@iamproperty/components 5.6.1-beta19 → 5.6.1-beta20
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/carousel.css +1 -1
- package/assets/css/components/carousel.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.js +7 -0
- package/assets/js/components/card/card.component.min.js +2 -2
- package/assets/js/components/card/card.component.min.js.map +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +5 -5
- package/assets/js/components/carousel/carousel.component.min.js.map +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/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.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.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +5 -5
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/carousel.js +16 -4
- package/assets/js/scripts.bundle.js +13 -13
- 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/sass/components/carousel.scss +1 -2
- package/assets/ts/components/card/card.component.ts +9 -2
- package/assets/ts/modules/carousel.ts +24 -5
- package/dist/components.es.js +10 -10
- package/dist/components.umd.js +26 -26
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{overflow:hidden;margin-inline:auto}.carousel .carousel__controls:not(.thumbnails){
|
|
1
|
+
.carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{overflow:hidden;margin-inline:auto}.carousel .carousel__controls:not(.thumbnails){text-align:center;max-width:30rem}.carousel .carousel__controls.thumbnails{margin-block-start:2rem}@media screen and (min-width: 36em){.carousel .carousel__controls{width:100%}}.carousel .carousel__controls button{padding:0;margin:0 .2rem .2rem;border:3px solid var(--colour-canvas);border-radius:4px}.carousel .carousel__controls button.has-thumbnail{height:4.625rem}.carousel .carousel__controls button.has-thumbnail img{height:100%;width:auto}.carousel .carousel__controls button:not(.has-thumbnail){width:1rem;height:1rem;min-height:1rem;border-radius:50%;text-indent:-50rem;overflow:hidden;background:var(--colour-primary-theme);margin:0 .5rem .5rem .5rem;border:none}.carousel .carousel__controls button:not(.has-thumbnail):before{display:none}.carousel .carousel__controls button:first-child:last-child{display:none}.carousel__controls>button[aria-current]{--colour-active-thumbnail: var(--colour-info);border-color:var(--colour-active-thumbnail)}.carousel__controls>button[aria-current]:not(.has-thumbnail){background:var(--colour-success)}.carousel.hide-btns .carousel__wrapper>.btn{display:none}.carousel.hide-controls .carousel__controls{display:none}@media screen and (min-width: 36em){[data-row-class*=cols-sm-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-sm-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-sm-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-sm-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-sm-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none}[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}@media screen and (min-width: 62em){.carousel__controls>button{display:inline-block !important}[data-row-class*=cols-md-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-md-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-md-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-md-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-md-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none !important}[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}/*# sourceMappingURL=carousel.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../sass/components/carousel.scss","../../sass/_functions/mixins.scss"],"names":[],"mappings":"AAKE,6BAEE,kBAGF,2BAEE,iBACA,cACA,6BAGF,4BACE,gBACA,iBAQJ,iBAEE,qBAEA,wBAGF,oCAEE,aAKF,oBAEE,qCACA,iBACA,mBACA,gBACA,4BACA,mBACA,cACA,kBACA,eACA,oBACA,gBACA,YACA,kBACA,gBACA,UAEA,kBACA,QACA,UACA,6BAEA,sCACE,WACA,oBAGF,gCACE,WACA,kBACA,QACA,MACA,YACA,WACA,wBACA,6BACA,cACA,sBACA,sBACA,qCACA,sBACA,8BACA,8BACA,uBAGF,gEAGE,iCACA,0BACA,mBAGF,kCACE,mBAIJ,UACE,UACA,QCjGE,oCD+FJ,UAMI,oBCrGA,oCDyGJ,UAII,mBAGF,gBAEE,yBAWJ,8BACE,gBACA,mBAEA,+CACE,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../sass/components/carousel.scss","../../sass/_functions/mixins.scss"],"names":[],"mappings":"AAKE,6BAEE,kBAGF,2BAEE,iBACA,cACA,6BAGF,4BACE,gBACA,iBAQJ,iBAEE,qBAEA,wBAGF,oCAEE,aAKF,oBAEE,qCACA,iBACA,mBACA,gBACA,4BACA,mBACA,cACA,kBACA,eACA,oBACA,gBACA,YACA,kBACA,gBACA,UAEA,kBACA,QACA,UACA,6BAEA,sCACE,WACA,oBAGF,gCACE,WACA,kBACA,QACA,MACA,YACA,WACA,wBACA,6BACA,cACA,sBACA,sBACA,qCACA,sBACA,8BACA,8BACA,uBAGF,gEAGE,iCACA,0BACA,mBAGF,kCACE,mBAIJ,UACE,UACA,QCjGE,oCD+FJ,UAMI,oBCrGA,oCDyGJ,UAII,mBAGF,gBAEE,yBAWJ,8BACE,gBACA,mBAEA,+CACE,kBACA,gBAGF,yCACE,wBCvIA,oCD6HJ,8BAcI,YAGF,qCACE,UACA,qBACA,sCACA,kBAEA,mDACE,gBAEA,uDACE,YACA,WAKN,yDACE,WACA,YACA,gBACA,kBACA,mBACA,gBACA,uCACA,2BACA,YAEA,gEACE,aAIJ,4DACE,aAIJ,yCACE,8CACA,4CAEA,6DACE,iCAOJ,4CACE,aAGF,4CACE,aCpME,oCDyMF,gYAKE,aAIF,yqDAUE,cC5NA,oCDiOF,2BACE,gCAGF,gYAKE,wBAIF,yqDAUE","file":"carousel.css"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=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"):`${o}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const _=function(i){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var a=i.getAttribute("data-id"),c=i.getAttribute("id");if(typeof c>"u"||c==null){var l=String.fromCharCode(65+Math.floor(Math.random()*26));c=l+Date.now(),i.setAttribute("id",c)}function o(){window.player=new YT.Player(c,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:p,onStateChange:e}})}o();function p(r){r.target.playVideo()}var t=!1;function e(r){if(r.data==YT.PlayerState.PLAYING&&!t){var s=document.getElementById(c);s.classList.add("player-ready"),t=!0}}},k=i=>(Array.from(i.querySelectorAll("dialog[open]")).forEach((a,c)=>{a.closest(".dialog__wrapper")||(a.removeAttribute("open"),a.showModal(),a.focus(),v(a))}),i.addEventListener("click",a=>{if(a.target.tagName=="IAM-ACTIONBAR")return!1;if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-modal]")){const o=a.target.closest("[data-modal]"),p=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),t=document.querySelector(`dialog#${p}`);v(t),t.showModal(),t.focus();let e=t.offsetWidth;t.setAttribute("style",`max-width: ${e}px;`),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((r,s)=>{const m=r.getAttribute("data-duplicate"),b=document.getElementById(m);if(r.checked!=b.checked){r.checked=b.checked;let u=new Event("change");r.dispatchEvent(u)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:p})}if(a&&a.target instanceof HTMLElement&&a.target.closest("button.dialog__close")){const o=a.target.closest("dialog[open]");a.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((t,e)=>{t.classList.remove("active")});let p=new CustomEvent("dialog-closed",{bubbles:!0,cancelable:!0,detail:{modalId:o.id}});a.target.dispatchEvent(p),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest('button[formmethod="dialog"]')){const o=a.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((p,t)=>{p.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest("dialog[open]")){let o=a.target.closest("dialog[open]");var c=window.getComputedStyle(o);if(c.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.classList.contains("dialog--transactional")&&!o.classList.contains("dialog--acknowledgement")){const p=o.getBoundingClientRect();(a.clientX<p.left||a.clientX>p.right||a.clientY<p.top||a.clientY>p.bottom)&&(a.target.closest("dialog *")||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__wrapper > button")){a.stopPropagation();let o=a.target.closest(".dialog__wrapper > button"),p=o.parentNode,t="openPopover",e=p.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=e&&o.closest("dialog[open]")!=document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((b,u)=>{b.removeAttribute("aria-expanded")}),e.hasAttribute("open"))e.close(),t="closePopover",e.removeAttribute("style"),o.removeAttribute("aria-expanded");else{e.show(),o.setAttribute("aria-expanded",!0);var l=o.getBoundingClientRect();let b=l.top,u=l.left;if(o.closest("iam-table")){let n=o.closest("iam-table").parentNode.getBoundingClientRect();b-=n.top,u-=n.left}e.classList.contains("dialog--fix")&&e.setAttribute("style",`position:fixed;top: ${b}px; left: ${u}px; margin: 3rem 0 0 0;`)}let r=e.getBoundingClientRect(),s=r.bottom-window.scrollY,m=window.innerHeight-window.scrollY;if(s>m){let b=e.hasAttribute("style")?e.getAttribute("style")+" ":"";e.setAttribute("style",b+"transform: translate(0, calc(-100% - 4rem))"),r=e.getBoundingClientRect(),r.top-window.scrollY<100&&e.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:t,id:o.textContent})}a&&a.target instanceof HTMLElement&&!a.target.closest("dialog[open]")&&!a.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,p)=>{o.removeAttribute("aria-expanded")}))}),null),v=i=>{let a=i.querySelector(".youtube-embed a");if(a&&_(a),i.classList.contains("dialog--multi")&&!i.querySelector(":scope > .steps")&&L(i),!i.querySelector(":scope .mh-lg")&&!i.classList.contains("dialog--multi")){i.innerHTML=`<div class="mh-lg">${i.innerHTML}</div>`;let c=i.querySelector(".mh-lg"),l=i.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(l){let o=l.previousSibling;c.before(l),o&&l.before(o)}}i.querySelector(":scope > button:first-child")||i.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},L=i=>{let a="",c=Array.from(i.querySelectorAll("fieldset[data-title]")),l=i.querySelector("form");c.forEach((t,e)=>{a+=`<button data-title="${t.getAttribute("data-title")}" type="button" class="${e==0?"active":""}" tabindex="-1">${t.getAttribute("data-title")}</button>`;const r=document.createElement("div");if(r.classList.add("btn--wrapper"),t.appendChild(r),e!=0&&(r.innerHTML+=`<button data-title="${c[e-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),e!=c.length-1&&(r.innerHTML+=`<button data-title="${c[e+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),e==c.length-1)if(l&&l.querySelector(':scope > button[type="submit"]')){let s=l.querySelector(':scope > button[type="submit"]');s.classList.add("mb-0"),r.insertAdjacentElement("beforeend",s)}else r.innerHTML+=`<button data-title="${c[e].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),i.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${a}</div>`);let o=Array.from(i.querySelectorAll("fieldset.was-validated"));for(let t=0;t<o.length;t++){let e=o[t],r=e.getAttribute("data-title");if(e.querySelector(".is-invalid")){Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,m)=>{s.classList.add("active")});break}else Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,m)=>{s.classList.add("valid")})}i.addEventListener("invalid",function(){return function(t){t.preventDefault()}}(),!0);function p(t){const e=i.querySelector("fieldset.active")?i.querySelector("fieldset.active"):i.querySelector("fieldset[data-title]"),r=e.getAttribute("data-title");let s=!0;if(e.classList.add("was-validated"),Array.from(e.querySelectorAll("input")).forEach((u,n)=>{u.checkValidity()||(s=!1)}),s?Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((u,n)=>{u.classList.add("valid")}):Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((u,n)=>{u.classList.remove("valid")}),s||!t.hasAttribute("data-next")){const u=i.querySelector(`fieldset[data-title="${t.getAttribute("data-title")}"]`),n=i.querySelector(`.steps button[data-title="${t.getAttribute("data-title")}"]`);Array.from(i.querySelectorAll("button")).forEach((g,y)=>{g.classList.remove("active")}),Array.from(i.querySelectorAll("fieldset")).forEach((g,y)=>{g.classList.remove("active")}),n.classList.add("active"),u.classList.add("active")}let m=Array.from(i.querySelectorAll("fieldset")).length,b=Array.from(i.querySelectorAll("fieldset.valid")).length;i.style.setProperty("--progress",`${b/(m-1)*100}%`)}i.addEventListener("keydown",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("button")){const e=t.target.closest("button");t.keyCode==13&&e.getAttribute("type")!="submit"&&(t.preventDefault(),p(e))}t&&t.target instanceof HTMLElement&&t.target.closest("input")&&(t.target.closest("input").classList.remove("is-invalid"),t.keyCode==13&&t.preventDefault())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest('button[type="submit"]'))t.target.closest("form").classList.add("was-validated");else if(t&&t.target instanceof HTMLElement&&t.target.closest("button[data-title]")){const e=t.target.closest("button[data-title]");p(e)}return null})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"action bar"});function A(i,a){i&&a=="all"?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!0,i.querySelector("label").textContent="Select all"):i&&a==0?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!1,i.querySelector("label").textContent="Select all"):i&&a?(i.querySelector("input").indeterminate=!0,i.querySelector("input").checked=!1,i.querySelector("label").textContent=`${a} item${a>1?"s":""} selected`):i&&(i.querySelector("input").checked=!1,i.querySelector("input").indeterminate=!1,i.querySelector("label").textContent="Select all")}class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",c=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,l=document.createElement("template");l.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/import x from"js-cookie";var g=function(S,h,a,o){function l(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function b(d){try{m(o.next(d))}catch(f){u(f)}}function v(d){try{m(o.throw(d))}catch(f){u(f)}}function m(d){d.done?c(d.value):l(d.value).then(b,v)}m((o=o.apply(S,h||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Address Lookup"});class j extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const h=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${h}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function A(r,i){function d(e,t,s=!0){let f=!1,l=t.getAttribute("name");if(!l)return!1;l.includes("[]")&&(l=l.replace("[]",`[${t.value}]`));let a=e.querySelector(`[data-name="${l}"]`);a&&t.getAttribute("type")=="checkbox"&&(f=!t.checked);let h=t.getAttribute("data-filter-text");if(a||(a=document.createElement("button"),e.appendChild(a)),a.setAttribute("type","button"),a.classList.add("filter"),a.classList.add("tag"),s&&a.classList.add("tag--not-set"),a.setAttribute("data-name",l),a.innerHTML=h.replace("$value",t.value),(!t.value||f)&&a.remove(),t.parentNode.closest("[data-filter-text]")){let m=t.parentNode.closest("[data-filter-text]"),o=!0;if(l="",m.querySelectorAll("input").forEach((u,c)=>{let p=u.getAttribute("name");if(l+=`${c!=0?",":""}${p}`,e.querySelector(`[data-name="${p}"]`)&&e.querySelector(`[data-name="${p}"]`).remove(),u.value){let n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.classList.add("tag"),s&&a.classList.add("tag--not-set"),n.setAttribute("data-name",p),n.innerHTML=h.replace("$value",u.value),e.appendChild(n)}else o=!1}),e.querySelector(`[data-name="${l}"]`)&&e.querySelector(`[data-name="${l}"]`).remove(),o){let u=m.getAttribute("data-filter-text");m.querySelectorAll("input").forEach((p,n)=>{let y=p.getAttribute("name");e.querySelector(`[data-name="${y}"]`)&&e.querySelector(`[data-name="${y}"]`).remove(),u=u.replace(`$${n+1}`,p.value)});let c=document.createElement("button");c.setAttribute("type","button"),c.classList.add("filter"),c.classList.add("tag"),s&&a.classList.add("tag--not-set"),c.setAttribute("data-name",l),c.innerHTML=u,e.appendChild(c)}}}Array.from(r.querySelectorAll('input[type="checkbox"]:checked, input:not([type="checkbox"]):not([type="radio"])')).forEach((e,t)=>{d(i,e,!1)});let b=r.closest("dialog");b&&new MutationObserver(function(t){t[0].attributeName=="open"&&Array.from(r.querySelectorAll('input[type="checkbox"]:checked, input:not([type="checkbox"]):not([type="radio"])')).forEach((s,f)=>{d(i,s,!1)})}).observe(b,{attributes:!0}),r.addEventListener("tags-set",function(e){i.innerHTML="",Array.from(r.querySelectorAll('input[type="checkbox"]:checked, input:not([type="checkbox"]):not([type="radio"])')).forEach((t,s)=>{d(i,t,!1)})}),Array.from(r.querySelectorAll('input[type="checkbox"]:checked, input:not([type="checkbox"]):not([type="radio"])')).forEach((e,t)=>{e.addEventListener("change",function(s){r.hasAttribute("data-keep-same")||d(i,e),s.stopPropagation()})}),r.addEventListener("change",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest("input[data-filter-text]")){let t=e.target.closest("input[data-filter-text]");r.hasAttribute("data-keep-same")||d(i,t)}}),i.addEventListener("click",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){let f=e.target.closest(".filter"),l=f.getAttribute("data-name").split(",");for(var t=0;t<l.length;t++){let a=l[t],h=`[name="${a}"]`;a.match(/\[(.*)\]/)&&(a.replace(/\[(.*)\]/,"[]"),h=`[value="${a.replace(/.*\[(.*)\]/,"$1")}"]`);let m=r.querySelectorAll(h);for(var s=0;s<m.length;s++){let o=m[s];if(o.getAttribute("type")!="radio"&&o.getAttribute("type")!="checkbox"){o.value="";var e=new Event("force");r.hasAttribute("data-nosubmit")||o.closest("form").dispatchEvent(e)}else{o.checked=!1;var e=new Event("force");r.hasAttribute("data-nosubmit")||o.closest("form").dispatchEvent(e)}}}f.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",d=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`;let b=this.classList.toString();const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -54,6 +54,13 @@ class iamCard extends HTMLElement {
|
|
|
54
54
|
const card = this.shadowRoot.querySelector('.card');
|
|
55
55
|
const btnCompact = this.shadowRoot.querySelector('.btn-compact');
|
|
56
56
|
const recordType = this.hasAttribute('data-record') ? this.getAttribute('data-record') : '';
|
|
57
|
+
/*
|
|
58
|
+
If the parentNode is actually just a div,
|
|
59
|
+
we don't want to look for anything or add events
|
|
60
|
+
*/
|
|
61
|
+
if (!parentNode) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
57
64
|
if (parentNode)
|
|
58
65
|
parentNode.setAttribute('tabindex', '-1');
|
|
59
66
|
if (parentNode.matches('label[for]')) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class m extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)')&&this.classList.add("card--has-icon");let r=this.classList.toString();const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
`,this.shadowRoot.appendChild(t.content.cloneNode(!0)),document.getElementById("cardGlobal")||document.head.insertAdjacentHTML("beforeend",`<style id="cardGlobal">@supports not selector(:has(*)){iam-card{margin-bottom:2rem;display:block}}iam-card>div:has([type=checkbox]){display:contents}iam-card>div:has([type=checkbox])>input:is([type=radio],[type=checkbox])+label{position:absolute !important;top:.5rem;right:.5rem;width:2rem;padding-left:2rem;margin:0.25rem 0.5rem !important;height:2.5rem;overflow:hidden}iam-card:has([type=checkbox]:checked){--hover-outline-colour: var(--colour-info);--outline-colour: var(--colour-info)}iam-card:has([type=checkbox]+label:hover){--hover-outline-colour: transparent;--hover-icon-bg: var(--colour-warning);--hover-icon-colour: var(--colour-primary-theme);--card-icon-right-overide:1rem}iam-card:has([type=checkbox]:active){--hover-outline-colour: transparent;--hover-icon-bg: var(--colour-warning);--hover-icon-colour: var(--colour-primary-theme);--card-icon-right-overide:1rem}iam-card.card--has-icon:not(.card--filter):not(.card--secondary) i{position:absolute;top:calc(50% - .5rem - 2px);left:1rem}iam-card .badge i{position:static !important;margin-right:.25rem}[data-select-container]:has([type=checkbox]:checked) iam-card>div:has([type=checkbox])>input:is([type=radio],[type=checkbox]){width:100%;height:100%;max-height:100%;max-width:100%;cursor:pointer;pointer-events:all;inset:0;border-radius:0;z-index:10}a[target=_blank] iam-card::part(card){--icon: var(--icon-new-tab)}/*# sourceMappingURL=assets/css/components/card.global.css.map */
|
|
30
|
-
</style>`)}connectedCallback(){this.classList.add("loaded");const r=this.parentNode.closest("a, button, label, router-link"),e=this.shadowRoot.querySelector(".card"),o=this.shadowRoot.querySelector(".btn-compact");if(this.hasAttribute("data-record")&&this.getAttribute("data-record")
|
|
30
|
+
</style>`)}connectedCallback(){this.classList.add("loaded");const r=this.parentNode.closest("a, button, label, router-link"),e=this.shadowRoot.querySelector(".card"),o=this.shadowRoot.querySelector(".btn-compact");if(this.hasAttribute("data-record")&&this.getAttribute("data-record"),!r)return!1;if(r&&r.setAttribute("tabindex","-1"),r.matches("label[for]")&&(document.getElementById(r.getAttribute("for")).checked?e.classList.add("checked"):e.classList.remove("checked")),this.addEventListener("click",t=>{let a=new Event("click");e.dispatchEvent(a)}),e.addEventListener("click",t=>{if(r.matches("label[for]")){t.stopPropagation(),t.preventDefault();const a=document.getElementById(r.getAttribute("for")),i=a.getAttribute("name"),c=a.getAttribute("id");Array.from(document.querySelectorAll(`[name="${i}"][type="radio"]:not([id="${c}"])`)).forEach((d,l)=>{document.querySelector(`[for="${d.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),r.click(),a.checked?e.classList.add("checked"):e.classList.remove("checked")}}),this.addEventListener("inactive",t=>{e.classList.remove("checked")}),e.addEventListener("keydown",t=>{switch(t.keyCode){case 32:case 13:if(r.matches("label[for]")){t.stopPropagation(),t.preventDefault();const a=document.getElementById(r.getAttribute("for")),i=a.getAttribute("name"),c=a.getAttribute("id");Array.from(document.querySelectorAll(`[name="${i}"]:not([id="${c}"])`)).forEach((d,l)=>{document.querySelector(`[for="${d.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),r.click(),a.checked?e.classList.add("checked"):e.classList.remove("checked")}else r.click();break}}),o){let t=this.getAttribute("data-add-link");o.addEventListener("click",a=>{a.stopPropagation(),a.preventDefault(),window.location=t})}}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(r,e,o){switch(r){case"data-total":{this.shadowRoot.querySelector(".card__total")&&(this.shadowRoot.querySelector(".card__total").innerHTML=o);break}case"class":{let t=this.classList.toString();this.querySelector('*:not(.badge):not(small):not(.btn) > [class*="fa-"]:not(.btn)')&&(t+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class",`card ${t}`);break}}}}export{m as default};
|
|
31
31
|
//# sourceMappingURL=card.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.component.min.js","sources":["card.component.js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Card\"\n});\nclass iamCard extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n if (this.querySelector('*:not(.badge):not(small):not(.btn) > [class*=\"fa-\"]:not(.btn)'))\n this.classList.add('card--has-icon');\n let classList = this.classList.toString();\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/card.css\";`;\n const loadExtraCSS = `@import \"${assetLocation}/css/components/card.global.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"card ${classList}\" tabindex=\"0\" part=\"card\">\n ${this.hasAttribute('data-image') || this.hasAttribute('data-record') ? `<div class=\"card__head\">${this.hasAttribute('data-image') ? `<img src=\"${this.getAttribute('data-image')}\" alt=\"\" loading=\"lazy\" />` : ``} <div class=\"card__badges\"><slot name=\"badges\"></slot></div></div>` : ''}\n <div class=\"card__body\" part=\"body\">\n ${!this.hasAttribute('data-image') && this.querySelector('[slot=\"badges\"]') && this.querySelector('[slot=\"checkbox\"]') ? `<div class=\"card__badges card__badges--inline\"><slot name=\"badges\"></slot></div>` : ''}\n ${!this.hasAttribute('data-image') && !this.hasAttribute('data-record') && this.querySelector('[slot=\"badges\"]') ? `<div class=\"card__badges\"><slot name=\"badges\"></slot></div>` : ''}\n ${this.hasAttribute('data-illustration') ? `<div class=\"card__illustration\"><img src=\"${this.getAttribute('data-illustration')}\" alt=\"\" loading=\"lazy\" /></div>` : ''}\n <slot></slot>\n ${this.hasAttribute('data-total') ? `<div class=\"card__total\">${this.getAttribute('data-total')}</div>` : ''}\n </div>\n ${this.hasAttribute('data-add-link') ? `<button class=\"btn btn-compact btn-secondary fa-plus\">Add property</button>` : ''}\n <slot name=\"checkbox\"></slot>\n <div class=\"card__footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n <slot name=\"btns\"></slot>\n ${this.hasAttribute('data-cta') ? `<span class=\"link d-inline-block pt-0 mb-0\">${this.getAttribute('data-cta')}</span>` : ''}\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n // insert extra CSS\n if (!document.getElementById('cardGlobal'))\n document.head.insertAdjacentHTML('beforeend', `<style id=\"cardGlobal\">${loadExtraCSS}</style>`);\n }\n connectedCallback() {\n this.classList.add('loaded');\n // Mimic clicking the parent node so the focus and target events can be on the card\n const parentNode = this.parentNode.closest('a, button, label, router-link');\n const card = this.shadowRoot.querySelector('.card');\n const btnCompact = this.shadowRoot.querySelector('.btn-compact');\n const recordType = this.hasAttribute('data-record') ? this.getAttribute('data-record') : '';\n if (parentNode)\n parentNode.setAttribute('tabindex', '-1');\n if (parentNode.matches('label[for]')) {\n let isChecked = document.getElementById(parentNode.getAttribute('for')).checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n // Click event down\n this.addEventListener('click', (event) => {\n let clickEvent = new Event('click');\n card.dispatchEvent(clickEvent);\n });\n card.addEventListener('click', (event) => {\n if (parentNode.matches('label[for]')) {\n event.stopPropagation();\n event.preventDefault();\n const input = document.getElementById(parentNode.getAttribute('for'));\n const inputName = input.getAttribute('name');\n const inputID = input.getAttribute('id');\n // Mimic radio button functionality\n const inputs = Array.from(document.querySelectorAll(`[name=\"${inputName}\"][type=\"radio\"]:not([id=\"${inputID}\"])`));\n inputs.forEach((input, index) => {\n const otherCard = document.querySelector(`[for=\"${input.getAttribute('id')}\"] iam-card`);\n otherCard.dispatchEvent(new Event('inactive'));\n });\n parentNode.click();\n let isChecked = input.checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n });\n this.addEventListener('inactive', (event) => {\n card.classList.remove('checked');\n });\n card.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 32:\n case 13:\n if (parentNode.matches('label[for]')) {\n event.stopPropagation();\n event.preventDefault();\n const input = document.getElementById(parentNode.getAttribute('for'));\n const inputName = input.getAttribute('name');\n const inputID = input.getAttribute('id');\n const inputs = Array.from(document.querySelectorAll(`[name=\"${inputName}\"]:not([id=\"${inputID}\"])`));\n inputs.forEach((input, index) => {\n const otherCard = document.querySelector(`[for=\"${input.getAttribute('id')}\"] iam-card`);\n otherCard.dispatchEvent(new Event('inactive'));\n });\n parentNode.click();\n let isChecked = input.checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n else {\n parentNode.click();\n }\n break;\n default:\n break;\n }\n });\n if (btnCompact) {\n let addLocation = this.getAttribute('data-add-link');\n btnCompact.addEventListener('click', (event) => {\n event.stopPropagation();\n event.preventDefault();\n window.location = addLocation;\n });\n }\n }\n static get observedAttributes() {\n return [\"data-total\", \"class\"];\n }\n attributeChangedCallback(attrName, oldVal, newVal) {\n switch (attrName) {\n case \"data-total\": {\n if (this.shadowRoot.querySelector('.card__total'))\n this.shadowRoot.querySelector('.card__total').innerHTML = newVal;\n break;\n }\n case \"class\": {\n let classList = this.classList.toString();\n if (this.querySelector('*:not(.badge):not(small):not(.btn) > [class*=\"fa-\"]:not(.btn)'))\n classList += ' card--has-icon';\n this.shadowRoot.querySelector('.card').setAttribute('class', `card ${classList}`);\n break;\n }\n }\n }\n}\nexport default iamCard;\n"],"names":["iamCard","classList","assetLocation","coreCSS","template","parentNode","card","btnCompact","event","clickEvent","input","inputName","inputID","index","addLocation","attrName","oldVal","newVal"],"mappings":";;;IAEA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,MACf,CAAC,EACD,MAAMA,UAAgB,WAAY,CAC9B,aAAc,CACV,QACA,KAAK,aAAa,CAAE,KAAM,MAAQ,CAAA,EAC9B,KAAK,cAAc,+DAA+D,GAClF,KAAK,UAAU,IAAI,gBAAgB,EACvC,IAAIC,EAAY,KAAK,UAAU,SAAQ,EACvC,MAAMC,EAAgB,SAAS,KAAK,aAAa,sBAAsB,EAAI,SAAS,KAAK,aAAa,sBAAsB,EAAI,UAC1HC,EAAU,SAAS,KAAK,aAAa,eAAe,EAAI,SAAS,KAAK,aAAa,eAAe,EAAI,GAAGD,qBAGzGE,EAAW,SAAS,cAAc,UAAU,EAClDA,EAAS,UAAY;AAAA;AAAA,eAEdD;AAAA;AAAA;AAAA,MAET,KAAK,aAAa,KAAK,EAAI,YAAY,KAAK,aAAa,KAAK,MAAQ;AAAA;AAAA;A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,IAAI,SAAS,EAE5BA,EAAK,UAAU,OAAO,SAAS,OAGnCD,EAAW,MAAK,EAEpB,KAGP,CACb,CAAS,EACGE,EAAY,CACZ,IAAIO,EAAc,KAAK,aAAa,eAAe,EACnDP,EAAW,iBAAiB,QAAUC,GAAU,CAC5CA,EAAM,gBAAe,EACrBA,EAAM,eAAc,EACpB,OAAO,SAAWM,CAClC,CAAa,EAER,CACD,WAAW,oBAAqB,CAC5B,MAAO,CAAC,aAAc,OAAO,CAChC,CACD,yBAAyBC,EAAUC,EAAQC,EAAQ,CAC/C,OAAQF,EAAQ,CACZ,IAAK,aAAc,CACX,KAAK,WAAW,cAAc,cAAc,IAC5C,KAAK,WAAW,cAAc,cAAc,EAAE,UAAYE,GAC9D,KACH,CACD,IAAK,QAAS,CACV,IAAIhB,EAAY,KAAK,UAAU,SAAQ,EACnC,KAAK,cAAc,+DAA+D,IAClFA,GAAa,mBACjB,KAAK,WAAW,cAAc,OAAO,EAAE,aAAa,QAAS,QAAQA,GAAW,EAChF,KACH,CACJ,CACJ,CACL"}
|
|
1
|
+
{"version":3,"file":"card.component.min.js","sources":["card.component.js"],"sourcesContent":["// @ts-nocheck\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Card\"\n});\nclass iamCard extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n if (this.querySelector('*:not(.badge):not(small):not(.btn) > [class*=\"fa-\"]:not(.btn)'))\n this.classList.add('card--has-icon');\n let classList = this.classList.toString();\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/card.css\";`;\n const loadExtraCSS = `@import \"${assetLocation}/css/components/card.global.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\">\n <div class=\"card ${classList}\" tabindex=\"0\" part=\"card\">\n ${this.hasAttribute('data-image') || this.hasAttribute('data-record') ? `<div class=\"card__head\">${this.hasAttribute('data-image') ? `<img src=\"${this.getAttribute('data-image')}\" alt=\"\" loading=\"lazy\" />` : ``} <div class=\"card__badges\"><slot name=\"badges\"></slot></div></div>` : ''}\n <div class=\"card__body\" part=\"body\">\n ${!this.hasAttribute('data-image') && this.querySelector('[slot=\"badges\"]') && this.querySelector('[slot=\"checkbox\"]') ? `<div class=\"card__badges card__badges--inline\"><slot name=\"badges\"></slot></div>` : ''}\n ${!this.hasAttribute('data-image') && !this.hasAttribute('data-record') && this.querySelector('[slot=\"badges\"]') ? `<div class=\"card__badges\"><slot name=\"badges\"></slot></div>` : ''}\n ${this.hasAttribute('data-illustration') ? `<div class=\"card__illustration\"><img src=\"${this.getAttribute('data-illustration')}\" alt=\"\" loading=\"lazy\" /></div>` : ''}\n <slot></slot>\n ${this.hasAttribute('data-total') ? `<div class=\"card__total\">${this.getAttribute('data-total')}</div>` : ''}\n </div>\n ${this.hasAttribute('data-add-link') ? `<button class=\"btn btn-compact btn-secondary fa-plus\">Add property</button>` : ''}\n <slot name=\"checkbox\"></slot>\n <div class=\"card__footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n <slot name=\"btns\"></slot>\n ${this.hasAttribute('data-cta') ? `<span class=\"link d-inline-block pt-0 mb-0\">${this.getAttribute('data-cta')}</span>` : ''}\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n // insert extra CSS\n if (!document.getElementById('cardGlobal'))\n document.head.insertAdjacentHTML('beforeend', `<style id=\"cardGlobal\">${loadExtraCSS}</style>`);\n }\n connectedCallback() {\n this.classList.add('loaded');\n // Mimic clicking the parent node so the focus and target events can be on the card\n const parentNode = this.parentNode.closest('a, button, label, router-link');\n const card = this.shadowRoot.querySelector('.card');\n const btnCompact = this.shadowRoot.querySelector('.btn-compact');\n const recordType = this.hasAttribute('data-record') ? this.getAttribute('data-record') : '';\n /*\n If the parentNode is actually just a div,\n we don't want to look for anything or add events\n */\n if (!parentNode) {\n return false;\n }\n if (parentNode)\n parentNode.setAttribute('tabindex', '-1');\n if (parentNode.matches('label[for]')) {\n let isChecked = document.getElementById(parentNode.getAttribute('for')).checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n // Click event down\n this.addEventListener('click', (event) => {\n let clickEvent = new Event('click');\n card.dispatchEvent(clickEvent);\n });\n card.addEventListener('click', (event) => {\n if (parentNode.matches('label[for]')) {\n event.stopPropagation();\n event.preventDefault();\n const input = document.getElementById(parentNode.getAttribute('for'));\n const inputName = input.getAttribute('name');\n const inputID = input.getAttribute('id');\n // Mimic radio button functionality\n const inputs = Array.from(document.querySelectorAll(`[name=\"${inputName}\"][type=\"radio\"]:not([id=\"${inputID}\"])`));\n inputs.forEach((input, index) => {\n const otherCard = document.querySelector(`[for=\"${input.getAttribute('id')}\"] iam-card`);\n otherCard.dispatchEvent(new Event('inactive'));\n });\n parentNode.click();\n let isChecked = input.checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n });\n this.addEventListener('inactive', (event) => {\n card.classList.remove('checked');\n });\n card.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 32:\n case 13:\n if (parentNode.matches('label[for]')) {\n event.stopPropagation();\n event.preventDefault();\n const input = document.getElementById(parentNode.getAttribute('for'));\n const inputName = input.getAttribute('name');\n const inputID = input.getAttribute('id');\n const inputs = Array.from(document.querySelectorAll(`[name=\"${inputName}\"]:not([id=\"${inputID}\"])`));\n inputs.forEach((input, index) => {\n const otherCard = document.querySelector(`[for=\"${input.getAttribute('id')}\"] iam-card`);\n otherCard.dispatchEvent(new Event('inactive'));\n });\n parentNode.click();\n let isChecked = input.checked;\n if (isChecked)\n card.classList.add('checked');\n else\n card.classList.remove('checked');\n }\n else {\n parentNode.click();\n }\n break;\n default:\n break;\n }\n });\n if (btnCompact) {\n let addLocation = this.getAttribute('data-add-link');\n btnCompact.addEventListener('click', (event) => {\n event.stopPropagation();\n event.preventDefault();\n window.location = addLocation;\n });\n }\n }\n static get observedAttributes() {\n return [\"data-total\", \"class\"];\n }\n attributeChangedCallback(attrName, oldVal, newVal) {\n switch (attrName) {\n case \"data-total\": {\n if (this.shadowRoot.querySelector('.card__total'))\n this.shadowRoot.querySelector('.card__total').innerHTML = newVal;\n break;\n }\n case \"class\": {\n let classList = this.classList.toString();\n if (this.querySelector('*:not(.badge):not(small):not(.btn) > [class*=\"fa-\"]:not(.btn)'))\n classList += ' card--has-icon';\n this.shadowRoot.querySelector('.card').setAttribute('class', `card ${classList}`);\n break;\n }\n }\n }\n}\nexport default iamCard;\n"],"names":["iamCard","classList","assetLocation","coreCSS","template","parentNode","card","btnCompact","event","clickEvent","input","inputName","inputID","index","addLocation","attrName","oldVal","newVal"],"mappings":";;;IAEA,OAAO,UAAY,OAAO,WAAa,GACvC,OAAO,UAAU,KAAK,CAClB,MAAS,0BACT,QAAW,MACf,CAAC,EACD,MAAMA,UAAgB,WAAY,CAC9B,aAAc,CACV,QACA,KAAK,aAAa,CAAE,KAAM,MAAQ,CAAA,EAC9B,KAAK,cAAc,+DAA+D,GAClF,KAAK,UAAU,IAAI,gBAAgB,EACvC,IAAIC,EAAY,KAAK,UAAU,SAAQ,EACvC,MAAMC,EAAgB,SAAS,KAAK,aAAa,sBAAsB,EAAI,SAAS,KAAK,aAAa,sBAAsB,EAAI,UAC1HC,EAAU,SAAS,KAAK,aAAa,eAAe,EAAI,SAAS,KAAK,aAAa,eAAe,EAAI,GAAGD,qBAGzGE,EAAW,SAAS,cAAc,UAAU,EAClDA,EAAS,UAAY;AAAA;AAAA,eAEdD;AAAA;AAAA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AI,cAAc,EAC7E,cAAc,IAAI,MAAM,UAAU,CAAC,CACzE,CAAyB,EACDL,EAAW,MAAK,EACAK,EAAM,QAElBJ,EAAK,UAAU,IAAI,SAAS,EAE5BA,EAAK,UAAU,OAAO,SAAS,OAGnCD,EAAW,MAAK,EAEpB,KAGP,CACb,CAAS,EACGE,EAAY,CACZ,IAAIO,EAAc,KAAK,aAAa,eAAe,EACnDP,EAAW,iBAAiB,QAAUC,GAAU,CAC5CA,EAAM,gBAAe,EACrBA,EAAM,eAAc,EACpB,OAAO,SAAWM,CAClC,CAAa,EAER,CACD,WAAW,oBAAqB,CAC5B,MAAO,CAAC,aAAc,OAAO,CAChC,CACD,yBAAyBC,EAAUC,EAAQC,EAAQ,CAC/C,OAAQF,EAAQ,CACZ,IAAK,aAAc,CACX,KAAK,WAAW,cAAc,cAAc,IAC5C,KAAK,WAAW,cAAc,cAAc,EAAE,UAAYE,GAC9D,KACH,CACD,IAAK,QAAS,CACV,IAAIhB,EAAY,KAAK,UAAU,SAAQ,EACnC,KAAK,cAAc,+DAA+D,IAClFA,GAAa,mBACjB,KAAK,WAAW,cAAc,OAAO,EAAE,aAAa,QAAS,QAAQA,GAAW,EAChF,KACH,CACJ,CACJ,CACL"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
|
-
*/function
|
|
4
|
+
*/function p(e,o){var i;let t=e.querySelector(".carousel__inner"),h=e.querySelector(".carousel__controls"),a=o.querySelectorAll(":scope > .col").length;t.addEventListener("scroll",function(n){clearTimeout(i),i=setTimeout(function(){let s=t.clientWidth,r=t.scrollWidth,c=t.scrollLeft,d=Math.round(c/r*a)+1,b=o.querySelector(":scope > .col").scrollWidth,u=o.querySelector(":scope > .col:last-child").offsetLeft,m=t.scrollLeft+s>=u+100,l=Math.round(s/b);Math.ceil(a/l)*l-a>0&&m&&(d=Math.floor(a/l)*l+1),Array.from(e.querySelectorAll(".carousel__controls button")).forEach((_,w)=>{_.removeAttribute("aria-current")}),e.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?e.querySelector(".btn-prev").setAttribute("disabled","disabled"):e.querySelector(".btn-prev").removeAttribute("disabled"),d>a-l?e.querySelector(".btn-next").setAttribute("disabled","disabled"):e.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),h.addEventListener("click",function(n){for(var s=n.target;s&&s!=this;s=s.parentNode)if(typeof s.matches=="function"&&s.matches("button")){n.preventDefault(),Array.from(h.querySelectorAll("button")).forEach((c,d)=>{c.removeAttribute("aria-current")}),s.setAttribute("aria-current",!0);const r=o.querySelector(`:scope > *:nth-child(${s.getAttribute("data-slide")})`);t.scroll({top:0,left:r.offsetLeft-100,behavior:"smooth"});break}},!1),e.addEventListener("click",function(n){let s=t.clientWidth;t.scrollWidth;let r=o.querySelector(":scope > .col").scrollWidth,c=Math.round(s/r),d=o.querySelector(":scope > .col:last-child").offsetLeft,b=t.scrollLeft+s>=d+100,u=Math.ceil(a/c)*c-a,m=b&&u>0?u*r:t.clientWidth;for(var l=n.target;l&&l!=this;l=l.parentNode)if(typeof l.matches=="function"&&l.matches(".btn-next, .btn-prev")){n.preventDefault();let f=l.classList.contains("btn-prev")?t.scrollLeft-m:t.scrollLeft+t.clientWidth;t.scroll({top:0,left:f,behavior:"smooth"});break}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"carousel"});class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",i=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
6
|
-
@import "${
|
|
7
|
-
.carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{overflow:hidden;margin-inline:auto}.carousel .carousel__controls:not(.thumbnails){
|
|
6
|
+
@import "${i}";
|
|
7
|
+
.carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{overflow:hidden;margin-inline:auto}.carousel .carousel__controls:not(.thumbnails){text-align:center;max-width:30rem}.carousel .carousel__controls.thumbnails{margin-block-start:2rem}@media screen and (min-width: 36em){.carousel .carousel__controls{width:100%}}.carousel .carousel__controls button{padding:0;margin:0 .2rem .2rem;border:3px solid var(--colour-canvas);border-radius:4px}.carousel .carousel__controls button.has-thumbnail{height:4.625rem}.carousel .carousel__controls button.has-thumbnail img{height:100%;width:auto}.carousel .carousel__controls button:not(.has-thumbnail){width:1rem;height:1rem;min-height:1rem;border-radius:50%;text-indent:-50rem;overflow:hidden;background:var(--colour-primary-theme);margin:0 .5rem .5rem .5rem;border:none}.carousel .carousel__controls button:not(.has-thumbnail):before{display:none}.carousel .carousel__controls button:first-child:last-child{display:none}.carousel__controls>button[aria-current]{--colour-active-thumbnail: var(--colour-info);border-color:var(--colour-active-thumbnail)}.carousel__controls>button[aria-current]:not(.has-thumbnail){background:var(--colour-success)}.carousel.hide-btns .carousel__wrapper>.btn{display:none}.carousel.hide-controls .carousel__controls{display:none}@media screen and (min-width: 36em){[data-row-class*=cols-sm-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-sm-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-sm-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-sm-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-sm-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none}[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}@media screen and (min-width: 62em){.carousel__controls>button{display:inline-block !important}[data-row-class*=cols-md-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-md-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-md-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-md-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-md-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none !important}[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}/*# sourceMappingURL=assets/css/components/carousel.css.map */
|
|
8
8
|
|
|
9
9
|
${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
|
|
10
10
|
</style>
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
|
-
`,this.shadowRoot.appendChild(
|
|
27
|
+
`,this.shadowRoot.appendChild(t.content.cloneNode(!0))}connectedCallback(){const o=this.shadowRoot.querySelector(".carousel"),i=this.querySelector(".row"),t=JSON.parse(this.dataset.thumbnails),h=this.shadowRoot.querySelector(".carousel__controls");let a=this.querySelectorAll(":scope > .row > .col").length;o.setAttribute("data-row-class",i.className),this.classList.contains("hide-btns")&&o.classList.add("hide-btns"),this.classList.contains("hide-controls")&&o.classList.add("hide-controls"),t?.length&&h.classList.add("thumbnails");let n="";for(let s=1;s<=a;s++){let r=null,c="";t.length?(c="has-thumbnail",r=`<img src="${t[s-1].src}" alt="Slide ${s}" height="148"/>`):r=`Slide ${s}`,n+=`<button class="control-${s} ${c}" data-slide="${s}" ${s==1?"aria-current":""}>${r}</button>`}h.innerHTML=n,p(o,i)}}export{v as default};
|
|
28
28
|
//# sourceMappingURL=carousel.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.component.min.js","sources":["../../modules/carousel.js","carousel.component.js"],"sourcesContent":["// @ts-nocheck\nfunction carousel(carouselElement, row) {\n var scrollTimeout;\n let carouselInner = carouselElement.querySelector('.carousel__inner');\n let carouselControls = carouselElement.querySelector('.carousel__controls');\n let itemCount = row.querySelectorAll(':scope > .col').length;\n // On scroll we need to make sure the buttons get corrected and the next testimonial is shown\n carouselInner.addEventListener('scroll', function (e) {\n clearTimeout(scrollTimeout);\n scrollTimeout = setTimeout(function () {\n let scrollArea = carouselInner.clientWidth;\n let scrollWidth = carouselInner.scrollWidth;\n let scrollLeft = carouselInner.scrollLeft;\n let targetSlide = Math.round((scrollLeft / scrollWidth) * itemCount) + 1;\n let lastItemOffset = row.querySelector(':scope > .col:last-child').offsetLeft - 50;\n let itemWidth = row.querySelector(':scope > .col').scrollWidth;\n let visibleItems = Math.round(scrollArea / itemWidth);\n if (carouselInner.scrollLeft + scrollArea >= lastItemOffset) {\n targetSlide = (Math.floor(itemCount / visibleItems) * visibleItems) + 1;\n }\n Array.from(carouselElement.querySelectorAll('.carousel__controls button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n carouselElement.querySelector('.control-' + targetSlide).setAttribute('aria-current', true);\n // Disable the previous button\n if (targetSlide == 1)\n carouselElement.querySelector('.btn-prev').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-prev').removeAttribute('disabled');\n // Disable the next button if the last item is in view\n if (targetSlide == itemCount)\n carouselElement.querySelector('.btn-next').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-next').removeAttribute('disabled');\n }, 100);\n }, false);\n // when the buttons are used we need to make sure the carousel scrolls to the correct place\n carouselControls.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('button')) {\n e.preventDefault();\n Array.from(carouselControls.querySelectorAll('button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n target.setAttribute('aria-current', true);\n const el = row.querySelector(`:scope > *:nth-child(${target.getAttribute('data-slide')})`);\n carouselInner.scroll({\n top: 0,\n left: el.offsetLeft - 100,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n carouselElement.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('.btn-next, .btn-prev')) {\n e.preventDefault();\n let scrollTo = target.classList.contains('btn-prev') ? carouselInner.scrollLeft - carouselInner.clientWidth : carouselInner.scrollLeft + carouselInner.clientWidth;\n carouselInner.scroll({\n top: 0,\n left: scrollTo,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n}\nexport default carousel;\n","// @ts-nocheck\nimport carousel from \"../../modules/carousel.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"carousel\"\n});\nclass iamCarousel extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/carousel.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"carousel\" :id=\"'carousel'+id\">\n <div class=\"carousel__wrapper\">\n <div class=\"carousel__inner\">\n \n <slot></slot>\n </div>\n \n <div class=\"carousel__controls\" part=\"controls\">\n \n </div>\n\n <button class=\"btn btn-prev\" data-go=\"0\" disabled part=\"prev\">Prev</button>\n <button class=\"btn btn-next\" data-go=\"2\" part=\"next\">Next</button>\n\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n const carouselElement = this.shadowRoot.querySelector('.carousel');\n const row = this.querySelector('.row');\n const thumbnailImages = JSON.parse(this.dataset.thumbnails);\n const carouselControls = this.shadowRoot.querySelector('.carousel__controls');\n let itemCount = this.querySelectorAll(':scope > .row > .col').length;\n carouselElement.setAttribute('data-row-class', row.className);\n if (this.classList.contains('hide-btns'))\n carouselElement.classList.add('hide-btns');\n if (this.classList.contains('hide-controls'))\n carouselElement.classList.add('hide-controls');\n if (thumbnailImages === null || thumbnailImages === void 0 ? void 0 : thumbnailImages.length) {\n carouselControls.classList.add('thumbnails');\n }\n // populate the pips\n let pips = \"\";\n for (let i = 1; i <= itemCount; i++) {\n let pipContent = null;\n let pipClass = '';\n if (thumbnailImages.length) {\n pipClass = 'has-thumbnail';\n pipContent = `<img src=\"${thumbnailImages[i - 1].src}\" alt=\"Slide ${i}\" height=\"148\"/>`;\n }\n else {\n pipContent = `Slide ${i}`;\n }\n pips += `<button class=\"control-${i} ${pipClass}\" data-slide=\"${i}\" ${i == 1 ? \"aria-current\" : \"\"}>${pipContent}</button>`;\n }\n carouselControls.innerHTML = pips;\n carousel(carouselElement, row);\n }\n}\nexport default iamCarousel;\n"],"names":["carousel","carouselElement","row","scrollTimeout","carouselInner","carouselControls","itemCount","e","scrollArea","scrollWidth","scrollLeft","targetSlide","lastItemOffset","itemWidth","visibleItems","button","index","target","el","scrollTo","iamCarousel","assetLocation","coreCSS","template","thumbnailImages","pips","i","pipContent","pipClass"],"mappings":";;;IACA,SAASA,EAASC,EAAiBC,EAAK,CACpC,IAAIC,EACJ,IAAIC,EAAgBH,EAAgB,cAAc,kBAAkB,EAChEI,EAAmBJ,EAAgB,cAAc,qBAAqB,EACtEK,EAAYJ,EAAI,iBAAiB,eAAe,EAAE,OAEtDE,EAAc,iBAAiB,SAAU,SAAUG,EAAG,CAClD,aAAaJ,CAAa,EAC1BA,EAAgB,WAAW,UAAY,CACnC,IAAIK,EAAaJ,EAAc,YAC3BK,EAAcL,EAAc,YAC5BM,EAAaN,EAAc,WAC3BO,EAAc,KAAK,MAAOD,EAAaD,EAAeH,CAAS,EAAI,EACnEM,EAAiBV,EAAI,cAAc,0BAA0B,EAAE,WAAa,GAC5EW,EAAYX,EAAI,cAAc,eAAe,EAAE,YAC/CY,EAAe,KAAK,MAAMN,EAAaK,CAAS,EAChDT,EAAc,WAAaI,GAAcI,IACzCD,EAAe,KAAK,MAAML,EAAYQ,CAAY,EAAIA,EAAgB,GAE1E,MAAM,KAAKb,EAAgB,iBAAiB,4BAA4B,CAAC,EAAE,QAAQ,CAACc,EAAQC,IAAU,CAClGD,EAAO,gBAAgB,cAAc,CACrD,CAAa,EACDd,EAAgB,cAAc,YAAcU,CAAW,EAAE,aAAa,eAAgB,EAAI,EAEtFA,GAAe,EACfV,EAAgB,cAAc,WAAW,EAAE,aAAa,WAAY,UAAU,EAE9EA,EAAgB,cAAc,WAAW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MC,aAE1GtB,EAAiB,UAAYoB,EAC7BzB,EAASC,EAAiBC,CAAG,CAChC,CACL"}
|
|
1
|
+
{"version":3,"file":"carousel.component.min.js","sources":["../../modules/carousel.js","carousel.component.js"],"sourcesContent":["// @ts-nocheck\nfunction carousel(carouselElement, row) {\n var scrollTimeout;\n let carouselInner = carouselElement.querySelector('.carousel__inner');\n let carouselControls = carouselElement.querySelector('.carousel__controls');\n let itemCount = row.querySelectorAll(':scope > .col').length;\n // On scroll we need to make sure the buttons get corrected and the next testimonial is shown\n carouselInner.addEventListener('scroll', function (e) {\n clearTimeout(scrollTimeout);\n scrollTimeout = setTimeout(function () {\n let scrollArea = carouselInner.clientWidth;\n let scrollWidth = carouselInner.scrollWidth;\n let scrollLeft = carouselInner.scrollLeft;\n let targetSlide = Math.round((scrollLeft / scrollWidth) * itemCount) + 1;\n let itemWidth = row.querySelector(':scope > .col').scrollWidth;\n let lastItemOffset = row.querySelector(':scope > .col:last-child').offsetLeft;\n let lastItemInView = carouselInner.scrollLeft + scrollArea >= (lastItemOffset + 100);\n let visibleItems = Math.round(scrollArea / itemWidth);\n //Check if theres room for more slides than we have\n let leftOverSpace = (Math.ceil(itemCount / visibleItems) * visibleItems) - itemCount;\n if (leftOverSpace > 0 && lastItemInView) {\n targetSlide = (Math.floor(itemCount / visibleItems) * visibleItems) + 1;\n }\n Array.from(carouselElement.querySelectorAll('.carousel__controls button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n carouselElement.querySelector('.control-' + targetSlide).setAttribute('aria-current', true);\n // Disable the previous button\n if (targetSlide == 1)\n carouselElement.querySelector('.btn-prev').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-prev').removeAttribute('disabled');\n // Disable the next button if the last item is in view\n if (targetSlide > (itemCount - visibleItems))\n carouselElement.querySelector('.btn-next').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-next').removeAttribute('disabled');\n }, 100);\n }, false);\n // when the buttons are used we need to make sure the carousel scrolls to the correct place\n carouselControls.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('button')) {\n e.preventDefault();\n Array.from(carouselControls.querySelectorAll('button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n target.setAttribute('aria-current', true);\n const el = row.querySelector(`:scope > *:nth-child(${target.getAttribute('data-slide')})`);\n carouselInner.scroll({\n top: 0,\n left: el.offsetLeft - 100,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n carouselElement.addEventListener('click', function (e) {\n let scrollArea = carouselInner.clientWidth;\n let scrollWidth = carouselInner.scrollWidth;\n let itemWidth = row.querySelector(':scope > .col').scrollWidth;\n let visibleItems = Math.round(scrollArea / itemWidth);\n let lastItemOffset = row.querySelector(':scope > .col:last-child').offsetLeft;\n let lastItemInView = carouselInner.scrollLeft + scrollArea >= (lastItemOffset + 100);\n //Check if theres room for more slides than we have\n let leftOverSpace = (Math.ceil(itemCount / visibleItems) * visibleItems) - itemCount;\n let movement = lastItemInView && leftOverSpace > 0 ? leftOverSpace * itemWidth : carouselInner.clientWidth;\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('.btn-next, .btn-prev')) {\n e.preventDefault();\n let scrollTo = target.classList.contains('btn-prev') ? carouselInner.scrollLeft - movement : carouselInner.scrollLeft + carouselInner.clientWidth;\n carouselInner.scroll({\n top: 0,\n left: scrollTo,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n}\nexport default carousel;\n","// @ts-nocheck\nimport carousel from \"../../modules/carousel.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"carousel\"\n});\nclass iamCarousel extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/carousel.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"carousel\" :id=\"'carousel'+id\">\n <div class=\"carousel__wrapper\">\n <div class=\"carousel__inner\">\n \n <slot></slot>\n </div>\n \n <div class=\"carousel__controls\" part=\"controls\">\n \n </div>\n\n <button class=\"btn btn-prev\" data-go=\"0\" disabled part=\"prev\">Prev</button>\n <button class=\"btn btn-next\" data-go=\"2\" part=\"next\">Next</button>\n\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n const carouselElement = this.shadowRoot.querySelector('.carousel');\n const row = this.querySelector('.row');\n const thumbnailImages = JSON.parse(this.dataset.thumbnails);\n const carouselControls = this.shadowRoot.querySelector('.carousel__controls');\n let itemCount = this.querySelectorAll(':scope > .row > .col').length;\n carouselElement.setAttribute('data-row-class', row.className);\n if (this.classList.contains('hide-btns'))\n carouselElement.classList.add('hide-btns');\n if (this.classList.contains('hide-controls'))\n carouselElement.classList.add('hide-controls');\n if (thumbnailImages === null || thumbnailImages === void 0 ? void 0 : thumbnailImages.length) {\n carouselControls.classList.add('thumbnails');\n }\n // populate the pips\n let pips = \"\";\n for (let i = 1; i <= itemCount; i++) {\n let pipContent = null;\n let pipClass = '';\n if (thumbnailImages.length) {\n pipClass = 'has-thumbnail';\n pipContent = `<img src=\"${thumbnailImages[i - 1].src}\" alt=\"Slide ${i}\" height=\"148\"/>`;\n }\n else {\n pipContent = `Slide ${i}`;\n }\n pips += `<button class=\"control-${i} ${pipClass}\" data-slide=\"${i}\" ${i == 1 ? \"aria-current\" : \"\"}>${pipContent}</button>`;\n }\n carouselControls.innerHTML = pips;\n carousel(carouselElement, row);\n }\n}\nexport default iamCarousel;\n"],"names":["carousel","carouselElement","row","scrollTimeout","carouselInner","carouselControls","itemCount","e","scrollArea","scrollWidth","scrollLeft","targetSlide","itemWidth","lastItemOffset","lastItemInView","visibleItems","button","index","target","el","leftOverSpace","movement","scrollTo","iamCarousel","assetLocation","coreCSS","template","thumbnailImages","pips","i","pipContent","pipClass"],"mappings":";;;IACA,SAASA,EAASC,EAAiBC,EAAK,CACpC,IAAIC,EACJ,IAAIC,EAAgBH,EAAgB,cAAc,kBAAkB,EAChEI,EAAmBJ,EAAgB,cAAc,qBAAqB,EACtEK,EAAYJ,EAAI,iBAAiB,eAAe,EAAE,OAEtDE,EAAc,iBAAiB,SAAU,SAAUG,EAAG,CAClD,aAAaJ,CAAa,EAC1BA,EAAgB,WAAW,UAAY,CACnC,IAAIK,EAAaJ,EAAc,YAC3BK,EAAcL,EAAc,YAC5BM,EAAaN,EAAc,WAC3BO,EAAc,KAAK,MAAOD,EAAaD,EAAeH,CAAS,EAAI,EACnEM,EAAYV,EAAI,cAAc,eAAe,EAAE,YAC/CW,EAAiBX,EAAI,cAAc,0BAA0B,EAAE,WAC/DY,EAAiBV,EAAc,WAAaI,GAAeK,EAAiB,IAC5EE,EAAe,KAAK,MAAMP,EAAaI,CAAS,EAE/B,KAAK,KAAKN,EAAYS,CAAY,EAAIA,EAAgBT,EACvD,GAAKQ,IACrBH,EAAe,KAAK,MAAML,EAAYS,CAAY,EAAIA,EAAgB,GAE1E,MAAM,KAAKd,EAAgB,iBAAiB,4BAA4B,CAAC,EAAE,QAAQ,CAACe,EAAQC,IAAU,CAClGD,EAAO,gBAAgB,cAAc,CACrD,CAAa,EACDf,EAAgB,cAAc,YAAcU,CAAW,EAAE,aAAa,eAAgB,EAAI,EAEtFA,GAAe,EACfV,EAAgB,cAAc,WAAW,EAAE,aAAa,WAAY,UAAU,EAE9EA,EAAgB,cAAc,WAAW,EAAE,gBAAgB,UAAU,EAErEU,EAAeL,EAAYS,EAC3Bd,EAAgB,cAAc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EAG/C,IAAIuB,EAAO,GACX,QAASC,EAAI,EAAGA,GAAKvB,EAAWuB,IAAK,CACjC,IAAIC,EAAa,KACbC,EAAW,GACXJ,EAAgB,QAChBI,EAAW,gBACXD,EAAa,aAAaH,EAAgBE,EAAI,CAAC,EAAE,mBAAmBA,qBAGpEC,EAAa,SAASD,IAE1BD,GAAQ,0BAA0BC,KAAKE,kBAAyBF,MAAMA,GAAK,EAAI,eAAiB,MAAMC,aAE1GzB,EAAiB,UAAYuB,EAC7B5B,EAASC,EAAiBC,CAAG,CAChC,CACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class a extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function v(d,i){const o=i.querySelector(".files"),n=i.querySelector(".drop-area"),e=d.querySelector("input"),f=d.hasAttribute("data-maxsize")?d.getAttribute("data-maxsize"):0,u=i.querySelector(".invalid-feedback.size"),h=i.querySelector(".invalid-feedback.ext"),s=e.cloneNode();n.append(s);let b=function(t){if(!e.hasAttribute("accept"))return!0;const r=t.split(".").pop();return!!e.getAttribute("accept").includes(r)};if(i.addEventListener("click",t=>{t&&t.target instanceof HTMLElement&&t.target.closest(".btn-primary")&&(t.target.closest(".btn-primary"),h.classList.remove("d-block"),u.classList.remove("d-block"),(e.hasAttribute("multiple")?s:e).click())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest(".files button")){const r=new DataTransfer,{files:a}=e,m=t.target.closest(".files button");for(let p=0;p<a.length;p++){const l=a[p];l.name!=m.getAttribute("data-file")&&r.items.add(l)}e.files=r.files;const c=new Event("change");e.dispatchEvent(c)}}),s.addEventListener("change",t=>{if(e.hasAttribute("multiple")){const a=[...e.files,...s.files];let m=[];const c=new DataTransfer;for(let p=0;p<a.length;p++){const l=a[p],g=l.size/1e3;!m.includes(l.name)&&(f==0||g<f)&&b(l.name)&&c.items.add(l),b(l.name)||h.classList.add("d-block"),g>f&&u.classList.add("d-block"),m.push(l.name)}e.files=c.files}else e.files=s.files;const r=new Event("change");e.dispatchEvent(r)}),s.addEventListener("dragenter",t=>{s.classList.add("focus")}),s.addEventListener("dragleave",t=>{s.classList.remove("focus")}),s.addEventListener("drop",t=>{s.classList.remove("focus")}),e.addEventListener("change",t=>{if(e.files.length==1){let a=e.files[0];const m=a.size/1e3;if(!b(a.name)){h.classList.add("d-block");const c=new DataTransfer;e.files=c.files}if(m>f){u.classList.add("d-block");const c=new DataTransfer;e.files=c.files}}o.innerHTML="";for(const a of e.files)o.innerHTML+=`<span class="file" part="file">${a.name} <button data-file="${a.name}">Remove</button></span>`;const r=new CustomEvent("elementchange",{detail:{files:e.files}});if(d.dispatchEvent(r),e.files.length==0){const a=new CustomEvent("empty");d.dispatchEvent(a)}}),d.hasAttribute("data-filename")){let t=d.getAttribute("data-filename");t&&(o.innerHTML=`<span class="file">${t} <button data-file="${t}">Remove</button></span>`)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function i(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let r=e.textContent.toLowerCase();e.classList.add("d-none"),r.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"inline edit"});class b extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",d=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Marketing"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",i=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"mutliselect"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",s=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class v extends HTMLElement{constructor(){super();const s=this.attachShadow({mode:"open"}),n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/function r(i){if(i.hasAttribute("data-type")&&i.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),a(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var n=new c(function(){a(i)},t);i.addEventListener("mouseenter",o=>{n.pause()}),i.addEventListener("mouseleave",o=>{n.resume()})}}function c(i,n){var t,o,e=n;this.pause=function(){window.clearTimeout(t),e-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,e)},this.resume()}const a=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/import k from"js-cookie";const q=e=>e.replace(/ /g,"_"),x=function(e){return e=e.toLowerCase(),e=q(e),e=e.replace(/\W/g,""),e},m=(e,s,a)=>s.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,d)=>o?o[d]:a,e),S=e=>Array.isArray(e)||e!==null&&["function","object"].includes(typeof e);var L=function(e,s,a,o){function d(c){return c instanceof a?c:new a(function(n){n(c)})}return new(a||(a=Promise))(function(c,n){function v(r){try{u(o.next(r))}catch(i){n(i)}}function t(r){try{u(o.throw(r))}catch(i){n(i)}}function u(r){r.done?c(r.value):d(r.value).then(v,t)}u((o=o.apply(e,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Search"});class C extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${s}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Slider"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",p=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const B=function(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))},Q=(o,e)=>String(o).padStart(e,"0"),X=o=>o.charAt(0).toUpperCase()+o.slice(1),S=(o,e,n)=>e.split(/[\.\[\]\'\"]/).filter(a=>a).reduce((a,h)=>a?a[h]:n,o);var Y=function(o,e,n,a){function h(d){return d instanceof n?d:new n(function(i){i(d)})}return new(n||(n=Promise))(function(d,i){function l(c){try{t(a.next(c))}catch(r){i(r)}}function s(c){try{t(a.throw(c))}catch(r){i(r)}}function t(c){c.done?d(c.value):h(c.value).then(l,s)}t((a=a.apply(o,e||[])).next())})};const R=o=>{const e=Array.from(o.querySelectorAll("thead th"));Array.from(o.querySelectorAll("tbody tr")).forEach((a,h)=>{const d=Array.from(a.querySelectorAll("th, td")),i=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];d.forEach((l,s)=>{const t=e[s];if(typeof t<"u"){let c=document.createElement("div");c.innerHTML=t.innerHTML;let r=c.textContent||c.innerText||"";l.setAttribute("data-label",r),t.hasAttribute("data-td-class")&&l.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(l.setAttribute("data-format",t.getAttribute("data-format")),l.innerHTML=D(t.getAttribute("data-format"),l.textContent.trim())),i.includes(l.textContent.trim().toLowerCase())&&l.setAttribute("data-content",l.textContent.trim().toLowerCase())}})})},J=o=>{let e=0;return Array.from(o.querySelectorAll("tbody tr")).forEach((n,a)=>{let h=window.getComputedStyle(document.querySelector("html")),d=n.querySelector(":scope > *:last-child > *:first-child");if(d){d.classList.add("text-nowrap");let i=d.offsetWidth/parseFloat(h.fontSize);i+=1.7,e=e>i?e:i}}),e},G=(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((n,a)=>{o.querySelectorAll("thead tr th.expand-button-heading").length||n.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(o.querySelectorAll("tbody tr")).forEach((n,a)=>{const h=n.getAttribute("data-view")==="full"?"aria-expanded":"";n.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${h}>Expand</button></td>`)})},V=o=>{o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let n=e.target.closest("[data-expand-button]"),a=n.closest("tr");n.toggleAttribute("aria-expanded"),a.getAttribute("data-view")=="full"?a.setAttribute("data-view","default"):a.setAttribute("data-view","full"),n.blur()}})},N=(o,e)=>{let n=e.querySelector("input[data-search]");if(!n)return!1;const a=n.getAttribute("id"),h=n.getAttribute("data-search").split(",");let d=n.parentNode,i={};h.forEach((l,s)=>{Array.from(o.querySelectorAll('td[data-label="'+l.trim()+'"]')).forEach((t,c)=>{t.querySelector(".td__content")?i[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:i[t.textContent]=t.textContent})}),n.setAttribute("list",`${a}_list`),n.setAttribute("autocomplete","off"),d.querySelector("datalist")||(d.innerHTML+=`<datalist id="${a}_list"></datalist>`),d.querySelector("datalist").innerHTML=`${Object.keys(i).map(l=>`<option value="${l}"></option>`).join("")}`},K=(o,e,n,a,h)=>{var d;let i=function(t,c=!1){if(a.hasAttribute("data-no-submit")||e.classList.contains("processing"))return!1;if(Array.from(e.querySelectorAll("iam-applied-filters")).forEach((r,p)=>{var u=new Event("tags-set");r.dispatchEvent(u)}),t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((r,p)=>{const u=r.getAttribute("data-duplicate"),b=document.getElementById(u),y=document.querySelector(`[for="${u}"] iam-card`);if(b.checked!=r.checked)if(y){let w=new Event("click");y.dispatchEvent(w)}else b.checked=r.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!c){let r=e.querySelector("[data-pagination]");r.value=1,a.setAttribute("data-page",1)}I(o,e,n,a)}else e.hasAttribute("data-submit")?e.submit():(C(o,e,a),$(o,e));if(e.hasAttribute("data-ajax-post")){let r=new FormData(e),p=new URLSearchParams(r).toString();const u=new XMLHttpRequest;u.open("GET",`${window.location.href}?ajax=true&${p}`),u.send()}};e.querySelector("iam-actionbar[data-search]")&&e.querySelector("iam-actionbar[data-search]").addEventListener("search-submit",t=>{e.querySelector("input[data-search]")?e.querySelector("input[data-search]").value=t.detail.search:e.insertAdjacentHTML("beforeend",`<input type="hidden" name="search" data-search="${e.querySelector("iam-actionbar[data-search]").getAttribute("data-search")}" value="${t.detail.search}"/>`),clearTimeout(d),i(t)}),e.addEventListener("keyup",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&(d=setTimeout(function(){i(t)},500))}),e.addEventListener("change",t=>{if(clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(o,e,h),i(t)),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(o,e,a),$(o,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.hasAttribute("id")){let c=t.target.getAttribute("id");document.querySelector(`[data-duplicate="${c}"]`)&&(document.querySelector(`[data-duplicate="${c}"]`).checked=t.target.checked)}}),e.addEventListener("click",t=>{if(clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((r,p)=>{r.innerHTML=""});let c=e.elements;for(let r=0;r<c.length;r++)switch(c[r].type.toLowerCase()?c[r].type.toLowerCase():"text"){case"text":case"password":case"textarea":c[r].value="";break;case"radio":case"checkbox":if(c[r].checked){let u=c[r],b=u.getAttribute("id"),y=document.querySelector(`[for="${b}"`);if(y.querySelector("iam-card")){let w=y.querySelector("iam-card"),L=new Event("click");w.dispatchEvent(L)}u.checked=!1}break;case"select-one":case"select-multi":c[r].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(o,e,h),i(t)}}),e.addEventListener("submit",t=>{clearTimeout(d),e.hasAttribute("data-submit")||t.preventDefault(),i(t)}),e.addEventListener("force",t=>{i(t)}),e.addEventListener("paginate",t=>{i(t,!0)});let l=[],s=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,c)=>{let r=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${r}"]`)).forEach((p,u)=>{let b=p.closest("form");l.includes(b)||l.push(b),s.includes(r)||s.push(r)})}),l.forEach((t,c)=>{const r=function(){let p=[],u=new FormData(t);for(const[b,y]of u)document.querySelector(`[data-mimic="${b}"]`)&&!p.includes(b)?(p.push(b),document.querySelector(`[data-mimic="${b}"]`).value=y):document.querySelector(`[data-mimic="${b}"]`)&&(document.querySelector(`[data-mimic="${b}"]`).value+=","+y);for(const b of p){const y=new Event("force");e.dispatchEvent(y)}for(const b of s)if(!u.has(b)&&t.querySelector(`[name="${b}"]`)){document.querySelector(`[data-mimic="${b}"]`).value="";const y=new Event("force");e.dispatchEvent(y)}};t.addEventListener("force",p=>{r()}),t.addEventListener("change",p=>{r()})})},O=(o,e,n)=>{if(e.getAttribute("data-ajax"))return!1;let a=o.querySelector("tbody"),h=e.querySelector('input[type="radio"][data-sort]:checked');if(e.querySelector("select[data-sort]")){let r=e.querySelector("select[data-sort]");h=e.querySelector(`select[data-sort] option:nth-child(${r.selectedIndex+1})`)}let d=h.getAttribute("data-sort"),i=h.getAttribute("data-order"),l=h.getAttribute("data-format");if(!d)return a.innerHTML=n.innerHTML,R(o),!1;let s=[];["asc","desc","descending"].includes(i)||(s=i.split(","));let t=[];Array.from(a.querySelectorAll("tr")).forEach((r,p)=>{let u=r.querySelector('td[data-label="'+d+'"], th[data-label="'+d+'"]').textContent.trim();r.querySelector('[data-label="'+d+'"] .td__content')&&(u=r.querySelector('[data-label="'+d+'"] .td__content').textContent.trim()),s.length&&s.includes(u)&&(u=s.indexOf(u)),B(u)&&(u=Q(u,10)),l&&l=="date"&&(u=new Date(u));const b={index:u,row:r};t.push(b)}),t.sort((r,p)=>r.index>p.index?1:-1),(i=="descending"||i=="desc")&&(t=t.reverse());let c="";t.forEach((r,p)=>{c+=r.row.outerHTML}),a.innerHTML=c},C=(o,e,n)=>{o.classList.remove("table--filtered");let a=z(e),h=[],d=0,i=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,l=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(o.querySelectorAll("tbody tr")).forEach((t,c)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("input[data-search]")){let t=e.querySelector("input[data-search]");e.querySelector("input[data-search]").getAttribute("data-search").split(",").forEach((r,p)=>{h.push({column:`${r.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let s=0;Object.values(a).forEach((t,c)=>{typeof t=="object"&&Object.values(t).length?s+=Object.values(t).length:s++}),s&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML+=`(${s})`,t.parentNode.classList.add("hover")}),o.classList.add("table--filtered");for(const[t,c]of Object.entries(a))Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((r,p)=>{let u=!1;c.forEach((b,y)=>{let w=r.querySelector(`[data-label="${t}"]`);if(b.includes("-date-from")){let f=new Date(b.replace("-date-from","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g<f?(r.classList.add("less-than-from-date"),u=!1):!r.classList.contains("less-than-from-date")&&!r.classList.contains("greater-than-to-date")&&(u=!0)}else if(b.includes("-date-to")){let f=new Date(b.replace("-date-to","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g>f?(r.classList.add("greater-than-to-date"),u=!1):!r.classList.contains("less-than-from-date")&&!r.classList.contains("greater-than-to-date")&&(u=!0)}if(b&&b=="$today")b=D("date",new Date);else if(b&&b=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),b=D("date",f)}else if(b&&(b=="$thisWeek"||b=="$lastWeek")){let f=new Date,g=new Date(f.setDate(f.getDate()-(f.getDay()-1))),m=new Date(f.setDate(f.getDate()-f.getDay()+7)),x=new Date(w.textContent.toLowerCase());if(f.setHours(0,0,0,0),g.setHours(0,0,0,0),m.setHours(0,0,0,0),x.setHours(0,0,0,0),b=="$thisWeek")u=x>=g&&x<=m;else{let A=new Date(g.setDate(g.getDate()-7)),k=new Date(m.setDate(m.getDate()-7));A.setHours(0,0,0,0),k.setHours(0,0,0,0),u=x>=A&&x<=k}}else if(b&&b=="$thisMonth"){let f=new Date,g=f.getFullYear(),m=f.getMonth();var L=new Date(g,m,1),q=new Date(g,m+1,0);let x=new Date(w.textContent.toLowerCase());L.setHours(0,0,0,0),q.setHours(0,0,0,0),x.setHours(0,0,0,0),u=x>=L&&x<=q}else if(b&&b=="$lastMonth"){let f=new Date,g=f.getFullYear(),m=f.getMonth();var E=new Date(g,m-1,1),v=new Date(g,m,0);let x=new Date(w.textContent.toLowerCase());E.setHours(0,0,0,0),v.setHours(0,0,0,0),x.setHours(0,0,0,0),u=x>=E&&x<=v}w&&w.textContent.toLowerCase().includes(b.replace("-"," ").toLowerCase())&&(u=!0)}),u||(r.classList.add("filtered"),r.setAttribute("data-filtered-by",t))});Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,c)=>{let r=!(h.length>0&&h[0].value.length>=3);h.forEach((p,u)=>{let b=t.querySelector(`[data-label="${p.column}"]`);b&&p.value.length>=3&&b.textContent.toLowerCase().includes(p.value.toLowerCase())&&(r=!0)}),r||t.classList.add("filtered")}),Array.from(o.querySelectorAll("tbody tr:not(.filtered")).forEach((t,c)=>{d++,t.classList.add("filtered--matched"),Math.ceil(d/l)==parseInt(i)&&t.classList.add("filtered--show")}),n&&(n.setAttribute("data-total",d),n.setAttribute("data-show",l),n.setAttribute("data-page",i))},$=(o,e,n)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((h,d)=>{let i=h.getAttribute("data-query"),l=0;if(i=="total")n.hasAttribute("data-total")?l=n.getAttribute("data-total"):l=(o.classList.contains("table--filtered"),o.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let s=i.split(" & "),t="";s.forEach(c=>{t+=`:not([data-filtered-by="${c}"])`}),l=Array.from(o.querySelectorAll(`tbody tr${t}`)).length}else if(!i.includes(" == "))l=Array.from(o.querySelectorAll(`tbody tr:not([data-filtered-by="${i}"])`)).length;else if(i.includes(" && ")){let s=i.split(" && ");l=Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let c=!0;for(const[r,p]of Object.entries(s)){let u=p.split(" == ");(!t.querySelector(`td[data-label="${u[0]}"]`)||t.querySelector(`td[data-label="${u[0]}"]`).textContent!=`${u[1]}`)&&(c=!1)}return c}).length}else{let s=i.split(" == ");l=Array.from(o.querySelectorAll(`tbody tr.filtered--matched td[data-label="${s[0]}"], tbody tr[data-filtered-by="${s[0]}"] td[data-label="${s[0]}"]`)).filter(function(t){return t.textContent===s[1]}).length}h.hasAttribute("data-total")?h.setAttribute("data-total",l):h.innerHTML=l})},Z=function(o,e,n,a){if(a.hasAttribute("data-no-submit"))return!1;n.addEventListener("update-page",h=>{let d=e.querySelector("[data-pagination]"),i=h.detail.page;if(d.value=i,e.dispatchEvent(new Event("paginate")),a.setAttribute("data-page",i),o.hasAttribute("data-show-history")){const l=new URL(location);l.searchParams.set("page",i),history.pushState({type:"pagination",form:e.getAttribute("id"),page:i},"",l)}if(!a.hasAttribute("data-no-scroll")){const s=o.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:s,behavior:"smooth"})}}),n.addEventListener("update-show",h=>{let d=e.querySelector("[data-show]"),i=h.detail.show;d.value=i,a.setAttribute("data-show",i),e.dispatchEvent(new Event("submit"))})},tt=(o,e)=>{if(!o)return!1;o.addEventListener("click",n=>{et(e)})},et=function(o){for(var e=[],n=o.getElementsByTagName("tr"),a=0;a<n.length;a++){for(var h=n[a].querySelectorAll("td,th"),d=[],i=0;i<h.length;i++)d.push(`"${h[i].textContent}"`);e.push(d.join(","))}e=e.join(`
|
|
5
5
|
`);let l=new Blob([e],{type:"text/csv"});var s=document.createElement("a");s.download="export.csv";var t=window.URL.createObjectURL(l);s.href=t,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},P=function(o,e,n,a){if(R(o),G(o,a),$(o,e,a),a&&a.classList.contains("table--cta")){let d=function(){Array.from(o.querySelectorAll("tr")).forEach((i,l)=>{let s=i.offsetHeight;i.style.setProperty("--row-height",`${s}px`)})};const h=J(o);a.style.setProperty("--cta-width",`${h}rem`),new ResizeObserver(d).observe(o)}},z=function(o){let e=new Object;return Array.from(o.querySelectorAll("[data-filter]")).forEach((a,h)=>{if(!(a.type=="radio"&&!a.checked)&&!(a.type=="checkbox"&&!a.checked)&&a&&a.value){let d=a.getAttribute("data-filter"),i=a.value;a.hasAttribute("data-date-from")&&(i+="-date-from"),a.hasAttribute("data-date-to")&&(i+="-date-to"),e[d]||(e[d]=new Array),e[d].push(i)}}),e},I=function(o,e,n,a){return Y(this,void 0,void 0,function*(){let h=new FormData(e),d=new URLSearchParams(h).toString(),i=o.querySelectorAll("thead tr th:not(.expand-button-heading)"),l=o.querySelector("tbody"),s=e.getAttribute("data-ajax");a.classList.add("table--loading");let t=z(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML="",p.parentNode.classList.remove("hover")});let c=0;Object.values(t).forEach((p,u)=>{typeof p=="object"&&Object.values(p).length?c+=Object.values(p).length:c++}),c&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML+=`(${c})`,p.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[s]&&window.controller[s].abort(),window.controller[s]=new AbortController;const{signal:r}=controller[s];n.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(s+"?"+d,{signal:r,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 u=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",b=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",y=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",w=S(p,b,15),L=S(p,y,1),q=S(p,u),E=a.hasAttribute("data-empty-msg")?a.getAttribute("data-empty-msg"):"No results found";q?(l.innerHTML="",q.forEach((v,f)=>{var g=document.createElement("tr");i.forEach((m,x)=>{let A="";var k=document.createElement("td");if(k.setAttribute("data-label",m.innerText),m.getAttribute("data-output")){var H=m.getAttribute("data-output");A=H.replace(new RegExp(/{(.*?)}/,"gm"),function(M){return S(v,M.replace("{","").replace("}",""))})}if(m.hasAttribute("data-output-array")){var H=m.getAttribute("data-output");let F=S(v,H.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=m.getAttribute("data-output-array"),T="";if(m.hasAttribute("data-output-array-property")&&m.hasAttribute("data-output-array-transform")){const _=S(j,m.getAttribute("data-output-array-property")),U=JSON.parse(m.getAttribute("data-output-array-transform"))[_];T=W.replace(`{${m.getAttribute("data-output-array-property")}}`,U)}T=T.replace(new RegExp(/{(.*?)}/,"gm"),function(_){return S(j,_.replace("{","").replace("}",""))}),A+=T})}m.hasAttribute("data-transform")&&(A=JSON.parse(m.getAttribute("data-transform"))[A],!A&&m.hasAttribute("data-default")&&(A=m.getAttribute("data-default"))),k.innerHTML=A,g.appendChild(k)}),l.appendChild(g)}),N(o,e),a.setAttribute("data-total",parseInt(w)),a.setAttribute("data-page",parseInt(L)),P(o,e,n,a),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((v,f)=>{let g=S(p,v.getAttribute("data-ajax-query"),"");v.hasAttribute("data-total")?v.setAttribute("data-total",g):v.innerHTML=g}),parseInt(w)==0&&(l.innerHTML=`<tr><td colspan="100%"><span>${E}</span></td></tr>`),a.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:s,formData:d})):l.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',n.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(p){console.log(p)}})},D=(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",{day:"numeric",month:"long",year:"2-digit"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",n=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.6.1-
|
|
2
|
+
* iamKey v5.6.1-beta20
|
|
3
3
|
* Copyright 2022-2024 iamproperty
|
|
4
4
|
*/const d=function(t){t.querySelectorAll(":scope > details");const o=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}let i=0;o.forEach((e,r)=>{let n=document.createElement("button");if(e.matches("details")){let s=e.querySelector(":scope > summary"),l=s.classList.contains("disabled");s.classList.add("visually-hidden"),e.hasAttribute("id")&&n.setAttribute("data-id",`${e.getAttribute("id")}`),e.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${s.innerText}`,n.classList.add("link"),n.setAttribute("data-index",i),e.setAttribute("tabindex","-1"),l&&n.classList.add("disabled"),i++}else e.matches("a")&&(n=e);n.classList.add("link"),a.appendChild(n)})},c=function(t){let o=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),i=t.querySelectorAll(":scope .tabs__links > button");t.shadowRoot&&(i=t.shadowRoot.querySelectorAll(".tabs__links > button")),i.forEach(e=>{e.addEventListener("click",r=>{if(r.preventDefault(),e.classList.contains("disabled"))return!1;i.forEach(n=>{let s=n==e;n.setAttribute("aria-pressed",s)}),o.forEach((n,s)=>{let l=e.getAttribute("data-index")==s;l?n.setAttribute("open",l):n.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})})}),a.forEach((e,r)=>{e.addEventListener("click",n=>{n.preventDefault(),i[r].click()})})},p=function(t){if(!t.querySelector(":scope > details"))return!1;let o=t.querySelectorAll(":scope > details"),a=t.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&t.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(t.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(o[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},b=function(t){d(t),c(t),p(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|