@aarhus-university/au-designsystem-delphinus 1.0.4 → 1.0.6

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esbuild.mjs +1 -0
  3. package/package.json +1 -1
  4. package/public/demo/demo-component.css +1 -38
  5. package/public/js/app.js +2 -1
  6. package/public/js/app.js.map +7 -1
  7. package/public/js/demo.js +1 -0
  8. package/public/js/demo.js.map +7 -1
  9. package/public/projects/bachelor-applications/js/app.js +2 -1
  10. package/public/projects/bachelor-applications/js/app.js.map +7 -0
  11. package/public/projects/bachelor-applications/style.css +1 -1
  12. package/public/projects/brightspace/style.css +1 -1
  13. package/public/projects/course-catalogue/js/app.js +2 -1
  14. package/public/projects/course-catalogue/js/app.js.map +7 -0
  15. package/public/projects/course-catalogue/style.css +1 -1
  16. package/public/projects/medarbejdere/js/app.js +2 -1
  17. package/public/projects/medarbejdere/js/app.js.map +7 -0
  18. package/public/projects/medarbejdere/style.css +1 -1
  19. package/public/projects/mitstudie/js/app.js +2 -1
  20. package/public/projects/mitstudie/js/app.js.map +7 -0
  21. package/public/projects/mitstudie/style.css +1 -1
  22. package/public/projects/queue-it/style.css +1 -1
  23. package/public/projects/typo3/js/app.js +1 -0
  24. package/public/projects/typo3/js/app.js.map +7 -0
  25. package/public/projects/typo3/style.css +1 -1
  26. package/public/style.css +1 -1
  27. package/source/demo-style.scss +1 -0
  28. package/source/js/production/app.ts +1 -1
  29. package/source/markup/design.pug +700 -0
  30. package/source/markup/partials/mixins/_nav-items.pug +5 -5
  31. package/source/markup/partials/mixins-demo/_design-documentation.pug +19 -0
  32. package/source/markup/partials/page-templates/_layout.pug +1 -1
  33. package/source/style/base/_text.scss +4 -0
  34. package/source/style/module-demo/_design-documentation.scss +441 -0
  35. package/source/markup/interactivity.pug +0 -32
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 1.0.5 (August 1, 2023)
2
+
3
+ ### Core Delphinus Updates
4
+ None
5
+
6
+ ### Delphinus Projects Updates
7
+ #### Medarbejdere
8
+ Restores functioning content toggle in profile header.
9
+
10
+
11
+ ## 1.0.4 (August 1, 2023)
12
+
13
+ ### Core Delphinus Updates
14
+ * This version actually restores minification for all compiled css files. Didn't work in 1.0.3.
15
+
16
+ ### Delphinus Projects Updates
17
+ None
18
+
19
+
20
+
1
21
  ## 1.0.3 (July 28, 2023)
2
22
 
3
23
  ### Core Delphinus Updates
package/esbuild.mjs CHANGED
@@ -15,4 +15,5 @@ await esbuild.build({
15
15
  bundle: true,
16
16
  minify: true,
17
17
  outdir: 'public',
18
+ sourcemap: true,
18
19
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarhus-university/au-designsystem-delphinus",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "concurrently \"npm run nodemon\" \"npm run sass\" \"npm run build\"",
@@ -1,38 +1 @@
1
- .content-container > *:first-child:not(.row) {
2
- margin-top: 0;
3
- }
4
- .content-container > *:last-child:not(.row) {
5
- margin-bottom: 0;
6
- }
7
-
8
- .component {
9
- padding: var(--spacing-m1);
10
- background-color: var(--color-background-secondary);
11
- color: var(--color-foreground);
12
- }
13
- .component > *:first-child:not(.row) {
14
- margin-top: 0;
15
- }
16
- .component > *:last-child:not(.row) {
17
- margin-bottom: 0;
18
- }
19
- .component--warning {
20
- background-color: var(--color-utility-warning-background);
21
- color: var(--color-utility-foreground);
22
- }
23
- .component__header {
24
- margin-bottom: var(--spacing-m5);
25
- font-size: var(--font-size-p1);
26
- line-height: calc(1.1em + 0.3rem);
27
- font-weight: 700;
28
- }
29
- .component__header--shout {
30
- text-transform: uppercase;
31
- }
32
- .component__content {
33
- font-size: var(--font-size-0);
34
- line-height: calc(1.1em + 0.7rem);
35
- font-weight: 400;
36
- }
37
-
38
- /*# sourceMappingURL=demo-component.css.map */
1
+ .content-container>*:first-child:not(.row){margin-top:0}.content-container>*:last-child:not(.row){margin-bottom:0}.component{padding:var(--spacing-m1);background-color:var(--color-background-secondary);color:var(--color-foreground)}.component>*:first-child:not(.row){margin-top:0}.component>*:last-child:not(.row){margin-bottom:0}.component--warning{background-color:var(--color-utility-warning-background);color:var(--color-utility-foreground)}.component__header{margin-bottom:var(--spacing-m5);font-size:var(--font-size-p1);line-height:calc(1.1em + 0.3rem);font-weight:700}.component__header--shout{text-transform:uppercase}.component__content{font-size:var(--font-size-0);line-height:calc(1.1em + 0.7rem);font-weight:400}/*# sourceMappingURL=demo-component.css.map */
package/public/js/app.js CHANGED
@@ -1 +1,2 @@
1
- (()=>{var V=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},x=V;var h=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},q=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let l=document.createElement("meta");l.name="theme-color",l.content=t,document.getElementsByTagName("head")[0].appendChild(l)}}},C=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),y=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),L=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=y(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var k=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:k(t):e},W=(e,t=null)=>{let o="nav--toggled";e.forEach(l=>{let r=l.querySelector(".nav__toggle");l!==t&&(l.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),l.classList.remove(o))})},I=e=>{let t=r=>{let n=k(r),s=n.querySelector(".nav__items"),i=s?.querySelector(".nav__item:last-of-type");s?.classList.add("nav__items--fadeout");let d=s?.querySelector(".nav__item--is-overflown");d&&d.focus();let a=()=>{n.classList.toggle("nav--toggled"),s?.classList.remove("nav__items--fadeout"),i?.removeEventListener("transitionend",a)};return i?.addEventListener("transitionend",a),n},o=[];return document.querySelectorAll(".nav__toggle").forEach(r=>{let n=()=>{let s=t(r),i=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",i==="false"?"true":"false"),W(e,s)};o.push({element:r,clickEvent:n}),r.addEventListener("click",n)}),o},_=(e,t)=>{let o="nav--toggled",l="nav__items";t.classList.remove(o);let r=t.querySelector(`.${l}`);if(r){let s=r.querySelectorAll(".nav__item"),i="nav__item--is-overflown",d="nav--has-overflow",a="nav__item--active",c=!1;for(let u=s.length-1;u>=0;u-=1){let m=s[u];m.offsetTop>0?(m.classList.add(i),t.classList.add(d),c=!0):m.classList.contains(a)||m.classList.remove(i)}if(!c){t.classList.remove(d);let u=t.querySelector(`.${a}`);u&&u.classList.remove(i)}}let n=s=>{!s.target.classList.contains("nav__toggle")&&!h(s,l)&&W(e)};return document.querySelector("body")?.addEventListener("click",n),{element:document.querySelector("body"),clickEvent:n}};var N=e=>{let t=e.querySelector("thead"),o=e.querySelector("tbody"),l=e.querySelector("tfoot");if(t){let r=[];t.querySelectorAll("th").forEach(i=>{i.classList.contains("table__cell--self-explanatory")?r.push(""):r.push(i.innerHTML)});let s=[];o&&s.push(o),l&&s.push(l),s.forEach(i=>{i.querySelectorAll("tr").forEach(a=>{a.querySelectorAll("td, th").forEach((u,m)=>{r[m]&&u.setAttribute("data-label",r[m])})})})}};var $=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,D=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/C(),l=$(e);return l>-1?o<l:!0},K=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),l=[];e.querySelectorAll("section").forEach(n=>{n.parentNode===e&&l.push(n)}),o?.forEach(n=>{n.removeAttribute("aria-selected"),n.classList.remove("nav__item--active")}),l.forEach(n=>{n.hidden=!1,n.removeAttribute("role")})};var T=(e,t,o,l,r,n=!0,s=i=>console.log(i))=>{n&&l.focus(),l.removeAttribute("tabindex"),l.setAttribute("aria-selected","true"),l.classList.contains("switch__segment")?l.classList.add("switch__segment--active"):l.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let i=Array.prototype.indexOf.call(e,l);if(Array.from(document.querySelectorAll(`[data-for="${t[i].id}"]`)).forEach(a=>{a.classList.add("tabbed-content-peripheral--active"),a.hidden=!1}),t[i].hidden=!1,o){let a=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[a].id}"]`)).forEach(u=>{u.classList.remove("tabbed-content-peripheral--active"),u.hidden=!0}),t[a].hidden=!0}l.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:i}})),s(i)},F=(e,t,o=0,l=!0,r=n=>console.log(n))=>{let n=t.querySelector(".switch,.nav__items"),s=n.querySelectorAll("a"),i=[];t.querySelectorAll("section").forEach(c=>{c.parentNode===t&&i.push(c)});let a=t.querySelector("button.tabbed-content__expand-all");if(a){let c=()=>{n.hidden=!0,i.forEach(u=>{u.hidden=!1})};a.removeEventListener("click",c),a.addEventListener("click",c)}n.setAttribute("role","tablist"),s.forEach((c,u)=>{c.setAttribute("role","tab"),c.setAttribute("id",`tab${e}_${u+1}`),c.setAttribute("tabindex","-1"),c.parentElement?.setAttribute("role","presentation");let m=f=>{f.preventDefault();let E=n.querySelector("[aria-selected]");f.currentTarget!==E&&T(s,i,E,f.currentTarget,t.classList,!0,v=>{r(v)})};c.removeEventListener("click",m),c.addEventListener("click",m);let p=f=>{let E=Array.prototype.indexOf.call(s,f.currentTarget),v=null;f.key==="ArrowLeft"&&(v=E-1),f.key==="ArrowRight"&&(v=E+1),f.key==="ArrowDown"&&(v="down"),v!==null&&(f.preventDefault(),v==="down"?i[u].focus():s[v]&&T(s,i,f.currentTarget,s[v],t.classList,!0,R=>{r(R)}))};c.removeEventListener("keydown",p),c.addEventListener("keydown",p)}),i.forEach((c,u)=>{c.setAttribute("tabindex","-1"),c.setAttribute("aria-labelledby",s[u].id),c.hidden=!0,c.setAttribute("role","tabpanel")}),o>-1&&T(s,i,null,s[o],t.classList,l)},w=e=>{e.forEach((t,o)=>{let{rendered:l,domElement:r}=t;if(D(r.classList)){if(!l){let n=r.getAttribute("data-focus-onload"),s=r.getAttribute("data-initial-tab"),i=s?parseInt(s,10):0;F(o,r,i,n!=="false"),t.rendered=!0}}else l&&(K(r),t.rendered=!1)})};var M=(e,t,o,l)=>{let r=[],n=(d,a,c)=>{c&&a.focus();let u=()=>{e.setAttribute("hidden","hidden"),d.removeAttribute("hidden"),d.setAttribute("aria-expanded","false"),d.focus()};return a.addEventListener("click",u),u},s=e?.parentElement?.querySelector(".content-toggle__toggle"),i=e.querySelectorAll(".content-toggle__close");if(s){let d=()=>{let a=s.getAttribute("aria-expanded");typeof o=="function"&&a==="false"&&o(e,s),s.setAttribute("aria-expanded",a==="false"?"true":"false"),a==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,s),s.hasAttribute("aria-haspopup")&&(s.setAttribute("hidden","hidden"),i.forEach(c=>{n(s,c,!0)})),typeof l=="function"&&l(e,s)};s.addEventListener("click",d),r.push({element:s,clickEvent:d}),i.forEach(a=>{let c=n(s,a,!1);r.push({element:a,clickEvent:c})})}return r};var O=()=>{let e=document.querySelector("body");(L("--bp-medium")||L("--bp-low-height"))&&e?.classList.add("body--no-scroll")},P=()=>{document.querySelector("body")?.classList.remove("body--no-scroll")},A=e=>{e.querySelectorAll(".content-toggle__toggle").forEach(o=>{let l=o.parentElement?.querySelector(".content-toggle__content");o.setAttribute("aria-expanded","false"),l?.setAttribute("hidden","hidden")})};var b=e=>{let t=e.parentElement;return t?t.classList.contains("toolbar")?t:b(t):e},B=e=>{if(!L("--bp-medium")&&!L("--bp-low-height")){let t=y(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--toolbar-popout-allowed-edge-distance").replace("rem,",""),10)),o=parseInt(getComputedStyle(e).width.replace("px",""),10),l=e.getBoundingClientRect().x,r=document.body.offsetWidth-t-o-l;r<0&&e.style.setProperty("--toolbar-popout-edge-overflow",`${r}px`)}};var z=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let l=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");l.forEach(n=>{n&&(t.addEventListener("click",()=>{let s=.8*n.clientWidth;n.scrollLeft+=s}),n.addEventListener("scroll",()=>{n.scrollLeft+n.clientWidth>=n.scrollWidth*.98?H(t):n.scrollLeft+n.clientWidth<n.scrollWidth&&S(t)}),r&&r.forEach(s=>{s.addEventListener("click",()=>{S(t),n.scrollLeft=0})}))})}})},U=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let l=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");l.forEach(n=>{n&&(t.addEventListener("click",()=>{let s=.8*n.clientWidth;n.scrollLeft-=s}),n.addEventListener("scroll",()=>{n.scrollLeft<=0?H(t):n.scrollLeft>0&&S(t)})),r&&r.forEach(s=>{s.addEventListener("click",()=>{H(t)})})})}})};function S(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function H(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}var g=0;x(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(d=>t.push({domElement:d,rendered:!1})),w(t),q();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(d=>_(o,d)),I(o),document.querySelectorAll(".table--wrap-medium-width, .table--wrap-default-width").forEach(d=>N(d)),document.querySelectorAll(".box .content-toggle__content").forEach(d=>{M(d)});let n=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),s=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");z(n),U(s),document.querySelectorAll(".toolbar .content-toggle__content").forEach(d=>{M(d,a=>{B(a),O()},a=>A(b(a)),(a,c)=>{let u=c.getAttribute("aria-expanded"),m=b(a);u==="true"?m?.classList.add("toolbar--has-popout"):m?.classList.remove("toolbar--has-popout"),a.addEventListener("click",p=>{p.target.classList.contains("toolbar__popout")&&!h(p,"toolbar__filter__content")&&(A(m),P())})})}),window.addEventListener("load",()=>{g=window.innerWidth}),window.addEventListener("resize",()=>{g>0&&window.innerWidth!==g&&(g=window.innerWidth,o.forEach(d=>_(o,d)),w(t))})});})();
1
+ (()=>{var V=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},x=V;var h=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},q=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let l=document.createElement("meta");l.name="theme-color",l.content=t,document.getElementsByTagName("head")[0].appendChild(l)}}},C=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),y=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),L=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=y(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var k=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:k(t):e},W=(e,t=null)=>{let o="nav--toggled";e.forEach(l=>{let r=l.querySelector(".nav__toggle");l!==t&&(l.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),l.classList.remove(o))})},I=e=>{let t=r=>{let n=k(r),s=n.querySelector(".nav__items"),i=s?.querySelector(".nav__item:last-of-type");s?.classList.add("nav__items--fadeout");let d=s?.querySelector(".nav__item--is-overflown");d&&d.focus();let a=()=>{n.classList.toggle("nav--toggled"),s?.classList.remove("nav__items--fadeout"),i?.removeEventListener("transitionend",a)};return i?.addEventListener("transitionend",a),n},o=[];return document.querySelectorAll(".nav__toggle").forEach(r=>{let n=()=>{let s=t(r),i=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",i==="false"?"true":"false"),W(e,s)};o.push({element:r,clickEvent:n}),r.addEventListener("click",n)}),o},_=(e,t)=>{let o="nav--toggled",l="nav__items";t.classList.remove(o);let r=t.querySelector(`.${l}`);if(r){let s=r.querySelectorAll(".nav__item"),i="nav__item--is-overflown",d="nav--has-overflow",a="nav__item--active",c=!1;for(let u=s.length-1;u>=0;u-=1){let m=s[u];m.offsetTop>0?(m.classList.add(i),t.classList.add(d),c=!0):m.classList.contains(a)||m.classList.remove(i)}if(!c){t.classList.remove(d);let u=t.querySelector(`.${a}`);u&&u.classList.remove(i)}}let n=s=>{!s.target.classList.contains("nav__toggle")&&!h(s,l)&&W(e)};return document.querySelector("body")?.addEventListener("click",n),{element:document.querySelector("body"),clickEvent:n}};var N=e=>{let t=e.querySelector("thead"),o=e.querySelector("tbody"),l=e.querySelector("tfoot");if(t){let r=[];t.querySelectorAll("th").forEach(i=>{i.classList.contains("table__cell--self-explanatory")?r.push(""):r.push(i.innerHTML)});let s=[];o&&s.push(o),l&&s.push(l),s.forEach(i=>{i.querySelectorAll("tr").forEach(a=>{a.querySelectorAll("td, th").forEach((u,m)=>{r[m]&&u.setAttribute("data-label",r[m])})})})}};var $=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,D=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/C(),l=$(e);return l>-1?o<l:!0},K=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),l=[];e.querySelectorAll("section").forEach(n=>{n.parentNode===e&&l.push(n)}),o?.forEach(n=>{n.removeAttribute("aria-selected"),n.classList.remove("nav__item--active")}),l.forEach(n=>{n.hidden=!1,n.removeAttribute("role")})};var T=(e,t,o,l,r,n=!0,s=i=>console.log(i))=>{n&&l.focus(),l.removeAttribute("tabindex"),l.setAttribute("aria-selected","true"),l.classList.contains("switch__segment")?l.classList.add("switch__segment--active"):l.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let i=Array.prototype.indexOf.call(e,l);if(Array.from(document.querySelectorAll(`[data-for="${t[i].id}"]`)).forEach(a=>{a.classList.add("tabbed-content-peripheral--active"),a.hidden=!1}),t[i].hidden=!1,o){let a=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[a].id}"]`)).forEach(u=>{u.classList.remove("tabbed-content-peripheral--active"),u.hidden=!0}),t[a].hidden=!0}l.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:i}})),s(i)},F=(e,t,o=0,l=!0,r=n=>console.log(n))=>{let n=t.querySelector(".switch,.nav__items"),s=n.querySelectorAll("a"),i=[];t.querySelectorAll("section").forEach(c=>{c.parentNode===t&&i.push(c)});let a=t.querySelector("button.tabbed-content__expand-all");if(a){let c=()=>{n.hidden=!0,i.forEach(u=>{u.hidden=!1})};a.removeEventListener("click",c),a.addEventListener("click",c)}n.setAttribute("role","tablist"),s.forEach((c,u)=>{c.setAttribute("role","tab"),c.setAttribute("id",`tab${e}_${u+1}`),c.setAttribute("tabindex","-1"),c.parentElement?.setAttribute("role","presentation");let m=f=>{f.preventDefault();let E=n.querySelector("[aria-selected]");f.currentTarget!==E&&T(s,i,E,f.currentTarget,t.classList,!0,v=>{r(v)})};c.removeEventListener("click",m),c.addEventListener("click",m);let p=f=>{let E=Array.prototype.indexOf.call(s,f.currentTarget),v=null;f.key==="ArrowLeft"&&(v=E-1),f.key==="ArrowRight"&&(v=E+1),f.key==="ArrowDown"&&(v="down"),v!==null&&(f.preventDefault(),v==="down"?i[u].focus():s[v]&&T(s,i,f.currentTarget,s[v],t.classList,!0,R=>{r(R)}))};c.removeEventListener("keydown",p),c.addEventListener("keydown",p)}),i.forEach((c,u)=>{c.setAttribute("tabindex","-1"),c.setAttribute("aria-labelledby",s[u].id),c.hidden=!0,c.setAttribute("role","tabpanel")}),o>-1&&T(s,i,null,s[o],t.classList,l)},w=e=>{e.forEach((t,o)=>{let{rendered:l,domElement:r}=t;if(D(r.classList)){if(!l){let n=r.getAttribute("data-focus-onload"),s=r.getAttribute("data-initial-tab"),i=s?parseInt(s,10):0;F(o,r,i,n!=="false"),t.rendered=!0}}else l&&(K(r),t.rendered=!1)})};var M=(e,t,o,l)=>{let r=[],n=(d,a,c)=>{c&&a.focus();let u=()=>{e.setAttribute("hidden","hidden"),d.removeAttribute("hidden"),d.setAttribute("aria-expanded","false"),d.focus()};return a.addEventListener("click",u),u},s=e?.parentElement?.querySelector(".content-toggle__toggle"),i=e.querySelectorAll(".content-toggle__close");if(s){let d=()=>{let a=s.getAttribute("aria-expanded");typeof o=="function"&&a==="false"&&o(e,s),s.setAttribute("aria-expanded",a==="false"?"true":"false"),a==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,s),s.hasAttribute("aria-haspopup")&&(s.setAttribute("hidden","hidden"),i.forEach(c=>{n(s,c,!0)})),typeof l=="function"&&l(e,s)};s.addEventListener("click",d),r.push({element:s,clickEvent:d}),i.forEach(a=>{let c=n(s,a,!1);r.push({element:a,clickEvent:c})})}return r};var O=()=>{let e=document.querySelector("body");(L("--bp-medium")||L("--bp-low-height"))&&e?.classList.add("body--no-scroll")},P=()=>{document.querySelector("body")?.classList.remove("body--no-scroll")},A=e=>{e.querySelectorAll(".content-toggle__toggle").forEach(o=>{let l=o.parentElement?.querySelector(".content-toggle__content");o.setAttribute("aria-expanded","false"),l?.setAttribute("hidden","hidden")})};var b=e=>{let t=e.parentElement;return t?t.classList.contains("toolbar")?t:b(t):e},B=e=>{if(!L("--bp-medium")&&!L("--bp-low-height")){let t=y(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--toolbar-popout-allowed-edge-distance").replace("rem,",""),10)),o=parseInt(getComputedStyle(e).width.replace("px",""),10),l=e.getBoundingClientRect().x,r=document.body.offsetWidth-t-o-l;r<0&&e.style.setProperty("--toolbar-popout-edge-overflow",`${r}px`)}};var z=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let l=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");l.forEach(n=>{n&&(t.addEventListener("click",()=>{let s=.8*n.clientWidth;n.scrollLeft+=s}),n.addEventListener("scroll",()=>{n.scrollLeft+n.clientWidth>=n.scrollWidth*.98?H(t):n.scrollLeft+n.clientWidth<n.scrollWidth&&S(t)}),r&&r.forEach(s=>{s.addEventListener("click",()=>{S(t),n.scrollLeft=0})}))})}})},U=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let l=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");l.forEach(n=>{n&&(t.addEventListener("click",()=>{let s=.8*n.clientWidth;n.scrollLeft-=s}),n.addEventListener("scroll",()=>{n.scrollLeft<=0?H(t):n.scrollLeft>0&&S(t)})),r&&r.forEach(s=>{s.addEventListener("click",()=>{H(t)})})})}})};function S(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function H(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}var g=0;x(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(d=>t.push({domElement:d,rendered:!1})),w(t),q();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(d=>_(o,d)),I(o),document.querySelectorAll(".table--wrap-medium-width, .table--wrap-default-width").forEach(d=>N(d)),document.querySelectorAll(".box .content-toggle__content, .profile-header .content-toggle__content, .design-documentation .content-toggle__content").forEach(d=>{M(d)});let n=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),s=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");z(n),U(s),document.querySelectorAll(".toolbar .content-toggle__content").forEach(d=>{M(d,a=>{B(a),O()},a=>A(b(a)),(a,c)=>{let u=c.getAttribute("aria-expanded"),m=b(a);u==="true"?m?.classList.add("toolbar--has-popout"):m?.classList.remove("toolbar--has-popout"),a.addEventListener("click",p=>{p.target.classList.contains("toolbar__popout")&&!h(p,"toolbar__filter__content")&&(A(m),P())})})}),window.addEventListener("load",()=>{g=window.innerWidth}),window.addEventListener("resize",()=>{g>0&&window.innerWidth!==g&&(g=window.innerWidth,o.forEach(d=>_(o,d)),w(t))})});})();
2
+ //# sourceMappingURL=app.js.map
@@ -1 +1,7 @@
1
- {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./source/js/components/helpers.ts","webpack:///./source/js/components/nav.ts","webpack:///./source/js/components/tabs.ts","webpack:///./source/js/components/content-toggle.ts","webpack:///./source/js/components/toolbar.ts","webpack:///./source/js/production/app.ts","webpack:///./source/js/components/ready.ts","webpack:///./source/js/components/table.ts"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isElementWithClassNameInEventPath","event","className","found","composedPath","forEach","classList","contains","convertRemToPixels","rem","parseFloat","getComputedStyle","document","documentElement","fontSize","isViewportBelow","mediaQuery","Math","max","clientWidth","innerWidth","parseInt","getPropertyValue","replace","findNav","element","parent","parentElement","closeResponsiveNav","navElements","keepOpen","button","querySelector","focus","setAttribute","remove","setResponsiveToggle","cleanUp","querySelectorAll","clickEvent","nav","navItems","lastNavItem","add","firstElement","transitionListener","toggle","removeEventListener","addEventListener","toggleMenu","ariaExpanded","getAttribute","push","setResponsiveNav","navElement","navItemsParent","isOverflownClass","hasOverflowClass","isActiveClass","hasOverflown","length","offsetTop","isActive","bodyClickEvent","e","target","isBelowViewportLimit","widthInRem","getBaseFontSize","mediaWidth","getMediaWidthBasedOnModifier","switchTab","tabs","panels","oldTab","newTab","_","callback","index","console","log","removeAttribute","Array","indexOf","from","id","link","hidden","oldIndex","dispatchEvent","CustomEvent","bubbles","detail","tab","setTabs","tabbedObjects","tabObject","rendered","domElement","dataInitial","tabbed","initial","tablist","section","parentNode","expandAll","expandAllEvent","panel","tabClickEvent","preventDefault","currentTab","currentTarget","tabIndex","tabKeyEvent","dir","setTabbedContent","destroyTabs","setContentToggle","content","onClick","beforeCallback","afterCallback","setContentClose","contentClose","click","hasAttribute","cc","btnClick","closeAllContentTogglesInToolbar","toolbar","findToolbar","windowInnerWidth","fn","readyState","ready","tabbedContent","body","bgColor","existingMeta","meta","createElement","getElementsByTagName","appendChild","setMetaThemeColor","table","head","foot","headers","h","innerHTML","rowContainers","rc","tr","cell","setResponsiveTable","popout","allowedDistance","popoutX","width","popoutWidth","getBoundingClientRect","x","distance","offsetWidth","style","setProperty","contentToggleEdgeHandling","lockBodyScroll","unlockBodyScroll"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,IAPxE,CASGC,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAAS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OAAuB3D,UAAUC,SAAS,qBAC/CP,EAAkCC,EAAqB,8BAC3D+H,EAAgCC,GDxDnB,MACvB,MAAMO,EAAO5H,SAASoB,cAAc,QACpCwG,WAAMlI,UAAU6B,OAAO,oBCuDbqI,UAOV3M,OAAOmF,iBAAiB,OAAQ,KAC9BmF,EAAmBtK,OAAOuD,aAG5BvD,OAAOmF,iBAAiB,SAAU,KAC5BmF,EAAmB,GAAKtK,OAAOuD,aAAe+G,IAChDA,EAAmBtK,OAAOuD,WAC1BS,EAAYxB,QAASZ,GAAM4D,EAAiBxB,EAAapC,IACzDqG,EAAQC","file":"app.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* eslint-disable wrap-iife */\n/* eslint-disable import/prefer-default-export */\n/* eslint-env browser */\nconst copyToClipboard = (str: string): void => {\n // eslint-disable-next-line no-console\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\n};\n\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\n let found = false;\n const path = event.composedPath();\n path.forEach((p: EventTarget): void => {\n if ((p as HTMLElement).classList) {\n if ((p as HTMLElement).classList.contains(className)) {\n found = true;\n }\n }\n });\n return found;\n};\n\nconst setMetaThemeColor = (): void => {\n const body = document.querySelector('body');\n if (body) {\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\n if (existingMeta) {\n existingMeta.content = bgColor;\n } else {\n const meta = document.createElement('meta');\n meta.name = 'theme-color';\n meta.content = bgColor;\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n }\n};\n\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\n\n// eslint-disable-next-line max-len\nconst convertRemToPixels = (rem: number): number => rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst isViewportBelow = (mediaQuery: string): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const mediaQueryValue = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue(mediaQuery).replace('rem', ''), 10));\n return viewportWidth < mediaQueryValue;\n};\n\nconst setScrollbarWidthVariable = (): void => {\n const scrollbarWidth = window.innerWidth - document.body.clientWidth;\n document.documentElement.style.setProperty('--vertical-scrollbar-width', `${scrollbarWidth}px`);\n};\n\nconst overflowsY = (element: HTMLElement): boolean => element.offsetHeight !== element.scrollHeight;\nconst overflowsX = (element: HTMLElement): boolean => element.offsetWidth !== element.scrollWidth;\n// eslint-disable-next-line max-len\nconst elementOverflows = (element: HTMLElement): boolean => overflowsY(element) || overflowsX(element);\n\nconst setHorizontalScroll = (element: HTMLElement): void => {\n const content = element.querySelector('.horizontal-scroll__scrollable-content');\n if (!overflowsX(content as HTMLElement)) {\n element.classList.add('horizontal-scroll--no-overflow');\n content?.removeAttribute('tabindex');\n } else {\n content?.setAttribute('tabindex', '0');\n }\n};\n\nconst focusableSelector = 'a[href]:not([tabindex=\"-1\"]), area[href]:not([tabindex=\"-1\"]), input:not([disabled]):not([tabindex=\"-1\"]), select:not([disabled]):not([tabindex=\"-1\"]), textarea:not([disabled]):not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), iframe:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [contentEditable=true]:not([tabindex=\"-1\"])';\n\nexport {\n copyToClipboard,\n isElementWithClassNameInEventPath,\n getBaseFontSize,\n setMetaThemeColor,\n isViewportBelow,\n convertRemToPixels,\n setScrollbarWidthVariable,\n overflowsX,\n overflowsY,\n elementOverflows,\n setHorizontalScroll,\n focusableSelector,\n};\n","/* eslint-env browser */\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\n\nconst findNav = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('nav')) {\n return parent;\n }\n return findNav(parent);\n }\n return element;\n};\n\n// eslint-disable-next-line max-len\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\n const navToggledClass = 'nav--toggled';\n navElements.forEach((n) => {\n const button = n.querySelector('.nav__toggle') as HTMLElement;\n if (n !== keepOpen) {\n if (n.classList.contains(navToggledClass)) {\n button.focus();\n button.setAttribute('aria-expanded', 'false');\n }\n n.classList.remove(navToggledClass);\n }\n });\n};\n\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\n const toggleMenu = (button: HTMLElement) => {\n const parent = findNav(button);\n\n const navItems = parent.querySelector('.nav__items');\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\n navItems?.classList.add('nav__items--fadeout');\n const firstElement = navItems?.querySelector('.nav__item--is-overflown') as HTMLElement;\n if (firstElement) {\n firstElement.focus();\n }\n\n const transitionListener = () => {\n parent.classList.toggle('nav--toggled');\n navItems?.classList.remove('nav__items--fadeout');\n lastNavItem?.removeEventListener('transitionend', transitionListener);\n };\n\n lastNavItem?.addEventListener('transitionend', transitionListener);\n return parent;\n };\n\n const cleanUp: CleanUpPair[] = [];\n\n const toggle = document.querySelectorAll('.nav__toggle');\n toggle.forEach((button) => {\n const clickEvent = () => {\n const nav = toggleMenu(button as HTMLElement);\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n closeResponsiveNav(navElements, nav);\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n button.addEventListener('click', clickEvent);\n });\n\n return cleanUp;\n};\n\nconst setResponsiveNav = (\n navElements: NodeListOf<Element>,\n navElement: Element,\n): SetResponsiveNavCleanUp => {\n const navToggledClass = 'nav--toggled';\n const navItemsClass = 'nav__items';\n // gitlab #117\n navElement.classList.remove(navToggledClass);\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\n\n if (navItemsParent) {\n const navItems = navItemsParent.querySelectorAll('.nav__item');\n const isOverflownClass = 'nav__item--is-overflown';\n const hasOverflowClass = 'nav--has-overflow';\n const isActiveClass = 'nav__item--active';\n let hasOverflown = false;\n\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\n const nav = navItems[i] as HTMLElement;\n const top = nav.offsetTop;\n\n if (top > 0) {\n nav.classList.add(isOverflownClass);\n navElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n } else if (!nav.classList.contains(isActiveClass)) {\n nav.classList.remove(isOverflownClass);\n }\n }\n\n if (!hasOverflown) {\n navElement.classList.remove(hasOverflowClass);\n const isActive = navElement.querySelector(`.${isActiveClass}`);\n if (isActive) {\n isActive.classList.remove(isOverflownClass);\n }\n }\n }\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\n closeResponsiveNav(navElements);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n\n return {\n element: document.querySelector('body'),\n clickEvent: bodyClickEvent,\n };\n};\n\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\n const subNavClass = 'sub-nav--toggled';\n buttons.forEach((button) => {\n if (button !== keepOpen) {\n if (button?.parentElement?.classList.contains(subNavClass)) {\n (button as HTMLElement).focus();\n button.setAttribute('aria-expanded', 'false');\n }\n button?.parentElement?.classList.remove(subNavClass);\n }\n });\n};\n\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\n const subNavClass = 'sub-nav--toggled';\n const buttonClickEvent = () => {\n button?.parentElement?.classList.toggle(subNavClass);\n if (button?.parentElement?.classList.contains(subNavClass)) {\n button.setAttribute('aria-expanded', 'true');\n } else {\n button.setAttribute('aria-expanded', 'false');\n }\n closeSubNav(buttons, button);\n };\n\n button.addEventListener('click', buttonClickEvent);\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\n closeSubNav(buttons);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n return {\n buttonClickEvent,\n element: document.querySelector('body'),\n bodyClickEvent,\n };\n};\n\nconst setClickMessage = ((\n text: string,\n copyElement: Element,\n clickElement: Element | null,\n ctcThis: HTMLElement | null,\n listener: () => void,\n): void => {\n if (ctcThis && clickElement) {\n // Vi kopierer teksten til clipboard\n copyToClipboard(ctcThis.innerText);\n copyElement.classList.add('copy-to-clipboard--confirm');\n if (copyElement === clickElement) {\n copyElement.classList.add('copy-to-clipboard--done');\n }\n // Laver en span, der viser, at teksten er kopieret\n const ctcThisMessage = document.createElement('span');\n ctcThisMessage.classList.add('copy-to-clipboard__this__confirm-message');\n ctcThisMessage.innerText = text;\n ctcThis.appendChild(ctcThisMessage);\n\n // Efter 1,2 sekunder fjerner vi beskeden igen\n clickElement.removeEventListener('click', listener);\n setTimeout(() => {\n copyElement.classList.remove('copy-to-clipboard--confirm');\n ctcThisMessage.remove();\n clickElement.addEventListener('click', listener);\n }, 1200);\n }\n});\n\nconst setCopyToClipboard = (element: HTMLElement, text = 'Kopieret!'): void => {\n const ctcThis = <HTMLElement>element.querySelector('.copy-to-clipboard__this');\n // Hvis det er en knap, så sætter vi click event på knappen\n if ((element as HTMLButtonElement).type === 'button') {\n const listener = (): void => {\n setClickMessage(text, element, element, ctcThis, listener);\n };\n element.addEventListener('click', listener);\n // Hvis det ikke er en knap, finder vi knappen \"inde i\" elementet\n } else {\n const btn = element.querySelector('.copy-to-clipboard__execute');\n const listener = (): void => {\n setClickMessage(text, element, btn, ctcThis, listener);\n };\n btn?.addEventListener('click', listener);\n }\n};\n\nconst setSearchToggle = (navSearch: Element, button: Element): void => {\n const toggleClass = 'nav__search--toggled';\n button.addEventListener('click', () => {\n if (navSearch.classList.contains(toggleClass)) {\n button.setAttribute('aria-expanded', 'false');\n navSearch.classList.remove(toggleClass);\n } else {\n button.setAttribute('aria-expanded', 'true');\n navSearch.classList.add(toggleClass);\n }\n });\n};\n\nexport {\n findNav,\n setResponsiveToggle,\n setResponsiveNav,\n setSubNavToggle,\n setCopyToClipboard,\n setSearchToggle,\n};\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-param-reassign */\nimport { getBaseFontSize } from './helpers';\n\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\n }\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\n }\n\n return -1;\n};\n\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const widthInRem = viewportWidth / getBaseFontSize();\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\n if (mediaWidth > -1) {\n return widthInRem < mediaWidth;\n }\n return true;\n};\n\nconst destroyTabs = (tabbed: Element): void => {\n const tablist = tabbed.querySelector('.nav__items');\n const tabs = tablist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n tabs?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('nav__item--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst destroySwitches = (tabbed: Element): void => {\n const switchlist = tabbed.querySelector('.switch');\n const switches = switchlist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n switches?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('switch__segment--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst switchTab = (\n tabs: NodeListOf<HTMLAnchorElement>,\n panels: HTMLElement[],\n oldTab: Element | null,\n newTab: HTMLElement,\n _: DOMTokenList,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number): void => console.log(index),\n): void => {\n if (focus) {\n newTab.focus();\n }\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n\n // Check if switch // should this be more pretty?\n if (newTab.classList.contains('switch__segment')) {\n newTab.classList.add('switch__segment--active');\n } else {\n newTab.classList.add('nav__item--active');\n }\n\n if (oldTab) {\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n\n if (oldTab.classList.contains('switch__segment')) {\n oldTab.classList.remove('switch__segment--active');\n } else {\n oldTab.classList.remove('nav__item--active');\n }\n }\n\n const index = Array.prototype.indexOf.call(tabs, newTab);\n\n // More links\n /* let moreLinks;\n var moreLink: HTMLElement;\n moreLinks = document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`);\n moreLinks.forEach((moreLink) => {\n moreLink.classList.add('tabbed-content-peripheral--active');\n moreLink.hidden = false;\n }); */\n const moreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`));\n moreLinks.forEach((link) => {\n link.classList.add('tabbed-content-peripheral--active');\n link.hidden = false;\n });\n\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n panels[index].hidden = false;\n if (oldTab) {\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n\n const oldMoreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[oldIndex].id}\"]`));\n oldMoreLinks.forEach((link) => {\n link.classList.remove('tabbed-content-peripheral--active');\n link.hidden = true;\n });\n\n /* moreLinks.forEach((moreLink) => {\n moreLink.classList.remove('tabbed-content-peripheral--active');\n moreLink.hidden = true;\n }); */\n\n panels[oldIndex].hidden = true;\n }\n\n // Dispatches custom event on every tab change\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\n bubbles: true,\n detail: { tab: index },\n }));\n callback(index);\n};\n\nconst setTabbedContent = (\n key: number,\n tabbed: Element,\n initial = 0,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number) => console.log(index),\n): void => {\n const tablist = tabbed.querySelector('.switch,.nav__items') as HTMLElement;\n const tabs = tablist.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\n if (expandAll) {\n const expandAllEvent = () => {\n tablist.hidden = true;\n panels.forEach((panel: HTMLElement) => {\n panel.hidden = false;\n });\n };\n\n expandAll.removeEventListener('click', expandAllEvent);\n expandAll.addEventListener('click', expandAllEvent);\n }\n\n // Add the tablist role to the first <ul> in the .tabbed container\n tablist.setAttribute('role', 'tablist');\n\n // Add semantics are remove user focusability for each tab\n tabs.forEach((tab, i) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\n tab.setAttribute('tabindex', '-1');\n tab.parentElement?.setAttribute('role', 'presentation');\n\n // Handle clicking of tabs for mouse users\n const tabClickEvent = (e: MouseEvent) => {\n e.preventDefault();\n const currentTab = tablist.querySelector('[aria-selected]');\n if (e.currentTarget !== currentTab) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n };\n\n tab.removeEventListener('click', tabClickEvent);\n tab.addEventListener('click', tabClickEvent);\n\n // Handle keydown events for keyboard users\n const tabKeyEvent = (e: KeyboardEvent) => {\n // Get the index of the current tab in the tabs node list\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\n // Work out which key the user is pressing and\n // Calculate the new tab's index where appropriate\n let dir: number | string | null = null;\n if (e.key === 'ArrowLeft') {\n dir = index - 1;\n }\n if (e.key === 'ArrowRight') {\n dir = index + 1;\n }\n if (e.key === 'ArrowDown') {\n dir = 'down';\n }\n if (dir !== null) {\n e.preventDefault();\n // If the down key is pressed, move focus to the open panel,\n // otherwise switch to the adjacent tab\n if (dir === 'down') {\n panels[i].focus();\n } else if (tabs[dir]) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n }\n };\n tab.removeEventListener('keydown', tabKeyEvent);\n tab.addEventListener('keydown', tabKeyEvent);\n });\n\n // Add tab panel semantics and hide them all\n panels.forEach((panel: HTMLElement, i: number) => {\n panel.setAttribute('tabindex', '-1');\n panel.setAttribute('aria-labelledby', tabs[i].id);\n // eslint-disable-next-line no-param-reassign\n panel.hidden = true;\n panel.setAttribute('role', 'tabpanel');\n });\n\n // Initially activate the first tab and reveal the first tab panel\n if (initial > -1) {\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\n }\n};\n\nconst setTabs = (tabbedObjects: ITabbedObject[]): void => {\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\n const { rendered, domElement } = tabObject;\n if (isBelowViewportLimit(domElement.classList)) {\n if (!rendered) {\n const focus = domElement.getAttribute('data-focus-onload');\n const dataInitial = domElement.getAttribute('data-initial-tab');\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\n setTabbedContent(key, domElement, initial, focus !== 'false');\n tabObject.rendered = true;\n }\n } else if (rendered) {\n destroyTabs(domElement);\n tabObject.rendered = false;\n }\n });\n};\n\nexport {\n setTabbedContent,\n isBelowViewportLimit,\n destroyTabs,\n destroySwitches,\n setTabs,\n};\n","/* eslint-disable max-len */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\nconst setContentToggle = (\n content: Element,\n onClick?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n beforeCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n afterCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n): CleanUpPair[] => {\n const cleanUp: CleanUpPair[] = [];\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean): () => void => {\n if (focus) {\n contentClose.focus();\n }\n const click = () => {\n content.setAttribute('hidden', 'hidden');\n button.removeAttribute('hidden');\n button.setAttribute('aria-expanded', 'false');\n button.focus();\n };\n contentClose.addEventListener('click', click);\n return click;\n };\n\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\n const contentClose = content.querySelectorAll('.content-toggle__close');\n\n if (button) {\n const clickEvent = () => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n // Til toolbar: hvis man klikker på en knap, der ikke er foldet ud\n // Så lukker vi alle åbne content-toggles\n if (typeof beforeCallback === 'function' && ariaExpanded === 'false') {\n beforeCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n // Og så går vi i gang med folde-ud-logikken\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n if (ariaExpanded === 'true') {\n content.setAttribute('hidden', 'hidden');\n } else {\n content.removeAttribute('hidden');\n }\n\n if (typeof onClick === 'function') {\n onClick(content as HTMLElement, button as HTMLButtonElement);\n }\n\n if (button.hasAttribute('aria-haspopup')) {\n button.setAttribute('hidden', 'hidden');\n contentClose.forEach((cc) => {\n setContentClose(button, cc as HTMLElement, true);\n });\n }\n\n // Det der sker efter folde-logikken\n if (typeof afterCallback === 'function') {\n afterCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n };\n\n button.addEventListener('click', clickEvent);\n // Altid tilføj denne først!\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n contentClose.forEach((cc) => {\n const btnClick = setContentClose(button, cc as HTMLElement, false);\n cleanUp.push({\n element: cc,\n clickEvent: btnClick,\n });\n });\n }\n return cleanUp;\n};\n\nexport {\n setContentToggle,\n};\n","/* eslint-disable max-len */\nimport { convertRemToPixels, isElementWithClassNameInEventPath, isViewportBelow } from './helpers';\n\nconst lockBodyScroll = (): void => {\n const body = document.querySelector('body');\n if (isViewportBelow('--bp-medium') || isViewportBelow('--bp-low-height')) {\n body?.classList.add('body--no-scroll');\n }\n};\n\nconst unlockBodyScroll = (): void => {\n const body = document.querySelector('body');\n body?.classList.remove('body--no-scroll');\n};\n\n/* eslint-env browser */\nconst closeAllContentTogglesInToolbar = (toolbar: HTMLElement): void => {\n const contentToggles = toolbar.querySelectorAll('.content-toggle__toggle');\n contentToggles.forEach((toggle) => {\n const content = toggle.parentElement?.querySelector('.content-toggle__content');\n toggle.setAttribute('aria-expanded', 'false');\n content?.setAttribute('hidden', 'hidden');\n });\n};\n\nconst setOverflow = (toolbarElement: Element): void => {\n if (!toolbarElement.classList.contains('toolbar--no-collapse')) {\n toolbarElement.classList.remove('toolbar--toggled');\n }\n toolbarElement.classList.remove('toolbar--fully-overflown');\n toolbarElement.classList.remove('toolbar--has-popout');\n const toolbarItemsParent = toolbarElement.querySelector('.toolbar__items');\n const toolbarItems = toolbarItemsParent?.children as HTMLCollection;\n const isOverflownClass = 'toolbar__item--is-overflown';\n const hasOverflowClass = 'toolbar--has-overflow';\n let hasOverflown = false;\n\n let overflownCount = 0;\n const addOverflowClass = (item: HTMLElement, index: number) => {\n if (item) {\n const top = item.offsetTop;\n if (top > 25) {\n item.classList.add(isOverflownClass);\n toolbarElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n overflownCount += 1;\n } else {\n item.classList.remove(isOverflownClass);\n }\n\n if (!hasOverflown) {\n toolbarElement.classList.remove(hasOverflowClass);\n } else if (index - 1 >= 0) {\n addOverflowClass(toolbarItems[index - 1] as HTMLElement, index - 1);\n }\n }\n };\n\n addOverflowClass(toolbarItems[toolbarItems.length - 1] as HTMLElement, toolbarItems.length - 1);\n\n if (overflownCount > 0 && overflownCount === toolbarItems.length) {\n toolbarElement.classList.add('toolbar--fully-overflown');\n }\n};\n\nconst setToolbarToggle = (toolbar: HTMLElement): ExtendedCleanUpPair[] => {\n const cleanUp: ExtendedCleanUpPair[] = [];\n const buttons = toolbar.querySelectorAll('.toolbar__toggle');\n buttons.forEach((button) => {\n const clickEvent = () => {\n button?.parentElement?.classList.toggle('toolbar--toggled');\n const ariaExpanded = button.getAttribute('aria-expanded');\n if (ariaExpanded !== 'true') {\n const focusable = 'a.toolbar__item--is-overflown, button.toolbar__item--is-overflown, input.toolbar__item--is-overflown, select.toolbar__item--is-overflown, .toolbar__item--is-overflown a, .toolbar__item--is-overflown button, .toolbar__item--is-overflown input, .toolbar__item--is-overflown select';\n const firstWithOverflow = button?.parentElement?.querySelector(focusable) as HTMLElement;\n if (firstWithOverflow) {\n setTimeout(() => {\n firstWithOverflow.focus();\n }, 0);\n }\n }\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n button.addEventListener('click', clickEvent);\n });\n return cleanUp;\n};\n\nconst setToolbar = (\n toolbar: HTMLElement,\n onCloseContentToggle: (toolbarElement: HTMLElement) => void,\n setOverflowOnly = true,\n): ExtendedCleanUpPair[] => {\n let cleanUp: ExtendedCleanUpPair[] = [];\n\n setOverflow(toolbar);\n onCloseContentToggle(toolbar);\n cleanUp = cleanUp.concat(setToolbarToggle(toolbar));\n\n if (!setOverflowOnly) {\n const bodyClickEvent = (event: Event) => {\n if (!(event.target as HTMLElement).classList.contains('content-toggle__toggle')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'content-toggle__content')) {\n onCloseContentToggle(toolbar);\n }\n };\n\n const escKeyEvent = (event: Event) => {\n if ((event as KeyboardEvent).key === 'Escape') {\n if (event.target && (event.target as HTMLElement).getAttribute('type') !== 'search') {\n onCloseContentToggle(toolbar);\n }\n }\n };\n\n const body = document.querySelector('body');\n\n cleanUp.push({\n element: body as Element,\n clickEvent: bodyClickEvent,\n });\n\n cleanUp.push({\n element: window,\n keyUpEvent: escKeyEvent,\n });\n\n body?.addEventListener('click', bodyClickEvent);\n window.addEventListener('keyup', escKeyEvent);\n }\n\n return cleanUp;\n};\n\nconst findToolbar = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('toolbar')) {\n return parent;\n }\n return findToolbar(parent);\n }\n return element;\n};\n\nconst contentToggleEdgeHandling = (element: HTMLElement): void => {\n if (!isViewportBelow('--bp-medium') && !isViewportBelow('--bp-low-height')) {\n const allowedDistance = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--toolbar-popout-allowed-edge-distance').replace('rem,', ''), 10));\n const popoutX = parseInt(getComputedStyle(element).width.replace('px', ''), 10);\n const popoutWidth = element.getBoundingClientRect().x;\n\n const distance = document.body.offsetWidth - allowedDistance - popoutX - popoutWidth;\n\n if (distance < 0) {\n element.style.setProperty('--toolbar-popout-edge-overflow', `${distance}px`);\n }\n }\n};\n\nexport {\n setToolbar,\n setOverflow,\n findToolbar,\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n lockBodyScroll,\n unlockBodyScroll,\n};\n","/* eslint-disable no-param-reassign */\n/* eslint-env browser */\nimport ready from '../components/ready';\nimport {\n setResponsiveNav,\n setResponsiveToggle,\n} from '../components/nav';\nimport { isElementWithClassNameInEventPath, setMetaThemeColor } from '../components/helpers';\nimport { setResponsiveTable } from '../components/table';\nimport { setTabs } from '../components/tabs';\nimport { setContentToggle } from '../components/content-toggle';\nimport {\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n findToolbar,\n lockBodyScroll,\n unlockBodyScroll,\n} from '../components/toolbar';\n\nlet windowInnerWidth = 0;\n\nready(() => {\n const tabbedContent = document.querySelectorAll('.tabbed-content');\n const tabbedObjects: ITabbedObject[] = [];\n tabbedContent.forEach((tab) => tabbedObjects.push({\n domElement: tab,\n rendered: false,\n }));\n setTabs(tabbedObjects);\n setMetaThemeColor();\n\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setResponsiveToggle(navElements);\n\n const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\n tables.forEach((table) => setResponsiveTable(table));\n\n // Almindelige content toggles\n const toggles = document.querySelectorAll('.box .content-toggle__content');\n toggles.forEach((toggle) => {\n setContentToggle(toggle);\n });\n\n // Kursuskatalog\n const togglesInToolbars = document.querySelectorAll('.toolbar .content-toggle__content');\n togglesInToolbars.forEach((toggle) => {\n setContentToggle(\n toggle,\n (popout: HTMLElement) => {\n contentToggleEdgeHandling(popout);\n lockBodyScroll();\n },\n (content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content)),\n (content: HTMLElement, button: HTMLButtonElement) => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n const toolbar = findToolbar(content);\n if (ariaExpanded === 'true') {\n toolbar?.classList.add('toolbar--has-popout');\n } else {\n toolbar?.classList.remove('toolbar--has-popout');\n }\n\n content.addEventListener('click', (event: MouseEvent) => {\n if ((event.target as HTMLElement).classList.contains('toolbar__popout')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {\n closeAllContentTogglesInToolbar(toolbar);\n unlockBodyScroll();\n }\n });\n },\n );\n });\n\n window.addEventListener('load', () => {\n windowInnerWidth = window.innerWidth;\n });\n\n window.addEventListener('resize', () => {\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\n windowInnerWidth = window.innerWidth;\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setTabs(tabbedObjects);\n }\n });\n});\n","/* eslint-env browser */\nconst ready = (fn: () => void): void => {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n};\n\nexport default ready;\n","/* eslint-disable import/prefer-default-export */\nconst setResponsiveTable = (table: Element): void => {\n const head = table.querySelector('thead');\n const body = table.querySelector('tbody');\n const foot = table.querySelector('tfoot');\n\n if (head) {\n const headers: string[] = [];\n const ths = head.querySelectorAll('th');\n ths.forEach((h) => {\n if (!h.classList.contains('table__cell--self-explanatory')) {\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\n } else {\n headers.push(''); // If header is self explanatory we do not add it\n }\n });\n\n const rowContainers: HTMLTableSectionElement[] = [];\n // Table elements that possibly contains <tr>'s\n if (body) {\n rowContainers.push(body);\n }\n if (foot) {\n rowContainers.push(foot);\n }\n\n rowContainers.forEach((rc) => {\n const rows = rc.querySelectorAll('tr');\n rows.forEach((tr) => {\n const cells = tr.querySelectorAll('td, th');\n cells.forEach((cell, i) => {\n if (headers[i]) {\n // if header is self explanatory we skip (value of array index is '' which is falsy)\n cell.setAttribute('data-label', headers[i]);\n }\n });\n });\n });\n }\n};\n\nexport {\n setResponsiveTable,\n};\n"],"sourceRoot":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../source/js/components/ready.ts", "../../source/js/components/helpers.ts", "../../source/js/components/nav.ts", "../../source/js/components/table.ts", "../../source/js/components/tabs.ts", "../../source/js/components/content-toggle.ts", "../../source/js/components/toolbar.ts", "../../source/js/components/horizontal-scroll-btn.ts", "../../source/js/production/app.ts"],
4
+ "sourcesContent": ["/* eslint-env browser */\nconst ready = (fn: () => void): void => {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n};\n\nexport default ready;\n", "/* eslint-disable wrap-iife */\n/* eslint-disable import/prefer-default-export */\n/* eslint-env browser */\nconst copyToClipboard = (str: string): void => {\n // eslint-disable-next-line no-console\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\n};\n\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\n let found = false;\n const path = event.composedPath();\n path.forEach((p: EventTarget): void => {\n if ((p as HTMLElement).classList) {\n if ((p as HTMLElement).classList.contains(className)) {\n found = true;\n }\n }\n });\n return found;\n};\n\nconst setMetaThemeColor = (): void => {\n const body = document.querySelector('body');\n if (body) {\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\n if (existingMeta) {\n existingMeta.content = bgColor;\n } else {\n const meta = document.createElement('meta');\n meta.name = 'theme-color';\n meta.content = bgColor;\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n }\n};\n\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\n\n// eslint-disable-next-line max-len\nconst convertRemToPixels = (rem: number): number => rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst isViewportBelow = (mediaQuery: string): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const mediaQueryValue = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue(mediaQuery).replace('rem', ''), 10));\n return viewportWidth < mediaQueryValue;\n};\n\nconst setScrollbarWidthVariable = (): void => {\n const scrollbarWidth = window.innerWidth - document.body.clientWidth;\n document.documentElement.style.setProperty('--vertical-scrollbar-width', `${scrollbarWidth}px`);\n};\n\nconst overflowsY = (element: HTMLElement): boolean => element.offsetHeight !== element.scrollHeight;\nconst overflowsX = (element: HTMLElement): boolean => element.offsetWidth !== element.scrollWidth;\n// eslint-disable-next-line max-len\nconst elementOverflows = (element: HTMLElement): boolean => overflowsY(element) || overflowsX(element);\n\nconst setHorizontalScroll = (element: HTMLElement): void => {\n const content = element.querySelector('.horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content');\n if (content) {\n if (!overflowsX(content as HTMLElement)) {\n element.classList.add('horizontal-scroll--no-overflow');\n content?.removeAttribute('tabindex');\n } else {\n content?.setAttribute('tabindex', '0');\n }\n }\n};\n\nconst focusableSelector = 'a[href]:not([tabindex=\"-1\"]), area[href]:not([tabindex=\"-1\"]), input:not([disabled]):not([tabindex=\"-1\"]), select:not([disabled]):not([tabindex=\"-1\"]), textarea:not([disabled]):not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), iframe:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [contentEditable=true]:not([tabindex=\"-1\"])';\n\nexport {\n copyToClipboard,\n isElementWithClassNameInEventPath,\n getBaseFontSize,\n setMetaThemeColor,\n isViewportBelow,\n convertRemToPixels,\n setScrollbarWidthVariable,\n overflowsX,\n overflowsY,\n elementOverflows,\n setHorizontalScroll,\n focusableSelector,\n};\n", "/* eslint-env browser */\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\n\nconst findNav = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('nav')) {\n return parent;\n }\n return findNav(parent);\n }\n return element;\n};\n\n// eslint-disable-next-line max-len\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\n const navToggledClass = 'nav--toggled';\n navElements.forEach((n) => {\n const button = n.querySelector('.nav__toggle') as HTMLElement;\n if (n !== keepOpen) {\n if (n.classList.contains(navToggledClass)) {\n button.focus();\n button.setAttribute('aria-expanded', 'false');\n }\n n.classList.remove(navToggledClass);\n }\n });\n};\n\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\n const toggleMenu = (button: HTMLElement) => {\n const parent = findNav(button);\n\n const navItems = parent.querySelector('.nav__items');\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\n navItems?.classList.add('nav__items--fadeout');\n const firstElement = navItems?.querySelector('.nav__item--is-overflown') as HTMLElement;\n if (firstElement) {\n firstElement.focus();\n }\n\n const transitionListener = () => {\n parent.classList.toggle('nav--toggled');\n navItems?.classList.remove('nav__items--fadeout');\n lastNavItem?.removeEventListener('transitionend', transitionListener);\n };\n\n lastNavItem?.addEventListener('transitionend', transitionListener);\n return parent;\n };\n\n const cleanUp: CleanUpPair[] = [];\n\n const toggle = document.querySelectorAll('.nav__toggle');\n toggle.forEach((button) => {\n const clickEvent = () => {\n const nav = toggleMenu(button as HTMLElement);\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n closeResponsiveNav(navElements, nav);\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n button.addEventListener('click', clickEvent);\n });\n\n return cleanUp;\n};\n\nconst setResponsiveNav = (\n navElements: NodeListOf<Element>,\n navElement: Element,\n): SetResponsiveNavCleanUp => {\n const navToggledClass = 'nav--toggled';\n const navItemsClass = 'nav__items';\n // gitlab #117\n navElement.classList.remove(navToggledClass);\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\n\n if (navItemsParent) {\n const navItems = navItemsParent.querySelectorAll('.nav__item');\n const isOverflownClass = 'nav__item--is-overflown';\n const hasOverflowClass = 'nav--has-overflow';\n const isActiveClass = 'nav__item--active';\n let hasOverflown = false;\n\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\n const nav = navItems[i] as HTMLElement;\n const top = nav.offsetTop;\n\n if (top > 0) {\n nav.classList.add(isOverflownClass);\n navElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n } else if (!nav.classList.contains(isActiveClass)) {\n nav.classList.remove(isOverflownClass);\n }\n }\n\n if (!hasOverflown) {\n navElement.classList.remove(hasOverflowClass);\n const isActive = navElement.querySelector(`.${isActiveClass}`);\n if (isActive) {\n isActive.classList.remove(isOverflownClass);\n }\n }\n }\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\n closeResponsiveNav(navElements);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n\n return {\n element: document.querySelector('body'),\n clickEvent: bodyClickEvent,\n };\n};\n\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\n const subNavClass = 'sub-nav--toggled';\n buttons.forEach((button) => {\n if (button !== keepOpen) {\n if (button?.parentElement?.classList.contains(subNavClass)) {\n (button as HTMLElement).focus();\n button.setAttribute('aria-expanded', 'false');\n }\n button?.parentElement?.classList.remove(subNavClass);\n }\n });\n};\n\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\n const subNavClass = 'sub-nav--toggled';\n const buttonClickEvent = () => {\n button?.parentElement?.classList.toggle(subNavClass);\n if (button?.parentElement?.classList.contains(subNavClass)) {\n button.setAttribute('aria-expanded', 'true');\n } else {\n button.setAttribute('aria-expanded', 'false');\n }\n closeSubNav(buttons, button);\n };\n\n button.addEventListener('click', buttonClickEvent);\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\n closeSubNav(buttons);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n return {\n buttonClickEvent,\n element: document.querySelector('body'),\n bodyClickEvent,\n };\n};\n\nconst setClickMessage = ((\n text: string,\n copyElement: Element,\n clickElement: Element | null,\n ctcThis: HTMLElement | null,\n listener: () => void,\n): void => {\n if (ctcThis && clickElement) {\n // Vi kopierer teksten til clipboard\n copyToClipboard(ctcThis.innerText);\n copyElement.classList.add('copy-to-clipboard--confirm');\n if (copyElement === clickElement) {\n copyElement.classList.add('copy-to-clipboard--done');\n }\n // Laver en span, der viser, at teksten er kopieret\n const ctcThisMessage = document.createElement('span');\n ctcThisMessage.classList.add('copy-to-clipboard__this__confirm-message');\n ctcThisMessage.innerText = text;\n ctcThis.appendChild(ctcThisMessage);\n\n // Efter 1,2 sekunder fjerner vi beskeden igen\n clickElement.removeEventListener('click', listener);\n setTimeout(() => {\n copyElement.classList.remove('copy-to-clipboard--confirm');\n ctcThisMessage.remove();\n clickElement.addEventListener('click', listener);\n }, 1200);\n }\n});\n\nconst setCopyToClipboard = (element: HTMLElement, text = 'Kopieret!'): void => {\n const ctcThis = <HTMLElement>element.querySelector('.copy-to-clipboard__this');\n // Hvis det er en knap, s\u00E5 s\u00E6tter vi click event p\u00E5 knappen\n if ((element as HTMLButtonElement).type === 'button') {\n const listener = (): void => {\n setClickMessage(text, element, element, ctcThis, listener);\n };\n element.addEventListener('click', listener);\n // Hvis det ikke er en knap, finder vi knappen \"inde i\" elementet\n } else {\n const btn = element.querySelector('.copy-to-clipboard__execute');\n const listener = (): void => {\n setClickMessage(text, element, btn, ctcThis, listener);\n };\n btn?.addEventListener('click', listener);\n }\n};\n\nconst setSearchToggle = (navSearch: Element, button: Element): void => {\n const toggleClass = 'nav__search--toggled';\n button.addEventListener('click', () => {\n if (navSearch.classList.contains(toggleClass)) {\n button.setAttribute('aria-expanded', 'false');\n navSearch.classList.remove(toggleClass);\n } else {\n button.setAttribute('aria-expanded', 'true');\n navSearch.classList.add(toggleClass);\n }\n });\n};\n\nexport {\n findNav,\n setResponsiveToggle,\n setResponsiveNav,\n setSubNavToggle,\n setCopyToClipboard,\n setSearchToggle,\n};\n", "/* eslint-disable import/prefer-default-export */\nconst setResponsiveTable = (table: Element): void => {\n const head = table.querySelector('thead');\n const body = table.querySelector('tbody');\n const foot = table.querySelector('tfoot');\n\n if (head) {\n const headers: string[] = [];\n const ths = head.querySelectorAll('th');\n ths.forEach((h) => {\n if (!h.classList.contains('table__cell--self-explanatory')) {\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\n } else {\n headers.push(''); // If header is self explanatory we do not add it\n }\n });\n\n const rowContainers: HTMLTableSectionElement[] = [];\n // Table elements that possibly contains <tr>'s\n if (body) {\n rowContainers.push(body);\n }\n if (foot) {\n rowContainers.push(foot);\n }\n\n rowContainers.forEach((rc) => {\n const rows = rc.querySelectorAll('tr');\n rows.forEach((tr) => {\n const cells = tr.querySelectorAll('td, th');\n cells.forEach((cell, i) => {\n if (headers[i]) {\n // if header is self explanatory we skip (value of array index is '' which is falsy)\n cell.setAttribute('data-label', headers[i]);\n }\n });\n });\n });\n }\n};\n\nexport {\n setResponsiveTable,\n};\n", "/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-param-reassign */\nimport { getBaseFontSize } from './helpers';\n\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\n }\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\n }\n\n return -1;\n};\n\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const widthInRem = viewportWidth / getBaseFontSize();\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\n if (mediaWidth > -1) {\n return widthInRem < mediaWidth;\n }\n return true;\n};\n\nconst destroyTabs = (tabbed: Element): void => {\n const tablist = tabbed.querySelector('.nav__items');\n const tabs = tablist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n tabs?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('nav__item--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst destroySwitches = (tabbed: Element): void => {\n const switchlist = tabbed.querySelector('.switch');\n const switches = switchlist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n switches?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('switch__segment--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst switchTab = (\n tabs: NodeListOf<HTMLAnchorElement>,\n panels: HTMLElement[],\n oldTab: Element | null,\n newTab: HTMLElement,\n _: DOMTokenList,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number): void => console.log(index),\n): void => {\n if (focus) {\n newTab.focus();\n }\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n\n // Check if switch // should this be more pretty?\n if (newTab.classList.contains('switch__segment')) {\n newTab.classList.add('switch__segment--active');\n } else {\n newTab.classList.add('nav__item--active');\n }\n\n if (oldTab) {\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n\n if (oldTab.classList.contains('switch__segment')) {\n oldTab.classList.remove('switch__segment--active');\n } else {\n oldTab.classList.remove('nav__item--active');\n }\n }\n\n const index = Array.prototype.indexOf.call(tabs, newTab);\n\n // More links\n /* let moreLinks;\n var moreLink: HTMLElement;\n moreLinks = document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`);\n moreLinks.forEach((moreLink) => {\n moreLink.classList.add('tabbed-content-peripheral--active');\n moreLink.hidden = false;\n }); */\n const moreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`));\n moreLinks.forEach((link) => {\n link.classList.add('tabbed-content-peripheral--active');\n link.hidden = false;\n });\n\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n panels[index].hidden = false;\n if (oldTab) {\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n\n const oldMoreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[oldIndex].id}\"]`));\n oldMoreLinks.forEach((link) => {\n link.classList.remove('tabbed-content-peripheral--active');\n link.hidden = true;\n });\n\n /* moreLinks.forEach((moreLink) => {\n moreLink.classList.remove('tabbed-content-peripheral--active');\n moreLink.hidden = true;\n }); */\n\n panels[oldIndex].hidden = true;\n }\n\n // Dispatches custom event on every tab change\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\n bubbles: true,\n detail: { tab: index },\n }));\n callback(index);\n};\n\nconst setTabbedContent = (\n key: number,\n tabbed: Element,\n initial = 0,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number) => console.log(index),\n): void => {\n const tablist = tabbed.querySelector('.switch,.nav__items') as HTMLElement;\n const tabs = tablist.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\n if (expandAll) {\n const expandAllEvent = () => {\n tablist.hidden = true;\n panels.forEach((panel: HTMLElement) => {\n panel.hidden = false;\n });\n };\n\n expandAll.removeEventListener('click', expandAllEvent);\n expandAll.addEventListener('click', expandAllEvent);\n }\n\n // Add the tablist role to the first <ul> in the .tabbed container\n tablist.setAttribute('role', 'tablist');\n\n // Add semantics are remove user focusability for each tab\n tabs.forEach((tab, i) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\n tab.setAttribute('tabindex', '-1');\n tab.parentElement?.setAttribute('role', 'presentation');\n\n // Handle clicking of tabs for mouse users\n const tabClickEvent = (e: MouseEvent) => {\n e.preventDefault();\n const currentTab = tablist.querySelector('[aria-selected]');\n if (e.currentTarget !== currentTab) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n };\n\n tab.removeEventListener('click', tabClickEvent);\n tab.addEventListener('click', tabClickEvent);\n\n // Handle keydown events for keyboard users\n const tabKeyEvent = (e: KeyboardEvent) => {\n // Get the index of the current tab in the tabs node list\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\n // Work out which key the user is pressing and\n // Calculate the new tab's index where appropriate\n let dir: number | string | null = null;\n if (e.key === 'ArrowLeft') {\n dir = index - 1;\n }\n if (e.key === 'ArrowRight') {\n dir = index + 1;\n }\n if (e.key === 'ArrowDown') {\n dir = 'down';\n }\n if (dir !== null) {\n e.preventDefault();\n // If the down key is pressed, move focus to the open panel,\n // otherwise switch to the adjacent tab\n if (dir === 'down') {\n panels[i].focus();\n } else if (tabs[dir]) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n }\n };\n tab.removeEventListener('keydown', tabKeyEvent);\n tab.addEventListener('keydown', tabKeyEvent);\n });\n\n // Add tab panel semantics and hide them all\n panels.forEach((panel: HTMLElement, i: number) => {\n panel.setAttribute('tabindex', '-1');\n panel.setAttribute('aria-labelledby', tabs[i].id);\n // eslint-disable-next-line no-param-reassign\n panel.hidden = true;\n panel.setAttribute('role', 'tabpanel');\n });\n\n // Initially activate the first tab and reveal the first tab panel\n if (initial > -1) {\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\n }\n};\n\nconst setTabs = (tabbedObjects: ITabbedObject[]): void => {\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\n const { rendered, domElement } = tabObject;\n if (isBelowViewportLimit(domElement.classList)) {\n if (!rendered) {\n const focus = domElement.getAttribute('data-focus-onload');\n const dataInitial = domElement.getAttribute('data-initial-tab');\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\n setTabbedContent(key, domElement, initial, focus !== 'false');\n tabObject.rendered = true;\n }\n } else if (rendered) {\n destroyTabs(domElement);\n tabObject.rendered = false;\n }\n });\n};\n\nexport {\n setTabbedContent,\n isBelowViewportLimit,\n destroyTabs,\n destroySwitches,\n setTabs,\n};\n", "/* eslint-disable max-len */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\nconst setContentToggle = (\n content: Element,\n onClick?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n beforeCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n afterCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n): CleanUpPair[] => {\n const cleanUp: CleanUpPair[] = [];\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean): () => void => {\n if (focus) {\n contentClose.focus();\n }\n const click = () => {\n content.setAttribute('hidden', 'hidden');\n button.removeAttribute('hidden');\n button.setAttribute('aria-expanded', 'false');\n button.focus();\n };\n contentClose.addEventListener('click', click);\n return click;\n };\n\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\n const contentClose = content.querySelectorAll('.content-toggle__close');\n\n if (button) {\n const clickEvent = () => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n // Til toolbar: hvis man klikker p\u00E5 en knap, der ikke er foldet ud\n // S\u00E5 lukker vi alle \u00E5bne content-toggles\n if (typeof beforeCallback === 'function' && ariaExpanded === 'false') {\n beforeCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n // Og s\u00E5 g\u00E5r vi i gang med folde-ud-logikken\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n if (ariaExpanded === 'true') {\n content.setAttribute('hidden', 'hidden');\n } else {\n content.removeAttribute('hidden');\n }\n\n if (typeof onClick === 'function') {\n onClick(content as HTMLElement, button as HTMLButtonElement);\n }\n\n if (button.hasAttribute('aria-haspopup')) {\n button.setAttribute('hidden', 'hidden');\n contentClose.forEach((cc) => {\n setContentClose(button, cc as HTMLElement, true);\n });\n }\n\n // Det der sker efter folde-logikken\n if (typeof afterCallback === 'function') {\n afterCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n };\n\n button.addEventListener('click', clickEvent);\n // Altid tilf\u00F8j denne f\u00F8rst!\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n contentClose.forEach((cc) => {\n const btnClick = setContentClose(button, cc as HTMLElement, false);\n cleanUp.push({\n element: cc,\n clickEvent: btnClick,\n });\n });\n }\n return cleanUp;\n};\n\nexport {\n setContentToggle,\n};\n", "/* eslint-disable max-len */\nimport { convertRemToPixels, isElementWithClassNameInEventPath, isViewportBelow } from './helpers';\n\nconst lockBodyScroll = (): void => {\n const body = document.querySelector('body');\n if (isViewportBelow('--bp-medium') || isViewportBelow('--bp-low-height')) {\n body?.classList.add('body--no-scroll');\n }\n};\n\nconst unlockBodyScroll = (): void => {\n const body = document.querySelector('body');\n body?.classList.remove('body--no-scroll');\n};\n\n/* eslint-env browser */\nconst closeAllContentTogglesInToolbar = (toolbar: HTMLElement): void => {\n const contentToggles = toolbar.querySelectorAll('.content-toggle__toggle');\n contentToggles.forEach((toggle) => {\n const content = toggle.parentElement?.querySelector('.content-toggle__content');\n toggle.setAttribute('aria-expanded', 'false');\n content?.setAttribute('hidden', 'hidden');\n });\n};\n\nconst setOverflow = (toolbarElement: Element): void => {\n if (!toolbarElement.classList.contains('toolbar--no-collapse')) {\n toolbarElement.classList.remove('toolbar--toggled');\n }\n toolbarElement.classList.remove('toolbar--fully-overflown');\n toolbarElement.classList.remove('toolbar--has-popout');\n const toolbarItemsParent = toolbarElement.querySelector('.toolbar__items');\n const toolbarItems = toolbarItemsParent?.children as HTMLCollection;\n const isOverflownClass = 'toolbar__item--is-overflown';\n const hasOverflowClass = 'toolbar--has-overflow';\n let hasOverflown = false;\n\n let overflownCount = 0;\n const addOverflowClass = (item: HTMLElement, index: number) => {\n if (item) {\n const top = item.offsetTop;\n if (top > 25) {\n item.classList.add(isOverflownClass);\n toolbarElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n overflownCount += 1;\n } else {\n item.classList.remove(isOverflownClass);\n }\n\n if (!hasOverflown) {\n toolbarElement.classList.remove(hasOverflowClass);\n } else if (index - 1 >= 0) {\n addOverflowClass(toolbarItems[index - 1] as HTMLElement, index - 1);\n }\n }\n };\n\n addOverflowClass(toolbarItems[toolbarItems.length - 1] as HTMLElement, toolbarItems.length - 1);\n\n if (overflownCount > 0 && overflownCount === toolbarItems.length) {\n toolbarElement.classList.add('toolbar--fully-overflown');\n }\n};\n\nconst setToolbarToggle = (toolbar: HTMLElement): ExtendedCleanUpPair[] => {\n const cleanUp: ExtendedCleanUpPair[] = [];\n const buttons = toolbar.querySelectorAll('.toolbar__toggle');\n buttons.forEach((button) => {\n const clickEvent = () => {\n button?.parentElement?.classList.toggle('toolbar--toggled');\n const ariaExpanded = button.getAttribute('aria-expanded');\n if (ariaExpanded !== 'true') {\n const focusable = 'a.toolbar__item--is-overflown, button.toolbar__item--is-overflown, input.toolbar__item--is-overflown, select.toolbar__item--is-overflown, .toolbar__item--is-overflown a, .toolbar__item--is-overflown button, .toolbar__item--is-overflown input, .toolbar__item--is-overflown select';\n const firstWithOverflow = button?.parentElement?.querySelector(focusable) as HTMLElement;\n if (firstWithOverflow) {\n setTimeout(() => {\n firstWithOverflow.focus();\n }, 0);\n }\n }\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n button.addEventListener('click', clickEvent);\n });\n return cleanUp;\n};\n\nconst setToolbar = (\n toolbar: HTMLElement,\n onCloseContentToggle: (toolbarElement: HTMLElement) => void,\n setOverflowOnly = true,\n): ExtendedCleanUpPair[] => {\n let cleanUp: ExtendedCleanUpPair[] = [];\n\n setOverflow(toolbar);\n onCloseContentToggle(toolbar);\n cleanUp = cleanUp.concat(setToolbarToggle(toolbar));\n\n if (!setOverflowOnly) {\n const bodyClickEvent = (event: Event) => {\n if (!(event.target as HTMLElement).classList.contains('content-toggle__toggle')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'content-toggle__content')) {\n onCloseContentToggle(toolbar);\n }\n };\n\n const escKeyEvent = (event: Event) => {\n if ((event as KeyboardEvent).key === 'Escape') {\n if (event.target && (event.target as HTMLElement).getAttribute('type') !== 'search') {\n onCloseContentToggle(toolbar);\n }\n }\n };\n\n const body = document.querySelector('body');\n\n cleanUp.push({\n element: body as Element,\n clickEvent: bodyClickEvent,\n });\n\n cleanUp.push({\n element: window,\n keyUpEvent: escKeyEvent,\n });\n\n body?.addEventListener('click', bodyClickEvent);\n window.addEventListener('keyup', escKeyEvent);\n }\n\n return cleanUp;\n};\n\nconst findToolbar = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('toolbar')) {\n return parent;\n }\n return findToolbar(parent);\n }\n return element;\n};\n\nconst contentToggleEdgeHandling = (element: HTMLElement): void => {\n if (!isViewportBelow('--bp-medium') && !isViewportBelow('--bp-low-height')) {\n const allowedDistance = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--toolbar-popout-allowed-edge-distance').replace('rem,', ''), 10));\n const popoutX = parseInt(getComputedStyle(element).width.replace('px', ''), 10);\n const popoutWidth = element.getBoundingClientRect().x;\n\n const distance = document.body.offsetWidth - allowedDistance - popoutX - popoutWidth;\n\n if (distance < 0) {\n element.style.setProperty('--toolbar-popout-edge-overflow', `${distance}px`);\n }\n }\n};\n\nexport {\n setToolbar,\n setOverflow,\n findToolbar,\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n lockBodyScroll,\n unlockBodyScroll,\n};\n", "// Scroller 80% p\u00E5 horisontal scroll til h\u00F8jre og s\u00E6tter knappen disabled n\u00E5r man rammer bunden\nconst horizontalScrollButtonNext = (nextButtons: NodeListOf<Element>): void => {\n if (nextButtons) {\n nextButtons.forEach((nextButton) => {\n const topElem = nextButton?.parentElement?.parentElement?.parentElement?.parentElement;\n if (topElem) {\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\n const switch__segments = topElem.querySelectorAll('.switch__segment');\n scrollElements.forEach((scrollElement) => { \n if (scrollElement) {\n nextButton.addEventListener('click', () => {\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til h\u00F8jre\n const scrollAmount = 0.8 * scrollElement.clientWidth;\n scrollElement.scrollLeft += scrollAmount;\n });\n // G\u00F8r knappen aktiv hvis scroll har ramt bunden\n scrollElement.addEventListener('scroll', () => {\n if ((scrollElement.scrollLeft + scrollElement.clientWidth) >= (scrollElement.scrollWidth * 0.98)) {\n disableButton(nextButton);\n } else if (scrollElement.scrollLeft + scrollElement.clientWidth < scrollElement.scrollWidth) {\n activateButton(nextButton);\n }\n });\n // Reset af knap ved flere tabs af horizontal scroll\n if (switch__segments) {\n switch__segments.forEach(switch__segment => {\n switch__segment.addEventListener('click', () => {\n activateButton(nextButton);\n scrollElement.scrollLeft = 0;\n })\n });\n }\n }\n });\n }\n });\n }\n };\n \n // Scroller 80% p\u00E5 horisontal scroll til venstre og s\u00E6tter knappen disabled n\u00E5r man rammer toppen\n const horizontalScrollButtonPrevious = (previousButtons: NodeListOf<Element>): void => {\n if (previousButtons) {\n previousButtons.forEach((previousButton) => {\n const topElem = previousButton?.parentElement?.parentElement?.parentElement?.parentElement;\n if (topElem) {\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\n const switch__segments = topElem.querySelectorAll('.switch__segment');\n scrollElements.forEach((scrollElement) => { \n if (scrollElement) {\n previousButton.addEventListener('click', () => {\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til venstre\n const scrollAmount = 0.8 * scrollElement.clientWidth;\n scrollElement.scrollLeft -= scrollAmount;\n });\n // G\u00F8r knappen aktiv hvis scroll har ramt toppen\n scrollElement.addEventListener('scroll', () => {\n if (scrollElement.scrollLeft <= 0) {\n disableButton(previousButton);\n } else if (scrollElement.scrollLeft > 0) {\n activateButton(previousButton);\n }\n });\n }\n // Reset af knap ved flere tabs af horizontal scroll\n if (switch__segments) {\n switch__segments.forEach(switch__segment => {\n switch__segment.addEventListener('click', () => {\n disableButton(previousButton);\n });\n });\n }\n });\n }\n });\n }\n };\n\n function activateButton(button) {\n button.classList.remove('visually-disabled');\n button.setAttribute('aria-disabled', 'false');\n }\n \n function disableButton(button) {\n button.classList.add('visually-disabled');\n button.setAttribute('aria-disabled', 'true');\n }\n\n export {\n horizontalScrollButtonNext,\n horizontalScrollButtonPrevious,\n };", "/* eslint-disable no-param-reassign */\n/* eslint-env browser */\nimport ready from '../components/ready';\nimport {\n setResponsiveNav,\n setResponsiveToggle,\n} from '../components/nav';\nimport { isElementWithClassNameInEventPath, setMetaThemeColor } from '../components/helpers';\nimport { setResponsiveTable } from '../components/table';\nimport { setTabs } from '../components/tabs';\nimport { setContentToggle } from '../components/content-toggle';\nimport {\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n findToolbar,\n lockBodyScroll,\n unlockBodyScroll,\n} from '../components/toolbar';\nimport { horizontalScrollButtonNext, horizontalScrollButtonPrevious } from '../components/horizontal-scroll-btn';\n\nlet windowInnerWidth = 0;\n\nready(() => {\n const tabbedContent = document.querySelectorAll('.tabbed-content');\n const tabbedObjects: ITabbedObject[] = [];\n tabbedContent.forEach((tab) => tabbedObjects.push({\n domElement: tab,\n rendered: false,\n }));\n setTabs(tabbedObjects);\n setMetaThemeColor();\n\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setResponsiveToggle(navElements);\n\n const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\n tables.forEach((table) => setResponsiveTable(table));\n\n // Almindelige content toggles\n const toggles = document.querySelectorAll('.box .content-toggle__content, .profile-header .content-toggle__content, .design-documentation .content-toggle__content');\n toggles.forEach((toggle) => {\n setContentToggle(toggle);\n });\n\n // Hortizontal scroll buttons\n const scrollButtonsNext = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-next');\n const scrollButtonsPrevious = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-previous');\n horizontalScrollButtonNext(scrollButtonsNext);\n horizontalScrollButtonPrevious(scrollButtonsPrevious);\n\n // Kursuskatalog\n const togglesInToolbars = document.querySelectorAll('.toolbar .content-toggle__content');\n togglesInToolbars.forEach((toggle) => {\n setContentToggle(\n toggle,\n (popout: HTMLElement) => {\n contentToggleEdgeHandling(popout);\n lockBodyScroll();\n },\n (content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content)),\n (content: HTMLElement, button: HTMLButtonElement) => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n const toolbar = findToolbar(content);\n if (ariaExpanded === 'true') {\n toolbar?.classList.add('toolbar--has-popout');\n } else {\n toolbar?.classList.remove('toolbar--has-popout');\n }\n\n content.addEventListener('click', (event: MouseEvent) => {\n if ((event.target as HTMLElement).classList.contains('toolbar__popout')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {\n closeAllContentTogglesInToolbar(toolbar);\n unlockBodyScroll();\n }\n });\n },\n );\n });\n\n window.addEventListener('load', () => {\n windowInnerWidth = window.innerWidth;\n });\n\n window.addEventListener('resize', () => {\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\n windowInnerWidth = window.innerWidth;\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setTabs(tabbedObjects);\n }\n });\n});\n"],
5
+ "mappings": "MACA,IAAMA,EAASC,GAAyB,CAClC,SAAS,aAAe,UAC1BA,EAAG,EAEH,SAAS,iBAAiB,mBAAoBA,CAAE,CAEpD,EAEOC,EAAQF,ECDf,IAAMG,EAAoC,CAACC,EAAmBC,IAA+B,CAC3F,IAAIC,EAAQ,GAEZ,OADaF,EAAM,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H,EAC3J,QAASE,GAAW,CAC1BC,EAAiBD,CAAM,CACzB,CAAC,EAGD,IAAME,EAAoB,SAAS,iBAAiB,uEAAuE,EACrHC,EAAwB,SAAS,iBAAiB,2EAA2E,EACnIC,EAA2BF,CAAiB,EAC5CG,EAA+BF,CAAqB,EAG1B,SAAS,iBAAiB,mCAAmC,EACrE,QAASH,GAAW,CACpCC,EACED,EACCM,GAAwB,CACvBC,EAA0BD,CAAM,EAChCE,EAAe,CACjB,EACCC,GAAyBC,EAAgCC,EAAYF,CAAO,CAAC,EAC9E,CAACA,EAAsBG,IAA8B,CACnD,IAAMC,EAAeD,EAAO,aAAa,eAAe,EAClDE,EAAUH,EAAYF,CAAO,EAC/BI,IAAiB,OACnBC,GAAS,UAAU,IAAI,qBAAqB,EAE5CA,GAAS,UAAU,OAAO,qBAAqB,EAGjDL,EAAQ,iBAAiB,QAAUM,GAAsB,CAClDA,EAAM,OAAuB,UAAU,SAAS,iBAAiB,GACjE,CAACC,EAAkCD,EAAqB,0BAA0B,IACrFL,EAAgCI,CAAO,EACvCG,EAAiB,EAErB,CAAC,CACH,CACF,CACF,CAAC,EAED,OAAO,iBAAiB,OAAQ,IAAM,CACpC9B,EAAmB,OAAO,UAC5B,CAAC,EAED,OAAO,iBAAiB,SAAU,IAAM,CAClCA,EAAmB,GAAK,OAAO,aAAeA,IAChDA,EAAmB,OAAO,WAC1BO,EAAY,QAASC,GAAMC,EAAiBF,EAAaC,CAAC,CAAC,EAC3DH,EAAQF,CAAa,EAEzB,CAAC,CACH,CAAC",
6
+ "names": ["ready", "fn", "ready_default", "isElementWithClassNameInEventPath", "event", "className", "found", "p", "setMetaThemeColor", "body", "bgColor", "existingMeta", "meta", "getBaseFontSize", "convertRemToPixels", "rem", "isViewportBelow", "mediaQuery", "viewportWidth", "mediaQueryValue", "findNav", "element", "parent", "closeResponsiveNav", "navElements", "keepOpen", "navToggledClass", "n", "button", "setResponsiveToggle", "toggleMenu", "navItems", "lastNavItem", "firstElement", "transitionListener", "cleanUp", "clickEvent", "nav", "ariaExpanded", "setResponsiveNav", "navElement", "navItemsClass", "navItemsParent", "isOverflownClass", "hasOverflowClass", "isActiveClass", "hasOverflown", "i", "isActive", "bodyClickEvent", "e", "isElementWithClassNameInEventPath", "setResponsiveTable", "table", "head", "body", "foot", "headers", "h", "rowContainers", "rc", "tr", "cell", "i", "getMediaWidthBasedOnModifier", "classList", "isBelowViewportLimit", "widthInRem", "getBaseFontSize", "mediaWidth", "destroyTabs", "tabbed", "tabs", "panels", "section", "tab", "panel", "switchTab", "tabs", "panels", "oldTab", "newTab", "_", "focus", "callback", "index", "link", "oldIndex", "setTabbedContent", "key", "tabbed", "initial", "tablist", "section", "expandAll", "expandAllEvent", "panel", "tab", "i", "tabClickEvent", "e", "currentTab", "tabIndex", "tabKeyEvent", "dir", "setTabs", "tabbedObjects", "tabObject", "rendered", "domElement", "isBelowViewportLimit", "dataInitial", "destroyTabs", "setContentToggle", "content", "onClick", "beforeCallback", "afterCallback", "cleanUp", "setContentClose", "button", "contentClose", "focus", "click", "clickEvent", "ariaExpanded", "cc", "btnClick", "lockBodyScroll", "body", "isViewportBelow", "unlockBodyScroll", "closeAllContentTogglesInToolbar", "toolbar", "toggle", "content", "findToolbar", "element", "parent", "contentToggleEdgeHandling", "isViewportBelow", "allowedDistance", "convertRemToPixels", "popoutX", "popoutWidth", "distance", "horizontalScrollButtonNext", "nextButtons", "nextButton", "topElem", "scrollElements", "switch__segments", "scrollElement", "scrollAmount", "disableButton", "activateButton", "switch__segment", "horizontalScrollButtonPrevious", "previousButtons", "previousButton", "button", "windowInnerWidth", "ready_default", "tabbedContent", "tabbedObjects", "tab", "setTabs", "setMetaThemeColor", "navElements", "n", "setResponsiveNav", "setResponsiveToggle", "table", "setResponsiveTable", "toggle", "setContentToggle", "scrollButtonsNext", "scrollButtonsPrevious", "horizontalScrollButtonNext", "horizontalScrollButtonPrevious", "popout", "contentToggleEdgeHandling", "lockBodyScroll", "content", "closeAllContentTogglesInToolbar", "findToolbar", "button", "ariaExpanded", "toolbar", "event", "isElementWithClassNameInEventPath", "unlockBodyScroll"]
7
+ }
package/public/js/demo.js CHANGED
@@ -11,3 +11,4 @@
11
11
  user-select: none;
12
12
  }
13
13
  `,l.appendChild(i)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var a=new m(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(i){a.setInert(this,i)}})}})();var S=(e,t,s=()=>{})=>{let n=document.getElementById(e);if(n){n.classList.remove("modal-view--visible"),n.inert=!0;let r=document.querySelector(".page");r.classList.remove("page--blur"),r.inert=!1,document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),s()}},Q=(e,t,s=()=>{},n=!0)=>{let r=document.getElementById(e),m=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let u=document.querySelector(".page");u.classList.add("page--blur"),u.inert=!0,document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let v=l=>{l.target===r&&S(e,t,s)},a=l=>{l.key==="Escape"&&S(e,t,s)};n&&(r.addEventListener("click",v),window.addEventListener("keyup",a),m.push({element:r,clickEvent:v}),m.push({element:window,keyUpEvent:a}))}return m};var q=e=>{e.querySelectorAll(".content-toggle__toggle").forEach(s=>{let n=s.parentElement?.querySelector(".content-toggle__content");s.setAttribute("aria-expanded","false"),n?.setAttribute("hidden","hidden")})},C=e=>{e.classList.contains("toolbar--no-collapse")||e.classList.remove("toolbar--toggled"),e.classList.remove("toolbar--fully-overflown"),e.classList.remove("toolbar--has-popout");let s=e.querySelector(".toolbar__items")?.children,n="toolbar__item--is-overflown",r="toolbar--has-overflow",m=!1,u=0,v=(a,l)=>{a&&(a.offsetTop>25?(a.classList.add(n),e.classList.add(r),m=!0,u+=1):a.classList.remove(n),m?l-1>=0&&v(s[l-1],l-1):e.classList.remove(r))};v(s[s.length-1],s.length-1),u>0&&u===s.length&&e.classList.add("toolbar--fully-overflown")},le=e=>{let t=[];return e.querySelectorAll(".toolbar__toggle").forEach(n=>{let r=()=>{n?.parentElement?.classList.toggle("toolbar--toggled");let m=n.getAttribute("aria-expanded");if(m!=="true"){let u="a.toolbar__item--is-overflown, button.toolbar__item--is-overflown, input.toolbar__item--is-overflown, select.toolbar__item--is-overflown, .toolbar__item--is-overflown a, .toolbar__item--is-overflown button, .toolbar__item--is-overflown input, .toolbar__item--is-overflown select",v=n?.parentElement?.querySelector(u);v&&setTimeout(()=>{v.focus()},0)}n.setAttribute("aria-expanded",m==="false"?"true":"false")};t.push({element:n,clickEvent:r}),n.addEventListener("click",r)}),t},J=(e,t,s=!0)=>{let n=[];if(C(e),t(e),n=n.concat(le(e)),!s){let r=v=>{!v.target.classList.contains("content-toggle__toggle")&&!y(v,"content-toggle__content")&&t(e)},m=v=>{v.key==="Escape"&&v.target&&v.target.getAttribute("type")!=="search"&&t(e)},u=document.querySelector("body");n.push({element:u,clickEvent:r}),n.push({element:window,keyUpEvent:m}),u?.addEventListener("click",r),window.addEventListener("keyup",m)}return n};var Z=e=>{e.forEach(t=>{t.querySelectorAll(".selection-list").forEach(n=>{n.classList.remove("selection-list--toggled")})})},ee=()=>{let e=[],t=document.querySelectorAll(".selection-list-overlay-container");t.forEach(n=>{let r=n.querySelector("button"),m=()=>{Z(t);let u=r.nextSibling;u&&u.classList.add("selection-list--toggled")};e.push({element:r,clickEvent:m}),r.addEventListener("click",m)});let s=n=>{!n.target.classList.contains("selection-list--overlay")&&!y(n,"selection-list-overlay-container")&&Z(t)};return document.querySelector("body")?.addEventListener("click",s),{pairs:e,element:document.querySelector("body"),clickEvent:s}};var O=e=>{let t=e.querySelector("select"),s=e.querySelector(`label[for="${t?.getAttribute("id")}"]`);if(s){let n=getComputedStyle(s).width;t?.style.setProperty("--label-width",n)}};var te=(e,t)=>{I(t)?e.removeAttribute("hidden"):e.parentElement?.classList.add("truncator--no-truncation")},ne=e=>{let t=e.querySelector(".truncator__expand"),s=e.querySelector(".truncator__content");if(t&&s){t.addEventListener("click",()=>{t.removeAttribute("hidden"),e.classList.add("truncator--no-truncation")}),te(t,s),window.addEventListener("resize",()=>{t.setAttribute("hidden","hidden"),e.classList.remove("truncator--no-truncation"),te(t,s)});let n=s.querySelectorAll(R);n&&n.forEach(r=>{r.addEventListener("focus",()=>{I(r)&&(t.removeAttribute("hidden"),e.classList.add("truncator--no-truncation"))})})}};var M=0;P(()=>{window.top===window.self&&document.querySelector(".atom-picker")&&Y();let e=document.querySelectorAll(".form__field--inline-label--select");e.forEach(a=>{O(a)}),document.querySelectorAll(".nav").forEach(a=>{let l=a.querySelector(".nav__search"),i=a.querySelector(".nav__search-toggle");l&&i&&z(l,i)}),document.querySelectorAll(".copy-to-clipboard").forEach(a=>B(a,document.querySelector("html")?.getAttribute("lang")==="en"?"Copied!":"Kopieret!"));let n=document.querySelectorAll(".horizontal-scroll");n.forEach(a=>{N(a)}),G(),ee();let r=document.querySelectorAll(".sub-nav > button.nav__item");r.forEach(a=>{D(r,a)}),document.querySelectorAll("[data-modal]").forEach(a=>{let l=a.getAttribute("data-modal");document.getElementById(l)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{S(l,a)}),a.addEventListener("click",()=>{Q(l,a)})});let u=document.querySelectorAll(".toolbar");u.forEach(a=>J(a,l=>{q(l)},!1)),document.querySelectorAll(".truncator").forEach(a=>ne(a)),document.documentElement.style.setProperty("--window-inner-height",`${window.innerHeight}px`),k(),window.addEventListener("load",()=>{M=window.innerWidth}),window.addEventListener("resize",()=>{M>0&&window.innerWidth!==M&&(M=window.innerWidth,e.forEach(a=>{O(a)}),u.forEach(a=>{q(a),C(a)}),k(),n.forEach(a=>{a.classList.remove("horizontal-scroll--no-overflow"),N(a)})),document.documentElement.style.setProperty("--window-inner-height",`${window.innerHeight}px`)})});})();
14
+ //# sourceMappingURL=demo.js.map