@aarhus-university/au-designsystem-delphinus 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarhus-university/au-designsystem-delphinus",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "concurrently \"npm run nodemon\" \"npm run sass\" \"npm run build\"",
@@ -10,5 +10,5 @@
10
10
  -ms-user-select: none;
11
11
  user-select: none;
12
12
  }
13
- `,m.appendChild(s)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var b=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(s){b.setInert(this,s)}})}})();var A=(e,t,o=()=>{})=>{let i=document.getElementById(e);if(i){i.classList.remove("modal-view--visible"),i.inert=!0;let r=document.querySelector(".page");r&&(r.classList.remove("page--blur"),r.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},G=(e,t,o=()=>{},i=!0)=>{let r=document.getElementById(e),l=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let a=document.querySelector(".page");a&&(a.classList.add("page--blur"),a.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let h=m=>{m.target===r&&A(e,t,o)},b=m=>{m.key==="Escape"&&A(e,t,o)};i&&(r.addEventListener("click",h),window.addEventListener("keyup",b),l.push({element:r,clickEvent:h}),l.push({element:window,keyUpEvent:b}))}return l};var T=0;C(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(u=>t.push({domElement:u,rendered:!1})),x(t),R();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(u=>M(o,u)),B(o);let i=document.getElementById("autoexpand");H(i),window.onload=function(){H(i)},document.querySelectorAll(".form__field select, .form__field__combo-box__field").forEach(u=>{K(u)}),document.querySelectorAll(".copy-to-clipboard").forEach(u=>U(u,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),V(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(u=>{$(u)});let h=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),b=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");F(h),j(b),document.querySelectorAll(".horizontal-scroll").forEach(u=>{w(u),window.addEventListener("resize",()=>{w(u)})}),document.querySelectorAll(".switch__segment").forEach(u=>{u.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(p=>{w(p)})})}),window.addEventListener("load",()=>{T=window.innerWidth}),window.addEventListener("resize",()=>{T>0&&window.innerWidth!==T&&(T=window.innerWidth,o.forEach(u=>M(o,u)),x(t))}),document.querySelectorAll("[data-modal]").forEach(u=>{let v=u.getAttribute("data-modal");document.getElementById(v)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{A(v,u)}),u.addEventListener("click",()=>{G(v,u)})}),document.querySelectorAll(".nav__search").forEach(u=>{u.addEventListener("submit",v=>{v.preventDefault();let p=u.querySelector('input[type="search"]');if(p){let E=p.value,g=`./soegning#?cludoquery=${encodeURIComponent(E)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\xE5%20Aarhus%20Universitet&cludoinputtype=standard`;console.log(E),window.location.href=g}})});let d=document.querySelector(".omnibus-header__logo-titel"),f=document.querySelector("html")?.getAttribute("lang");d&&(f==="da"?d.setAttribute("src","/fileadmin/logos/Omnibus-logo.png"):d.setAttribute("src","/fileadmin/logos/Omnibus-logo-en.png"))});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});function Q(e,t){let o=e.offsetWidth,i=o*(3/4);t.style.width=o+"px",t.style.height=i+"px";let r=t.src,l=r.replace(".jpg","@2x.jpg").replace(".png","@2x.png");fetch(l,{method:"HEAD"}).then(a=>{a.ok?t.setAttribute("srcset",`${r} 1x, ${l} 2x`):t.setAttribute("srcset",`${r} 1x`)}).catch(()=>{t.setAttribute("srcset",`${r} 1x`)}),e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center"}window.addEventListener("resize",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});})();
13
+ `,m.appendChild(s)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var b=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(s){b.setInert(this,s)}})}})();var A=(e,t,o=()=>{})=>{let i=document.getElementById(e);if(i){i.classList.remove("modal-view--visible"),i.inert=!0;let r=document.querySelector(".page");r&&(r.classList.remove("page--blur"),r.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},G=(e,t,o=()=>{},i=!0)=>{let r=document.getElementById(e),l=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let a=document.querySelector(".page");a&&(a.classList.add("page--blur"),a.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let h=m=>{m.target===r&&A(e,t,o)},b=m=>{m.key==="Escape"&&A(e,t,o)};i&&(r.addEventListener("click",h),window.addEventListener("keyup",b),l.push({element:r,clickEvent:h}),l.push({element:window,keyUpEvent:b}))}return l};var T=0;C(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(u=>t.push({domElement:u,rendered:!1})),x(t),R();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(u=>M(o,u)),B(o);let i=document.getElementById("autoexpand");H(i),window.onload=function(){H(i)},document.querySelectorAll(".form__field select, .form__field__combo-box__field").forEach(u=>{K(u)}),document.querySelectorAll(".copy-to-clipboard").forEach(u=>U(u,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),V(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(u=>{$(u)});let h=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),b=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");F(h),j(b),document.querySelectorAll(".horizontal-scroll").forEach(u=>{w(u),window.addEventListener("resize",()=>{w(u)})}),document.querySelectorAll(".switch__segment").forEach(u=>{u.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(p=>{w(p)})})}),window.addEventListener("load",()=>{T=window.innerWidth}),window.addEventListener("resize",()=>{T>0&&window.innerWidth!==T&&(T=window.innerWidth,o.forEach(u=>M(o,u)),x(t))}),document.querySelectorAll("[data-modal]").forEach(u=>{let v=u.getAttribute("data-modal");document.getElementById(v)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{A(v,u)}),u.addEventListener("click",()=>{G(v,u)})}),document.querySelectorAll(".nav__search").forEach(u=>{u.addEventListener("submit",v=>{v.preventDefault();let p=u.querySelector('input[type="search"]');if(p){let E=p.value,g=`./soegning#?cludoquery=${encodeURIComponent(E)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\xE5%20Aarhus%20Universitet&cludoinputtype=standard`;console.log(E),window.location.href=g}})});let d=document.querySelector(".omnibus-header__logo-titel"),f=document.querySelector("html")?.getAttribute("lang");d&&(f==="da"?d.setAttribute("src","/fileadmin/logos/Omnibus-logo.png"):d.setAttribute("src","/fileadmin/logos/Omnibus-logo-en.png"))});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});function Q(e,t){let o=e.offsetWidth,i=o*(3/4);t.style.width=o+"px",t.style.height=i+"px";let r=t.src,l=r.replace(".jpg","@2x.jpg").replace(".png","@2x.png");fetch(l,{method:"HEAD"}).then(a=>{a.ok?t.setAttribute("srcset",`${r} 1x, ${l} 1x`):t.setAttribute("srcset",`${r} 1x`)}).catch(()=>{t.setAttribute("srcset",`${r} 1x`)}),e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center"}window.addEventListener("resize",()=>{document.querySelectorAll(".news-story__normal").forEach(t=>{let o=t.querySelector(".news-story__image-container"),i=o?.querySelector("img.news-story__image");i instanceof HTMLImageElement&&Q(o,i)})});})();
14
14
  //# sourceMappingURL=app.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../source/js/components/ready.ts", "../../../../source/js/components/helpers.ts", "../../../../source/js/components/nav.ts", "../../../../source/js/components/copy-hex-code.ts", "../../../../source/js/components/tabs.ts", "../../../../source/js/components/content-toggle.ts", "../../../../source/js/components/horizontal-scroll-btn.ts", "../../../../source/js/components/text-area.ts", "../../../../source/js/components/form.ts", "../../../../node_modules/wicg-inert/dist/inert.esm.js", "../../../../source/js/components/modal-view.ts", "../../../../source/js/omnibus/app.ts"],
4
- "sourcesContent": ["/* eslint-env browser */\r\nconst ready = (fn: () => void): void => {\r\n if (document.readyState !== 'loading') {\r\n fn();\r\n } else {\r\n document.addEventListener('DOMContentLoaded', fn);\r\n }\r\n};\r\n\r\nexport default ready;\r\n", "/* eslint-disable wrap-iife */\r\n/* eslint-disable import/prefer-default-export */\r\n/* eslint-env browser */\r\nconst copyToClipboard = (str: string): void => {\r\n // eslint-disable-next-line no-console\r\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\r\n};\r\n\r\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\r\n let found = false;\r\n const path = event.composedPath();\r\n path.forEach((p: EventTarget): void => {\r\n if ((p as HTMLElement).classList) {\r\n if ((p as HTMLElement).classList.contains(className)) {\r\n found = true;\r\n }\r\n }\r\n });\r\n return found;\r\n};\r\n\r\nconst setMetaThemeColor = (): void => {\r\n const body = document.querySelector('body');\r\n if (body) {\r\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\r\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\r\n if (existingMeta) {\r\n existingMeta.content = bgColor;\r\n } else {\r\n const meta = document.createElement('meta');\r\n meta.name = 'theme-color';\r\n meta.content = bgColor;\r\n document.getElementsByTagName('head')[0].appendChild(meta);\r\n }\r\n }\r\n};\r\n\r\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\r\n\r\n// eslint-disable-next-line max-len\r\nconst convertRemToPixels = (rem: number): number => rem * 16;\r\n\r\nconst isViewportBelow = (mediaQuery: string): boolean => {\r\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\r\n const mediaQueryValue = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue(mediaQuery).replace('rem', ''), 10));\r\n return viewportWidth < mediaQueryValue;\r\n};\r\n\r\nconst setScrollbarWidthVariable = (): void => {\r\n const scrollbarWidth = window.innerWidth - document.body.clientWidth;\r\n document.documentElement.style.setProperty('--vertical-scrollbar-width', `${scrollbarWidth}px`);\r\n};\r\n\r\nconst overflowsY = (element: HTMLElement): boolean => element.offsetHeight !== element.scrollHeight;\r\nconst overflowsX = (element: HTMLElement): boolean => element.offsetWidth !== element.scrollWidth;\r\n// eslint-disable-next-line max-len\r\nconst elementOverflows = (element: HTMLElement): boolean => overflowsY(element) || overflowsX(element);\r\n\r\nconst setHorizontalScroll = (element: HTMLElement): void => {\r\n // Checks if the element already contains no-overflow\r\n if (element.classList.contains('horizontal-scroll--no-overflow')) {\r\n element.classList.remove('horizontal-scroll--no-overflow');\r\n }\r\n\r\n // Defines of content of horizontal scroll \r\n let content = element.querySelector('.horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content');\r\n if (content === null && !content) {\r\n content = element.querySelector('.horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content');\r\n }\r\n\r\n // Checks if no-overflow should be added or not depending on content width\r\n if (content) {\r\n if (!overflowsX(content as HTMLElement)) {\r\n element.classList.add('horizontal-scroll--no-overflow');\r\n content?.removeAttribute('tabindex');\r\n } else {\r\n content?.setAttribute('tabindex', '0');\r\n }\r\n }\r\n};\r\n\r\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\"])';\r\n\r\nexport {\r\n copyToClipboard,\r\n isElementWithClassNameInEventPath,\r\n getBaseFontSize,\r\n setMetaThemeColor,\r\n isViewportBelow,\r\n convertRemToPixels,\r\n setScrollbarWidthVariable,\r\n overflowsX,\r\n overflowsY,\r\n elementOverflows,\r\n setHorizontalScroll,\r\n focusableSelector,\r\n};\r\n", "/* eslint-env browser */\r\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\r\n\r\nconst findNav = (element: HTMLElement): HTMLElement => {\r\n const parent = element.parentElement;\r\n if (parent) {\r\n if (parent.classList.contains('nav')) {\r\n return parent;\r\n }\r\n return findNav(parent);\r\n }\r\n return element;\r\n};\r\n\r\n// eslint-disable-next-line max-len\r\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\r\n const navToggledClass = 'nav--toggled';\r\n navElements.forEach((n) => {\r\n const button = n.querySelector('.nav__toggle') as HTMLElement;\r\n if (n !== keepOpen) {\r\n if (n.classList.contains(navToggledClass)) {\r\n button.focus();\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n n.classList.remove(navToggledClass);\r\n }\r\n });\r\n};\r\n\r\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\r\n const toggleMenu = (button: HTMLElement) => {\r\n const parent = findNav(button);\r\n // const hideItems: NodeListOf<HTMLElement> = parent.querySelectorAll('.nav__item');\r\n\r\n // // Only shows overflown elements when the menu is extended \r\n // hideItems.forEach(item => {\r\n // const currentDisplay = window.getComputedStyle(item).display;\r\n // if (!item.classList.contains('nav__item--is-overflown')) {\r\n // item.style.display = currentDisplay === 'none' ? 'inline-flex' : 'none';\r\n // }\r\n // });\r\n\r\n // // All elements get display: inline-flex when there is clicked outside of the button \r\n // const handleDocumentClick = (event: MouseEvent) => {\r\n // if (!parent.contains(event.target as Node)) {\r\n // hideItems.forEach(item => {\r\n // item.style.display = 'inline-flex';\r\n // });\r\n // }\r\n // };\r\n // document.body.addEventListener('click', handleDocumentClick);\r\n\r\n const navItems = parent.querySelector('.nav__items');\r\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\r\n navItems?.classList.add('nav__items--fadeout');\r\n const firstElement = navItems?.querySelector('.nav__item--is-overflown') as HTMLElement;\r\n if (firstElement) {\r\n firstElement.focus();\r\n }\r\n const transitionListener = () => {\r\n parent.classList.toggle('nav--toggled');\r\n navItems?.classList.remove('nav__items--fadeout');\r\n lastNavItem?.removeEventListener('transitionend', transitionListener);\r\n };\r\n lastNavItem?.addEventListener('transitionend', transitionListener);\r\n return parent;\r\n };\r\n\r\n const cleanUp: CleanUpPair[] = [];\r\n\r\n const toggle = document.querySelectorAll('.nav__toggle');\r\n toggle.forEach((button) => {\r\n const clickEvent = () => {\r\n const nav = toggleMenu(button as HTMLElement);\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\r\n closeResponsiveNav(navElements, nav);\r\n };\r\n\r\n cleanUp.push({\r\n element: button,\r\n clickEvent,\r\n });\r\n\r\n button.addEventListener('click', clickEvent);\r\n });\r\n\r\n return cleanUp;\r\n};\r\n\r\nconst setResponsiveNav = (\r\n navElements: NodeListOf<Element>,\r\n navElement: Element,\r\n): SetResponsiveNavCleanUp => {\r\n const navToggledClass = 'nav--toggled';\r\n const navItemsClass = 'nav__items';\r\n // gitlab #117\r\n navElement.classList.remove(navToggledClass);\r\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\r\n\r\n if (navItemsParent) {\r\n const navItems = navItemsParent.querySelectorAll('.nav__item');\r\n const isOverflownClass = 'nav__item--is-overflown';\r\n const hasOverflowClass = 'nav--has-overflow';\r\n const isActiveClass = 'nav__item--active';\r\n let hasOverflown = false;\r\n\r\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\r\n const nav = navItems[i] as HTMLElement;\r\n const top = nav.offsetTop;\r\n\r\n if (top > 0) {\r\n nav.classList.add(isOverflownClass);\r\n navElement.classList.add(hasOverflowClass);\r\n hasOverflown = true;\r\n } else if (!nav.classList.contains(isActiveClass)) {\r\n nav.classList.remove(isOverflownClass);\r\n }\r\n }\r\n\r\n if (!hasOverflown) {\r\n navElement.classList.remove(hasOverflowClass);\r\n const isActive = navElement.querySelector(`.${isActiveClass}`);\r\n if (isActive) {\r\n isActive.classList.remove(isOverflownClass);\r\n }\r\n }\r\n }\r\n\r\n // gitlab #115\r\n const bodyClickEvent = (e: Event) => {\r\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\r\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\r\n closeResponsiveNav(navElements);\r\n }\r\n };\r\n\r\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\r\n\r\n return {\r\n element: document.querySelector('body'),\r\n clickEvent: bodyClickEvent,\r\n };\r\n};\r\n\r\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\r\n const subNavClass = 'sub-nav--toggled';\r\n buttons.forEach((button) => {\r\n if (button !== keepOpen) {\r\n if (button?.parentElement?.classList.contains(subNavClass)) {\r\n (button as HTMLElement).focus();\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n button?.parentElement?.classList.remove(subNavClass);\r\n }\r\n });\r\n};\r\n\r\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\r\n const subNavClass = 'sub-nav--toggled';\r\n const buttonClickEvent = () => {\r\n button?.parentElement?.classList.toggle(subNavClass);\r\n if (button?.parentElement?.classList.contains(subNavClass)) {\r\n button.setAttribute('aria-expanded', 'true');\r\n } else {\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n closeSubNav(buttons, button);\r\n };\r\n\r\n button.addEventListener('click', buttonClickEvent);\r\n\r\n // gitlab #115\r\n const bodyClickEvent = (e: Event) => {\r\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\r\n closeSubNav(buttons);\r\n }\r\n };\r\n\r\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\r\n return {\r\n buttonClickEvent,\r\n element: document.querySelector('body'),\r\n bodyClickEvent,\r\n };\r\n};\r\n\r\nconst setClickMessage = ((\r\n text: string,\r\n copyElement: Element,\r\n clickElement: Element | null,\r\n ctcThis: HTMLElement | null,\r\n listener: () => void,\r\n): void => {\r\n if (ctcThis && clickElement) {\r\n // Vi kopierer teksten til clipboard\r\n copyToClipboard(ctcThis.innerText);\r\n copyElement.classList.add('copy-to-clipboard--confirm');\r\n if (copyElement === clickElement) {\r\n copyElement.classList.add('copy-to-clipboard--done');\r\n }\r\n // Laver en span, der viser, at teksten er kopieret\r\n const ctcThisMessage = document.createElement('span');\r\n ctcThisMessage.classList.add('copy-to-clipboard__this__confirm-message');\r\n ctcThisMessage.innerText = text;\r\n ctcThis.appendChild(ctcThisMessage);\r\n\r\n // Efter 1,2 sekunder fjerner vi beskeden igen\r\n clickElement.removeEventListener('click', listener);\r\n setTimeout(() => {\r\n copyElement.classList.remove('copy-to-clipboard--confirm');\r\n ctcThisMessage.remove();\r\n clickElement.addEventListener('click', listener);\r\n }, 1200);\r\n }\r\n});\r\n\r\nconst setCopyToClipboard = (element: HTMLElement, text = 'Kopieret!'): void => {\r\n const ctcThis = <HTMLElement>element.querySelector('.copy-to-clipboard__this');\r\n // Hvis det er en knap, s\u00E5 s\u00E6tter vi click event p\u00E5 knappen\r\n if ((element as HTMLButtonElement).type === 'button') {\r\n const listener = (): void => {\r\n setClickMessage(text, element, element, ctcThis, listener);\r\n };\r\n element.addEventListener('click', listener);\r\n // Hvis det ikke er en knap, finder vi knappen \"inde i\" elementet\r\n } else {\r\n const btn = element.querySelector('.copy-to-clipboard__execute');\r\n const listener = (): void => {\r\n setClickMessage(text, element, btn, ctcThis, listener);\r\n };\r\n btn?.addEventListener('click', listener);\r\n }\r\n};\r\n\r\nconst setSearchToggle = (navSearch: Element, button: Element): void => {\r\n const toggleClass = 'nav__search--toggled';\r\n button.addEventListener('click', () => {\r\n if (navSearch.classList.contains(toggleClass)) {\r\n button.setAttribute('aria-expanded', 'false');\r\n navSearch.classList.remove(toggleClass);\r\n } else {\r\n button.setAttribute('aria-expanded', 'true');\r\n navSearch.classList.add(toggleClass);\r\n }\r\n });\r\n};\r\n\r\n\r\n\r\nexport {\r\n findNav,\r\n setResponsiveToggle,\r\n setResponsiveNav,\r\n setSubNavToggle,\r\n setCopyToClipboard,\r\n setSearchToggle,\r\n};\r\n", "/* eslint-env browser */\r\nimport { copyToClipboard } from './helpers';\r\n\r\nconst copyHexCode = (): void => {\r\n const ctc = document.querySelectorAll('.copy-to-clipboard');\r\n const colorElements = document.querySelectorAll('.copy-to-clipboard__color');\r\n ctc.forEach((button) => {\r\n button.addEventListener('click', () => {\r\n let color = button.parentElement?.querySelector('.copy-to-clipboard__color');\r\n if(color) {\r\n let computedStyle = getComputedStyle(color).getPropertyValue('background-color');\r\n let hexColor = rgbToHex(computedStyle);\r\n console.log(hexColor);\r\n copyToClipboard(hexColor.replace(/\"/g, ''));\r\n }\r\n });\r\n });\r\n};\r\n\r\nfunction rgbToHex(rgb) {\r\n // Extract the individual RGB components\r\n var rgbArray = rgb.match(/\\d+/g);\r\n\r\n // Convert each component to hex and concatenate\r\n var hex = \"#\" + rgbArray.map(function (value) {\r\n var hexValue = parseInt(value).toString(16);\r\n return hexValue.length === 1 ? \"0\" + hexValue : hexValue;\r\n }).join('');\r\n\r\n return hex;\r\n}\r\n\r\nexport default copyHexCode;\r\n", "/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-env browser */\r\n/* eslint-disable import/prefer-default-export */\r\n/* eslint-disable no-param-reassign */\r\nimport { getBaseFontSize } from './helpers';\r\n\r\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\r\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\r\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\r\n }\r\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\r\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\r\n }\r\n\r\n return -1;\r\n};\r\n\r\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\r\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\r\n const widthInRem = viewportWidth / getBaseFontSize();\r\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\r\n if (mediaWidth > -1) {\r\n return widthInRem < mediaWidth;\r\n }\r\n return true;\r\n};\r\n\r\nconst destroyTabs = (tabbed: Element): void => {\r\n const tablist = tabbed.querySelector('.nav__items');\r\n const tabs = tablist?.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n tabs?.forEach((tab) => {\r\n tab.removeAttribute('aria-selected');\r\n tab.classList.remove('nav__item--active');\r\n });\r\n\r\n panels.forEach((panel) => {\r\n panel.hidden = false;\r\n panel.removeAttribute('role');\r\n });\r\n};\r\n\r\nconst destroySwitches = (tabbed: Element): void => {\r\n const switchlist = tabbed.querySelector('.switch');\r\n const switches = switchlist?.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n switches?.forEach((tab) => {\r\n tab.removeAttribute('aria-selected');\r\n tab.classList.remove('switch__segment--active');\r\n });\r\n\r\n panels.forEach((panel) => {\r\n panel.hidden = false;\r\n panel.removeAttribute('role');\r\n });\r\n};\r\n\r\nconst switchTab = (\r\n tabs: NodeListOf<HTMLAnchorElement>,\r\n panels: HTMLElement[],\r\n oldTab: Element | null,\r\n newTab: HTMLElement,\r\n _: DOMTokenList,\r\n focus = true,\r\n // eslint-disable-next-line no-console\r\n callback = (index: number): void => console.log(index),\r\n): void => {\r\n if (focus) {\r\n newTab.focus();\r\n }\r\n // Make the active tab focusable by the user (Tab key)\r\n newTab.removeAttribute('tabindex');\r\n // Set the selected state\r\n newTab.setAttribute('aria-selected', 'true');\r\n\r\n // Check if switch // should this be more pretty?\r\n if (newTab.classList.contains('switch__segment')) {\r\n newTab.classList.add('switch__segment--active');\r\n } else {\r\n newTab.classList.add('nav__item--active');\r\n }\r\n\r\n if (oldTab) {\r\n oldTab.removeAttribute('aria-selected');\r\n oldTab.setAttribute('tabindex', '-1');\r\n\r\n if (oldTab.classList.contains('switch__segment')) {\r\n oldTab.classList.remove('switch__segment--active');\r\n } else {\r\n oldTab.classList.remove('nav__item--active');\r\n }\r\n }\r\n\r\n const index = Array.prototype.indexOf.call(tabs, newTab);\r\n\r\n // More links\r\n /* let moreLinks;\r\n var moreLink: HTMLElement;\r\n moreLinks = document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`);\r\n moreLinks.forEach((moreLink) => {\r\n moreLink.classList.add('tabbed-content-peripheral--active');\r\n moreLink.hidden = false;\r\n }); */\r\n const moreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`));\r\n moreLinks.forEach((link) => {\r\n link.classList.add('tabbed-content-peripheral--active');\r\n link.hidden = false;\r\n });\r\n\r\n // Get the indices of the new and old tabs to find the correct\r\n // tab panels to show and hide\r\n panels[index].hidden = false;\r\n if (oldTab) {\r\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\r\n\r\n const oldMoreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[oldIndex].id}\"]`));\r\n oldMoreLinks.forEach((link) => {\r\n link.classList.remove('tabbed-content-peripheral--active');\r\n link.hidden = true;\r\n });\r\n\r\n /* moreLinks.forEach((moreLink) => {\r\n moreLink.classList.remove('tabbed-content-peripheral--active');\r\n moreLink.hidden = true;\r\n }); */\r\n\r\n panels[oldIndex].hidden = true;\r\n }\r\n\r\n // Dispatches custom event on every tab change\r\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\r\n bubbles: true,\r\n detail: { tab: index },\r\n }));\r\n callback(index);\r\n};\r\n\r\nconst setTabbedContent = (\r\n key: number,\r\n tabbed: Element,\r\n initial = 0,\r\n focus = true,\r\n // eslint-disable-next-line no-console\r\n callback = (index: number) => console.log(index),\r\n): void => {\r\n const tablist = tabbed.querySelector('.switch,.nav__items') as HTMLElement;\r\n const tabs = tablist.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n\r\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\r\n if (expandAll) {\r\n const expandAllEvent = () => {\r\n tablist.hidden = true;\r\n panels.forEach((panel: HTMLElement) => {\r\n panel.hidden = false;\r\n });\r\n };\r\n\r\n expandAll.removeEventListener('click', expandAllEvent);\r\n expandAll.addEventListener('click', expandAllEvent);\r\n }\r\n\r\n // Add the tablist role to the first <ul> in the .tabbed container\r\n tablist.setAttribute('role', 'tablist');\r\n\r\n // Add semantics are remove user focusability for each tab\r\n tabs.forEach((tab, i) => {\r\n tab.setAttribute('role', 'tab');\r\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\r\n tab.setAttribute('tabindex', '-1');\r\n tab.parentElement?.setAttribute('role', 'presentation');\r\n\r\n // Handle clicking of tabs for mouse users\r\n const tabClickEvent = (e: MouseEvent) => {\r\n e.preventDefault();\r\n const currentTab = tablist.querySelector('[aria-selected]');\r\n if (e.currentTarget !== currentTab) {\r\n // eslint-disable-next-line max-len\r\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\r\n callback(tabIndex);\r\n });\r\n }\r\n };\r\n\r\n tab.removeEventListener('click', tabClickEvent);\r\n tab.addEventListener('click', tabClickEvent);\r\n\r\n // Handle keydown events for keyboard users\r\n const tabKeyEvent = (e: KeyboardEvent) => {\r\n // Get the index of the current tab in the tabs node list\r\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\r\n // Work out which key the user is pressing and\r\n // Calculate the new tab's index where appropriate\r\n let dir: number | string | null = null;\r\n if (e.key === 'ArrowLeft') {\r\n dir = index - 1;\r\n }\r\n if (e.key === 'ArrowRight') {\r\n dir = index + 1;\r\n }\r\n if (e.key === 'ArrowDown') {\r\n dir = 'down';\r\n }\r\n if (dir !== null) {\r\n e.preventDefault();\r\n // If the down key is pressed, move focus to the open panel,\r\n // otherwise switch to the adjacent tab\r\n if (dir === 'down') {\r\n panels[i].focus();\r\n } else if (tabs[dir]) {\r\n // eslint-disable-next-line max-len\r\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\r\n callback(tabIndex);\r\n });\r\n }\r\n }\r\n };\r\n tab.removeEventListener('keydown', tabKeyEvent);\r\n tab.addEventListener('keydown', tabKeyEvent);\r\n });\r\n\r\n // Add tab panel semantics and hide them all\r\n panels.forEach((panel: HTMLElement, i: number) => {\r\n panel.setAttribute('tabindex', '-1');\r\n panel.setAttribute('aria-labelledby', tabs[i].id);\r\n // eslint-disable-next-line no-param-reassign\r\n panel.hidden = true;\r\n panel.setAttribute('role', 'tabpanel');\r\n });\r\n\r\n // Initially activate the first tab and reveal the first tab panel\r\n if (initial > -1) {\r\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\r\n }\r\n};\r\n\r\nconst setTabs = (tabbedObjects: ITabbedObject[]): void => {\r\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\r\n const { rendered, domElement } = tabObject;\r\n if (isBelowViewportLimit(domElement.classList)) {\r\n if (!rendered) {\r\n const focus = domElement.getAttribute('data-focus-onload');\r\n const dataInitial = domElement.getAttribute('data-initial-tab');\r\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\r\n setTabbedContent(key, domElement, initial, focus !== 'false');\r\n tabObject.rendered = true;\r\n }\r\n } else if (rendered) {\r\n destroyTabs(domElement);\r\n tabObject.rendered = false;\r\n }\r\n });\r\n};\r\n\r\nexport {\r\n setTabbedContent,\r\n isBelowViewportLimit,\r\n destroyTabs,\r\n destroySwitches,\r\n setTabs,\r\n};\r\n", "/* eslint-disable max-len */\r\n/* eslint-env browser */\r\n/* eslint-disable import/prefer-default-export */\r\n\r\nimport { isViewportBelow} from './helpers';\r\n\r\nconst setContentToggle = (\r\n content: Element,\r\n onClick?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n beforeCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n afterCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n): CleanUpPair[] => {\r\n const cleanUp: CleanUpPair[] = [];\r\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean): () => void => {\r\n if (focus) {\r\n contentClose.focus();\r\n }\r\n const click = () => {\r\n content.setAttribute('hidden', 'hidden');\r\n button.removeAttribute('hidden');\r\n button.setAttribute('aria-expanded', 'false');\r\n button.focus();\r\n };\r\n contentClose.addEventListener('click', click);\r\n return click;\r\n };\r\n\r\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\r\n const contentClose = content.querySelectorAll('.content-toggle__close');\r\n \r\n const setBPModiferClass = () => {\r\n if (isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--always-show-on-medium')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n } \r\n else if (isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--always-show-on-wide')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n } \r\n else if (isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--always-show-on-max-width')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n \r\n } \r\n else (\r\n content.classList.contains('content-toggle__content--always-show-on-medium') ||\r\n content.classList.contains('content-toggle__content--always-show-on-wide') ||\r\n content.classList.contains('content-toggle__content--always-show-on-max-width')\r\n )\r\n }\r\n window.addEventListener('resize', () => {\r\n setBPModiferClass();\r\n });\r\n\r\n const setBPModifierPopupClass = () => {\r\n document.addEventListener('click', (event) => {\r\n const eventTarget = event.target as HTMLElement;\r\n const doesNotContainContent = !eventTarget.classList.contains('content-toggle__content')\r\n const doesNotContainButton = !eventTarget.classList.contains('content-toggle__toggle')\r\n const doesNotContainSpan = !eventTarget.classList.contains('profile-header__info__contact__toggle__button')\r\n if (doesNotContainContent && doesNotContainButton && doesNotContainSpan) {\r\n if (!isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--is-popover--on-medium')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n } else if (!isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--is-popover--on-wide')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n } else if (!isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--is-popover--on-max-width')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus(); \r\n }\r\n else if (content.classList.contains('content-toggle__content--is-popover')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n }\r\n }\r\n });\r\n }\r\n\r\n setBPModifierPopupClass(); \r\n setBPModiferClass();\r\n\r\n if (button) {\r\n const clickEvent = () => {\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n // Til toolbar: hvis man klikker p\u00E5 en knap, der ikke er foldet ud\r\n // S\u00E5 lukker vi alle \u00E5bne content-toggles\r\n if (typeof beforeCallback === 'function' && ariaExpanded === 'false') {\r\n beforeCallback(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n // Og s\u00E5 g\u00E5r vi i gang med folde-ud-logikken\r\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\r\n if (ariaExpanded === 'true') {\r\n content.setAttribute('hidden', 'hidden');\r\n } else {\r\n content.removeAttribute('hidden');\r\n }\r\n\r\n if (typeof onClick === 'function') {\r\n onClick(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n\r\n if (button.hasAttribute('aria-haspopup')) {\r\n button.setAttribute('hidden', 'hidden');\r\n contentClose.forEach((cc) => {\r\n setContentClose(button, cc as HTMLElement, true);\r\n });\r\n }\r\n\r\n // Det der sker efter folde-logikken\r\n if (typeof afterCallback === 'function') {\r\n afterCallback(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n };\r\n\r\n button.addEventListener('click', clickEvent);\r\n // Altid tilf\u00F8j denne f\u00F8rst!\r\n cleanUp.push({\r\n element: button,\r\n clickEvent,\r\n });\r\n\r\n contentClose.forEach((cc) => {\r\n const btnClick = setContentClose(button, cc as HTMLElement, false);\r\n cleanUp.push({\r\n element: cc,\r\n clickEvent: btnClick,\r\n });\r\n });\r\n }\r\n return cleanUp;\r\n};\r\n\r\nexport {\r\n setContentToggle, \r\n};\r\n", "// Scroller 80% p\u00E5 horisontal scroll til h\u00F8jre og s\u00E6tter knappen disabled n\u00E5r man rammer bunden\r\nconst horizontalScrollButtonNext = (nextButtons: NodeListOf<Element>): void => {\r\n if (nextButtons) {\r\n nextButtons.forEach((nextButton) => {\r\n const topElem = nextButton?.parentElement?.parentElement?.parentElement?.parentElement;\r\n if (topElem) {\r\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\r\n const switch__segments = topElem.querySelectorAll('.switch__segment');\r\n scrollElements.forEach((scrollElement) => { \r\n if (scrollElement) {\r\n nextButton.addEventListener('click', () => {\r\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til h\u00F8jre\r\n const scrollAmount = 0.8 * scrollElement.clientWidth;\r\n scrollElement.scrollLeft += scrollAmount;\r\n });\r\n // G\u00F8r knappen aktiv hvis scroll har ramt bunden\r\n scrollElement.addEventListener('scroll', () => {\r\n if ((scrollElement.scrollLeft + scrollElement.clientWidth) >= (scrollElement.scrollWidth * 0.98)) {\r\n disableButton(nextButton);\r\n } else if (scrollElement.scrollLeft + scrollElement.clientWidth < scrollElement.scrollWidth) {\r\n activateButton(nextButton);\r\n }\r\n });\r\n // Reset af knap ved flere tabs af horizontal scroll\r\n if (switch__segments) {\r\n switch__segments.forEach(switch__segment => {\r\n switch__segment.addEventListener('click', () => {\r\n activateButton(nextButton);\r\n scrollElement.scrollLeft = 0;\r\n })\r\n });\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n \r\n // Scroller 80% p\u00E5 horisontal scroll til venstre og s\u00E6tter knappen disabled n\u00E5r man rammer toppen\r\n const horizontalScrollButtonPrevious = (previousButtons: NodeListOf<Element>): void => {\r\n if (previousButtons) {\r\n previousButtons.forEach((previousButton) => {\r\n const topElem = previousButton?.parentElement?.parentElement?.parentElement?.parentElement;\r\n if (topElem) {\r\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\r\n const switch__segments = topElem.querySelectorAll('.switch__segment');\r\n scrollElements.forEach((scrollElement) => { \r\n if (scrollElement) {\r\n previousButton.addEventListener('click', () => {\r\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til venstre\r\n const scrollAmount = 0.8 * scrollElement.clientWidth;\r\n scrollElement.scrollLeft -= scrollAmount;\r\n });\r\n // G\u00F8r knappen aktiv hvis scroll har ramt toppen\r\n scrollElement.addEventListener('scroll', () => {\r\n if (scrollElement.scrollLeft <= 0) {\r\n disableButton(previousButton);\r\n } else if (scrollElement.scrollLeft > 0) {\r\n activateButton(previousButton);\r\n }\r\n });\r\n }\r\n // Reset af knap ved flere tabs af horizontal scroll\r\n if (switch__segments) {\r\n switch__segments.forEach(switch__segment => {\r\n switch__segment.addEventListener('click', () => {\r\n disableButton(previousButton);\r\n });\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n\r\n function activateButton(button) {\r\n button.classList.remove('visually-disabled');\r\n button.setAttribute('aria-disabled', 'false');\r\n }\r\n \r\n function disableButton(button) {\r\n button.classList.add('visually-disabled');\r\n button.setAttribute('aria-disabled', 'true');\r\n }\r\n\r\n export {\r\n horizontalScrollButtonNext,\r\n horizontalScrollButtonPrevious,\r\n };", "function setupAutoExpand(textarea: HTMLTextAreaElement | null): void {\r\n if (textarea) {\r\n textarea.addEventListener(\"input\", function (this: HTMLTextAreaElement, event: Event) {\r\n const parentNode = textarea?.parentNode as HTMLElement | null;\r\n \r\n if (parentNode && parentNode.dataset) {\r\n parentNode.dataset.value = this.value;\r\n }\r\n });\r\n }\r\n }\r\n\r\n export {\r\n setupAutoExpand\r\n };", "/* eslint-disable import/prefer-default-export */\r\nconst setInlineSelectLabel = (formField: Element): void => {\r\n const select = formField.querySelector('select');\r\n const label = formField.querySelector(`label[for=\"${select?.getAttribute('id')}\"]`);\r\n if (label) {\r\n const labelWidth = getComputedStyle(label).width;\r\n select?.style.setProperty('--label-width', labelWidth);\r\n }\r\n};\r\n\r\nfunction dropdownIconToggle(element: HTMLElement): void { \r\n let dropdownInactive = true;\r\n element.addEventListener('click', function (event) {\r\n if (dropdownInactive) {\r\n element.classList.add('dropdown-icon--active');\r\n element.classList.remove('dropdown-icon--inactive');\r\n dropdownInactive = false;\r\n } else {\r\n element.classList.add('dropdown-icon--inactive');\r\n element.classList.remove('dropdown-icon--active');\r\n dropdownInactive = true;\r\n }\r\n \r\n const handleOutsideClick = (event) => {\r\n if (!element.contains(event.target)) {\r\n element.classList.add('dropdown-icon--inactive');\r\n element.classList.remove('dropdown-icon--active');\r\n document.removeEventListener('click', handleOutsideClick);\r\n dropdownInactive = true;\r\n }\r\n };\r\n \r\n document.addEventListener('click', handleOutsideClick);\r\n });\r\n }\r\n\r\n\r\n\r\nexport {\r\n setInlineSelectLabel,\r\n dropdownIconToggle\r\n};\r\n", "var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This work is licensed under the W3C Software and Document License\n * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).\n */\n\n(function () {\n // Return early if we're not running inside of the browser.\n if (typeof window === 'undefined') {\n return;\n }\n\n // Convenience function for converting NodeLists.\n /** @type {typeof Array.prototype.slice} */\n var slice = Array.prototype.slice;\n\n /**\n * IE has a non-standard name for \"matches\".\n * @type {typeof Element.prototype.matches}\n */\n var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n\n /** @type {string} */\n var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');\n\n /**\n * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`\n * attribute.\n *\n * Its main functions are:\n *\n * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the\n * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering\n * each focusable node in the subtree with the singleton `InertManager` which manages all known\n * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`\n * instance exists for each focusable node which has at least one inert root as an ancestor.\n *\n * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`\n * attribute is removed from the root node). This is handled in the destructor, which calls the\n * `deregister` method on `InertManager` for each managed inert node.\n */\n\n var InertRoot = function () {\n /**\n * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree.\n * @param {!InertManager} inertManager The global singleton InertManager object.\n */\n function InertRoot(rootElement, inertManager) {\n _classCallCheck(this, InertRoot);\n\n /** @type {!InertManager} */\n this._inertManager = inertManager;\n\n /** @type {!HTMLElement} */\n this._rootElement = rootElement;\n\n /**\n * @type {!Set<!InertNode>}\n * All managed focusable nodes in this InertRoot's subtree.\n */\n this._managedNodes = new Set();\n\n // Make the subtree hidden from assistive technology\n if (this._rootElement.hasAttribute('aria-hidden')) {\n /** @type {?string} */\n this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n } else {\n this._savedAriaHidden = null;\n }\n this._rootElement.setAttribute('aria-hidden', 'true');\n\n // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n this._makeSubtreeUnfocusable(this._rootElement);\n\n // Watch for:\n // - any additions in the subtree: make them unfocusable too\n // - any removals from the subtree: remove them from this inert root's managed nodes\n // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n // element, make that node a managed node.\n this._observer = new MutationObserver(this._onMutation.bind(this));\n this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n }\n\n /**\n * Call this whenever this object is about to become obsolete. This unwinds all of the state\n * stored in this object and updates the state of all of the managed nodes.\n */\n\n\n _createClass(InertRoot, [{\n key: 'destructor',\n value: function destructor() {\n this._observer.disconnect();\n\n if (this._rootElement) {\n if (this._savedAriaHidden !== null) {\n this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n } else {\n this._rootElement.removeAttribute('aria-hidden');\n }\n }\n\n this._managedNodes.forEach(function (inertNode) {\n this._unmanageNode(inertNode.node);\n }, this);\n\n // Note we cast the nulls to the ANY type here because:\n // 1) We want the class properties to be declared as non-null, or else we\n // need even more casts throughout this code. All bets are off if an\n // instance has been destroyed and a method is called.\n // 2) We don't want to cast \"this\", because we want type-aware optimizations\n // to know which properties we're setting.\n this._observer = /** @type {?} */null;\n this._rootElement = /** @type {?} */null;\n this._managedNodes = /** @type {?} */null;\n this._inertManager = /** @type {?} */null;\n }\n\n /**\n * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.\n */\n\n }, {\n key: '_makeSubtreeUnfocusable',\n\n\n /**\n * @param {!Node} startNode\n */\n value: function _makeSubtreeUnfocusable(startNode) {\n var _this2 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this2._visitNode(node);\n });\n\n var activeElement = document.activeElement;\n\n if (!document.body.contains(startNode)) {\n // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n var node = startNode;\n /** @type {!ShadowRoot|undefined} */\n var root = undefined;\n while (node) {\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n root = /** @type {!ShadowRoot} */node;\n break;\n }\n node = node.parentNode;\n }\n if (root) {\n activeElement = root.activeElement;\n }\n }\n if (startNode.contains(activeElement)) {\n activeElement.blur();\n // In IE11, if an element is already focused, and then set to tabindex=-1\n // calling blur() will not actually move the focus.\n // To work around this we call focus() on the body instead.\n if (activeElement === document.activeElement) {\n document.body.focus();\n }\n }\n }\n\n /**\n * @param {!Node} node\n */\n\n }, {\n key: '_visitNode',\n value: function _visitNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */node;\n\n // If a descendant inert root becomes un-inert, its descendants will still be inert because of\n // this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n if (element !== this._rootElement && element.hasAttribute('inert')) {\n this._adoptInertRoot(element);\n }\n\n if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n this._manageNode(element);\n }\n }\n\n /**\n * Register the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_manageNode',\n value: function _manageNode(node) {\n var inertNode = this._inertManager.register(node, this);\n this._managedNodes.add(inertNode);\n }\n\n /**\n * Unregister the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_unmanageNode',\n value: function _unmanageNode(node) {\n var inertNode = this._inertManager.deregister(node, this);\n if (inertNode) {\n this._managedNodes['delete'](inertNode);\n }\n }\n\n /**\n * Unregister the entire subtree starting at `startNode`.\n * @param {!Node} startNode\n */\n\n }, {\n key: '_unmanageSubtree',\n value: function _unmanageSubtree(startNode) {\n var _this3 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this3._unmanageNode(node);\n });\n }\n\n /**\n * If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n * @param {!HTMLElement} node\n */\n\n }, {\n key: '_adoptInertRoot',\n value: function _adoptInertRoot(node) {\n var inertSubroot = this._inertManager.getInertRoot(node);\n\n // During initialisation this inert root may not have been registered yet,\n // so register it now if need be.\n if (!inertSubroot) {\n this._inertManager.setInert(node, true);\n inertSubroot = this._inertManager.getInertRoot(node);\n }\n\n inertSubroot.managedNodes.forEach(function (savedInertNode) {\n this._manageNode(savedInertNode.node);\n }, this);\n }\n\n /**\n * Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_onMutation',\n value: function _onMutation(records, self) {\n records.forEach(function (record) {\n var target = /** @type {!HTMLElement} */record.target;\n if (record.type === 'childList') {\n // Manage added nodes\n slice.call(record.addedNodes).forEach(function (node) {\n this._makeSubtreeUnfocusable(node);\n }, this);\n\n // Un-manage removed nodes\n slice.call(record.removedNodes).forEach(function (node) {\n this._unmanageSubtree(node);\n }, this);\n } else if (record.type === 'attributes') {\n if (record.attributeName === 'tabindex') {\n // Re-initialise inert node if tabindex changes\n this._manageNode(target);\n } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n // If a new inert root is added, adopt its managed nodes and make sure it knows about the\n // already managed nodes from this inert subroot.\n this._adoptInertRoot(target);\n var inertSubroot = this._inertManager.getInertRoot(target);\n this._managedNodes.forEach(function (managedNode) {\n if (target.contains(managedNode.node)) {\n inertSubroot._manageNode(managedNode.node);\n }\n });\n }\n }\n }, this);\n }\n }, {\n key: 'managedNodes',\n get: function get() {\n return new Set(this._managedNodes);\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'hasSavedAriaHidden',\n get: function get() {\n return this._savedAriaHidden !== null;\n }\n\n /** @param {?string} ariaHidden */\n\n }, {\n key: 'savedAriaHidden',\n set: function set(ariaHidden) {\n this._savedAriaHidden = ariaHidden;\n }\n\n /** @return {?string} */\n ,\n get: function get() {\n return this._savedAriaHidden;\n }\n }]);\n\n return InertRoot;\n }();\n\n /**\n * `InertNode` initialises and manages a single inert node.\n * A node is inert if it is a descendant of one or more inert root elements.\n *\n * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n * is intrinsically focusable or not.\n *\n * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n * or removes the `tabindex` attribute if the element is intrinsically focusable.\n */\n\n\n var InertNode = function () {\n /**\n * @param {!Node} node A focusable element to be made inert.\n * @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n */\n function InertNode(node, inertRoot) {\n _classCallCheck(this, InertNode);\n\n /** @type {!Node} */\n this._node = node;\n\n /** @type {boolean} */\n this._overrodeFocusMethod = false;\n\n /**\n * @type {!Set<!InertRoot>} The set of descendant inert roots.\n * If and only if this set becomes empty, this node is no longer inert.\n */\n this._inertRoots = new Set([inertRoot]);\n\n /** @type {?number} */\n this._savedTabIndex = null;\n\n /** @type {boolean} */\n this._destroyed = false;\n\n // Save any prior tabindex info and make this node untabbable\n this.ensureUntabbable();\n }\n\n /**\n * Call this whenever this object is about to become obsolete.\n * This makes the managed node focusable again and deletes all of the previously stored state.\n */\n\n\n _createClass(InertNode, [{\n key: 'destructor',\n value: function destructor() {\n this._throwIfDestroyed();\n\n if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */this._node;\n if (this._savedTabIndex !== null) {\n element.setAttribute('tabindex', this._savedTabIndex);\n } else {\n element.removeAttribute('tabindex');\n }\n\n // Use `delete` to restore native focus method.\n if (this._overrodeFocusMethod) {\n delete element.focus;\n }\n }\n\n // See note in InertRoot.destructor for why we cast these nulls to ANY.\n this._node = /** @type {?} */null;\n this._inertRoots = /** @type {?} */null;\n this._destroyed = true;\n }\n\n /**\n * @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n * If the object has been destroyed, any attempt to access it will cause an exception.\n */\n\n }, {\n key: '_throwIfDestroyed',\n\n\n /**\n * Throw if user tries to access destroyed InertNode.\n */\n value: function _throwIfDestroyed() {\n if (this.destroyed) {\n throw new Error('Trying to access destroyed InertNode');\n }\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'ensureUntabbable',\n\n\n /** Save the existing tabindex value and make the node untabbable and unfocusable */\n value: function ensureUntabbable() {\n if (this.node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */this.node;\n if (matches.call(element, _focusableElementsString)) {\n if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {\n return;\n }\n\n if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n }\n element.setAttribute('tabindex', '-1');\n if (element.nodeType === Node.ELEMENT_NODE) {\n element.focus = function () {};\n this._overrodeFocusMethod = true;\n }\n } else if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n element.removeAttribute('tabindex');\n }\n }\n\n /**\n * Add another inert root to this inert node's set of managing inert roots.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'addInertRoot',\n value: function addInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots.add(inertRoot);\n }\n\n /**\n * Remove the given inert root from this inert node's set of managing inert roots.\n * If the set of managing inert roots becomes empty, this node is no longer inert,\n * so the object should be destroyed.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'removeInertRoot',\n value: function removeInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots['delete'](inertRoot);\n if (this._inertRoots.size === 0) {\n this.destructor();\n }\n }\n }, {\n key: 'destroyed',\n get: function get() {\n return (/** @type {!InertNode} */this._destroyed\n );\n }\n }, {\n key: 'hasSavedTabIndex',\n get: function get() {\n return this._savedTabIndex !== null;\n }\n\n /** @return {!Node} */\n\n }, {\n key: 'node',\n get: function get() {\n this._throwIfDestroyed();\n return this._node;\n }\n\n /** @param {?number} tabIndex */\n\n }, {\n key: 'savedTabIndex',\n set: function set(tabIndex) {\n this._throwIfDestroyed();\n this._savedTabIndex = tabIndex;\n }\n\n /** @return {?number} */\n ,\n get: function get() {\n this._throwIfDestroyed();\n return this._savedTabIndex;\n }\n }]);\n\n return InertNode;\n }();\n\n /**\n * InertManager is a per-document singleton object which manages all inert roots and nodes.\n *\n * When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n * property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n * is created for each such node, via the `_managedNodes` map.\n */\n\n\n var InertManager = function () {\n /**\n * @param {!Document} document\n */\n function InertManager(document) {\n _classCallCheck(this, InertManager);\n\n if (!document) {\n throw new Error('Missing required argument; InertManager needs to wrap a document.');\n }\n\n /** @type {!Document} */\n this._document = document;\n\n /**\n * All managed nodes known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertNode>}\n */\n this._managedNodes = new Map();\n\n /**\n * All inert roots known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertRoot>}\n */\n this._inertRoots = new Map();\n\n /**\n * Observer for mutations on `document.body`.\n * @type {!MutationObserver}\n */\n this._observer = new MutationObserver(this._watchForInert.bind(this));\n\n // Add inert style.\n addInertStyle(document.head || document.body || document.documentElement);\n\n // Wait for document to be loaded.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n } else {\n this._onDocumentLoaded();\n }\n }\n\n /**\n * Set whether the given element should be an inert root or not.\n * @param {!HTMLElement} root\n * @param {boolean} inert\n */\n\n\n _createClass(InertManager, [{\n key: 'setInert',\n value: function setInert(root, inert) {\n if (inert) {\n if (this._inertRoots.has(root)) {\n // element is already inert\n return;\n }\n\n var inertRoot = new InertRoot(root, this);\n root.setAttribute('inert', '');\n this._inertRoots.set(root, inertRoot);\n // If not contained in the document, it must be in a shadowRoot.\n // Ensure inert styles are added there.\n if (!this._document.body.contains(root)) {\n var parent = root.parentNode;\n while (parent) {\n if (parent.nodeType === 11) {\n addInertStyle(parent);\n }\n parent = parent.parentNode;\n }\n }\n } else {\n if (!this._inertRoots.has(root)) {\n // element is already non-inert\n return;\n }\n\n var _inertRoot = this._inertRoots.get(root);\n _inertRoot.destructor();\n this._inertRoots['delete'](root);\n root.removeAttribute('inert');\n }\n }\n\n /**\n * Get the InertRoot object corresponding to the given inert root element, if any.\n * @param {!Node} element\n * @return {!InertRoot|undefined}\n */\n\n }, {\n key: 'getInertRoot',\n value: function getInertRoot(element) {\n return this._inertRoots.get(element);\n }\n\n /**\n * Register the given InertRoot as managing the given node.\n * In the case where the node has a previously existing inert root, this inert root will\n * be added to its set of inert roots.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {!InertNode} inertNode\n */\n\n }, {\n key: 'register',\n value: function register(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (inertNode !== undefined) {\n // node was already in an inert subtree\n inertNode.addInertRoot(inertRoot);\n } else {\n inertNode = new InertNode(node, inertRoot);\n }\n\n this._managedNodes.set(node, inertNode);\n\n return inertNode;\n }\n\n /**\n * De-register the given InertRoot as managing the given inert node.\n * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n * node from the InertManager's set of managed nodes if it is destroyed.\n * If the node is not currently managed, this is essentially a no-op.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n */\n\n }, {\n key: 'deregister',\n value: function deregister(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (!inertNode) {\n return null;\n }\n\n inertNode.removeInertRoot(inertRoot);\n if (inertNode.destroyed) {\n this._managedNodes['delete'](node);\n }\n\n return inertNode;\n }\n\n /**\n * Callback used when document has finished loading.\n */\n\n }, {\n key: '_onDocumentLoaded',\n value: function _onDocumentLoaded() {\n // Find all inert roots in document and make them actually inert.\n var inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, this);\n\n // Comment this out to use programmatic API only.\n this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });\n }\n\n /**\n * Callback used when mutation observer detects attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_watchForInert',\n value: function _watchForInert(records, self) {\n var _this = this;\n records.forEach(function (record) {\n switch (record.type) {\n case 'childList':\n slice.call(record.addedNodes).forEach(function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var inertElements = slice.call(node.querySelectorAll('[inert]'));\n if (matches.call(node, '[inert]')) {\n inertElements.unshift(node);\n }\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, _this);\n }, _this);\n break;\n case 'attributes':\n if (record.attributeName !== 'inert') {\n return;\n }\n var target = /** @type {!HTMLElement} */record.target;\n var inert = target.hasAttribute('inert');\n _this.setInert(target, inert);\n break;\n }\n }, this);\n }\n }]);\n\n return InertManager;\n }();\n\n /**\n * Recursively walk the composed tree from |node|.\n * @param {!Node} node\n * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,\n * before descending into child nodes.\n * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n */\n\n\n function composedTreeWalk(node, callback, shadowRootAncestor) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */node;\n if (callback) {\n callback(element);\n }\n\n // Descend into node:\n // If it has a ShadowRoot, ignore all child elements - these will be picked\n // up by the <content> or <shadow> elements. Descend straight into the\n // ShadowRoot.\n var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;\n if (shadowRoot) {\n composedTreeWalk(shadowRoot, callback, shadowRoot);\n return;\n }\n\n // If it is a <content> element, descend into distributed elements - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'content') {\n var content = /** @type {!HTMLContentElement} */element;\n // Verifies if ShadowDom v0 is supported.\n var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n for (var i = 0; i < distributedNodes.length; i++) {\n composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n }\n return;\n }\n\n // If it is a <slot> element, descend into assigned nodes - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'slot') {\n var slot = /** @type {!HTMLSlotElement} */element;\n // Verify if ShadowDom v1 is supported.\n var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];\n for (var _i = 0; _i < _distributedNodes.length; _i++) {\n composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n }\n return;\n }\n }\n\n // If it is neither the parent of a ShadowRoot, a <content> element, a <slot>\n // element, nor a <shadow> element recurse normally.\n var child = node.firstChild;\n while (child != null) {\n composedTreeWalk(child, callback, shadowRootAncestor);\n child = child.nextSibling;\n }\n }\n\n /**\n * Adds a style element to the node containing the inert specific styles\n * @param {!Node} node\n */\n function addInertStyle(node) {\n if (node.querySelector('style#inert-style, link#inert-style')) {\n return;\n }\n var style = document.createElement('style');\n style.setAttribute('id', 'inert-style');\n style.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + ' user-select: none;\\n' + '}\\n';\n node.appendChild(style);\n }\n\n if (!HTMLElement.prototype.hasOwnProperty('inert')) {\n /** @type {!InertManager} */\n var inertManager = new InertManager(document);\n\n Object.defineProperty(HTMLElement.prototype, 'inert', {\n enumerable: true,\n /** @this {!HTMLElement} */\n get: function get() {\n return this.hasAttribute('inert');\n },\n /** @this {!HTMLElement} */\n set: function set(inert) {\n inertManager.setInert(this, inert);\n }\n });\n }\n})();\n", "/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-env browser */\r\nimport 'wicg-inert';\r\n\r\ntype HTMLElementWithInert = {\r\n inert: boolean,\r\n} & HTMLElement;\r\n\r\nconst hideModal = (modal: string, sender: Element, callback = () => { }): void => {\r\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\r\n if (modalView) {\r\n modalView.classList.remove('modal-view--visible');\r\n modalView.inert = true;\r\n const page = document.querySelector('.page') as HTMLElementWithInert;\r\n if (page) {\r\n page.classList.remove('page--blur');\r\n page.inert = false;\r\n }\r\n document.querySelector('body')?.classList.remove('body--no-scroll');\r\n (sender as HTMLElement).focus();\r\n sender.setAttribute('aria-expanded', 'false');\r\n callback();\r\n }\r\n};\r\n\r\nconst showModal = (\r\n modal: string, sender: Element, hideCallback = (): void => { }, closeable = true,\r\n): ExtendedCleanUpPair[] => {\r\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\r\n const cleanUp: ExtendedCleanUpPair[] = [];\r\n if (modalView) {\r\n modalView.classList.add('modal-view--visible');\r\n modalView.inert = false;\r\n const page = document.querySelector('.page') as HTMLElementWithInert;\r\n if (page) {\r\n page.classList.add('page--blur');\r\n page.inert = true;\r\n }\r\n document.querySelector('body')?.classList.add('body--no-scroll');\r\n sender.setAttribute('aria-expanded', 'true');\r\n\r\n modalView.focus();\r\n\r\n const clickEvent = (event: Event) => {\r\n if (event.target === modalView) {\r\n hideModal(modal, sender, hideCallback);\r\n }\r\n };\r\n\r\n const keyEvent = (event: Event) => {\r\n if ((event as KeyboardEvent).key === 'Escape') {\r\n hideModal(modal, sender, hideCallback);\r\n }\r\n };\r\n\r\n if (closeable) {\r\n modalView.addEventListener('click', clickEvent);\r\n window.addEventListener('keyup', keyEvent);\r\n\r\n cleanUp.push({\r\n element: modalView,\r\n clickEvent,\r\n });\r\n\r\n cleanUp.push({\r\n element: window,\r\n keyUpEvent: keyEvent,\r\n });\r\n }\r\n }\r\n return cleanUp;\r\n};\r\n\r\nexport {\r\n hideModal,\r\n showModal,\r\n};\r\n", "/* eslint-disable no-param-reassign */\r\n/* eslint-env browser */\r\nimport ready from '../components/ready';\r\nimport {\r\n setResponsiveNav,\r\n setResponsiveToggle, setCopyToClipboard,\r\n} from '../components/nav';\r\nimport copyHexCode from '../components/copy-hex-code';\r\nimport { isElementWithClassNameInEventPath, setMetaThemeColor, setHorizontalScroll } from '../components/helpers';\r\nimport { setResponsiveTable } from '../components/table';\r\nimport { setTabs } from '../components/tabs';\r\nimport { setContentToggle } from '../components/content-toggle';\r\nimport {\r\n closeAllContentTogglesInToolbar,\r\n contentToggleEdgeHandling,\r\n findToolbar,\r\n lockBodyScroll,\r\n unlockBodyScroll,\r\n} from '../components/toolbar';\r\nimport { horizontalScrollButtonNext, horizontalScrollButtonPrevious } from '../components/horizontal-scroll-btn';\r\nimport { setupAutoExpand } from '../components/text-area';\r\nimport { charCounter } from '../components/char-counter';\r\nimport { dropdownIconToggle } from '../components/form';\r\nimport { stepperLabelsCenter } from '../components/stepper';\r\nimport { showModal, hideModal } from '../components/modal-view';\r\n\r\nlet windowInnerWidth = 0;\r\n\r\nready(() => {\r\n const tabbedContent = document.querySelectorAll('.tabbed-content');\r\n const tabbedObjects: ITabbedObject[] = [];\r\n tabbedContent.forEach((tab) => tabbedObjects.push({\r\n domElement: tab,\r\n rendered: false,\r\n }));\r\n setTabs(tabbedObjects);\r\n setMetaThemeColor();\r\n\r\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\r\n navElements.forEach((n) => setResponsiveNav(navElements, n));\r\n setResponsiveToggle(navElements);\r\n\r\n // Textarea input\r\n const textarea = document.getElementById(\"autoexpand\") as HTMLTextAreaElement | null;\r\n setupAutoExpand(textarea);\r\n window.onload = function () {\r\n setupAutoExpand(textarea);\r\n };\r\n\r\n // Dropdown box icon toggle\r\n const dropDownElements: NodeListOf<HTMLElement> = document.querySelectorAll('.form__field select, .form__field__combo-box__field');\r\n dropDownElements.forEach((element) => {\r\n dropdownIconToggle(element);\r\n });\r\n\r\n // Find alle copy-to-clipboard elementer\r\n const ctc = document.querySelectorAll('.copy-to-clipboard');\r\n ctc.forEach((element) => setCopyToClipboard(element as HTMLElement, document.querySelector('html')?.getAttribute('lang') === 'en' ? 'Hexcode copied!' : 'Hexkode kopieret!'));\r\n copyHexCode();\r\n\r\n //const toggles = document.querySelectorAll('.box .content-toggle__content, .profile-header .content-toggle__content, .design-documentation .content-toggle__content');\r\n const toggles = document.querySelectorAll('.content-toggle__content:not(.toolbar .content-toggle__content)');\r\n toggles.forEach((toggle) => {\r\n setContentToggle(toggle);\r\n });\r\n\r\n // Hortizontal scroll buttons\r\n const scrollButtonsNext = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-next');\r\n const scrollButtonsPrevious = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-previous');\r\n horizontalScrollButtonNext(scrollButtonsNext);\r\n horizontalScrollButtonPrevious(scrollButtonsPrevious);\r\n\r\n const horizontalScroll = document.querySelectorAll('.horizontal-scroll');\r\n horizontalScroll.forEach((hs) => {\r\n setHorizontalScroll(hs as HTMLElement);\r\n window.addEventListener('resize', () => {\r\n setHorizontalScroll(hs as HTMLElement);\r\n });\r\n });\r\n\r\n const switchSegments = document.querySelectorAll('.switch__segment');\r\n switchSegments.forEach((switchSegment) => {\r\n switchSegment.addEventListener('click', () => {\r\n const horizontalScrollTabbed = document.querySelectorAll('.horizontal-scroll');\r\n horizontalScrollTabbed.forEach((hsTabbed) => {\r\n setHorizontalScroll(hsTabbed as HTMLElement);\r\n });\r\n });\r\n });\r\n\r\n window.addEventListener('load', () => {\r\n windowInnerWidth = window.innerWidth;\r\n });\r\n\r\n window.addEventListener('resize', () => {\r\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\r\n windowInnerWidth = window.innerWidth;\r\n navElements.forEach((n) => setResponsiveNav(navElements, n));\r\n setTabs(tabbedObjects);\r\n }\r\n });\r\n\r\n // Omnibus header mobile scroll\r\n /* const topBar = document.querySelector('.omnibus-header__mobile-scroll'); \r\n window.addEventListener('scroll', function() {\r\n if (topBar) {\r\n if (window.scrollY > 70) {\r\n topBar.classList.add('omnibus-header__mobile-scroll--show'); \r\n topBar.classList.remove('omnibus-header__mobile-scroll--hide');\r\n } else {\r\n topBar.classList.remove('omnibus-header__mobile-scroll--show'); \r\n topBar.classList.add('omnibus-header__mobile-scroll--hide'); \r\n }\r\n }\r\n }); */\r\n\r\n // Modal view for Omnibus \r\n const modalsBtns = document.querySelectorAll('[data-modal]');\r\n modalsBtns.forEach((button) => {\r\n const modalId = button.getAttribute('data-modal') as string;\r\n const modal = document.getElementById(modalId);\r\n const closeBtn = modal?.querySelector('.modal-view__close');\r\n closeBtn?.addEventListener('click', () => {\r\n hideModal(modalId, button);\r\n });\r\n button.addEventListener('click', () => {\r\n showModal(modalId, button);\r\n });\r\n });\r\n\r\n // Search for Omnibus \r\n const searchInputs = document.querySelectorAll<HTMLFormElement>('.nav__search');\r\n searchInputs.forEach((form) => {\r\n form.addEventListener('submit', (event) => {\r\n event.preventDefault();\r\n const input = form.querySelector('input[type=\"search\"]');\r\n if (input) {\r\n const inputValue = (input as HTMLInputElement).value;\r\n const redirectURL = `./soegning#?cludoquery=${encodeURIComponent(inputValue)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\u00E5%20Aarhus%20Universitet&cludoinputtype=standard`;\r\n console.log(inputValue);\r\n window.location.href = redirectURL;\r\n }\r\n });\r\n });\r\n\r\n // Logo language switch for Omnibus\r\n const logo = document.querySelector('.omnibus-header__logo-titel');\r\n const htmlLang = document.querySelector('html')?.getAttribute('lang');\r\n if (logo) {\r\n if (htmlLang === 'da') {\r\n logo.setAttribute('src', '/fileadmin/logos/Omnibus-logo.png');\r\n } else {\r\n logo.setAttribute('src', '/fileadmin/logos/Omnibus-logo-en.png');\r\n }\r\n }\r\n});\r\n\r\n\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n const containers = document.querySelectorAll('.news-story__normal');\r\n \r\n containers.forEach(container => {\r\n const imageContainer = container.querySelector('.news-story__image-container');\r\n const img = imageContainer?.querySelector('img.news-story__image');\r\n\r\n if (img instanceof HTMLImageElement) {\r\n updateImageSize(imageContainer, img);\r\n }\r\n });\r\n});\r\n\r\nfunction updateImageSize(imageContainer, img) {\r\n const containerWidth = imageContainer.offsetWidth;\r\n const containerHeight = containerWidth * (3 / 4); // Aspect ratio between 3:2 and 4:3\r\n img.style.width = containerWidth + 'px';\r\n img.style.height = containerHeight + 'px';\r\n\r\n const src = img.src;\r\n const src2x = src.replace('.jpg', '@2x.jpg').replace('.png', '@2x.png');\r\n\r\n // Check if the 2x image exists\r\n fetch(src2x, { method: 'HEAD' })\r\n .then(response => {\r\n if (response.ok) {\r\n img.setAttribute('srcset', `${src} 1x, ${src2x} 2x`);\r\n } else {\r\n img.setAttribute('srcset', `${src} 1x`);\r\n }\r\n })\r\n .catch(() => {\r\n img.setAttribute('srcset', `${src} 1x`);\r\n });\r\n\r\n // Center the image horizontally and vertically\r\n imageContainer.style.display = 'flex';\r\n imageContainer.style.justifyContent = 'center';\r\n imageContainer.style.alignItems = 'center';\r\n}\r\n\r\n// Update image size on window resize\r\nwindow.addEventListener('resize', () => {\r\n const containers = document.querySelectorAll('.news-story__normal');\r\n \r\n containers.forEach(container => {\r\n const imageContainer = container.querySelector('.news-story__image-container');\r\n const img = imageContainer?.querySelector('img.news-story__image');\r\n\r\n if (img instanceof HTMLImageElement) {\r\n updateImageSize(imageContainer, img);\r\n }\r\n });\r\n});\r\n"],
4
+ "sourcesContent": ["/* eslint-env browser */\r\nconst ready = (fn: () => void): void => {\r\n if (document.readyState !== 'loading') {\r\n fn();\r\n } else {\r\n document.addEventListener('DOMContentLoaded', fn);\r\n }\r\n};\r\n\r\nexport default ready;\r\n", "/* eslint-disable wrap-iife */\r\n/* eslint-disable import/prefer-default-export */\r\n/* eslint-env browser */\r\nconst copyToClipboard = (str: string): void => {\r\n // eslint-disable-next-line no-console\r\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\r\n};\r\n\r\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\r\n let found = false;\r\n const path = event.composedPath();\r\n path.forEach((p: EventTarget): void => {\r\n if ((p as HTMLElement).classList) {\r\n if ((p as HTMLElement).classList.contains(className)) {\r\n found = true;\r\n }\r\n }\r\n });\r\n return found;\r\n};\r\n\r\nconst setMetaThemeColor = (): void => {\r\n const body = document.querySelector('body');\r\n if (body) {\r\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\r\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\r\n if (existingMeta) {\r\n existingMeta.content = bgColor;\r\n } else {\r\n const meta = document.createElement('meta');\r\n meta.name = 'theme-color';\r\n meta.content = bgColor;\r\n document.getElementsByTagName('head')[0].appendChild(meta);\r\n }\r\n }\r\n};\r\n\r\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\r\n\r\n// eslint-disable-next-line max-len\r\nconst convertRemToPixels = (rem: number): number => rem * 16;\r\n\r\nconst isViewportBelow = (mediaQuery: string): boolean => {\r\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\r\n const mediaQueryValue = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue(mediaQuery).replace('rem', ''), 10));\r\n return viewportWidth < mediaQueryValue;\r\n};\r\n\r\nconst setScrollbarWidthVariable = (): void => {\r\n const scrollbarWidth = window.innerWidth - document.body.clientWidth;\r\n document.documentElement.style.setProperty('--vertical-scrollbar-width', `${scrollbarWidth}px`);\r\n};\r\n\r\nconst overflowsY = (element: HTMLElement): boolean => element.offsetHeight !== element.scrollHeight;\r\nconst overflowsX = (element: HTMLElement): boolean => element.offsetWidth !== element.scrollWidth;\r\n// eslint-disable-next-line max-len\r\nconst elementOverflows = (element: HTMLElement): boolean => overflowsY(element) || overflowsX(element);\r\n\r\nconst setHorizontalScroll = (element: HTMLElement): void => {\r\n // Checks if the element already contains no-overflow\r\n if (element.classList.contains('horizontal-scroll--no-overflow')) {\r\n element.classList.remove('horizontal-scroll--no-overflow');\r\n }\r\n\r\n // Defines of content of horizontal scroll \r\n let content = element.querySelector('.horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content');\r\n if (content === null && !content) {\r\n content = element.querySelector('.horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content');\r\n }\r\n\r\n // Checks if no-overflow should be added or not depending on content width\r\n if (content) {\r\n if (!overflowsX(content as HTMLElement)) {\r\n element.classList.add('horizontal-scroll--no-overflow');\r\n content?.removeAttribute('tabindex');\r\n } else {\r\n content?.setAttribute('tabindex', '0');\r\n }\r\n }\r\n};\r\n\r\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\"])';\r\n\r\nexport {\r\n copyToClipboard,\r\n isElementWithClassNameInEventPath,\r\n getBaseFontSize,\r\n setMetaThemeColor,\r\n isViewportBelow,\r\n convertRemToPixels,\r\n setScrollbarWidthVariable,\r\n overflowsX,\r\n overflowsY,\r\n elementOverflows,\r\n setHorizontalScroll,\r\n focusableSelector,\r\n};\r\n", "/* eslint-env browser */\r\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\r\n\r\nconst findNav = (element: HTMLElement): HTMLElement => {\r\n const parent = element.parentElement;\r\n if (parent) {\r\n if (parent.classList.contains('nav')) {\r\n return parent;\r\n }\r\n return findNav(parent);\r\n }\r\n return element;\r\n};\r\n\r\n// eslint-disable-next-line max-len\r\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\r\n const navToggledClass = 'nav--toggled';\r\n navElements.forEach((n) => {\r\n const button = n.querySelector('.nav__toggle') as HTMLElement;\r\n if (n !== keepOpen) {\r\n if (n.classList.contains(navToggledClass)) {\r\n button.focus();\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n n.classList.remove(navToggledClass);\r\n }\r\n });\r\n};\r\n\r\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\r\n const toggleMenu = (button: HTMLElement) => {\r\n const parent = findNav(button);\r\n // const hideItems: NodeListOf<HTMLElement> = parent.querySelectorAll('.nav__item');\r\n\r\n // // Only shows overflown elements when the menu is extended \r\n // hideItems.forEach(item => {\r\n // const currentDisplay = window.getComputedStyle(item).display;\r\n // if (!item.classList.contains('nav__item--is-overflown')) {\r\n // item.style.display = currentDisplay === 'none' ? 'inline-flex' : 'none';\r\n // }\r\n // });\r\n\r\n // // All elements get display: inline-flex when there is clicked outside of the button \r\n // const handleDocumentClick = (event: MouseEvent) => {\r\n // if (!parent.contains(event.target as Node)) {\r\n // hideItems.forEach(item => {\r\n // item.style.display = 'inline-flex';\r\n // });\r\n // }\r\n // };\r\n // document.body.addEventListener('click', handleDocumentClick);\r\n\r\n const navItems = parent.querySelector('.nav__items');\r\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\r\n navItems?.classList.add('nav__items--fadeout');\r\n const firstElement = navItems?.querySelector('.nav__item--is-overflown') as HTMLElement;\r\n if (firstElement) {\r\n firstElement.focus();\r\n }\r\n const transitionListener = () => {\r\n parent.classList.toggle('nav--toggled');\r\n navItems?.classList.remove('nav__items--fadeout');\r\n lastNavItem?.removeEventListener('transitionend', transitionListener);\r\n };\r\n lastNavItem?.addEventListener('transitionend', transitionListener);\r\n return parent;\r\n };\r\n\r\n const cleanUp: CleanUpPair[] = [];\r\n\r\n const toggle = document.querySelectorAll('.nav__toggle');\r\n toggle.forEach((button) => {\r\n const clickEvent = () => {\r\n const nav = toggleMenu(button as HTMLElement);\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\r\n closeResponsiveNav(navElements, nav);\r\n };\r\n\r\n cleanUp.push({\r\n element: button,\r\n clickEvent,\r\n });\r\n\r\n button.addEventListener('click', clickEvent);\r\n });\r\n\r\n return cleanUp;\r\n};\r\n\r\nconst setResponsiveNav = (\r\n navElements: NodeListOf<Element>,\r\n navElement: Element,\r\n): SetResponsiveNavCleanUp => {\r\n const navToggledClass = 'nav--toggled';\r\n const navItemsClass = 'nav__items';\r\n // gitlab #117\r\n navElement.classList.remove(navToggledClass);\r\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\r\n\r\n if (navItemsParent) {\r\n const navItems = navItemsParent.querySelectorAll('.nav__item');\r\n const isOverflownClass = 'nav__item--is-overflown';\r\n const hasOverflowClass = 'nav--has-overflow';\r\n const isActiveClass = 'nav__item--active';\r\n let hasOverflown = false;\r\n\r\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\r\n const nav = navItems[i] as HTMLElement;\r\n const top = nav.offsetTop;\r\n\r\n if (top > 0) {\r\n nav.classList.add(isOverflownClass);\r\n navElement.classList.add(hasOverflowClass);\r\n hasOverflown = true;\r\n } else if (!nav.classList.contains(isActiveClass)) {\r\n nav.classList.remove(isOverflownClass);\r\n }\r\n }\r\n\r\n if (!hasOverflown) {\r\n navElement.classList.remove(hasOverflowClass);\r\n const isActive = navElement.querySelector(`.${isActiveClass}`);\r\n if (isActive) {\r\n isActive.classList.remove(isOverflownClass);\r\n }\r\n }\r\n }\r\n\r\n // gitlab #115\r\n const bodyClickEvent = (e: Event) => {\r\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\r\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\r\n closeResponsiveNav(navElements);\r\n }\r\n };\r\n\r\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\r\n\r\n return {\r\n element: document.querySelector('body'),\r\n clickEvent: bodyClickEvent,\r\n };\r\n};\r\n\r\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\r\n const subNavClass = 'sub-nav--toggled';\r\n buttons.forEach((button) => {\r\n if (button !== keepOpen) {\r\n if (button?.parentElement?.classList.contains(subNavClass)) {\r\n (button as HTMLElement).focus();\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n button?.parentElement?.classList.remove(subNavClass);\r\n }\r\n });\r\n};\r\n\r\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\r\n const subNavClass = 'sub-nav--toggled';\r\n const buttonClickEvent = () => {\r\n button?.parentElement?.classList.toggle(subNavClass);\r\n if (button?.parentElement?.classList.contains(subNavClass)) {\r\n button.setAttribute('aria-expanded', 'true');\r\n } else {\r\n button.setAttribute('aria-expanded', 'false');\r\n }\r\n closeSubNav(buttons, button);\r\n };\r\n\r\n button.addEventListener('click', buttonClickEvent);\r\n\r\n // gitlab #115\r\n const bodyClickEvent = (e: Event) => {\r\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\r\n closeSubNav(buttons);\r\n }\r\n };\r\n\r\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\r\n return {\r\n buttonClickEvent,\r\n element: document.querySelector('body'),\r\n bodyClickEvent,\r\n };\r\n};\r\n\r\nconst setClickMessage = ((\r\n text: string,\r\n copyElement: Element,\r\n clickElement: Element | null,\r\n ctcThis: HTMLElement | null,\r\n listener: () => void,\r\n): void => {\r\n if (ctcThis && clickElement) {\r\n // Vi kopierer teksten til clipboard\r\n copyToClipboard(ctcThis.innerText);\r\n copyElement.classList.add('copy-to-clipboard--confirm');\r\n if (copyElement === clickElement) {\r\n copyElement.classList.add('copy-to-clipboard--done');\r\n }\r\n // Laver en span, der viser, at teksten er kopieret\r\n const ctcThisMessage = document.createElement('span');\r\n ctcThisMessage.classList.add('copy-to-clipboard__this__confirm-message');\r\n ctcThisMessage.innerText = text;\r\n ctcThis.appendChild(ctcThisMessage);\r\n\r\n // Efter 1,2 sekunder fjerner vi beskeden igen\r\n clickElement.removeEventListener('click', listener);\r\n setTimeout(() => {\r\n copyElement.classList.remove('copy-to-clipboard--confirm');\r\n ctcThisMessage.remove();\r\n clickElement.addEventListener('click', listener);\r\n }, 1200);\r\n }\r\n});\r\n\r\nconst setCopyToClipboard = (element: HTMLElement, text = 'Kopieret!'): void => {\r\n const ctcThis = <HTMLElement>element.querySelector('.copy-to-clipboard__this');\r\n // Hvis det er en knap, s\u00E5 s\u00E6tter vi click event p\u00E5 knappen\r\n if ((element as HTMLButtonElement).type === 'button') {\r\n const listener = (): void => {\r\n setClickMessage(text, element, element, ctcThis, listener);\r\n };\r\n element.addEventListener('click', listener);\r\n // Hvis det ikke er en knap, finder vi knappen \"inde i\" elementet\r\n } else {\r\n const btn = element.querySelector('.copy-to-clipboard__execute');\r\n const listener = (): void => {\r\n setClickMessage(text, element, btn, ctcThis, listener);\r\n };\r\n btn?.addEventListener('click', listener);\r\n }\r\n};\r\n\r\nconst setSearchToggle = (navSearch: Element, button: Element): void => {\r\n const toggleClass = 'nav__search--toggled';\r\n button.addEventListener('click', () => {\r\n if (navSearch.classList.contains(toggleClass)) {\r\n button.setAttribute('aria-expanded', 'false');\r\n navSearch.classList.remove(toggleClass);\r\n } else {\r\n button.setAttribute('aria-expanded', 'true');\r\n navSearch.classList.add(toggleClass);\r\n }\r\n });\r\n};\r\n\r\n\r\n\r\nexport {\r\n findNav,\r\n setResponsiveToggle,\r\n setResponsiveNav,\r\n setSubNavToggle,\r\n setCopyToClipboard,\r\n setSearchToggle,\r\n};\r\n", "/* eslint-env browser */\r\nimport { copyToClipboard } from './helpers';\r\n\r\nconst copyHexCode = (): void => {\r\n const ctc = document.querySelectorAll('.copy-to-clipboard');\r\n const colorElements = document.querySelectorAll('.copy-to-clipboard__color');\r\n ctc.forEach((button) => {\r\n button.addEventListener('click', () => {\r\n let color = button.parentElement?.querySelector('.copy-to-clipboard__color');\r\n if(color) {\r\n let computedStyle = getComputedStyle(color).getPropertyValue('background-color');\r\n let hexColor = rgbToHex(computedStyle);\r\n console.log(hexColor);\r\n copyToClipboard(hexColor.replace(/\"/g, ''));\r\n }\r\n });\r\n });\r\n};\r\n\r\nfunction rgbToHex(rgb) {\r\n // Extract the individual RGB components\r\n var rgbArray = rgb.match(/\\d+/g);\r\n\r\n // Convert each component to hex and concatenate\r\n var hex = \"#\" + rgbArray.map(function (value) {\r\n var hexValue = parseInt(value).toString(16);\r\n return hexValue.length === 1 ? \"0\" + hexValue : hexValue;\r\n }).join('');\r\n\r\n return hex;\r\n}\r\n\r\nexport default copyHexCode;\r\n", "/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-env browser */\r\n/* eslint-disable import/prefer-default-export */\r\n/* eslint-disable no-param-reassign */\r\nimport { getBaseFontSize } from './helpers';\r\n\r\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\r\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\r\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\r\n }\r\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\r\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\r\n }\r\n\r\n return -1;\r\n};\r\n\r\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\r\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\r\n const widthInRem = viewportWidth / getBaseFontSize();\r\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\r\n if (mediaWidth > -1) {\r\n return widthInRem < mediaWidth;\r\n }\r\n return true;\r\n};\r\n\r\nconst destroyTabs = (tabbed: Element): void => {\r\n const tablist = tabbed.querySelector('.nav__items');\r\n const tabs = tablist?.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n tabs?.forEach((tab) => {\r\n tab.removeAttribute('aria-selected');\r\n tab.classList.remove('nav__item--active');\r\n });\r\n\r\n panels.forEach((panel) => {\r\n panel.hidden = false;\r\n panel.removeAttribute('role');\r\n });\r\n};\r\n\r\nconst destroySwitches = (tabbed: Element): void => {\r\n const switchlist = tabbed.querySelector('.switch');\r\n const switches = switchlist?.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n switches?.forEach((tab) => {\r\n tab.removeAttribute('aria-selected');\r\n tab.classList.remove('switch__segment--active');\r\n });\r\n\r\n panels.forEach((panel) => {\r\n panel.hidden = false;\r\n panel.removeAttribute('role');\r\n });\r\n};\r\n\r\nconst switchTab = (\r\n tabs: NodeListOf<HTMLAnchorElement>,\r\n panels: HTMLElement[],\r\n oldTab: Element | null,\r\n newTab: HTMLElement,\r\n _: DOMTokenList,\r\n focus = true,\r\n // eslint-disable-next-line no-console\r\n callback = (index: number): void => console.log(index),\r\n): void => {\r\n if (focus) {\r\n newTab.focus();\r\n }\r\n // Make the active tab focusable by the user (Tab key)\r\n newTab.removeAttribute('tabindex');\r\n // Set the selected state\r\n newTab.setAttribute('aria-selected', 'true');\r\n\r\n // Check if switch // should this be more pretty?\r\n if (newTab.classList.contains('switch__segment')) {\r\n newTab.classList.add('switch__segment--active');\r\n } else {\r\n newTab.classList.add('nav__item--active');\r\n }\r\n\r\n if (oldTab) {\r\n oldTab.removeAttribute('aria-selected');\r\n oldTab.setAttribute('tabindex', '-1');\r\n\r\n if (oldTab.classList.contains('switch__segment')) {\r\n oldTab.classList.remove('switch__segment--active');\r\n } else {\r\n oldTab.classList.remove('nav__item--active');\r\n }\r\n }\r\n\r\n const index = Array.prototype.indexOf.call(tabs, newTab);\r\n\r\n // More links\r\n /* let moreLinks;\r\n var moreLink: HTMLElement;\r\n moreLinks = document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`);\r\n moreLinks.forEach((moreLink) => {\r\n moreLink.classList.add('tabbed-content-peripheral--active');\r\n moreLink.hidden = false;\r\n }); */\r\n const moreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`));\r\n moreLinks.forEach((link) => {\r\n link.classList.add('tabbed-content-peripheral--active');\r\n link.hidden = false;\r\n });\r\n\r\n // Get the indices of the new and old tabs to find the correct\r\n // tab panels to show and hide\r\n panels[index].hidden = false;\r\n if (oldTab) {\r\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\r\n\r\n const oldMoreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[oldIndex].id}\"]`));\r\n oldMoreLinks.forEach((link) => {\r\n link.classList.remove('tabbed-content-peripheral--active');\r\n link.hidden = true;\r\n });\r\n\r\n /* moreLinks.forEach((moreLink) => {\r\n moreLink.classList.remove('tabbed-content-peripheral--active');\r\n moreLink.hidden = true;\r\n }); */\r\n\r\n panels[oldIndex].hidden = true;\r\n }\r\n\r\n // Dispatches custom event on every tab change\r\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\r\n bubbles: true,\r\n detail: { tab: index },\r\n }));\r\n callback(index);\r\n};\r\n\r\nconst setTabbedContent = (\r\n key: number,\r\n tabbed: Element,\r\n initial = 0,\r\n focus = true,\r\n // eslint-disable-next-line no-console\r\n callback = (index: number) => console.log(index),\r\n): void => {\r\n const tablist = tabbed.querySelector('.switch,.nav__items') as HTMLElement;\r\n const tabs = tablist.querySelectorAll('a');\r\n const panels: HTMLElement[] = [];\r\n const sections = tabbed.querySelectorAll('section');\r\n sections.forEach((section) => {\r\n if (section.parentNode === tabbed) {\r\n panels.push(section);\r\n }\r\n });\r\n\r\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\r\n if (expandAll) {\r\n const expandAllEvent = () => {\r\n tablist.hidden = true;\r\n panels.forEach((panel: HTMLElement) => {\r\n panel.hidden = false;\r\n });\r\n };\r\n\r\n expandAll.removeEventListener('click', expandAllEvent);\r\n expandAll.addEventListener('click', expandAllEvent);\r\n }\r\n\r\n // Add the tablist role to the first <ul> in the .tabbed container\r\n tablist.setAttribute('role', 'tablist');\r\n\r\n // Add semantics are remove user focusability for each tab\r\n tabs.forEach((tab, i) => {\r\n tab.setAttribute('role', 'tab');\r\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\r\n tab.setAttribute('tabindex', '-1');\r\n tab.parentElement?.setAttribute('role', 'presentation');\r\n\r\n // Handle clicking of tabs for mouse users\r\n const tabClickEvent = (e: MouseEvent) => {\r\n e.preventDefault();\r\n const currentTab = tablist.querySelector('[aria-selected]');\r\n if (e.currentTarget !== currentTab) {\r\n // eslint-disable-next-line max-len\r\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\r\n callback(tabIndex);\r\n });\r\n }\r\n };\r\n\r\n tab.removeEventListener('click', tabClickEvent);\r\n tab.addEventListener('click', tabClickEvent);\r\n\r\n // Handle keydown events for keyboard users\r\n const tabKeyEvent = (e: KeyboardEvent) => {\r\n // Get the index of the current tab in the tabs node list\r\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\r\n // Work out which key the user is pressing and\r\n // Calculate the new tab's index where appropriate\r\n let dir: number | string | null = null;\r\n if (e.key === 'ArrowLeft') {\r\n dir = index - 1;\r\n }\r\n if (e.key === 'ArrowRight') {\r\n dir = index + 1;\r\n }\r\n if (e.key === 'ArrowDown') {\r\n dir = 'down';\r\n }\r\n if (dir !== null) {\r\n e.preventDefault();\r\n // If the down key is pressed, move focus to the open panel,\r\n // otherwise switch to the adjacent tab\r\n if (dir === 'down') {\r\n panels[i].focus();\r\n } else if (tabs[dir]) {\r\n // eslint-disable-next-line max-len\r\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\r\n callback(tabIndex);\r\n });\r\n }\r\n }\r\n };\r\n tab.removeEventListener('keydown', tabKeyEvent);\r\n tab.addEventListener('keydown', tabKeyEvent);\r\n });\r\n\r\n // Add tab panel semantics and hide them all\r\n panels.forEach((panel: HTMLElement, i: number) => {\r\n panel.setAttribute('tabindex', '-1');\r\n panel.setAttribute('aria-labelledby', tabs[i].id);\r\n // eslint-disable-next-line no-param-reassign\r\n panel.hidden = true;\r\n panel.setAttribute('role', 'tabpanel');\r\n });\r\n\r\n // Initially activate the first tab and reveal the first tab panel\r\n if (initial > -1) {\r\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\r\n }\r\n};\r\n\r\nconst setTabs = (tabbedObjects: ITabbedObject[]): void => {\r\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\r\n const { rendered, domElement } = tabObject;\r\n if (isBelowViewportLimit(domElement.classList)) {\r\n if (!rendered) {\r\n const focus = domElement.getAttribute('data-focus-onload');\r\n const dataInitial = domElement.getAttribute('data-initial-tab');\r\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\r\n setTabbedContent(key, domElement, initial, focus !== 'false');\r\n tabObject.rendered = true;\r\n }\r\n } else if (rendered) {\r\n destroyTabs(domElement);\r\n tabObject.rendered = false;\r\n }\r\n });\r\n};\r\n\r\nexport {\r\n setTabbedContent,\r\n isBelowViewportLimit,\r\n destroyTabs,\r\n destroySwitches,\r\n setTabs,\r\n};\r\n", "/* eslint-disable max-len */\r\n/* eslint-env browser */\r\n/* eslint-disable import/prefer-default-export */\r\n\r\nimport { isViewportBelow} from './helpers';\r\n\r\nconst setContentToggle = (\r\n content: Element,\r\n onClick?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n beforeCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n afterCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\r\n): CleanUpPair[] => {\r\n const cleanUp: CleanUpPair[] = [];\r\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean): () => void => {\r\n if (focus) {\r\n contentClose.focus();\r\n }\r\n const click = () => {\r\n content.setAttribute('hidden', 'hidden');\r\n button.removeAttribute('hidden');\r\n button.setAttribute('aria-expanded', 'false');\r\n button.focus();\r\n };\r\n contentClose.addEventListener('click', click);\r\n return click;\r\n };\r\n\r\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\r\n const contentClose = content.querySelectorAll('.content-toggle__close');\r\n \r\n const setBPModiferClass = () => {\r\n if (isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--always-show-on-medium')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n } \r\n else if (isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--always-show-on-wide')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n } \r\n else if (isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--always-show-on-max-width')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n \r\n } \r\n else (\r\n content.classList.contains('content-toggle__content--always-show-on-medium') ||\r\n content.classList.contains('content-toggle__content--always-show-on-wide') ||\r\n content.classList.contains('content-toggle__content--always-show-on-max-width')\r\n )\r\n }\r\n window.addEventListener('resize', () => {\r\n setBPModiferClass();\r\n });\r\n\r\n const setBPModifierPopupClass = () => {\r\n document.addEventListener('click', (event) => {\r\n const eventTarget = event.target as HTMLElement;\r\n const doesNotContainContent = !eventTarget.classList.contains('content-toggle__content')\r\n const doesNotContainButton = !eventTarget.classList.contains('content-toggle__toggle')\r\n const doesNotContainSpan = !eventTarget.classList.contains('profile-header__info__contact__toggle__button')\r\n if (doesNotContainContent && doesNotContainButton && doesNotContainSpan) {\r\n if (!isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--is-popover--on-medium')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n } else if (!isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--is-popover--on-wide')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n } else if (!isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--is-popover--on-max-width')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus(); \r\n }\r\n else if (content.classList.contains('content-toggle__content--is-popover')) {\r\n button.removeAttribute(\"hidden\");\r\n content.setAttribute(\"hidden\", \"hidden\");\r\n button.setAttribute(\"aria-expanded\", \"false\");\r\n button.focus();\r\n }\r\n }\r\n });\r\n }\r\n\r\n setBPModifierPopupClass(); \r\n setBPModiferClass();\r\n\r\n if (button) {\r\n const clickEvent = () => {\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n // Til toolbar: hvis man klikker p\u00E5 en knap, der ikke er foldet ud\r\n // S\u00E5 lukker vi alle \u00E5bne content-toggles\r\n if (typeof beforeCallback === 'function' && ariaExpanded === 'false') {\r\n beforeCallback(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n // Og s\u00E5 g\u00E5r vi i gang med folde-ud-logikken\r\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\r\n if (ariaExpanded === 'true') {\r\n content.setAttribute('hidden', 'hidden');\r\n } else {\r\n content.removeAttribute('hidden');\r\n }\r\n\r\n if (typeof onClick === 'function') {\r\n onClick(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n\r\n if (button.hasAttribute('aria-haspopup')) {\r\n button.setAttribute('hidden', 'hidden');\r\n contentClose.forEach((cc) => {\r\n setContentClose(button, cc as HTMLElement, true);\r\n });\r\n }\r\n\r\n // Det der sker efter folde-logikken\r\n if (typeof afterCallback === 'function') {\r\n afterCallback(content as HTMLElement, button as HTMLButtonElement);\r\n }\r\n };\r\n\r\n button.addEventListener('click', clickEvent);\r\n // Altid tilf\u00F8j denne f\u00F8rst!\r\n cleanUp.push({\r\n element: button,\r\n clickEvent,\r\n });\r\n\r\n contentClose.forEach((cc) => {\r\n const btnClick = setContentClose(button, cc as HTMLElement, false);\r\n cleanUp.push({\r\n element: cc,\r\n clickEvent: btnClick,\r\n });\r\n });\r\n }\r\n return cleanUp;\r\n};\r\n\r\nexport {\r\n setContentToggle, \r\n};\r\n", "// Scroller 80% p\u00E5 horisontal scroll til h\u00F8jre og s\u00E6tter knappen disabled n\u00E5r man rammer bunden\r\nconst horizontalScrollButtonNext = (nextButtons: NodeListOf<Element>): void => {\r\n if (nextButtons) {\r\n nextButtons.forEach((nextButton) => {\r\n const topElem = nextButton?.parentElement?.parentElement?.parentElement?.parentElement;\r\n if (topElem) {\r\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\r\n const switch__segments = topElem.querySelectorAll('.switch__segment');\r\n scrollElements.forEach((scrollElement) => { \r\n if (scrollElement) {\r\n nextButton.addEventListener('click', () => {\r\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til h\u00F8jre\r\n const scrollAmount = 0.8 * scrollElement.clientWidth;\r\n scrollElement.scrollLeft += scrollAmount;\r\n });\r\n // G\u00F8r knappen aktiv hvis scroll har ramt bunden\r\n scrollElement.addEventListener('scroll', () => {\r\n if ((scrollElement.scrollLeft + scrollElement.clientWidth) >= (scrollElement.scrollWidth * 0.98)) {\r\n disableButton(nextButton);\r\n } else if (scrollElement.scrollLeft + scrollElement.clientWidth < scrollElement.scrollWidth) {\r\n activateButton(nextButton);\r\n }\r\n });\r\n // Reset af knap ved flere tabs af horizontal scroll\r\n if (switch__segments) {\r\n switch__segments.forEach(switch__segment => {\r\n switch__segment.addEventListener('click', () => {\r\n activateButton(nextButton);\r\n scrollElement.scrollLeft = 0;\r\n })\r\n });\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n \r\n // Scroller 80% p\u00E5 horisontal scroll til venstre og s\u00E6tter knappen disabled n\u00E5r man rammer toppen\r\n const horizontalScrollButtonPrevious = (previousButtons: NodeListOf<Element>): void => {\r\n if (previousButtons) {\r\n previousButtons.forEach((previousButton) => {\r\n const topElem = previousButton?.parentElement?.parentElement?.parentElement?.parentElement;\r\n if (topElem) {\r\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\r\n const switch__segments = topElem.querySelectorAll('.switch__segment');\r\n scrollElements.forEach((scrollElement) => { \r\n if (scrollElement) {\r\n previousButton.addEventListener('click', () => {\r\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til venstre\r\n const scrollAmount = 0.8 * scrollElement.clientWidth;\r\n scrollElement.scrollLeft -= scrollAmount;\r\n });\r\n // G\u00F8r knappen aktiv hvis scroll har ramt toppen\r\n scrollElement.addEventListener('scroll', () => {\r\n if (scrollElement.scrollLeft <= 0) {\r\n disableButton(previousButton);\r\n } else if (scrollElement.scrollLeft > 0) {\r\n activateButton(previousButton);\r\n }\r\n });\r\n }\r\n // Reset af knap ved flere tabs af horizontal scroll\r\n if (switch__segments) {\r\n switch__segments.forEach(switch__segment => {\r\n switch__segment.addEventListener('click', () => {\r\n disableButton(previousButton);\r\n });\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n\r\n function activateButton(button) {\r\n button.classList.remove('visually-disabled');\r\n button.setAttribute('aria-disabled', 'false');\r\n }\r\n \r\n function disableButton(button) {\r\n button.classList.add('visually-disabled');\r\n button.setAttribute('aria-disabled', 'true');\r\n }\r\n\r\n export {\r\n horizontalScrollButtonNext,\r\n horizontalScrollButtonPrevious,\r\n };", "function setupAutoExpand(textarea: HTMLTextAreaElement | null): void {\r\n if (textarea) {\r\n textarea.addEventListener(\"input\", function (this: HTMLTextAreaElement, event: Event) {\r\n const parentNode = textarea?.parentNode as HTMLElement | null;\r\n \r\n if (parentNode && parentNode.dataset) {\r\n parentNode.dataset.value = this.value;\r\n }\r\n });\r\n }\r\n }\r\n\r\n export {\r\n setupAutoExpand\r\n };", "/* eslint-disable import/prefer-default-export */\r\nconst setInlineSelectLabel = (formField: Element): void => {\r\n const select = formField.querySelector('select');\r\n const label = formField.querySelector(`label[for=\"${select?.getAttribute('id')}\"]`);\r\n if (label) {\r\n const labelWidth = getComputedStyle(label).width;\r\n select?.style.setProperty('--label-width', labelWidth);\r\n }\r\n};\r\n\r\nfunction dropdownIconToggle(element: HTMLElement): void { \r\n let dropdownInactive = true;\r\n element.addEventListener('click', function (event) {\r\n if (dropdownInactive) {\r\n element.classList.add('dropdown-icon--active');\r\n element.classList.remove('dropdown-icon--inactive');\r\n dropdownInactive = false;\r\n } else {\r\n element.classList.add('dropdown-icon--inactive');\r\n element.classList.remove('dropdown-icon--active');\r\n dropdownInactive = true;\r\n }\r\n \r\n const handleOutsideClick = (event) => {\r\n if (!element.contains(event.target)) {\r\n element.classList.add('dropdown-icon--inactive');\r\n element.classList.remove('dropdown-icon--active');\r\n document.removeEventListener('click', handleOutsideClick);\r\n dropdownInactive = true;\r\n }\r\n };\r\n \r\n document.addEventListener('click', handleOutsideClick);\r\n });\r\n }\r\n\r\n\r\n\r\nexport {\r\n setInlineSelectLabel,\r\n dropdownIconToggle\r\n};\r\n", "var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This work is licensed under the W3C Software and Document License\n * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).\n */\n\n(function () {\n // Return early if we're not running inside of the browser.\n if (typeof window === 'undefined') {\n return;\n }\n\n // Convenience function for converting NodeLists.\n /** @type {typeof Array.prototype.slice} */\n var slice = Array.prototype.slice;\n\n /**\n * IE has a non-standard name for \"matches\".\n * @type {typeof Element.prototype.matches}\n */\n var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n\n /** @type {string} */\n var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');\n\n /**\n * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`\n * attribute.\n *\n * Its main functions are:\n *\n * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the\n * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering\n * each focusable node in the subtree with the singleton `InertManager` which manages all known\n * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`\n * instance exists for each focusable node which has at least one inert root as an ancestor.\n *\n * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`\n * attribute is removed from the root node). This is handled in the destructor, which calls the\n * `deregister` method on `InertManager` for each managed inert node.\n */\n\n var InertRoot = function () {\n /**\n * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree.\n * @param {!InertManager} inertManager The global singleton InertManager object.\n */\n function InertRoot(rootElement, inertManager) {\n _classCallCheck(this, InertRoot);\n\n /** @type {!InertManager} */\n this._inertManager = inertManager;\n\n /** @type {!HTMLElement} */\n this._rootElement = rootElement;\n\n /**\n * @type {!Set<!InertNode>}\n * All managed focusable nodes in this InertRoot's subtree.\n */\n this._managedNodes = new Set();\n\n // Make the subtree hidden from assistive technology\n if (this._rootElement.hasAttribute('aria-hidden')) {\n /** @type {?string} */\n this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n } else {\n this._savedAriaHidden = null;\n }\n this._rootElement.setAttribute('aria-hidden', 'true');\n\n // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n this._makeSubtreeUnfocusable(this._rootElement);\n\n // Watch for:\n // - any additions in the subtree: make them unfocusable too\n // - any removals from the subtree: remove them from this inert root's managed nodes\n // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n // element, make that node a managed node.\n this._observer = new MutationObserver(this._onMutation.bind(this));\n this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });\n }\n\n /**\n * Call this whenever this object is about to become obsolete. This unwinds all of the state\n * stored in this object and updates the state of all of the managed nodes.\n */\n\n\n _createClass(InertRoot, [{\n key: 'destructor',\n value: function destructor() {\n this._observer.disconnect();\n\n if (this._rootElement) {\n if (this._savedAriaHidden !== null) {\n this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n } else {\n this._rootElement.removeAttribute('aria-hidden');\n }\n }\n\n this._managedNodes.forEach(function (inertNode) {\n this._unmanageNode(inertNode.node);\n }, this);\n\n // Note we cast the nulls to the ANY type here because:\n // 1) We want the class properties to be declared as non-null, or else we\n // need even more casts throughout this code. All bets are off if an\n // instance has been destroyed and a method is called.\n // 2) We don't want to cast \"this\", because we want type-aware optimizations\n // to know which properties we're setting.\n this._observer = /** @type {?} */null;\n this._rootElement = /** @type {?} */null;\n this._managedNodes = /** @type {?} */null;\n this._inertManager = /** @type {?} */null;\n }\n\n /**\n * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.\n */\n\n }, {\n key: '_makeSubtreeUnfocusable',\n\n\n /**\n * @param {!Node} startNode\n */\n value: function _makeSubtreeUnfocusable(startNode) {\n var _this2 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this2._visitNode(node);\n });\n\n var activeElement = document.activeElement;\n\n if (!document.body.contains(startNode)) {\n // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n var node = startNode;\n /** @type {!ShadowRoot|undefined} */\n var root = undefined;\n while (node) {\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n root = /** @type {!ShadowRoot} */node;\n break;\n }\n node = node.parentNode;\n }\n if (root) {\n activeElement = root.activeElement;\n }\n }\n if (startNode.contains(activeElement)) {\n activeElement.blur();\n // In IE11, if an element is already focused, and then set to tabindex=-1\n // calling blur() will not actually move the focus.\n // To work around this we call focus() on the body instead.\n if (activeElement === document.activeElement) {\n document.body.focus();\n }\n }\n }\n\n /**\n * @param {!Node} node\n */\n\n }, {\n key: '_visitNode',\n value: function _visitNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */node;\n\n // If a descendant inert root becomes un-inert, its descendants will still be inert because of\n // this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n if (element !== this._rootElement && element.hasAttribute('inert')) {\n this._adoptInertRoot(element);\n }\n\n if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n this._manageNode(element);\n }\n }\n\n /**\n * Register the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_manageNode',\n value: function _manageNode(node) {\n var inertNode = this._inertManager.register(node, this);\n this._managedNodes.add(inertNode);\n }\n\n /**\n * Unregister the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n\n }, {\n key: '_unmanageNode',\n value: function _unmanageNode(node) {\n var inertNode = this._inertManager.deregister(node, this);\n if (inertNode) {\n this._managedNodes['delete'](inertNode);\n }\n }\n\n /**\n * Unregister the entire subtree starting at `startNode`.\n * @param {!Node} startNode\n */\n\n }, {\n key: '_unmanageSubtree',\n value: function _unmanageSubtree(startNode) {\n var _this3 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this3._unmanageNode(node);\n });\n }\n\n /**\n * If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n * @param {!HTMLElement} node\n */\n\n }, {\n key: '_adoptInertRoot',\n value: function _adoptInertRoot(node) {\n var inertSubroot = this._inertManager.getInertRoot(node);\n\n // During initialisation this inert root may not have been registered yet,\n // so register it now if need be.\n if (!inertSubroot) {\n this._inertManager.setInert(node, true);\n inertSubroot = this._inertManager.getInertRoot(node);\n }\n\n inertSubroot.managedNodes.forEach(function (savedInertNode) {\n this._manageNode(savedInertNode.node);\n }, this);\n }\n\n /**\n * Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_onMutation',\n value: function _onMutation(records, self) {\n records.forEach(function (record) {\n var target = /** @type {!HTMLElement} */record.target;\n if (record.type === 'childList') {\n // Manage added nodes\n slice.call(record.addedNodes).forEach(function (node) {\n this._makeSubtreeUnfocusable(node);\n }, this);\n\n // Un-manage removed nodes\n slice.call(record.removedNodes).forEach(function (node) {\n this._unmanageSubtree(node);\n }, this);\n } else if (record.type === 'attributes') {\n if (record.attributeName === 'tabindex') {\n // Re-initialise inert node if tabindex changes\n this._manageNode(target);\n } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n // If a new inert root is added, adopt its managed nodes and make sure it knows about the\n // already managed nodes from this inert subroot.\n this._adoptInertRoot(target);\n var inertSubroot = this._inertManager.getInertRoot(target);\n this._managedNodes.forEach(function (managedNode) {\n if (target.contains(managedNode.node)) {\n inertSubroot._manageNode(managedNode.node);\n }\n });\n }\n }\n }, this);\n }\n }, {\n key: 'managedNodes',\n get: function get() {\n return new Set(this._managedNodes);\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'hasSavedAriaHidden',\n get: function get() {\n return this._savedAriaHidden !== null;\n }\n\n /** @param {?string} ariaHidden */\n\n }, {\n key: 'savedAriaHidden',\n set: function set(ariaHidden) {\n this._savedAriaHidden = ariaHidden;\n }\n\n /** @return {?string} */\n ,\n get: function get() {\n return this._savedAriaHidden;\n }\n }]);\n\n return InertRoot;\n }();\n\n /**\n * `InertNode` initialises and manages a single inert node.\n * A node is inert if it is a descendant of one or more inert root elements.\n *\n * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n * is intrinsically focusable or not.\n *\n * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n * or removes the `tabindex` attribute if the element is intrinsically focusable.\n */\n\n\n var InertNode = function () {\n /**\n * @param {!Node} node A focusable element to be made inert.\n * @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n */\n function InertNode(node, inertRoot) {\n _classCallCheck(this, InertNode);\n\n /** @type {!Node} */\n this._node = node;\n\n /** @type {boolean} */\n this._overrodeFocusMethod = false;\n\n /**\n * @type {!Set<!InertRoot>} The set of descendant inert roots.\n * If and only if this set becomes empty, this node is no longer inert.\n */\n this._inertRoots = new Set([inertRoot]);\n\n /** @type {?number} */\n this._savedTabIndex = null;\n\n /** @type {boolean} */\n this._destroyed = false;\n\n // Save any prior tabindex info and make this node untabbable\n this.ensureUntabbable();\n }\n\n /**\n * Call this whenever this object is about to become obsolete.\n * This makes the managed node focusable again and deletes all of the previously stored state.\n */\n\n\n _createClass(InertNode, [{\n key: 'destructor',\n value: function destructor() {\n this._throwIfDestroyed();\n\n if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */this._node;\n if (this._savedTabIndex !== null) {\n element.setAttribute('tabindex', this._savedTabIndex);\n } else {\n element.removeAttribute('tabindex');\n }\n\n // Use `delete` to restore native focus method.\n if (this._overrodeFocusMethod) {\n delete element.focus;\n }\n }\n\n // See note in InertRoot.destructor for why we cast these nulls to ANY.\n this._node = /** @type {?} */null;\n this._inertRoots = /** @type {?} */null;\n this._destroyed = true;\n }\n\n /**\n * @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n * If the object has been destroyed, any attempt to access it will cause an exception.\n */\n\n }, {\n key: '_throwIfDestroyed',\n\n\n /**\n * Throw if user tries to access destroyed InertNode.\n */\n value: function _throwIfDestroyed() {\n if (this.destroyed) {\n throw new Error('Trying to access destroyed InertNode');\n }\n }\n\n /** @return {boolean} */\n\n }, {\n key: 'ensureUntabbable',\n\n\n /** Save the existing tabindex value and make the node untabbable and unfocusable */\n value: function ensureUntabbable() {\n if (this.node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var element = /** @type {!HTMLElement} */this.node;\n if (matches.call(element, _focusableElementsString)) {\n if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {\n return;\n }\n\n if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n }\n element.setAttribute('tabindex', '-1');\n if (element.nodeType === Node.ELEMENT_NODE) {\n element.focus = function () {};\n this._overrodeFocusMethod = true;\n }\n } else if (element.hasAttribute('tabindex')) {\n this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;\n element.removeAttribute('tabindex');\n }\n }\n\n /**\n * Add another inert root to this inert node's set of managing inert roots.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'addInertRoot',\n value: function addInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots.add(inertRoot);\n }\n\n /**\n * Remove the given inert root from this inert node's set of managing inert roots.\n * If the set of managing inert roots becomes empty, this node is no longer inert,\n * so the object should be destroyed.\n * @param {!InertRoot} inertRoot\n */\n\n }, {\n key: 'removeInertRoot',\n value: function removeInertRoot(inertRoot) {\n this._throwIfDestroyed();\n this._inertRoots['delete'](inertRoot);\n if (this._inertRoots.size === 0) {\n this.destructor();\n }\n }\n }, {\n key: 'destroyed',\n get: function get() {\n return (/** @type {!InertNode} */this._destroyed\n );\n }\n }, {\n key: 'hasSavedTabIndex',\n get: function get() {\n return this._savedTabIndex !== null;\n }\n\n /** @return {!Node} */\n\n }, {\n key: 'node',\n get: function get() {\n this._throwIfDestroyed();\n return this._node;\n }\n\n /** @param {?number} tabIndex */\n\n }, {\n key: 'savedTabIndex',\n set: function set(tabIndex) {\n this._throwIfDestroyed();\n this._savedTabIndex = tabIndex;\n }\n\n /** @return {?number} */\n ,\n get: function get() {\n this._throwIfDestroyed();\n return this._savedTabIndex;\n }\n }]);\n\n return InertNode;\n }();\n\n /**\n * InertManager is a per-document singleton object which manages all inert roots and nodes.\n *\n * When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n * property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n * is created for each such node, via the `_managedNodes` map.\n */\n\n\n var InertManager = function () {\n /**\n * @param {!Document} document\n */\n function InertManager(document) {\n _classCallCheck(this, InertManager);\n\n if (!document) {\n throw new Error('Missing required argument; InertManager needs to wrap a document.');\n }\n\n /** @type {!Document} */\n this._document = document;\n\n /**\n * All managed nodes known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertNode>}\n */\n this._managedNodes = new Map();\n\n /**\n * All inert roots known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertRoot>}\n */\n this._inertRoots = new Map();\n\n /**\n * Observer for mutations on `document.body`.\n * @type {!MutationObserver}\n */\n this._observer = new MutationObserver(this._watchForInert.bind(this));\n\n // Add inert style.\n addInertStyle(document.head || document.body || document.documentElement);\n\n // Wait for document to be loaded.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n } else {\n this._onDocumentLoaded();\n }\n }\n\n /**\n * Set whether the given element should be an inert root or not.\n * @param {!HTMLElement} root\n * @param {boolean} inert\n */\n\n\n _createClass(InertManager, [{\n key: 'setInert',\n value: function setInert(root, inert) {\n if (inert) {\n if (this._inertRoots.has(root)) {\n // element is already inert\n return;\n }\n\n var inertRoot = new InertRoot(root, this);\n root.setAttribute('inert', '');\n this._inertRoots.set(root, inertRoot);\n // If not contained in the document, it must be in a shadowRoot.\n // Ensure inert styles are added there.\n if (!this._document.body.contains(root)) {\n var parent = root.parentNode;\n while (parent) {\n if (parent.nodeType === 11) {\n addInertStyle(parent);\n }\n parent = parent.parentNode;\n }\n }\n } else {\n if (!this._inertRoots.has(root)) {\n // element is already non-inert\n return;\n }\n\n var _inertRoot = this._inertRoots.get(root);\n _inertRoot.destructor();\n this._inertRoots['delete'](root);\n root.removeAttribute('inert');\n }\n }\n\n /**\n * Get the InertRoot object corresponding to the given inert root element, if any.\n * @param {!Node} element\n * @return {!InertRoot|undefined}\n */\n\n }, {\n key: 'getInertRoot',\n value: function getInertRoot(element) {\n return this._inertRoots.get(element);\n }\n\n /**\n * Register the given InertRoot as managing the given node.\n * In the case where the node has a previously existing inert root, this inert root will\n * be added to its set of inert roots.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {!InertNode} inertNode\n */\n\n }, {\n key: 'register',\n value: function register(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (inertNode !== undefined) {\n // node was already in an inert subtree\n inertNode.addInertRoot(inertRoot);\n } else {\n inertNode = new InertNode(node, inertRoot);\n }\n\n this._managedNodes.set(node, inertNode);\n\n return inertNode;\n }\n\n /**\n * De-register the given InertRoot as managing the given inert node.\n * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n * node from the InertManager's set of managed nodes if it is destroyed.\n * If the node is not currently managed, this is essentially a no-op.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n */\n\n }, {\n key: 'deregister',\n value: function deregister(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n if (!inertNode) {\n return null;\n }\n\n inertNode.removeInertRoot(inertRoot);\n if (inertNode.destroyed) {\n this._managedNodes['delete'](node);\n }\n\n return inertNode;\n }\n\n /**\n * Callback used when document has finished loading.\n */\n\n }, {\n key: '_onDocumentLoaded',\n value: function _onDocumentLoaded() {\n // Find all inert roots in document and make them actually inert.\n var inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, this);\n\n // Comment this out to use programmatic API only.\n this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });\n }\n\n /**\n * Callback used when mutation observer detects attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n\n }, {\n key: '_watchForInert',\n value: function _watchForInert(records, self) {\n var _this = this;\n records.forEach(function (record) {\n switch (record.type) {\n case 'childList':\n slice.call(record.addedNodes).forEach(function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n var inertElements = slice.call(node.querySelectorAll('[inert]'));\n if (matches.call(node, '[inert]')) {\n inertElements.unshift(node);\n }\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, _this);\n }, _this);\n break;\n case 'attributes':\n if (record.attributeName !== 'inert') {\n return;\n }\n var target = /** @type {!HTMLElement} */record.target;\n var inert = target.hasAttribute('inert');\n _this.setInert(target, inert);\n break;\n }\n }, this);\n }\n }]);\n\n return InertManager;\n }();\n\n /**\n * Recursively walk the composed tree from |node|.\n * @param {!Node} node\n * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,\n * before descending into child nodes.\n * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n */\n\n\n function composedTreeWalk(node, callback, shadowRootAncestor) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n var element = /** @type {!HTMLElement} */node;\n if (callback) {\n callback(element);\n }\n\n // Descend into node:\n // If it has a ShadowRoot, ignore all child elements - these will be picked\n // up by the <content> or <shadow> elements. Descend straight into the\n // ShadowRoot.\n var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;\n if (shadowRoot) {\n composedTreeWalk(shadowRoot, callback, shadowRoot);\n return;\n }\n\n // If it is a <content> element, descend into distributed elements - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'content') {\n var content = /** @type {!HTMLContentElement} */element;\n // Verifies if ShadowDom v0 is supported.\n var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n for (var i = 0; i < distributedNodes.length; i++) {\n composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n }\n return;\n }\n\n // If it is a <slot> element, descend into assigned nodes - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n if (element.localName == 'slot') {\n var slot = /** @type {!HTMLSlotElement} */element;\n // Verify if ShadowDom v1 is supported.\n var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];\n for (var _i = 0; _i < _distributedNodes.length; _i++) {\n composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n }\n return;\n }\n }\n\n // If it is neither the parent of a ShadowRoot, a <content> element, a <slot>\n // element, nor a <shadow> element recurse normally.\n var child = node.firstChild;\n while (child != null) {\n composedTreeWalk(child, callback, shadowRootAncestor);\n child = child.nextSibling;\n }\n }\n\n /**\n * Adds a style element to the node containing the inert specific styles\n * @param {!Node} node\n */\n function addInertStyle(node) {\n if (node.querySelector('style#inert-style, link#inert-style')) {\n return;\n }\n var style = document.createElement('style');\n style.setAttribute('id', 'inert-style');\n style.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + ' user-select: none;\\n' + '}\\n';\n node.appendChild(style);\n }\n\n if (!HTMLElement.prototype.hasOwnProperty('inert')) {\n /** @type {!InertManager} */\n var inertManager = new InertManager(document);\n\n Object.defineProperty(HTMLElement.prototype, 'inert', {\n enumerable: true,\n /** @this {!HTMLElement} */\n get: function get() {\n return this.hasAttribute('inert');\n },\n /** @this {!HTMLElement} */\n set: function set(inert) {\n inertManager.setInert(this, inert);\n }\n });\n }\n})();\n", "/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-env browser */\r\nimport 'wicg-inert';\r\n\r\ntype HTMLElementWithInert = {\r\n inert: boolean,\r\n} & HTMLElement;\r\n\r\nconst hideModal = (modal: string, sender: Element, callback = () => { }): void => {\r\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\r\n if (modalView) {\r\n modalView.classList.remove('modal-view--visible');\r\n modalView.inert = true;\r\n const page = document.querySelector('.page') as HTMLElementWithInert;\r\n if (page) {\r\n page.classList.remove('page--blur');\r\n page.inert = false;\r\n }\r\n document.querySelector('body')?.classList.remove('body--no-scroll');\r\n (sender as HTMLElement).focus();\r\n sender.setAttribute('aria-expanded', 'false');\r\n callback();\r\n }\r\n};\r\n\r\nconst showModal = (\r\n modal: string, sender: Element, hideCallback = (): void => { }, closeable = true,\r\n): ExtendedCleanUpPair[] => {\r\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\r\n const cleanUp: ExtendedCleanUpPair[] = [];\r\n if (modalView) {\r\n modalView.classList.add('modal-view--visible');\r\n modalView.inert = false;\r\n const page = document.querySelector('.page') as HTMLElementWithInert;\r\n if (page) {\r\n page.classList.add('page--blur');\r\n page.inert = true;\r\n }\r\n document.querySelector('body')?.classList.add('body--no-scroll');\r\n sender.setAttribute('aria-expanded', 'true');\r\n\r\n modalView.focus();\r\n\r\n const clickEvent = (event: Event) => {\r\n if (event.target === modalView) {\r\n hideModal(modal, sender, hideCallback);\r\n }\r\n };\r\n\r\n const keyEvent = (event: Event) => {\r\n if ((event as KeyboardEvent).key === 'Escape') {\r\n hideModal(modal, sender, hideCallback);\r\n }\r\n };\r\n\r\n if (closeable) {\r\n modalView.addEventListener('click', clickEvent);\r\n window.addEventListener('keyup', keyEvent);\r\n\r\n cleanUp.push({\r\n element: modalView,\r\n clickEvent,\r\n });\r\n\r\n cleanUp.push({\r\n element: window,\r\n keyUpEvent: keyEvent,\r\n });\r\n }\r\n }\r\n return cleanUp;\r\n};\r\n\r\nexport {\r\n hideModal,\r\n showModal,\r\n};\r\n", "/* eslint-disable no-param-reassign */\r\n/* eslint-env browser */\r\nimport ready from '../components/ready';\r\nimport {\r\n setResponsiveNav,\r\n setResponsiveToggle, setCopyToClipboard,\r\n} from '../components/nav';\r\nimport copyHexCode from '../components/copy-hex-code';\r\nimport { isElementWithClassNameInEventPath, setMetaThemeColor, setHorizontalScroll } from '../components/helpers';\r\nimport { setResponsiveTable } from '../components/table';\r\nimport { setTabs } from '../components/tabs';\r\nimport { setContentToggle } from '../components/content-toggle';\r\nimport {\r\n closeAllContentTogglesInToolbar,\r\n contentToggleEdgeHandling,\r\n findToolbar,\r\n lockBodyScroll,\r\n unlockBodyScroll,\r\n} from '../components/toolbar';\r\nimport { horizontalScrollButtonNext, horizontalScrollButtonPrevious } from '../components/horizontal-scroll-btn';\r\nimport { setupAutoExpand } from '../components/text-area';\r\nimport { charCounter } from '../components/char-counter';\r\nimport { dropdownIconToggle } from '../components/form';\r\nimport { stepperLabelsCenter } from '../components/stepper';\r\nimport { showModal, hideModal } from '../components/modal-view';\r\n\r\nlet windowInnerWidth = 0;\r\n\r\nready(() => {\r\n const tabbedContent = document.querySelectorAll('.tabbed-content');\r\n const tabbedObjects: ITabbedObject[] = [];\r\n tabbedContent.forEach((tab) => tabbedObjects.push({\r\n domElement: tab,\r\n rendered: false,\r\n }));\r\n setTabs(tabbedObjects);\r\n setMetaThemeColor();\r\n\r\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\r\n navElements.forEach((n) => setResponsiveNav(navElements, n));\r\n setResponsiveToggle(navElements);\r\n\r\n // Textarea input\r\n const textarea = document.getElementById(\"autoexpand\") as HTMLTextAreaElement | null;\r\n setupAutoExpand(textarea);\r\n window.onload = function () {\r\n setupAutoExpand(textarea);\r\n };\r\n\r\n // Dropdown box icon toggle\r\n const dropDownElements: NodeListOf<HTMLElement> = document.querySelectorAll('.form__field select, .form__field__combo-box__field');\r\n dropDownElements.forEach((element) => {\r\n dropdownIconToggle(element);\r\n });\r\n\r\n // Find alle copy-to-clipboard elementer\r\n const ctc = document.querySelectorAll('.copy-to-clipboard');\r\n ctc.forEach((element) => setCopyToClipboard(element as HTMLElement, document.querySelector('html')?.getAttribute('lang') === 'en' ? 'Hexcode copied!' : 'Hexkode kopieret!'));\r\n copyHexCode();\r\n\r\n //const toggles = document.querySelectorAll('.box .content-toggle__content, .profile-header .content-toggle__content, .design-documentation .content-toggle__content');\r\n const toggles = document.querySelectorAll('.content-toggle__content:not(.toolbar .content-toggle__content)');\r\n toggles.forEach((toggle) => {\r\n setContentToggle(toggle);\r\n });\r\n\r\n // Hortizontal scroll buttons\r\n const scrollButtonsNext = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-next');\r\n const scrollButtonsPrevious = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-previous');\r\n horizontalScrollButtonNext(scrollButtonsNext);\r\n horizontalScrollButtonPrevious(scrollButtonsPrevious);\r\n\r\n const horizontalScroll = document.querySelectorAll('.horizontal-scroll');\r\n horizontalScroll.forEach((hs) => {\r\n setHorizontalScroll(hs as HTMLElement);\r\n window.addEventListener('resize', () => {\r\n setHorizontalScroll(hs as HTMLElement);\r\n });\r\n });\r\n\r\n const switchSegments = document.querySelectorAll('.switch__segment');\r\n switchSegments.forEach((switchSegment) => {\r\n switchSegment.addEventListener('click', () => {\r\n const horizontalScrollTabbed = document.querySelectorAll('.horizontal-scroll');\r\n horizontalScrollTabbed.forEach((hsTabbed) => {\r\n setHorizontalScroll(hsTabbed as HTMLElement);\r\n });\r\n });\r\n });\r\n\r\n window.addEventListener('load', () => {\r\n windowInnerWidth = window.innerWidth;\r\n });\r\n\r\n window.addEventListener('resize', () => {\r\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\r\n windowInnerWidth = window.innerWidth;\r\n navElements.forEach((n) => setResponsiveNav(navElements, n));\r\n setTabs(tabbedObjects);\r\n }\r\n });\r\n\r\n // Omnibus header mobile scroll\r\n /* const topBar = document.querySelector('.omnibus-header__mobile-scroll'); \r\n window.addEventListener('scroll', function() {\r\n if (topBar) {\r\n if (window.scrollY > 70) {\r\n topBar.classList.add('omnibus-header__mobile-scroll--show'); \r\n topBar.classList.remove('omnibus-header__mobile-scroll--hide');\r\n } else {\r\n topBar.classList.remove('omnibus-header__mobile-scroll--show'); \r\n topBar.classList.add('omnibus-header__mobile-scroll--hide'); \r\n }\r\n }\r\n }); */\r\n\r\n // Modal view for Omnibus \r\n const modalsBtns = document.querySelectorAll('[data-modal]');\r\n modalsBtns.forEach((button) => {\r\n const modalId = button.getAttribute('data-modal') as string;\r\n const modal = document.getElementById(modalId);\r\n const closeBtn = modal?.querySelector('.modal-view__close');\r\n closeBtn?.addEventListener('click', () => {\r\n hideModal(modalId, button);\r\n });\r\n button.addEventListener('click', () => {\r\n showModal(modalId, button);\r\n });\r\n });\r\n\r\n // Search for Omnibus \r\n const searchInputs = document.querySelectorAll<HTMLFormElement>('.nav__search');\r\n searchInputs.forEach((form) => {\r\n form.addEventListener('submit', (event) => {\r\n event.preventDefault();\r\n const input = form.querySelector('input[type=\"search\"]');\r\n if (input) {\r\n const inputValue = (input as HTMLInputElement).value;\r\n const redirectURL = `./soegning#?cludoquery=${encodeURIComponent(inputValue)}&cludoDomainName=https://omnibus.au.dk/&cludopage=1&cludorefurl=https%3A%2F%2Fomnibus.au.dk%2F&cludorefpt=Omnibus%20-%20Universitetsavisen%20p\u00E5%20Aarhus%20Universitet&cludoinputtype=standard`;\r\n console.log(inputValue);\r\n window.location.href = redirectURL;\r\n }\r\n });\r\n });\r\n\r\n // Logo language switch for Omnibus\r\n const logo = document.querySelector('.omnibus-header__logo-titel');\r\n const htmlLang = document.querySelector('html')?.getAttribute('lang');\r\n if (logo) {\r\n if (htmlLang === 'da') {\r\n logo.setAttribute('src', '/fileadmin/logos/Omnibus-logo.png');\r\n } else {\r\n logo.setAttribute('src', '/fileadmin/logos/Omnibus-logo-en.png');\r\n }\r\n }\r\n});\r\n\r\n\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n const containers = document.querySelectorAll('.news-story__normal');\r\n \r\n containers.forEach(container => {\r\n const imageContainer = container.querySelector('.news-story__image-container');\r\n const img = imageContainer?.querySelector('img.news-story__image');\r\n\r\n if (img instanceof HTMLImageElement) {\r\n updateImageSize(imageContainer, img);\r\n }\r\n });\r\n});\r\n\r\nfunction updateImageSize(imageContainer, img) {\r\n const containerWidth = imageContainer.offsetWidth;\r\n const containerHeight = containerWidth * (3 / 4); // Aspect ratio between 3:2 and 4:3\r\n img.style.width = containerWidth + 'px';\r\n img.style.height = containerHeight + 'px';\r\n\r\n const src = img.src;\r\n const src2x = src.replace('.jpg', '@2x.jpg').replace('.png', '@2x.png');\r\n\r\n // Check if the 2x image exists\r\n fetch(src2x, { method: 'HEAD' })\r\n .then(response => {\r\n if (response.ok) {\r\n img.setAttribute('srcset', `${src} 1x, ${src2x} 1x`);\r\n } else {\r\n img.setAttribute('srcset', `${src} 1x`);\r\n }\r\n })\r\n .catch(() => {\r\n img.setAttribute('srcset', `${src} 1x`);\r\n });\r\n\r\n // Center the image horizontally and vertically\r\n imageContainer.style.display = 'flex';\r\n imageContainer.style.justifyContent = 'center';\r\n imageContainer.style.alignItems = 'center';\r\n}\r\n\r\n// Update image size on window resize\r\nwindow.addEventListener('resize', () => {\r\n const containers = document.querySelectorAll('.news-story__normal');\r\n \r\n containers.forEach(container => {\r\n const imageContainer = container.querySelector('.news-story__image-container');\r\n const img = imageContainer?.querySelector('img.news-story__image');\r\n\r\n if (img instanceof HTMLImageElement) {\r\n updateImageSize(imageContainer, img);\r\n }\r\n });\r\n});\r\n"],
5
5
  "mappings": "MACA,IAAMA,EAASC,GAAyB,CAClC,SAAS,aAAe,UAC1BA,EAAG,EAEH,SAAS,iBAAiB,mBAAoBA,CAAE,CAEpD,EAEOC,EAAQF,ECNf,IAAMG,EAAmBC,GAAsB,CAE7C,UAAU,UAAU,UAAUA,CAAG,EAAE,KAAK,IAAM,QAAQ,IAAI,GAAGA,CAAG,uBAAuB,CAAC,CAC1F,EAEMC,EAAoC,CAACC,EAAmBC,IAA+B,CAC3F,IAAIC,EAAQ,GAEZ,OADaF,EAAM,aAAa,EAC3B,QAASG,G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C,aAAe,kBACfC,EAAgBF,EAAgBC,CAAG,CAE3C,CAAC,CACH,CAAC",
6
6
  "names": ["ready", "fn", "ready_default", "copyToClipboard", "str", "isElementWithClassNameInEventPath", "event", "className", "found", "p", "setMetaThemeColor", "body", "bgColor", "existingMeta", "meta", "getBaseFontSize", "convertRemToPixels", "rem", "isViewportBelow", "mediaQuery", "viewportWidth", "mediaQueryValue", "overflowsX", "element", "setHorizontalScroll", "element", "content", "overflowsX", "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", "setClickMessage", "text", "copyElement", "clickElement", "ctcThis", "listener", "copyToClipboard", "ctcThisMessage", "setCopyToClipboard", "element", "btn", "copyHexCode", "ctc", "colorElements", "button", "color", "computedStyle", "hexColor", "rgbToHex", "copyToClipboard", "rgb", "rgbArray", "hex", "value", "hexValue", "copy_hex_code_default", "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", "setBPModiferClass", "isViewportBelow", "event", "eventTarget", "doesNotContainContent", "doesNotContainButton", "doesNotContainSpan", "clickEvent", "ariaExpanded", "cc", "btnClick", "horizontalScrollButtonNext", "nextButtons", "nextButton", "topElem", "scrollElements", "switch__segments", "scrollElement", "scrollAmount", "disableButton", "activateButton", "switch__segment", "horizontalScrollButtonPrevious", "previousButtons", "previousButton", "button", "setupAutoExpand", "textarea", "event", "parentNode", "dropdownIconToggle", "element", "dropdownInactive", "event", "handleOutsideClick", "_createClass", "defineProperties", "target", "props", "descriptor", "Constructor", "protoProps", "staticProps", "_classCallCheck", "instance", "slice", "matches", "_focusableElementsString", "InertRoot", "rootElement", "inertManager", "inertNode", "startNode", "_this2", "composedTreeWalk", "node", "activeElement", "root", "element", "_this3", "inertSubroot", "savedInertNode", "records", "self", "record", "managedNode", "ariaHidden", "InertNode", "inertRoot", "tabIndex", "InertManager", "document", "addInertStyle", "inert", "parent", "_inertRoot", "inertElements", "inertElement", "_this", "callback", "shadowRootAncestor", "shadowRoot", "content", "distributedNodes", "i", "slot", "_distributedNodes", "_i", "child", "style", "hideModal", "modal", "sender", "callback", "modalView", "page", "showModal", "hideCallback", "closeable", "cleanUp", "clickEvent", "event", "keyEvent", "windowInnerWidth", "ready_default", "tabbedContent", "tabbedObjects", "tab", "setTabs", "setMetaThemeColor", "navElements", "n", "setResponsiveNav", "setResponsiveToggle", "textarea", "setupAutoExpand", "element", "dropdownIconToggle", "setCopyToClipboard", "copy_hex_code_default", "toggle", "setContentToggle", "scrollButtonsNext", "scrollButtonsPrevious", "horizontalScrollButtonNext", "horizontalScrollButtonPrevious", "hs", "setHorizontalScroll", "switchSegment", "hsTabbed", "button", "modalId", "hideModal", "showModal", "form", "event", "input", "inputValue", "redirectURL", "logo", "htmlLang", "container", "imageContainer", "img", "updateImageSize", "containerWidth", "containerHeight", "src", "src2x", "response"]
7
7
  }
@@ -182,7 +182,7 @@ function updateImageSize(imageContainer, img) {
182
182
  fetch(src2x, { method: 'HEAD' })
183
183
  .then(response => {
184
184
  if (response.ok) {
185
- img.setAttribute('srcset', `${src} 1x, ${src2x} 2x`);
185
+ img.setAttribute('srcset', `${src} 1x, ${src2x} 1x`);
186
186
  } else {
187
187
  img.setAttribute('srcset', `${src} 1x`);
188
188
  }