@internetarchive/collection-browser 3.0.5 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- 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/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/collection-browser.d.ts +5 -0
- package/dist/src/collection-browser.js +690 -681
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +46 -34
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +1 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +1 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/test/collection-browser.test.js +196 -183
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +24 -1
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +1 -2
- package/dist/test/collection-facets.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +117 -117
- package/renovate.json +6 -6
- package/src/collection-browser.ts +2788 -2776
- package/src/collection-facets/facet-row.ts +49 -36
- package/src/data-source/collection-browser-data-source.ts +1391 -1390
- package/src/data-source/collection-browser-query-state.ts +64 -63
- package/test/collection-browser.test.ts +2359 -2340
- package/test/collection-facets/facet-row.test.ts +34 -1
- package/test/collection-facets.test.ts +0 -4
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -16,6 +16,7 @@ import type {
|
|
|
16
16
|
FacetState,
|
|
17
17
|
} from '../models';
|
|
18
18
|
import type { CollectionTitles } from '../data-source/models';
|
|
19
|
+
import { srOnlyStyle } from '../styles/sr-only';
|
|
19
20
|
|
|
20
21
|
@customElement('facet-row')
|
|
21
22
|
export class FacetRow extends LitElement {
|
|
@@ -98,26 +99,29 @@ export class FacetRow extends LitElement {
|
|
|
98
99
|
id=${showOnlyCheckboxId}
|
|
99
100
|
data-testid=${showOnlyCheckboxId}
|
|
100
101
|
/>
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
<div class="hide-facet-container">
|
|
103
|
+
<input
|
|
104
|
+
type="checkbox"
|
|
105
|
+
id=${negativeCheckboxId}
|
|
106
|
+
.name=${facetType}
|
|
107
|
+
.value=${bucket.key}
|
|
108
|
+
@click=${(e: Event) => {
|
|
109
|
+
this.facetClicked(e, true);
|
|
110
|
+
}}
|
|
111
|
+
.checked=${facetHidden}
|
|
112
|
+
class="hide-facet-checkbox"
|
|
113
|
+
/>
|
|
114
|
+
<label
|
|
115
|
+
for=${negativeCheckboxId}
|
|
116
|
+
class="hide-facet-icon${facetHidden ? ' active' : ''}"
|
|
117
|
+
title=${showHideText}
|
|
118
|
+
data-testid=${negativeCheckboxId}
|
|
119
|
+
>
|
|
120
|
+
<span class="sr-only">${showHideText}</span>
|
|
121
|
+
<span class="eye eye-open">${eyeIcon}</span>
|
|
122
|
+
<span class="eye eye-closed">${eyeClosedIcon}</span>
|
|
123
|
+
</label>
|
|
124
|
+
</div>
|
|
121
125
|
</div>
|
|
122
126
|
<label
|
|
123
127
|
for=${showOnlyCheckboxId}
|
|
@@ -191,22 +195,20 @@ export class FacetRow extends LitElement {
|
|
|
191
195
|
static get styles(): CSSResultGroup {
|
|
192
196
|
const facetRowBorderTop = css`var(--facet-row-border-top, 1px solid transparent)`;
|
|
193
197
|
const facetRowBorderBottom = css`var(--facet-row-border-bottom, 1px solid transparent)`;
|
|
198
|
+
const checkboxHeight = css`15px`;
|
|
194
199
|
|
|
195
|
-
|
|
196
|
-
async-collection-name {
|
|
197
|
-
display: contents;
|
|
198
|
-
}
|
|
200
|
+
const ownCss = css`
|
|
199
201
|
.facet-checkboxes {
|
|
200
202
|
margin: 0 5px 0 0;
|
|
201
203
|
display: flex;
|
|
202
|
-
height:
|
|
204
|
+
height: ${checkboxHeight};
|
|
203
205
|
}
|
|
204
206
|
.facet-checkboxes input:first-child {
|
|
205
207
|
margin-right: 5px;
|
|
206
208
|
}
|
|
207
209
|
.facet-checkboxes input {
|
|
208
|
-
height:
|
|
209
|
-
width:
|
|
210
|
+
height: ${checkboxHeight};
|
|
211
|
+
width: ${checkboxHeight};
|
|
210
212
|
margin: 0;
|
|
211
213
|
}
|
|
212
214
|
.facet-row-container {
|
|
@@ -218,7 +220,6 @@ export class FacetRow extends LitElement {
|
|
|
218
220
|
height: auto;
|
|
219
221
|
border-top: ${facetRowBorderTop};
|
|
220
222
|
border-bottom: ${facetRowBorderBottom};
|
|
221
|
-
overflow: hidden;
|
|
222
223
|
}
|
|
223
224
|
.facet-info-display {
|
|
224
225
|
display: flex;
|
|
@@ -242,20 +243,30 @@ export class FacetRow extends LitElement {
|
|
|
242
243
|
display: inline-block;
|
|
243
244
|
}
|
|
244
245
|
.hide-facet-checkbox {
|
|
245
|
-
|
|
246
|
+
position: absolute;
|
|
247
|
+
clip: rect(0, 0, 0, 0);
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
}
|
|
250
|
+
.hide-facet-checkbox:focus-visible + .hide-facet-icon {
|
|
251
|
+
outline-style: auto;
|
|
252
|
+
outline-offset: 2px;
|
|
246
253
|
}
|
|
247
254
|
.hide-facet-icon {
|
|
248
|
-
width:
|
|
249
|
-
height:
|
|
255
|
+
width: ${checkboxHeight};
|
|
256
|
+
height: ${checkboxHeight};
|
|
250
257
|
cursor: pointer;
|
|
258
|
+
display: flex;
|
|
259
|
+
}
|
|
260
|
+
.eye {
|
|
261
|
+
width: ${checkboxHeight};
|
|
262
|
+
height: ${checkboxHeight};
|
|
251
263
|
opacity: 0.3;
|
|
252
|
-
display: inline-block;
|
|
253
264
|
}
|
|
254
|
-
.hide-facet-icon:hover,
|
|
255
|
-
.active {
|
|
265
|
+
.hide-facet-icon:hover .eye,
|
|
266
|
+
.active .eye {
|
|
256
267
|
opacity: 1;
|
|
257
268
|
}
|
|
258
|
-
.hide-facet-icon:hover .eye,
|
|
269
|
+
.hide-facet-icon:hover .eye-open,
|
|
259
270
|
.hide-facet-icon .eye-closed {
|
|
260
271
|
display: none;
|
|
261
272
|
}
|
|
@@ -263,7 +274,7 @@ export class FacetRow extends LitElement {
|
|
|
263
274
|
.hide-facet-icon.active .eye-closed {
|
|
264
275
|
display: inline;
|
|
265
276
|
}
|
|
266
|
-
.hide-facet-icon.active .eye {
|
|
277
|
+
.hide-facet-icon.active .eye-open {
|
|
267
278
|
display: none;
|
|
268
279
|
}
|
|
269
280
|
.sorting-icon {
|
|
@@ -279,5 +290,7 @@ export class FacetRow extends LitElement {
|
|
|
279
290
|
text-decoration: underline;
|
|
280
291
|
}
|
|
281
292
|
`;
|
|
293
|
+
|
|
294
|
+
return [srOnlyStyle, ownCss];
|
|
282
295
|
}
|
|
283
296
|
}
|