@internetarchive/collection-browser 3.3.4-alpha-webdev7761.0 → 3.3.4-alpha-webdev7761.2

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.
@@ -23,7 +23,7 @@ import './manage/manage-bar';
23
23
  import './collection-facets';
24
24
  import './circular-activity-indicator';
25
25
  import './collection-facets/smart-facets/smart-facet-bar';
26
- import { mergeSelectedFacets, updateSelectedFacetBucket, } from './utils/facet-utils';
26
+ import { updateSelectedFacetBucket, } from './utils/facet-utils';
27
27
  let CollectionBrowser = class CollectionBrowser extends LitElement {
28
28
  constructor() {
29
29
  super();
@@ -186,6 +186,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
186
186
  this.placeholderCellTemplate = html `<collection-browser-loading-tile></collection-browser-loading-tile>`;
187
187
  this.selectedTVNetwork = undefined;
188
188
  this.selectedTVShow = undefined;
189
+ this.shouldPopulateShows = false;
189
190
  /**
190
191
  * Updates the height of the left column according to its position on the page.
191
192
  * Arrow function ensures proper `this` binding.
@@ -325,6 +326,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
325
326
  this.sortDirection = null;
326
327
  this.selectedSort = SortField.default;
327
328
  }
329
+ this.selectedTVNetwork = undefined;
330
+ this.selectedTVShow = undefined;
328
331
  if (this.smartFacetBar) {
329
332
  this.smartFacetBar.deselectAll();
330
333
  }
@@ -361,32 +364,32 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
361
364
  this.setPlaceholderType();
362
365
  }
363
366
  render() {
364
- return html `
367
+ return html `
365
368
  ${this.showSmartFacetBar && this.placeholderType === null
366
- ? html `<smart-facet-bar
367
- .query=${this.baseQuery}
368
- .aggregations=${this.dataSource.aggregations}
369
- .selectedFacets=${this.selectedFacets}
370
- .collectionTitles=${this.dataSource.collectionTitles}
371
- .filterToggleShown=${!this.mobileView}
372
- .filterToggleActive=${this.facetPaneVisible}
373
- .label=${this.smartFacetBarLabel}
374
- @facetsChanged=${this.facetsChanged}
369
+ ? html `<smart-facet-bar
370
+ .query=${this.baseQuery}
371
+ .aggregations=${this.dataSource.aggregations}
372
+ .selectedFacets=${this.selectedFacets}
373
+ .collectionTitles=${this.dataSource.collectionTitles}
374
+ .filterToggleShown=${!this.mobileView}
375
+ .filterToggleActive=${this.facetPaneVisible}
376
+ .label=${this.smartFacetBarLabel}
377
+ @facetsChanged=${this.facetsChanged}
375
378
  @filtersToggled=${() => {
376
379
  this.facetPaneVisible = !this.facetPaneVisible;
377
380
  this.emitFacetPaneVisibilityChanged();
378
- }}
381
+ }}
379
382
  ></smart-facet-bar>`
380
- : nothing}
381
-
382
- <div
383
- id="content-container"
384
- class=${this.mobileView ? 'mobile' : 'desktop'}
385
- >
383
+ : nothing}
384
+
385
+ <div
386
+ id="content-container"
387
+ class=${this.mobileView ? 'mobile' : 'desktop'}
388
+ >
386
389
  ${this.placeholderType
387
390
  ? this.emptyPlaceholderTemplate
388
- : this.collectionBrowserTemplate}
389
- </div>
391
+ : this.collectionBrowserTemplate}
392
+ </div>
390
393
  `;
391
394
  }
392
395
  /**
@@ -432,23 +435,23 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
432
435
  */
433
436
  get emptyPlaceholderTemplate() {
434
437
  var _a;
435
- return html `
436
- <empty-placeholder
437
- .placeholderType=${this.placeholderType}
438
- ?isMobileView=${this.mobileView}
439
- ?isCollection=${!!this.withinCollection}
440
- .detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
441
- .baseNavigationUrl=${this.baseNavigationUrl}
442
- ></empty-placeholder>
438
+ return html `
439
+ <empty-placeholder
440
+ .placeholderType=${this.placeholderType}
441
+ ?isMobileView=${this.mobileView}
442
+ ?isCollection=${!!this.withinCollection}
443
+ .detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
444
+ .baseNavigationUrl=${this.baseNavigationUrl}
445
+ ></empty-placeholder>
443
446
  `;
444
447
  }
445
448
  /**
446
449
  * Top-level template for rendering the left (facets) and right (results) columns.
447
450
  */
448
451
  get collectionBrowserTemplate() {
449
- return html `
450
- <div id="left-column-scroll-sentinel"></div>
451
- ${this.leftColumnTemplate} ${this.rightColumnTemplate}
452
+ return html `
453
+ <div id="left-column-scroll-sentinel"></div>
454
+ ${this.leftColumnTemplate} ${this.rightColumnTemplate}
452
455
  `;
453
456
  }
454
457
  /**
@@ -467,33 +470,33 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
467
470
  * accordion-style facets.
468
471
  */
469
472
  get mobileLeftColumnTemplate() {
470
- return html `
471
- <div
472
- id="left-column"
473
- class="column${this.isResizeToMobile ? ' preload' : ''}"
474
- >
475
- ${this.facetTopViewSlot} ${this.resultsCountTemplate}
476
- <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
477
- </div>
473
+ return html `
474
+ <div
475
+ id="left-column"
476
+ class="column${this.isResizeToMobile ? ' preload' : ''}"
477
+ >
478
+ ${this.facetTopViewSlot} ${this.resultsCountTemplate}
479
+ <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
480
+ </div>
478
481
  `;
479
482
  }
480
483
  /**
481
484
  * Template for the desktop version of the left column, displaying the facets sidebar.
482
485
  */
483
486
  get desktopLeftColumnTemplate() {
484
- return html `
485
- <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
486
- ${this.facetTopViewSlot}
487
- <div id="facets-header-container">
488
- <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
489
- ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
490
- </div>
491
- <div id="facets-container" aria-labelledby="facets-header">
492
- ${this.facetsTemplate}
493
- <div id="facets-scroll-sentinel"></div>
494
- </div>
495
- <div id="facets-bottom-fade"></div>
496
- </div>
487
+ return html `
488
+ <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
489
+ ${this.facetTopViewSlot}
490
+ <div id="facets-header-container">
491
+ <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
492
+ ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
493
+ </div>
494
+ <div id="facets-container" aria-labelledby="facets-header">
495
+ ${this.facetsTemplate}
496
+ <div id="facets-scroll-sentinel"></div>
497
+ </div>
498
+ <div id="facets-bottom-fade"></div>
499
+ </div>
497
500
  `;
498
501
  }
499
502
  /**
@@ -501,8 +504,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
501
504
  * - mainly used to render userlists
502
505
  */
503
506
  get facetTopViewSlot() {
504
- return html `<div id="facet-top-view">
505
- <slot name="facet-top-slot"></slot>
507
+ return html `<div id="facet-top-view">
508
+ <slot name="facet-top-slot"></slot>
506
509
  </div>`;
507
510
  }
508
511
  /**
@@ -517,15 +520,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
517
520
  const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
518
521
  const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
519
522
  // Added data-testid for Playwright testing
520
- return html `
521
- <div id="results-total" data-testid="results-total">
522
- <span id="big-results-count">
523
- ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
524
- </span>
525
- <span id="big-results-label">
526
- ${shouldShowSearching ? nothing : resultsLabel}
527
- </span>
528
- </div>
523
+ return html `
524
+ <div id="results-total" data-testid="results-total">
525
+ <span id="big-results-count">
526
+ ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
527
+ </span>
528
+ <span id="big-results-label">
529
+ ${shouldShowSearching ? nothing : resultsLabel}
530
+ </span>
531
+ </div>
529
532
  `;
530
533
  }
531
534
  /**
@@ -538,45 +541,45 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
538
541
  'full-width': !this.facetPaneVisible,
539
542
  'smart-results-spacing': !!this.showSmartResults,
540
543
  });
541
- return html `
542
- <div id="right-column" class=${rightColumnClasses}>
544
+ return html `
545
+ <div id="right-column" class=${rightColumnClasses}>
543
546
  ${this.showSmartResults
544
547
  ? html `<slot name="smart-results"></slot>`
545
- : nothing}
546
- <section id="results">
547
- <h2 class="results-section-heading">
548
- <slot name="results-heading"></slot>
549
- </h2>
550
- <div id="cb-top-view">
551
- <slot name="cb-top-slot"></slot>
552
- </div>
548
+ : nothing}
549
+ <section id="results">
550
+ <h2 class="results-section-heading">
551
+ <slot name="results-heading"></slot>
552
+ </h2>
553
+ <div id="cb-top-view">
554
+ <slot name="cb-top-slot"></slot>
555
+ </div>
553
556
  ${this.isManageView
554
557
  ? this.manageBarTemplate
555
- : this.sortFilterBarTemplate}
556
- <slot name="cb-results"></slot>
558
+ : this.sortFilterBarTemplate}
559
+ <slot name="cb-results"></slot>
557
560
  ${this.displayMode === `list-compact` && this.totalResults
558
561
  ? this.listHeaderTemplate
559
- : nothing}
560
- ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
561
- </section>
562
- </div>
562
+ : nothing}
563
+ ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
564
+ </section>
565
+ </div>
563
566
  `;
564
567
  }
565
568
  /**
566
569
  * Template for the infinite scroller widget that contains the result tiles.
567
570
  */
568
571
  get infiniteScrollerTemplate() {
569
- return html `<infinite-scroller
570
- class=${this.infiniteScrollerClasses}
571
- itemCount=${this.placeholderType ? 0 : nothing}
572
- ariaLandmarkLabel="Search results"
573
- .cellProvider=${this}
574
- .placeholderCellTemplate=${this.placeholderCellTemplate}
575
- @scrollThresholdReached=${this.scrollThresholdReached}
576
- @visibleCellsChanged=${this.visibleCellsChanged}
572
+ return html `<infinite-scroller
573
+ class=${this.infiniteScrollerClasses}
574
+ itemCount=${this.placeholderType ? 0 : nothing}
575
+ ariaLandmarkLabel="Search results"
576
+ .cellProvider=${this}
577
+ .placeholderCellTemplate=${this.placeholderCellTemplate}
578
+ @scrollThresholdReached=${this.scrollThresholdReached}
579
+ @visibleCellsChanged=${this.visibleCellsChanged}
577
580
  >${this.displayMode === 'grid'
578
581
  ? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
579
- : nothing}
582
+ : nothing}
580
583
  </infinite-scroller>`;
581
584
  }
582
585
  /**
@@ -617,32 +620,32 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
617
620
  }
618
621
  // We only show relevance sort if a search query is currently defined
619
622
  sortFieldAvailability.relevance = this.isRelevanceSortAvailable;
620
- return html `
621
- <sort-filter-bar
622
- .defaultSortField=${this.defaultSortField}
623
- .defaultSortDirection=${this.defaultSortDirection}
624
- .defaultViewSort=${defaultViewSort}
625
- .defaultDateSort=${defaultDateSort}
626
- .selectedSort=${this.selectedSort}
627
- .sortDirection=${this.sortDirection}
628
- .sortFieldAvailability=${sortFieldAvailability}
629
- .displayMode=${this.displayMode}
630
- .selectedTitleFilter=${this.selectedTitleFilter}
631
- .selectedCreatorFilter=${this.selectedCreatorFilter}
632
- .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
633
- .resizeObserver=${this.resizeObserver}
634
- .enableSortOptionsSlot=${this.enableSortOptionsSlot}
635
- .suppressDisplayModes=${this.suppressDisplayModes}
636
- @sortChanged=${this.userChangedSort}
637
- @displayModeChanged=${this.displayModeChanged}
638
- @titleLetterChanged=${this.titleLetterSelected}
639
- @creatorLetterChanged=${this.creatorLetterSelected}
640
- >
641
- ${this.tileBlurCheckboxTemplate}
642
- <slot name="sort-options-left" slot="sort-options-left"></slot>
643
- <slot name="sort-options" slot="sort-options"></slot>
644
- <slot name="sort-options-right" slot="sort-options-right"></slot>
645
- </sort-filter-bar>
623
+ return html `
624
+ <sort-filter-bar
625
+ .defaultSortField=${this.defaultSortField}
626
+ .defaultSortDirection=${this.defaultSortDirection}
627
+ .defaultViewSort=${defaultViewSort}
628
+ .defaultDateSort=${defaultDateSort}
629
+ .selectedSort=${this.selectedSort}
630
+ .sortDirection=${this.sortDirection}
631
+ .sortFieldAvailability=${sortFieldAvailability}
632
+ .displayMode=${this.displayMode}
633
+ .selectedTitleFilter=${this.selectedTitleFilter}
634
+ .selectedCreatorFilter=${this.selectedCreatorFilter}
635
+ .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
636
+ .resizeObserver=${this.resizeObserver}
637
+ .enableSortOptionsSlot=${this.enableSortOptionsSlot}
638
+ .suppressDisplayModes=${this.suppressDisplayModes}
639
+ @sortChanged=${this.userChangedSort}
640
+ @displayModeChanged=${this.displayModeChanged}
641
+ @titleLetterChanged=${this.titleLetterSelected}
642
+ @creatorLetterChanged=${this.creatorLetterSelected}
643
+ >
644
+ ${this.tileBlurCheckboxTemplate}
645
+ <slot name="sort-options-left" slot="sort-options-left"></slot>
646
+ <slot name="sort-options" slot="sort-options"></slot>
647
+ <slot name="sort-options-right" slot="sort-options-right"></slot>
648
+ </sort-filter-bar>
646
649
  `;
647
650
  }
648
651
  /**
@@ -654,20 +657,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
654
657
  // Only show the checkbox for @archive.org users
655
658
  if (!((_a = this.dataSource.sessionContext) === null || _a === void 0 ? void 0 : _a.is_archive_user))
656
659
  return nothing;
657
- return html `
658
- <label
659
- id="tile-blur-label"
660
- for="tile-blur-check"
661
- slot="sort-options-right"
662
- >
663
- ${msg('Blurring')}
664
- <input
665
- id="tile-blur-check"
666
- type="checkbox"
667
- ?checked=${!this.shouldSuppressTileBlurring}
668
- @change=${this.tileBlurCheckboxChanged}
669
- />
670
- </label>
660
+ return html `
661
+ <label
662
+ id="tile-blur-label"
663
+ for="tile-blur-check"
664
+ slot="sort-options-right"
665
+ >
666
+ ${msg('Blurring')}
667
+ <input
668
+ id="tile-blur-check"
669
+ type="checkbox"
670
+ ?checked=${!this.shouldSuppressTileBlurring}
671
+ @change=${this.tileBlurCheckboxChanged}
672
+ />
673
+ </label>
671
674
  `;
672
675
  }
673
676
  /**
@@ -693,27 +696,27 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
693
696
  * showing the management view. This generally replaces the sort bar when present.
694
697
  */
695
698
  get manageBarTemplate() {
696
- return html `
697
- <manage-bar
698
- .label=${this.manageViewLabel}
699
- .modalManager=${this.modalManager}
700
- .selectedItems=${this.dataSource.checkedTileModels}
701
- .manageViewModalMsg=${this.manageViewModalMsg}
702
- showSelectAll
703
- showUnselectAll
704
- ?showItemManageButton=${this.pageContext === 'search'}
705
- ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
706
- @removeItems=${this.handleRemoveItems}
707
- @manageItems=${this.handleManageItems}
708
- @selectAll=${() => this.dataSource.checkAllTiles()}
709
- @unselectAll=${() => this.dataSource.uncheckAllTiles()}
699
+ return html `
700
+ <manage-bar
701
+ .label=${this.manageViewLabel}
702
+ .modalManager=${this.modalManager}
703
+ .selectedItems=${this.dataSource.checkedTileModels}
704
+ .manageViewModalMsg=${this.manageViewModalMsg}
705
+ showSelectAll
706
+ showUnselectAll
707
+ ?showItemManageButton=${this.pageContext === 'search'}
708
+ ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
709
+ @removeItems=${this.handleRemoveItems}
710
+ @manageItems=${this.handleManageItems}
711
+ @selectAll=${() => this.dataSource.checkAllTiles()}
712
+ @unselectAll=${() => this.dataSource.uncheckAllTiles()}
710
713
  @cancel=${() => {
711
714
  this.isManageView = false;
712
715
  this.dataSource.uncheckAllTiles();
713
716
  if (this.searchResultsLoading)
714
717
  this.dataSource.resetPages();
715
- }}
716
- ></manage-bar>
718
+ }}
719
+ ></manage-bar>
717
720
  `;
718
721
  }
719
722
  /**
@@ -961,15 +964,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
961
964
  label: target.open ? 'open' : 'closed',
962
965
  });
963
966
  };
964
- return html `
965
- <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
966
- <summary>
967
- <span class="collapser-icon">${chevronIcon}</span>
968
- <h2>${msg('Filters')}</h2>
969
- ${this.clearFiltersBtnTemplate(true)}
970
- </summary>
971
- ${this.facetsTemplate}
972
- </details>
967
+ return html `
968
+ <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
969
+ <summary>
970
+ <span class="collapser-icon">${chevronIcon}</span>
971
+ <h2>${msg('Filters')}</h2>
972
+ ${this.clearFiltersBtnTemplate(true)}
973
+ </summary>
974
+ ${this.facetsTemplate}
975
+ </details>
973
976
  `;
974
977
  }
975
978
  async networksDropdownClicked() {
@@ -982,41 +985,59 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
982
985
  var _a, _b;
983
986
  (_a = this.tvShowsDropdown) === null || _a === void 0 ? void 0 : _a.classList.add('loading');
984
987
  await this.dataSource.populateTVChannelMaps();
988
+ // Delay for a single tick so that the loading indicator will be rendered
989
+ // while the dropdown options are being added
990
+ await new Promise(res => setTimeout(res, 0));
991
+ this.shouldPopulateShows = true;
992
+ await this.updateComplete;
985
993
  (_b = this.tvShowsDropdown) === null || _b === void 0 ? void 0 : _b.classList.remove('loading');
986
994
  }
987
995
  async networksDropdownChanged() {
988
- var _a;
989
- if (((_a = this.tvNetworksDropdown) === null || _a === void 0 ? void 0 : _a.selectedIndex) === 0) {
990
- this.selectedTVNetwork = undefined;
991
- return;
992
- }
993
- this.selectedTVNetwork = this.tvNetworksDropdown.selectedOptions[0].value;
994
- let newNetworkFacets = getDefaultSelectedFacets();
995
- for (const [channel, network,] of this.dataSource.tvChannelMaps.channelToNetwork.entries()) {
996
- if (network === this.selectedTVNetwork) {
997
- newNetworkFacets = updateSelectedFacetBucket(newNetworkFacets, 'creator', {
996
+ const previousNetwork = this.selectedTVNetwork;
997
+ this.selectedTVNetwork =
998
+ this.tvNetworksDropdown.selectedOptions[0].value || undefined;
999
+ const entries = this.dataSource.tvChannelMaps.channelToNetwork.entries();
1000
+ for (const [channel, network] of entries) {
1001
+ if (network === previousNetwork) {
1002
+ // Remove any previously-applied network filter
1003
+ const removedBucket = {
1004
+ key: channel.toLowerCase(),
1005
+ count: 0,
1006
+ state: 'none',
1007
+ };
1008
+ this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, 'creator', removedBucket, true);
1009
+ }
1010
+ else if (network === this.selectedTVNetwork) {
1011
+ const newBucket = {
998
1012
  key: channel.toLowerCase(),
999
1013
  count: 0,
1000
1014
  state: 'selected',
1001
- });
1015
+ };
1016
+ this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, 'creator', newBucket);
1002
1017
  }
1003
1018
  }
1004
- log(newNetworkFacets);
1005
- this.selectedFacets = mergeSelectedFacets(this.selectedFacets, newNetworkFacets);
1006
- log(this.selectedFacets);
1007
1019
  }
1008
1020
  async showsDropdownChanged() {
1009
- var _a;
1010
- if (((_a = this.tvShowsDropdown) === null || _a === void 0 ? void 0 : _a.selectedIndex) === 0) {
1011
- this.selectedTVShow = undefined;
1012
- return;
1021
+ const previousShow = this.selectedTVShow;
1022
+ this.selectedTVShow =
1023
+ this.tvShowsDropdown.selectedOptions[0].value || undefined;
1024
+ // Remove any previously-applied shows filter
1025
+ if (previousShow !== undefined) {
1026
+ const removedBucket = {
1027
+ key: previousShow,
1028
+ count: 0,
1029
+ state: 'none',
1030
+ };
1031
+ this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, 'program', removedBucket, true);
1032
+ }
1033
+ if (this.selectedTVShow) {
1034
+ const newBucket = {
1035
+ key: this.selectedTVShow,
1036
+ count: 0,
1037
+ state: 'selected',
1038
+ };
1039
+ this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, 'program', newBucket);
1013
1040
  }
1014
- this.selectedTVShow = this.tvShowsDropdown.selectedOptions[0].value;
1015
- this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, 'program', {
1016
- key: this.selectedTVShow,
1017
- count: 0,
1018
- state: 'selected',
1019
- });
1020
1041
  }
1021
1042
  get tvDropdownFiltersTemplate() {
1022
1043
  if (this.searchType !== SearchType.TV)
@@ -1032,27 +1053,53 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1032
1053
  }
1033
1054
  const shows = showEntries.map(([show]) => show);
1034
1055
  log('end filters template preprocess', Date.now());
1035
- return html `
1036
- <div id="tv-filters" slot="facets-top">
1037
- <select
1038
- id="tv-networks"
1039
- class="tv-filter-dropdown"
1040
- @click=${this.networksDropdownClicked}
1041
- @change=${this.networksDropdownChanged}
1042
- >
1043
- <option selected value="">${msg('Filter by Network')}</option>
1044
- ${map(networks, n => html `<option>${n}</option>`)}
1045
- </select>
1046
- <select
1047
- id="tv-shows"
1048
- class="tv-filter-dropdown"
1049
- @click=${this.showsDropdownClicked}
1050
- @change=${this.showsDropdownChanged}
1051
- >
1052
- <option selected value="">${msg('Filter by Show')}</option>
1053
- ${map(shows, s => html `<option>${s}</option>`)}
1054
- </select>
1055
- </div>
1056
+ const makeNetworkOption = (network) => html `
1057
+ <option ?selected=${this.selectedTVNetwork === network}>
1058
+ ${network}
1059
+ </option>
1060
+ `;
1061
+ const makeShowOption = (show) => html `
1062
+ <option ?selected=${this.selectedTVShow === show}>
1063
+ ${show}
1064
+ </option>
1065
+ `;
1066
+ const loadingIndicator = html `
1067
+ <img src="https://archive.org/images/loading.gif" />
1068
+ `;
1069
+ return html `
1070
+ <div id="tv-filters" slot="facets-top">
1071
+ <div class="tv-filter-dropdown-wrap">
1072
+ <select
1073
+ id="tv-networks"
1074
+ class="tv-filter-dropdown"
1075
+ @click=${this.networksDropdownClicked}
1076
+ @change=${this.networksDropdownChanged}
1077
+ >
1078
+ <option value="" ?selected=${!this.selectedTVNetwork}>
1079
+ ${msg('Filter by Network')}
1080
+ </option>
1081
+ ${map(networks, makeNetworkOption)}
1082
+ </select>
1083
+ ${loadingIndicator}
1084
+ </div>
1085
+
1086
+ <div class="tv-filter-dropdown-wrap">
1087
+ <select
1088
+ id="tv-shows"
1089
+ class="tv-filter-dropdown"
1090
+ @click=${this.showsDropdownClicked}
1091
+ @change=${this.showsDropdownChanged}
1092
+ >
1093
+ <option value="" ?selected=${!this.selectedTVShow}>
1094
+ ${msg('Filter by Show')}
1095
+ </option>
1096
+ ${this.shouldPopulateShows
1097
+ ? map(shows, makeShowOption)
1098
+ : nothing}
1099
+ </select>
1100
+ ${loadingIndicator}
1101
+ </div>
1102
+ </div>
1056
1103
  `;
1057
1104
  }
1058
1105
  /**
@@ -1062,10 +1109,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1062
1109
  if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
1063
1110
  return nothing;
1064
1111
  if (this.facetLoadStrategy === 'off') {
1065
- return html `
1066
- <p class="facets-message">
1067
- ${msg('Facets are temporarily unavailable.')}
1068
- </p>
1112
+ return html `
1113
+ <p class="facets-message">
1114
+ ${msg('Facets are temporarily unavailable.')}
1115
+ </p>
1069
1116
  `;
1070
1117
  }
1071
1118
  // We switch to TV facet ordering & date picker if we are in a TV collection or showing TV search results
@@ -1074,46 +1121,46 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1074
1121
  const facetDisplayOrder = shouldUseTvInterface
1075
1122
  ? tvFacetDisplayOrder
1076
1123
  : defaultFacetDisplayOrder;
1077
- const facets = html `
1078
- <collection-facets
1079
- .collectionPagePath=${this.collectionPagePath}
1080
- .parentCollections=${this.dataSource.parentCollections}
1081
- .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
1082
- .searchService=${this.searchService}
1083
- .featureFeedbackService=${this.featureFeedbackService}
1084
- .recaptchaManager=${this.recaptchaManager}
1085
- .resizeObserver=${this.resizeObserver}
1086
- .searchType=${this.searchType}
1087
- .aggregations=${this.dataSource.aggregations}
1088
- .histogramAggregation=${this.dataSource.histogramAggregation}
1089
- .minSelectedDate=${this.minSelectedDate}
1090
- .maxSelectedDate=${this.maxSelectedDate}
1091
- .selectedFacets=${this.selectedFacets}
1092
- .baseNavigationUrl=${this.baseNavigationUrl}
1093
- .collectionTitles=${this.dataSource.collectionTitles}
1094
- .tvChannelAliases=${this.dataSource.tvChannelAliases}
1095
- .showHistogramDatePicker=${this.showHistogramDatePicker}
1096
- .allowExpandingDatePicker=${!this.mobileView}
1097
- .allowDatePickerMonths=${shouldUseTvInterface}
1098
- .contentWidth=${this.contentWidth}
1099
- .query=${this.baseQuery}
1100
- .identifiers=${this.identifiers}
1101
- .filterMap=${this.dataSource.filterMap}
1102
- .isManageView=${this.isManageView}
1103
- .modalManager=${this.modalManager}
1104
- .analyticsHandler=${this.analyticsHandler}
1105
- .facetDisplayOrder=${facetDisplayOrder}
1106
- .isTvSearch=${shouldUseTvInterface}
1107
- ?collapsableFacets=${this.mobileView}
1108
- ?facetsLoading=${this.facetsLoading}
1109
- ?histogramAggregationLoading=${this.facetsLoading}
1110
- ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1111
- @facetClick=${this.facetClickHandler}
1112
- @facetsChanged=${this.facetsChanged}
1113
- @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1114
- >
1115
- ${this.tvDropdownFiltersTemplate}
1116
- </collection-facets>
1124
+ const facets = html `
1125
+ <collection-facets
1126
+ .collectionPagePath=${this.collectionPagePath}
1127
+ .parentCollections=${this.dataSource.parentCollections}
1128
+ .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
1129
+ .searchService=${this.searchService}
1130
+ .featureFeedbackService=${this.featureFeedbackService}
1131
+ .recaptchaManager=${this.recaptchaManager}
1132
+ .resizeObserver=${this.resizeObserver}
1133
+ .searchType=${this.searchType}
1134
+ .aggregations=${this.dataSource.aggregations}
1135
+ .histogramAggregation=${this.dataSource.histogramAggregation}
1136
+ .minSelectedDate=${this.minSelectedDate}
1137
+ .maxSelectedDate=${this.maxSelectedDate}
1138
+ .selectedFacets=${this.selectedFacets}
1139
+ .baseNavigationUrl=${this.baseNavigationUrl}
1140
+ .collectionTitles=${this.dataSource.collectionTitles}
1141
+ .tvChannelAliases=${this.dataSource.tvChannelAliases}
1142
+ .showHistogramDatePicker=${this.showHistogramDatePicker}
1143
+ .allowExpandingDatePicker=${!this.mobileView}
1144
+ .allowDatePickerMonths=${shouldUseTvInterface}
1145
+ .contentWidth=${this.contentWidth}
1146
+ .query=${this.baseQuery}
1147
+ .identifiers=${this.identifiers}
1148
+ .filterMap=${this.dataSource.filterMap}
1149
+ .isManageView=${this.isManageView}
1150
+ .modalManager=${this.modalManager}
1151
+ .analyticsHandler=${this.analyticsHandler}
1152
+ .facetDisplayOrder=${facetDisplayOrder}
1153
+ .isTvSearch=${shouldUseTvInterface}
1154
+ ?collapsableFacets=${this.mobileView}
1155
+ ?facetsLoading=${this.facetsLoading}
1156
+ ?histogramAggregationLoading=${this.facetsLoading}
1157
+ ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1158
+ @facetClick=${this.facetClickHandler}
1159
+ @facetsChanged=${this.facetsChanged}
1160
+ @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1161
+ >
1162
+ ${this.tvDropdownFiltersTemplate}
1163
+ </collection-facets>
1117
1164
  `;
1118
1165
  // If we are using one of the opt-in facet load strategies, we may need to wrap the
1119
1166
  // desktop view facets in a <details> widget so that patrons can opt into loading them.
@@ -1121,20 +1168,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1121
1168
  const showDesktopOptInWidget = this.facetLoadStrategy === 'opt-in' ||
1122
1169
  (this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);
1123
1170
  if (showDesktopOptInWidget && !this.mobileView) {
1124
- return html `
1125
- <details
1126
- class="desktop-facets-dropdown"
1171
+ return html `
1172
+ <details
1173
+ class="desktop-facets-dropdown"
1127
1174
  @toggle=${(e) => {
1128
1175
  const target = e.target;
1129
1176
  this.collapsibleFacetsVisible = target.open;
1130
- }}
1131
- >
1132
- <summary>
1133
- <span class="collapser-icon">${chevronIcon}</span>
1134
- <h2>${msg('Filters')}</h2>
1135
- </summary>
1136
- ${facets}
1137
- </details>
1177
+ }}
1178
+ >
1179
+ <summary>
1180
+ <span class="collapser-icon">${chevronIcon}</span>
1181
+ <h2>${msg('Filters')}</h2>
1182
+ </summary>
1183
+ ${facets}
1184
+ </details>
1138
1185
  `;
1139
1186
  }
1140
1187
  // Otherwise, just render the facets component bare
@@ -1154,34 +1201,34 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1154
1201
  mobile,
1155
1202
  });
1156
1203
  const buttonText = mobile ? 'Clear all' : 'Clear all filters';
1157
- return html `
1158
- <div class="clear-filters-btn-row">
1204
+ return html `
1205
+ <div class="clear-filters-btn-row">
1159
1206
  ${mobile
1160
1207
  ? html `<span class="clear-filters-btn-separator">&nbsp;</span>`
1161
- : nothing}
1162
- <button class=${buttonClasses} @click=${this.clearFilters}>
1163
- ${buttonText}
1164
- </button>
1165
- </div>
1208
+ : nothing}
1209
+ <button class=${buttonClasses} @click=${this.clearFilters}>
1210
+ ${buttonText}
1211
+ </button>
1212
+ </div>
1166
1213
  `;
1167
1214
  }
1168
1215
  /**
1169
1216
  * Template for the table header content that appears atop the compact list view.
1170
1217
  */
1171
1218
  get listHeaderTemplate() {
1172
- return html `
1173
- <div id="list-header">
1174
- <tile-dispatcher
1175
- .tileDisplayMode=${'list-header'}
1176
- .resizeObserver=${this.resizeObserver}
1177
- .sortParam=${this.sortParam}
1178
- .defaultSortParam=${this.defaultSortParam}
1179
- .mobileBreakpoint=${this.mobileBreakpoint}
1180
- .loggedIn=${this.loggedIn}
1181
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1182
- >
1183
- </tile-dispatcher>
1184
- </div>
1219
+ return html `
1220
+ <div id="list-header">
1221
+ <tile-dispatcher
1222
+ .tileDisplayMode=${'list-header'}
1223
+ .resizeObserver=${this.resizeObserver}
1224
+ .sortParam=${this.sortParam}
1225
+ .defaultSortParam=${this.defaultSortParam}
1226
+ .mobileBreakpoint=${this.mobileBreakpoint}
1227
+ .loggedIn=${this.loggedIn}
1228
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
1229
+ >
1230
+ </tile-dispatcher>
1231
+ </div>
1185
1232
  `;
1186
1233
  }
1187
1234
  /**
@@ -1937,28 +1984,28 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1937
1984
  const isRadioSearch = this.searchType === SearchType.RADIO;
1938
1985
  const { isTVCollection, isRadioCollection } = this;
1939
1986
  const shouldUseLocalTime = isTVSearch || isRadioSearch || isTVCollection || isRadioCollection;
1940
- return html `
1941
- <tile-dispatcher
1942
- .collectionPagePath=${this.collectionPagePath}
1943
- .baseNavigationUrl=${this.baseNavigationUrl}
1944
- .baseImageUrl=${this.baseImageUrl}
1945
- .model=${model}
1946
- .tileDisplayMode=${this.displayMode}
1947
- .resizeObserver=${this.resizeObserver}
1948
- .collectionTitles=${this.dataSource.collectionTitles}
1949
- .sortParam=${this.sortParam}
1950
- .defaultSortParam=${this.defaultSortParam}
1951
- .creatorFilter=${this.selectedCreatorFilter}
1952
- .mobileBreakpoint=${this.mobileBreakpoint}
1953
- .loggedIn=${this.loggedIn}
1954
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1955
- .isManageView=${this.isManageView}
1956
- ?showTvClips=${isTVSearch || isTVCollection}
1957
- ?enableHoverPane=${true}
1958
- ?useLocalTime=${shouldUseLocalTime}
1959
- @resultSelected=${(e) => this.resultSelected(e)}
1960
- >
1961
- </tile-dispatcher>
1987
+ return html `
1988
+ <tile-dispatcher
1989
+ .collectionPagePath=${this.collectionPagePath}
1990
+ .baseNavigationUrl=${this.baseNavigationUrl}
1991
+ .baseImageUrl=${this.baseImageUrl}
1992
+ .model=${model}
1993
+ .tileDisplayMode=${this.displayMode}
1994
+ .resizeObserver=${this.resizeObserver}
1995
+ .collectionTitles=${this.dataSource.collectionTitles}
1996
+ .sortParam=${this.sortParam}
1997
+ .defaultSortParam=${this.defaultSortParam}
1998
+ .creatorFilter=${this.selectedCreatorFilter}
1999
+ .mobileBreakpoint=${this.mobileBreakpoint}
2000
+ .loggedIn=${this.loggedIn}
2001
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
2002
+ .isManageView=${this.isManageView}
2003
+ ?showTvClips=${isTVSearch || isTVCollection}
2004
+ ?enableHoverPane=${true}
2005
+ ?useLocalTime=${shouldUseLocalTime}
2006
+ @resultSelected=${(e) => this.resultSelected(e)}
2007
+ >
2008
+ </tile-dispatcher>
1962
2009
  `;
1963
2010
  }
1964
2011
  /**
@@ -1994,451 +2041,466 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1994
2041
  static get styles() {
1995
2042
  return [
1996
2043
  srOnlyStyle,
1997
- css `
1998
- :host {
1999
- display: block;
2000
- --leftColumnWidth: 18rem;
2001
- --leftColumnPaddingTop: 2rem;
2002
- --leftColumnPaddingRight: 2.5rem;
2003
- }
2004
-
2005
- #facet-top-view {
2006
- display: flex;
2007
- }
2008
-
2009
- /**
2010
- * When page width resizes from desktop to mobile, use this class to
2011
- * disable expand/collapse transition when loading.
2012
- */
2013
- .preload * {
2014
- transition: none !important;
2015
- -webkit-transition: none !important;
2016
- -moz-transition: none !important;
2017
- -ms-transition: none !important;
2018
- -o-transition: none !important;
2019
- }
2020
-
2021
- #content-container {
2022
- display: flex;
2023
- }
2024
-
2025
- empty-placeholder {
2026
- margin-top: var(--placeholderMarginTop, 0);
2027
- }
2028
-
2029
- .collapser-icon {
2030
- display: inline-block;
2031
- }
2032
-
2033
- .collapser-icon svg {
2034
- display: inline-block;
2035
- width: 12px;
2036
- height: 12px;
2037
- transition: transform 0.2s ease-out;
2038
- }
2039
-
2040
- #mobile-filter-collapse {
2041
- width: 100%;
2042
- }
2043
-
2044
- #mobile-filter-collapse > summary {
2045
- cursor: pointer;
2046
- list-style: none;
2047
- }
2048
-
2049
- #mobile-filter-collapse[open] > summary {
2050
- margin-bottom: 10px;
2051
- }
2052
-
2053
- #mobile-filter-collapse h2 {
2054
- display: inline-block;
2055
- margin: 0;
2056
- font-size: 2rem;
2057
- }
2058
-
2059
- #mobile-filter-collapse[open] svg {
2060
- transform: rotate(90deg);
2061
- }
2062
-
2063
- #content-container.mobile {
2064
- display: block;
2065
- }
2066
-
2067
- #right-column {
2068
- flex: 1;
2069
- position: relative;
2070
- min-height: 90vh;
2071
- border-right: 1px solid rgb(232, 232, 232);
2072
- margin-top: var(--rightColumnMarginTop, 0);
2073
- padding-top: var(--rightColumnPaddingTop, 2rem);
2074
- background: #fff;
2075
- }
2076
-
2077
- #left-column:not([hidden]) + #right-column {
2078
- border-left: 1px solid rgb(232, 232, 232);
2079
- }
2080
-
2081
- #right-column.smart-results-spacing {
2082
- padding-top: 0.5rem;
2083
- border-right: none;
2084
- background: transparent;
2085
- min-width: 0;
2086
- }
2087
-
2088
- #results {
2089
- background: #fff;
2090
- padding-left: 1rem;
2091
- padding-right: 1rem;
2092
- }
2093
-
2094
- #right-column.smart-results-spacing #results {
2095
- border-radius: 10px 10px 0px 0px;
2096
- padding-top: 0.5rem;
2097
- margin-top: 1rem;
2098
- }
2099
-
2100
- .mobile #right-column {
2101
- border-left: none;
2102
- }
2103
-
2104
- .mobile #results {
2105
- padding: 5px 5px 0;
2106
- }
2107
-
2108
- #left-column {
2109
- width: var(--leftColumnWidth, 18rem);
2110
- /* Prevents Safari from shrinking col at first draw */
2111
- min-width: var(--leftColumnWidth, 18rem);
2112
- padding-top: var(--leftColumnPaddingTop, 2rem);
2113
- /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2114
- padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2115
- border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2116
- z-index: 1;
2117
- }
2118
-
2119
- .desktop #left-column {
2120
- top: 0;
2121
- position: sticky;
2122
- height: calc(100vh - 2rem);
2123
- max-height: calc(100vh - 2rem);
2124
- overflow-x: hidden;
2125
- overflow-y: scroll;
2126
-
2127
- /*
2128
- * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2129
- * does at least give us a tiny bit of control over width & color.
2130
- */
2131
- scrollbar-width: thin;
2132
- scrollbar-color: transparent transparent;
2133
- }
2134
- .desktop #left-column:hover {
2135
- scrollbar-color: auto;
2136
- }
2137
- .desktop #left-column::-webkit-scrollbar {
2138
- appearance: none;
2139
- width: 6px;
2140
- }
2141
- .desktop #left-column::-webkit-scrollbar-button {
2142
- height: 3px;
2143
- background: transparent;
2144
- }
2145
- .desktop #left-column::-webkit-scrollbar-corner {
2146
- background: transparent;
2147
- }
2148
- .desktop #left-column::-webkit-scrollbar-thumb {
2149
- border-radius: 4px;
2150
- }
2151
- .desktop #left-column:hover::-webkit-scrollbar-thumb {
2152
- background: rgba(0, 0, 0, 0.15);
2153
- }
2154
- .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2155
- background: rgba(0, 0, 0, 0.2);
2156
- }
2157
- .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2158
- background: rgba(0, 0, 0, 0.3);
2159
- }
2160
-
2161
- #facets-bottom-fade {
2162
- background: linear-gradient(
2163
- to bottom,
2164
- #f5f5f700 0%,
2165
- #f5f5f7c0 50%,
2166
- #f5f5f7 80%,
2167
- #f5f5f7 100%
2168
- );
2169
- position: fixed;
2170
- bottom: 0;
2171
- height: 50px;
2172
- /* Wide enough to cover the content, but leave the scrollbar uncovered */
2173
- width: calc(
2174
- var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2175
- );
2176
- z-index: 2;
2177
- pointer-events: none;
2178
- transition: height 0.1s ease;
2179
- }
2180
- #facets-bottom-fade.hidden {
2181
- height: 0;
2182
- }
2183
-
2184
- .facets-message {
2185
- font-size: 1.4rem;
2186
- }
2187
-
2188
- .desktop-facets-dropdown > summary {
2189
- cursor: pointer;
2190
- list-style: none;
2191
- }
2192
-
2193
- .desktop-facets-dropdown h2 {
2194
- display: inline-block;
2195
- margin: 0;
2196
- font-size: 1.6rem;
2197
- }
2198
-
2199
- .desktop-facets-dropdown[open] > summary {
2200
- margin-bottom: 10px;
2201
- }
2202
-
2203
- .desktop-facets-dropdown[open] svg {
2204
- transform: rotate(90deg);
2205
- }
2206
-
2207
- .desktop #left-column-scroll-sentinel {
2208
- width: 1px;
2209
- height: 100vh;
2210
- background: transparent;
2211
- }
2212
-
2213
- .desktop #facets-scroll-sentinel {
2214
- width: 1px;
2215
- height: 1px;
2216
- background: transparent;
2217
- }
2218
-
2219
- #facets-header-container {
2220
- display: flex;
2221
- justify-content: space-between;
2222
- align-items: flex-start;
2223
- clear: both;
2224
- }
2225
-
2226
- .desktop #facets-header-container {
2227
- flex-wrap: wrap;
2228
- }
2229
-
2230
- .mobile #left-column {
2231
- width: 100%;
2232
- min-width: 0;
2233
- padding: 5px 0;
2234
- border: 0;
2235
- }
2236
-
2237
- .clear-filters-btn-row {
2238
- display: inline-block;
2239
- }
2240
-
2241
- .desktop .clear-filters-btn-row {
2242
- width: 100%;
2243
- }
2244
-
2245
- .clear-filters-btn {
2246
- display: inline-block;
2247
- appearance: none;
2248
- margin: 0;
2249
- padding: 0;
2250
- border: 0;
2251
- background: none;
2252
- color: var(--ia-theme-link-color);
2253
- font-size: 1.4rem;
2254
- font-family: inherit;
2255
- cursor: pointer;
2256
- }
2257
-
2258
- .clear-filters-btn:hover {
2259
- text-decoration: underline;
2260
- }
2261
-
2262
- .clear-filters-btn-separator {
2263
- display: inline-block;
2264
- margin-left: 5px;
2265
- border-left: 1px solid #2c2c2c;
2266
- font-size: 1.4rem;
2267
- line-height: 1.3rem;
2268
- }
2269
-
2270
- #tv-filters {
2271
- margin-bottom: 15px;
2272
- }
2273
-
2274
- .tv-filter-dropdown {
2275
- width: 100%;
2276
- padding: 3px;
2277
- margin-bottom: 5px;
2278
- }
2279
-
2280
- #facets-container {
2281
- position: relative;
2282
- max-height: 0;
2283
- transition: max-height 0.2s ease-in-out;
2284
- z-index: 1;
2285
- margin-top: var(--facetsContainerMarginTop, 5rem);
2286
- padding-bottom: 2rem;
2287
- }
2288
-
2289
- .desktop #facets-container {
2290
- width: 18rem;
2291
- }
2292
-
2293
- .mobile #facets-container {
2294
- overflow: hidden;
2295
- padding-bottom: 0;
2296
- padding-left: 10px;
2297
- padding-right: 10px;
2298
- }
2299
-
2300
- #facets-container.expanded {
2301
- max-height: 2000px;
2302
- }
2303
-
2304
- .results-section-heading {
2305
- margin: 0.5rem 0.3rem;
2306
- font-size: 2rem;
2307
- line-height: 25px;
2308
- }
2309
-
2310
- #results-total {
2311
- display: flex;
2312
- align-items: baseline;
2313
- }
2314
-
2315
- .mobile #results-total {
2316
- position: absolute;
2317
- right: 10px;
2318
- }
2319
-
2320
- #big-results-count {
2321
- font-size: 2.4rem;
2322
- font-weight: 500;
2323
- margin-right: 5px;
2324
- }
2325
-
2326
- .mobile #big-results-count {
2327
- font-size: 2rem;
2328
- }
2329
-
2330
- #big-results-label {
2331
- font-size: 1.4rem;
2332
- font-weight: 200;
2333
- }
2334
-
2335
- #list-header {
2336
- max-height: 4.2rem;
2337
- }
2338
-
2339
- .loading-cover {
2340
- position: absolute;
2341
- top: 0;
2342
- left: 0;
2343
- width: 100%;
2344
- height: 100%;
2345
- display: flex;
2346
- justify-content: center;
2347
- z-index: 1;
2348
- padding-top: 50px;
2349
- }
2350
-
2351
- #tile-blur-label {
2352
- display: flex;
2353
- align-items: center;
2354
- column-gap: 5px;
2355
- }
2356
-
2357
- #tile-blur-check {
2358
- margin: 0 5px 0 0;
2359
- width: 15px;
2360
- }
2361
-
2362
- circular-activity-indicator {
2363
- width: 30px;
2364
- height: 30px;
2365
- }
2366
-
2367
- sort-filter-bar {
2368
- display: block;
2369
- margin-bottom: 4rem;
2370
- }
2371
-
2372
- infinite-scroller {
2373
- display: block;
2374
- --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2375
- --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2376
- }
2377
-
2378
- infinite-scroller.list-compact {
2379
- --infiniteScrollerCellMinWidth: var(
2380
- --collectionBrowserCellMinWidth,
2381
- 100%
2382
- );
2383
- --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2384
- --infiniteScrollerCellMaxHeight: 56px;
2385
- --infiniteScrollerRowGap: 10px;
2386
- }
2387
-
2388
- infinite-scroller.list-detail {
2389
- --infiniteScrollerCellMinWidth: var(
2390
- --collectionBrowserCellMinWidth,
2391
- 100%
2392
- );
2393
- --infiniteScrollerCellMinHeight: var(
2394
- --collectionBrowserCellMinHeight,
2395
- 5rem
2396
- );
2397
- /*
2398
- 30px in spec, compensating for a -4px margin
2399
- to align title with top of item image
2400
- src/tiles/list/tile-list.ts
2401
- */
2402
- --infiniteScrollerRowGap: 34px;
2403
- }
2404
-
2405
- .mobile infinite-scroller.list-detail {
2406
- --infiniteScrollerRowGap: 24px;
2407
- }
2408
-
2409
- infinite-scroller.grid {
2410
- --infiniteScrollerCellMinWidth: var(
2411
- --collectionBrowserCellMinWidth,
2412
- 17rem
2413
- );
2414
- --infiniteScrollerCellMaxWidth: var(
2415
- --collectionBrowserCellMaxWidth,
2416
- 1fr
2417
- );
2418
- }
2419
-
2420
- /* Allow tiles to shrink a bit further at smaller viewport widths */
2421
- @media screen and (max-width: 880px) {
2422
- infinite-scroller.grid {
2423
- --infiniteScrollerCellMinWidth: var(
2424
- --collectionBrowserCellMinWidth,
2425
- 15rem
2426
- );
2427
- }
2428
- }
2429
- /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2430
- @media screen and (max-width: 360px) {
2431
- infinite-scroller.grid {
2432
- --infiniteScrollerCellMinWidth: var(
2433
- --collectionBrowserCellMinWidth,
2434
- 12rem
2435
- );
2436
- }
2437
- }
2438
-
2439
- infinite-scroller.hidden {
2440
- display: none;
2441
- }
2044
+ css `
2045
+ :host {
2046
+ display: block;
2047
+ --leftColumnWidth: 18rem;
2048
+ --leftColumnPaddingTop: 2rem;
2049
+ --leftColumnPaddingRight: 2.5rem;
2050
+ }
2051
+
2052
+ #facet-top-view {
2053
+ display: flex;
2054
+ }
2055
+
2056
+ /**
2057
+ * When page width resizes from desktop to mobile, use this class to
2058
+ * disable expand/collapse transition when loading.
2059
+ */
2060
+ .preload * {
2061
+ transition: none !important;
2062
+ -webkit-transition: none !important;
2063
+ -moz-transition: none !important;
2064
+ -ms-transition: none !important;
2065
+ -o-transition: none !important;
2066
+ }
2067
+
2068
+ #content-container {
2069
+ display: flex;
2070
+ }
2071
+
2072
+ empty-placeholder {
2073
+ margin-top: var(--placeholderMarginTop, 0);
2074
+ }
2075
+
2076
+ .collapser-icon {
2077
+ display: inline-block;
2078
+ }
2079
+
2080
+ .collapser-icon svg {
2081
+ display: inline-block;
2082
+ width: 12px;
2083
+ height: 12px;
2084
+ transition: transform 0.2s ease-out;
2085
+ }
2086
+
2087
+ #mobile-filter-collapse {
2088
+ width: 100%;
2089
+ }
2090
+
2091
+ #mobile-filter-collapse > summary {
2092
+ cursor: pointer;
2093
+ list-style: none;
2094
+ }
2095
+
2096
+ #mobile-filter-collapse[open] > summary {
2097
+ margin-bottom: 10px;
2098
+ }
2099
+
2100
+ #mobile-filter-collapse h2 {
2101
+ display: inline-block;
2102
+ margin: 0;
2103
+ font-size: 2rem;
2104
+ }
2105
+
2106
+ #mobile-filter-collapse[open] svg {
2107
+ transform: rotate(90deg);
2108
+ }
2109
+
2110
+ #content-container.mobile {
2111
+ display: block;
2112
+ }
2113
+
2114
+ #right-column {
2115
+ flex: 1;
2116
+ position: relative;
2117
+ min-height: 90vh;
2118
+ border-right: 1px solid rgb(232, 232, 232);
2119
+ margin-top: var(--rightColumnMarginTop, 0);
2120
+ padding-top: var(--rightColumnPaddingTop, 2rem);
2121
+ background: #fff;
2122
+ }
2123
+
2124
+ #left-column:not([hidden]) + #right-column {
2125
+ border-left: 1px solid rgb(232, 232, 232);
2126
+ }
2127
+
2128
+ #right-column.smart-results-spacing {
2129
+ padding-top: 0.5rem;
2130
+ border-right: none;
2131
+ background: transparent;
2132
+ min-width: 0;
2133
+ }
2134
+
2135
+ #results {
2136
+ background: #fff;
2137
+ padding-left: 1rem;
2138
+ padding-right: 1rem;
2139
+ }
2140
+
2141
+ #right-column.smart-results-spacing #results {
2142
+ border-radius: 10px 10px 0px 0px;
2143
+ padding-top: 0.5rem;
2144
+ margin-top: 1rem;
2145
+ }
2146
+
2147
+ .mobile #right-column {
2148
+ border-left: none;
2149
+ }
2150
+
2151
+ .mobile #results {
2152
+ padding: 5px 5px 0;
2153
+ }
2154
+
2155
+ #left-column {
2156
+ width: var(--leftColumnWidth, 18rem);
2157
+ /* Prevents Safari from shrinking col at first draw */
2158
+ min-width: var(--leftColumnWidth, 18rem);
2159
+ padding-top: var(--leftColumnPaddingTop, 2rem);
2160
+ /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2161
+ padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2162
+ border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2163
+ z-index: 1;
2164
+ }
2165
+
2166
+ .desktop #left-column {
2167
+ top: 0;
2168
+ position: sticky;
2169
+ height: calc(100vh - 2rem);
2170
+ max-height: calc(100vh - 2rem);
2171
+ overflow-x: hidden;
2172
+ overflow-y: scroll;
2173
+
2174
+ /*
2175
+ * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2176
+ * does at least give us a tiny bit of control over width & color.
2177
+ */
2178
+ scrollbar-width: thin;
2179
+ scrollbar-color: transparent transparent;
2180
+ }
2181
+ .desktop #left-column:hover {
2182
+ scrollbar-color: auto;
2183
+ }
2184
+ .desktop #left-column::-webkit-scrollbar {
2185
+ appearance: none;
2186
+ width: 6px;
2187
+ }
2188
+ .desktop #left-column::-webkit-scrollbar-button {
2189
+ height: 3px;
2190
+ background: transparent;
2191
+ }
2192
+ .desktop #left-column::-webkit-scrollbar-corner {
2193
+ background: transparent;
2194
+ }
2195
+ .desktop #left-column::-webkit-scrollbar-thumb {
2196
+ border-radius: 4px;
2197
+ }
2198
+ .desktop #left-column:hover::-webkit-scrollbar-thumb {
2199
+ background: rgba(0, 0, 0, 0.15);
2200
+ }
2201
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2202
+ background: rgba(0, 0, 0, 0.2);
2203
+ }
2204
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2205
+ background: rgba(0, 0, 0, 0.3);
2206
+ }
2207
+
2208
+ #facets-bottom-fade {
2209
+ background: linear-gradient(
2210
+ to bottom,
2211
+ #f5f5f700 0%,
2212
+ #f5f5f7c0 50%,
2213
+ #f5f5f7 80%,
2214
+ #f5f5f7 100%
2215
+ );
2216
+ position: fixed;
2217
+ bottom: 0;
2218
+ height: 50px;
2219
+ /* Wide enough to cover the content, but leave the scrollbar uncovered */
2220
+ width: calc(
2221
+ var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2222
+ );
2223
+ z-index: 2;
2224
+ pointer-events: none;
2225
+ transition: height 0.1s ease;
2226
+ }
2227
+ #facets-bottom-fade.hidden {
2228
+ height: 0;
2229
+ }
2230
+
2231
+ .facets-message {
2232
+ font-size: 1.4rem;
2233
+ }
2234
+
2235
+ .desktop-facets-dropdown > summary {
2236
+ cursor: pointer;
2237
+ list-style: none;
2238
+ }
2239
+
2240
+ .desktop-facets-dropdown h2 {
2241
+ display: inline-block;
2242
+ margin: 0;
2243
+ font-size: 1.6rem;
2244
+ }
2245
+
2246
+ .desktop-facets-dropdown[open] > summary {
2247
+ margin-bottom: 10px;
2248
+ }
2249
+
2250
+ .desktop-facets-dropdown[open] svg {
2251
+ transform: rotate(90deg);
2252
+ }
2253
+
2254
+ .desktop #left-column-scroll-sentinel {
2255
+ width: 1px;
2256
+ height: 100vh;
2257
+ background: transparent;
2258
+ }
2259
+
2260
+ .desktop #facets-scroll-sentinel {
2261
+ width: 1px;
2262
+ height: 1px;
2263
+ background: transparent;
2264
+ }
2265
+
2266
+ #facets-header-container {
2267
+ display: flex;
2268
+ justify-content: space-between;
2269
+ align-items: flex-start;
2270
+ clear: both;
2271
+ }
2272
+
2273
+ .desktop #facets-header-container {
2274
+ flex-wrap: wrap;
2275
+ }
2276
+
2277
+ .mobile #left-column {
2278
+ width: 100%;
2279
+ min-width: 0;
2280
+ padding: 5px 0;
2281
+ border: 0;
2282
+ }
2283
+
2284
+ .clear-filters-btn-row {
2285
+ display: inline-block;
2286
+ }
2287
+
2288
+ .desktop .clear-filters-btn-row {
2289
+ width: 100%;
2290
+ }
2291
+
2292
+ .clear-filters-btn {
2293
+ display: inline-block;
2294
+ appearance: none;
2295
+ margin: 0;
2296
+ padding: 0;
2297
+ border: 0;
2298
+ background: none;
2299
+ color: var(--ia-theme-link-color);
2300
+ font-size: 1.4rem;
2301
+ font-family: inherit;
2302
+ cursor: pointer;
2303
+ }
2304
+
2305
+ .clear-filters-btn:hover {
2306
+ text-decoration: underline;
2307
+ }
2308
+
2309
+ .clear-filters-btn-separator {
2310
+ display: inline-block;
2311
+ margin-left: 5px;
2312
+ border-left: 1px solid #2c2c2c;
2313
+ font-size: 1.4rem;
2314
+ line-height: 1.3rem;
2315
+ }
2316
+
2317
+ #tv-filters {
2318
+ margin-bottom: 15px;
2319
+ }
2320
+
2321
+ .tv-filter-dropdown {
2322
+ width: 100%;
2323
+ padding: 3px;
2324
+ }
2325
+
2326
+ .tv-filter-dropdown-wrap {
2327
+ display: flex;
2328
+ align-items: center;
2329
+ column-gap: 5px;
2330
+ margin-bottom: 5px;
2331
+ }
2332
+
2333
+ .tv-filter-dropdown-wrap > img {
2334
+ flex: 1;
2335
+ visibility: hidden;
2336
+ }
2337
+
2338
+ .tv-filter-dropdown.loading + img {
2339
+ visibility: visible;
2340
+ }
2341
+
2342
+ #facets-container {
2343
+ position: relative;
2344
+ max-height: 0;
2345
+ transition: max-height 0.2s ease-in-out;
2346
+ z-index: 1;
2347
+ margin-top: var(--facetsContainerMarginTop, 5rem);
2348
+ padding-bottom: 2rem;
2349
+ }
2350
+
2351
+ .desktop #facets-container {
2352
+ width: 18rem;
2353
+ }
2354
+
2355
+ .mobile #facets-container {
2356
+ overflow: hidden;
2357
+ padding-bottom: 0;
2358
+ padding-left: 10px;
2359
+ padding-right: 10px;
2360
+ }
2361
+
2362
+ #facets-container.expanded {
2363
+ max-height: 2000px;
2364
+ }
2365
+
2366
+ .results-section-heading {
2367
+ margin: 0.5rem 0.3rem;
2368
+ font-size: 2rem;
2369
+ line-height: 25px;
2370
+ }
2371
+
2372
+ #results-total {
2373
+ display: flex;
2374
+ align-items: baseline;
2375
+ }
2376
+
2377
+ .mobile #results-total {
2378
+ position: absolute;
2379
+ right: 10px;
2380
+ }
2381
+
2382
+ #big-results-count {
2383
+ font-size: 2.4rem;
2384
+ font-weight: 500;
2385
+ margin-right: 5px;
2386
+ }
2387
+
2388
+ .mobile #big-results-count {
2389
+ font-size: 2rem;
2390
+ }
2391
+
2392
+ #big-results-label {
2393
+ font-size: 1.4rem;
2394
+ font-weight: 200;
2395
+ }
2396
+
2397
+ #list-header {
2398
+ max-height: 4.2rem;
2399
+ }
2400
+
2401
+ .loading-cover {
2402
+ position: absolute;
2403
+ top: 0;
2404
+ left: 0;
2405
+ width: 100%;
2406
+ height: 100%;
2407
+ display: flex;
2408
+ justify-content: center;
2409
+ z-index: 1;
2410
+ padding-top: 50px;
2411
+ }
2412
+
2413
+ #tile-blur-label {
2414
+ display: flex;
2415
+ align-items: center;
2416
+ column-gap: 5px;
2417
+ }
2418
+
2419
+ #tile-blur-check {
2420
+ margin: 0 5px 0 0;
2421
+ width: 15px;
2422
+ }
2423
+
2424
+ circular-activity-indicator {
2425
+ width: 30px;
2426
+ height: 30px;
2427
+ }
2428
+
2429
+ sort-filter-bar {
2430
+ display: block;
2431
+ margin-bottom: 4rem;
2432
+ }
2433
+
2434
+ infinite-scroller {
2435
+ display: block;
2436
+ --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2437
+ --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2438
+ }
2439
+
2440
+ infinite-scroller.list-compact {
2441
+ --infiniteScrollerCellMinWidth: var(
2442
+ --collectionBrowserCellMinWidth,
2443
+ 100%
2444
+ );
2445
+ --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2446
+ --infiniteScrollerCellMaxHeight: 56px;
2447
+ --infiniteScrollerRowGap: 10px;
2448
+ }
2449
+
2450
+ infinite-scroller.list-detail {
2451
+ --infiniteScrollerCellMinWidth: var(
2452
+ --collectionBrowserCellMinWidth,
2453
+ 100%
2454
+ );
2455
+ --infiniteScrollerCellMinHeight: var(
2456
+ --collectionBrowserCellMinHeight,
2457
+ 5rem
2458
+ );
2459
+ /*
2460
+ 30px in spec, compensating for a -4px margin
2461
+ to align title with top of item image
2462
+ src/tiles/list/tile-list.ts
2463
+ */
2464
+ --infiniteScrollerRowGap: 34px;
2465
+ }
2466
+
2467
+ .mobile infinite-scroller.list-detail {
2468
+ --infiniteScrollerRowGap: 24px;
2469
+ }
2470
+
2471
+ infinite-scroller.grid {
2472
+ --infiniteScrollerCellMinWidth: var(
2473
+ --collectionBrowserCellMinWidth,
2474
+ 17rem
2475
+ );
2476
+ --infiniteScrollerCellMaxWidth: var(
2477
+ --collectionBrowserCellMaxWidth,
2478
+ 1fr
2479
+ );
2480
+ }
2481
+
2482
+ /* Allow tiles to shrink a bit further at smaller viewport widths */
2483
+ @media screen and (max-width: 880px) {
2484
+ infinite-scroller.grid {
2485
+ --infiniteScrollerCellMinWidth: var(
2486
+ --collectionBrowserCellMinWidth,
2487
+ 15rem
2488
+ );
2489
+ }
2490
+ }
2491
+ /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2492
+ @media screen and (max-width: 360px) {
2493
+ infinite-scroller.grid {
2494
+ --infiniteScrollerCellMinWidth: var(
2495
+ --collectionBrowserCellMinWidth,
2496
+ 12rem
2497
+ );
2498
+ }
2499
+ }
2500
+
2501
+ infinite-scroller.hidden {
2502
+ display: none;
2503
+ }
2442
2504
  `,
2443
2505
  ];
2444
2506
  }
@@ -2656,6 +2718,9 @@ __decorate([
2656
2718
  __decorate([
2657
2719
  state()
2658
2720
  ], CollectionBrowser.prototype, "selectedTVShow", void 0);
2721
+ __decorate([
2722
+ state()
2723
+ ], CollectionBrowser.prototype, "shouldPopulateShows", void 0);
2659
2724
  __decorate([
2660
2725
  query('#tv-networks')
2661
2726
  ], CollectionBrowser.prototype, "tvNetworksDropdown", void 0);