Skip to content

Commit

Permalink
Update library output
Browse files Browse the repository at this point in the history
  • Loading branch information
markteekman committed Jan 22, 2023
1 parent a241419 commit 4e57093
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
46 changes: 25 additions & 21 deletions dist/accessible-vue-components.es.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
import { ref as r, openBlock as l, createElementBlock as a, createElementVNode as u, withKeys as k } from "vue";
const m = ["onKeydown"], p = {
import { ref as i, openBlock as l, createElementBlock as a, createElementVNode as u, withKeys as k, renderSlot as m, createTextVNode as d } from "vue";
const p = ["onKeydown"], _ = {
__name: "SkipLinks",
setup(s) {
const c = r(null), o = (n) => {
n.setAttribute("tabindex", "-1"), n.focus();
}, i = (n) => {
const e = c.value.querySelector("a").getAttribute("href");
if (document.querySelector(e)) {
const t = document.querySelector(e);
o(t);
} else if (!document.querySelector(e) && document.querySelector("h1")) {
const t = document.querySelector("h1");
o(t);
} else if (!document.querySelector(e) && !document.querySelector("h1")) {
const t = document.querySelector("main");
o(t);
const c = i(null), o = (e) => {
e.setAttribute("tabindex", "-1"), e.focus();
}, r = (e) => {
const t = c.value.querySelector("a").getAttribute("href");
if (document.querySelector(t)) {
const n = document.querySelector(t);
o(n);
} else if (!document.querySelector(t) && document.querySelector("h1")) {
const n = document.querySelector("h1");
o(n);
} else if (!document.querySelector(t) && !document.querySelector("h1")) {
const n = document.querySelector("main");
o(n);
} else
console.warn("SkipLinks are not set, either missing an h1, main landmark or main content id on the page.");
};
return (n, e) => (l(), a("div", {
return (e, t) => (l(), a("div", {
class: "avc-skiplinks",
ref_key: "skipLinks",
ref: c
}, [
u("a", {
href: "#main-content",
class: "skiplinks__skiplink",
onKeydown: k(i, ["enter"])
}, "Skip to main content", 40, m)
onKeydown: k(r, ["enter"])
}, [
m(e.$slots, "default", {}, () => [
d("Skip to main content")
])
], 40, p)
], 512));
}
}, d = {
}, S = {
install: (s) => {
s.component("SkipLinks", p);
s.component("SkipLinks", _);
}
};
export {
d as default
S as default
};
2 changes: 1 addition & 1 deletion dist/accessible-vue-components.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e57093

Please sign in to comment.