@iamproperty/components 5.1.0-beta8 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/components/component.native.css +1 -1
- package/assets/css/components/component.native.css.map +1 -1
- package/assets/css/components/component.reset.css +1 -1
- package/assets/css/components/component.reset.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.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.js +5 -4
- package/assets/js/components/address-lookup/address-lookup.component.min.js +4 -4
- package/assets/js/components/address-lookup/address-lookup.component.min.js.map +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.min.js +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.js +29 -15
- package/assets/js/components/search/search.component.min.js +13 -7
- package/assets/js/components/search/search.component.min.js.map +1 -1
- package/assets/js/components/table/table.component.js +1 -0
- package/assets/js/components/table/table.component.min.js +2 -2
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +5 -4
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/helpers.js +5 -1
- package/assets/js/modules/inputs.js +61 -0
- package/assets/js/scripts.bundle.js +32 -31
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/js/vendor/hibp.js +78 -0
- package/assets/sass/_func.scss +1 -0
- package/assets/sass/components/component.native.scss +4 -0
- package/assets/sass/elements/admin-panel.scss +1 -0
- package/assets/sass/elements/dialog.scss +4 -4
- package/assets/sass/elements/forms.scss +35 -4
- package/assets/sass/helpers/max-height.scss +4 -2
- package/assets/ts/components/address-lookup/address-lookup.component.ts +6 -6
- package/assets/ts/components/search/search.component.ts +35 -19
- package/assets/ts/components/table/table.component.ts +1 -0
- package/assets/ts/modules/helpers.ts +6 -1
- package/assets/ts/modules/inputs.ts +84 -0
- package/assets/ts/vendor/hibp.ts +81 -0
- package/dist/components.es.js +13 -13
- package/dist/components.umd.js +17 -17
- package/package.json +1 -1
package/dist/components.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* iamKey v5.
|
|
1
|
+
(function(A,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(A=typeof globalThis<"u"?globalThis:A||self,s(A.iamkey={},A.Vue))})(this,function(A,s){"use strict";const k=(o,e)=>{const t=o.__vccOpts||o;for(const[r,i]of e)t[r]=i;return t},it={name:"Logo",props:{id:{type:String,required:!1,default:"property"},path:{type:String,required:!1,default:"/svg/logo.svg"},desc:{type:String}},computed:{src:function(){return"#logo-"+this.id},className:function(){return"brand brand--"+this.id}}},st=["xlink:href"],lt=["innerHTML"];function ct(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(l.className)},[(s.openBlock(),s.createElementBlock("svg",null,[s.createElementVNode("title",null,"iam "+s.toDisplayString(t.id),1),s.createElementVNode("use",{"xlink:href":t.path+l.src},null,8,st)])),t.desc?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:t.desc},null,8,lt)):s.createCommentVNode("",!0)],2)}const dt=k(it,[["render",ct]]);/*!
|
|
2
|
+
* iamKey v5.2.0
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
|
-
*/const mt=function(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))},ut=(o,e)=>String(o).padStart(e,"0"),pt=o=>o.charAt(0).toUpperCase()+o.slice(1),q=(o,e,t)=>e.split(/[\.\[\]\'\"]/).filter(r=>r).reduce((r,i)=>r?r[i]:t,o);var ht=function(o,e,t,r){function i(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function n(m){try{c(r.next(m))}catch(u){a(u)}}function d(m){try{c(r.throw(m))}catch(u){a(u)}}function c(m){m.done?l(m.value):i(m.value).then(n,d)}c((r=r.apply(o,e||[])).next())})};const O=o=>{const e=Array.from(o.querySelectorAll("thead th"));Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{const i=Array.from(t.querySelectorAll("th, td")),l=["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"];i.forEach((a,n)=>{const d=e[n];if(typeof d<"u"){let c=document.createElement("div");c.innerHTML=d.innerHTML;let m=c.textContent||c.innerText||"";a.setAttribute("data-label",m),d.hasAttribute("data-td-class")&&a.setAttribute("class",d.getAttribute("data-td-class")),d.hasAttribute("data-format")&&(a.setAttribute("data-format",d.getAttribute("data-format")),a.innerHTML=B(d.getAttribute("data-format"),a.textContent.trim())),l.includes(a.textContent.trim().toLowerCase())&&a.setAttribute("data-content",a.textContent.trim().toLowerCase())}})})},bt=o=>{let e=0;return Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{let i=window.getComputedStyle(document.querySelector("html")),l=t.querySelector(":scope > *:last-child > *:first-child");if(l){l.classList.add("text-nowrap");let a=l.offsetWidth/parseFloat(i.fontSize);a+=1.7,e=e>a?e:a}}),e},ft=(o,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||o.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(o.querySelectorAll("thead tr")).forEach((t,r)=>{o.querySelectorAll("thead tr th.expand-button-heading").length||t.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{const i=t.getAttribute("data-view")==="full"?"aria-expanded":"";t.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${i}>Expand</button></td>`)})},gt=o=>{o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let t=e.target.closest("[data-expand-button]"),r=t.closest("tr");t.toggleAttribute("aria-expanded"),r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),t.blur()}})},I=(o,e)=>{let t=e.querySelector("[data-search]");if(!t)return!1;const r=t.getAttribute("id"),i=t.getAttribute("data-search").split(",");let l=t.parentNode,a={};i.forEach((n,d)=>{Array.from(o.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((c,m)=>{c.querySelector(".td__content")?a[c.querySelector(".td__content").textContent]=c.querySelector(".td__content").textContent:a[c.textContent]=c.textContent})}),t.setAttribute("list",`${r}_list`),t.setAttribute("autocomplete","off"),l.querySelector("datalist")||(l.innerHTML+=`<datalist id="${r}_list"></datalist>`),l.querySelector("datalist").innerHTML=`${Object.keys(a).map(n=>`<option value="${n}"></option>`).join("")}`},yt=(o,e,t,r,i)=>{var l;let a=function(c,m=!1){if(e.classList.contains("processing"))return!1;if(c.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((u,p)=>{const b=u.getAttribute("data-duplicate"),h=document.getElementById(b),f=document.querySelector(`[for="${b}"] iam-card`);if(h.checked!=u.checked)if(f){let y=new Event("click");f.dispatchEvent(y)}else h.checked=u.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!m){let u=e.querySelector("[data-pagination]");u.value=1,r.setAttribute("data-page",1)}Y(o,e,t,r)}else e.hasAttribute("data-submit")?e.submit():(j(o,e,r),M(o,e));if(e.hasAttribute("data-ajax-post")){let u=new FormData(e),p=new URLSearchParams(u).toString();const b=new XMLHttpRequest;b.open("GET",`${window.location.href}?ajax=true&${p}`),b.send()}};e.addEventListener("keyup",c=>{clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&(l=setTimeout(function(){a(c)},500))}),e.addEventListener("change",c=>{clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||W(o,e,i),a(c)),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter][data-no-ajax]")?(j(o,e,r),M(o,e)):(c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&c.target.closest("form .dialog__wrapper > dialog")||c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&!c.target.closest("form dialog"))&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-show]")&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-mimic]")&&a(c)}),e.addEventListener("click",c=>{if(clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest('dialog button:not([type="button"])')&&c.target.closest('dialog button:not([type="button"])').closest("dialog").close(),c&&c.target instanceof HTMLElement&&c.target.closest(".dialog__close")&&(c.preventDefault(),c.stopPropagation()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((u,p)=>{u.innerHTML=""});let m=e.elements;for(let u=0;u<m.length;u++)switch(m[u].type.toLowerCase()?m[u].type.toLowerCase():"text"){case"text":case"password":case"textarea":m[u].value="";break;case"radio":case"checkbox":if(m[u].checked){let p=m[u],b=p.getAttribute("id"),h=document.querySelector(`[for="${b}"`);if(h.querySelector("iam-card")){let f=h.querySelector("iam-card"),y=new Event("click");f.dispatchEvent(y)}p.checked=!1}break;case"select-one":case"select-multi":m[u].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||W(o,e,i),a(c)}}),e.addEventListener("submit",c=>{clearTimeout(l),e.hasAttribute("data-submit")||c.preventDefault(),a(c)}),e.addEventListener("force",c=>{a(c)}),e.addEventListener("paginate",c=>{a(c,!0)});let n=[],d=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((c,m)=>{let u=c.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${u}"]`)).forEach((p,b)=>{let h=p.closest("form");n.includes(h)||n.push(h),d.includes(u)||d.push(u)})}),n.forEach((c,m)=>{const u=function(){let p=[],b=new FormData(c);for(const[h,f]of b)document.querySelector(`[data-mimic="${h}"]`)&&!p.includes(h)?(p.push(h),document.querySelector(`[data-mimic="${h}"]`).value=f):document.querySelector(`[data-mimic="${h}"]`)&&(document.querySelector(`[data-mimic="${h}"]`).value+=","+f);for(const h of p){const f=new Event("force");e.dispatchEvent(f)}for(const h of d)if(!b.has(h)&&c.querySelector(`[name="${h}"]`)){document.querySelector(`[data-mimic="${h}"]`).value="";const f=new Event("force");e.dispatchEvent(f)}};c.addEventListener("force",p=>{u()}),c.addEventListener("change",p=>{u()})})},W=(o,e,t)=>{if(e.getAttribute("data-ajax"))return!1;let r=o.querySelector("tbody"),i=e.querySelector("[data-sort]"),l=i.querySelector(`option:nth-child(${i.selectedIndex+1})`),a=l.getAttribute("data-sort"),n=l.getAttribute("data-order"),d=l.getAttribute("data-format");if(!a)return r.innerHTML=t.innerHTML,O(o),!1;let c=[];["asc","desc","descending"].includes(n)||(c=n.split(","));let m=[];Array.from(r.querySelectorAll("tr")).forEach((p,b)=>{let h=p.querySelector('td[data-label="'+a+'"], th[data-label="'+a+'"]').textContent.trim();p.querySelector('[data-label="'+a+'"] .td__content')&&(h=p.querySelector('[data-label="'+a+'"] .td__content').textContent.trim()),c.length&&c.includes(h)&&(h=c.indexOf(h)),mt(h)&&(h=ut(h,10)),d&&d=="date"&&(h=new Date(h));const f={index:h,row:p};m.push(f)}),m.sort((p,b)=>p.index>b.index?1:-1),(n=="descending"||n=="desc")&&(m=m.reverse());let u="";m.forEach((p,b)=>{u+=p.row.outerHTML}),r.innerHTML=u},j=(o,e,t)=>{o.classList.remove("table--filtered");let r=G(e),i=[],l=0,a=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(o.querySelectorAll("tbody tr")).forEach((c,m)=>{c.classList.remove("filtered"),c.classList.remove("filtered--matched"),c.classList.remove("filtered--show"),c.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let c=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((m,u)=>{i.push({column:`${m.trim()}`,value:`${c.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((c,m)=>{c.innerHTML="",c.parentNode.classList.remove("hover")});let d=0;Object.values(r).forEach((c,m)=>{typeof c=="object"&&Object.values(c).length?d+=Object.values(c).length:d++}),d&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((c,m)=>{c.innerHTML+=`(${d})`,c.parentNode.classList.add("hover")}),o.classList.add("table--filtered");for(const[c,m]of Object.entries(r))Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((u,p)=>{let b=!1;m.forEach((h,f)=>{let y=u.querySelector(`[data-label="${c}"]`);if(h&&h=="$today")h=B("date",new Date);else if(h&&h=="$yesterday"){let _=new Date;_.setDate(_.getDate()-1),h=B("date",_)}else if(h&&(h=="$thisWeek"||h=="$lastWeek")){let _=new Date,x=new Date(_.setDate(_.getDate()-(_.getDay()-1))),A=new Date(_.setDate(_.getDate()-_.getDay()+7)),S=new Date(y.textContent.toLowerCase());if(_.setHours(0,0,0,0),x.setHours(0,0,0,0),A.setHours(0,0,0,0),S.setHours(0,0,0,0),h=="$thisWeek")b=S>=x&&S<=A;else{let E=new Date(x.setDate(x.getDate()-7)),C=new Date(A.setDate(A.getDate()-7));E.setHours(0,0,0,0),C.setHours(0,0,0,0),b=S>=E&&S<=C}}else if(h&&h=="$thisMonth"){let _=new Date,x=_.getFullYear(),A=_.getMonth();var v=new Date(x,A,1),g=new Date(x,A+1,0);let S=new Date(y.textContent.toLowerCase());v.setHours(0,0,0,0),g.setHours(0,0,0,0),S.setHours(0,0,0,0),b=S>=v&&S<=g}else if(h&&h=="$lastMonth"){let _=new Date,x=_.getFullYear(),A=_.getMonth();var T=new Date(x,A-1,1),L=new Date(x,A,0);let S=new Date(y.textContent.toLowerCase());T.setHours(0,0,0,0),L.setHours(0,0,0,0),S.setHours(0,0,0,0),b=S>=T&&S<=L}y&&y.textContent.toLowerCase().includes(h.toLowerCase())&&(b=!0)}),b||(u.classList.add("filtered"),u.setAttribute("data-filtered-by",c))});Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((c,m)=>{let u=!(i.length>0&&i[0].value.length>=3);i.forEach((p,b)=>{let h=c.querySelector(`[data-label="${p.column}"]`);h&&p.value.length>=3&&h.textContent.toLowerCase().includes(p.value.toLowerCase())&&(u=!0)}),u||c.classList.add("filtered")}),Array.from(o.querySelectorAll("tbody tr:not(.filtered")).forEach((c,m)=>{l++,c.classList.add("filtered--matched"),Math.ceil(l/n)==parseInt(a)&&c.classList.add("filtered--show")}),t&&(t.setAttribute("data-total",l),t.setAttribute("data-show",n),t.setAttribute("data-page",a))},M=(o,e,t)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((r,i)=>{let l=r.getAttribute("data-query"),a=0;if(l=="total")t.hasAttribute("data-total")?a=t.getAttribute("data-total"):a=(o.classList.contains("table--filtered"),o.querySelectorAll("tbody tr").length);else if(!l.includes(" == ")&&l.includes(" & ")){let n=l.split(" & "),d="";n.forEach(c=>{d+=`:not([data-filtered-by="${c}"])`}),a=Array.from(o.querySelectorAll(`tbody tr${d}`)).length}else if(!l.includes(" == "))a=Array.from(o.querySelectorAll(`tbody tr:not([data-filtered-by="${l}"])`)).length;else if(l.includes(" && ")){let n=l.split(" && ");a=Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).filter(function(d){let c=!0;for(const[m,u]of Object.entries(n)){let p=u.split(" == ");(!d.querySelector(`td[data-label="${p[0]}"]`)||d.querySelector(`td[data-label="${p[0]}"]`).textContent!=`${p[1]}`)&&(c=!1)}return c}).length}else{let n=l.split(" == ");a=Array.from(o.querySelectorAll(`tbody tr.filtered--matched td[data-label="${n[0]}"], tbody tr[data-filtered-by="${n[0]}"] td[data-label="${n[0]}"]`)).filter(function(d){return d.textContent===n[1]}).length}r.hasAttribute("data-total")?r.setAttribute("data-total",a):r.innerHTML=a})},vt=function(o,e,t,r){t.addEventListener("update-page",i=>{let l=e.querySelector("[data-pagination]"),a=i.detail.page;if(l.value=a,e.dispatchEvent(new Event("paginate")),r.setAttribute("data-page",a),o.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",a),history.pushState({type:"pagination",form:e.getAttribute("id"),page:a},"",n)}if(!r.hasAttribute("data-no-scroll")){const n=o.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:n,behavior:"smooth"})}}),t.addEventListener("update-show",i=>{let l=e.querySelector("[data-show]"),a=i.detail.show;l.value=a,r.setAttribute("data-show",a),e.dispatchEvent(new Event("submit"))})},wt=(o,e)=>{if(!o)return!1;o.addEventListener("click",t=>{At(e)})},At=function(o){for(var e=[],t=o.getElementsByTagName("tr"),r=0;r<t.length;r++){for(var i=t[r].querySelectorAll("td,th"),l=[],a=0;a<i.length;a++)l.push(`"${i[a].textContent}"`);e.push(l.join(","))}e=e.join(`
|
|
5
|
-
`);let n=new Blob([e],{type:"text/csv"});var d=document.createElement("a");d.download="export.csv";var c=window.URL.createObjectURL(n);d.href=c,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d)},U=function(o,e,t,r){if(O(o),ft(o,r),M(o,e,r),r&&r.classList.contains("table--cta")){let i=function(){Array.from(o.querySelectorAll("tr")).forEach((a,n)=>{let d=a.offsetHeight;a.style.setProperty("--row-height",`${d}px`)})};const l=bt(o);r.style.setProperty("--cta-width",`${l}rem`),new ResizeObserver(i).observe(o)}},G=function(o){let e=new Object;return Array.from(o.querySelectorAll("[data-filter]")).forEach((t,r)=>{if(!(t.type=="radio"&&!t.checked)&&!(t.type=="checkbox"&&!t.checked)&&t&&t.value){let i=t.getAttribute("data-filter");e[i]||(e[i]=new Array),e[i].push(t.value)}}),e},Y=function(o,e,t,r){return ht(this,void 0,void 0,function*(){let i=new FormData(e),l=new URLSearchParams(i).toString(),a=o.querySelectorAll("thead tr th:not(.expand-button-heading)"),n=o.querySelector("tbody"),d=e.getAttribute("data-ajax");r.classList.add("table--loading");let c=G(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,b)=>{p.innerHTML="",p.parentNode.classList.remove("hover")});let m=0;Object.values(c).forEach((p,b)=>{typeof p=="object"&&Object.values(p).length?m+=Object.values(p).length:m++}),m&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,b)=>{p.innerHTML+=`(${m})`,p.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[d]&&window.controller[d].abort(),window.controller[d]=new AbortController;const{signal:u}=controller[d];t.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(d+"?"+l,{signal:u,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=>{let b=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",h=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",f=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",y=q(p,h,15),v=q(p,f,1),g=q(p,b),T=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";g?(n.innerHTML="",g.forEach((L,_)=>{var x=document.createElement("tr");a.forEach((
|
|
4
|
+
*/const mt=function(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))},ut=(o,e)=>String(o).padStart(e,"0"),pt=o=>o.charAt(0).toUpperCase()+o.slice(1),q=(o,e,t)=>e.split(/[\.\[\]\'\"]/).filter(r=>r).reduce((r,i)=>r?r[i]:t,o);var ht=function(o,e,t,r){function i(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function n(m){try{c(r.next(m))}catch(u){a(u)}}function d(m){try{c(r.throw(m))}catch(u){a(u)}}function c(m){m.done?l(m.value):i(m.value).then(n,d)}c((r=r.apply(o,e||[])).next())})};const O=o=>{const e=Array.from(o.querySelectorAll("thead th"));Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{const i=Array.from(t.querySelectorAll("th, td")),l=["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"];i.forEach((a,n)=>{const d=e[n];if(typeof d<"u"){let c=document.createElement("div");c.innerHTML=d.innerHTML;let m=c.textContent||c.innerText||"";a.setAttribute("data-label",m),d.hasAttribute("data-td-class")&&a.setAttribute("class",d.getAttribute("data-td-class")),d.hasAttribute("data-format")&&(a.setAttribute("data-format",d.getAttribute("data-format")),a.innerHTML=B(d.getAttribute("data-format"),a.textContent.trim())),l.includes(a.textContent.trim().toLowerCase())&&a.setAttribute("data-content",a.textContent.trim().toLowerCase())}})})},bt=o=>{let e=0;return Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{let i=window.getComputedStyle(document.querySelector("html")),l=t.querySelector(":scope > *:last-child > *:first-child");if(l){l.classList.add("text-nowrap");let a=l.offsetWidth/parseFloat(i.fontSize);a+=1.7,e=e>a?e:a}}),e},ft=(o,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||o.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(o.querySelectorAll("thead tr")).forEach((t,r)=>{o.querySelectorAll("thead tr th.expand-button-heading").length||t.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(o.querySelectorAll("tbody tr")).forEach((t,r)=>{const i=t.getAttribute("data-view")==="full"?"aria-expanded":"";t.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${i}>Expand</button></td>`)})},gt=o=>{o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let t=e.target.closest("[data-expand-button]"),r=t.closest("tr");t.toggleAttribute("aria-expanded"),r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),t.blur()}})},I=(o,e)=>{let t=e.querySelector("[data-search]");if(!t)return!1;const r=t.getAttribute("id"),i=t.getAttribute("data-search").split(",");let l=t.parentNode,a={};i.forEach((n,d)=>{Array.from(o.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((c,m)=>{c.querySelector(".td__content")?a[c.querySelector(".td__content").textContent]=c.querySelector(".td__content").textContent:a[c.textContent]=c.textContent})}),t.setAttribute("list",`${r}_list`),t.setAttribute("autocomplete","off"),l.querySelector("datalist")||(l.innerHTML+=`<datalist id="${r}_list"></datalist>`),l.querySelector("datalist").innerHTML=`${Object.keys(a).map(n=>`<option value="${n}"></option>`).join("")}`},yt=(o,e,t,r,i)=>{var l;let a=function(c,m=!1){if(e.classList.contains("processing"))return!1;if(c.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((u,p)=>{const b=u.getAttribute("data-duplicate"),h=document.getElementById(b),f=document.querySelector(`[for="${b}"] iam-card`);if(h.checked!=u.checked)if(f){let y=new Event("click");f.dispatchEvent(y)}else h.checked=u.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!m){let u=e.querySelector("[data-pagination]");u.value=1,r.setAttribute("data-page",1)}Y(o,e,t,r)}else e.hasAttribute("data-submit")?e.submit():(j(o,e,r),M(o,e));if(e.hasAttribute("data-ajax-post")){let u=new FormData(e),p=new URLSearchParams(u).toString();const b=new XMLHttpRequest;b.open("GET",`${window.location.href}?ajax=true&${p}`),b.send()}};e.addEventListener("keyup",c=>{clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&(l=setTimeout(function(){a(c)},500))}),e.addEventListener("change",c=>{clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||W(o,e,i),a(c)),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter][data-no-ajax]")?(j(o,e,r),M(o,e)):(c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&c.target.closest("form .dialog__wrapper > dialog")||c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&!c.target.closest("form dialog"))&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-show]")&&a(c),c&&c.target instanceof HTMLElement&&c.target.closest("[data-mimic]")&&a(c)}),e.addEventListener("click",c=>{if(clearTimeout(l),c&&c.target instanceof HTMLElement&&c.target.closest('dialog button:not([type="button"])')&&c.target.closest('dialog button:not([type="button"])').closest("dialog").close(),c&&c.target instanceof HTMLElement&&c.target.closest(".dialog__close")&&(c.preventDefault(),c.stopPropagation()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((u,p)=>{u.innerHTML=""});let m=e.elements;for(let u=0;u<m.length;u++)switch(m[u].type.toLowerCase()?m[u].type.toLowerCase():"text"){case"text":case"password":case"textarea":m[u].value="";break;case"radio":case"checkbox":if(m[u].checked){let p=m[u],b=p.getAttribute("id"),h=document.querySelector(`[for="${b}"`);if(h.querySelector("iam-card")){let f=h.querySelector("iam-card"),y=new Event("click");f.dispatchEvent(y)}p.checked=!1}break;case"select-one":case"select-multi":m[u].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||W(o,e,i),a(c)}}),e.addEventListener("submit",c=>{clearTimeout(l),e.hasAttribute("data-submit")||c.preventDefault(),a(c)}),e.addEventListener("force",c=>{a(c)}),e.addEventListener("paginate",c=>{a(c,!0)});let n=[],d=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((c,m)=>{let u=c.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${u}"]`)).forEach((p,b)=>{let h=p.closest("form");n.includes(h)||n.push(h),d.includes(u)||d.push(u)})}),n.forEach((c,m)=>{const u=function(){let p=[],b=new FormData(c);for(const[h,f]of b)document.querySelector(`[data-mimic="${h}"]`)&&!p.includes(h)?(p.push(h),document.querySelector(`[data-mimic="${h}"]`).value=f):document.querySelector(`[data-mimic="${h}"]`)&&(document.querySelector(`[data-mimic="${h}"]`).value+=","+f);for(const h of p){const f=new Event("force");e.dispatchEvent(f)}for(const h of d)if(!b.has(h)&&c.querySelector(`[name="${h}"]`)){document.querySelector(`[data-mimic="${h}"]`).value="";const f=new Event("force");e.dispatchEvent(f)}};c.addEventListener("force",p=>{u()}),c.addEventListener("change",p=>{u()})})},W=(o,e,t)=>{if(e.getAttribute("data-ajax"))return!1;let r=o.querySelector("tbody"),i=e.querySelector("[data-sort]"),l=i.querySelector(`option:nth-child(${i.selectedIndex+1})`),a=l.getAttribute("data-sort"),n=l.getAttribute("data-order"),d=l.getAttribute("data-format");if(!a)return r.innerHTML=t.innerHTML,O(o),!1;let c=[];["asc","desc","descending"].includes(n)||(c=n.split(","));let m=[];Array.from(r.querySelectorAll("tr")).forEach((p,b)=>{let h=p.querySelector('td[data-label="'+a+'"], th[data-label="'+a+'"]').textContent.trim();p.querySelector('[data-label="'+a+'"] .td__content')&&(h=p.querySelector('[data-label="'+a+'"] .td__content').textContent.trim()),c.length&&c.includes(h)&&(h=c.indexOf(h)),mt(h)&&(h=ut(h,10)),d&&d=="date"&&(h=new Date(h));const f={index:h,row:p};m.push(f)}),m.sort((p,b)=>p.index>b.index?1:-1),(n=="descending"||n=="desc")&&(m=m.reverse());let u="";m.forEach((p,b)=>{u+=p.row.outerHTML}),r.innerHTML=u},j=(o,e,t)=>{o.classList.remove("table--filtered");let r=G(e),i=[],l=0,a=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(o.querySelectorAll("tbody tr")).forEach((c,m)=>{c.classList.remove("filtered"),c.classList.remove("filtered--matched"),c.classList.remove("filtered--show"),c.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let c=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((m,u)=>{i.push({column:`${m.trim()}`,value:`${c.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((c,m)=>{c.innerHTML="",c.parentNode.classList.remove("hover")});let d=0;Object.values(r).forEach((c,m)=>{typeof c=="object"&&Object.values(c).length?d+=Object.values(c).length:d++}),d&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((c,m)=>{c.innerHTML+=`(${d})`,c.parentNode.classList.add("hover")}),o.classList.add("table--filtered");for(const[c,m]of Object.entries(r))Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((u,p)=>{let b=!1;m.forEach((h,f)=>{let y=u.querySelector(`[data-label="${c}"]`);if(h&&h=="$today")h=B("date",new Date);else if(h&&h=="$yesterday"){let _=new Date;_.setDate(_.getDate()-1),h=B("date",_)}else if(h&&(h=="$thisWeek"||h=="$lastWeek")){let _=new Date,x=new Date(_.setDate(_.getDate()-(_.getDay()-1))),w=new Date(_.setDate(_.getDate()-_.getDay()+7)),S=new Date(y.textContent.toLowerCase());if(_.setHours(0,0,0,0),x.setHours(0,0,0,0),w.setHours(0,0,0,0),S.setHours(0,0,0,0),h=="$thisWeek")b=S>=x&&S<=w;else{let E=new Date(x.setDate(x.getDate()-7)),C=new Date(w.setDate(w.getDate()-7));E.setHours(0,0,0,0),C.setHours(0,0,0,0),b=S>=E&&S<=C}}else if(h&&h=="$thisMonth"){let _=new Date,x=_.getFullYear(),w=_.getMonth();var v=new Date(x,w,1),g=new Date(x,w+1,0);let S=new Date(y.textContent.toLowerCase());v.setHours(0,0,0,0),g.setHours(0,0,0,0),S.setHours(0,0,0,0),b=S>=v&&S<=g}else if(h&&h=="$lastMonth"){let _=new Date,x=_.getFullYear(),w=_.getMonth();var T=new Date(x,w-1,1),L=new Date(x,w,0);let S=new Date(y.textContent.toLowerCase());T.setHours(0,0,0,0),L.setHours(0,0,0,0),S.setHours(0,0,0,0),b=S>=T&&S<=L}y&&y.textContent.toLowerCase().includes(h.toLowerCase())&&(b=!0)}),b||(u.classList.add("filtered"),u.setAttribute("data-filtered-by",c))});Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((c,m)=>{let u=!(i.length>0&&i[0].value.length>=3);i.forEach((p,b)=>{let h=c.querySelector(`[data-label="${p.column}"]`);h&&p.value.length>=3&&h.textContent.toLowerCase().includes(p.value.toLowerCase())&&(u=!0)}),u||c.classList.add("filtered")}),Array.from(o.querySelectorAll("tbody tr:not(.filtered")).forEach((c,m)=>{l++,c.classList.add("filtered--matched"),Math.ceil(l/n)==parseInt(a)&&c.classList.add("filtered--show")}),t&&(t.setAttribute("data-total",l),t.setAttribute("data-show",n),t.setAttribute("data-page",a))},M=(o,e,t)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((r,i)=>{let l=r.getAttribute("data-query"),a=0;if(l=="total")t.hasAttribute("data-total")?a=t.getAttribute("data-total"):a=(o.classList.contains("table--filtered"),o.querySelectorAll("tbody tr").length);else if(!l.includes(" == ")&&l.includes(" & ")){let n=l.split(" & "),d="";n.forEach(c=>{d+=`:not([data-filtered-by="${c}"])`}),a=Array.from(o.querySelectorAll(`tbody tr${d}`)).length}else if(!l.includes(" == "))a=Array.from(o.querySelectorAll(`tbody tr:not([data-filtered-by="${l}"])`)).length;else if(l.includes(" && ")){let n=l.split(" && ");a=Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).filter(function(d){let c=!0;for(const[m,u]of Object.entries(n)){let p=u.split(" == ");(!d.querySelector(`td[data-label="${p[0]}"]`)||d.querySelector(`td[data-label="${p[0]}"]`).textContent!=`${p[1]}`)&&(c=!1)}return c}).length}else{let n=l.split(" == ");a=Array.from(o.querySelectorAll(`tbody tr.filtered--matched td[data-label="${n[0]}"], tbody tr[data-filtered-by="${n[0]}"] td[data-label="${n[0]}"]`)).filter(function(d){return d.textContent===n[1]}).length}r.hasAttribute("data-total")?r.setAttribute("data-total",a):r.innerHTML=a})},vt=function(o,e,t,r){t.addEventListener("update-page",i=>{let l=e.querySelector("[data-pagination]"),a=i.detail.page;if(l.value=a,e.dispatchEvent(new Event("paginate")),r.setAttribute("data-page",a),o.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",a),history.pushState({type:"pagination",form:e.getAttribute("id"),page:a},"",n)}if(!r.hasAttribute("data-no-scroll")){const n=o.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:n,behavior:"smooth"})}}),t.addEventListener("update-show",i=>{let l=e.querySelector("[data-show]"),a=i.detail.show;l.value=a,r.setAttribute("data-show",a),e.dispatchEvent(new Event("submit"))})},wt=(o,e)=>{if(!o)return!1;o.addEventListener("click",t=>{At(e)})},At=function(o){for(var e=[],t=o.getElementsByTagName("tr"),r=0;r<t.length;r++){for(var i=t[r].querySelectorAll("td,th"),l=[],a=0;a<i.length;a++)l.push(`"${i[a].textContent}"`);e.push(l.join(","))}e=e.join(`
|
|
5
|
+
`);let n=new Blob([e],{type:"text/csv"});var d=document.createElement("a");d.download="export.csv";var c=window.URL.createObjectURL(n);d.href=c,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d)},U=function(o,e,t,r){if(O(o),ft(o,r),M(o,e,r),r&&r.classList.contains("table--cta")){let i=function(){Array.from(o.querySelectorAll("tr")).forEach((a,n)=>{let d=a.offsetHeight;a.style.setProperty("--row-height",`${d}px`)})};const l=bt(o);r.style.setProperty("--cta-width",`${l}rem`),new ResizeObserver(i).observe(o)}},G=function(o){let e=new Object;return Array.from(o.querySelectorAll("[data-filter]")).forEach((t,r)=>{if(!(t.type=="radio"&&!t.checked)&&!(t.type=="checkbox"&&!t.checked)&&t&&t.value){let i=t.getAttribute("data-filter");e[i]||(e[i]=new Array),e[i].push(t.value)}}),e},Y=function(o,e,t,r){return ht(this,void 0,void 0,function*(){let i=new FormData(e),l=new URLSearchParams(i).toString(),a=o.querySelectorAll("thead tr th:not(.expand-button-heading)"),n=o.querySelector("tbody"),d=e.getAttribute("data-ajax");r.classList.add("table--loading");let c=G(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,b)=>{p.innerHTML="",p.parentNode.classList.remove("hover")});let m=0;Object.values(c).forEach((p,b)=>{typeof p=="object"&&Object.values(p).length?m+=Object.values(p).length:m++}),m&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,b)=>{p.innerHTML+=`(${m})`,p.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[d]&&window.controller[d].abort(),window.controller[d]=new AbortController;const{signal:u}=controller[d];t.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(d+"?"+l,{signal:u,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=>{let b=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",h=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",f=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",y=q(p,h,15),v=q(p,f,1),g=q(p,b),T=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";g?(n.innerHTML="",g.forEach((L,_)=>{var x=document.createElement("tr");a.forEach((w,S)=>{let E="";var C=document.createElement("td");if(C.setAttribute("data-label",w.innerText),w.getAttribute("data-output")){var P=w.getAttribute("data-output");E=P.replace(new RegExp(/{(.*?)}/,"gm"),function(Cr){return q(L,Cr.replace("{","").replace("}",""))})}if(w.hasAttribute("data-output-array")){var P=w.getAttribute("data-output");let Mr=q(L,P.replace("{","").replace("}",""));E="",Mr.forEach((nt,Or)=>{let Hr=w.getAttribute("data-output-array"),R="";if(w.hasAttribute("data-output-array-property")&&w.hasAttribute("data-output-array-transform")){const F=q(nt,w.getAttribute("data-output-array-property")),Rr=JSON.parse(w.getAttribute("data-output-array-transform"))[F];R=Hr.replace(`{${w.getAttribute("data-output-array-property")}}`,Rr)}R=R.replace(new RegExp(/{(.*?)}/,"gm"),function(F){return q(nt,F.replace("{","").replace("}",""))}),E+=R})}w.hasAttribute("data-transform")&&(E=JSON.parse(w.getAttribute("data-transform"))[E],!E&&w.hasAttribute("data-default")&&(E=w.getAttribute("data-default"))),C.innerHTML=E,x.appendChild(C)}),n.appendChild(x)}),I(o,e),r.setAttribute("data-total",parseInt(y)),r.setAttribute("data-page",parseInt(v)),U(o,e,t,r),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((L,_)=>{let x=q(p,L.getAttribute("data-ajax-query"),"");L.hasAttribute("data-total")?L.setAttribute("data-total",x):L.innerHTML=x}),parseInt(y)==0&&(n.innerHTML=`<tr><td colspan="100%"><span>${T}</span></td></tr>`),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:d,formData:l})):n.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',t.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(p){console.log(p)}})},B=(o,e)=>{switch(o){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=pt(e)}};class kt 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`,r=document.createElement("template");r.innerHTML=`
|
|
6
6
|
<style>
|
|
7
7
|
@import "${t}";
|
|
8
8
|
:host{--wrapper-padding: 2rem;--bg-colour: #ffffff;display:block;background:#fff;padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.625rem;margin-bottom:2rem;overflow:hidden}:host:before{display:none !important}@media screen and (prefers-color-scheme: dark){:host{background:var(--colour-canvas-2)}}@media(forced-colors: active){:host{--wrapper-padding: 0;background:var(--colour-canvas-2)}}::slotted(table){margin-bottom:0 !important}.table__wrapper{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}@container (width < 23.4375em){:host(:not(.table--fullwidth)){margin-left:-1.5rem;margin-right:-1.5rem;margin-bottom:0;background:var(--colour-canvas-2);border-radius:0;background:none;padding:0;box-shadow:none;overflow:visible}:host(:not(.table--fullwidth)) .table__wrapper:not(.table--fullwidth){overflow:hidden;max-height:none !important}:host(:not(.table--fullwidth)) ::slotted(table){overflow:visible !important;margin-inline:1.5rem;margin-bottom:1.5rem !important;width:calc(100% - 3rem) !important;display:block}:host(:not(.table--fullwidth)) .table--cta{border-bottom:0}:host(:not(.table--fullwidth)) .table--cta:after{content:none;display:none !important}}@container (width > 23.4375em){:host{--cta-width: 8rem}:host(.table--loading){--cta-width: 1.5rem!important}.table--cta{position:relative}.table--cta .table__wrapper{overflow-y:hidden;margin-bottom:0}}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg){position:relative}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg)::before{top:calc(100% - 1.2rem);bottom:2px;height:1.2rem;border-bottom:2px solid var(--colour-border);margin-bottom:-1.2rem}.table--cta>.table__wrapper:is(.mh-sm,.mh-md,.mh-lg){max-height:none;position:static}.table--cta>.table__wrapper:is(.mh-sm,.mh-md,.mh-lg)::before{display:none}@container (width < 23.4375em){.table__wrapper.has-actionbar{margin-top:calc(-100vh + 6.75rem) !important}}:host(.table--loading){pointer-events:none;position:relative}:host(.table--loading) ::slotted(table){min-height:20rem;opacity:.5}:host(.table--loading)::after{content:"Loading...";position:absolute;top:6.25rem;left:50%;transform:translate(-50%, 0);font-weight:bold;color:var(--colour-heading);font-size:1.5rem;text-shadow:0px 0px 10px var(--colour-canvas-2);padding-inline:2rem;text-shadow:0px 0px 10px var(--colour-canvas-2);background:radial-gradient(var(--colour-canvas-2), transparent)}@container (width < 23.4375em){.pagination--table{margin-inline:1.5rem;width:auto}:host(.table--fullwidth) .pagination--table{margin-inline:0}}/*# sourceMappingURL=assets/css/components/table.css.map */
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
<iam-pagination class="pagination--table" ${this.hasAttribute("data-page")?`data-page="${this.getAttribute("data-page")}"`:""} ></iam-pagination>
|
|
30
30
|
`,this.shadowRoot.appendChild(r.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:"";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:"";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 :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 :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 :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:"";font-weight:normal;color:var(--colour-danger)}table [data-content=medium]:after{content:"";font-weight:normal;color:var(--colour-warning)}table [data-content=low]:after{content:"";font-weight:normal;color:var(--colour-complete)}table [data-content=unknown]:after{content:"";font-weight:normal;color:var(--colour-muted)}table :is([data-content=overdue],[data-content=due],[data-content=incomplete]):after{content:"";color:var(--colour-danger)}table :is([data-content="not started"],[data-content="to do"],[data-content="on track"]):after{content:"";color:var(--colour-muted)}table :is([data-content="requires approval"],[data-content="approval required"],[data-content=upcoming]):after{content:"";color:var(--colour-warning)}table :is([data-content=warning]):after{content:"";color:var(--colour-warning)}table :is([data-content=verified],[data-content=completed],[data-content=complete]):after{content:"";font-weight:normal;color:var(--colour-complete)}table .alert-status:not([data-content="0"]):not([data-content=""]):not(:empty):after{content:"";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:"";font-weight:500}iam-table[data-expandable] [data-expand-button][aria-expanded]:before{content:""}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
|
-
</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 t=this.classList.toString();if(t=t.replace("table--cta",""),t=t.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=` ${t}`,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"),I(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" />`),gt(this.table),yt(this.table,this.form,this.pagination,this,this.savedTableBody),vt(this.table,this.form,this.pagination,this),wt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax"))Y(this.table,this.form,this.pagination,this);else{let r=function(l=1){return Math.floor(Math.random()*Date.now()*(l+1))};if(this.querySelector("iam-actionbar[data-selectall]")){const l=this.querySelector("iam-actionbar[data-selectall]");Array.from(this.table.querySelectorAll("thead tr")).forEach((a,n)=>{a.insertAdjacentHTML("afterbegin",'<th class="th--fixed"></th>')}),Array.from(this.table.querySelectorAll("tbody tr")).forEach((a,n)=>{let d=`row${r(n)}`;a.insertAdjacentHTML("afterbegin",`<td class="td--fixed selectrow"><input type="checkbox" name="row" id="${d}"/><label for="${d}"><span class="visually-hidden">Select row</span></label></td>`)}),this.table.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest(".selectrow input")){let n=this.table.querySelectorAll('.selectrow input[type="checkbox"]').length,d=this.table.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;l.setAttribute("data-selected",n==d?"all":d)}}),l.addEventListener("selected",a=>{a.detail.selected=="0"?Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,d)=>{n.checked=!1}):a.detail.selected=="all"&&Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,d)=>{n.checked=!0})})}let i=-1;Array.from(this.table.querySelectorAll("tbody tr")).forEach((l,a)=>{if(l.querySelector(":scope > td > .dialog__wrapper")){let n=l.querySelector(":scope > td > .dialog__wrapper").parentNode;n.classList.add("td--fixed"),i=Array.from(n.parentNode.children).indexOf(n)}}),i!=-1&&(this.table.querySelector(`thead tr th:nth-child(${i+1})`).classList.add("th--fixed"),Array.from(this.table.querySelectorAll(`tbody tr td:nth-child(${i+1})`)).forEach((l,a)=>{l.classList.add("td--fixed")})),U(this.table,this.form,this.pagination,this),j(this.table,this.form,this),M(this.table,this.form)}this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",r=>{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,t,r){switch(this.pagination=this.shadowRoot.querySelector("iam-pagination"),e){case"data-total":{t!=r&&this.pagination.setAttribute("data-total",r);break}case"data-show":{t!=r&&this.pagination.setAttribute("data-show",r);break}case"data-page":{t!=r&&this.pagination.setAttribute("data-page",r);break}}}}/*!
|
|
32
|
-
* iamKey v5.
|
|
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 t=this.classList.toString();if(t=t.replace("table--cta",""),t=t.replace("table--loading",""),t=t.replace("mh-md",""),this.shadowRoot.querySelector(".table__wrapper").className+=` ${t}`,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"),I(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" />`),gt(this.table),yt(this.table,this.form,this.pagination,this,this.savedTableBody),vt(this.table,this.form,this.pagination,this),wt(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax"))Y(this.table,this.form,this.pagination,this);else{let r=function(l=1){return Math.floor(Math.random()*Date.now()*(l+1))};if(this.querySelector("iam-actionbar[data-selectall]")){const l=this.querySelector("iam-actionbar[data-selectall]");Array.from(this.table.querySelectorAll("thead tr")).forEach((a,n)=>{a.insertAdjacentHTML("afterbegin",'<th class="th--fixed"></th>')}),Array.from(this.table.querySelectorAll("tbody tr")).forEach((a,n)=>{let d=`row${r(n)}`;a.insertAdjacentHTML("afterbegin",`<td class="td--fixed selectrow"><input type="checkbox" name="row" id="${d}"/><label for="${d}"><span class="visually-hidden">Select row</span></label></td>`)}),this.table.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest(".selectrow input")){let n=this.table.querySelectorAll('.selectrow input[type="checkbox"]').length,d=this.table.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;l.setAttribute("data-selected",n==d?"all":d)}}),l.addEventListener("selected",a=>{a.detail.selected=="0"?Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,d)=>{n.checked=!1}):a.detail.selected=="all"&&Array.from(this.table.querySelectorAll('.selectrow input[type="checkbox"]')).forEach((n,d)=>{n.checked=!0})})}let i=-1;Array.from(this.table.querySelectorAll("tbody tr")).forEach((l,a)=>{if(l.querySelector(":scope > td > .dialog__wrapper")){let n=l.querySelector(":scope > td > .dialog__wrapper").parentNode;n.classList.add("td--fixed"),i=Array.from(n.parentNode.children).indexOf(n)}}),i!=-1&&(this.table.querySelector(`thead tr th:nth-child(${i+1})`).classList.add("th--fixed"),Array.from(this.table.querySelectorAll(`tbody tr td:nth-child(${i+1})`)).forEach((l,a)=>{l.classList.add("td--fixed")})),U(this.table,this.form,this.pagination,this),j(this.table,this.form,this),M(this.table,this.form)}this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",r=>{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,t,r){switch(this.pagination=this.shadowRoot.querySelector("iam-pagination"),e){case"data-total":{t!=r&&this.pagination.setAttribute("data-total",r);break}case"data-show":{t!=r&&this.pagination.setAttribute("data-show",r);break}case"data-page":{t!=r&&this.pagination.setAttribute("data-page",r);break}}}}/*!
|
|
32
|
+
* iamKey v5.2.0
|
|
33
33
|
* Copyright 2022-2023 iamproperty
|
|
34
34
|
*/let X=class 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`,r=document.createElement("template");r.innerHTML=`
|
|
35
35
|
<style>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<div class="files"></div>
|
|
89
89
|
</div>
|
|
90
90
|
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){this.innerHTML+='<i class="fa-regular fa-arrow-up-from-bracket me-2" aria-hidden="true" slot="btn"></i>';const e=this.shadowRoot.querySelector(".file-upload"),t=this.querySelector("input"),r=this.shadowRoot.querySelector(".helper-text");r.innerHTML=`${this.hasAttribute("data-maxsize")?`Max file size is ${this.getAttribute("data-maxsize")}kb. `:""}${t.hasAttribute("accept")?`Supported file types are ${t.getAttribute("accept")}`:""}`,ee(this,e)}}const oe={name:"FileUpload",props:{maxfilesize:{type:Number,required:!1},maxfiles:{type:Number,required:!1}},mounted(){this.$nextTick(function(){window.customElements.get("iam-fileupload")||window.customElements.define("iam-fileupload",ae)})}};function re(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-fileupload",null,[s.renderSlot(o.$slots,"default")])}const ne=k(oe,[["render",re]]),$=(o,e)=>{const t=o[e];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e)))})},jr="",ie={name:"Accordion",props:{},mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/accordion/accordion.component.js":()=>Promise.resolve().then(()=>Vo),"../../../assets/js/components/accordion/accordion.component.min.js":()=>Promise.resolve().then(()=>Oo)}),"../../../assets/js/components/accordion/accordion.component.js").then(o=>{window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",o.default)}).catch(o=>{console.log(o.message)})})}},se={ref:"wrapper"};function le(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-accordion",se,[s.renderSlot(o.$slots,"default")],512)}const ce=k(ie,[["render",le]]),de={name:"AccordionItem",props:{title:{type:String,required:!0},titlecolour:{type:String,required:!1},badge:{type:[Number,String],required:!1},badgecolour:{type:String,required:!1,default:"light"},lazy:{type:Boolean,required:!1}},computed:{createID(){return o=>`${St(o)}`}},data(){return{show:!this.lazy}}},me=["id"],ue=["classList"];function pe(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("details",{id:l.createID(t.title)},[s.createElementVNode("summary",{classList:`${t.titlecolour?`bg-${t.titlecolour}`:""}`},[s.createTextVNode(s.toDisplayString(t.title),1),t.badge?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(`badge bg-${t.badgecolour}`)},s.toDisplayString(t.badge),3)):s.createCommentVNode("",!0)],8,ue),s.renderSlot(o.$slots,"default")],8,me)}const he=k(de,[["render",pe]]),be={name:"Header",props:{title:{type:String,required:!0},image:{type:String,required:!1},background:{type:String,default:"light",required:!1}}},fe={class:"container"},ge={class:"row"},ye={class:"col-sm-6"},ve={class:"pt-5 pb-3 px-4"},we={class:"col-sm-6 col-md-5 ms-auto"},Ae=["src"];function ke(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",fe,[s.createElementVNode("div",{class:s.normalizeClass("bg-"+t.background+" mb-4")},[s.createElementVNode("div",ge,[s.createElementVNode("div",ye,[s.createElementVNode("div",ve,[s.createElementVNode("h2",null,s.toDisplayString(t.title),1),s.renderSlot(o.$slots,"default")])]),s.createElementVNode("div",we,[t.image?(s.openBlock(),s.createElementBlock("img",{key:0,src:t.image,alt:"",class:"h-100 w-100 object-cover"},null,8,Ae)):s.createCommentVNode("",!0)])])],2)])}const _e=k(be,[["render",ke]]),xe={name:"Card",mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/card/card.component.js":()=>Promise.resolve().then(()=>Wo),"../../../assets/js/components/card/card.component.min.js":()=>Promise.resolve().then(()=>Go)}),"../../../assets/js/components/card/card.component.js").then(o=>{window.customElements.get("iam-card")||window.customElements.define("iam-card",o.default)}).catch(o=>{console.log(o.message)})})}};function Le(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-card",null,[s.renderSlot(o.$slots,"default")])}const Se=k(xe,[["render",Le]]),Ee={name:"Header",props:{title:{type:String,required:!0},image:{type:String,required:!1}},mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/carousel/carousel.component.js":()=>Promise.resolve().then(()=>Ko)}),"../../../assets/js/components/carousel/carousel.component.js").then(o=>{window.customElements.get("iam-carousel")||window.customElements.define("iam-carousel",o.default)}).catch(o=>{console.log(o.message)})})}};function qe(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-carousel",null,[s.renderSlot(o.$slots,"default")])}const $e=k(Ee,[["render",qe]]),Te={name:"Header",props:{title:{type:String,required:!0},image:{type:String,required:!1}},mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/header/header.component.js":()=>Promise.resolve().then(()=>Qo),"../../../assets/js/components/header/header.component.min.js":()=>Promise.resolve().then(()=>tr)}),"../../../assets/js/components/header/header.component.js").then(o=>{window.customElements.get("iam-header")||window.customElements.define("iam-header",o.default)}).catch(o=>{console.log(o.message)})})}},Ce=["image"],Me=["innerHTML"];function He(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-header",{image:t.image},[s.renderSlot(o.$slots,"breadcrumb"),t.title?(s.openBlock(),s.createElementBlock("h1",{key:0,innerHTML:t.title},null,8,Me)):s.createCommentVNode("",!0),s.renderSlot(o.$slots,"default")],8,Ce)}const Re=k(Te,[["render",He]]);function je(o){var e;const t=o.querySelector(".testimonial__images"),r=t.querySelectorAll("img").length;if(r==1)return!1;o.classList.add("testimonial--multi");const i=function(l){const a=o.querySelector(".btn-next"),n=o.querySelector(".btn-prev");a.setAttribute("data-go",l+1),n.setAttribute("data-go",l-1),a.removeAttribute("disabled"),n.removeAttribute("disabled"),l==1?n.setAttribute("disabled",!0):l==r&&a.setAttribute("disabled",!0)};t.addEventListener("scroll",function(l){clearTimeout(e),e=setTimeout(function(){let a=t.scrollWidth,n=t.scrollHeight,d=t.scrollLeft,c=t.scrollTop,m=Math.round(d/a*r)+1;d==0&&c!=0&&(m=Math.round(c/n*r)+1),o.setAttribute("data-show",m),i(m)},300)},!1),o.addEventListener("click",function(l){for(var a=l.target;a&&a!=this;a=a.parentNode)if(a.matches("[data-go]")){let n=parseInt(a.getAttribute("data-go")),d=0,c=0,m=t.scrollWidth,u=t.scrollHeight;m>u?c=Math.floor(m*((n-1)/r)):d=Math.floor(u*((n-1)/r)),t.scroll({top:d,left:c,behavior:"smooth"});break}},!1)}const Br="",Be={name:"Testimonial",props:{items:{type:Array,required:!0},background:{type:String,default:"light",required:!1}},mounted(){je(this.$refs.wrapper)}},Ne={class:"container testimonial mb-5","data-show":"1",ref:"wrapper"},ze={class:"row"},De={class:"col-md-5 position-relative"},Ve={class:"testimonial__images"},Pe=["src"],Fe=s.createElementVNode("div",{class:"testimonial__controls"},[s.createElementVNode("button",{"data-go":"0",disabled:"",class:"btn-prev"},"Previous"),s.createElementVNode("button",{"data-go":"2",class:"btn-next"},"Next")],-1),Oe={class:"col-md-7"},Ie=s.createElementVNode("h2",null,"What our customers think…",-1),We={class:"testimonial__content"},Ue=["innerHTML"],Ge=["innerHTML"],Ye={class:"testimonial__after"},Xe=s.createElementVNode("span",{class:"circle circle--dots d-none d-md-block"},null,-1);function Ke(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",Ne,[s.createElementVNode("div",{class:s.normalizeClass("bg-"+t.background)},[s.createElementVNode("div",ze,[s.createElementVNode("div",De,[s.createElementVNode("div",Ve,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,(a,n)=>(s.openBlock(),s.createElementBlock("img",{key:n,src:a.image?a.image:"data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"",class:s.normalizeClass("h-100 w-100 object-cover"+(a.image?"":" opacity-0"))},null,10,Pe))),128))]),Fe]),s.createElementVNode("div",Oe,[Ie,s.createElementVNode("div",We,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,(a,n)=>(s.openBlock(),s.createElementBlock("blockquote",{key:n,class:s.normalizeClass(a.class)},[s.createElementVNode("div",{innerHTML:a.quote},null,8,Ue),s.createElementVNode("cite",{innerHTML:a.cite},null,8,Ge)],2))),128))]),s.createElementVNode("div",Ye,[s.renderSlot(o.$slots,"default")])])]),Xe],2)],512)}const Je=k(Be,[["render",Ke]]),Nr="",Qe={name:"Timeline",props:{image:{type:String,required:!1}}},Ze={class:"timeline"},ta={class:"timeline__content"},ea=["src"];function aa(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",Ze,[s.createElementVNode("div",ta,[s.renderSlot(o.$slots,"default")]),t.image?(s.openBlock(),s.createElementBlock("img",{key:0,src:t.image,alt:""},null,8,ea)):s.createCommentVNode("",!0)])}const oa=k(Qe,[["render",aa]]),zr="",ra={components:{Input:z},name:"PropertySearchbar",props:{formaction:{type:String,required:!1},formmethod:{type:String,required:!1},location:{type:String,required:!1},locations:{type:Array,required:!1},distances:{type:Array,required:!1,default(){return[{value:"0.25",display:"+¼ mi"},{value:"0.5",display:"+½ mi"},{value:"1",display:"+1 mi"},{value:"2",display:"+2 mi"},{value:"3",display:"+3 mi"},{value:"4",display:"+4 mi"},{value:"5",display:"+5 mi"}]}},pricemin:{type:Array,required:!1,default(){return[{value:"0",display:"No min"},{value:"50000",display:"£50k min"},{value:"75000",display:"£75k min"},{value:"100000",display:"£100k min"},{value:"150000",display:"£150k min"},{value:"200000",display:"£200k min"},{value:"250000",display:"£250k min"}]}},pricemax:{type:Array,required:!1,default(){return[{value:"any",display:"No max"},{value:"50000",display:"£50k max"},{value:"75000",display:"£75k max"},{value:"100000",display:"£100k max"},{value:"150000",display:"£150k max"},{value:"200000",display:"£200k max"},{value:"250000",display:"£250k max"}]}},bedsmin:{type:Array,required:!1,default(){return[{value:"any",display:"No min"},{value:"0",display:"Studio min"},{value:"1",display:"1 bed min"},{value:"2",display:"2 beds min"},{value:"3",display:"3 beds min"},{value:"4",display:"4 beds min"},{value:"5",display:"5 beds min"},{value:"6",display:"6 beds min"}]}},bedsmax:{type:Array,required:!1,default(){return[{value:"any",display:"No max"},{value:"0",display:"Studio max"},{value:"1",display:"1 bed max"},{value:"2",display:"2 beds max"},{value:"3",display:"3 beds max"},{value:"4",display:"4 beds max"},{value:"5",display:"5 beds max"},{value:"6",display:"6 beds max"}]}},propertytypes:{type:Array,required:!1,default(){return[{value:"all",display:"Show all"},{value:"Bungalow",display:"Bungalow"},{value:"Character Property",display:"Character Property"},{value:"Commercial Property",display:"Commercial Property"},{value:"Flat / Apartment",display:"Flat / Apartment"},{value:"Garage / Parking",display:"Garage / Parking"},{value:"Guest House / Hotel",display:"Guest House / Hotel"},{value:"House",display:"House"},{value:"House / Flat Share",display:"House / Flat Share"},{value:"Land",display:"Land"},{value:"Mobile / Park Home",display:"Mobile / Park Home"},{value:"Private Halls",display:"Private Halls"},{value:"Retirement Property",display:"Retirement Property"}]}}},data(){return{locationSave:""}},methods:{locationKeyup:function(o){this.$emit("locationKeyup",o)}},computed:{locationSet:{get(){return this.locationSave?this.locationSave:this.location},set(o){this.locationSave=o,this.$emit("input",o)}},locationsList(){return()=>this.locations?this.locations:[{value:"Newcastle"}]}}},na={class:"container",ref:"wrapper"},ia={class:"property-searchbar"},sa=["action","method"],la={class:"col-12 col-md-3"},ca={class:"col-12 col-md"},da=s.createElementVNode("span",{class:"form-label d-none d-md-block"},"Price range",-1),ma={class:"row","data-input-range":""},ua={class:"col-12 col-md"},pa=s.createElementVNode("span",{class:"form-label d-none d-md-block"},"Number of beds",-1),ha={class:"row","data-input-range":""},ba={class:"col-12 col-md-2"},fa=s.createElementVNode("div",{class:"col-12 col-md mw-md-fit-content d-flex property-searchbar__btn"},[s.createElementVNode("button",{class:"btn w-100 me-0",type:"submit",value:"submit"},"Search")],-1);function ga(o,e,t,r,i,l){const a=s.resolveComponent("Input");return s.openBlock(),s.createElementBlock("div",na,[s.renderSlot(o.$slots,"default"),s.createElementVNode("div",ia,[s.createElementVNode("form",{class:"row",action:t.formaction,method:t.formmethod},[s.createElementVNode("fieldset",la,[s.createVNode(a,{inputClass:"input--locations",modelValue:l.locationSet,"onUpdate:modelValue":e[0]||(e[0]=n=>l.locationSet=n),label:"Location",id:"location",options:l.locationsList(),required:"",placeholder:"i.e. Newcastle or NE1",onKeyupEvent:e[1]||(e[1]=n=>l.locationKeyup(...arguments)),ref:"search"},null,8,["modelValue","options"]),s.createVNode(a,{class:"select--miles",label:"Miles",id:"miles",type:"select",options:t.distances},null,8,["options"])]),s.createElementVNode("fieldset",ca,[da,s.createElementVNode("div",ma,[s.createVNode(a,{class:"col-6",label:"Minimum price",id:"price-min","data-min":"true",type:"select",options:t.pricemin},null,8,["options"]),s.createVNode(a,{class:"col-6",label:"Maximum price",id:"price-max","data-max":"true",type:"select",options:t.pricemax},null,8,["options"])])]),s.createElementVNode("fieldset",ua,[pa,s.createElementVNode("div",ha,[s.createVNode(a,{class:"col-6",label:"Minimum beds",id:"beds-min","data-min":"true",type:"select",options:t.bedsmin},null,8,["options"]),s.createVNode(a,{class:"col-6",label:"Maximum beds",id:"beds-max","data-max":"true",type:"select",options:t.bedsmax},null,8,["options"])])]),s.createElementVNode("fieldset",ba,[s.createVNode(a,{label:"Property type",id:"property-type",type:"select",options:t.propertytypes},null,8,["options"])]),fa],8,sa)]),s.renderSlot(o.$slots,"after")],512)}const ya=k(ra,[["render",ga]]),va={components:{},name:"Nav",mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/nav/nav.component.js":()=>Promise.resolve().then(()=>ar),"../../../assets/js/components/nav/nav.component.min.js":()=>Promise.resolve().then(()=>or)}),"../../../assets/js/components/nav/nav.component.js").then(o=>{window.customElements.get("iam-nav")||window.customElements.define("iam-nav",o.default)}).catch(o=>{console.log(o.message)})})},methods:{}},wa={ref:"wrapper"};function Aa(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-nav",wa,[s.renderSlot(o.$slots,"default")],512)}const ka=k(va,[["render",Aa]]),Dr="",_a={name:"Stepper",props:{label:{type:String,required:!1},endlabel:{type:String,required:!1,default:"Complete"}}},xa={class:"container"},La=["aria-label"],Sa={key:0,class:"h6 stepper__start"},Ea={class:"list-unstyled"},qa={class:"h6 stepper__end"};function $a(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",xa,[s.createElementVNode("nav",{class:"stepper","aria-label":t.label?t.label:"Progress"},[t.label?(s.openBlock(),s.createElementBlock("span",Sa,s.toDisplayString(t.label),1)):s.createCommentVNode("",!0),s.createElementVNode("ol",Ea,[s.renderSlot(o.$slots,"default")]),s.createElementVNode("span",qa,s.toDisplayString(t.endlabel),1)],8,La)])}const Ta=k(_a,[["render",$a]]),Vr="",Ca={name:"Snapshot",props:{items:{type:Array,required:!0}}},Ma={class:"container snapshot",ref:"wrapper"},Ha={class:"row"},Ra=["href"],ja={class:"lead snapshot__title"},Ba={class:"stat"};function Na(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("div",Ma,[s.renderSlot(o.$slots,"default"),s.createElementVNode("div",Ha,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,(a,n)=>(s.openBlock(),s.createElementBlock("div",{class:"col",key:n},[a.link?(s.openBlock(),s.createElementBlock("a",{key:0,href:a.link},"View "+s.toDisplayString(a.title),9,Ra)):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(`snapshot__item ${a.bg?"bg-"+a.bg:""}`)},[s.createElementVNode("span",ja,s.toDisplayString(a.title),1),s.createElementVNode("span",Ba,s.toDisplayString(a.number),1)],2)]))),128))])],512)}const za=k(Ca,[["render",Na]]),Da={name:"Stepper",props:{url:{type:String,required:!1},status:{type:String,required:!1},current:{type:String,required:!1}}},Va=["href","aria-current"],Pa={key:0,class:"visually-hidden"};function Fa(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("li",null,[s.createElementVNode("a",{href:t.url,class:s.normalizeClass(`${t.status?"bg-"+t.status:""}${typeof t.current<"u"?"current":""}`),"aria-current":typeof t.current<"u"?"step":!1},[s.createElementVNode("span",null,[s.renderSlot(o.$slots,"default")]),t.status?(s.openBlock(),s.createElementBlock("em",Pa," - status: "+s.toDisplayString(t.status),1)):s.createCommentVNode("",!0)],10,Va)])}const Oa=k(Da,[["render",Fa]]),Pr="",Ia={name:"Tabs",mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/tabs/tabs.component.js":()=>Promise.resolve().then(()=>cr),"../../../assets/js/components/tabs/tabs.component.min.js":()=>Promise.resolve().then(()=>br)}),"../../../assets/js/components/tabs/tabs.component.js").then(o=>{window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",o.default)}).catch(o=>{console.log(o.message)})})}},Wa={ref:"wrapper"};function Ua(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-tabs",Wa,[s.renderSlot(o.$slots,"default")],512)}const Ga=k(Ia,[["render",Ua]]),Ya={name:"Tab",props:{title:{type:String,required:!0},lazy:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1}},data(){return{show:!this.lazy,isDisabled:!!this.disabled}}},Xa={class:"tab"},Ka=["innerHTML"];function Ja(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("details",Xa,[s.createElementVNode("summary",{innerHTML:t.title,class:s.normalizeClass({disabled:i.isDisabled})},null,10,Ka),s.renderSlot(o.$slots,"default")])}const Qa=k(Ya,[["render",Ja]]);let K=N.props;K.fields.required=!1;const Za={components:{Table:N,Input:z},data(){return{itemsData:[...this.items]}},methods:{submitForm:function(o){console.log(this);const e=new FormData(o.target);let t=new Date;const r=t.getFullYear();let i=t.getMonth()+1,l=t.getDate();l<10&&(l="0"+l),i<10&&(i="0"+i),t=l+"/"+i+"/"+r,this.itemsData.unshift({date_added:t,user:e.get("user"),note:e.get("addNote")}),this.$emit("formSubmitted",o)}},name:"NoteFeed",props:{user:{type:String,required:!0},...K,title:{type:String,required:!1},method:{type:String,required:!1,default:"post"},action:{type:String,required:!1}}},to={class:"container note-feed mb-2"},eo=["innerHTML"],ao=["action","method"],oo=["value"],ro=s.createElementVNode("button",{class:"btn btn-tertiary"},"Submit note",-1);function no(o,e,t,r,i,l){const a=s.resolveComponent("Table"),n=s.resolveComponent("Input");return s.openBlock(),s.createElementBlock("div",to,[t.title?(s.openBlock(),s.createElementBlock("span",{key:0,class:"h3",innerHTML:t.title},null,8,eo)):s.createCommentVNode("",!0),s.createVNode(a,s.mergeProps({fields:[{key:"date_added"},{key:"user"},{key:"note"}],items:i.itemsData},o.$props,{class:"mb-0"}),null,16,["items"]),s.createElementVNode("form",{action:t.action,method:t.method,onSubmit:e[0]||(e[0]=s.withModifiers(d=>l.submitForm(...arguments),["prevent"]))},[s.createElementVNode("input",{type:"hidden",value:t.user,name:"user"},null,8,oo),s.createVNode(n,{id:"addNote",type:"textarea",label:"Add note",required:"",class:"mw-100"}),ro],40,ao)])}const io=k(Za,[["render",no]]);/*!
|
|
91
|
-
* iamKey v5.
|
|
91
|
+
* iamKey v5.2.0
|
|
92
92
|
* Copyright 2022-2023 iamproperty
|
|
93
93
|
*/function so(o,e){function t(r,i){let l=!1,a=i.getAttribute("name");a.includes("[]")&&(a=a.replace("[]",`[${i.value}]`));let n=r.querySelector(`[data-name="${a}"]`);n&&i.getAttribute("type")=="checkbox"&&(l=!i.checked);let d=i.getAttribute("data-filter-text");if(n||(n=document.createElement("button"),r.appendChild(n)),n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",a),n.innerHTML=d.replace("$value",i.value),(!i.value||l)&&n.remove(),i.parentNode.closest("[data-filter-text]")){let c=i.parentNode.closest("[data-filter-text]"),m=!0;if(a="",c.querySelectorAll("input").forEach((u,p)=>{let b=u.getAttribute("name");if(a+=`${p!=0?",":""}${b}`,r.querySelector(`[data-name="${b}"]`)&&r.querySelector(`[data-name="${b}"]`).remove(),u.value){let h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",b),h.innerHTML=d.replace("$value",u.value),r.appendChild(h)}else m=!1}),r.querySelector(`[data-name="${a}"]`)&&r.querySelector(`[data-name="${a}"]`).remove(),m){let u=c.getAttribute("data-filter-text");c.querySelectorAll("input").forEach((b,h)=>{let f=b.getAttribute("name");r.querySelector(`[data-name="${f}"]`)&&r.querySelector(`[data-name="${f}"]`).remove(),u=u.replace(`$${h+1}`,b.value)});let p=document.createElement("button");p.setAttribute("type","button"),p.classList.add("filter"),p.setAttribute("data-name",a),p.innerHTML=u,r.appendChild(p)}}}Array.from(o.querySelectorAll('input[type="checkbox"]:checked')).forEach((r,i)=>{t(e,r)}),Array.from(o.querySelectorAll("input[data-filter-text]")).forEach((r,i)=>{r.addEventListener("change",function(l){t(e,r),l.stopPropagation()})}),o.addEventListener("change",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest("input[data-filter-text]")){let i=r.target.closest("input[data-filter-text]");t(e,i)}}),e.addEventListener("click",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest(".filter")){let a=r.target.closest(".filter"),n=a.getAttribute("data-name").split(",");for(var i=0;i<n.length;i++){let d=n[i],c=`[name="${d}"]`;d.match(/\[(.*)\]/)&&(d.replace(/\[(.*)\]/,"[]"),c=`[value="${d.replace(/.*\[(.*)\]/,"$1")}"]`);let m=o.querySelectorAll(c);for(var l=0;l<m.length;l++){let u=m[l];if(u.getAttribute("type")!="radio"&&u.getAttribute("type")!="checkbox")u.value="";else{u.checked=!1;var r=new Event("force");o.hasAttribute("data-nosubmit")||u.closest("form").dispatchEvent(r)}}}a.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});let lo=class 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`;let r=this.classList.toString();const i=document.createElement("template");i.innerHTML=`
|
|
94
94
|
<style>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
<div class="applied-filters ${r}"></div>
|
|
101
101
|
<slot></slot>
|
|
102
102
|
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){so(this,this.shadowRoot.querySelector(".applied-filters"))}};window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",lo);const co={name:"Header"};function mo(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-applied-filters",null,[s.renderSlot(o.$slots,"default")])}const uo=k(co,[["render",mo]]);/*!
|
|
103
|
-
* iamKey v5.
|
|
103
|
+
* iamKey v5.2.0
|
|
104
104
|
* Copyright 2022-2023 iamproperty
|
|
105
105
|
*/function po(o,e){ho(o,e)}function ho(o,e){var t;e.addEventListener("keyup",r=>{clearTimeout(t),t=setTimeout(function(){J(o,e.value)},500)}),e.addEventListener("change",r=>{clearTimeout(t),J(o,e.value)})}const J=function(o,e){Array.from(o.querySelectorAll(":scope > li")).forEach((t,r)=>{let i=t.textContent.toLowerCase();t.classList.add("d-none"),i.includes(e.toLowerCase())&&t.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:e})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class bo 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`,r=document.createElement("template");r.innerHTML=`
|
|
106
106
|
<style>
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
${this.hasAttribute("data-dismiss")?'<div class="notification__dismiss"><button data-dismiss-button>Dismiss</button></div>':""}
|
|
143
143
|
</div>
|
|
144
144
|
`,this.shadowRoot.appendChild(a.content.cloneNode(!0)),document.getElementById("notificationHolder")||document.head.insertAdjacentHTML("beforeend",`<style id="notificationHolder">${i}</style>`)}connectedCallback(){const e=this.shadowRoot.querySelector("[data-dismiss-button]"),t=this.hasAttribute("data-status")?this.getAttribute("data-status"):"white";this.hasAttribute("data-type")?this.classList.add(`bg-${t}`):this.classList.add(`colour-${t}`);const r=this;if(!this.querySelector("i"))switch(t){case"danger":this.innerHTML+='<i class="fa-solid fa-circle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"warning":this.innerHTML+='<i class="fa-solid fa-triangle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"success":this.innerHTML+='<i class="fa-solid fa-check-circle" aria-hidden="true" slot="icon"></i>';break;default:this.innerHTML+='<i class="fa-solid fa-circle-info" aria-hidden="true" slot="icon"></i>'}vo(r),e&&e.addEventListener("click",function(i){D(r)},!1)}}const ko={name:"Notification",props:{},created(){this.$nextTick(function(){window.customElements.get("iam-notification")||window.customElements.define("iam-notification",Ao)})}};function _o(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-notification",null,[s.renderSlot(o.$slots,"default")])}const xo=k(ko,[["render",_o]]),Lo={name:"Actionbar",props:{},mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/actionbar/actionbar.component.js":()=>Promise.resolve().then(()=>wr),"../../../assets/js/components/actionbar/actionbar.component.min.js":()=>Promise.resolve().then(()=>Lr)}),"../../../assets/js/components/actionbar/actionbar.component.js").then(o=>{window.customElements.get("iam-actionbar")||window.customElements.define("iam-actionbar",o.default)}).catch(o=>{console.log(o.message)})})}};function So(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-actionbar",null,[s.renderSlot(o.$slots,"default")])}const Eo=k(Lo,[["render",So]]),qo={name:"Pagination",props:{},computed:{},created(){this.$nextTick(function(){window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",X)})},updated(){}};function $o(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-pagination")}const To=k(qo,[["render",$o]]),Co={name:"Address Lookup",mounted(){this.$nextTick(function(){$(Object.assign({"../../../assets/js/components/address-lookup/address-lookup.component.js":()=>Promise.resolve().then(()=>qr),"../../../assets/js/components/address-lookup/address-lookup.component.min.js":()=>Promise.resolve().then(()=>Tr)}),"../../../assets/js/components/address-lookup/address-lookup.component.js").then(o=>{window.customElements.get("iam-address-lookup")||window.customElements.define("iam-address-lookup",o.default)}).catch(o=>{console.log(o.message)})})}};function Mo(o,e,t,r,i,l){return s.openBlock(),s.createElementBlock("iam-address-lookup",null,[s.renderSlot(o.$slots,"default")])}const Ho=k(Co,[["render",Mo]]);/*!
|
|
145
|
-
* iamKey v5.
|
|
145
|
+
* iamKey v5.2.0
|
|
146
146
|
* Copyright 2022-2023 iamproperty
|
|
147
147
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class Ro 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`,r=document.createElement("template");r.innerHTML=`
|
|
148
148
|
<style class="styles">
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
<slot></slot>
|
|
177
177
|
</div>
|
|
178
178
|
`,this.shadowRoot.appendChild(l.content.cloneNode(!0)),document.getElementById("accordionGlobal")||document.head.insertAdjacentHTML("beforeend",`<style id="accordionGlobal">${i}</style>`)}connectedCallback(){zo(this)}}const Vo=Object.freeze(Object.defineProperty({__proto__:null,default:Do},Symbol.toStringTag,{value:"Module"}));/*!
|
|
179
|
-
* iamKey v5.
|
|
179
|
+
* iamKey v5.2.0
|
|
180
180
|
* Copyright 2022-2023 iamproperty
|
|
181
181
|
*/function Po(o){let e=o.querySelectorAll("details"),t=o.querySelectorAll("summary");if(e.forEach(r=>{r.classList.add("accordion-item")}),t.forEach(r=>{r.classList.add("accordion-header"),r.classList.add("accordion-button"),r.classList.add("h4")}),!o.classList.contains("accordion--keep-open")){const r=o.querySelectorAll(":scope > details");r.forEach(i=>{i.addEventListener("click",()=>{r.forEach(l=>{l!==i&&l.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class Fo 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`,r=document.createElement("template");r.innerHTML=`
|
|
182
182
|
<style>
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
${this.hasAttribute("data-cta")?`<div class="card__footer"><span class="link">${this.getAttribute("data-cta")}</span></div>`:""}
|
|
209
209
|
</div>
|
|
210
210
|
`,this.shadowRoot.appendChild(a.content.cloneNode(!0)),document.getElementById("cardGlobal")||document.head.insertAdjacentHTML("beforeend",`<style id="cardGlobal">${l}</style>`)}connectedCallback(){this.classList.add("loaded");const e=this.parentNode.closest("a, button, label"),t=this.shadowRoot.querySelector(".card");e.setAttribute("tabindex","-1"),e.matches("label[for]")&&(document.getElementById(e.getAttribute("for")).checked?t.classList.add("checked"):t.classList.remove("checked")),this.addEventListener("click",r=>{let i=new Event("click");t.dispatchEvent(i)}),t.addEventListener("click",r=>{if(e.matches("label[for]")){r.stopPropagation(),r.preventDefault();const i=document.getElementById(e.getAttribute("for")),l=i.getAttribute("name"),a=i.getAttribute("id");Array.from(document.querySelectorAll(`[name="${l}"][type="radio"]:not([id="${a}"])`)).forEach((c,m)=>{document.querySelector(`[for="${c.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),e.click(),i.checked?t.classList.add("checked"):t.classList.remove("checked")}}),this.addEventListener("inactive",r=>{t.classList.remove("checked")}),t.addEventListener("keydown",r=>{switch(r.keyCode){case 32:case 13:if(e.matches("label[for]")){r.stopPropagation(),r.preventDefault();const i=document.getElementById(e.getAttribute("for")),l=i.getAttribute("name"),a=i.getAttribute("id");Array.from(document.querySelectorAll(`[name="${l}"]:not([id="${a}"])`)).forEach((c,m)=>{document.querySelector(`[for="${c.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),e.click(),i.checked?t.classList.add("checked"):t.classList.remove("checked")}else e.click();break}})}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(e,t,r){switch(e){case"data-total":{this.shadowRoot.querySelector(".card__total")&&(this.shadowRoot.querySelector(".card__total").innerHTML=r);break}case"class":{let i=this.classList.toString();this.querySelector('[class*="fa-"]')&&(i+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class",`card ${i}`);break}}}}const Wo=Object.freeze(Object.defineProperty({__proto__:null,default:Io},Symbol.toStringTag,{value:"Module"}));/*!
|
|
211
|
-
* iamKey v5.
|
|
211
|
+
* iamKey v5.2.0
|
|
212
212
|
* Copyright 2022-2023 iamproperty
|
|
213
213
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class Uo extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let e=this.classList.toString();const t=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"):`${t}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
214
214
|
<style>
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
</div>
|
|
268
268
|
</div>
|
|
269
269
|
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){this.classList.add("bg-primary");const e=this.shadowRoot.querySelector("picture"),t=this.shadowRoot.querySelector("picture img");this.hasAttribute("image")?t.setAttribute("src",this.getAttribute("image")):e.remove()}}const Qo=Object.freeze(Object.defineProperty({__proto__:null,default:Jo},Symbol.toStringTag,{value:"Module"}));/*!
|
|
270
|
-
* iamKey v5.
|
|
270
|
+
* iamKey v5.2.0
|
|
271
271
|
* Copyright 2022-2023 iamproperty
|
|
272
272
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class Zo 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`,r=document.createElement("template");r.innerHTML=`
|
|
273
273
|
<style>
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
</div>
|
|
328
328
|
</div>
|
|
329
329
|
</dialog>`);let n=this.shadowRoot.querySelector("#search-button"),d=this.shadowRoot.querySelector("#search-close"),c=this.shadowRoot.querySelector("#search-dialog");this.hasAttribute("data-search-open")&&(c.setAttribute("open","open"),this.classList.add("search-open"),n.setAttribute("aria-expanded",!0)),n.addEventListener("click",m=>{c.setAttribute("open","open"),this.classList.add("search-open"),n.setAttribute("aria-expanded",!0)}),d.addEventListener("click",m=>{c.removeAttribute("open"),this.classList.remove("search-open"),n.removeAttribute("aria-expanded")})}}}const ar=Object.freeze(Object.defineProperty({__proto__:null,default:er},Symbol.toStringTag,{value:"Module"}));/*!
|
|
330
|
-
* iamKey v5.
|
|
330
|
+
* iamKey v5.2.0
|
|
331
331
|
* Copyright 2022-2023 iamproperty
|
|
332
332
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});const or=Object.freeze(Object.defineProperty({__proto__:null,default:class extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"}),t=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"):`${t}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
333
333
|
<style class="styles">
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
<slot></slot>
|
|
392
392
|
</div>
|
|
393
393
|
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){let e=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class",`tabs ${e}`),sr(this)}}const cr=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"}));/*!
|
|
394
|
-
* iamKey v5.
|
|
394
|
+
* iamKey v5.2.0
|
|
395
395
|
* Copyright 2022-2023 iamproperty
|
|
396
396
|
*/const dr=function(o){o.querySelectorAll(":scope > details");const e=o.querySelectorAll(":scope > details, :scope > a");o.querySelectorAll(":scope > details > summary");let t=o.querySelector(":scope > .tabs__links");if(o.shadowRoot&&o.shadowRoot.querySelector(".tabs__links")&&(t=o.shadowRoot.querySelector(".tabs__links")),!t){t=document.createElement("div"),t.classList.add("tabs__links");let i=document.createElement("div");i.classList.add("tabs__links__wrapper"),i.prepend(t),o.prepend(i)}let r=0;e.forEach((i,l)=>{let a=document.createElement("button");if(i.matches("details")){let n=i.querySelector(":scope > summary"),d=n.classList.contains("disabled");n.classList.add("visually-hidden"),i.hasAttribute("id")&&a.setAttribute("data-id",`${i.getAttribute("id")}`),i.hasAttribute("open")&&a.setAttribute("aria-pressed",!0),a.innerHTML=`${n.innerText}`,a.classList.add("link"),a.setAttribute("data-index",r),i.setAttribute("tabindex","-1"),d&&a.classList.add("disabled"),r++}else i.matches("a")&&(a=i);a.classList.add("link"),t.appendChild(a)})},mr=function(o){let e=o.querySelectorAll(":scope > details"),t=o.querySelectorAll(":scope > details > summary"),r=o.querySelectorAll(":scope .tabs__links > button");o.shadowRoot&&(r=o.shadowRoot.querySelectorAll(".tabs__links > button")),r.forEach(i=>{i.addEventListener("click",l=>{if(l.preventDefault(),i.classList.contains("disabled"))return!1;r.forEach(a=>{let n=a==i;a.setAttribute("aria-pressed",n)}),e.forEach((a,n)=>{let d=i.getAttribute("data-index")==n;d?a.setAttribute("open",d):a.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:i.textContent})})}),t.forEach((i,l)=>{i.addEventListener("click",a=>{a.preventDefault(),r[l].click()})})},ur=function(o){if(!o.querySelector(":scope > details"))return!1;let e=o.querySelectorAll(":scope > details"),t=o.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&o.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(o.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),o.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):o.querySelector("details[open]")||(e[0].setAttribute("open",!0),t[0].setAttribute("aria-pressed",!0))},pr=function(o){dr(o),mr(o),ur(o)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class hr 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`,r=document.createElement("template");r.innerHTML=`
|
|
397
397
|
<style>
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
</div>
|
|
460
460
|
</div>
|
|
461
461
|
`,this.shadowRoot.appendChild(l.content.cloneNode(!0)),document.getElementById("actionbarGlobal")||document.head.insertAdjacentHTML("beforeend",`<style id="actionbarGlobal">${i}</style>`)}connectedCallback(){let e=this;const t=this.shadowRoot.querySelector(".actionbar__wrapper");if(this.hasAttribute("data-selectall")){t.insertAdjacentHTML("afterbegin",'<div class="selectall pb-0"><input type="checkbox" name="selectall" id="selectall"><label for="selectall" class="m-0">Select all</label></div>');let a=this.shadowRoot.querySelector(".selectall");this.hasAttribute("data-selected")&&Z(a,this.getAttribute("data-selected")),a.addEventListener("change",d=>{d&&d.target instanceof HTMLElement&&d.target.closest("input")&&(d.target.closest("input").checked?this.setAttribute("data-selected","all"):this.setAttribute("data-selected",0))});let n=this.querySelector("button[data-cancel]");n&&n.addEventListener("click",d=>{this.setAttribute("data-selected",0)})}if(this.hasAttribute("data-select-watch")){const a=document.getElementById(this.getAttribute("data-select-watch"));a.setAttribute("data-select-container","true"),Array.from(a.querySelectorAll('input[type="checkbox"]')).forEach((n,d)=>{n.parentElement.setAttribute("slot","checkbox")}),a.addEventListener("change",n=>{if(n&&n.target instanceof HTMLElement&&n.target.closest('[type="checkbox"]')){let d=a.querySelectorAll('input[type="checkbox"]').length,c=a.querySelectorAll('input[type="checkbox"]:checked').length;e.setAttribute("data-selected",d==c?"all":c),n.target.closest('[type="checkbox"]'),c?Array.from(a.querySelectorAll('input[type="checkbox"]')).forEach((m,u)=>{m.closest("iam-card")&&m.closest("iam-card").setAttribute("data-selected","true")}):Array.from(a.querySelectorAll('input[type="checkbox"]')).forEach((m,u)=>{m.closest("iam-card")&&m.closest("iam-card").removeAttribute("data-selected")})}})}if(this.hasAttribute("data-switchviews")){let a="";this.getAttribute("data-switchviews").split(",").forEach((c,m)=>{let u="fa-grid-2";c=="list"?u="fa-grip-lines":c=="small"&&(u="fa-bars"),a+=`<button class="btn btn-action btn-compact mb-0 fa-regular ${u}">${c}</button>`}),t.insertAdjacentHTML("afterbegin",`<div class="views m-0">${a}</div>`),this.shadowRoot.querySelector(".views").addEventListener("click",c=>{if(c&&c.target instanceof HTMLElement&&c.target.closest(".btn-action")){let m=c.target.closest(".btn-action");this.setAttribute("data-view",m.textContent);const u=new CustomEvent("switch-view",{detail:{view:m.textContent}});this.dispatchEvent(u)}})}const r=this.shadowRoot.querySelector(".actionbar--search");this.hasAttribute("data-search")&&this.getAttribute("data-search")=="show"&&r.classList.add("show");const i=this.shadowRoot.querySelector("button[data-search]");this.shadowRoot.addEventListener("click",a=>{a&&a.target instanceof HTMLElement&&a.target.closest("button[data-search]")&&(r.classList.toggle("show"),i.toggleAttribute("aria-expanded"))}),r.addEventListener("keyup",a=>{const n=new CustomEvent("search-keyup",{detail:{search:r.querySelector("input").value}});this.dispatchEvent(n)}),r.addEventListener("change",a=>{const n=new CustomEvent("search-change",{detail:{search:r.querySelector("input").value}});this.dispatchEvent(n)}),r.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("button.suffix")){const n=new CustomEvent("search-submit",{detail:{search:r.querySelector("input").value}});this.dispatchEvent(n)}}),Array.from(this.shadowRoot.querySelectorAll(".body")).forEach((a,n)=>{gr(a)});function l(){const a=t.scrollWidth,n=document.documentElement.scrollWidth;let d=750,c=16,m=e.hasAttribute("data-switchviews")?144:210,u=1;n>=992&&n<=1280?u=n/1280:n>=576&&n<=1280?u=n/768:n<576&&(u=n/375),a>=992&&a<=1280?d=d*u:a>=576&&a<=1280?d=450*u:a<576&&(d=m*u),c=c*u,a<576?Array.from(e.querySelectorAll(":scope > .btn:not(.js-updated)")).forEach((p,b)=>{p.className=p.className.replace(" btn-compact"," _btn-compact"),p.classList.add("btn-compact"),p.classList.add("js-updated")}):Array.from(e.querySelectorAll(":scope > .btn.js-updated")).forEach((p,b)=>{p.classList.remove("btn-compact"),p.classList.remove("js-updated"),p.className=p.className.replace(" _btn-compact"," btn-compact")}),Array.from(e.querySelectorAll("[slot]")).forEach((p,b)=>{p.getAttribute("slot")=="overflow"&&p.removeAttribute("slot"),p.getAttribute("slot")=="selected-overflow"&&p.setAttribute("slot","selected")}),Array.from(e.querySelectorAll(".show")).forEach((p,b)=>{p.classList.remove("show")}),Array.from(e.shadowRoot.querySelectorAll(".safe-area")).forEach((p,b)=>{let h="overflow";p.querySelector("slot").hasAttribute("name")&&p.querySelector("slot").getAttribute("name")=="selected"&&(h="selected-overflow");let f=p.querySelector("slot").assignedElements(),y=44*u;e.hasAttribute("data-search")&&(y+=44*u);for(let g=0;g<f.length;g++)!f[g].classList.contains("btn-action")&&!f[g].classList.contains("dialog__wrapper")&&(y+=f[g].offsetWidth,y+=c);for(let g=0;g<f.length;g++)if(f[g].classList.contains("dialog__wrapper")&&(f[g].classList.add("show"),y+=f[g].offsetWidth,y+=c/2,y-c/2>d)){f[g].classList.remove("show");break}for(let g=0;g<f.length;g++)if(f[g].classList.contains("btn-action")&&(f[g].classList.add("show"),y+=f[g].offsetWidth,y+=c/2,y-c/2>d)){f[g].classList.remove("show");break}let v=p.querySelector(".dialog-overflow");v&&v.classList.add("d-none");for(let g=0;g<f.length;g++)(f[g].classList.contains("btn-action")||f[g].classList.contains("dialog__wrapper"))&&(f[g].classList.contains("show")||(f[g].setAttribute("slot",h),v&&v.classList.remove("d-none")))})}l(),new ResizeObserver(l).observe(t)}static get observedAttributes(){return["data-selected"]}attributeChangedCallback(e,t,r){switch(e){case"data-selected":{let i=this.shadowRoot.querySelector(".selectall");i&&Z(i,r);const l=new CustomEvent("selected",{detail:{selected:r}});if(this.dispatchEvent(l),r=="all"&&this.hasAttribute("data-select-watch")){const a=document.getElementById(this.getAttribute("data-select-watch"));Array.from(a.querySelectorAll('input[type="checkbox"]')).forEach((n,d)=>{n.checked=!0,n.closest("iam-card")&&n.closest("iam-card").setAttribute("data-selected","true")})}if(r=="0"&&this.hasAttribute("data-select-watch")){const a=document.getElementById(this.getAttribute("data-select-watch"));Array.from(a.querySelectorAll('input[type="checkbox"]')).forEach((n,d)=>{n.checked=!1,n.closest("iam-card")&&n.closest("iam-card").removeAttribute("data-selected","true")})}break}}}}const wr=Object.freeze(Object.defineProperty({__proto__:null,default:vr},Symbol.toStringTag,{value:"Module"}));/*!
|
|
462
|
-
* iamKey v5.
|
|
462
|
+
* iamKey v5.2.0
|
|
463
463
|
* Copyright 2022-2023 iamproperty
|
|
464
464
|
*/const Ar=function(o){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=o.getAttribute("data-id"),t=o.getAttribute("id");if(typeof t>"u"||t==null){var r=String.fromCharCode(65+Math.floor(Math.random()*26));t=r+Date.now(),o.setAttribute("id",t)}function i(){window.player=new YT.Player(t,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:l,onStateChange:n}})}i();function l(d){d.target.playVideo()}var a=!1;function n(d){if(d.data==YT.PlayerState.PLAYING&&!a){var c=document.getElementById(t);c.classList.add("player-ready"),a=!0}}},kr=o=>(Array.from(o.querySelectorAll("dialog[open]")).forEach((e,t)=>{e.closest(".dialog__wrapper")||(e.removeAttribute("open"),e.showModal(),e.focus(),tt(e))}),o.addEventListener("click",e=>{if(e.target.tagName=="IAM-ACTIONBAR")return!1;if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-modal]")){const i=e.target.closest("[data-modal]"),l=i.hasAttribute("data-modal")?i.getAttribute("data-modal"):i.getAttribute("data-filter"),a=document.querySelector(`dialog#${l}`);tt(a),a.showModal(),a.focus();let n=a.offsetWidth;a.setAttribute("style",`max-width: ${n}px;`),Array.from(a.querySelectorAll("[data-duplicate]")).forEach((d,c)=>{const m=d.getAttribute("data-duplicate"),u=document.getElementById(m);if(d.checked!=u.checked){d.checked=u.checked;let p=new Event("change");d.dispatchEvent(p)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:l})}if(e&&e.target instanceof HTMLElement&&e.target.closest("button.dialog__close")){const i=e.target.closest("dialog[open]");e.preventDefault(),i.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((l,a)=>{l.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('button[formmethod="dialog"]')){const i=e.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((l,a)=>{l.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]")){let i=e.target.closest("dialog[open]");var t=window.getComputedStyle(i);if(t.display==="contents"&&(i=i.parentNode.closest("dialog[open]")),!i.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||i.classList.contains("dialog--multi")){const l=i.getBoundingClientRect();(e.clientX<l.left||e.clientX>l.right||e.clientY<l.top||e.clientY>l.bottom)&&(e.target.closest('input[type="radio"]')||i.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")}))}}if(e&&e.target instanceof HTMLElement&&e.target.closest(".dialog__wrapper > button")){e.stopPropagation();let i=e.target.closest(".dialog__wrapper > button"),l=e.target.closest(".dialog__wrapper > button").parentNode,a="openPopover",n=l.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,p)=>{u.removeAttribute("aria-expanded")}),n.hasAttribute("open"))n.close(),a="closePopover",n.removeAttribute("style"),i.removeAttribute("aria-expanded");else{n.show(),i.setAttribute("aria-expanded",!0);var r=i.getBoundingClientRect();let u=r.top,p=r.left;if(i.closest("iam-table")){let b=i.closest("iam-table").parentNode.getBoundingClientRect();u-=b.top,p-=b.left}n.classList.contains("dialog--fix")&&n.setAttribute("style",`position:fixed;top: ${u}px; left: ${p}px; margin: 3rem 0 0 0;`)}let d=n.getBoundingClientRect(),c=d.bottom-window.scrollY,m=window.innerHeight-window.scrollY;if(c>m){let u=n.hasAttribute("style")?n.getAttribute("style")+" ":"";n.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),d=n.getBoundingClientRect(),d.top-window.scrollY<100&&n.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:a,id:i.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((i,l)=>{i.removeAttribute("aria-expanded")}))}),null),tt=o=>{o.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!o.classList.contains("dialog--multi")&&o.addEventListener("cancel",t=>{t.preventDefault()});let e=o.querySelector(".youtube-embed a");if(e&&Ar(e),o.classList.contains("dialog--multi")&&!o.querySelector(":scope > .steps")&&_r(o),!o.querySelector(":scope > .mh-lg")&&!o.classList.contains("dialog--multi")){o.innerHTML=`<div class="mh-lg">${o.innerHTML}</div>`;let t=o.querySelector(".mh-lg"),r=o.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){let i=r.previousSibling;t.before(r),i&&r.before(i)}}o.querySelector(":scope > button:first-child")||o.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},_r=o=>{let e="",t=Array.from(o.querySelectorAll("fieldset[data-title]")),r=o.querySelector("form");t.forEach((a,n)=>{e+=`<button data-title="${a.getAttribute("data-title")}" type="button" class="${n==0?"active":""}" tabindex="-1">${a.getAttribute("data-title")}</button>`;const d=document.createElement("div");if(d.classList.add("btn--wrapper"),a.appendChild(d),n!=0&&(d.innerHTML+=`<button data-title="${t[n-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),n!=t.length-1&&(d.innerHTML+=`<button data-title="${t[n+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),n==t.length-1)if(r&&r.querySelector(':scope > button[type="submit"]')){let c=r.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),d.insertAdjacentElement("beforeend",c)}else d.innerHTML+=`<button data-title="${t[n].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),o.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${e}</div>`);let i=Array.from(o.querySelectorAll("fieldset.was-validated"));for(let a=0;a<i.length;a++){let n=i[a],d=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(o.querySelectorAll(`[data-title="${d}"]`)).forEach((c,m)=>{c.classList.add("active")});break}else Array.from(o.querySelectorAll(`[data-title="${d}"]`)).forEach((c,m)=>{c.classList.add("valid")})}o.addEventListener("invalid",function(){return function(a){a.preventDefault()}}(),!0);function l(a){const n=o.querySelector("fieldset.active")?o.querySelector("fieldset.active"):o.querySelector("fieldset[data-title]"),d=n.getAttribute("data-title");let c=!0;if(n.classList.add("was-validated"),Array.from(n.querySelectorAll("input")).forEach((p,b)=>{p.checkValidity()||(c=!1)}),c?Array.from(o.querySelectorAll(`[data-title="${d}"]`)).forEach((p,b)=>{p.classList.add("valid")}):Array.from(o.querySelectorAll(`[data-title="${d}"]`)).forEach((p,b)=>{p.classList.remove("valid")}),c||!a.hasAttribute("data-next")){const p=o.querySelector(`fieldset[data-title="${a.getAttribute("data-title")}"]`),b=o.querySelector(`.steps button[data-title="${a.getAttribute("data-title")}"]`);Array.from(o.querySelectorAll("button")).forEach((h,f)=>{h.classList.remove("active")}),Array.from(o.querySelectorAll("fieldset")).forEach((h,f)=>{h.classList.remove("active")}),b.classList.add("active"),p.classList.add("active")}let m=Array.from(o.querySelectorAll("fieldset")).length,u=Array.from(o.querySelectorAll("fieldset.valid")).length;o.style.setProperty("--progress",`${u/(m-1)*100}%`)}o.addEventListener("keydown",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("button")){const n=a.target.closest("button");a.keyCode==13&&n.getAttribute("type")!="submit"&&(a.preventDefault(),l(n))}a&&a.target instanceof HTMLElement&&a.target.closest("input")&&(a.target.closest("input").classList.remove("is-invalid"),a.keyCode==13&&a.preventDefault())}),o.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest('button[type="submit"]'))a.target.closest("form").classList.add("was-validated");else if(a&&a.target instanceof HTMLElement&&a.target.closest("button[data-title]")){const n=a.target.closest("button[data-title]");l(n)}return null})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"action bar"});function et(o,e){o&&e=="all"?(o.querySelector("input").indeterminate=!1,o.querySelector("input").checked=!0,o.querySelector("label").textContent="Select all"):o&&e==0?(o.querySelector("input").indeterminate=!1,o.querySelector("input").checked=!1,o.querySelector("label").textContent="Select all"):o&&e?(o.querySelector("input").indeterminate=!0,o.querySelector("input").checked=!1,o.querySelector("label").textContent=`${e} item${e>1?"s":""} selected`):o&&(o.querySelector("input").checked=!1,o.querySelector("input").indeterminate=!1,o.querySelector("label").textContent="Select all")}class xr 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`,r=document.createElement("template");r.innerHTML=`
|
|
465
465
|
<style>
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
<p><span class="pre-filled-address"></span><button class="text-primary text-decoration-none ms-1 cursor-pointer"><i class="fa-regular fa-pen-to-square"></i><span class="visually-hidden">Edit</span></button><slot name="prefilled"></slot></p>
|
|
545
545
|
</div>
|
|
546
546
|
</div>
|
|
547
|
-
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){return ot(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const e=this.shadowRoot.querySelector('[name="postcode"]'),t=this.shadowRoot.querySelector(".postcode-lookup"),r=this.shadowRoot.querySelector(".manual-address"),i=this.shadowRoot.querySelector(".pre-filled"),l=this.shadowRoot.querySelector("datalist"),a=this.shadowRoot.querySelector(".switch-to-manual-btn"),n=this.shadowRoot.querySelector(".switch-to-lookup-btn"),d=this.hasAttribute("data-title")?this.getAttribute("data-title"):"Property address",c=this.shadowRoot.querySelector(".pre-filled-address + button");Array.from(this.shadowRoot.querySelectorAll(".title")).forEach((b,h)=>{b.innerHTML=d});function m(b){let h=b.shadowRoot.querySelector(".pre-filled-address"),f=!0;h.innerHTML="",Array.from(b.querySelectorAll("input[required],input[data-required],select[required],select[data-required]")).forEach((y,v)=>{y.value?h.innerHTML+=", "
|
|
547
|
+
`,this.shadowRoot.appendChild(i.content.cloneNode(!0))}connectedCallback(){return ot(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const e=this.shadowRoot.querySelector('[name="postcode"]'),t=this.shadowRoot.querySelector(".postcode-lookup"),r=this.shadowRoot.querySelector(".manual-address"),i=this.shadowRoot.querySelector(".pre-filled"),l=this.shadowRoot.querySelector("datalist"),a=this.shadowRoot.querySelector(".switch-to-manual-btn"),n=this.shadowRoot.querySelector(".switch-to-lookup-btn"),d=this.hasAttribute("data-title")?this.getAttribute("data-title"):"Property address",c=this.shadowRoot.querySelector(".pre-filled-address + button");Array.from(this.shadowRoot.querySelectorAll(".title")).forEach((b,h)=>{b.innerHTML=d});function m(b){let h=b.shadowRoot.querySelector(".pre-filled-address"),f=!0;h.innerHTML="",Array.from(b.querySelectorAll("input[required],input[data-required],select[required],select[data-required]")).forEach((y,v)=>{const g=y.value;g?h.innerHTML+=g+(/^-?\d+$/.test(g)?" ":", "):f=!1}),h.innerHTML=h.innerHTML.slice(0,-2),f&&(i.classList.remove("js-hide"),t.classList.add("js-hide"),r.classList.add("js-hide"))}if(m(this),this.addEventListener("filled",b=>{m(this)}),this.hasAttribute("data-use")){let h=`<div><input type="checkbox" name="use" id="use" value="yes"><label for="use">${this.hasAttribute("data-use-label")?this.getAttribute("data-use-label"):"Use saved address"}</label></div>`;t.insertAdjacentHTML("afterbegin",h),this.shadowRoot.addEventListener("change",f=>{if(f&&f.target instanceof HTMLElement&&f.target.closest('[name="use"]')&&f.target.closest('[name="use"]').checked){t.classList.add("js-hide"),r.classList.remove("js-hide");let v=JSON.parse(this.getAttribute("data-use"));Object.keys(v).forEach((g,T)=>{let L=v[g];this.querySelector(`[data-name="${g}"]`)?this.querySelector(`[data-name="${g}"]`).value=L:this.querySelector(`[name="${g}"]`)&&(this.querySelector(`[name="${g}"]`).value=L)})}})}function u(){t.classList.add("js-hide"),r.classList.remove("js-hide"),Array.from(r.querySelectorAll("[data-required]")).forEach((b,h)=>{b.setAttribute("required","true")}),r.scrollIntoView()}c.addEventListener("click",b=>{i.classList.add("js-hide"),u()}),a.addEventListener("click",b=>{u()}),n.addEventListener("click",b=>{t.classList.remove("js-hide"),r.classList.add("js-hide"),t.scrollIntoView()}),e.addEventListener("keyup",b=>{e.value.length>=3&&p(e.value)}),e.addEventListener("change",b=>{if(e.value.length>=3&&(p(e.value),l.querySelector(`[value="${e.value}"]`))){t.classList.add("js-hide"),r.classList.remove("js-hide");let h=JSON.parse(l.querySelector(`[value="${e.value}"]`).getAttribute("data-values"));Object.keys(h).forEach((f,y)=>{let v=h[f];this.querySelector(`[data-name="${f}"]`)?this.querySelector(`[data-name="${f}"]`).value=v:this.querySelector(`[name="${f}"]`)&&(this.querySelector(`[name="${f}"]`).value=v)}),this.querySelector('[data-name="address_1"]').focus(),Array.from(this.querySelectorAll("[data-required]")).forEach((f,y)=>{f.setAttribute("required","true")}),e.removeAttribute("required"),this.shadowRoot.querySelector('[name="use"]')&&(this.shadowRoot.querySelector('[name="use"]').checked=!1)}});const p=b=>ot(this,void 0,void 0,function*(){let h=this.getAttribute("data-url");h+=`${encodeURI(b)}`,window.controller||(window.controller=[]),window.controller[h]&&window.controller[h].abort(),window.controller[h]=new AbortController;const{signal:f}=controller[h];try{yield fetch(h,{signal:f,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":at.get("XSRF-TOKEN")})}).then(y=>y.json()).then(y=>{let v="";return y.forEach((g,T)=>{if(typeof g.value=="object"){let L=JSON.stringify(g.value);v+=`<option value="${g.label}, ${b}" data-values='${L}'></option>`}else{let L=JSON.stringify(g),_="";for(const[x,w]of Object.entries(g))x=="address_number_name"?_+=`${w} `:x!="postcode"&&x!="address_title"&&(_+=`${w}${/^-?\d+$/.test(w)?"":","} `);v+=`<option value="${_}${b}" data-values='${L}'></option>`}}),l.innerHTML=v,y})}catch(y){console.log(y)}})})}}const qr=Object.freeze(Object.defineProperty({__proto__:null,default:Er},Symbol.toStringTag,{value:"Module"}));var rt=function(o,e,t,r){function i(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function n(m){try{c(r.next(m))}catch(u){a(u)}}function d(m){try{c(r.throw(m))}catch(u){a(u)}}function c(m){m.done?l(m.value):i(m.value).then(n,d)}c((r=r.apply(o,e||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Address Lookup"});class $r 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`,r=document.createElement("template");r.innerHTML=`
|
|
548
548
|
<style>
|
|
549
549
|
@import "${t}";
|
|
550
550
|
:host{margin-bottom:1rem;display:block}input[name=postcode]{border-color:var(--error-border, var(--colour-primary)) !important}div:has(input[name=postcode]) .suffix{border-color:var(--error-border, var(--colour-primary)) !important}.invalid-feedback{display:var(--error-display, none) !important}.optional{display:var(--req-display, inline-block) !important}.pre-filled p{padding-bottom:1rem}.pre-filled button{border:none;background:none;cursor:pointer}/*# sourceMappingURL=assets/css/components/address-lookup.css.map */
|
|
@@ -579,4 +579,4 @@
|
|
|
579
579
|
<p><span class="pre-filled-address"></span><button class="text-primary text-decoration-none ms-1 cursor-pointer"><i class="fa-regular fa-pen-to-square"></i><span class="visually-hidden">Edit</span></button><slot name="prefilled"></slot></p>
|
|
580
580
|
</div>
|
|
581
581
|
</div>
|
|
582
|
-
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){return rt(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const e=this.shadowRoot.querySelector('[name="postcode"]'),t=this.shadowRoot.querySelector(".postcode-lookup"),r=this.shadowRoot.querySelector(".manual-address"),i=this.shadowRoot.querySelector(".pre-filled"),l=this.shadowRoot.querySelector("datalist"),a=this.shadowRoot.querySelector(".switch-to-manual-btn"),n=this.shadowRoot.querySelector(".switch-to-lookup-btn"),d=this.hasAttribute("data-title")?this.getAttribute("data-title"):"Property address",c=this.shadowRoot.querySelector(".pre-filled-address + button");Array.from(this.shadowRoot.querySelectorAll(".title")).forEach((b,h)=>{b.innerHTML=d});function m(b){let h=b.shadowRoot.querySelector(".pre-filled-address"),f=!0;h.innerHTML="",Array.from(b.querySelectorAll("input[required],input[data-required],select[required],select[data-required]")).forEach((y,v)=>{y.value?h.innerHTML+=", "
|
|
582
|
+
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){return rt(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const e=this.shadowRoot.querySelector('[name="postcode"]'),t=this.shadowRoot.querySelector(".postcode-lookup"),r=this.shadowRoot.querySelector(".manual-address"),i=this.shadowRoot.querySelector(".pre-filled"),l=this.shadowRoot.querySelector("datalist"),a=this.shadowRoot.querySelector(".switch-to-manual-btn"),n=this.shadowRoot.querySelector(".switch-to-lookup-btn"),d=this.hasAttribute("data-title")?this.getAttribute("data-title"):"Property address",c=this.shadowRoot.querySelector(".pre-filled-address + button");Array.from(this.shadowRoot.querySelectorAll(".title")).forEach((b,h)=>{b.innerHTML=d});function m(b){let h=b.shadowRoot.querySelector(".pre-filled-address"),f=!0;h.innerHTML="",Array.from(b.querySelectorAll("input[required],input[data-required],select[required],select[data-required]")).forEach((y,v)=>{const g=y.value;g?h.innerHTML+=g+(/^-?\d+$/.test(g)?" ":", "):f=!1}),h.innerHTML=h.innerHTML.slice(0,-2),f&&(i.classList.remove("js-hide"),t.classList.add("js-hide"),r.classList.add("js-hide"))}if(m(this),this.addEventListener("filled",b=>{m(this)}),this.hasAttribute("data-use")){let b=`<div><input type="checkbox" name="use" id="use" value="yes"><label for="use">${this.hasAttribute("data-use-label")?this.getAttribute("data-use-label"):"Use saved address"}</label></div>`;t.insertAdjacentHTML("afterbegin",b),this.shadowRoot.addEventListener("change",h=>{if(h&&h.target instanceof HTMLElement&&h.target.closest('[name="use"]')&&h.target.closest('[name="use"]').checked){t.classList.add("js-hide"),r.classList.remove("js-hide");let f=JSON.parse(this.getAttribute("data-use"));Object.keys(f).forEach((y,v)=>{let g=f[y];this.querySelector(`[data-name="${y}"]`)?this.querySelector(`[data-name="${y}"]`).value=g:this.querySelector(`[name="${y}"]`)&&(this.querySelector(`[name="${y}"]`).value=g)})}})}function u(){t.classList.add("js-hide"),r.classList.remove("js-hide"),Array.from(r.querySelectorAll("[data-required]")).forEach((b,h)=>{b.setAttribute("required","true")}),r.scrollIntoView()}c.addEventListener("click",b=>{i.classList.add("js-hide"),u()}),a.addEventListener("click",b=>{u()}),n.addEventListener("click",b=>{t.classList.remove("js-hide"),r.classList.add("js-hide"),t.scrollIntoView()}),e.addEventListener("keyup",b=>{e.value.length>=3&&p(e.value)}),e.addEventListener("change",b=>{if(e.value.length>=3&&(p(e.value),l.querySelector(`[value="${e.value}"]`))){t.classList.add("js-hide"),r.classList.remove("js-hide");let h=JSON.parse(l.querySelector(`[value="${e.value}"]`).getAttribute("data-values"));Object.keys(h).forEach((f,y)=>{let v=h[f];this.querySelector(`[data-name="${f}"]`)?this.querySelector(`[data-name="${f}"]`).value=v:this.querySelector(`[name="${f}"]`)&&(this.querySelector(`[name="${f}"]`).value=v)}),this.querySelector('[data-name="address_1"]').focus(),Array.from(this.querySelectorAll("[data-required]")).forEach((f,y)=>{f.setAttribute("required","true")}),e.removeAttribute("required"),this.shadowRoot.querySelector('[name="use"]')&&(this.shadowRoot.querySelector('[name="use"]').checked=!1)}});const p=b=>rt(this,void 0,void 0,function*(){let h=this.getAttribute("data-url");h+=`${encodeURI(b)}`,window.controller||(window.controller=[]),window.controller[h]&&window.controller[h].abort(),window.controller[h]=new AbortController;const{signal:f}=controller[h];try{yield fetch(h,{signal:f,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":at.get("XSRF-TOKEN")})}).then(y=>y.json()).then(y=>{let v="";return y.forEach((g,T)=>{if(typeof g.value=="object"){let L=JSON.stringify(g.value);v+=`<option value="${g.label}, ${b}" data-values='${L}'></option>`}else{let L=JSON.stringify(g),_="";for(const[x,w]of Object.entries(g))x=="address_number_name"?_+=`${w} `:x!="postcode"&&x!="address_title"&&(_+=`${w}${/^-?\d+$/.test(w)?"":","} `);v+=`<option value="${_}${b}" data-values='${L}'></option>`}}),l.innerHTML=v,y})}catch(y){console.log(y)}})})}}const Tr=Object.freeze(Object.defineProperty({__proto__:null,default:$r},Symbol.toStringTag,{value:"Module"}));A.Accordion=ce,A.AccordionItem=he,A.Actionbar=Eo,A.AddressLookup=Ho,A.AppliedFilters=uo,A.Banner=_e,A.Card=Se,A.Carousel=$e,A.CollapsibleSideMenu=No,A.FileUpload=ne,A.Filterlist=yo,A.Header=Re,A.Input=z,A.Logo=dt,A.Nav=ka,A.NoteFeed=io,A.Notification=xo,A.Pagination=To,A.PropertySearchbar=ya,A.Snapshot=za,A.Step=Oa,A.Stepper=Ta,A.Tab=Qa,A.Table=N,A.Tabs=Ga,A.Testimonial=Je,A.Timeline=oa,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "iamproperty"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "5.
|
|
8
|
+
"version": "5.2.0",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"bootstrap": "copyfiles -u 2 node_modules/bootstrap/**/* assets/bootstrap",
|
|
11
11
|
"dev": "npm run copy && node local_modules/delete-assets.js && vite --host",
|