@internetarchive/collection-browser 0.4.10-alpha.2 → 0.4.10
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/models.js +6 -6
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +7 -12
- package/dist/src/sort-filter-bar/sort-filter-bar.js +156 -222
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +5 -8
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +22 -33
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/package.json +3 -4
- package/src/models.ts +6 -6
- package/src/sort-filter-bar/sort-filter-bar.ts +197 -283
- package/src/tiles/grid/item-tile.ts +1 -5
- package/test/sort-filter-bar/sort-filter-bar.test.ts +39 -56
|
@@ -11,12 +11,6 @@ import type {
|
|
|
11
11
|
SharedResizeObserverInterface,
|
|
12
12
|
SharedResizeObserverResizeHandlerInterface,
|
|
13
13
|
} from '@internetarchive/shared-resize-observer';
|
|
14
|
-
import '@internetarchive/ia-dropdown';
|
|
15
|
-
import type {
|
|
16
|
-
IaDropdown,
|
|
17
|
-
optionInterface,
|
|
18
|
-
} from '@internetarchive/ia-dropdown/dist/src/ia-dropdown';
|
|
19
|
-
import type { SortDirection } from '@internetarchive/search-service';
|
|
20
14
|
import {
|
|
21
15
|
CollectionDisplayMode,
|
|
22
16
|
PrefixFilterCounts,
|
|
@@ -63,28 +57,26 @@ export class SortFilterBar
|
|
|
63
57
|
|
|
64
58
|
@state() viewSortSelectorVisible = false;
|
|
65
59
|
|
|
66
|
-
@state()
|
|
60
|
+
@state() desktopSelectorBarWidth = 0;
|
|
67
61
|
|
|
68
62
|
@state() selectorBarContainerWidth = 0;
|
|
69
63
|
|
|
70
64
|
@state() hoveringOverDateSortOptions = false;
|
|
71
65
|
|
|
72
|
-
@query('#desktop-sort-
|
|
73
|
-
private
|
|
66
|
+
@query('#desktop-sort-selector')
|
|
67
|
+
private desktopSortSelector!: HTMLUListElement;
|
|
74
68
|
|
|
75
69
|
@query('#sort-selector-container')
|
|
76
70
|
private sortSelectorContainer!: HTMLDivElement;
|
|
77
71
|
|
|
78
|
-
@query('#views-dropdown')
|
|
79
|
-
private viewsDropdown!: IaDropdown;
|
|
80
|
-
|
|
81
|
-
@query('#date-dropdown')
|
|
82
|
-
private dateDropdown!: IaDropdown;
|
|
83
|
-
|
|
84
72
|
render() {
|
|
85
73
|
return html`
|
|
86
74
|
<div id="container">
|
|
87
75
|
<div id="sort-bar">
|
|
76
|
+
<div id="sort-direction-container">
|
|
77
|
+
${this.sortDirectionSelectorTemplate}
|
|
78
|
+
</div>
|
|
79
|
+
|
|
88
80
|
<div id="sort-selector-container">
|
|
89
81
|
${this.mobileSortSelectorTemplate}
|
|
90
82
|
${this.desktopSortSelectorTemplate}
|
|
@@ -94,12 +86,14 @@ export class SortFilterBar
|
|
|
94
86
|
</div>
|
|
95
87
|
|
|
96
88
|
${this.viewSortSelectorVisible && !this.mobileSelectorVisible
|
|
97
|
-
? this.
|
|
89
|
+
? this.viewSortSelector
|
|
98
90
|
: nothing}
|
|
99
91
|
${this.dateSortSelectorVisible && !this.mobileSelectorVisible
|
|
100
|
-
? this.
|
|
92
|
+
? this.dateSortSelector
|
|
101
93
|
: nothing}
|
|
102
94
|
${this.alphaBarTemplate}
|
|
95
|
+
|
|
96
|
+
<div id="bottom-shadow"></div>
|
|
103
97
|
</div>
|
|
104
98
|
`;
|
|
105
99
|
}
|
|
@@ -173,7 +167,7 @@ export class SortFilterBar
|
|
|
173
167
|
});
|
|
174
168
|
|
|
175
169
|
resizeObserver.removeObserver({
|
|
176
|
-
target: this.
|
|
170
|
+
target: this.desktopSortSelector,
|
|
177
171
|
handler: this,
|
|
178
172
|
});
|
|
179
173
|
}
|
|
@@ -186,13 +180,13 @@ export class SortFilterBar
|
|
|
186
180
|
});
|
|
187
181
|
|
|
188
182
|
this.resizeObserver.addObserver({
|
|
189
|
-
target: this.
|
|
183
|
+
target: this.desktopSortSelector,
|
|
190
184
|
handler: this,
|
|
191
185
|
});
|
|
192
186
|
}
|
|
193
187
|
|
|
194
188
|
private get mobileSelectorVisible() {
|
|
195
|
-
return this.selectorBarContainerWidth - 10 < this.
|
|
189
|
+
return this.selectorBarContainerWidth - 10 < this.desktopSelectorBarWidth;
|
|
196
190
|
}
|
|
197
191
|
|
|
198
192
|
private get alphaBarTemplate(): TemplateResult | typeof nothing {
|
|
@@ -211,8 +205,8 @@ export class SortFilterBar
|
|
|
211
205
|
}
|
|
212
206
|
|
|
213
207
|
handleResize(entry: ResizeObserverEntry): void {
|
|
214
|
-
if (entry.target === this.
|
|
215
|
-
this.
|
|
208
|
+
if (entry.target === this.desktopSortSelector) {
|
|
209
|
+
this.desktopSelectorBarWidth = entry.contentRect.width;
|
|
216
210
|
} else if (entry.target === this.sortSelectorContainer) {
|
|
217
211
|
this.selectorBarContainerWidth = entry.contentRect.width;
|
|
218
212
|
}
|
|
@@ -220,130 +214,101 @@ export class SortFilterBar
|
|
|
220
214
|
|
|
221
215
|
private get sortDirectionSelectorTemplate() {
|
|
222
216
|
return html`
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
?disabled=${this.selectedSort === 'relevance'}
|
|
226
|
-
@click=${this.toggleSortDirection}
|
|
227
|
-
>
|
|
228
|
-
<div
|
|
217
|
+
<div id="sort-direction-selector">
|
|
218
|
+
<button
|
|
229
219
|
id="sort-ascending-btn"
|
|
230
220
|
class="sort-button ${this.sortDirection === 'asc' ? 'selected' : ''}"
|
|
221
|
+
?disabled=${this.selectedSort === 'relevance'}
|
|
222
|
+
@click=${() => {
|
|
223
|
+
this.setSortDirections('asc');
|
|
224
|
+
}}
|
|
231
225
|
>
|
|
232
226
|
${sortIcon}
|
|
233
|
-
</
|
|
234
|
-
<
|
|
227
|
+
</button>
|
|
228
|
+
<button
|
|
235
229
|
id="sort-descending-btn"
|
|
236
230
|
class="sort-button ${this.sortDirection === 'desc' ? 'selected' : ''}"
|
|
231
|
+
?disabled=${this.selectedSort === 'relevance'}
|
|
232
|
+
@click=${() => {
|
|
233
|
+
this.setSortDirections('desc');
|
|
234
|
+
}}
|
|
237
235
|
>
|
|
238
236
|
${sortIcon}
|
|
239
|
-
</
|
|
240
|
-
</
|
|
237
|
+
</button>
|
|
238
|
+
</div>
|
|
241
239
|
`;
|
|
242
240
|
}
|
|
243
241
|
|
|
244
242
|
private get desktopSortSelectorTemplate() {
|
|
245
243
|
return html`
|
|
246
|
-
<
|
|
247
|
-
id="desktop-sort-
|
|
244
|
+
<ul
|
|
245
|
+
id="desktop-sort-selector"
|
|
248
246
|
class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
|
|
249
247
|
>
|
|
250
|
-
<
|
|
251
|
-
<
|
|
252
|
-
${this.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
this.setSelectedSort(SortField.date);
|
|
315
|
-
this.viewsDropdown.open = false;
|
|
316
|
-
this.dateSortSelectorVisible = this.dateDropdown.open;
|
|
317
|
-
this.dateDropdown.classList.toggle(
|
|
318
|
-
'open',
|
|
319
|
-
this.dateDropdown.open
|
|
320
|
-
);
|
|
321
|
-
},
|
|
322
|
-
displayName: html`${this.dateSortField}`,
|
|
323
|
-
id: 'date-dropdown',
|
|
324
|
-
isSelected: () => this.dateOptionSelected,
|
|
325
|
-
dropdownOptions: [
|
|
326
|
-
this.getDropdownOption(SortField.date),
|
|
327
|
-
this.getDropdownOption(SortField.datearchived),
|
|
328
|
-
this.getDropdownOption(SortField.datereviewed),
|
|
329
|
-
this.getDropdownOption(SortField.dateadded),
|
|
330
|
-
],
|
|
331
|
-
selectedOption: this.dateOptionSelected ? this.selectedSort : '',
|
|
332
|
-
})}
|
|
333
|
-
</li>
|
|
334
|
-
<li>
|
|
335
|
-
${this.getSortDisplayOption(SortField.creator, {
|
|
336
|
-
clickEvent: () => {
|
|
337
|
-
this.alphaSelectorVisible = 'creator';
|
|
338
|
-
this.selectedTitleFilter = null;
|
|
339
|
-
this.dateSortSelectorVisible = false;
|
|
340
|
-
this.setSelectedSort(SortField.creator);
|
|
341
|
-
this.emitTitleLetterChangedEvent();
|
|
342
|
-
},
|
|
343
|
-
})}
|
|
344
|
-
</li>
|
|
345
|
-
</ul>
|
|
346
|
-
</div>
|
|
248
|
+
<li id="sort-by-text">Sort By</li>
|
|
249
|
+
<li>
|
|
250
|
+
${this.showRelevance
|
|
251
|
+
? this.getSortDisplayOption(SortField.relevance)
|
|
252
|
+
: nothing}
|
|
253
|
+
</li>
|
|
254
|
+
<li>
|
|
255
|
+
${this.getSortDisplayOption(SortField.weeklyview, {
|
|
256
|
+
clickEvent: () => {
|
|
257
|
+
if (!this.viewOptionSelected)
|
|
258
|
+
this.setSelectedSort(SortField.weeklyview);
|
|
259
|
+
this.viewSortSelectorVisible = !this.viewSortSelectorVisible;
|
|
260
|
+
this.dateSortSelectorVisible = false;
|
|
261
|
+
this.alphaSelectorVisible = null;
|
|
262
|
+
this.selectedTitleFilter = null;
|
|
263
|
+
this.selectedCreatorFilter = null;
|
|
264
|
+
this.emitTitleLetterChangedEvent();
|
|
265
|
+
this.emitCreatorLetterChangedEvent();
|
|
266
|
+
},
|
|
267
|
+
displayName: html`${this.viewSortField}`,
|
|
268
|
+
isSelected: () => this.viewOptionSelected,
|
|
269
|
+
})}
|
|
270
|
+
</li>
|
|
271
|
+
<li>
|
|
272
|
+
${this.getSortDisplayOption(SortField.title, {
|
|
273
|
+
clickEvent: () => {
|
|
274
|
+
this.alphaSelectorVisible = 'title';
|
|
275
|
+
this.selectedCreatorFilter = null;
|
|
276
|
+
this.dateSortSelectorVisible = false;
|
|
277
|
+
this.viewSortSelectorVisible = false;
|
|
278
|
+
this.setSelectedSort(SortField.title);
|
|
279
|
+
this.emitCreatorLetterChangedEvent();
|
|
280
|
+
},
|
|
281
|
+
})}
|
|
282
|
+
</li>
|
|
283
|
+
<li>
|
|
284
|
+
${this.getSortDisplayOption(SortField.date, {
|
|
285
|
+
clickEvent: () => {
|
|
286
|
+
if (!this.dateOptionSelected)
|
|
287
|
+
this.setSelectedSort(SortField.date);
|
|
288
|
+
this.dateSortSelectorVisible = !this.dateSortSelectorVisible;
|
|
289
|
+
this.viewSortSelectorVisible = false;
|
|
290
|
+
this.alphaSelectorVisible = null;
|
|
291
|
+
this.selectedTitleFilter = null;
|
|
292
|
+
this.selectedCreatorFilter = null;
|
|
293
|
+
this.emitTitleLetterChangedEvent();
|
|
294
|
+
this.emitCreatorLetterChangedEvent();
|
|
295
|
+
},
|
|
296
|
+
displayName: html`${this.dateSortField}`,
|
|
297
|
+
isSelected: () => this.dateOptionSelected,
|
|
298
|
+
})}
|
|
299
|
+
</li>
|
|
300
|
+
<li>
|
|
301
|
+
${this.getSortDisplayOption(SortField.creator, {
|
|
302
|
+
clickEvent: () => {
|
|
303
|
+
this.alphaSelectorVisible = 'creator';
|
|
304
|
+
this.selectedTitleFilter = null;
|
|
305
|
+
this.dateSortSelectorVisible = false;
|
|
306
|
+
this.setSelectedSort(SortField.creator);
|
|
307
|
+
this.emitTitleLetterChangedEvent();
|
|
308
|
+
},
|
|
309
|
+
})}
|
|
310
|
+
</li>
|
|
311
|
+
</ul>
|
|
347
312
|
`;
|
|
348
313
|
}
|
|
349
314
|
|
|
@@ -388,76 +353,28 @@ export class SortFilterBar
|
|
|
388
353
|
this.emitCreatorLetterChangedEvent();
|
|
389
354
|
}
|
|
390
355
|
}}
|
|
391
|
-
class=${isSelected() ? 'selected' :
|
|
356
|
+
class=${isSelected() ? 'selected' : ''}
|
|
392
357
|
>
|
|
393
358
|
${displayName}
|
|
394
359
|
</a>
|
|
395
360
|
`;
|
|
396
361
|
}
|
|
397
362
|
|
|
398
|
-
private getSortDropdown(options?: {
|
|
399
|
-
optionSelectedHandler?: (e: Event) => void;
|
|
400
|
-
clickHandler?: (e: PointerEvent) => void;
|
|
401
|
-
isSelected?: () => boolean;
|
|
402
|
-
displayName?: TemplateResult;
|
|
403
|
-
id?: string;
|
|
404
|
-
dropdownOptions?: optionInterface[];
|
|
405
|
-
selectedOption?: string;
|
|
406
|
-
}): TemplateResult {
|
|
407
|
-
return html`
|
|
408
|
-
<ia-dropdown
|
|
409
|
-
id=${options?.id ?? nothing}
|
|
410
|
-
class=${options?.isSelected?.() ? 'selected' : nothing}
|
|
411
|
-
displayCaret
|
|
412
|
-
closeOnSelect
|
|
413
|
-
includeSelectedOption
|
|
414
|
-
.openViaButton=${false}
|
|
415
|
-
.options=${options?.dropdownOptions}
|
|
416
|
-
.selectedOption=${options?.selectedOption}
|
|
417
|
-
@optionSelected=${options?.optionSelectedHandler ?? nothing}
|
|
418
|
-
@click=${options?.clickHandler ?? nothing}
|
|
419
|
-
>
|
|
420
|
-
<span class="dropdown-label" slot="dropdown-label">
|
|
421
|
-
${options?.displayName ?? ''}
|
|
422
|
-
</span>
|
|
423
|
-
</ia-dropdown>
|
|
424
|
-
`;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
private getDropdownOption(sortField: SortField): optionInterface {
|
|
428
|
-
return {
|
|
429
|
-
id: sortField,
|
|
430
|
-
selectedHandler: () => {
|
|
431
|
-
this.selectDropdownSortField(sortField);
|
|
432
|
-
},
|
|
433
|
-
label: html`
|
|
434
|
-
<span class="dropdown-option-label">
|
|
435
|
-
${SortFieldDisplayName[sortField]}
|
|
436
|
-
</span>
|
|
437
|
-
`,
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
|
|
441
363
|
private get mobileSortSelectorTemplate() {
|
|
442
364
|
return html`
|
|
443
|
-
<
|
|
444
|
-
id="mobile-sort-
|
|
365
|
+
<select
|
|
366
|
+
id="mobile-sort-selector"
|
|
367
|
+
@change=${this.mobileSortChanged}
|
|
445
368
|
class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
|
|
446
369
|
>
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
${SortFieldDisplayName[field as SortField]}
|
|
456
|
-
</option>
|
|
457
|
-
`
|
|
458
|
-
)}
|
|
459
|
-
</select>
|
|
460
|
-
</div>
|
|
370
|
+
${Object.keys(SortField).map(
|
|
371
|
+
field => html`
|
|
372
|
+
<option value="${field}" ?selected=${this.selectedSort === field}>
|
|
373
|
+
${SortFieldDisplayName[field as SortField]}
|
|
374
|
+
</option>
|
|
375
|
+
`
|
|
376
|
+
)}
|
|
377
|
+
</select>
|
|
461
378
|
`;
|
|
462
379
|
}
|
|
463
380
|
|
|
@@ -520,38 +437,72 @@ export class SortFilterBar
|
|
|
520
437
|
`;
|
|
521
438
|
}
|
|
522
439
|
|
|
523
|
-
private get
|
|
440
|
+
private get dateSortSelector() {
|
|
524
441
|
return html`
|
|
525
442
|
<div
|
|
526
|
-
id="sort-selector-backdrop"
|
|
527
|
-
@keyup=${
|
|
528
|
-
|
|
443
|
+
id="date-sort-selector-backdrop"
|
|
444
|
+
@keyup=${() => {
|
|
445
|
+
this.dateSortSelectorVisible = false;
|
|
446
|
+
}}
|
|
447
|
+
@click=${() => {
|
|
448
|
+
this.dateSortSelectorVisible = false;
|
|
449
|
+
}}
|
|
529
450
|
></div>
|
|
451
|
+
<div id="date-sort-selector">
|
|
452
|
+
<ul>
|
|
453
|
+
<li>${this.getDateSortButton(SortField.datearchived)}</li>
|
|
454
|
+
<li>${this.getDateSortButton(SortField.date)}</li>
|
|
455
|
+
<li>${this.getDateSortButton(SortField.datereviewed)}</li>
|
|
456
|
+
<li>${this.getDateSortButton(SortField.dateadded)}</li>
|
|
457
|
+
</ul>
|
|
458
|
+
</div>
|
|
530
459
|
`;
|
|
531
460
|
}
|
|
532
461
|
|
|
533
|
-
private
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
462
|
+
private get viewSortSelector() {
|
|
463
|
+
return html`
|
|
464
|
+
<div
|
|
465
|
+
id="view-sort-selector-backdrop"
|
|
466
|
+
@keyup=${() => {
|
|
467
|
+
this.viewSortSelectorVisible = false;
|
|
468
|
+
}}
|
|
469
|
+
@click=${() => {
|
|
470
|
+
this.viewSortSelectorVisible = false;
|
|
471
|
+
}}
|
|
472
|
+
></div>
|
|
473
|
+
<div id="view-sort-selector">
|
|
474
|
+
<ul>
|
|
475
|
+
<li>${this.getDateSortButton(SortField.alltimeview)}</li>
|
|
476
|
+
<li>${this.getDateSortButton(SortField.weeklyview)}</li>
|
|
477
|
+
</ul>
|
|
478
|
+
</div>
|
|
479
|
+
`;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
private getDateSortButton(sortField: SortField) {
|
|
483
|
+
return html`
|
|
484
|
+
<button
|
|
485
|
+
@click=${() => {
|
|
486
|
+
this.selectDateSort(sortField);
|
|
487
|
+
}}
|
|
488
|
+
class=${this.selectedSort === sortField ? 'selected' : ''}
|
|
489
|
+
>
|
|
490
|
+
${SortFieldDisplayName[sortField]}
|
|
491
|
+
</button>
|
|
492
|
+
`;
|
|
538
493
|
}
|
|
539
494
|
|
|
540
|
-
private
|
|
495
|
+
private selectDateSort(sortField: SortField) {
|
|
541
496
|
this.dateSortSelectorVisible = false;
|
|
542
497
|
this.viewSortSelectorVisible = false;
|
|
543
498
|
this.setSelectedSort(sortField);
|
|
544
499
|
}
|
|
545
500
|
|
|
546
|
-
private
|
|
501
|
+
private setSortDirections(sortDirection: 'asc' | 'desc') {
|
|
547
502
|
this.sortDirection = sortDirection;
|
|
548
503
|
this.emitSortChangedEvent();
|
|
549
504
|
}
|
|
550
505
|
|
|
551
|
-
private toggleSortDirection() {
|
|
552
|
-
this.setSortDirection(this.sortDirection === 'desc' ? 'asc' : 'desc');
|
|
553
|
-
}
|
|
554
|
-
|
|
555
506
|
private setSelectedSort(sort: SortField) {
|
|
556
507
|
this.selectedSort = sort;
|
|
557
508
|
this.emitSortChangedEvent();
|
|
@@ -705,8 +656,9 @@ export class SortFilterBar
|
|
|
705
656
|
#sort-bar {
|
|
706
657
|
display: flex;
|
|
707
658
|
justify-content: space-between;
|
|
708
|
-
border
|
|
659
|
+
border: 1px solid rgb(232, 232, 232);
|
|
709
660
|
align-items: center;
|
|
661
|
+
padding: 0.5rem 1.5rem;
|
|
710
662
|
}
|
|
711
663
|
|
|
712
664
|
#sort-direction-container {
|
|
@@ -714,10 +666,14 @@ export class SortFilterBar
|
|
|
714
666
|
}
|
|
715
667
|
|
|
716
668
|
#sort-by-text {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
669
|
+
text-transform: uppercase;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
#bottom-shadow {
|
|
673
|
+
height: 1px;
|
|
674
|
+
width: 100%;
|
|
675
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
|
676
|
+
background-color: #bbb;
|
|
721
677
|
}
|
|
722
678
|
|
|
723
679
|
ul {
|
|
@@ -732,28 +688,12 @@ export class SortFilterBar
|
|
|
732
688
|
padding: 0;
|
|
733
689
|
}
|
|
734
690
|
|
|
735
|
-
#sort-direction-selector {
|
|
736
|
-
display: flex;
|
|
737
|
-
flex-direction: column;
|
|
738
|
-
margin-right: 5px;
|
|
739
|
-
padding: 0;
|
|
740
|
-
border: none;
|
|
741
|
-
appearance: none;
|
|
742
|
-
background: transparent;
|
|
743
|
-
cursor: pointer;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
#sort-direction-selector:disabled {
|
|
747
|
-
cursor: default;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
691
|
.sort-button {
|
|
751
|
-
display: flex;
|
|
752
|
-
align-items: center;
|
|
753
692
|
background: none;
|
|
754
693
|
color: inherit;
|
|
755
694
|
border: none;
|
|
756
695
|
padding: 0;
|
|
696
|
+
cursor: pointer;
|
|
757
697
|
outline: inherit;
|
|
758
698
|
width: 12px;
|
|
759
699
|
height: 12px;
|
|
@@ -764,8 +704,9 @@ export class SortFilterBar
|
|
|
764
704
|
opacity: 1;
|
|
765
705
|
}
|
|
766
706
|
|
|
767
|
-
|
|
707
|
+
.sort-button:disabled {
|
|
768
708
|
opacity: 0.25;
|
|
709
|
+
cursor: default;
|
|
769
710
|
}
|
|
770
711
|
|
|
771
712
|
#date-sort-selector,
|
|
@@ -816,45 +757,42 @@ export class SortFilterBar
|
|
|
816
757
|
transform: rotate(180deg);
|
|
817
758
|
}
|
|
818
759
|
|
|
819
|
-
#sort-selector
|
|
820
|
-
flex: 1;
|
|
760
|
+
#sort-direction-selector {
|
|
821
761
|
display: flex;
|
|
822
|
-
|
|
823
|
-
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
gap: 3px;
|
|
764
|
+
margin-right: 1rem;
|
|
824
765
|
}
|
|
825
766
|
|
|
826
|
-
#
|
|
827
|
-
|
|
828
|
-
display: flex;
|
|
829
|
-
justify-content: flex-start;
|
|
830
|
-
align-items: center;
|
|
767
|
+
#sort-selector-container {
|
|
768
|
+
flex: 1;
|
|
831
769
|
}
|
|
832
770
|
|
|
833
771
|
/*
|
|
834
772
|
we move the desktop sort selector offscreen instead of display: none
|
|
835
773
|
because we need to observe the width of it vs its container to determine
|
|
836
|
-
if it's wide enough to display the desktop version and if you
|
|
774
|
+
if it's wide enough to display the desktop version and if you displY: none,
|
|
837
775
|
the width becomes 0
|
|
838
776
|
*/
|
|
839
|
-
#desktop-sort-
|
|
777
|
+
#desktop-sort-selector.hidden {
|
|
840
778
|
position: absolute;
|
|
841
779
|
top: -9999px;
|
|
842
780
|
left: -9999px;
|
|
843
|
-
visibility: hidden;
|
|
844
781
|
}
|
|
845
782
|
|
|
846
|
-
#mobile-sort-
|
|
783
|
+
#mobile-sort-selector.hidden {
|
|
847
784
|
display: none;
|
|
848
785
|
}
|
|
849
786
|
|
|
850
|
-
#sort-selector-backdrop
|
|
787
|
+
#date-sort-selector-backdrop,
|
|
788
|
+
#view-sort-selector-backdrop {
|
|
851
789
|
position: fixed;
|
|
852
790
|
top: 0;
|
|
853
791
|
left: 0;
|
|
854
|
-
width:
|
|
855
|
-
height:
|
|
792
|
+
width: 100%;
|
|
793
|
+
height: 100%;
|
|
856
794
|
z-index: 1;
|
|
857
|
-
background-color:
|
|
795
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
858
796
|
}
|
|
859
797
|
|
|
860
798
|
#desktop-sort-selector {
|
|
@@ -864,22 +802,30 @@ export class SortFilterBar
|
|
|
864
802
|
#desktop-sort-selector li {
|
|
865
803
|
display: flex;
|
|
866
804
|
align-items: center;
|
|
867
|
-
padding-left: 5px;
|
|
868
|
-
padding-right: 5px;
|
|
869
805
|
}
|
|
870
806
|
|
|
871
807
|
#desktop-sort-selector li a {
|
|
872
|
-
padding: 0 5px;
|
|
873
808
|
text-decoration: none;
|
|
809
|
+
text-transform: uppercase;
|
|
874
810
|
font-size: 1.4rem;
|
|
875
811
|
color: #333;
|
|
876
|
-
line-height: 2;
|
|
812
|
+
line-height: 2.5;
|
|
877
813
|
}
|
|
878
814
|
|
|
879
815
|
#desktop-sort-selector li a.selected {
|
|
880
816
|
font-weight: bold;
|
|
881
817
|
}
|
|
882
818
|
|
|
819
|
+
#desktop-sort-selector li::after {
|
|
820
|
+
content: '•';
|
|
821
|
+
padding-left: 1rem;
|
|
822
|
+
padding-right: 1rem;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
#desktop-sort-selector li:first-child::after {
|
|
826
|
+
content: '';
|
|
827
|
+
}
|
|
828
|
+
|
|
883
829
|
#desktop-sort-selector li:last-child::after {
|
|
884
830
|
content: '';
|
|
885
831
|
}
|
|
@@ -895,7 +841,7 @@ export class SortFilterBar
|
|
|
895
841
|
appearance: none;
|
|
896
842
|
cursor: pointer;
|
|
897
843
|
-webkit-appearance: none;
|
|
898
|
-
opacity: 0.
|
|
844
|
+
opacity: 0.5;
|
|
899
845
|
}
|
|
900
846
|
|
|
901
847
|
#display-style-selector button.active {
|
|
@@ -906,37 +852,5 @@ export class SortFilterBar
|
|
|
906
852
|
width: 24px;
|
|
907
853
|
height: 24px;
|
|
908
854
|
}
|
|
909
|
-
|
|
910
|
-
ia-dropdown {
|
|
911
|
-
--dropdownTextColor: white;
|
|
912
|
-
--dropdownFontSize: 1.4rem;
|
|
913
|
-
--dropdownOffsetTop: 0;
|
|
914
|
-
--dropdownBorderTopWidth: 0;
|
|
915
|
-
--dropdownBorderTopLeftRadius: 0;
|
|
916
|
-
--dropdownBorderTopRightRadius: 0;
|
|
917
|
-
--dropdownWhiteSpace: nowrap;
|
|
918
|
-
--dropdownListZIndex: 2;
|
|
919
|
-
--dropdownCaretColor: #2c2c2c;
|
|
920
|
-
--dropdownSelectedTextColor: white;
|
|
921
|
-
--dropdownSelectedBgColor: #2c2c2c;
|
|
922
|
-
--caretHeight: 9px;
|
|
923
|
-
--caretWidth: 14px;
|
|
924
|
-
}
|
|
925
|
-
ia-dropdown.selected .dropdown-label {
|
|
926
|
-
font-weight: bold;
|
|
927
|
-
}
|
|
928
|
-
ia-dropdown.open {
|
|
929
|
-
z-index: 2;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
.dropdown-label {
|
|
933
|
-
display: inline-block;
|
|
934
|
-
height: 100%;
|
|
935
|
-
padding-left: 5px;
|
|
936
|
-
font-size: 1.4rem;
|
|
937
|
-
line-height: 2;
|
|
938
|
-
color: #2c2c2c;
|
|
939
|
-
white-space: nowrap;
|
|
940
|
-
}
|
|
941
855
|
`;
|
|
942
856
|
}
|