@aarhus-university/au-designsystem-delphinus 1.9.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/public/demo/demo-component.css +1 -1
- package/public/js/app.js +14 -14
- package/public/js/app.js.map +7 -7
- package/public/js/demo.js +14 -14
- package/public/js/demo.js.map +7 -7
- package/public/projects/bachelor-applications/js/app.js +14 -14
- package/public/projects/bachelor-applications/js/app.js.map +7 -7
- package/public/projects/bachelor-applications/style.css +1 -1
- package/public/projects/brightspace/style.css +1 -1
- package/public/projects/config-tools/style.css +1 -1
- package/public/projects/course-catalogue/js/app.js +14 -14
- package/public/projects/course-catalogue/js/app.js.map +7 -7
- package/public/projects/course-catalogue/style.css +1 -1
- package/public/projects/medarbejdere/js/app.js +14 -14
- package/public/projects/medarbejdere/js/app.js.map +7 -7
- package/public/projects/medarbejdere/style.css +1 -1
- package/public/projects/mitstudie/js/app.js +14 -14
- package/public/projects/mitstudie/js/app.js.map +7 -7
- package/public/projects/mitstudie/style.css +1 -1
- package/public/projects/omnibus/js/app.js +14 -14
- package/public/projects/omnibus/js/app.js.map +7 -7
- package/public/projects/omnibus/style.css +1 -1
- package/public/projects/queue-it/style.css +1 -1
- package/public/projects/typo3/js/app.js +2 -2
- package/public/projects/typo3/js/app.js.map +7 -7
- package/public/projects/typo3/style.css +1 -1
- package/public/style.css +1 -1
- package/source/projects/medarbejdere/style/_course-config.scss +9 -0
- package/source/projects/omnibus/style/_omnibus.scss +1 -0
- package/public/figma-tokens/style.css +0 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.content-container>*:first-child:not(.row){margin-top:0}.content-container>*:last-child:not(.row){margin-bottom:0}.component{padding:var(--spacing-m1);background-color:var(--color-background-secondary);color:var(--color-foreground)}.component>*:first-child:not(.row){margin-top:0}.component>*:last-child:not(.row){margin-bottom:0}.component--warning{background-color:var(--color-utility-warning-background);color:var(--color-utility-foreground)}.component__header{margin-bottom:var(--spacing-m5);font-size:var(--font-size-p1);line-height:calc(1.1em + 0.3rem);font-weight:700}.component__header--shout{text-transform:uppercase}.component__content{font-size:var(--font-size-0);line-height:calc(1.1em + 0.7rem);font-weight:400}/*# sourceMappingURL=demo-component.css.map */
|
|
1
|
+
.content-container>*:first-child:not(.row){margin-top:0}.content-container>*:last-child:not(.row){margin-bottom:0}.component{padding:var(--spacing-m1);background-color:var(--color-background-secondary);color:var(--color-foreground)}.component>*:first-child:not(.row){margin-top:0}.component>*:last-child:not(.row){margin-bottom:0}.component--warning{background-color:var(--color-utility-warning-background);color:var(--color-utility-foreground)}.component__header{margin-bottom:var(--spacing-m5);font-size:var(--font-size-p1);line-height:calc(1.1em + 0.3rem);font-weight:700}.component__header--shout{text-transform:uppercase}.component__content{font-size:var(--font-size-0);line-height:calc(1.1em + 0.7rem);font-weight:400}/*# sourceMappingURL=demo-component.css.map */
|
package/public/js/app.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(()=>{var de=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},$=de;var A=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},T=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},j=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let s=document.createElement("meta");s.name="theme-color",s.content=t,document.getElementsByTagName("head")[0].appendChild(s)}}},K=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),k=e=>e*16,p=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=k(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var ue=e=>e.offsetWidth!==e.scrollWidth;var H=e=>{e.classList.contains("horizontal-scroll--no-overflow")&&e.classList.remove("horizontal-scroll--no-overflow");let t=e.querySelector(".horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content");t===null&&!t&&(t=e.querySelector(".horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content")),t&&(ue(t)?t?.setAttribute("tabindex","0"):(e.classList.add("horizontal-scroll--no-overflow"),t?.removeAttribute("tabindex")))};var G=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:G(t):e},Q=(e,t=null)=>{let o="nav--toggled";e.forEach(s=>{let r=s.querySelector(".nav__toggle");s!==t&&(s.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),s.classList.remove(o))})},Y=e=>{let t=r=>{let l=G(r),i=l.querySelector(".nav__items"),f=i?.querySelector(".nav__item:last-of-type");i?.classList.add("nav__items--fadeout");let E=i?.querySelector(".nav__item--is-overflown");E&&E.focus();let d=()=>{l.classList.toggle("nav--toggled"),i?.classList.remove("nav__items--fadeout"),f?.removeEventListener("transitionend",d)};return f?.addEventListener("transitionend",d),l},o=[];return document.querySelectorAll(".nav__toggle").forEach(r=>{let l=()=>{let i=t(r),f=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",f==="false"?"true":"false"),Q(e,i)};o.push({element:r,clickEvent:l}),r.addEventListener("click",l)}),o},C=(e,t)=>{let o="nav--toggled",s="nav__items";t.classList.remove(o);let r=t.querySelector(`.${s}`);if(r){let i=r.querySelectorAll(".nav__item"),f="nav__item--is-overflown",E="nav--has-overflow",d="nav__item--active",a=!1;for(let n=i.length-1;n>=0;n-=1){let c=i[n];c.offsetTop>0?(c.classList.add(f),t.classList.add(E),a=!0):c.classList.contains(d)||c.classList.remove(f)}if(!a){t.classList.remove(E);let n=t.querySelector(`.${d}`);n&&n.classList.remove(f)}}let l=i=>{!i.target.classList.contains("nav__toggle")&&!T(i,s)&&Q(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var X=(e,t,o,s,r)=>{if(s&&o){A(s.innerText),t.classList.add("copy-to-clipboard--confirm"),t===o&&t.classList.add("copy-to-clipboard--done");let l=document.createElement("span");l.classList.add("copy-to-clipboard__this__confirm-message"),l.innerText=e,s.appendChild(l),o.removeEventListener("click",r),setTimeout(()=>{t.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",r)},1200)}},J=(e,t="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let s=()=>{X(t,e,e,o,s)};e.addEventListener("click",s)}else{let s=e.querySelector(".copy-to-clipboard__execute"),r=()=>{X(t,e,s,o,r)};s?.addEventListener("click",r)}};var fe=()=>{let e=document.querySelectorAll(".copy-to-clipboard"),t=document.querySelectorAll(".copy-to-clipboard__color");e.forEach(o=>{o.addEventListener("click",()=>{let s=o.parentElement?.querySelector(".copy-to-clipboard__color");if(s){let r=getComputedStyle(s).getPropertyValue("background-color"),l=me(r);console.log(l),A(l.replace(/"/g,""))}})})};function me(e){var t=e.match(/\d+/g),o="#"+t.map(function(s){var r=parseInt(s).toString(16);return r.length===1?"0"+r:r}).join("");return o}var Z=fe;var ee=e=>{let t=e.querySelector("thead"),o=e.querySelector("tbody"),s=e.querySelector("tfoot");if(t){let r=[];t.querySelectorAll("th").forEach(f=>{f.classList.contains("table__cell--self-explanatory")?r.push(""):r.push(f.innerHTML)});let i=[];o&&i.push(o),s&&i.push(s),i.forEach(f=>{f.querySelectorAll("tr").forEach(d=>{d.querySelectorAll("td, th").forEach((n,c)=>{r[c]&&n.setAttribute("data-label",r[c])})})})}};function te(e,t){e.forEach(o=>{o.addEventListener("click",()=>{o.id==="demo-button--attention"&&t.forEach(s=>{s.id==="table__row--flash-attention"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-attention"),w(t))}),o.id==="demo-button--confirm"&&t.forEach(s=>{s.id==="table__row--flash-confirm"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-confirm"),w(t))}),o.id==="demo-button--warning"&&t.forEach(s=>{s.id==="table__row--flash-warning"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-warning"),w(t))})})})}function w(e){setTimeout(()=>{e.forEach(t=>{t.classList.contains("table__row--flash-attention")&&t.classList.remove("table__row--flash-attention"),t.classList.contains("table__row--flash-confirm")&&t.classList.remove("table__row--flash-confirm"),t.classList.contains("table__row--flash-warning")&&t.classList.remove("table__row--flash-warning"),t.classList.add("table__row--flash-transparent")})},1e3)}var he=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,ve=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/K(),s=he(e);return s>-1?o<s:!0},Ee=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),s=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&s.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),s.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var q=(e,t,o,s,r,l=!0,i=f=>console.log(f))=>{l&&s.focus(),s.removeAttribute("tabindex"),s.setAttribute("aria-selected","true"),s.classList.contains("switch__segment")?s.classList.add("switch__segment--active"):s.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let f=Array.prototype.indexOf.call(e,s);if(Array.from(document.querySelectorAll(`[data-for="${t[f].id}"]`)).forEach(d=>{d.classList.add("tabbed-content-peripheral--active"),d.hidden=!1}),t[f].hidden=!1,o){let d=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[d].id}"]`)).forEach(n=>{n.classList.remove("tabbed-content-peripheral--active"),n.hidden=!0}),t[d].hidden=!0}s.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:f}})),i(f)},be=(e,t,o=0,s=!0,r=l=>console.log(l))=>{let l=t.querySelector(".switch,.nav__items"),i=l.querySelectorAll("a"),f=[];t.querySelectorAll("section").forEach(a=>{a.parentNode===t&&f.push(a)});let d=t.querySelector("button.tabbed-content__expand-all");if(d){let a=()=>{l.hidden=!0,f.forEach(n=>{n.hidden=!1})};d.removeEventListener("click",a),d.addEventListener("click",a)}l.setAttribute("role","tablist"),i.forEach((a,n)=>{a.setAttribute("role","tab"),a.setAttribute("id",`tab${e}_${n+1}`),a.setAttribute("tabindex","-1"),a.parentElement?.setAttribute("role","presentation");let c=m=>{m.preventDefault();let b=l.querySelector("[aria-selected]");m.currentTarget!==b&&q(i,f,b,m.currentTarget,t.classList,!0,v=>{r(v)})};a.removeEventListener("click",c),a.addEventListener("click",c);let u=m=>{let b=Array.prototype.indexOf.call(i,m.currentTarget),v=null;m.key==="ArrowLeft"&&(v=b-1),m.key==="ArrowRight"&&(v=b+1),m.key==="ArrowDown"&&(v="down"),v!==null&&(m.preventDefault(),v==="down"?f[n].focus():i[v]&&q(i,f,m.currentTarget,i[v],t.classList,!0,g=>{r(g)}))};a.removeEventListener("keydown",u),a.addEventListener("keydown",u)}),f.forEach((a,n)=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-labelledby",i[n].id),a.hidden=!0,a.setAttribute("role","tabpanel")}),o>-1&&q(i,f,null,i[o],t.classList,s)},O=e=>{e.forEach((t,o)=>{let{rendered:s,domElement:r}=t;if(ve(r.classList)){if(!s){let l=r.getAttribute("data-focus-onload"),i=r.getAttribute("data-initial-tab"),f=i?parseInt(i,10):0;be(o,r,f,l!=="false"),t.rendered=!0}}else s&&(Ee(r),t.rendered=!1)})};var R=(e,t,o,s)=>{let r=[],l=(a,n,c)=>{c&&n.focus();let u=()=>{e.setAttribute("hidden","hidden"),a.removeAttribute("hidden"),a.setAttribute("aria-expanded","false"),a.focus()};return n.addEventListener("click",u),u},i=e?.parentElement?.querySelector(".content-toggle__toggle"),f=e.querySelectorAll(".content-toggle__close"),E=()=>{p("--bp-medium")&&e.classList.contains("content-toggle__content--always-show-on-medium")||p("--bp-wide")&&e.classList.contains("content-toggle__content--always-show-on-wide")||p("--bp-max-width")&&e.classList.contains("content-toggle__content--always-show-on-max-width")?(i.removeAttribute("hidden"),e.setAttribute("hidden","hidden")):e.classList.contains("content-toggle__content--always-show-on-medium")||e.classList.contains("content-toggle__content--always-show-on-wide")||e.classList.contains("content-toggle__content--always-show-on-max-width")};if(window.addEventListener("resize",()=>{E()}),(()=>{document.addEventListener("click",a=>{let n=a.target,c=!n.classList.contains("content-toggle__content"),u=!n.classList.contains("content-toggle__toggle"),m=!n.classList.contains("profile-header__info__contact__toggle__button");c&&u&&m&&(!p("--bp-medium")&&e.classList.contains("content-toggle__content--is-popover--on-medium")||!p("--bp-wide")&&e.classList.contains("content-toggle__content--is-popover--on-wide")||!p("--bp-max-width")&&e.classList.contains("content-toggle__content--is-popover--on-max-width")||e.classList.contains("content-toggle__content--is-popover"))&&(i.removeAttribute("hidden"),e.setAttribute("hidden","hidden"),i.setAttribute("aria-expanded","false"),i.focus())})})(),E(),i){let a=()=>{let n=i.getAttribute("aria-expanded");typeof o=="function"&&n==="false"&&o(e,i),i.setAttribute("aria-expanded",n==="false"?"true":"false"),n==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,i),i.hasAttribute("aria-haspopup")&&(i.setAttribute("hidden","hidden"),f.forEach(c=>{l(i,c,!0)})),typeof s=="function"&&s(e,i)};i.addEventListener("click",a),r.push({element:i,clickEvent:a}),f.forEach(n=>{let c=l(i,n,!1);r.push({element:n,clickEvent:c})})}return r};var ne=()=>{let e=document.querySelector("body");(p("--bp-medium")||p("--bp-low-height"))&&e?.classList.add("body--no-scroll")},oe=()=>{document.querySelector("body")?.classList.remove("body--no-scroll")},P=e=>{e.querySelectorAll(".content-toggle__toggle").forEach(o=>{let s=o.parentElement?.querySelector(".content-toggle__content");o.setAttribute("aria-expanded","false"),s?.setAttribute("hidden","hidden")})};var S=e=>{let t=e.parentElement;return t?t.classList.contains("toolbar")?t:S(t):e},se=e=>{if(!p("--bp-medium")&&!p("--bp-low-height")){let t=k(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--toolbar-popout-allowed-edge-distance").replace("rem,",""),10)),o=parseInt(getComputedStyle(e).width.replace("px",""),10),s=e.getBoundingClientRect().x,r=document.body.offsetWidth-t-o-s;r<0&&e.style.setProperty("--toolbar-popout-edge-overflow",`${r}px`)}};var ie=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let i=.8*l.clientWidth;l.scrollLeft+=i}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?W(t):l.scrollLeft+l.clientWidth<l.scrollWidth&&B(t)}),r&&r.forEach(i=>{i.addEventListener("click",()=>{B(t),l.scrollLeft=0})}))})}})},re=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let i=.8*l.clientWidth;l.scrollLeft-=i}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?W(t):l.scrollLeft>0&&B(t)})),r&&r.forEach(i=>{i.addEventListener("click",()=>{W(t)})})})}})};function B(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function W(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}function D(e){e&&e.addEventListener("input",function(t){let o=e?.parentNode;o&&o.dataset&&(o.dataset.value=this.value)})}function L(e,t,o,s,r){let l=t?.value,i=l?.length;if(t&&l&&(t.textContent=l,i=l?.length,i&&s&&r&&o)){let E=parseInt(o,10)-i,d=Math.abs(E);r.textContent&&(r.textContent=r.textContent.replace(/\d+/,String(d))),s.textContent&&(s.textContent=s.textContent.replace(/\d+/,String(d))),E<0&&(e.classList.add("form__field__character-count--overflow"),e.setAttribute("aria-invalid","true")),E>=0&&(e.classList.remove("form__field__character-count--overflow"),e.setAttribute("aria-invalid","false"))}}function ae(e){if(e){let t=e.querySelector("textarea"),o=e.querySelector("input"),s=e.getAttribute("data-recommended-length"),r=e.getAttribute("data-allowed-length"),l=e.querySelector(".form__field__character-count__info__count-down"),i=e.querySelector(".form__field__character-count__info__overflow-count");L(e,t,s,l,i),L(e,t,r,l,i),L(e,o,s,l,i),L(e,o,r,l,i),t?.addEventListener("input",function(){L(e,t,s,l,i),L(e,t,r,l,i)}),o?.addEventListener("input",function(){L(e,o,s,l,i),L(e,o,r,l,i)})}}function le(e){e&&e.textContent&&e.textContent.length<=4&&(e.style.textAlign="center")}var z=function(){function e(t,o){for(var s=0;s<o.length;s++){var r=o[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,s){return o&&e(t.prototype,o),s&&e(t,s),t}}();function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u")return;var e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,o=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),s=function(){function d(a,n){U(this,d),this._inertManager=n,this._rootElement=a,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return z(d,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(n){this._unmanageNode(n.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(n){var c=this;i(n,function(v){return c._visitNode(v)});var u=document.activeElement;if(!document.body.contains(n)){for(var m=n,b=void 0;m;){if(m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){b=m;break}m=m.parentNode}b&&(u=b.activeElement)}n.contains(u)&&(u.blur(),u===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(n){if(n.nodeType===Node.ELEMENT_NODE){var c=n;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(t.call(c,o)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(n){var c=this._inertManager.register(n,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(n){var c=this._inertManager.deregister(n,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(n){var c=this;i(n,function(u){return c._unmanageNode(u)})}},{key:"_adoptInertRoot",value:function(n){var c=this._inertManager.getInertRoot(n);c||(this._inertManager.setInert(n,!0),c=this._inertManager.getInertRoot(n)),c.managedNodes.forEach(function(u){this._manageNode(u.node)},this)}},{key:"_onMutation",value:function(n,c){n.forEach(function(u){var m=u.target;if(u.type==="childList")e.call(u.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(u.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(u.type==="attributes"){if(u.attributeName==="tabindex")this._manageNode(m);else if(m!==this._rootElement&&u.attributeName==="inert"&&m.hasAttribute("inert")){this._adoptInertRoot(m);var b=this._inertManager.getInertRoot(m);this._managedNodes.forEach(function(v){m.contains(v.node)&&b._manageNode(v.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(n){this._savedAriaHidden=n},get:function(){return this._savedAriaHidden}}]),d}(),r=function(){function d(a,n){U(this,d),this._node=a,this._overrodeFocusMethod=!1,this._inertRoots=new Set([n]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return z(d,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var n=this._node;this._savedTabIndex!==null?n.setAttribute("tabindex",this._savedTabIndex):n.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete n.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var n=this.node;if(t.call(n,o)){if(n.tabIndex===-1&&this.hasSavedTabIndex)return;n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex),n.setAttribute("tabindex","-1"),n.nodeType===Node.ELEMENT_NODE&&(n.focus=function(){},this._overrodeFocusMethod=!0)}else n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex,n.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.add(n)}},{key:"removeInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.delete(n),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(n){this._throwIfDestroyed(),this._savedTabIndex=n},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),d}(),l=function(){function d(a){if(U(this,d),!a)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=a,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),f(a.head||a.body||a.documentElement),a.readyState==="loading"?a.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return z(d,[{key:"setInert",value:function(n,c){if(c){if(this._inertRoots.has(n))return;var u=new s(n,this);if(n.setAttribute("inert",""),this._inertRoots.set(n,u),!this._document.body.contains(n))for(var m=n.parentNode;m;)m.nodeType===11&&f(m),m=m.parentNode}else{if(!this._inertRoots.has(n))return;var b=this._inertRoots.get(n);b.destructor(),this._inertRoots.delete(n),n.removeAttribute("inert")}}},{key:"getInertRoot",value:function(n){return this._inertRoots.get(n)}},{key:"register",value:function(n,c){var u=this._managedNodes.get(n);return u!==void 0?u.addInertRoot(c):u=new r(n,c),this._managedNodes.set(n,u),u}},{key:"deregister",value:function(n,c){var u=this._managedNodes.get(n);return u?(u.removeInertRoot(c),u.destroyed&&this._managedNodes.delete(n),u):null}},{key:"_onDocumentLoaded",value:function(){var n=e.call(this._document.querySelectorAll("[inert]"));n.forEach(function(c){this.setInert(c,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(n,c){var u=this;n.forEach(function(m){switch(m.type){case"childList":e.call(m.addedNodes).forEach(function(g){if(g.nodeType===Node.ELEMENT_NODE){var y=e.call(g.querySelectorAll("[inert]"));t.call(g,"[inert]")&&y.unshift(g),y.forEach(function(h){this.setInert(h,!0)},u)}},u);break;case"attributes":if(m.attributeName!=="inert")return;var b=m.target,v=b.hasAttribute("inert");u.setInert(b,v);break}},this)}}]),d}();function i(d,a,n){if(d.nodeType==Node.ELEMENT_NODE){var c=d;a&&a(c);var u=c.shadowRoot;if(u){i(u,a,u);return}if(c.localName=="content"){for(var m=c,b=m.getDistributedNodes?m.getDistributedNodes():[],v=0;v<b.length;v++)i(b[v],a,n);return}if(c.localName=="slot"){for(var g=c,y=g.assignedNodes?g.assignedNodes({flatten:!0}):[],h=0;h<y.length;h++)i(y[h],a,n);return}}for(var _=d.firstChild;_!=null;)i(_,a,n),_=_.nextSibling}function f(d){if(!d.querySelector("style#inert-style, link#inert-style")){var a=document.createElement("style");a.setAttribute("id","inert-style"),a.textContent=`
|
|
2
|
-
[inert] {
|
|
3
|
-
pointer-events: none;
|
|
4
|
-
cursor: default;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
[inert], [inert] * {
|
|
8
|
-
-webkit-user-select: none;
|
|
9
|
-
-moz-user-select: none;
|
|
10
|
-
-ms-user-select: none;
|
|
11
|
-
user-select: none;
|
|
12
|
-
}
|
|
13
|
-
`,d.appendChild(a)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var E=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(a){E.setInert(this,a)}})}})();var x=(e,t,o=()=>{})=>{let s=document.getElementById(e);if(s){s.classList.remove("modal-view--visible"),s.inert=!0;let r=document.querySelector(".page");r&&(r.classList.remove("page--blur"),r.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},ce=(e,t,o=()=>{},s=!0)=>{let r=document.getElementById(e),l=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let i=document.querySelector(".page");i&&(i.classList.add("page--blur"),i.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let f=d=>{d.target===r&&x(e,t,o)},E=d=>{d.key==="Escape"&&x(e,t,o)};s&&(r.addEventListener("click",f),window.addEventListener("keyup",E),l.push({element:r,clickEvent:f}),l.push({element:window,keyUpEvent:E}))}return l};var N=0;$(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(h=>t.push({domElement:h,rendered:!1})),O(t),j();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(h=>C(o,h)),Y(o),document.querySelectorAll(".table--wrap-medium-width, .table--wrap-default-width").forEach(h=>ee(h));let r=document.querySelectorAll(".table__row--flash-attention, .table__row--flash-confirm, .table__row--flash-warning");w(r);let l=document.querySelectorAll("#demo-button--attention, #demo-button--confirm, #demo-button--warning");te(l,r);let i=document.querySelectorAll(".button"),f=document.querySelectorAll(".progress-bar__progress.progress-bar__progress--confirm.progress-bar__progress--transistion-from-start");i.forEach(h=>{h.addEventListener("click",()=>{f.forEach(_=>{_.classList.toggle("progress-bar__progress--transistion-from-start")})})}),document.querySelectorAll(".form__field__character-count").forEach(h=>{ae(h)});let d=document.getElementById("autoexpand");D(d),window.onload=function(){D(d)},document.querySelectorAll(".stepper__item__label").forEach(h=>{le(h)}),document.querySelectorAll(".copy-to-clipboard").forEach(h=>J(h,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),Z(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(h=>{R(h)});let u=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),m=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");ie(u),re(m),document.querySelectorAll(".horizontal-scroll").forEach(h=>{H(h),window.addEventListener("resize",()=>{H(h)})}),document.querySelectorAll(".switch__segment").forEach(h=>{h.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(M=>{H(M)})})}),document.querySelectorAll(".toolbar .content-toggle__content").forEach(h=>{R(h,_=>{se(_),ne()},_=>P(S(_)),(_,M)=>{let V=M.getAttribute("aria-expanded"),I=S(_);V==="true"?I?.classList.add("toolbar--has-popout"):I?.classList.remove("toolbar--has-popout"),_.addEventListener("click",F=>{F.target.classList.contains("toolbar__popout")&&!T(F,"toolbar__filter__content")&&(P(I),oe())})})}),document.querySelectorAll("[data-modal]").forEach(h=>{let _=h.getAttribute("data-modal");document.getElementById(_)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{x(_,h)}),h.addEventListener("click",()=>{ce(_,h)})}),window.addEventListener("load",()=>{N=window.innerWidth}),window.addEventListener("resize",()=>{N>0&&window.innerWidth!==N&&(N=window.innerWidth,o.forEach(h=>C(o,h)),O(t))})});})();
|
|
14
|
-
//# sourceMappingURL=app.js.map
|
|
1
|
+
(()=>{var de=e=>{document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)},$=de;var A=e=>{navigator.clipboard.writeText(e).then(()=>console.log(`${e} written to clipboard`))},T=(e,t)=>{let o=!1;return e.composedPath().forEach(r=>{r.classList&&r.classList.contains(t)&&(o=!0)}),o},j=()=>{let e=document.querySelector("body");if(e){let t=window.getComputedStyle(e).getPropertyValue("--color-background"),o=document.querySelector('meta[name="theme-color"]');if(o)o.content=t;else{let s=document.createElement("meta");s.name="theme-color",s.content=t,document.getElementsByTagName("head")[0].appendChild(s)}}},K=()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10),k=e=>e*16,p=e=>{let t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=k(parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("rem",""),10));return t<o};var ue=e=>e.offsetWidth!==e.scrollWidth;var H=e=>{e.classList.contains("horizontal-scroll--no-overflow")&&e.classList.remove("horizontal-scroll--no-overflow");let t=e.querySelector(".horizontal-scroll--check-overflow .tabbed-content__section:not([hidden]) .horizontal-scroll__scrollable-content");t===null&&!t&&(t=e.querySelector(".horizontal-scroll--check-overflow .horizontal-scroll__scrollable-content")),t&&(ue(t)?t?.setAttribute("tabindex","0"):(e.classList.add("horizontal-scroll--no-overflow"),t?.removeAttribute("tabindex")))};var G=e=>{let t=e.parentElement;return t?t.classList.contains("nav")?t:G(t):e},Q=(e,t=null)=>{let o="nav--toggled";e.forEach(s=>{let r=s.querySelector(".nav__toggle");s!==t&&(s.classList.contains(o)&&(r.focus(),r.setAttribute("aria-expanded","false")),s.classList.remove(o))})},Y=e=>{let t=r=>{let l=G(r),i=l.querySelector(".nav__items"),f=i?.querySelector(".nav__item:last-of-type");i?.classList.add("nav__items--fadeout");let E=i?.querySelector(".nav__item--is-overflown");E&&E.focus();let d=()=>{l.classList.toggle("nav--toggled"),i?.classList.remove("nav__items--fadeout"),f?.removeEventListener("transitionend",d)};return f?.addEventListener("transitionend",d),l},o=[];return document.querySelectorAll(".nav__toggle").forEach(r=>{let l=()=>{let i=t(r),f=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded",f==="false"?"true":"false"),Q(e,i)};o.push({element:r,clickEvent:l}),r.addEventListener("click",l)}),o},C=(e,t)=>{let o="nav--toggled",s="nav__items";t.classList.remove(o);let r=t.querySelector(`.${s}`);if(r){let i=r.querySelectorAll(".nav__item"),f="nav__item--is-overflown",E="nav--has-overflow",d="nav__item--active",a=!1;for(let n=i.length-1;n>=0;n-=1){let c=i[n];c.offsetTop>0?(c.classList.add(f),t.classList.add(E),a=!0):c.classList.contains(d)||c.classList.remove(f)}if(!a){t.classList.remove(E);let n=t.querySelector(`.${d}`);n&&n.classList.remove(f)}}let l=i=>{!i.target.classList.contains("nav__toggle")&&!T(i,s)&&Q(e)};return document.querySelector("body")?.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}};var X=(e,t,o,s,r)=>{if(s&&o){A(s.innerText),t.classList.add("copy-to-clipboard--confirm"),t===o&&t.classList.add("copy-to-clipboard--done");let l=document.createElement("span");l.classList.add("copy-to-clipboard__this__confirm-message"),l.innerText=e,s.appendChild(l),o.removeEventListener("click",r),setTimeout(()=>{t.classList.remove("copy-to-clipboard--confirm"),l.remove(),o.addEventListener("click",r)},1200)}},J=(e,t="Kopieret!")=>{let o=e.querySelector(".copy-to-clipboard__this");if(e.type==="button"){let s=()=>{X(t,e,e,o,s)};e.addEventListener("click",s)}else{let s=e.querySelector(".copy-to-clipboard__execute"),r=()=>{X(t,e,s,o,r)};s?.addEventListener("click",r)}};var fe=()=>{let e=document.querySelectorAll(".copy-to-clipboard"),t=document.querySelectorAll(".copy-to-clipboard__color");e.forEach(o=>{o.addEventListener("click",()=>{let s=o.parentElement?.querySelector(".copy-to-clipboard__color");if(s){let r=getComputedStyle(s).getPropertyValue("background-color"),l=me(r);console.log(l),A(l.replace(/"/g,""))}})})};function me(e){var t=e.match(/\d+/g),o="#"+t.map(function(s){var r=parseInt(s).toString(16);return r.length===1?"0"+r:r}).join("");return o}var Z=fe;var ee=e=>{let t=e.querySelector("thead"),o=e.querySelector("tbody"),s=e.querySelector("tfoot");if(t){let r=[];t.querySelectorAll("th").forEach(f=>{f.classList.contains("table__cell--self-explanatory")?r.push(""):r.push(f.innerHTML)});let i=[];o&&i.push(o),s&&i.push(s),i.forEach(f=>{f.querySelectorAll("tr").forEach(d=>{d.querySelectorAll("td, th").forEach((n,c)=>{r[c]&&n.setAttribute("data-label",r[c])})})})}};function te(e,t){e.forEach(o=>{o.addEventListener("click",()=>{o.id==="demo-button--attention"&&t.forEach(s=>{s.id==="table__row--flash-attention"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-attention"),w(t))}),o.id==="demo-button--confirm"&&t.forEach(s=>{s.id==="table__row--flash-confirm"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-confirm"),w(t))}),o.id==="demo-button--warning"&&t.forEach(s=>{s.id==="table__row--flash-warning"&&(s.classList.remove("table__row--flash-transparent"),s.classList.add("table__row--flash-warning"),w(t))})})})}function w(e){setTimeout(()=>{e.forEach(t=>{t.classList.contains("table__row--flash-attention")&&t.classList.remove("table__row--flash-attention"),t.classList.contains("table__row--flash-confirm")&&t.classList.remove("table__row--flash-confirm"),t.classList.contains("table__row--flash-warning")&&t.classList.remove("table__row--flash-warning"),t.classList.add("table__row--flash-transparent")})},1e3)}var he=e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1,ve=e=>{let o=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/K(),s=he(e);return s>-1?o<s:!0},Ee=e=>{let o=e.querySelector(".nav__items")?.querySelectorAll("a"),s=[];e.querySelectorAll("section").forEach(l=>{l.parentNode===e&&s.push(l)}),o?.forEach(l=>{l.removeAttribute("aria-selected"),l.classList.remove("nav__item--active")}),s.forEach(l=>{l.hidden=!1,l.removeAttribute("role")})};var q=(e,t,o,s,r,l=!0,i=f=>console.log(f))=>{l&&s.focus(),s.removeAttribute("tabindex"),s.setAttribute("aria-selected","true"),s.classList.contains("switch__segment")?s.classList.add("switch__segment--active"):s.classList.add("nav__item--active"),o&&(o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1"),o.classList.contains("switch__segment")?o.classList.remove("switch__segment--active"):o.classList.remove("nav__item--active"));let f=Array.prototype.indexOf.call(e,s);if(Array.from(document.querySelectorAll(`[data-for="${t[f].id}"]`)).forEach(d=>{d.classList.add("tabbed-content-peripheral--active"),d.hidden=!1}),t[f].hidden=!1,o){let d=Array.prototype.indexOf.call(e,o);Array.from(document.querySelectorAll(`[data-for="${t[d].id}"]`)).forEach(n=>{n.classList.remove("tabbed-content-peripheral--active"),n.hidden=!0}),t[d].hidden=!0}s.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:f}})),i(f)},be=(e,t,o=0,s=!0,r=l=>console.log(l))=>{let l=t.querySelector(".switch,.nav__items"),i=l.querySelectorAll("a"),f=[];t.querySelectorAll("section").forEach(a=>{a.parentNode===t&&f.push(a)});let d=t.querySelector("button.tabbed-content__expand-all");if(d){let a=()=>{l.hidden=!0,f.forEach(n=>{n.hidden=!1})};d.removeEventListener("click",a),d.addEventListener("click",a)}l.setAttribute("role","tablist"),i.forEach((a,n)=>{a.setAttribute("role","tab"),a.setAttribute("id",`tab${e}_${n+1}`),a.setAttribute("tabindex","-1"),a.parentElement?.setAttribute("role","presentation");let c=m=>{m.preventDefault();let b=l.querySelector("[aria-selected]");m.currentTarget!==b&&q(i,f,b,m.currentTarget,t.classList,!0,v=>{r(v)})};a.removeEventListener("click",c),a.addEventListener("click",c);let u=m=>{let b=Array.prototype.indexOf.call(i,m.currentTarget),v=null;m.key==="ArrowLeft"&&(v=b-1),m.key==="ArrowRight"&&(v=b+1),m.key==="ArrowDown"&&(v="down"),v!==null&&(m.preventDefault(),v==="down"?f[n].focus():i[v]&&q(i,f,m.currentTarget,i[v],t.classList,!0,g=>{r(g)}))};a.removeEventListener("keydown",u),a.addEventListener("keydown",u)}),f.forEach((a,n)=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-labelledby",i[n].id),a.hidden=!0,a.setAttribute("role","tabpanel")}),o>-1&&q(i,f,null,i[o],t.classList,s)},O=e=>{e.forEach((t,o)=>{let{rendered:s,domElement:r}=t;if(ve(r.classList)){if(!s){let l=r.getAttribute("data-focus-onload"),i=r.getAttribute("data-initial-tab"),f=i?parseInt(i,10):0;be(o,r,f,l!=="false"),t.rendered=!0}}else s&&(Ee(r),t.rendered=!1)})};var R=(e,t,o,s)=>{let r=[],l=(a,n,c)=>{c&&n.focus();let u=()=>{e.setAttribute("hidden","hidden"),a.removeAttribute("hidden"),a.setAttribute("aria-expanded","false"),a.focus()};return n.addEventListener("click",u),u},i=e?.parentElement?.querySelector(".content-toggle__toggle"),f=e.querySelectorAll(".content-toggle__close"),E=()=>{p("--bp-medium")&&e.classList.contains("content-toggle__content--always-show-on-medium")||p("--bp-wide")&&e.classList.contains("content-toggle__content--always-show-on-wide")||p("--bp-max-width")&&e.classList.contains("content-toggle__content--always-show-on-max-width")?(i.removeAttribute("hidden"),e.setAttribute("hidden","hidden")):e.classList.contains("content-toggle__content--always-show-on-medium")||e.classList.contains("content-toggle__content--always-show-on-wide")||e.classList.contains("content-toggle__content--always-show-on-max-width")};if(window.addEventListener("resize",()=>{E()}),(()=>{document.addEventListener("click",a=>{let n=a.target,c=!n.classList.contains("content-toggle__content"),u=!n.classList.contains("content-toggle__toggle"),m=!n.classList.contains("profile-header__info__contact__toggle__button");c&&u&&m&&(!p("--bp-medium")&&e.classList.contains("content-toggle__content--is-popover--on-medium")||!p("--bp-wide")&&e.classList.contains("content-toggle__content--is-popover--on-wide")||!p("--bp-max-width")&&e.classList.contains("content-toggle__content--is-popover--on-max-width")||e.classList.contains("content-toggle__content--is-popover"))&&(i.removeAttribute("hidden"),e.setAttribute("hidden","hidden"),i.setAttribute("aria-expanded","false"),i.focus())})})(),E(),i){let a=()=>{let n=i.getAttribute("aria-expanded");typeof o=="function"&&n==="false"&&o(e,i),i.setAttribute("aria-expanded",n==="false"?"true":"false"),n==="true"?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),typeof t=="function"&&t(e,i),i.hasAttribute("aria-haspopup")&&(i.setAttribute("hidden","hidden"),f.forEach(c=>{l(i,c,!0)})),typeof s=="function"&&s(e,i)};i.addEventListener("click",a),r.push({element:i,clickEvent:a}),f.forEach(n=>{let c=l(i,n,!1);r.push({element:n,clickEvent:c})})}return r};var ne=()=>{let e=document.querySelector("body");(p("--bp-medium")||p("--bp-low-height"))&&e?.classList.add("body--no-scroll")},oe=()=>{document.querySelector("body")?.classList.remove("body--no-scroll")},P=e=>{e.querySelectorAll(".content-toggle__toggle").forEach(o=>{let s=o.parentElement?.querySelector(".content-toggle__content");o.setAttribute("aria-expanded","false"),s?.setAttribute("hidden","hidden")})};var S=e=>{let t=e.parentElement;return t?t.classList.contains("toolbar")?t:S(t):e},se=e=>{if(!p("--bp-medium")&&!p("--bp-low-height")){let t=k(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--toolbar-popout-allowed-edge-distance").replace("rem,",""),10)),o=parseInt(getComputedStyle(e).width.replace("px",""),10),s=e.getBoundingClientRect().x,r=document.body.offsetWidth-t-o-s;r<0&&e.style.setProperty("--toolbar-popout-edge-overflow",`${r}px`)}};var ie=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let i=.8*l.clientWidth;l.scrollLeft+=i}),l.addEventListener("scroll",()=>{l.scrollLeft+l.clientWidth>=l.scrollWidth*.98?W(t):l.scrollLeft+l.clientWidth<l.scrollWidth&&B(t)}),r&&r.forEach(i=>{i.addEventListener("click",()=>{B(t),l.scrollLeft=0})}))})}})},re=e=>{e&&e.forEach(t=>{let o=t?.parentElement?.parentElement?.parentElement?.parentElement;if(o){let s=o.querySelectorAll(".horizontal-scroll__scrollable-content"),r=o.querySelectorAll(".switch__segment");s.forEach(l=>{l&&(t.addEventListener("click",()=>{let i=.8*l.clientWidth;l.scrollLeft-=i}),l.addEventListener("scroll",()=>{l.scrollLeft<=0?W(t):l.scrollLeft>0&&B(t)})),r&&r.forEach(i=>{i.addEventListener("click",()=>{W(t)})})})}})};function B(e){e.classList.remove("visually-disabled"),e.setAttribute("aria-disabled","false")}function W(e){e.classList.add("visually-disabled"),e.setAttribute("aria-disabled","true")}function D(e){e&&e.addEventListener("input",function(t){let o=e?.parentNode;o&&o.dataset&&(o.dataset.value=this.value)})}function L(e,t,o,s,r){let l=t?.value,i=l?.length;if(t&&l&&(t.textContent=l,i=l?.length,i&&s&&r&&o)){let E=parseInt(o,10)-i,d=Math.abs(E);r.textContent&&(r.textContent=r.textContent.replace(/\d+/,String(d))),s.textContent&&(s.textContent=s.textContent.replace(/\d+/,String(d))),E<0&&(e.classList.add("form__field__character-count--overflow"),e.setAttribute("aria-invalid","true")),E>=0&&(e.classList.remove("form__field__character-count--overflow"),e.setAttribute("aria-invalid","false"))}}function ae(e){if(e){let t=e.querySelector("textarea"),o=e.querySelector("input"),s=e.getAttribute("data-recommended-length"),r=e.getAttribute("data-allowed-length"),l=e.querySelector(".form__field__character-count__info__count-down"),i=e.querySelector(".form__field__character-count__info__overflow-count");L(e,t,s,l,i),L(e,t,r,l,i),L(e,o,s,l,i),L(e,o,r,l,i),t?.addEventListener("input",function(){L(e,t,s,l,i),L(e,t,r,l,i)}),o?.addEventListener("input",function(){L(e,o,s,l,i),L(e,o,r,l,i)})}}function le(e){e&&e.textContent&&e.textContent.length<=4&&(e.style.textAlign="center")}var z=function(){function e(t,o){for(var s=0;s<o.length;s++){var r=o[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,s){return o&&e(t.prototype,o),s&&e(t,s),t}}();function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){if(typeof window>"u")return;var e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,o=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),s=function(){function d(a,n){U(this,d),this._inertManager=n,this._rootElement=a,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return z(d,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(n){this._unmanageNode(n.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(n){var c=this;i(n,function(v){return c._visitNode(v)});var u=document.activeElement;if(!document.body.contains(n)){for(var m=n,b=void 0;m;){if(m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){b=m;break}m=m.parentNode}b&&(u=b.activeElement)}n.contains(u)&&(u.blur(),u===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(n){if(n.nodeType===Node.ELEMENT_NODE){var c=n;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(t.call(c,o)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(n){var c=this._inertManager.register(n,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(n){var c=this._inertManager.deregister(n,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(n){var c=this;i(n,function(u){return c._unmanageNode(u)})}},{key:"_adoptInertRoot",value:function(n){var c=this._inertManager.getInertRoot(n);c||(this._inertManager.setInert(n,!0),c=this._inertManager.getInertRoot(n)),c.managedNodes.forEach(function(u){this._manageNode(u.node)},this)}},{key:"_onMutation",value:function(n,c){n.forEach(function(u){var m=u.target;if(u.type==="childList")e.call(u.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(u.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(u.type==="attributes"){if(u.attributeName==="tabindex")this._manageNode(m);else if(m!==this._rootElement&&u.attributeName==="inert"&&m.hasAttribute("inert")){this._adoptInertRoot(m);var b=this._inertManager.getInertRoot(m);this._managedNodes.forEach(function(v){m.contains(v.node)&&b._manageNode(v.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(n){this._savedAriaHidden=n},get:function(){return this._savedAriaHidden}}]),d}(),r=function(){function d(a,n){U(this,d),this._node=a,this._overrodeFocusMethod=!1,this._inertRoots=new Set([n]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return z(d,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var n=this._node;this._savedTabIndex!==null?n.setAttribute("tabindex",this._savedTabIndex):n.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete n.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var n=this.node;if(t.call(n,o)){if(n.tabIndex===-1&&this.hasSavedTabIndex)return;n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex),n.setAttribute("tabindex","-1"),n.nodeType===Node.ELEMENT_NODE&&(n.focus=function(){},this._overrodeFocusMethod=!0)}else n.hasAttribute("tabindex")&&(this._savedTabIndex=n.tabIndex,n.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.add(n)}},{key:"removeInertRoot",value:function(n){this._throwIfDestroyed(),this._inertRoots.delete(n),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(n){this._throwIfDestroyed(),this._savedTabIndex=n},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),d}(),l=function(){function d(a){if(U(this,d),!a)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=a,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),f(a.head||a.body||a.documentElement),a.readyState==="loading"?a.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return z(d,[{key:"setInert",value:function(n,c){if(c){if(this._inertRoots.has(n))return;var u=new s(n,this);if(n.setAttribute("inert",""),this._inertRoots.set(n,u),!this._document.body.contains(n))for(var m=n.parentNode;m;)m.nodeType===11&&f(m),m=m.parentNode}else{if(!this._inertRoots.has(n))return;var b=this._inertRoots.get(n);b.destructor(),this._inertRoots.delete(n),n.removeAttribute("inert")}}},{key:"getInertRoot",value:function(n){return this._inertRoots.get(n)}},{key:"register",value:function(n,c){var u=this._managedNodes.get(n);return u!==void 0?u.addInertRoot(c):u=new r(n,c),this._managedNodes.set(n,u),u}},{key:"deregister",value:function(n,c){var u=this._managedNodes.get(n);return u?(u.removeInertRoot(c),u.destroyed&&this._managedNodes.delete(n),u):null}},{key:"_onDocumentLoaded",value:function(){var n=e.call(this._document.querySelectorAll("[inert]"));n.forEach(function(c){this.setInert(c,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(n,c){var u=this;n.forEach(function(m){switch(m.type){case"childList":e.call(m.addedNodes).forEach(function(g){if(g.nodeType===Node.ELEMENT_NODE){var y=e.call(g.querySelectorAll("[inert]"));t.call(g,"[inert]")&&y.unshift(g),y.forEach(function(h){this.setInert(h,!0)},u)}},u);break;case"attributes":if(m.attributeName!=="inert")return;var b=m.target,v=b.hasAttribute("inert");u.setInert(b,v);break}},this)}}]),d}();function i(d,a,n){if(d.nodeType==Node.ELEMENT_NODE){var c=d;a&&a(c);var u=c.shadowRoot;if(u){i(u,a,u);return}if(c.localName=="content"){for(var m=c,b=m.getDistributedNodes?m.getDistributedNodes():[],v=0;v<b.length;v++)i(b[v],a,n);return}if(c.localName=="slot"){for(var g=c,y=g.assignedNodes?g.assignedNodes({flatten:!0}):[],h=0;h<y.length;h++)i(y[h],a,n);return}}for(var _=d.firstChild;_!=null;)i(_,a,n),_=_.nextSibling}function f(d){if(!d.querySelector("style#inert-style, link#inert-style")){var a=document.createElement("style");a.setAttribute("id","inert-style"),a.textContent=`
|
|
2
|
+
[inert] {
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
cursor: default;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[inert], [inert] * {
|
|
8
|
+
-webkit-user-select: none;
|
|
9
|
+
-moz-user-select: none;
|
|
10
|
+
-ms-user-select: none;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
`,d.appendChild(a)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var E=new l(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(a){E.setInert(this,a)}})}})();var x=(e,t,o=()=>{})=>{let s=document.getElementById(e);if(s){s.classList.remove("modal-view--visible"),s.inert=!0;let r=document.querySelector(".page");r&&(r.classList.remove("page--blur"),r.inert=!1),document.querySelector("body")?.classList.remove("body--no-scroll"),t.focus(),t.setAttribute("aria-expanded","false"),o()}},ce=(e,t,o=()=>{},s=!0)=>{let r=document.getElementById(e),l=[];if(r){r.classList.add("modal-view--visible"),r.inert=!1;let i=document.querySelector(".page");i&&(i.classList.add("page--blur"),i.inert=!0),document.querySelector("body")?.classList.add("body--no-scroll"),t.setAttribute("aria-expanded","true"),r.focus();let f=d=>{d.target===r&&x(e,t,o)},E=d=>{d.key==="Escape"&&x(e,t,o)};s&&(r.addEventListener("click",f),window.addEventListener("keyup",E),l.push({element:r,clickEvent:f}),l.push({element:window,keyUpEvent:E}))}return l};var N=0;$(()=>{let e=document.querySelectorAll(".tabbed-content"),t=[];e.forEach(h=>t.push({domElement:h,rendered:!1})),O(t),j();let o=document.querySelectorAll(".nav:not(.nav--vertical)");o.forEach(h=>C(o,h)),Y(o),document.querySelectorAll(".table--wrap-medium-width, .table--wrap-default-width").forEach(h=>ee(h));let r=document.querySelectorAll(".table__row--flash-attention, .table__row--flash-confirm, .table__row--flash-warning");w(r);let l=document.querySelectorAll("#demo-button--attention, #demo-button--confirm, #demo-button--warning");te(l,r);let i=document.querySelectorAll(".button"),f=document.querySelectorAll(".progress-bar__progress.progress-bar__progress--confirm.progress-bar__progress--transistion-from-start");i.forEach(h=>{h.addEventListener("click",()=>{f.forEach(_=>{_.classList.toggle("progress-bar__progress--transistion-from-start")})})}),document.querySelectorAll(".form__field__character-count").forEach(h=>{ae(h)});let d=document.getElementById("autoexpand");D(d),window.onload=function(){D(d)},document.querySelectorAll(".stepper__item__label").forEach(h=>{le(h)}),document.querySelectorAll(".copy-to-clipboard").forEach(h=>J(h,document.querySelector("html")?.getAttribute("lang")==="en"?"Hexcode copied!":"Hexkode kopieret!")),Z(),document.querySelectorAll(".content-toggle__content:not(.toolbar .content-toggle__content)").forEach(h=>{R(h)});let u=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-next"),m=document.querySelectorAll(".button.button--small.button--icon.button--icon--hide-label.icon-previous");ie(u),re(m),document.querySelectorAll(".horizontal-scroll").forEach(h=>{H(h),window.addEventListener("resize",()=>{H(h)})}),document.querySelectorAll(".switch__segment").forEach(h=>{h.addEventListener("click",()=>{document.querySelectorAll(".horizontal-scroll").forEach(M=>{H(M)})})}),document.querySelectorAll(".toolbar .content-toggle__content").forEach(h=>{R(h,_=>{se(_),ne()},_=>P(S(_)),(_,M)=>{let V=M.getAttribute("aria-expanded"),I=S(_);V==="true"?I?.classList.add("toolbar--has-popout"):I?.classList.remove("toolbar--has-popout"),_.addEventListener("click",F=>{F.target.classList.contains("toolbar__popout")&&!T(F,"toolbar__filter__content")&&(P(I),oe())})})}),document.querySelectorAll("[data-modal]").forEach(h=>{let _=h.getAttribute("data-modal");document.getElementById(_)?.querySelector(".modal-view__close")?.addEventListener("click",()=>{x(_,h)}),h.addEventListener("click",()=>{ce(_,h)})}),window.addEventListener("load",()=>{N=window.innerWidth}),window.addEventListener("resize",()=>{N>0&&window.innerWidth!==N&&(N=window.innerWidth,o.forEach(h=>C(o,h)),O(t))})});})();
|
|
14
|
+
//# sourceMappingURL=app.js.map
|