@internetarchive/collection-browser 2.18.2 → 2.18.3-alpha-webdev7768.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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/collection-browser.js +682 -682
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets.js +291 -274
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +6 -4
- package/dist/src/expanded-date-picker.js +64 -55
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +382 -382
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +139 -139
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +118 -118
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +289 -289
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +200 -200
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +117 -117
- package/renovate.json +6 -6
- package/src/collection-browser.ts +2712 -2712
- package/src/collection-facets.ts +990 -966
- package/src/expanded-date-picker.ts +191 -175
- package/src/models.ts +822 -822
- package/src/sort-filter-bar/sort-filter-bar.ts +1189 -1189
- package/src/tiles/grid/item-tile.ts +339 -339
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +129 -129
- package/src/tiles/list/tile-list.ts +688 -688
- package/src/tiles/tile-dispatcher.ts +486 -486
- package/test/sort-filter-bar/sort-filter-bar.test.ts +692 -692
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -77,27 +77,27 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
77
77
|
// Added data-testid for Playwright testing
|
|
78
78
|
// Using facet-group class and aria-labels is not ideal for Playwright locator
|
|
79
79
|
const datePickerLabelId = 'date-picker-label';
|
|
80
|
-
return html `
|
|
81
|
-
<div id="container" class=${containerClasses}>
|
|
80
|
+
return html `
|
|
81
|
+
<div id="container" class=${containerClasses}>
|
|
82
82
|
${this.showHistogramDatePicker &&
|
|
83
83
|
(this.histogramAggregation || this.histogramAggregationLoading)
|
|
84
|
-
? html `
|
|
85
|
-
<section
|
|
86
|
-
class="facet-group"
|
|
87
|
-
aria-labelledby=${datePickerLabelId}
|
|
88
|
-
data-testid="facet-group-header-label-date-picker"
|
|
89
|
-
>
|
|
90
|
-
<h3 id=${datePickerLabelId}>
|
|
91
|
-
Year Published <span class="sr-only">range filter</span>
|
|
92
|
-
${this.expandDatePickerBtnTemplate}
|
|
93
|
-
</h3>
|
|
94
|
-
${this.histogramTemplate}
|
|
95
|
-
</section>
|
|
84
|
+
? html `
|
|
85
|
+
<section
|
|
86
|
+
class="facet-group"
|
|
87
|
+
aria-labelledby=${datePickerLabelId}
|
|
88
|
+
data-testid="facet-group-header-label-date-picker"
|
|
89
|
+
>
|
|
90
|
+
<h3 id=${datePickerLabelId}>
|
|
91
|
+
Year Published <span class="sr-only">range filter</span>
|
|
92
|
+
${this.expandDatePickerBtnTemplate}
|
|
93
|
+
</h3>
|
|
94
|
+
${this.histogramTemplate}
|
|
95
|
+
</section>
|
|
96
96
|
`
|
|
97
|
-
: nothing}
|
|
98
|
-
${this.collectionPartOfTemplate}
|
|
99
|
-
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
100
|
-
</div>
|
|
97
|
+
: nothing}
|
|
98
|
+
${this.collectionPartOfTemplate}
|
|
99
|
+
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
100
|
+
</div>
|
|
101
101
|
`;
|
|
102
102
|
}
|
|
103
103
|
get collectionPartOfTemplate() {
|
|
@@ -108,31 +108,31 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
108
108
|
// Added data-testid for Playwright testing
|
|
109
109
|
// Using className and aria-labels is not ideal for Playwright locator
|
|
110
110
|
const headingId = 'partof-heading';
|
|
111
|
-
return html `
|
|
112
|
-
<section
|
|
113
|
-
class="facet-group partof-collections"
|
|
114
|
-
aria-labelledby=${headingId}
|
|
115
|
-
data-testid="facet-group-partof-collections"
|
|
116
|
-
>
|
|
117
|
-
<div class="facet-group-header">
|
|
118
|
-
<h3 id=${headingId}>${msg('Part Of')}</h3>
|
|
119
|
-
</div>
|
|
120
|
-
<ul>
|
|
111
|
+
return html `
|
|
112
|
+
<section
|
|
113
|
+
class="facet-group partof-collections"
|
|
114
|
+
aria-labelledby=${headingId}
|
|
115
|
+
data-testid="facet-group-partof-collections"
|
|
116
|
+
>
|
|
117
|
+
<div class="facet-group-header">
|
|
118
|
+
<h3 id=${headingId}>${msg('Part Of')}</h3>
|
|
119
|
+
</div>
|
|
120
|
+
<ul>
|
|
121
121
|
${map(this.parentCollections, collxn => {
|
|
122
122
|
var _a, _b;
|
|
123
123
|
const collectionURL = `${this.baseNavigationUrl}${this.collectionPagePath}${collxn}`;
|
|
124
|
-
return html ` <li>
|
|
125
|
-
<a
|
|
126
|
-
href=${collectionURL}
|
|
127
|
-
data-id=${collxn}
|
|
128
|
-
@click=${this.partOfCollectionClicked}
|
|
129
|
-
>
|
|
130
|
-
${(_b = (_a = this.collectionTitles) === null || _a === void 0 ? void 0 : _a.get(collxn)) !== null && _b !== void 0 ? _b : collxn}
|
|
131
|
-
</a>
|
|
124
|
+
return html ` <li>
|
|
125
|
+
<a
|
|
126
|
+
href=${collectionURL}
|
|
127
|
+
data-id=${collxn}
|
|
128
|
+
@click=${this.partOfCollectionClicked}
|
|
129
|
+
>
|
|
130
|
+
${(_b = (_a = this.collectionTitles) === null || _a === void 0 ? void 0 : _a.get(collxn)) !== null && _b !== void 0 ? _b : collxn}
|
|
131
|
+
</a>
|
|
132
132
|
</li>`;
|
|
133
|
-
})}
|
|
134
|
-
</ul>
|
|
135
|
-
</section>
|
|
133
|
+
})}
|
|
134
|
+
</ul>
|
|
135
|
+
</section>
|
|
136
136
|
`;
|
|
137
137
|
}
|
|
138
138
|
partOfCollectionClicked(e) {
|
|
@@ -161,21 +161,34 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
161
161
|
const yearInterval = (_e = aggregation.interval) !== null && _e !== void 0 ? _e : 1;
|
|
162
162
|
const monthInterval = (_f = aggregation.interval_in_months) !== null && _f !== void 0 ? _f : 12;
|
|
163
163
|
const zeroPadMonth = (month) => month.toString().padStart(2, '0');
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
// The date picker is configured differently for TV search, allowing month-level resolution
|
|
165
|
+
if (this.isTvSearch) {
|
|
166
|
+
// Whether the bucket interval is less than a year
|
|
167
|
+
// (i.e., requires individual months to be handled & labeled)
|
|
168
|
+
const mustHandleMonths = monthInterval < 12;
|
|
169
|
+
return {
|
|
170
|
+
buckets: aggregation.buckets,
|
|
171
|
+
dateFormat: 'YYYY-MM',
|
|
172
|
+
tooltipDateFormat: mustHandleMonths ? 'MMM YYYY' : 'YYYY',
|
|
173
|
+
tooltipLabel: 'broadcast',
|
|
174
|
+
binSnapping: (mustHandleMonths
|
|
175
|
+
? 'month'
|
|
176
|
+
: 'year'),
|
|
177
|
+
barScaling: 'linear',
|
|
178
|
+
minDate: `${firstYear}-${zeroPadMonth(firstMonth)}`,
|
|
179
|
+
maxDate: `${lastYear}-${zeroPadMonth(lastMonth + monthInterval - 1)}`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// All other search types use the same configuration
|
|
172
183
|
return {
|
|
173
184
|
buckets: aggregation.buckets,
|
|
174
|
-
dateFormat:
|
|
175
|
-
tooltipDateFormat:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
185
|
+
dateFormat: 'YYYY',
|
|
186
|
+
tooltipDateFormat: 'YYYY',
|
|
187
|
+
tooltipLabel: 'item',
|
|
188
|
+
binSnapping: 'year',
|
|
189
|
+
barScaling: 'logarithmic',
|
|
190
|
+
minDate: `${firstYear}`,
|
|
191
|
+
maxDate: `${lastYear + yearInterval - 1}`,
|
|
179
192
|
};
|
|
180
193
|
}
|
|
181
194
|
/**
|
|
@@ -186,7 +199,7 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
186
199
|
const { histogramProps } = this;
|
|
187
200
|
if (!histogramProps)
|
|
188
201
|
return;
|
|
189
|
-
const { buckets, dateFormat, tooltipDateFormat, binSnapping, minDate, maxDate, } = histogramProps;
|
|
202
|
+
const { buckets, dateFormat, tooltipDateFormat, tooltipLabel, binSnapping, barScaling, minDate, maxDate, } = histogramProps;
|
|
190
203
|
// Because the modal manager does not clear its DOM content after being closed,
|
|
191
204
|
// it may try to render the exact same date picker template when it is reopened.
|
|
192
205
|
// And because it isn't actually a descendent of this collection-facets component,
|
|
@@ -202,22 +215,24 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
202
215
|
expandedDatePicker.maxSelectedDate = this.maxSelectedDate;
|
|
203
216
|
}
|
|
204
217
|
};
|
|
205
|
-
const customModalContent = html `
|
|
206
|
-
<expanded-date-picker
|
|
207
|
-
${ref(expandedDatePickerChanged)}
|
|
208
|
-
.minDate=${minDate}
|
|
209
|
-
.maxDate=${maxDate}
|
|
210
|
-
.minSelectedDate=${this.minSelectedDate}
|
|
211
|
-
.maxSelectedDate=${this.maxSelectedDate}
|
|
212
|
-
.
|
|
213
|
-
.
|
|
214
|
-
.
|
|
215
|
-
.
|
|
216
|
-
.
|
|
217
|
-
.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
const customModalContent = html `
|
|
219
|
+
<expanded-date-picker
|
|
220
|
+
${ref(expandedDatePickerChanged)}
|
|
221
|
+
.minDate=${minDate}
|
|
222
|
+
.maxDate=${maxDate}
|
|
223
|
+
.minSelectedDate=${this.minSelectedDate}
|
|
224
|
+
.maxSelectedDate=${this.maxSelectedDate}
|
|
225
|
+
.customDateFormat=${dateFormat}
|
|
226
|
+
.customTooltipDateFormat=${tooltipDateFormat}
|
|
227
|
+
.customTooltipLabel=${tooltipLabel}
|
|
228
|
+
.binSnapping=${binSnapping}
|
|
229
|
+
.barScaling=${barScaling}
|
|
230
|
+
.buckets=${buckets}
|
|
231
|
+
.modalManager=${this.modalManager}
|
|
232
|
+
.analyticsHandler=${this.analyticsHandler}
|
|
233
|
+
@histogramDateRangeApplied=${this.histogramDateRangeUpdated}
|
|
234
|
+
@modalClosed=${this.handleExpandedDatePickerClosed}
|
|
235
|
+
></expanded-date-picker>
|
|
221
236
|
`;
|
|
222
237
|
const config = new ModalConfig({
|
|
223
238
|
bodyColor: '#fff',
|
|
@@ -256,12 +271,12 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
256
271
|
*/
|
|
257
272
|
get expandDatePickerBtnTemplate() {
|
|
258
273
|
return this.allowExpandingDatePicker && !this.facetsLoading
|
|
259
|
-
? html `<button
|
|
260
|
-
class="expand-date-picker-btn"
|
|
261
|
-
aria-hidden="true"
|
|
262
|
-
@click=${this.showDatePickerModal}
|
|
263
|
-
>
|
|
264
|
-
${expandIcon}
|
|
274
|
+
? html `<button
|
|
275
|
+
class="expand-date-picker-btn"
|
|
276
|
+
aria-hidden="true"
|
|
277
|
+
@click=${this.showDatePickerModal}
|
|
278
|
+
>
|
|
279
|
+
${expandIcon}
|
|
265
280
|
</button>`
|
|
266
281
|
: nothing;
|
|
267
282
|
}
|
|
@@ -273,25 +288,27 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
273
288
|
const { histogramProps } = this;
|
|
274
289
|
if (!histogramProps)
|
|
275
290
|
return nothing;
|
|
276
|
-
const { buckets, dateFormat, tooltipDateFormat, binSnapping, minDate, maxDate, } = histogramProps;
|
|
277
|
-
return html `
|
|
278
|
-
<histogram-date-range
|
|
279
|
-
class=${this.isTvSearch ? 'wide-inputs' : nothing}
|
|
280
|
-
.minDate=${minDate}
|
|
281
|
-
.maxDate=${maxDate}
|
|
282
|
-
.minSelectedDate=${(_a = this.minSelectedDate) !== null && _a !== void 0 ? _a : minDate}
|
|
283
|
-
.maxSelectedDate=${(_b = this.maxSelectedDate) !== null && _b !== void 0 ? _b : maxDate}
|
|
284
|
-
.updateDelay=${100}
|
|
285
|
-
.dateFormat=${dateFormat}
|
|
286
|
-
.tooltipDateFormat=${tooltipDateFormat}
|
|
287
|
-
.
|
|
288
|
-
.
|
|
289
|
-
|
|
291
|
+
const { buckets, dateFormat, tooltipDateFormat, tooltipLabel, binSnapping, barScaling, minDate, maxDate, } = histogramProps;
|
|
292
|
+
return html `
|
|
293
|
+
<histogram-date-range
|
|
294
|
+
class=${this.isTvSearch ? 'wide-inputs' : nothing}
|
|
295
|
+
.minDate=${minDate}
|
|
296
|
+
.maxDate=${maxDate}
|
|
297
|
+
.minSelectedDate=${(_a = this.minSelectedDate) !== null && _a !== void 0 ? _a : minDate}
|
|
298
|
+
.maxSelectedDate=${(_b = this.maxSelectedDate) !== null && _b !== void 0 ? _b : maxDate}
|
|
299
|
+
.updateDelay=${100}
|
|
300
|
+
.dateFormat=${dateFormat}
|
|
301
|
+
.tooltipDateFormat=${tooltipDateFormat}
|
|
302
|
+
.tooltipLabel=${tooltipLabel}
|
|
303
|
+
.binSnapping=${binSnapping}
|
|
304
|
+
.barScaling=${barScaling}
|
|
305
|
+
.bins=${buckets}
|
|
306
|
+
missingDataMessage="..."
|
|
290
307
|
.width=${this.collapsableFacets && this.contentWidth
|
|
291
308
|
? this.contentWidth
|
|
292
|
-
: 180}
|
|
293
|
-
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
294
|
-
></histogram-date-range>
|
|
309
|
+
: 180}
|
|
310
|
+
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
311
|
+
></histogram-date-range>
|
|
295
312
|
`;
|
|
296
313
|
}
|
|
297
314
|
/**
|
|
@@ -467,8 +484,8 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
467
484
|
return nothing;
|
|
468
485
|
const { key } = facetGroup;
|
|
469
486
|
const isOpen = this.openFacets[key];
|
|
470
|
-
const collapser = html `
|
|
471
|
-
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
487
|
+
const collapser = html `
|
|
488
|
+
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
472
489
|
`;
|
|
473
490
|
const toggleCollapsed = () => {
|
|
474
491
|
const newOpenFacets = { ...this.openFacets };
|
|
@@ -478,40 +495,40 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
478
495
|
// Added data-testid for Playwright testing
|
|
479
496
|
// Using className and aria-labels is not ideal for Playwright locator
|
|
480
497
|
const headerId = `facet-group-header-label-${facetGroup.key}`;
|
|
481
|
-
return html `
|
|
482
|
-
<section
|
|
483
|
-
class="facet-group ${this.collapsableFacets ? 'mobile' : ''}"
|
|
484
|
-
aria-labelledby=${headerId}
|
|
485
|
-
data-testid=${headerId}
|
|
486
|
-
>
|
|
487
|
-
<div class="facet-group-header">
|
|
488
|
-
<h3
|
|
489
|
-
id=${headerId}
|
|
490
|
-
@click=${toggleCollapsed}
|
|
491
|
-
@keyup=${toggleCollapsed}
|
|
492
|
-
>
|
|
493
|
-
${this.collapsableFacets ? collapser : nothing} ${facetGroup.title}
|
|
494
|
-
<span class="sr-only">filters</span>
|
|
495
|
-
</h3>
|
|
496
|
-
</div>
|
|
497
|
-
<div
|
|
498
|
-
class="facet-group-content ${isOpen ? 'open' : ''}"
|
|
499
|
-
data-testid="facet-group-content-${facetGroup.key}"
|
|
500
|
-
>
|
|
498
|
+
return html `
|
|
499
|
+
<section
|
|
500
|
+
class="facet-group ${this.collapsableFacets ? 'mobile' : ''}"
|
|
501
|
+
aria-labelledby=${headerId}
|
|
502
|
+
data-testid=${headerId}
|
|
503
|
+
>
|
|
504
|
+
<div class="facet-group-header">
|
|
505
|
+
<h3
|
|
506
|
+
id=${headerId}
|
|
507
|
+
@click=${toggleCollapsed}
|
|
508
|
+
@keyup=${toggleCollapsed}
|
|
509
|
+
>
|
|
510
|
+
${this.collapsableFacets ? collapser : nothing} ${facetGroup.title}
|
|
511
|
+
<span class="sr-only">filters</span>
|
|
512
|
+
</h3>
|
|
513
|
+
</div>
|
|
514
|
+
<div
|
|
515
|
+
class="facet-group-content ${isOpen ? 'open' : ''}"
|
|
516
|
+
data-testid="facet-group-content-${facetGroup.key}"
|
|
517
|
+
>
|
|
501
518
|
${this.facetsLoading
|
|
502
519
|
? this.getTombstoneFacetGroupTemplate()
|
|
503
|
-
: html `
|
|
504
|
-
${this.getFacetTemplate(facetGroup)}
|
|
505
|
-
${this.searchMoreFacetsLink(facetGroup)}
|
|
506
|
-
`}
|
|
507
|
-
</div>
|
|
508
|
-
</section>
|
|
520
|
+
: html `
|
|
521
|
+
${this.getFacetTemplate(facetGroup)}
|
|
522
|
+
${this.searchMoreFacetsLink(facetGroup)}
|
|
523
|
+
`}
|
|
524
|
+
</div>
|
|
525
|
+
</section>
|
|
509
526
|
`;
|
|
510
527
|
}
|
|
511
528
|
getTombstoneFacetGroupTemplate() {
|
|
512
529
|
// Render five tombstone rows
|
|
513
|
-
return html `
|
|
514
|
-
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
530
|
+
return html `
|
|
531
|
+
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
515
532
|
`;
|
|
516
533
|
}
|
|
517
534
|
/**
|
|
@@ -536,8 +553,8 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
536
553
|
const facetSort = defaultFacetSort[facetGroup.key];
|
|
537
554
|
// Added data-testid for Playwright testing
|
|
538
555
|
// Using the className is not ideal for Playwright locator
|
|
539
|
-
return html `<button
|
|
540
|
-
class="more-link"
|
|
556
|
+
return html `<button
|
|
557
|
+
class="more-link"
|
|
541
558
|
@click=${() => {
|
|
542
559
|
var _a;
|
|
543
560
|
this.showMoreFacetsModal(facetGroup, facetSort);
|
|
@@ -547,29 +564,29 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
547
564
|
label: facetGroup.key,
|
|
548
565
|
});
|
|
549
566
|
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
550
|
-
}}
|
|
551
|
-
data-testid="more-link-btn"
|
|
552
|
-
>
|
|
553
|
-
More...
|
|
567
|
+
}}
|
|
568
|
+
data-testid="more-link-btn"
|
|
569
|
+
>
|
|
570
|
+
More...
|
|
554
571
|
</button>`;
|
|
555
572
|
}
|
|
556
573
|
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
557
574
|
var _a, _b;
|
|
558
|
-
const customModalContent = html `
|
|
559
|
-
<more-facets-content
|
|
560
|
-
.analyticsHandler=${this.analyticsHandler}
|
|
561
|
-
.facetKey=${facetGroup.key}
|
|
562
|
-
.query=${this.query}
|
|
563
|
-
.filterMap=${this.filterMap}
|
|
564
|
-
.pageSpecifierParams=${this.pageSpecifierParams}
|
|
565
|
-
.modalManager=${this.modalManager}
|
|
566
|
-
.searchService=${this.searchService}
|
|
567
|
-
.searchType=${this.searchType}
|
|
568
|
-
.collectionTitles=${this.collectionTitles}
|
|
569
|
-
.tvChannelAliases=${this.tvChannelAliases}
|
|
570
|
-
.selectedFacets=${this.selectedFacets}
|
|
571
|
-
.sortedBy=${sortedBy}
|
|
572
|
-
.isTvSearch=${this.isTvSearch}
|
|
575
|
+
const customModalContent = html `
|
|
576
|
+
<more-facets-content
|
|
577
|
+
.analyticsHandler=${this.analyticsHandler}
|
|
578
|
+
.facetKey=${facetGroup.key}
|
|
579
|
+
.query=${this.query}
|
|
580
|
+
.filterMap=${this.filterMap}
|
|
581
|
+
.pageSpecifierParams=${this.pageSpecifierParams}
|
|
582
|
+
.modalManager=${this.modalManager}
|
|
583
|
+
.searchService=${this.searchService}
|
|
584
|
+
.searchType=${this.searchType}
|
|
585
|
+
.collectionTitles=${this.collectionTitles}
|
|
586
|
+
.tvChannelAliases=${this.tvChannelAliases}
|
|
587
|
+
.selectedFacets=${this.selectedFacets}
|
|
588
|
+
.sortedBy=${sortedBy}
|
|
589
|
+
.isTvSearch=${this.isTvSearch}
|
|
573
590
|
@facetsChanged=${(e) => {
|
|
574
591
|
const event = new CustomEvent('facetsChanged', {
|
|
575
592
|
detail: e.detail,
|
|
@@ -577,9 +594,9 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
577
594
|
composed: true,
|
|
578
595
|
});
|
|
579
596
|
this.dispatchEvent(event);
|
|
580
|
-
}}
|
|
581
|
-
>
|
|
582
|
-
</more-facets-content>
|
|
597
|
+
}}
|
|
598
|
+
>
|
|
599
|
+
</more-facets-content>
|
|
583
600
|
`;
|
|
584
601
|
const config = new ModalConfig({
|
|
585
602
|
bodyColor: '#fff',
|
|
@@ -602,12 +619,12 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
602
619
|
* Generate the list template for each bucket in a facet group
|
|
603
620
|
*/
|
|
604
621
|
getFacetTemplate(facetGroup) {
|
|
605
|
-
return html `
|
|
606
|
-
<facets-template
|
|
607
|
-
.collectionPagePath=${this.collectionPagePath}
|
|
608
|
-
.facetGroup=${facetGroup}
|
|
609
|
-
.selectedFacets=${this.selectedFacets}
|
|
610
|
-
.collectionTitles=${this.collectionTitles}
|
|
622
|
+
return html `
|
|
623
|
+
<facets-template
|
|
624
|
+
.collectionPagePath=${this.collectionPagePath}
|
|
625
|
+
.facetGroup=${facetGroup}
|
|
626
|
+
.selectedFacets=${this.selectedFacets}
|
|
627
|
+
.collectionTitles=${this.collectionTitles}
|
|
611
628
|
@facetClick=${(e) => {
|
|
612
629
|
this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, facetGroup.key, e.detail.bucket, true);
|
|
613
630
|
const event = new CustomEvent('facetsChanged', {
|
|
@@ -616,133 +633,133 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
616
633
|
composed: true,
|
|
617
634
|
});
|
|
618
635
|
this.dispatchEvent(event);
|
|
619
|
-
}}
|
|
620
|
-
></facets-template>
|
|
636
|
+
}}
|
|
637
|
+
></facets-template>
|
|
621
638
|
`;
|
|
622
639
|
}
|
|
623
640
|
static get styles() {
|
|
624
641
|
return [
|
|
625
642
|
srOnlyStyle,
|
|
626
|
-
css `
|
|
627
|
-
a:link {
|
|
628
|
-
text-decoration: none;
|
|
629
|
-
color: var(--ia-theme-link-color, #4b64ff);
|
|
630
|
-
}
|
|
631
|
-
a:link:hover {
|
|
632
|
-
text-decoration: underline;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
#container.loading {
|
|
636
|
-
opacity: 0.5;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
#container.managing {
|
|
640
|
-
opacity: 0.3;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
.histogram-loading-indicator {
|
|
644
|
-
width: 100%;
|
|
645
|
-
height: 2.25rem;
|
|
646
|
-
margin-top: 1.75rem;
|
|
647
|
-
font-size: 1.4rem;
|
|
648
|
-
text-align: center;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
.collapser {
|
|
652
|
-
display: inline-block;
|
|
653
|
-
cursor: pointer;
|
|
654
|
-
width: 10px;
|
|
655
|
-
height: 10px;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
.collapser svg {
|
|
659
|
-
transition: transform 0.2s ease-in-out;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
.collapser.open svg {
|
|
663
|
-
transform: rotate(90deg);
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
.facet-group:not(:last-child) {
|
|
667
|
-
margin-bottom: 2rem;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.facet-group h3 {
|
|
671
|
-
margin-bottom: 0.7rem;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
.facet-group.mobile h3 {
|
|
675
|
-
cursor: pointer;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.facet-group-header {
|
|
679
|
-
display: flex;
|
|
680
|
-
margin-bottom: 0.7rem;
|
|
681
|
-
justify-content: space-between;
|
|
682
|
-
border-bottom: 1px solid rgb(232, 232, 232);
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
.facet-group-content {
|
|
686
|
-
transition: max-height 0.2s ease-in-out;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
.facet-group.mobile .facet-group-content {
|
|
690
|
-
max-height: 0;
|
|
691
|
-
overflow: hidden;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.facet-group.mobile .facet-group-content.open {
|
|
695
|
-
max-height: 2000px;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
.partof-collections ul {
|
|
699
|
-
list-style-type: none;
|
|
700
|
-
padding: 0;
|
|
701
|
-
font-size: 1.2rem;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
h3 {
|
|
705
|
-
font-size: 1.4rem;
|
|
706
|
-
margin: 0;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
.more-link {
|
|
710
|
-
font-size: 1.2rem;
|
|
711
|
-
text-decoration: none;
|
|
712
|
-
padding: 0;
|
|
713
|
-
background: inherit;
|
|
714
|
-
border: 0;
|
|
715
|
-
color: var(--ia-theme-link-color, #4b64ff);
|
|
716
|
-
cursor: pointer;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
#date-picker-label {
|
|
720
|
-
display: flex;
|
|
721
|
-
justify-content: space-between;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
.expand-date-picker-btn {
|
|
725
|
-
margin: 0;
|
|
726
|
-
padding: 0;
|
|
727
|
-
border: 0;
|
|
728
|
-
appearance: none;
|
|
729
|
-
background: none;
|
|
730
|
-
cursor: pointer;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
.expand-date-picker-btn > svg {
|
|
734
|
-
width: 14px;
|
|
735
|
-
height: 14px;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
.sorting-icon {
|
|
739
|
-
height: 15px;
|
|
740
|
-
cursor: pointer;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
histogram-date-range.wide-inputs {
|
|
744
|
-
--histogramDateRangeInputWidth: 4.8rem;
|
|
745
|
-
}
|
|
643
|
+
css `
|
|
644
|
+
a:link {
|
|
645
|
+
text-decoration: none;
|
|
646
|
+
color: var(--ia-theme-link-color, #4b64ff);
|
|
647
|
+
}
|
|
648
|
+
a:link:hover {
|
|
649
|
+
text-decoration: underline;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
#container.loading {
|
|
653
|
+
opacity: 0.5;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
#container.managing {
|
|
657
|
+
opacity: 0.3;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.histogram-loading-indicator {
|
|
661
|
+
width: 100%;
|
|
662
|
+
height: 2.25rem;
|
|
663
|
+
margin-top: 1.75rem;
|
|
664
|
+
font-size: 1.4rem;
|
|
665
|
+
text-align: center;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.collapser {
|
|
669
|
+
display: inline-block;
|
|
670
|
+
cursor: pointer;
|
|
671
|
+
width: 10px;
|
|
672
|
+
height: 10px;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.collapser svg {
|
|
676
|
+
transition: transform 0.2s ease-in-out;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.collapser.open svg {
|
|
680
|
+
transform: rotate(90deg);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.facet-group:not(:last-child) {
|
|
684
|
+
margin-bottom: 2rem;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.facet-group h3 {
|
|
688
|
+
margin-bottom: 0.7rem;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.facet-group.mobile h3 {
|
|
692
|
+
cursor: pointer;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.facet-group-header {
|
|
696
|
+
display: flex;
|
|
697
|
+
margin-bottom: 0.7rem;
|
|
698
|
+
justify-content: space-between;
|
|
699
|
+
border-bottom: 1px solid rgb(232, 232, 232);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.facet-group-content {
|
|
703
|
+
transition: max-height 0.2s ease-in-out;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.facet-group.mobile .facet-group-content {
|
|
707
|
+
max-height: 0;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.facet-group.mobile .facet-group-content.open {
|
|
712
|
+
max-height: 2000px;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.partof-collections ul {
|
|
716
|
+
list-style-type: none;
|
|
717
|
+
padding: 0;
|
|
718
|
+
font-size: 1.2rem;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
h3 {
|
|
722
|
+
font-size: 1.4rem;
|
|
723
|
+
margin: 0;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.more-link {
|
|
727
|
+
font-size: 1.2rem;
|
|
728
|
+
text-decoration: none;
|
|
729
|
+
padding: 0;
|
|
730
|
+
background: inherit;
|
|
731
|
+
border: 0;
|
|
732
|
+
color: var(--ia-theme-link-color, #4b64ff);
|
|
733
|
+
cursor: pointer;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
#date-picker-label {
|
|
737
|
+
display: flex;
|
|
738
|
+
justify-content: space-between;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.expand-date-picker-btn {
|
|
742
|
+
margin: 0;
|
|
743
|
+
padding: 0;
|
|
744
|
+
border: 0;
|
|
745
|
+
appearance: none;
|
|
746
|
+
background: none;
|
|
747
|
+
cursor: pointer;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.expand-date-picker-btn > svg {
|
|
751
|
+
width: 14px;
|
|
752
|
+
height: 14px;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.sorting-icon {
|
|
756
|
+
height: 15px;
|
|
757
|
+
cursor: pointer;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
histogram-date-range.wide-inputs {
|
|
761
|
+
--histogramDateRangeInputWidth: 4.8rem;
|
|
762
|
+
}
|
|
746
763
|
`,
|
|
747
764
|
];
|
|
748
765
|
}
|