@internetarchive/collection-browser 1.8.0 → 1.9.0-alpha2
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/.github/workflows/ci.yml +26 -26
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +54 -54
- package/dist/src/app-root.js +293 -293
- 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/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 +469 -469
- package/dist/src/collection-browser.js +1677 -1653
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facets-template.d.ts +20 -20
- package/dist/src/collection-facets/facets-template.js +152 -152
- package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
- package/dist/src/collection-facets/more-facets-content.js +359 -359
- 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 +99 -99
- package/dist/src/collection-facets.js +471 -471
- package/dist/src/empty-placeholder.d.ts +21 -21
- package/dist/src/empty-placeholder.js +69 -69
- 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/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +85 -85
- package/dist/src/models.d.ts +162 -149
- package/dist/src/models.js +256 -195
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +70 -63
- package/dist/src/restoration-state-handler.js +355 -326
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar.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 +201 -199
- package/dist/src/sort-filter-bar/sort-filter-bar.js +622 -617
- 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 +18 -18
- package/dist/src/tiles/base-tile-component.js +59 -59
- 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 +27 -27
- package/dist/src/tiles/grid/item-tile.js +134 -134
- 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 +48 -48
- 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 +72 -72
- package/dist/src/tiles/item-image.d.ts +35 -35
- package/dist/src/tiles/item-image.js +117 -117
- 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 +114 -114
- package/dist/src/tiles/list/tile-list.d.ts +46 -46
- package/dist/src/tiles/list/tile-list.js +298 -298
- 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 +50 -50
- package/dist/src/tiles/tile-dispatcher.js +185 -185
- package/dist/src/tiles/tile-display-value-provider.d.ts +43 -43
- package/dist/src/tiles/tile-display-value-provider.js +80 -80
- package/dist/src/utils/analytics-events.d.ts +24 -24
- package/dist/src/utils/analytics-events.js +26 -26
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- 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/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 +808 -808
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +134 -134
- 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-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 +645 -645
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +56 -56
- 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 +84 -84
- 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-collection-name-cache.d.ts +9 -9
- package/dist/test/mocks/mock-collection-name-cache.js +17 -17
- package/dist/test/mocks/mock-search-responses.d.ts +19 -19
- package/dist/test/mocks/mock-search-responses.js +623 -623
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +48 -48
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -218
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.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 +378 -378
- 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 +33 -33
- 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 +254 -254
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +257 -257
- 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 +242 -242
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +67 -67
- 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/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +1 -1
- package/renovate.json +6 -6
- package/src/collection-browser.ts +42 -8
- package/src/models.ts +193 -109
- package/src/restoration-state-handler.ts +66 -40
- package/src/sort-filter-bar/sort-filter-bar.ts +34 -27
- package/test/restoration-state-handler.test.ts +68 -1
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/* eslint-disable import/no-duplicates */
|
|
3
|
-
import { css, html, LitElement, nothing, } from 'lit';
|
|
4
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
|
-
import { map } from 'lit/directives/map.js';
|
|
6
|
-
import { ref } from 'lit/directives/ref.js';
|
|
7
|
-
import '@internetarchive/histogram-date-range';
|
|
8
|
-
import '@internetarchive/feature-feedback';
|
|
9
|
-
import '@internetarchive/collection-name-cache';
|
|
10
|
-
import { ModalConfig, } from '@internetarchive/modal-manager';
|
|
11
|
-
import chevronIcon from './assets/img/icons/chevron';
|
|
12
|
-
import expandIcon from './assets/img/icons/expand';
|
|
13
|
-
import { facetDisplayOrder, facetTitles, lendingFacetDisplayNames, lendingFacetKeysVisibility, suppressedCollections, defaultFacetSort, } from './models';
|
|
14
|
-
import './collection-facets/more-facets-content';
|
|
15
|
-
import './collection-facets/facets-template';
|
|
16
|
-
import './collection-facets/facet-tombstone-row';
|
|
17
|
-
import './expanded-date-picker';
|
|
18
|
-
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
19
|
-
import { srOnlyStyle } from './styles/sr-only';
|
|
20
|
-
import { ExpandedDatePicker } from './expanded-date-picker';
|
|
21
|
-
let CollectionFacets = class CollectionFacets extends LitElement {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
this.moreLinksVisible = true;
|
|
25
|
-
this.facetsLoading = false;
|
|
26
|
-
this.fullYearAggregationLoading = false;
|
|
27
|
-
this.collapsableFacets = false;
|
|
28
|
-
this.showHistogramDatePicker = false;
|
|
29
|
-
this.allowExpandingDatePicker = false;
|
|
30
|
-
this.collectionPagePath = '/details/';
|
|
31
|
-
this.openFacets = {
|
|
32
|
-
subject: false,
|
|
33
|
-
lending: false,
|
|
34
|
-
mediatype: false,
|
|
35
|
-
language: false,
|
|
36
|
-
creator: false,
|
|
37
|
-
collection: false,
|
|
38
|
-
year: false,
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Maximum # of facet buckets to render per facet group
|
|
42
|
-
*/
|
|
43
|
-
this.allowedFacetCount = 6;
|
|
44
|
-
this.handleExpandedDatePickerClosed = () => {
|
|
45
|
-
var _a;
|
|
46
|
-
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.remove('expanded-date-picker');
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Dispatches a `histogramDateRangeUpdated` event with the date range copied from the
|
|
50
|
-
* input event.
|
|
51
|
-
*
|
|
52
|
-
* Arrow function to ensure `this` is always bound to the current component.
|
|
53
|
-
*/
|
|
54
|
-
this.histogramDateRangeUpdated = (e) => {
|
|
55
|
-
const { minDate, maxDate } = e.detail;
|
|
56
|
-
const event = new CustomEvent('histogramDateRangeUpdated', {
|
|
57
|
-
detail: { minDate, maxDate },
|
|
58
|
-
});
|
|
59
|
-
this.dispatchEvent(event);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
render() {
|
|
63
|
-
const datePickerLabelId = 'date-picker-label';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable import/no-duplicates */
|
|
3
|
+
import { css, html, LitElement, nothing, } from 'lit';
|
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
|
+
import { map } from 'lit/directives/map.js';
|
|
6
|
+
import { ref } from 'lit/directives/ref.js';
|
|
7
|
+
import '@internetarchive/histogram-date-range';
|
|
8
|
+
import '@internetarchive/feature-feedback';
|
|
9
|
+
import '@internetarchive/collection-name-cache';
|
|
10
|
+
import { ModalConfig, } from '@internetarchive/modal-manager';
|
|
11
|
+
import chevronIcon from './assets/img/icons/chevron';
|
|
12
|
+
import expandIcon from './assets/img/icons/expand';
|
|
13
|
+
import { facetDisplayOrder, facetTitles, lendingFacetDisplayNames, lendingFacetKeysVisibility, suppressedCollections, defaultFacetSort, } from './models';
|
|
14
|
+
import './collection-facets/more-facets-content';
|
|
15
|
+
import './collection-facets/facets-template';
|
|
16
|
+
import './collection-facets/facet-tombstone-row';
|
|
17
|
+
import './expanded-date-picker';
|
|
18
|
+
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
19
|
+
import { srOnlyStyle } from './styles/sr-only';
|
|
20
|
+
import { ExpandedDatePicker } from './expanded-date-picker';
|
|
21
|
+
let CollectionFacets = class CollectionFacets extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.moreLinksVisible = true;
|
|
25
|
+
this.facetsLoading = false;
|
|
26
|
+
this.fullYearAggregationLoading = false;
|
|
27
|
+
this.collapsableFacets = false;
|
|
28
|
+
this.showHistogramDatePicker = false;
|
|
29
|
+
this.allowExpandingDatePicker = false;
|
|
30
|
+
this.collectionPagePath = '/details/';
|
|
31
|
+
this.openFacets = {
|
|
32
|
+
subject: false,
|
|
33
|
+
lending: false,
|
|
34
|
+
mediatype: false,
|
|
35
|
+
language: false,
|
|
36
|
+
creator: false,
|
|
37
|
+
collection: false,
|
|
38
|
+
year: false,
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Maximum # of facet buckets to render per facet group
|
|
42
|
+
*/
|
|
43
|
+
this.allowedFacetCount = 6;
|
|
44
|
+
this.handleExpandedDatePickerClosed = () => {
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.remove('expanded-date-picker');
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Dispatches a `histogramDateRangeUpdated` event with the date range copied from the
|
|
50
|
+
* input event.
|
|
51
|
+
*
|
|
52
|
+
* Arrow function to ensure `this` is always bound to the current component.
|
|
53
|
+
*/
|
|
54
|
+
this.histogramDateRangeUpdated = (e) => {
|
|
55
|
+
const { minDate, maxDate } = e.detail;
|
|
56
|
+
const event = new CustomEvent('histogramDateRangeUpdated', {
|
|
57
|
+
detail: { minDate, maxDate },
|
|
58
|
+
});
|
|
59
|
+
this.dispatchEvent(event);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
const datePickerLabelId = 'date-picker-label';
|
|
64
64
|
return html `
|
|
65
65
|
<div id="container" class="${this.facetsLoading ? 'loading' : ''}">
|
|
66
|
-
${this.showHistogramDatePicker &&
|
|
67
|
-
(this.fullYearsHistogramAggregation || this.fullYearAggregationLoading)
|
|
66
|
+
${this.showHistogramDatePicker &&
|
|
67
|
+
(this.fullYearsHistogramAggregation || this.fullYearAggregationLoading)
|
|
68
68
|
? html `
|
|
69
69
|
<section class="facet-group" aria-labelledby=${datePickerLabelId}>
|
|
70
70
|
<h3 id=${datePickerLabelId}>
|
|
@@ -73,36 +73,36 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
73
73
|
</h3>
|
|
74
74
|
${this.histogramTemplate}
|
|
75
75
|
</section>
|
|
76
|
-
`
|
|
76
|
+
`
|
|
77
77
|
: nothing}
|
|
78
78
|
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
79
79
|
</div>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Opens a modal dialog containing an enlarged version of the date picker.
|
|
84
|
-
*/
|
|
85
|
-
showDatePickerModal() {
|
|
86
|
-
var _a, _b, _c;
|
|
87
|
-
const { fullYearsHistogramAggregation } = this;
|
|
88
|
-
const minDate = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.first_bucket_key;
|
|
89
|
-
const maxDate = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.last_bucket_key;
|
|
90
|
-
const buckets = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.buckets;
|
|
91
|
-
// Because the modal manager does not clear its DOM content after being closed,
|
|
92
|
-
// it may try to render the exact same date picker template when it is reopened.
|
|
93
|
-
// And because it isn't actually a descendent of this collection-facets component,
|
|
94
|
-
// changes to the template defined here may not trigger a reactive update to the date
|
|
95
|
-
// picker, resulting in it displaying a stale date range.
|
|
96
|
-
// This ref callback ensures that every time the date picker modal is opened, it will
|
|
97
|
-
// always propagate the most recent date range into the date picker regardless of
|
|
98
|
-
// whether Lit thinks the update is necessary.
|
|
99
|
-
const expandedDatePickerChanged = (elmt) => {
|
|
100
|
-
if (elmt && elmt instanceof ExpandedDatePicker) {
|
|
101
|
-
const expandedDatePicker = elmt;
|
|
102
|
-
expandedDatePicker.minSelectedDate = this.minSelectedDate;
|
|
103
|
-
expandedDatePicker.maxSelectedDate = this.maxSelectedDate;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Opens a modal dialog containing an enlarged version of the date picker.
|
|
84
|
+
*/
|
|
85
|
+
showDatePickerModal() {
|
|
86
|
+
var _a, _b, _c;
|
|
87
|
+
const { fullYearsHistogramAggregation } = this;
|
|
88
|
+
const minDate = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.first_bucket_key;
|
|
89
|
+
const maxDate = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.last_bucket_key;
|
|
90
|
+
const buckets = fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.buckets;
|
|
91
|
+
// Because the modal manager does not clear its DOM content after being closed,
|
|
92
|
+
// it may try to render the exact same date picker template when it is reopened.
|
|
93
|
+
// And because it isn't actually a descendent of this collection-facets component,
|
|
94
|
+
// changes to the template defined here may not trigger a reactive update to the date
|
|
95
|
+
// picker, resulting in it displaying a stale date range.
|
|
96
|
+
// This ref callback ensures that every time the date picker modal is opened, it will
|
|
97
|
+
// always propagate the most recent date range into the date picker regardless of
|
|
98
|
+
// whether Lit thinks the update is necessary.
|
|
99
|
+
const expandedDatePickerChanged = (elmt) => {
|
|
100
|
+
if (elmt && elmt instanceof ExpandedDatePicker) {
|
|
101
|
+
const expandedDatePicker = elmt;
|
|
102
|
+
expandedDatePicker.minSelectedDate = this.minSelectedDate;
|
|
103
|
+
expandedDatePicker.maxSelectedDate = this.maxSelectedDate;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
106
|
const customModalContent = html `
|
|
107
107
|
<expanded-date-picker
|
|
108
108
|
${ref(expandedDatePickerChanged)}
|
|
@@ -116,57 +116,57 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
116
116
|
@histogramDateRangeApplied=${this.histogramDateRangeUpdated}
|
|
117
117
|
@modalClosed=${this.handleExpandedDatePickerClosed}
|
|
118
118
|
></expanded-date-picker>
|
|
119
|
-
`;
|
|
120
|
-
const config = new ModalConfig({
|
|
121
|
-
bodyColor: '#fff',
|
|
122
|
-
headerColor: '#194880',
|
|
123
|
-
showHeaderLogo: false,
|
|
124
|
-
closeOnBackdropClick: true,
|
|
125
|
-
title: html `Select a date range`,
|
|
126
|
-
});
|
|
127
|
-
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('expanded-date-picker');
|
|
128
|
-
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
129
|
-
config,
|
|
130
|
-
customModalContent,
|
|
131
|
-
userClosedModalCallback: this.handleExpandedDatePickerClosed,
|
|
132
|
-
});
|
|
133
|
-
(_c = this.analyticsHandler) === null || _c === void 0 ? void 0 : _c.sendEvent({
|
|
134
|
-
category: analyticsCategories.default,
|
|
135
|
-
action: analyticsActions.histogramExpanded,
|
|
136
|
-
label: window.location.href,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
updated(changed) {
|
|
140
|
-
if (changed.has('selectedFacets')) {
|
|
141
|
-
this.dispatchFacetsChangedEvent();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// TODO: want to fire analytics?
|
|
145
|
-
dispatchFacetsChangedEvent() {
|
|
146
|
-
const event = new CustomEvent('facetsChanged', {
|
|
147
|
-
detail: this.selectedFacets,
|
|
148
|
-
});
|
|
149
|
-
this.dispatchEvent(event);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Template for the "Expand" button to show the date picker modal, or
|
|
153
|
-
* `nothing` if that button should currently not be shown.
|
|
154
|
-
*/
|
|
155
|
-
get expandDatePickerBtnTemplate() {
|
|
156
|
-
return this.allowExpandingDatePicker && !this.facetsLoading
|
|
119
|
+
`;
|
|
120
|
+
const config = new ModalConfig({
|
|
121
|
+
bodyColor: '#fff',
|
|
122
|
+
headerColor: '#194880',
|
|
123
|
+
showHeaderLogo: false,
|
|
124
|
+
closeOnBackdropClick: true,
|
|
125
|
+
title: html `Select a date range`,
|
|
126
|
+
});
|
|
127
|
+
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('expanded-date-picker');
|
|
128
|
+
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
129
|
+
config,
|
|
130
|
+
customModalContent,
|
|
131
|
+
userClosedModalCallback: this.handleExpandedDatePickerClosed,
|
|
132
|
+
});
|
|
133
|
+
(_c = this.analyticsHandler) === null || _c === void 0 ? void 0 : _c.sendEvent({
|
|
134
|
+
category: analyticsCategories.default,
|
|
135
|
+
action: analyticsActions.histogramExpanded,
|
|
136
|
+
label: window.location.href,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
updated(changed) {
|
|
140
|
+
if (changed.has('selectedFacets')) {
|
|
141
|
+
this.dispatchFacetsChangedEvent();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// TODO: want to fire analytics?
|
|
145
|
+
dispatchFacetsChangedEvent() {
|
|
146
|
+
const event = new CustomEvent('facetsChanged', {
|
|
147
|
+
detail: this.selectedFacets,
|
|
148
|
+
});
|
|
149
|
+
this.dispatchEvent(event);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Template for the "Expand" button to show the date picker modal, or
|
|
153
|
+
* `nothing` if that button should currently not be shown.
|
|
154
|
+
*/
|
|
155
|
+
get expandDatePickerBtnTemplate() {
|
|
156
|
+
return this.allowExpandingDatePicker && !this.facetsLoading
|
|
157
157
|
? html `<button
|
|
158
158
|
class="expand-date-picker-btn"
|
|
159
159
|
aria-hidden="true"
|
|
160
160
|
@click=${this.showDatePickerModal}
|
|
161
161
|
>
|
|
162
162
|
${expandIcon}
|
|
163
|
-
</button>`
|
|
164
|
-
: nothing;
|
|
165
|
-
}
|
|
166
|
-
get histogramTemplate() {
|
|
167
|
-
const { fullYearsHistogramAggregation } = this;
|
|
168
|
-
return this.fullYearAggregationLoading
|
|
169
|
-
? html `<div class="histogram-loading-indicator">…</div>` // Ellipsis block
|
|
163
|
+
</button>`
|
|
164
|
+
: nothing;
|
|
165
|
+
}
|
|
166
|
+
get histogramTemplate() {
|
|
167
|
+
const { fullYearsHistogramAggregation } = this;
|
|
168
|
+
return this.fullYearAggregationLoading
|
|
169
|
+
? html `<div class="histogram-loading-indicator">…</div>` // Ellipsis block
|
|
170
170
|
: html `
|
|
171
171
|
<histogram-date-range
|
|
172
172
|
.minDate=${fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.first_bucket_key}
|
|
@@ -175,180 +175,180 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
175
175
|
.maxSelectedDate=${this.maxSelectedDate}
|
|
176
176
|
.updateDelay=${100}
|
|
177
177
|
missingDataMessage="..."
|
|
178
|
-
.width=${this.collapsableFacets && this.contentWidth
|
|
179
|
-
? this.contentWidth
|
|
178
|
+
.width=${this.collapsableFacets && this.contentWidth
|
|
179
|
+
? this.contentWidth
|
|
180
180
|
: 180}
|
|
181
181
|
.bins=${fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.buckets}
|
|
182
182
|
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
183
183
|
></histogram-date-range>
|
|
184
|
-
`;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Combines the selected facets with the aggregations to create a single list of facets
|
|
188
|
-
*/
|
|
189
|
-
get mergedFacets() {
|
|
190
|
-
const facetGroups = [];
|
|
191
|
-
facetDisplayOrder.forEach(facetKey => {
|
|
192
|
-
var _a, _b;
|
|
193
|
-
const selectedFacetGroup = this.selectedFacetGroups.find(group => group.key === facetKey);
|
|
194
|
-
const aggregateFacetGroup = this.aggregationFacetGroups.find(group => group.key === facetKey);
|
|
195
|
-
// if the user selected a facet, but it's not in the aggregation, we add it as-is
|
|
196
|
-
if (selectedFacetGroup && !aggregateFacetGroup) {
|
|
197
|
-
facetGroups.push(selectedFacetGroup);
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
// if we don't have an aggregate facet group, don't add this to the list
|
|
201
|
-
if (!aggregateFacetGroup)
|
|
202
|
-
return;
|
|
203
|
-
// start with either the selected group if we have one, or the aggregate group
|
|
204
|
-
const facetGroup = selectedFacetGroup !== null && selectedFacetGroup !== void 0 ? selectedFacetGroup : aggregateFacetGroup;
|
|
205
|
-
// attach the counts to the selected buckets
|
|
206
|
-
let bucketsWithCount = (_a = selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets.map(bucket => {
|
|
207
|
-
const selectedBucket = aggregateFacetGroup.buckets.find(b => b.key === bucket.key);
|
|
208
|
-
return selectedBucket
|
|
209
|
-
? {
|
|
210
|
-
...bucket,
|
|
211
|
-
count: selectedBucket.count,
|
|
212
|
-
}
|
|
213
|
-
: bucket;
|
|
214
|
-
})) !== null && _a !== void 0 ? _a : [];
|
|
215
|
-
// append any additional buckets that were not selected
|
|
216
|
-
aggregateFacetGroup.buckets.forEach(bucket => {
|
|
217
|
-
const existingBucket = bucketsWithCount.find(b => b.key === bucket.key);
|
|
218
|
-
if (existingBucket)
|
|
219
|
-
return;
|
|
220
|
-
bucketsWithCount.push(bucket);
|
|
221
|
-
});
|
|
222
|
-
/**
|
|
223
|
-
* render limited facet items on page facet area
|
|
224
|
-
*
|
|
225
|
-
* - by-default we are showing 6 items
|
|
226
|
-
* - additionally want to show all items (selected/suppressed) in page facet area
|
|
227
|
-
*/
|
|
228
|
-
let allowedFacetCount = (_b = Object.keys((selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets) || [])) === null || _b === void 0 ? void 0 : _b.length;
|
|
229
|
-
if (allowedFacetCount < this.allowedFacetCount) {
|
|
230
|
-
allowedFacetCount = this.allowedFacetCount; // splice start index from 0th
|
|
231
|
-
}
|
|
232
|
-
// For lending facets, only include a specific subset of buckets
|
|
233
|
-
if (facetKey === 'lending') {
|
|
234
|
-
bucketsWithCount = bucketsWithCount.filter(bucket => lendingFacetKeysVisibility[bucket.key]);
|
|
235
|
-
}
|
|
236
|
-
// For mediatype facets, ensure the collection bucket is always shown if present
|
|
237
|
-
if (facetKey === 'mediatype') {
|
|
238
|
-
const collectionIndex = bucketsWithCount.findIndex(bucket => bucket.key === 'collection');
|
|
239
|
-
if (collectionIndex >= allowedFacetCount) {
|
|
240
|
-
const [collectionBucket] = bucketsWithCount.splice(collectionIndex, 1);
|
|
241
|
-
bucketsWithCount.splice(allowedFacetCount - 1, 0, collectionBucket);
|
|
242
|
-
// If we're showing lots of selected facets, ensure we're not cutting off the last one
|
|
243
|
-
if (allowedFacetCount > this.allowedFacetCount)
|
|
244
|
-
allowedFacetCount += 1;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
// splice how many items we want to show in page facet area
|
|
248
|
-
facetGroup.buckets = bucketsWithCount.splice(0, allowedFacetCount);
|
|
249
|
-
facetGroups.push(facetGroup);
|
|
250
|
-
});
|
|
251
|
-
return facetGroups;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Converts the selected facets to a `FacetGroup` array,
|
|
255
|
-
* which is easier to work with
|
|
256
|
-
*/
|
|
257
|
-
get selectedFacetGroups() {
|
|
258
|
-
if (!this.selectedFacets)
|
|
259
|
-
return [];
|
|
260
|
-
const facetGroups = Object.entries(this.selectedFacets).map(([key, selectedFacets]) => {
|
|
261
|
-
const option = key;
|
|
262
|
-
const title = facetTitles[option];
|
|
263
|
-
const buckets = Object.entries(selectedFacets).map(([value, facetData]) => {
|
|
264
|
-
var _a;
|
|
265
|
-
let displayText = value;
|
|
266
|
-
// for lending facets, convert the key to a readable format
|
|
267
|
-
if (option === 'lending') {
|
|
268
|
-
displayText =
|
|
269
|
-
(_a = lendingFacetDisplayNames[value]) !== null && _a !== void 0 ? _a : value;
|
|
270
|
-
}
|
|
271
|
-
return {
|
|
272
|
-
displayText,
|
|
273
|
-
key: value,
|
|
274
|
-
count: facetData.count,
|
|
275
|
-
state: facetData.state,
|
|
276
|
-
};
|
|
277
|
-
});
|
|
278
|
-
return {
|
|
279
|
-
title,
|
|
280
|
-
key: option,
|
|
281
|
-
buckets,
|
|
282
|
-
};
|
|
283
|
-
});
|
|
284
|
-
return facetGroups;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Converts the raw `aggregations` to `FacetGroups`, which are easier to use
|
|
288
|
-
*/
|
|
289
|
-
get aggregationFacetGroups() {
|
|
290
|
-
var _a;
|
|
291
|
-
const facetGroups = [];
|
|
292
|
-
Object.entries((_a = this.aggregations) !== null && _a !== void 0 ? _a : []).forEach(([key, aggregation]) => {
|
|
293
|
-
// the year_histogram data is in a different format so can't be handled here
|
|
294
|
-
if (key === 'year_histogram')
|
|
295
|
-
return;
|
|
296
|
-
const option = key;
|
|
297
|
-
const title = facetTitles[option];
|
|
298
|
-
if (!title)
|
|
299
|
-
return;
|
|
300
|
-
let castedBuckets = aggregation.getSortedBuckets(defaultFacetSort[option]);
|
|
301
|
-
if (option === 'collection') {
|
|
302
|
-
// we are not showing fav- collections or certain deemphasized collections in facets
|
|
303
|
-
castedBuckets = castedBuckets === null || castedBuckets === void 0 ? void 0 : castedBuckets.filter(bucket => {
|
|
304
|
-
var _a;
|
|
305
|
-
const bucketKey = (_a = bucket === null || bucket === void 0 ? void 0 : bucket.key) === null || _a === void 0 ? void 0 : _a.toString();
|
|
306
|
-
return (!suppressedCollections[bucketKey] && !(bucketKey === null || bucketKey === void 0 ? void 0 : bucketKey.startsWith('fav-')));
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
const facetBuckets = castedBuckets.map(bucket => {
|
|
310
|
-
var _a;
|
|
311
|
-
const bucketKey = bucket.key;
|
|
312
|
-
let displayText = `${bucket.key}`;
|
|
313
|
-
// for lending facets, convert the bucket key to a readable format
|
|
314
|
-
if (option === 'lending') {
|
|
315
|
-
displayText =
|
|
316
|
-
(_a = lendingFacetDisplayNames[bucket.key]) !== null && _a !== void 0 ? _a : `${bucket.key}`;
|
|
317
|
-
}
|
|
318
|
-
return {
|
|
319
|
-
displayText,
|
|
320
|
-
key: `${bucketKey}`,
|
|
321
|
-
count: bucket.doc_count,
|
|
322
|
-
state: 'none',
|
|
323
|
-
};
|
|
324
|
-
});
|
|
325
|
-
const group = {
|
|
326
|
-
title,
|
|
327
|
-
key: option,
|
|
328
|
-
buckets: facetBuckets,
|
|
329
|
-
};
|
|
330
|
-
facetGroups.push(group);
|
|
331
|
-
});
|
|
332
|
-
return facetGroups;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Generate the template for a facet group with a header and the collapsible
|
|
336
|
-
* chevron for the mobile view
|
|
337
|
-
*/
|
|
338
|
-
getFacetGroupTemplate(facetGroup) {
|
|
339
|
-
if (!this.facetsLoading && facetGroup.buckets.length === 0)
|
|
340
|
-
return nothing;
|
|
341
|
-
const { key } = facetGroup;
|
|
342
|
-
const isOpen = this.openFacets[key];
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Combines the selected facets with the aggregations to create a single list of facets
|
|
188
|
+
*/
|
|
189
|
+
get mergedFacets() {
|
|
190
|
+
const facetGroups = [];
|
|
191
|
+
facetDisplayOrder.forEach(facetKey => {
|
|
192
|
+
var _a, _b;
|
|
193
|
+
const selectedFacetGroup = this.selectedFacetGroups.find(group => group.key === facetKey);
|
|
194
|
+
const aggregateFacetGroup = this.aggregationFacetGroups.find(group => group.key === facetKey);
|
|
195
|
+
// if the user selected a facet, but it's not in the aggregation, we add it as-is
|
|
196
|
+
if (selectedFacetGroup && !aggregateFacetGroup) {
|
|
197
|
+
facetGroups.push(selectedFacetGroup);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
// if we don't have an aggregate facet group, don't add this to the list
|
|
201
|
+
if (!aggregateFacetGroup)
|
|
202
|
+
return;
|
|
203
|
+
// start with either the selected group if we have one, or the aggregate group
|
|
204
|
+
const facetGroup = selectedFacetGroup !== null && selectedFacetGroup !== void 0 ? selectedFacetGroup : aggregateFacetGroup;
|
|
205
|
+
// attach the counts to the selected buckets
|
|
206
|
+
let bucketsWithCount = (_a = selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets.map(bucket => {
|
|
207
|
+
const selectedBucket = aggregateFacetGroup.buckets.find(b => b.key === bucket.key);
|
|
208
|
+
return selectedBucket
|
|
209
|
+
? {
|
|
210
|
+
...bucket,
|
|
211
|
+
count: selectedBucket.count,
|
|
212
|
+
}
|
|
213
|
+
: bucket;
|
|
214
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
215
|
+
// append any additional buckets that were not selected
|
|
216
|
+
aggregateFacetGroup.buckets.forEach(bucket => {
|
|
217
|
+
const existingBucket = bucketsWithCount.find(b => b.key === bucket.key);
|
|
218
|
+
if (existingBucket)
|
|
219
|
+
return;
|
|
220
|
+
bucketsWithCount.push(bucket);
|
|
221
|
+
});
|
|
222
|
+
/**
|
|
223
|
+
* render limited facet items on page facet area
|
|
224
|
+
*
|
|
225
|
+
* - by-default we are showing 6 items
|
|
226
|
+
* - additionally want to show all items (selected/suppressed) in page facet area
|
|
227
|
+
*/
|
|
228
|
+
let allowedFacetCount = (_b = Object.keys((selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets) || [])) === null || _b === void 0 ? void 0 : _b.length;
|
|
229
|
+
if (allowedFacetCount < this.allowedFacetCount) {
|
|
230
|
+
allowedFacetCount = this.allowedFacetCount; // splice start index from 0th
|
|
231
|
+
}
|
|
232
|
+
// For lending facets, only include a specific subset of buckets
|
|
233
|
+
if (facetKey === 'lending') {
|
|
234
|
+
bucketsWithCount = bucketsWithCount.filter(bucket => lendingFacetKeysVisibility[bucket.key]);
|
|
235
|
+
}
|
|
236
|
+
// For mediatype facets, ensure the collection bucket is always shown if present
|
|
237
|
+
if (facetKey === 'mediatype') {
|
|
238
|
+
const collectionIndex = bucketsWithCount.findIndex(bucket => bucket.key === 'collection');
|
|
239
|
+
if (collectionIndex >= allowedFacetCount) {
|
|
240
|
+
const [collectionBucket] = bucketsWithCount.splice(collectionIndex, 1);
|
|
241
|
+
bucketsWithCount.splice(allowedFacetCount - 1, 0, collectionBucket);
|
|
242
|
+
// If we're showing lots of selected facets, ensure we're not cutting off the last one
|
|
243
|
+
if (allowedFacetCount > this.allowedFacetCount)
|
|
244
|
+
allowedFacetCount += 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// splice how many items we want to show in page facet area
|
|
248
|
+
facetGroup.buckets = bucketsWithCount.splice(0, allowedFacetCount);
|
|
249
|
+
facetGroups.push(facetGroup);
|
|
250
|
+
});
|
|
251
|
+
return facetGroups;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Converts the selected facets to a `FacetGroup` array,
|
|
255
|
+
* which is easier to work with
|
|
256
|
+
*/
|
|
257
|
+
get selectedFacetGroups() {
|
|
258
|
+
if (!this.selectedFacets)
|
|
259
|
+
return [];
|
|
260
|
+
const facetGroups = Object.entries(this.selectedFacets).map(([key, selectedFacets]) => {
|
|
261
|
+
const option = key;
|
|
262
|
+
const title = facetTitles[option];
|
|
263
|
+
const buckets = Object.entries(selectedFacets).map(([value, facetData]) => {
|
|
264
|
+
var _a;
|
|
265
|
+
let displayText = value;
|
|
266
|
+
// for lending facets, convert the key to a readable format
|
|
267
|
+
if (option === 'lending') {
|
|
268
|
+
displayText =
|
|
269
|
+
(_a = lendingFacetDisplayNames[value]) !== null && _a !== void 0 ? _a : value;
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
displayText,
|
|
273
|
+
key: value,
|
|
274
|
+
count: facetData.count,
|
|
275
|
+
state: facetData.state,
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
return {
|
|
279
|
+
title,
|
|
280
|
+
key: option,
|
|
281
|
+
buckets,
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
return facetGroups;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Converts the raw `aggregations` to `FacetGroups`, which are easier to use
|
|
288
|
+
*/
|
|
289
|
+
get aggregationFacetGroups() {
|
|
290
|
+
var _a;
|
|
291
|
+
const facetGroups = [];
|
|
292
|
+
Object.entries((_a = this.aggregations) !== null && _a !== void 0 ? _a : []).forEach(([key, aggregation]) => {
|
|
293
|
+
// the year_histogram data is in a different format so can't be handled here
|
|
294
|
+
if (key === 'year_histogram')
|
|
295
|
+
return;
|
|
296
|
+
const option = key;
|
|
297
|
+
const title = facetTitles[option];
|
|
298
|
+
if (!title)
|
|
299
|
+
return;
|
|
300
|
+
let castedBuckets = aggregation.getSortedBuckets(defaultFacetSort[option]);
|
|
301
|
+
if (option === 'collection') {
|
|
302
|
+
// we are not showing fav- collections or certain deemphasized collections in facets
|
|
303
|
+
castedBuckets = castedBuckets === null || castedBuckets === void 0 ? void 0 : castedBuckets.filter(bucket => {
|
|
304
|
+
var _a;
|
|
305
|
+
const bucketKey = (_a = bucket === null || bucket === void 0 ? void 0 : bucket.key) === null || _a === void 0 ? void 0 : _a.toString();
|
|
306
|
+
return (!suppressedCollections[bucketKey] && !(bucketKey === null || bucketKey === void 0 ? void 0 : bucketKey.startsWith('fav-')));
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const facetBuckets = castedBuckets.map(bucket => {
|
|
310
|
+
var _a;
|
|
311
|
+
const bucketKey = bucket.key;
|
|
312
|
+
let displayText = `${bucket.key}`;
|
|
313
|
+
// for lending facets, convert the bucket key to a readable format
|
|
314
|
+
if (option === 'lending') {
|
|
315
|
+
displayText =
|
|
316
|
+
(_a = lendingFacetDisplayNames[bucket.key]) !== null && _a !== void 0 ? _a : `${bucket.key}`;
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
displayText,
|
|
320
|
+
key: `${bucketKey}`,
|
|
321
|
+
count: bucket.doc_count,
|
|
322
|
+
state: 'none',
|
|
323
|
+
};
|
|
324
|
+
});
|
|
325
|
+
const group = {
|
|
326
|
+
title,
|
|
327
|
+
key: option,
|
|
328
|
+
buckets: facetBuckets,
|
|
329
|
+
};
|
|
330
|
+
facetGroups.push(group);
|
|
331
|
+
});
|
|
332
|
+
return facetGroups;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Generate the template for a facet group with a header and the collapsible
|
|
336
|
+
* chevron for the mobile view
|
|
337
|
+
*/
|
|
338
|
+
getFacetGroupTemplate(facetGroup) {
|
|
339
|
+
if (!this.facetsLoading && facetGroup.buckets.length === 0)
|
|
340
|
+
return nothing;
|
|
341
|
+
const { key } = facetGroup;
|
|
342
|
+
const isOpen = this.openFacets[key];
|
|
343
343
|
const collapser = html `
|
|
344
344
|
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
345
|
-
`;
|
|
346
|
-
const toggleCollapsed = () => {
|
|
347
|
-
const newOpenFacets = { ...this.openFacets };
|
|
348
|
-
newOpenFacets[key] = !isOpen;
|
|
349
|
-
this.openFacets = newOpenFacets;
|
|
350
|
-
};
|
|
351
|
-
const headerId = `facet-group-header-label-${facetGroup.key}`;
|
|
345
|
+
`;
|
|
346
|
+
const toggleCollapsed = () => {
|
|
347
|
+
const newOpenFacets = { ...this.openFacets };
|
|
348
|
+
newOpenFacets[key] = !isOpen;
|
|
349
|
+
this.openFacets = newOpenFacets;
|
|
350
|
+
};
|
|
351
|
+
const headerId = `facet-group-header-label-${facetGroup.key}`;
|
|
352
352
|
return html `
|
|
353
353
|
<section
|
|
354
354
|
class="facet-group ${this.collapsableFacets ? 'mobile' : ''}"
|
|
@@ -365,61 +365,61 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
365
365
|
</h3>
|
|
366
366
|
</div>
|
|
367
367
|
<div class="facet-group-content ${isOpen ? 'open' : ''}">
|
|
368
|
-
${this.facetsLoading
|
|
369
|
-
? this.getTombstoneFacetGroupTemplate()
|
|
368
|
+
${this.facetsLoading
|
|
369
|
+
? this.getTombstoneFacetGroupTemplate()
|
|
370
370
|
: html `
|
|
371
371
|
${this.getFacetTemplate(facetGroup)}
|
|
372
372
|
${this.searchMoreFacetsLink(facetGroup)}
|
|
373
373
|
`}
|
|
374
374
|
</div>
|
|
375
375
|
</section>
|
|
376
|
-
`;
|
|
377
|
-
}
|
|
378
|
-
getTombstoneFacetGroupTemplate() {
|
|
379
|
-
// Render five tombstone rows
|
|
376
|
+
`;
|
|
377
|
+
}
|
|
378
|
+
getTombstoneFacetGroupTemplate() {
|
|
379
|
+
// Render five tombstone rows
|
|
380
380
|
return html `
|
|
381
381
|
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
382
|
-
`;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Generate the More... link button just below the facets group
|
|
386
|
-
*
|
|
387
|
-
* TODO: want to fire analytics?
|
|
388
|
-
*/
|
|
389
|
-
searchMoreFacetsLink(facetGroup) {
|
|
390
|
-
// Don't render More... links for FTS searches
|
|
391
|
-
if (!this.moreLinksVisible) {
|
|
392
|
-
return nothing;
|
|
393
|
-
}
|
|
394
|
-
// Don't render More... links for lending facets
|
|
395
|
-
if (facetGroup.key === 'lending') {
|
|
396
|
-
return nothing;
|
|
397
|
-
}
|
|
398
|
-
// Don't render More... link if the number of facets < this.allowedFacetCount
|
|
399
|
-
if (Object.keys(facetGroup.buckets).length < this.allowedFacetCount) {
|
|
400
|
-
return nothing;
|
|
401
|
-
}
|
|
402
|
-
// We sort years in numeric order by default, rather than bucket count
|
|
403
|
-
const facetSort = defaultFacetSort[facetGroup.key];
|
|
382
|
+
`;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Generate the More... link button just below the facets group
|
|
386
|
+
*
|
|
387
|
+
* TODO: want to fire analytics?
|
|
388
|
+
*/
|
|
389
|
+
searchMoreFacetsLink(facetGroup) {
|
|
390
|
+
// Don't render More... links for FTS searches
|
|
391
|
+
if (!this.moreLinksVisible) {
|
|
392
|
+
return nothing;
|
|
393
|
+
}
|
|
394
|
+
// Don't render More... links for lending facets
|
|
395
|
+
if (facetGroup.key === 'lending') {
|
|
396
|
+
return nothing;
|
|
397
|
+
}
|
|
398
|
+
// Don't render More... link if the number of facets < this.allowedFacetCount
|
|
399
|
+
if (Object.keys(facetGroup.buckets).length < this.allowedFacetCount) {
|
|
400
|
+
return nothing;
|
|
401
|
+
}
|
|
402
|
+
// We sort years in numeric order by default, rather than bucket count
|
|
403
|
+
const facetSort = defaultFacetSort[facetGroup.key];
|
|
404
404
|
return html `<button
|
|
405
405
|
class="more-link"
|
|
406
|
-
@click=${() => {
|
|
407
|
-
var _a;
|
|
408
|
-
this.showMoreFacetsModal(facetGroup, facetSort);
|
|
409
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
410
|
-
category: analyticsCategories.default,
|
|
411
|
-
action: analyticsActions.showMoreFacetsModal,
|
|
412
|
-
label: facetGroup.key,
|
|
413
|
-
});
|
|
414
|
-
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
406
|
+
@click=${() => {
|
|
407
|
+
var _a;
|
|
408
|
+
this.showMoreFacetsModal(facetGroup, facetSort);
|
|
409
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
410
|
+
category: analyticsCategories.default,
|
|
411
|
+
action: analyticsActions.showMoreFacetsModal,
|
|
412
|
+
label: facetGroup.key,
|
|
413
|
+
});
|
|
414
|
+
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
415
415
|
}}
|
|
416
416
|
>
|
|
417
417
|
More...
|
|
418
|
-
</button>`;
|
|
419
|
-
}
|
|
420
|
-
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
421
|
-
var _a, _b;
|
|
422
|
-
const facetAggrKey = facetGroup.key;
|
|
418
|
+
</button>`;
|
|
419
|
+
}
|
|
420
|
+
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
421
|
+
var _a, _b;
|
|
422
|
+
const facetAggrKey = facetGroup.key;
|
|
423
423
|
const customModalContent = html `
|
|
424
424
|
<more-facets-content
|
|
425
425
|
.analyticsHandler=${this.analyticsHandler}
|
|
@@ -434,38 +434,38 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
434
434
|
.collectionNameCache=${this.collectionNameCache}
|
|
435
435
|
.selectedFacets=${this.selectedFacets}
|
|
436
436
|
.sortedBy=${sortedBy}
|
|
437
|
-
@facetsChanged=${(e) => {
|
|
438
|
-
const event = new CustomEvent('facetsChanged', {
|
|
439
|
-
detail: e.detail,
|
|
440
|
-
bubbles: true,
|
|
441
|
-
composed: true,
|
|
442
|
-
});
|
|
443
|
-
this.dispatchEvent(event);
|
|
437
|
+
@facetsChanged=${(e) => {
|
|
438
|
+
const event = new CustomEvent('facetsChanged', {
|
|
439
|
+
detail: e.detail,
|
|
440
|
+
bubbles: true,
|
|
441
|
+
composed: true,
|
|
442
|
+
});
|
|
443
|
+
this.dispatchEvent(event);
|
|
444
444
|
}}
|
|
445
445
|
>
|
|
446
446
|
</more-facets-content>
|
|
447
|
-
`;
|
|
448
|
-
const config = new ModalConfig({
|
|
449
|
-
bodyColor: '#fff',
|
|
450
|
-
headerColor: '#194880',
|
|
451
|
-
showHeaderLogo: false,
|
|
452
|
-
closeOnBackdropClick: true,
|
|
453
|
-
title: html `Select filters`,
|
|
454
|
-
});
|
|
455
|
-
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('more-search-facets');
|
|
456
|
-
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
457
|
-
config,
|
|
458
|
-
customModalContent,
|
|
459
|
-
userClosedModalCallback: () => {
|
|
460
|
-
var _a;
|
|
461
|
-
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.remove('more-search-facets');
|
|
462
|
-
},
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Generate the list template for each bucket in a facet group
|
|
467
|
-
*/
|
|
468
|
-
getFacetTemplate(facetGroup) {
|
|
447
|
+
`;
|
|
448
|
+
const config = new ModalConfig({
|
|
449
|
+
bodyColor: '#fff',
|
|
450
|
+
headerColor: '#194880',
|
|
451
|
+
showHeaderLogo: false,
|
|
452
|
+
closeOnBackdropClick: true,
|
|
453
|
+
title: html `Select filters`,
|
|
454
|
+
});
|
|
455
|
+
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('more-search-facets');
|
|
456
|
+
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
457
|
+
config,
|
|
458
|
+
customModalContent,
|
|
459
|
+
userClosedModalCallback: () => {
|
|
460
|
+
var _a;
|
|
461
|
+
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.remove('more-search-facets');
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Generate the list template for each bucket in a facet group
|
|
467
|
+
*/
|
|
468
|
+
getFacetTemplate(facetGroup) {
|
|
469
469
|
return html `
|
|
470
470
|
<facets-template
|
|
471
471
|
.collectionPagePath=${this.collectionPagePath}
|
|
@@ -473,20 +473,20 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
473
473
|
.selectedFacets=${this.selectedFacets}
|
|
474
474
|
.renderOn=${'page'}
|
|
475
475
|
.collectionNameCache=${this.collectionNameCache}
|
|
476
|
-
@selectedFacetsChanged=${(e) => {
|
|
477
|
-
const event = new CustomEvent('facetsChanged', {
|
|
478
|
-
detail: e.detail,
|
|
479
|
-
bubbles: true,
|
|
480
|
-
composed: true,
|
|
481
|
-
});
|
|
482
|
-
this.dispatchEvent(event);
|
|
476
|
+
@selectedFacetsChanged=${(e) => {
|
|
477
|
+
const event = new CustomEvent('facetsChanged', {
|
|
478
|
+
detail: e.detail,
|
|
479
|
+
bubbles: true,
|
|
480
|
+
composed: true,
|
|
481
|
+
});
|
|
482
|
+
this.dispatchEvent(event);
|
|
483
483
|
}}
|
|
484
484
|
></facets-template>
|
|
485
|
-
`;
|
|
486
|
-
}
|
|
487
|
-
static get styles() {
|
|
488
|
-
return [
|
|
489
|
-
srOnlyStyle,
|
|
485
|
+
`;
|
|
486
|
+
}
|
|
487
|
+
static get styles() {
|
|
488
|
+
return [
|
|
489
|
+
srOnlyStyle,
|
|
490
490
|
css `
|
|
491
491
|
#container.loading {
|
|
492
492
|
opacity: 0.5;
|
|
@@ -587,87 +587,87 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
587
587
|
height: 15px;
|
|
588
588
|
cursor: pointer;
|
|
589
589
|
}
|
|
590
|
-
`,
|
|
591
|
-
];
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
__decorate([
|
|
595
|
-
property({ type: Object })
|
|
596
|
-
], CollectionFacets.prototype, "searchService", void 0);
|
|
597
|
-
__decorate([
|
|
598
|
-
property({ type: String })
|
|
599
|
-
], CollectionFacets.prototype, "searchType", void 0);
|
|
600
|
-
__decorate([
|
|
601
|
-
property({ type: Object })
|
|
602
|
-
], CollectionFacets.prototype, "aggregations", void 0);
|
|
603
|
-
__decorate([
|
|
604
|
-
property({ type: Object })
|
|
605
|
-
], CollectionFacets.prototype, "fullYearsHistogramAggregation", void 0);
|
|
606
|
-
__decorate([
|
|
607
|
-
property({ type: String })
|
|
608
|
-
], CollectionFacets.prototype, "minSelectedDate", void 0);
|
|
609
|
-
__decorate([
|
|
610
|
-
property({ type: String })
|
|
611
|
-
], CollectionFacets.prototype, "maxSelectedDate", void 0);
|
|
612
|
-
__decorate([
|
|
613
|
-
property({ type: Boolean })
|
|
614
|
-
], CollectionFacets.prototype, "moreLinksVisible", void 0);
|
|
615
|
-
__decorate([
|
|
616
|
-
property({ type: Boolean })
|
|
617
|
-
], CollectionFacets.prototype, "facetsLoading", void 0);
|
|
618
|
-
__decorate([
|
|
619
|
-
property({ type: Boolean })
|
|
620
|
-
], CollectionFacets.prototype, "fullYearAggregationLoading", void 0);
|
|
621
|
-
__decorate([
|
|
622
|
-
property({ type: Object })
|
|
623
|
-
], CollectionFacets.prototype, "selectedFacets", void 0);
|
|
624
|
-
__decorate([
|
|
625
|
-
property({ type: Boolean })
|
|
626
|
-
], CollectionFacets.prototype, "collapsableFacets", void 0);
|
|
627
|
-
__decorate([
|
|
628
|
-
property({ type: Number })
|
|
629
|
-
], CollectionFacets.prototype, "contentWidth", void 0);
|
|
630
|
-
__decorate([
|
|
631
|
-
property({ type: Boolean })
|
|
632
|
-
], CollectionFacets.prototype, "showHistogramDatePicker", void 0);
|
|
633
|
-
__decorate([
|
|
634
|
-
property({ type: Boolean })
|
|
635
|
-
], CollectionFacets.prototype, "allowExpandingDatePicker", void 0);
|
|
636
|
-
__decorate([
|
|
637
|
-
property({ type: String })
|
|
638
|
-
], CollectionFacets.prototype, "query", void 0);
|
|
639
|
-
__decorate([
|
|
640
|
-
property({ type: Object })
|
|
641
|
-
], CollectionFacets.prototype, "filterMap", void 0);
|
|
642
|
-
__decorate([
|
|
643
|
-
property({ type: String })
|
|
644
|
-
], CollectionFacets.prototype, "withinCollection", void 0);
|
|
645
|
-
__decorate([
|
|
646
|
-
property({ type: String })
|
|
647
|
-
], CollectionFacets.prototype, "collectionPagePath", void 0);
|
|
648
|
-
__decorate([
|
|
649
|
-
property({ type: Object, attribute: false })
|
|
650
|
-
], CollectionFacets.prototype, "modalManager", void 0);
|
|
651
|
-
__decorate([
|
|
652
|
-
property({ type: Object, attribute: false })
|
|
653
|
-
], CollectionFacets.prototype, "resizeObserver", void 0);
|
|
654
|
-
__decorate([
|
|
655
|
-
property({ type: Object, attribute: false })
|
|
656
|
-
], CollectionFacets.prototype, "featureFeedbackService", void 0);
|
|
657
|
-
__decorate([
|
|
658
|
-
property({ type: Object, attribute: false })
|
|
659
|
-
], CollectionFacets.prototype, "recaptchaManager", void 0);
|
|
660
|
-
__decorate([
|
|
661
|
-
property({ type: Object, attribute: false })
|
|
662
|
-
], CollectionFacets.prototype, "analyticsHandler", void 0);
|
|
663
|
-
__decorate([
|
|
664
|
-
property({ type: Object, attribute: false })
|
|
665
|
-
], CollectionFacets.prototype, "collectionNameCache", void 0);
|
|
666
|
-
__decorate([
|
|
667
|
-
state()
|
|
668
|
-
], CollectionFacets.prototype, "openFacets", void 0);
|
|
669
|
-
CollectionFacets = __decorate([
|
|
670
|
-
customElement('collection-facets')
|
|
671
|
-
], CollectionFacets);
|
|
672
|
-
export { CollectionFacets };
|
|
590
|
+
`,
|
|
591
|
+
];
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
__decorate([
|
|
595
|
+
property({ type: Object })
|
|
596
|
+
], CollectionFacets.prototype, "searchService", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
property({ type: String })
|
|
599
|
+
], CollectionFacets.prototype, "searchType", void 0);
|
|
600
|
+
__decorate([
|
|
601
|
+
property({ type: Object })
|
|
602
|
+
], CollectionFacets.prototype, "aggregations", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
property({ type: Object })
|
|
605
|
+
], CollectionFacets.prototype, "fullYearsHistogramAggregation", void 0);
|
|
606
|
+
__decorate([
|
|
607
|
+
property({ type: String })
|
|
608
|
+
], CollectionFacets.prototype, "minSelectedDate", void 0);
|
|
609
|
+
__decorate([
|
|
610
|
+
property({ type: String })
|
|
611
|
+
], CollectionFacets.prototype, "maxSelectedDate", void 0);
|
|
612
|
+
__decorate([
|
|
613
|
+
property({ type: Boolean })
|
|
614
|
+
], CollectionFacets.prototype, "moreLinksVisible", void 0);
|
|
615
|
+
__decorate([
|
|
616
|
+
property({ type: Boolean })
|
|
617
|
+
], CollectionFacets.prototype, "facetsLoading", void 0);
|
|
618
|
+
__decorate([
|
|
619
|
+
property({ type: Boolean })
|
|
620
|
+
], CollectionFacets.prototype, "fullYearAggregationLoading", void 0);
|
|
621
|
+
__decorate([
|
|
622
|
+
property({ type: Object })
|
|
623
|
+
], CollectionFacets.prototype, "selectedFacets", void 0);
|
|
624
|
+
__decorate([
|
|
625
|
+
property({ type: Boolean })
|
|
626
|
+
], CollectionFacets.prototype, "collapsableFacets", void 0);
|
|
627
|
+
__decorate([
|
|
628
|
+
property({ type: Number })
|
|
629
|
+
], CollectionFacets.prototype, "contentWidth", void 0);
|
|
630
|
+
__decorate([
|
|
631
|
+
property({ type: Boolean })
|
|
632
|
+
], CollectionFacets.prototype, "showHistogramDatePicker", void 0);
|
|
633
|
+
__decorate([
|
|
634
|
+
property({ type: Boolean })
|
|
635
|
+
], CollectionFacets.prototype, "allowExpandingDatePicker", void 0);
|
|
636
|
+
__decorate([
|
|
637
|
+
property({ type: String })
|
|
638
|
+
], CollectionFacets.prototype, "query", void 0);
|
|
639
|
+
__decorate([
|
|
640
|
+
property({ type: Object })
|
|
641
|
+
], CollectionFacets.prototype, "filterMap", void 0);
|
|
642
|
+
__decorate([
|
|
643
|
+
property({ type: String })
|
|
644
|
+
], CollectionFacets.prototype, "withinCollection", void 0);
|
|
645
|
+
__decorate([
|
|
646
|
+
property({ type: String })
|
|
647
|
+
], CollectionFacets.prototype, "collectionPagePath", void 0);
|
|
648
|
+
__decorate([
|
|
649
|
+
property({ type: Object, attribute: false })
|
|
650
|
+
], CollectionFacets.prototype, "modalManager", void 0);
|
|
651
|
+
__decorate([
|
|
652
|
+
property({ type: Object, attribute: false })
|
|
653
|
+
], CollectionFacets.prototype, "resizeObserver", void 0);
|
|
654
|
+
__decorate([
|
|
655
|
+
property({ type: Object, attribute: false })
|
|
656
|
+
], CollectionFacets.prototype, "featureFeedbackService", void 0);
|
|
657
|
+
__decorate([
|
|
658
|
+
property({ type: Object, attribute: false })
|
|
659
|
+
], CollectionFacets.prototype, "recaptchaManager", void 0);
|
|
660
|
+
__decorate([
|
|
661
|
+
property({ type: Object, attribute: false })
|
|
662
|
+
], CollectionFacets.prototype, "analyticsHandler", void 0);
|
|
663
|
+
__decorate([
|
|
664
|
+
property({ type: Object, attribute: false })
|
|
665
|
+
], CollectionFacets.prototype, "collectionNameCache", void 0);
|
|
666
|
+
__decorate([
|
|
667
|
+
state()
|
|
668
|
+
], CollectionFacets.prototype, "openFacets", void 0);
|
|
669
|
+
CollectionFacets = __decorate([
|
|
670
|
+
customElement('collection-facets')
|
|
671
|
+
], CollectionFacets);
|
|
672
|
+
export { CollectionFacets };
|
|
673
673
|
//# sourceMappingURL=collection-facets.js.map
|