@aarhus-university/au-designsystem-delphinus 1.8.9 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/js/app.js.map +1 -1
- package/public/js/demo.js.map +1 -1
- package/public/projects/bachelor-applications/js/app.js.map +1 -1
- package/public/projects/course-catalogue/js/app.js.map +1 -1
- package/public/projects/medarbejdere/js/app.js.map +1 -1
- package/public/projects/mitstudie/js/app.js.map +1 -1
- package/public/projects/omnibus/js/app.js.map +1 -1
- package/public/projects/typo3/js/app.js.map +1 -1
package/package.json
CHANGED
package/public/js/app.js.map
CHANGED
|
@@ -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/table.ts", "../../source/js/components/tabs.ts", "../../source/js/components/content-toggle.ts", "../../source/js/components/toolbar.ts", "../../source/js/components/horizontal-scroll-btn.ts", "../../source/js/components/text-area.ts", "../../source/js/components/char-counter.ts", "../../source/js/components/stepper.ts", "../../node_modules/wicg-inert/dist/inert.esm.js", "../../source/js/components/modal-view.ts", "../../source/js/production/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 import/prefer-default-export */\r\nconst setResponsiveTable = (table: Element): void => {\r\n const head = table.querySelector('thead');\r\n const body = table.querySelector('tbody');\r\n const foot = table.querySelector('tfoot');\r\n\r\n if (head) {\r\n const headers: string[] = [];\r\n const ths = head.querySelectorAll('th');\r\n ths.forEach((h) => {\r\n if (!h.classList.contains('table__cell--self-explanatory')) {\r\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\r\n } else {\r\n headers.push(''); // If header is self explanatory we do not add it\r\n }\r\n });\r\n\r\n const rowContainers: HTMLTableSectionElement[] = [];\r\n // Table elements that possibly contains <tr>'s\r\n if (body) {\r\n rowContainers.push(body);\r\n }\r\n if (foot) {\r\n rowContainers.push(foot);\r\n }\r\n\r\n rowContainers.forEach((rc) => {\r\n const rows = rc.querySelectorAll('tr');\r\n rows.forEach((tr) => {\r\n const cells = tr.querySelectorAll('td, th');\r\n cells.forEach((cell, i) => {\r\n if (headers[i]) {\r\n // if header is self explanatory we skip (value of array index is '' which is falsy)\r\n cell.setAttribute('data-label', headers[i]);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n};\r\n\r\nfunction runDemotableButtons(buttons: NodeListOf<Element>, rows: NodeListOf<HTMLTableRowElement>) {\r\n buttons.forEach((button) => {\r\n button.addEventListener('click', () => {\r\n if (button.id === 'demo-button--attention') {\r\n rows.forEach((row) => {\r\n if (row.id === 'table__row--flash-attention') {\r\n row.classList.remove('table__row--flash-transparent');\r\n row.classList.add('table__row--flash-attention');\r\n changeBackgroundColor(rows);\r\n }\r\n });\r\n }\r\n if (button.id === 'demo-button--confirm') {\r\n rows.forEach((row) => {\r\n if (row.id === 'table__row--flash-confirm') {\r\n row.classList.remove('table__row--flash-transparent');\r\n row.classList.add('table__row--flash-confirm');\r\n changeBackgroundColor(rows);\r\n }\r\n });\r\n }\r\n if (button.id === 'demo-button--warning') {\r\n rows.forEach((row) => {\r\n if (row.id === 'table__row--flash-warning') {\r\n row.classList.remove('table__row--flash-transparent');\r\n row.classList.add('table__row--flash-warning');\r\n changeBackgroundColor(rows);\r\n }\r\n });\r\n }\r\n });\r\n });\r\n}\r\n\r\n\r\nfunction changeBackgroundColor(rows: NodeListOf<HTMLTableRowElement>) {\r\n setTimeout(() => {\r\n rows.forEach((row: HTMLTableRowElement) => {\r\n if (row.classList.contains('table__row--flash-attention')) {\r\n row.classList.remove('table__row--flash-attention')\r\n }\r\n if (row.classList.contains('table__row--flash-confirm')) {\r\n row.classList.remove('table__row--flash-confirm')\r\n }\r\n if (row.classList.contains('table__row--flash-warning')) {\r\n row.classList.remove('table__row--flash-warning')\r\n }\r\n row.classList.add('table__row--flash-transparent');\r\n });\r\n }, 1000);\r\n}\r\n\r\nexport {\r\n setResponsiveTable,\r\n runDemotableButtons,\r\n changeBackgroundColor\r\n};\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", "/* eslint-disable max-len */\r\nimport { convertRemToPixels, isElementWithClassNameInEventPath, isViewportBelow } from './helpers';\r\n\r\nconst lockBodyScroll = (): void => {\r\n const body = document.querySelector('body');\r\n if (isViewportBelow('--bp-medium') || isViewportBelow('--bp-low-height')) {\r\n body?.classList.add('body--no-scroll');\r\n }\r\n};\r\n\r\nconst unlockBodyScroll = (): void => {\r\n const body = document.querySelector('body');\r\n body?.classList.remove('body--no-scroll');\r\n};\r\n\r\n/* eslint-env browser */\r\nconst closeAllContentTogglesInToolbar = (toolbar: HTMLElement): void => {\r\n const contentToggles = toolbar.querySelectorAll('.content-toggle__toggle');\r\n contentToggles.forEach((toggle) => {\r\n const content = toggle.parentElement?.querySelector('.content-toggle__content');\r\n toggle.setAttribute('aria-expanded', 'false');\r\n content?.setAttribute('hidden', 'hidden');\r\n });\r\n};\r\n\r\nconst setOverflow = (toolbarElement: Element): void => {\r\n if (!toolbarElement.classList.contains('toolbar--no-collapse')) {\r\n toolbarElement.classList.remove('toolbar--toggled');\r\n }\r\n toolbarElement.classList.remove('toolbar--fully-overflown');\r\n toolbarElement.classList.remove('toolbar--has-popout');\r\n const toolbarItemsParent = toolbarElement.querySelector('.toolbar__items');\r\n const toolbarItems = toolbarItemsParent?.children as HTMLCollection;\r\n const isOverflownClass = 'toolbar__item--is-overflown';\r\n const hasOverflowClass = 'toolbar--has-overflow';\r\n let hasOverflown = false;\r\n\r\n let overflownCount = 0;\r\n const addOverflowClass = (item: HTMLElement, index: number) => {\r\n if (item) {\r\n const top = item.offsetTop;\r\n if (top > 25) {\r\n item.classList.add(isOverflownClass);\r\n toolbarElement.classList.add(hasOverflowClass);\r\n hasOverflown = true;\r\n overflownCount += 1;\r\n } else {\r\n item.classList.remove(isOverflownClass);\r\n }\r\n\r\n if (!hasOverflown) {\r\n toolbarElement.classList.remove(hasOverflowClass);\r\n } else if (index - 1 >= 0) {\r\n addOverflowClass(toolbarItems[index - 1] as HTMLElement, index - 1);\r\n }\r\n }\r\n };\r\n\r\n addOverflowClass(toolbarItems[toolbarItems.length - 1] as HTMLElement, toolbarItems.length - 1);\r\n\r\n if (overflownCount > 0 && overflownCount === toolbarItems.length) {\r\n toolbarElement.classList.add('toolbar--fully-overflown');\r\n }\r\n};\r\n\r\nconst setToolbarToggle = (toolbar: HTMLElement): ExtendedCleanUpPair[] => {\r\n const cleanUp: ExtendedCleanUpPair[] = [];\r\n const buttons = toolbar.querySelectorAll('.toolbar__toggle');\r\n buttons.forEach((button) => {\r\n const clickEvent = () => {\r\n button?.parentElement?.classList.toggle('toolbar--toggled');\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n if (ariaExpanded !== 'true') {\r\n const focusable = 'a.toolbar__item--is-overflown, button.toolbar__item--is-overflown, input.toolbar__item--is-overflown, select.toolbar__item--is-overflown, .toolbar__item--is-overflown a, .toolbar__item--is-overflown button, .toolbar__item--is-overflown input, .toolbar__item--is-overflown select';\r\n const firstWithOverflow = button?.parentElement?.querySelector(focusable) as HTMLElement;\r\n if (firstWithOverflow) {\r\n setTimeout(() => {\r\n firstWithOverflow.focus();\r\n }, 0);\r\n }\r\n }\r\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\r\n };\r\n\r\n cleanUp.push({\r\n element: button,\r\n clickEvent,\r\n });\r\n button.addEventListener('click', clickEvent);\r\n });\r\n return cleanUp;\r\n};\r\n\r\nconst setToolbar = (\r\n toolbar: HTMLElement,\r\n onCloseContentToggle: (toolbarElement: HTMLElement) => void,\r\n setOverflowOnly = true,\r\n): ExtendedCleanUpPair[] => {\r\n let cleanUp: ExtendedCleanUpPair[] = [];\r\n\r\n setOverflow(toolbar);\r\n onCloseContentToggle(toolbar);\r\n cleanUp = cleanUp.concat(setToolbarToggle(toolbar));\r\n\r\n if (!setOverflowOnly) {\r\n const bodyClickEvent = (event: Event) => {\r\n if (!(event.target as HTMLElement).classList.contains('content-toggle__toggle')\r\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'content-toggle__content')) {\r\n onCloseContentToggle(toolbar);\r\n }\r\n };\r\n\r\n const escKeyEvent = (event: Event) => {\r\n if ((event as KeyboardEvent).key === 'Escape') {\r\n if (event.target && (event.target as HTMLElement).getAttribute('type') !== 'search') {\r\n onCloseContentToggle(toolbar);\r\n }\r\n }\r\n };\r\n\r\n const body = document.querySelector('body');\r\n\r\n cleanUp.push({\r\n element: body as Element,\r\n clickEvent: bodyClickEvent,\r\n });\r\n\r\n cleanUp.push({\r\n element: window,\r\n keyUpEvent: escKeyEvent,\r\n });\r\n\r\n body?.addEventListener('click', bodyClickEvent);\r\n window.addEventListener('keyup', escKeyEvent);\r\n }\r\n\r\n return cleanUp;\r\n};\r\n\r\nconst findToolbar = (element: HTMLElement): HTMLElement => {\r\n const parent = element.parentElement;\r\n if (parent) {\r\n if (parent.classList.contains('toolbar')) {\r\n return parent;\r\n }\r\n return findToolbar(parent);\r\n }\r\n return element;\r\n};\r\n\r\nconst contentToggleEdgeHandling = (element: HTMLElement): void => {\r\n if (!isViewportBelow('--bp-medium') && !isViewportBelow('--bp-low-height')) {\r\n const allowedDistance = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--toolbar-popout-allowed-edge-distance').replace('rem,', ''), 10));\r\n const popoutX = parseInt(getComputedStyle(element).width.replace('px', ''), 10);\r\n const popoutWidth = element.getBoundingClientRect().x;\r\n\r\n const distance = document.body.offsetWidth - allowedDistance - popoutX - popoutWidth;\r\n\r\n if (distance < 0) {\r\n element.style.setProperty('--toolbar-popout-edge-overflow', `${distance}px`);\r\n }\r\n }\r\n};\r\n\r\nexport {\r\n setToolbar,\r\n setOverflow,\r\n findToolbar,\r\n closeAllContentTogglesInToolbar,\r\n contentToggleEdgeHandling,\r\n lockBodyScroll,\r\n unlockBodyScroll,\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 };", "function setupCharacterCount(\r\n element: HTMLElement,\r\n type: HTMLTextAreaElement | HTMLInputElement | null,\r\n length: string | null,\r\n countdown: HTMLElement | null,\r\n countMessageOverflow: HTMLElement | null\r\n ): void {\r\n let text = type?.value;\r\n let charCount = text?.length;\r\n if (type && text) {\r\n type.textContent = text;\r\n charCount = text?.length;\r\n if (charCount && countdown && countMessageOverflow) {\r\n if (length) {\r\n const lengthNumber = parseInt(length, 10);\r\n let remainingChars = lengthNumber - charCount;\r\n let absoluteValue = Math.abs(remainingChars);\r\n // Update span 2 with remaining number of chars\r\n if(countMessageOverflow.textContent) {\r\n countMessageOverflow.textContent = countMessageOverflow.textContent.replace(/\\d+/, String(absoluteValue));\r\n }\r\n // Update span 3 with remaining number of chars\r\n if(countdown.textContent) {\r\n countdown.textContent = countdown.textContent.replace(/\\d+/, String(absoluteValue));\r\n }\r\n // Adds overflow class if remaining chars < 0 \r\n if (remainingChars < 0) {\r\n element.classList.add('form__field__character-count--overflow');\r\n element.setAttribute(\"aria-invalid\", \"true\");\r\n }\r\n // Remove overflow class if remaining chars >= 0 \r\n if (remainingChars >= 0) {\r\n element.classList.remove('form__field__character-count--overflow');\r\n element.setAttribute(\"aria-invalid\", \"false\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function charCounter(element: HTMLElement | null): void { \r\n if (element) {\r\n const textArea = element.querySelector(\"textarea\");\r\n const input = element.querySelector(\"input\");\r\n const recommendedLength = element.getAttribute('data-recommended-length');\r\n const allowedLength = element.getAttribute('data-allowed-length');\r\n let countdown = element.querySelector('.form__field__character-count__info__count-down');\r\n let countMessageOverflow = element.querySelector('.form__field__character-count__info__overflow-count');\r\n\r\n // Textarea intial page load\r\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n\r\n // Input intial page load\r\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n\r\n // Update textarea on input\r\n textArea?.addEventListener('input', function() { \r\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n })\r\n\r\n // Update input field on input\r\n input?.addEventListener('input', function() { \r\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\r\n })\r\n }\r\n }\r\n\r\n export {\r\n charCounter,\r\n setupCharacterCount\r\n };", "// Centers stepper labels if they are 4 chars or less\r\nfunction stepperLabelsCenter(element: HTMLElement): void { \r\n if (element && element.textContent) {\r\n if (element.textContent.length <= 4) {\r\n element.style.textAlign = 'center';\r\n }\r\n }\r\n}\r\n\r\nexport {\r\n stepperLabelsCenter\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, runDemotableButtons, changeBackgroundColor } 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 { hideModal, showModal } 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 const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\r\n tables.forEach((table) => setResponsiveTable(table));\r\n\r\n // Attention highlight style for table rows\r\n const rows = document.querySelectorAll('.table__row--flash-attention, .table__row--flash-confirm, .table__row--flash-warning') as NodeListOf<HTMLTableRowElement>;\r\n changeBackgroundColor(rows);\r\n\r\n // Demo buttons to demonstrate attention, confirm and warning styles\r\n const demoTableButtons = document.querySelectorAll('#demo-button--attention, #demo-button--confirm, #demo-button--warning');\r\n runDemotableButtons(demoTableButtons, rows);\r\n\r\n // Progress bar animation\r\n const animationButtons = document.querySelectorAll('.button');\r\n const animatedProgressBars = document.querySelectorAll('.progress-bar__progress.progress-bar__progress--confirm.progress-bar__progress--transistion-from-start');\r\n animationButtons.forEach((button) => {\r\n button.addEventListener('click', () => {\r\n animatedProgressBars.forEach((progressBar) => {\r\n progressBar.classList.toggle('progress-bar__progress--transistion-from-start');\r\n });\r\n });\r\n });\r\n\r\n // Character counter for form input\r\n const elements = document.querySelectorAll('.form__field__character-count');\r\n elements.forEach((element) => {\r\n charCounter(element as HTMLElement);\r\n });\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 // Centers stepper labels when they are 4 chars or less\r\n const stepperLabels: NodeListOf<HTMLElement> = document.querySelectorAll('.stepper__item__label');\r\n stepperLabels.forEach((element) => {\r\n stepperLabelsCenter(element);\r\n });\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 // Kursuskatalog\r\n const togglesInToolbars = document.querySelectorAll('.toolbar .content-toggle__content');\r\n togglesInToolbars.forEach((toggle) => {\r\n setContentToggle(\r\n toggle,\r\n (popout: HTMLElement) => {\r\n contentToggleEdgeHandling(popout);\r\n lockBodyScroll();\r\n },\r\n (content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content)),\r\n (content: HTMLElement, button: HTMLButtonElement) => {\r\n const ariaExpanded = button.getAttribute('aria-expanded');\r\n const toolbar = findToolbar(content);\r\n if (ariaExpanded === 'true') {\r\n toolbar?.classList.add('toolbar--has-popout');\r\n } else {\r\n toolbar?.classList.remove('toolbar--has-popout');\r\n }\r\n\r\n content.addEventListener('click', (event: MouseEvent) => {\r\n if ((event.target as HTMLElement).classList.contains('toolbar__popout')\r\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {\r\n closeAllContentTogglesInToolbar(toolbar);\r\n unlockBodyScroll();\r\n }\r\n });\r\n },\r\n );\r\n });\r\n\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 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"],
|
|
4
|
+
"sourcesContent": ["/* eslint-env browser */\nconst ready = (fn: () => void): void => {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n};\n\nexport default ready;\n", "/* eslint-disable wrap-iife */\n/* eslint-disable import/prefer-default-export */\n/* eslint-env browser */\nconst copyToClipboard = (str: string): void => {\n // eslint-disable-next-line no-console\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\n};\n\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\n let found = false;\n const path = event.composedPath();\n path.forEach((p: EventTarget): void => {\n if ((p as HTMLElement).classList) {\n if ((p as HTMLElement).classList.contains(className)) {\n found = true;\n }\n }\n });\n return found;\n};\n\nconst setMetaThemeColor = (): void => {\n const body = document.querySelector('body');\n if (body) {\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\n if (existingMeta) {\n existingMeta.content = bgColor;\n } else {\n const meta = document.createElement('meta');\n meta.name = 'theme-color';\n meta.content = bgColor;\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n }\n};\n\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\n\n// eslint-disable-next-line max-len\nconst convertRemToPixels = (rem: number): number => rem * 16;\n\nconst isViewportBelow = (mediaQuery: string): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const mediaQueryValue = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue(mediaQuery).replace('rem', ''), 10));\n return viewportWidth < mediaQueryValue;\n};\n\nconst setScrollbarWidthVariable = (): void => {\n const scrollbarWidth = window.innerWidth - document.body.clientWidth;\n document.documentElement.style.setProperty('--vertical-scrollbar-width', `${scrollbarWidth}px`);\n};\n\nconst overflowsY = (element: HTMLElement): boolean => element.offsetHeight !== element.scrollHeight;\nconst overflowsX = (element: HTMLElement): boolean => element.offsetWidth !== element.scrollWidth;\n// eslint-disable-next-line max-len\nconst elementOverflows = (element: HTMLElement): boolean => overflowsY(element) || overflowsX(element);\n\nconst setHorizontalScroll = (element: HTMLElement): void => {\n // Checks if the element already contains no-overflow\n if (element.classList.contains('horizontal-scroll--no-overflow')) {\n element.classList.remove('horizontal-scroll--no-overflow');\n }\n\n // Defines of content of horizontal scroll \n let content = element.querySelector('.horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content');\n if (content === null && !content) {\n content = element.querySelector('.horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content');\n }\n\n // Checks if no-overflow should be added or not depending on content width\n if (content) {\n if (!overflowsX(content as HTMLElement)) {\n element.classList.add('horizontal-scroll--no-overflow');\n content?.removeAttribute('tabindex');\n } else {\n content?.setAttribute('tabindex', '0');\n }\n }\n};\n\nconst focusableSelector = 'a[href]:not([tabindex=\"-1\"]), area[href]:not([tabindex=\"-1\"]), input:not([disabled]):not([tabindex=\"-1\"]), select:not([disabled]):not([tabindex=\"-1\"]), textarea:not([disabled]):not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), iframe:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]), [contentEditable=true]:not([tabindex=\"-1\"])';\n\nexport {\n copyToClipboard,\n isElementWithClassNameInEventPath,\n getBaseFontSize,\n setMetaThemeColor,\n isViewportBelow,\n convertRemToPixels,\n setScrollbarWidthVariable,\n overflowsX,\n overflowsY,\n elementOverflows,\n setHorizontalScroll,\n focusableSelector,\n};\n", "/* eslint-env browser */\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\n\nconst findNav = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('nav')) {\n return parent;\n }\n return findNav(parent);\n }\n return element;\n};\n\n// eslint-disable-next-line max-len\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\n const navToggledClass = 'nav--toggled';\n navElements.forEach((n) => {\n const button = n.querySelector('.nav__toggle') as HTMLElement;\n if (n !== keepOpen) {\n if (n.classList.contains(navToggledClass)) {\n button.focus();\n button.setAttribute('aria-expanded', 'false');\n }\n n.classList.remove(navToggledClass);\n }\n });\n};\n\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\n const toggleMenu = (button: HTMLElement) => {\n const parent = findNav(button);\n // const hideItems: NodeListOf<HTMLElement> = parent.querySelectorAll('.nav__item');\n\n // // Only shows overflown elements when the menu is extended \n // hideItems.forEach(item => {\n // const currentDisplay = window.getComputedStyle(item).display;\n // if (!item.classList.contains('nav__item--is-overflown')) {\n // item.style.display = currentDisplay === 'none' ? 'inline-flex' : 'none';\n // }\n // });\n\n // // All elements get display: inline-flex when there is clicked outside of the button \n // const handleDocumentClick = (event: MouseEvent) => {\n // if (!parent.contains(event.target as Node)) {\n // hideItems.forEach(item => {\n // item.style.display = 'inline-flex';\n // });\n // }\n // };\n // document.body.addEventListener('click', handleDocumentClick);\n\n const navItems = parent.querySelector('.nav__items');\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\n navItems?.classList.add('nav__items--fadeout');\n const firstElement = navItems?.querySelector('.nav__item--is-overflown') as HTMLElement;\n if (firstElement) {\n firstElement.focus();\n }\n const transitionListener = () => {\n parent.classList.toggle('nav--toggled');\n navItems?.classList.remove('nav__items--fadeout');\n lastNavItem?.removeEventListener('transitionend', transitionListener);\n };\n lastNavItem?.addEventListener('transitionend', transitionListener);\n return parent;\n };\n\n const cleanUp: CleanUpPair[] = [];\n\n const toggle = document.querySelectorAll('.nav__toggle');\n toggle.forEach((button) => {\n const clickEvent = () => {\n const nav = toggleMenu(button as HTMLElement);\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n closeResponsiveNav(navElements, nav);\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n button.addEventListener('click', clickEvent);\n });\n\n return cleanUp;\n};\n\nconst setResponsiveNav = (\n navElements: NodeListOf<Element>,\n navElement: Element,\n): SetResponsiveNavCleanUp => {\n const navToggledClass = 'nav--toggled';\n const navItemsClass = 'nav__items';\n // gitlab #117\n navElement.classList.remove(navToggledClass);\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\n\n if (navItemsParent) {\n const navItems = navItemsParent.querySelectorAll('.nav__item');\n const isOverflownClass = 'nav__item--is-overflown';\n const hasOverflowClass = 'nav--has-overflow';\n const isActiveClass = 'nav__item--active';\n let hasOverflown = false;\n\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\n const nav = navItems[i] as HTMLElement;\n const top = nav.offsetTop;\n\n if (top > 0) {\n nav.classList.add(isOverflownClass);\n navElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n } else if (!nav.classList.contains(isActiveClass)) {\n nav.classList.remove(isOverflownClass);\n }\n }\n\n if (!hasOverflown) {\n navElement.classList.remove(hasOverflowClass);\n const isActive = navElement.querySelector(`.${isActiveClass}`);\n if (isActive) {\n isActive.classList.remove(isOverflownClass);\n }\n }\n }\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\n closeResponsiveNav(navElements);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n\n return {\n element: document.querySelector('body'),\n clickEvent: bodyClickEvent,\n };\n};\n\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\n const subNavClass = 'sub-nav--toggled';\n buttons.forEach((button) => {\n if (button !== keepOpen) {\n if (button?.parentElement?.classList.contains(subNavClass)) {\n (button as HTMLElement).focus();\n button.setAttribute('aria-expanded', 'false');\n }\n button?.parentElement?.classList.remove(subNavClass);\n }\n });\n};\n\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\n const subNavClass = 'sub-nav--toggled';\n const buttonClickEvent = () => {\n button?.parentElement?.classList.toggle(subNavClass);\n if (button?.parentElement?.classList.contains(subNavClass)) {\n button.setAttribute('aria-expanded', 'true');\n } else {\n button.setAttribute('aria-expanded', 'false');\n }\n closeSubNav(buttons, button);\n };\n\n button.addEventListener('click', buttonClickEvent);\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\n closeSubNav(buttons);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n return {\n buttonClickEvent,\n element: document.querySelector('body'),\n bodyClickEvent,\n };\n};\n\nconst setClickMessage = ((\n text: string,\n copyElement: Element,\n clickElement: Element | null,\n ctcThis: HTMLElement | null,\n listener: () => void,\n): void => {\n if (ctcThis && clickElement) {\n // Vi kopierer teksten til clipboard\n copyToClipboard(ctcThis.innerText);\n copyElement.classList.add('copy-to-clipboard--confirm');\n if (copyElement === clickElement) {\n copyElement.classList.add('copy-to-clipboard--done');\n }\n // Laver en span, der viser, at teksten er kopieret\n const ctcThisMessage = document.createElement('span');\n ctcThisMessage.classList.add('copy-to-clipboard__this__confirm-message');\n ctcThisMessage.innerText = text;\n ctcThis.appendChild(ctcThisMessage);\n\n // Efter 1,2 sekunder fjerner vi beskeden igen\n clickElement.removeEventListener('click', listener);\n setTimeout(() => {\n copyElement.classList.remove('copy-to-clipboard--confirm');\n ctcThisMessage.remove();\n clickElement.addEventListener('click', listener);\n }, 1200);\n }\n});\n\nconst setCopyToClipboard = (element: HTMLElement, text = 'Kopieret!'): void => {\n const ctcThis = <HTMLElement>element.querySelector('.copy-to-clipboard__this');\n // Hvis det er en knap, s\u00E5 s\u00E6tter vi click event p\u00E5 knappen\n if ((element as HTMLButtonElement).type === 'button') {\n const listener = (): void => {\n setClickMessage(text, element, element, ctcThis, listener);\n };\n element.addEventListener('click', listener);\n // Hvis det ikke er en knap, finder vi knappen \"inde i\" elementet\n } else {\n const btn = element.querySelector('.copy-to-clipboard__execute');\n const listener = (): void => {\n setClickMessage(text, element, btn, ctcThis, listener);\n };\n btn?.addEventListener('click', listener);\n }\n};\n\nconst setSearchToggle = (navSearch: Element, button: Element): void => {\n const toggleClass = 'nav__search--toggled';\n button.addEventListener('click', () => {\n if (navSearch.classList.contains(toggleClass)) {\n button.setAttribute('aria-expanded', 'false');\n navSearch.classList.remove(toggleClass);\n } else {\n button.setAttribute('aria-expanded', 'true');\n navSearch.classList.add(toggleClass);\n }\n });\n};\n\n\n\nexport {\n findNav,\n setResponsiveToggle,\n setResponsiveNav,\n setSubNavToggle,\n setCopyToClipboard,\n setSearchToggle,\n};\n", "/* eslint-env browser */\nimport { copyToClipboard } from './helpers';\n\nconst copyHexCode = (): void => {\n const ctc = document.querySelectorAll('.copy-to-clipboard');\n const colorElements = document.querySelectorAll('.copy-to-clipboard__color');\n ctc.forEach((button) => {\n button.addEventListener('click', () => {\n let color = button.parentElement?.querySelector('.copy-to-clipboard__color');\n if(color) {\n let computedStyle = getComputedStyle(color).getPropertyValue('background-color');\n let hexColor = rgbToHex(computedStyle);\n console.log(hexColor);\n copyToClipboard(hexColor.replace(/\"/g, ''));\n }\n });\n });\n};\n\nfunction rgbToHex(rgb) {\n // Extract the individual RGB components\n var rgbArray = rgb.match(/\\d+/g);\n\n // Convert each component to hex and concatenate\n var hex = \"#\" + rgbArray.map(function (value) {\n var hexValue = parseInt(value).toString(16);\n return hexValue.length === 1 ? \"0\" + hexValue : hexValue;\n }).join('');\n\n return hex;\n}\n\nexport default copyHexCode;\n", "/* eslint-disable import/prefer-default-export */\nconst setResponsiveTable = (table: Element): void => {\n const head = table.querySelector('thead');\n const body = table.querySelector('tbody');\n const foot = table.querySelector('tfoot');\n\n if (head) {\n const headers: string[] = [];\n const ths = head.querySelectorAll('th');\n ths.forEach((h) => {\n if (!h.classList.contains('table__cell--self-explanatory')) {\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\n } else {\n headers.push(''); // If header is self explanatory we do not add it\n }\n });\n\n const rowContainers: HTMLTableSectionElement[] = [];\n // Table elements that possibly contains <tr>'s\n if (body) {\n rowContainers.push(body);\n }\n if (foot) {\n rowContainers.push(foot);\n }\n\n rowContainers.forEach((rc) => {\n const rows = rc.querySelectorAll('tr');\n rows.forEach((tr) => {\n const cells = tr.querySelectorAll('td, th');\n cells.forEach((cell, i) => {\n if (headers[i]) {\n // if header is self explanatory we skip (value of array index is '' which is falsy)\n cell.setAttribute('data-label', headers[i]);\n }\n });\n });\n });\n }\n};\n\nfunction runDemotableButtons(buttons: NodeListOf<Element>, rows: NodeListOf<HTMLTableRowElement>) {\n buttons.forEach((button) => {\n button.addEventListener('click', () => {\n if (button.id === 'demo-button--attention') {\n rows.forEach((row) => {\n if (row.id === 'table__row--flash-attention') {\n row.classList.remove('table__row--flash-transparent');\n row.classList.add('table__row--flash-attention');\n changeBackgroundColor(rows);\n }\n });\n }\n if (button.id === 'demo-button--confirm') {\n rows.forEach((row) => {\n if (row.id === 'table__row--flash-confirm') {\n row.classList.remove('table__row--flash-transparent');\n row.classList.add('table__row--flash-confirm');\n changeBackgroundColor(rows);\n }\n });\n }\n if (button.id === 'demo-button--warning') {\n rows.forEach((row) => {\n if (row.id === 'table__row--flash-warning') {\n row.classList.remove('table__row--flash-transparent');\n row.classList.add('table__row--flash-warning');\n changeBackgroundColor(rows);\n }\n });\n }\n });\n });\n}\n\n\nfunction changeBackgroundColor(rows: NodeListOf<HTMLTableRowElement>) {\n setTimeout(() => {\n rows.forEach((row: HTMLTableRowElement) => {\n if (row.classList.contains('table__row--flash-attention')) {\n row.classList.remove('table__row--flash-attention')\n }\n if (row.classList.contains('table__row--flash-confirm')) {\n row.classList.remove('table__row--flash-confirm')\n }\n if (row.classList.contains('table__row--flash-warning')) {\n row.classList.remove('table__row--flash-warning')\n }\n row.classList.add('table__row--flash-transparent');\n });\n }, 1000);\n}\n\nexport {\n setResponsiveTable,\n runDemotableButtons,\n changeBackgroundColor\n};\n", "/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-param-reassign */\nimport { getBaseFontSize } from './helpers';\n\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\n }\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\n }\n\n return -1;\n};\n\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const widthInRem = viewportWidth / getBaseFontSize();\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\n if (mediaWidth > -1) {\n return widthInRem < mediaWidth;\n }\n return true;\n};\n\nconst destroyTabs = (tabbed: Element): void => {\n const tablist = tabbed.querySelector('.nav__items');\n const tabs = tablist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n tabs?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('nav__item--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst destroySwitches = (tabbed: Element): void => {\n const switchlist = tabbed.querySelector('.switch');\n const switches = switchlist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n switches?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('switch__segment--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst switchTab = (\n tabs: NodeListOf<HTMLAnchorElement>,\n panels: HTMLElement[],\n oldTab: Element | null,\n newTab: HTMLElement,\n _: DOMTokenList,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number): void => console.log(index),\n): void => {\n if (focus) {\n newTab.focus();\n }\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n\n // Check if switch // should this be more pretty?\n if (newTab.classList.contains('switch__segment')) {\n newTab.classList.add('switch__segment--active');\n } else {\n newTab.classList.add('nav__item--active');\n }\n\n if (oldTab) {\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n\n if (oldTab.classList.contains('switch__segment')) {\n oldTab.classList.remove('switch__segment--active');\n } else {\n oldTab.classList.remove('nav__item--active');\n }\n }\n\n const index = Array.prototype.indexOf.call(tabs, newTab);\n\n // More links\n /* let moreLinks;\n var moreLink: HTMLElement;\n moreLinks = document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`);\n moreLinks.forEach((moreLink) => {\n moreLink.classList.add('tabbed-content-peripheral--active');\n moreLink.hidden = false;\n }); */\n const moreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[index].id}\"]`));\n moreLinks.forEach((link) => {\n link.classList.add('tabbed-content-peripheral--active');\n link.hidden = false;\n });\n\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n panels[index].hidden = false;\n if (oldTab) {\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n\n const oldMoreLinks: HTMLElement[] = Array.from(document.querySelectorAll(`[data-for=\"${panels[oldIndex].id}\"]`));\n oldMoreLinks.forEach((link) => {\n link.classList.remove('tabbed-content-peripheral--active');\n link.hidden = true;\n });\n\n /* moreLinks.forEach((moreLink) => {\n moreLink.classList.remove('tabbed-content-peripheral--active');\n moreLink.hidden = true;\n }); */\n\n panels[oldIndex].hidden = true;\n }\n\n // Dispatches custom event on every tab change\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\n bubbles: true,\n detail: { tab: index },\n }));\n callback(index);\n};\n\nconst setTabbedContent = (\n key: number,\n tabbed: Element,\n initial = 0,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number) => console.log(index),\n): void => {\n const tablist = tabbed.querySelector('.switch,.nav__items') as HTMLElement;\n const tabs = tablist.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\n if (expandAll) {\n const expandAllEvent = () => {\n tablist.hidden = true;\n panels.forEach((panel: HTMLElement) => {\n panel.hidden = false;\n });\n };\n\n expandAll.removeEventListener('click', expandAllEvent);\n expandAll.addEventListener('click', expandAllEvent);\n }\n\n // Add the tablist role to the first <ul> in the .tabbed container\n tablist.setAttribute('role', 'tablist');\n\n // Add semantics are remove user focusability for each tab\n tabs.forEach((tab, i) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\n tab.setAttribute('tabindex', '-1');\n tab.parentElement?.setAttribute('role', 'presentation');\n\n // Handle clicking of tabs for mouse users\n const tabClickEvent = (e: MouseEvent) => {\n e.preventDefault();\n const currentTab = tablist.querySelector('[aria-selected]');\n if (e.currentTarget !== currentTab) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n };\n\n tab.removeEventListener('click', tabClickEvent);\n tab.addEventListener('click', tabClickEvent);\n\n // Handle keydown events for keyboard users\n const tabKeyEvent = (e: KeyboardEvent) => {\n // Get the index of the current tab in the tabs node list\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\n // Work out which key the user is pressing and\n // Calculate the new tab's index where appropriate\n let dir: number | string | null = null;\n if (e.key === 'ArrowLeft') {\n dir = index - 1;\n }\n if (e.key === 'ArrowRight') {\n dir = index + 1;\n }\n if (e.key === 'ArrowDown') {\n dir = 'down';\n }\n if (dir !== null) {\n e.preventDefault();\n // If the down key is pressed, move focus to the open panel,\n // otherwise switch to the adjacent tab\n if (dir === 'down') {\n panels[i].focus();\n } else if (tabs[dir]) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n }\n };\n tab.removeEventListener('keydown', tabKeyEvent);\n tab.addEventListener('keydown', tabKeyEvent);\n });\n\n // Add tab panel semantics and hide them all\n panels.forEach((panel: HTMLElement, i: number) => {\n panel.setAttribute('tabindex', '-1');\n panel.setAttribute('aria-labelledby', tabs[i].id);\n // eslint-disable-next-line no-param-reassign\n panel.hidden = true;\n panel.setAttribute('role', 'tabpanel');\n });\n\n // Initially activate the first tab and reveal the first tab panel\n if (initial > -1) {\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\n }\n};\n\nconst setTabs = (tabbedObjects: ITabbedObject[]): void => {\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\n const { rendered, domElement } = tabObject;\n if (isBelowViewportLimit(domElement.classList)) {\n if (!rendered) {\n const focus = domElement.getAttribute('data-focus-onload');\n const dataInitial = domElement.getAttribute('data-initial-tab');\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\n setTabbedContent(key, domElement, initial, focus !== 'false');\n tabObject.rendered = true;\n }\n } else if (rendered) {\n destroyTabs(domElement);\n tabObject.rendered = false;\n }\n });\n};\n\nexport {\n setTabbedContent,\n isBelowViewportLimit,\n destroyTabs,\n destroySwitches,\n setTabs,\n};\n", "/* eslint-disable max-len */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n\nimport { isViewportBelow} from './helpers';\n\nconst setContentToggle = (\n content: Element,\n onClick?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n beforeCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n afterCallback?: ((content: HTMLElement, button: HTMLButtonElement) => void) | undefined,\n): CleanUpPair[] => {\n const cleanUp: CleanUpPair[] = [];\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean): () => void => {\n if (focus) {\n contentClose.focus();\n }\n const click = () => {\n content.setAttribute('hidden', 'hidden');\n button.removeAttribute('hidden');\n button.setAttribute('aria-expanded', 'false');\n button.focus();\n };\n contentClose.addEventListener('click', click);\n return click;\n };\n\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\n const contentClose = content.querySelectorAll('.content-toggle__close');\n \n const setBPModiferClass = () => {\n if (isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--always-show-on-medium')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n } \n else if (isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--always-show-on-wide')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n } \n else if (isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--always-show-on-max-width')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n \n } \n else (\n content.classList.contains('content-toggle__content--always-show-on-medium') ||\n content.classList.contains('content-toggle__content--always-show-on-wide') ||\n content.classList.contains('content-toggle__content--always-show-on-max-width')\n )\n }\n window.addEventListener('resize', () => {\n setBPModiferClass();\n });\n\n const setBPModifierPopupClass = () => {\n document.addEventListener('click', (event) => {\n const eventTarget = event.target as HTMLElement;\n const doesNotContainContent = !eventTarget.classList.contains('content-toggle__content')\n const doesNotContainButton = !eventTarget.classList.contains('content-toggle__toggle')\n const doesNotContainSpan = !eventTarget.classList.contains('profile-header__info__contact__toggle__button')\n if (doesNotContainContent && doesNotContainButton && doesNotContainSpan) {\n if (!isViewportBelow('--bp-medium') && content.classList.contains('content-toggle__content--is-popover--on-medium')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n button.setAttribute(\"aria-expanded\", \"false\");\n button.focus();\n } else if (!isViewportBelow('--bp-wide') && content.classList.contains('content-toggle__content--is-popover--on-wide')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n button.setAttribute(\"aria-expanded\", \"false\");\n button.focus();\n } else if (!isViewportBelow('--bp-max-width') && content.classList.contains('content-toggle__content--is-popover--on-max-width')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n button.setAttribute(\"aria-expanded\", \"false\");\n button.focus(); \n }\n else if (content.classList.contains('content-toggle__content--is-popover')) {\n button.removeAttribute(\"hidden\");\n content.setAttribute(\"hidden\", \"hidden\");\n button.setAttribute(\"aria-expanded\", \"false\");\n button.focus();\n }\n }\n });\n }\n\n setBPModifierPopupClass(); \n setBPModiferClass();\n\n if (button) {\n const clickEvent = () => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n // Til toolbar: hvis man klikker p\u00E5 en knap, der ikke er foldet ud\n // S\u00E5 lukker vi alle \u00E5bne content-toggles\n if (typeof beforeCallback === 'function' && ariaExpanded === 'false') {\n beforeCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n // Og s\u00E5 g\u00E5r vi i gang med folde-ud-logikken\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n if (ariaExpanded === 'true') {\n content.setAttribute('hidden', 'hidden');\n } else {\n content.removeAttribute('hidden');\n }\n\n if (typeof onClick === 'function') {\n onClick(content as HTMLElement, button as HTMLButtonElement);\n }\n\n if (button.hasAttribute('aria-haspopup')) {\n button.setAttribute('hidden', 'hidden');\n contentClose.forEach((cc) => {\n setContentClose(button, cc as HTMLElement, true);\n });\n }\n\n // Det der sker efter folde-logikken\n if (typeof afterCallback === 'function') {\n afterCallback(content as HTMLElement, button as HTMLButtonElement);\n }\n };\n\n button.addEventListener('click', clickEvent);\n // Altid tilf\u00F8j denne f\u00F8rst!\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n contentClose.forEach((cc) => {\n const btnClick = setContentClose(button, cc as HTMLElement, false);\n cleanUp.push({\n element: cc,\n clickEvent: btnClick,\n });\n });\n }\n return cleanUp;\n};\n\nexport {\n setContentToggle, \n};\n", "/* eslint-disable max-len */\nimport { convertRemToPixels, isElementWithClassNameInEventPath, isViewportBelow } from './helpers';\n\nconst lockBodyScroll = (): void => {\n const body = document.querySelector('body');\n if (isViewportBelow('--bp-medium') || isViewportBelow('--bp-low-height')) {\n body?.classList.add('body--no-scroll');\n }\n};\n\nconst unlockBodyScroll = (): void => {\n const body = document.querySelector('body');\n body?.classList.remove('body--no-scroll');\n};\n\n/* eslint-env browser */\nconst closeAllContentTogglesInToolbar = (toolbar: HTMLElement): void => {\n const contentToggles = toolbar.querySelectorAll('.content-toggle__toggle');\n contentToggles.forEach((toggle) => {\n const content = toggle.parentElement?.querySelector('.content-toggle__content');\n toggle.setAttribute('aria-expanded', 'false');\n content?.setAttribute('hidden', 'hidden');\n });\n};\n\nconst setOverflow = (toolbarElement: Element): void => {\n if (!toolbarElement.classList.contains('toolbar--no-collapse')) {\n toolbarElement.classList.remove('toolbar--toggled');\n }\n toolbarElement.classList.remove('toolbar--fully-overflown');\n toolbarElement.classList.remove('toolbar--has-popout');\n const toolbarItemsParent = toolbarElement.querySelector('.toolbar__items');\n const toolbarItems = toolbarItemsParent?.children as HTMLCollection;\n const isOverflownClass = 'toolbar__item--is-overflown';\n const hasOverflowClass = 'toolbar--has-overflow';\n let hasOverflown = false;\n\n let overflownCount = 0;\n const addOverflowClass = (item: HTMLElement, index: number) => {\n if (item) {\n const top = item.offsetTop;\n if (top > 25) {\n item.classList.add(isOverflownClass);\n toolbarElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n overflownCount += 1;\n } else {\n item.classList.remove(isOverflownClass);\n }\n\n if (!hasOverflown) {\n toolbarElement.classList.remove(hasOverflowClass);\n } else if (index - 1 >= 0) {\n addOverflowClass(toolbarItems[index - 1] as HTMLElement, index - 1);\n }\n }\n };\n\n addOverflowClass(toolbarItems[toolbarItems.length - 1] as HTMLElement, toolbarItems.length - 1);\n\n if (overflownCount > 0 && overflownCount === toolbarItems.length) {\n toolbarElement.classList.add('toolbar--fully-overflown');\n }\n};\n\nconst setToolbarToggle = (toolbar: HTMLElement): ExtendedCleanUpPair[] => {\n const cleanUp: ExtendedCleanUpPair[] = [];\n const buttons = toolbar.querySelectorAll('.toolbar__toggle');\n buttons.forEach((button) => {\n const clickEvent = () => {\n button?.parentElement?.classList.toggle('toolbar--toggled');\n const ariaExpanded = button.getAttribute('aria-expanded');\n if (ariaExpanded !== 'true') {\n const focusable = 'a.toolbar__item--is-overflown, button.toolbar__item--is-overflown, input.toolbar__item--is-overflown, select.toolbar__item--is-overflown, .toolbar__item--is-overflown a, .toolbar__item--is-overflown button, .toolbar__item--is-overflown input, .toolbar__item--is-overflown select';\n const firstWithOverflow = button?.parentElement?.querySelector(focusable) as HTMLElement;\n if (firstWithOverflow) {\n setTimeout(() => {\n firstWithOverflow.focus();\n }, 0);\n }\n }\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n button.addEventListener('click', clickEvent);\n });\n return cleanUp;\n};\n\nconst setToolbar = (\n toolbar: HTMLElement,\n onCloseContentToggle: (toolbarElement: HTMLElement) => void,\n setOverflowOnly = true,\n): ExtendedCleanUpPair[] => {\n let cleanUp: ExtendedCleanUpPair[] = [];\n\n setOverflow(toolbar);\n onCloseContentToggle(toolbar);\n cleanUp = cleanUp.concat(setToolbarToggle(toolbar));\n\n if (!setOverflowOnly) {\n const bodyClickEvent = (event: Event) => {\n if (!(event.target as HTMLElement).classList.contains('content-toggle__toggle')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'content-toggle__content')) {\n onCloseContentToggle(toolbar);\n }\n };\n\n const escKeyEvent = (event: Event) => {\n if ((event as KeyboardEvent).key === 'Escape') {\n if (event.target && (event.target as HTMLElement).getAttribute('type') !== 'search') {\n onCloseContentToggle(toolbar);\n }\n }\n };\n\n const body = document.querySelector('body');\n\n cleanUp.push({\n element: body as Element,\n clickEvent: bodyClickEvent,\n });\n\n cleanUp.push({\n element: window,\n keyUpEvent: escKeyEvent,\n });\n\n body?.addEventListener('click', bodyClickEvent);\n window.addEventListener('keyup', escKeyEvent);\n }\n\n return cleanUp;\n};\n\nconst findToolbar = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('toolbar')) {\n return parent;\n }\n return findToolbar(parent);\n }\n return element;\n};\n\nconst contentToggleEdgeHandling = (element: HTMLElement): void => {\n if (!isViewportBelow('--bp-medium') && !isViewportBelow('--bp-low-height')) {\n const allowedDistance = convertRemToPixels(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--toolbar-popout-allowed-edge-distance').replace('rem,', ''), 10));\n const popoutX = parseInt(getComputedStyle(element).width.replace('px', ''), 10);\n const popoutWidth = element.getBoundingClientRect().x;\n\n const distance = document.body.offsetWidth - allowedDistance - popoutX - popoutWidth;\n\n if (distance < 0) {\n element.style.setProperty('--toolbar-popout-edge-overflow', `${distance}px`);\n }\n }\n};\n\nexport {\n setToolbar,\n setOverflow,\n findToolbar,\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n lockBodyScroll,\n unlockBodyScroll,\n};\n", "// Scroller 80% p\u00E5 horisontal scroll til h\u00F8jre og s\u00E6tter knappen disabled n\u00E5r man rammer bunden\nconst horizontalScrollButtonNext = (nextButtons: NodeListOf<Element>): void => {\n if (nextButtons) {\n nextButtons.forEach((nextButton) => {\n const topElem = nextButton?.parentElement?.parentElement?.parentElement?.parentElement;\n if (topElem) {\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\n const switch__segments = topElem.querySelectorAll('.switch__segment');\n scrollElements.forEach((scrollElement) => { \n if (scrollElement) {\n nextButton.addEventListener('click', () => {\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til h\u00F8jre\n const scrollAmount = 0.8 * scrollElement.clientWidth;\n scrollElement.scrollLeft += scrollAmount;\n });\n // G\u00F8r knappen aktiv hvis scroll har ramt bunden\n scrollElement.addEventListener('scroll', () => {\n if ((scrollElement.scrollLeft + scrollElement.clientWidth) >= (scrollElement.scrollWidth * 0.98)) {\n disableButton(nextButton);\n } else if (scrollElement.scrollLeft + scrollElement.clientWidth < scrollElement.scrollWidth) {\n activateButton(nextButton);\n }\n });\n // Reset af knap ved flere tabs af horizontal scroll\n if (switch__segments) {\n switch__segments.forEach(switch__segment => {\n switch__segment.addEventListener('click', () => {\n activateButton(nextButton);\n scrollElement.scrollLeft = 0;\n })\n });\n }\n }\n });\n }\n });\n }\n };\n \n // Scroller 80% p\u00E5 horisontal scroll til venstre og s\u00E6tter knappen disabled n\u00E5r man rammer toppen\n const horizontalScrollButtonPrevious = (previousButtons: NodeListOf<Element>): void => {\n if (previousButtons) {\n previousButtons.forEach((previousButton) => {\n const topElem = previousButton?.parentElement?.parentElement?.parentElement?.parentElement;\n if (topElem) {\n const scrollElements = topElem.querySelectorAll('.horizontal-scroll__scrollable-content');\n const switch__segments = topElem.querySelectorAll('.switch__segment');\n scrollElements.forEach((scrollElement) => { \n if (scrollElement) {\n previousButton.addEventListener('click', () => {\n // Scroller 80% af den synlige bredde p\u00E5 horizontal scroll til venstre\n const scrollAmount = 0.8 * scrollElement.clientWidth;\n scrollElement.scrollLeft -= scrollAmount;\n });\n // G\u00F8r knappen aktiv hvis scroll har ramt toppen\n scrollElement.addEventListener('scroll', () => {\n if (scrollElement.scrollLeft <= 0) {\n disableButton(previousButton);\n } else if (scrollElement.scrollLeft > 0) {\n activateButton(previousButton);\n }\n });\n }\n // Reset af knap ved flere tabs af horizontal scroll\n if (switch__segments) {\n switch__segments.forEach(switch__segment => {\n switch__segment.addEventListener('click', () => {\n disableButton(previousButton);\n });\n });\n }\n });\n }\n });\n }\n };\n\n function activateButton(button) {\n button.classList.remove('visually-disabled');\n button.setAttribute('aria-disabled', 'false');\n }\n \n function disableButton(button) {\n button.classList.add('visually-disabled');\n button.setAttribute('aria-disabled', 'true');\n }\n\n export {\n horizontalScrollButtonNext,\n horizontalScrollButtonPrevious,\n };", "function setupAutoExpand(textarea: HTMLTextAreaElement | null): void {\n if (textarea) {\n textarea.addEventListener(\"input\", function (this: HTMLTextAreaElement, event: Event) {\n const parentNode = textarea?.parentNode as HTMLElement | null;\n \n if (parentNode && parentNode.dataset) {\n parentNode.dataset.value = this.value;\n }\n });\n }\n }\n\n export {\n setupAutoExpand\n };", "function setupCharacterCount(\n element: HTMLElement,\n type: HTMLTextAreaElement | HTMLInputElement | null,\n length: string | null,\n countdown: HTMLElement | null,\n countMessageOverflow: HTMLElement | null\n ): void {\n let text = type?.value;\n let charCount = text?.length;\n if (type && text) {\n type.textContent = text;\n charCount = text?.length;\n if (charCount && countdown && countMessageOverflow) {\n if (length) {\n const lengthNumber = parseInt(length, 10);\n let remainingChars = lengthNumber - charCount;\n let absoluteValue = Math.abs(remainingChars);\n // Update span 2 with remaining number of chars\n if(countMessageOverflow.textContent) {\n countMessageOverflow.textContent = countMessageOverflow.textContent.replace(/\\d+/, String(absoluteValue));\n }\n // Update span 3 with remaining number of chars\n if(countdown.textContent) {\n countdown.textContent = countdown.textContent.replace(/\\d+/, String(absoluteValue));\n }\n // Adds overflow class if remaining chars < 0 \n if (remainingChars < 0) {\n element.classList.add('form__field__character-count--overflow');\n element.setAttribute(\"aria-invalid\", \"true\");\n }\n // Remove overflow class if remaining chars >= 0 \n if (remainingChars >= 0) {\n element.classList.remove('form__field__character-count--overflow');\n element.setAttribute(\"aria-invalid\", \"false\");\n }\n }\n }\n }\n }\n\n function charCounter(element: HTMLElement | null): void { \n if (element) {\n const textArea = element.querySelector(\"textarea\");\n const input = element.querySelector(\"input\");\n const recommendedLength = element.getAttribute('data-recommended-length');\n const allowedLength = element.getAttribute('data-allowed-length');\n let countdown = element.querySelector('.form__field__character-count__info__count-down');\n let countMessageOverflow = element.querySelector('.form__field__character-count__info__overflow-count');\n\n // Textarea intial page load\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n\n // Input intial page load\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n\n // Update textarea on input\n textArea?.addEventListener('input', function() { \n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n setupCharacterCount(element as HTMLElement, textArea as HTMLTextAreaElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n })\n\n // Update input field on input\n input?.addEventListener('input', function() { \n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, recommendedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n setupCharacterCount(element as HTMLElement, input as HTMLInputElement, allowedLength as string, countdown as HTMLElement, countMessageOverflow as HTMLElement);\n })\n }\n }\n\n export {\n charCounter,\n setupCharacterCount\n };", "// Centers stepper labels if they are 4 chars or less\nfunction stepperLabelsCenter(element: HTMLElement): void { \n if (element && element.textContent) {\n if (element.textContent.length <= 4) {\n element.style.textAlign = 'center';\n }\n }\n}\n\nexport {\n stepperLabelsCenter\n };\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 */\n/* eslint-env browser */\nimport 'wicg-inert';\n\ntype HTMLElementWithInert = {\n inert: boolean,\n} & HTMLElement;\n\nconst hideModal = (modal: string, sender: Element, callback = () => { }): void => {\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\n if (modalView) {\n modalView.classList.remove('modal-view--visible');\n modalView.inert = true;\n const page = document.querySelector('.page') as HTMLElementWithInert;\n if (page) {\n page.classList.remove('page--blur');\n page.inert = false;\n }\n document.querySelector('body')?.classList.remove('body--no-scroll');\n (sender as HTMLElement).focus();\n sender.setAttribute('aria-expanded', 'false');\n callback();\n }\n};\n\nconst showModal = (\n modal: string, sender: Element, hideCallback = (): void => { }, closeable = true,\n): ExtendedCleanUpPair[] => {\n const modalView = document.getElementById(modal) as HTMLElementWithInert;\n const cleanUp: ExtendedCleanUpPair[] = [];\n if (modalView) {\n modalView.classList.add('modal-view--visible');\n modalView.inert = false;\n const page = document.querySelector('.page') as HTMLElementWithInert;\n if (page) {\n page.classList.add('page--blur');\n page.inert = true;\n }\n document.querySelector('body')?.classList.add('body--no-scroll');\n sender.setAttribute('aria-expanded', 'true');\n\n modalView.focus();\n\n const clickEvent = (event: Event) => {\n if (event.target === modalView) {\n hideModal(modal, sender, hideCallback);\n }\n };\n\n const keyEvent = (event: Event) => {\n if ((event as KeyboardEvent).key === 'Escape') {\n hideModal(modal, sender, hideCallback);\n }\n };\n\n if (closeable) {\n modalView.addEventListener('click', clickEvent);\n window.addEventListener('keyup', keyEvent);\n\n cleanUp.push({\n element: modalView,\n clickEvent,\n });\n\n cleanUp.push({\n element: window,\n keyUpEvent: keyEvent,\n });\n }\n }\n return cleanUp;\n};\n\nexport {\n hideModal,\n showModal,\n};\n", "/* eslint-disable no-param-reassign */\n/* eslint-env browser */\nimport ready from '../components/ready';\nimport {\n setResponsiveNav,\n setResponsiveToggle, setCopyToClipboard,\n} from '../components/nav';\nimport copyHexCode from '../components/copy-hex-code';\nimport { isElementWithClassNameInEventPath, setMetaThemeColor, setHorizontalScroll } from '../components/helpers';\nimport { setResponsiveTable, runDemotableButtons, changeBackgroundColor } from '../components/table';\nimport { setTabs } from '../components/tabs';\nimport { setContentToggle } from '../components/content-toggle';\nimport {\n closeAllContentTogglesInToolbar,\n contentToggleEdgeHandling,\n findToolbar,\n lockBodyScroll,\n unlockBodyScroll,\n} from '../components/toolbar';\nimport { horizontalScrollButtonNext, horizontalScrollButtonPrevious } from '../components/horizontal-scroll-btn';\nimport { setupAutoExpand } from '../components/text-area';\nimport { charCounter } from '../components/char-counter';\nimport { dropdownIconToggle } from '../components/form';\nimport { stepperLabelsCenter } from '../components/stepper';\nimport { hideModal, showModal } from '../components/modal-view';\n\nlet windowInnerWidth = 0;\n\nready(() => {\n const tabbedContent = document.querySelectorAll('.tabbed-content');\n const tabbedObjects: ITabbedObject[] = [];\n tabbedContent.forEach((tab) => tabbedObjects.push({\n domElement: tab,\n rendered: false,\n }));\n setTabs(tabbedObjects);\n setMetaThemeColor();\n\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setResponsiveToggle(navElements);\n\n const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\n tables.forEach((table) => setResponsiveTable(table));\n\n // Attention highlight style for table rows\n const rows = document.querySelectorAll('.table__row--flash-attention, .table__row--flash-confirm, .table__row--flash-warning') as NodeListOf<HTMLTableRowElement>;\n changeBackgroundColor(rows);\n\n // Demo buttons to demonstrate attention, confirm and warning styles\n const demoTableButtons = document.querySelectorAll('#demo-button--attention, #demo-button--confirm, #demo-button--warning');\n runDemotableButtons(demoTableButtons, rows);\n\n // Progress bar animation\n const animationButtons = document.querySelectorAll('.button');\n const animatedProgressBars = document.querySelectorAll('.progress-bar__progress.progress-bar__progress--confirm.progress-bar__progress--transistion-from-start');\n animationButtons.forEach((button) => {\n button.addEventListener('click', () => {\n animatedProgressBars.forEach((progressBar) => {\n progressBar.classList.toggle('progress-bar__progress--transistion-from-start');\n });\n });\n });\n\n // Character counter for form input\n const elements = document.querySelectorAll('.form__field__character-count');\n elements.forEach((element) => {\n charCounter(element as HTMLElement);\n });\n\n // Textarea input\n const textarea = document.getElementById(\"autoexpand\") as HTMLTextAreaElement | null;\n setupAutoExpand(textarea);\n window.onload = function () {\n setupAutoExpand(textarea);\n };\n\n // Dropdown box icon toggle\n // const dropDownElements: NodeListOf<HTMLElement> = document.querySelectorAll('.form__field select, .form__field__combo-box__field');\n // dropDownElements.forEach((element) => {\n // dropdownIconToggle(element);\n // });\n\n // Centers stepper labels when they are 4 chars or less\n const stepperLabels: NodeListOf<HTMLElement> = document.querySelectorAll('.stepper__item__label');\n stepperLabels.forEach((element) => {\n stepperLabelsCenter(element);\n });\n\n\n // Find alle copy-to-clipboard elementer\n const ctc = document.querySelectorAll('.copy-to-clipboard');\n ctc.forEach((element) => setCopyToClipboard(element as HTMLElement, document.querySelector('html')?.getAttribute('lang') === 'en' ? 'Hexcode copied!' : 'Hexkode kopieret!'));\n copyHexCode();\n\n //const toggles = document.querySelectorAll('.box .content-toggle__content, .profile-header .content-toggle__content, .design-documentation .content-toggle__content');\n const toggles = document.querySelectorAll('.content-toggle__content:not(.toolbar .content-toggle__content)');\n toggles.forEach((toggle) => {\n setContentToggle(toggle);\n });\n\n // Hortizontal scroll buttons\n const scrollButtonsNext = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-next');\n const scrollButtonsPrevious = document.querySelectorAll('.button.button--small.button--icon.button--icon--hide-label.icon-previous');\n horizontalScrollButtonNext(scrollButtonsNext);\n horizontalScrollButtonPrevious(scrollButtonsPrevious);\n\n const horizontalScroll = document.querySelectorAll('.horizontal-scroll');\n horizontalScroll.forEach((hs) => {\n setHorizontalScroll(hs as HTMLElement);\n window.addEventListener('resize', () => {\n setHorizontalScroll(hs as HTMLElement);\n });\n });\n\n const switchSegments = document.querySelectorAll('.switch__segment');\n switchSegments.forEach((switchSegment) => {\n switchSegment.addEventListener('click', () => {\n const horizontalScrollTabbed = document.querySelectorAll('.horizontal-scroll');\n horizontalScrollTabbed.forEach((hsTabbed) => {\n setHorizontalScroll(hsTabbed as HTMLElement);\n });\n });\n });\n\n // Kursuskatalog\n const togglesInToolbars = document.querySelectorAll('.toolbar .content-toggle__content');\n togglesInToolbars.forEach((toggle) => {\n setContentToggle(\n toggle,\n (popout: HTMLElement) => {\n contentToggleEdgeHandling(popout);\n lockBodyScroll();\n },\n (content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content)),\n (content: HTMLElement, button: HTMLButtonElement) => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n const toolbar = findToolbar(content);\n if (ariaExpanded === 'true') {\n toolbar?.classList.add('toolbar--has-popout');\n } else {\n toolbar?.classList.remove('toolbar--has-popout');\n }\n\n content.addEventListener('click', (event: MouseEvent) => {\n if ((event.target as HTMLElement).classList.contains('toolbar__popout')\n && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {\n closeAllContentTogglesInToolbar(toolbar);\n unlockBodyScroll();\n }\n });\n },\n );\n });\n\n const modalsBtns = document.querySelectorAll('[data-modal]');\n modalsBtns.forEach((button) => {\n const modalId = button.getAttribute('data-modal') as string;\n const modal = document.getElementById(modalId);\n const closeBtn = modal?.querySelector('.modal-view__close');\n closeBtn?.addEventListener('click', () => {\n hideModal(modalId, button);\n });\n button.addEventListener('click', () => {\n showModal(modalId, button);\n });\n });\n\n window.addEventListener('load', () => {\n windowInnerWidth = window.innerWidth;\n });\n\n window.addEventListener('resize', () => {\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\n windowInnerWidth = window.innerWidth;\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setTabs(tabbedObjects);\n }\n });\n});\n"],
|
|
5
5
|
"mappings": "MACA,IAAMA,GAASC,GAAyB,CAClC,SAAS,aAAe,UAC1BA,EAAG,EAEH,SAAS,iBAAiB,mBAAoBA,CAAE,CAEpD,EAEOC,EAAQF,GCNf,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,GAAyB,CAChCA,EAAkB,WAChBA,EAAkB,UAAU,SAASF,CAAS,IACjDC,EAAQ,GAGd,CAAC,EACMA,CACT,EAEME,EAAoB,IAAY,CACpC,IAAMC,EAAO,SA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UK,GAAsB,CAClDA,EAAM,OAAuB,UAAU,SAAS,iBAAiB,GACjE,CAACC,EAAkCD,EAAqB,0BAA0B,IACrFJ,EAAgCG,CAAO,EACvCG,GAAiB,EAErB,CAAC,CACH,CACF,CACF,CAAC,EAEkB,SAAS,iBAAiB,cAAc,EAChD,QAAS7B,GAAW,CAC7B,IAAM8B,EAAU9B,EAAO,aAAa,YAAY,EAClC,SAAS,eAAe8B,CAAO,GACrB,cAAc,oBAAoB,GAChD,iBAAiB,QAAS,IAAM,CACxCC,EAAUD,EAAS9B,CAAM,CAC3B,CAAC,EACDA,EAAO,iBAAiB,QAAS,IAAM,CACrCgC,GAAUF,EAAS9B,CAAM,CAC3B,CAAC,CACH,CAAC,EAED,OAAO,iBAAiB,OAAQ,IAAM,CACpCnB,EAAmB,OAAO,UAC5B,CAAC,EAED,OAAO,iBAAiB,SAAU,IAAM,CAClCA,EAAmB,GAAK,OAAO,aAAeA,IAChDA,EAAmB,OAAO,WAC1BO,EAAY,QAASC,GAAMC,EAAiBF,EAAaC,CAAC,CAAC,EAC3DH,EAAQF,CAAa,EAEzB,CAAC,CACH,CAAC",
|
|
6
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", "setResponsiveTable", "table", "head", "body", "foot", "headers", "h", "rowContainers", "rc", "tr", "cell", "i", "runDemotableButtons", "buttons", "rows", "button", "row", "changeBackgroundColor", "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", "lockBodyScroll", "body", "isViewportBelow", "unlockBodyScroll", "closeAllContentTogglesInToolbar", "toolbar", "toggle", "content", "findToolbar", "element", "parent", "contentToggleEdgeHandling", "isViewportBelow", "allowedDistance", "convertRemToPixels", "popoutX", "popoutWidth", "distance", "horizontalScrollButtonNext", "nextButtons", "nextButton", "topElem", "scrollElements", "switch__segments", "scrollElement", "scrollAmount", "disableButton", "activateButton", "switch__segment", "horizontalScrollButtonPrevious", "previousButtons", "previousButton", "button", "setupAutoExpand", "textarea", "event", "parentNode", "setupCharacterCount", "element", "type", "length", "countdown", "countMessageOverflow", "text", "charCount", "remainingChars", "absoluteValue", "charCounter", "textArea", "input", "recommendedLength", "allowedLength", "stepperLabelsCenter", "element", "_createClass", "defineProperties", "target", "props", "i", "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", "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", "table", "setResponsiveTable", "rows", "changeBackgroundColor", "demoTableButtons", "runDemotableButtons", "animationButtons", "animatedProgressBars", "button", "progressBar", "element", "charCounter", "textarea", "setupAutoExpand", "stepperLabelsCenter", "setCopyToClipboard", "copy_hex_code_default", "toggle", "setContentToggle", "scrollButtonsNext", "scrollButtonsPrevious", "horizontalScrollButtonNext", "horizontalScrollButtonPrevious", "hs", "setHorizontalScroll", "switchSegment", "hsTabbed", "popout", "contentToggleEdgeHandling", "lockBodyScroll", "content", "closeAllContentTogglesInToolbar", "findToolbar", "ariaExpanded", "toolbar", "event", "isElementWithClassNameInEventPath", "unlockBodyScroll", "modalId", "hideModal", "showModal"]
|
|
7
7
|
}
|