@internetarchive/collection-browser 2.7.14-alpha-webdev7002.4 → 2.7.14-alpha-webdev7397.1
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/.github/workflows/ci.yml +3 -3
- package/.github/workflows/gh-pages-main.yml +2 -2
- package/.github/workflows/pr-preview.yml +2 -2
- package/.prettierignore +1 -0
- package/dist/index.d.ts +13 -16
- package/dist/index.js +11 -16
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +107 -107
- package/dist/src/app-root.js +531 -531
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/contract.d.ts +2 -2
- package/dist/src/assets/img/icons/contract.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/expand.d.ts +2 -2
- package/dist/src/assets/img/icons/expand.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-unfilled.js +2 -2
- package/dist/src/assets/img/icons/filter.d.ts +2 -2
- package/dist/src/assets/img/icons/filter.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/circular-activity-indicator.js.map +1 -1
- package/dist/src/collection-browser.d.ts +606 -606
- package/dist/src/collection-browser.js +1684 -1677
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.d.ts +30 -30
- package/dist/src/collection-facets/facet-row.js +118 -118
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.d.ts +13 -13
- package/dist/src/collection-facets/facets-template.js +49 -49
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +106 -106
- package/dist/src/collection-facets/more-facets-content.js +406 -408
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +197 -196
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/dedupe.d.ts +10 -10
- package/dist/src/collection-facets/smart-facets/dedupe.js +33 -33
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.d.ts → browser-language-heuristic.d.ts} +5 -5
- package/dist/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.js → browser-language-heuristic.js} +23 -23
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/{query-keywords/query-keywords-heuristic.d.ts → query-keywords-heuristic.d.ts} +5 -4
- package/dist/src/collection-facets/smart-facets/heuristics/{query-keywords/query-keywords-map.js → query-keywords-heuristic.js} +45 -35
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/{wikidata/wikidata-heuristic.d.ts → wikidata-heuristic.d.ts} +5 -4
- package/dist/src/collection-facets/smart-facets/heuristics/{wikidata/wikidata-entity-map.js → wikidata-heuristic.js} +173 -133
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/models.d.ts +26 -26
- package/dist/src/collection-facets/smart-facets/models.js +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +31 -31
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +237 -240
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +11 -11
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +86 -86
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +16 -16
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +100 -100
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +2 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +12 -12
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +5 -5
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +15 -17
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
- package/dist/src/collection-facets/toggle-switch.js +94 -94
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.d.ts +103 -103
- package/dist/src/collection-facets.js +521 -522
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +245 -245
- package/dist/src/data-source/collection-browser-data-source-interface.js +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.d.ts +377 -377
- package/dist/src/data-source/collection-browser-data-source.js +1003 -1004
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +44 -44
- package/dist/src/data-source/collection-browser-query-state.js +1 -1
- package/dist/src/data-source/models.d.ts +28 -28
- package/dist/src/data-source/models.js +8 -8
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +87 -88
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/language-code-handler/language-code-mapping.js.map +1 -1
- package/dist/src/manage/manage-bar.d.ts +58 -58
- package/dist/src/manage/manage-bar.js +175 -175
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.d.ts +9 -9
- package/dist/src/manage/remove-items-modal-content.js +34 -34
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +92 -91
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/models.d.ts +228 -228
- package/dist/src/models.js +401 -401
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +70 -70
- package/dist/src/restoration-state-handler.js +362 -363
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +136 -136
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +223 -223
- package/dist/src/sort-filter-bar/sort-filter-bar.js +696 -697
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/styles/ia-button.d.ts +2 -2
- package/dist/src/styles/ia-button.js +17 -17
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +9 -9
- package/dist/src/styles/sr-only.d.ts +1 -1
- package/dist/src/styles/sr-only.js +2 -2
- package/dist/src/tiles/base-tile-component.d.ts +19 -19
- package/dist/src/tiles/base-tile-component.js +64 -64
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
- package/dist/src/tiles/grid/collection-tile.js +80 -80
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +34 -34
- package/dist/src/tiles/grid/item-tile.js +159 -160
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.d.ts +10 -10
- package/dist/src/tiles/grid/search-tile.js +51 -51
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
- package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
- package/dist/src/tiles/grid/tile-stats.js +54 -54
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
- package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +18 -18
- package/dist/src/tiles/hover/tile-hover-pane.js +72 -70
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +18 -18
- package/dist/src/tiles/image-block.js +89 -89
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +39 -39
- package/dist/src/tiles/item-image.js +154 -154
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +19 -19
- package/dist/src/tiles/list/tile-list-compact.js +122 -122
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +54 -54
- package/dist/src/tiles/list/tile-list.js +324 -326
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +8 -8
- package/dist/src/tiles/overlay/icon-overlay.js +25 -25
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/text-overlay.js +31 -31
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.d.ts +12 -12
- package/dist/src/tiles/review-block.js +56 -56
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/text-snippet-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +64 -64
- package/dist/src/tiles/tile-dispatcher.js +230 -230
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +47 -47
- package/dist/src/tiles/tile-display-value-provider.js +94 -94
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/analytics-events.d.ts +28 -28
- package/dist/src/utils/analytics-events.js +30 -30
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- package/dist/src/utils/collapse-repeated-quotes.d.ts +11 -11
- package/dist/src/utils/collapse-repeated-quotes.js +13 -13
- package/dist/src/utils/facet-utils.d.ts +83 -83
- package/dist/src/utils/facet-utils.js +145 -145
- package/dist/src/utils/facet-utils.js.map +1 -1
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +75 -76
- package/dist/src/utils/format-count.js.map +1 -1
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +27 -27
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/src/utils/format-unit-size.js.map +1 -1
- package/dist/src/utils/local-date-from-utc.d.ts +9 -9
- package/dist/src/utils/local-date-from-utc.js +15 -15
- package/dist/src/utils/log.d.ts +7 -7
- package/dist/src/utils/log.js +13 -15
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/resolve-mediatype.d.ts +8 -8
- package/dist/src/utils/resolve-mediatype.js +23 -23
- package/dist/src/utils/resolve-mediatype.js.map +1 -1
- package/dist/src/utils/sha1.d.ts +2 -2
- package/dist/src/utils/sha1.js +8 -8
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +1309 -1308
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +1 -1
- package/dist/test/collection-facets/facet-row.test.js +230 -227
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +91 -91
- package/dist/test/collection-facets/facets-template.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +140 -141
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +116 -117
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +82 -73
- package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +692 -692
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +89 -89
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +62 -63
- package/dist/test/empty-placeholder.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +97 -96
- package/dist/test/expanded-date-picker.test.js.map +1 -1
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +23 -24
- package/dist/test/icon-overlay.test.js.map +1 -1
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +106 -107
- package/dist/test/image-block.test.js.map +1 -1
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +84 -85
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/manage/manage-bar.test.d.ts +2 -2
- package/dist/test/manage/manage-bar.test.js +100 -101
- package/dist/test/manage/manage-bar.test.js.map +1 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +1 -1
- package/dist/test/manage/remove-items-modal-content.test.js +44 -45
- package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-search-responses.d.ts +25 -25
- package/dist/test/mocks/mock-search-responses.js +942 -942
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +54 -54
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -270
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/review-block.test.d.ts +1 -1
- package/dist/test/review-block.test.js +43 -44
- package/dist/test/review-block.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +425 -426
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +37 -38
- package/dist/test/text-overlay.test.js.map +1 -1
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +56 -57
- package/dist/test/text-snippet-block.test.js.map +1 -1
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +98 -99
- package/dist/test/tile-stats.test.js.map +1 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +75 -76
- package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +72 -73
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +311 -312
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +50 -51
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +259 -259
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +56 -56
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +142 -143
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +296 -297
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +100 -100
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
- package/dist/test/utils/array-equals.test.d.ts +1 -1
- package/dist/test/utils/array-equals.test.js +26 -26
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-count.test.js.map +1 -1
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +30 -30
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/dist/test/utils/format-unit-size.test.d.ts +1 -1
- package/dist/test/utils/format-unit-size.test.js +17 -17
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
- package/dist/test/utils/local-date-from-utc.test.js +26 -26
- package/dist/test/utils/local-date-from-utc.test.js.map +1 -1
- package/eslint.config.mjs +53 -0
- package/index.html +0 -3
- package/index.ts +1 -15
- package/package.json +41 -39
- package/src/app-root.ts +21 -22
- package/src/collection-browser.ts +50 -42
- package/src/collection-facets/facets-template.ts +7 -6
- package/src/collection-facets/more-facets-content.ts +11 -13
- package/src/collection-facets/more-facets-pagination.ts +3 -2
- package/src/collection-facets/smart-facets/dedupe.ts +2 -2
- package/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.ts → browser-language-heuristic.ts} +1 -1
- package/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.ts +55 -0
- package/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.ts +191 -0
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +6 -8
- package/src/collection-facets/smart-facets/smart-facet-button.ts +5 -3
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +4 -4
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +8 -13
- package/src/collection-facets/toggle-switch.ts +2 -2
- package/src/collection-facets.ts +18 -19
- package/src/data-source/collection-browser-data-source-interface.ts +5 -1
- package/src/data-source/collection-browser-data-source.ts +37 -34
- package/src/empty-placeholder.ts +19 -16
- package/src/expanded-date-picker.ts +1 -1
- package/src/language-code-handler/language-code-handler.ts +1 -1
- package/src/manage/manage-bar.ts +23 -20
- package/src/manage/remove-items-modal-content.ts +2 -2
- package/src/mediatype/mediatype-config.ts +1 -0
- package/src/models.ts +3 -3
- package/src/restoration-state-handler.ts +14 -15
- package/src/sort-filter-bar/alpha-bar.ts +16 -17
- package/src/sort-filter-bar/sort-filter-bar.ts +14 -15
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +1 -1
- package/src/tiles/grid/item-tile.ts +9 -9
- package/src/tiles/grid/tile-stats.ts +4 -4
- package/src/tiles/hover/hover-pane-controller.ts +1 -1
- package/src/tiles/hover/tile-hover-pane.ts +4 -2
- package/src/tiles/item-image.ts +1 -1
- package/src/tiles/list/tile-list-compact.ts +2 -2
- package/src/tiles/list/tile-list.ts +22 -24
- package/src/tiles/tile-dispatcher.ts +5 -5
- package/src/tiles/tile-display-value-provider.ts +4 -4
- package/src/utils/facet-utils.ts +6 -6
- package/src/utils/format-count.ts +2 -3
- package/src/utils/format-date.ts +1 -1
- package/src/utils/format-unit-size.ts +1 -1
- package/src/utils/log.ts +1 -3
- package/test/collection-browser.test.ts +125 -124
- package/test/collection-facets/facet-row.test.ts +31 -28
- package/test/collection-facets/facets-template.test.ts +9 -9
- package/test/collection-facets/more-facets-content.test.ts +14 -15
- package/test/collection-facets/more-facets-pagination.test.ts +18 -19
- package/test/collection-facets/toggle-switch.test.ts +28 -18
- package/test/collection-facets.test.ts +46 -39
- package/test/data-source/collection-browser-data-source.test.ts +2 -2
- package/test/empty-placeholder.test.ts +6 -7
- package/test/expanded-date-picker.test.ts +25 -20
- package/test/icon-overlay.test.ts +0 -1
- package/test/image-block.test.ts +6 -7
- package/test/item-image.test.ts +0 -1
- package/test/manage/manage-bar.test.ts +19 -16
- package/test/manage/remove-items-modal-content.test.ts +4 -5
- package/test/mocks/mock-search-responses.ts +2 -1
- package/test/mocks/mock-search-service.ts +1 -1
- package/test/restoration-state-handler.test.ts +12 -12
- package/test/review-block.test.ts +1 -2
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +1 -1
- package/test/sort-filter-bar/alpha-bar.test.ts +5 -5
- package/test/sort-filter-bar/sort-filter-bar.test.ts +38 -39
- package/test/text-overlay.test.ts +0 -1
- package/test/text-snippet-block.test.ts +5 -6
- package/test/tile-stats.test.ts +26 -35
- package/test/tiles/grid/account-tile.test.ts +2 -3
- package/test/tiles/grid/collection-tile.test.ts +3 -4
- package/test/tiles/grid/item-tile.test.ts +13 -14
- package/test/tiles/grid/search-tile.test.ts +1 -2
- package/test/tiles/hover/hover-pane-controller.test.ts +15 -15
- package/test/tiles/hover/tile-hover-pane.test.ts +5 -5
- package/test/tiles/list/tile-list-compact.test.ts +1 -2
- package/test/tiles/list/tile-list.test.ts +10 -11
- package/test/tiles/tile-dispatcher.test.ts +5 -5
- package/test/utils/format-count.test.ts +1 -1
- package/test/utils/format-date.test.ts +1 -1
- package/test/utils/local-date-from-utc.test.ts +1 -1
- package/tsconfig.json +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +0 -3
- package/dist/src/collection-facets/smart-facets/heuristics/index.js +0 -4
- package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +0 -14
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +0 -6
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +0 -9
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +0 -49
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +0 -1
- package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -36
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -134
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -60
|
@@ -1,340 +1,339 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import '
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import './
|
|
19
|
-
import './tiles/tile
|
|
20
|
-
import './
|
|
21
|
-
import './
|
|
22
|
-
import './
|
|
23
|
-
import './
|
|
24
|
-
import './
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
143
|
-
this.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
*
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
*
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
this.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
//
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
this.
|
|
254
|
-
this.
|
|
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
|
-
this.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
this.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
this.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
this.
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
render() {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, LitElement, nothing, } from 'lit';
|
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { msg } from '@lit/localize';
|
|
6
|
+
import { SearchType, } from '@internetarchive/search-service';
|
|
7
|
+
import '@internetarchive/infinite-scroller';
|
|
8
|
+
import { SortField, getDefaultSelectedFacets, sortOptionFromAPIString, SORT_OPTIONS, defaultProfileElementSorts, } from './models';
|
|
9
|
+
import { RestorationStateHandler, } from './restoration-state-handler';
|
|
10
|
+
import { CollectionBrowserDataSource } from './data-source/collection-browser-data-source';
|
|
11
|
+
import { FACETLESS_PAGE_ELEMENTS } from './data-source/models';
|
|
12
|
+
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
13
|
+
import chevronIcon from './assets/img/icons/chevron';
|
|
14
|
+
import { srOnlyStyle } from './styles/sr-only';
|
|
15
|
+
import { sha1 } from './utils/sha1';
|
|
16
|
+
import { log } from './utils/log';
|
|
17
|
+
import './empty-placeholder';
|
|
18
|
+
import './tiles/tile-dispatcher';
|
|
19
|
+
import './tiles/collection-browser-loading-tile';
|
|
20
|
+
import './sort-filter-bar/sort-filter-bar';
|
|
21
|
+
import './manage/manage-bar';
|
|
22
|
+
import './collection-facets';
|
|
23
|
+
import './circular-activity-indicator';
|
|
24
|
+
import './collection-facets/smart-facets/smart-facet-bar';
|
|
25
|
+
let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.baseImageUrl = 'https://archive.org';
|
|
29
|
+
/**
|
|
30
|
+
* Which backend should be targeted by searches (e.g., metadata or FTS)
|
|
31
|
+
*/
|
|
32
|
+
this.searchType = SearchType.METADATA;
|
|
33
|
+
this.selectedSort = SortField.default;
|
|
34
|
+
this.selectedTitleFilter = null;
|
|
35
|
+
this.selectedCreatorFilter = null;
|
|
36
|
+
this.sortDirection = null;
|
|
37
|
+
this.defaultSortField = SortField.relevance;
|
|
38
|
+
this.defaultSortDirection = null;
|
|
39
|
+
this.pageSize = 50;
|
|
40
|
+
this.showSmartFacetBar = false;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to show the date picker (above the facets)
|
|
43
|
+
*/
|
|
44
|
+
this.showHistogramDatePicker = false;
|
|
45
|
+
/**
|
|
46
|
+
* Whether placeholder views should be suppressed. If true, searches that produce an
|
|
47
|
+
* error or empty result set will simply show a blank results view instead of a placeholder.
|
|
48
|
+
*/
|
|
49
|
+
this.suppressPlaceholders = false;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the result count text should be suppressed.
|
|
52
|
+
* If true, no "X Results" message will be shown.
|
|
53
|
+
*/
|
|
54
|
+
this.suppressResultCount = false;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the scrolling result view should be suppressed entirely.
|
|
57
|
+
* If true, no infinite scroller (and thus no result tiles) will be rendered.
|
|
58
|
+
*/
|
|
59
|
+
this.suppressResultTiles = false;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to suppress persistence of the query to the URL.
|
|
62
|
+
* If true, the `query` param will not be added to the URL or updated on query changes.
|
|
63
|
+
*/
|
|
64
|
+
this.suppressURLQuery = false;
|
|
65
|
+
/**
|
|
66
|
+
* Whether to suppress display of the sort bar.
|
|
67
|
+
* If true, the entire sort bar (incl. display modes) will be omitted from rendering.
|
|
68
|
+
*/
|
|
69
|
+
this.suppressSortBar = false;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to suppress showing the display mode options in the sort bar.
|
|
72
|
+
* If true, those options will be omitted (though the rest of the sort bar may still render).
|
|
73
|
+
*/
|
|
74
|
+
this.suppressDisplayModes = false;
|
|
75
|
+
/**
|
|
76
|
+
* What strategy to use for when/whether to load facet data for a search.
|
|
77
|
+
*
|
|
78
|
+
* Defaults to `eager`, always loading facets immediately alongside search results.
|
|
79
|
+
*
|
|
80
|
+
* To eliminate facets that are never seen, this can be reduced to `lazy-mobile`, which
|
|
81
|
+
* will delay loading facets in the mobile view until the "Filters" accordion is opened.
|
|
82
|
+
* Facets are still loaded eagerly when viewing the desktop layout.
|
|
83
|
+
*
|
|
84
|
+
* To further reduce facet requests for patrons who do not need to use them, this can be
|
|
85
|
+
* again reduced to `opt-in`, which will also require desktop users to explicitly request
|
|
86
|
+
* that they be loaded (in addition to the lazy mobile behavior described above).
|
|
87
|
+
*
|
|
88
|
+
* To entirely suppress facets from being loaded, this may be set to `off`.
|
|
89
|
+
*/
|
|
90
|
+
this.facetLoadStrategy = 'eager';
|
|
91
|
+
this.facetPaneVisible = false;
|
|
92
|
+
this.clearResultsOnEmptyQuery = false;
|
|
93
|
+
this.collectionPagePath = '/details/';
|
|
94
|
+
/** describes where this component is being used */
|
|
95
|
+
this.searchContext = analyticsCategories.default;
|
|
96
|
+
this.pageContext = 'search';
|
|
97
|
+
this.restorationStateHandler = new RestorationStateHandler({
|
|
98
|
+
context: this.pageContext,
|
|
99
|
+
});
|
|
100
|
+
this.mobileBreakpoint = 600;
|
|
101
|
+
this.loggedIn = false;
|
|
102
|
+
this.modalManager = undefined;
|
|
103
|
+
/**
|
|
104
|
+
* If item management UI active
|
|
105
|
+
*/
|
|
106
|
+
this.isManageView = false;
|
|
107
|
+
this.manageViewLabel = 'Select items to remove';
|
|
108
|
+
/** Whether to replace the default sort options with a slot for customization (default: false) */
|
|
109
|
+
this.enableSortOptionsSlot = false;
|
|
110
|
+
/** Whether to display a smart results carousel above the full results */
|
|
111
|
+
this.showSmartResults = false;
|
|
112
|
+
/**
|
|
113
|
+
* The maximum number of pages we will load when a privileged user clicks
|
|
114
|
+
* the "Manage" button on the search page. Limited to 15 pages.
|
|
115
|
+
*/
|
|
116
|
+
this.maxPagesToManage = 15;
|
|
117
|
+
/**
|
|
118
|
+
* The results per page so we can paginate.
|
|
119
|
+
*
|
|
120
|
+
* This allows us to start in the middle of the search results and
|
|
121
|
+
* fetch data before or after the current page. If we don't have a key
|
|
122
|
+
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
123
|
+
*/
|
|
124
|
+
this.dataSource = new CollectionBrowserDataSource(this, this.pageSize);
|
|
125
|
+
/**
|
|
126
|
+
* The page that the consumer wants to load.
|
|
127
|
+
*/
|
|
128
|
+
this.initialPageNumber = 1;
|
|
129
|
+
/**
|
|
130
|
+
* This the the number of pages that we want to show.
|
|
131
|
+
*
|
|
132
|
+
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
133
|
+
* know how many cells we should render.
|
|
134
|
+
*/
|
|
135
|
+
this.pagesToRender = this.initialPageNumber;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the initial page fetch for a new query is currently in progress.
|
|
138
|
+
*/
|
|
139
|
+
this.searchResultsLoading = false;
|
|
140
|
+
this.facetsLoading = false;
|
|
141
|
+
this.mobileView = false;
|
|
142
|
+
this.collapsibleFacetsVisible = false;
|
|
143
|
+
this.placeholderType = null;
|
|
144
|
+
/** Whether layout size analytics have been sent already. */
|
|
145
|
+
this.layoutSizeAnalyticsSent = false;
|
|
146
|
+
/**
|
|
147
|
+
* When we're animated scrolling to the page, we don't want to fetch
|
|
148
|
+
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
149
|
+
*/
|
|
150
|
+
this.isScrollingToCell = false;
|
|
151
|
+
/**
|
|
152
|
+
* When page width resizes from desktop to mobile, set true to
|
|
153
|
+
* disable expand/collapse transition when loading.
|
|
154
|
+
*/
|
|
155
|
+
this.isResizeToMobile = false;
|
|
156
|
+
/**
|
|
157
|
+
* Flag indicating that a new data source is currently being installed.
|
|
158
|
+
* During the install, any URL persistence operation should replace the current entry
|
|
159
|
+
* instead of creating a new one.
|
|
160
|
+
*/
|
|
161
|
+
this.dataSourceInstallInProgress = false;
|
|
162
|
+
this.placeholderCellTemplate = html `<collection-browser-loading-tile></collection-browser-loading-tile>`;
|
|
163
|
+
/**
|
|
164
|
+
* Updates the height of the left column according to its position on the page.
|
|
165
|
+
* Arrow function ensures proper `this` binding.
|
|
166
|
+
*/
|
|
167
|
+
this.updateLeftColumnHeight = () => {
|
|
168
|
+
var _a, _b, _c, _d, _e;
|
|
169
|
+
if (this.mobileView) {
|
|
170
|
+
(_b = (_a = this.leftColumn) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.removeProperty('height');
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const clientTop = (_c = this.leftColumn) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().top;
|
|
174
|
+
const columnHeight = window.innerHeight - (clientTop !== null && clientTop !== void 0 ? clientTop : 0);
|
|
175
|
+
const cssHeightValue = clientTop === 0
|
|
176
|
+
? null
|
|
177
|
+
: // Subtract off the column's top padding so that it doesn't overflow
|
|
178
|
+
`calc(${columnHeight}px - var(--leftColumnPaddingTop, 2rem))`;
|
|
179
|
+
(_e = (_d = this.leftColumn) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.setProperty('height', cssHeightValue);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Toggles whether the fade-out is visible at the bottom of the facets.
|
|
184
|
+
* It should only be visible if the facets are not scrolled to the bottom.
|
|
185
|
+
* Arrow function ensures proper `this` binding.
|
|
186
|
+
*/
|
|
187
|
+
this.updateFacetFadeOut = (entries) => {
|
|
188
|
+
var _a, _b;
|
|
189
|
+
const fadeElmt = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('facets-bottom-fade');
|
|
190
|
+
fadeElmt === null || fadeElmt === void 0 ? void 0 : fadeElmt.classList.toggle('hidden', (_b = entries === null || entries === void 0 ? void 0 : entries[0]) === null || _b === void 0 ? void 0 : _b.isIntersecting);
|
|
191
|
+
};
|
|
192
|
+
// we only want to scroll on the very first query change
|
|
193
|
+
// so this keeps track of whether we've already set the initial query
|
|
194
|
+
this.initialQueryChangeHappened = false;
|
|
195
|
+
this.historyPopOccurred = false;
|
|
196
|
+
this.addController(this.dataSource);
|
|
197
|
+
}
|
|
198
|
+
tileModelAtCellIndex(index) {
|
|
199
|
+
const model = this.dataSource.getTileModelAt(index);
|
|
200
|
+
/**
|
|
201
|
+
* If we encounter a model we don't have yet and we're not in the middle of an
|
|
202
|
+
* automated scroll, fetch the page and just return undefined.
|
|
203
|
+
* The datasource will be updated once the page is loaded and the cell will be rendered.
|
|
204
|
+
*
|
|
205
|
+
* We disable it during the automated scroll since we don't want to fetch pages for intervening cells the
|
|
206
|
+
* user may never see.
|
|
207
|
+
*/
|
|
208
|
+
if (!model && !this.isScrollingToCell && this.dataSource.queryInitialized) {
|
|
209
|
+
const pageNumber = Math.floor(index / this.pageSize) + 1;
|
|
210
|
+
this.dataSource.fetchPage(pageNumber);
|
|
211
|
+
}
|
|
212
|
+
return model;
|
|
213
|
+
}
|
|
214
|
+
// this is the total number of tiles we expect if
|
|
215
|
+
// the data returned is a full page worth
|
|
216
|
+
// this is useful for putting in placeholders for the expected number of tiles
|
|
217
|
+
get estimatedTileCount() {
|
|
218
|
+
return this.pagesToRender * this.pageSize;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Returns a promise resolving to a unique string that persists for the current browser session.
|
|
222
|
+
* Used in generating unique IDs for search requests, so that multiple requests coming from the
|
|
223
|
+
* same browser session can be identified.
|
|
224
|
+
*/
|
|
225
|
+
async getSessionId() {
|
|
226
|
+
try {
|
|
227
|
+
const storedSessionId = sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage.getItem('cb-session');
|
|
228
|
+
if (storedSessionId) {
|
|
229
|
+
return storedSessionId;
|
|
230
|
+
}
|
|
231
|
+
// If we enter this method a second time while a first session ID is already being generated,
|
|
232
|
+
// ensure we produce the same ID from both calls instead of generating another one.
|
|
233
|
+
if (this.sessionIdGenPromise) {
|
|
234
|
+
return this.sessionIdGenPromise;
|
|
235
|
+
}
|
|
236
|
+
this.sessionIdGenPromise = sha1(Math.random().toString());
|
|
237
|
+
const newSessionId = await this.sessionIdGenPromise;
|
|
238
|
+
sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage.setItem('cb-session', newSessionId);
|
|
239
|
+
return newSessionId;
|
|
240
|
+
}
|
|
241
|
+
catch (_a) {
|
|
242
|
+
// Either we can't generate the hash or we're restricted from accessing sessionStorage
|
|
243
|
+
return '';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Go to the given page of results
|
|
248
|
+
*
|
|
249
|
+
* @param pageNumber
|
|
250
|
+
*/
|
|
251
|
+
goToPage(pageNumber) {
|
|
252
|
+
this.initialPageNumber = pageNumber;
|
|
253
|
+
this.pagesToRender = pageNumber;
|
|
254
|
+
return this.scrollToPage(pageNumber);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Sets the state for whether the initial set of search results is loading in.
|
|
258
|
+
*/
|
|
259
|
+
setSearchResultsLoading(loading) {
|
|
260
|
+
this.searchResultsLoading = loading;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Sets the state for whether facet data is loading in
|
|
264
|
+
*/
|
|
265
|
+
setFacetsLoading(loading) {
|
|
266
|
+
this.facetsLoading = loading;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Sets the total number of results to be displayed for the current search
|
|
270
|
+
*/
|
|
271
|
+
setTotalResultCount(totalResults) {
|
|
272
|
+
this.totalResults = totalResults;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Clears all selected/negated facets, date ranges, and letter filters.
|
|
276
|
+
*
|
|
277
|
+
* By default, the current sort field/direction are not cleared,
|
|
278
|
+
* but this can be overridden by setting the `sort` option to `true`.
|
|
279
|
+
*
|
|
280
|
+
* Similarly, it is possible to finely control what is cleared by
|
|
281
|
+
* setting any of the `facets`, `dateRange`, or `letterFilters` flags
|
|
282
|
+
* in the options object.
|
|
283
|
+
*/
|
|
284
|
+
clearFilters({ facets = true, dateRange = true, letterFilters = true, sort = false, } = {}) {
|
|
285
|
+
// Don't bother clearing facets if none are checked, so that we don't
|
|
286
|
+
// trigger unnecessary update cycles.
|
|
287
|
+
if (facets && this.hasCheckedFacets) {
|
|
288
|
+
this.selectedFacets = getDefaultSelectedFacets();
|
|
289
|
+
}
|
|
290
|
+
if (dateRange) {
|
|
291
|
+
this.minSelectedDate = undefined;
|
|
292
|
+
this.maxSelectedDate = undefined;
|
|
293
|
+
}
|
|
294
|
+
if (letterFilters) {
|
|
295
|
+
this.selectedTitleFilter = null;
|
|
296
|
+
this.selectedCreatorFilter = null;
|
|
297
|
+
}
|
|
298
|
+
if (sort) {
|
|
299
|
+
this.sortDirection = null;
|
|
300
|
+
this.selectedSort = SortField.default;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Returns true if the current value of `this.selectedFacets` contains
|
|
305
|
+
* any facet buckets than have been selected or negated, or false otherwise.
|
|
306
|
+
*/
|
|
307
|
+
get hasCheckedFacets() {
|
|
308
|
+
if (!this.selectedFacets)
|
|
309
|
+
return false;
|
|
310
|
+
for (const facetGroup of Object.values(this.selectedFacets)) {
|
|
311
|
+
for (const bucket of Object.values(facetGroup)) {
|
|
312
|
+
if (bucket.state !== 'none')
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Returns true if there are any currently selected/negated facet buckets,
|
|
320
|
+
* any selected date range, or any selected letter filters. False otherwise.
|
|
321
|
+
*
|
|
322
|
+
* Ignores sorting options.
|
|
323
|
+
*/
|
|
324
|
+
get hasActiveFilters() {
|
|
325
|
+
return !!(this.hasCheckedFacets ||
|
|
326
|
+
this.minSelectedDate ||
|
|
327
|
+
this.maxSelectedDate ||
|
|
328
|
+
this.selectedTitleFilter ||
|
|
329
|
+
this.selectedCreatorFilter);
|
|
330
|
+
}
|
|
331
|
+
willUpdate() {
|
|
332
|
+
this.setPlaceholderType();
|
|
333
|
+
}
|
|
334
|
+
render() {
|
|
336
335
|
return html `
|
|
337
|
-
${this.showSmartFacetBar
|
|
336
|
+
${this.showSmartFacetBar
|
|
338
337
|
? html ` <smart-facet-bar
|
|
339
338
|
.query=${this.baseQuery}
|
|
340
339
|
.aggregations=${this.dataSource.aggregations}
|
|
@@ -342,59 +341,59 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
342
341
|
.collectionTitles=${this.dataSource.collectionTitles}
|
|
343
342
|
.filterToggleActive=${this.facetPaneVisible}
|
|
344
343
|
@facetsChanged=${this.facetsChanged}
|
|
345
|
-
@filtersToggled=${() => {
|
|
346
|
-
this.facetPaneVisible = !this.facetPaneVisible;
|
|
344
|
+
@filtersToggled=${() => {
|
|
345
|
+
this.facetPaneVisible = !this.facetPaneVisible;
|
|
347
346
|
}}
|
|
348
|
-
></smart-facet-bar>`
|
|
347
|
+
></smart-facet-bar>`
|
|
349
348
|
: nothing}
|
|
350
349
|
|
|
351
350
|
<div
|
|
352
351
|
id="content-container"
|
|
353
352
|
class=${this.mobileView ? 'mobile' : 'desktop'}
|
|
354
353
|
>
|
|
355
|
-
${this.placeholderType
|
|
356
|
-
? this.emptyPlaceholderTemplate
|
|
354
|
+
${this.placeholderType
|
|
355
|
+
? this.emptyPlaceholderTemplate
|
|
357
356
|
: this.collectionBrowserTemplate}
|
|
358
357
|
</div>
|
|
359
|
-
`;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Determines what type of placeholder content should be shown instead of result tiles, if applicable.
|
|
363
|
-
* The placeholders indicate states where we have no results to show, which could be the result of:
|
|
364
|
-
* - No query is set (on the search page)
|
|
365
|
-
* - No results were returned for the most recent search
|
|
366
|
-
* - The collection being searched within has no viewable items
|
|
367
|
-
* - An error occurred on the most recent search attempt
|
|
368
|
-
*/
|
|
369
|
-
setPlaceholderType() {
|
|
370
|
-
var _a;
|
|
371
|
-
const hasQuery = !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
372
|
-
const isCollection = !!this.withinCollection;
|
|
373
|
-
const isProfile = !!this.withinProfile;
|
|
374
|
-
const noResults = !this.searchResultsLoading &&
|
|
375
|
-
(this.dataSource.size === 0 || !this.searchService);
|
|
376
|
-
this.placeholderType = null;
|
|
377
|
-
if (this.suppressPlaceholders)
|
|
378
|
-
return;
|
|
379
|
-
if (!hasQuery && !isCollection && !isProfile) {
|
|
380
|
-
this.placeholderType = 'empty-query';
|
|
381
|
-
}
|
|
382
|
-
else if (noResults) {
|
|
383
|
-
// Within a collection, no query + no results means the collection simply has no viewable items.
|
|
384
|
-
// Otherwise, we must have a user query that produced 0 results.
|
|
385
|
-
this.placeholderType =
|
|
386
|
-
!hasQuery && isCollection ? 'empty-collection' : 'no-results';
|
|
387
|
-
}
|
|
388
|
-
if (this.dataSource.queryErrorMessage) {
|
|
389
|
-
this.placeholderType =
|
|
390
|
-
!hasQuery && isCollection ? 'collection-error' : 'query-error';
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Template for the placeholder content to show when no results are available.
|
|
395
|
-
*/
|
|
396
|
-
get emptyPlaceholderTemplate() {
|
|
397
|
-
var _a;
|
|
358
|
+
`;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Determines what type of placeholder content should be shown instead of result tiles, if applicable.
|
|
362
|
+
* The placeholders indicate states where we have no results to show, which could be the result of:
|
|
363
|
+
* - No query is set (on the search page)
|
|
364
|
+
* - No results were returned for the most recent search
|
|
365
|
+
* - The collection being searched within has no viewable items
|
|
366
|
+
* - An error occurred on the most recent search attempt
|
|
367
|
+
*/
|
|
368
|
+
setPlaceholderType() {
|
|
369
|
+
var _a;
|
|
370
|
+
const hasQuery = !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
371
|
+
const isCollection = !!this.withinCollection;
|
|
372
|
+
const isProfile = !!this.withinProfile;
|
|
373
|
+
const noResults = !this.searchResultsLoading &&
|
|
374
|
+
(this.dataSource.size === 0 || !this.searchService);
|
|
375
|
+
this.placeholderType = null;
|
|
376
|
+
if (this.suppressPlaceholders)
|
|
377
|
+
return;
|
|
378
|
+
if (!hasQuery && !isCollection && !isProfile) {
|
|
379
|
+
this.placeholderType = 'empty-query';
|
|
380
|
+
}
|
|
381
|
+
else if (noResults) {
|
|
382
|
+
// Within a collection, no query + no results means the collection simply has no viewable items.
|
|
383
|
+
// Otherwise, we must have a user query that produced 0 results.
|
|
384
|
+
this.placeholderType =
|
|
385
|
+
!hasQuery && isCollection ? 'empty-collection' : 'no-results';
|
|
386
|
+
}
|
|
387
|
+
if (this.dataSource.queryErrorMessage) {
|
|
388
|
+
this.placeholderType =
|
|
389
|
+
!hasQuery && isCollection ? 'collection-error' : 'query-error';
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Template for the placeholder content to show when no results are available.
|
|
394
|
+
*/
|
|
395
|
+
get emptyPlaceholderTemplate() {
|
|
396
|
+
var _a;
|
|
398
397
|
return html `
|
|
399
398
|
<empty-placeholder
|
|
400
399
|
.placeholderType=${this.placeholderType}
|
|
@@ -403,33 +402,33 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
403
402
|
.detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
|
|
404
403
|
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
405
404
|
></empty-placeholder>
|
|
406
|
-
`;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
410
|
-
*/
|
|
411
|
-
get collectionBrowserTemplate() {
|
|
405
|
+
`;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
409
|
+
*/
|
|
410
|
+
get collectionBrowserTemplate() {
|
|
412
411
|
return html `
|
|
413
412
|
<div id="left-column-scroll-sentinel"></div>
|
|
414
413
|
${this.leftColumnTemplate} ${this.rightColumnTemplate}
|
|
415
|
-
`;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Template for either the mobile or desktop version of the left column, depending
|
|
419
|
-
* on current component state.
|
|
420
|
-
*/
|
|
421
|
-
get leftColumnTemplate() {
|
|
422
|
-
if (this.mobileView) {
|
|
423
|
-
return this.mobileLeftColumnTemplate;
|
|
424
|
-
}
|
|
425
|
-
return this.desktopLeftColumnTemplate;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Template for the mobile version of the "left column" (which in this case, appears
|
|
429
|
-
* *above* the search results rather than beside them), for rendering the
|
|
430
|
-
* accordion-style facets.
|
|
431
|
-
*/
|
|
432
|
-
get mobileLeftColumnTemplate() {
|
|
414
|
+
`;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Template for either the mobile or desktop version of the left column, depending
|
|
418
|
+
* on current component state.
|
|
419
|
+
*/
|
|
420
|
+
get leftColumnTemplate() {
|
|
421
|
+
if (this.mobileView) {
|
|
422
|
+
return this.mobileLeftColumnTemplate;
|
|
423
|
+
}
|
|
424
|
+
return this.desktopLeftColumnTemplate;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Template for the mobile version of the "left column" (which in this case, appears
|
|
428
|
+
* *above* the search results rather than beside them), for rendering the
|
|
429
|
+
* accordion-style facets.
|
|
430
|
+
*/
|
|
431
|
+
get mobileLeftColumnTemplate() {
|
|
433
432
|
return html `
|
|
434
433
|
<div
|
|
435
434
|
id="left-column"
|
|
@@ -438,12 +437,12 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
438
437
|
${this.facetTopViewSlot} ${this.resultsCountTemplate}
|
|
439
438
|
<div id="facets-header-container">${this.mobileFacetsTemplate}</div>
|
|
440
439
|
</div>
|
|
441
|
-
`;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
445
|
-
*/
|
|
446
|
-
get desktopLeftColumnTemplate() {
|
|
440
|
+
`;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
444
|
+
*/
|
|
445
|
+
get desktopLeftColumnTemplate() {
|
|
447
446
|
return html `
|
|
448
447
|
<div
|
|
449
448
|
id="left-column"
|
|
@@ -461,29 +460,29 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
461
460
|
</div>
|
|
462
461
|
<div id="facets-bottom-fade"></div>
|
|
463
462
|
</div>
|
|
464
|
-
`;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Slot which is placed at top of the facets area for user-profile page
|
|
468
|
-
* - mainly used to render userlists
|
|
469
|
-
*/
|
|
470
|
-
get facetTopViewSlot() {
|
|
463
|
+
`;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Slot which is placed at top of the facets area for user-profile page
|
|
467
|
+
* - mainly used to render userlists
|
|
468
|
+
*/
|
|
469
|
+
get facetTopViewSlot() {
|
|
471
470
|
return html `<div id="facet-top-view">
|
|
472
471
|
<slot name="facet-top-slot"></slot>
|
|
473
|
-
</div>`;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Template for the "X Results" count at the top of the search results.
|
|
477
|
-
* Changes to the "Searching..." label if the search results are still loading.
|
|
478
|
-
*/
|
|
479
|
-
get resultsCountTemplate() {
|
|
480
|
-
var _a;
|
|
481
|
-
if (this.suppressResultCount)
|
|
482
|
-
return nothing;
|
|
483
|
-
const shouldShowSearching = this.searchResultsLoading || this.totalResults === undefined;
|
|
484
|
-
const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
|
|
485
|
-
const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
|
|
486
|
-
// Added data-testid for Playwright testing
|
|
472
|
+
</div>`;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Template for the "X Results" count at the top of the search results.
|
|
476
|
+
* Changes to the "Searching..." label if the search results are still loading.
|
|
477
|
+
*/
|
|
478
|
+
get resultsCountTemplate() {
|
|
479
|
+
var _a;
|
|
480
|
+
if (this.suppressResultCount)
|
|
481
|
+
return nothing;
|
|
482
|
+
const shouldShowSearching = this.searchResultsLoading || this.totalResults === undefined;
|
|
483
|
+
const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
|
|
484
|
+
const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
|
|
485
|
+
// Added data-testid for Playwright testing
|
|
487
486
|
return html `
|
|
488
487
|
<div id="results-total" data-testid="results-total">
|
|
489
488
|
<span id="big-results-count">
|
|
@@ -493,46 +492,46 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
493
492
|
${shouldShowSearching ? nothing : resultsLabel}
|
|
494
493
|
</span>
|
|
495
494
|
</div>
|
|
496
|
-
`;
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Template for the right column of the collection browser, where the result
|
|
500
|
-
* tiles and sort/filter bar are shown.
|
|
501
|
-
*/
|
|
502
|
-
get rightColumnTemplate() {
|
|
495
|
+
`;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Template for the right column of the collection browser, where the result
|
|
499
|
+
* tiles and sort/filter bar are shown.
|
|
500
|
+
*/
|
|
501
|
+
get rightColumnTemplate() {
|
|
503
502
|
return html `
|
|
504
503
|
<div
|
|
505
504
|
id="right-column"
|
|
506
505
|
class="column ${this.showSmartResults ? 'smart-results-spacing' : ''}"
|
|
507
506
|
>
|
|
508
|
-
${this.showSmartResults
|
|
509
|
-
? html `<slot name="smart-results"></slot>`
|
|
507
|
+
${this.showSmartResults
|
|
508
|
+
? html `<slot name="smart-results"></slot>`
|
|
510
509
|
: nothing}
|
|
511
510
|
<section id="results">
|
|
512
|
-
${this.showSmartResults
|
|
511
|
+
${this.showSmartResults
|
|
513
512
|
? html `<h2 class="results-section-heading">
|
|
514
513
|
${msg('All results')}
|
|
515
|
-
</h2>`
|
|
514
|
+
</h2>`
|
|
516
515
|
: nothing}
|
|
517
516
|
<div id="cb-top-view">
|
|
518
517
|
<slot name="cb-top-slot"></slot>
|
|
519
518
|
</div>
|
|
520
|
-
${this.isManageView
|
|
521
|
-
? this.manageBarTemplate
|
|
519
|
+
${this.isManageView
|
|
520
|
+
? this.manageBarTemplate
|
|
522
521
|
: this.sortFilterBarTemplate}
|
|
523
522
|
<slot name="cb-results"></slot>
|
|
524
|
-
${this.displayMode === `list-compact` && this.totalResults
|
|
525
|
-
? this.listHeaderTemplate
|
|
523
|
+
${this.displayMode === `list-compact` && this.totalResults
|
|
524
|
+
? this.listHeaderTemplate
|
|
526
525
|
: nothing}
|
|
527
526
|
${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
|
|
528
527
|
</section>
|
|
529
528
|
</div>
|
|
530
|
-
`;
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* Template for the infinite scroller widget that contains the result tiles.
|
|
534
|
-
*/
|
|
535
|
-
get infiniteScrollerTemplate() {
|
|
529
|
+
`;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Template for the infinite scroller widget that contains the result tiles.
|
|
533
|
+
*/
|
|
534
|
+
get infiniteScrollerTemplate() {
|
|
536
535
|
return html `<infinite-scroller
|
|
537
536
|
class=${this.infiniteScrollerClasses}
|
|
538
537
|
itemCount=${this.placeholderType ? 0 : nothing}
|
|
@@ -541,29 +540,29 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
541
540
|
.placeholderCellTemplate=${this.placeholderCellTemplate}
|
|
542
541
|
@scrollThresholdReached=${this.scrollThresholdReached}
|
|
543
542
|
@visibleCellsChanged=${this.visibleCellsChanged}
|
|
544
|
-
>${this.displayMode === 'grid'
|
|
545
|
-
? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
|
|
543
|
+
>${this.displayMode === 'grid'
|
|
544
|
+
? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
|
|
546
545
|
: nothing}
|
|
547
|
-
</infinite-scroller>`;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* Produces a `classMap` indicating which classes the infinite scroller should have
|
|
551
|
-
* given the current display mode & placeholder case.
|
|
552
|
-
*/
|
|
553
|
-
get infiniteScrollerClasses() {
|
|
554
|
-
var _a;
|
|
555
|
-
return classMap({
|
|
556
|
-
[(_a = this.displayMode) !== null && _a !== void 0 ? _a : '']: !!this.displayMode,
|
|
557
|
-
hidden: !!this.placeholderType,
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Template for the sort & filtering bar that appears atop the search results.
|
|
562
|
-
*/
|
|
563
|
-
get sortFilterBarTemplate() {
|
|
564
|
-
var _a;
|
|
565
|
-
if (this.suppressSortBar)
|
|
566
|
-
return nothing;
|
|
546
|
+
</infinite-scroller>`;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Produces a `classMap` indicating which classes the infinite scroller should have
|
|
550
|
+
* given the current display mode & placeholder case.
|
|
551
|
+
*/
|
|
552
|
+
get infiniteScrollerClasses() {
|
|
553
|
+
var _a;
|
|
554
|
+
return classMap({
|
|
555
|
+
[(_a = this.displayMode) !== null && _a !== void 0 ? _a : '']: !!this.displayMode,
|
|
556
|
+
hidden: !!this.placeholderType,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Template for the sort & filtering bar that appears atop the search results.
|
|
561
|
+
*/
|
|
562
|
+
get sortFilterBarTemplate() {
|
|
563
|
+
var _a;
|
|
564
|
+
if (this.suppressSortBar)
|
|
565
|
+
return nothing;
|
|
567
566
|
return html `
|
|
568
567
|
<sort-filter-bar
|
|
569
568
|
.defaultSortField=${this.defaultSortField}
|
|
@@ -588,16 +587,16 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
588
587
|
<slot name="sort-options" slot="sort-options"></slot>
|
|
589
588
|
<slot name="sort-options-right" slot="sort-options-right"></slot>
|
|
590
589
|
</sort-filter-bar>
|
|
591
|
-
`;
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* Template for the manage bar UI that appears atop the search results when we are
|
|
595
|
-
* showing the management view. This generally replaces the sort bar when present.
|
|
596
|
-
*/
|
|
597
|
-
get manageBarTemplate() {
|
|
598
|
-
const manageViewModalMsg = this.profileElement === 'uploads'
|
|
599
|
-
? 'Note: it may take a few minutes for these items to stop appearing in your uploads list.'
|
|
600
|
-
: nothing;
|
|
590
|
+
`;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Template for the manage bar UI that appears atop the search results when we are
|
|
594
|
+
* showing the management view. This generally replaces the sort bar when present.
|
|
595
|
+
*/
|
|
596
|
+
get manageBarTemplate() {
|
|
597
|
+
const manageViewModalMsg = this.profileElement === 'uploads'
|
|
598
|
+
? 'Note: it may take a few minutes for these items to stop appearing in your uploads list.'
|
|
599
|
+
: nothing;
|
|
601
600
|
return html `
|
|
602
601
|
<manage-bar
|
|
603
602
|
.label=${this.manageViewLabel}
|
|
@@ -612,222 +611,222 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
612
611
|
@manageItems=${this.handleManageItems}
|
|
613
612
|
@selectAll=${() => this.dataSource.checkAllTiles()}
|
|
614
613
|
@unselectAll=${() => this.dataSource.uncheckAllTiles()}
|
|
615
|
-
@cancel=${() => {
|
|
616
|
-
this.isManageView = false;
|
|
617
|
-
this.dataSource.uncheckAllTiles();
|
|
618
|
-
if (this.searchResultsLoading)
|
|
619
|
-
this.dataSource.resetPages();
|
|
614
|
+
@cancel=${() => {
|
|
615
|
+
this.isManageView = false;
|
|
616
|
+
this.dataSource.uncheckAllTiles();
|
|
617
|
+
if (this.searchResultsLoading)
|
|
618
|
+
this.dataSource.resetPages();
|
|
620
619
|
}}
|
|
621
620
|
></manage-bar>
|
|
622
|
-
`;
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
626
|
-
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
627
|
-
*/
|
|
628
|
-
handleRemoveItems() {
|
|
629
|
-
this.dispatchEvent(new CustomEvent('itemRemovalRequested', {
|
|
630
|
-
detail: {
|
|
631
|
-
items: this.dataSource.checkedTileModels.map(model => (model === null || model === void 0 ? void 0 : model.identifier) ? model.identifier : ''),
|
|
632
|
-
},
|
|
633
|
-
}));
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* Handler when user request to bulk edit from /search/ page
|
|
637
|
-
*/
|
|
638
|
-
handleManageItems() {
|
|
639
|
-
this.dispatchEvent(new CustomEvent('itemManagerRequested', {
|
|
640
|
-
detail: {
|
|
641
|
-
items: this.dataSource.checkedTileModels.map(model => (model === null || model === void 0 ? void 0 : model.identifier) ? model.identifier : ''),
|
|
642
|
-
},
|
|
643
|
-
}));
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Handler to show processing modal while removing item
|
|
647
|
-
*/
|
|
648
|
-
showRemoveItemsProcessingModal() {
|
|
649
|
-
var _a;
|
|
650
|
-
(_a = this.manageBar) === null || _a === void 0 ? void 0 : _a.showRemoveItemsProcessingModal();
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Handler to show error modal when item removal failed
|
|
654
|
-
*/
|
|
655
|
-
showRemoveItemsErrorModal() {
|
|
656
|
-
var _a;
|
|
657
|
-
(_a = this.manageBar) === null || _a === void 0 ? void 0 : _a.showRemoveItemsErrorModal();
|
|
658
|
-
}
|
|
659
|
-
/**
|
|
660
|
-
* Removes all tile models that are currently checked & adjusts the paging
|
|
661
|
-
* of the data source to account for any new gaps in the data.
|
|
662
|
-
*/
|
|
663
|
-
removeCheckedTiles() {
|
|
664
|
-
this.dataSource.removeCheckedTiles();
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Handler for when the user changes the selected sort option or direction.
|
|
668
|
-
*/
|
|
669
|
-
userChangedSort(e) {
|
|
670
|
-
var _a;
|
|
671
|
-
const { selectedSort, sortDirection } = e.detail;
|
|
672
|
-
this.selectedSort = selectedSort;
|
|
673
|
-
this.sortDirection = sortDirection;
|
|
674
|
-
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
675
|
-
this.goToPage(1);
|
|
676
|
-
}
|
|
677
|
-
this.currentPage = 1;
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* Fires an analytics event for sorting changes.
|
|
681
|
-
* @param prevSortDirection Which sort direction was previously set.
|
|
682
|
-
*/
|
|
683
|
-
sendSortByAnalytics(prevSortDirection) {
|
|
684
|
-
var _a;
|
|
685
|
-
const directionCleared = prevSortDirection && !this.sortDirection;
|
|
686
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
687
|
-
category: this.searchContext,
|
|
688
|
-
action: analyticsActions.sortBy,
|
|
689
|
-
label: `${this.selectedSort}${this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''}`,
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Handler for when the selected sort option is updated, whether by the user
|
|
694
|
-
* themselves or programmatically.
|
|
695
|
-
*/
|
|
696
|
-
selectedSortChanged() {
|
|
697
|
-
// Lazy-load the alphabet counts for title/creator sort bar as needed
|
|
698
|
-
this.dataSource.updatePrefixFiltersForCurrentSort();
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* An object representing the current sort field & direction.
|
|
702
|
-
*/
|
|
703
|
-
get sortParam() {
|
|
704
|
-
var _a;
|
|
705
|
-
const sortOption = SORT_OPTIONS[this.selectedSort];
|
|
706
|
-
if (!(sortOption === null || sortOption === void 0 ? void 0 : sortOption.handledBySearchService)) {
|
|
707
|
-
return null;
|
|
708
|
-
}
|
|
709
|
-
// If the sort option specified in the URL is unrecognized, we just use it as-is
|
|
710
|
-
const urlSortParam = new URL(window.location.href).searchParams.get('sort');
|
|
711
|
-
const sortField = (_a = sortOption.searchServiceKey) !== null && _a !== void 0 ? _a : urlSortParam === null || urlSortParam === void 0 ? void 0 : urlSortParam.replace(/^-/, '');
|
|
712
|
-
// If the sort direction is still null at this point, then we assume ascending
|
|
713
|
-
// (i.e., it was unrecognized and had no directional flag)
|
|
714
|
-
if (!this.sortDirection)
|
|
715
|
-
this.sortDirection = 'asc';
|
|
716
|
-
if (!sortField)
|
|
717
|
-
return null;
|
|
718
|
-
return { field: sortField, direction: this.sortDirection };
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* An object representing the default sort field & direction, if none are explicitly set.
|
|
722
|
-
*/
|
|
723
|
-
get defaultSortParam() {
|
|
724
|
-
var _a;
|
|
725
|
-
const direction = (_a = this.defaultSortDirection) !== null && _a !== void 0 ? _a : 'asc';
|
|
726
|
-
const field = SORT_OPTIONS[this.defaultSortField].searchServiceKey;
|
|
727
|
-
if (!field)
|
|
728
|
-
return null;
|
|
729
|
-
return { field, direction };
|
|
730
|
-
}
|
|
731
|
-
/**
|
|
732
|
-
* Handler for when the display mode option is changed (grid/list/compact-list views).
|
|
733
|
-
*/
|
|
734
|
-
displayModeChanged(e) {
|
|
735
|
-
var _a;
|
|
736
|
-
this.displayMode = e.detail.displayMode;
|
|
737
|
-
if (this.displayMode) {
|
|
738
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
739
|
-
category: this.searchContext,
|
|
740
|
-
action: analyticsActions.displayMode,
|
|
741
|
-
label: this.displayMode,
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* Returns a query clause identifying the currently selected title filter,
|
|
747
|
-
* e.g., `firstTitle:X`.
|
|
748
|
-
*/
|
|
749
|
-
get titleQuery() {
|
|
750
|
-
return this.selectedTitleFilter
|
|
751
|
-
? `firstTitle:${this.selectedTitleFilter}`
|
|
752
|
-
: undefined;
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Returns a query clause identifying the currently selected creator filter,
|
|
756
|
-
* e.g., `firstCreator:X`.
|
|
757
|
-
*/
|
|
758
|
-
get creatorQuery() {
|
|
759
|
-
return this.selectedCreatorFilter
|
|
760
|
-
? `firstCreator:${this.selectedCreatorFilter}`
|
|
761
|
-
: undefined;
|
|
762
|
-
}
|
|
763
|
-
/**
|
|
764
|
-
* Send Analytics when sorting by title's first letter
|
|
765
|
-
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
766
|
-
*/
|
|
767
|
-
sendFilterByTitleAnalytics(prevSelectedLetter) {
|
|
768
|
-
var _a;
|
|
769
|
-
if (!prevSelectedLetter && !this.selectedTitleFilter) {
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
const cleared = prevSelectedLetter && !this.selectedTitleFilter;
|
|
773
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
774
|
-
category: this.searchContext,
|
|
775
|
-
action: analyticsActions.filterByTitle,
|
|
776
|
-
label: cleared
|
|
777
|
-
? `clear-${prevSelectedLetter}`
|
|
778
|
-
: `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
* Send Analytics when filtering by creator's first letter
|
|
783
|
-
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
784
|
-
*/
|
|
785
|
-
sendFilterByCreatorAnalytics(prevSelectedLetter) {
|
|
786
|
-
var _a;
|
|
787
|
-
if (!prevSelectedLetter && !this.selectedCreatorFilter) {
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
|
-
const cleared = prevSelectedLetter && !this.selectedCreatorFilter;
|
|
791
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
792
|
-
category: this.searchContext,
|
|
793
|
-
action: analyticsActions.filterByCreator,
|
|
794
|
-
label: cleared
|
|
795
|
-
? `clear-${prevSelectedLetter}`
|
|
796
|
-
: `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* Handler for changes to which letter is selected in the title alphabet bar.
|
|
801
|
-
*/
|
|
802
|
-
titleLetterSelected(e) {
|
|
803
|
-
this.selectedCreatorFilter = null;
|
|
804
|
-
this.selectedTitleFilter = e.detail.selectedLetter;
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* Handler for changes to which letter is selected in the creator alphabet bar.
|
|
808
|
-
*/
|
|
809
|
-
creatorLetterSelected(e) {
|
|
810
|
-
this.selectedTitleFilter = null;
|
|
811
|
-
this.selectedCreatorFilter = e.detail.selectedLetter;
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
* The full template for how the facets should be structured in mobile view,
|
|
815
|
-
* including the collapsible container (with header) and the facets themselves.
|
|
816
|
-
*/
|
|
817
|
-
get mobileFacetsTemplate() {
|
|
818
|
-
if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
|
|
819
|
-
return nothing;
|
|
820
|
-
const toggleFacetsVisible = (e) => {
|
|
821
|
-
var _a;
|
|
822
|
-
const target = e.target;
|
|
823
|
-
this.isResizeToMobile = false;
|
|
824
|
-
this.collapsibleFacetsVisible = target.open;
|
|
825
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
826
|
-
category: this.searchContext,
|
|
827
|
-
action: analyticsActions.mobileFacetsToggled,
|
|
828
|
-
label: target.open ? 'open' : 'closed',
|
|
829
|
-
});
|
|
830
|
-
};
|
|
621
|
+
`;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
625
|
+
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
626
|
+
*/
|
|
627
|
+
handleRemoveItems() {
|
|
628
|
+
this.dispatchEvent(new CustomEvent('itemRemovalRequested', {
|
|
629
|
+
detail: {
|
|
630
|
+
items: this.dataSource.checkedTileModels.map(model => (model === null || model === void 0 ? void 0 : model.identifier) ? model.identifier : ''),
|
|
631
|
+
},
|
|
632
|
+
}));
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Handler when user request to bulk edit from /search/ page
|
|
636
|
+
*/
|
|
637
|
+
handleManageItems() {
|
|
638
|
+
this.dispatchEvent(new CustomEvent('itemManagerRequested', {
|
|
639
|
+
detail: {
|
|
640
|
+
items: this.dataSource.checkedTileModels.map(model => (model === null || model === void 0 ? void 0 : model.identifier) ? model.identifier : ''),
|
|
641
|
+
},
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Handler to show processing modal while removing item
|
|
646
|
+
*/
|
|
647
|
+
showRemoveItemsProcessingModal() {
|
|
648
|
+
var _a;
|
|
649
|
+
(_a = this.manageBar) === null || _a === void 0 ? void 0 : _a.showRemoveItemsProcessingModal();
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Handler to show error modal when item removal failed
|
|
653
|
+
*/
|
|
654
|
+
showRemoveItemsErrorModal() {
|
|
655
|
+
var _a;
|
|
656
|
+
(_a = this.manageBar) === null || _a === void 0 ? void 0 : _a.showRemoveItemsErrorModal();
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Removes all tile models that are currently checked & adjusts the paging
|
|
660
|
+
* of the data source to account for any new gaps in the data.
|
|
661
|
+
*/
|
|
662
|
+
removeCheckedTiles() {
|
|
663
|
+
this.dataSource.removeCheckedTiles();
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Handler for when the user changes the selected sort option or direction.
|
|
667
|
+
*/
|
|
668
|
+
userChangedSort(e) {
|
|
669
|
+
var _a;
|
|
670
|
+
const { selectedSort, sortDirection } = e.detail;
|
|
671
|
+
this.selectedSort = selectedSort;
|
|
672
|
+
this.sortDirection = sortDirection;
|
|
673
|
+
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
674
|
+
this.goToPage(1);
|
|
675
|
+
}
|
|
676
|
+
this.currentPage = 1;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Fires an analytics event for sorting changes.
|
|
680
|
+
* @param prevSortDirection Which sort direction was previously set.
|
|
681
|
+
*/
|
|
682
|
+
sendSortByAnalytics(prevSortDirection) {
|
|
683
|
+
var _a;
|
|
684
|
+
const directionCleared = prevSortDirection && !this.sortDirection;
|
|
685
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
686
|
+
category: this.searchContext,
|
|
687
|
+
action: analyticsActions.sortBy,
|
|
688
|
+
label: `${this.selectedSort}${this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''}`,
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Handler for when the selected sort option is updated, whether by the user
|
|
693
|
+
* themselves or programmatically.
|
|
694
|
+
*/
|
|
695
|
+
selectedSortChanged() {
|
|
696
|
+
// Lazy-load the alphabet counts for title/creator sort bar as needed
|
|
697
|
+
this.dataSource.updatePrefixFiltersForCurrentSort();
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* An object representing the current sort field & direction.
|
|
701
|
+
*/
|
|
702
|
+
get sortParam() {
|
|
703
|
+
var _a;
|
|
704
|
+
const sortOption = SORT_OPTIONS[this.selectedSort];
|
|
705
|
+
if (!(sortOption === null || sortOption === void 0 ? void 0 : sortOption.handledBySearchService)) {
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
708
|
+
// If the sort option specified in the URL is unrecognized, we just use it as-is
|
|
709
|
+
const urlSortParam = new URL(window.location.href).searchParams.get('sort');
|
|
710
|
+
const sortField = (_a = sortOption.searchServiceKey) !== null && _a !== void 0 ? _a : urlSortParam === null || urlSortParam === void 0 ? void 0 : urlSortParam.replace(/^-/, '');
|
|
711
|
+
// If the sort direction is still null at this point, then we assume ascending
|
|
712
|
+
// (i.e., it was unrecognized and had no directional flag)
|
|
713
|
+
if (!this.sortDirection)
|
|
714
|
+
this.sortDirection = 'asc';
|
|
715
|
+
if (!sortField)
|
|
716
|
+
return null;
|
|
717
|
+
return { field: sortField, direction: this.sortDirection };
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* An object representing the default sort field & direction, if none are explicitly set.
|
|
721
|
+
*/
|
|
722
|
+
get defaultSortParam() {
|
|
723
|
+
var _a;
|
|
724
|
+
const direction = (_a = this.defaultSortDirection) !== null && _a !== void 0 ? _a : 'asc';
|
|
725
|
+
const field = SORT_OPTIONS[this.defaultSortField].searchServiceKey;
|
|
726
|
+
if (!field)
|
|
727
|
+
return null;
|
|
728
|
+
return { field, direction };
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Handler for when the display mode option is changed (grid/list/compact-list views).
|
|
732
|
+
*/
|
|
733
|
+
displayModeChanged(e) {
|
|
734
|
+
var _a;
|
|
735
|
+
this.displayMode = e.detail.displayMode;
|
|
736
|
+
if (this.displayMode) {
|
|
737
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
738
|
+
category: this.searchContext,
|
|
739
|
+
action: analyticsActions.displayMode,
|
|
740
|
+
label: this.displayMode,
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Returns a query clause identifying the currently selected title filter,
|
|
746
|
+
* e.g., `firstTitle:X`.
|
|
747
|
+
*/
|
|
748
|
+
get titleQuery() {
|
|
749
|
+
return this.selectedTitleFilter
|
|
750
|
+
? `firstTitle:${this.selectedTitleFilter}`
|
|
751
|
+
: undefined;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Returns a query clause identifying the currently selected creator filter,
|
|
755
|
+
* e.g., `firstCreator:X`.
|
|
756
|
+
*/
|
|
757
|
+
get creatorQuery() {
|
|
758
|
+
return this.selectedCreatorFilter
|
|
759
|
+
? `firstCreator:${this.selectedCreatorFilter}`
|
|
760
|
+
: undefined;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Send Analytics when sorting by title's first letter
|
|
764
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
765
|
+
*/
|
|
766
|
+
sendFilterByTitleAnalytics(prevSelectedLetter) {
|
|
767
|
+
var _a;
|
|
768
|
+
if (!prevSelectedLetter && !this.selectedTitleFilter) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
const cleared = prevSelectedLetter && !this.selectedTitleFilter;
|
|
772
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
773
|
+
category: this.searchContext,
|
|
774
|
+
action: analyticsActions.filterByTitle,
|
|
775
|
+
label: cleared
|
|
776
|
+
? `clear-${prevSelectedLetter}`
|
|
777
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Send Analytics when filtering by creator's first letter
|
|
782
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
783
|
+
*/
|
|
784
|
+
sendFilterByCreatorAnalytics(prevSelectedLetter) {
|
|
785
|
+
var _a;
|
|
786
|
+
if (!prevSelectedLetter && !this.selectedCreatorFilter) {
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
const cleared = prevSelectedLetter && !this.selectedCreatorFilter;
|
|
790
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
791
|
+
category: this.searchContext,
|
|
792
|
+
action: analyticsActions.filterByCreator,
|
|
793
|
+
label: cleared
|
|
794
|
+
? `clear-${prevSelectedLetter}`
|
|
795
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Handler for changes to which letter is selected in the title alphabet bar.
|
|
800
|
+
*/
|
|
801
|
+
titleLetterSelected(e) {
|
|
802
|
+
this.selectedCreatorFilter = null;
|
|
803
|
+
this.selectedTitleFilter = e.detail.selectedLetter;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Handler for changes to which letter is selected in the creator alphabet bar.
|
|
807
|
+
*/
|
|
808
|
+
creatorLetterSelected(e) {
|
|
809
|
+
this.selectedTitleFilter = null;
|
|
810
|
+
this.selectedCreatorFilter = e.detail.selectedLetter;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* The full template for how the facets should be structured in mobile view,
|
|
814
|
+
* including the collapsible container (with header) and the facets themselves.
|
|
815
|
+
*/
|
|
816
|
+
get mobileFacetsTemplate() {
|
|
817
|
+
if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
|
|
818
|
+
return nothing;
|
|
819
|
+
const toggleFacetsVisible = (e) => {
|
|
820
|
+
var _a;
|
|
821
|
+
const target = e.target;
|
|
822
|
+
this.isResizeToMobile = false;
|
|
823
|
+
this.collapsibleFacetsVisible = target.open;
|
|
824
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
825
|
+
category: this.searchContext,
|
|
826
|
+
action: analyticsActions.mobileFacetsToggled,
|
|
827
|
+
label: target.open ? 'open' : 'closed',
|
|
828
|
+
});
|
|
829
|
+
};
|
|
831
830
|
return html `
|
|
832
831
|
<details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
|
|
833
832
|
<summary>
|
|
@@ -837,21 +836,21 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
837
836
|
</summary>
|
|
838
837
|
${this.facetsTemplate}
|
|
839
838
|
</details>
|
|
840
|
-
`;
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* The template for the facets component alone, without any surrounding wrappers.
|
|
844
|
-
*/
|
|
845
|
-
get facetsTemplate() {
|
|
846
|
-
if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
|
|
847
|
-
return nothing;
|
|
848
|
-
if (this.facetLoadStrategy === 'off') {
|
|
839
|
+
`;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* The template for the facets component alone, without any surrounding wrappers.
|
|
843
|
+
*/
|
|
844
|
+
get facetsTemplate() {
|
|
845
|
+
if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
|
|
846
|
+
return nothing;
|
|
847
|
+
if (this.facetLoadStrategy === 'off') {
|
|
849
848
|
return html `
|
|
850
849
|
<p class="facets-message">
|
|
851
850
|
${msg('Facets are temporarily unavailable.')}
|
|
852
851
|
</p>
|
|
853
|
-
`;
|
|
854
|
-
}
|
|
852
|
+
`;
|
|
853
|
+
}
|
|
855
854
|
const facets = html `
|
|
856
855
|
<collection-facets
|
|
857
856
|
@facetsChanged=${this.facetsChanged}
|
|
@@ -865,7 +864,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
865
864
|
.resizeObserver=${this.resizeObserver}
|
|
866
865
|
.searchType=${this.searchType}
|
|
867
866
|
.aggregations=${this.dataSource.aggregations}
|
|
868
|
-
.fullYearsHistogramAggregation=${this.dataSource
|
|
867
|
+
.fullYearsHistogramAggregation=${this.dataSource
|
|
869
868
|
.yearHistogramAggregation}
|
|
870
869
|
.minSelectedDate=${this.minSelectedDate}
|
|
871
870
|
.maxSelectedDate=${this.maxSelectedDate}
|
|
@@ -886,19 +885,19 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
886
885
|
.analyticsHandler=${this.analyticsHandler}
|
|
887
886
|
>
|
|
888
887
|
</collection-facets>
|
|
889
|
-
`;
|
|
890
|
-
// If we are using one of the opt-in facet load strategies, we may need to wrap the
|
|
891
|
-
// desktop view facets in a <details> widget so that patrons can opt into loading them.
|
|
892
|
-
// In the `opt-in-or-login` case, we only do this if they are not logged in.
|
|
893
|
-
const showDesktopOptInWidget = this.facetLoadStrategy === 'opt-in' ||
|
|
894
|
-
(this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);
|
|
895
|
-
if (showDesktopOptInWidget && !this.mobileView) {
|
|
888
|
+
`;
|
|
889
|
+
// If we are using one of the opt-in facet load strategies, we may need to wrap the
|
|
890
|
+
// desktop view facets in a <details> widget so that patrons can opt into loading them.
|
|
891
|
+
// In the `opt-in-or-login` case, we only do this if they are not logged in.
|
|
892
|
+
const showDesktopOptInWidget = this.facetLoadStrategy === 'opt-in' ||
|
|
893
|
+
(this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);
|
|
894
|
+
if (showDesktopOptInWidget && !this.mobileView) {
|
|
896
895
|
return html `
|
|
897
896
|
<details
|
|
898
897
|
class="desktop-facets-dropdown"
|
|
899
|
-
@toggle=${(e) => {
|
|
900
|
-
const target = e.target;
|
|
901
|
-
this.collapsibleFacetsVisible = target.open;
|
|
898
|
+
@toggle=${(e) => {
|
|
899
|
+
const target = e.target;
|
|
900
|
+
this.collapsibleFacetsVisible = target.open;
|
|
902
901
|
}}
|
|
903
902
|
>
|
|
904
903
|
<summary>
|
|
@@ -907,40 +906,40 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
907
906
|
</summary>
|
|
908
907
|
${facets}
|
|
909
908
|
</button>
|
|
910
|
-
`;
|
|
911
|
-
}
|
|
912
|
-
// Otherwise, just render the facets component bare
|
|
913
|
-
return facets;
|
|
914
|
-
}
|
|
915
|
-
/**
|
|
916
|
-
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
917
|
-
* filters are currently active.
|
|
918
|
-
*
|
|
919
|
-
* @param mobile Whether to style/shorten the button for mobile view
|
|
920
|
-
*/
|
|
921
|
-
clearFiltersBtnTemplate(mobile) {
|
|
922
|
-
if (!this.hasActiveFilters)
|
|
923
|
-
return nothing;
|
|
924
|
-
const buttonClasses = classMap({
|
|
925
|
-
'clear-filters-btn': true,
|
|
926
|
-
mobile,
|
|
927
|
-
});
|
|
928
|
-
const buttonText = mobile ? 'Clear all' : 'Clear all filters';
|
|
909
|
+
`;
|
|
910
|
+
}
|
|
911
|
+
// Otherwise, just render the facets component bare
|
|
912
|
+
return facets;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
916
|
+
* filters are currently active.
|
|
917
|
+
*
|
|
918
|
+
* @param mobile Whether to style/shorten the button for mobile view
|
|
919
|
+
*/
|
|
920
|
+
clearFiltersBtnTemplate(mobile) {
|
|
921
|
+
if (!this.hasActiveFilters)
|
|
922
|
+
return nothing;
|
|
923
|
+
const buttonClasses = classMap({
|
|
924
|
+
'clear-filters-btn': true,
|
|
925
|
+
mobile,
|
|
926
|
+
});
|
|
927
|
+
const buttonText = mobile ? 'Clear all' : 'Clear all filters';
|
|
929
928
|
return html `
|
|
930
929
|
<div class="clear-filters-btn-row">
|
|
931
|
-
${mobile
|
|
932
|
-
? html `<span class="clear-filters-btn-separator"> </span>`
|
|
930
|
+
${mobile
|
|
931
|
+
? html `<span class="clear-filters-btn-separator"> </span>`
|
|
933
932
|
: nothing}
|
|
934
933
|
<button class=${buttonClasses} @click=${this.clearFilters}>
|
|
935
934
|
${buttonText}
|
|
936
935
|
</button>
|
|
937
936
|
</div>
|
|
938
|
-
`;
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Template for the table header content that appears atop the compact list view.
|
|
942
|
-
*/
|
|
943
|
-
get listHeaderTemplate() {
|
|
937
|
+
`;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Template for the table header content that appears atop the compact list view.
|
|
941
|
+
*/
|
|
942
|
+
get listHeaderTemplate() {
|
|
944
943
|
return html `
|
|
945
944
|
<div id="list-header">
|
|
946
945
|
<tile-dispatcher
|
|
@@ -953,711 +952,718 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
953
952
|
>
|
|
954
953
|
</tile-dispatcher>
|
|
955
954
|
</div>
|
|
956
|
-
`;
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* Handler for when the date picker's date range is changed.
|
|
960
|
-
*/
|
|
961
|
-
histogramDateRangeUpdated(e) {
|
|
962
|
-
var _a;
|
|
963
|
-
const { minDate, maxDate } = e.detail;
|
|
964
|
-
[this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];
|
|
965
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
966
|
-
category: this.searchContext,
|
|
967
|
-
action: analyticsActions.histogramChanged,
|
|
968
|
-
label: this.dateRangeQueryClause,
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
/**
|
|
972
|
-
* The Lucene query corresponding to the current date range.
|
|
973
|
-
*/
|
|
974
|
-
get dateRangeQueryClause() {
|
|
975
|
-
if (!this.minSelectedDate || !this.maxSelectedDate) {
|
|
976
|
-
return undefined;
|
|
977
|
-
}
|
|
978
|
-
return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Emits an event indicating a change in whether the manage mode is shown.
|
|
982
|
-
*/
|
|
983
|
-
emitManageModeChangedEvent() {
|
|
984
|
-
this.dispatchEvent(new CustomEvent('manageModeChanged', {
|
|
985
|
-
detail: this.isManageView,
|
|
986
|
-
}));
|
|
987
|
-
}
|
|
988
|
-
/**
|
|
989
|
-
* Installs a new data source component and associated query state parameters into
|
|
990
|
-
* this component, causing it to efficiently update its views to represent the
|
|
991
|
-
* newly-provided data. In this way, one can reuse a single instance of
|
|
992
|
-
* <collection-browser> to handle multiple different sets of search results on
|
|
993
|
-
* a single page, each set of results being loaded & updated by its own data
|
|
994
|
-
* source.
|
|
995
|
-
*
|
|
996
|
-
* @param dataSource The data source component containing (or prepared to fetch)
|
|
997
|
-
* the tile data to be displayed.
|
|
998
|
-
* @param queryState The new query-related state that this component should
|
|
999
|
-
* represent, such as the search query, sort option, and any filters applied.
|
|
1000
|
-
*/
|
|
1001
|
-
async installDataSourceAndQueryState(dataSource, queryState) {
|
|
1002
|
-
var _a, _b;
|
|
1003
|
-
log('Installing data source & query state in CB:', dataSource, queryState);
|
|
1004
|
-
if (this.dataSource)
|
|
1005
|
-
this.removeController(this.dataSource);
|
|
1006
|
-
this.dataSource = dataSource;
|
|
1007
|
-
this.addController(this.dataSource);
|
|
1008
|
-
this.baseQuery = queryState.baseQuery;
|
|
1009
|
-
this.profileElement = queryState.profileElement;
|
|
1010
|
-
this.searchType = queryState.searchType;
|
|
1011
|
-
this.selectedFacets =
|
|
1012
|
-
(_a = queryState.selectedFacets) !== null && _a !== void 0 ? _a : getDefaultSelectedFacets();
|
|
1013
|
-
this.minSelectedDate = queryState.minSelectedDate;
|
|
1014
|
-
this.maxSelectedDate = queryState.maxSelectedDate;
|
|
1015
|
-
this.selectedSort = (_b = queryState.selectedSort) !== null && _b !== void 0 ? _b : SortField.default;
|
|
1016
|
-
this.sortDirection = queryState.sortDirection;
|
|
1017
|
-
this.selectedTitleFilter = queryState.selectedTitleFilter;
|
|
1018
|
-
this.selectedCreatorFilter = queryState.selectedCreatorFilter;
|
|
1019
|
-
// We set this flag during the update to prevent the URL state persistence
|
|
1020
|
-
// from creating an unwanted extra history entry.
|
|
1021
|
-
this.dataSourceInstallInProgress = true;
|
|
1022
|
-
this.requestUpdate();
|
|
1023
|
-
await this.updateComplete;
|
|
1024
|
-
this.dataSourceInstallInProgress = false;
|
|
1025
|
-
if (!this.searchResultsLoading) {
|
|
1026
|
-
this.setTotalResultCount(this.dataSource.totalResults);
|
|
1027
|
-
this.setTileCount(this.dataSource.size);
|
|
1028
|
-
}
|
|
1029
|
-
this.refreshVisibleResults();
|
|
1030
|
-
}
|
|
1031
|
-
firstUpdated() {
|
|
1032
|
-
this.restoreState();
|
|
1033
|
-
this.setInitialSize();
|
|
1034
|
-
}
|
|
1035
|
-
/**
|
|
1036
|
-
* Determines the initial size of the content container and whether or not
|
|
1037
|
-
* the mobile layout should be used.
|
|
1038
|
-
*/
|
|
1039
|
-
setInitialSize() {
|
|
1040
|
-
this.contentWidth = this.contentContainer.getBoundingClientRect().width;
|
|
1041
|
-
this.mobileView =
|
|
1042
|
-
this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;
|
|
1043
|
-
this.sendLayoutSizeAnalytics();
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* Fires an analytics event indicating which type of layout was rendered:
|
|
1047
|
-
* mobile or desktop.
|
|
1048
|
-
*/
|
|
1049
|
-
sendLayoutSizeAnalytics() {
|
|
1050
|
-
if (this.analyticsHandler) {
|
|
1051
|
-
this.layoutSizeAnalyticsSent = true;
|
|
1052
|
-
this.analyticsHandler.sendEvent({
|
|
1053
|
-
category: this.searchContext,
|
|
1054
|
-
action: this.mobileView
|
|
1055
|
-
? analyticsActions.loadMobileView
|
|
1056
|
-
: analyticsActions.loadDesktopView,
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
updated(changed) {
|
|
1061
|
-
var _a, _b, _c;
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
this.
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
this.
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
}
|
|
1080
|
-
if (changed.has('
|
|
1081
|
-
changed.has('
|
|
1082
|
-
changed.has('
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
//
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
if (changed.has('
|
|
1111
|
-
this.
|
|
1112
|
-
}
|
|
1113
|
-
if (changed.has('
|
|
1114
|
-
this.
|
|
1115
|
-
}
|
|
1116
|
-
if (changed.has('
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
changed.has('
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
this.
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
changed.
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
changed.has('
|
|
1146
|
-
changed.has('
|
|
1147
|
-
changed.has('
|
|
1148
|
-
changed.has('
|
|
1149
|
-
changed.has('
|
|
1150
|
-
changed.has('
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
this.
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
if (changed.has('
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
this.
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
(
|
|
1175
|
-
this.
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
if (
|
|
1180
|
-
this.
|
|
1181
|
-
this.
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
(
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
//
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
*/
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
this.
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
this.
|
|
1417
|
-
}
|
|
1418
|
-
this.
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
this.
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
this.
|
|
1448
|
-
if (
|
|
1449
|
-
this.
|
|
1450
|
-
this.
|
|
1451
|
-
this.
|
|
1452
|
-
this.
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
this.
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
*
|
|
1496
|
-
*/
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
action
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
*
|
|
1550
|
-
*/
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
//
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
this.
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
}
|
|
1633
|
-
/**
|
|
1634
|
-
*
|
|
1635
|
-
*/
|
|
1636
|
-
|
|
1637
|
-
var _a
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
955
|
+
`;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Handler for when the date picker's date range is changed.
|
|
959
|
+
*/
|
|
960
|
+
histogramDateRangeUpdated(e) {
|
|
961
|
+
var _a;
|
|
962
|
+
const { minDate, maxDate } = e.detail;
|
|
963
|
+
[this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];
|
|
964
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
965
|
+
category: this.searchContext,
|
|
966
|
+
action: analyticsActions.histogramChanged,
|
|
967
|
+
label: this.dateRangeQueryClause,
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* The Lucene query corresponding to the current date range.
|
|
972
|
+
*/
|
|
973
|
+
get dateRangeQueryClause() {
|
|
974
|
+
if (!this.minSelectedDate || !this.maxSelectedDate) {
|
|
975
|
+
return undefined;
|
|
976
|
+
}
|
|
977
|
+
return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Emits an event indicating a change in whether the manage mode is shown.
|
|
981
|
+
*/
|
|
982
|
+
emitManageModeChangedEvent() {
|
|
983
|
+
this.dispatchEvent(new CustomEvent('manageModeChanged', {
|
|
984
|
+
detail: this.isManageView,
|
|
985
|
+
}));
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* Installs a new data source component and associated query state parameters into
|
|
989
|
+
* this component, causing it to efficiently update its views to represent the
|
|
990
|
+
* newly-provided data. In this way, one can reuse a single instance of
|
|
991
|
+
* <collection-browser> to handle multiple different sets of search results on
|
|
992
|
+
* a single page, each set of results being loaded & updated by its own data
|
|
993
|
+
* source.
|
|
994
|
+
*
|
|
995
|
+
* @param dataSource The data source component containing (or prepared to fetch)
|
|
996
|
+
* the tile data to be displayed.
|
|
997
|
+
* @param queryState The new query-related state that this component should
|
|
998
|
+
* represent, such as the search query, sort option, and any filters applied.
|
|
999
|
+
*/
|
|
1000
|
+
async installDataSourceAndQueryState(dataSource, queryState) {
|
|
1001
|
+
var _a, _b;
|
|
1002
|
+
log('Installing data source & query state in CB:', dataSource, queryState);
|
|
1003
|
+
if (this.dataSource)
|
|
1004
|
+
this.removeController(this.dataSource);
|
|
1005
|
+
this.dataSource = dataSource;
|
|
1006
|
+
this.addController(this.dataSource);
|
|
1007
|
+
this.baseQuery = queryState.baseQuery;
|
|
1008
|
+
this.profileElement = queryState.profileElement;
|
|
1009
|
+
this.searchType = queryState.searchType;
|
|
1010
|
+
this.selectedFacets =
|
|
1011
|
+
(_a = queryState.selectedFacets) !== null && _a !== void 0 ? _a : getDefaultSelectedFacets();
|
|
1012
|
+
this.minSelectedDate = queryState.minSelectedDate;
|
|
1013
|
+
this.maxSelectedDate = queryState.maxSelectedDate;
|
|
1014
|
+
this.selectedSort = (_b = queryState.selectedSort) !== null && _b !== void 0 ? _b : SortField.default;
|
|
1015
|
+
this.sortDirection = queryState.sortDirection;
|
|
1016
|
+
this.selectedTitleFilter = queryState.selectedTitleFilter;
|
|
1017
|
+
this.selectedCreatorFilter = queryState.selectedCreatorFilter;
|
|
1018
|
+
// We set this flag during the update to prevent the URL state persistence
|
|
1019
|
+
// from creating an unwanted extra history entry.
|
|
1020
|
+
this.dataSourceInstallInProgress = true;
|
|
1021
|
+
this.requestUpdate();
|
|
1022
|
+
await this.updateComplete;
|
|
1023
|
+
this.dataSourceInstallInProgress = false;
|
|
1024
|
+
if (!this.searchResultsLoading) {
|
|
1025
|
+
this.setTotalResultCount(this.dataSource.totalResults);
|
|
1026
|
+
this.setTileCount(this.dataSource.size);
|
|
1027
|
+
}
|
|
1028
|
+
this.refreshVisibleResults();
|
|
1029
|
+
}
|
|
1030
|
+
firstUpdated() {
|
|
1031
|
+
this.restoreState();
|
|
1032
|
+
this.setInitialSize();
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Determines the initial size of the content container and whether or not
|
|
1036
|
+
* the mobile layout should be used.
|
|
1037
|
+
*/
|
|
1038
|
+
setInitialSize() {
|
|
1039
|
+
this.contentWidth = this.contentContainer.getBoundingClientRect().width;
|
|
1040
|
+
this.mobileView =
|
|
1041
|
+
this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;
|
|
1042
|
+
this.sendLayoutSizeAnalytics();
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Fires an analytics event indicating which type of layout was rendered:
|
|
1046
|
+
* mobile or desktop.
|
|
1047
|
+
*/
|
|
1048
|
+
sendLayoutSizeAnalytics() {
|
|
1049
|
+
if (this.analyticsHandler) {
|
|
1050
|
+
this.layoutSizeAnalyticsSent = true;
|
|
1051
|
+
this.analyticsHandler.sendEvent({
|
|
1052
|
+
category: this.searchContext,
|
|
1053
|
+
action: this.mobileView
|
|
1054
|
+
? analyticsActions.loadMobileView
|
|
1055
|
+
: analyticsActions.loadDesktopView,
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
updated(changed) {
|
|
1060
|
+
var _a, _b, _c;
|
|
1061
|
+
try {
|
|
1062
|
+
console.log('c-b updated', '\n' + [...changed.entries()].map(([k, v]) => `${String(k)}: ${JSON.stringify(v)} -> ${JSON.stringify(this[k])}`).join('\n'));
|
|
1063
|
+
}
|
|
1064
|
+
catch (err) {
|
|
1065
|
+
console.error(err);
|
|
1066
|
+
}
|
|
1067
|
+
if (changed.has('placeholderType') && this.placeholderType === null) {
|
|
1068
|
+
if (!this.leftColIntersectionObserver) {
|
|
1069
|
+
this.setupLeftColumnScrollListeners();
|
|
1070
|
+
}
|
|
1071
|
+
if (!this.facetsIntersectionObserver) {
|
|
1072
|
+
this.setupFacetsScrollListeners();
|
|
1073
|
+
}
|
|
1074
|
+
this.updateLeftColumnHeight();
|
|
1075
|
+
}
|
|
1076
|
+
if (changed.has('analyticsHandler') && !this.layoutSizeAnalyticsSent) {
|
|
1077
|
+
this.sendLayoutSizeAnalytics();
|
|
1078
|
+
}
|
|
1079
|
+
if (changed.has('displayMode') ||
|
|
1080
|
+
changed.has('baseNavigationUrl') ||
|
|
1081
|
+
changed.has('baseImageUrl') ||
|
|
1082
|
+
changed.has('loggedIn')) {
|
|
1083
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|
|
1084
|
+
}
|
|
1085
|
+
if (changed.has('baseQuery') ||
|
|
1086
|
+
changed.has('searchType') ||
|
|
1087
|
+
changed.has('withinCollection')) {
|
|
1088
|
+
// Unless this query/search type update is from the initial page load or the
|
|
1089
|
+
// result of hitting the back button,
|
|
1090
|
+
// we need to clear any existing filters since they may no longer be valid for
|
|
1091
|
+
// the new set of search results.
|
|
1092
|
+
if (!this.historyPopOccurred && this.initialQueryChangeHappened) {
|
|
1093
|
+
// Ordinarily, we leave the sort param unchanged between searches.
|
|
1094
|
+
// However, if we are changing the target collection itself, we want the sort cleared too,
|
|
1095
|
+
// since different collections may have different sorting options available.
|
|
1096
|
+
const shouldClearSort = changed.has('withinCollection') &&
|
|
1097
|
+
!changed.has('selectedSort') &&
|
|
1098
|
+
!changed.has('sortDirection');
|
|
1099
|
+
// Otherwise, only clear filters that haven't been simultaneously applied in this update
|
|
1100
|
+
this.clearFilters({
|
|
1101
|
+
sort: shouldClearSort,
|
|
1102
|
+
facets: !changed.has('selectedFacets'),
|
|
1103
|
+
dateRange: !(changed.has('minSelectedDate') || changed.has('maxSelectedDate')),
|
|
1104
|
+
letterFilters: !(changed.has('selectedTitleFilter') ||
|
|
1105
|
+
changed.has('selectedCreatorFilter')),
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
if (changed.has('profileElement')) {
|
|
1110
|
+
this.applyDefaultProfileSort();
|
|
1111
|
+
}
|
|
1112
|
+
if (changed.has('baseQuery')) {
|
|
1113
|
+
this.emitBaseQueryChanged();
|
|
1114
|
+
}
|
|
1115
|
+
if (changed.has('searchType')) {
|
|
1116
|
+
this.emitSearchTypeChanged();
|
|
1117
|
+
}
|
|
1118
|
+
if (changed.has('currentPage') || changed.has('displayMode')) {
|
|
1119
|
+
this.persistState();
|
|
1120
|
+
}
|
|
1121
|
+
if (changed.has('baseQuery') ||
|
|
1122
|
+
changed.has('minSelectedDate') ||
|
|
1123
|
+
changed.has('maxSelectedDate') ||
|
|
1124
|
+
changed.has('selectedFacets') ||
|
|
1125
|
+
changed.has('searchService') ||
|
|
1126
|
+
changed.has('withinCollection') ||
|
|
1127
|
+
changed.has('withinProfile') ||
|
|
1128
|
+
changed.has('profileElement')) {
|
|
1129
|
+
this.dataSource.refreshLetterCounts();
|
|
1130
|
+
}
|
|
1131
|
+
if (changed.has('selectedSort') || changed.has('sortDirection')) {
|
|
1132
|
+
const prevSortDirection = changed.get('sortDirection');
|
|
1133
|
+
this.sendSortByAnalytics(prevSortDirection);
|
|
1134
|
+
this.selectedSortChanged();
|
|
1135
|
+
}
|
|
1136
|
+
if (changed.has('selectedTitleFilter')) {
|
|
1137
|
+
this.sendFilterByTitleAnalytics(changed.get('selectedTitleFilter'));
|
|
1138
|
+
}
|
|
1139
|
+
if (changed.has('selectedCreatorFilter')) {
|
|
1140
|
+
this.sendFilterByCreatorAnalytics(changed.get('selectedCreatorFilter'));
|
|
1141
|
+
}
|
|
1142
|
+
this.updateFacetReadiness();
|
|
1143
|
+
if (changed.has('baseQuery') ||
|
|
1144
|
+
changed.has('searchType') ||
|
|
1145
|
+
changed.has('selectedTitleFilter') ||
|
|
1146
|
+
changed.has('selectedCreatorFilter') ||
|
|
1147
|
+
changed.has('minSelectedDate') ||
|
|
1148
|
+
changed.has('maxSelectedDate') ||
|
|
1149
|
+
changed.has('selectedSort') ||
|
|
1150
|
+
changed.has('sortDirection') ||
|
|
1151
|
+
changed.has('selectedFacets') ||
|
|
1152
|
+
changed.has('searchService') ||
|
|
1153
|
+
changed.has('withinCollection') ||
|
|
1154
|
+
changed.has('withinProfile') ||
|
|
1155
|
+
changed.has('profileElement')) {
|
|
1156
|
+
this.handleQueryChange();
|
|
1157
|
+
}
|
|
1158
|
+
if (changed.has('searchResultsLoading')) {
|
|
1159
|
+
this.emitSearchResultsLoadingChanged();
|
|
1160
|
+
}
|
|
1161
|
+
if (changed.has('facetsLoading') &&
|
|
1162
|
+
this.facetsLoading &&
|
|
1163
|
+
this.collectionFacets) {
|
|
1164
|
+
this.collectionFacets.moreLinksVisible =
|
|
1165
|
+
this.searchType !== SearchType.FULLTEXT;
|
|
1166
|
+
}
|
|
1167
|
+
if (changed.has('pagesToRender')) {
|
|
1168
|
+
if (!this.dataSource.endOfDataReached && this.infiniteScroller) {
|
|
1169
|
+
this.infiniteScroller.itemCount = this.estimatedTileCount;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
if (changed.has('isManageView')) {
|
|
1173
|
+
console.log('isManageView changed', changed.get('isManageView'), this.isManageView);
|
|
1174
|
+
if (this.isManageView) {
|
|
1175
|
+
this.displayMode = 'grid';
|
|
1176
|
+
this.fetchManageableSearchResults();
|
|
1177
|
+
}
|
|
1178
|
+
else if (this.pageContext === 'search')
|
|
1179
|
+
(_b = this.infiniteScroller) === null || _b === void 0 ? void 0 : _b.reload();
|
|
1180
|
+
(_c = this.infiniteScroller) === null || _c === void 0 ? void 0 : _c.refreshAllVisibleCells();
|
|
1181
|
+
this.emitManageModeChangedEvent();
|
|
1182
|
+
}
|
|
1183
|
+
if (changed.has('resizeObserver')) {
|
|
1184
|
+
const oldObserver = changed.get('resizeObserver');
|
|
1185
|
+
if (oldObserver)
|
|
1186
|
+
this.disconnectResizeObserver(oldObserver);
|
|
1187
|
+
this.setupResizeObserver();
|
|
1188
|
+
}
|
|
1189
|
+
this.ensureAvailableTilesDisplayed();
|
|
1190
|
+
}
|
|
1191
|
+
connectedCallback() {
|
|
1192
|
+
var _a;
|
|
1193
|
+
(_a = super.connectedCallback) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1194
|
+
this.setupStateRestorationObserver();
|
|
1195
|
+
this.setupResizeObserver();
|
|
1196
|
+
}
|
|
1197
|
+
disconnectedCallback() {
|
|
1198
|
+
var _a, _b;
|
|
1199
|
+
if (this.resizeObserver) {
|
|
1200
|
+
this.disconnectResizeObserver(this.resizeObserver);
|
|
1201
|
+
}
|
|
1202
|
+
if (this.boundNavigationHandler) {
|
|
1203
|
+
window.removeEventListener('popstate', this.boundNavigationHandler);
|
|
1204
|
+
}
|
|
1205
|
+
(_a = this.leftColIntersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1206
|
+
(_b = this.facetsIntersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1207
|
+
window.removeEventListener('resize', this.updateLeftColumnHeight);
|
|
1208
|
+
}
|
|
1209
|
+
handleResize(entry) {
|
|
1210
|
+
const previousView = this.mobileView;
|
|
1211
|
+
if (entry.target === this.contentContainer) {
|
|
1212
|
+
this.contentWidth = entry.contentRect.width;
|
|
1213
|
+
this.mobileView =
|
|
1214
|
+
this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;
|
|
1215
|
+
// If changing from desktop to mobile disable transition
|
|
1216
|
+
if (this.mobileView && !previousView) {
|
|
1217
|
+
this.isResizeToMobile = true;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
// Ensure the facet sidebar remains sized correctly
|
|
1221
|
+
this.updateLeftColumnHeight();
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Ensures that if we have new results from the data source that are not yet
|
|
1225
|
+
* displayed in the infinite scroller, that they are immediately reflected
|
|
1226
|
+
* in the tile count.
|
|
1227
|
+
*/
|
|
1228
|
+
ensureAvailableTilesDisplayed() {
|
|
1229
|
+
if (this.infiniteScroller &&
|
|
1230
|
+
this.infiniteScroller.itemCount < this.dataSource.size) {
|
|
1231
|
+
this.setTileCount(this.dataSource.endOfDataReached
|
|
1232
|
+
? this.dataSource.size
|
|
1233
|
+
: this.estimatedTileCount);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Updates the data source with the current state of facet readiness for loading,
|
|
1238
|
+
* so that they will begin to load in at the appropriate time according to the
|
|
1239
|
+
* current facet loading strategy.
|
|
1240
|
+
*/
|
|
1241
|
+
updateFacetReadiness() {
|
|
1242
|
+
// There are two ways to opt into facet production:
|
|
1243
|
+
// (1) have the facets dropdown open, or
|
|
1244
|
+
// (2) if using the `opt-in-or-login` strategy, be logged into an account
|
|
1245
|
+
const optedIn = this.collapsibleFacetsVisible ||
|
|
1246
|
+
(this.facetLoadStrategy === 'opt-in-or-login' && this.loggedIn);
|
|
1247
|
+
// In desktop view, we are always ready to load facets *unless* we are using one of the
|
|
1248
|
+
// `opt-in` strategies and have not opted in (whether by login or UI interaction).
|
|
1249
|
+
const usingOptInStrategy = ['opt-in', 'opt-in-or-login'].includes(this.facetLoadStrategy);
|
|
1250
|
+
const desktopFacetsReady = !this.mobileView && (!usingOptInStrategy || optedIn);
|
|
1251
|
+
// In the mobile view, facets are considered ready provided we have opted in (whether by
|
|
1252
|
+
// login or UI interaction).
|
|
1253
|
+
const mobileFacetsReady = this.mobileView && optedIn;
|
|
1254
|
+
this.dataSource.handleFacetReadinessChange(desktopFacetsReady || mobileFacetsReady);
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Sets up listeners for events that may require updating the left column height.
|
|
1258
|
+
*/
|
|
1259
|
+
setupLeftColumnScrollListeners() {
|
|
1260
|
+
var _a;
|
|
1261
|
+
// We observe intersections between the left column's scroll sentinel and
|
|
1262
|
+
// the viewport, so that we can ensure the left column is always sized to
|
|
1263
|
+
// match the _available_ viewport height. This should generally be more
|
|
1264
|
+
// performant than listening to scroll events on the page or column.
|
|
1265
|
+
const leftColumnSentinel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#left-column-scroll-sentinel');
|
|
1266
|
+
if (leftColumnSentinel) {
|
|
1267
|
+
this.leftColIntersectionObserver = new IntersectionObserver(this.updateLeftColumnHeight, {
|
|
1268
|
+
threshold: [...Array(201).keys()].map(n => n / 200), // Threshold every 0.5%
|
|
1269
|
+
});
|
|
1270
|
+
this.leftColIntersectionObserver.observe(leftColumnSentinel);
|
|
1271
|
+
}
|
|
1272
|
+
// We also listen for window resize events, as they are not always captured
|
|
1273
|
+
// by the resize observer and can affect the desired height of the left column.
|
|
1274
|
+
window.addEventListener('resize', this.updateLeftColumnHeight);
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
|
|
1278
|
+
* Note this uses a separate IntersectionObserver from the left column, because we
|
|
1279
|
+
* don't need granular intersection thresholds for this.
|
|
1280
|
+
*/
|
|
1281
|
+
setupFacetsScrollListeners() {
|
|
1282
|
+
var _a;
|
|
1283
|
+
const facetsSentinel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#facets-scroll-sentinel');
|
|
1284
|
+
if (facetsSentinel) {
|
|
1285
|
+
this.facetsIntersectionObserver = new IntersectionObserver(this.updateFacetFadeOut);
|
|
1286
|
+
this.facetsIntersectionObserver.observe(facetsSentinel);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Emits a `baseQueryChanged` event indicating an update to the search query.
|
|
1291
|
+
*/
|
|
1292
|
+
emitBaseQueryChanged() {
|
|
1293
|
+
this.dispatchEvent(new CustomEvent('baseQueryChanged', {
|
|
1294
|
+
detail: {
|
|
1295
|
+
baseQuery: this.baseQuery,
|
|
1296
|
+
},
|
|
1297
|
+
}));
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Emits a `searchTypeChanged` event indicating an update to the search type
|
|
1301
|
+
* (e.g., metadata vs. full-text).
|
|
1302
|
+
*/
|
|
1303
|
+
emitSearchTypeChanged() {
|
|
1304
|
+
this.dispatchEvent(new CustomEvent('searchTypeChanged', {
|
|
1305
|
+
detail: this.searchType,
|
|
1306
|
+
}));
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
1310
|
+
* properties have changed in a way that could affect the set of search results.
|
|
1311
|
+
*/
|
|
1312
|
+
emitQueryStateChanged() {
|
|
1313
|
+
this.dispatchEvent(new CustomEvent('queryStateChanged', {
|
|
1314
|
+
detail: {
|
|
1315
|
+
baseQuery: this.baseQuery,
|
|
1316
|
+
withinCollection: this.withinCollection,
|
|
1317
|
+
withinProfile: this.withinProfile,
|
|
1318
|
+
profileElement: this.profileElement,
|
|
1319
|
+
searchType: this.searchType,
|
|
1320
|
+
selectedFacets: this.selectedFacets,
|
|
1321
|
+
minSelectedDate: this.minSelectedDate,
|
|
1322
|
+
maxSelectedDate: this.maxSelectedDate,
|
|
1323
|
+
selectedSort: this.selectedSort,
|
|
1324
|
+
sortDirection: this.sortDirection,
|
|
1325
|
+
selectedTitleFilter: this.selectedTitleFilter,
|
|
1326
|
+
selectedCreatorFilter: this.selectedCreatorFilter,
|
|
1327
|
+
},
|
|
1328
|
+
}));
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Emits an `emptyResults` event indicating that we have received an empty result set
|
|
1332
|
+
* for the most recent query.
|
|
1333
|
+
*/
|
|
1334
|
+
emitEmptyResults() {
|
|
1335
|
+
this.dispatchEvent(new Event('emptyResults'));
|
|
1336
|
+
}
|
|
1337
|
+
disconnectResizeObserver(resizeObserver) {
|
|
1338
|
+
resizeObserver.removeObserver({
|
|
1339
|
+
target: this.contentContainer,
|
|
1340
|
+
handler: this,
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
setupResizeObserver() {
|
|
1344
|
+
if (!this.resizeObserver || !this.contentContainer)
|
|
1345
|
+
return;
|
|
1346
|
+
this.resizeObserver.addObserver({
|
|
1347
|
+
target: this.contentContainer,
|
|
1348
|
+
handler: this,
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* When the visible cells change from the infinite scroller, we want to emit
|
|
1353
|
+
* which page is currently visible so the consumer can update its UI or the URL
|
|
1354
|
+
*
|
|
1355
|
+
* @param e
|
|
1356
|
+
* @returns
|
|
1357
|
+
*/
|
|
1358
|
+
visibleCellsChanged(e) {
|
|
1359
|
+
if (this.isScrollingToCell)
|
|
1360
|
+
return;
|
|
1361
|
+
const { visibleCellIndices } = e.detail;
|
|
1362
|
+
if (visibleCellIndices.length === 0)
|
|
1363
|
+
return;
|
|
1364
|
+
// For page determination, do not count more than a single page of visible cells,
|
|
1365
|
+
// since otherwise patrons using very tall screens will be treated as one page
|
|
1366
|
+
// further than they actually are.
|
|
1367
|
+
const lastIndexWithinCurrentPage = Math.min(this.pageSize, visibleCellIndices.length) - 1;
|
|
1368
|
+
const lastVisibleCellIndex = visibleCellIndices[lastIndexWithinCurrentPage];
|
|
1369
|
+
const lastVisibleCellPage = Math.floor(lastVisibleCellIndex / this.pageSize) + 1;
|
|
1370
|
+
if (this.currentPage !== lastVisibleCellPage) {
|
|
1371
|
+
this.currentPage = lastVisibleCellPage;
|
|
1372
|
+
}
|
|
1373
|
+
const event = new CustomEvent('visiblePageChanged', {
|
|
1374
|
+
detail: {
|
|
1375
|
+
pageNumber: lastVisibleCellPage,
|
|
1376
|
+
},
|
|
1377
|
+
});
|
|
1378
|
+
this.dispatchEvent(event);
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
1382
|
+
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
1383
|
+
*
|
|
1384
|
+
* Ensure you await this component's `updateComplete` promise before awaiting this
|
|
1385
|
+
* one, to ensure you do not await an obsolete promise from the previous update.
|
|
1386
|
+
*/
|
|
1387
|
+
get initialSearchComplete() {
|
|
1388
|
+
return this.dataSource.initialSearchComplete;
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Handler for whenever the component's properties change in a way that may require
|
|
1392
|
+
* fetching new results.
|
|
1393
|
+
*/
|
|
1394
|
+
async handleQueryChange() {
|
|
1395
|
+
var _a;
|
|
1396
|
+
// only reset if the query has actually changed
|
|
1397
|
+
if (!this.searchService ||
|
|
1398
|
+
this.dataSource.pageFetchQueryKey === this.previousQueryKey) {
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
// If the new state prevents us from updating the search results, don't reset
|
|
1402
|
+
if (this.baseQuery && !this.dataSource.canPerformSearch) {
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
this.previousQueryKey = this.dataSource.pageFetchQueryKey;
|
|
1406
|
+
this.totalResults = undefined;
|
|
1407
|
+
this.pagesToRender =
|
|
1408
|
+
this.initialPageNumber === 1
|
|
1409
|
+
? 2 // First two pages are batched into one request when starting from page 1
|
|
1410
|
+
: this.initialPageNumber;
|
|
1411
|
+
// Reset the infinite scroller's item count, so that it
|
|
1412
|
+
// shows tile placeholders until the new query's results load in
|
|
1413
|
+
if (this.infiniteScroller) {
|
|
1414
|
+
this.infiniteScroller.itemCount = this.estimatedTileCount;
|
|
1415
|
+
this.infiniteScroller.reload();
|
|
1416
|
+
}
|
|
1417
|
+
if (this.withinCollection && ((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
1418
|
+
this.defaultSortField = SortField.relevance;
|
|
1419
|
+
this.defaultSortDirection = null;
|
|
1420
|
+
}
|
|
1421
|
+
if (!this.initialQueryChangeHappened && this.initialPageNumber > 1) {
|
|
1422
|
+
this.scrollToPage(this.initialPageNumber);
|
|
1423
|
+
}
|
|
1424
|
+
this.initialQueryChangeHappened = true;
|
|
1425
|
+
// if the query changed as part of a window.history pop event, we don't want to
|
|
1426
|
+
// persist the state because it overwrites the forward history
|
|
1427
|
+
if (!this.historyPopOccurred) {
|
|
1428
|
+
this.persistState();
|
|
1429
|
+
}
|
|
1430
|
+
this.historyPopOccurred = false;
|
|
1431
|
+
}
|
|
1432
|
+
setupStateRestorationObserver() {
|
|
1433
|
+
if (!this.boundNavigationHandler) {
|
|
1434
|
+
this.boundNavigationHandler = this.historyNavigationHandler.bind(this);
|
|
1435
|
+
}
|
|
1436
|
+
// when the user navigates back, we want to update the UI to match the URL
|
|
1437
|
+
window.addEventListener('popstate', this.boundNavigationHandler);
|
|
1438
|
+
}
|
|
1439
|
+
historyNavigationHandler() {
|
|
1440
|
+
this.historyPopOccurred = true;
|
|
1441
|
+
this.restoreState();
|
|
1442
|
+
}
|
|
1443
|
+
restoreState() {
|
|
1444
|
+
var _a, _b, _c, _d, _e;
|
|
1445
|
+
const restorationState = this.restorationStateHandler.getRestorationState();
|
|
1446
|
+
this.displayMode = restorationState.displayMode;
|
|
1447
|
+
if (restorationState.searchType != null)
|
|
1448
|
+
this.searchType = restorationState.searchType;
|
|
1449
|
+
this.selectedSort = (_a = restorationState.selectedSort) !== null && _a !== void 0 ? _a : SortField.default;
|
|
1450
|
+
this.sortDirection = (_b = restorationState.sortDirection) !== null && _b !== void 0 ? _b : null;
|
|
1451
|
+
this.selectedTitleFilter = (_c = restorationState.selectedTitleFilter) !== null && _c !== void 0 ? _c : null;
|
|
1452
|
+
this.selectedCreatorFilter = (_d = restorationState.selectedCreatorFilter) !== null && _d !== void 0 ? _d : null;
|
|
1453
|
+
this.selectedFacets = restorationState.selectedFacets;
|
|
1454
|
+
if (!this.suppressURLQuery)
|
|
1455
|
+
this.baseQuery = restorationState.baseQuery;
|
|
1456
|
+
this.currentPage = (_e = restorationState.currentPage) !== null && _e !== void 0 ? _e : 1;
|
|
1457
|
+
this.minSelectedDate = restorationState.minSelectedDate;
|
|
1458
|
+
this.maxSelectedDate = restorationState.maxSelectedDate;
|
|
1459
|
+
if (this.currentPage > 1) {
|
|
1460
|
+
this.goToPage(this.currentPage);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
persistState() {
|
|
1464
|
+
var _a, _b, _c, _d;
|
|
1465
|
+
const restorationState = {
|
|
1466
|
+
displayMode: this.displayMode,
|
|
1467
|
+
searchType: this.searchType,
|
|
1468
|
+
selectedSort: this.selectedSort,
|
|
1469
|
+
sortDirection: (_a = this.sortDirection) !== null && _a !== void 0 ? _a : undefined,
|
|
1470
|
+
selectedFacets: (_b = this.selectedFacets) !== null && _b !== void 0 ? _b : getDefaultSelectedFacets(),
|
|
1471
|
+
baseQuery: this.suppressURLQuery ? undefined : this.baseQuery,
|
|
1472
|
+
currentPage: this.currentPage,
|
|
1473
|
+
titleQuery: this.titleQuery,
|
|
1474
|
+
creatorQuery: this.creatorQuery,
|
|
1475
|
+
minSelectedDate: this.minSelectedDate,
|
|
1476
|
+
maxSelectedDate: this.maxSelectedDate,
|
|
1477
|
+
selectedTitleFilter: (_c = this.selectedTitleFilter) !== null && _c !== void 0 ? _c : undefined,
|
|
1478
|
+
selectedCreatorFilter: (_d = this.selectedCreatorFilter) !== null && _d !== void 0 ? _d : undefined,
|
|
1479
|
+
};
|
|
1480
|
+
this.restorationStateHandler.persistState(restorationState, this.dataSourceInstallInProgress);
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* Emits a `searchResultsLoadingChanged` event indicating that our loading state has
|
|
1484
|
+
* changed (either we have started loading new results, or we have finished loading them).
|
|
1485
|
+
*/
|
|
1486
|
+
emitSearchResultsLoadingChanged() {
|
|
1487
|
+
this.dispatchEvent(new CustomEvent('searchResultsLoadingChanged', {
|
|
1488
|
+
detail: {
|
|
1489
|
+
loading: this.searchResultsLoading,
|
|
1490
|
+
},
|
|
1491
|
+
}));
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Handler for when the set of selected facets changes.
|
|
1495
|
+
*/
|
|
1496
|
+
facetsChanged(e) {
|
|
1497
|
+
this.selectedFacets = e.detail;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Handler for when any facet is selected/unselected/hidden/unhidden.
|
|
1501
|
+
* Fires analytics indicating the type of facet event that took place.
|
|
1502
|
+
*/
|
|
1503
|
+
facetClickHandler({ detail: { facetType, bucket, negative }, }) {
|
|
1504
|
+
var _a;
|
|
1505
|
+
let action;
|
|
1506
|
+
if (negative) {
|
|
1507
|
+
action =
|
|
1508
|
+
bucket.state !== 'none'
|
|
1509
|
+
? analyticsActions.facetNegativeSelected
|
|
1510
|
+
: analyticsActions.facetNegativeDeselected;
|
|
1511
|
+
}
|
|
1512
|
+
else {
|
|
1513
|
+
action =
|
|
1514
|
+
bucket.state !== 'none'
|
|
1515
|
+
? analyticsActions.facetSelected
|
|
1516
|
+
: analyticsActions.facetDeselected;
|
|
1517
|
+
}
|
|
1518
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
1519
|
+
category: this.searchContext,
|
|
1520
|
+
action,
|
|
1521
|
+
label: facetType,
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
scrollToPage(pageNumber) {
|
|
1525
|
+
return new Promise(resolve => {
|
|
1526
|
+
const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);
|
|
1527
|
+
// without this setTimeout, Safari just pauses until the `fetchPage` is complete
|
|
1528
|
+
// then scrolls to the cell
|
|
1529
|
+
setTimeout(() => {
|
|
1530
|
+
var _a;
|
|
1531
|
+
this.isScrollingToCell = true;
|
|
1532
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.scrollToCell(cellIndexToScrollTo, true);
|
|
1533
|
+
// This timeout is to give the scroll animation time to finish
|
|
1534
|
+
// then updating the infinite scroller once we're done scrolling
|
|
1535
|
+
// There's no scroll animation completion callback so we're
|
|
1536
|
+
// giving it 0.5s to finish.
|
|
1537
|
+
setTimeout(() => {
|
|
1538
|
+
var _a;
|
|
1539
|
+
this.isScrollingToCell = false;
|
|
1540
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshAllVisibleCells();
|
|
1541
|
+
resolve();
|
|
1542
|
+
}, 500);
|
|
1543
|
+
}, 0);
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Whether sorting by relevance makes sense for the current state.
|
|
1548
|
+
* Currently equivalent to having a non-empty query.
|
|
1549
|
+
*/
|
|
1550
|
+
get isRelevanceSortAvailable() {
|
|
1551
|
+
var _a;
|
|
1552
|
+
return !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* Sets the total number of tiles displayed in the infinite scroller.
|
|
1556
|
+
*/
|
|
1557
|
+
setTileCount(count) {
|
|
1558
|
+
if (this.infiniteScroller) {
|
|
1559
|
+
this.infiniteScroller.itemCount = count;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Applies any default sort option for the current collection, by checking
|
|
1564
|
+
* for one in the collection's metadata. If none is found, defaults to sorting
|
|
1565
|
+
* descending by:
|
|
1566
|
+
* - Date Favorited for fav-* collections
|
|
1567
|
+
* - Weekly views for all other collections
|
|
1568
|
+
*/
|
|
1569
|
+
applyDefaultCollectionSort(collectionInfo) {
|
|
1570
|
+
var _a, _b, _c;
|
|
1571
|
+
if (this.baseQuery) {
|
|
1572
|
+
// If there's a query set, then we default to relevance sorting regardless of
|
|
1573
|
+
// the collection metadata-specified sort.
|
|
1574
|
+
this.defaultSortField = SortField.relevance;
|
|
1575
|
+
this.defaultSortDirection = null;
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
// Favorite collections sort on Date Favorited by default.
|
|
1579
|
+
// Other collections fall back to sorting on weekly views.
|
|
1580
|
+
const baseDefaultSort = ((_b = (_a = collectionInfo === null || collectionInfo === void 0 ? void 0 : collectionInfo.public_metadata) === null || _a === void 0 ? void 0 : _a.identifier) === null || _b === void 0 ? void 0 : _b.startsWith('fav-'))
|
|
1581
|
+
? '-favoritedate'
|
|
1582
|
+
: '-week';
|
|
1583
|
+
// The collection metadata may override the default sorting with something else
|
|
1584
|
+
const metadataSort = (_c = collectionInfo === null || collectionInfo === void 0 ? void 0 : collectionInfo.public_metadata) === null || _c === void 0 ? void 0 : _c['sort-by'];
|
|
1585
|
+
// Prefer the metadata-specified sort if one exists
|
|
1586
|
+
const defaultSortToApply = metadataSort !== null && metadataSort !== void 0 ? metadataSort : baseDefaultSort;
|
|
1587
|
+
// Account for both -field and field:dir formats
|
|
1588
|
+
let [field, dir] = defaultSortToApply.split(':');
|
|
1589
|
+
if (field.startsWith('-')) {
|
|
1590
|
+
field = field.slice(1);
|
|
1591
|
+
dir = 'desc';
|
|
1592
|
+
}
|
|
1593
|
+
else if (!['asc', 'desc'].includes(dir)) {
|
|
1594
|
+
dir = 'asc';
|
|
1595
|
+
}
|
|
1596
|
+
const sortOption = sortOptionFromAPIString(field);
|
|
1597
|
+
const sortField = sortOption.field;
|
|
1598
|
+
if (sortField && sortField !== SortField.default) {
|
|
1599
|
+
this.defaultSortField = sortField;
|
|
1600
|
+
this.defaultSortDirection = dir;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Applies the default sort option for the current profile element
|
|
1605
|
+
*/
|
|
1606
|
+
applyDefaultProfileSort() {
|
|
1607
|
+
if (this.profileElement) {
|
|
1608
|
+
const defaultSortField = defaultProfileElementSorts[this.profileElement];
|
|
1609
|
+
this.defaultSortField = defaultSortField !== null && defaultSortField !== void 0 ? defaultSortField : SortField.weeklyview;
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
this.defaultSortField = SortField.weeklyview;
|
|
1613
|
+
}
|
|
1614
|
+
this.defaultSortDirection = 'desc';
|
|
1615
|
+
}
|
|
1616
|
+
/**
|
|
1617
|
+
* This is useful for determining whether we need to reload the scroller.
|
|
1618
|
+
*
|
|
1619
|
+
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
1620
|
+
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
1621
|
+
*/
|
|
1622
|
+
get currentVisiblePageNumbers() {
|
|
1623
|
+
var _a, _b;
|
|
1624
|
+
const visibleCells = (_b = (_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.getVisibleCellIndices()) !== null && _b !== void 0 ? _b : [];
|
|
1625
|
+
const visiblePages = new Set();
|
|
1626
|
+
visibleCells.forEach(cellIndex => {
|
|
1627
|
+
const visiblePage = Math.floor(cellIndex / this.pageSize) + 1;
|
|
1628
|
+
visiblePages.add(visiblePage);
|
|
1629
|
+
});
|
|
1630
|
+
return Array.from(visiblePages);
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Refreshes all visible result cells in the infinite scroller.
|
|
1634
|
+
*/
|
|
1635
|
+
refreshVisibleResults() {
|
|
1636
|
+
var _a;
|
|
1637
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshAllVisibleCells();
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Callback when a result is selected
|
|
1641
|
+
*/
|
|
1642
|
+
resultSelected(event) {
|
|
1643
|
+
var _a, _b, _c;
|
|
1644
|
+
if (this.isManageView) {
|
|
1645
|
+
// Checked/unchecked state change -- rerender to ensure it propagates
|
|
1646
|
+
// this.mapDataSource(model => ({ ...model }));
|
|
1647
|
+
const cellIndex = this.dataSource.indexOf(event.detail);
|
|
1648
|
+
if (cellIndex >= 0)
|
|
1649
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshCell(cellIndex);
|
|
1650
|
+
this.requestUpdate();
|
|
1651
|
+
}
|
|
1652
|
+
(_b = this.analyticsHandler) === null || _b === void 0 ? void 0 : _b.sendEvent({
|
|
1653
|
+
category: this.searchContext,
|
|
1654
|
+
action: analyticsActions.resultSelected,
|
|
1655
|
+
label: event.detail.mediatype,
|
|
1656
|
+
});
|
|
1657
|
+
(_c = this.analyticsHandler) === null || _c === void 0 ? void 0 : _c.sendEvent({
|
|
1658
|
+
category: this.searchContext,
|
|
1659
|
+
action: analyticsActions.resultSelected,
|
|
1660
|
+
label: `page-${this.currentPage}`,
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
cellForIndex(index) {
|
|
1664
|
+
const model = this.tileModelAtCellIndex(index);
|
|
1665
|
+
if (!model)
|
|
1666
|
+
return undefined;
|
|
1661
1667
|
return html `
|
|
1662
1668
|
<tile-dispatcher
|
|
1663
1669
|
.collectionPagePath=${this.collectionPagePath}
|
|
@@ -1677,40 +1683,41 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1677
1683
|
@resultSelected=${(e) => this.resultSelected(e)}
|
|
1678
1684
|
>
|
|
1679
1685
|
</tile-dispatcher>
|
|
1680
|
-
`;
|
|
1681
|
-
}
|
|
1682
|
-
/**
|
|
1683
|
-
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
1684
|
-
* increase the number of pages to render and start fetching data for the new page
|
|
1685
|
-
*/
|
|
1686
|
-
scrollThresholdReached() {
|
|
1687
|
-
if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {
|
|
1688
|
-
this.pagesToRender += 1;
|
|
1689
|
-
this.dataSource.fetchPage(this.pagesToRender);
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Fetches search results for privileged users when in manage view.
|
|
1694
|
-
*
|
|
1695
|
-
* This method:
|
|
1696
|
-
* 1. Checks if we're in search context with > 100 results and not currently loading
|
|
1697
|
-
* 2. Resets the datasource pagination state
|
|
1698
|
-
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
1699
|
-
* 4. Reloads the infinite scroller to display new results
|
|
1700
|
-
*/
|
|
1701
|
-
|
|
1702
|
-
var _a;
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
!this.searchResultsLoading
|
|
1706
|
-
|
|
1707
|
-
this.dataSource.
|
|
1708
|
-
(
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1686
|
+
`;
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
1690
|
+
* increase the number of pages to render and start fetching data for the new page
|
|
1691
|
+
*/
|
|
1692
|
+
scrollThresholdReached() {
|
|
1693
|
+
if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {
|
|
1694
|
+
this.pagesToRender += 1;
|
|
1695
|
+
this.dataSource.fetchPage(this.pagesToRender);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Fetches search results for privileged users when in manage view.
|
|
1700
|
+
*
|
|
1701
|
+
* This method:
|
|
1702
|
+
* 1. Checks if we're in search context with > 100 results and not currently loading
|
|
1703
|
+
* 2. Resets the datasource pagination state
|
|
1704
|
+
* 3. Fetches first page with limit based on maxPagesToManage threshold
|
|
1705
|
+
* 4. Reloads the infinite scroller to display new results
|
|
1706
|
+
*/
|
|
1707
|
+
fetchManageableSearchResults() {
|
|
1708
|
+
var _a;
|
|
1709
|
+
console.log('fetchManageableSearchResults', this.pageContext, this.dataSource.totalResults, this.searchResultsLoading);
|
|
1710
|
+
if (this.pageContext === 'search' &&
|
|
1711
|
+
(this.dataSource.totalResults > 100 && !this.searchResultsLoading ||
|
|
1712
|
+
!this.dataSource.totalResults)) {
|
|
1713
|
+
this.dataSource.resetPages();
|
|
1714
|
+
this.dataSource.fetchPage(1, this.maxPagesToManage);
|
|
1715
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
static get styles() {
|
|
1719
|
+
return [
|
|
1720
|
+
srOnlyStyle,
|
|
1714
1721
|
css `
|
|
1715
1722
|
:host {
|
|
1716
1723
|
display: block;
|
|
@@ -2133,195 +2140,195 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
2133
2140
|
infinite-scroller.hidden {
|
|
2134
2141
|
display: none;
|
|
2135
2142
|
}
|
|
2136
|
-
`,
|
|
2137
|
-
];
|
|
2138
|
-
}
|
|
2139
|
-
};
|
|
2140
|
-
__decorate([
|
|
2141
|
-
property({ type: String })
|
|
2142
|
-
], CollectionBrowser.prototype, "baseNavigationUrl", void 0);
|
|
2143
|
-
__decorate([
|
|
2144
|
-
property({ type: String })
|
|
2145
|
-
], CollectionBrowser.prototype, "baseImageUrl", void 0);
|
|
2146
|
-
__decorate([
|
|
2147
|
-
property({ type: Object })
|
|
2148
|
-
], CollectionBrowser.prototype, "searchService", void 0);
|
|
2149
|
-
__decorate([
|
|
2150
|
-
property({ type: Number })
|
|
2151
|
-
], CollectionBrowser.prototype, "searchType", void 0);
|
|
2152
|
-
__decorate([
|
|
2153
|
-
property({ type: String })
|
|
2154
|
-
], CollectionBrowser.prototype, "withinCollection", void 0);
|
|
2155
|
-
__decorate([
|
|
2156
|
-
property({ type: String })
|
|
2157
|
-
], CollectionBrowser.prototype, "withinProfile", void 0);
|
|
2158
|
-
__decorate([
|
|
2159
|
-
property({ type: String })
|
|
2160
|
-
], CollectionBrowser.prototype, "profileElement", void 0);
|
|
2161
|
-
__decorate([
|
|
2162
|
-
property({ type: String })
|
|
2163
|
-
], CollectionBrowser.prototype, "baseQuery", void 0);
|
|
2164
|
-
__decorate([
|
|
2165
|
-
property({ type: String })
|
|
2166
|
-
], CollectionBrowser.prototype, "displayMode", void 0);
|
|
2167
|
-
__decorate([
|
|
2168
|
-
property({ type: String })
|
|
2169
|
-
], CollectionBrowser.prototype, "selectedSort", void 0);
|
|
2170
|
-
__decorate([
|
|
2171
|
-
property({ type: String })
|
|
2172
|
-
], CollectionBrowser.prototype, "selectedTitleFilter", void 0);
|
|
2173
|
-
__decorate([
|
|
2174
|
-
property({ type: String })
|
|
2175
|
-
], CollectionBrowser.prototype, "selectedCreatorFilter", void 0);
|
|
2176
|
-
__decorate([
|
|
2177
|
-
property({ type: String })
|
|
2178
|
-
], CollectionBrowser.prototype, "sortDirection", void 0);
|
|
2179
|
-
__decorate([
|
|
2180
|
-
property({ type: String })
|
|
2181
|
-
], CollectionBrowser.prototype, "defaultSortField", void 0);
|
|
2182
|
-
__decorate([
|
|
2183
|
-
property({ type: String })
|
|
2184
|
-
], CollectionBrowser.prototype, "defaultSortDirection", void 0);
|
|
2185
|
-
__decorate([
|
|
2186
|
-
property({ type: Number })
|
|
2187
|
-
], CollectionBrowser.prototype, "pageSize", void 0);
|
|
2188
|
-
__decorate([
|
|
2189
|
-
property({ type: Number })
|
|
2190
|
-
], CollectionBrowser.prototype, "currentPage", void 0);
|
|
2191
|
-
__decorate([
|
|
2192
|
-
property({ type: String })
|
|
2193
|
-
], CollectionBrowser.prototype, "minSelectedDate", void 0);
|
|
2194
|
-
__decorate([
|
|
2195
|
-
property({ type: String })
|
|
2196
|
-
], CollectionBrowser.prototype, "maxSelectedDate", void 0);
|
|
2197
|
-
__decorate([
|
|
2198
|
-
property({ type: Object })
|
|
2199
|
-
], CollectionBrowser.prototype, "selectedFacets", void 0);
|
|
2200
|
-
__decorate([
|
|
2201
|
-
property({ type: Boolean })
|
|
2202
|
-
], CollectionBrowser.prototype, "showSmartFacetBar", void 0);
|
|
2203
|
-
__decorate([
|
|
2204
|
-
property({ type: Boolean })
|
|
2205
|
-
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0);
|
|
2206
|
-
__decorate([
|
|
2207
|
-
property({ type: Boolean })
|
|
2208
|
-
], CollectionBrowser.prototype, "suppressPlaceholders", void 0);
|
|
2209
|
-
__decorate([
|
|
2210
|
-
property({ type: Boolean })
|
|
2211
|
-
], CollectionBrowser.prototype, "suppressResultCount", void 0);
|
|
2212
|
-
__decorate([
|
|
2213
|
-
property({ type: Boolean })
|
|
2214
|
-
], CollectionBrowser.prototype, "suppressResultTiles", void 0);
|
|
2215
|
-
__decorate([
|
|
2216
|
-
property({ type: Boolean })
|
|
2217
|
-
], CollectionBrowser.prototype, "suppressURLQuery", void 0);
|
|
2218
|
-
__decorate([
|
|
2219
|
-
property({ type: Boolean })
|
|
2220
|
-
], CollectionBrowser.prototype, "suppressSortBar", void 0);
|
|
2221
|
-
__decorate([
|
|
2222
|
-
property({ type: Boolean })
|
|
2223
|
-
], CollectionBrowser.prototype, "suppressDisplayModes", void 0);
|
|
2224
|
-
__decorate([
|
|
2225
|
-
property({ type: String })
|
|
2226
|
-
], CollectionBrowser.prototype, "facetLoadStrategy", void 0);
|
|
2227
|
-
__decorate([
|
|
2228
|
-
property({ type: Boolean })
|
|
2229
|
-
], CollectionBrowser.prototype, "facetPaneVisible", void 0);
|
|
2230
|
-
__decorate([
|
|
2231
|
-
property({ type: Boolean })
|
|
2232
|
-
], CollectionBrowser.prototype, "clearResultsOnEmptyQuery", void 0);
|
|
2233
|
-
__decorate([
|
|
2234
|
-
property({ type: String })
|
|
2235
|
-
], CollectionBrowser.prototype, "collectionPagePath", void 0);
|
|
2236
|
-
__decorate([
|
|
2237
|
-
property({ type: String, reflect: true })
|
|
2238
|
-
], CollectionBrowser.prototype, "searchContext", void 0);
|
|
2239
|
-
__decorate([
|
|
2240
|
-
property({ type: String })
|
|
2241
|
-
], CollectionBrowser.prototype, "pageContext", void 0);
|
|
2242
|
-
__decorate([
|
|
2243
|
-
property({ type: Object })
|
|
2244
|
-
], CollectionBrowser.prototype, "restorationStateHandler", void 0);
|
|
2245
|
-
__decorate([
|
|
2246
|
-
property({ type: Number })
|
|
2247
|
-
], CollectionBrowser.prototype, "mobileBreakpoint", void 0);
|
|
2248
|
-
__decorate([
|
|
2249
|
-
property({ type: Boolean })
|
|
2250
|
-
], CollectionBrowser.prototype, "loggedIn", void 0);
|
|
2251
|
-
__decorate([
|
|
2252
|
-
property({ type: Object })
|
|
2253
|
-
], CollectionBrowser.prototype, "resizeObserver", void 0);
|
|
2254
|
-
__decorate([
|
|
2255
|
-
property({ type: Object })
|
|
2256
|
-
], CollectionBrowser.prototype, "modalManager", void 0);
|
|
2257
|
-
__decorate([
|
|
2258
|
-
property({ type: Object })
|
|
2259
|
-
], CollectionBrowser.prototype, "featureFeedbackService", void 0);
|
|
2260
|
-
__decorate([
|
|
2261
|
-
property({ type: Object })
|
|
2262
|
-
], CollectionBrowser.prototype, "recaptchaManager", void 0);
|
|
2263
|
-
__decorate([
|
|
2264
|
-
property({ type: Boolean })
|
|
2265
|
-
], CollectionBrowser.prototype, "isManageView", void 0);
|
|
2266
|
-
__decorate([
|
|
2267
|
-
property({ type: String })
|
|
2268
|
-
], CollectionBrowser.prototype, "manageViewLabel", void 0);
|
|
2269
|
-
__decorate([
|
|
2270
|
-
property({ type: Boolean })
|
|
2271
|
-
], CollectionBrowser.prototype, "enableSortOptionsSlot", void 0);
|
|
2272
|
-
__decorate([
|
|
2273
|
-
property({ type: Boolean, reflect: true })
|
|
2274
|
-
], CollectionBrowser.prototype, "showSmartResults", void 0);
|
|
2275
|
-
__decorate([
|
|
2276
|
-
property({ type: Number })
|
|
2277
|
-
], CollectionBrowser.prototype, "maxPagesToManage", void 0);
|
|
2278
|
-
__decorate([
|
|
2279
|
-
property({ type: Object })
|
|
2280
|
-
], CollectionBrowser.prototype, "dataSource", void 0);
|
|
2281
|
-
__decorate([
|
|
2282
|
-
state()
|
|
2283
|
-
], CollectionBrowser.prototype, "pagesToRender", void 0);
|
|
2284
|
-
__decorate([
|
|
2285
|
-
state()
|
|
2286
|
-
], CollectionBrowser.prototype, "searchResultsLoading", void 0);
|
|
2287
|
-
__decorate([
|
|
2288
|
-
state()
|
|
2289
|
-
], CollectionBrowser.prototype, "facetsLoading", void 0);
|
|
2290
|
-
__decorate([
|
|
2291
|
-
state()
|
|
2292
|
-
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
2293
|
-
__decorate([
|
|
2294
|
-
state()
|
|
2295
|
-
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
2296
|
-
__decorate([
|
|
2297
|
-
state()
|
|
2298
|
-
], CollectionBrowser.prototype, "collapsibleFacetsVisible", void 0);
|
|
2299
|
-
__decorate([
|
|
2300
|
-
state()
|
|
2301
|
-
], CollectionBrowser.prototype, "contentWidth", void 0);
|
|
2302
|
-
__decorate([
|
|
2303
|
-
state()
|
|
2304
|
-
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
2305
|
-
__decorate([
|
|
2306
|
-
query('#content-container')
|
|
2307
|
-
], CollectionBrowser.prototype, "contentContainer", void 0);
|
|
2308
|
-
__decorate([
|
|
2309
|
-
query('#left-column')
|
|
2310
|
-
], CollectionBrowser.prototype, "leftColumn", void 0);
|
|
2311
|
-
__decorate([
|
|
2312
|
-
query('collection-facets')
|
|
2313
|
-
], CollectionBrowser.prototype, "collectionFacets", void 0);
|
|
2314
|
-
__decorate([
|
|
2315
|
-
query('manage-bar')
|
|
2316
|
-
], CollectionBrowser.prototype, "manageBar", void 0);
|
|
2317
|
-
__decorate([
|
|
2318
|
-
property({ type: Object, attribute: false })
|
|
2319
|
-
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|
|
2320
|
-
__decorate([
|
|
2321
|
-
query('infinite-scroller')
|
|
2322
|
-
], CollectionBrowser.prototype, "infiniteScroller", void 0);
|
|
2323
|
-
CollectionBrowser = __decorate([
|
|
2324
|
-
customElement('collection-browser')
|
|
2325
|
-
], CollectionBrowser);
|
|
2326
|
-
export { CollectionBrowser };
|
|
2143
|
+
`,
|
|
2144
|
+
];
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
__decorate([
|
|
2148
|
+
property({ type: String })
|
|
2149
|
+
], CollectionBrowser.prototype, "baseNavigationUrl", void 0);
|
|
2150
|
+
__decorate([
|
|
2151
|
+
property({ type: String })
|
|
2152
|
+
], CollectionBrowser.prototype, "baseImageUrl", void 0);
|
|
2153
|
+
__decorate([
|
|
2154
|
+
property({ type: Object })
|
|
2155
|
+
], CollectionBrowser.prototype, "searchService", void 0);
|
|
2156
|
+
__decorate([
|
|
2157
|
+
property({ type: Number })
|
|
2158
|
+
], CollectionBrowser.prototype, "searchType", void 0);
|
|
2159
|
+
__decorate([
|
|
2160
|
+
property({ type: String })
|
|
2161
|
+
], CollectionBrowser.prototype, "withinCollection", void 0);
|
|
2162
|
+
__decorate([
|
|
2163
|
+
property({ type: String })
|
|
2164
|
+
], CollectionBrowser.prototype, "withinProfile", void 0);
|
|
2165
|
+
__decorate([
|
|
2166
|
+
property({ type: String })
|
|
2167
|
+
], CollectionBrowser.prototype, "profileElement", void 0);
|
|
2168
|
+
__decorate([
|
|
2169
|
+
property({ type: String })
|
|
2170
|
+
], CollectionBrowser.prototype, "baseQuery", void 0);
|
|
2171
|
+
__decorate([
|
|
2172
|
+
property({ type: String })
|
|
2173
|
+
], CollectionBrowser.prototype, "displayMode", void 0);
|
|
2174
|
+
__decorate([
|
|
2175
|
+
property({ type: String })
|
|
2176
|
+
], CollectionBrowser.prototype, "selectedSort", void 0);
|
|
2177
|
+
__decorate([
|
|
2178
|
+
property({ type: String })
|
|
2179
|
+
], CollectionBrowser.prototype, "selectedTitleFilter", void 0);
|
|
2180
|
+
__decorate([
|
|
2181
|
+
property({ type: String })
|
|
2182
|
+
], CollectionBrowser.prototype, "selectedCreatorFilter", void 0);
|
|
2183
|
+
__decorate([
|
|
2184
|
+
property({ type: String })
|
|
2185
|
+
], CollectionBrowser.prototype, "sortDirection", void 0);
|
|
2186
|
+
__decorate([
|
|
2187
|
+
property({ type: String })
|
|
2188
|
+
], CollectionBrowser.prototype, "defaultSortField", void 0);
|
|
2189
|
+
__decorate([
|
|
2190
|
+
property({ type: String })
|
|
2191
|
+
], CollectionBrowser.prototype, "defaultSortDirection", void 0);
|
|
2192
|
+
__decorate([
|
|
2193
|
+
property({ type: Number })
|
|
2194
|
+
], CollectionBrowser.prototype, "pageSize", void 0);
|
|
2195
|
+
__decorate([
|
|
2196
|
+
property({ type: Number })
|
|
2197
|
+
], CollectionBrowser.prototype, "currentPage", void 0);
|
|
2198
|
+
__decorate([
|
|
2199
|
+
property({ type: String })
|
|
2200
|
+
], CollectionBrowser.prototype, "minSelectedDate", void 0);
|
|
2201
|
+
__decorate([
|
|
2202
|
+
property({ type: String })
|
|
2203
|
+
], CollectionBrowser.prototype, "maxSelectedDate", void 0);
|
|
2204
|
+
__decorate([
|
|
2205
|
+
property({ type: Object })
|
|
2206
|
+
], CollectionBrowser.prototype, "selectedFacets", void 0);
|
|
2207
|
+
__decorate([
|
|
2208
|
+
property({ type: Boolean })
|
|
2209
|
+
], CollectionBrowser.prototype, "showSmartFacetBar", void 0);
|
|
2210
|
+
__decorate([
|
|
2211
|
+
property({ type: Boolean })
|
|
2212
|
+
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0);
|
|
2213
|
+
__decorate([
|
|
2214
|
+
property({ type: Boolean })
|
|
2215
|
+
], CollectionBrowser.prototype, "suppressPlaceholders", void 0);
|
|
2216
|
+
__decorate([
|
|
2217
|
+
property({ type: Boolean })
|
|
2218
|
+
], CollectionBrowser.prototype, "suppressResultCount", void 0);
|
|
2219
|
+
__decorate([
|
|
2220
|
+
property({ type: Boolean })
|
|
2221
|
+
], CollectionBrowser.prototype, "suppressResultTiles", void 0);
|
|
2222
|
+
__decorate([
|
|
2223
|
+
property({ type: Boolean })
|
|
2224
|
+
], CollectionBrowser.prototype, "suppressURLQuery", void 0);
|
|
2225
|
+
__decorate([
|
|
2226
|
+
property({ type: Boolean })
|
|
2227
|
+
], CollectionBrowser.prototype, "suppressSortBar", void 0);
|
|
2228
|
+
__decorate([
|
|
2229
|
+
property({ type: Boolean })
|
|
2230
|
+
], CollectionBrowser.prototype, "suppressDisplayModes", void 0);
|
|
2231
|
+
__decorate([
|
|
2232
|
+
property({ type: String })
|
|
2233
|
+
], CollectionBrowser.prototype, "facetLoadStrategy", void 0);
|
|
2234
|
+
__decorate([
|
|
2235
|
+
property({ type: Boolean })
|
|
2236
|
+
], CollectionBrowser.prototype, "facetPaneVisible", void 0);
|
|
2237
|
+
__decorate([
|
|
2238
|
+
property({ type: Boolean })
|
|
2239
|
+
], CollectionBrowser.prototype, "clearResultsOnEmptyQuery", void 0);
|
|
2240
|
+
__decorate([
|
|
2241
|
+
property({ type: String })
|
|
2242
|
+
], CollectionBrowser.prototype, "collectionPagePath", void 0);
|
|
2243
|
+
__decorate([
|
|
2244
|
+
property({ type: String, reflect: true })
|
|
2245
|
+
], CollectionBrowser.prototype, "searchContext", void 0);
|
|
2246
|
+
__decorate([
|
|
2247
|
+
property({ type: String })
|
|
2248
|
+
], CollectionBrowser.prototype, "pageContext", void 0);
|
|
2249
|
+
__decorate([
|
|
2250
|
+
property({ type: Object })
|
|
2251
|
+
], CollectionBrowser.prototype, "restorationStateHandler", void 0);
|
|
2252
|
+
__decorate([
|
|
2253
|
+
property({ type: Number })
|
|
2254
|
+
], CollectionBrowser.prototype, "mobileBreakpoint", void 0);
|
|
2255
|
+
__decorate([
|
|
2256
|
+
property({ type: Boolean })
|
|
2257
|
+
], CollectionBrowser.prototype, "loggedIn", void 0);
|
|
2258
|
+
__decorate([
|
|
2259
|
+
property({ type: Object })
|
|
2260
|
+
], CollectionBrowser.prototype, "resizeObserver", void 0);
|
|
2261
|
+
__decorate([
|
|
2262
|
+
property({ type: Object })
|
|
2263
|
+
], CollectionBrowser.prototype, "modalManager", void 0);
|
|
2264
|
+
__decorate([
|
|
2265
|
+
property({ type: Object })
|
|
2266
|
+
], CollectionBrowser.prototype, "featureFeedbackService", void 0);
|
|
2267
|
+
__decorate([
|
|
2268
|
+
property({ type: Object })
|
|
2269
|
+
], CollectionBrowser.prototype, "recaptchaManager", void 0);
|
|
2270
|
+
__decorate([
|
|
2271
|
+
property({ type: Boolean })
|
|
2272
|
+
], CollectionBrowser.prototype, "isManageView", void 0);
|
|
2273
|
+
__decorate([
|
|
2274
|
+
property({ type: String })
|
|
2275
|
+
], CollectionBrowser.prototype, "manageViewLabel", void 0);
|
|
2276
|
+
__decorate([
|
|
2277
|
+
property({ type: Boolean })
|
|
2278
|
+
], CollectionBrowser.prototype, "enableSortOptionsSlot", void 0);
|
|
2279
|
+
__decorate([
|
|
2280
|
+
property({ type: Boolean, reflect: true })
|
|
2281
|
+
], CollectionBrowser.prototype, "showSmartResults", void 0);
|
|
2282
|
+
__decorate([
|
|
2283
|
+
property({ type: Number })
|
|
2284
|
+
], CollectionBrowser.prototype, "maxPagesToManage", void 0);
|
|
2285
|
+
__decorate([
|
|
2286
|
+
property({ type: Object })
|
|
2287
|
+
], CollectionBrowser.prototype, "dataSource", void 0);
|
|
2288
|
+
__decorate([
|
|
2289
|
+
state()
|
|
2290
|
+
], CollectionBrowser.prototype, "pagesToRender", void 0);
|
|
2291
|
+
__decorate([
|
|
2292
|
+
state()
|
|
2293
|
+
], CollectionBrowser.prototype, "searchResultsLoading", void 0);
|
|
2294
|
+
__decorate([
|
|
2295
|
+
state()
|
|
2296
|
+
], CollectionBrowser.prototype, "facetsLoading", void 0);
|
|
2297
|
+
__decorate([
|
|
2298
|
+
state()
|
|
2299
|
+
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
2300
|
+
__decorate([
|
|
2301
|
+
state()
|
|
2302
|
+
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
2303
|
+
__decorate([
|
|
2304
|
+
state()
|
|
2305
|
+
], CollectionBrowser.prototype, "collapsibleFacetsVisible", void 0);
|
|
2306
|
+
__decorate([
|
|
2307
|
+
state()
|
|
2308
|
+
], CollectionBrowser.prototype, "contentWidth", void 0);
|
|
2309
|
+
__decorate([
|
|
2310
|
+
state()
|
|
2311
|
+
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
2312
|
+
__decorate([
|
|
2313
|
+
query('#content-container')
|
|
2314
|
+
], CollectionBrowser.prototype, "contentContainer", void 0);
|
|
2315
|
+
__decorate([
|
|
2316
|
+
query('#left-column')
|
|
2317
|
+
], CollectionBrowser.prototype, "leftColumn", void 0);
|
|
2318
|
+
__decorate([
|
|
2319
|
+
query('collection-facets')
|
|
2320
|
+
], CollectionBrowser.prototype, "collectionFacets", void 0);
|
|
2321
|
+
__decorate([
|
|
2322
|
+
query('manage-bar')
|
|
2323
|
+
], CollectionBrowser.prototype, "manageBar", void 0);
|
|
2324
|
+
__decorate([
|
|
2325
|
+
property({ type: Object, attribute: false })
|
|
2326
|
+
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|
|
2327
|
+
__decorate([
|
|
2328
|
+
query('infinite-scroller')
|
|
2329
|
+
], CollectionBrowser.prototype, "infiniteScroller", void 0);
|
|
2330
|
+
CollectionBrowser = __decorate([
|
|
2331
|
+
customElement('collection-browser')
|
|
2332
|
+
], CollectionBrowser);
|
|
2333
|
+
export { CollectionBrowser };
|
|
2327
2334
|
//# sourceMappingURL=collection-browser.js.map
|