@internetarchive/collection-browser 0.4.18-alpha.6 → 0.4.18
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/dist/src/collection-browser.d.ts +1 -8
- package/dist/src/collection-browser.js +291 -318
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +0 -2
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.js +70 -63
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.js +55 -49
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.js +56 -46
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.d.ts +1 -1
- package/dist/src/collection-facets.js +84 -94
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +1 -2
- package/dist/src/sort-filter-bar/alpha-bar.js +25 -33
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +186 -198
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +1 -1
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +2 -2
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +15 -5
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +65 -58
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +2 -3
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-facets.test.js +5 -8
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +2 -2
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/package.json +5 -5
- package/src/collection-browser.ts +293 -321
- package/src/collection-facets/facets-template.ts +0 -2
- package/src/collection-facets/more-facets-content.ts +70 -63
- package/src/collection-facets/more-facets-pagination.ts +55 -49
- package/src/collection-facets/toggle-switch.ts +61 -51
- package/src/collection-facets.ts +85 -96
- package/src/sort-filter-bar/alpha-bar.ts +18 -26
- package/src/sort-filter-bar/sort-filter-bar.ts +186 -200
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +2 -2
- package/src/tiles/grid/item-tile.ts +2 -2
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +15 -5
- package/src/tiles/grid/tile-stats.ts +73 -66
- package/src/tiles/tile-dispatcher.ts +0 -1
- package/test/collection-facets.test.ts +2 -10
- package/test/sort-filter-bar/alpha-bar.test.ts +12 -16
- package/test/sort-filter-bar/sort-filter-bar.test.ts +2 -2
- package/dist/src/styles/sr-only.d.ts +0 -1
- package/dist/src/styles/sr-only.js +0 -18
- package/dist/src/styles/sr-only.js.map +0 -1
- package/src/styles/sr-only.ts +0 -18
|
@@ -10,7 +10,6 @@ import { sortDisabledIcon } from './img/sort-toggle-disabled';
|
|
|
10
10
|
import { tileIcon } from './img/tile';
|
|
11
11
|
import { listIcon } from './img/list';
|
|
12
12
|
import { compactIcon } from './img/compact';
|
|
13
|
-
import { srOnlyStyle } from '../styles/sr-only';
|
|
14
13
|
let SortFilterBar = class SortFilterBar extends LitElement {
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
@@ -53,7 +52,7 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
53
52
|
render() {
|
|
54
53
|
return html `
|
|
55
54
|
<div id="container">
|
|
56
|
-
<
|
|
55
|
+
<div id="sort-bar">
|
|
57
56
|
<div class="sort-direction-container">
|
|
58
57
|
${this.sortDirectionSelectorTemplate}
|
|
59
58
|
</div>
|
|
@@ -65,7 +64,7 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
65
64
|
</div>
|
|
66
65
|
|
|
67
66
|
<div id="display-style-selector">${this.displayOptionTemplate}</div>
|
|
68
|
-
</
|
|
67
|
+
</div>
|
|
69
68
|
|
|
70
69
|
${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
|
|
71
70
|
${this.alphaBarTemplate}
|
|
@@ -167,15 +166,12 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
167
166
|
}
|
|
168
167
|
/** Template to render the sort direction toggle button */
|
|
169
168
|
get sortDirectionSelectorTemplate() {
|
|
170
|
-
const oppositeSortDirectionReadable = this.sortDirection === 'asc' ? 'descending' : 'ascending';
|
|
171
|
-
const srLabel = `Change to ${oppositeSortDirectionReadable} sort`;
|
|
172
169
|
return html `
|
|
173
170
|
<button
|
|
174
171
|
class="sort-direction-selector"
|
|
175
172
|
?disabled=${this.selectedSort === 'relevance'}
|
|
176
173
|
@click=${this.toggleSortDirection}
|
|
177
174
|
>
|
|
178
|
-
<span class="sr-only">${srLabel}</span>
|
|
179
175
|
${this.sortDirectionIcon}
|
|
180
176
|
</button>
|
|
181
177
|
`;
|
|
@@ -603,7 +599,6 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
603
599
|
return html ` <alpha-bar
|
|
604
600
|
.selectedLetter=${this.selectedTitleFilter}
|
|
605
601
|
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
|
|
606
|
-
ariaLandmarkLabel="Filter by title letter"
|
|
607
602
|
@letterChanged=${this.titleLetterChanged}
|
|
608
603
|
></alpha-bar>`;
|
|
609
604
|
}
|
|
@@ -612,7 +607,6 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
612
607
|
return html ` <alpha-bar
|
|
613
608
|
.selectedLetter=${this.selectedCreatorFilter}
|
|
614
609
|
.letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
|
|
615
|
-
ariaLandmarkLabel="Filter by creator letter"
|
|
616
610
|
@letterChanged=${this.creatorLetterChanged}
|
|
617
611
|
></alpha-bar>`;
|
|
618
612
|
}
|
|
@@ -653,223 +647,217 @@ let SortFilterBar = class SortFilterBar extends LitElement {
|
|
|
653
647
|
});
|
|
654
648
|
this.dispatchEvent(event);
|
|
655
649
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
position: relative;
|
|
662
|
-
}
|
|
650
|
+
};
|
|
651
|
+
SortFilterBar.styles = css `
|
|
652
|
+
#container {
|
|
653
|
+
position: relative;
|
|
654
|
+
}
|
|
663
655
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
656
|
+
#sort-bar {
|
|
657
|
+
display: flex;
|
|
658
|
+
justify-content: space-between;
|
|
659
|
+
align-items: center;
|
|
660
|
+
border-bottom: 1px solid #2c2c2c;
|
|
661
|
+
font-size: 1.4rem;
|
|
662
|
+
}
|
|
671
663
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
664
|
+
ul {
|
|
665
|
+
list-style: none;
|
|
666
|
+
display: flex;
|
|
667
|
+
align-items: center;
|
|
668
|
+
margin: 0;
|
|
669
|
+
padding: 0;
|
|
670
|
+
}
|
|
679
671
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
672
|
+
li {
|
|
673
|
+
padding: 0;
|
|
674
|
+
}
|
|
683
675
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
676
|
+
.sort-by-text {
|
|
677
|
+
margin-right: 5px;
|
|
678
|
+
font-weight: bold;
|
|
679
|
+
white-space: nowrap;
|
|
680
|
+
}
|
|
689
681
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
682
|
+
.sort-direction-container {
|
|
683
|
+
display: flex;
|
|
684
|
+
align-self: stretch;
|
|
685
|
+
flex: 0;
|
|
686
|
+
margin: 0 5px;
|
|
687
|
+
}
|
|
696
688
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
689
|
+
.sort-direction-selector {
|
|
690
|
+
padding: 0;
|
|
691
|
+
border: none;
|
|
692
|
+
appearance: none;
|
|
693
|
+
background: transparent;
|
|
694
|
+
cursor: pointer;
|
|
695
|
+
}
|
|
704
696
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
697
|
+
.sort-direction-selector:disabled {
|
|
698
|
+
cursor: default;
|
|
699
|
+
}
|
|
708
700
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
701
|
+
.sort-direction-icon {
|
|
702
|
+
display: flex;
|
|
703
|
+
align-items: center;
|
|
704
|
+
background: none;
|
|
705
|
+
color: inherit;
|
|
706
|
+
border: none;
|
|
707
|
+
padding: 0;
|
|
708
|
+
outline: inherit;
|
|
709
|
+
width: 14px;
|
|
710
|
+
height: 14px;
|
|
711
|
+
}
|
|
720
712
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
713
|
+
.sort-direction-icon > svg {
|
|
714
|
+
flex: 1;
|
|
715
|
+
}
|
|
724
716
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
717
|
+
#date-sort-selector,
|
|
718
|
+
#view-sort-selector {
|
|
719
|
+
position: absolute;
|
|
720
|
+
left: 150px;
|
|
721
|
+
top: 45px;
|
|
730
722
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
723
|
+
z-index: 1;
|
|
724
|
+
padding: 1rem;
|
|
725
|
+
background-color: white;
|
|
726
|
+
border-radius: 2.5rem;
|
|
727
|
+
border: 1px solid #404142;
|
|
728
|
+
}
|
|
737
729
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
730
|
+
#sort-selector-container {
|
|
731
|
+
flex: 1;
|
|
732
|
+
display: flex;
|
|
733
|
+
justify-content: flex-start;
|
|
734
|
+
align-items: center;
|
|
735
|
+
}
|
|
744
736
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
737
|
+
#desktop-sort-container,
|
|
738
|
+
#mobile-sort-container {
|
|
739
|
+
display: flex;
|
|
740
|
+
justify-content: flex-start;
|
|
741
|
+
align-items: center;
|
|
742
|
+
}
|
|
751
743
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
744
|
+
/*
|
|
745
|
+
we move the desktop sort selector offscreen instead of display: none
|
|
746
|
+
because we need to observe the width of it vs its container to determine
|
|
747
|
+
if it's wide enough to display the desktop version and if you display: none,
|
|
748
|
+
the width becomes 0
|
|
749
|
+
*/
|
|
750
|
+
#desktop-sort-container.hidden {
|
|
751
|
+
position: absolute;
|
|
752
|
+
top: -9999px;
|
|
753
|
+
left: -9999px;
|
|
754
|
+
visibility: hidden;
|
|
755
|
+
}
|
|
764
756
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
757
|
+
#mobile-sort-container.hidden {
|
|
758
|
+
display: none;
|
|
759
|
+
}
|
|
768
760
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
761
|
+
#sort-selector-backdrop {
|
|
762
|
+
position: fixed;
|
|
763
|
+
top: 0;
|
|
764
|
+
left: 0;
|
|
765
|
+
width: 100vw;
|
|
766
|
+
height: 100vh;
|
|
767
|
+
z-index: 1;
|
|
768
|
+
background-color: transparent;
|
|
769
|
+
}
|
|
778
770
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
771
|
+
#desktop-sort-selector {
|
|
772
|
+
display: inline-flex;
|
|
773
|
+
}
|
|
782
774
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
775
|
+
#desktop-sort-selector li {
|
|
776
|
+
display: flex;
|
|
777
|
+
align-items: center;
|
|
778
|
+
padding-left: 5px;
|
|
779
|
+
padding-right: 5px;
|
|
780
|
+
}
|
|
789
781
|
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
782
|
+
#desktop-sort-selector li a {
|
|
783
|
+
padding: 0 5px;
|
|
784
|
+
text-decoration: none;
|
|
785
|
+
color: #333;
|
|
786
|
+
line-height: 2;
|
|
787
|
+
}
|
|
796
788
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}
|
|
789
|
+
#desktop-sort-selector li button {
|
|
790
|
+
padding: 0px 5px;
|
|
791
|
+
border: none;
|
|
792
|
+
background: none;
|
|
793
|
+
font-size: inherit;
|
|
794
|
+
color: #333;
|
|
795
|
+
line-height: 2;
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
appearance: none;
|
|
798
|
+
}
|
|
808
799
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
800
|
+
#desktop-sort-selector li button.selected {
|
|
801
|
+
font-weight: bold;
|
|
802
|
+
}
|
|
812
803
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
804
|
+
#display-style-selector {
|
|
805
|
+
flex: 0;
|
|
806
|
+
}
|
|
816
807
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
808
|
+
#display-style-selector button {
|
|
809
|
+
background: none;
|
|
810
|
+
color: inherit;
|
|
811
|
+
border: none;
|
|
812
|
+
appearance: none;
|
|
813
|
+
cursor: pointer;
|
|
814
|
+
-webkit-appearance: none;
|
|
815
|
+
fill: #bbbbbb;
|
|
816
|
+
}
|
|
826
817
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
818
|
+
#display-style-selector button.active {
|
|
819
|
+
fill: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
820
|
+
}
|
|
830
821
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
822
|
+
#display-style-selector button svg {
|
|
823
|
+
width: 24px;
|
|
824
|
+
height: 24px;
|
|
825
|
+
}
|
|
835
826
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
827
|
+
ia-dropdown {
|
|
828
|
+
--dropdownTextColor: white;
|
|
829
|
+
--dropdownOffsetTop: 0;
|
|
830
|
+
--dropdownBorderTopWidth: 0;
|
|
831
|
+
--dropdownBorderTopLeftRadius: 0;
|
|
832
|
+
--dropdownBorderTopRightRadius: 0;
|
|
833
|
+
--dropdownWhiteSpace: nowrap;
|
|
834
|
+
--dropdownListZIndex: 2;
|
|
835
|
+
--dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
836
|
+
--dropdownSelectedTextColor: white;
|
|
837
|
+
--dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
|
|
838
|
+
--dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
|
|
839
|
+
--caretHeight: 9px;
|
|
840
|
+
--caretWidth: 12px;
|
|
841
|
+
--caretPadding: 0 5px 0 0;
|
|
842
|
+
}
|
|
843
|
+
ia-dropdown.selected .dropdown-label {
|
|
844
|
+
font-weight: bold;
|
|
845
|
+
}
|
|
846
|
+
ia-dropdown.open {
|
|
847
|
+
z-index: 2;
|
|
848
|
+
}
|
|
858
849
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
];
|
|
871
|
-
}
|
|
872
|
-
};
|
|
850
|
+
.dropdown-label {
|
|
851
|
+
display: inline-block;
|
|
852
|
+
height: 100%;
|
|
853
|
+
padding-left: 5px;
|
|
854
|
+
font-size: 1.4rem;
|
|
855
|
+
line-height: 2;
|
|
856
|
+
color: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
857
|
+
white-space: nowrap;
|
|
858
|
+
user-select: none;
|
|
859
|
+
}
|
|
860
|
+
`;
|
|
873
861
|
__decorate([
|
|
874
862
|
property({ type: String })
|
|
875
863
|
], SortFilterBar.prototype, "displayMode", void 0);
|