@internetarchive/collection-browser 3.1.1-alpha-webdev6778.7 → 3.1.1-alpha-webdev6778.9
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.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/models.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +75 -75
- 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 +54 -54
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.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 +1 -3
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/expanded-date-picker.js +52 -52
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/manage/manage-bar.js +77 -77
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +376 -376
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +36 -36
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.js +42 -42
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +119 -119
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +97 -97
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/utils/analytics-events.js.map +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/test/collection-browser.test.js +187 -187
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +23 -23
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +20 -20
- package/dist/test/collection-facets.test.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/dist/test/tiles/grid/item-tile.test.js +64 -64
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +57 -57
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/package.json +2 -2
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +1 -1
- package/src/collection-facets/facet-row.ts +296 -296
- package/src/collection-facets/models.ts +10 -10
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +437 -437
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +185 -185
- package/src/data-source/collection-browser-data-source-interface.ts +333 -333
- package/src/data-source/collection-browser-data-source.ts +2 -4
- package/src/data-source/models.ts +43 -43
- package/src/expanded-date-picker.ts +191 -191
- package/src/manage/manage-bar.ts +247 -247
- package/src/models.ts +870 -870
- package/src/sort-filter-bar/sort-filter-bar.ts +1283 -1283
- package/src/tiles/base-tile-component.ts +53 -53
- package/src/tiles/grid/account-tile.ts +112 -112
- package/src/tiles/grid/search-tile.ts +90 -90
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
- package/src/tiles/list/tile-list-compact.ts +236 -236
- package/src/utils/analytics-events.ts +29 -29
- package/src/utils/format-date.ts +42 -42
- package/test/collection-browser.test.ts +2359 -2359
- package/test/collection-facets/facet-row.test.ts +375 -375
- package/test/collection-facets.test.ts +928 -928
- package/test/sort-filter-bar/sort-filter-bar.test.ts +885 -885
- package/test/tiles/grid/item-tile.test.ts +464 -464
- package/test/tiles/list/tile-list-compact.test.ts +228 -228
- package/test/utils/format-date.test.ts +39 -39
|
@@ -84,36 +84,36 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
return html `
|
|
88
|
-
<div id="container">
|
|
89
|
-
<section id="sort-bar" aria-label="Sorting options">
|
|
90
|
-
<slot name="sort-options-left"></slot>
|
|
91
|
-
<div id="sort-options">
|
|
87
|
+
return html `
|
|
88
|
+
<div id="container">
|
|
89
|
+
<section id="sort-bar" aria-label="Sorting options">
|
|
90
|
+
<slot name="sort-options-left"></slot>
|
|
91
|
+
<div id="sort-options">
|
|
92
92
|
${!this.enableSortOptionsSlot
|
|
93
|
-
? html `
|
|
94
|
-
<div class="sort-direction-container">
|
|
95
|
-
${this.sortDirectionSelectorTemplate}
|
|
96
|
-
</div>
|
|
97
|
-
<span class="sort-by-text">${msg('Sort by:')}</span>
|
|
98
|
-
<div id="sort-selector-container">
|
|
99
|
-
${this.mobileSortSelectorTemplate}
|
|
100
|
-
${this.desktopSortSelectorTemplate}
|
|
101
|
-
</div>
|
|
93
|
+
? html `
|
|
94
|
+
<div class="sort-direction-container">
|
|
95
|
+
${this.sortDirectionSelectorTemplate}
|
|
96
|
+
</div>
|
|
97
|
+
<span class="sort-by-text">${msg('Sort by:')}</span>
|
|
98
|
+
<div id="sort-selector-container">
|
|
99
|
+
${this.mobileSortSelectorTemplate}
|
|
100
|
+
${this.desktopSortSelectorTemplate}
|
|
101
|
+
</div>
|
|
102
102
|
`
|
|
103
|
-
: html `<slot name="sort-options"></slot>`}
|
|
104
|
-
</div>
|
|
105
|
-
<slot name="sort-options-right"></slot>
|
|
106
|
-
|
|
103
|
+
: html `<slot name="sort-options"></slot>`}
|
|
104
|
+
</div>
|
|
105
|
+
<slot name="sort-options-right"></slot>
|
|
106
|
+
|
|
107
107
|
${this.suppressDisplayModes
|
|
108
108
|
? nothing
|
|
109
|
-
: html `<div id="display-style-selector">
|
|
110
|
-
${this.displayOptionTemplate}
|
|
111
|
-
</div>`}
|
|
112
|
-
</section>
|
|
113
|
-
|
|
114
|
-
${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
|
|
115
|
-
${this.alphaBarTemplate}
|
|
116
|
-
</div>
|
|
109
|
+
: html `<div id="display-style-selector">
|
|
110
|
+
${this.displayOptionTemplate}
|
|
111
|
+
</div>`}
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
|
|
115
|
+
${this.alphaBarTemplate}
|
|
116
|
+
</div>
|
|
117
117
|
`;
|
|
118
118
|
}
|
|
119
119
|
willUpdate(changed) {
|
|
@@ -248,15 +248,15 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
248
248
|
get sortDirectionSelectorTemplate() {
|
|
249
249
|
const oppositeSortDirectionReadable = this.sortDirection === 'asc' ? 'descending' : 'ascending';
|
|
250
250
|
const srLabel = `Change to ${oppositeSortDirectionReadable} sort`;
|
|
251
|
-
return html `
|
|
252
|
-
<button
|
|
253
|
-
class="sort-direction-selector"
|
|
254
|
-
?disabled=${!this.canChangeSortDirection}
|
|
255
|
-
@click=${this.handleSortDirectionClicked}
|
|
256
|
-
>
|
|
257
|
-
<span class="sr-only">${srLabel}</span>
|
|
258
|
-
${this.sortDirectionIcon}
|
|
259
|
-
</button>
|
|
251
|
+
return html `
|
|
252
|
+
<button
|
|
253
|
+
class="sort-direction-selector"
|
|
254
|
+
?disabled=${!this.canChangeSortDirection}
|
|
255
|
+
@click=${this.handleSortDirectionClicked}
|
|
256
|
+
>
|
|
257
|
+
<span class="sr-only">${srLabel}</span>
|
|
258
|
+
${this.sortDirectionIcon}
|
|
259
|
+
</button>
|
|
260
260
|
`;
|
|
261
261
|
}
|
|
262
262
|
/** Template to render the sort direction button's icon in the correct current state */
|
|
@@ -266,37 +266,37 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
266
266
|
return html `<div class="sort-direction-icon">${sortDisabledIcon}</div>`;
|
|
267
267
|
}
|
|
268
268
|
// For all other sorts, show the ascending/descending direction
|
|
269
|
-
return html `
|
|
270
|
-
<div class="sort-direction-icon">
|
|
271
|
-
${this.finalizedSortDirection === 'asc' ? sortUpIcon : sortDownIcon}
|
|
272
|
-
</div>
|
|
269
|
+
return html `
|
|
270
|
+
<div class="sort-direction-icon">
|
|
271
|
+
${this.finalizedSortDirection === 'asc' ? sortUpIcon : sortDownIcon}
|
|
272
|
+
</div>
|
|
273
273
|
`;
|
|
274
274
|
}
|
|
275
275
|
/** The template to render all the sort options in desktop view */
|
|
276
276
|
get desktopSortSelectorTemplate() {
|
|
277
|
-
return html `
|
|
278
|
-
<div
|
|
279
|
-
id="desktop-sort-container"
|
|
280
|
-
class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
|
|
281
|
-
>
|
|
282
|
-
<ul id="desktop-sort-selector">
|
|
283
|
-
<li>${this.relevanceSortSelectorTemplate}</li>
|
|
284
|
-
<li>${this.allViewsSortOptionsTemplate}</li>
|
|
285
|
-
<li>${this.titleSortSelectorTemplate}</li>
|
|
286
|
-
<li>${this.allDateSortOptionsTemplate}</li>
|
|
287
|
-
<li>${this.creatorSortSelectorTemplate}</li>
|
|
288
|
-
</ul>
|
|
289
|
-
</div>
|
|
277
|
+
return html `
|
|
278
|
+
<div
|
|
279
|
+
id="desktop-sort-container"
|
|
280
|
+
class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
|
|
281
|
+
>
|
|
282
|
+
<ul id="desktop-sort-selector">
|
|
283
|
+
<li>${this.relevanceSortSelectorTemplate}</li>
|
|
284
|
+
<li>${this.allViewsSortOptionsTemplate}</li>
|
|
285
|
+
<li>${this.titleSortSelectorTemplate}</li>
|
|
286
|
+
<li>${this.allDateSortOptionsTemplate}</li>
|
|
287
|
+
<li>${this.creatorSortSelectorTemplate}</li>
|
|
288
|
+
</ul>
|
|
289
|
+
</div>
|
|
290
290
|
`;
|
|
291
291
|
}
|
|
292
292
|
/** The template to render all the sort options in mobile view */
|
|
293
293
|
get mobileSortSelectorTemplate() {
|
|
294
294
|
const displayedOptions = Object.values(SORT_OPTIONS).filter(opt => opt.shownInSortBar && this.sortFieldAvailability[opt.field]);
|
|
295
|
-
return html `
|
|
296
|
-
<div
|
|
297
|
-
id="mobile-sort-container"
|
|
298
|
-
class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
|
|
299
|
-
>
|
|
295
|
+
return html `
|
|
296
|
+
<div
|
|
297
|
+
id="mobile-sort-container"
|
|
298
|
+
class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
|
|
299
|
+
>
|
|
300
300
|
${this.getSortDropdown({
|
|
301
301
|
displayName: SORT_OPTIONS[this.finalizedSortField].displayName,
|
|
302
302
|
id: 'mobile-dropdown',
|
|
@@ -308,8 +308,8 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
308
308
|
this.dropdownBackdropVisible = this.mobileDropdown.open;
|
|
309
309
|
this.mobileDropdown.classList.toggle('open', this.mobileDropdown.open);
|
|
310
310
|
},
|
|
311
|
-
})}
|
|
312
|
-
</div>
|
|
311
|
+
})}
|
|
312
|
+
</div>
|
|
313
313
|
`;
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
@@ -327,10 +327,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
327
327
|
const isSelected = this.finalizedSortField === sortField;
|
|
328
328
|
const displayName = SORT_OPTIONS[sortField].displayName;
|
|
329
329
|
const onSelected = (_a = options === null || options === void 0 ? void 0 : options.onSelected) !== null && _a !== void 0 ? _a : (() => this.clearAlphaBarFilters());
|
|
330
|
-
return html `
|
|
331
|
-
<button
|
|
332
|
-
class=${isSelected ? 'selected' : ''}
|
|
333
|
-
data-title=${displayName}
|
|
330
|
+
return html `
|
|
331
|
+
<button
|
|
332
|
+
class=${isSelected ? 'selected' : ''}
|
|
333
|
+
data-title=${displayName}
|
|
334
334
|
@click=${(e) => {
|
|
335
335
|
e.preventDefault();
|
|
336
336
|
this.dropdownBackdropVisible = false;
|
|
@@ -338,10 +338,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
338
338
|
onSelected === null || onSelected === void 0 ? void 0 : onSelected(e);
|
|
339
339
|
this.setSelectedSort(sortField);
|
|
340
340
|
}
|
|
341
|
-
}}
|
|
342
|
-
>
|
|
343
|
-
${displayName}
|
|
344
|
-
</button>
|
|
341
|
+
}}
|
|
342
|
+
>
|
|
343
|
+
${displayName}
|
|
344
|
+
</button>
|
|
345
345
|
`;
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
@@ -360,24 +360,24 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
360
360
|
*/
|
|
361
361
|
getSortDropdown(options) {
|
|
362
362
|
var _a, _b, _c, _d;
|
|
363
|
-
return html `
|
|
364
|
-
<ia-dropdown
|
|
365
|
-
id=${options.id}
|
|
366
|
-
class=${options.selected ? 'selected' : ''}
|
|
367
|
-
displayCaret
|
|
368
|
-
closeOnSelect
|
|
369
|
-
includeSelectedOption
|
|
370
|
-
.openViaButton=${options.selected}
|
|
371
|
-
.options=${options.dropdownOptions}
|
|
372
|
-
.selectedOption=${(_a = options.selectedOption) !== null && _a !== void 0 ? _a : ''}
|
|
373
|
-
@optionSelected=${(_b = options.onOptionSelected) !== null && _b !== void 0 ? _b : nothing}
|
|
374
|
-
@click=${(_c = options.onDropdownClick) !== null && _c !== void 0 ? _c : nothing}
|
|
375
|
-
>
|
|
376
|
-
<span
|
|
377
|
-
class="dropdown-label"
|
|
378
|
-
slot="dropdown-label"
|
|
379
|
-
data-title=${options.displayName}
|
|
380
|
-
@click=${(_d = options.onLabelInteraction) !== null && _d !== void 0 ? _d : nothing}
|
|
363
|
+
return html `
|
|
364
|
+
<ia-dropdown
|
|
365
|
+
id=${options.id}
|
|
366
|
+
class=${options.selected ? 'selected' : ''}
|
|
367
|
+
displayCaret
|
|
368
|
+
closeOnSelect
|
|
369
|
+
includeSelectedOption
|
|
370
|
+
.openViaButton=${options.selected}
|
|
371
|
+
.options=${options.dropdownOptions}
|
|
372
|
+
.selectedOption=${(_a = options.selectedOption) !== null && _a !== void 0 ? _a : ''}
|
|
373
|
+
@optionSelected=${(_b = options.onOptionSelected) !== null && _b !== void 0 ? _b : nothing}
|
|
374
|
+
@click=${(_c = options.onDropdownClick) !== null && _c !== void 0 ? _c : nothing}
|
|
375
|
+
>
|
|
376
|
+
<span
|
|
377
|
+
class="dropdown-label"
|
|
378
|
+
slot="dropdown-label"
|
|
379
|
+
data-title=${options.displayName}
|
|
380
|
+
@click=${(_d = options.onLabelInteraction) !== null && _d !== void 0 ? _d : nothing}
|
|
381
381
|
@keydown=${options.onLabelInteraction
|
|
382
382
|
? (e) => {
|
|
383
383
|
var _a;
|
|
@@ -385,11 +385,11 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
385
385
|
(_a = options.onLabelInteraction) === null || _a === void 0 ? void 0 : _a.call(options, e);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
: nothing}
|
|
389
|
-
>
|
|
390
|
-
${options.displayName}
|
|
391
|
-
</span>
|
|
392
|
-
</ia-dropdown>
|
|
388
|
+
: nothing}
|
|
389
|
+
>
|
|
390
|
+
${options.displayName}
|
|
391
|
+
</span>
|
|
392
|
+
</ia-dropdown>
|
|
393
393
|
`;
|
|
394
394
|
}
|
|
395
395
|
/** Generates a single dropdown option object for the given sort field */
|
|
@@ -399,10 +399,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
399
399
|
selectedHandler: () => {
|
|
400
400
|
this.selectDropdownSortField(sortField);
|
|
401
401
|
},
|
|
402
|
-
label: html `
|
|
403
|
-
<span class="dropdown-option-label">
|
|
404
|
-
${SORT_OPTIONS[sortField].displayName}
|
|
405
|
-
</span>
|
|
402
|
+
label: html `
|
|
403
|
+
<span class="dropdown-option-label">
|
|
404
|
+
${SORT_OPTIONS[sortField].displayName}
|
|
405
|
+
</span>
|
|
406
406
|
`,
|
|
407
407
|
};
|
|
408
408
|
}
|
|
@@ -589,48 +589,48 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
589
589
|
/** Template for rendering the three display mode options */
|
|
590
590
|
/** Added data-testid for Playwright testing * */
|
|
591
591
|
get displayOptionTemplate() {
|
|
592
|
-
return html `
|
|
593
|
-
<ul>
|
|
594
|
-
<li>
|
|
595
|
-
<button
|
|
596
|
-
id="grid-button"
|
|
592
|
+
return html `
|
|
593
|
+
<ul>
|
|
594
|
+
<li>
|
|
595
|
+
<button
|
|
596
|
+
id="grid-button"
|
|
597
597
|
@click=${() => {
|
|
598
598
|
this.displayMode = 'grid';
|
|
599
|
-
}}
|
|
600
|
-
class=${this.displayMode === 'grid' ? 'active' : ''}
|
|
601
|
-
title="Tile view"
|
|
602
|
-
data-testid="grid-button"
|
|
603
|
-
>
|
|
604
|
-
${tileIcon}
|
|
605
|
-
</button>
|
|
606
|
-
</li>
|
|
607
|
-
<li>
|
|
608
|
-
<button
|
|
609
|
-
id="list-detail-button"
|
|
599
|
+
}}
|
|
600
|
+
class=${this.displayMode === 'grid' ? 'active' : ''}
|
|
601
|
+
title="Tile view"
|
|
602
|
+
data-testid="grid-button"
|
|
603
|
+
>
|
|
604
|
+
${tileIcon}
|
|
605
|
+
</button>
|
|
606
|
+
</li>
|
|
607
|
+
<li>
|
|
608
|
+
<button
|
|
609
|
+
id="list-detail-button"
|
|
610
610
|
@click=${() => {
|
|
611
611
|
this.displayMode = 'list-detail';
|
|
612
|
-
}}
|
|
613
|
-
class=${this.displayMode === 'list-detail' ? 'active' : ''}
|
|
614
|
-
title="List view"
|
|
615
|
-
data-testid="list-detail-button"
|
|
616
|
-
>
|
|
617
|
-
${listIcon}
|
|
618
|
-
</button>
|
|
619
|
-
</li>
|
|
620
|
-
<li>
|
|
621
|
-
<button
|
|
622
|
-
id="list-compact-button"
|
|
612
|
+
}}
|
|
613
|
+
class=${this.displayMode === 'list-detail' ? 'active' : ''}
|
|
614
|
+
title="List view"
|
|
615
|
+
data-testid="list-detail-button"
|
|
616
|
+
>
|
|
617
|
+
${listIcon}
|
|
618
|
+
</button>
|
|
619
|
+
</li>
|
|
620
|
+
<li>
|
|
621
|
+
<button
|
|
622
|
+
id="list-compact-button"
|
|
623
623
|
@click=${() => {
|
|
624
624
|
this.displayMode = 'list-compact';
|
|
625
|
-
}}
|
|
626
|
-
class=${this.displayMode === 'list-compact' ? 'active' : ''}
|
|
627
|
-
title="Compact list view"
|
|
628
|
-
data-testid="list-compact-button"
|
|
629
|
-
>
|
|
630
|
-
${compactIcon}
|
|
631
|
-
</button>
|
|
632
|
-
</li>
|
|
633
|
-
</ul>
|
|
625
|
+
}}
|
|
626
|
+
class=${this.displayMode === 'list-compact' ? 'active' : ''}
|
|
627
|
+
title="Compact list view"
|
|
628
|
+
data-testid="list-compact-button"
|
|
629
|
+
>
|
|
630
|
+
${compactIcon}
|
|
631
|
+
</button>
|
|
632
|
+
</li>
|
|
633
|
+
</ul>
|
|
634
634
|
`;
|
|
635
635
|
}
|
|
636
636
|
/**
|
|
@@ -638,12 +638,12 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
638
638
|
* dropdown menu while it is open.
|
|
639
639
|
*/
|
|
640
640
|
get dropdownBackdrop() {
|
|
641
|
-
return html `
|
|
642
|
-
<div
|
|
643
|
-
id="sort-selector-backdrop"
|
|
644
|
-
@keyup=${this.closeDropdowns}
|
|
645
|
-
@click=${this.closeDropdowns}
|
|
646
|
-
></div>
|
|
641
|
+
return html `
|
|
642
|
+
<div
|
|
643
|
+
id="sort-selector-backdrop"
|
|
644
|
+
@keyup=${this.closeDropdowns}
|
|
645
|
+
@click=${this.closeDropdowns}
|
|
646
|
+
></div>
|
|
647
647
|
`;
|
|
648
648
|
}
|
|
649
649
|
/** Closes all of the sorting dropdown components' menus */
|
|
@@ -789,20 +789,20 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
789
789
|
}
|
|
790
790
|
get titleSelectorBar() {
|
|
791
791
|
var _a;
|
|
792
|
-
return html ` <alpha-bar
|
|
793
|
-
.selectedLetter=${this.selectedTitleFilter}
|
|
794
|
-
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
|
|
795
|
-
ariaLandmarkLabel="Filter by title letter"
|
|
796
|
-
@letterChanged=${this.titleLetterChanged}
|
|
792
|
+
return html ` <alpha-bar
|
|
793
|
+
.selectedLetter=${this.selectedTitleFilter}
|
|
794
|
+
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
|
|
795
|
+
ariaLandmarkLabel="Filter by title letter"
|
|
796
|
+
@letterChanged=${this.titleLetterChanged}
|
|
797
797
|
></alpha-bar>`;
|
|
798
798
|
}
|
|
799
799
|
get creatorSelectorBar() {
|
|
800
800
|
var _a;
|
|
801
|
-
return html ` <alpha-bar
|
|
802
|
-
.selectedLetter=${this.selectedCreatorFilter}
|
|
803
|
-
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
|
|
804
|
-
ariaLandmarkLabel="Filter by creator letter"
|
|
805
|
-
@letterChanged=${this.creatorLetterChanged}
|
|
801
|
+
return html ` <alpha-bar
|
|
802
|
+
.selectedLetter=${this.selectedCreatorFilter}
|
|
803
|
+
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
|
|
804
|
+
ariaLandmarkLabel="Filter by creator letter"
|
|
805
|
+
@letterChanged=${this.creatorLetterChanged}
|
|
806
806
|
></alpha-bar>`;
|
|
807
807
|
}
|
|
808
808
|
titleLetterChanged(e) {
|
|
@@ -845,236 +845,236 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
845
845
|
static get styles() {
|
|
846
846
|
return [
|
|
847
847
|
srOnlyStyle,
|
|
848
|
-
css `
|
|
849
|
-
#container {
|
|
850
|
-
position: relative;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
#sort-bar {
|
|
854
|
-
display: flex;
|
|
855
|
-
justify-content: flex-start;
|
|
856
|
-
align-items: center;
|
|
857
|
-
border-bottom: 1px solid #2c2c2c;
|
|
858
|
-
font-size: 1.4rem;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
#sort-options {
|
|
862
|
-
display: flex;
|
|
863
|
-
align-items: center;
|
|
864
|
-
flex-grow: 1;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
ul {
|
|
868
|
-
list-style: none;
|
|
869
|
-
display: flex;
|
|
870
|
-
align-items: center;
|
|
871
|
-
margin: 0;
|
|
872
|
-
padding: 0;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
li {
|
|
876
|
-
padding: 0;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
.sort-by-text {
|
|
880
|
-
margin-right: 5px;
|
|
881
|
-
font-weight: bold;
|
|
882
|
-
white-space: nowrap;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
.sort-direction-container {
|
|
886
|
-
display: flex;
|
|
887
|
-
align-self: stretch;
|
|
888
|
-
flex: 0;
|
|
889
|
-
margin: 0 5px;
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
.sort-direction-selector {
|
|
893
|
-
padding: 0;
|
|
894
|
-
border: none;
|
|
895
|
-
appearance: none;
|
|
896
|
-
background: transparent;
|
|
897
|
-
cursor: pointer;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
.sort-direction-selector:disabled {
|
|
901
|
-
cursor: default;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
.sort-direction-icon {
|
|
905
|
-
display: flex;
|
|
906
|
-
align-items: center;
|
|
907
|
-
background: none;
|
|
908
|
-
color: inherit;
|
|
909
|
-
border: none;
|
|
910
|
-
padding: 0;
|
|
911
|
-
outline: inherit;
|
|
912
|
-
width: 14px;
|
|
913
|
-
height: 14px;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
.sort-direction-icon > svg {
|
|
917
|
-
flex: 1;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
#date-sort-selector,
|
|
921
|
-
#view-sort-selector {
|
|
922
|
-
position: absolute;
|
|
923
|
-
left: 150px;
|
|
924
|
-
top: 45px;
|
|
925
|
-
|
|
926
|
-
z-index: 1;
|
|
927
|
-
padding: 1rem;
|
|
928
|
-
background-color: white;
|
|
929
|
-
border-radius: 2.5rem;
|
|
930
|
-
border: 1px solid #404142;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
#sort-selector-container {
|
|
934
|
-
flex: 1;
|
|
935
|
-
display: flex;
|
|
936
|
-
justify-content: flex-start;
|
|
937
|
-
align-items: center;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
#desktop-sort-container,
|
|
941
|
-
#mobile-sort-container {
|
|
942
|
-
display: flex;
|
|
943
|
-
justify-content: flex-start;
|
|
944
|
-
align-items: center;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
/*
|
|
948
|
-
we move the desktop sort selector offscreen instead of display: none
|
|
949
|
-
because we need to observe the width of it vs its container to determine
|
|
950
|
-
if it's wide enough to display the desktop version and if you display: none,
|
|
951
|
-
the width becomes 0
|
|
952
|
-
*/
|
|
953
|
-
#desktop-sort-container.hidden {
|
|
954
|
-
position: absolute;
|
|
955
|
-
top: -9999px;
|
|
956
|
-
left: -9999px;
|
|
957
|
-
visibility: hidden;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
#mobile-sort-container.hidden {
|
|
961
|
-
display: none;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
#sort-selector-backdrop {
|
|
965
|
-
position: fixed;
|
|
966
|
-
top: 0;
|
|
967
|
-
left: 0;
|
|
968
|
-
width: 100vw;
|
|
969
|
-
height: 100vh;
|
|
970
|
-
z-index: 1;
|
|
971
|
-
background-color: transparent;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
#desktop-sort-selector {
|
|
975
|
-
display: inline-flex;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
#desktop-sort-selector li {
|
|
979
|
-
display: flex;
|
|
980
|
-
align-items: center;
|
|
981
|
-
padding-left: 5px;
|
|
982
|
-
padding-right: 5px;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
#desktop-sort-selector li a {
|
|
986
|
-
padding: 0 5px;
|
|
987
|
-
text-decoration: none;
|
|
988
|
-
color: #333;
|
|
989
|
-
line-height: 2;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
#desktop-sort-selector li button {
|
|
993
|
-
padding: 0px 5px;
|
|
994
|
-
border: none;
|
|
995
|
-
background: none;
|
|
996
|
-
font-family: inherit;
|
|
997
|
-
font-size: inherit;
|
|
998
|
-
color: #333;
|
|
999
|
-
line-height: 2;
|
|
1000
|
-
cursor: pointer;
|
|
1001
|
-
appearance: none;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
#desktop-sort-selector li button.selected {
|
|
1005
|
-
font-weight: bold;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* Fix to not shift the sort-bar options when get selected
|
|
1010
|
-
*/
|
|
1011
|
-
#desktop-sort-selector li button::before,
|
|
1012
|
-
#desktop-sort-selector .dropdown-label::before {
|
|
1013
|
-
display: block;
|
|
1014
|
-
content: attr(data-title);
|
|
1015
|
-
font-weight: bold;
|
|
1016
|
-
height: 0;
|
|
1017
|
-
overflow: hidden;
|
|
1018
|
-
visibility: hidden;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
#display-style-selector {
|
|
1022
|
-
flex: 0;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
#display-style-selector button {
|
|
1026
|
-
background: none;
|
|
1027
|
-
color: inherit;
|
|
1028
|
-
border: none;
|
|
1029
|
-
appearance: none;
|
|
1030
|
-
cursor: pointer;
|
|
1031
|
-
-webkit-appearance: none;
|
|
1032
|
-
fill: #bbbbbb;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
#display-style-selector button.active {
|
|
1036
|
-
fill: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
#display-style-selector button svg {
|
|
1040
|
-
width: 24px;
|
|
1041
|
-
height: 24px;
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
ia-dropdown {
|
|
1045
|
-
--dropdownTextColor: white;
|
|
1046
|
-
--dropdownOffsetTop: 0;
|
|
1047
|
-
--dropdownBorderTopWidth: 0;
|
|
1048
|
-
--dropdownBorderTopLeftRadius: 0;
|
|
1049
|
-
--dropdownBorderTopRightRadius: 0;
|
|
1050
|
-
--dropdownWhiteSpace: nowrap;
|
|
1051
|
-
--dropdownListZIndex: 2;
|
|
1052
|
-
--dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1053
|
-
--dropdownSelectedTextColor: white;
|
|
1054
|
-
--dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
|
|
1055
|
-
--dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
|
|
1056
|
-
--caretHeight: 9px;
|
|
1057
|
-
--caretWidth: 12px;
|
|
1058
|
-
--caretPadding: 0 5px 0 0;
|
|
1059
|
-
}
|
|
1060
|
-
ia-dropdown.selected .dropdown-label {
|
|
1061
|
-
font-weight: bold;
|
|
1062
|
-
}
|
|
1063
|
-
ia-dropdown.open {
|
|
1064
|
-
z-index: 2;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
.dropdown-label {
|
|
1068
|
-
display: inline-block;
|
|
1069
|
-
height: 100%;
|
|
1070
|
-
padding-left: 5px;
|
|
1071
|
-
font-size: 1.4rem;
|
|
1072
|
-
font-family: var(--ia-theme-base-font-family);
|
|
1073
|
-
line-height: 2;
|
|
1074
|
-
color: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1075
|
-
white-space: nowrap;
|
|
1076
|
-
user-select: none;
|
|
1077
|
-
}
|
|
848
|
+
css `
|
|
849
|
+
#container {
|
|
850
|
+
position: relative;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
#sort-bar {
|
|
854
|
+
display: flex;
|
|
855
|
+
justify-content: flex-start;
|
|
856
|
+
align-items: center;
|
|
857
|
+
border-bottom: 1px solid #2c2c2c;
|
|
858
|
+
font-size: 1.4rem;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
#sort-options {
|
|
862
|
+
display: flex;
|
|
863
|
+
align-items: center;
|
|
864
|
+
flex-grow: 1;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
ul {
|
|
868
|
+
list-style: none;
|
|
869
|
+
display: flex;
|
|
870
|
+
align-items: center;
|
|
871
|
+
margin: 0;
|
|
872
|
+
padding: 0;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
li {
|
|
876
|
+
padding: 0;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
.sort-by-text {
|
|
880
|
+
margin-right: 5px;
|
|
881
|
+
font-weight: bold;
|
|
882
|
+
white-space: nowrap;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.sort-direction-container {
|
|
886
|
+
display: flex;
|
|
887
|
+
align-self: stretch;
|
|
888
|
+
flex: 0;
|
|
889
|
+
margin: 0 5px;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.sort-direction-selector {
|
|
893
|
+
padding: 0;
|
|
894
|
+
border: none;
|
|
895
|
+
appearance: none;
|
|
896
|
+
background: transparent;
|
|
897
|
+
cursor: pointer;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.sort-direction-selector:disabled {
|
|
901
|
+
cursor: default;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.sort-direction-icon {
|
|
905
|
+
display: flex;
|
|
906
|
+
align-items: center;
|
|
907
|
+
background: none;
|
|
908
|
+
color: inherit;
|
|
909
|
+
border: none;
|
|
910
|
+
padding: 0;
|
|
911
|
+
outline: inherit;
|
|
912
|
+
width: 14px;
|
|
913
|
+
height: 14px;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.sort-direction-icon > svg {
|
|
917
|
+
flex: 1;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
#date-sort-selector,
|
|
921
|
+
#view-sort-selector {
|
|
922
|
+
position: absolute;
|
|
923
|
+
left: 150px;
|
|
924
|
+
top: 45px;
|
|
925
|
+
|
|
926
|
+
z-index: 1;
|
|
927
|
+
padding: 1rem;
|
|
928
|
+
background-color: white;
|
|
929
|
+
border-radius: 2.5rem;
|
|
930
|
+
border: 1px solid #404142;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
#sort-selector-container {
|
|
934
|
+
flex: 1;
|
|
935
|
+
display: flex;
|
|
936
|
+
justify-content: flex-start;
|
|
937
|
+
align-items: center;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
#desktop-sort-container,
|
|
941
|
+
#mobile-sort-container {
|
|
942
|
+
display: flex;
|
|
943
|
+
justify-content: flex-start;
|
|
944
|
+
align-items: center;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/*
|
|
948
|
+
we move the desktop sort selector offscreen instead of display: none
|
|
949
|
+
because we need to observe the width of it vs its container to determine
|
|
950
|
+
if it's wide enough to display the desktop version and if you display: none,
|
|
951
|
+
the width becomes 0
|
|
952
|
+
*/
|
|
953
|
+
#desktop-sort-container.hidden {
|
|
954
|
+
position: absolute;
|
|
955
|
+
top: -9999px;
|
|
956
|
+
left: -9999px;
|
|
957
|
+
visibility: hidden;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
#mobile-sort-container.hidden {
|
|
961
|
+
display: none;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
#sort-selector-backdrop {
|
|
965
|
+
position: fixed;
|
|
966
|
+
top: 0;
|
|
967
|
+
left: 0;
|
|
968
|
+
width: 100vw;
|
|
969
|
+
height: 100vh;
|
|
970
|
+
z-index: 1;
|
|
971
|
+
background-color: transparent;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
#desktop-sort-selector {
|
|
975
|
+
display: inline-flex;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
#desktop-sort-selector li {
|
|
979
|
+
display: flex;
|
|
980
|
+
align-items: center;
|
|
981
|
+
padding-left: 5px;
|
|
982
|
+
padding-right: 5px;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
#desktop-sort-selector li a {
|
|
986
|
+
padding: 0 5px;
|
|
987
|
+
text-decoration: none;
|
|
988
|
+
color: #333;
|
|
989
|
+
line-height: 2;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
#desktop-sort-selector li button {
|
|
993
|
+
padding: 0px 5px;
|
|
994
|
+
border: none;
|
|
995
|
+
background: none;
|
|
996
|
+
font-family: inherit;
|
|
997
|
+
font-size: inherit;
|
|
998
|
+
color: #333;
|
|
999
|
+
line-height: 2;
|
|
1000
|
+
cursor: pointer;
|
|
1001
|
+
appearance: none;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
#desktop-sort-selector li button.selected {
|
|
1005
|
+
font-weight: bold;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Fix to not shift the sort-bar options when get selected
|
|
1010
|
+
*/
|
|
1011
|
+
#desktop-sort-selector li button::before,
|
|
1012
|
+
#desktop-sort-selector .dropdown-label::before {
|
|
1013
|
+
display: block;
|
|
1014
|
+
content: attr(data-title);
|
|
1015
|
+
font-weight: bold;
|
|
1016
|
+
height: 0;
|
|
1017
|
+
overflow: hidden;
|
|
1018
|
+
visibility: hidden;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
#display-style-selector {
|
|
1022
|
+
flex: 0;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
#display-style-selector button {
|
|
1026
|
+
background: none;
|
|
1027
|
+
color: inherit;
|
|
1028
|
+
border: none;
|
|
1029
|
+
appearance: none;
|
|
1030
|
+
cursor: pointer;
|
|
1031
|
+
-webkit-appearance: none;
|
|
1032
|
+
fill: #bbbbbb;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
#display-style-selector button.active {
|
|
1036
|
+
fill: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
#display-style-selector button svg {
|
|
1040
|
+
width: 24px;
|
|
1041
|
+
height: 24px;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
ia-dropdown {
|
|
1045
|
+
--dropdownTextColor: white;
|
|
1046
|
+
--dropdownOffsetTop: 0;
|
|
1047
|
+
--dropdownBorderTopWidth: 0;
|
|
1048
|
+
--dropdownBorderTopLeftRadius: 0;
|
|
1049
|
+
--dropdownBorderTopRightRadius: 0;
|
|
1050
|
+
--dropdownWhiteSpace: nowrap;
|
|
1051
|
+
--dropdownListZIndex: 2;
|
|
1052
|
+
--dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1053
|
+
--dropdownSelectedTextColor: white;
|
|
1054
|
+
--dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
|
|
1055
|
+
--dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
|
|
1056
|
+
--caretHeight: 9px;
|
|
1057
|
+
--caretWidth: 12px;
|
|
1058
|
+
--caretPadding: 0 5px 0 0;
|
|
1059
|
+
}
|
|
1060
|
+
ia-dropdown.selected .dropdown-label {
|
|
1061
|
+
font-weight: bold;
|
|
1062
|
+
}
|
|
1063
|
+
ia-dropdown.open {
|
|
1064
|
+
z-index: 2;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.dropdown-label {
|
|
1068
|
+
display: inline-block;
|
|
1069
|
+
height: 100%;
|
|
1070
|
+
padding-left: 5px;
|
|
1071
|
+
font-size: 1.4rem;
|
|
1072
|
+
font-family: var(--ia-theme-base-font-family);
|
|
1073
|
+
line-height: 2;
|
|
1074
|
+
color: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1075
|
+
white-space: nowrap;
|
|
1076
|
+
user-select: none;
|
|
1077
|
+
}
|
|
1078
1078
|
`,
|
|
1079
1079
|
];
|
|
1080
1080
|
}
|