@internetarchive/collection-browser 1.14.17-beta.5 → 1.14.18-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +29 -29
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +12 -11
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +83 -83
- package/dist/src/app-root.js +438 -489
- 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/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/collection-browser.d.ts +384 -406
- package/dist/src/collection-browser.js +1342 -1363
- 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 +114 -114
- 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/facets-template.d.ts +17 -17
- package/dist/src/collection-facets/facets-template.js +114 -114
- package/dist/src/collection-facets/more-facets-content.d.ts +70 -70
- package/dist/src/collection-facets/more-facets-content.js +354 -369
- 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 +196 -196
- 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.d.ts +103 -103
- package/dist/src/collection-facets.js +513 -510
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +217 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js +2 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source.d.ts +352 -434
- package/dist/src/data-source/collection-browser-data-source.js +911 -800
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +43 -0
- package/dist/src/data-source/collection-browser-query-state.js +2 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -0
- package/dist/src/data-source/models.d.ts +28 -62
- package/dist/src/data-source/models.js +8 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +74 -74
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- 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-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/manage/manage-bar.d.ts +26 -26
- package/dist/src/manage/manage-bar.js +53 -53
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +91 -91
- package/dist/src/models.d.ts +197 -180
- package/dist/src/models.js +380 -269
- 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 +355 -355
- 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.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +128 -128
- 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 +210 -210
- package/dist/src/sort-filter-bar/sort-filter-bar.js +653 -652
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- 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 +63 -63
- 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/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- 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/item-tile.d.ts +28 -27
- package/dist/src/tiles/grid/item-tile.js +162 -135
- 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/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 +58 -53
- 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/tile-hover-pane.d.ts +15 -15
- package/dist/src/tiles/hover/tile-hover-pane.js +38 -38
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +73 -73
- package/dist/src/tiles/item-image.d.ts +39 -36
- package/dist/src/tiles/item-image.js +155 -127
- 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.d.ts +15 -15
- package/dist/src/tiles/list/tile-list-compact.js +115 -115
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +47 -46
- package/dist/src/tiles/list/tile-list.js +327 -296
- 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/overlay/icon-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/icon-overlay.js +40 -40
- package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
- package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/text-overlay.js +42 -42
- 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/tile-dispatcher.d.ts +64 -64
- package/dist/src/tiles/tile-dispatcher.js +232 -231
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +47 -43
- package/dist/src/tiles/tile-display-value-provider.js +94 -80
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/analytics-events.d.ts +25 -25
- package/dist/src/utils/analytics-events.js +27 -27
- 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 -0
- package/dist/src/utils/collapse-repeated-quotes.js +14 -0
- package/dist/src/utils/collapse-repeated-quotes.js.map +1 -0
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +25 -25
- 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/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 -0
- package/dist/src/utils/log.js +16 -0
- package/dist/src/utils/log.js.map +1 -0
- package/dist/src/utils/resolve-mediatype.d.ts +8 -0
- package/dist/src/utils/resolve-mediatype.js +24 -0
- package/dist/src/utils/resolve-mediatype.js.map +1 -0
- 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 +1211 -1149
- 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 +203 -203
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +105 -105
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +133 -133
- 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 +117 -117
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +73 -73
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +653 -648
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -0
- package/dist/test/data-source/collection-browser-data-source.test.js +80 -0
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -0
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +63 -63
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +95 -95
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +85 -86
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/manage/manage-bar.test.d.ts +1 -1
- package/dist/test/manage/manage-bar.test.js +72 -72
- 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 +24 -21
- package/dist/test/mocks/mock-search-responses.js +840 -709
- 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 +53 -50
- 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/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.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- 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 +418 -418
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +48 -48
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +95 -33
- 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 +76 -76
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +73 -73
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +298 -254
- 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 +51 -51
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +259 -258
- 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 +13 -13
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +143 -143
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +283 -239
- 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 +106 -94
- 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-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- 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/index.ts +3 -5
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +3 -4
- package/renovate.json +6 -6
- package/src/app-root.ts +30 -85
- package/src/collection-browser.ts +112 -139
- package/src/collection-facets/more-facets-content.ts +0 -19
- package/src/collection-facets.ts +6 -4
- package/src/data-source/collection-browser-data-source-interface.ts +272 -0
- package/src/data-source/collection-browser-data-source.ts +314 -379
- package/src/data-source/collection-browser-query-state.ts +54 -0
- package/src/data-source/models.ts +8 -45
- package/src/manage/manage-bar.ts +1 -1
- package/src/models.ts +164 -3
- package/src/sort-filter-bar/sort-filter-bar.ts +2 -1
- package/src/tiles/grid/item-tile.ts +36 -1
- package/src/tiles/grid/tile-stats.ts +12 -7
- package/src/tiles/item-image.ts +28 -0
- package/src/tiles/list/tile-list-compact.ts +1 -1
- package/src/tiles/list/tile-list.ts +43 -5
- package/src/tiles/tile-dispatcher.ts +2 -1
- package/src/tiles/tile-display-value-provider.ts +20 -2
- package/src/utils/collapse-repeated-quotes.ts +13 -0
- package/src/utils/log.ts +16 -0
- package/src/utils/resolve-mediatype.ts +26 -0
- package/test/collection-browser.test.ts +161 -50
- package/test/collection-facets/more-facets-content.test.ts +4 -2
- package/test/collection-facets.test.ts +5 -0
- package/test/data-source/collection-browser-data-source.test.ts +103 -0
- package/test/item-image.test.ts +34 -36
- package/test/mocks/mock-search-responses.ts +144 -0
- package/test/mocks/mock-search-service.ts +6 -0
- package/test/tile-stats.test.ts +104 -0
- package/test/tiles/grid/item-tile.test.ts +55 -0
- package/test/tiles/hover/hover-pane-controller.test.ts +19 -17
- package/test/tiles/list/tile-list.test.ts +55 -0
- package/test/tiles/tile-dispatcher.test.ts +13 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
- package/types/sentry.d.ts +0 -1
|
@@ -1,357 +1,342 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/* eslint-disable import/no-duplicates */
|
|
3
|
-
import { html, css, LitElement, nothing, } from 'lit';
|
|
4
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
5
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
-
import { msg } from '@lit/localize';
|
|
7
|
-
import { SearchType, } from '@internetarchive/search-service';
|
|
8
|
-
import '@internetarchive/infinite-scroller';
|
|
9
|
-
import './
|
|
10
|
-
import './
|
|
11
|
-
import './
|
|
12
|
-
import './
|
|
13
|
-
import './
|
|
14
|
-
import './
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import './
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
this
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.
|
|
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
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
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
|
-
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Returns true if there are any currently selected/negated facet buckets,
|
|
270
|
-
* any selected date range, or any selected letter filters. False otherwise.
|
|
271
|
-
*
|
|
272
|
-
* Ignores sorting options.
|
|
273
|
-
*/
|
|
274
|
-
get hasActiveFilters() {
|
|
275
|
-
return !!(this.hasCheckedFacets ||
|
|
276
|
-
this.minSelectedDate ||
|
|
277
|
-
this.maxSelectedDate ||
|
|
278
|
-
this.selectedTitleFilter ||
|
|
279
|
-
this.selectedCreatorFilter);
|
|
280
|
-
}
|
|
281
|
-
render() {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable import/no-duplicates */
|
|
3
|
+
import { html, css, LitElement, nothing, } from 'lit';
|
|
4
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import { msg } from '@lit/localize';
|
|
7
|
+
import { SearchType, } from '@internetarchive/search-service';
|
|
8
|
+
import '@internetarchive/infinite-scroller';
|
|
9
|
+
import { SortField, getDefaultSelectedFacets, sortOptionFromAPIString, SORT_OPTIONS, defaultProfileElementSorts, } from './models';
|
|
10
|
+
import { RestorationStateHandler, } from './restoration-state-handler';
|
|
11
|
+
import { CollectionBrowserDataSource } from './data-source/collection-browser-data-source';
|
|
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 { formatDate } from './utils/format-date';
|
|
17
|
+
import { log } from './utils/log';
|
|
18
|
+
import './empty-placeholder';
|
|
19
|
+
import './tiles/tile-dispatcher';
|
|
20
|
+
import './tiles/collection-browser-loading-tile';
|
|
21
|
+
import './sort-filter-bar/sort-filter-bar';
|
|
22
|
+
import './manage/manage-bar';
|
|
23
|
+
import './collection-facets';
|
|
24
|
+
import './circular-activity-indicator';
|
|
25
|
+
let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.baseImageUrl = 'https://archive.org';
|
|
29
|
+
this.searchType = SearchType.METADATA;
|
|
30
|
+
this.defaultSortParam = null;
|
|
31
|
+
this.selectedSort = SortField.default;
|
|
32
|
+
this.selectedTitleFilter = null;
|
|
33
|
+
this.selectedCreatorFilter = null;
|
|
34
|
+
this.sortDirection = null;
|
|
35
|
+
this.pageSize = 50;
|
|
36
|
+
this.showHistogramDatePicker = false;
|
|
37
|
+
this.suppressPlaceholders = false;
|
|
38
|
+
this.suppressResultCount = false;
|
|
39
|
+
this.suppressURLQuery = false;
|
|
40
|
+
this.suppressFacets = false;
|
|
41
|
+
this.suppressSortBar = false;
|
|
42
|
+
this.clearResultsOnEmptyQuery = false;
|
|
43
|
+
this.collectionPagePath = '/details/';
|
|
44
|
+
/** describes where this component is being used */
|
|
45
|
+
this.searchContext = analyticsCategories.default;
|
|
46
|
+
this.pageContext = 'search';
|
|
47
|
+
this.restorationStateHandler = new RestorationStateHandler({
|
|
48
|
+
context: this.pageContext,
|
|
49
|
+
});
|
|
50
|
+
this.mobileBreakpoint = 600;
|
|
51
|
+
this.loggedIn = false;
|
|
52
|
+
this.modalManager = undefined;
|
|
53
|
+
/**
|
|
54
|
+
* If item management UI active
|
|
55
|
+
*/
|
|
56
|
+
this.isManageView = false;
|
|
57
|
+
this.isLoansTab = false;
|
|
58
|
+
/**
|
|
59
|
+
* The results per page so we can paginate.
|
|
60
|
+
*
|
|
61
|
+
* This allows us to start in the middle of the search results and
|
|
62
|
+
* fetch data before or after the current page. If we don't have a key
|
|
63
|
+
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
64
|
+
*/
|
|
65
|
+
this.dataSource = new CollectionBrowserDataSource(this, this.pageSize);
|
|
66
|
+
/**
|
|
67
|
+
* The page that the consumer wants to load.
|
|
68
|
+
*/
|
|
69
|
+
this.initialPageNumber = 1;
|
|
70
|
+
/**
|
|
71
|
+
* This the the number of pages that we want to show.
|
|
72
|
+
*
|
|
73
|
+
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
74
|
+
* know how many cells we should render.
|
|
75
|
+
*/
|
|
76
|
+
this.pagesToRender = this.initialPageNumber;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the initial page fetch for a new query is currently in progress.
|
|
79
|
+
*/
|
|
80
|
+
this.searchResultsLoading = false;
|
|
81
|
+
this.facetsLoading = false;
|
|
82
|
+
this.mobileView = false;
|
|
83
|
+
this.mobileFacetsVisible = false;
|
|
84
|
+
this.defaultSortField = SortField.relevance;
|
|
85
|
+
this.defaultSortDirection = null;
|
|
86
|
+
this.placeholderType = null;
|
|
87
|
+
/**
|
|
88
|
+
* When we're animated scrolling to the page, we don't want to fetch
|
|
89
|
+
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
90
|
+
*/
|
|
91
|
+
this.isScrollingToCell = false;
|
|
92
|
+
/**
|
|
93
|
+
* When page width resizes from desktop to mobile, set true to
|
|
94
|
+
* disable expand/collapse transition when loading.
|
|
95
|
+
*/
|
|
96
|
+
this.isResizeToMobile = false;
|
|
97
|
+
this.placeholderCellTemplate = html `<collection-browser-loading-tile></collection-browser-loading-tile>`;
|
|
98
|
+
/**
|
|
99
|
+
* How many tiles to offset the data source by, to account for any removed tiles.
|
|
100
|
+
*/
|
|
101
|
+
this.tileModelOffset = 0;
|
|
102
|
+
/**
|
|
103
|
+
* Updates the height of the left column according to its position on the page.
|
|
104
|
+
* Arrow function ensures proper `this` binding.
|
|
105
|
+
*/
|
|
106
|
+
this.updateLeftColumnHeight = () => {
|
|
107
|
+
var _a, _b, _c, _d, _e;
|
|
108
|
+
if (this.mobileView) {
|
|
109
|
+
(_b = (_a = this.leftColumn) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.removeProperty('height');
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const clientTop = (_c = this.leftColumn) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().top;
|
|
113
|
+
(_e = (_d = this.leftColumn) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.setProperty('height', `${window.innerHeight - (clientTop !== null && clientTop !== void 0 ? clientTop : 0) - 3}px`);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Toggles whether the fade-out is visible at the bottom of the facets.
|
|
118
|
+
* It should only be visible if the facets are not scrolled to the bottom.
|
|
119
|
+
* Arrow function ensures proper `this` binding.
|
|
120
|
+
*/
|
|
121
|
+
this.updateFacetFadeOut = (entries) => {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
const fadeElmt = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('facets-bottom-fade');
|
|
124
|
+
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);
|
|
125
|
+
};
|
|
126
|
+
// we only want to scroll on the very first query change
|
|
127
|
+
// so this keeps track of whether we've already set the initial query
|
|
128
|
+
this.initialQueryChangeHappened = false;
|
|
129
|
+
this.historyPopOccurred = false;
|
|
130
|
+
this.addController(this.dataSource);
|
|
131
|
+
}
|
|
132
|
+
tileModelAtCellIndex(index) {
|
|
133
|
+
const model = this.dataSource.getTileModelAt(index);
|
|
134
|
+
/**
|
|
135
|
+
* If we encounter a model we don't have yet and we're not in the middle of an
|
|
136
|
+
* automated scroll, fetch the page and just return undefined.
|
|
137
|
+
* The datasource will be updated once the page is loaded and the cell will be rendered.
|
|
138
|
+
*
|
|
139
|
+
* We disable it during the automated scroll since we don't want to fetch pages for intervening cells the
|
|
140
|
+
* user may never see.
|
|
141
|
+
*/
|
|
142
|
+
if (!model && !this.isScrollingToCell && this.dataSource.queryInitialized) {
|
|
143
|
+
const pageNumber = Math.floor(index / this.pageSize) + 1;
|
|
144
|
+
this.dataSource.fetchPage(pageNumber);
|
|
145
|
+
}
|
|
146
|
+
return model;
|
|
147
|
+
}
|
|
148
|
+
// this is the total number of tiles we expect if
|
|
149
|
+
// the data returned is a full page worth
|
|
150
|
+
// this is useful for putting in placeholders for the expected number of tiles
|
|
151
|
+
get estimatedTileCount() {
|
|
152
|
+
return this.pagesToRender * this.pageSize;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Returns a promise resolving to a unique string that persists for the current browser session.
|
|
156
|
+
* Used in generating unique IDs for search requests, so that multiple requests coming from the
|
|
157
|
+
* same browser session can be identified.
|
|
158
|
+
*/
|
|
159
|
+
async getSessionId() {
|
|
160
|
+
try {
|
|
161
|
+
const storedSessionId = sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage.getItem('cb-session');
|
|
162
|
+
if (storedSessionId) {
|
|
163
|
+
return storedSessionId;
|
|
164
|
+
}
|
|
165
|
+
// If we enter this method a second time while a first session ID is already being generated,
|
|
166
|
+
// ensure we produce the same ID from both calls instead of generating another one.
|
|
167
|
+
if (this.sessionIdGenPromise) {
|
|
168
|
+
return this.sessionIdGenPromise;
|
|
169
|
+
}
|
|
170
|
+
this.sessionIdGenPromise = sha1(Math.random().toString());
|
|
171
|
+
const newSessionId = await this.sessionIdGenPromise;
|
|
172
|
+
sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage.setItem('cb-session', newSessionId);
|
|
173
|
+
return newSessionId;
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
// Either we can't generate the hash or we're restricted from accessing sessionStorage
|
|
177
|
+
return '';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Go to the given page of results
|
|
182
|
+
*
|
|
183
|
+
* @param pageNumber
|
|
184
|
+
*/
|
|
185
|
+
goToPage(pageNumber) {
|
|
186
|
+
this.initialPageNumber = pageNumber;
|
|
187
|
+
this.pagesToRender = pageNumber;
|
|
188
|
+
return this.scrollToPage(pageNumber);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Sets the state for whether the initial set of search results is loading in.
|
|
192
|
+
*/
|
|
193
|
+
setSearchResultsLoading(loading) {
|
|
194
|
+
this.searchResultsLoading = loading;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Sets the state for whether facet data is loading in
|
|
198
|
+
*/
|
|
199
|
+
setFacetsLoading(loading) {
|
|
200
|
+
this.facetsLoading = loading;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Sets the total number of results to be displayed for the current search
|
|
204
|
+
*/
|
|
205
|
+
setTotalResultCount(totalResults) {
|
|
206
|
+
this.totalResults = totalResults;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Clears all selected/negated facets, date ranges, and letter filters.
|
|
210
|
+
*
|
|
211
|
+
* By default, the current sort field/direction are not cleared,
|
|
212
|
+
* but this can be overridden by setting the `sort` option to `true`.
|
|
213
|
+
*
|
|
214
|
+
* Similarly, it is possible to finely control what is cleared by
|
|
215
|
+
* setting any of the `facets`, `dateRange`, or `letterFilters` flags
|
|
216
|
+
* in the options object.
|
|
217
|
+
*/
|
|
218
|
+
clearFilters({ facets = true, dateRange = true, letterFilters = true, sort = false, } = {}) {
|
|
219
|
+
// Don't bother clearing facets if none are checked, so that we don't
|
|
220
|
+
// trigger unnecessary update cycles.
|
|
221
|
+
if (facets && this.hasCheckedFacets) {
|
|
222
|
+
this.selectedFacets = getDefaultSelectedFacets();
|
|
223
|
+
}
|
|
224
|
+
if (dateRange) {
|
|
225
|
+
this.minSelectedDate = undefined;
|
|
226
|
+
this.maxSelectedDate = undefined;
|
|
227
|
+
}
|
|
228
|
+
if (letterFilters) {
|
|
229
|
+
this.selectedTitleFilter = null;
|
|
230
|
+
this.selectedCreatorFilter = null;
|
|
231
|
+
}
|
|
232
|
+
if (sort) {
|
|
233
|
+
this.sortDirection = null;
|
|
234
|
+
this.selectedSort = SortField.default;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Returns true if the current value of `this.selectedFacets` contains
|
|
239
|
+
* any facet buckets than have been selected or negated, or false otherwise.
|
|
240
|
+
*/
|
|
241
|
+
get hasCheckedFacets() {
|
|
242
|
+
if (!this.selectedFacets)
|
|
243
|
+
return false;
|
|
244
|
+
for (const facetGroup of Object.values(this.selectedFacets)) {
|
|
245
|
+
for (const bucket of Object.values(facetGroup)) {
|
|
246
|
+
if (bucket.state !== 'none')
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Returns true if there are any currently selected/negated facet buckets,
|
|
254
|
+
* any selected date range, or any selected letter filters. False otherwise.
|
|
255
|
+
*
|
|
256
|
+
* Ignores sorting options.
|
|
257
|
+
*/
|
|
258
|
+
get hasActiveFilters() {
|
|
259
|
+
return !!(this.hasCheckedFacets ||
|
|
260
|
+
this.minSelectedDate ||
|
|
261
|
+
this.maxSelectedDate ||
|
|
262
|
+
this.selectedTitleFilter ||
|
|
263
|
+
this.selectedCreatorFilter);
|
|
264
|
+
}
|
|
265
|
+
render() {
|
|
266
|
+
this.setPlaceholderType();
|
|
282
267
|
return html `
|
|
283
268
|
<div
|
|
284
269
|
id="content-container"
|
|
285
270
|
class=${this.mobileView ? 'mobile' : 'desktop'}
|
|
286
271
|
>
|
|
287
|
-
${this.placeholderType
|
|
288
|
-
? this.emptyPlaceholderTemplate
|
|
272
|
+
${this.placeholderType
|
|
273
|
+
? this.emptyPlaceholderTemplate
|
|
289
274
|
: this.collectionBrowserTemplate}
|
|
290
275
|
</div>
|
|
291
|
-
`;
|
|
292
|
-
}
|
|
293
|
-
setPlaceholderType() {
|
|
294
|
-
var _a;
|
|
295
|
-
const hasQuery = !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
296
|
-
const isCollection = !!this.withinCollection;
|
|
297
|
-
const isProfile = !!this.withinProfile;
|
|
298
|
-
const noResults = !this.searchResultsLoading &&
|
|
299
|
-
(this.dataSource.size === 0 || !this.searchService);
|
|
300
|
-
this.placeholderType = null;
|
|
301
|
-
if (this.suppressPlaceholders)
|
|
302
|
-
return;
|
|
303
|
-
if (!hasQuery && !isCollection && !isProfile) {
|
|
304
|
-
this.placeholderType = 'empty-query';
|
|
305
|
-
}
|
|
306
|
-
else if (noResults) {
|
|
307
|
-
// Within a collection, no query + no results means the collection simply has no viewable items.
|
|
308
|
-
// Otherwise, we must have a user query that produced 0 results.
|
|
309
|
-
this.placeholderType =
|
|
310
|
-
!hasQuery && isCollection ? 'empty-collection' : 'no-results';
|
|
311
|
-
}
|
|
312
|
-
if (this.queryErrorMessage) {
|
|
313
|
-
this.placeholderType =
|
|
314
|
-
!hasQuery && isCollection ? 'collection-error' : 'query-error';
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
get emptyPlaceholderTemplate() {
|
|
318
|
-
var _a;
|
|
276
|
+
`;
|
|
277
|
+
}
|
|
278
|
+
setPlaceholderType() {
|
|
279
|
+
var _a;
|
|
280
|
+
const hasQuery = !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
281
|
+
const isCollection = !!this.withinCollection;
|
|
282
|
+
const isProfile = !!this.withinProfile;
|
|
283
|
+
const noResults = !this.searchResultsLoading &&
|
|
284
|
+
(this.dataSource.size === 0 || !this.searchService);
|
|
285
|
+
this.placeholderType = null;
|
|
286
|
+
if (this.suppressPlaceholders)
|
|
287
|
+
return;
|
|
288
|
+
if (!hasQuery && !isCollection && !isProfile) {
|
|
289
|
+
this.placeholderType = 'empty-query';
|
|
290
|
+
}
|
|
291
|
+
else if (noResults) {
|
|
292
|
+
// Within a collection, no query + no results means the collection simply has no viewable items.
|
|
293
|
+
// Otherwise, we must have a user query that produced 0 results.
|
|
294
|
+
this.placeholderType =
|
|
295
|
+
!hasQuery && isCollection ? 'empty-collection' : 'no-results';
|
|
296
|
+
}
|
|
297
|
+
if (this.dataSource.queryErrorMessage) {
|
|
298
|
+
this.placeholderType =
|
|
299
|
+
!hasQuery && isCollection ? 'collection-error' : 'query-error';
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
get emptyPlaceholderTemplate() {
|
|
303
|
+
var _a;
|
|
319
304
|
return html `
|
|
320
305
|
<empty-placeholder
|
|
321
306
|
.placeholderType=${this.placeholderType}
|
|
322
307
|
?isMobileView=${this.mobileView}
|
|
323
308
|
?isCollection=${!!this.withinCollection}
|
|
324
|
-
.detailMessage=${(_a = this.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
|
|
309
|
+
.detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
|
|
325
310
|
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
326
311
|
></empty-placeholder>
|
|
327
312
|
${this.infiniteScrollerTemplate}
|
|
328
|
-
`;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
332
|
-
*/
|
|
333
|
-
get collectionBrowserTemplate() {
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
317
|
+
*/
|
|
318
|
+
get collectionBrowserTemplate() {
|
|
334
319
|
return html `
|
|
335
320
|
<div id="left-column-scroll-sentinel"></div>
|
|
336
321
|
${this.leftColumnTemplate} ${this.rightColumnTemplate}
|
|
337
|
-
`;
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Template for either the mobile or desktop version of the left column, depending
|
|
341
|
-
* on current component state.
|
|
342
|
-
*/
|
|
343
|
-
get leftColumnTemplate() {
|
|
344
|
-
if (this.mobileView) {
|
|
345
|
-
return this.mobileLeftColumnTemplate;
|
|
346
|
-
}
|
|
347
|
-
return this.desktopLeftColumnTemplate;
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Template for the mobile version of the "left column" (which in this case, appears
|
|
351
|
-
* *above* the search results rather than beside them), for rendering the
|
|
352
|
-
* accordion-style facets.
|
|
353
|
-
*/
|
|
354
|
-
get mobileLeftColumnTemplate() {
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Template for either the mobile or desktop version of the left column, depending
|
|
326
|
+
* on current component state.
|
|
327
|
+
*/
|
|
328
|
+
get leftColumnTemplate() {
|
|
329
|
+
if (this.mobileView) {
|
|
330
|
+
return this.mobileLeftColumnTemplate;
|
|
331
|
+
}
|
|
332
|
+
return this.desktopLeftColumnTemplate;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Template for the mobile version of the "left column" (which in this case, appears
|
|
336
|
+
* *above* the search results rather than beside them), for rendering the
|
|
337
|
+
* accordion-style facets.
|
|
338
|
+
*/
|
|
339
|
+
get mobileLeftColumnTemplate() {
|
|
355
340
|
return html `
|
|
356
341
|
<div
|
|
357
342
|
id="left-column"
|
|
@@ -360,12 +345,12 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
360
345
|
${this.facetTopViewSlot} ${this.resultsCountTemplate}
|
|
361
346
|
<div id="facets-header-container">${this.mobileFacetsTemplate}</div>
|
|
362
347
|
</div>
|
|
363
|
-
`;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
367
|
-
*/
|
|
368
|
-
get desktopLeftColumnTemplate() {
|
|
348
|
+
`;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
352
|
+
*/
|
|
353
|
+
get desktopLeftColumnTemplate() {
|
|
369
354
|
return html `
|
|
370
355
|
<div id="left-column" class="column">
|
|
371
356
|
${this.facetTopViewSlot}
|
|
@@ -379,28 +364,28 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
379
364
|
</div>
|
|
380
365
|
<div id="facets-bottom-fade"></div>
|
|
381
366
|
</div>
|
|
382
|
-
`;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Slot which is placed at top of the facets area for user-profile page
|
|
386
|
-
* - mainly used to render userlists
|
|
387
|
-
*/
|
|
388
|
-
get facetTopViewSlot() {
|
|
367
|
+
`;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Slot which is placed at top of the facets area for user-profile page
|
|
371
|
+
* - mainly used to render userlists
|
|
372
|
+
*/
|
|
373
|
+
get facetTopViewSlot() {
|
|
389
374
|
return html `<div id="facet-top-view">
|
|
390
375
|
<slot name="facet-top-slot"></slot>
|
|
391
|
-
</div>`;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Template for the "X Results" count at the top of the search results.
|
|
395
|
-
* Changes to the "Searching..." label if the search results are still loading.
|
|
396
|
-
*/
|
|
397
|
-
get resultsCountTemplate() {
|
|
398
|
-
var _a;
|
|
399
|
-
if (this.suppressResultCount)
|
|
400
|
-
return nothing;
|
|
401
|
-
const shouldShowSearching = this.searchResultsLoading || this.totalResults === undefined;
|
|
402
|
-
const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
|
|
403
|
-
const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
|
|
376
|
+
</div>`;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Template for the "X Results" count at the top of the search results.
|
|
380
|
+
* Changes to the "Searching..." label if the search results are still loading.
|
|
381
|
+
*/
|
|
382
|
+
get resultsCountTemplate() {
|
|
383
|
+
var _a;
|
|
384
|
+
if (this.suppressResultCount)
|
|
385
|
+
return nothing;
|
|
386
|
+
const shouldShowSearching = this.searchResultsLoading || this.totalResults === undefined;
|
|
387
|
+
const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
|
|
388
|
+
const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
|
|
404
389
|
return html `
|
|
405
390
|
<div id="results-total">
|
|
406
391
|
<span id="big-results-count">
|
|
@@ -410,31 +395,30 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
410
395
|
${shouldShowSearching ? nothing : resultsLabel}
|
|
411
396
|
</span>
|
|
412
397
|
</div>
|
|
413
|
-
`;
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Template for the right column of the collection browser, where the result
|
|
417
|
-
* tiles and sort/filter bar are shown.
|
|
418
|
-
*/
|
|
419
|
-
get rightColumnTemplate() {
|
|
398
|
+
`;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Template for the right column of the collection browser, where the result
|
|
402
|
+
* tiles and sort/filter bar are shown.
|
|
403
|
+
*/
|
|
404
|
+
get rightColumnTemplate() {
|
|
420
405
|
return html `
|
|
421
406
|
<div id="right-column" class="column">
|
|
422
407
|
<div id="cb-top-view">
|
|
423
408
|
<slot name="cb-top-slot"></slot>
|
|
424
409
|
</div>
|
|
425
|
-
${this.isManageView
|
|
426
|
-
? this.manageBarTemplate
|
|
410
|
+
${this.isManageView
|
|
411
|
+
? this.manageBarTemplate
|
|
427
412
|
: this.sortFilterBarTemplate}
|
|
428
413
|
<slot name="cb-results"></slot>
|
|
429
|
-
${this.displayMode === `list-compact`
|
|
430
|
-
? this.listHeaderTemplate
|
|
414
|
+
${this.displayMode === `list-compact`
|
|
415
|
+
? this.listHeaderTemplate
|
|
431
416
|
: nothing}
|
|
432
417
|
${this.infiniteScrollerTemplate}
|
|
433
418
|
</div>
|
|
434
|
-
`;
|
|
435
|
-
}
|
|
436
|
-
get infiniteScrollerTemplate() {
|
|
437
|
-
console.warn('infiniteScrollerTemplate', this.placeholderType);
|
|
419
|
+
`;
|
|
420
|
+
}
|
|
421
|
+
get infiniteScrollerTemplate() {
|
|
438
422
|
return html `<infinite-scroller
|
|
439
423
|
class=${this.infiniteScrollerClasses}
|
|
440
424
|
itemCount=${this.placeholderType ? 0 : nothing}
|
|
@@ -443,20 +427,22 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
443
427
|
.placeholderCellTemplate=${this.placeholderCellTemplate}
|
|
444
428
|
@scrollThresholdReached=${this.scrollThresholdReached}
|
|
445
429
|
@visibleCellsChanged=${this.visibleCellsChanged}
|
|
446
|
-
>${this.displayMode === 'grid'
|
|
447
|
-
? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
|
|
430
|
+
>${this.displayMode === 'grid'
|
|
431
|
+
? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
|
|
448
432
|
: nothing}
|
|
449
|
-
</infinite-scroller>`;
|
|
450
|
-
}
|
|
451
|
-
get infiniteScrollerClasses() {
|
|
452
|
-
var _a;
|
|
453
|
-
return classMap({
|
|
454
|
-
[(_a = this.displayMode) !== null && _a !== void 0 ? _a : '']: !!this.displayMode,
|
|
455
|
-
hidden: !!this.placeholderType,
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
get sortFilterBarTemplate() {
|
|
459
|
-
var _a;
|
|
433
|
+
</infinite-scroller>`;
|
|
434
|
+
}
|
|
435
|
+
get infiniteScrollerClasses() {
|
|
436
|
+
var _a;
|
|
437
|
+
return classMap({
|
|
438
|
+
[(_a = this.displayMode) !== null && _a !== void 0 ? _a : '']: !!this.displayMode,
|
|
439
|
+
hidden: !!this.placeholderType,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
get sortFilterBarTemplate() {
|
|
443
|
+
var _a;
|
|
444
|
+
if (this.suppressSortBar)
|
|
445
|
+
return nothing;
|
|
460
446
|
return html `
|
|
461
447
|
<sort-filter-bar
|
|
462
448
|
.defaultSortField=${this.defaultSortField}
|
|
@@ -484,9 +470,9 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
484
470
|
slot="loans-tab-filter-bar-options-slot"
|
|
485
471
|
></slot>
|
|
486
472
|
</sort-filter-bar>
|
|
487
|
-
`;
|
|
488
|
-
}
|
|
489
|
-
get manageBarTemplate() {
|
|
473
|
+
`;
|
|
474
|
+
}
|
|
475
|
+
get manageBarTemplate() {
|
|
490
476
|
return html `
|
|
491
477
|
<manage-bar
|
|
492
478
|
showSelectAll
|
|
@@ -494,162 +480,163 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
494
480
|
@removeItems=${this.handleRemoveItems}
|
|
495
481
|
@selectAll=${() => this.dataSource.checkAllTiles()}
|
|
496
482
|
@unselectAll=${() => this.dataSource.uncheckAllTiles()}
|
|
497
|
-
@cancel=${() => {
|
|
498
|
-
this.isManageView = false;
|
|
499
|
-
this.dataSource.uncheckAllTiles();
|
|
483
|
+
@cancel=${() => {
|
|
484
|
+
this.isManageView = false;
|
|
485
|
+
this.dataSource.uncheckAllTiles();
|
|
500
486
|
}}
|
|
501
487
|
></manage-bar>
|
|
502
|
-
`;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
506
|
-
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
507
|
-
*/
|
|
508
|
-
handleRemoveItems() {
|
|
509
|
-
this.dispatchEvent(new CustomEvent('itemRemovalRequested', {
|
|
510
|
-
detail: {
|
|
511
|
-
items: this.dataSource.checkedTileModels.map(model =>
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
*
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
this.
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
//
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
*
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
*
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
*
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
*
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
this.
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
*
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
this.
|
|
652
|
-
|
|
488
|
+
`;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
492
|
+
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
493
|
+
*/
|
|
494
|
+
handleRemoveItems() {
|
|
495
|
+
this.dispatchEvent(new CustomEvent('itemRemovalRequested', {
|
|
496
|
+
detail: {
|
|
497
|
+
items: this.dataSource.checkedTileModels.map(model => {
|
|
498
|
+
const cloned = model.clone();
|
|
499
|
+
cloned.dateStr = formatDate(model.datePublished, 'long');
|
|
500
|
+
return cloned;
|
|
501
|
+
}),
|
|
502
|
+
},
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Removes all tile models that are currently checked & adjusts the paging
|
|
507
|
+
* of the data source to account for any new gaps in the data.
|
|
508
|
+
*/
|
|
509
|
+
removeCheckedTiles() {
|
|
510
|
+
this.dataSource.removeCheckedTiles();
|
|
511
|
+
}
|
|
512
|
+
userChangedSort(e) {
|
|
513
|
+
var _a;
|
|
514
|
+
const { selectedSort, sortDirection } = e.detail;
|
|
515
|
+
this.selectedSort = selectedSort;
|
|
516
|
+
this.sortDirection = sortDirection;
|
|
517
|
+
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
518
|
+
this.goToPage(1);
|
|
519
|
+
}
|
|
520
|
+
this.currentPage = 1;
|
|
521
|
+
}
|
|
522
|
+
sendSortByAnalytics(prevSortDirection) {
|
|
523
|
+
var _a;
|
|
524
|
+
const directionCleared = prevSortDirection && !this.sortDirection;
|
|
525
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
526
|
+
category: this.searchContext,
|
|
527
|
+
action: analyticsActions.sortBy,
|
|
528
|
+
label: `${this.selectedSort}${this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''}`,
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
selectedSortChanged() {
|
|
532
|
+
// Lazy-load the alphabet counts for title/creator sort bar as needed
|
|
533
|
+
this.dataSource.updatePrefixFiltersForCurrentSort();
|
|
534
|
+
}
|
|
535
|
+
get sortParam() {
|
|
536
|
+
var _a;
|
|
537
|
+
const sortOption = SORT_OPTIONS[this.selectedSort];
|
|
538
|
+
if (!(sortOption === null || sortOption === void 0 ? void 0 : sortOption.handledBySearchService)) {
|
|
539
|
+
return null;
|
|
540
|
+
}
|
|
541
|
+
// If the sort option specified in the URL is unrecognized, we just use it as-is
|
|
542
|
+
const urlSortParam = new URL(window.location.href).searchParams.get('sort');
|
|
543
|
+
const sortField = (_a = sortOption.searchServiceKey) !== null && _a !== void 0 ? _a : urlSortParam === null || urlSortParam === void 0 ? void 0 : urlSortParam.replace(/^-/, '');
|
|
544
|
+
// If the sort direction is still null at this point, then we assume ascending
|
|
545
|
+
// (i.e., it was unrecognized and had no directional flag)
|
|
546
|
+
if (!this.sortDirection)
|
|
547
|
+
this.sortDirection = 'asc';
|
|
548
|
+
if (!sortField)
|
|
549
|
+
return null;
|
|
550
|
+
return { field: sortField, direction: this.sortDirection };
|
|
551
|
+
}
|
|
552
|
+
displayModeChanged(e) {
|
|
553
|
+
var _a;
|
|
554
|
+
this.displayMode = e.detail.displayMode;
|
|
555
|
+
if (this.displayMode) {
|
|
556
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
557
|
+
category: this.searchContext,
|
|
558
|
+
action: analyticsActions.displayMode,
|
|
559
|
+
label: this.displayMode,
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Returns a query clause identifying the currently selected title filter,
|
|
565
|
+
* e.g., `firstTitle:X`.
|
|
566
|
+
*/
|
|
567
|
+
get titleQuery() {
|
|
568
|
+
return this.selectedTitleFilter
|
|
569
|
+
? `firstTitle:${this.selectedTitleFilter}`
|
|
570
|
+
: undefined;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Returns a query clause identifying the currently selected creator filter,
|
|
574
|
+
* e.g., `firstCreator:X`.
|
|
575
|
+
*/
|
|
576
|
+
get creatorQuery() {
|
|
577
|
+
return this.selectedCreatorFilter
|
|
578
|
+
? `firstCreator:${this.selectedCreatorFilter}`
|
|
579
|
+
: undefined;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Send Analytics when sorting by title's first letter
|
|
583
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
584
|
+
*/
|
|
585
|
+
sendFilterByTitleAnalytics(prevSelectedLetter) {
|
|
586
|
+
var _a;
|
|
587
|
+
if (!prevSelectedLetter && !this.selectedTitleFilter) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
const cleared = prevSelectedLetter && !this.selectedTitleFilter;
|
|
591
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
592
|
+
category: this.searchContext,
|
|
593
|
+
action: analyticsActions.filterByTitle,
|
|
594
|
+
label: cleared
|
|
595
|
+
? `clear-${prevSelectedLetter}`
|
|
596
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Send Analytics when filtering by creator's first letter
|
|
601
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
602
|
+
*/
|
|
603
|
+
sendFilterByCreatorAnalytics(prevSelectedLetter) {
|
|
604
|
+
var _a;
|
|
605
|
+
if (!prevSelectedLetter && !this.selectedCreatorFilter) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const cleared = prevSelectedLetter && !this.selectedCreatorFilter;
|
|
609
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
610
|
+
category: this.searchContext,
|
|
611
|
+
action: analyticsActions.filterByCreator,
|
|
612
|
+
label: cleared
|
|
613
|
+
? `clear-${prevSelectedLetter}`
|
|
614
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Handler for changes to which letter is selected in the title alphabet bar.
|
|
619
|
+
*/
|
|
620
|
+
titleLetterSelected(e) {
|
|
621
|
+
this.selectedCreatorFilter = null;
|
|
622
|
+
this.selectedTitleFilter = e.detail.selectedLetter;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Handler for changes to which letter is selected in the creator alphabet bar.
|
|
626
|
+
*/
|
|
627
|
+
creatorLetterSelected(e) {
|
|
628
|
+
this.selectedTitleFilter = null;
|
|
629
|
+
this.selectedCreatorFilter = e.detail.selectedLetter;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* The full template for how the facets should be structured in mobile view,
|
|
633
|
+
* including the collapsible container (with header) and the facets themselves.
|
|
634
|
+
*/
|
|
635
|
+
get mobileFacetsTemplate() {
|
|
636
|
+
const toggleFacetsVisible = () => {
|
|
637
|
+
this.isResizeToMobile = false;
|
|
638
|
+
this.mobileFacetsVisible = !this.mobileFacetsVisible;
|
|
639
|
+
};
|
|
653
640
|
return html `
|
|
654
641
|
<details
|
|
655
642
|
id="mobile-filter-collapse"
|
|
@@ -663,26 +650,25 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
663
650
|
</summary>
|
|
664
651
|
${this.facetsTemplate}
|
|
665
652
|
</details>
|
|
666
|
-
`;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* The template for the facets component alone, without any surrounding wrappers.
|
|
670
|
-
*/
|
|
671
|
-
get facetsTemplate() {
|
|
672
|
-
|
|
673
|
-
if (this.suppressFacets) {
|
|
653
|
+
`;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* The template for the facets component alone, without any surrounding wrappers.
|
|
657
|
+
*/
|
|
658
|
+
get facetsTemplate() {
|
|
659
|
+
if (this.suppressFacets) {
|
|
674
660
|
return html `
|
|
675
661
|
<p class="facets-message">
|
|
676
662
|
${msg('Facets are temporarily unavailable.')}
|
|
677
663
|
</p>
|
|
678
|
-
`;
|
|
679
|
-
}
|
|
664
|
+
`;
|
|
665
|
+
}
|
|
680
666
|
return html `
|
|
681
667
|
<collection-facets
|
|
682
668
|
@facetsChanged=${this.facetsChanged}
|
|
683
669
|
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
684
670
|
.collectionPagePath=${this.collectionPagePath}
|
|
685
|
-
.parentCollections=${
|
|
671
|
+
.parentCollections=${this.dataSource.parentCollections}
|
|
686
672
|
.withinCollection=${this.withinCollection}
|
|
687
673
|
.searchService=${this.searchService}
|
|
688
674
|
.featureFeedbackService=${this.featureFeedbackService}
|
|
@@ -690,7 +676,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
690
676
|
.resizeObserver=${this.resizeObserver}
|
|
691
677
|
.searchType=${this.searchType}
|
|
692
678
|
.aggregations=${this.dataSource.aggregations}
|
|
693
|
-
.fullYearsHistogramAggregation=${this.dataSource
|
|
679
|
+
.fullYearsHistogramAggregation=${this.dataSource
|
|
694
680
|
.yearHistogramAggregation}
|
|
695
681
|
.minSelectedDate=${this.minSelectedDate}
|
|
696
682
|
.maxSelectedDate=${this.maxSelectedDate}
|
|
@@ -711,41 +697,41 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
711
697
|
.analyticsHandler=${this.analyticsHandler}
|
|
712
698
|
>
|
|
713
699
|
</collection-facets>
|
|
714
|
-
`;
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
718
|
-
* filters are currently active.
|
|
719
|
-
*
|
|
720
|
-
* @param mobile Whether to style/shorten the button for mobile view
|
|
721
|
-
*/
|
|
722
|
-
clearFiltersBtnTemplate(mobile) {
|
|
723
|
-
if (!this.hasActiveFilters)
|
|
724
|
-
return nothing;
|
|
725
|
-
const buttonClasses = classMap({
|
|
726
|
-
'clear-filters-btn': true,
|
|
727
|
-
mobile,
|
|
728
|
-
});
|
|
729
|
-
const buttonText = mobile ? 'Clear all' : 'Clear all filters';
|
|
700
|
+
`;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
704
|
+
* filters are currently active.
|
|
705
|
+
*
|
|
706
|
+
* @param mobile Whether to style/shorten the button for mobile view
|
|
707
|
+
*/
|
|
708
|
+
clearFiltersBtnTemplate(mobile) {
|
|
709
|
+
if (!this.hasActiveFilters)
|
|
710
|
+
return nothing;
|
|
711
|
+
const buttonClasses = classMap({
|
|
712
|
+
'clear-filters-btn': true,
|
|
713
|
+
mobile,
|
|
714
|
+
});
|
|
715
|
+
const buttonText = mobile ? 'Clear all' : 'Clear all filters';
|
|
730
716
|
return html `
|
|
731
717
|
<div class="clear-filters-btn-row">
|
|
732
|
-
${mobile
|
|
733
|
-
? html `<span class="clear-filters-btn-separator"> </span>`
|
|
718
|
+
${mobile
|
|
719
|
+
? html `<span class="clear-filters-btn-separator"> </span>`
|
|
734
720
|
: nothing}
|
|
735
721
|
<button class=${buttonClasses} @click=${this.clearFilters}>
|
|
736
722
|
${buttonText}
|
|
737
723
|
</button>
|
|
738
724
|
</div>
|
|
739
|
-
`;
|
|
740
|
-
}
|
|
741
|
-
get loadingTemplate() {
|
|
725
|
+
`;
|
|
726
|
+
}
|
|
727
|
+
get loadingTemplate() {
|
|
742
728
|
return html `
|
|
743
729
|
<div class="loading-cover">
|
|
744
730
|
<circular-activity-indicator></circular-activity-indicator>
|
|
745
731
|
</div>
|
|
746
|
-
`;
|
|
747
|
-
}
|
|
748
|
-
get listHeaderTemplate() {
|
|
732
|
+
`;
|
|
733
|
+
}
|
|
734
|
+
get listHeaderTemplate() {
|
|
749
735
|
return html `
|
|
750
736
|
<div id="list-header">
|
|
751
737
|
<tile-dispatcher
|
|
@@ -758,594 +744,591 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
758
744
|
>
|
|
759
745
|
</tile-dispatcher>
|
|
760
746
|
</div>
|
|
761
|
-
`;
|
|
762
|
-
}
|
|
763
|
-
histogramDateRangeUpdated(e) {
|
|
764
|
-
var _a;
|
|
765
|
-
const { minDate, maxDate } = e.detail;
|
|
766
|
-
[this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];
|
|
767
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
768
|
-
category: this.searchContext,
|
|
769
|
-
action: analyticsActions.histogramChanged,
|
|
770
|
-
label: this.dateRangeQueryClause,
|
|
771
|
-
});
|
|
772
|
-
}
|
|
773
|
-
get dateRangeQueryClause() {
|
|
774
|
-
if (!this.minSelectedDate || !this.maxSelectedDate) {
|
|
775
|
-
return undefined;
|
|
776
|
-
}
|
|
777
|
-
return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;
|
|
778
|
-
}
|
|
779
|
-
/**
|
|
780
|
-
* Emits an event indicating a change in whether the manage mode is shown.
|
|
781
|
-
*/
|
|
782
|
-
emitManageModeChangedEvent() {
|
|
783
|
-
this.dispatchEvent(new CustomEvent('manageModeChanged', {
|
|
784
|
-
detail: this.isManageView,
|
|
785
|
-
}));
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
this.
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
if (!this.
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
this.
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
this.
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
changed.has('
|
|
872
|
-
changed.has('
|
|
873
|
-
changed.has('
|
|
874
|
-
changed.has('
|
|
875
|
-
changed.has('
|
|
876
|
-
changed.has('
|
|
877
|
-
changed.has('
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
this.
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
(
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
this.
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
if (
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
},
|
|
997
|
-
}));
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
this.dispatchEvent(new
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
this.
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
//
|
|
1081
|
-
|
|
1082
|
-
|
|
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
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
//
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
this.
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
this.
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
this.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
this.
|
|
1134
|
-
this.
|
|
1135
|
-
this.
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
action =
|
|
1180
|
-
bucket.state !== 'none'
|
|
1181
|
-
? analyticsActions.
|
|
1182
|
-
: analyticsActions.
|
|
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
|
-
const
|
|
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
|
-
const
|
|
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
|
-
const model = this.tileModelAtCellIndex(index);
|
|
1347
|
-
if (!model)
|
|
1348
|
-
return undefined;
|
|
747
|
+
`;
|
|
748
|
+
}
|
|
749
|
+
histogramDateRangeUpdated(e) {
|
|
750
|
+
var _a;
|
|
751
|
+
const { minDate, maxDate } = e.detail;
|
|
752
|
+
[this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];
|
|
753
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
754
|
+
category: this.searchContext,
|
|
755
|
+
action: analyticsActions.histogramChanged,
|
|
756
|
+
label: this.dateRangeQueryClause,
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
get dateRangeQueryClause() {
|
|
760
|
+
if (!this.minSelectedDate || !this.maxSelectedDate) {
|
|
761
|
+
return undefined;
|
|
762
|
+
}
|
|
763
|
+
return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Emits an event indicating a change in whether the manage mode is shown.
|
|
767
|
+
*/
|
|
768
|
+
emitManageModeChangedEvent() {
|
|
769
|
+
this.dispatchEvent(new CustomEvent('manageModeChanged', {
|
|
770
|
+
detail: this.isManageView,
|
|
771
|
+
}));
|
|
772
|
+
}
|
|
773
|
+
async installDataSourceAndQueryState(dataSource, queryState) {
|
|
774
|
+
var _a, _b;
|
|
775
|
+
log('Installing data source & query state in CB:', dataSource, queryState);
|
|
776
|
+
if (this.dataSource)
|
|
777
|
+
this.removeController(this.dataSource);
|
|
778
|
+
this.dataSource = dataSource;
|
|
779
|
+
this.addController(this.dataSource);
|
|
780
|
+
this.baseQuery = queryState.baseQuery;
|
|
781
|
+
this.profileElement = queryState.profileElement;
|
|
782
|
+
this.searchType = queryState.searchType;
|
|
783
|
+
this.selectedFacets =
|
|
784
|
+
(_a = queryState.selectedFacets) !== null && _a !== void 0 ? _a : getDefaultSelectedFacets();
|
|
785
|
+
this.minSelectedDate = queryState.minSelectedDate;
|
|
786
|
+
this.maxSelectedDate = queryState.maxSelectedDate;
|
|
787
|
+
this.selectedSort = (_b = queryState.selectedSort) !== null && _b !== void 0 ? _b : SortField.default;
|
|
788
|
+
this.sortDirection = queryState.sortDirection;
|
|
789
|
+
this.selectedTitleFilter = queryState.selectedTitleFilter;
|
|
790
|
+
this.selectedCreatorFilter = queryState.selectedCreatorFilter;
|
|
791
|
+
this.requestUpdate();
|
|
792
|
+
await this.updateComplete;
|
|
793
|
+
if (!this.searchResultsLoading) {
|
|
794
|
+
this.setTotalResultCount(this.dataSource.totalResults);
|
|
795
|
+
this.setTileCount(this.dataSource.size);
|
|
796
|
+
}
|
|
797
|
+
this.refreshVisibleResults();
|
|
798
|
+
}
|
|
799
|
+
firstUpdated() {
|
|
800
|
+
this.setupStateRestorationObserver();
|
|
801
|
+
this.restoreState();
|
|
802
|
+
}
|
|
803
|
+
updated(changed) {
|
|
804
|
+
var _a, _b;
|
|
805
|
+
if (changed.has('placeholderType') && this.placeholderType === null) {
|
|
806
|
+
if (!this.leftColIntersectionObserver) {
|
|
807
|
+
this.setupLeftColumnScrollListeners();
|
|
808
|
+
}
|
|
809
|
+
if (!this.facetsIntersectionObserver) {
|
|
810
|
+
this.setupFacetsScrollListeners();
|
|
811
|
+
}
|
|
812
|
+
this.updateLeftColumnHeight();
|
|
813
|
+
}
|
|
814
|
+
if (changed.has('displayMode') ||
|
|
815
|
+
changed.has('baseNavigationUrl') ||
|
|
816
|
+
changed.has('baseImageUrl') ||
|
|
817
|
+
changed.has('loggedIn')) {
|
|
818
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|
|
819
|
+
}
|
|
820
|
+
if (changed.has('baseQuery') ||
|
|
821
|
+
changed.has('searchType') ||
|
|
822
|
+
changed.has('withinCollection')) {
|
|
823
|
+
// Unless this query/search type update is from the initial page load or the
|
|
824
|
+
// result of hitting the back button,
|
|
825
|
+
// we need to clear any existing filters since they may no longer be valid for
|
|
826
|
+
// the new set of search results.
|
|
827
|
+
if (!this.historyPopOccurred && this.initialQueryChangeHappened) {
|
|
828
|
+
// Ordinarily, we leave the sort param unchanged between searches.
|
|
829
|
+
// However, if we are changing the target collection itself, we want the sort cleared too,
|
|
830
|
+
// since different collections may have different sorting options available.
|
|
831
|
+
const shouldClearSort = changed.has('withinCollection') &&
|
|
832
|
+
!changed.has('selectedSort') &&
|
|
833
|
+
!changed.has('sortDirection');
|
|
834
|
+
// Otherwise, only clear filters that haven't been simultaneously applied in this update
|
|
835
|
+
this.clearFilters({
|
|
836
|
+
sort: shouldClearSort,
|
|
837
|
+
facets: !changed.has('selectedFacets'),
|
|
838
|
+
dateRange: !(changed.has('minSelectedDate') || changed.has('maxSelectedDate')),
|
|
839
|
+
letterFilters: !(changed.has('selectedTitleFilter') ||
|
|
840
|
+
changed.has('selectedCreatorFilter')),
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
if (changed.has('profileElement')) {
|
|
845
|
+
this.applyDefaultProfileSort();
|
|
846
|
+
}
|
|
847
|
+
if (changed.has('baseQuery')) {
|
|
848
|
+
this.emitBaseQueryChanged();
|
|
849
|
+
}
|
|
850
|
+
if (changed.has('searchType')) {
|
|
851
|
+
this.emitSearchTypeChanged();
|
|
852
|
+
}
|
|
853
|
+
if (changed.has('currentPage') || changed.has('displayMode')) {
|
|
854
|
+
this.persistState();
|
|
855
|
+
}
|
|
856
|
+
if (changed.has('baseQuery') ||
|
|
857
|
+
changed.has('minSelectedDate') ||
|
|
858
|
+
changed.has('maxSelectedDate') ||
|
|
859
|
+
changed.has('selectedFacets') ||
|
|
860
|
+
changed.has('searchService') ||
|
|
861
|
+
changed.has('withinCollection') ||
|
|
862
|
+
changed.has('withinProfile') ||
|
|
863
|
+
changed.has('profileElement')) {
|
|
864
|
+
this.dataSource.refreshLetterCounts();
|
|
865
|
+
}
|
|
866
|
+
if (changed.has('selectedSort') || changed.has('sortDirection')) {
|
|
867
|
+
const prevSortDirection = changed.get('sortDirection');
|
|
868
|
+
this.sendSortByAnalytics(prevSortDirection);
|
|
869
|
+
this.selectedSortChanged();
|
|
870
|
+
}
|
|
871
|
+
if (changed.has('selectedTitleFilter')) {
|
|
872
|
+
this.sendFilterByTitleAnalytics(changed.get('selectedTitleFilter'));
|
|
873
|
+
}
|
|
874
|
+
if (changed.has('selectedCreatorFilter')) {
|
|
875
|
+
this.sendFilterByCreatorAnalytics(changed.get('selectedCreatorFilter'));
|
|
876
|
+
}
|
|
877
|
+
if (changed.has('baseQuery') ||
|
|
878
|
+
changed.has('searchType') ||
|
|
879
|
+
changed.has('selectedTitleFilter') ||
|
|
880
|
+
changed.has('selectedCreatorFilter') ||
|
|
881
|
+
changed.has('minSelectedDate') ||
|
|
882
|
+
changed.has('maxSelectedDate') ||
|
|
883
|
+
changed.has('selectedSort') ||
|
|
884
|
+
changed.has('sortDirection') ||
|
|
885
|
+
changed.has('selectedFacets') ||
|
|
886
|
+
changed.has('searchService') ||
|
|
887
|
+
changed.has('withinCollection') ||
|
|
888
|
+
changed.has('withinProfile') ||
|
|
889
|
+
changed.has('profileElement')) {
|
|
890
|
+
this.handleQueryChange();
|
|
891
|
+
}
|
|
892
|
+
if (changed.has('searchResultsLoading')) {
|
|
893
|
+
this.emitSearchResultsLoadingChanged();
|
|
894
|
+
}
|
|
895
|
+
if (changed.has('facetsLoading') &&
|
|
896
|
+
this.facetsLoading &&
|
|
897
|
+
this.collectionFacets) {
|
|
898
|
+
this.collectionFacets.moreLinksVisible =
|
|
899
|
+
this.searchType !== SearchType.FULLTEXT;
|
|
900
|
+
}
|
|
901
|
+
if (changed.has('pagesToRender')) {
|
|
902
|
+
if (!this.dataSource.endOfDataReached && this.infiniteScroller) {
|
|
903
|
+
this.infiniteScroller.itemCount = this.estimatedTileCount;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (changed.has('isManageView')) {
|
|
907
|
+
if (this.isManageView)
|
|
908
|
+
this.displayMode = 'grid';
|
|
909
|
+
(_b = this.infiniteScroller) === null || _b === void 0 ? void 0 : _b.refreshAllVisibleCells();
|
|
910
|
+
this.emitManageModeChangedEvent();
|
|
911
|
+
}
|
|
912
|
+
if (changed.has('resizeObserver')) {
|
|
913
|
+
const oldObserver = changed.get('resizeObserver');
|
|
914
|
+
if (oldObserver)
|
|
915
|
+
this.disconnectResizeObserver(oldObserver);
|
|
916
|
+
this.setupResizeObserver();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
disconnectedCallback() {
|
|
920
|
+
var _a, _b;
|
|
921
|
+
if (this.resizeObserver) {
|
|
922
|
+
this.disconnectResizeObserver(this.resizeObserver);
|
|
923
|
+
}
|
|
924
|
+
if (this.boundNavigationHandler) {
|
|
925
|
+
window.removeEventListener('popstate', this.boundNavigationHandler);
|
|
926
|
+
}
|
|
927
|
+
(_a = this.leftColIntersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
928
|
+
(_b = this.facetsIntersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
929
|
+
window.removeEventListener('resize', this.updateLeftColumnHeight);
|
|
930
|
+
}
|
|
931
|
+
handleResize(entry) {
|
|
932
|
+
const previousView = this.mobileView;
|
|
933
|
+
if (entry.target === this.contentContainer) {
|
|
934
|
+
this.contentWidth = entry.contentRect.width;
|
|
935
|
+
this.mobileView =
|
|
936
|
+
this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;
|
|
937
|
+
// If changing from desktop to mobile disable transition
|
|
938
|
+
if (this.mobileView && !previousView) {
|
|
939
|
+
this.isResizeToMobile = true;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
// Ensure the facet sidebar remains sized correctly
|
|
943
|
+
this.updateLeftColumnHeight();
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Sets up listeners for events that may require updating the left column height.
|
|
947
|
+
*/
|
|
948
|
+
setupLeftColumnScrollListeners() {
|
|
949
|
+
var _a;
|
|
950
|
+
// We observe intersections between the left column's scroll sentinel and
|
|
951
|
+
// the viewport, so that we can ensure the left column is always sized to
|
|
952
|
+
// match the _available_ viewport height. This should generally be more
|
|
953
|
+
// performant than listening to scroll events on the page or column.
|
|
954
|
+
const leftColumnSentinel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#left-column-scroll-sentinel');
|
|
955
|
+
if (leftColumnSentinel) {
|
|
956
|
+
this.leftColIntersectionObserver = new IntersectionObserver(this.updateLeftColumnHeight, {
|
|
957
|
+
threshold: [...Array(101).keys()].map(n => n / 100), // Threshold every 1%
|
|
958
|
+
});
|
|
959
|
+
this.leftColIntersectionObserver.observe(leftColumnSentinel);
|
|
960
|
+
}
|
|
961
|
+
// We also listen for window resize events, as they are not always captured
|
|
962
|
+
// by the resize observer and can affect the desired height of the left column.
|
|
963
|
+
window.addEventListener('resize', this.updateLeftColumnHeight);
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
|
|
967
|
+
* Note this uses a separate IntersectionObserver from the left column, because we
|
|
968
|
+
* don't need granular intersection thresholds for this.
|
|
969
|
+
*/
|
|
970
|
+
setupFacetsScrollListeners() {
|
|
971
|
+
var _a;
|
|
972
|
+
const facetsSentinel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#facets-scroll-sentinel');
|
|
973
|
+
if (facetsSentinel) {
|
|
974
|
+
this.facetsIntersectionObserver = new IntersectionObserver(this.updateFacetFadeOut);
|
|
975
|
+
this.facetsIntersectionObserver.observe(facetsSentinel);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
emitBaseQueryChanged() {
|
|
979
|
+
this.dispatchEvent(new CustomEvent('baseQueryChanged', {
|
|
980
|
+
detail: {
|
|
981
|
+
baseQuery: this.baseQuery,
|
|
982
|
+
},
|
|
983
|
+
}));
|
|
984
|
+
}
|
|
985
|
+
emitSearchTypeChanged() {
|
|
986
|
+
this.dispatchEvent(new CustomEvent('searchTypeChanged', {
|
|
987
|
+
detail: this.searchType,
|
|
988
|
+
}));
|
|
989
|
+
}
|
|
990
|
+
emitQueryStateChanged() {
|
|
991
|
+
this.dispatchEvent(new CustomEvent('queryStateChanged', {
|
|
992
|
+
detail: {
|
|
993
|
+
baseQuery: this.baseQuery,
|
|
994
|
+
withinCollection: this.withinCollection,
|
|
995
|
+
withinProfile: this.withinProfile,
|
|
996
|
+
profileElement: this.profileElement,
|
|
997
|
+
searchType: this.searchType,
|
|
998
|
+
selectedFacets: this.selectedFacets,
|
|
999
|
+
minSelectedDate: this.minSelectedDate,
|
|
1000
|
+
maxSelectedDate: this.maxSelectedDate,
|
|
1001
|
+
selectedSort: this.selectedSort,
|
|
1002
|
+
sortDirection: this.sortDirection,
|
|
1003
|
+
selectedTitleFilter: this.selectedTitleFilter,
|
|
1004
|
+
selectedCreatorFilter: this.selectedCreatorFilter,
|
|
1005
|
+
},
|
|
1006
|
+
}));
|
|
1007
|
+
}
|
|
1008
|
+
emitEmptyResults() {
|
|
1009
|
+
this.dispatchEvent(new Event('emptyResults'));
|
|
1010
|
+
}
|
|
1011
|
+
disconnectResizeObserver(resizeObserver) {
|
|
1012
|
+
resizeObserver.removeObserver({
|
|
1013
|
+
target: this.contentContainer,
|
|
1014
|
+
handler: this,
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
setupResizeObserver() {
|
|
1018
|
+
if (!this.resizeObserver)
|
|
1019
|
+
return;
|
|
1020
|
+
this.resizeObserver.addObserver({
|
|
1021
|
+
target: this.contentContainer,
|
|
1022
|
+
handler: this,
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* When the visible cells change from the infinite scroller, we want to emit
|
|
1027
|
+
* which page is currently visible so the consumer can update its UI or the URL
|
|
1028
|
+
*
|
|
1029
|
+
* @param e
|
|
1030
|
+
* @returns
|
|
1031
|
+
*/
|
|
1032
|
+
visibleCellsChanged(e) {
|
|
1033
|
+
if (this.isScrollingToCell)
|
|
1034
|
+
return;
|
|
1035
|
+
const { visibleCellIndices } = e.detail;
|
|
1036
|
+
if (visibleCellIndices.length === 0)
|
|
1037
|
+
return;
|
|
1038
|
+
const lastVisibleCellIndex = visibleCellIndices[visibleCellIndices.length - 1];
|
|
1039
|
+
const lastVisibleCellPage = Math.floor(lastVisibleCellIndex / this.pageSize) + 1;
|
|
1040
|
+
if (this.currentPage !== lastVisibleCellPage) {
|
|
1041
|
+
this.currentPage = lastVisibleCellPage;
|
|
1042
|
+
}
|
|
1043
|
+
const event = new CustomEvent('visiblePageChanged', {
|
|
1044
|
+
detail: {
|
|
1045
|
+
pageNumber: lastVisibleCellPage,
|
|
1046
|
+
},
|
|
1047
|
+
});
|
|
1048
|
+
this.dispatchEvent(event);
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
1052
|
+
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
1053
|
+
*
|
|
1054
|
+
* Ensure you await this component's `updateComplete` promise before awaiting this
|
|
1055
|
+
* one, to ensure you do not await an obsolete promise from the previous update.
|
|
1056
|
+
*/
|
|
1057
|
+
get initialSearchComplete() {
|
|
1058
|
+
return this.dataSource.initialSearchComplete;
|
|
1059
|
+
}
|
|
1060
|
+
async handleQueryChange() {
|
|
1061
|
+
var _a;
|
|
1062
|
+
// only reset if the query has actually changed
|
|
1063
|
+
if (!this.searchService ||
|
|
1064
|
+
this.dataSource.pageFetchQueryKey === this.previousQueryKey)
|
|
1065
|
+
return;
|
|
1066
|
+
// If the new state prevents us from updating the search results, don't reset
|
|
1067
|
+
if (!this.dataSource.canPerformSearch &&
|
|
1068
|
+
!(this.clearResultsOnEmptyQuery && this.baseQuery === ''))
|
|
1069
|
+
return;
|
|
1070
|
+
this.previousQueryKey = this.dataSource.pageFetchQueryKey;
|
|
1071
|
+
// this.emitQueryStateChanged();
|
|
1072
|
+
this.tileModelOffset = 0;
|
|
1073
|
+
this.totalResults = undefined;
|
|
1074
|
+
this.pagesToRender =
|
|
1075
|
+
this.initialPageNumber === 1
|
|
1076
|
+
? 2 // First two pages are batched into one request when starting from page 1
|
|
1077
|
+
: this.initialPageNumber;
|
|
1078
|
+
// Reset the infinite scroller's item count, so that it
|
|
1079
|
+
// shows tile placeholders until the new query's results load in
|
|
1080
|
+
if (this.infiniteScroller) {
|
|
1081
|
+
this.infiniteScroller.itemCount = this.estimatedTileCount;
|
|
1082
|
+
this.infiniteScroller.reload();
|
|
1083
|
+
}
|
|
1084
|
+
if (this.withinCollection && ((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
1085
|
+
this.defaultSortField = SortField.relevance;
|
|
1086
|
+
this.defaultSortDirection = null;
|
|
1087
|
+
}
|
|
1088
|
+
if (!this.initialQueryChangeHappened && this.initialPageNumber > 1) {
|
|
1089
|
+
this.scrollToPage(this.initialPageNumber);
|
|
1090
|
+
}
|
|
1091
|
+
this.initialQueryChangeHappened = true;
|
|
1092
|
+
// if the query changed as part of a window.history pop event, we don't want to
|
|
1093
|
+
// persist the state because it overwrites the forward history
|
|
1094
|
+
if (!this.historyPopOccurred) {
|
|
1095
|
+
this.persistState();
|
|
1096
|
+
}
|
|
1097
|
+
this.historyPopOccurred = false;
|
|
1098
|
+
// Fire the initial page and facets requests
|
|
1099
|
+
// await this.dataSource.handleQueryChange();
|
|
1100
|
+
}
|
|
1101
|
+
setupStateRestorationObserver() {
|
|
1102
|
+
if (this.boundNavigationHandler)
|
|
1103
|
+
return;
|
|
1104
|
+
this.boundNavigationHandler = this.historyNavigationHandler.bind(this);
|
|
1105
|
+
// when the user navigates back, we want to update the UI to match the URL
|
|
1106
|
+
window.addEventListener('popstate', this.boundNavigationHandler);
|
|
1107
|
+
}
|
|
1108
|
+
historyNavigationHandler() {
|
|
1109
|
+
this.historyPopOccurred = true;
|
|
1110
|
+
this.restoreState();
|
|
1111
|
+
}
|
|
1112
|
+
restoreState() {
|
|
1113
|
+
var _a, _b, _c, _d, _e;
|
|
1114
|
+
const restorationState = this.restorationStateHandler.getRestorationState();
|
|
1115
|
+
this.displayMode = restorationState.displayMode;
|
|
1116
|
+
if (restorationState.searchType != null)
|
|
1117
|
+
this.searchType = restorationState.searchType;
|
|
1118
|
+
this.selectedSort = (_a = restorationState.selectedSort) !== null && _a !== void 0 ? _a : SortField.default;
|
|
1119
|
+
this.sortDirection = (_b = restorationState.sortDirection) !== null && _b !== void 0 ? _b : null;
|
|
1120
|
+
this.selectedTitleFilter = (_c = restorationState.selectedTitleFilter) !== null && _c !== void 0 ? _c : null;
|
|
1121
|
+
this.selectedCreatorFilter = (_d = restorationState.selectedCreatorFilter) !== null && _d !== void 0 ? _d : null;
|
|
1122
|
+
this.selectedFacets = restorationState.selectedFacets;
|
|
1123
|
+
if (!this.suppressURLQuery)
|
|
1124
|
+
this.baseQuery = restorationState.baseQuery;
|
|
1125
|
+
this.currentPage = (_e = restorationState.currentPage) !== null && _e !== void 0 ? _e : 1;
|
|
1126
|
+
this.minSelectedDate = restorationState.minSelectedDate;
|
|
1127
|
+
this.maxSelectedDate = restorationState.maxSelectedDate;
|
|
1128
|
+
if (this.currentPage > 1) {
|
|
1129
|
+
this.goToPage(this.currentPage);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
persistState() {
|
|
1133
|
+
var _a, _b, _c, _d;
|
|
1134
|
+
const restorationState = {
|
|
1135
|
+
displayMode: this.displayMode,
|
|
1136
|
+
searchType: this.searchType,
|
|
1137
|
+
selectedSort: this.selectedSort,
|
|
1138
|
+
sortDirection: (_a = this.sortDirection) !== null && _a !== void 0 ? _a : undefined,
|
|
1139
|
+
selectedFacets: (_b = this.selectedFacets) !== null && _b !== void 0 ? _b : getDefaultSelectedFacets(),
|
|
1140
|
+
baseQuery: this.suppressURLQuery ? undefined : this.baseQuery,
|
|
1141
|
+
currentPage: this.currentPage,
|
|
1142
|
+
titleQuery: this.titleQuery,
|
|
1143
|
+
creatorQuery: this.creatorQuery,
|
|
1144
|
+
minSelectedDate: this.minSelectedDate,
|
|
1145
|
+
maxSelectedDate: this.maxSelectedDate,
|
|
1146
|
+
selectedTitleFilter: (_c = this.selectedTitleFilter) !== null && _c !== void 0 ? _c : undefined,
|
|
1147
|
+
selectedCreatorFilter: (_d = this.selectedCreatorFilter) !== null && _d !== void 0 ? _d : undefined,
|
|
1148
|
+
};
|
|
1149
|
+
this.restorationStateHandler.persistState(restorationState);
|
|
1150
|
+
}
|
|
1151
|
+
emitSearchResultsLoadingChanged() {
|
|
1152
|
+
this.dispatchEvent(new CustomEvent('searchResultsLoadingChanged', {
|
|
1153
|
+
detail: {
|
|
1154
|
+
loading: this.searchResultsLoading,
|
|
1155
|
+
},
|
|
1156
|
+
}));
|
|
1157
|
+
}
|
|
1158
|
+
facetsChanged(e) {
|
|
1159
|
+
this.selectedFacets = e.detail;
|
|
1160
|
+
}
|
|
1161
|
+
facetClickHandler({ detail: { facetType, bucket, negative }, }) {
|
|
1162
|
+
var _a;
|
|
1163
|
+
let action;
|
|
1164
|
+
if (negative) {
|
|
1165
|
+
action =
|
|
1166
|
+
bucket.state !== 'none'
|
|
1167
|
+
? analyticsActions.facetNegativeSelected
|
|
1168
|
+
: analyticsActions.facetNegativeDeselected;
|
|
1169
|
+
}
|
|
1170
|
+
else {
|
|
1171
|
+
action =
|
|
1172
|
+
bucket.state !== 'none'
|
|
1173
|
+
? analyticsActions.facetSelected
|
|
1174
|
+
: analyticsActions.facetDeselected;
|
|
1175
|
+
}
|
|
1176
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
1177
|
+
category: this.searchContext,
|
|
1178
|
+
action,
|
|
1179
|
+
label: facetType,
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
scrollToPage(pageNumber) {
|
|
1183
|
+
return new Promise(resolve => {
|
|
1184
|
+
const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);
|
|
1185
|
+
// without this setTimeout, Safari just pauses until the `fetchPage` is complete
|
|
1186
|
+
// then scrolls to the cell
|
|
1187
|
+
setTimeout(() => {
|
|
1188
|
+
var _a;
|
|
1189
|
+
this.isScrollingToCell = true;
|
|
1190
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.scrollToCell(cellIndexToScrollTo, true);
|
|
1191
|
+
// This timeout is to give the scroll animation time to finish
|
|
1192
|
+
// then updating the infinite scroller once we're done scrolling
|
|
1193
|
+
// There's no scroll animation completion callback so we're
|
|
1194
|
+
// giving it 0.5s to finish.
|
|
1195
|
+
setTimeout(() => {
|
|
1196
|
+
var _a;
|
|
1197
|
+
this.isScrollingToCell = false;
|
|
1198
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshAllVisibleCells();
|
|
1199
|
+
resolve();
|
|
1200
|
+
}, 500);
|
|
1201
|
+
}, 0);
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Whether sorting by relevance makes sense for the current state.
|
|
1206
|
+
* Currently equivalent to having a non-empty query.
|
|
1207
|
+
*/
|
|
1208
|
+
get isRelevanceSortAvailable() {
|
|
1209
|
+
var _a;
|
|
1210
|
+
return !!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim());
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Sets the total number of tiles displayed in the infinite scroller.
|
|
1214
|
+
*/
|
|
1215
|
+
setTileCount(count) {
|
|
1216
|
+
if (this.infiniteScroller) {
|
|
1217
|
+
this.infiniteScroller.itemCount = count;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Applies any default sort option for the current collection, by checking
|
|
1222
|
+
* for one in the collection's metadata. If none is found, defaults to sorting
|
|
1223
|
+
* descending by:
|
|
1224
|
+
* - Date Favorited for fav-* collections
|
|
1225
|
+
* - Weekly views for all other collections
|
|
1226
|
+
*/
|
|
1227
|
+
applyDefaultCollectionSort(collectionInfo) {
|
|
1228
|
+
var _a, _b, _c;
|
|
1229
|
+
if (this.baseQuery) {
|
|
1230
|
+
// If there's a query set, then we default to relevance sorting regardless of
|
|
1231
|
+
// the collection metadata-specified sort.
|
|
1232
|
+
this.defaultSortField = SortField.relevance;
|
|
1233
|
+
this.defaultSortDirection = null;
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
// Favorite collections sort on Date Favorited by default.
|
|
1237
|
+
// Other collections fall back to sorting on weekly views.
|
|
1238
|
+
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-'))
|
|
1239
|
+
? '-favoritedate'
|
|
1240
|
+
: '-week';
|
|
1241
|
+
// The collection metadata may override the default sorting with something else
|
|
1242
|
+
const metadataSort = (_c = collectionInfo === null || collectionInfo === void 0 ? void 0 : collectionInfo.public_metadata) === null || _c === void 0 ? void 0 : _c['sort-by'];
|
|
1243
|
+
// Prefer the metadata-specified sort if one exists
|
|
1244
|
+
const defaultSortToApply = metadataSort !== null && metadataSort !== void 0 ? metadataSort : baseDefaultSort;
|
|
1245
|
+
// Account for both -field and field:dir formats
|
|
1246
|
+
let [field, dir] = defaultSortToApply.split(':');
|
|
1247
|
+
if (field.startsWith('-')) {
|
|
1248
|
+
field = field.slice(1);
|
|
1249
|
+
dir = 'desc';
|
|
1250
|
+
}
|
|
1251
|
+
else if (!['asc', 'desc'].includes(dir)) {
|
|
1252
|
+
dir = 'asc';
|
|
1253
|
+
}
|
|
1254
|
+
const sortOption = sortOptionFromAPIString(field);
|
|
1255
|
+
const sortField = sortOption.field;
|
|
1256
|
+
if (sortField && sortField !== SortField.default) {
|
|
1257
|
+
this.defaultSortField = sortField;
|
|
1258
|
+
this.defaultSortDirection = dir;
|
|
1259
|
+
this.defaultSortParam = {
|
|
1260
|
+
field: this.defaultSortField,
|
|
1261
|
+
direction: this.defaultSortDirection,
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Applies the default sort option for the current profile element
|
|
1267
|
+
*/
|
|
1268
|
+
applyDefaultProfileSort() {
|
|
1269
|
+
if (this.profileElement) {
|
|
1270
|
+
const defaultSortField = defaultProfileElementSorts[this.profileElement];
|
|
1271
|
+
this.defaultSortField = defaultSortField !== null && defaultSortField !== void 0 ? defaultSortField : SortField.weeklyview;
|
|
1272
|
+
}
|
|
1273
|
+
else {
|
|
1274
|
+
this.defaultSortField = SortField.weeklyview;
|
|
1275
|
+
}
|
|
1276
|
+
this.defaultSortDirection = 'desc';
|
|
1277
|
+
this.defaultSortParam = {
|
|
1278
|
+
field: this.defaultSortField,
|
|
1279
|
+
direction: this.defaultSortDirection,
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* This is useful for determining whether we need to reload the scroller.
|
|
1284
|
+
*
|
|
1285
|
+
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
1286
|
+
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
1287
|
+
*/
|
|
1288
|
+
get currentVisiblePageNumbers() {
|
|
1289
|
+
var _a, _b;
|
|
1290
|
+
const visibleCells = (_b = (_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.getVisibleCellIndices()) !== null && _b !== void 0 ? _b : [];
|
|
1291
|
+
const visiblePages = new Set();
|
|
1292
|
+
visibleCells.forEach(cellIndex => {
|
|
1293
|
+
const visiblePage = Math.floor(cellIndex / this.pageSize) + 1;
|
|
1294
|
+
visiblePages.add(visiblePage);
|
|
1295
|
+
});
|
|
1296
|
+
return Array.from(visiblePages);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Refreshes all visible result cells in the infinite scroller.
|
|
1300
|
+
*/
|
|
1301
|
+
refreshVisibleResults() {
|
|
1302
|
+
var _a;
|
|
1303
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshAllVisibleCells();
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Callback when a result is selected
|
|
1307
|
+
*/
|
|
1308
|
+
resultSelected(event) {
|
|
1309
|
+
var _a, _b, _c;
|
|
1310
|
+
if (this.isManageView) {
|
|
1311
|
+
// Checked/unchecked state change -- rerender to ensure it propagates
|
|
1312
|
+
// this.mapDataSource(model => ({ ...model }));
|
|
1313
|
+
const cellIndex = this.dataSource.indexOf(event.detail);
|
|
1314
|
+
if (cellIndex >= 0)
|
|
1315
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshCell(cellIndex);
|
|
1316
|
+
}
|
|
1317
|
+
(_b = this.analyticsHandler) === null || _b === void 0 ? void 0 : _b.sendEvent({
|
|
1318
|
+
category: this.searchContext,
|
|
1319
|
+
action: analyticsActions.resultSelected,
|
|
1320
|
+
label: event.detail.mediatype,
|
|
1321
|
+
});
|
|
1322
|
+
(_c = this.analyticsHandler) === null || _c === void 0 ? void 0 : _c.sendEvent({
|
|
1323
|
+
category: this.searchContext,
|
|
1324
|
+
action: analyticsActions.resultSelected,
|
|
1325
|
+
label: `page-${this.currentPage}`,
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
cellForIndex(index) {
|
|
1329
|
+
const model = this.tileModelAtCellIndex(index);
|
|
1330
|
+
if (!model)
|
|
1331
|
+
return undefined;
|
|
1349
1332
|
return html `
|
|
1350
1333
|
<tile-dispatcher
|
|
1351
1334
|
.collectionPagePath=${this.collectionPagePath}
|
|
@@ -1357,7 +1340,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1357
1340
|
.collectionTitles=${this.dataSource.collectionTitles}
|
|
1358
1341
|
.sortParam=${this.sortParam}
|
|
1359
1342
|
.defaultSortParam=${this.defaultSortParam}
|
|
1360
|
-
.creatorFilter=${
|
|
1343
|
+
.creatorFilter=${this.selectedCreatorFilter}
|
|
1361
1344
|
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
1362
1345
|
.loggedIn=${this.loggedIn}
|
|
1363
1346
|
.isManageView=${this.isManageView}
|
|
@@ -1365,22 +1348,21 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1365
1348
|
@resultSelected=${(e) => this.resultSelected(e)}
|
|
1366
1349
|
>
|
|
1367
1350
|
</tile-dispatcher>
|
|
1368
|
-
`;
|
|
1369
|
-
}
|
|
1370
|
-
/**
|
|
1371
|
-
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
1372
|
-
* increase the number of pages to render and start fetching data for the new page
|
|
1373
|
-
*/
|
|
1374
|
-
scrollThresholdReached() {
|
|
1375
|
-
if (!this.endOfDataReached) {
|
|
1376
|
-
this.pagesToRender += 1;
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
srOnlyStyle,
|
|
1351
|
+
`;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
1355
|
+
* increase the number of pages to render and start fetching data for the new page
|
|
1356
|
+
*/
|
|
1357
|
+
scrollThresholdReached() {
|
|
1358
|
+
if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {
|
|
1359
|
+
this.pagesToRender += 1;
|
|
1360
|
+
this.dataSource.fetchPage(this.pagesToRender);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
static get styles() {
|
|
1364
|
+
return [
|
|
1365
|
+
srOnlyStyle,
|
|
1384
1366
|
css `
|
|
1385
1367
|
:host {
|
|
1386
1368
|
display: block;
|
|
@@ -1696,9 +1678,9 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1696
1678
|
--collectionBrowserCellMinWidth,
|
|
1697
1679
|
100%
|
|
1698
1680
|
);
|
|
1699
|
-
--infiniteScrollerCellMinHeight:
|
|
1681
|
+
--infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
|
|
1700
1682
|
--infiniteScrollerCellMaxHeight: 56px;
|
|
1701
|
-
--infiniteScrollerRowGap:
|
|
1683
|
+
--infiniteScrollerRowGap: 10px;
|
|
1702
1684
|
}
|
|
1703
1685
|
|
|
1704
1686
|
infinite-scroller.list-detail {
|
|
@@ -1755,177 +1737,174 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1755
1737
|
infinite-scroller.hidden {
|
|
1756
1738
|
display: none;
|
|
1757
1739
|
}
|
|
1758
|
-
`,
|
|
1759
|
-
];
|
|
1760
|
-
}
|
|
1761
|
-
};
|
|
1762
|
-
__decorate([
|
|
1763
|
-
property({ type: String })
|
|
1764
|
-
], CollectionBrowser.prototype, "baseNavigationUrl", void 0);
|
|
1765
|
-
__decorate([
|
|
1766
|
-
property({ type: String })
|
|
1767
|
-
], CollectionBrowser.prototype, "baseImageUrl", void 0);
|
|
1768
|
-
__decorate([
|
|
1769
|
-
property({ type: Object })
|
|
1770
|
-
], CollectionBrowser.prototype, "searchService", void 0);
|
|
1771
|
-
__decorate([
|
|
1772
|
-
property({ type: String })
|
|
1773
|
-
], CollectionBrowser.prototype, "searchType", void 0);
|
|
1774
|
-
__decorate([
|
|
1775
|
-
property({ type: String })
|
|
1776
|
-
], CollectionBrowser.prototype, "withinCollection", void 0);
|
|
1777
|
-
__decorate([
|
|
1778
|
-
property({ type: String })
|
|
1779
|
-
], CollectionBrowser.prototype, "withinProfile", void 0);
|
|
1780
|
-
__decorate([
|
|
1781
|
-
property({ type: String })
|
|
1782
|
-
], CollectionBrowser.prototype, "profileElement", void 0);
|
|
1783
|
-
__decorate([
|
|
1784
|
-
property({ type: String })
|
|
1785
|
-
], CollectionBrowser.prototype, "baseQuery", void 0);
|
|
1786
|
-
__decorate([
|
|
1787
|
-
property({ type: String })
|
|
1788
|
-
], CollectionBrowser.prototype, "displayMode", void 0);
|
|
1789
|
-
__decorate([
|
|
1790
|
-
property({ type: Object })
|
|
1791
|
-
], CollectionBrowser.prototype, "defaultSortParam", void 0);
|
|
1792
|
-
__decorate([
|
|
1793
|
-
property({ type: String })
|
|
1794
|
-
], CollectionBrowser.prototype, "selectedSort", void 0);
|
|
1795
|
-
__decorate([
|
|
1796
|
-
property({ type: String })
|
|
1797
|
-
], CollectionBrowser.prototype, "selectedTitleFilter", void 0);
|
|
1798
|
-
__decorate([
|
|
1799
|
-
property({ type: String })
|
|
1800
|
-
], CollectionBrowser.prototype, "selectedCreatorFilter", void 0);
|
|
1801
|
-
__decorate([
|
|
1802
|
-
property({ type: String })
|
|
1803
|
-
], CollectionBrowser.prototype, "sortDirection", void 0);
|
|
1804
|
-
__decorate([
|
|
1805
|
-
property({ type: Number })
|
|
1806
|
-
], CollectionBrowser.prototype, "pageSize", void 0);
|
|
1807
|
-
__decorate([
|
|
1808
|
-
property({ type: Number })
|
|
1809
|
-
], CollectionBrowser.prototype, "currentPage", void 0);
|
|
1810
|
-
__decorate([
|
|
1811
|
-
property({ type: String })
|
|
1812
|
-
], CollectionBrowser.prototype, "minSelectedDate", void 0);
|
|
1813
|
-
__decorate([
|
|
1814
|
-
property({ type: String })
|
|
1815
|
-
], CollectionBrowser.prototype, "maxSelectedDate", void 0);
|
|
1816
|
-
__decorate([
|
|
1817
|
-
property({ type: Object })
|
|
1818
|
-
], CollectionBrowser.prototype, "selectedFacets", void 0);
|
|
1819
|
-
__decorate([
|
|
1820
|
-
property({ type: Boolean })
|
|
1821
|
-
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0);
|
|
1822
|
-
__decorate([
|
|
1823
|
-
property({ type: Boolean })
|
|
1824
|
-
], CollectionBrowser.prototype, "suppressPlaceholders", void 0);
|
|
1825
|
-
__decorate([
|
|
1826
|
-
property({ type: Boolean })
|
|
1827
|
-
], CollectionBrowser.prototype, "suppressResultCount", void 0);
|
|
1828
|
-
__decorate([
|
|
1829
|
-
property({ type: Boolean })
|
|
1830
|
-
], CollectionBrowser.prototype, "suppressURLQuery", void 0);
|
|
1831
|
-
__decorate([
|
|
1832
|
-
property({ type: Boolean })
|
|
1833
|
-
], CollectionBrowser.prototype, "suppressFacets", void 0);
|
|
1834
|
-
__decorate([
|
|
1835
|
-
property({ type: Boolean })
|
|
1836
|
-
], CollectionBrowser.prototype, "
|
|
1837
|
-
__decorate([
|
|
1838
|
-
property({ type:
|
|
1839
|
-
], CollectionBrowser.prototype, "
|
|
1840
|
-
__decorate([
|
|
1841
|
-
property({ type: String
|
|
1842
|
-
], CollectionBrowser.prototype, "
|
|
1843
|
-
__decorate([
|
|
1844
|
-
property({ type: String })
|
|
1845
|
-
], CollectionBrowser.prototype, "
|
|
1846
|
-
__decorate([
|
|
1847
|
-
property({ type:
|
|
1848
|
-
], CollectionBrowser.prototype, "
|
|
1849
|
-
__decorate([
|
|
1850
|
-
property({ type:
|
|
1851
|
-
], CollectionBrowser.prototype, "
|
|
1852
|
-
__decorate([
|
|
1853
|
-
property({ type:
|
|
1854
|
-
], CollectionBrowser.prototype, "
|
|
1855
|
-
__decorate([
|
|
1856
|
-
property({ type:
|
|
1857
|
-
], CollectionBrowser.prototype, "
|
|
1858
|
-
__decorate([
|
|
1859
|
-
property({ type: Object })
|
|
1860
|
-
], CollectionBrowser.prototype, "
|
|
1861
|
-
__decorate([
|
|
1862
|
-
property({ type: Object })
|
|
1863
|
-
], CollectionBrowser.prototype, "
|
|
1864
|
-
__decorate([
|
|
1865
|
-
property({ type: Object })
|
|
1866
|
-
], CollectionBrowser.prototype, "
|
|
1867
|
-
__decorate([
|
|
1868
|
-
property({ type:
|
|
1869
|
-
], CollectionBrowser.prototype, "
|
|
1870
|
-
__decorate([
|
|
1871
|
-
property({ type: Boolean })
|
|
1872
|
-
], CollectionBrowser.prototype, "
|
|
1873
|
-
__decorate([
|
|
1874
|
-
property({ type:
|
|
1875
|
-
], CollectionBrowser.prototype, "
|
|
1876
|
-
__decorate([
|
|
1877
|
-
property({ type: Object })
|
|
1878
|
-
], CollectionBrowser.prototype, "dataSource", void 0);
|
|
1879
|
-
__decorate([
|
|
1880
|
-
state()
|
|
1881
|
-
], CollectionBrowser.prototype, "pagesToRender", void 0);
|
|
1882
|
-
__decorate([
|
|
1883
|
-
state()
|
|
1884
|
-
], CollectionBrowser.prototype, "searchResultsLoading", void 0);
|
|
1885
|
-
__decorate([
|
|
1886
|
-
state()
|
|
1887
|
-
], CollectionBrowser.prototype, "facetsLoading", void 0);
|
|
1888
|
-
__decorate([
|
|
1889
|
-
state()
|
|
1890
|
-
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
1891
|
-
__decorate([
|
|
1892
|
-
state()
|
|
1893
|
-
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
1894
|
-
__decorate([
|
|
1895
|
-
state()
|
|
1896
|
-
], CollectionBrowser.prototype, "mobileFacetsVisible", void 0);
|
|
1897
|
-
__decorate([
|
|
1898
|
-
state()
|
|
1899
|
-
], CollectionBrowser.prototype, "contentWidth", void 0);
|
|
1900
|
-
__decorate([
|
|
1901
|
-
state()
|
|
1902
|
-
], CollectionBrowser.prototype, "defaultSortField", void 0);
|
|
1903
|
-
__decorate([
|
|
1904
|
-
state()
|
|
1905
|
-
], CollectionBrowser.prototype, "defaultSortDirection", void 0);
|
|
1906
|
-
__decorate([
|
|
1907
|
-
state()
|
|
1908
|
-
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
1909
|
-
__decorate([
|
|
1910
|
-
|
|
1911
|
-
], CollectionBrowser.prototype, "
|
|
1912
|
-
__decorate([
|
|
1913
|
-
query('#
|
|
1914
|
-
], CollectionBrowser.prototype, "
|
|
1915
|
-
__decorate([
|
|
1916
|
-
query('
|
|
1917
|
-
], CollectionBrowser.prototype, "
|
|
1918
|
-
__decorate([
|
|
1919
|
-
|
|
1920
|
-
], CollectionBrowser.prototype, "
|
|
1921
|
-
__decorate([
|
|
1922
|
-
|
|
1923
|
-
], CollectionBrowser.prototype, "
|
|
1924
|
-
__decorate([
|
|
1925
|
-
|
|
1926
|
-
], CollectionBrowser
|
|
1927
|
-
CollectionBrowser
|
|
1928
|
-
customElement('collection-browser')
|
|
1929
|
-
], CollectionBrowser);
|
|
1930
|
-
export { CollectionBrowser };
|
|
1740
|
+
`,
|
|
1741
|
+
];
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
__decorate([
|
|
1745
|
+
property({ type: String })
|
|
1746
|
+
], CollectionBrowser.prototype, "baseNavigationUrl", void 0);
|
|
1747
|
+
__decorate([
|
|
1748
|
+
property({ type: String })
|
|
1749
|
+
], CollectionBrowser.prototype, "baseImageUrl", void 0);
|
|
1750
|
+
__decorate([
|
|
1751
|
+
property({ type: Object })
|
|
1752
|
+
], CollectionBrowser.prototype, "searchService", void 0);
|
|
1753
|
+
__decorate([
|
|
1754
|
+
property({ type: String })
|
|
1755
|
+
], CollectionBrowser.prototype, "searchType", void 0);
|
|
1756
|
+
__decorate([
|
|
1757
|
+
property({ type: String })
|
|
1758
|
+
], CollectionBrowser.prototype, "withinCollection", void 0);
|
|
1759
|
+
__decorate([
|
|
1760
|
+
property({ type: String })
|
|
1761
|
+
], CollectionBrowser.prototype, "withinProfile", void 0);
|
|
1762
|
+
__decorate([
|
|
1763
|
+
property({ type: String })
|
|
1764
|
+
], CollectionBrowser.prototype, "profileElement", void 0);
|
|
1765
|
+
__decorate([
|
|
1766
|
+
property({ type: String })
|
|
1767
|
+
], CollectionBrowser.prototype, "baseQuery", void 0);
|
|
1768
|
+
__decorate([
|
|
1769
|
+
property({ type: String })
|
|
1770
|
+
], CollectionBrowser.prototype, "displayMode", void 0);
|
|
1771
|
+
__decorate([
|
|
1772
|
+
property({ type: Object })
|
|
1773
|
+
], CollectionBrowser.prototype, "defaultSortParam", void 0);
|
|
1774
|
+
__decorate([
|
|
1775
|
+
property({ type: String })
|
|
1776
|
+
], CollectionBrowser.prototype, "selectedSort", void 0);
|
|
1777
|
+
__decorate([
|
|
1778
|
+
property({ type: String })
|
|
1779
|
+
], CollectionBrowser.prototype, "selectedTitleFilter", void 0);
|
|
1780
|
+
__decorate([
|
|
1781
|
+
property({ type: String })
|
|
1782
|
+
], CollectionBrowser.prototype, "selectedCreatorFilter", void 0);
|
|
1783
|
+
__decorate([
|
|
1784
|
+
property({ type: String })
|
|
1785
|
+
], CollectionBrowser.prototype, "sortDirection", void 0);
|
|
1786
|
+
__decorate([
|
|
1787
|
+
property({ type: Number })
|
|
1788
|
+
], CollectionBrowser.prototype, "pageSize", void 0);
|
|
1789
|
+
__decorate([
|
|
1790
|
+
property({ type: Number })
|
|
1791
|
+
], CollectionBrowser.prototype, "currentPage", void 0);
|
|
1792
|
+
__decorate([
|
|
1793
|
+
property({ type: String })
|
|
1794
|
+
], CollectionBrowser.prototype, "minSelectedDate", void 0);
|
|
1795
|
+
__decorate([
|
|
1796
|
+
property({ type: String })
|
|
1797
|
+
], CollectionBrowser.prototype, "maxSelectedDate", void 0);
|
|
1798
|
+
__decorate([
|
|
1799
|
+
property({ type: Object })
|
|
1800
|
+
], CollectionBrowser.prototype, "selectedFacets", void 0);
|
|
1801
|
+
__decorate([
|
|
1802
|
+
property({ type: Boolean })
|
|
1803
|
+
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0);
|
|
1804
|
+
__decorate([
|
|
1805
|
+
property({ type: Boolean })
|
|
1806
|
+
], CollectionBrowser.prototype, "suppressPlaceholders", void 0);
|
|
1807
|
+
__decorate([
|
|
1808
|
+
property({ type: Boolean })
|
|
1809
|
+
], CollectionBrowser.prototype, "suppressResultCount", void 0);
|
|
1810
|
+
__decorate([
|
|
1811
|
+
property({ type: Boolean })
|
|
1812
|
+
], CollectionBrowser.prototype, "suppressURLQuery", void 0);
|
|
1813
|
+
__decorate([
|
|
1814
|
+
property({ type: Boolean })
|
|
1815
|
+
], CollectionBrowser.prototype, "suppressFacets", void 0);
|
|
1816
|
+
__decorate([
|
|
1817
|
+
property({ type: Boolean })
|
|
1818
|
+
], CollectionBrowser.prototype, "suppressSortBar", void 0);
|
|
1819
|
+
__decorate([
|
|
1820
|
+
property({ type: Boolean })
|
|
1821
|
+
], CollectionBrowser.prototype, "clearResultsOnEmptyQuery", void 0);
|
|
1822
|
+
__decorate([
|
|
1823
|
+
property({ type: String })
|
|
1824
|
+
], CollectionBrowser.prototype, "collectionPagePath", void 0);
|
|
1825
|
+
__decorate([
|
|
1826
|
+
property({ type: String, reflect: true })
|
|
1827
|
+
], CollectionBrowser.prototype, "searchContext", void 0);
|
|
1828
|
+
__decorate([
|
|
1829
|
+
property({ type: String })
|
|
1830
|
+
], CollectionBrowser.prototype, "pageContext", void 0);
|
|
1831
|
+
__decorate([
|
|
1832
|
+
property({ type: Object })
|
|
1833
|
+
], CollectionBrowser.prototype, "restorationStateHandler", void 0);
|
|
1834
|
+
__decorate([
|
|
1835
|
+
property({ type: Number })
|
|
1836
|
+
], CollectionBrowser.prototype, "mobileBreakpoint", void 0);
|
|
1837
|
+
__decorate([
|
|
1838
|
+
property({ type: Boolean })
|
|
1839
|
+
], CollectionBrowser.prototype, "loggedIn", void 0);
|
|
1840
|
+
__decorate([
|
|
1841
|
+
property({ type: Object })
|
|
1842
|
+
], CollectionBrowser.prototype, "resizeObserver", void 0);
|
|
1843
|
+
__decorate([
|
|
1844
|
+
property({ type: Object })
|
|
1845
|
+
], CollectionBrowser.prototype, "modalManager", void 0);
|
|
1846
|
+
__decorate([
|
|
1847
|
+
property({ type: Object })
|
|
1848
|
+
], CollectionBrowser.prototype, "featureFeedbackService", void 0);
|
|
1849
|
+
__decorate([
|
|
1850
|
+
property({ type: Object })
|
|
1851
|
+
], CollectionBrowser.prototype, "recaptchaManager", void 0);
|
|
1852
|
+
__decorate([
|
|
1853
|
+
property({ type: Boolean })
|
|
1854
|
+
], CollectionBrowser.prototype, "isManageView", void 0);
|
|
1855
|
+
__decorate([
|
|
1856
|
+
property({ type: Boolean })
|
|
1857
|
+
], CollectionBrowser.prototype, "isLoansTab", void 0);
|
|
1858
|
+
__decorate([
|
|
1859
|
+
property({ type: Object })
|
|
1860
|
+
], CollectionBrowser.prototype, "dataSource", void 0);
|
|
1861
|
+
__decorate([
|
|
1862
|
+
state()
|
|
1863
|
+
], CollectionBrowser.prototype, "pagesToRender", void 0);
|
|
1864
|
+
__decorate([
|
|
1865
|
+
state()
|
|
1866
|
+
], CollectionBrowser.prototype, "searchResultsLoading", void 0);
|
|
1867
|
+
__decorate([
|
|
1868
|
+
state()
|
|
1869
|
+
], CollectionBrowser.prototype, "facetsLoading", void 0);
|
|
1870
|
+
__decorate([
|
|
1871
|
+
state()
|
|
1872
|
+
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
1873
|
+
__decorate([
|
|
1874
|
+
state()
|
|
1875
|
+
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
1876
|
+
__decorate([
|
|
1877
|
+
state()
|
|
1878
|
+
], CollectionBrowser.prototype, "mobileFacetsVisible", void 0);
|
|
1879
|
+
__decorate([
|
|
1880
|
+
state()
|
|
1881
|
+
], CollectionBrowser.prototype, "contentWidth", void 0);
|
|
1882
|
+
__decorate([
|
|
1883
|
+
state()
|
|
1884
|
+
], CollectionBrowser.prototype, "defaultSortField", void 0);
|
|
1885
|
+
__decorate([
|
|
1886
|
+
state()
|
|
1887
|
+
], CollectionBrowser.prototype, "defaultSortDirection", void 0);
|
|
1888
|
+
__decorate([
|
|
1889
|
+
state()
|
|
1890
|
+
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
1891
|
+
__decorate([
|
|
1892
|
+
query('#content-container')
|
|
1893
|
+
], CollectionBrowser.prototype, "contentContainer", void 0);
|
|
1894
|
+
__decorate([
|
|
1895
|
+
query('#left-column')
|
|
1896
|
+
], CollectionBrowser.prototype, "leftColumn", void 0);
|
|
1897
|
+
__decorate([
|
|
1898
|
+
query('collection-facets')
|
|
1899
|
+
], CollectionBrowser.prototype, "collectionFacets", void 0);
|
|
1900
|
+
__decorate([
|
|
1901
|
+
property({ type: Object, attribute: false })
|
|
1902
|
+
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|
|
1903
|
+
__decorate([
|
|
1904
|
+
query('infinite-scroller')
|
|
1905
|
+
], CollectionBrowser.prototype, "infiniteScroller", void 0);
|
|
1906
|
+
CollectionBrowser = __decorate([
|
|
1907
|
+
customElement('collection-browser')
|
|
1908
|
+
], CollectionBrowser);
|
|
1909
|
+
export { CollectionBrowser };
|
|
1931
1910
|
//# sourceMappingURL=collection-browser.js.map
|