@uvalib/web-components 1.9.0 → 1.11.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/CHANGELOG.md +39 -0
- package/README.md +277 -18
- package/bin/install-skill.mjs +174 -54
- package/dist/base.css +121 -2
- package/dist/components/uvalib-contents/UvalibContents.d.ts +66 -2
- package/dist/components/uvalib-contents/UvalibContents.js +277 -29
- package/dist/components/uvalib-contents/UvalibContents.js.map +1 -1
- package/dist/components/uvalib-list-filter/UvalibListFilter.d.ts +162 -0
- package/dist/components/uvalib-list-filter/UvalibListFilter.js +685 -0
- package/dist/components/uvalib-list-filter/UvalibListFilter.js.map +1 -0
- package/dist/components/uvalib-list-filter/uvalib-list-filter.d.ts +1 -0
- package/dist/components/uvalib-list-filter/uvalib-list-filter.js +4 -0
- package/dist/components/uvalib-list-filter/uvalib-list-filter.js.map +1 -0
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.d.ts +54 -1
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js +230 -3
- package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js.map +1 -1
- package/dist/custom-elements.json +7757 -6209
- package/dist/edition.css +758 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pagefind.css +144 -0
- package/dist/styles/base.js +78 -1
- package/dist/styles/base.js.map +1 -1
- package/dist/styles/controls.js +2 -0
- package/dist/styles/controls.js.map +1 -1
- package/dist/styles/edition.d.ts +1 -0
- package/dist/styles/edition.js +747 -0
- package/dist/styles/edition.js.map +1 -0
- package/dist/styles/hidden.js +2 -0
- package/dist/styles/hidden.js.map +1 -1
- package/dist/styles/layout.d.ts +1 -0
- package/dist/styles/layout.js +92 -0
- package/dist/styles/layout.js.map +1 -0
- package/dist/styles/pagefind.js +150 -0
- package/dist/styles/pagefind.js.map +1 -1
- package/dist-cdn/base.css +121 -2
- package/dist-cdn/chunks/{base-CHMHBPeI.js → base-DmImIMld.js} +79 -2
- package/dist-cdn/chunks/base-DmImIMld.js.map +1 -0
- package/dist-cdn/custom-elements.json +7757 -6209
- package/dist-cdn/edition.css +758 -0
- package/dist-cdn/manifest.json +5 -3
- package/dist-cdn/pagefind.css +144 -0
- package/dist-cdn/site-page.js +1 -1
- package/dist-cdn/site-style.js +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +29 -8
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +65 -4
- package/dist-cdn/uvalib-contents.js +185 -47
- package/dist-cdn/uvalib-contents.js.map +1 -1
- package/dist-cdn/uvalib-list-filter.js +451 -0
- package/dist-cdn/uvalib-list-filter.js.map +1 -0
- package/dist-cdn/uvalib-pagefind-search.js +149 -49
- package/dist-cdn/uvalib-pagefind-search.js.map +1 -1
- package/package.json +6 -1
- package/skills/uvalib-web-components/SKILL.md +29 -8
- package/skills/uvalib-web-components/reference/components.md +65 -4
- package/dist-cdn/chunks/base-CHMHBPeI.js.map +0 -1
|
@@ -8,28 +8,38 @@ import { t as _ } from "./chunks/accessible-DJv7YOtS.js";
|
|
|
8
8
|
var v = (e) => {
|
|
9
9
|
let t = e?.trim().toLowerCase();
|
|
10
10
|
return t === "page" || t === "true" ? "page" : t === "location" ? "location" : void 0;
|
|
11
|
-
}, y = (e) => JSON.stringify(e, (e, t) => e === "nodes" ? void 0 : t), b = "Contents", x = "64rem", S = 2, C = "2-3", w = 2, T =
|
|
11
|
+
}, y = (e) => JSON.stringify(e, (e, t) => e === "nodes" ? void 0 : t), b = "Contents", x = "64rem", S = 2, C = "2-3", w = 2, T = "Full contents", E = "sections", D = 0, O = (e) => e.toLocaleString("en-US"), k = (e) => {
|
|
12
|
+
let t = typeof e == "number" ? e : NaN;
|
|
13
|
+
return Number.isFinite(t) && t >= 0 ? Math.trunc(t) : void 0;
|
|
14
|
+
}, A = {
|
|
15
|
+
fromAttribute: (e) => e === null || e.trim() === "" ? void 0 : Number(e),
|
|
16
|
+
toAttribute: (e) => e === void 0 ? null : String(e)
|
|
17
|
+
}, j = {
|
|
12
18
|
childList: !0,
|
|
13
19
|
characterData: !0,
|
|
14
20
|
subtree: !0
|
|
15
|
-
},
|
|
21
|
+
}, M = (e) => e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "section", N = (e) => {
|
|
16
22
|
let t = "", n = (e) => {
|
|
17
23
|
e instanceof Element && e.getAttribute("aria-hidden") === "true" || (e.nodeType === Node.TEXT_NODE ? t += e.textContent : e.childNodes.forEach(n));
|
|
18
24
|
};
|
|
19
25
|
return n(e), m(t);
|
|
20
|
-
},
|
|
26
|
+
}, P = (e) => `
|
|
21
27
|
${e} { display: block; }
|
|
22
28
|
${e} :is(ol, ul) { list-style: none; margin: 0; padding: 0; }
|
|
23
29
|
${e} li :is(ol, ul) { padding-inline-start: 1rem; }
|
|
30
|
+
${e} .visually-hidden {
|
|
31
|
+
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
|
|
32
|
+
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
|
33
|
+
}
|
|
24
34
|
${e}[hidden], ${e} [hidden] { display: none !important; }
|
|
25
|
-
`,
|
|
35
|
+
`, F = o(P(":host")), I = (e) => e.origin + (e.pathname.replace(/\/index\.html?$/i, "/").replace(/(.)\/$/, "$1") || "/"), L = (e) => {
|
|
26
36
|
let t = new URLSearchParams(e.search);
|
|
27
37
|
return t.sort(), t.toString();
|
|
28
|
-
},
|
|
38
|
+
}, R = class e extends c {
|
|
29
39
|
static {
|
|
30
40
|
this.styles = [
|
|
31
41
|
_,
|
|
32
|
-
|
|
42
|
+
F,
|
|
33
43
|
t`
|
|
34
44
|
:host {
|
|
35
45
|
font-size: 1rem;
|
|
@@ -145,11 +155,64 @@ var v = (e) => {
|
|
|
145
155
|
:host([data-narrow]) .panel {
|
|
146
156
|
margin-top: 0.5rem;
|
|
147
157
|
}
|
|
158
|
+
/* A gap between the entries a window shows (aria-hidden). */
|
|
159
|
+
.gap {
|
|
160
|
+
padding: 0 0.75rem 0.25rem calc(0.75rem + 4px);
|
|
161
|
+
color: var(--uva-color-text-muted, var(--uva-grey-A, #4f4f4f));
|
|
162
|
+
line-height: 1;
|
|
163
|
+
letter-spacing: 0.1em;
|
|
164
|
+
}
|
|
165
|
+
/* The full-contents link and the window's button: a call to action after the list, as
|
|
166
|
+
library.virginia.edu's "See all" links (bold, underlined, an arrow), its text lined up
|
|
167
|
+
with the entries'. Outside the scrolling panel, so it shows however long the list. */
|
|
168
|
+
.more {
|
|
169
|
+
margin: 0.5rem 0 0;
|
|
170
|
+
}
|
|
171
|
+
.more > :is(a, button) {
|
|
172
|
+
display: inline-flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: 0.5rem;
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
min-height: 44px;
|
|
177
|
+
margin: 0;
|
|
178
|
+
padding: 0.5rem 0.75rem 0.5rem calc(0.75rem + 4px);
|
|
179
|
+
border: 0;
|
|
180
|
+
background: none;
|
|
181
|
+
color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));
|
|
182
|
+
font: inherit;
|
|
183
|
+
font-weight: 700;
|
|
184
|
+
text-align: start;
|
|
185
|
+
text-decoration: underline;
|
|
186
|
+
text-decoration-thickness: 1px;
|
|
187
|
+
text-underline-offset: 0.2em;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
}
|
|
190
|
+
.more > :is(a, button):hover {
|
|
191
|
+
text-decoration-thickness: 2px;
|
|
192
|
+
}
|
|
193
|
+
.more > a::after {
|
|
194
|
+
content: '';
|
|
195
|
+
flex: none;
|
|
196
|
+
width: 0.45em;
|
|
197
|
+
height: 0.45em;
|
|
198
|
+
border-inline-end: 2px solid currentColor;
|
|
199
|
+
border-block-start: 2px solid currentColor;
|
|
200
|
+
transform: rotate(45deg);
|
|
201
|
+
}
|
|
202
|
+
.more > a:dir(rtl)::after {
|
|
203
|
+
transform: rotate(-45deg);
|
|
204
|
+
}
|
|
205
|
+
:host([sticky][data-more]:not([data-narrow])) .panel {
|
|
206
|
+
max-height: var(
|
|
207
|
+
--uvalib-contents-max-height,
|
|
208
|
+
calc(100dvh - 2 * var(--uvalib-contents-sticky-top, 1rem) - 6.5rem)
|
|
209
|
+
);
|
|
210
|
+
}
|
|
148
211
|
`
|
|
149
212
|
];
|
|
150
213
|
}
|
|
151
214
|
constructor() {
|
|
152
|
-
super(), this.label = b, this.headingLevel = S, this.collapseBelow = x, this.open = !1, this.sticky = !1, this.levels = C, this.min = w, this.headingItems = [], this.headingsQueued = !1, this.scrolledToHash = !1, this.childItems = [], this.ordered = !1, this.narrow = !1, this.here = "", this.warned = /* @__PURE__ */ new Set(), this.panelId = `uvalib-contents-${++
|
|
215
|
+
super(), this.label = b, this.headingLevel = S, this.collapseBelow = x, this.open = !1, this.sticky = !1, this.levels = C, this.min = w, this.fullLabel = T, this.noun = E, this.singular = "", this.expanded = !1, this.headingItems = [], this.headingsQueued = !1, this.scrolledToHash = !1, this.childItems = [], this.ordered = !1, this.narrow = !1, this.here = "", this.warned = /* @__PURE__ */ new Set(), this.panelId = `uvalib-contents-${++D}`, this.hasMore = !1, this.onLocation = () => {
|
|
153
216
|
this.here = this.ownerDocument.defaultView?.location.href ?? "";
|
|
154
217
|
}, this.listening = !1, this.onWidth = () => {
|
|
155
218
|
this.narrow = !!this.mql?.matches;
|
|
@@ -158,7 +221,7 @@ var v = (e) => {
|
|
|
158
221
|
createRenderRoot() {
|
|
159
222
|
let e = super.createRenderRoot();
|
|
160
223
|
if (e instanceof ShadowRoot && this.noStyle) {
|
|
161
|
-
let t =
|
|
224
|
+
let t = F.styleSheet;
|
|
162
225
|
t && (e.adoptedStyleSheets = [t]);
|
|
163
226
|
}
|
|
164
227
|
return e;
|
|
@@ -166,7 +229,7 @@ var v = (e) => {
|
|
|
166
229
|
connectedCallback() {
|
|
167
230
|
if (super.connectedCallback(), this.lightDom && this.noStyle) {
|
|
168
231
|
let e = this.getRootNode();
|
|
169
|
-
s(`${this.localName}::structure`, o(
|
|
232
|
+
s(`${this.localName}::structure`, o(P(this.localName)), {
|
|
170
233
|
root: e instanceof ShadowRoot || e instanceof Document ? e : void 0,
|
|
171
234
|
scope: !1
|
|
172
235
|
});
|
|
@@ -206,7 +269,7 @@ var v = (e) => {
|
|
|
206
269
|
}
|
|
207
270
|
!t && this.ownerDocument.readyState === "loading" ? this.ownerDocument.addEventListener("DOMContentLoaded", () => this.refresh(), { once: !0 }) : t || this.warnOnce("headings-from", `no element matches headings-from="${e}".`);
|
|
208
271
|
}
|
|
209
|
-
t !== this.headingsScope && (this.headingsScope = t, this.headingsObserver?.disconnect(), t && (this.headingsObserver ??= new MutationObserver(() => this.queueHeadings()), this.headingsObserver.observe(t,
|
|
272
|
+
t !== this.headingsScope && (this.headingsScope = t, this.headingsObserver?.disconnect(), t && (this.headingsObserver ??= new MutationObserver(() => this.queueHeadings()), this.headingsObserver.observe(t, j)));
|
|
210
273
|
let n = t ? this.fromHeadings(t) : [];
|
|
211
274
|
y(n) !== y(this.headingItems) && (this.headingItems = n);
|
|
212
275
|
}
|
|
@@ -225,10 +288,10 @@ var v = (e) => {
|
|
|
225
288
|
let [t, n] = this.headingRange, r = Array.from({ length: n - t + 1 }, (e, n) => `h${t + n}`).join(", "), i = e.getRootNode(), a = [], o = [], s = [];
|
|
226
289
|
for (let t of e.querySelectorAll(r)) {
|
|
227
290
|
if (this.contains(t) || t.closest("[aria-hidden=\"true\"]")) continue;
|
|
228
|
-
let e =
|
|
291
|
+
let e = N(t);
|
|
229
292
|
if (!e) continue;
|
|
230
293
|
if (!t.id) {
|
|
231
|
-
let n =
|
|
294
|
+
let n = M(e), r = n;
|
|
232
295
|
for (let e = 2; i.getElementById(r); e++) r = `${n}-${e}`;
|
|
233
296
|
t.id = r, s.push(t);
|
|
234
297
|
}
|
|
@@ -342,11 +405,11 @@ var v = (e) => {
|
|
|
342
405
|
} catch {
|
|
343
406
|
return r;
|
|
344
407
|
}
|
|
345
|
-
let c = (e) => new URL(e, e.startsWith("#") ? s.href : a), l =
|
|
408
|
+
let c = (e) => new URL(e, e.startsWith("#") ? s.href : a), l = I(s), u = L(s), d = t.flatMap((e) => {
|
|
346
409
|
if (e.href === void 0) return [];
|
|
347
410
|
try {
|
|
348
411
|
let t = c(e.href);
|
|
349
|
-
return
|
|
412
|
+
return I(t) !== l || t.search && L(t) !== u ? [] : [{
|
|
350
413
|
e,
|
|
351
414
|
hash: t.hash
|
|
352
415
|
}];
|
|
@@ -362,6 +425,33 @@ var v = (e) => {
|
|
|
362
425
|
let e = Math.trunc(Number(this.headingLevel));
|
|
363
426
|
return e >= 2 && e <= 6 ? e : S;
|
|
364
427
|
}
|
|
428
|
+
word(e) {
|
|
429
|
+
let t = m(this.noun) || E;
|
|
430
|
+
return e === 1 ? m(this.singular) || (t === E ? "section" : t) : t;
|
|
431
|
+
}
|
|
432
|
+
get fullLink() {
|
|
433
|
+
let e = this.fullHref?.trim();
|
|
434
|
+
if (e) {
|
|
435
|
+
if (h(e, this.ownerDocument.baseURI)) return e;
|
|
436
|
+
this.warnOnce("full-href", "ignoring full-href: it is not http(s), mailto, tel or relative.");
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
windowOf(e, t) {
|
|
440
|
+
let n = k(this.windowSize);
|
|
441
|
+
if (n === void 0 || this.expanded) return;
|
|
442
|
+
let r = [], i = /* @__PURE__ */ new Map(), a = (e, t) => e.forEach((e) => {
|
|
443
|
+
r.push(e), t && i.set(e, t), a(e.children, e);
|
|
444
|
+
});
|
|
445
|
+
a(e);
|
|
446
|
+
let o = 2 * n + 1;
|
|
447
|
+
if (r.length <= o) return;
|
|
448
|
+
let s = [...t], c = (s.find(([, e]) => e === "location") ?? s.find(([, e]) => e === "page"))?.[0], l = c ? r.indexOf(c) : 0, u = Math.min(Math.max(l - n, 0), r.length - o), d = /* @__PURE__ */ new Set();
|
|
449
|
+
for (let e of r.slice(u, u + o)) for (let t = e; t && !d.has(t); t = i.get(t)) d.add(t);
|
|
450
|
+
return d;
|
|
451
|
+
}
|
|
452
|
+
showAll() {
|
|
453
|
+
this.expanded = !this.expanded, d(this, ["uvalib-contents", this.expanded ? "show-all" : "show-fewer"]);
|
|
454
|
+
}
|
|
365
455
|
toggle() {
|
|
366
456
|
this.open = !this.open, d(this, [
|
|
367
457
|
"uvalib-contents",
|
|
@@ -373,12 +463,12 @@ var v = (e) => {
|
|
|
373
463
|
let t = e.target?.closest?.("a[href]");
|
|
374
464
|
if (!t || !this.renderRoot.contains(t)) return;
|
|
375
465
|
let n = Number(t.getAttribute("data-level"));
|
|
376
|
-
if (d(this, [
|
|
466
|
+
if (n ? d(this, [
|
|
377
467
|
"uvalib-contents",
|
|
378
468
|
"link-click",
|
|
379
469
|
`level ${n}`,
|
|
380
470
|
n
|
|
381
|
-
]), e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
471
|
+
]) : d(this, ["uvalib-contents", "full-contents-click"]), e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
382
472
|
let r = new CustomEvent("uvalib-contents-navigate", {
|
|
383
473
|
detail: {
|
|
384
474
|
href: t.getAttribute("href"),
|
|
@@ -394,7 +484,7 @@ var v = (e) => {
|
|
|
394
484
|
e.has("collapseBelow") && this.isConnected && this.watchWidth(), (e.has("headingsFrom") || e.has("levels") || e.has("min")) && this.isConnected && this.refresh();
|
|
395
485
|
}
|
|
396
486
|
updated(e) {
|
|
397
|
-
super.updated(e), this.toggleAttribute("data-narrow", this.narrow), this.toggleAttribute("data-empty", !this.entries.length), this.reveal();
|
|
487
|
+
super.updated(e), this.toggleAttribute("data-narrow", this.narrow), this.toggleAttribute("data-empty", !this.entries.length), this.toggleAttribute("data-more", this.hasMore), this.reveal();
|
|
398
488
|
}
|
|
399
489
|
reveal() {
|
|
400
490
|
let e = this.renderRoot.querySelector(`#${this.panelId}`), t = e ? [...e.querySelectorAll("a[aria-current]")] : [], n = t.find((e) => e.getAttribute("aria-current") === "location") ?? t[0];
|
|
@@ -404,62 +494,110 @@ var v = (e) => {
|
|
|
404
494
|
let i = e.getBoundingClientRect(), a = n.getBoundingClientRect();
|
|
405
495
|
a.top >= i.top && a.bottom <= i.bottom || (e.scrollTop += a.top - i.top - (i.height - a.height) / 2);
|
|
406
496
|
}
|
|
407
|
-
renderList(e, t, n) {
|
|
408
|
-
let
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
dir=${e.dir ?? a}
|
|
417
|
-
>${i}</a
|
|
418
|
-
>`;
|
|
419
|
-
return l`<li role="listitem" lang=${e.itemLang ?? a} dir=${e.itemDir ?? a}>
|
|
420
|
-
${o}${e.children.length ? this.renderList(e.children, t, n + 1) : a}
|
|
421
|
-
</li>`;
|
|
422
|
-
});
|
|
423
|
-
return this.ordered || this.fromHeadingsNow ? l`<ol role="list">
|
|
424
|
-
${r}
|
|
425
|
-
</ol>` : l`<ul role="list">
|
|
426
|
-
${r}
|
|
497
|
+
renderList(e, t, n, r) {
|
|
498
|
+
let i = !r || e.some((e) => r.has(e)), a = [];
|
|
499
|
+
return e.forEach((o, s) => {
|
|
500
|
+
let c = !!r && !r.has(o);
|
|
501
|
+
c && i && (s === 0 || r.has(e[s - 1])) && a.push(l`<li class="gap" aria-hidden="true">…</li>`), a.push(this.renderEntry(o, t, n, c, r));
|
|
502
|
+
}), this.ordered || this.fromHeadingsNow ? l`<ol role="list" ?hidden=${!i}>
|
|
503
|
+
${a}
|
|
504
|
+
</ol>` : l`<ul role="list" ?hidden=${!i}>
|
|
505
|
+
${a}
|
|
427
506
|
</ul>`;
|
|
428
507
|
}
|
|
508
|
+
renderEntry(e, t, n, r, i) {
|
|
509
|
+
let o = t.get(e), s = e.nodes ? e.nodes.map((e) => e.cloneNode(!0)) : e.label, c = e.href === void 0 ? l`<span class="group" lang=${e.lang ?? a} dir=${e.dir ?? a}
|
|
510
|
+
>${s}</span
|
|
511
|
+
>` : l`<a
|
|
512
|
+
href=${e.href}
|
|
513
|
+
data-level=${n}
|
|
514
|
+
aria-current=${o ?? a}
|
|
515
|
+
lang=${e.lang ?? a}
|
|
516
|
+
dir=${e.dir ?? a}
|
|
517
|
+
>${s}</a
|
|
518
|
+
>`;
|
|
519
|
+
return l`<li
|
|
520
|
+
role="listitem"
|
|
521
|
+
lang=${e.itemLang ?? a}
|
|
522
|
+
dir=${e.itemDir ?? a}
|
|
523
|
+
?hidden=${r}
|
|
524
|
+
>
|
|
525
|
+
${c}${e.children.length ? this.renderList(e.children, t, n + 1, i) : a}
|
|
526
|
+
</li>`;
|
|
527
|
+
}
|
|
528
|
+
static size(e, t) {
|
|
529
|
+
let n = 0, r = (e) => e.forEach((e) => {
|
|
530
|
+
(!t || t.has(e)) && n++, r(e.children);
|
|
531
|
+
});
|
|
532
|
+
return r(e), n;
|
|
533
|
+
}
|
|
534
|
+
renderMore(t, n, r) {
|
|
535
|
+
let i = this.fullLink, o = !!n || this.expanded, s = e.size(t), c = k(this.total) ?? (o ? s : void 0), u = e.size(t, n), d = "";
|
|
536
|
+
c !== void 0 && u < c ? d = `Showing ${O(u)} of ${O(c)} ${this.word(c)}.` : i && c === void 0 && (d = `Showing ${O(u)} ${this.word(u)}, part of the contents.`);
|
|
537
|
+
let f;
|
|
538
|
+
if (i) {
|
|
539
|
+
let e = `${m(this.fullLabel) || T}${c === void 0 ? "" : ` (${O(c)} ${this.word(c)})`}`;
|
|
540
|
+
f = l`<a class="full" href=${i} data-level="0">${e}</a>`;
|
|
541
|
+
} else o && (f = l`<button
|
|
542
|
+
type="button"
|
|
543
|
+
aria-expanded=${this.expanded ? "true" : "false"}
|
|
544
|
+
aria-controls=${this.panelId}
|
|
545
|
+
@click=${this.showAll}
|
|
546
|
+
>
|
|
547
|
+
${this.expanded ? "Show fewer" : `Show all ${O(s)} ${this.word(s)}`}
|
|
548
|
+
</button>`);
|
|
549
|
+
return {
|
|
550
|
+
note: d ? l`<p class="visually-hidden">${d}</p>` : a,
|
|
551
|
+
more: f ? l`<p class="more" id=${`${this.panelId}-more`} ?hidden=${r}>${f}</p>` : a,
|
|
552
|
+
has: !!f
|
|
553
|
+
};
|
|
554
|
+
}
|
|
429
555
|
render() {
|
|
430
|
-
let e = this.entries, t = m(this.label) || b, n = u(`h${this.level}`), r = this.narrow && !this.open, i = this.
|
|
556
|
+
let e = this.entries, t = m(this.label) || b, n = u(`h${this.level}`), r = this.narrow && !this.open, i = this.currentOf(e), a = this.windowOf(e, i), { note: o, more: s, has: c } = this.renderMore(e, a, r);
|
|
557
|
+
this.hasMore = c;
|
|
558
|
+
let d = this.narrow ? l`<button
|
|
431
559
|
type="button"
|
|
432
560
|
class="toggle"
|
|
433
561
|
aria-expanded=${this.open ? "true" : "false"}
|
|
434
|
-
aria-controls=${this.panelId}
|
|
562
|
+
aria-controls=${c ? `${this.panelId} ${this.panelId}-more` : this.panelId}
|
|
435
563
|
@click=${this.toggle}
|
|
436
564
|
>
|
|
437
565
|
${t}
|
|
438
566
|
</button>` : t;
|
|
439
567
|
return l`<nav aria-label=${t} ?hidden=${!e.length} @click=${this.onClick}>
|
|
440
|
-
${l`<${n} class="headline">${
|
|
568
|
+
${l`<${n} class="headline">${d}</${n}>`}
|
|
441
569
|
<div class="panel" id=${this.panelId} ?hidden=${r}>
|
|
442
|
-
${this.renderList(e,
|
|
570
|
+
${o}${this.renderList(e, i, 1, a)}
|
|
443
571
|
</div>
|
|
572
|
+
${s}
|
|
444
573
|
</nav>`;
|
|
445
574
|
}
|
|
446
575
|
};
|
|
447
576
|
// src/components/uvalib-contents/uvalib-contents.ts
|
|
448
|
-
i([e({ type: String })],
|
|
577
|
+
i([e({ type: String })], R.prototype, "label", void 0), i([e({
|
|
449
578
|
type: Number,
|
|
450
579
|
attribute: "heading-level"
|
|
451
|
-
})],
|
|
580
|
+
})], R.prototype, "headingLevel", void 0), i([e({ type: String })], R.prototype, "current", void 0), i([e({
|
|
452
581
|
type: String,
|
|
453
582
|
attribute: "collapse-below"
|
|
454
|
-
})],
|
|
583
|
+
})], R.prototype, "collapseBelow", void 0), i([e({
|
|
455
584
|
type: Boolean,
|
|
456
585
|
reflect: !0
|
|
457
|
-
})],
|
|
586
|
+
})], R.prototype, "open", void 0), i([e({
|
|
458
587
|
type: Boolean,
|
|
459
588
|
reflect: !0
|
|
460
|
-
})],
|
|
589
|
+
})], R.prototype, "sticky", void 0), i([e({ attribute: !1 })], R.prototype, "items", void 0), i([e({
|
|
461
590
|
type: String,
|
|
462
591
|
attribute: "headings-from"
|
|
463
|
-
})],
|
|
592
|
+
})], R.prototype, "headingsFrom", void 0), i([e({ type: String })], R.prototype, "levels", void 0), i([e({ type: Number })], R.prototype, "min", void 0), i([e({
|
|
593
|
+
type: String,
|
|
594
|
+
attribute: "full-href"
|
|
595
|
+
})], R.prototype, "fullHref", void 0), i([e({
|
|
596
|
+
type: String,
|
|
597
|
+
attribute: "full-label"
|
|
598
|
+
})], R.prototype, "fullLabel", void 0), i([e({ converter: A })], R.prototype, "total", void 0), i([e({ type: String })], R.prototype, "noun", void 0), i([e({ type: String })], R.prototype, "singular", void 0), i([e({
|
|
599
|
+
converter: A,
|
|
600
|
+
attribute: "window"
|
|
601
|
+
})], R.prototype, "windowSize", void 0), i([n()], R.prototype, "expanded", void 0), i([n()], R.prototype, "headingItems", void 0), i([n()], R.prototype, "childItems", void 0), i([n()], R.prototype, "ordered", void 0), i([n()], R.prototype, "narrow", void 0), i([n()], R.prototype, "here", void 0), r("uvalib-contents", R);
|
|
464
602
|
|
|
465
603
|
//# sourceMappingURL=uvalib-contents.js.map
|