@internetarchive/collection-browser 0.4.9 → 0.4.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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 +50 -50
- package/dist/src/app-root.js +278 -278
- 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/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.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 +280 -281
- package/dist/src/collection-browser.js +1173 -1202
- 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 +16 -16
- package/dist/src/collection-facets/facets-template.js +125 -125
- package/dist/src/collection-facets/more-facets-content.d.ts +75 -77
- package/dist/src/collection-facets/more-facets-content.js +340 -357
- 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 +192 -192
- package/dist/src/collection-facets.d.ts +81 -83
- package/dist/src/collection-facets.js +375 -393
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +11 -11
- package/dist/src/empty-placeholder.js +42 -42
- 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 +115 -115
- package/dist/src/models.js +125 -125
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +45 -45
- package/dist/src/restoration-state-handler.js +230 -230
- 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 +20 -20
- 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-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 +113 -108
- package/dist/src/sort-filter-bar/sort-filter-bar.js +614 -548
- 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/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 +20 -20
- package/dist/src/tiles/grid/account-tile.js +64 -64
- package/dist/src/tiles/grid/collection-tile.d.ts +17 -17
- package/dist/src/tiles/grid/collection-tile.js +71 -71
- package/dist/src/tiles/grid/item-tile.d.ts +32 -32
- package/dist/src/tiles/grid/item-tile.js +129 -126
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +7 -7
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -10
- package/dist/src/tiles/grid/tile-stats.js +40 -40
- 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/account-label.d.ts +1 -1
- package/dist/src/tiles/list/account-label.js +6 -6
- package/dist/src/tiles/list/date-label.d.ts +1 -1
- package/dist/src/tiles/list/date-label.js +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.js +41 -41
- package/dist/src/tiles/list/tile-list-compact.d.ts +21 -21
- package/dist/src/tiles/list/tile-list-compact.js +99 -99
- package/dist/src/tiles/list/tile-list.d.ts +55 -55
- package/dist/src/tiles/list/tile-list.js +301 -301
- 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 +58 -58
- package/dist/src/tiles/tile-dispatcher.js +194 -194
- package/dist/src/utils/analytics-events.d.ts +22 -22
- package/dist/src/utils/analytics-events.js +24 -24
- 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 +23 -23
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +584 -584
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +62 -62
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +114 -114
- 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.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +460 -508
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +33 -33
- 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 +7 -7
- package/dist/test/mocks/mock-collection-name-cache.js +13 -13
- package/dist/test/mocks/mock-search-responses.d.ts +12 -12
- package/dist/test/mocks/mock-search-responses.js +341 -341
- package/dist/test/mocks/mock-search-service.d.ts +13 -13
- package/dist/test/mocks/mock-search-service.js +40 -40
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +125 -125
- 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 +208 -197
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +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 +158 -158
- 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 +92 -92
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +163 -163
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +67 -67
- 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/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +4 -3
- package/renovate.json +6 -6
- package/src/collection-browser.ts +1 -34
- package/src/collection-facets/more-facets-content.ts +2 -22
- package/src/collection-facets.ts +1 -24
- package/src/models.ts +6 -6
- package/src/sort-filter-bar/sort-filter-bar.ts +283 -197
- package/src/tiles/grid/item-tile.ts +5 -1
- package/test/collection-facets.test.ts +0 -67
- package/test/sort-filter-bar/sort-filter-bar.test.ts +56 -39
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -1,45 +1,45 @@
|
|
|
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 '@internetarchive/histogram-date-range';
|
|
7
|
-
import '@internetarchive/feature-feedback';
|
|
8
|
-
import '@internetarchive/collection-name-cache';
|
|
9
|
-
import { ModalConfig, } from '@internetarchive/modal-manager';
|
|
10
|
-
import chevronIcon from './assets/img/icons/chevron';
|
|
11
|
-
import { facetDisplayOrder, facetTitles, lendingFacetDisplayNames, lendingFacetKeysVisibility, suppressedCollections, } from './models';
|
|
12
|
-
import './collection-facets/more-facets-content';
|
|
13
|
-
import './collection-facets/facets-template';
|
|
14
|
-
import './collection-facets/facet-tombstone-row';
|
|
15
|
-
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
16
|
-
let CollectionFacets = class CollectionFacets extends LitElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.moreLinksVisible = true;
|
|
20
|
-
this.facetsLoading = false;
|
|
21
|
-
this.fullYearAggregationLoading = false;
|
|
22
|
-
this.collapsableFacets = false;
|
|
23
|
-
this.showHistogramDatePicker = false;
|
|
24
|
-
this.openFacets = {
|
|
25
|
-
subject: false,
|
|
26
|
-
lending: false,
|
|
27
|
-
mediatype: false,
|
|
28
|
-
language: false,
|
|
29
|
-
creator: false,
|
|
30
|
-
collection: false,
|
|
31
|
-
year: false,
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Maximum # of facet buckets to render per facet group
|
|
35
|
-
*/
|
|
36
|
-
this.allowedFacetCount = 6;
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
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 '@internetarchive/histogram-date-range';
|
|
7
|
+
import '@internetarchive/feature-feedback';
|
|
8
|
+
import '@internetarchive/collection-name-cache';
|
|
9
|
+
import { ModalConfig, } from '@internetarchive/modal-manager';
|
|
10
|
+
import chevronIcon from './assets/img/icons/chevron';
|
|
11
|
+
import { facetDisplayOrder, facetTitles, lendingFacetDisplayNames, lendingFacetKeysVisibility, suppressedCollections, } from './models';
|
|
12
|
+
import './collection-facets/more-facets-content';
|
|
13
|
+
import './collection-facets/facets-template';
|
|
14
|
+
import './collection-facets/facet-tombstone-row';
|
|
15
|
+
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
16
|
+
let CollectionFacets = class CollectionFacets extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.moreLinksVisible = true;
|
|
20
|
+
this.facetsLoading = false;
|
|
21
|
+
this.fullYearAggregationLoading = false;
|
|
22
|
+
this.collapsableFacets = false;
|
|
23
|
+
this.showHistogramDatePicker = false;
|
|
24
|
+
this.openFacets = {
|
|
25
|
+
subject: false,
|
|
26
|
+
lending: false,
|
|
27
|
+
mediatype: false,
|
|
28
|
+
language: false,
|
|
29
|
+
creator: false,
|
|
30
|
+
collection: false,
|
|
31
|
+
year: false,
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Maximum # of facet buckets to render per facet group
|
|
35
|
+
*/
|
|
36
|
+
this.allowedFacetCount = 6;
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
39
|
return html `
|
|
40
40
|
<div id="container" class="${this.facetsLoading ? 'loading' : ''}">
|
|
41
|
-
${this.showHistogramDatePicker &&
|
|
42
|
-
(this.fullYearsHistogramAggregation || this.fullYearAggregationLoading)
|
|
41
|
+
${this.showHistogramDatePicker &&
|
|
42
|
+
(this.fullYearsHistogramAggregation || this.fullYearAggregationLoading)
|
|
43
43
|
? html `
|
|
44
44
|
<div class="facet-group">
|
|
45
45
|
<h1>
|
|
@@ -54,32 +54,32 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
54
54
|
</h1>
|
|
55
55
|
${this.histogramTemplate}
|
|
56
56
|
</div>
|
|
57
|
-
`
|
|
57
|
+
`
|
|
58
58
|
: nothing}
|
|
59
59
|
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
60
60
|
</div>
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
updated(changed) {
|
|
64
|
-
if (changed.has('selectedFacets')) {
|
|
65
|
-
this.dispatchFacetsChangedEvent();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// TODO: want to fire analytics?
|
|
69
|
-
dispatchFacetsChangedEvent() {
|
|
70
|
-
const event = new CustomEvent('facetsChanged', {
|
|
71
|
-
detail: this.selectedFacets,
|
|
72
|
-
});
|
|
73
|
-
this.dispatchEvent(event);
|
|
74
|
-
}
|
|
75
|
-
get currentYearsHistogramAggregation() {
|
|
76
|
-
var _a;
|
|
77
|
-
return (_a = this.aggregations) === null || _a === void 0 ? void 0 : _a.year_histogram;
|
|
78
|
-
}
|
|
79
|
-
get histogramTemplate() {
|
|
80
|
-
const { fullYearsHistogramAggregation } = this;
|
|
81
|
-
return this.fullYearAggregationLoading
|
|
82
|
-
? html `<div class="histogram-loading-indicator">…</div>` // Ellipsis block
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
updated(changed) {
|
|
64
|
+
if (changed.has('selectedFacets')) {
|
|
65
|
+
this.dispatchFacetsChangedEvent();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// TODO: want to fire analytics?
|
|
69
|
+
dispatchFacetsChangedEvent() {
|
|
70
|
+
const event = new CustomEvent('facetsChanged', {
|
|
71
|
+
detail: this.selectedFacets,
|
|
72
|
+
});
|
|
73
|
+
this.dispatchEvent(event);
|
|
74
|
+
}
|
|
75
|
+
get currentYearsHistogramAggregation() {
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = this.aggregations) === null || _a === void 0 ? void 0 : _a.year_histogram;
|
|
78
|
+
}
|
|
79
|
+
get histogramTemplate() {
|
|
80
|
+
const { fullYearsHistogramAggregation } = this;
|
|
81
|
+
return this.fullYearAggregationLoading
|
|
82
|
+
? html `<div class="histogram-loading-indicator">…</div>` // Ellipsis block
|
|
83
83
|
: html `
|
|
84
84
|
<histogram-date-range
|
|
85
85
|
.minDate=${fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.first_bucket_key}
|
|
@@ -92,250 +92,236 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
92
92
|
.bins=${fullYearsHistogramAggregation === null || fullYearsHistogramAggregation === void 0 ? void 0 : fullYearsHistogramAggregation.buckets}
|
|
93
93
|
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
94
94
|
></histogram-date-range>
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
histogramDateRangeUpdated(e) {
|
|
98
|
-
const { minDate, maxDate } = e.detail;
|
|
99
|
-
const event = new CustomEvent('histogramDateRangeUpdated', {
|
|
100
|
-
detail: { minDate, maxDate },
|
|
101
|
-
});
|
|
102
|
-
this.dispatchEvent(event);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Combines the selected facets with the aggregations to create a single list of facets
|
|
106
|
-
*/
|
|
107
|
-
get mergedFacets() {
|
|
108
|
-
const facetGroups = [];
|
|
109
|
-
facetDisplayOrder.forEach(facetKey => {
|
|
110
|
-
var _a, _b;
|
|
111
|
-
const selectedFacetGroup = this.selectedFacetGroups.find(group => group.key === facetKey);
|
|
112
|
-
const aggregateFacetGroup = this.aggregationFacetGroups.find(group => group.key === facetKey);
|
|
113
|
-
// if the user selected a facet, but it's not in the aggregation, we add it as-is
|
|
114
|
-
if (selectedFacetGroup && !aggregateFacetGroup) {
|
|
115
|
-
facetGroups.push(selectedFacetGroup);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
// if we don't have an aggregate facet group, don't add this to the list
|
|
119
|
-
if (!aggregateFacetGroup)
|
|
120
|
-
return;
|
|
121
|
-
// start with either the selected group if we have one, or the aggregate group
|
|
122
|
-
const facetGroup = selectedFacetGroup !== null && selectedFacetGroup !== void 0 ? selectedFacetGroup : aggregateFacetGroup;
|
|
123
|
-
// attach the counts to the selected buckets
|
|
124
|
-
let bucketsWithCount = (_a = selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets.map(bucket => {
|
|
125
|
-
const selectedBucket = aggregateFacetGroup.buckets.find(b => b.key === bucket.key);
|
|
126
|
-
return selectedBucket
|
|
127
|
-
? {
|
|
128
|
-
...bucket,
|
|
129
|
-
count: selectedBucket.count,
|
|
130
|
-
}
|
|
131
|
-
: bucket;
|
|
132
|
-
})) !== null && _a !== void 0 ? _a : [];
|
|
133
|
-
// append any additional buckets that were not selected
|
|
134
|
-
aggregateFacetGroup.buckets.forEach(bucket => {
|
|
135
|
-
const existingBucket = bucketsWithCount.find(b => b.key === bucket.key);
|
|
136
|
-
if (existingBucket)
|
|
137
|
-
return;
|
|
138
|
-
bucketsWithCount.push(bucket);
|
|
139
|
-
});
|
|
140
|
-
// For lending facets, only include a specific subset of buckets
|
|
141
|
-
if (facetKey === 'lending') {
|
|
142
|
-
bucketsWithCount = bucketsWithCount.filter(bucket => lendingFacetKeysVisibility[bucket.key]);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* render limited facet items on page facet area
|
|
146
|
-
*
|
|
147
|
-
* - by-default we are showing 6 items
|
|
148
|
-
* - additionally want to show all items (selected/suppressed) in page facet area
|
|
149
|
-
*/
|
|
150
|
-
let allowedFacetCount = (_b = Object.keys((selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets) || [])) === null || _b === void 0 ? void 0 : _b.length;
|
|
151
|
-
if (allowedFacetCount < this.allowedFacetCount) {
|
|
152
|
-
allowedFacetCount = this.allowedFacetCount; // splice start index from 0th
|
|
153
|
-
}
|
|
154
|
-
// splice how many items we want to show in page facet area
|
|
155
|
-
facetGroup.buckets = bucketsWithCount.splice(0, allowedFacetCount);
|
|
156
|
-
facetGroups.push(facetGroup);
|
|
157
|
-
});
|
|
158
|
-
return facetGroups;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Converts the selected facets to a `FacetGroup` array,
|
|
162
|
-
* which is easier to work with
|
|
163
|
-
*/
|
|
164
|
-
get selectedFacetGroups() {
|
|
165
|
-
if (!this.selectedFacets)
|
|
166
|
-
return [];
|
|
167
|
-
const facetGroups = Object.entries(this.selectedFacets).map(([key, selectedFacets]) => {
|
|
168
|
-
const option = key;
|
|
169
|
-
const title = facetTitles[option];
|
|
170
|
-
const buckets = Object.entries(selectedFacets).map(([value, facetData]) => {
|
|
171
|
-
var _a
|
|
172
|
-
let displayText = value;
|
|
173
|
-
// for
|
|
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
|
-
facetGroups.push(group);
|
|
252
|
-
});
|
|
253
|
-
return facetGroups;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Generate the template for a facet group with a header and the collapsible
|
|
257
|
-
* chevron for the mobile view
|
|
258
|
-
*/
|
|
259
|
-
getFacetGroupTemplate(facetGroup) {
|
|
260
|
-
if (!this.facetsLoading && facetGroup.buckets.length === 0)
|
|
261
|
-
return nothing;
|
|
262
|
-
const { key } = facetGroup;
|
|
263
|
-
const isOpen = this.openFacets[key];
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
histogramDateRangeUpdated(e) {
|
|
98
|
+
const { minDate, maxDate } = e.detail;
|
|
99
|
+
const event = new CustomEvent('histogramDateRangeUpdated', {
|
|
100
|
+
detail: { minDate, maxDate },
|
|
101
|
+
});
|
|
102
|
+
this.dispatchEvent(event);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Combines the selected facets with the aggregations to create a single list of facets
|
|
106
|
+
*/
|
|
107
|
+
get mergedFacets() {
|
|
108
|
+
const facetGroups = [];
|
|
109
|
+
facetDisplayOrder.forEach(facetKey => {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const selectedFacetGroup = this.selectedFacetGroups.find(group => group.key === facetKey);
|
|
112
|
+
const aggregateFacetGroup = this.aggregationFacetGroups.find(group => group.key === facetKey);
|
|
113
|
+
// if the user selected a facet, but it's not in the aggregation, we add it as-is
|
|
114
|
+
if (selectedFacetGroup && !aggregateFacetGroup) {
|
|
115
|
+
facetGroups.push(selectedFacetGroup);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// if we don't have an aggregate facet group, don't add this to the list
|
|
119
|
+
if (!aggregateFacetGroup)
|
|
120
|
+
return;
|
|
121
|
+
// start with either the selected group if we have one, or the aggregate group
|
|
122
|
+
const facetGroup = selectedFacetGroup !== null && selectedFacetGroup !== void 0 ? selectedFacetGroup : aggregateFacetGroup;
|
|
123
|
+
// attach the counts to the selected buckets
|
|
124
|
+
let bucketsWithCount = (_a = selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets.map(bucket => {
|
|
125
|
+
const selectedBucket = aggregateFacetGroup.buckets.find(b => b.key === bucket.key);
|
|
126
|
+
return selectedBucket
|
|
127
|
+
? {
|
|
128
|
+
...bucket,
|
|
129
|
+
count: selectedBucket.count,
|
|
130
|
+
}
|
|
131
|
+
: bucket;
|
|
132
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
133
|
+
// append any additional buckets that were not selected
|
|
134
|
+
aggregateFacetGroup.buckets.forEach(bucket => {
|
|
135
|
+
const existingBucket = bucketsWithCount.find(b => b.key === bucket.key);
|
|
136
|
+
if (existingBucket)
|
|
137
|
+
return;
|
|
138
|
+
bucketsWithCount.push(bucket);
|
|
139
|
+
});
|
|
140
|
+
// For lending facets, only include a specific subset of buckets
|
|
141
|
+
if (facetKey === 'lending') {
|
|
142
|
+
bucketsWithCount = bucketsWithCount.filter(bucket => lendingFacetKeysVisibility[bucket.key]);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* render limited facet items on page facet area
|
|
146
|
+
*
|
|
147
|
+
* - by-default we are showing 6 items
|
|
148
|
+
* - additionally want to show all items (selected/suppressed) in page facet area
|
|
149
|
+
*/
|
|
150
|
+
let allowedFacetCount = (_b = Object.keys((selectedFacetGroup === null || selectedFacetGroup === void 0 ? void 0 : selectedFacetGroup.buckets) || [])) === null || _b === void 0 ? void 0 : _b.length;
|
|
151
|
+
if (allowedFacetCount < this.allowedFacetCount) {
|
|
152
|
+
allowedFacetCount = this.allowedFacetCount; // splice start index from 0th
|
|
153
|
+
}
|
|
154
|
+
// splice how many items we want to show in page facet area
|
|
155
|
+
facetGroup.buckets = bucketsWithCount.splice(0, allowedFacetCount);
|
|
156
|
+
facetGroups.push(facetGroup);
|
|
157
|
+
});
|
|
158
|
+
return facetGroups;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Converts the selected facets to a `FacetGroup` array,
|
|
162
|
+
* which is easier to work with
|
|
163
|
+
*/
|
|
164
|
+
get selectedFacetGroups() {
|
|
165
|
+
if (!this.selectedFacets)
|
|
166
|
+
return [];
|
|
167
|
+
const facetGroups = Object.entries(this.selectedFacets).map(([key, selectedFacets]) => {
|
|
168
|
+
const option = key;
|
|
169
|
+
const title = facetTitles[option];
|
|
170
|
+
const buckets = Object.entries(selectedFacets).map(([value, facetData]) => {
|
|
171
|
+
var _a;
|
|
172
|
+
let displayText = value;
|
|
173
|
+
// for lending facets, convert the key to a readable format
|
|
174
|
+
if (option === 'lending') {
|
|
175
|
+
displayText =
|
|
176
|
+
(_a = lendingFacetDisplayNames[value]) !== null && _a !== void 0 ? _a : value;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
displayText,
|
|
180
|
+
key: value,
|
|
181
|
+
count: facetData.count,
|
|
182
|
+
state: facetData.state,
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
return {
|
|
186
|
+
title,
|
|
187
|
+
key: option,
|
|
188
|
+
buckets,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
return facetGroups;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Converts the raw `aggregations` to `FacetGroups`, which are easier to use
|
|
195
|
+
*/
|
|
196
|
+
get aggregationFacetGroups() {
|
|
197
|
+
var _a;
|
|
198
|
+
const facetGroups = [];
|
|
199
|
+
Object.entries((_a = this.aggregations) !== null && _a !== void 0 ? _a : []).forEach(([key, buckets]) => {
|
|
200
|
+
// the year_histogram data is in a different format so can't be handled here
|
|
201
|
+
if (key === 'year_histogram')
|
|
202
|
+
return;
|
|
203
|
+
const option = key;
|
|
204
|
+
const title = facetTitles[option];
|
|
205
|
+
if (!title)
|
|
206
|
+
return;
|
|
207
|
+
let castedBuckets = buckets.buckets;
|
|
208
|
+
if (option === 'collection') {
|
|
209
|
+
// we are not showing fav- collections or certain deemphasized collections in facets
|
|
210
|
+
castedBuckets = castedBuckets === null || castedBuckets === void 0 ? void 0 : castedBuckets.filter(bucket => {
|
|
211
|
+
var _a;
|
|
212
|
+
const bucketKey = (_a = bucket === null || bucket === void 0 ? void 0 : bucket.key) === null || _a === void 0 ? void 0 : _a.toString();
|
|
213
|
+
return (!suppressedCollections[bucketKey] && !(bucketKey === null || bucketKey === void 0 ? void 0 : bucketKey.startsWith('fav-')));
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const facetBuckets = castedBuckets.map(bucket => {
|
|
217
|
+
var _a;
|
|
218
|
+
const bucketKey = bucket.key;
|
|
219
|
+
let displayText = `${bucket.key}`;
|
|
220
|
+
// for lending facets, convert the bucket key to a readable format
|
|
221
|
+
if (option === 'lending') {
|
|
222
|
+
displayText =
|
|
223
|
+
(_a = lendingFacetDisplayNames[bucket.key]) !== null && _a !== void 0 ? _a : `${bucket.key}`;
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
displayText,
|
|
227
|
+
key: `${bucketKey}`,
|
|
228
|
+
count: bucket.doc_count,
|
|
229
|
+
state: 'none',
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
const group = {
|
|
233
|
+
title,
|
|
234
|
+
key: option,
|
|
235
|
+
buckets: facetBuckets,
|
|
236
|
+
};
|
|
237
|
+
facetGroups.push(group);
|
|
238
|
+
});
|
|
239
|
+
return facetGroups;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Generate the template for a facet group with a header and the collapsible
|
|
243
|
+
* chevron for the mobile view
|
|
244
|
+
*/
|
|
245
|
+
getFacetGroupTemplate(facetGroup) {
|
|
246
|
+
if (!this.facetsLoading && facetGroup.buckets.length === 0)
|
|
247
|
+
return nothing;
|
|
248
|
+
const { key } = facetGroup;
|
|
249
|
+
const isOpen = this.openFacets[key];
|
|
264
250
|
const collapser = html `
|
|
265
251
|
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
266
|
-
`;
|
|
252
|
+
`;
|
|
267
253
|
return html `
|
|
268
254
|
<div class="facet-group ${this.collapsableFacets ? 'mobile' : ''}">
|
|
269
255
|
<div class="facet-group-header">
|
|
270
256
|
<h1
|
|
271
|
-
@click=${() => {
|
|
272
|
-
const newOpenFacets = { ...this.openFacets };
|
|
273
|
-
newOpenFacets[key] = !isOpen;
|
|
274
|
-
this.openFacets = newOpenFacets;
|
|
257
|
+
@click=${() => {
|
|
258
|
+
const newOpenFacets = { ...this.openFacets };
|
|
259
|
+
newOpenFacets[key] = !isOpen;
|
|
260
|
+
this.openFacets = newOpenFacets;
|
|
275
261
|
}}
|
|
276
|
-
@keyup=${() => {
|
|
277
|
-
const newOpenFacets = { ...this.openFacets };
|
|
278
|
-
newOpenFacets[key] = !isOpen;
|
|
279
|
-
this.openFacets = newOpenFacets;
|
|
262
|
+
@keyup=${() => {
|
|
263
|
+
const newOpenFacets = { ...this.openFacets };
|
|
264
|
+
newOpenFacets[key] = !isOpen;
|
|
265
|
+
this.openFacets = newOpenFacets;
|
|
280
266
|
}}
|
|
281
267
|
>
|
|
282
268
|
${this.collapsableFacets ? collapser : nothing} ${facetGroup.title}
|
|
283
269
|
</h1>
|
|
284
270
|
</div>
|
|
285
271
|
<div class="facet-group-content ${isOpen ? 'open' : ''}">
|
|
286
|
-
${this.facetsLoading
|
|
287
|
-
? this.getTombstoneFacetGroupTemplate()
|
|
272
|
+
${this.facetsLoading
|
|
273
|
+
? this.getTombstoneFacetGroupTemplate()
|
|
288
274
|
: html `
|
|
289
275
|
${this.getFacetTemplate(facetGroup)}
|
|
290
276
|
${this.searchMoreFacetsLink(facetGroup)}
|
|
291
277
|
`}
|
|
292
278
|
</div>
|
|
293
279
|
</div>
|
|
294
|
-
`;
|
|
295
|
-
}
|
|
296
|
-
getTombstoneFacetGroupTemplate() {
|
|
297
|
-
// Render five tombstone rows
|
|
280
|
+
`;
|
|
281
|
+
}
|
|
282
|
+
getTombstoneFacetGroupTemplate() {
|
|
283
|
+
// Render five tombstone rows
|
|
298
284
|
return html `
|
|
299
285
|
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
300
|
-
`;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Generate the More... link button just below the facets group
|
|
304
|
-
*
|
|
305
|
-
* TODO: want to fire analytics?
|
|
306
|
-
*/
|
|
307
|
-
searchMoreFacetsLink(facetGroup) {
|
|
308
|
-
// Don't render More... links for FTS searches
|
|
309
|
-
if (!this.moreLinksVisible) {
|
|
310
|
-
return nothing;
|
|
311
|
-
}
|
|
312
|
-
// Don't render More... links for lending facets
|
|
313
|
-
if (facetGroup.key === 'lending') {
|
|
314
|
-
return nothing;
|
|
315
|
-
}
|
|
316
|
-
// Don't render More... link if the number of facets < this.allowedFacetCount
|
|
317
|
-
if (Object.keys(facetGroup.buckets).length < this.allowedFacetCount) {
|
|
318
|
-
return nothing;
|
|
319
|
-
}
|
|
286
|
+
`;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Generate the More... link button just below the facets group
|
|
290
|
+
*
|
|
291
|
+
* TODO: want to fire analytics?
|
|
292
|
+
*/
|
|
293
|
+
searchMoreFacetsLink(facetGroup) {
|
|
294
|
+
// Don't render More... links for FTS searches
|
|
295
|
+
if (!this.moreLinksVisible) {
|
|
296
|
+
return nothing;
|
|
297
|
+
}
|
|
298
|
+
// Don't render More... links for lending facets
|
|
299
|
+
if (facetGroup.key === 'lending') {
|
|
300
|
+
return nothing;
|
|
301
|
+
}
|
|
302
|
+
// Don't render More... link if the number of facets < this.allowedFacetCount
|
|
303
|
+
if (Object.keys(facetGroup.buckets).length < this.allowedFacetCount) {
|
|
304
|
+
return nothing;
|
|
305
|
+
}
|
|
320
306
|
return html `<button
|
|
321
307
|
class="more-link"
|
|
322
|
-
@click=${() => {
|
|
323
|
-
var _a;
|
|
324
|
-
this.showMoreFacetsModal(facetGroup, 'count');
|
|
325
|
-
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
326
|
-
category: analyticsCategories.default,
|
|
327
|
-
action: analyticsActions.showMoreFacetsModal,
|
|
328
|
-
label: facetGroup.key,
|
|
329
|
-
});
|
|
330
|
-
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
308
|
+
@click=${() => {
|
|
309
|
+
var _a;
|
|
310
|
+
this.showMoreFacetsModal(facetGroup, 'count');
|
|
311
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEvent({
|
|
312
|
+
category: analyticsCategories.default,
|
|
313
|
+
action: analyticsActions.showMoreFacetsModal,
|
|
314
|
+
label: facetGroup.key,
|
|
315
|
+
});
|
|
316
|
+
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
331
317
|
}}
|
|
332
318
|
>
|
|
333
319
|
More...
|
|
334
|
-
</button>`;
|
|
335
|
-
}
|
|
336
|
-
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
337
|
-
var _a, _b;
|
|
338
|
-
const facetAggrKey = facetGroup.key;
|
|
320
|
+
</button>`;
|
|
321
|
+
}
|
|
322
|
+
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
323
|
+
var _a, _b;
|
|
324
|
+
const facetAggrKey = facetGroup.key;
|
|
339
325
|
const customModalContent = html `
|
|
340
326
|
<more-facets-content
|
|
341
327
|
.analyticsHandler=${this.analyticsHandler}
|
|
@@ -347,55 +333,54 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
347
333
|
.searchService=${this.searchService}
|
|
348
334
|
.searchType=${this.searchType}
|
|
349
335
|
.collectionNameCache=${this.collectionNameCache}
|
|
350
|
-
.languageCodeHandler=${this.languageCodeHandler}
|
|
351
336
|
.selectedFacets=${this.selectedFacets}
|
|
352
337
|
.sortedBy=${sortedBy}
|
|
353
|
-
@facetsChanged=${(e) => {
|
|
354
|
-
const event = new CustomEvent('facetsChanged', {
|
|
355
|
-
detail: e.detail,
|
|
356
|
-
bubbles: true,
|
|
357
|
-
composed: true,
|
|
358
|
-
});
|
|
359
|
-
this.dispatchEvent(event);
|
|
338
|
+
@facetsChanged=${(e) => {
|
|
339
|
+
const event = new CustomEvent('facetsChanged', {
|
|
340
|
+
detail: e.detail,
|
|
341
|
+
bubbles: true,
|
|
342
|
+
composed: true,
|
|
343
|
+
});
|
|
344
|
+
this.dispatchEvent(event);
|
|
360
345
|
}}
|
|
361
346
|
>
|
|
362
347
|
</more-facets-content>
|
|
363
|
-
`;
|
|
364
|
-
const config = new ModalConfig({
|
|
365
|
-
bodyColor: '#fff',
|
|
366
|
-
headerColor: '#194880',
|
|
367
|
-
showHeaderLogo: false,
|
|
368
|
-
closeOnBackdropClick: true,
|
|
369
|
-
title: html `Select filters`,
|
|
370
|
-
});
|
|
371
|
-
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('more-search-facets');
|
|
372
|
-
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
373
|
-
config,
|
|
374
|
-
customModalContent,
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Generate the list template for each bucket in a facet group
|
|
379
|
-
*/
|
|
380
|
-
getFacetTemplate(facetGroup) {
|
|
348
|
+
`;
|
|
349
|
+
const config = new ModalConfig({
|
|
350
|
+
bodyColor: '#fff',
|
|
351
|
+
headerColor: '#194880',
|
|
352
|
+
showHeaderLogo: false,
|
|
353
|
+
closeOnBackdropClick: true,
|
|
354
|
+
title: html `Select filters`,
|
|
355
|
+
});
|
|
356
|
+
(_a = this.modalManager) === null || _a === void 0 ? void 0 : _a.classList.add('more-search-facets');
|
|
357
|
+
(_b = this.modalManager) === null || _b === void 0 ? void 0 : _b.showModal({
|
|
358
|
+
config,
|
|
359
|
+
customModalContent,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Generate the list template for each bucket in a facet group
|
|
364
|
+
*/
|
|
365
|
+
getFacetTemplate(facetGroup) {
|
|
381
366
|
return html `
|
|
382
367
|
<facets-template
|
|
383
368
|
.facetGroup=${facetGroup}
|
|
384
369
|
.selectedFacets=${this.selectedFacets}
|
|
385
370
|
.renderOn=${'page'}
|
|
386
371
|
.collectionNameCache=${this.collectionNameCache}
|
|
387
|
-
@selectedFacetsChanged=${(e) => {
|
|
388
|
-
const event = new CustomEvent('facetsChanged', {
|
|
389
|
-
detail: e.detail,
|
|
390
|
-
bubbles: true,
|
|
391
|
-
composed: true,
|
|
392
|
-
});
|
|
393
|
-
this.dispatchEvent(event);
|
|
372
|
+
@selectedFacetsChanged=${(e) => {
|
|
373
|
+
const event = new CustomEvent('facetsChanged', {
|
|
374
|
+
detail: e.detail,
|
|
375
|
+
bubbles: true,
|
|
376
|
+
composed: true,
|
|
377
|
+
});
|
|
378
|
+
this.dispatchEvent(event);
|
|
394
379
|
}}
|
|
395
380
|
></facets-template>
|
|
396
|
-
`;
|
|
397
|
-
}
|
|
398
|
-
static get styles() {
|
|
381
|
+
`;
|
|
382
|
+
}
|
|
383
|
+
static get styles() {
|
|
399
384
|
return css `
|
|
400
385
|
#container.loading {
|
|
401
386
|
opacity: 0.5;
|
|
@@ -477,80 +462,77 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
477
462
|
height: 15px;
|
|
478
463
|
cursor: pointer;
|
|
479
464
|
}
|
|
480
|
-
`;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
__decorate([
|
|
484
|
-
property({ type: Object })
|
|
485
|
-
], CollectionFacets.prototype, "searchService", void 0);
|
|
486
|
-
__decorate([
|
|
487
|
-
property({ type: String })
|
|
488
|
-
], CollectionFacets.prototype, "searchType", void 0);
|
|
489
|
-
__decorate([
|
|
490
|
-
property({ type: Object })
|
|
491
|
-
], CollectionFacets.prototype, "aggregations", void 0);
|
|
492
|
-
__decorate([
|
|
493
|
-
property({ type: Object })
|
|
494
|
-
], CollectionFacets.prototype, "fullYearsHistogramAggregation", void 0);
|
|
495
|
-
__decorate([
|
|
496
|
-
property({ type: String })
|
|
497
|
-
], CollectionFacets.prototype, "minSelectedDate", void 0);
|
|
498
|
-
__decorate([
|
|
499
|
-
property({ type: String })
|
|
500
|
-
], CollectionFacets.prototype, "maxSelectedDate", void 0);
|
|
501
|
-
__decorate([
|
|
502
|
-
property({ type: Boolean })
|
|
503
|
-
], CollectionFacets.prototype, "moreLinksVisible", void 0);
|
|
504
|
-
__decorate([
|
|
505
|
-
property({ type: Boolean })
|
|
506
|
-
], CollectionFacets.prototype, "facetsLoading", void 0);
|
|
507
|
-
__decorate([
|
|
508
|
-
property({ type: Boolean })
|
|
509
|
-
], CollectionFacets.prototype, "fullYearAggregationLoading", void 0);
|
|
510
|
-
__decorate([
|
|
511
|
-
property({ type: Object })
|
|
512
|
-
], CollectionFacets.prototype, "selectedFacets", void 0);
|
|
513
|
-
__decorate([
|
|
514
|
-
property({ type: Boolean })
|
|
515
|
-
], CollectionFacets.prototype, "collapsableFacets", void 0);
|
|
516
|
-
__decorate([
|
|
517
|
-
property({ type: Boolean })
|
|
518
|
-
], CollectionFacets.prototype, "showHistogramDatePicker", void 0);
|
|
519
|
-
__decorate([
|
|
520
|
-
property({ type: String })
|
|
521
|
-
], CollectionFacets.prototype, "query", void 0);
|
|
522
|
-
__decorate([
|
|
523
|
-
property({ type: Object })
|
|
524
|
-
], CollectionFacets.prototype, "filterMap", void 0);
|
|
525
|
-
__decorate([
|
|
526
|
-
property({ type: Object, attribute: false })
|
|
527
|
-
], CollectionFacets.prototype, "modalManager", void 0);
|
|
528
|
-
__decorate([
|
|
529
|
-
property({ type: Object, attribute: false })
|
|
530
|
-
], CollectionFacets.prototype, "resizeObserver", void 0);
|
|
531
|
-
__decorate([
|
|
532
|
-
property({ type: Object, attribute: false })
|
|
533
|
-
], CollectionFacets.prototype, "featureFeedbackService", void 0);
|
|
534
|
-
__decorate([
|
|
535
|
-
property({ type: Object, attribute: false })
|
|
536
|
-
], CollectionFacets.prototype, "recaptchaManager", void 0);
|
|
537
|
-
__decorate([
|
|
538
|
-
property({ type: Object, attribute: false })
|
|
539
|
-
], CollectionFacets.prototype, "analyticsHandler", void 0);
|
|
540
|
-
__decorate([
|
|
541
|
-
property({ type: Object, attribute: false })
|
|
542
|
-
], CollectionFacets.prototype, "
|
|
543
|
-
__decorate([
|
|
544
|
-
property({ type:
|
|
545
|
-
], CollectionFacets.prototype, "
|
|
546
|
-
__decorate([
|
|
547
|
-
|
|
548
|
-
], CollectionFacets.prototype, "
|
|
549
|
-
__decorate([
|
|
550
|
-
|
|
551
|
-
], CollectionFacets
|
|
552
|
-
CollectionFacets
|
|
553
|
-
customElement('collection-facets')
|
|
554
|
-
], CollectionFacets);
|
|
555
|
-
export { CollectionFacets };
|
|
465
|
+
`;
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
__decorate([
|
|
469
|
+
property({ type: Object })
|
|
470
|
+
], CollectionFacets.prototype, "searchService", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
property({ type: String })
|
|
473
|
+
], CollectionFacets.prototype, "searchType", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
property({ type: Object })
|
|
476
|
+
], CollectionFacets.prototype, "aggregations", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
property({ type: Object })
|
|
479
|
+
], CollectionFacets.prototype, "fullYearsHistogramAggregation", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
property({ type: String })
|
|
482
|
+
], CollectionFacets.prototype, "minSelectedDate", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
property({ type: String })
|
|
485
|
+
], CollectionFacets.prototype, "maxSelectedDate", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
property({ type: Boolean })
|
|
488
|
+
], CollectionFacets.prototype, "moreLinksVisible", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
property({ type: Boolean })
|
|
491
|
+
], CollectionFacets.prototype, "facetsLoading", void 0);
|
|
492
|
+
__decorate([
|
|
493
|
+
property({ type: Boolean })
|
|
494
|
+
], CollectionFacets.prototype, "fullYearAggregationLoading", void 0);
|
|
495
|
+
__decorate([
|
|
496
|
+
property({ type: Object })
|
|
497
|
+
], CollectionFacets.prototype, "selectedFacets", void 0);
|
|
498
|
+
__decorate([
|
|
499
|
+
property({ type: Boolean })
|
|
500
|
+
], CollectionFacets.prototype, "collapsableFacets", void 0);
|
|
501
|
+
__decorate([
|
|
502
|
+
property({ type: Boolean })
|
|
503
|
+
], CollectionFacets.prototype, "showHistogramDatePicker", void 0);
|
|
504
|
+
__decorate([
|
|
505
|
+
property({ type: String })
|
|
506
|
+
], CollectionFacets.prototype, "query", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
property({ type: Object })
|
|
509
|
+
], CollectionFacets.prototype, "filterMap", void 0);
|
|
510
|
+
__decorate([
|
|
511
|
+
property({ type: Object, attribute: false })
|
|
512
|
+
], CollectionFacets.prototype, "modalManager", void 0);
|
|
513
|
+
__decorate([
|
|
514
|
+
property({ type: Object, attribute: false })
|
|
515
|
+
], CollectionFacets.prototype, "resizeObserver", void 0);
|
|
516
|
+
__decorate([
|
|
517
|
+
property({ type: Object, attribute: false })
|
|
518
|
+
], CollectionFacets.prototype, "featureFeedbackService", void 0);
|
|
519
|
+
__decorate([
|
|
520
|
+
property({ type: Object, attribute: false })
|
|
521
|
+
], CollectionFacets.prototype, "recaptchaManager", void 0);
|
|
522
|
+
__decorate([
|
|
523
|
+
property({ type: Object, attribute: false })
|
|
524
|
+
], CollectionFacets.prototype, "analyticsHandler", void 0);
|
|
525
|
+
__decorate([
|
|
526
|
+
property({ type: Object, attribute: false })
|
|
527
|
+
], CollectionFacets.prototype, "collectionNameCache", void 0);
|
|
528
|
+
__decorate([
|
|
529
|
+
property({ type: Function })
|
|
530
|
+
], CollectionFacets.prototype, "onFacetClick", void 0);
|
|
531
|
+
__decorate([
|
|
532
|
+
state()
|
|
533
|
+
], CollectionFacets.prototype, "openFacets", void 0);
|
|
534
|
+
CollectionFacets = __decorate([
|
|
535
|
+
customElement('collection-facets')
|
|
536
|
+
], CollectionFacets);
|
|
537
|
+
export { CollectionFacets };
|
|
556
538
|
//# sourceMappingURL=collection-facets.js.map
|