@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,41 +1,38 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html, css, nothing, } from 'lit';
|
|
3
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
|
-
import
|
|
5
|
-
import '
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html, css, nothing, } from 'lit';
|
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
|
+
import '@internetarchive/ia-dropdown';
|
|
5
|
+
import { SortField, SortFieldDisplayName, } from '../models';
|
|
6
|
+
import './alpha-bar';
|
|
7
|
+
import { sortIcon } from './img/sort-triangle';
|
|
8
|
+
import { tileIcon } from './img/tile';
|
|
9
|
+
import { listIcon } from './img/list';
|
|
10
|
+
import { compactIcon } from './img/compact';
|
|
11
|
+
let SortFilterBar = class SortFilterBar extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.sortDirection = null;
|
|
15
|
+
this.selectedSort = SortField.relevance;
|
|
16
|
+
this.selectedTitleFilter = null;
|
|
17
|
+
this.selectedCreatorFilter = null;
|
|
18
|
+
this.showRelevance = true;
|
|
19
|
+
this.alphaSelectorVisible = null;
|
|
20
|
+
this.dateSortSelectorVisible = false;
|
|
21
|
+
this.viewSortSelectorVisible = false;
|
|
22
|
+
this.desktopSortContainerWidth = 0;
|
|
23
|
+
this.selectorBarContainerWidth = 0;
|
|
24
|
+
this.hoveringOverDateSortOptions = false;
|
|
25
|
+
this.boundSortBarSelectorEscapeListener = (e) => {
|
|
26
|
+
if (e.key === 'Escape') {
|
|
27
|
+
this.viewSortSelectorVisible = false;
|
|
28
|
+
this.dateSortSelectorVisible = false;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
32
33
|
return html `
|
|
33
34
|
<div id="container">
|
|
34
35
|
<div id="sort-bar">
|
|
35
|
-
<div id="sort-direction-container">
|
|
36
|
-
${this.sortDirectionSelectorTemplate}
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
36
|
<div id="sort-selector-container">
|
|
40
37
|
${this.mobileSortSelectorTemplate}
|
|
41
38
|
${this.desktopSortSelectorTemplate}
|
|
@@ -44,280 +41,340 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
44
41
|
<div id="display-style-selector">${this.displayOptionTemplate}</div>
|
|
45
42
|
</div>
|
|
46
43
|
|
|
47
|
-
${this.viewSortSelectorVisible && !this.mobileSelectorVisible
|
|
48
|
-
? this.
|
|
44
|
+
${this.viewSortSelectorVisible && !this.mobileSelectorVisible
|
|
45
|
+
? this.dropdownBackdrop
|
|
49
46
|
: nothing}
|
|
50
|
-
${this.dateSortSelectorVisible && !this.mobileSelectorVisible
|
|
51
|
-
? this.
|
|
47
|
+
${this.dateSortSelectorVisible && !this.mobileSelectorVisible
|
|
48
|
+
? this.dropdownBackdrop
|
|
52
49
|
: nothing}
|
|
53
50
|
${this.alphaBarTemplate}
|
|
54
|
-
|
|
55
|
-
<div id="bottom-shadow"></div>
|
|
56
51
|
</div>
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
updated(changed) {
|
|
60
|
-
if (changed.has('displayMode')) {
|
|
61
|
-
this.displayModeChanged();
|
|
62
|
-
}
|
|
63
|
-
if (changed.has('selectedSort') && this.sortDirection === null) {
|
|
64
|
-
this.sortDirection = 'desc';
|
|
65
|
-
}
|
|
66
|
-
if (changed.has('selectedTitleFilter') && this.selectedTitleFilter) {
|
|
67
|
-
this.alphaSelectorVisible = 'title';
|
|
68
|
-
}
|
|
69
|
-
if (changed.has('selectedCreatorFilter') && this.selectedCreatorFilter) {
|
|
70
|
-
this.alphaSelectorVisible = 'creator';
|
|
71
|
-
}
|
|
72
|
-
if (changed.has('dateSortSelectorVisible') ||
|
|
73
|
-
changed.has('viewSortSelectorVisible')) {
|
|
74
|
-
this.setupEscapeListeners();
|
|
75
|
-
}
|
|
76
|
-
if (changed.has('resizeObserver')) {
|
|
77
|
-
const oldObserver = changed.get('resizeObserver');
|
|
78
|
-
if (oldObserver)
|
|
79
|
-
this.disconnectResizeObserver(oldObserver);
|
|
80
|
-
this.setupResizeObserver();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
setupEscapeListeners() {
|
|
84
|
-
if (this.dateSortSelectorVisible || this.viewSortSelectorVisible) {
|
|
85
|
-
document.addEventListener('keydown', this.boundSortBarSelectorEscapeListener);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
document.removeEventListener('keydown', this.boundSortBarSelectorEscapeListener);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
disconnectedCallback() {
|
|
92
|
-
if (this.resizeObserver) {
|
|
93
|
-
this.disconnectResizeObserver(this.resizeObserver);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
disconnectResizeObserver(resizeObserver) {
|
|
97
|
-
resizeObserver.removeObserver({
|
|
98
|
-
target: this.sortSelectorContainer,
|
|
99
|
-
handler: this,
|
|
100
|
-
});
|
|
101
|
-
resizeObserver.removeObserver({
|
|
102
|
-
target: this.
|
|
103
|
-
handler: this,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
setupResizeObserver() {
|
|
107
|
-
if (!this.resizeObserver)
|
|
108
|
-
return;
|
|
109
|
-
this.resizeObserver.addObserver({
|
|
110
|
-
target: this.sortSelectorContainer,
|
|
111
|
-
handler: this,
|
|
112
|
-
});
|
|
113
|
-
this.resizeObserver.addObserver({
|
|
114
|
-
target: this.
|
|
115
|
-
handler: this,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
get mobileSelectorVisible() {
|
|
119
|
-
return this.selectorBarContainerWidth - 10 < this.
|
|
120
|
-
}
|
|
121
|
-
get alphaBarTemplate() {
|
|
122
|
-
if (!['title', 'creator'].includes(this.selectedSort))
|
|
123
|
-
return nothing;
|
|
124
|
-
if (this.alphaSelectorVisible === null) {
|
|
125
|
-
if (this.selectedSort === 'creator')
|
|
126
|
-
return this.creatorSelectorBar;
|
|
127
|
-
if (this.selectedSort === 'title')
|
|
128
|
-
return this.titleSelectorBar;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
return this.alphaSelectorVisible === 'creator'
|
|
132
|
-
? this.creatorSelectorBar
|
|
133
|
-
: this.titleSelectorBar;
|
|
134
|
-
}
|
|
135
|
-
return nothing;
|
|
136
|
-
}
|
|
137
|
-
handleResize(entry) {
|
|
138
|
-
if (entry.target === this.
|
|
139
|
-
this.
|
|
140
|
-
}
|
|
141
|
-
else if (entry.target === this.sortSelectorContainer) {
|
|
142
|
-
this.selectorBarContainerWidth = entry.contentRect.width;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
get sortDirectionSelectorTemplate() {
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
updated(changed) {
|
|
55
|
+
if (changed.has('displayMode')) {
|
|
56
|
+
this.displayModeChanged();
|
|
57
|
+
}
|
|
58
|
+
if (changed.has('selectedSort') && this.sortDirection === null) {
|
|
59
|
+
this.sortDirection = 'desc';
|
|
60
|
+
}
|
|
61
|
+
if (changed.has('selectedTitleFilter') && this.selectedTitleFilter) {
|
|
62
|
+
this.alphaSelectorVisible = 'title';
|
|
63
|
+
}
|
|
64
|
+
if (changed.has('selectedCreatorFilter') && this.selectedCreatorFilter) {
|
|
65
|
+
this.alphaSelectorVisible = 'creator';
|
|
66
|
+
}
|
|
67
|
+
if (changed.has('dateSortSelectorVisible') ||
|
|
68
|
+
changed.has('viewSortSelectorVisible')) {
|
|
69
|
+
this.setupEscapeListeners();
|
|
70
|
+
}
|
|
71
|
+
if (changed.has('resizeObserver')) {
|
|
72
|
+
const oldObserver = changed.get('resizeObserver');
|
|
73
|
+
if (oldObserver)
|
|
74
|
+
this.disconnectResizeObserver(oldObserver);
|
|
75
|
+
this.setupResizeObserver();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
setupEscapeListeners() {
|
|
79
|
+
if (this.dateSortSelectorVisible || this.viewSortSelectorVisible) {
|
|
80
|
+
document.addEventListener('keydown', this.boundSortBarSelectorEscapeListener);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
document.removeEventListener('keydown', this.boundSortBarSelectorEscapeListener);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
if (this.resizeObserver) {
|
|
88
|
+
this.disconnectResizeObserver(this.resizeObserver);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
disconnectResizeObserver(resizeObserver) {
|
|
92
|
+
resizeObserver.removeObserver({
|
|
93
|
+
target: this.sortSelectorContainer,
|
|
94
|
+
handler: this,
|
|
95
|
+
});
|
|
96
|
+
resizeObserver.removeObserver({
|
|
97
|
+
target: this.desktopSortContainer,
|
|
98
|
+
handler: this,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
setupResizeObserver() {
|
|
102
|
+
if (!this.resizeObserver)
|
|
103
|
+
return;
|
|
104
|
+
this.resizeObserver.addObserver({
|
|
105
|
+
target: this.sortSelectorContainer,
|
|
106
|
+
handler: this,
|
|
107
|
+
});
|
|
108
|
+
this.resizeObserver.addObserver({
|
|
109
|
+
target: this.desktopSortContainer,
|
|
110
|
+
handler: this,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
get mobileSelectorVisible() {
|
|
114
|
+
return this.selectorBarContainerWidth - 10 < this.desktopSortContainerWidth;
|
|
115
|
+
}
|
|
116
|
+
get alphaBarTemplate() {
|
|
117
|
+
if (!['title', 'creator'].includes(this.selectedSort))
|
|
118
|
+
return nothing;
|
|
119
|
+
if (this.alphaSelectorVisible === null) {
|
|
120
|
+
if (this.selectedSort === 'creator')
|
|
121
|
+
return this.creatorSelectorBar;
|
|
122
|
+
if (this.selectedSort === 'title')
|
|
123
|
+
return this.titleSelectorBar;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return this.alphaSelectorVisible === 'creator'
|
|
127
|
+
? this.creatorSelectorBar
|
|
128
|
+
: this.titleSelectorBar;
|
|
129
|
+
}
|
|
130
|
+
return nothing;
|
|
131
|
+
}
|
|
132
|
+
handleResize(entry) {
|
|
133
|
+
if (entry.target === this.desktopSortContainer) {
|
|
134
|
+
this.desktopSortContainerWidth = entry.contentRect.width;
|
|
135
|
+
}
|
|
136
|
+
else if (entry.target === this.sortSelectorContainer) {
|
|
137
|
+
this.selectorBarContainerWidth = entry.contentRect.width;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
get sortDirectionSelectorTemplate() {
|
|
146
141
|
return html `
|
|
147
|
-
<
|
|
148
|
-
|
|
142
|
+
<button
|
|
143
|
+
id="sort-direction-selector"
|
|
144
|
+
?disabled=${this.selectedSort === 'relevance'}
|
|
145
|
+
@click=${this.toggleSortDirection}
|
|
146
|
+
>
|
|
147
|
+
<div
|
|
149
148
|
id="sort-ascending-btn"
|
|
150
149
|
class="sort-button ${this.sortDirection === 'asc' ? 'selected' : ''}"
|
|
151
|
-
?disabled=${this.selectedSort === 'relevance'}
|
|
152
|
-
@click=${() => {
|
|
153
|
-
this.setSortDirections('asc');
|
|
154
|
-
}}
|
|
155
150
|
>
|
|
156
151
|
${sortIcon}
|
|
157
|
-
</
|
|
158
|
-
<
|
|
152
|
+
</div>
|
|
153
|
+
<div
|
|
159
154
|
id="sort-descending-btn"
|
|
160
155
|
class="sort-button ${this.sortDirection === 'desc' ? 'selected' : ''}"
|
|
161
|
-
?disabled=${this.selectedSort === 'relevance'}
|
|
162
|
-
@click=${() => {
|
|
163
|
-
this.setSortDirections('desc');
|
|
164
|
-
}}
|
|
165
156
|
>
|
|
166
157
|
${sortIcon}
|
|
167
|
-
</
|
|
168
|
-
</
|
|
169
|
-
`;
|
|
170
|
-
}
|
|
171
|
-
get desktopSortSelectorTemplate() {
|
|
158
|
+
</div>
|
|
159
|
+
</button>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
get desktopSortSelectorTemplate() {
|
|
172
163
|
return html `
|
|
173
|
-
<
|
|
174
|
-
id="desktop-sort-
|
|
164
|
+
<div
|
|
165
|
+
id="desktop-sort-container"
|
|
175
166
|
class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
|
|
176
167
|
>
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
${this.
|
|
180
|
-
|
|
168
|
+
<span id="sort-by-text">Sort by</span>
|
|
169
|
+
<div id="sort-direction-container">
|
|
170
|
+
${this.sortDirectionSelectorTemplate}
|
|
171
|
+
</div>
|
|
172
|
+
<ul id="desktop-sort-selector">
|
|
173
|
+
<li>
|
|
174
|
+
${this.showRelevance
|
|
175
|
+
? this.getSortDisplayOption(SortField.relevance)
|
|
181
176
|
: nothing}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
this.
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
177
|
+
</li>
|
|
178
|
+
<li>
|
|
179
|
+
${this.getSortDropdown({
|
|
180
|
+
optionSelectedHandler: () => {
|
|
181
|
+
this.dateSortSelectorVisible = false;
|
|
182
|
+
this.alphaSelectorVisible = null;
|
|
183
|
+
this.selectedTitleFilter = null;
|
|
184
|
+
this.selectedCreatorFilter = null;
|
|
185
|
+
this.emitTitleLetterChangedEvent();
|
|
186
|
+
this.emitCreatorLetterChangedEvent();
|
|
187
|
+
},
|
|
188
|
+
clickHandler: () => {
|
|
189
|
+
if (!this.viewsDropdown.open && !this.viewOptionSelected)
|
|
190
|
+
this.setSelectedSort(SortField.weeklyview);
|
|
191
|
+
this.dateDropdown.open = false;
|
|
192
|
+
this.viewSortSelectorVisible = this.viewsDropdown.open;
|
|
193
|
+
this.viewsDropdown.classList.toggle('open', this.viewsDropdown.open);
|
|
194
|
+
},
|
|
195
|
+
displayName: html `${this.viewSortField}`,
|
|
196
|
+
id: 'views-dropdown',
|
|
197
|
+
isSelected: () => this.viewOptionSelected,
|
|
198
|
+
dropdownOptions: [
|
|
199
|
+
this.getDropdownOption(SortField.weeklyview),
|
|
200
|
+
this.getDropdownOption(SortField.alltimeview),
|
|
201
|
+
],
|
|
202
|
+
selectedOption: this.viewOptionSelected ? this.selectedSort : '',
|
|
198
203
|
})}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
clickEvent: () => {
|
|
203
|
-
this.alphaSelectorVisible = 'title';
|
|
204
|
-
this.selectedCreatorFilter = null;
|
|
205
|
-
this.dateSortSelectorVisible = false;
|
|
206
|
-
this.viewSortSelectorVisible = false;
|
|
207
|
-
this.setSelectedSort(SortField.title);
|
|
208
|
-
this.emitCreatorLetterChangedEvent();
|
|
209
|
-
},
|
|
204
|
+
</li>
|
|
205
|
+
<li>
|
|
206
|
+
${this.getSortDisplayOption(SortField.title, {
|
|
207
|
+
clickEvent: () => {
|
|
208
|
+
this.alphaSelectorVisible = 'title';
|
|
209
|
+
this.selectedCreatorFilter = null;
|
|
210
|
+
this.dateSortSelectorVisible = false;
|
|
211
|
+
this.viewSortSelectorVisible = false;
|
|
212
|
+
this.setSelectedSort(SortField.title);
|
|
213
|
+
this.emitCreatorLetterChangedEvent();
|
|
214
|
+
},
|
|
210
215
|
})}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
this.
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
this.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
216
|
+
</li>
|
|
217
|
+
<li>
|
|
218
|
+
${this.getSortDropdown({
|
|
219
|
+
optionSelectedHandler: () => {
|
|
220
|
+
this.viewSortSelectorVisible = false;
|
|
221
|
+
this.alphaSelectorVisible = null;
|
|
222
|
+
this.selectedTitleFilter = null;
|
|
223
|
+
this.selectedCreatorFilter = null;
|
|
224
|
+
this.emitTitleLetterChangedEvent();
|
|
225
|
+
this.emitCreatorLetterChangedEvent();
|
|
226
|
+
},
|
|
227
|
+
clickHandler: () => {
|
|
228
|
+
if (!this.dateDropdown.open && !this.dateOptionSelected)
|
|
229
|
+
this.setSelectedSort(SortField.date);
|
|
230
|
+
this.viewsDropdown.open = false;
|
|
231
|
+
this.dateSortSelectorVisible = this.dateDropdown.open;
|
|
232
|
+
this.dateDropdown.classList.toggle('open', this.dateDropdown.open);
|
|
233
|
+
},
|
|
234
|
+
displayName: html `${this.dateSortField}`,
|
|
235
|
+
id: 'date-dropdown',
|
|
236
|
+
isSelected: () => this.dateOptionSelected,
|
|
237
|
+
dropdownOptions: [
|
|
238
|
+
this.getDropdownOption(SortField.date),
|
|
239
|
+
this.getDropdownOption(SortField.datearchived),
|
|
240
|
+
this.getDropdownOption(SortField.datereviewed),
|
|
241
|
+
this.getDropdownOption(SortField.dateadded),
|
|
242
|
+
],
|
|
243
|
+
selectedOption: this.dateOptionSelected ? this.selectedSort : '',
|
|
227
244
|
})}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
clickEvent: () => {
|
|
232
|
-
this.alphaSelectorVisible = 'creator';
|
|
233
|
-
this.selectedTitleFilter = null;
|
|
234
|
-
this.dateSortSelectorVisible = false;
|
|
235
|
-
this.setSelectedSort(SortField.creator);
|
|
236
|
-
this.emitTitleLetterChangedEvent();
|
|
237
|
-
},
|
|
245
|
+
</li>
|
|
246
|
+
<li>
|
|
247
|
+
${this.getSortDisplayOption(SortField.creator, {
|
|
248
|
+
clickEvent: () => {
|
|
249
|
+
this.alphaSelectorVisible = 'creator';
|
|
250
|
+
this.selectedTitleFilter = null;
|
|
251
|
+
this.dateSortSelectorVisible = false;
|
|
252
|
+
this.setSelectedSort(SortField.creator);
|
|
253
|
+
this.emitTitleLetterChangedEvent();
|
|
254
|
+
},
|
|
238
255
|
})}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* @param
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const
|
|
256
|
+
</li>
|
|
257
|
+
</ul>
|
|
258
|
+
</div>
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* This generates each of the sort option links.
|
|
263
|
+
*
|
|
264
|
+
* It manages the display value and the selected state of the option.
|
|
265
|
+
*
|
|
266
|
+
* @param sortField
|
|
267
|
+
* @param options {
|
|
268
|
+
* additionalClickEvent?: () => void; If this is provided, it will also be called when the option is clicked.
|
|
269
|
+
* displayName?: TemplateResult; The name to display for the option. Defaults to the sortField display name.
|
|
270
|
+
* isSelected?: () => boolean; A function that returns true if the option is selected. Defaults to the selectedSort === sortField.
|
|
271
|
+
* }
|
|
272
|
+
* @returns
|
|
273
|
+
*/
|
|
274
|
+
getSortDisplayOption(sortField, options) {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
const isSelected = (_a = options === null || options === void 0 ? void 0 : options.isSelected) !== null && _a !== void 0 ? _a : (() => this.selectedSort === sortField);
|
|
277
|
+
const displayName = (_b = options === null || options === void 0 ? void 0 : options.displayName) !== null && _b !== void 0 ? _b : SortFieldDisplayName[sortField];
|
|
260
278
|
return html `
|
|
261
279
|
<a
|
|
262
280
|
href="#"
|
|
263
|
-
@click=${(e) => {
|
|
264
|
-
e.preventDefault();
|
|
265
|
-
if (options === null || options === void 0 ? void 0 : options.clickEvent) {
|
|
266
|
-
options.clickEvent(e);
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
this.alphaSelectorVisible = null;
|
|
270
|
-
this.dateSortSelectorVisible = false;
|
|
271
|
-
this.selectedTitleFilter = null;
|
|
272
|
-
this.selectedCreatorFilter = null;
|
|
273
|
-
this.setSelectedSort(sortField);
|
|
274
|
-
this.emitTitleLetterChangedEvent();
|
|
275
|
-
this.emitCreatorLetterChangedEvent();
|
|
276
|
-
}
|
|
281
|
+
@click=${(e) => {
|
|
282
|
+
e.preventDefault();
|
|
283
|
+
if (options === null || options === void 0 ? void 0 : options.clickEvent) {
|
|
284
|
+
options.clickEvent(e);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
this.alphaSelectorVisible = null;
|
|
288
|
+
this.dateSortSelectorVisible = false;
|
|
289
|
+
this.selectedTitleFilter = null;
|
|
290
|
+
this.selectedCreatorFilter = null;
|
|
291
|
+
this.setSelectedSort(sortField);
|
|
292
|
+
this.emitTitleLetterChangedEvent();
|
|
293
|
+
this.emitCreatorLetterChangedEvent();
|
|
294
|
+
}
|
|
277
295
|
}}
|
|
278
|
-
class=${isSelected() ? 'selected' :
|
|
296
|
+
class=${isSelected() ? 'selected' : nothing}
|
|
279
297
|
>
|
|
280
298
|
${displayName}
|
|
281
299
|
</a>
|
|
282
|
-
`;
|
|
283
|
-
}
|
|
284
|
-
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
getSortDropdown(options) {
|
|
303
|
+
var _a, _b, _c, _d, _e;
|
|
285
304
|
return html `
|
|
286
|
-
<
|
|
287
|
-
id=
|
|
288
|
-
|
|
305
|
+
<ia-dropdown
|
|
306
|
+
id=${(_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : nothing}
|
|
307
|
+
class=${((_b = options === null || options === void 0 ? void 0 : options.isSelected) === null || _b === void 0 ? void 0 : _b.call(options)) ? 'selected' : nothing}
|
|
308
|
+
displayCaret
|
|
309
|
+
closeOnSelect
|
|
310
|
+
includeSelectedOption
|
|
311
|
+
.openViaButton=${false}
|
|
312
|
+
.options=${options === null || options === void 0 ? void 0 : options.dropdownOptions}
|
|
313
|
+
.selectedOption=${options === null || options === void 0 ? void 0 : options.selectedOption}
|
|
314
|
+
@optionSelected=${(_c = options === null || options === void 0 ? void 0 : options.optionSelectedHandler) !== null && _c !== void 0 ? _c : nothing}
|
|
315
|
+
@click=${(_d = options === null || options === void 0 ? void 0 : options.clickHandler) !== null && _d !== void 0 ? _d : nothing}
|
|
316
|
+
>
|
|
317
|
+
<span class="dropdown-label" slot="dropdown-label">
|
|
318
|
+
${(_e = options === null || options === void 0 ? void 0 : options.displayName) !== null && _e !== void 0 ? _e : ''}
|
|
319
|
+
</span>
|
|
320
|
+
</ia-dropdown>
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
getDropdownOption(sortField) {
|
|
324
|
+
return {
|
|
325
|
+
id: sortField,
|
|
326
|
+
selectedHandler: () => {
|
|
327
|
+
this.selectDropdownSortField(sortField);
|
|
328
|
+
},
|
|
329
|
+
label: html `
|
|
330
|
+
<span class="dropdown-option-label">
|
|
331
|
+
${SortFieldDisplayName[sortField]}
|
|
332
|
+
</span>
|
|
333
|
+
`,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
get mobileSortSelectorTemplate() {
|
|
337
|
+
return html `
|
|
338
|
+
<div
|
|
339
|
+
id="mobile-sort-container"
|
|
289
340
|
class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
|
|
290
341
|
>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
342
|
+
<span id="sort-by-text">Sort by</span>
|
|
343
|
+
<div id="sort-direction-container">
|
|
344
|
+
${this.sortDirectionSelectorTemplate}
|
|
345
|
+
</div>
|
|
346
|
+
<select id="mobile-sort-selector" @change=${this.mobileSortChanged}>
|
|
347
|
+
${Object.keys(SortField).map(field => html `
|
|
348
|
+
<option value="${field}" ?selected=${this.selectedSort === field}>
|
|
349
|
+
${SortFieldDisplayName[field]}
|
|
350
|
+
</option>
|
|
351
|
+
`)}
|
|
352
|
+
</select>
|
|
353
|
+
</div>
|
|
354
|
+
`;
|
|
355
|
+
}
|
|
356
|
+
mobileSortChanged(e) {
|
|
357
|
+
const target = e.target;
|
|
358
|
+
const sortField = target.value;
|
|
359
|
+
this.setSelectedSort(sortField);
|
|
360
|
+
this.alphaSelectorVisible = null;
|
|
361
|
+
if (sortField !== 'title' && this.selectedTitleFilter) {
|
|
362
|
+
this.selectedTitleFilter = null;
|
|
363
|
+
this.emitTitleLetterChangedEvent();
|
|
364
|
+
}
|
|
365
|
+
if (sortField !== 'creator' && this.selectedCreatorFilter) {
|
|
366
|
+
this.selectedCreatorFilter = null;
|
|
367
|
+
this.emitCreatorLetterChangedEvent();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
get displayOptionTemplate() {
|
|
314
371
|
return html `
|
|
315
372
|
<ul>
|
|
316
373
|
<li>
|
|
317
374
|
<button
|
|
318
375
|
id="grid-button"
|
|
319
|
-
@click=${() => {
|
|
320
|
-
this.displayMode = 'grid';
|
|
376
|
+
@click=${() => {
|
|
377
|
+
this.displayMode = 'grid';
|
|
321
378
|
}}
|
|
322
379
|
class=${this.displayMode === 'grid' ? 'active' : ''}
|
|
323
380
|
title="Tile view"
|
|
@@ -328,8 +385,8 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
328
385
|
<li>
|
|
329
386
|
<button
|
|
330
387
|
id="list-detail-button"
|
|
331
|
-
@click=${() => {
|
|
332
|
-
this.displayMode = 'list-detail';
|
|
388
|
+
@click=${() => {
|
|
389
|
+
this.displayMode = 'list-detail';
|
|
333
390
|
}}
|
|
334
391
|
class=${this.displayMode === 'list-detail' ? 'active' : ''}
|
|
335
392
|
title="List view"
|
|
@@ -340,8 +397,8 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
340
397
|
<li>
|
|
341
398
|
<button
|
|
342
399
|
id="list-compact-button"
|
|
343
|
-
@click=${() => {
|
|
344
|
-
this.displayMode = 'list-compact';
|
|
400
|
+
@click=${() => {
|
|
401
|
+
this.displayMode = 'list-compact';
|
|
345
402
|
}}
|
|
346
403
|
class=${this.displayMode === 'list-compact' ? 'active' : ''}
|
|
347
404
|
title="Compact list view"
|
|
@@ -350,195 +407,161 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
350
407
|
</button>
|
|
351
408
|
</li>
|
|
352
409
|
</ul>
|
|
353
|
-
`;
|
|
354
|
-
}
|
|
355
|
-
get
|
|
356
|
-
return html `
|
|
357
|
-
<div
|
|
358
|
-
id="date-sort-selector-backdrop"
|
|
359
|
-
@keyup=${() => {
|
|
360
|
-
this.dateSortSelectorVisible = false;
|
|
361
|
-
}}
|
|
362
|
-
@click=${() => {
|
|
363
|
-
this.dateSortSelectorVisible = false;
|
|
364
|
-
}}
|
|
365
|
-
></div>
|
|
366
|
-
<div id="date-sort-selector">
|
|
367
|
-
<ul>
|
|
368
|
-
<li>${this.getDateSortButton(SortField.datearchived)}</li>
|
|
369
|
-
<li>${this.getDateSortButton(SortField.date)}</li>
|
|
370
|
-
<li>${this.getDateSortButton(SortField.datereviewed)}</li>
|
|
371
|
-
<li>${this.getDateSortButton(SortField.dateadded)}</li>
|
|
372
|
-
</ul>
|
|
373
|
-
</div>
|
|
374
|
-
`;
|
|
375
|
-
}
|
|
376
|
-
get viewSortSelector() {
|
|
410
|
+
`;
|
|
411
|
+
}
|
|
412
|
+
get dropdownBackdrop() {
|
|
377
413
|
return html `
|
|
378
414
|
<div
|
|
379
|
-
id="
|
|
380
|
-
@keyup=${
|
|
381
|
-
|
|
382
|
-
}}
|
|
383
|
-
@click=${() => {
|
|
384
|
-
this.viewSortSelectorVisible = false;
|
|
385
|
-
}}
|
|
415
|
+
id="sort-selector-backdrop"
|
|
416
|
+
@keyup=${this.closeDropdowns}
|
|
417
|
+
@click=${this.closeDropdowns}
|
|
386
418
|
></div>
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
this.
|
|
409
|
-
this.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
var _a;
|
|
482
|
-
const defaultSort = SortFieldDisplayName[SortField.weeklyview];
|
|
483
|
-
const name = this.viewOptionSelected
|
|
484
|
-
? (_a = SortFieldDisplayName[this.selectedSort]) !== null && _a !== void 0 ? _a : defaultSort
|
|
485
|
-
: defaultSort;
|
|
486
|
-
return name;
|
|
487
|
-
}
|
|
488
|
-
get titleSelectorBar() {
|
|
489
|
-
var _a;
|
|
419
|
+
`;
|
|
420
|
+
}
|
|
421
|
+
closeDropdowns() {
|
|
422
|
+
this.viewsDropdown.open = false;
|
|
423
|
+
this.dateDropdown.open = false;
|
|
424
|
+
this.viewSortSelectorVisible = false;
|
|
425
|
+
this.dateSortSelectorVisible = false;
|
|
426
|
+
}
|
|
427
|
+
selectDropdownSortField(sortField) {
|
|
428
|
+
this.dateSortSelectorVisible = false;
|
|
429
|
+
this.viewSortSelectorVisible = false;
|
|
430
|
+
this.setSelectedSort(sortField);
|
|
431
|
+
}
|
|
432
|
+
setSortDirection(sortDirection) {
|
|
433
|
+
this.sortDirection = sortDirection;
|
|
434
|
+
this.emitSortChangedEvent();
|
|
435
|
+
}
|
|
436
|
+
toggleSortDirection() {
|
|
437
|
+
this.setSortDirection(this.sortDirection === 'desc' ? 'asc' : 'desc');
|
|
438
|
+
}
|
|
439
|
+
setSelectedSort(sort) {
|
|
440
|
+
this.selectedSort = sort;
|
|
441
|
+
this.emitSortChangedEvent();
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* There are four date sort options.
|
|
445
|
+
*
|
|
446
|
+
* This checks to see if the current sort is one of them.
|
|
447
|
+
*
|
|
448
|
+
* @readonly
|
|
449
|
+
* @private
|
|
450
|
+
* @type {boolean}
|
|
451
|
+
* @memberof SortFilterBar
|
|
452
|
+
*/
|
|
453
|
+
get dateOptionSelected() {
|
|
454
|
+
const dateSortFields = [
|
|
455
|
+
SortField.datearchived,
|
|
456
|
+
SortField.date,
|
|
457
|
+
SortField.datereviewed,
|
|
458
|
+
SortField.dateadded,
|
|
459
|
+
];
|
|
460
|
+
return dateSortFields.includes(this.selectedSort);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* There are two view sort options.
|
|
464
|
+
*
|
|
465
|
+
* This checks to see if the current sort is one of them.
|
|
466
|
+
*
|
|
467
|
+
* @readonly
|
|
468
|
+
* @private
|
|
469
|
+
* @type {boolean}
|
|
470
|
+
* @memberof SortFilterBar
|
|
471
|
+
*/
|
|
472
|
+
get viewOptionSelected() {
|
|
473
|
+
const viewSortFields = [
|
|
474
|
+
SortField.alltimeview,
|
|
475
|
+
SortField.weeklyview,
|
|
476
|
+
];
|
|
477
|
+
return viewSortFields.includes(this.selectedSort);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* The display name of the current date field
|
|
481
|
+
*
|
|
482
|
+
* @readonly
|
|
483
|
+
* @private
|
|
484
|
+
* @type {string}
|
|
485
|
+
* @memberof SortFilterBar
|
|
486
|
+
*/
|
|
487
|
+
get dateSortField() {
|
|
488
|
+
var _a;
|
|
489
|
+
const defaultSort = SortFieldDisplayName[SortField.date];
|
|
490
|
+
const name = this.dateOptionSelected
|
|
491
|
+
? (_a = SortFieldDisplayName[this.selectedSort]) !== null && _a !== void 0 ? _a : defaultSort
|
|
492
|
+
: defaultSort;
|
|
493
|
+
return name;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The display name of the current view field
|
|
497
|
+
*
|
|
498
|
+
* @readonly
|
|
499
|
+
* @private
|
|
500
|
+
* @type {string}
|
|
501
|
+
* @memberof SortFilterBar
|
|
502
|
+
*/
|
|
503
|
+
get viewSortField() {
|
|
504
|
+
var _a;
|
|
505
|
+
const defaultSort = SortFieldDisplayName[SortField.weeklyview];
|
|
506
|
+
const name = this.viewOptionSelected
|
|
507
|
+
? (_a = SortFieldDisplayName[this.selectedSort]) !== null && _a !== void 0 ? _a : defaultSort
|
|
508
|
+
: defaultSort;
|
|
509
|
+
return name;
|
|
510
|
+
}
|
|
511
|
+
get titleSelectorBar() {
|
|
512
|
+
var _a;
|
|
490
513
|
return html ` <alpha-bar
|
|
491
514
|
.selectedLetter=${this.selectedTitleFilter}
|
|
492
515
|
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
|
|
493
516
|
@letterChanged=${this.titleLetterChanged}
|
|
494
|
-
></alpha-bar>`;
|
|
495
|
-
}
|
|
496
|
-
get creatorSelectorBar() {
|
|
497
|
-
var _a;
|
|
517
|
+
></alpha-bar>`;
|
|
518
|
+
}
|
|
519
|
+
get creatorSelectorBar() {
|
|
520
|
+
var _a;
|
|
498
521
|
return html ` <alpha-bar
|
|
499
522
|
.selectedLetter=${this.selectedCreatorFilter}
|
|
500
523
|
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
|
|
501
524
|
@letterChanged=${this.creatorLetterChanged}
|
|
502
|
-
></alpha-bar>`;
|
|
503
|
-
}
|
|
504
|
-
titleLetterChanged(e) {
|
|
505
|
-
var _a;
|
|
506
|
-
this.selectedTitleFilter = (_a = e.detail.selectedLetter) !== null && _a !== void 0 ? _a : null;
|
|
507
|
-
this.emitTitleLetterChangedEvent();
|
|
508
|
-
}
|
|
509
|
-
creatorLetterChanged(e) {
|
|
510
|
-
var _a;
|
|
511
|
-
this.selectedCreatorFilter = (_a = e.detail.selectedLetter) !== null && _a !== void 0 ? _a : null;
|
|
512
|
-
this.emitCreatorLetterChangedEvent();
|
|
513
|
-
}
|
|
514
|
-
emitTitleLetterChangedEvent() {
|
|
515
|
-
const event = new CustomEvent('titleLetterChanged', {
|
|
516
|
-
detail: { selectedLetter: this.selectedTitleFilter },
|
|
517
|
-
});
|
|
518
|
-
this.dispatchEvent(event);
|
|
519
|
-
}
|
|
520
|
-
emitCreatorLetterChangedEvent() {
|
|
521
|
-
const event = new CustomEvent('creatorLetterChanged', {
|
|
522
|
-
detail: { selectedLetter: this.selectedCreatorFilter },
|
|
523
|
-
});
|
|
524
|
-
this.dispatchEvent(event);
|
|
525
|
-
}
|
|
526
|
-
displayModeChanged() {
|
|
527
|
-
const event = new CustomEvent('displayModeChanged', {
|
|
528
|
-
detail: { displayMode: this.displayMode },
|
|
529
|
-
});
|
|
530
|
-
this.dispatchEvent(event);
|
|
531
|
-
}
|
|
532
|
-
emitSortChangedEvent() {
|
|
533
|
-
const event = new CustomEvent('sortChanged', {
|
|
534
|
-
detail: {
|
|
535
|
-
selectedSort: this.selectedSort,
|
|
536
|
-
sortDirection: this.sortDirection,
|
|
537
|
-
},
|
|
538
|
-
});
|
|
539
|
-
this.dispatchEvent(event);
|
|
540
|
-
}
|
|
541
|
-
};
|
|
525
|
+
></alpha-bar>`;
|
|
526
|
+
}
|
|
527
|
+
titleLetterChanged(e) {
|
|
528
|
+
var _a;
|
|
529
|
+
this.selectedTitleFilter = (_a = e.detail.selectedLetter) !== null && _a !== void 0 ? _a : null;
|
|
530
|
+
this.emitTitleLetterChangedEvent();
|
|
531
|
+
}
|
|
532
|
+
creatorLetterChanged(e) {
|
|
533
|
+
var _a;
|
|
534
|
+
this.selectedCreatorFilter = (_a = e.detail.selectedLetter) !== null && _a !== void 0 ? _a : null;
|
|
535
|
+
this.emitCreatorLetterChangedEvent();
|
|
536
|
+
}
|
|
537
|
+
emitTitleLetterChangedEvent() {
|
|
538
|
+
const event = new CustomEvent('titleLetterChanged', {
|
|
539
|
+
detail: { selectedLetter: this.selectedTitleFilter },
|
|
540
|
+
});
|
|
541
|
+
this.dispatchEvent(event);
|
|
542
|
+
}
|
|
543
|
+
emitCreatorLetterChangedEvent() {
|
|
544
|
+
const event = new CustomEvent('creatorLetterChanged', {
|
|
545
|
+
detail: { selectedLetter: this.selectedCreatorFilter },
|
|
546
|
+
});
|
|
547
|
+
this.dispatchEvent(event);
|
|
548
|
+
}
|
|
549
|
+
displayModeChanged() {
|
|
550
|
+
const event = new CustomEvent('displayModeChanged', {
|
|
551
|
+
detail: { displayMode: this.displayMode },
|
|
552
|
+
});
|
|
553
|
+
this.dispatchEvent(event);
|
|
554
|
+
}
|
|
555
|
+
emitSortChangedEvent() {
|
|
556
|
+
const event = new CustomEvent('sortChanged', {
|
|
557
|
+
detail: {
|
|
558
|
+
selectedSort: this.selectedSort,
|
|
559
|
+
sortDirection: this.sortDirection,
|
|
560
|
+
},
|
|
561
|
+
});
|
|
562
|
+
this.dispatchEvent(event);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
542
565
|
SortFilterBar.styles = css `
|
|
543
566
|
#container {
|
|
544
567
|
position: relative;
|
|
@@ -547,9 +570,8 @@ SortFilterBar.styles = css `
|
|
|
547
570
|
#sort-bar {
|
|
548
571
|
display: flex;
|
|
549
572
|
justify-content: space-between;
|
|
550
|
-
border: 1px solid
|
|
573
|
+
border-bottom: 1px solid #2c2c2c;
|
|
551
574
|
align-items: center;
|
|
552
|
-
padding: 0.5rem 1.5rem;
|
|
553
575
|
}
|
|
554
576
|
|
|
555
577
|
#sort-direction-container {
|
|
@@ -557,14 +579,10 @@ SortFilterBar.styles = css `
|
|
|
557
579
|
}
|
|
558
580
|
|
|
559
581
|
#sort-by-text {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
height: 1px;
|
|
565
|
-
width: 100%;
|
|
566
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
|
567
|
-
background-color: #bbb;
|
|
582
|
+
margin-right: 10px;
|
|
583
|
+
font-size: 1.4rem;
|
|
584
|
+
font-weight: bold;
|
|
585
|
+
white-space: nowrap;
|
|
568
586
|
}
|
|
569
587
|
|
|
570
588
|
ul {
|
|
@@ -579,12 +597,28 @@ SortFilterBar.styles = css `
|
|
|
579
597
|
padding: 0;
|
|
580
598
|
}
|
|
581
599
|
|
|
600
|
+
#sort-direction-selector {
|
|
601
|
+
display: flex;
|
|
602
|
+
flex-direction: column;
|
|
603
|
+
margin-right: 5px;
|
|
604
|
+
padding: 0;
|
|
605
|
+
border: none;
|
|
606
|
+
appearance: none;
|
|
607
|
+
background: transparent;
|
|
608
|
+
cursor: pointer;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
#sort-direction-selector:disabled {
|
|
612
|
+
cursor: default;
|
|
613
|
+
}
|
|
614
|
+
|
|
582
615
|
.sort-button {
|
|
616
|
+
display: flex;
|
|
617
|
+
align-items: center;
|
|
583
618
|
background: none;
|
|
584
619
|
color: inherit;
|
|
585
620
|
border: none;
|
|
586
621
|
padding: 0;
|
|
587
|
-
cursor: pointer;
|
|
588
622
|
outline: inherit;
|
|
589
623
|
width: 12px;
|
|
590
624
|
height: 12px;
|
|
@@ -595,9 +629,8 @@ SortFilterBar.styles = css `
|
|
|
595
629
|
opacity: 1;
|
|
596
630
|
}
|
|
597
631
|
|
|
598
|
-
|
|
632
|
+
#sort-direction-selector:disabled .sort-button {
|
|
599
633
|
opacity: 0.25;
|
|
600
|
-
cursor: default;
|
|
601
634
|
}
|
|
602
635
|
|
|
603
636
|
#date-sort-selector,
|
|
@@ -648,42 +681,45 @@ SortFilterBar.styles = css `
|
|
|
648
681
|
transform: rotate(180deg);
|
|
649
682
|
}
|
|
650
683
|
|
|
651
|
-
#sort-
|
|
684
|
+
#sort-selector-container {
|
|
685
|
+
flex: 1;
|
|
652
686
|
display: flex;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
margin-right: 1rem;
|
|
687
|
+
justify-content: flex-start;
|
|
688
|
+
align-items: center;
|
|
656
689
|
}
|
|
657
690
|
|
|
658
|
-
#sort-
|
|
659
|
-
|
|
691
|
+
#desktop-sort-container,
|
|
692
|
+
#mobile-sort-container {
|
|
693
|
+
display: flex;
|
|
694
|
+
justify-content: flex-start;
|
|
695
|
+
align-items: center;
|
|
660
696
|
}
|
|
661
697
|
|
|
662
698
|
/*
|
|
663
699
|
we move the desktop sort selector offscreen instead of display: none
|
|
664
700
|
because we need to observe the width of it vs its container to determine
|
|
665
|
-
if it's wide enough to display the desktop version and if you
|
|
701
|
+
if it's wide enough to display the desktop version and if you display: none,
|
|
666
702
|
the width becomes 0
|
|
667
703
|
*/
|
|
668
|
-
#desktop-sort-
|
|
704
|
+
#desktop-sort-container.hidden {
|
|
669
705
|
position: absolute;
|
|
670
706
|
top: -9999px;
|
|
671
707
|
left: -9999px;
|
|
708
|
+
visibility: hidden;
|
|
672
709
|
}
|
|
673
710
|
|
|
674
|
-
#mobile-sort-
|
|
711
|
+
#mobile-sort-container.hidden {
|
|
675
712
|
display: none;
|
|
676
713
|
}
|
|
677
714
|
|
|
678
|
-
#
|
|
679
|
-
#view-sort-selector-backdrop {
|
|
715
|
+
#sort-selector-backdrop {
|
|
680
716
|
position: fixed;
|
|
681
717
|
top: 0;
|
|
682
718
|
left: 0;
|
|
683
|
-
width:
|
|
684
|
-
height:
|
|
719
|
+
width: 100vw;
|
|
720
|
+
height: 100vh;
|
|
685
721
|
z-index: 1;
|
|
686
|
-
background-color:
|
|
722
|
+
background-color: transparent;
|
|
687
723
|
}
|
|
688
724
|
|
|
689
725
|
#desktop-sort-selector {
|
|
@@ -693,30 +729,22 @@ SortFilterBar.styles = css `
|
|
|
693
729
|
#desktop-sort-selector li {
|
|
694
730
|
display: flex;
|
|
695
731
|
align-items: center;
|
|
732
|
+
padding-left: 5px;
|
|
733
|
+
padding-right: 5px;
|
|
696
734
|
}
|
|
697
735
|
|
|
698
736
|
#desktop-sort-selector li a {
|
|
737
|
+
padding: 0 5px;
|
|
699
738
|
text-decoration: none;
|
|
700
|
-
text-transform: uppercase;
|
|
701
739
|
font-size: 1.4rem;
|
|
702
740
|
color: #333;
|
|
703
|
-
line-height: 2
|
|
741
|
+
line-height: 2;
|
|
704
742
|
}
|
|
705
743
|
|
|
706
744
|
#desktop-sort-selector li a.selected {
|
|
707
745
|
font-weight: bold;
|
|
708
746
|
}
|
|
709
747
|
|
|
710
|
-
#desktop-sort-selector li::after {
|
|
711
|
-
content: '•';
|
|
712
|
-
padding-left: 1rem;
|
|
713
|
-
padding-right: 1rem;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
#desktop-sort-selector li:first-child::after {
|
|
717
|
-
content: '';
|
|
718
|
-
}
|
|
719
|
-
|
|
720
748
|
#desktop-sort-selector li:last-child::after {
|
|
721
749
|
content: '';
|
|
722
750
|
}
|
|
@@ -732,7 +760,7 @@ SortFilterBar.styles = css `
|
|
|
732
760
|
appearance: none;
|
|
733
761
|
cursor: pointer;
|
|
734
762
|
-webkit-appearance: none;
|
|
735
|
-
opacity: 0.
|
|
763
|
+
opacity: 0.3;
|
|
736
764
|
}
|
|
737
765
|
|
|
738
766
|
#display-style-selector button.active {
|
|
@@ -743,57 +771,95 @@ SortFilterBar.styles = css `
|
|
|
743
771
|
width: 24px;
|
|
744
772
|
height: 24px;
|
|
745
773
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
774
|
+
|
|
775
|
+
ia-dropdown {
|
|
776
|
+
--dropdownTextColor: white;
|
|
777
|
+
--dropdownFontSize: 1.4rem;
|
|
778
|
+
--dropdownOffsetTop: 0;
|
|
779
|
+
--dropdownBorderTopWidth: 0;
|
|
780
|
+
--dropdownBorderTopLeftRadius: 0;
|
|
781
|
+
--dropdownBorderTopRightRadius: 0;
|
|
782
|
+
--dropdownWhiteSpace: nowrap;
|
|
783
|
+
--dropdownListZIndex: 2;
|
|
784
|
+
--dropdownCaretColor: #2c2c2c;
|
|
785
|
+
--dropdownSelectedTextColor: white;
|
|
786
|
+
--dropdownSelectedBgColor: #2c2c2c;
|
|
787
|
+
--caretHeight: 9px;
|
|
788
|
+
--caretWidth: 14px;
|
|
789
|
+
}
|
|
790
|
+
ia-dropdown.selected .dropdown-label {
|
|
791
|
+
font-weight: bold;
|
|
792
|
+
}
|
|
793
|
+
ia-dropdown.open {
|
|
794
|
+
z-index: 2;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.dropdown-label {
|
|
798
|
+
display: inline-block;
|
|
799
|
+
height: 100%;
|
|
800
|
+
padding-left: 5px;
|
|
801
|
+
font-size: 1.4rem;
|
|
802
|
+
line-height: 2;
|
|
803
|
+
color: #2c2c2c;
|
|
804
|
+
white-space: nowrap;
|
|
805
|
+
}
|
|
806
|
+
`;
|
|
807
|
+
__decorate([
|
|
808
|
+
property({ type: String })
|
|
809
|
+
], SortFilterBar.prototype, "displayMode", void 0);
|
|
810
|
+
__decorate([
|
|
811
|
+
property({ type: String })
|
|
812
|
+
], SortFilterBar.prototype, "sortDirection", void 0);
|
|
813
|
+
__decorate([
|
|
814
|
+
property({ type: String })
|
|
815
|
+
], SortFilterBar.prototype, "selectedSort", void 0);
|
|
816
|
+
__decorate([
|
|
817
|
+
property({ type: String })
|
|
818
|
+
], SortFilterBar.prototype, "selectedTitleFilter", void 0);
|
|
819
|
+
__decorate([
|
|
820
|
+
property({ type: String })
|
|
821
|
+
], SortFilterBar.prototype, "selectedCreatorFilter", void 0);
|
|
822
|
+
__decorate([
|
|
823
|
+
property({ type: Boolean })
|
|
824
|
+
], SortFilterBar.prototype, "showRelevance", void 0);
|
|
825
|
+
__decorate([
|
|
826
|
+
property({ type: Object })
|
|
827
|
+
], SortFilterBar.prototype, "prefixFilterCountMap", void 0);
|
|
828
|
+
__decorate([
|
|
829
|
+
property({ type: Object })
|
|
830
|
+
], SortFilterBar.prototype, "resizeObserver", void 0);
|
|
831
|
+
__decorate([
|
|
832
|
+
state()
|
|
833
|
+
], SortFilterBar.prototype, "alphaSelectorVisible", void 0);
|
|
834
|
+
__decorate([
|
|
835
|
+
state()
|
|
836
|
+
], SortFilterBar.prototype, "dateSortSelectorVisible", void 0);
|
|
837
|
+
__decorate([
|
|
838
|
+
state()
|
|
839
|
+
], SortFilterBar.prototype, "viewSortSelectorVisible", void 0);
|
|
840
|
+
__decorate([
|
|
841
|
+
state()
|
|
842
|
+
], SortFilterBar.prototype, "desktopSortContainerWidth", void 0);
|
|
843
|
+
__decorate([
|
|
844
|
+
state()
|
|
845
|
+
], SortFilterBar.prototype, "selectorBarContainerWidth", void 0);
|
|
846
|
+
__decorate([
|
|
847
|
+
state()
|
|
848
|
+
], SortFilterBar.prototype, "hoveringOverDateSortOptions", void 0);
|
|
849
|
+
__decorate([
|
|
850
|
+
query('#desktop-sort-container')
|
|
851
|
+
], SortFilterBar.prototype, "desktopSortContainer", void 0);
|
|
852
|
+
__decorate([
|
|
853
|
+
query('#sort-selector-container')
|
|
854
|
+
], SortFilterBar.prototype, "sortSelectorContainer", void 0);
|
|
855
|
+
__decorate([
|
|
856
|
+
query('#views-dropdown')
|
|
857
|
+
], SortFilterBar.prototype, "viewsDropdown", void 0);
|
|
858
|
+
__decorate([
|
|
859
|
+
query('#date-dropdown')
|
|
860
|
+
], SortFilterBar.prototype, "dateDropdown", void 0);
|
|
861
|
+
SortFilterBar = __decorate([
|
|
862
|
+
customElement('sort-filter-bar')
|
|
863
|
+
], SortFilterBar);
|
|
864
|
+
export { SortFilterBar };
|
|
799
865
|
//# sourceMappingURL=sort-filter-bar.js.map
|