@iamproperty/components 7.1.0--beta2 → 7.1.0--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/notification.css +1 -1
- package/assets/css/components/notification.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +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/barchart/barchart.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/carousel/carousel.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/filter-card/filter-card.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/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.js +4 -3
- package/assets/js/components/multiselect/multiselect.component.min.js +4 -3
- package/assets/js/components/multiselect/multiselect.component.min.js.map +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.js +23 -14
- package/assets/js/components/notification/notification.component.min.js +7 -7
- package/assets/js/components/notification/notification.component.min.js.map +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/record-card/record-card.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/components/video-card/video-card.component.min.js +1 -1
- package/assets/js/components.bundle.js +1 -1
- package/assets/js/modules/notification.js +3 -1
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/sass/components/notification.scss +8 -0
- package/assets/ts/components/multiselect/multiselect.component.ts +4 -3
- package/assets/ts/components/notification/notification.component.ts +27 -18
- package/assets/ts/modules/notification.ts +5 -1
- package/dist/components.es.js +165 -167
- package/dist/components.umd.js +41 -41
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/const h=t=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:t})},p=(t,o,a)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:o}),a.forEach(r=>{t.addEventListener(r,function(e){const d={event:r,element:o,target:e.target};Object.keys(e.detail).forEach(i=>{const c=e.detail[i];d[i]=c}),window.dataLayer.push(d)})}),!0),g=`<div class="card__head" part="head">
|
|
5
5
|
<slot name="head"></slot>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 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(r){return r instanceof a?r:new a(function(n){n(r)})}return new(a||(a=Promise))(function(r,n){function v(c){try{u(o.next(c))}catch(i){n(i)}}function t(c){try{u(o.throw(c))}catch(i){n(i)}}function u(c){c.done?r(c.value):d(c.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 v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Slider"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",p=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,l=document.createElement("template");l.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/const U=function(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))},B=(i,e)=>String(i).padStart(e,"0"),Q=i=>i.charAt(0).toUpperCase()+i.slice(1),k=(i,e,r)=>e.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,c)=>o?o[c]:r,i);var X=function(i,e,r,o){function c(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function d(h){try{t(o.next(h))}catch(n){a(n)}}function l(h){try{t(o.throw(h))}catch(n){a(n)}}function t(h){h.done?s(h.value):c(h.value).then(d,l)}t((o=o.apply(i,e||[])).next())})};const j=i=>{const e=Array.from(i.querySelectorAll("thead th"));Array.from(i.querySelectorAll("tbody tr")).forEach((o,c)=>{const s=Array.from(o.querySelectorAll("th, td")),a=["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"];s.forEach((d,l)=>{const t=e[l];if(typeof t<"u"){const h=document.createElement("div");h.innerHTML=t.innerHTML;const n=h.textContent||h.innerText||"";d.setAttribute("data-label",n),t.hasAttribute("data-td-class")&&d.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(d.setAttribute("data-format",t.getAttribute("data-format")),d.innerHTML=_(t.getAttribute("data-format"),d.textContent.trim())),a.includes(d.textContent.trim().toLowerCase())&&d.setAttribute("data-content",d.textContent.trim().toLowerCase())}})})},Y=i=>{let e=0;return Array.from(i.querySelectorAll("tbody tr")).forEach((r,o)=>{const c=window.getComputedStyle(document.querySelector("html")),s=r.querySelector(":scope > *:last-child > *:first-child");if(s){s.classList.add("text-nowrap");let a=s.offsetWidth/parseFloat(c.fontSize);a+=1.7,e=e>a?e:a}}),e},J=(i,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||i.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(i.querySelectorAll("thead tr")).forEach((r,o)=>{i.querySelectorAll("thead tr th.expand-button-heading").length||r.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(i.querySelectorAll("tbody tr")).forEach((r,o)=>{const c=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 ${c}>Expand</button></td>`)})},G=i=>{i.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){const r=e.target.closest("[data-expand-button]"),o=r.closest("tr");r.toggleAttribute("aria-expanded"),o.getAttribute("data-view")=="full"?o.setAttribute("data-view","default"):o.setAttribute("data-view","full"),r.blur()}})},R=(i,e)=>{const r=e.querySelector("input[data-search]");if(!r)return!1;const o=r.getAttribute("id"),c=r.getAttribute("data-search").split(","),s=r.parentNode,a={};c.forEach((d,l)=>{Array.from(i.querySelectorAll('td[data-label="'+d.trim()+'"]')).forEach((t,h)=>{t.querySelector(".td__content")?a[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:a[t.textContent]=t.textContent})}),r.setAttribute("list",`${o}_list`),r.setAttribute("autocomplete","off"),s.querySelector("datalist")||(s.innerHTML+=`<datalist id="${o}_list"></datalist>`),s.querySelector("datalist").innerHTML=`${Object.keys(a).map(d=>`<option value="${d}"></option>`).join("")}`},V=(i,e,r,o,c)=>{let s;const a=function(t,h=!1){if(o.hasAttribute("data-no-submit")||e.classList.contains("processing"))return!1;if(Array.from(e.querySelectorAll("iam-applied-filters")).forEach((n,p)=>{const u=new Event("tags-set");n.dispatchEvent(u)}),t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((n,p)=>{const u=n.getAttribute("data-duplicate"),b=document.getElementById(u),w=document.querySelector(`[for="${u}"] iam-card`);if(b.checked!=n.checked)if(w){const A=new Event("click");w.dispatchEvent(A)}else b.checked=n.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!h){const n=e.querySelector("[data-pagination]");n.value=1,o.setAttribute("data-page",1)}z(i,e,r,o)}else e.hasAttribute("data-submit")?e.submit():(H(i,e,o),E(i,e));if(e.hasAttribute("data-ajax-post")){const n=new FormData(e),p=new URLSearchParams(n).toString(),u=new XMLHttpRequest;u.open("GET",`${window.location.href}?ajax=true&${p}`),u.send()}};e.querySelector("iam-actionbar[data-search]")&&e.querySelector("iam-actionbar[data-search]").addEventListener("search-submit",t=>{e.querySelector("input[data-search]")?e.querySelector("input[data-search]").value=t.detail.search:e.insertAdjacentHTML("beforeend",`<input type="hidden" name="search" data-search="${e.querySelector("iam-actionbar[data-search]").getAttribute("data-search")}" value="${t.detail.search}"/>`),clearTimeout(s),a(t)}),e.addEventListener("keyup",t=>{clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&(s=setTimeout(function(){a(t)},500))}),e.addEventListener("change",t=>{if(clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||N(i,e,c),a(t)),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&a(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(H(i,e,o),E(i,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"))&&a(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&a(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&a(t),t&&t.target instanceof HTMLElement&&t.target.hasAttribute("id")){const h=t.target.getAttribute("id");document.querySelector(`[data-duplicate="${h}"]`)&&(document.querySelector(`[data-duplicate="${h}"]`).checked=t.target.checked)}}),e.addEventListener("click",t=>{if(clearTimeout(s),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((n,p)=>{n.innerHTML=""});const h=e.elements;for(let n=0;n<h.length;n++)switch(h[n].type.toLowerCase()?h[n].type.toLowerCase():"text"){case"text":case"password":case"textarea":h[n].value="";break;case"radio":case"checkbox":if(h[n].checked){const u=h[n],b=u.getAttribute("id"),w=document.querySelector(`[for="${b}"`);if(w.querySelector("iam-card")){const A=w.querySelector("iam-card"),m=new Event("click");A.dispatchEvent(m)}u.checked=!1}break;case"select-one":case"select-multi":h[n].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||N(i,e,c),a(t)}}),e.addEventListener("submit",t=>{clearTimeout(s),e.hasAttribute("data-submit")||t.preventDefault(),a(t)}),e.addEventListener("force",t=>{a(t)}),e.addEventListener("paginate",t=>{a(t,!0)});const d=[],l=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,h)=>{const n=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${n}"]`)).forEach((p,u)=>{const b=p.closest("form");d.includes(b)||d.push(b),l.includes(n)||l.push(n)})}),d.forEach((t,h)=>{const n=function(){const p=[],u=new FormData(t);for(const[b,w]of u)document.querySelector(`[data-mimic="${b}"]`)&&!p.includes(b)?(p.push(b),document.querySelector(`[data-mimic="${b}"]`).value=w):document.querySelector(`[data-mimic="${b}"]`)&&(document.querySelector(`[data-mimic="${b}"]`).value+=","+w);for(const b of p){const w=new Event("force");e.dispatchEvent(w)}for(const b of l)if(!u.has(b)&&t.querySelector(`[name="${b}"]`)){document.querySelector(`[data-mimic="${b}"]`).value="";const w=new Event("force");e.dispatchEvent(w)}};t.addEventListener("force",p=>{n()}),t.addEventListener("change",p=>{n()})})},N=(i,e,r)=>{if(e.getAttribute("data-ajax"))return!1;const o=i.querySelector("tbody");let c=e.querySelector('input[type="radio"][data-sort]:checked');if(e.querySelector("select[data-sort]")){const n=e.querySelector("select[data-sort]");c=e.querySelector(`select[data-sort] option:nth-child(${n.selectedIndex+1})`)}const s=c.getAttribute("data-sort"),a=c.getAttribute("data-order"),d=c.getAttribute("data-format");if(!s)return o.innerHTML=r.innerHTML,j(i),!1;let l=[];["asc","desc","descending"].includes(a)||(l=a.split(","));let t=[];Array.from(o.querySelectorAll("tr")).forEach((n,p)=>{let u=n.querySelector('td[data-label="'+s+'"], th[data-label="'+s+'"]').textContent.trim();n.querySelector('[data-label="'+s+'"] .td__content')&&(u=n.querySelector('[data-label="'+s+'"] .td__content').textContent.trim()),l.length&&l.includes(u)&&(u=l.indexOf(u)),U(u)&&(u=B(u,10)),d&&d=="date"&&(u=new Date(u));const b={index:u,row:n};t.push(b)}),t.sort((n,p)=>n.index>p.index?1:-1),(a=="descending"||a=="desc")&&(t=t.reverse());let h="";t.forEach((n,p)=>{h+=n.row.outerHTML}),o.innerHTML=h},H=(i,e,r)=>{i.classList.remove("table--filtered");const o=P(e),c=[];let s=0;const a=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,d=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(i.querySelectorAll("tbody tr")).forEach((t,h)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("input[data-search]")){const t=e.querySelector("input[data-search]");e.querySelector("input[data-search]").getAttribute("data-search").split(",").forEach((n,p)=>{c.push({column:`${n.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,h)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let l=0;Object.values(o).forEach((t,h)=>{typeof t=="object"&&Object.values(t).length?l+=Object.values(t).length:l++}),l&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,h)=>{t.innerHTML+=`(${l})`,t.parentNode.classList.add("hover")}),i.classList.add("table--filtered");for(const[t,h]of Object.entries(o))Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).forEach((n,p)=>{let u=!1;h.forEach((b,w)=>{const A=n.querySelector(`[data-label="${t}"]`);if(b.includes("-date-from")){const m=new Date(b.replace("-date-from","")),f=new Date(A.textContent.toLowerCase());m.setHours(0,0,0,0),f.setHours(0,0,0,0),f<m?(n.classList.add("less-than-from-date"),u=!1):!n.classList.contains("less-than-from-date")&&!n.classList.contains("greater-than-to-date")&&(u=!0)}else if(b.includes("-date-to")){const m=new Date(b.replace("-date-to","")),f=new Date(A.textContent.toLowerCase());m.setHours(0,0,0,0),f.setHours(0,0,0,0),f>m?(n.classList.add("greater-than-to-date"),u=!1):!n.classList.contains("less-than-from-date")&&!n.classList.contains("greater-than-to-date")&&(u=!0)}if(b&&b=="$today")b=_("date",new Date);else if(b&&b=="$yesterday"){const m=new Date;m.setDate(m.getDate()-1),b=_("date",m)}else if(b&&(b=="$thisWeek"||b=="$lastWeek")){const m=new Date,f=new Date(m.setDate(m.getDate()-(m.getDay()-1))),v=new Date(m.setDate(m.getDate()-m.getDay()+7)),g=new Date(A.textContent.toLowerCase());if(m.setHours(0,0,0,0),f.setHours(0,0,0,0),v.setHours(0,0,0,0),g.setHours(0,0,0,0),b=="$thisWeek")u=g>=f&&g<=v;else{const L=new Date(f.setDate(f.getDate()-7)),y=new Date(v.setDate(v.getDate()-7));L.setHours(0,0,0,0),y.setHours(0,0,0,0),u=g>=L&&g<=y}}else if(b&&b=="$thisMonth"){const m=new Date,f=m.getFullYear(),v=m.getMonth(),g=new Date(f,v,1),L=new Date(f,v+1,0),y=new Date(A.textContent.toLowerCase());g.setHours(0,0,0,0),L.setHours(0,0,0,0),y.setHours(0,0,0,0),u=y>=g&&y<=L}else if(b&&b=="$lastMonth"){const m=new Date,f=m.getFullYear(),v=m.getMonth(),g=new Date(f,v-1,1),L=new Date(f,v,0),y=new Date(A.textContent.toLowerCase());g.setHours(0,0,0,0),L.setHours(0,0,0,0),y.setHours(0,0,0,0),u=y>=g&&y<=L}A&&A.textContent.toLowerCase().includes(b.replace("-"," ").toLowerCase())&&(u=!0)}),u||(n.classList.add("filtered"),n.setAttribute("data-filtered-by",t))});Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,h)=>{let n=!(c.length>0&&c[0].value.length>=3);c.forEach((p,u)=>{const b=t.querySelector(`[data-label="${p.column}"]`);b&&p.value.length>=3&&b.textContent.toLowerCase().includes(p.value.toLowerCase())&&(n=!0)}),n||t.classList.add("filtered")}),Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,h)=>{s++,t.classList.add("filtered--matched"),Math.ceil(s/d)==parseInt(a)&&t.classList.add("filtered--show")}),r&&(r.setAttribute("data-total",s),r.setAttribute("data-show",d),r.setAttribute("data-page",a))},E=(i,e,r)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((c,s)=>{const a=c.getAttribute("data-query");let d=0;if(a=="total")r.hasAttribute("data-total")?d=r.getAttribute("data-total"):d=(i.classList.contains("table--filtered"),i.querySelectorAll("tbody tr").length);else if(!a.includes(" == ")&&a.includes(" & ")){const l=a.split(" & ");let t="";l.forEach(h=>{t+=`:not([data-filtered-by="${h}"])`}),d=Array.from(i.querySelectorAll(`tbody tr${t}`)).length}else if(!a.includes(" == "))d=Array.from(i.querySelectorAll(`tbody tr:not([data-filtered-by="${a}"])`)).length;else if(a.includes(" && ")){const l=a.split(" && ");d=Array.from(i.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let h=!0;for(const[n,p]of Object.entries(l)){const u=p.split(" == ");(!t.querySelector(`td[data-label="${u[0]}"]`)||t.querySelector(`td[data-label="${u[0]}"]`).textContent!=`${u[1]}`)&&(h=!1)}return h}).length}else{const l=a.split(" == ");d=Array.from(i.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}c.hasAttribute("data-total")?c.setAttribute("data-total",d):c.innerHTML=d})},K=function(i,e,r,o){if(o.hasAttribute("data-no-submit"))return!1;r.addEventListener("update-page",c=>{const s=e.querySelector("[data-pagination]"),a=c.detail.page;if(s.value=a,e.dispatchEvent(new Event("paginate")),o.setAttribute("data-page",a),i.hasAttribute("data-show-history")){const d=new URL(location);d.searchParams.set("page",a),history.pushState({type:"pagination",form:e.getAttribute("id"),page:a},"",d)}if(!o.hasAttribute("data-no-scroll")){const l=i.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:l,behavior:"smooth"})}}),r.addEventListener("update-show",c=>{const s=e.querySelector("[data-show]"),a=c.detail.show;s.value=a,o.setAttribute("data-show",a),e.dispatchEvent(new Event("submit"))})},Z=(i,e)=>{if(!i)return!1;i.addEventListener("click",r=>{tt(e)})},tt=function(i){let e=[];const r=i.getElementsByTagName("tr");for(let a=0;a<r.length;a++){const d=r[a].querySelectorAll("td,th"),l=[];for(let t=0;t<d.length;t++)l.push(`"${d[t].textContent}"`);e.push(l.join(","))}e=e.join(`
|
|
5
5
|
`);const o=new Blob([e],{type:"text/csv"}),c=document.createElement("a");c.download="export.csv";const s=window.URL.createObjectURL(o);c.href=s,c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c)},O=function(i,e,r,o){if(j(i),J(i,o),E(i,e,o),o&&o.classList.contains("table--cta")){let s=function(){Array.from(i.querySelectorAll("tr")).forEach((a,d)=>{const l=a.offsetHeight;a.style.setProperty("--row-height",`${l}px`)})};const c=Y(i);o.style.setProperty("--cta-width",`${c}rem`),new ResizeObserver(s).observe(i)}},P=function(i){const e=new Object;return Array.from(i.querySelectorAll("[data-filter]")).forEach((o,c)=>{if(!(o.type=="radio"&&!o.checked)&&!(o.type=="checkbox"&&!o.checked)&&o&&o.value){const s=o.getAttribute("data-filter");let a=o.value;o.hasAttribute("data-date-from")&&(a+="-date-from"),o.hasAttribute("data-date-to")&&(a+="-date-to"),e[s]||(e[s]=[]),e[s].push(a)}}),e},z=function(i,e,r,o){return X(this,void 0,void 0,function*(){const c=new FormData(e),s=new URLSearchParams(c).toString(),a=i.querySelectorAll("thead tr th:not(.expand-button-heading)"),d=i.querySelector("tbody"),l=e.getAttribute("data-ajax");o.classList.add("table--loading");const t=P(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML="",p.parentNode.classList.remove("hover")});let h=0;Object.values(t).forEach((p,u)=>{typeof p=="object"&&Object.values(p).length?h+=Object.values(p).length:h++}),h&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML+=`(${h})`,p.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[l]&&window.controller[l].abort(),window.controller[l]=new AbortController;const{signal:n}=controller[l];r.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(l+"?"+s,{signal:n,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(p=>p.json()).then(p=>{const u=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",b=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",w=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",A=k(p,b,15),m=k(p,w,1),f=k(p,u),v=o.hasAttribute("data-empty-msg")?o.getAttribute("data-empty-msg"):"No results found";f?(d.innerHTML="",f.forEach((g,L)=>{const y=document.createElement("tr");a.forEach((x,at)=>{let S="";const T=document.createElement("td");if(T.setAttribute("data-label",x.innerText),x.getAttribute("data-output")){var D=x.getAttribute("data-output");S=D.replace(new RegExp(/{(.*?)}/,"gm"),function(C){return k(g,C.replace("{","").replace("}",""))})}if(x.hasAttribute("data-output-array")){var D=x.getAttribute("data-output");const I=k(g,D.replace("{","").replace("}",""));S="",I.forEach((M,ot)=>{const F=x.getAttribute("data-output-array");let q="";if(x.hasAttribute("data-output-array-property")&&x.hasAttribute("data-output-array-transform")){const $=k(M,x.getAttribute("data-output-array-property")),W=JSON.parse(x.getAttribute("data-output-array-transform"))[$];q=F.replace(`{${x.getAttribute("data-output-array-property")}}`,W)}q=q.replace(new RegExp(/{(.*?)}/,"gm"),function($){return k(M,$.replace("{","").replace("}",""))}),S+=q})}x.hasAttribute("data-transform")&&(S=JSON.parse(x.getAttribute("data-transform"))[S],!S&&x.hasAttribute("data-default")&&(S=x.getAttribute("data-default"))),T.innerHTML=S,y.appendChild(T)}),d.appendChild(y)}),R(i,e),o.setAttribute("data-total",parseInt(A)),o.setAttribute("data-page",parseInt(m)),O(i,e,r,o),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((g,L)=>{const y=k(p,g.getAttribute("data-ajax-query"),"");g.hasAttribute("data-total")?g.setAttribute("data-total",y):g.innerHTML=y}),parseInt(A)==0&&(d.innerHTML=`<tr><td colspan="100%"><span>${v}</span></td></tr>`),o.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:l,formData:s})):d.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',r.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(p){console.log(p)}})},_=(i,e)=>{switch(i){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",{day:"numeric",month:"long",year:"2-digit"});case"capitalise":return e=Q(e)}};class et 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`,o=document.createElement("template");o.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/const f=(t,l,o,r)=>{const n=Math.tan(.375*Math.PI),c=window.innerWidth||document.body.clientWidth,s=Math.max(1,Math.floor(.01*c)),e=o-t,a=r-l,i=Math.abs(e/a),d=Math.abs(a/e);if(Math.abs(e)>s||Math.abs(a)>s){if(d<=n)return e<0?"left":"right";if(i<=n)return a<0?"top":"bottom"}else return"tap"},k=function(t){t.querySelectorAll(":scope > details");const l=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let o=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(o=t.shadowRoot.querySelector(".tabs__links")),!o){o=document.createElement("div"),o.classList.add("tabs__links");const n=document.createElement("div");n.classList.add("tabs__links__wrapper"),n.prepend(o),t.prepend(n)}let r=0;l.forEach((n,c)=>{let s=document.createElement("button");if(n.matches("details")){const e=n.querySelector(":scope > summary"),a=e.classList.contains("disabled");e.classList.add("visually-hidden"),n.hasAttribute("id")&&s.setAttribute("data-id",`${n.getAttribute("id")}`),n.hasAttribute("open")&&s.setAttribute("aria-pressed",!0),s.innerHTML=`${e.innerText}`,s.classList.add("link"),s.setAttribute("data-index",r),n.setAttribute("tabindex","-1"),a&&s.classList.add("disabled"),r++}else n.matches("a")&&(s=n);s.classList.add("link"),o.appendChild(s)})},g=function(t){const l=t.querySelectorAll(":scope > details"),o=t.querySelectorAll(":scope > details > summary");let r=t.querySelector(":scope .tabs__links"),n=t.querySelectorAll(":scope .tabs__links > button"),c=t.querySelector(":scope .tabs__next");var s;if(window.isClicked=!1,window.isScrolling=!1,t.shadowRoot&&(n=t.shadowRoot.querySelectorAll(".tabs__links > button"),r=t.shadowRoot.querySelector(".tabs__links"),c=t.shadowRoot.querySelector(":scope .tabs__next")),n.forEach(e=>{e.addEventListener("click",a=>{if(a.preventDefault(),!window.isScrolling){if(window.triggered||(window.isClicked=!0),e.classList.contains("disabled"))return!1;n.forEach(i=>{const d=i==e;i.setAttribute("aria-pressed",d)}),r.scroll({top:0,left:e.offsetLeft,behavior:"smooth"}),l.forEach((i,d)=>{const u=e.getAttribute("data-index")==d;u?i.setAttribute("open",u):i.removeAttribute("open")}),e.matches(":last-child")?c.setAttribute("disabled","disabled"):c.removeAttribute("disabled"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})}})}),r.addEventListener("scroll",e=>{window.isScrolling||(clearTimeout(s),window.isScrolling=!0)}),r.addEventListener("scrollend",e=>{window.isScrolling=!1,clearTimeout(s),s=setTimeout(function(){if(window.isClicked)return window.isClicked=!1,!1;let a=n[0],i=Math.abs(a.getBoundingClientRect().left);n.forEach(d=>{Math.abs(d.getBoundingClientRect().left)<i&&(i=Math.abs(d.getBoundingClientRect().left),a=d)}),window.triggered=!0,a.focus(),a.click(),window.triggered=!1},200)}),o.forEach((e,a)=>{e.addEventListener("click",i=>{i.preventDefault(),n[a].click()})}),c.addEventListener("click",e=>{e.preventDefault();const i=r.querySelector('[aria-pressed="true"]').nextSibling;i&&i.click()}),t.classList.contains("tabs--guided")){let e=0,a=0,i=0,d=0;l.forEach(u=>{u.addEventListener("touchstart",p=>{p.stopPropagation(),e=p.changedTouches[0].screenX,a=p.changedTouches[0].screenY}),u.addEventListener("touchend",p=>{p.stopPropagation(),i=p.changedTouches[0].screenX,d=p.changedTouches[0].screenY;const m=f(e,a,i,d),b=r.querySelector('[aria-pressed="true"]'),_=b.nextSibling,h=b.previousSibling;switch(m){case"left":_&&_.click();break;case"right":h&&h.click();break}})})}},w=function(t){if(!t.querySelector(":scope > details"))return!1;const l=t.querySelectorAll(":scope > details"),o=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]")||(l[0].setAttribute("open",!0),o[0].setAttribute("aria-pressed",!0))},y=function(t){k(t),g(t),w(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const l=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"):`${l}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/const u=i=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:i})},p=(i,t,e)=>(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementAdded",element:t}),e.forEach(r=>{i.addEventListener(r,function(o){const a={event:r,element:t,target:o.target};Object.keys(o.detail).forEach(d=>{const n=o.detail[d];a[d]=n}),window.dataLayer.push(a)})}),!0),h=`<div class="card__head" part="head">
|
|
5
5
|
<slot name="head"></slot>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/(function(t){typeof define=="function"&&define.amd?define(t):t()})(function(){"use strict";var t=["accordion","header","table","tabs","card","filter-card","video-card","record-card","filterlist","applied-filters","pagination","notification","actionbar","nav","collapsible-side","address-lookup","fileupload","search","inline-edit","multiselect","multi-step","slider","carousel","marketing","barchart"],a="iam",i={rootMargin:"50px",threshold:.1},r=".component.min.js";t.forEach(e=>{if(document.getElementsByTagName("".concat(a,"-").concat(e)).length!==0){var s=l=>{l.forEach(o=>{o.intersectionRatio>0&&(console.log(e),import("./components/".concat(e,"/").concat(e).concat(r)).then(c=>{window.customElements.get("".concat(a,"-").concat(e))||window.customElements.define("".concat(a,"-").concat(e),c.default)}).catch(c=>{console.log(c.message)}),n.unobserve(o.target))})},n=new IntersectionObserver(s,i);n.observe(document.getElementsByTagName("".concat(a,"-").concat(e))[0])}})});
|
|
5
5
|
//# sourceMappingURL=components.bundle.js.map
|
|
@@ -15,7 +15,9 @@ function setupNotification(element) {
|
|
|
15
15
|
element.setAttribute('role', 'alert');
|
|
16
16
|
// Create a dissmissable button
|
|
17
17
|
element.addEventListener('click', function (e) {
|
|
18
|
-
if (event &&
|
|
18
|
+
if (event &&
|
|
19
|
+
event.target instanceof HTMLElement &&
|
|
20
|
+
(event.target.closest('[data-dismiss-button]') || event.target.matches('[data-dismiss-button]'))) {
|
|
19
21
|
e.preventDefault();
|
|
20
22
|
closeNotification(element);
|
|
21
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/(function(h){typeof define=="function"&&define.amd?define(h):h()})(function(){"use strict";var h=r=>(r.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&r.classList.add("ie"),null),T=r=>{var e=function(t){var o=document.querySelector('label[for="'.concat(t.replace("#",""),'"]')),c=document.querySelector(t+" summary"),s=document.querySelector("dialog".concat(t)),n=document.querySelector("detail".concat(t));o instanceof HTMLElement?o.click():c instanceof HTMLElement?c.click():s instanceof HTMLElement?s.showModal():n instanceof HTMLElement&&n.addAttribute("open")};return location.hash&&e(location.hash),window.addEventListener("hashchange",function(){e(location.hash)},!1),addEventListener("popstate",a=>{if(a&&a.state&&a.state.type&&a.state.type=="pagination"){var t=document.querySelector("#".concat(a.state.form)),o=document.querySelector("#".concat(a.state.form," [data-pagination]"));o?o.value=a.state.page:t.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(a.state.page,'" />'),t.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",a=>{if(a&&a.target instanceof HTMLElement&&a.target.matches("form")){var t=a.target;Array.from(t.querySelectorAll("[data-password-type]")).forEach((o,c)=>{o.setAttribute("type","password")}),(t.querySelector(":invalid")||t.querySelector('.pwd-checker[data-strength="1"]')||t.querySelector('.pwd-checker[data-strength="2"]'))&&(t.classList.add("was-validated"),a.preventDefault()),t.querySelector("iam-multiselect[data-is-required][data-error]")&&(t.classList.add("was-validated"),a.preventDefault())}}),document.addEventListener("keydown",a=>{a.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(a.preventDefault(),a.stopPropagation())}),Array.from(document.querySelectorAll("label progress")).forEach((a,t)=>{var o=a.closest("label");o.setAttribute("data-percent",a.getAttribute("value"))}),null},C=r=>(Array.from(r.querySelectorAll("dialog[open]")).forEach((e,a)=>{var t=e.closest(".dialog__wrapper");t||(e.removeAttribute("open"),e.showModal(),e.focus(),v(e))}),r.addEventListener("click",e=>{if(e.target.tagName=="IAM-ACTIONBAR")return!1;if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-modal]")){var a=e.target.closest("[data-modal]"),t=a.hasAttribute("data-modal")?a.getAttribute("data-modal"):a.getAttribute("data-filter"),o=document.querySelector("dialog#".concat(t));if(v(o),o.showModal(),o.focus(),!o.querySelector("iam-multi-step")){var c=o.offsetWidth;o.setAttribute("style","max-width: ".concat(c,"px;"))}Array.from(o.querySelectorAll("[data-duplicate]")).forEach((u,p)=>{var W=u.getAttribute("data-duplicate"),M=document.getElementById(W);if(u.checked!=M.checked){u.checked=M.checked;var J=new Event("change");u.dispatchEvent(J)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:t})}if(e&&e.target instanceof HTMLElement&&e.target.closest("button.dialog__close")){var s=e.target.closest("dialog[open]");e.preventDefault(),s.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,p)=>{u.classList.remove("active")});var n=new CustomEvent("dialog-closed",{bubbles:!0,cancelable:!0,detail:{modalId:s.id}});e.target.dispatchEvent(n),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")})}if(e&&e.target instanceof HTMLElement&&e.target.closest('button[formmethod="dialog"]')){var i=e.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,p)=>{u.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(e&&e.target instanceof HTMLElement&&e.target.closest("dialog[open]")){var l=e.target.closest("dialog[open]"),y=window.getComputedStyle(l);if(y.display==="contents"&&(l=l.parentNode.closest("dialog[open]")),!l.classList.contains("dialog--transactional")&&!l.classList.contains("dialog--acknowledgement")){var g=l.getBoundingClientRect();(e.clientX<g.left||e.clientX>g.right||e.clientY<g.top||e.clientY>g.bottom)&&(e.target.closest("dialog *")||l.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:l.getAttribute("id")}))}}if(e&&e.target instanceof HTMLElement&&e.target.closest(".dialog__wrapper > button")){e.stopPropagation();var f=e.target.closest(".dialog__wrapper > button"),V=f.parentNode,E="openPopover",d=V.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=d&&f.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,p)=>{u.removeAttribute("aria-expanded")}),d.hasAttribute("open"))d.close(),E="closePopover",d.removeAttribute("style"),f.removeAttribute("aria-expanded");else{d.show(),f.setAttribute("aria-expanded",!0);var L=f.getBoundingClientRect(),q=L.top,x=L.left;if(f.closest("iam-table")){var k=f.closest("iam-table").parentNode.getBoundingClientRect();q-=k.top,x-=k.left}d.classList.contains("dialog--fix")&&d.setAttribute("style","position:fixed;top: ".concat(q,"px; left: ").concat(x,"px; margin: 3rem 0 0 0;"))}var w=d.getBoundingClientRect(),O=w.bottom-window.scrollY,Y=window.innerHeight-window.scrollY;if(O>Y){var R=d.hasAttribute("style")?d.getAttribute("style")+" ":"";d.setAttribute("style",R+"transform: translate(0, calc(-100% - 4rem))"),w=d.getBoundingClientRect();var F=w.top-window.scrollY;F<100&&d.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:E,id:f.textContent})}e&&e.target instanceof HTMLElement&&!e.target.closest("dialog[open]")&&!e.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((u,p)=>{u.removeAttribute("aria-expanded")}))}),null),v=r=>{if(!r.querySelector(":scope .mh-lg")&&!r.querySelector("iam-multi-step")){r.innerHTML='<div class="mh-lg">'.concat(r.innerHTML,"</div>");var e=r.querySelector(".mh-lg"),a=r.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var t=a.previousSibling;e.before(a),t&&a.before(t)}}r.querySelector(":scope > button:first-child")||r.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')};function H(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",r=>{var e=r.target.closest("[open] summary");if(e)window.dataLayer.push({event:"closeDetails",detailsTitle:e.textContent||""});else{var a=r.target.closest("summary"),t=r.target.closest("a"),o=r.target.closest("button");a&&window.dataLayer.push({event:"openDetails",detailsTitle:a.textContent||""}),t&&window.dataLayer.push({event:"linkClicked",linkText:t.hasAttribute("title")?t.getAttribute("title")||"":t.textContent||"",class:t.hasAttribute("class")&&t.getAttribute("class")||"",href:t.getAttribute("href")||""}),o&&window.dataLayer.push({event:"buttonClicked",buttonText:o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||""})}})}function D(r){var e=new TextEncoder("utf-8").encode(r);return crypto.subtle.digest("SHA-1",e).then(function(a){for(var t=[],o=new DataView(a),c=0;c<o.byteLength;c+=4){var s=o.getUint32(c),n=s.toString(16),i="00000000",l=(i+n).slice(-i.length);t.push(l)}return t.join("")})}var _=(r,e)=>{D(r).then(function(a){var t=new XMLHttpRequest;t.addEventListener("load",function(){var o=this.responseText.split(`
|
|
5
5
|
`),c=a.slice(5).toUpperCase(),s=!1;for(var n in o)if(o[n].substring(0,35)==c){s=!0;break}var i=new CustomEvent("hibpCheck",{detail:s});e.dispatchEvent(i)}),t.open("GET","https://api.pwnedpasswords.com/range/"+a.substr(0,5)),t.send()})},B=r=>{function e(){if(Array.from(document.querySelectorAll("input[maxlength],textarea[maxlength]")).forEach((t,o)=>{t.parentElement,I(t)}),Array.from(document.querySelectorAll("label input")).forEach((t,o)=>{!t.closest("label").querySelector(".optional-text")&&!t.hasAttribute("required")&&(t.parentNode.tagName.toLowerCase()=="span"?t.parentElement.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'):t.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'))}),document.querySelector('input[type="date"]')){let t=function(o){var c=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),n=String(o.getDate()).padStart(2,"0");return"".concat(c,"-").concat(s,"-").concat(n)};var a=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((o,c)=>{var s=a;if(o.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(o.getAttribute("data-start"))),o.setAttribute("min",t(s))),o.hasAttribute("data-period")){var n=parseInt(o.getAttribute("data-period")),i=new Date;i.setDate(s.getDate()+n),o.setAttribute("max",t(i))}if(o.hasAttribute("data-allowed-days")){var l=JSON.parse("[".concat(o.getAttribute("data-allowed-days"),"]"));o.addEventListener("input",function(y){var g=new Date(this.value).getUTCDay();l.includes(g)?o.setCustomValidity(""):o.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&e(),document.onreadystatechange=()=>{document.readyState==="complete"&&e()},r.addEventListener("input",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("input,textarea,select")){var t=a.target.closest("input,textarea,select");t.parentElement,t.hasAttribute("type")&&t.getAttribute("type")=="color"&&(t.nextElementSibling.value=t.value),t.hasAttribute("maxlength")&&t.nextElementSibling&&t.nextElementSibling.setAttribute("data-count",t.value.length),t.hasAttribute("data-strength-checker")&&b(t)}}),r.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("select")){var t=a.target.closest("select");if(t.hasAttribute("data-change-type")&&t.hasAttribute("data-input")){var o=document.getElementById(t.getAttribute("data-input")),c=t.value;S(o,c)}}if(a&&a.target instanceof HTMLElement&&a.target.closest('dialog [type="radio"]')){var s=a.target.closest("dialog");a.target.closest('dialog [type="radio"]'),Array.from(s.querySelectorAll('[type="radio"][autofocus]')).forEach((n,i)=>{n.removeAttribute("autofocus")}),Array.from(s.querySelectorAll('[type="radio"]:checked')).forEach((n,i)=>{n.setAttribute("autofocus",!0)})}}),r.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-change-type][data-input]:not(select)")){var t=a.target.closest("[data-change-type]"),o=document.getElementById(t.getAttribute("data-input")),c=t.getAttribute("data-change-type");if(t.setAttribute("data-change-type",o.getAttribute("type")),S(o,c),t.hasAttribute("data-alt-class")){var s=t.getAttribute("data-alt-class");t.setAttribute("data-alt-class",t.getAttribute("class")),t.setAttribute("class",s)}}})},I=r=>{var e=r.parentElement,a=r.getAttribute("maxlength");e.style.setProperty("--maxlength",a);var t=r.nextElementSibling;(!t||t&&t.classList.contains("invalid-feedback"))&&(t=document.createElement("span"),e.insertBefore(t,r.nextSibling)),t.setAttribute("data-count",r.value.length)},S=(r,e)=>{r.hasAttribute("type")&&r.getAttribute("type")=="password"&&r.setAttribute("data-password-type",!0),r.setAttribute("type",e)},b=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"no",t=document.getElementById(e.getAttribute("data-strength-checker")),o=e.value,c=e.hasAttribute("minlength")?e.getAttribute("minlength"):12,s=1,n=["Very weak","Weak","Average","Strong","Very strong"],i="";if(o.match(/(?=.*[0-9])/)&&(s+=1),o.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(s+=1),o.match(/(?=.*[a-z])/)&&(s+=1),o.match(/(?=.*[A-Z])/)&&(s+=1),o.length<c&&(s=1,i="(must be at least ".concat(c," characters.)")),s>=3&&a=="no"){let l=function(y,g){y.detail?b(g,"danger"):b(g,"success"),g.removeEventListener("hibpCheck",l)};_(o,e),e.addEventListener("hibpCheck",function(y){l(y,e)})}else s>=3&&a=="danger"&&(s=3,i="(this password is very common)");t&&(s<=3?t.classList.add("invalid-feedback"):t.classList.remove("invalid-feedback"),t.setAttribute("data-strength",s),t.innerHTML="Password strength: ".concat(n[s-1]," ").concat(i))},N=()=>{document.addEventListener("change",r=>{r&&r.target instanceof HTMLElement&&r.target.closest("[data-change-events]")&&A(r.target,r.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("keyup",r=>{r&&r.target instanceof HTMLElement&&r.target.closest("[data-change-events]")&&A(r.target,r.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("click",r=>{r&&r.target instanceof HTMLElement&&r.target.closest("[data-click-events]")&&A(r.target,r.target.closest("[data-click-events]").getAttribute("data-click-events"))})},A=(r,e)=>{if(e||(e=r.parentNode.getAttribute("data-change-events")),!e)return!1;Array.from(JSON.parse(e)).forEach((a,t)=>{P(r,a)})},P=(r,e)=>{if("matches"in e)return e.matches=="any"||r.value==e.matches?m(r,e,"if"):m(r,e,"else"),!1;if("in-list"in e){var a=document.querySelector("".concat(e["in-list"],' option[value="').concat(r.value,'"]'));return document.querySelector("".concat(e["in-list"],' option[value="').concat(r.value,'"]'))?m(a,e,"if"):m(a,e,"else"),!1}else"event"in e&&m(r,e,"event")},m=(r,e,a)=>{if(!(a in e))return!1;switch(e[a]){case"hide":if(document.querySelector(e.target)){var t=document.querySelector(e.target);t.classList.add("js-hide"),Array.from(t.querySelectorAll("[data-required]")).forEach((n,i)=>{n.removeAttribute("required")})}break;case"show":if(document.querySelector(e.target)){var o=document.querySelector(e.target);o.classList.remove("js-hide"),Array.from(o.querySelectorAll("[data-required]")).forEach((n,i)=>{n.closest(".js-hide")||n.setAttribute("required","true")})}break;case"populate-form":j(r,e);break;case"dispatchEvent":var c=new Event(e.value);document.querySelector("".concat(e.target)).dispatchEvent(c);break;case"setAttribute":Array.from(document.querySelectorAll("".concat(e.target))).forEach(function(n,i){n.setAttribute(e.attribute,e.value)});break;case"focus":document.querySelector("".concat(e.target)).focus();break;case"removeAttribute":Array.from(document.querySelectorAll("".concat(e.target))).forEach(function(n,i){n.removeAttribute(e.attribute)});break;case"updateValue":document.querySelector("".concat(e.target)).value=e.value?e.value:"";var s=new Event("change");document.querySelector("".concat(e.target)).dispatchEvent(s);break;case"submitForm":document.querySelector("".concat(e.target)).submit();break;case"openLink":document.querySelector("".concat(e.target)).value&&(window.location.href=document.querySelector("".concat(e.target)).value);break}},j=function(e,a){var t=JSON.parse(e.getAttribute("data-values")),o=document.querySelector(a.target);if(!t)return!1;Object.keys(t).forEach((c,s)=>{document.getElementById(c)&&document.getElementById(c).tagName=="SPAN"&&(document.getElementById(c).innerHTML=t[c]),o.querySelector('select[name="'.concat(c,'"] [value="').concat(t[c],'"]'))?(o.querySelector('select[name="'.concat(c,'"]')).value=t[c],e.hasAttribute("data-lock-fields")&&(o.querySelector('select[name="'.concat(c,'"]')).disabled=!0)):o.querySelector('input[name="'.concat(c,'"][type="radio"][value="').concat(t[c],'"]'))?(Array.from(o.querySelectorAll('input[name="'.concat(c,'"][type="radio"]'))).forEach(function(n,i){n.disabled=!0}),o.querySelector('input[name="'.concat(c,'"][type="radio"][value="').concat(t[c],'"]')).checked=!0,o.querySelector('input[name="'.concat(c,'"][type="radio"][value="').concat(t[c],'"]')).disabled=!1):o.querySelector('input[name="'.concat(c,'"]'))&&(o.querySelector('input[name="'.concat(c,'"]')).value=t[c],e.hasAttribute("data-lock-fields")&&o.querySelector('input[name="'.concat(c,'"]')).setAttribute("readonly","true"))})};document.addEventListener("DOMContentLoaded",function(){H(),N(),h(document.body),T(),C(document.body),B(document.body)})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.1.0--
|
|
2
|
+
* iamKey v7.1.0--beta4
|
|
3
3
|
* Copyright 2022-2025 iamproperty
|
|
4
4
|
*/
|
|
5
5
|
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e=e=>{if(!e.querySelector(":scope .mh-lg")&&!e.querySelector("iam-multi-step")){e.innerHTML='<div class="mh-lg">'.concat(e.innerHTML,"</div>");var t=e.querySelector(".mh-lg"),a=e.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var r=a.previousSibling;t.before(a),r&&a.before(r)}}e.querySelector(":scope > button:first-child")||e.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},t=(e,t)=>{(function(e){var t=new TextEncoder("utf-8").encode(e);return crypto.subtle.digest("SHA-1",t).then((function(e){for(var t=[],a=new DataView(e),r=0;r<a.byteLength;r+=4){var n=("00000000"+a.getUint32(r).toString(16)).slice(-8);t.push(n)}return t.join("")}))})(e).then((function(e){var a=new XMLHttpRequest;a.addEventListener("load",(function(){var a=this.responseText.split("\n"),r=e.slice(5).toUpperCase(),n=!1;for(var o in a)if(a[o].substring(0,35)==r){n=!0;break}var c=new CustomEvent("hibpCheck",{detail:n});t.dispatchEvent(c)})),a.open("GET","https://api.pwnedpasswords.com/range/"+e.substr(0,5)),a.send()}))},a=e=>{function t(){if(Array.from(document.querySelectorAll("input[maxlength],textarea[maxlength]")).forEach(((e,t)=>{e.parentElement,r(e)})),Array.from(document.querySelectorAll("label input")).forEach(((e,t)=>{!e.closest("label").querySelector(".optional-text")&&!e.hasAttribute("required")&&("span"==e.parentNode.tagName.toLowerCase()?e.parentElement.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'):e.insertAdjacentHTML("beforebegin",'<span class="optional-text"></span>'))})),document.querySelector('input[type="date"]')){let t=function(e){var t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)};var e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach(((a,r)=>{var n=e;if(a.hasAttribute("data-start")&&(n.setDate(n.getDate()+parseInt(a.getAttribute("data-start"))),a.setAttribute("min",t(n))),a.hasAttribute("data-period")){var o=parseInt(a.getAttribute("data-period")),c=new Date;c.setDate(n.getDate()+o),a.setAttribute("max",t(c))}if(a.hasAttribute("data-allowed-days")){var i=JSON.parse("[".concat(a.getAttribute("data-allowed-days"),"]"));a.addEventListener("input",(function(e){var t=new Date(this.value).getUTCDay();i.includes(t)?a.setCustomValidity(""):a.setCustomValidity("That day of the week is not allowed")}))}}))}}"complete"===document.readyState&&t(),document.onreadystatechange=()=>{"complete"===document.readyState&&t()},e.addEventListener("input",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){var t=e.target.closest("input,textarea,select");t.parentElement,t.hasAttribute("type")&&"color"==t.getAttribute("type")&&(t.nextElementSibling.value=t.value),t.hasAttribute("maxlength")&&t.nextElementSibling&&t.nextElementSibling.setAttribute("data-count",t.value.length),t.hasAttribute("data-strength-checker")&&o(t)}})),e.addEventListener("change",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){var t=e.target.closest("select");if(t.hasAttribute("data-change-type")&&t.hasAttribute("data-input")){var a=document.getElementById(t.getAttribute("data-input")),r=t.value;n(a,r)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){var o=e.target.closest("dialog");e.target.closest('dialog [type="radio"]'),Array.from(o.querySelectorAll('[type="radio"][autofocus]')).forEach(((e,t)=>{e.removeAttribute("autofocus")})),Array.from(o.querySelectorAll('[type="radio"]:checked')).forEach(((e,t)=>{e.setAttribute("autofocus",!0)}))}})),e.addEventListener("click",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){var t=e.target.closest("[data-change-type]"),a=document.getElementById(t.getAttribute("data-input")),r=t.getAttribute("data-change-type");if(t.setAttribute("data-change-type",a.getAttribute("type")),n(a,r),t.hasAttribute("data-alt-class")){var o=t.getAttribute("data-alt-class");t.setAttribute("data-alt-class",t.getAttribute("class")),t.setAttribute("class",o)}}}))},r=e=>{var t=e.parentElement,a=e.getAttribute("maxlength");t.style.setProperty("--maxlength",a);var r=e.nextElementSibling;(!r||r&&r.classList.contains("invalid-feedback"))&&(r=document.createElement("span"),t.insertBefore(r,e.nextSibling)),r.setAttribute("data-count",e.value.length)},n=(e,t)=>{e.hasAttribute("type")&&"password"==e.getAttribute("type")&&e.setAttribute("data-password-type",!0),e.setAttribute("type",t)},o=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"no",r=document.getElementById(e.getAttribute("data-strength-checker")),n=e.value,c=e.hasAttribute("minlength")?e.getAttribute("minlength"):12,i=1,l="";if(n.match(/(?=.*[0-9])/)&&(i+=1),n.match(/(?=.*[!,%,&,#,$,^,*,?,_,~,<,>,])/)&&(i+=1),n.match(/(?=.*[a-z])/)&&(i+=1),n.match(/(?=.*[A-Z])/)&&(i+=1),n.length<c&&(i=1,l="(must be at least ".concat(c," characters.)")),i>=3&&"no"==a){let a=function(e,t){e.detail?o(t,"danger"):o(t,"success"),t.removeEventListener("hibpCheck",a)};t(n,e),e.addEventListener("hibpCheck",(function(t){a(t,e)}))}else i>=3&&"danger"==a&&(i=3,l="(this password is very common)");r&&(i<=3?r.classList.add("invalid-feedback"):r.classList.remove("invalid-feedback"),r.setAttribute("data-strength",i),r.innerHTML="Password strength: ".concat(["Very weak","Weak","Average","Strong","Very strong"][i-1]," ").concat(l))},c=(e,t)=>{if(t||(t=e.parentNode.getAttribute("data-change-events")),!t)return!1;Array.from(JSON.parse(t)).forEach(((t,a)=>{i(e,t)}))},i=(e,t)=>{if("matches"in t)return"any"==t.matches||e.value==t.matches?l(e,t,"if"):l(e,t,"else"),!1;if("in-list"in t){var a=document.querySelector("".concat(t["in-list"],' option[value="').concat(e.value,'"]'));return document.querySelector("".concat(t["in-list"],' option[value="').concat(e.value,'"]'))?l(a,t,"if"):l(a,t,"else"),!1}"event"in t&&l(e,t,"event")},l=(e,t,a)=>{if(!(a in t))return!1;switch(t[a]){case"hide":if(document.querySelector(t.target)){var r=document.querySelector(t.target);r.classList.add("js-hide"),Array.from(r.querySelectorAll("[data-required]")).forEach(((e,t)=>{e.removeAttribute("required")}))}break;case"show":if(document.querySelector(t.target)){var n=document.querySelector(t.target);n.classList.remove("js-hide"),Array.from(n.querySelectorAll("[data-required]")).forEach(((e,t)=>{e.closest(".js-hide")||e.setAttribute("required","true")}))}break;case"populate-form":s(e,t);break;case"dispatchEvent":var o=new Event(t.value);document.querySelector("".concat(t.target)).dispatchEvent(o);break;case"setAttribute":Array.from(document.querySelectorAll("".concat(t.target))).forEach((function(e,a){e.setAttribute(t.attribute,t.value)}));break;case"focus":document.querySelector("".concat(t.target)).focus();break;case"removeAttribute":Array.from(document.querySelectorAll("".concat(t.target))).forEach((function(e,a){e.removeAttribute(t.attribute)}));break;case"updateValue":document.querySelector("".concat(t.target)).value=t.value?t.value:"";var c=new Event("change");document.querySelector("".concat(t.target)).dispatchEvent(c);break;case"submitForm":document.querySelector("".concat(t.target)).submit();break;case"openLink":document.querySelector("".concat(t.target)).value&&(window.location.href=document.querySelector("".concat(t.target)).value)}},s=function(e,t){var a=JSON.parse(e.getAttribute("data-values")),r=document.querySelector(t.target);if(!a)return!1;Object.keys(a).forEach(((t,n)=>{document.getElementById(t)&&"SPAN"==document.getElementById(t).tagName&&(document.getElementById(t).innerHTML=a[t]),r.querySelector('select[name="'.concat(t,'"] [value="').concat(a[t],'"]'))?(r.querySelector('select[name="'.concat(t,'"]')).value=a[t],e.hasAttribute("data-lock-fields")&&(r.querySelector('select[name="'.concat(t,'"]')).disabled=!0)):r.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]'))?(Array.from(r.querySelectorAll('input[name="'.concat(t,'"][type="radio"]'))).forEach((function(e,t){e.disabled=!0})),r.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]')).checked=!0,r.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]')).disabled=!1):r.querySelector('input[name="'.concat(t,'"]'))&&(r.querySelector('input[name="'.concat(t,'"]')).value=a[t],e.hasAttribute("data-lock-fields")&&r.querySelector('input[name="'.concat(t,'"]')).setAttribute("readonly","true"))}))};document.addEventListener("DOMContentLoaded",(function(){var t,r;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",(e=>{var t=e.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var a=e.target.closest("summary"),r=e.target.closest("a"),n=e.target.closest("button");a&&window.dataLayer.push({event:"openDetails",detailsTitle:a.textContent||""}),r&&window.dataLayer.push({event:"linkClicked",linkText:r.hasAttribute("title")?r.getAttribute("title")||"":r.textContent||"",class:r.hasAttribute("class")&&r.getAttribute("class")||"",href:r.getAttribute("href")||""}),n&&window.dataLayer.push({event:"buttonClicked",buttonText:n.textContent||"",class:n.hasAttribute("class")&&n.getAttribute("class")||""})}})),document.addEventListener("change",(e=>{e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-events]")&&c(e.target,e.target.closest("[data-change-events]").getAttribute("data-change-events"))})),document.addEventListener("keyup",(e=>{e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-events]")&&c(e.target,e.target.closest("[data-change-events]").getAttribute("data-change-events"))})),document.addEventListener("click",(e=>{e&&e.target instanceof HTMLElement&&e.target.closest("[data-click-events]")&&c(e.target,e.target.closest("[data-click-events]").getAttribute("data-click-events"))})),(r=document.body).classList.add("js-enabled"),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&r.classList.add("ie"),t=function(e){var t=document.querySelector('label[for="'.concat(e.replace("#",""),'"]')),a=document.querySelector(e+" summary"),r=document.querySelector("dialog".concat(e)),n=document.querySelector("detail".concat(e));t instanceof HTMLElement?t.click():a instanceof HTMLElement?a.click():r instanceof HTMLElement?r.showModal():n instanceof HTMLElement&&n.addAttribute("open")},location.hash&&t(location.hash),window.addEventListener("hashchange",(function(){t(location.hash)}),!1),addEventListener("popstate",(e=>{if(e&&e.state&&e.state.type&&"pagination"==e.state.type){var t=document.querySelector("#".concat(e.state.form)),a=document.querySelector("#".concat(e.state.form," [data-pagination]"));a?a.value=e.state.page:t.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),t.dispatchEvent(new Event("submit"))}})),document.addEventListener("submit",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){var t=e.target;Array.from(t.querySelectorAll("[data-password-type]")).forEach(((e,t)=>{e.setAttribute("type","password")})),(t.querySelector(":invalid")||t.querySelector('.pwd-checker[data-strength="1"]')||t.querySelector('.pwd-checker[data-strength="2"]'))&&(t.classList.add("was-validated"),e.preventDefault()),t.querySelector("iam-multiselect[data-is-required][data-error]")&&(t.classList.add("was-validated"),e.preventDefault())}})),document.addEventListener("keydown",(e=>{"Escape"===e.key&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(e.preventDefault(),e.stopPropagation())})),Array.from(document.querySelectorAll("label progress")).forEach(((e,t)=>{e.closest("label").setAttribute("data-percent",e.getAttribute("value"))})),(t=>{Array.from(t.querySelectorAll("dialog[open]")).forEach(((t,a)=>{t.closest(".dialog__wrapper")||(t.removeAttribute("open"),t.showModal(),t.focus(),e(t))})),t.addEventListener("click",(t=>{if("IAM-ACTIONBAR"==t.target.tagName)return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var a=t.target.closest("[data-modal]"),r=a.hasAttribute("data-modal")?a.getAttribute("data-modal"):a.getAttribute("data-filter"),n=document.querySelector("dialog#".concat(r));if(e(n),n.showModal(),n.focus(),!n.querySelector("iam-multi-step")){var o=n.offsetWidth;n.setAttribute("style","max-width: ".concat(o,"px;"))}Array.from(n.querySelectorAll("[data-duplicate]")).forEach(((e,t)=>{var a=e.getAttribute("data-duplicate"),r=document.getElementById(a);if(e.checked!=r.checked){e.checked=r.checked;var n=new Event("change");e.dispatchEvent(n)}})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var c=t.target.closest("dialog[open]");t.preventDefault(),c.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((e,t)=>{e.classList.remove("active")}));var i=new CustomEvent("dialog-closed",{bubbles:!0,cancelable:!0,detail:{modalId:c.id}});t.target.dispatchEvent(i),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var l=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((e,t)=>{e.classList.remove("active")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:l.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var s=t.target.closest("dialog[open]");if("contents"===window.getComputedStyle(s).display&&(s=s.parentNode.closest("dialog[open]")),!s.classList.contains("dialog--transactional")&&!s.classList.contains("dialog--acknowledgement")){var d=s.getBoundingClientRect();(t.clientX<d.left||t.clientX>d.right||t.clientY<d.top||t.clientY>d.bottom)&&(t.target.closest("dialog *")||s.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var u=t.target.closest(".dialog__wrapper > button"),g="openPopover",p=u.parentNode.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=p&&u.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((e,t)=>{e.removeAttribute("aria-expanded")})),p.hasAttribute("open"))p.close(),g="closePopover",p.removeAttribute("style"),u.removeAttribute("aria-expanded");else{p.show(),u.setAttribute("aria-expanded",!0);var m=u.getBoundingClientRect(),y=m.top,v=m.left;if(u.closest("iam-table")){var f=u.closest("iam-table").parentNode.getBoundingClientRect();y-=f.top,v-=f.left}p.classList.contains("dialog--fix")&&p.setAttribute("style","position:fixed;top: ".concat(y,"px; left: ").concat(v,"px; margin: 3rem 0 0 0;"))}var h=p.getBoundingClientRect();if(h.bottom-window.scrollY>window.innerHeight-window.scrollY){var b=p.hasAttribute("style")?p.getAttribute("style")+" ":"";p.setAttribute("style",b+"transform: translate(0, calc(-100% - 4rem))"),(h=p.getBoundingClientRect()).top-window.scrollY<100&&p.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:g,id:u.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.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(((e,t)=>{e.removeAttribute("aria-expanded")})))}))})(document.body),a(document.body)}))}));
|
|
@@ -116,6 +116,10 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.notification__btns {
|
|
119
|
+
&.empty {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
119
123
|
flex-grow: 0;
|
|
120
124
|
flex-shrink: 0;
|
|
121
125
|
--colour-underline: currentColor;
|
|
@@ -141,6 +145,10 @@
|
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
.notification__dismiss {
|
|
148
|
+
&:empty {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
144
152
|
flex-grow: 0;
|
|
145
153
|
padding-left: 1rem;
|
|
146
154
|
|
|
@@ -27,7 +27,7 @@ class iamMultiselect extends HTMLElement {
|
|
|
27
27
|
${loadCSS}
|
|
28
28
|
${this.hasAttribute('css') ? `@import "${this.getAttribute('css')}";` : ``}
|
|
29
29
|
</style>
|
|
30
|
-
<label for="search"> <slot name="feedback"></slot
|
|
30
|
+
<label for="search" class="mb-0"><span class="inner-label label"></span> <slot name="feedback"></slot>
|
|
31
31
|
<div class="outer">
|
|
32
32
|
<div class="wrapper">
|
|
33
33
|
|
|
@@ -40,6 +40,7 @@ class iamMultiselect extends HTMLElement {
|
|
|
40
40
|
<button id="clear"><span class="visually-hidden">Clear</span></button>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
|
+
</label>
|
|
43
44
|
`;
|
|
44
45
|
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
45
46
|
}
|
|
@@ -51,9 +52,9 @@ class iamMultiselect extends HTMLElement {
|
|
|
51
52
|
const search = multiselect.shadowRoot.querySelector('#search');
|
|
52
53
|
const button = multiselect.shadowRoot.querySelector('#clear');
|
|
53
54
|
let order = 0;
|
|
54
|
-
const
|
|
55
|
+
const innerLabel = multiselect.shadowRoot.querySelector('label .inner-label');
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
innerLabel.innerHTML = multiselect.getAttribute('data-label');
|
|
57
58
|
|
|
58
59
|
if (multiselect.hasAttribute('placeholder')) {
|
|
59
60
|
search.setAttribute('placeholder', multiselect.getAttribute('placeholder'));
|
|
@@ -21,15 +21,6 @@ class iamNotification extends HTMLElement {
|
|
|
21
21
|
const loadCSS = `@import "${assetLocation}/css/components/notification.css";`;
|
|
22
22
|
const loadExtraCSS = `@import "${assetLocation}/css/components/notification.global.css";`;
|
|
23
23
|
|
|
24
|
-
const buttons = this.querySelectorAll('a,button');
|
|
25
|
-
|
|
26
|
-
Array.from(buttons).forEach((button, index) => {
|
|
27
|
-
button.setAttribute('slot', 'btns');
|
|
28
|
-
button.classList.add('link');
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
if (buttons.length || this.hasAttribute('data-dismiss')) this.classList.add('notification--dismissable');
|
|
32
|
-
|
|
33
24
|
const template = document.createElement('template');
|
|
34
25
|
template.innerHTML = `
|
|
35
26
|
<style>
|
|
@@ -40,8 +31,8 @@ class iamNotification extends HTMLElement {
|
|
|
40
31
|
|
|
41
32
|
<div class="notification">
|
|
42
33
|
<div class="notification__icon"><slot name="icon"></slot></div>
|
|
43
|
-
<div class="notification__inner"><div class="notification__text"><slot></slot></div
|
|
44
|
-
|
|
34
|
+
<div class="notification__inner"><div class="notification__text"><slot></slot></div><div class="notification__btns"><slot name="btns"></slot></div></div>
|
|
35
|
+
<div class="notification__dismiss"></div>
|
|
45
36
|
</div>
|
|
46
37
|
`;
|
|
47
38
|
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
@@ -51,8 +42,8 @@ class iamNotification extends HTMLElement {
|
|
|
51
42
|
document.head.insertAdjacentHTML('beforeend', `<style id="notificationHolder">${loadExtraCSS}</style>`);
|
|
52
43
|
}
|
|
53
44
|
|
|
54
|
-
connectedCallback() {
|
|
55
|
-
const
|
|
45
|
+
connectedCallback(): void {
|
|
46
|
+
const wrapper = this;
|
|
56
47
|
const statusBG = this.hasAttribute('data-status') ? this.getAttribute('data-status') : 'white';
|
|
57
48
|
|
|
58
49
|
if (this.hasAttribute('data-type')) this.classList.add(`bg-${statusBG}`);
|
|
@@ -60,8 +51,6 @@ class iamNotification extends HTMLElement {
|
|
|
60
51
|
this.classList.add(`colour-${statusBG}`);
|
|
61
52
|
}
|
|
62
53
|
|
|
63
|
-
const wrapper = this;
|
|
64
|
-
|
|
65
54
|
if (!this.querySelector('i')) {
|
|
66
55
|
switch (statusBG) {
|
|
67
56
|
case 'danger':
|
|
@@ -78,10 +67,28 @@ class iamNotification extends HTMLElement {
|
|
|
78
67
|
}
|
|
79
68
|
}
|
|
80
69
|
|
|
81
|
-
|
|
70
|
+
const buttons = this.querySelectorAll('a,button');
|
|
82
71
|
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
Array.from(buttons).forEach((button, index) => {
|
|
73
|
+
button.setAttribute('slot', 'btns');
|
|
74
|
+
button.classList.add('link');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (buttons.length || this.hasAttribute('data-dismiss')) {
|
|
78
|
+
this.classList.add('notification--dismissable');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!buttons.length) {
|
|
82
|
+
this.shadowRoot?.querySelector('.notification__btns')?.classList.add('empty');
|
|
83
|
+
} else {
|
|
84
|
+
this.shadowRoot?.querySelector('.notification__btns')?.classList.remove('empty');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (this.hasAttribute('data-dismiss')) {
|
|
88
|
+
this.shadowRoot.querySelector('.notification__dismiss')?.innerHTML =
|
|
89
|
+
`<button data-dismiss-button part="dismiss-btn">Dismiss</button>`;
|
|
90
|
+
|
|
91
|
+
this.shadowRoot.querySelector('.notification__dismiss [data-dismiss-button]').addEventListener(
|
|
85
92
|
'click',
|
|
86
93
|
function (e) {
|
|
87
94
|
closeNotification(wrapper);
|
|
@@ -89,6 +96,8 @@ class iamNotification extends HTMLElement {
|
|
|
89
96
|
false
|
|
90
97
|
);
|
|
91
98
|
}
|
|
99
|
+
|
|
100
|
+
setupNotification(this);
|
|
92
101
|
}
|
|
93
102
|
}
|
|
94
103
|
|
|
@@ -20,7 +20,11 @@ function setupNotification(element) {
|
|
|
20
20
|
element.addEventListener(
|
|
21
21
|
'click',
|
|
22
22
|
function (e) {
|
|
23
|
-
if (
|
|
23
|
+
if (
|
|
24
|
+
event &&
|
|
25
|
+
event.target instanceof HTMLElement &&
|
|
26
|
+
(event.target.closest('[data-dismiss-button]') || event.target.matches('[data-dismiss-button]'))
|
|
27
|
+
) {
|
|
24
28
|
e.preventDefault();
|
|
25
29
|
closeNotification(element);
|
|
26
30
|
}
|