@iamproperty/components 5.4.2-beta3 → 5.4.2-beta4
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/assets/css/components/actionbar.global.css +1 -1
- package/assets/css/components/actionbar.global.css.map +1 -1
- package/assets/css/components/table.global.css +1 -1
- package/assets/css/components/table.global.css.map +1 -1
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- package/assets/css/style.min.css +1 -1
- package/assets/css/style.min.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +3 -3
- package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.js +3 -0
- package/assets/js/components/nav/nav.component.min.js +2 -2
- package/assets/js/components/nav/nav.component.min.js.map +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +2 -2
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +1 -1
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/sass/components/actionbar.global.scss +1 -0
- package/assets/sass/components/table.global.scss +7 -2
- package/assets/sass/elements/details.scss +1 -1
- package/assets/sass/elements/table.element.scss +1 -1
- package/assets/ts/components/actionbar/actionbar.component.ts +1 -1
- package/assets/ts/components/nav/nav.component.ts +6 -0
- package/dist/components.es.js +11 -11
- package/dist/components.umd.js +25 -25
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function h(d,m){function u(e,t){let l=!1,r=t.getAttribute("name");r.includes("[]")&&(r=r.replace("[]",`[${t.value}]`));let i=e.querySelector(`[data-name="${r}"]`);i&&t.getAttribute("type")=="checkbox"&&(l=!t.checked);let o=t.getAttribute("data-filter-text");if(i||(i=document.createElement("button"),e.appendChild(i)),i.setAttribute("type","button"),i.classList.add("filter"),i.setAttribute("data-name",r),i.innerHTML=o.replace("$value",t.value),(!t.value||l)&&i.remove(),t.parentNode.closest("[data-filter-text]")){let p=t.parentNode.closest("[data-filter-text]"),f=!0;if(r="",p.querySelectorAll("input").forEach((a,n)=>{let s=a.getAttribute("name");if(r+=`${n!=0?",":""}${s}`,e.querySelector(`[data-name="${s}"]`)&&e.querySelector(`[data-name="${s}"]`).remove(),a.value){let c=document.createElement("button");c.setAttribute("type","button"),c.classList.add("filter"),c.setAttribute("data-name",s),c.innerHTML=o.replace("$value",a.value),e.appendChild(c)}else f=!1}),e.querySelector(`[data-name="${r}"]`)&&e.querySelector(`[data-name="${r}"]`).remove(),f){let a=p.getAttribute("data-filter-text");p.querySelectorAll("input").forEach((s,c)=>{let b=s.getAttribute("name");e.querySelector(`[data-name="${b}"]`)&&e.querySelector(`[data-name="${b}"]`).remove(),a=a.replace(`$${c+1}`,s.value)});let n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",r),n.innerHTML=a,e.appendChild(n)}}}Array.from(d.querySelectorAll('input[type="checkbox"]:checked')).forEach((e,t)=>{u(m,e)}),Array.from(d.querySelectorAll("input[data-filter-text]")).forEach((e,t)=>{e.addEventListener("change",function(l){u(m,e),l.stopPropagation()})}),d.addEventListener("change",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest("input[data-filter-text]")){let t=e.target.closest("input[data-filter-text]");u(m,t)}}),m.addEventListener("click",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){let r=e.target.closest(".filter"),i=r.getAttribute("data-name").split(",");for(var t=0;t<i.length;t++){let o=i[t],p=`[name="${o}"]`;o.match(/\[(.*)\]/)&&(o.replace(/\[(.*)\]/,"[]"),p=`[value="${o.replace(/.*\[(.*)\]/,"$1")}"]`);let f=d.querySelectorAll(p);for(var l=0;l<f.length;l++){let a=f[l];if(a.getAttribute("type")!="radio"&&a.getAttribute("type")!="checkbox")a.value="";else{a.checked=!1;var e=new Event("force");d.hasAttribute("data-nosubmit")||a.closest("form").dispatchEvent(e)}}}r.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const m=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",u=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${m}/css/core.min.css`;let e=this.classList.toString();const t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let e=this.classList.toString();const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function h(c,o){const r=o.querySelector(".files"),l=o.querySelector(".drop-area"),t=c.querySelector("input"),u=c.hasAttribute("data-maxsize")?c.getAttribute("data-maxsize"):0,a=t.cloneNode();l.append(a),o.addEventListener("click",e=>{e&&e.target instanceof HTMLElement&&e.target.closest(".btn-primary")&&(e.target.closest(".btn-primary"),(t.hasAttribute("multiple")?a:t).click())}),o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest(".files button")){const i=new DataTransfer,{files:d}=t,p=e.target.closest(".files button");for(let n=0;n<d.length;n++){const s=d[n];s.name!=p.getAttribute("data-file")&&i.items.add(s)}t.files=i.files;const m=new Event("change");t.dispatchEvent(m)}}),a.addEventListener("change",e=>{if(t.hasAttribute("multiple")){const d=[...t.files,...a.files];let p=[];const m=new DataTransfer;for(let n=0;n<d.length;n++){const s=d[n],f=s.size/1e3;!p.includes(s.name)&&(u==0||f<u)&&m.items.add(s),p.push(s.name)}t.files=m.files}else t.files=a.files;const i=new Event("change");t.dispatchEvent(i)}),a.addEventListener("dragenter",e=>{a.classList.add("focus")}),a.addEventListener("dragleave",e=>{a.classList.remove("focus")}),a.addEventListener("drop",e=>{a.classList.remove("focus")}),t.addEventListener("change",e=>{r.innerHTML="";for(const i of t.files)r.innerHTML+=`<span class="file">${i.name} <button data-file="${i.name}">Remove</button></span>`})}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,l=document.createElement("template");l.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let i=e.textContent.toLowerCase();e.classList.add("d-none"),i.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -136,6 +136,9 @@ class iamNav extends HTMLElement {
|
|
|
136
136
|
}, false);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
+
this.querySelectorAll('details').forEach(function (element) {
|
|
140
|
+
element.classList.add('details--revert');
|
|
141
|
+
});
|
|
139
142
|
// Has secondary link
|
|
140
143
|
if (this.querySelector('a[slot="secondary"]')) {
|
|
141
144
|
menu.classList.add('has-secondary');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class v extends HTMLElement{constructor(){super();const s=this.attachShadow({mode:"open"}),n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
<div class="backdrop" part="backdrop"></div>
|
|
37
37
|
`,s.appendChild(i.content.cloneNode(!0)),document.getElementById("navGlobal")||document.head.insertAdjacentHTML("beforeend",`<style id="navGlobal">body:has(iam-nav.open:not(.nav--sticky):not(.nav--xs-sticky)){max-height:100vh;overflow:hidden}body{--nav-height: 6rem;--sticky-padding: 0px}body:has(iam-nav a[slot=secondary]){--nav-height: 8.5rem}body:has(iam-nav.nav--sticky){--sticky-padding: var(--nav-height)}nav:has(iam-nav){min-height:6rem;display:block;position:relative}nav:has(iam-nav) iam-nav{position:absolute;top:0;left:0;width:100%;z-index:var(--index-menu)}@media screen and (min-width: 62em){nav:has(iam-nav a[slot=secondary]){min-height:8.5rem}}nav:has(iam-nav.nav--sticky) iam-nav{position:fixed}@media screen and (max-width: 36em){body:has(iam-nav.open:not(.nav--xs-sticky)){max-height:100vh;overflow:hidden}nav:has(iam-nav.nav--xs-sticky) iam-nav{position:fixed}}@media screen and (min-width: 36em){body:has(iam-nav.open:not(.nav--sticky)){max-height:100vh;overflow:hidden}}iam-nav{--nav-height: 6rem;overscroll-behavior:contain !important;background-color:var(--colour-canvas);display:block;margin-left:auto;margin-right:auto;padding:var(--container-padding);padding-top:1.5rem;padding-bottom:1.5rem;width:100%}iam-nav:has(a[slot=secondary]){--nav-height: 8.5rem}iam-nav .brand{font-size:3rem;height:3rem;padding:0;text-decoration:none;min-width:min(var(--svg-width),14rem);margin-right:auto}iam-nav .brand img{height:100%;width:auto}iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card)){text-decoration:none}iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card)) .badge{position:absolute;right:0;top:50%;margin-top:-0.8rem}iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card)):where(:hover,:focus,.selected,[aria-current=page]){text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-underline)}iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card)):active{text-decoration-color:#a2d393 !important}iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card)).selected,iam-nav a:not([slot=logo]):not(.btn):not(:has(iam-card))[aria-current=page]{text-decoration-color:var(--colour-info) !important}iam-nav details>summary{text-decoration:none}iam-nav details>summary:where(:hover,:focus,.selected){text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-underline)}iam-nav details>summary:active{text-decoration-color:#a2d393 !important}iam-nav details[open]>summary{text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-success)}iam-nav details:has([aria-current=page]:not([data-duplicate]))>summary{text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-info)}@media screen and (max-width: 62em){iam-nav details{background-color:var(--colour-canvas);margin-left:-1.5rem;margin-right:-1.5rem;padding-inline:1.5rem;width:auto;position:relative}}@media screen and (max-width: 62em)and (prefers-color-scheme: light){iam-nav details{background-color:#eee}}@media screen and (max-width: 62em){iam-nav details summary{background-color:var(--colour-white);display:block;border:none;color:var(--colour-link);margin:0;margin-left:-1.5rem;margin-right:-1.5rem;padding:1.5rem 4rem 1.5rem 1.5rem;font-size:1rem;line-height:1.5rem;min-height:1.5rem;position:relative;font-weight:normal}}@media screen and (max-width: 62em)and (prefers-color-scheme: dark){iam-nav details summary{background-color:var(--colour-canvas-2)}}@media screen and (max-width: 62em){iam-nav details summary:after{content:"\uF055";display:block;font-size:1.5rem;font-weight:300;position:absolute;top:1.5rem;right:1.5rem;font-family:"Font Awesome 6 Pro";line-height:1em}iam-nav details[open]>summary:after{content:"\uF056";font-weight:bold}iam-nav details a{text-decoration:none;display:block;border:none;color:var(--colour-link);margin:0;margin-left:3rem;padding:1.5rem 0 1.5rem 0;font-size:1rem;line-height:1.5rem;min-height:1.5rem;position:relative;font-weight:normal}iam-nav details a:after{background:var(--colour-border) !important;top:calc(100% - 2px) !important;width:100% !important}iam-nav details a:has(iam-card){display:none !important}iam-nav details>div a:last-child{margin-bottom:0 !important}iam-nav details>div a:last-child:after{display:none}iam-nav details:after{content:"";position:absolute;top:calc(100% - 2px);left:1.5rem;height:2px;width:calc(100% - 3rem);display:block;height:2px;background-color:var(--colour-border) !important}iam-nav details details:after{display:none}iam-nav details details summary{padding:0 1.5rem 1.5rem 3.5rem;position:relative}iam-nav details details summary:after{left:1.5rem;font-size:1rem;top:0.1875rem;transform:none;font-weight:400}iam-nav details a+details>summary{padding-top:1.5rem}iam-nav details a+details>summary:after{margin-top:1.5rem}iam-nav details details[open]+details:before{content:"";display:block;background:var(--colour-canvas-2);padding-top:1.5rem;margin-left:-1.5rem;margin-right:-1.5rem}}@media screen and (max-width: 62em)and (min-width: 36em){iam-nav details{padding-right:2.5rem;margin-right:-2.5rem}iam-nav details:after{width:calc(100% - 4rem)}iam-nav details summary{padding-right:2.5rem;margin-right:-2.5rem}iam-nav details summary:after{right:2.5rem}iam-nav details details[open]+details:before{padding-right:2.5rem;margin-right:-2.5rem}}@media screen and (min-width: 62em){iam-nav .nav--menu details{background-color:var(--colour-canvas);margin-left:-1.5rem;margin-right:-1.5rem;padding-inline:1.5rem;width:auto;position:relative;padding-right:2.5rem;margin-right:-2.5rem}}@media screen and (min-width: 62em)and (prefers-color-scheme: light){iam-nav .nav--menu details{background-color:#eee}}@media screen and (min-width: 62em){iam-nav .nav--menu details summary{background-color:var(--colour-white);display:block;border:none;color:var(--colour-link);margin:0;margin-left:-1.5rem;margin-right:-1.5rem;padding:1.5rem 4rem 1.5rem 1.5rem;font-size:1rem;line-height:1.5rem;min-height:1.5rem;position:relative;font-weight:normal}}@media screen and (min-width: 62em)and (prefers-color-scheme: dark){iam-nav .nav--menu details summary{background-color:var(--colour-canvas-2)}}@media screen and (min-width: 62em){iam-nav .nav--menu details summary:after{content:"\uF055";display:block;font-size:1.5rem;font-weight:300;position:absolute;top:1.5rem;right:1.5rem;font-family:"Font Awesome 6 Pro";line-height:1em}iam-nav .nav--menu details[open]>summary:after{content:"\uF056";font-weight:bold}iam-nav .nav--menu details a{text-decoration:none;display:block;border:none;color:var(--colour-link);margin:0;margin-left:3rem;padding:1.5rem 0 1.5rem 0;font-size:1rem;line-height:1.5rem;min-height:1.5rem;position:relative;font-weight:normal}iam-nav .nav--menu details a:after{background:var(--colour-border) !important;top:calc(100% - 2px) !important;width:100% !important}iam-nav .nav--menu details a:has(iam-card){display:none !important}iam-nav .nav--menu details>div a:last-child{margin-bottom:0 !important}iam-nav .nav--menu details>div a:last-child:after{display:none}iam-nav .nav--menu details:after{content:"";position:absolute;top:calc(100% - 2px);left:1.5rem;height:2px;width:calc(100% - 3rem);display:block;height:2px;background-color:var(--colour-border) !important}iam-nav .nav--menu details:after{width:calc(100% - 4rem)}iam-nav .nav--menu details summary{padding-right:2.5rem;margin-right:-2.5rem}iam-nav .nav--menu details summary:after{right:2.5rem}}@media screen and (min-width: 62em){iam-nav>details,iam-nav *:not(.nav--menu)>details{width:auto}iam-nav>details>summary,iam-nav *:not(.nav--menu)>details>summary{display:block;border:none;color:var(--colour-link);margin:0;font-size:1rem;line-height:6rem;min-height:6rem;margin-block:-1.5rem;position:relative;font-weight:normal;white-space:nowrap;padding-right:1.5rem}iam-nav>details>summary:after,iam-nav *:not(.nav--menu)>details>summary:after{content:"\uF078";display:block;font-size:1rem;font-weight:300;position:absolute;top:50%;transform:translate(0, -50%);right:0;font-family:"Font Awesome 6 Pro";line-height:1em}iam-nav>details:not(:first-child)>summary,iam-nav *:not(.nav--menu)>details:not(:first-child)>summary{margin-left:1.5rem}iam-nav>details div,iam-nav *:not(.nav--menu)>details div{display:none}iam-nav>details[open]>div,iam-nav *:not(.nav--menu)>details[open]>div{position:absolute;display:block;top:100%;left:0;width:100%;padding-inline:max(var(--padding-inline),(100% - var(--container-max-width))/2 + var(--padding-inline)) !important;box-shadow:0px 6px 12px rgba(0,0,0,.11)}}@media screen and (min-width: 62em)and (prefers-color-scheme: light){iam-nav>details[open]>div,iam-nav *:not(.nav--menu)>details[open]>div{background:var(--colour-white);--colour-muted: #9d9d9d;--colour-body: #595959;--colour-border: #D8D8D8;--colour-link: var(--colour-primary-theme);--colour-brand: var(--colour-primary-theme);--colour-underline: var(--colour-secondary);--colour-heading: var(--colour-primary);--colour-focus: var(--colour-primary-theme);--colour-hover: var(--colour-primary-theme);--colour-active: var(--colour-primary-theme);--colour-selected: var(--colour-info);--colour-inverted: #FCFCFC;--colour-btn: var(--colour-primary-theme);--colour-btn-bg: var(--colour-warning);--colour-btn-border: var(--colour-warning);--colour-btn-bg-hover: transparent;--colour-btn-hover: var(--colour-primary-theme);--colour-btn-secondary: var(--colour-primary-theme);--colour-btn-secondary-border: var(--colour-primary-theme);--colour-btn-secondary-bg: transparent;--colour-btn-secondary-bg-hover: var(--colour-primary-theme);--colour-btn-secondary-hover: var(--colour-inverted);--colour-canvas-2: white;--colour-btn-action-hover-bg: var(--colour-light)}iam-nav>details[open]>div .text-primary,iam-nav *:not(.nav--menu)>details[open]>div .text-primary{color:var(--colour-primary) !important}}@media screen and (min-width: 62em)and (prefers-color-scheme: dark){iam-nav>details[open]>div,iam-nav *:not(.nav--menu)>details[open]>div{--colour-canvas: #262626;--colour-canvas-2: #313131;--colour-body: #BFBFBF;--colour-heading: var(--colour-white);--colour-link: var(--colour-white);--colour-hover: var(--colour-white);--colour-active: var(--colour-white);--colour-border: var(--colour-white);--colour-brand: var(--colour-white);--colour-btn: #00313c;--colour-btn-border: var(--colour-white);--colour-btn-bg: var(--colour-white);--colour-btn-hover: var(--colour-white);--colour-btn-secondary: var(--colour-white);--colour-btn-secondary-border: var(--colour-white);--colour-btn-secondary-bg: transparent;--colour-btn-secondary-bg-hover: var(--colour-white);--colour-btn-secondary-hover: var(--colour-primary-theme);--colour-btn-action-hover-bg: var(--colour-canvas-2)}}@media screen and (min-width: 62em){iam-nav>details[open]>div:has(details),iam-nav *:not(.nav--menu)>details[open]>div:has(details){background:var(--colour-canvas-2)}}@media screen and (min-width: 62em)and (prefers-color-scheme: light){iam-nav>details[open]>div:has(details),iam-nav *:not(.nav--menu)>details[open]>div:has(details){background:#eee}}@media screen and (min-width: 62em){iam-nav>details[open]>div:has(details)>a,iam-nav *:not(.nav--menu)>details[open]>div:has(details)>a{display:inline-block !important;margin-right:2rem !important}iam-nav>details[open]>div:has(details)>a:first-child,iam-nav *:not(.nav--menu)>details[open]>div:has(details)>a:first-child{margin-right:0}iam-nav>details[open]>div:has(details)>a:after,iam-nav *:not(.nav--menu)>details[open]>div:has(details)>a:after{display:none !important}iam-nav>details[open]>div:has(details) a:has(iam-card),iam-nav *:not(.nav--menu)>details[open]>div:has(details) a:has(iam-card){display:none}iam-nav>details[open]>div:has(details) details,iam-nav *:not(.nav--menu)>details[open]>div:has(details) details{display:inline-block}iam-nav>details[open]>div:has(details) details summary,iam-nav *:not(.nav--menu)>details[open]>div:has(details) details summary{display:inline-block;margin-left:0 !important;margin-right:2rem}iam-nav>details[open]>div:has(details) details:first-child summary,iam-nav *:not(.nav--menu)>details[open]>div:has(details) details:first-child summary{margin-left:0}iam-nav>details[open]>div:not(:has(details)),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)){background:var(--colour-canvas);padding-top:8rem;padding-bottom:4rem;columns:3;column-gap:6.875rem}}@media screen and (min-width: 62em)and (prefers-color-scheme: light){iam-nav>details[open]>div:not(:has(details)),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)){background:var(--colour-white);--colour-canvas-2: white}}@media screen and (min-width: 62em){iam-nav>details[open]>div:not(:has(details))>a,iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details))>a{margin-right:0 !important;display:block;max-height:6rem}iam-nav>details[open]>div:not(:has(details))>a.double-height,iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details))>a.double-height{min-height:6rem}iam-nav>details[open]>div:not(:has(details)) a:has(iam-card),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)) a:has(iam-card){display:inline-block}iam-nav>details[open]>div:not(:has(details)):before,iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)):before{content:attr(data-title);display:block;position:absolute;top:0;left:0;width:100%;color:var(--colour-white);padding-inline:max(var(--padding-inline),(100% - var(--container-max-width))/2 + var(--padding-inline)) !important;font-size:2rem;font-weight:bold;line-height:5.5rem;--gradient-direction: 90deg;background-color:var(--colour-info-theme);background-image:linear-gradient(var(--gradient-direction), var(--colour-primary-theme) 0, transparent 100%) !important}iam-nav>details[open]>div:not(:has(details)):has(iam-card),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)):has(iam-card){column-gap:1rem}iam-nav>details[open]>div:not(:has(details)):has(iam-card) a:not(:has(iam-card)),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)):has(iam-card) a:not(:has(iam-card)){margin-right:5.875rem !important}iam-nav>details[open]>div:not(:has(details)):has(iam-card) a:has(iam-card):after,iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)):has(iam-card) a:has(iam-card):after{display:none}iam-nav>details[open]>div:not(:has(details)):has(iam-card) a:not(:has(iam-card))+a:has(iam-card),iam-nav *:not(.nav--menu)>details[open]>div:not(:has(details)):has(iam-card) a:not(:has(iam-card))+a:has(iam-card){break-before:column}iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card)),iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card)){font-size:1rem;line-height:1.5rem;padding-block:1.5rem;position:relative;font-weight:normal;display:block;margin:0}iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):where(:hover,:focus,.selected,[aria-current=page]),iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):where(:hover,:focus,.selected,[aria-current=page]){text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-underline)}iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):active,iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):active{text-decoration-color:#a2d393 !important}iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card)).selected,iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card))[aria-current=page],iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card)).selected,iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card))[aria-current=page]{text-decoration-color:var(--colour-info)}iam-nav>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):after,iam-nav *:not(.nav--menu)>details a:not([slot=logo]):not(.btn):not(:has(iam-card)):after{content:"";display:block;height:2px;width:100% !important;top:calc(100% - 2px);background-color:var(--colour-border) !important}iam-nav>details details>summary,iam-nav *:not(.nav--menu)>details details>summary{padding-right:0;background:rgba(0,0,0,0)}iam-nav>details details>summary:after,iam-nav *:not(.nav--menu)>details details>summary:after{display:none}iam-nav>details details:not(:first-child)>summary,iam-nav *:not(.nav--menu)>details details:not(:first-child)>summary{margin-left:2rem}nav:has(iam-nav.open){min-height:100vh !important;max-height:100vh;overflow:auto;margin-bottom:calc((100vh - var(--nav-height))*-1)}html:has(iam-nav.open:not(.demo-open)){overflow:hidden}}@media screen and (min-width: 80em){iam-nav.nav--large *:not(.nav--menu)>details[open]>div:not(:has(details)){columns:4;column-gap:6.875rem}}@media screen and (min-width: 62em){iam-nav.search-open>*:not([slot=logo]):not([slot=secondary]):not([slot=search]){display:none !important}}@media screen and (min-width: 62em){iam-nav:has([slot=dual]) .brand:has(~[slot=dual]){margin-right:1.5rem !important}iam-nav:has([slot=dual]) *:not([slot=dual]):has(+[slot=dual])+[slot=dual]{margin-left:auto !important}iam-nav:has([slot=dual]) .btn[slot=dual]{margin-left:0}iam-nav:has([slot=dual])::part(btn-menu){margin-left:1rem !important}}iam-nav>.dialog__wrapper .dialog--list a{font-size:1rem}@media screen and (max-width: 62em){iam-nav>.dialog__wrapper:not(.dialog--xs){width:100%}iam-nav>.dialog__wrapper:not(.dialog--xs) .btn-compact{display:none !important}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list{display:contents !important}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list a{font-size:1rem}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list a,iam-nav .btn-compact{--compact-size: 2rem;all:unset;display:block !important;font-size:0.875rem !important;line-height:2rem !important;height:2rem !important;min-height:2rem !important;max-height:2rem !important;width:100% !important;margin:0 !important;cursor:pointer;color:var(--colour-link);font-weight:normal !important}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list a:where(:hover,:focus,.selected,[aria-current=page]),iam-nav .btn-compact:where(:hover,:focus,.selected,[aria-current=page]){text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:2px;text-decoration-color:var(--colour-underline)}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list a:before,iam-nav .btn-compact:before{display:inline-block;width:auto;position:static;margin-right:.5rem;font-size:.875rem !important;text-decoration:none !important}iam-nav>.dialog__wrapper:not(.dialog--xs) .dialog--list a:after,iam-nav .btn-compact:after{display:none}}iam-nav .nav--menu{outline:none !important}iam-nav .nav--menu::-webkit-scrollbar{width:6px}iam-nav .nav--menu::-webkit-scrollbar-track{border:0 !important}iam-nav .nav--menu::-webkit-scrollbar-thumb{border:0 !important}iam-nav .nav--menu hr{width:100% !important;border-top:2px solid var(--colour-border) !important}iam-nav .nav--menu a{display:block !important;line-height:1.25rem !important;padding:1.5rem 0 !important;margin:0 !important;flex-shrink:0;font-size:1rem !important;font-weight:normal !important}iam-nav .nav--menu a:not(.mb-0):not(:has(+a)){margin:0 0 2.25rem 0 !important}iam-nav .nav--menu a:has(+a){margin-bottom:0 !important}iam-nav .nav--menu a:after{content:"";display:block;height:2px;width:100% !important;background-color:var(--colour-border) !important;top:calc(100% - 2px) !important}iam-nav .nav--menu>button{min-width:100%;text-align:center}iam-nav .nav--menu.closed *{display:none !important}/*# sourceMappingURL=assets/css/components/nav.global.css.map */
|
|
38
|
-
</style>`)}connectedCallback(){this.hasAttribute("data-css")&&this.shadowRoot.querySelector(".doc-styles").insertAdjacentHTML("beforeend",`@import "${this.getAttribute("data-css")}";`);const s=this.shadowRoot.querySelector(".btn-menu"),n=this.shadowRoot.querySelector(".menu"),e=this,i=this.shadowRoot.querySelector(".backdrop"),u=this.shadowRoot.querySelector(".buttons-holder");if(this.querySelectorAll(":scope > *").forEach(function(a){switch(a.tagName){case"BUTTON":a.hasAttribute("slot")||(a.setAttribute("slot","actions"),n.classList.add("has-actions"));break}if(a.classList.contains("nav--menu")&&a.hasAttribute("data-title")&&a.hasAttribute("data-icon")){const r=a.getAttribute("data-title"),l=a.getAttribute("data-icon"),o=document.createElement("button");o.setAttribute("slot",r),o.classList.add("btn-menu"),o.setAttribute("part","btn-menu"),o.innerHTML=`<span class="btn btn-primary"><span>${r}</span><i class="${l}"></i><i class="fa-regular fa-xmark-large"></i></span>`,u.insertAdjacentElement("beforeend",o);const m=o.querySelector(".btn-primary");a.setAttribute("slot","menus"),a.classList.contains("open")?(o.setAttribute("aria-expanded",!0),m.classList.toggle("active"),e.classList.add("open"),i.classList.add("show")):a.classList.add("closed"),o.addEventListener("click",function(h){h.preventDefault(),o.toggleAttribute("aria-expanded"),a.classList.toggle("open"),m.classList.toggle("active");let c=e.querySelector(":scope > details[open]");c&&c.removeAttribute("open"),a.classList.contains("open")?(n.classList.remove("open"),s.removeAttribute("aria-expanded"),setTimeout(function(){n.classList.add("closed")},1e3),e.classList.add("open"),i.classList.add("show"),a.classList.remove("closed")):(e.classList.remove("open"),i.classList.remove("show"),setTimeout(function(){a.classList.add("closed")},1e3)),e.querySelectorAll(".nav--menu.open").forEach(function(d){d!=a&&d.classList.remove("open")}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(d){d!=o&&(d.removeAttribute("aria-expanded"),d.querySelector(".btn-primary").classList.remove("active"))})},!1)}}),this.querySelector('a[slot="secondary"]')&&n.classList.add("has-secondary"),document.documentElement.style.setProperty("--scrollbar-width",window.innerWidth-document.documentElement.offsetWidth+"px"),s.addEventListener("click",function(a){a.preventDefault(),s.toggleAttribute("aria-expanded"),n.classList.toggle("open"),e.querySelectorAll(".nav--menu.open").forEach(function(t){t.classList.remove("open"),setTimeout(function(){t.classList.add("closed")},1e3)}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(t){t.removeAttribute("aria-expanded"),t.querySelector(".btn-primary").classList.remove("active")}),n.classList.contains("open")?(e.classList.add("open"),n.classList.remove("closed")):(e.classList.remove("open"),setTimeout(function(){n.classList.add("closed")},1e3))},!1),this.addEventListener("request-close",a=>{s.removeAttribute("aria-expanded"),n.classList.remove("open"),e.classList.remove("open")}),i.addEventListener("click",a=>{let t=this.querySelector("details[open] summary");t&&t.click(),e.querySelectorAll(".nav--menu.open").forEach(function(r){r.classList.remove("open")}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(r){r.removeAttribute("aria-expanded"),r.querySelector(".btn-primary").classList.remove("active")}),i.classList.remove("show")}),this.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("summary")&&window.innerWidth>992&&!a.target.closest(".nav--menu")){let r=a.target.closest("summary").closest("details"),l=r.parentNode;r.hasAttribute("open")?r.removeAttribute("open"):r.setAttribute("open","true"),e.querySelectorAll(".nav--menu.open").forEach(function(o){o.classList.remove("open"),setTimeout(function(){n.classList.add("closed")},1e3)}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(o){o.removeAttribute("aria-expanded"),o.querySelector(".btn-primary").classList.remove("active")}),Array.from(l.querySelectorAll(":scope > details")).forEach((o,m)=>{o!=r&&o.removeAttribute("open")}),this.querySelectorAll(":scope > details[open]").length?(i.classList.add("show"),e.classList.add("open")):(i.classList.remove("show"),e.classList.remove("open")),a.preventDefault()}}),this.querySelectorAll("details").forEach(a=>{let t=a.querySelector("summary");a.querySelector(":Scope > div").setAttribute("data-title",t.textContent)}),this.querySelector('[slot="search"]')){n.classList.add("has-search");let a=this.shadowRoot.querySelector("#search-wrapper");a.classList.remove("d-none"),a.insertAdjacentHTML("afterbegin",`<button class="btn btn-secondary btn-compact fa-search me-0 mb-0" id="search-button" aria-controls="search-dialog">Open Search field</button>
|
|
38
|
+
</style>`)}connectedCallback(){this.hasAttribute("data-css")&&this.shadowRoot.querySelector(".doc-styles").insertAdjacentHTML("beforeend",`@import "${this.getAttribute("data-css")}";`);const s=this.shadowRoot.querySelector(".btn-menu"),n=this.shadowRoot.querySelector(".menu"),e=this,i=this.shadowRoot.querySelector(".backdrop"),u=this.shadowRoot.querySelector(".buttons-holder");if(this.querySelectorAll(":scope > *").forEach(function(a){switch(a.tagName){case"BUTTON":a.hasAttribute("slot")||(a.setAttribute("slot","actions"),n.classList.add("has-actions"));break}if(a.classList.contains("nav--menu")&&a.hasAttribute("data-title")&&a.hasAttribute("data-icon")){const r=a.getAttribute("data-title"),l=a.getAttribute("data-icon"),o=document.createElement("button");o.setAttribute("slot",r),o.classList.add("btn-menu"),o.setAttribute("part","btn-menu"),o.innerHTML=`<span class="btn btn-primary"><span>${r}</span><i class="${l}"></i><i class="fa-regular fa-xmark-large"></i></span>`,u.insertAdjacentElement("beforeend",o);const m=o.querySelector(".btn-primary");a.setAttribute("slot","menus"),a.classList.contains("open")?(o.setAttribute("aria-expanded",!0),m.classList.toggle("active"),e.classList.add("open"),i.classList.add("show")):a.classList.add("closed"),o.addEventListener("click",function(h){h.preventDefault(),o.toggleAttribute("aria-expanded"),a.classList.toggle("open"),m.classList.toggle("active");let c=e.querySelector(":scope > details[open]");c&&c.removeAttribute("open"),a.classList.contains("open")?(n.classList.remove("open"),s.removeAttribute("aria-expanded"),setTimeout(function(){n.classList.add("closed")},1e3),e.classList.add("open"),i.classList.add("show"),a.classList.remove("closed")):(e.classList.remove("open"),i.classList.remove("show"),setTimeout(function(){a.classList.add("closed")},1e3)),e.querySelectorAll(".nav--menu.open").forEach(function(d){d!=a&&d.classList.remove("open")}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(d){d!=o&&(d.removeAttribute("aria-expanded"),d.querySelector(".btn-primary").classList.remove("active"))})},!1)}}),this.querySelectorAll("details").forEach(function(a){a.classList.add("details--revert")}),this.querySelector('a[slot="secondary"]')&&n.classList.add("has-secondary"),document.documentElement.style.setProperty("--scrollbar-width",window.innerWidth-document.documentElement.offsetWidth+"px"),s.addEventListener("click",function(a){a.preventDefault(),s.toggleAttribute("aria-expanded"),n.classList.toggle("open"),e.querySelectorAll(".nav--menu.open").forEach(function(t){t.classList.remove("open"),setTimeout(function(){t.classList.add("closed")},1e3)}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(t){t.removeAttribute("aria-expanded"),t.querySelector(".btn-primary").classList.remove("active")}),n.classList.contains("open")?(e.classList.add("open"),n.classList.remove("closed")):(e.classList.remove("open"),setTimeout(function(){n.classList.add("closed")},1e3))},!1),this.addEventListener("request-close",a=>{s.removeAttribute("aria-expanded"),n.classList.remove("open"),e.classList.remove("open")}),i.addEventListener("click",a=>{let t=this.querySelector("details[open] summary");t&&t.click(),e.querySelectorAll(".nav--menu.open").forEach(function(r){r.classList.remove("open")}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(r){r.removeAttribute("aria-expanded"),r.querySelector(".btn-primary").classList.remove("active")}),i.classList.remove("show")}),this.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("summary")&&window.innerWidth>992&&!a.target.closest(".nav--menu")){let r=a.target.closest("summary").closest("details"),l=r.parentNode;r.hasAttribute("open")?r.removeAttribute("open"):r.setAttribute("open","true"),e.querySelectorAll(".nav--menu.open").forEach(function(o){o.classList.remove("open"),setTimeout(function(){n.classList.add("closed")},1e3)}),e.shadowRoot.querySelectorAll(".buttons-holder .btn-menu[aria-expanded]").forEach(function(o){o.removeAttribute("aria-expanded"),o.querySelector(".btn-primary").classList.remove("active")}),Array.from(l.querySelectorAll(":scope > details")).forEach((o,m)=>{o!=r&&o.removeAttribute("open")}),this.querySelectorAll(":scope > details[open]").length?(i.classList.add("show"),e.classList.add("open")):(i.classList.remove("show"),e.classList.remove("open")),a.preventDefault()}}),this.querySelectorAll("details").forEach(a=>{let t=a.querySelector("summary");a.querySelector(":Scope > div").setAttribute("data-title",t.textContent)}),this.querySelector('[slot="search"]')){n.classList.add("has-search");let a=this.shadowRoot.querySelector("#search-wrapper");a.classList.remove("d-none"),a.insertAdjacentHTML("afterbegin",`<button class="btn btn-secondary btn-compact fa-search me-0 mb-0" id="search-button" aria-controls="search-dialog">Open Search field</button>
|
|
39
39
|
<dialog id="search-dialog">
|
|
40
40
|
<div class="container">
|
|
41
41
|
<div class="row">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.component.min.js","sources":["nav.component.js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"nav\"\n});\nclass iamNav extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/nav.css\";`;\n const loadExtraCSS = `@import \"${assetLocation}/css/components/nav.global.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style class=\"styles\">\n @import \"${coreCSS}\";\n ${loadCSS}\n </style>\n <style class=\"doc-styles\">\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"container\">\n <slot name=\"logo\"></slot>\n <div class=\"buttons-holder\"></div>\n <button class=\"btn-menu\" part=\"btn-menu\">Menu<i class=\"fa-regular fa-bars\"></i><i class=\"fa-regular fa-xmark-large\"></i></button>\n\n <div class=\"menu__outer\">\n <div class=\"menu closed\">\n \n <div class=\"menu__primary\">\n <slot></slot>\n <slot name=\"dual\"></slot>\n </div>\n <div class=\"dialog__wrapper d-none\" id=\"search-wrapper\"></div>\n <slot name=\"actions\"></slot>\n <div class=\"menu__secondary\">\n <div class=\"container\">\n <slot name=\"secondary\"></slot>\n </div>\n </div>\n </div>\n <slot name=\"menus\"></slot>\n </div> \n </div>\n <div class=\"backdrop\" part=\"backdrop\"></div>\n `;\n shadowRoot.appendChild(template.content.cloneNode(true));\n // insert extra CSS\n if (!document.getElementById('navGlobal'))\n document.head.insertAdjacentHTML('beforeend', `<style id=\"navGlobal\">${loadExtraCSS}</style>`);\n }\n connectedCallback() {\n // Load external CSS if needed\n if (this.hasAttribute('data-css'))\n this.shadowRoot.querySelector('.doc-styles').insertAdjacentHTML('beforeend', `@import \"${this.getAttribute('data-css')}\";`);\n const menuButton = this.shadowRoot.querySelector('.btn-menu');\n const menu = this.shadowRoot.querySelector('.menu');\n const iamNav = this;\n const backdrop = this.shadowRoot.querySelector('.backdrop');\n const buttonsHolder = this.shadowRoot.querySelector('.buttons-holder');\n // Check the content \n this.querySelectorAll(':scope > *').forEach(function (element) {\n let tagname = element.tagName;\n switch (tagname) {\n case \"BUTTON\":\n if (!element.hasAttribute('slot')) {\n element.setAttribute('slot', 'actions');\n menu.classList.add('has-actions');\n }\n break;\n }\n // Create menu button\n if (element.classList.contains('nav--menu') && element.hasAttribute('data-title') && element.hasAttribute('data-icon')) {\n const title = element.getAttribute('data-title');\n const iconClass = element.getAttribute('data-icon');\n // Create the menu button that sits seperately to the menu\n const button = document.createElement('button');\n button.setAttribute('slot', title);\n button.classList.add('btn-menu');\n button.setAttribute('part', 'btn-menu');\n button.innerHTML = `<span class=\"btn btn-primary\"><span>${title}</span><i class=\"${iconClass}\"></i><i class=\"fa-regular fa-xmark-large\"></i></span>`;\n buttonsHolder.insertAdjacentElement('beforeend', button);\n const mdButton = button.querySelector('.btn-primary');\n // Make sure the menu is added to the right part of the component\n element.setAttribute('slot', 'menus');\n // If open we need to make sure the main mobile menu is closed, the new button has the right state and the backdrop is shown\n if (element.classList.contains('open')) {\n button.setAttribute('aria-expanded', true);\n mdButton.classList.toggle('active');\n iamNav.classList.add('open');\n backdrop.classList.add('show');\n }\n else {\n element.classList.add('closed'); // closed class is added to prevent the elements being tabbed into, this causes visual issues\n }\n // Click event\n button.addEventListener('click', function (e) {\n e.preventDefault();\n button.toggleAttribute('aria-expanded');\n element.classList.toggle('open');\n mdButton.classList.toggle('active');\n // Close desktop menus\n let openMenu = iamNav.querySelector(':scope > details[open]');\n if (openMenu)\n openMenu.removeAttribute('open');\n // Close the main menu and fix states on the button, iamNav component and backdrop\n if (element.classList.contains('open')) {\n menu.classList.remove('open');\n menuButton.removeAttribute('aria-expanded');\n setTimeout(function () { menu.classList.add('closed'); }, 1000); // Delay until its close so the animation is broken\n iamNav.classList.add('open');\n backdrop.classList.add('show');\n element.classList.remove('closed');\n }\n else {\n iamNav.classList.remove('open');\n backdrop.classList.remove('show');\n setTimeout(function () { element.classList.add('closed'); }, 1000);\n }\n // Close any open menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (openmenu) {\n if (openmenu != element) {\n openmenu.classList.remove('open');\n }\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (selectedButton) {\n if (selectedButton != button) {\n selectedButton.removeAttribute('aria-expanded');\n let innerBtn = selectedButton.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n }\n });\n }, false);\n }\n });\n // Has secondary link\n if (this.querySelector('a[slot=\"secondary\"]')) {\n menu.classList.add('has-secondary');\n }\n // Create a scroll width variable to help with the sizing of the menu with in the CSS\n document.documentElement.style.setProperty('--scrollbar-width', (window.innerWidth - document.documentElement.offsetWidth) + 'px');\n // Open and close the menu\n menuButton.addEventListener('click', function (e) {\n e.preventDefault();\n menuButton.toggleAttribute('aria-expanded');\n menu.classList.toggle('open');\n // Close any other menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n setTimeout(function () { element.classList.add('closed'); }, 1000);\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n if (menu.classList.contains('open')) {\n iamNav.classList.add('open');\n menu.classList.remove('closed');\n }\n else {\n iamNav.classList.remove('open');\n setTimeout(function () { menu.classList.add('closed'); }, 1000);\n }\n }, false);\n // Allow outside JS to close the menu\n this.addEventListener(\"request-close\", (event) => {\n menuButton.removeAttribute('aria-expanded');\n menu.classList.remove('open');\n iamNav.classList.remove('open');\n });\n // Close the menu on the click of the backdrop on desktop\n backdrop.addEventListener(\"click\", (event) => {\n let openMenu = this.querySelector('details[open] summary');\n if (openMenu)\n openMenu.click();\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n backdrop.classList.remove('show');\n });\n // On desktop close other menu's (details) when one is clicked\n this.addEventListener(\"click\", (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('summary')) {\n if (window.innerWidth > 992 && !event.target.closest('.nav--menu')) {\n let summary = event.target.closest('summary');\n let details = summary.closest('details');\n let wrapper = details.parentNode;\n if (details.hasAttribute('open'))\n details.removeAttribute('open');\n else\n details.setAttribute('open', 'true');\n // Close any bespoke menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n setTimeout(function () { menu.classList.add('closed'); }, 1000);\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n // Close any other dropdowns on the same level\n Array.from(wrapper.querySelectorAll(':scope > details')).forEach((detailsArrayElement, index) => {\n if (detailsArrayElement != details)\n detailsArrayElement.removeAttribute('open');\n });\n if (this.querySelectorAll(':scope > details[open]').length) {\n backdrop.classList.add('show');\n iamNav.classList.add('open');\n }\n else {\n backdrop.classList.remove('show');\n iamNav.classList.remove('open');\n }\n event.preventDefault();\n }\n }\n ;\n });\n // Mega menu title\n this.querySelectorAll('details').forEach((detailsElement) => {\n let summary = detailsElement.querySelector('summary');\n let containerDiv = detailsElement.querySelector(':Scope > div');\n containerDiv.setAttribute('data-title', summary.textContent);\n });\n // Search \n if (this.querySelector('[slot=\"search\"]')) {\n menu.classList.add('has-search');\n let searchWrapper = this.shadowRoot.querySelector('#search-wrapper');\n searchWrapper.classList.remove('d-none');\n searchWrapper.insertAdjacentHTML('afterbegin', `<button class=\"btn btn-secondary btn-compact fa-search me-0 mb-0\" id=\"search-button\" aria-controls=\"search-dialog\">Open Search field</button>\n <dialog id=\"search-dialog\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col mb-0 ms-auto col-md-7\">\n <slot name=\"search\"></slot>\n </div>\n <div class=\"col d-none d-md-block mw-fit-content ms-3\">\n <button class=\"btn btn-compact btn-secondary fa-xmark-large m-0 mb-0\" type=\"button\" id=\"search-close\">Close search field</button>\n </div>\n </div>\n </div>\n </dialog>`);\n let searchButton = this.shadowRoot.querySelector('#search-button');\n let searchClose = this.shadowRoot.querySelector('#search-close');\n let searchDialog = this.shadowRoot.querySelector('#search-dialog');\n if (this.hasAttribute('data-search-open')) {\n searchDialog.setAttribute('open', 'open');\n this.classList.add('search-open');\n searchButton.setAttribute('aria-expanded', true);\n }\n searchButton.addEventListener(\"click\", (event) => {\n searchDialog.setAttribute('open', 'open');\n this.classList.add('search-open');\n searchButton.setAttribute('aria-expanded', true);\n });\n searchClose.addEventListener(\"click\", (event) => {\n searchDialog.removeAttribute('open');\n this.classList.remove('search-open');\n searchButton.removeAttribute('aria-expanded');\n });\n }\n }\n}\nexport default iamNav;\n"],"names":["iamNav","shadowRoot","assetLocation","coreCSS","template","menuButton","menu","backdrop","buttonsHolder","element","title","iconClass","button","mdButton","e","openMenu","openmenu","selectedButton","event","details","wrapper","detailsArrayElement","index","detailsElement","summary","searchWrapper","searchButton","searchClose","searchDialog"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js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"nav\"\n});\nclass iamNav extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/nav.css\";`;\n const loadExtraCSS = `@import \"${assetLocation}/css/components/nav.global.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style class=\"styles\">\n @import \"${coreCSS}\";\n ${loadCSS}\n </style>\n <style class=\"doc-styles\">\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"container\">\n <slot name=\"logo\"></slot>\n <div class=\"buttons-holder\"></div>\n <button class=\"btn-menu\" part=\"btn-menu\">Menu<i class=\"fa-regular fa-bars\"></i><i class=\"fa-regular fa-xmark-large\"></i></button>\n\n <div class=\"menu__outer\">\n <div class=\"menu closed\">\n \n <div class=\"menu__primary\">\n <slot></slot>\n <slot name=\"dual\"></slot>\n </div>\n <div class=\"dialog__wrapper d-none\" id=\"search-wrapper\"></div>\n <slot name=\"actions\"></slot>\n <div class=\"menu__secondary\">\n <div class=\"container\">\n <slot name=\"secondary\"></slot>\n </div>\n </div>\n </div>\n <slot name=\"menus\"></slot>\n </div> \n </div>\n <div class=\"backdrop\" part=\"backdrop\"></div>\n `;\n shadowRoot.appendChild(template.content.cloneNode(true));\n // insert extra CSS\n if (!document.getElementById('navGlobal'))\n document.head.insertAdjacentHTML('beforeend', `<style id=\"navGlobal\">${loadExtraCSS}</style>`);\n }\n connectedCallback() {\n // Load external CSS if needed\n if (this.hasAttribute('data-css'))\n this.shadowRoot.querySelector('.doc-styles').insertAdjacentHTML('beforeend', `@import \"${this.getAttribute('data-css')}\";`);\n const menuButton = this.shadowRoot.querySelector('.btn-menu');\n const menu = this.shadowRoot.querySelector('.menu');\n const iamNav = this;\n const backdrop = this.shadowRoot.querySelector('.backdrop');\n const buttonsHolder = this.shadowRoot.querySelector('.buttons-holder');\n // Check the content \n this.querySelectorAll(':scope > *').forEach(function (element) {\n let tagname = element.tagName;\n switch (tagname) {\n case \"BUTTON\":\n if (!element.hasAttribute('slot')) {\n element.setAttribute('slot', 'actions');\n menu.classList.add('has-actions');\n }\n break;\n }\n // Create menu button\n if (element.classList.contains('nav--menu') && element.hasAttribute('data-title') && element.hasAttribute('data-icon')) {\n const title = element.getAttribute('data-title');\n const iconClass = element.getAttribute('data-icon');\n // Create the menu button that sits seperately to the menu\n const button = document.createElement('button');\n button.setAttribute('slot', title);\n button.classList.add('btn-menu');\n button.setAttribute('part', 'btn-menu');\n button.innerHTML = `<span class=\"btn btn-primary\"><span>${title}</span><i class=\"${iconClass}\"></i><i class=\"fa-regular fa-xmark-large\"></i></span>`;\n buttonsHolder.insertAdjacentElement('beforeend', button);\n const mdButton = button.querySelector('.btn-primary');\n // Make sure the menu is added to the right part of the component\n element.setAttribute('slot', 'menus');\n // If open we need to make sure the main mobile menu is closed, the new button has the right state and the backdrop is shown\n if (element.classList.contains('open')) {\n button.setAttribute('aria-expanded', true);\n mdButton.classList.toggle('active');\n iamNav.classList.add('open');\n backdrop.classList.add('show');\n }\n else {\n element.classList.add('closed'); // closed class is added to prevent the elements being tabbed into, this causes visual issues\n }\n // Click event\n button.addEventListener('click', function (e) {\n e.preventDefault();\n button.toggleAttribute('aria-expanded');\n element.classList.toggle('open');\n mdButton.classList.toggle('active');\n // Close desktop menus\n let openMenu = iamNav.querySelector(':scope > details[open]');\n if (openMenu)\n openMenu.removeAttribute('open');\n // Close the main menu and fix states on the button, iamNav component and backdrop\n if (element.classList.contains('open')) {\n menu.classList.remove('open');\n menuButton.removeAttribute('aria-expanded');\n setTimeout(function () { menu.classList.add('closed'); }, 1000); // Delay until its close so the animation is broken\n iamNav.classList.add('open');\n backdrop.classList.add('show');\n element.classList.remove('closed');\n }\n else {\n iamNav.classList.remove('open');\n backdrop.classList.remove('show');\n setTimeout(function () { element.classList.add('closed'); }, 1000);\n }\n // Close any open menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (openmenu) {\n if (openmenu != element) {\n openmenu.classList.remove('open');\n }\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (selectedButton) {\n if (selectedButton != button) {\n selectedButton.removeAttribute('aria-expanded');\n let innerBtn = selectedButton.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n }\n });\n }, false);\n }\n });\n this.querySelectorAll('details').forEach(function (element) {\n element.classList.add('details--revert');\n });\n // Has secondary link\n if (this.querySelector('a[slot=\"secondary\"]')) {\n menu.classList.add('has-secondary');\n }\n // Create a scroll width variable to help with the sizing of the menu with in the CSS\n document.documentElement.style.setProperty('--scrollbar-width', (window.innerWidth - document.documentElement.offsetWidth) + 'px');\n // Open and close the menu\n menuButton.addEventListener('click', function (e) {\n e.preventDefault();\n menuButton.toggleAttribute('aria-expanded');\n menu.classList.toggle('open');\n // Close any other menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n setTimeout(function () { element.classList.add('closed'); }, 1000);\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n if (menu.classList.contains('open')) {\n iamNav.classList.add('open');\n menu.classList.remove('closed');\n }\n else {\n iamNav.classList.remove('open');\n setTimeout(function () { menu.classList.add('closed'); }, 1000);\n }\n }, false);\n // Allow outside JS to close the menu\n this.addEventListener(\"request-close\", (event) => {\n menuButton.removeAttribute('aria-expanded');\n menu.classList.remove('open');\n iamNav.classList.remove('open');\n });\n // Close the menu on the click of the backdrop on desktop\n backdrop.addEventListener(\"click\", (event) => {\n let openMenu = this.querySelector('details[open] summary');\n if (openMenu)\n openMenu.click();\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n backdrop.classList.remove('show');\n });\n // On desktop close other menu's (details) when one is clicked\n this.addEventListener(\"click\", (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('summary')) {\n if (window.innerWidth > 992 && !event.target.closest('.nav--menu')) {\n let summary = event.target.closest('summary');\n let details = summary.closest('details');\n let wrapper = details.parentNode;\n if (details.hasAttribute('open'))\n details.removeAttribute('open');\n else\n details.setAttribute('open', 'true');\n // Close any bespoke menus\n iamNav.querySelectorAll('.nav--menu.open').forEach(function (element) {\n element.classList.remove('open');\n setTimeout(function () { menu.classList.add('closed'); }, 1000);\n });\n iamNav.shadowRoot.querySelectorAll('.buttons-holder .btn-menu[aria-expanded]').forEach(function (element) {\n element.removeAttribute('aria-expanded');\n let innerBtn = element.querySelector('.btn-primary');\n innerBtn.classList.remove('active');\n });\n // Close any other dropdowns on the same level\n Array.from(wrapper.querySelectorAll(':scope > details')).forEach((detailsArrayElement, index) => {\n if (detailsArrayElement != details)\n detailsArrayElement.removeAttribute('open');\n });\n if (this.querySelectorAll(':scope > details[open]').length) {\n backdrop.classList.add('show');\n iamNav.classList.add('open');\n }\n else {\n backdrop.classList.remove('show');\n iamNav.classList.remove('open');\n }\n event.preventDefault();\n }\n }\n ;\n });\n // Mega menu title\n this.querySelectorAll('details').forEach((detailsElement) => {\n let summary = detailsElement.querySelector('summary');\n let containerDiv = detailsElement.querySelector(':Scope > div');\n containerDiv.setAttribute('data-title', summary.textContent);\n });\n // Search \n if (this.querySelector('[slot=\"search\"]')) {\n menu.classList.add('has-search');\n let searchWrapper = this.shadowRoot.querySelector('#search-wrapper');\n searchWrapper.classList.remove('d-none');\n searchWrapper.insertAdjacentHTML('afterbegin', `<button class=\"btn btn-secondary btn-compact fa-search me-0 mb-0\" id=\"search-button\" aria-controls=\"search-dialog\">Open Search field</button>\n <dialog id=\"search-dialog\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col mb-0 ms-auto col-md-7\">\n <slot name=\"search\"></slot>\n </div>\n <div class=\"col d-none d-md-block mw-fit-content ms-3\">\n <button class=\"btn btn-compact btn-secondary fa-xmark-large m-0 mb-0\" type=\"button\" id=\"search-close\">Close search field</button>\n </div>\n </div>\n </div>\n </dialog>`);\n let searchButton = this.shadowRoot.querySelector('#search-button');\n let searchClose = this.shadowRoot.querySelector('#search-close');\n let searchDialog = this.shadowRoot.querySelector('#search-dialog');\n if (this.hasAttribute('data-search-open')) {\n searchDialog.setAttribute('open', 'open');\n this.classList.add('search-open');\n searchButton.setAttribute('aria-expanded', true);\n }\n searchButton.addEventListener(\"click\", (event) => {\n searchDialog.setAttribute('open', 'open');\n this.classList.add('search-open');\n searchButton.setAttribute('aria-expanded', true);\n });\n searchClose.addEventListener(\"click\", (event) => {\n searchDialog.removeAttribute('open');\n this.classList.remove('search-open');\n searchButton.removeAttribute('aria-expanded');\n });\n }\n }\n}\nexport default iamNav;\n"],"names":["iamNav","shadowRoot","assetLocation","coreCSS","template","menuButton","menu","backdrop","buttonsHolder","element","title","iconClass","button","mdButton","e","openMenu","openmenu","selectedButton","event","details","wrapper","detailsArrayElement","index","detailsElement","summary","searchWrapper","searchButton","searchClose","searchDialog"],"mappings":";;;IAEA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,KACf,CAAC,EACD,MAAMA,UAAe,WAAY,CAC7B,aAAc,CACV,QACA,MAAMC,EAAa,KAAK,aAAa,CAAE,KAAM,MAAM,CAAE,EAC/CC,EAAgB,SAA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asAttribute("data-type")&&i.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),a(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var n=new c(function(){a(i)},t);i.addEventListener("mouseenter",o=>{n.pause()}),i.addEventListener("mouseleave",o=>{n.resume()})}}function c(i,n){var t,o,e=n;this.pause=function(){window.clearTimeout(t),e-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,e)},this.resume()}const a=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/import k from"js-cookie";const q=e=>e.replace(/ /g,"_"),x=function(e){return e=e.toLowerCase(),e=q(e),e=e.replace(/\W/g,""),e},m=(e,s,a)=>s.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,d)=>o?o[d]:a,e),S=e=>Array.isArray(e)||e!==null&&["function","object"].includes(typeof e);var L=function(e,s,a,o){function d(c){return c instanceof a?c:new a(function(n){n(c)})}return new(a||(a=Promise))(function(c,n){function v(r){try{u(o.next(r))}catch(i){n(i)}}function t(r){try{u(o.throw(r))}catch(i){n(i)}}function u(r){r.done?c(r.value):d(r.value).then(v,t)}u((o=o.apply(e,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Search"});class C extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${s}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const B=function(a){return typeof a!="string"?!1:!isNaN(a)&&!isNaN(parseFloat(a))},Q=(a,e)=>String(a).padStart(e,"0"),X=a=>a.charAt(0).toUpperCase()+a.slice(1),k=(a,e,r)=>e.split(/[\.\[\]\'\"]/).filter(i=>i).reduce((i,b)=>i?i[b]:r,a);var Y=function(a,e,r,i){function b(d){return d instanceof r?d:new r(function(o){o(d)})}return new(r||(r=Promise))(function(d,o){function n(c){try{t(i.next(c))}catch(h){o(h)}}function l(c){try{t(i.throw(c))}catch(h){o(h)}}function t(c){c.done?d(c.value):b(c.value).then(n,l)}t((i=i.apply(a,e||[])).next())})};const R=a=>{const e=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((i,b)=>{const d=Array.from(i.querySelectorAll("th, td")),o=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];d.forEach((n,l)=>{const t=e[l];if(typeof t<"u"){let c=document.createElement("div");c.innerHTML=t.innerHTML;let h=c.textContent||c.innerText||"";n.setAttribute("data-label",h),t.hasAttribute("data-td-class")&&n.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(n.setAttribute("data-format",t.getAttribute("data-format")),n.innerHTML=M(t.getAttribute("data-format"),n.textContent.trim())),o.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},J=a=>{let e=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((r,i)=>{let b=window.getComputedStyle(document.querySelector("html")),d=r.querySelector(":scope > *:last-child > *:first-child");if(d){d.classList.add("text-nowrap");let o=d.offsetWidth/parseFloat(b.fontSize);o+=1.7,e=e>o?e:o}}),e},G=(a,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||a.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(a.querySelectorAll("thead tr")).forEach((r,i)=>{a.querySelectorAll("thead tr th.expand-button-heading").length||r.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(a.querySelectorAll("tbody tr")).forEach((r,i)=>{const b=r.getAttribute("data-view")==="full"?"aria-expanded":"";r.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${b}>Expand</button></td>`)})},K=a=>{a.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let r=e.target.closest("[data-expand-button]"),i=r.closest("tr");r.toggleAttribute("aria-expanded"),i.getAttribute("data-view")=="full"?i.setAttribute("data-view","default"):i.setAttribute("data-view","full"),r.blur()}})},N=(a,e)=>{let r=e.querySelector("[data-search]");if(!r)return!1;const i=r.getAttribute("id"),b=r.getAttribute("data-search").split(",");let d=r.parentNode,o={};b.forEach((n,l)=>{Array.from(a.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((t,c)=>{t.querySelector(".td__content")?o[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:o[t.textContent]=t.textContent})}),r.setAttribute("list",`${i}_list`),r.setAttribute("autocomplete","off"),d.querySelector("datalist")||(d.innerHTML+=`<datalist id="${i}_list"></datalist>`),d.querySelector("datalist").innerHTML=`${Object.keys(o).map(n=>`<option value="${n}"></option>`).join("")}`},V=(a,e,r,i,b)=>{var d;let o=function(t,c=!1){if(e.classList.contains("processing"))return!1;if(t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((h,u)=>{const m=h.getAttribute("data-duplicate"),s=document.getElementById(m),g=document.querySelector(`[for="${m}"] iam-card`);if(s.checked!=h.checked)if(g){let x=new Event("click");g.dispatchEvent(x)}else s.checked=h.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!c){let h=e.querySelector("[data-pagination]");h.value=1,i.setAttribute("data-page",1)}z(a,e,r,i)}else e.hasAttribute("data-submit")?e.submit():(C(a,e,i),_(a,e));if(e.hasAttribute("data-ajax-post")){let h=new FormData(e),u=new URLSearchParams(h).toString();const m=new XMLHttpRequest;m.open("GET",`${window.location.href}?ajax=true&${u}`),m.send()}};e.addEventListener("keyup",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(d=setTimeout(function(){o(t)},500))}),e.addEventListener("change",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(a,e,b),o(t)),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(a,e,i),_(a,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&o(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&o(t)}),e.addEventListener("click",t=>{if(clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((h,u)=>{h.innerHTML=""});let c=e.elements;for(let h=0;h<c.length;h++)switch(c[h].type.toLowerCase()?c[h].type.toLowerCase():"text"){case"text":case"password":case"textarea":c[h].value="";break;case"radio":case"checkbox":if(c[h].checked){let m=c[h],s=m.getAttribute("id"),g=document.querySelector(`[for="${s}"`);if(g.querySelector("iam-card")){let x=g.querySelector("iam-card"),S=new Event("click");x.dispatchEvent(S)}m.checked=!1}break;case"select-one":case"select-multi":c[h].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(a,e,b),o(t)}}),e.addEventListener("submit",t=>{clearTimeout(d),e.hasAttribute("data-submit")||t.preventDefault(),o(t)}),e.addEventListener("force",t=>{o(t)}),e.addEventListener("paginate",t=>{o(t,!0)});let n=[],l=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,c)=>{let h=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${h}"]`)).forEach((u,m)=>{let s=u.closest("form");n.includes(s)||n.push(s),l.includes(h)||l.push(h)})}),n.forEach((t,c)=>{const h=function(){let u=[],m=new FormData(t);for(const[s,g]of m)document.querySelector(`[data-mimic="${s}"]`)&&!u.includes(s)?(u.push(s),document.querySelector(`[data-mimic="${s}"]`).value=g):document.querySelector(`[data-mimic="${s}"]`)&&(document.querySelector(`[data-mimic="${s}"]`).value+=","+g);for(const s of u){const g=new Event("force");e.dispatchEvent(g)}for(const s of l)if(!m.has(s)&&t.querySelector(`[name="${s}"]`)){document.querySelector(`[data-mimic="${s}"]`).value="";const g=new Event("force");e.dispatchEvent(g)}};t.addEventListener("force",u=>{h()}),t.addEventListener("change",u=>{h()})})},O=(a,e,r)=>{if(e.getAttribute("data-ajax"))return!1;let i=a.querySelector("tbody"),b=e.querySelector("[data-sort]"),d=b.querySelector(`option:nth-child(${b.selectedIndex+1})`),o=d.getAttribute("data-sort"),n=d.getAttribute("data-order"),l=d.getAttribute("data-format");if(!o)return i.innerHTML=r.innerHTML,R(a),!1;let t=[];["asc","desc","descending"].includes(n)||(t=n.split(","));let c=[];Array.from(i.querySelectorAll("tr")).forEach((u,m)=>{let s=u.querySelector('td[data-label="'+o+'"], th[data-label="'+o+'"]').textContent.trim();u.querySelector('[data-label="'+o+'"] .td__content')&&(s=u.querySelector('[data-label="'+o+'"] .td__content').textContent.trim()),t.length&&t.includes(s)&&(s=t.indexOf(s)),B(s)&&(s=Q(s,10)),l&&l=="date"&&(s=new Date(s));const g={index:s,row:u};c.push(g)}),c.sort((u,m)=>u.index>m.index?1:-1),(n=="descending"||n=="desc")&&(c=c.reverse());let h="";c.forEach((u,m)=>{h+=u.row.outerHTML}),i.innerHTML=h},C=(a,e,r)=>{a.classList.remove("table--filtered");let i=P(e),b=[],d=0,o=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,n=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((t,c)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let t=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((h,u)=>{b.push({column:`${h.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let l=0;Object.values(i).forEach((t,c)=>{typeof t=="object"&&Object.values(t).length?l+=Object.values(t).length:l++}),l&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML+=`(${l})`,t.parentNode.classList.add("hover")}),a.classList.add("table--filtered");for(const[t,c]of Object.entries(i))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((h,u)=>{let m=!1;c.forEach((s,g)=>{let x=h.querySelector(`[data-label="${t}"]`);if(s&&s=="$today")s=M("date",new Date);else if(s&&s=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),s=M("date",f)}else if(s&&(s=="$thisWeek"||s=="$lastWeek")){let f=new Date,y=new Date(f.setDate(f.getDate()-(f.getDay()-1))),p=new Date(f.setDate(f.getDate()-f.getDay()+7)),w=new Date(x.textContent.toLowerCase());if(f.setHours(0,0,0,0),y.setHours(0,0,0,0),p.setHours(0,0,0,0),w.setHours(0,0,0,0),s=="$thisWeek")m=w>=y&&w<=p;else{let A=new Date(y.setDate(y.getDate()-7)),L=new Date(p.setDate(p.getDate()-7));A.setHours(0,0,0,0),L.setHours(0,0,0,0),m=w>=A&&w<=L}}else if(s&&s=="$thisMonth"){let f=new Date,y=f.getFullYear(),p=f.getMonth();var S=new Date(y,p,1),q=new Date(y,p+1,0);let w=new Date(x.textContent.toLowerCase());S.setHours(0,0,0,0),q.setHours(0,0,0,0),w.setHours(0,0,0,0),m=w>=S&&w<=q}else if(s&&s=="$lastMonth"){let f=new Date,y=f.getFullYear(),p=f.getMonth();var E=new Date(y,p-1,1),v=new Date(y,p,0);let w=new Date(x.textContent.toLowerCase());E.setHours(0,0,0,0),v.setHours(0,0,0,0),w.setHours(0,0,0,0),m=w>=E&&w<=v}x&&x.textContent.toLowerCase().includes(s.toLowerCase())&&(m=!0)}),m||(h.classList.add("filtered"),h.setAttribute("data-filtered-by",t))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,c)=>{let h=!(b.length>0&&b[0].value.length>=3);b.forEach((u,m)=>{let s=t.querySelector(`[data-label="${u.column}"]`);s&&u.value.length>=3&&s.textContent.toLowerCase().includes(u.value.toLowerCase())&&(h=!0)}),h||t.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((t,c)=>{d++,t.classList.add("filtered--matched"),Math.ceil(d/n)==parseInt(o)&&t.classList.add("filtered--show")}),r&&(r.setAttribute("data-total",d),r.setAttribute("data-show",n),r.setAttribute("data-page",o))},_=(a,e,r)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((b,d)=>{let o=b.getAttribute("data-query"),n=0;if(o=="total")r.hasAttribute("data-total")?n=r.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!o.includes(" == ")&&o.includes(" & ")){let l=o.split(" & "),t="";l.forEach(c=>{t+=`:not([data-filtered-by="${c}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${t}`)).length}else if(!o.includes(" == "))n=Array.from(a.querySelectorAll(`tbody tr:not([data-filtered-by="${o}"])`)).length;else if(o.includes(" && ")){let l=o.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let c=!0;for(const[h,u]of Object.entries(l)){let m=u.split(" == ");(!t.querySelector(`td[data-label="${m[0]}"]`)||t.querySelector(`td[data-label="${m[0]}"]`).textContent!=`${m[1]}`)&&(c=!1)}return c}).length}else{let l=o.split(" == ");n=Array.from(a.querySelectorAll(`tbody tr.filtered--matched td[data-label="${l[0]}"], tbody tr[data-filtered-by="${l[0]}"] td[data-label="${l[0]}"]`)).filter(function(t){return t.textContent===l[1]}).length}b.hasAttribute("data-total")?b.setAttribute("data-total",n):b.innerHTML=n})},Z=function(a,e,r,i){r.addEventListener("update-page",b=>{let d=e.querySelector("[data-pagination]"),o=b.detail.page;if(d.value=o,e.dispatchEvent(new Event("paginate")),i.setAttribute("data-page",o),a.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",o),history.pushState({type:"pagination",form:e.getAttribute("id"),page:o},"",n)}if(!i.hasAttribute("data-no-scroll")){const l=a.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:l,behavior:"smooth"})}}),r.addEventListener("update-show",b=>{let d=e.querySelector("[data-show]"),o=b.detail.show;d.value=o,i.setAttribute("data-show",o),e.dispatchEvent(new Event("submit"))})},tt=(a,e)=>{if(!a)return!1;a.addEventListener("click",r=>{et(e)})},et=function(a){for(var e=[],r=a.getElementsByTagName("tr"),i=0;i<r.length;i++){for(var b=r[i].querySelectorAll("td,th"),d=[],o=0;o<b.length;o++)d.push(`"${b[o].textContent}"`);e.push(d.join(","))}e=e.join(`
|
|
5
5
|
`);let n=new Blob([e],{type:"text/csv"});var l=document.createElement("a");l.download="export.csv";var t=window.URL.createObjectURL(n);l.href=t,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},I=function(a,e,r,i){if(R(a),G(a,i),_(a,e,i),i&&i.classList.contains("table--cta")){let d=function(){Array.from(a.querySelectorAll("tr")).forEach((o,n)=>{let l=o.offsetHeight;o.style.setProperty("--row-height",`${l}px`)})};const b=J(a);i.style.setProperty("--cta-width",`${b}rem`),new ResizeObserver(d).observe(a)}},P=function(a){let e=new Object;return Array.from(a.querySelectorAll("[data-filter]")).forEach((i,b)=>{if(!(i.type=="radio"&&!i.checked)&&!(i.type=="checkbox"&&!i.checked)&&i&&i.value){let d=i.getAttribute("data-filter");e[d]||(e[d]=new Array),e[d].push(i.value)}}),e},z=function(a,e,r,i){return Y(this,void 0,void 0,function*(){let b=new FormData(e),d=new URLSearchParams(b).toString(),o=a.querySelectorAll("thead tr th:not(.expand-button-heading)"),n=a.querySelector("tbody"),l=e.getAttribute("data-ajax");i.classList.add("table--loading");let t=P(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML="",u.parentNode.classList.remove("hover")});let c=0;Object.values(t).forEach((u,m)=>{typeof u=="object"&&Object.values(u).length?c+=Object.values(u).length:c++}),c&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((u,m)=>{u.innerHTML+=`(${c})`,u.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;const{signal:h}=controller[l];r.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(l+"?"+d,{signal:h,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(u=>u.json()).then(u=>{let m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",s=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",g=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",x=k(u,s,15),S=k(u,g,1),q=k(u,m),E=i.hasAttribute("data-empty-msg")?i.getAttribute("data-empty-msg"):"No results found";q?(n.innerHTML="",q.forEach((v,f)=>{var y=document.createElement("tr");o.forEach((p,w)=>{let A="";var L=document.createElement("td");if(L.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var $=p.getAttribute("data-output");A=$.replace(new RegExp(/{(.*?)}/,"gm"),function(D){return k(v,D.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var $=p.getAttribute("data-output");let F=k(v,$.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=p.getAttribute("data-output-array"),T="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){const H=k(j,p.getAttribute("data-output-array-property")),U=JSON.parse(p.getAttribute("data-output-array-transform"))[H];T=W.replace(`{${p.getAttribute("data-output-array-property")}}`,U)}T=T.replace(new RegExp(/{(.*?)}/,"gm"),function(H){return k(j,H.replace("{","").replace("}",""))}),A+=T})}p.hasAttribute("data-transform")&&(A=JSON.parse(p.getAttribute("data-transform"))[A],!A&&p.hasAttribute("data-default")&&(A=p.getAttribute("data-default"))),L.innerHTML=A,y.appendChild(L)}),n.appendChild(y)}),N(a,e),i.setAttribute("data-total",parseInt(x)),i.setAttribute("data-page",parseInt(S)),I(a,e,r,i),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((v,f)=>{let y=k(u,v.getAttribute("data-ajax-query"),"");v.hasAttribute("data-total")?v.setAttribute("data-total",y):v.innerHTML=y}),parseInt(x)==0&&(n.innerHTML=`<tr><td colspan="100%"><span>${E}</span></td></tr>`),i.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:d})):n.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',r.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(u){console.log(u)}})},M=(a,e)=>{switch(a){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
<iam-pagination class="pagination--table" ${this.hasAttribute("data-page")?`data-page="${this.getAttribute("data-page")}"`:""} ></iam-pagination>
|
|
30
|
-
`,this.shadowRoot.appendChild(i.content.cloneNode(!0)),document.getElementById("tableExtras")||document.head.insertAdjacentHTML("beforeend",`<style id="tableExtras">*:has(>iam-table){container-type:inline-size}iam-table{--hover-background: var(--colour-light);--row-bg: var(--colour-canvas-2)}iam-table thead tr{background:var(--row-bg)}iam-table tbody tr{background:var(--row-bg)}iam-table tbody tr:is(:hover,:focus-within,.hover){--bg-colour-rgb: 238,238,238;--row-bg: var(--hover-background);background:var(--row-bg)}@media screen and (prefers-color-scheme: dark){iam-table tbody tr{--hover-background: var(--colour-canvas)}iam-table tbody tr:is(:hover,:focus-within,.hover){background:var(--row-bg)}}iam-table[data-expandable] [data-expand-button][aria-expanded]{background-color:rgba(0,0,0,0)}@container (width < 23.4375em){iam-table:not(.table--fullwidth) thead{display:none}iam-table:not(.table--fullwidth) tbody{display:block;overflow:visible}iam-table:not(.table--fullwidth) tbody tr td:first-child{padding-top:0}iam-table:not(.table--fullwidth) tr{display:block;position:relative;border:none;background:var(--row-bg);padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.5rem}iam-table:not(.table--fullwidth) tr+tr{margin-top:2rem}iam-table:not(.table--fullwidth) tr:is(:hover,:focus,.hover){--row-bg: var(--colour-canvas-2)}iam-table:not(.table--fullwidth) :is(td,th){display:block;border-color:var(--colour-border);padding-right:0}iam-table:not(.table--fullwidth) :is(td,th):nth-child(1){border-top:none}iam-table:not(.table--fullwidth) :is(td,th)[data-label]:not([data-label=""]):before{content:attr(data-label);color:var(--colour-heading);padding:0 0 0.375rem 0;margin-bottom:0;display:block;font-weight:bold}iam-table:not(.table--fullwidth) td:first-child::after{top:1.75rem !important}iam-table:not(.table--fullwidth) td::after{top:2.5rem}iam-table:not(.table--fullwidth) .td--fixed{padding-right:50%}iam-table:not(.table--fullwidth) tbody tr td:not(:first-child){border-top:var(--border-width) solid currentColor;border-color:var(--colour-border) !important}iam-table:not(.table--fullwidth) tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}iam-table:not(.table--fullwidth) td:has([data-expand-button]){height:0;padding:0;position:relative}iam-table:not(.table--fullwidth) td:has([data-expand-button])+td{border-top:none !important;padding-top:0 !important}iam-table:not(.table--fullwidth) [data-expand-button]{top:0;right:0;background:rgba(0,0,0,0) !important;border:none;position:absolute;overflow:hidden;--compact-size: 2rem}iam-table:not(.table--fullwidth) [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF055";font-weight:300 !important;font-size:1.75rem;line-height:var(--compact-size) !important}iam-table:not(.table--fullwidth) [data-expand-button][aria-expanded]:before{content:"\uF056";font-weight:900 !important}iam-table:not(.table--fullwidth) .dialog__wrapper{margin-top:-0.5rem;margin-left:-1rem;z-index:10}iam-table:not(.table--fullwidth) tbody tr:not([data-view=full]) td:not(.td--fixed)+td:not(.td--fixed)+td+td{display:none}iam-table.table--cta:not(.table--fullwidth) tr td:not(:first-child):last-child{display:block !important;position:static;width:100%;min-width:100%;margin-left:0;padding-left:0;text-align:left;min-height:0}iam-table.table--cta:not(.table--fullwidth) tr td:not(:first-child):last-child:after{display:none}}@container (width > 23.4375em){iam-table.table--cta:not(.table--loading):has(tr:first-child td:first-child:last-child){padding-right:calc(var(--wrapper-padding) + 1.5rem)}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>th:nth-last-child(2),iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>td:nth-last-child(2){padding-right:var(--cta-width)}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child{position:absolute;left:calc(100% - var(--cta-width));top:auto;background:rgba(0,0,0,0);width:var(--cta-width);min-height:calc(var(--row-height) - 2px);text-align:right;background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem);cursor:default}@media screen and (prefers-color-scheme: dark){iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem)}}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child a{white-space:nowrap;padding-right:.2rem}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tbody tr:hover>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem)}}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta){position:relative}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) thead{position:sticky;top:0;left:0;z-index:1;background-color:var(--row-bg)}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) thead:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--colour-primary)}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody{position:relative}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody tr:first-child td{border-top:0}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody tr:last-child td{border-bottom:0}table .hide-status:after{display:none}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)){position:relative;padding-left:1.5rem}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty))::before{margin-left:-1.5rem !important}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)):after{font-family:"Font Awesome 6 Pro";position:absolute;top:1rem;left:0;font-size:1rem;line-height:1;height:1rem;width:1rem;display:inline-block}table [data-content=high]:after{content:"\uF325";font-weight:normal;color:var(--colour-danger)}table [data-content=medium]:after{content:"\uF7A4";font-weight:normal;color:var(--colour-warning)}table [data-content=low]:after{content:"\uE404";font-weight:normal;color:var(--colour-complete)}table [data-content=unknown]:after{content:"\uE404";font-weight:normal;color:var(--colour-muted)}table :is([data-content=overdue],[data-content=due],[data-content=incomplete]):after{content:"\uF024";color:var(--colour-danger)}table :is([data-content="not started"],[data-content="to do"],[data-content="on track"]):after{content:"\uF024";color:var(--colour-muted)}table :is([data-content="requires approval"],[data-content="approval required"],[data-content="action required"],[data-content=upcoming]):after{content:"\uF024";color:var(--colour-warning)}table :is([data-content=warning]):after{content:"\uF071";color:var(--colour-warning)}table :is([data-content="manually verified"],[data-content=verified],[data-content=completed],[data-content=complete]):after{content:"\uF00C";font-weight:normal;color:var(--colour-complete)}table .alert-status:not([data-content="0"]):not([data-content=""]):not(:empty):after{content:"\uF0F3";color:var(--colour-primary)}iam-table .table--filtered tbody tr:not(.filtered--show){display:none !important}iam-table table:not(.table--filtered):not(.table--ajax) tbody tr:nth-child(15)~tr{display:none}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.75rem !important;left:.25rem !important}iam-table:has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100vw;height:100%;max-height:var(--row-height);max-width:100vw;cursor:pointer;pointer-events:all;top:auto;margin:0;margin-top:0rem}iam-table tr:has([type=checkbox]:checked){--row-bg: #E0E0E0}@media screen and (prefers-color-scheme: dark){iam-table tr:has([type=checkbox]:checked){--row-bg: #000000}}@container (width < 23.4375em){@media screen and (prefers-color-scheme: light){iam-table:has([slot=before]) iam-actionbar{background-color:#e6eaec}}iam-table:has([slot=before]) .actionbar__sticky+*{margin-top:0 !important}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important;min-height:2rem}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.25rem !important;left:0 !important}iam-table:has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100%;height:100%;max-height:100%;max-width:100%;margin-top:-2rem}}iam-table.table--fullwidth:not([data-expandable]) th.expand-button-heading{display:none}iam-table.table--fullwidth:not([data-expandable]) td:has([data-expand-button]){display:none}@container (width > 23.4375em){iam-table:not([data-expandable]) th.expand-button-heading{display:none}iam-table:not([data-expandable]) td.td--expand{display:none}iam-table[data-expandable] [data-expand-button]{margin:0}iam-table[data-expandable] [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF078";font-weight:500}iam-table[data-expandable] [data-expand-button][aria-expanded]:before{content:"\uF077"}iam-table[data-expandable] tr:not(:has(p)) [data-expand-button]{display:none}iam-table[data-expandable] tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}}@container (width < 23.4375em){iam-table:not(.table--fullwidth) .td--fixed+td:not(.td--fixed){border-top:none}}@container (width > 23.4375em){iam-table{--width-adjust: 0px}iam-table:has([type=checkbox]){--width-adjust: -1rem}iam-table .th--fixed{min-width:calc(4.5rem + var(--width-adjust));position:absolute;padding:0}iam-table .th--fixed:after{top:auto;left:0;content:"";position:absolute;width:100%;height:calc(var(--row-height) - 2px);background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table .td--fixed{position:absolute;position:absolute;left:auto;top:auto;z-index:3;padding:0.25rem 0 0 0;min-width:4.5rem;height:calc(var(--row-height) - 2px);text-align:left;background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table .td--fixed:has([open]){z-index:4}iam-table tr:is(:hover,:focus) .td--fixed{background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table tr:has([data-expand-button]){height:calc(4.625rem - 2px)}iam-table .td--fixed+td:not(.td--fixed){padding-left:calc(4.5rem + var(--width-adjust))}iam-table .th--fixed:not(.expand-button-heading)+.th--fixed+th:not(.th--fixed),iam-table .td--fixed:not(.td--expand)+.td--fixed+td:not(.td--fixed){padding-left:calc(7.75rem + var(--width-adjust))}iam-table[data-expandable] .th--fixed+.th--fixed+th:not(.th--fixed),iam-table[data-expandable] .td--fixed+.td--fixed+td:not(.td--fixed){padding-left:calc(7.75rem + var(--width-adjust))}iam-table .th--fixed+.th--fixed,iam-table .td--fixed+.td--fixed{padding-left:calc(3.25rem + var(--width-adjust));min-width:calc(7.75rem + var(--width-adjust))}iam-table .th--fixed:has(+.th--fixed),iam-table .td--fixed:has(+.td--fixed){min-width:calc(3.25rem + var(--width-adjust));z-index:5}iam-table .dialog__wrapper{z-index:10}iam-table .dialog__wrapper:has([open]){z-index:20}iam-table[data-expandable] input:is([type=radio],[type=checkbox])+label:before,iam-table[data-expandable] input:is([type=radio],[type=checkbox])+label:after{left:1.25rem !important}iam-table:not([data-expandable]) th.expand-button-heading+th{padding-left:0 !important}iam-table:not([data-expandable]) td.td--expand+td{padding-left:0 !important}iam-table:not([data-expandable]) th.expand-button-heading+.th--fixed{min-width:calc(4.5rem + var(--width-adjust)) !important}iam-table:not([data-expandable]) td.td--expand+.td--fixed{min-width:calc(4.5rem + var(--width-adjust)) !important}}/*# sourceMappingURL=assets/css/components/table.global.css.map */
|
|
30
|
+
`,this.shadowRoot.appendChild(i.content.cloneNode(!0)),document.getElementById("tableExtras")||document.head.insertAdjacentHTML("beforeend",`<style id="tableExtras">*:has(>iam-table){container-type:inline-size}iam-table{--hover-background: var(--colour-light);--row-bg: var(--colour-canvas-2)}iam-table thead tr{background:var(--row-bg)}iam-table tbody tr{background:var(--row-bg);height:3.5rem}iam-table tbody tr:is(:hover,:focus-within,.hover){--bg-colour-rgb: 238,238,238;--row-bg: var(--hover-background);background:var(--row-bg)}@media screen and (prefers-color-scheme: dark){iam-table tbody tr{--hover-background: var(--colour-canvas)}iam-table tbody tr:is(:hover,:focus-within,.hover){background:var(--row-bg)}}iam-table[data-expandable] [data-expand-button][aria-expanded]{background-color:rgba(0,0,0,0)}@container (width < 23.4375em){iam-table:not(.table--fullwidth) thead{display:none}iam-table:not(.table--fullwidth) tbody{display:block;overflow:visible}iam-table:not(.table--fullwidth) tbody tr td:first-child{padding-top:0}iam-table:not(.table--fullwidth) tr{display:block;position:relative;border:none;background:var(--row-bg);padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.5rem;height:auto}iam-table:not(.table--fullwidth) tr+tr{margin-top:2rem}iam-table:not(.table--fullwidth) tr:is(:hover,:focus,.hover){--row-bg: var(--colour-canvas-2)}iam-table:not(.table--fullwidth) :is(td,th){display:block;border-color:var(--colour-border);padding-right:0}iam-table:not(.table--fullwidth) :is(td,th):nth-child(1){border-top:none}iam-table:not(.table--fullwidth) :is(td,th)[data-label]:not([data-label=""]):before{content:attr(data-label);color:var(--colour-heading);padding:0 0 0.375rem 0;margin-bottom:0;display:block;font-weight:bold}iam-table:not(.table--fullwidth) td:first-child::after{top:1.75rem !important}iam-table:not(.table--fullwidth) td::after{top:2.5rem}iam-table:not(.table--fullwidth) .td--fixed{padding-right:50%}iam-table:not(.table--fullwidth) tbody tr td:not(:first-child){border-top:var(--border-width) solid currentColor;border-color:var(--colour-border) !important}iam-table:not(.table--fullwidth) tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}iam-table:not(.table--fullwidth) td:has([data-expand-button]){height:0;padding:0;position:relative}iam-table:not(.table--fullwidth) td:has([data-expand-button])+td{border-top:none !important;padding-top:0 !important}iam-table:not(.table--fullwidth) [data-expand-button]{top:0;right:0;background:rgba(0,0,0,0) !important;border:none;position:absolute;overflow:hidden;--compact-size: 2rem}iam-table:not(.table--fullwidth) [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF055";font-weight:300 !important;font-size:1.75rem;line-height:var(--compact-size) !important}iam-table:not(.table--fullwidth) [data-expand-button][aria-expanded]:before{content:"\uF056";font-weight:900 !important}iam-table:not(.table--fullwidth) .dialog__wrapper:not([slot=overflow]){margin-top:-0.5rem;margin-left:-1rem;z-index:10}iam-table:not(.table--fullwidth) tbody tr:not([data-view=full]) td:not(.td--fixed)+td:not(.td--fixed)+td+td{display:none}iam-table.table--cta:not(.table--fullwidth) tr td:not(:first-child):last-child{display:block !important;position:static;width:100%;min-width:100%;margin-left:0;padding-left:0;text-align:left;min-height:0}iam-table.table--cta:not(.table--fullwidth) tr td:not(:first-child):last-child:after{display:none}}@container (width > 23.4375em){iam-table.table--cta:not(.table--loading):has(tr:first-child td:first-child:last-child){padding-right:calc(var(--wrapper-padding) + 1.5rem)}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>th:nth-last-child(2),iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>td:nth-last-child(2){padding-right:var(--cta-width)}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child{position:absolute;left:calc(100% - var(--cta-width));top:auto;background:rgba(0,0,0,0);width:var(--cta-width);min-height:calc(var(--row-height) - 2px);text-align:right;background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem);cursor:default;padding-bottom:0}@media screen and (prefers-color-scheme: dark){iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem)}}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tr>*:not(:first-child):last-child a{white-space:nowrap;padding-right:.2rem;padding-bottom:0}iam-table.table--cta:not(.table--loading):not(:has(tr:first-child td:first-child:last-child)) tbody tr:hover>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg) 1.25rem)}}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta){position:relative}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) thead{position:sticky;top:0;left:0;z-index:1;background-color:var(--row-bg)}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) thead:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--colour-primary)}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody{position:relative}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody tr:first-child td{border-top:0}iam-table:is(.mh-sm,.mh-md,.mh-lg):not(.table--cta) tbody tr:last-child td{border-bottom:0}table .hide-status:after{display:none}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)){position:relative;padding-left:1.5rem}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty))::before{margin-left:-1.5rem !important}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)):after{font-family:"Font Awesome 6 Pro";position:absolute;top:1rem;left:0;font-size:1rem;line-height:1;height:1rem;width:1rem;display:inline-block}table [data-content=high]:after{content:"\uF325";font-weight:normal;color:var(--colour-danger)}table [data-content=medium]:after{content:"\uF7A4";font-weight:normal;color:var(--colour-warning)}table [data-content=low]:after{content:"\uE404";font-weight:normal;color:var(--colour-complete)}table [data-content=unknown]:after{content:"\uE404";font-weight:normal;color:var(--colour-muted)}table :is([data-content=overdue],[data-content=due],[data-content=incomplete]):after{content:"\uF024";color:var(--colour-danger)}table :is([data-content="not started"],[data-content="to do"],[data-content="on track"]):after{content:"\uF024";color:var(--colour-muted)}table :is([data-content="requires approval"],[data-content="approval required"],[data-content="action required"],[data-content=upcoming]):after{content:"\uF024";color:var(--colour-warning)}table :is([data-content=warning]):after{content:"\uF071";color:var(--colour-warning)}table :is([data-content="manually verified"],[data-content=verified],[data-content=completed],[data-content=complete]):after{content:"\uF00C";font-weight:normal;color:var(--colour-complete)}table .alert-status:not([data-content="0"]):not([data-content=""]):not(:empty):after{content:"\uF0F3";color:var(--colour-primary)}iam-table .table--filtered tbody tr:not(.filtered--show){display:none !important}iam-table table:not(.table--filtered):not(.table--ajax) tbody tr:nth-child(15)~tr{display:none}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.75rem !important;left:.25rem !important}iam-table:has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100vw;height:100%;max-height:var(--row-height);max-width:100vw;cursor:pointer;pointer-events:all;top:auto;margin:0;margin-top:0rem}iam-table tr:has([type=checkbox]:checked){--row-bg: #E0E0E0}@media screen and (prefers-color-scheme: dark){iam-table tr:has([type=checkbox]:checked){--row-bg: #000000}}@container (width < 23.4375em){@media screen and (prefers-color-scheme: light){iam-table:has([slot=before]) iam-actionbar{background-color:#e6eaec}}iam-table:has([slot=before]) .actionbar__sticky+*{margin-top:0 !important}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important;min-height:2rem}iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,iam-table input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.25rem !important;left:0 !important}iam-table:has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100%;height:100%;max-height:100%;max-width:100%;margin-top:-2rem}}iam-table.table--fullwidth:not([data-expandable]) th.expand-button-heading{display:none}iam-table.table--fullwidth:not([data-expandable]) td:has([data-expand-button]){display:none}@container (width > 23.4375em){iam-table:not([data-expandable]) th.expand-button-heading{display:none}iam-table:not([data-expandable]) td.td--expand{display:none}iam-table[data-expandable] [data-expand-button]{margin:0}iam-table[data-expandable] [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF078";font-weight:500}iam-table[data-expandable] [data-expand-button][aria-expanded]:before{content:"\uF077"}iam-table[data-expandable] tr:not(:has(p)) [data-expand-button]{display:none}iam-table[data-expandable] tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}}@container (width < 23.4375em){iam-table:not(.table--fullwidth) .td--fixed+td:not(.td--fixed){border-top:none}}@container (width > 23.4375em){iam-table{--width-adjust: 0px}iam-table:has([type=checkbox]){--width-adjust: -1rem}iam-table .th--fixed{min-width:calc(4.5rem + var(--width-adjust));position:absolute;padding:0}iam-table .th--fixed:after{top:auto;left:0;content:"";position:absolute;width:100%;height:calc(var(--row-height) - 2px);background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table .td--fixed{position:absolute;position:absolute;left:auto;top:auto;z-index:3;padding:0.25rem 0 0 0;min-width:4.5rem;height:calc(var(--row-height) - 2px);text-align:left;background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table .td--fixed:has([open]){z-index:4}iam-table tr:is(:hover,:focus) .td--fixed{background:linear-gradient(90deg, var(--row-bg) calc(100% - 1.5rem), transparent 100%)}iam-table tr:has([data-expand-button]){height:calc(4.625rem - 2px)}iam-table .th--fixed+th:not(.th--fixed),iam-table .td--fixed+td:not(.td--fixed){padding-left:calc(4.5rem + var(--width-adjust))}iam-table .th--fixed:not(.expand-button-heading)+.th--fixed+th:not(.th--fixed),iam-table .td--fixed:not(.td--expand)+.td--fixed+td:not(.td--fixed){padding-left:calc(7.75rem + var(--width-adjust))}iam-table[data-expandable] .th--fixed+.th--fixed+th:not(.th--fixed),iam-table[data-expandable] .td--fixed+.td--fixed+td:not(.td--fixed){padding-left:calc(7.75rem + var(--width-adjust))}iam-table .th--fixed+.th--fixed,iam-table .td--fixed+.td--fixed{padding-left:calc(3.25rem + var(--width-adjust));min-width:calc(7.75rem + var(--width-adjust))}iam-table .th--fixed:has(+.th--fixed),iam-table .td--fixed:has(+.td--fixed){min-width:calc(3.25rem + var(--width-adjust));z-index:5}iam-table .dialog__wrapper{z-index:10}iam-table .dialog__wrapper:has([open]){z-index:20}iam-table[data-expandable] input:is([type=radio],[type=checkbox])+label:before,iam-table[data-expandable] input:is([type=radio],[type=checkbox])+label:after{left:1.25rem !important}iam-table:not([data-expandable]) th.expand-button-heading+th{padding-left:0 !important}iam-table:not([data-expandable]) td.td--expand+td{padding-left:0 !important}iam-table:not([data-expandable]) th.expand-button-heading+.th--fixed{min-width:calc(4.5rem + var(--width-adjust)) !important}iam-table:not([data-expandable]) td.td--expand+.td--fixed{min-width:calc(4.5rem + var(--width-adjust)) !important}}/*# sourceMappingURL=assets/css/components/table.global.css.map */
|
|
31
31
|
</style>`)}connectedCallback(){const e=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",e.has("page")?e.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",e.has("show")?e.get("show"):15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",this.getAttribute("data-show"));let r=this.classList.toString();if(r=r.replace("table--cta",""),r=r.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=` ${r}`,this.querySelector(".actionbar__sticky")&&this.shadowRoot.querySelector(".table__wrapper").classList.add("has-actionbar"),this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector("iam-pagination"),this.pagination.setAttribute("data-total",this.getAttribute("data-total")),this.pagination.setAttribute("data-page",this.getAttribute("data-page")),this.pagination.setAttribute("data-show",this.getAttribute("data-show")),this.pagination.setAttribute("data-increment",this.getAttribute("data-show")),this.hasAttribute("data-page-jump")&&this.pagination.setAttribute("data-page-jump","true"),this.hasAttribute("data-per-page")&&this.pagination.setAttribute("data-per-page","true"),this.hasAttribute("data-item-count")&&this.pagination.setAttribute("data-item-count","true"),this.hasAttribute("data-loading")&&this.pagination.setAttribute("data-loading","true"),this.classList.contains("table--fullwidth")&&this.pagination.setAttribute("data-minimal","true"),this.classList.contains("table--cta")||this.shadowRoot.querySelector(".table--cta").classList.remove("table--cta"),this.form=document.createElement("form"),this.hasAttribute("data-filterby")?this.form=document.querySelector(`#${this.getAttribute("data-filterby")}`):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),N(this.table,this.form),this.form.querySelector("[data-pagination]")||(this.form.innerHTML+=`<input name="page" type="hidden" value="${this.getAttribute("data-page")}" data-pagination="true" />`),this.form.querySelector("[data-show]")||(this.form.innerHTML+=`<input name="show" type="hidden" value="${this.getAttribute("data-show")}" data-show="true" />`),K(this.table),V(this.table,this.form,this.pagination,this,this.savedTableBody),Z(this.table,this.form,this.pagination,this),tt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax"))z(this.table,this.form,this.pagination,this);else{let b=function(o=1){return Math.floor(Math.random()*Date.now()*(o+1))};if(this.querySelector("iam-actionbar[data-selectall]")){const o=this.querySelector("iam-actionbar[data-selectall]");Array.from(this.table.querySelectorAll("thead tr")).forEach((n,l)=>{n.insertAdjacentHTML("afterbegin",'<th class="th--fixed"></th>')}),Array.from(this.table.querySelectorAll("tbody tr")).forEach((n,l)=>{let t=`row${b(l)}`;n.insertAdjacentHTML("afterbegin",`<td class="td--fixed selectrow"><input type="checkbox" name="row" id="${t}"/><label for="${t}"><span class="visually-hidden">Select row</span></label></td>`)}),this.table.addEventListener("change",n=>{if(n&&n.target instanceof HTMLElement&&n.target.closest(".selectrow input")){let l=this.table.querySelectorAll('.selectrow input[type="checkbox"]').length,t=this.table.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;o.setAttribute("data-selected",l==t?"all":t)}}),o.addEventListener("selected",n=>{n.detail.selected=="0"?Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((l,t)=>{l.checked=!1}):n.detail.selected=="all"&&Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((l,t)=>{l.checked=!0})})}let d=-1;Array.from(this.table.querySelectorAll("tbody tr")).forEach((o,n)=>{if(o.querySelector(":scope > td > .dialog__wrapper")){let l=o.querySelector(":scope > td > .dialog__wrapper").parentNode;l.classList.add("td--fixed"),d=Array.from(l.parentNode.children).indexOf(l)}}),d!=-1&&(this.table.querySelector(`thead tr th:nth-child(${d+1})`).classList.add("th--fixed"),Array.from(this.table.querySelectorAll(`tbody tr td:nth-child(${d+1})`)).forEach((o,n)=>{o.classList.add("td--fixed")})),I(this.table,this.form,this.pagination,this),C(this.table,this.form,this),_(this.table,this.form)}this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",b=>{this.table.querySelector("dialog[open]")&&(this.table.querySelector("dialog[open]").close(),this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"))})}static get observedAttributes(){return["data-total","data-page","data-show"]}attributeChangedCallback(e,r,i){switch(this.pagination=this.shadowRoot.querySelector("iam-pagination"),e){case"data-total":{r!=i&&this.pagination.setAttribute("data-total",i);break}case"data-show":{r!=i&&this.pagination.setAttribute("data-show",i);break}case"data-page":{r!=i&&this.pagination.setAttribute("data-page",i);break}}}}export{at as default};
|
|
32
32
|
//# sourceMappingURL=table.component.min.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const d=function(t){t.querySelectorAll(":scope > details");const o=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}let i=0;o.forEach((e,r)=>{let n=document.createElement("button");if(e.matches("details")){let s=e.querySelector(":scope > summary"),l=s.classList.contains("disabled");s.classList.add("visually-hidden"),e.hasAttribute("id")&&n.setAttribute("data-id",`${e.getAttribute("id")}`),e.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${s.innerText}`,n.classList.add("link"),n.setAttribute("data-index",i),e.setAttribute("tabindex","-1"),l&&n.classList.add("disabled"),i++}else e.matches("a")&&(n=e);n.classList.add("link"),a.appendChild(n)})},c=function(t){let o=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),i=t.querySelectorAll(":scope .tabs__links > button");t.shadowRoot&&(i=t.shadowRoot.querySelectorAll(".tabs__links > button")),i.forEach(e=>{e.addEventListener("click",r=>{if(r.preventDefault(),e.classList.contains("disabled"))return!1;i.forEach(n=>{let s=n==e;n.setAttribute("aria-pressed",s)}),o.forEach((n,s)=>{let l=e.getAttribute("data-index")==s;l?n.setAttribute("open",l):n.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})})}),a.forEach((e,r)=>{e.addEventListener("click",n=>{n.preventDefault(),i[r].click()})})},p=function(t){if(!t.querySelector(":scope > details"))return!1;let o=t.querySelectorAll(":scope > details"),a=t.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&t.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(t.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(o[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},b=function(t){d(t),c(t),p(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.4.2-
|
|
2
|
+
* iamKey v5.4.2-beta4
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/(function(h){typeof define=="function"&&define.amd?define(h):h()})(function(){"use strict";const h=t=>(t.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie"),null),L=t=>{const i=function(e){const a=document.querySelector(`label[for="${e.replace("#","")}"]`),o=document.querySelector(e+" summary"),r=document.querySelector(`dialog${e}`),s=document.querySelector(`detail${e}`);a instanceof HTMLElement?a.click():o instanceof HTMLElement?o.click():r instanceof HTMLElement?r.showModal():s instanceof HTMLElement&&s.addAttribute("open")};return location.hash&&i(location.hash),window.addEventListener("hashchange",function(){i(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state&&e.state.type&&e.state.type=="pagination"){let a=document.querySelector(`#${e.state.form}`),o=document.querySelector(`#${e.state.form} [data-pagination]`);o?o.value=e.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${e.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){let a=e.target;Array.from(a.querySelectorAll("[data-password-type]")).forEach((o,r)=>{o.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),e.preventDefault())}}),document.addEventListener("keydown",e=>{e.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(e.preventDefault(),e.stopPropagation())}),null};class S{constructor(i){document.body.classList.contains("youtubeLoaded")?i.addEventListener("click",function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){e.preventDefault(),y(a);break}},!1):this.loadScripts(i,this.createEmbed)}loadScripts(i){return new Promise((e,a)=>{const o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(r,s),document.body.classList.add("youtubeLoaded"),e(!0),r.onload=()=>{i.addEventListener("click",function(n){console.log("click"),n&&n.target instanceof HTMLElement&&n.target.closest("a")&&(n.preventDefault(),y(n.target.closest("a")))},!1)}},o.onerror=function(){a(!1)},o.src="https://youtube.com/favicon.ico"})}}const y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var i=t.getAttribute("data-id"),e=t.getAttribute("id");if(typeof e>"u"||e==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));e=a+Date.now(),t.setAttribute("id",e)}function o(){window.player=new YT.Player(e,{height:"100%",width:"100%",videoId:i,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:n}})}o();function r(l){l.target.playVideo()}var s=!1;function n(l){if(l.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(e);c.classList.add("player-ready"),s=!0}}},E=t=>(Array.from(t.querySelectorAll("dialog[open]")).forEach((i,e)=>{i.closest(".dialog__wrapper")||(i.removeAttribute("open"),i.showModal(),i.focus(),w(i))}),t.addEventListener("click",i=>{if(i.target.tagName=="IAM-ACTIONBAR")return!1;if(i&&i.target instanceof HTMLElement&&i.target.closest("[data-modal]")){const o=i.target.closest("[data-modal]"),r=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),s=document.querySelector(`dialog#${r}`);w(s),s.showModal(),s.focus();let n=s.offsetWidth;s.setAttribute("style",`max-width: ${n}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((l,c)=>{const d=l.getAttribute("data-duplicate"),u=document.getElementById(d);if(l.checked!=u.checked){l.checked=u.checked;let f=new Event("change");l.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(i&&i.target instanceof HTMLElement&&i.target.closest("button.dialog__close")){const o=i.target.closest("dialog[open]");i.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest('button[formmethod="dialog"]')){const o=i.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(i&&i.target instanceof HTMLElement&&i.target.closest("dialog[open]")){let o=i.target.closest("dialog[open]");var e=window.getComputedStyle(o);if(e.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const r=o.getBoundingClientRect();(i.clientX<r.left||i.clientX>r.right||i.clientY<r.top||i.clientY>r.bottom)&&(i.target.closest('input[type="radio"]')||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(i&&i.target instanceof HTMLElement&&i.target.closest(".dialog__wrapper > button")){i.stopPropagation();let o=i.target.closest(".dialog__wrapper > button"),r=i.target.closest(".dialog__wrapper > button").parentNode,s="openPopover",n=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=n&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.removeAttribute("aria-expanded")}),n.hasAttribute("open"))n.close(),s="closePopover",n.removeAttribute("style"),o.removeAttribute("aria-expanded");else{n.show(),o.setAttribute("aria-expanded",!0);var a=o.getBoundingClientRect();let u=a.top,f=a.left;if(o.closest("iam-table")){let m=o.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}n.classList.contains("dialog--fix")&&n.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let l=n.getBoundingClientRect(),c=l.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=n.hasAttribute("style")?n.getAttribute("style")+" ":"";n.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),l=n.getBoundingClientRect(),l.top-window.scrollY<100&&n.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:o.textContent})}i&&i.target instanceof HTMLElement&&!i.target.closest("dialog[open]")&&!i.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,r)=>{o.removeAttribute("aria-expanded")}))}),null),w=t=>{let i=t.querySelector(".youtube-embed a");if(i&&y(i),t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&q(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML=`<div class="mh-lg">${t.innerHTML}</div>`;let e=t.querySelector(".mh-lg"),a=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let o=a.previousSibling;e.before(a),o&&a.before(o)}}t.querySelector(":scope > button:first-child")||t.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=t=>{let i="",e=Array.from(t.querySelectorAll("fieldset[data-title]")),a=t.querySelector("form");e.forEach((s,n)=>{i+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${n==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const l=document.createElement("div");if(l.classList.add("btn--wrapper"),s.appendChild(l),n!=0&&(l.innerHTML+=`<button data-title="${e[n-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),n!=e.length-1&&(l.innerHTML+=`<button data-title="${e[n+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),n==e.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),l.insertAdjacentElement("beforeend",c)}else l.innerHTML+=`<button data-title="${e[n].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),t.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${i}</div>`);let o=Array.from(t.querySelectorAll("fieldset.was-validated"));for(let s=0;s<o.length;s++){let n=o[s],l=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((c,d)=>{c.classList.add("valid")})}t.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const n=t.querySelector("fieldset.active")?t.querySelector("fieldset.active"):t.querySelector("fieldset[data-title]"),l=n.getAttribute("data-title");let c=!0;if(n.classList.add("was-validated"),Array.from(n.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(t.querySelectorAll(`[data-title="${l}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=t.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=t.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(t.querySelectorAll("button")).forEach((A,Y)=>{A.classList.remove("active")}),Array.from(t.querySelectorAll("fieldset")).forEach((A,Y)=>{A.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(t.querySelectorAll("fieldset")).length,u=Array.from(t.querySelectorAll("fieldset.valid")).length;t.style.setProperty("--progress",`${u/(d-1)*100}%`)}t.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const n=s.target.closest("button");s.keyCode==13&&n.getAttribute("type")!="submit"&&(s.preventDefault(),r(n))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),t.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const n=s.target.closest("button[data-title]");r(n)}return null})};function x(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",t=>{const i=t.target.closest("[open] summary");if(i)window.dataLayer.push({event:"closeDetails",detailsTitle:i.textContent||""});else{const e=t.target.closest("summary"),a=t.target.closest("a"),o=t.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function k(t){var i=new TextEncoder("utf-8").encode(t);return crypto.subtle.digest("SHA-1",i).then(function(e){for(var a=[],o=new DataView(e),r=0;r<o.byteLength;r+=4){var s=o.getUint32(r),n=s.toString(16),l="00000000",c=(l+n).slice(-l.length);a.push(c)}return a.join("")})}const T=(t,i)=>{k(t).then(function(e){const a=new XMLHttpRequest;a.addEventListener("load",function(){const o=this.responseText.split(`
|
|
5
5
|
`),r=e.slice(5).toUpperCase();var s=!1;for(let l in o)if(o[l].substring(0,35)==r){s=!0;break}const n=new CustomEvent("hibpCheck",{detail:s});i.dispatchEvent(n)}),a.open("GET","https://api.pwnedpasswords.com/range/"+e.substr(0,5)),a.send()})},M=t=>{function i(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((e,a)=>{e.parentElement,$(e)}),Array.from(document.querySelectorAll("label input")).forEach((e,a)=>{!e.closest("label").querySelector(".optional-text")&&!e.hasAttribute("required")&&e.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>')}),document.querySelector('input[type="date"]')){let a=function(o){const r=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),n=String(o.getDate()).padStart(2,"0");return`${r}-${s}-${n}`};const e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((o,r)=>{let s=e;if(o.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(o.getAttribute("data-start"))),o.setAttribute("min",a(s))),o.hasAttribute("data-period")){let n=parseInt(o.getAttribute("data-period")),l=new Date;l.setDate(s.getDate()+n),o.setAttribute("max",a(l))}if(o.hasAttribute("data-allowed-days")){let n=JSON.parse(`[${o.getAttribute("data-allowed-days")}]`);o.addEventListener("input",function(l){var c=new Date(this.value).getUTCDay();n.includes(c)?o.setCustomValidity(""):o.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&i(),document.onreadystatechange=()=>{document.readyState==="complete"&&i()},t.addEventListener("input",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){const a=e.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length),a.hasAttribute("data-strength-checker")&&p(a)}}),t.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){const a=e.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){const o=document.getElementById(a.getAttribute("data-input")),r=a.value;v(o,r)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){const a=e.target.closest("dialog");e.target.closest('dialog [type="radio"]'),Array.from(a.querySelectorAll('[type="radio"][autofocus]')).forEach((o,r)=>{o.removeAttribute("autofocus")}),Array.from(a.querySelectorAll('[type="radio"]:checked')).forEach((o,r)=>{o.setAttribute("autofocus",!0)})}}),t.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){const a=e.target.closest("[data-change-type]"),o=document.getElementById(a.getAttribute("data-input")),r=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",o.getAttribute("type")),v(o,r),a.hasAttribute("data-alt-class")){const s=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",s)}}})},$=t=>{let i=t.parentElement,e=t.getAttribute("maxlength");i.style.setProperty("--maxlength",e);let a=t.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),i.insertBefore(a,t.nextSibling)),a.setAttribute("data-count",t.value.length)},v=(t,i)=>{t.hasAttribute("type")&&t.getAttribute("type")=="password"&&t.setAttribute("data-password-type",!0),t.setAttribute("type",i)},p=(t,i="no")=>{const e=document.getElementById(t.getAttribute("data-strength-checker")),a=t.value,o=t.hasAttribute("minlength")?t.getAttribute("minlength"):12;let r=1,s=["Very weak","Weak","Average","Strong","Very strong"],n="";if(a.match(/(?=.*[0-9])/)&&(r+=1),a.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(r+=1),a.match(/(?=.*[a-z])/)&&(r+=1),a.match(/(?=.*[A-Z])/)&&(r+=1),a.length<o&&(r=1,n=`(must be at least ${o} characters.)`),r>=3&&i=="no"){let l=function(c,d){c.detail?p(d,"danger"):p(d,"success"),d.removeEventListener("hibpCheck",l)};T(a,t),t.addEventListener("hibpCheck",function(c){l(c,t)})}else r>=3&&i=="danger"&&(r=3,n="(this password is very common)");e&&(r<=3?e.classList.add("invalid-feedback"):e.classList.remove("invalid-feedback"),e.setAttribute("data-strength",r),e.innerHTML=`Password strength: ${s[r-1]} ${n}`)},_=t=>{Array.from(t.querySelectorAll("details")).forEach((i,e)=>{i.addEventListener("mouseenter",function(a){window.matchMedia("(min-width: 62em)").matches&&i.setAttribute("open","true")},!1),i.addEventListener("mouseleave",function(a){window.matchMedia("(min-width: 62em)").matches&&i.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([e])=>e.target.classList.toggle("is-stuck",e.intersectionRatio<1),{threshold:[1]}).observe(t)};function C(t){var i;const e=t.querySelector(".testimonial__images"),a=e.querySelectorAll("img").length;if(a==1)return!1;t.classList.add("testimonial--multi");const o=function(r){const s=t.querySelector(".btn-next"),n=t.querySelector(".btn-prev");s.setAttribute("data-go",r+1),n.setAttribute("data-go",r-1),s.removeAttribute("disabled"),n.removeAttribute("disabled"),r==1?n.setAttribute("disabled",!0):r==a&&s.setAttribute("disabled",!0)};e.addEventListener("scroll",function(r){clearTimeout(i),i=setTimeout(function(){let s=e.scrollWidth,n=e.scrollHeight,l=e.scrollLeft,c=e.scrollTop,d=Math.round(l/s*a)+1;l==0&&c!=0&&(d=Math.round(c/n*a)+1),t.setAttribute("data-show",d),o(d)},300)},!1),t.addEventListener("click",function(r){for(var s=r.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let n=parseInt(s.getAttribute("data-go")),l=0,c=0,d=e.scrollWidth,u=e.scrollHeight;d>u?c=Math.floor(d*((n-1)/a)):l=Math.floor(u*((n-1)/a)),e.scroll({top:l,left:c,behavior:"smooth"});break}},!1)}function H(t,i){var e;let a=t.querySelector(".carousel__inner"),o=t.querySelector(".carousel__controls"),r=i.querySelectorAll(".col").length;a.addEventListener("scroll",function(s){clearTimeout(e),e=setTimeout(function(){let n=a.clientWidth,l=a.scrollWidth,c=a.scrollLeft,d=Math.round(c/l*r)+1,u=i.querySelector(".col:last-child").offsetLeft+50;a.scrollLeft+n>=u&&(d=r),Array.from(t.querySelectorAll(".carousel__controls button")).forEach((f,m)=>{f.removeAttribute("aria-current")}),t.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),d==r?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),o.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches("button")){s.preventDefault(),Array.from(o.querySelectorAll("button")).forEach((c,d)=>{c.removeAttribute("aria-current")}),n.setAttribute("aria-current",!0);const l=i.querySelector(`*:nth-child(${n.getAttribute("data-slide")})`);a.scroll({top:0,left:l.offsetLeft,behavior:"smooth"});break}},!1),t.addEventListener("click",function(s){for(var n=s.target;n&&n!=this;n=n.parentNode)if(typeof n.matches=="function"&&n.matches(".btn-next, .btn-prev")){s.preventDefault();let l=n.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:l,behavior:"smooth"});break}},!1)}function D(t){t.addEventListener("change",function(i){var e=parseInt(t.querySelector("[data-min] select,[data-min] input").value),a=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach((o,r)=>{o.setAttribute("max",a)}),Array.from(t.querySelectorAll("[data-max] input")).forEach((o,r)=>{o.setAttribute("min",e)}),Array.from(t.querySelectorAll("[data-min] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))>a?o.classList.add("d-none"):o.classList.remove("d-none")}),Array.from(t.querySelectorAll("[data-max] select option")).forEach((o,r)=>{parseInt(o.getAttribute("value"))<e?o.classList.add("d-none"):o.classList.remove("d-none")})},!1)}function I(t){t.addEventListener("change",function(i){if(t.matches("[data-value-if]")){const e=t.getAttribute("data-redirect"),a=t.getAttribute("data-value-if");t.value==a&&(document.location.href=e)}else typeof t.value<"u"&&(document.location.href=t.value)},!1)}function B(t){const e=t.querySelector(".row").cloneNode(!0),a=t.querySelector("[data-add]");t.addEventListener("click",function(o){for(var r=o.target;r&&r!=this;r=r.parentNode){if(r.matches("[data-add]")){const s=e.cloneNode(!0);t.insertBefore(s,r),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(r.matches("[data-delete]")){r.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function N(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach((i,e)=>{D(i)}),Array.from(t.querySelectorAll("[data-redirect]")).forEach((i,e)=>{I(i)}),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach((i,e)=>{B(i)}),t.addEventListener("change",function(i){for(var e=i.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){const a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}},!1),t.addEventListener("change",function(i){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,a)=>{let o=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,a)=>{let o=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;o.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}function P(t){if(t.hasAttribute("data-type")&&t.getAttribute("data-type")=="toast"){let e=document.querySelector(".notification__holder");e||(e=document.createElement("div"),e.classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),g(t))},!1),t.hasAttribute("data-timeout")){let e=t.getAttribute("data-timeout");var i=new R(function(){g(t)},e);t.addEventListener("mouseenter",a=>{i.pause()}),t.addEventListener("mouseleave",a=>{i.resume()})}}function R(t,i){var e,a,o=i;this.pause=function(){window.clearTimeout(e),o-=new Date-a},this.resume=function(){a=new Date,window.clearTimeout(e),e=window.setTimeout(t,o)},this.resume()}const g=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class V extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,a=`@import "${i}/css/components/notification.css";`,o=`@import "${i}/css/components/notification.global.css";`,r=this.querySelectorAll("a,button");Array.from(r).forEach((n,l)=>{n.setAttribute("slot","btns"),n.classList.add("link")}),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const s=document.createElement("template");s.innerHTML=`
|