@internetarchive/collection-browser 2.19.1-alpha-webdev7818.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app-root.js +606 -605
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +26 -9
- package/dist/src/collection-browser.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/collection-facets.js +263 -263
- package/dist/src/collection-facets.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/models.d.ts +13 -0
- package/dist/src/models.js +41 -0
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +79 -24
- package/dist/src/sort-filter-bar/sort-filter-bar.js +201 -119
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +139 -139
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +118 -118
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +289 -289
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +200 -200
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +157 -11
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +30 -8
- 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/collection-facets.ts +990 -990
- package/src/expanded-date-picker.ts +191 -191
- package/src/models.ts +48 -0
- package/src/sort-filter-bar/sort-filter-bar.ts +220 -126
- package/src/tiles/grid/item-tile.ts +339 -339
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +129 -129
- package/src/tiles/list/tile-list.ts +688 -688
- package/src/tiles/tile-dispatcher.ts +486 -486
- package/test/sort-filter-bar/sort-filter-bar.test.ts +205 -12
- package/tsconfig.json +1 -1
|
@@ -47,6 +47,9 @@ import {
|
|
|
47
47
|
tvFacetDisplayOrder,
|
|
48
48
|
TvClipFilterType,
|
|
49
49
|
TileBlurOverrideState,
|
|
50
|
+
defaultSortAvailability,
|
|
51
|
+
favoritesSortAvailability,
|
|
52
|
+
tvSortAvailability,
|
|
50
53
|
} from './models';
|
|
51
54
|
import {
|
|
52
55
|
RestorationStateHandlerInterface,
|
|
@@ -236,7 +239,7 @@ export class CollectionBrowser
|
|
|
236
239
|
*/
|
|
237
240
|
@property({ type: String }) facetLoadStrategy: FacetLoadStrategy = 'eager';
|
|
238
241
|
|
|
239
|
-
@property({ type: Boolean }) facetPaneVisible = false;
|
|
242
|
+
@property({ type: Boolean, reflect: true }) facetPaneVisible = false;
|
|
240
243
|
|
|
241
244
|
@property({ type: Boolean }) clearResultsOnEmptyQuery = false;
|
|
242
245
|
|
|
@@ -675,11 +678,7 @@ export class CollectionBrowser
|
|
|
675
678
|
*/
|
|
676
679
|
private get desktopLeftColumnTemplate(): TemplateResult {
|
|
677
680
|
return html`
|
|
678
|
-
<div
|
|
679
|
-
id="left-column"
|
|
680
|
-
class="column"
|
|
681
|
-
?hidden=${!this.facetPaneVisible}
|
|
682
|
-
>
|
|
681
|
+
<div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
|
|
683
682
|
${this.facetTopViewSlot}
|
|
684
683
|
<div id="facets-header-container">
|
|
685
684
|
<h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
|
|
@@ -802,14 +801,37 @@ export class CollectionBrowser
|
|
|
802
801
|
private get sortFilterBarTemplate(): TemplateResult | typeof nothing {
|
|
803
802
|
if (this.suppressSortBar) return nothing;
|
|
804
803
|
|
|
804
|
+
// Determine the set of sortable fields that should be shown in the sort bar
|
|
805
|
+
let defaultViewSort = SortField.weeklyview;
|
|
806
|
+
let defaultDateSort = SortField.date;
|
|
807
|
+
let sortFieldAvailability = defaultSortAvailability;
|
|
808
|
+
|
|
809
|
+
// We adjust the sort options for a couple of special cases...
|
|
810
|
+
if (this.withinCollection?.startsWith('fav-')) {
|
|
811
|
+
// When viewing a fav- collection, we include the Date Favorited option and show
|
|
812
|
+
// it as the default in the date dropdown.
|
|
813
|
+
defaultDateSort = SortField.datefavorited;
|
|
814
|
+
sortFieldAvailability = favoritesSortAvailability;
|
|
815
|
+
} else if (!this.withinCollection && this.searchType === SearchType.TV) {
|
|
816
|
+
// When viewing TV search results, we default the views dropdown to All-time Views
|
|
817
|
+
// and exclude several of the usual date sort options.
|
|
818
|
+
defaultViewSort = SortField.alltimeview;
|
|
819
|
+
defaultDateSort = SortField.datearchived;
|
|
820
|
+
sortFieldAvailability = tvSortAvailability;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// We only show relevance sort if a search query is currently defined
|
|
824
|
+
sortFieldAvailability.relevance = this.isRelevanceSortAvailable;
|
|
825
|
+
|
|
805
826
|
return html`
|
|
806
827
|
<sort-filter-bar
|
|
807
828
|
.defaultSortField=${this.defaultSortField}
|
|
808
829
|
.defaultSortDirection=${this.defaultSortDirection}
|
|
830
|
+
.defaultViewSort=${defaultViewSort}
|
|
831
|
+
.defaultDateSort=${defaultDateSort}
|
|
809
832
|
.selectedSort=${this.selectedSort}
|
|
810
833
|
.sortDirection=${this.sortDirection}
|
|
811
|
-
.
|
|
812
|
-
.showDateFavorited=${this.withinCollection?.startsWith('fav-')}
|
|
834
|
+
.sortFieldAvailability=${sortFieldAvailability}
|
|
813
835
|
.displayMode=${this.displayMode}
|
|
814
836
|
.selectedTitleFilter=${this.selectedTitleFilter}
|
|
815
837
|
.selectedCreatorFilter=${this.selectedCreatorFilter}
|