@iamproperty/components 7.2.0 → 7.2.1--beta2

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.
Files changed (126) hide show
  1. package/assets/css/components/actionbar.component.css +1 -1
  2. package/assets/css/components/actionbar.component.css.map +1 -1
  3. package/assets/css/components/actionbar.global.css +1 -1
  4. package/assets/css/components/actionbar.global.css.map +1 -1
  5. package/assets/css/components/barchart.component.css +1 -1
  6. package/assets/css/components/barchart.component.css.map +1 -1
  7. package/assets/css/components/card.component.css +1 -1
  8. package/assets/css/components/card.component.css.map +1 -1
  9. package/assets/css/components/carousel.component.css +1 -1
  10. package/assets/css/components/carousel.component.css.map +1 -1
  11. package/assets/css/components/doughnutchart.component.css +1 -1
  12. package/assets/css/components/doughnutchart.component.css.map +1 -1
  13. package/assets/css/components/pagination.css +1 -1
  14. package/assets/css/components/pagination.css.map +1 -1
  15. package/assets/css/components/table-basic.component.css +1 -0
  16. package/assets/css/components/table-basic.component.css.map +1 -0
  17. package/assets/css/components/table-basic.global.css +1 -0
  18. package/assets/css/components/table-basic.global.css.map +1 -0
  19. package/assets/css/components/table.component.css +1 -1
  20. package/assets/css/components/table.component.css.map +1 -1
  21. package/assets/css/components/table.global.css +1 -1
  22. package/assets/css/components/table.global.css.map +1 -1
  23. package/assets/css/components/tabs.config.css +1 -0
  24. package/assets/css/components/tabs.config.css.map +1 -0
  25. package/assets/css/components/tabs.css +1 -1
  26. package/assets/css/components/tabs.css.map +1 -1
  27. package/assets/css/core.min.css +1 -1
  28. package/assets/css/core.min.css.map +1 -1
  29. package/assets/css/mobile-core.min.css +1 -1
  30. package/assets/css/mobile-core.min.css.map +1 -1
  31. package/assets/css/mobile.min.css +1 -1
  32. package/assets/css/mobile.min.css.map +1 -1
  33. package/assets/css/style.min.css +1 -1
  34. package/assets/css/style.min.css.map +1 -1
  35. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  36. package/assets/js/components/actionbar/actionbar.component.min.js +4 -4
  37. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  38. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  39. package/assets/js/components/barchart/barchart.component.min.js +2 -2
  40. package/assets/js/components/barchart/barchart.component.min.js.map +1 -1
  41. package/assets/js/components/bento-grid/bento-grid.component.min.js +1 -1
  42. package/assets/js/components/card/card.component.min.js +2 -2
  43. package/assets/js/components/carousel/carousel.component.min.js +2 -2
  44. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  45. package/assets/js/components/doughnutchart/doughnutchart.component.min.js +2 -2
  46. package/assets/js/components/doughnutchart/doughnutchart.component.min.js.map +1 -1
  47. package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
  48. package/assets/js/components/filter-card/filter-card.component.min.js +1 -1
  49. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  50. package/assets/js/components/header/header.component.min.js +1 -1
  51. package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
  52. package/assets/js/components/marketing/marketing.component.min.js +1 -1
  53. package/assets/js/components/menu/menu.component.min.js +1 -1
  54. package/assets/js/components/multi-step/multi-step.component.min.js +1 -1
  55. package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
  56. package/assets/js/components/nav/nav.component.min.js +1 -1
  57. package/assets/js/components/notification/notification.component.min.js +1 -1
  58. package/assets/js/components/pagination/pagination.component.js +11 -4
  59. package/assets/js/components/pagination/pagination.component.min.js +5 -5
  60. package/assets/js/components/pagination/pagination.component.min.js.map +1 -1
  61. package/assets/js/components/record-card/record-card.component.min.js +1 -1
  62. package/assets/js/components/search/search.component.min.js +1 -1
  63. package/assets/js/components/search/search.component.min.js.map +1 -1
  64. package/assets/js/components/slider/slider.component.min.js +1 -1
  65. package/assets/js/components/table/table.component.js +36 -198
  66. package/assets/js/components/table/table.component.min.js +13 -23
  67. package/assets/js/components/table/table.component.min.js.map +1 -1
  68. package/assets/js/components/table-ajax/table-ajax.component.js +46 -0
  69. package/assets/js/components/table-ajax/table-ajax.component.min.js +22 -0
  70. package/assets/js/components/table-ajax/table-ajax.component.min.js.map +1 -0
  71. package/assets/js/components/table-basic/table-basic.component.js +46 -0
  72. package/assets/js/components/table-basic/table-basic.component.min.js +22 -0
  73. package/assets/js/components/table-basic/table-basic.component.min.js.map +1 -0
  74. package/assets/js/components/table-no-submit/table-no-submit.component.js +77 -0
  75. package/assets/js/components/table-no-submit/table-no-submit.component.min.js +22 -0
  76. package/assets/js/components/table-no-submit/table-no-submit.component.min.js.map +1 -0
  77. package/assets/js/components/table-submit/table-submit.component.js +55 -0
  78. package/assets/js/components/table-submit/table-submit.component.min.js +22 -0
  79. package/assets/js/components/table-submit/table-submit.component.min.js.map +1 -0
  80. package/assets/js/components/tabs/tabs.component.js +2 -0
  81. package/assets/js/components/tabs/tabs.component.min.js +6 -4
  82. package/assets/js/components/tabs/tabs.component.min.js.map +1 -1
  83. package/assets/js/components/video-card/video-card.component.min.js +1 -1
  84. package/assets/js/modules/helpers.js +4 -0
  85. package/assets/js/modules/table.js +544 -294
  86. package/assets/js/modules/tabs.js +43 -13
  87. package/assets/js/scripts.bundle.js +3 -3
  88. package/assets/js/scripts.bundle.js.map +1 -1
  89. package/assets/js/scripts.bundle.min.js +2 -2
  90. package/assets/js/scripts.bundle.min.js.map +1 -1
  91. package/assets/js/scripts.js +31 -24
  92. package/assets/js/tests/table.spec.js +0 -31
  93. package/assets/sass/_components.scss +3 -0
  94. package/assets/sass/components/actionbar.component.scss +1 -0
  95. package/assets/sass/components/actionbar.global.scss +0 -70
  96. package/assets/sass/components/pagination.scss +2 -1
  97. package/assets/sass/components/table-basic.component.scss +132 -0
  98. package/assets/sass/components/table-basic.global.scss +365 -0
  99. package/assets/sass/components/table.component.scss +2 -133
  100. package/assets/sass/components/table.global.scss +175 -434
  101. package/assets/sass/components/tabs.config.scss +27 -0
  102. package/assets/sass/components/tabs.scss +33 -1
  103. package/assets/sass/elements/buttons--global.scss +2 -1
  104. package/assets/sass/elements/table.element.scss +9 -7
  105. package/assets/sass/foundations/root.scss +1 -1
  106. package/assets/ts/components/pagination/pagination.component.ts +17 -4
  107. package/assets/ts/components/table/table.component.ts +49 -243
  108. package/assets/ts/components/table-ajax/table-ajax.component.ts +64 -0
  109. package/assets/ts/components/table-basic/README.md +40 -0
  110. package/assets/ts/components/table-basic/table-basic.component.ts +56 -0
  111. package/assets/ts/components/table-no-submit/table-no-submit.component.ts +134 -0
  112. package/assets/ts/components/table-submit/table-submit.component.ts +64 -0
  113. package/assets/ts/components/tabs/tabs.component.ts +2 -0
  114. package/assets/ts/modules/helpers.ts +6 -0
  115. package/assets/ts/modules/table.ts +656 -328
  116. package/assets/ts/modules/tabs.ts +54 -12
  117. package/assets/ts/scripts.ts +5 -3
  118. package/assets/ts/tests/table.spec.ts +0 -38
  119. package/dist/components.es.js +138 -136
  120. package/dist/components.umd.js +108 -116
  121. package/package.json +1 -1
  122. package/src/components/Table/TableAjax.vue +34 -0
  123. package/src/components/Table/TableBasic.vue +34 -0
  124. package/src/components/Table/TableNoSubmit.vue +34 -0
  125. package/src/components/Table/TableSubmit.vue +34 -0
  126. package/src/components/Table/Table.spec.js +0 -47
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * iamKey v7.2.1--beta2
3
+ * Copyright 2022-2025 iamproperty
4
+ */const R=t=>t.charAt(0).toUpperCase()+t.slice(1),h=(t,e,a)=>e.split(/[\.\[\]\'\"]/).filter(i=>i).reduce((i,l)=>i?i[l]:a,t),D=(t=1)=>Math.floor(Math.random()*Date.now()*(t+1));var B=function(t,e,a,i){function l(o){return o instanceof a?o:new a(function(s){s(o)})}return new(a||(a=Promise))(function(o,s){function m(d){try{c(i.next(d))}catch(g){s(g)}}function b(d){try{c(i.throw(d))}catch(g){s(g)}}function c(d){d.done?o(d.value):l(d.value).then(m,b)}c((i=i.apply(t,e||[])).next())})};const P=(t,e)=>{switch(t){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=R(e)}},I=function(t){const e=new Object;return Array.from(t.querySelectorAll("[data-filter]")).forEach(i=>{if(!(i.type=="radio"&&!i.checked)&&!(i.type=="checkbox"&&!i.checked)&&i&&i.value){const l=i.getAttribute("data-filter");let o=i.value;i.hasAttribute("data-date-from")&&(o+="-date-from"),i.hasAttribute("data-date-to")&&(o+="-date-to"),e[l]||(e[l]=[]),e[l].push(o)}}),e},N=(t,e,a,i,l)=>{a.querySelector("[name=show]")||a.insertAdjacentHTML("beforeend",`<input name="show" type="hidden" value="${t.getAttribute("data-show")}" />`),a.querySelector("[name=page]")||a.insertAdjacentHTML("beforeend",`<input name="page" type="hidden" value="${t.getAttribute("data-page")}" />`),i.addEventListener("update-show",o=>{if(a.querySelector("[name=show]").value!=o.detail.show){a.querySelector("[name=show]").value=o.detail.show;const s=new CustomEvent("update-show",{detail:{show:o.detail.show}});t.dispatchEvent(s),T(t,i),l()}}),i.addEventListener("update-page",o=>{if(a.querySelector("[name=page]").value!=o.detail.page){a.querySelector("[name=page]").value=o.detail.page;const s=new CustomEvent("update-page",{detail:{page:o.detail.page}});if(t.dispatchEvent(s),T(t,i),l(),!t.hasAttribute("data-no-scroll")){const b=e.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:b,behavior:"smooth"})}}})},O=(t,e)=>{let a=document.createElement("form");return t.hasAttribute("data-filterby")?a=document.querySelector(`#${t.getAttribute("data-filterby")}`):t.closest("form")?a=t.closest("form"):e.parentNode.insertBefore(a,e.nextSibling),a},E=(t,e,a,i)=>{const l=t.shadowRoot.querySelector(".table__wrapper");t.hasAttribute("data-total")||t.setAttribute("data-total",t.querySelectorAll("tbody tr").length),t.hasAttribute("data-page")||t.setAttribute("data-page",1),t.hasAttribute("data-show")||t.setAttribute("data-show",5),t.hasAttribute("data-increment")||t.setAttribute("data-increment",t.getAttribute("data-show")),W(t,i),U(e),V(t,e),t.classList.contains("mh-sm")&&l.classList.add("mh-sm"),t.classList.contains("mh-md")&&l.classList.add("mh-md"),t.classList.contains("mh-lg")&&l.classList.add("mh-lg"),t.classList.contains("table--cta")&&(J(t,e),X(t,e))},W=(t,e)=>{t.hasAttribute("data-total")&&e.setAttribute("data-total",t.getAttribute("data-total")),t.hasAttribute("data-page")&&e.setAttribute("data-page",t.getAttribute("data-page")),t.hasAttribute("data-show")&&e.setAttribute("data-show",t.getAttribute("data-show")),t.hasAttribute("data-increment")&&e.setAttribute("data-increment",t.getAttribute("data-show")),t.hasAttribute("data-page-jump")&&e.setAttribute("data-page-jump","true"),t.hasAttribute("data-per-page")&&e.setAttribute("data-per-page","true"),t.hasAttribute("data-item-count")&&e.setAttribute("data-item-count","true"),t.hasAttribute("data-loading")&&e.setAttribute("data-loading","true"),t.classList.contains("table--fullwidth")&&e.setAttribute("data-minimal","true")},T=(t,e)=>{t.setAttribute("data-total",e.getAttribute("data-total")),t.setAttribute("data-page",e.getAttribute("data-page")),t.setAttribute("data-show",e.getAttribute("data-show")),t.setAttribute("data-increment",e.getAttribute("data-show"))},U=t=>{const e=Array.from(t.querySelectorAll("thead th"));Array.from(t.querySelectorAll("tbody tr")).forEach(i=>{const l=Array.from(i.querySelectorAll("th, td")),o=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","successful","failed"];l.forEach((s,m)=>{const b=e[m];if(typeof b<"u"){const c=document.createElement("div");c.innerHTML=b.innerHTML;const d=c.textContent||c.innerText||"";s.setAttribute("data-label",d),b.hasAttribute("data-td-class")&&s.setAttribute("class",b.getAttribute("data-td-class")),b.hasAttribute("data-format")&&(s.setAttribute("data-format",b.getAttribute("data-format")),s.innerHTML=P(b.getAttribute("data-format"),s.textContent.trim())),o.includes(s.textContent.trim().toLowerCase())&&s.setAttribute("data-content",s.textContent.trim().toLowerCase())}})})},V=(t,e)=>{if(t.classList.contains("table--fullwidth")&&!t.hasAttribute("data-expandable")||e.querySelectorAll("thead tr th").length<4&&!t.hasAttribute("data-expandable"))return!1;Array.from(e.querySelectorAll("thead tr")).forEach(a=>{e.querySelectorAll("thead tr th.expand-button-heading").length||a.insertAdjacentHTML("afterbegin",`<th class="${t.hasAttribute("data-expandable")?"th--fixed ":""}expand-button-heading"></th>`)}),Array.from(e.querySelectorAll("tbody tr")).forEach((a,i)=>{const l=a.getAttribute("data-view")==="full"?"aria-expanded":"";a.insertAdjacentHTML("afterbegin",`<td class="${t.hasAttribute("data-expandable")?"td--fixed ":""}td--expand"><button class="btn btn-compact btn-secondary btn-sm" data-expand-button ${l} data-index="${i}">Expand</button></td>`)}),e.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-expand-button]")){const i=a.target.closest("[data-expand-button]"),l=i.closest("tr");i.toggleAttribute("aria-expanded"),l.getAttribute("data-view")=="full"?l.setAttribute("data-view","default"):l.setAttribute("data-view","full"),i.blur(),t.dispatchEvent(new CustomEvent("row-expanded",{detail:{row:i.getAttribute("data-index")}}))}})},J=(t,e)=>{let a=0;Array.from(e.querySelectorAll("tbody tr")).forEach(i=>{const l=window.getComputedStyle(document.querySelector("html")),o=i.querySelector(":scope > *:last-child > *:first-child");if(o){o.classList.add("text-nowrap");let s=o.offsetWidth/parseFloat(l.fontSize);s+=1.8,a=a>s?a:s}}),t.style.setProperty("--cta-width",`${a}rem`)},X=(t,e)=>{function a(){Array.from(e.querySelectorAll("tr")).forEach(i=>{const l=i.offsetHeight;i.style.setProperty("--row-height",`${l}px`)})}new ResizeObserver(a).observe(e)},C=(t,e)=>{if(t.querySelector("iam-actionbar[data-selectall]")||document.querySelector(`iam-actionbar[data-for='${t.getAttribute("id")}']`)){const a=t.querySelector("iam-actionbar[data-selectall]")?t.querySelector("iam-actionbar[data-selectall]"):document.querySelector(`iam-actionbar[data-for='${t.getAttribute("id")}']`);Y(t,e,a)}t.querySelectorAll(".dialog__wrapper .btn-compact").forEach(a=>{a.classList.add("btn-sm"),a.classList.add("m-0");const i=a.closest("tr"),l=a.closest("td"),s=Array.prototype.slice.call(i.children).indexOf(l);l.classList.add("td--fixed"),e.querySelector(`thead tr th:nth-child(${s+1})`).classList.add("th--fixed")})},Y=(t,e,a)=>{Array.from(e.querySelectorAll("thead tr")).forEach(i=>{i.querySelector(".expand-button-heading")?i.querySelector(".expand-button-heading").insertAdjacentHTML("afterend",'<th class="th--fixed"></th>'):i.insertAdjacentHTML("afterbegin",'<th class="th--fixed"></th>')}),Array.from(e.querySelectorAll("tbody tr")).forEach((i,l)=>{if(i.setAttribute("data-index",l+1),!i.querySelector(".selectrow")){const o=`row${D(l)}`;i.querySelector(".td--expand")?i.querySelector(".td--expand").insertAdjacentHTML("afterend",`<td class="td--fixed selectrow selected"><input type="checkbox" name="row" id="${o}" ${i.hasAttribute("data-selected")?'checked="true"':""}/><label for="${o}"><span class="visually-hidden">Select row</span></label></td>`):i.insertAdjacentHTML("afterbegin",`<td class="td--fixed selectrow selected"><input type="checkbox" name="row" id="${o}" ${i.hasAttribute("data-selected")?'checked="true"':""}/><label for="${o}"><span class="visually-hidden">Select row</span></label></td>`)}}),e.addEventListener("change",i=>{if(i&&i.target instanceof HTMLElement&&i.target.closest(".selectrow input")){const l=i.target.closest(".selectrow input"),o=i.target.closest("tr"),s=e.querySelectorAll('.selectrow input[type="checkbox"]').length,m=e.querySelectorAll('.selectrow input[type="checkbox"]:checked').length;a.setAttribute("data-selected",s==m?"all":m);const b=new CustomEvent("row-selected",{detail:{rowIndex:o.getAttribute("data-index"),checked:!!l.checked}});t.dispatchEvent(b)}}),a.addEventListener("selected",i=>{if(i.detail.selected=="0"){Array.from(e.querySelectorAll('.selectrow input[type="checkbox"]')).forEach(o=>{o.checked=!1});const l=new CustomEvent("all-rows-unselected");t.dispatchEvent(l)}else if(i.detail.selected=="all"){Array.from(e.querySelectorAll('.selectrow input[type="checkbox"]')).forEach(o=>{o.checked=!0});const l=new CustomEvent("all-rows-selected");t.dispatchEvent(l)}})},G=(t,e,a,i)=>{y(t,e,a,i);const l=t.querySelector("iam-actionbar");a.addEventListener("submit",o=>{y(t,e,a,i),o.preventDefault()}),l&&l.addEventListener("change",o=>{y(t,e,a,i)})},y=function(t,e,a,i){return B(this,void 0,void 0,function*(){t.querySelector("iam-actionbar")&&!t.querySelector("iam-actionbar").closest("form")&&(a.querySelector(".duplicate-actionbar")||a.insertAdjacentHTML("beforeend",'<div class="duplicate-actionbar" style="visibility: hidden; pointer-events: none; position: absolute;"></div>'),a.querySelector(".duplicate-actionbar").innerHTML=t.querySelector("iam-actionbar").innerHTML),a.querySelector("input[name=show]")||a.insertAdjacentHTML("beforeend",`<input name="show" type="hidden" value="${t.getAttribute("data-show")}" />`),a.querySelector("input[name=page]")||a.insertAdjacentHTML("beforeend",`<input name="page" type="hidden" value="${t.getAttribute("data-page")}" />`),a.querySelector("input[name=page]").value=t.getAttribute("data-page"),a.querySelector("input[name=show]").value=t.getAttribute("data-show");const l=new FormData(a),o=new URLSearchParams(l).toString(),s=e.querySelectorAll("thead tr th:not(.expand-button-heading)"),m=e.querySelector("tbody"),b=a.getAttribute("data-ajax");t.classList.add("table--loading");const c=I(a);Array.from(a.querySelectorAll("[data-filter-count]")).forEach(n=>{n.innerHTML="",n.parentNode.classList.remove("hover")});let d=0;Object.values(c).forEach(n=>{typeof n=="object"&&Object.values(n).length?d+=Object.values(n).length:d++}),d&&Array.from(a.querySelectorAll("[data-filter-count]")).forEach(n=>{n.innerHTML+=`(${d})`,n.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[b]&&window.controller[b].abort(),window.controller[b]=new AbortController;const{signal:g}=controller[b];i.setAttribute("data-loading","true"),a.classList.add("processing");try{yield fetch(b+"?"+o,{signal:g,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(n=>n.json()).then(n=>{const M=a.hasAttribute("data-schema")?a.getAttribute("data-schema"):"data",H=a.hasAttribute("data-schema-total")?a.getAttribute("data-schema-total"):"meta.total",j=a.hasAttribute("data-schema-page")?a.getAttribute("data-schema-page"):"meta.current_page",v=h(n,H,15),S=h(n,j,1),_=h(n,M),$=t.hasAttribute("data-empty-msg")?t.getAttribute("data-empty-msg"):"No results found";_?(m.innerHTML="",_.forEach(p=>{const f=document.createElement("tr");s.forEach(r=>{let u="";const x=document.createElement("td");if(x.setAttribute("data-label",r.innerText),r.getAttribute("data-output")&&(u=r.getAttribute("data-output").replace(new RegExp(/{(.*?)}/,"gm"),function(k){return h(p,k.replace("{","").replace("}",""))})),r.hasAttribute("data-output-array")){const A=r.getAttribute("data-output"),k=h(p,A.replace("{","").replace("}",""));u="",k.forEach(q=>{const z=r.getAttribute("data-output-array");let w="";if(r.hasAttribute("data-output-array-property")&&r.hasAttribute("data-output-array-transform")){const L=h(q,r.getAttribute("data-output-array-property")),F=JSON.parse(r.getAttribute("data-output-array-transform"))[L];w=z.replace(`{${r.getAttribute("data-output-array-property")}}`,F)}w=w.replace(new RegExp(/{(.*?)}/,"gm"),function(L){return h(q,L.replace("{","").replace("}",""))}),u+=w})}r.hasAttribute("data-transform")&&(u=JSON.parse(r.getAttribute("data-transform"))[u],!u&&r.hasAttribute("data-default")&&(u=r.getAttribute("data-default"))),x.innerHTML=u,f.appendChild(x)}),m.appendChild(f)}),t.setAttribute("data-total",parseInt(v)),t.setAttribute("data-page",parseInt(S)),i.setAttribute("data-total",v),i.setAttribute("data-page",S),Array.from(a.querySelectorAll("[data-ajax-query]")).forEach(p=>{const f=h(n,p.getAttribute("data-ajax-query"),"");p.hasAttribute("data-total")?p.setAttribute("data-total",f):p.innerHTML=f}),parseInt(v)==0&&(m.innerHTML=`<tr><td colspan="100%"><span>${$}</span></td></tr>`),t.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:b,formData:o}),E(t,e,a,i),C(t,e,a,i)):m.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',i.removeAttribute("data-loading"),a.classList.remove("processing")})}catch(n){console.log(n)}})};class K extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const e=document.createElement("template");e.innerHTML=`
5
+ <style>
6
+ :is(.mh-sm,.mh-md,.mh-lg,.mh-sm-sm,.mh-sm-md,.mh-sm-lg,.mh-md-sm,.mh-md-md,.mh-md-lg,.mh-fluid):not(iam-table):not(.table__wrapper){padding-inline:var(--mh-padding-inline, 0);margin-inline:calc(var(--mh-padding-inline, 0)*-1)}:is(.mh-sm,.mh-md,.mh-lg,.mh-sm-sm,.mh-sm-md,.mh-sm-lg,.mh-md-sm,.mh-md-md,.mh-md-lg,.mh-fluid)::before{top:calc(100% - 1.5rem);bottom:0;left:0;right:0;height:1.5rem;position:sticky;display:block;background:linear-gradient(180deg, transparent 0%, var(--colour-canvas-2) 100%);z-index:2;margin-bottom:-1.5rem}:is(.mh-sm,.mh-md,.mh-lg,.mh-fluid){overflow:auto;overscroll-behavior:contain}:is(.mh-sm,.mh-md,.mh-lg,.mh-fluid)::before{content:""}.mh-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}.mh-fluid{max-height:100%}@media screen and (min-width: 36em){:is(.mh-sm-sm,.mh-sm-md,.mh-sm-lg){overflow:auto;overscroll-behavior:contain}:is(.mh-sm-sm,.mh-sm-md,.mh-sm-lg)::before{content:""}.mh-sm-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-sm-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-sm-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}}@media screen and (min-width: 62em){:is(.mh-md-sm,.mh-md-md,.mh-md-lg){overflow:auto;overscroll-behavior:contain}:is(.mh-md-sm,.mh-md-md,.mh-md-lg)::before{content:""}.mh-md-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-md-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-md-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}}:host{container-type:inline-size;display:block}.table__container{--wrapper-padding: 2rem;--bg-colour: #ffffff;display:block;background:#fff;padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.625rem;margin-bottom:2rem;overflow:hidden}.table__container:before{display:none !important}@media screen and (prefers-color-scheme: dark){.table__container{background:var(--colour-canvas-2)}}@media(forced-colors: active){.table__container{--wrapper-padding: 0;background:var(--colour-canvas-2)}}:host-context(.admin-panel) .table__container{display:contents}:host(.mh-sm){max-height:none !important}:host(.mh-md){max-height:none !important}:host(.mh-lg){max-height:none !important}.table__wrapper{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}@container (width < 23.4375em){:host(:not(.table--fullwidth)) .table__container{margin-left:-1.5rem;margin-right:-1.5rem;margin-bottom:0;background:var(--colour-canvas-2);border-radius:0;background:none;padding:0;box-shadow:none;overflow:visible}:host(:not(.table--fullwidth)) .table__container .table__wrapper{overflow:hidden;max-height:none !important}:host(:not(.table--fullwidth)) .table__container ::slotted(table){overflow:visible !important;margin-inline:1.5rem;margin-bottom:1.5rem !important;width:calc(100% - 3rem) !important;display:block}:host(:not(.table--fullwidth)) .table__container .table--cta{border-bottom:0}:host(:not(.table--fullwidth)) .table__container .table--cta:after{content:none;display:none !important}}@container (width > 23.4375em){:host{--cta-width: 8rem}:host(.table--loading){--cta-width: 1.5rem !important}.table--cta{position:relative}.table--cta .table__wrapper{overflow-y:hidden;margin-bottom:0}}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg){position:relative;overflow:auto}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg)::before{top:calc(100% - 1.2rem);bottom:2px;height:1.2rem;border-bottom:2px solid var(--colour-border);margin-bottom:-1.2rem}@container (width < 23.4375em){.table__wrapper.has-actionbar{margin-top:calc(-100vh + 6.75rem) !important}}:host(.table--loading){pointer-events:none;position:relative}:host(.table--loading) ::slotted(table){min-height:20rem;opacity:.5}:host(.table--loading)::after{content:"Loading...";position:absolute;top:6.25rem;left:50%;transform:translate(-50%, 0);font-weight:bold;color:var(--colour-heading);font-size:1.5rem;text-shadow:0px 0px 10px var(--colour-canvas-2);padding-inline:2rem;text-shadow:0px 0px 10px var(--colour-canvas-2);background:radial-gradient(var(--colour-canvas-2), transparent)}/*# sourceMappingURL=assets/css/components/table.component.css.map */
7
+
8
+
9
+ ${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
10
+ </style>
11
+ <div class="table__container">
12
+ <slot name="before"></slot>
13
+ <div class="table--cta">
14
+ <div class="table__wrapper">
15
+ <slot></slot>
16
+ </div>
17
+ </div>
18
+ <iam-pagination part="pagination" class="pagination--table" ${this.hasAttribute("data-page")?`data-page="${this.getAttribute("data-page")}"`:""} ></iam-pagination>
19
+ </div>
20
+ `,this.shadowRoot.appendChild(e.content.cloneNode(!0)),!document.getElementById("tableSingleExtras")&&!document.getElementById("tableExtras")&&document.head.insertAdjacentHTML("beforeend",`<style id="tableSingleExtras">:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit){--hover-background: var(--colour-light);--row-bg: var(--colour-canvas-2)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table{margin-bottom:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table thead tr th{position:relative;padding-right:2rem !important;padding-left:0rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) td{background-color:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tr td p{min-width:10rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tbody tr{background:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tbody tr:is(:hover,:focus-within,.hover){--bg-colour-rgb: 238, 238, 238;--row-bg: var(--hover-background);background:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table:has(tr.show) tbody tr:not(.show){display:none !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:has([data-expand-button]),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) .expand-button-heading{display:none}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button]){height:0;padding:0;position:relative;display:block !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button])+td{border-top:none !important;padding-top:0 !important;padding-right:3rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button])+.td--fixed+td{border-top:none !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button]{top:0;right:0;background:rgba(0,0,0,0) !important;border:none;position:absolute;overflow:hidden;--compact-size: 2rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF055";font-weight:300 !important;font-size:1.75rem;line-height:var(--compact-size) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button][aria-expanded]:before{content:"\uF056";font-weight:900 !important}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) thead{display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody{--status-pt: 2.5rem;display:block;overflow:visible}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr td:first-child{padding-top:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr{display:block;position:relative;border:none;background:var(--row-bg);padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.5rem;height:auto}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr+tr{margin-top:2rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr:is(:hover,:focus,.hover){--row-bg: var(--colour-canvas-2)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:has([data-expand-button]){display:block}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th){display:block;border-color:var(--colour-border);padding-right:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th):nth-child(1){border-top:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th)[data-label]:not([data-label=""]):before{content:attr(data-label);color:var(--colour-heading);padding:0 0 0.375rem 0;margin-bottom:0;display:block;font-weight:bold}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:first-child::after{top:1.75rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td::after{top:2.5rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) .td--fixed{padding-right:50%}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr td:not(:first-child){border-top:var(--border-width) solid currentColor;border-color:var(--colour-border) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr:not([data-view=full]) td:not(.td--fixed)+td:not(.td--fixed)+td+td{display:none}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth).table--cta tbody tr td:last-child{display:block !important}}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta{padding-right:calc(var(--wrapper-padding) + 1.5rem) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>th:nth-last-child(2),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>td:nth-last-child(2){padding-right:var(--cta-width) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>*:not(:first-child):last-child{position:absolute;left:calc(100% - var(--cta-width));top:auto;background:rgba(0,0,0,0);width:var(--cta-width);min-height:calc(var(--row-height) - 2px);text-align:right;background:linear-gradient(90deg, transparent 0%, var(--row-bg, var(--colour-canvs-2)) 1.25rem);cursor:default;padding-bottom:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>*:not(:first-child):last-child a{white-space:nowrap;padding-right:.2rem;padding-bottom:0;margin:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tbody tr:hover>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg, var(--colour-canvs-2)) 1.25rem)}}table .hide-status:after{display:none}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)){position:relative;padding-left:1.5rem}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty))::before{margin-left:-1.5rem !important}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)):after{font-family:"Font Awesome 6 Pro";position:absolute;top:var(--status-pt, 1rem);left:0;font-size:1rem;line-height:1;height:1rem;width:1rem;display:inline-block}table [data-content=high]:after{content:"\uF325";font-weight:normal;color:var(--colour-danger)}table [data-content=medium]:after{content:"\uF7A4";font-weight:normal;color:var(--colour-warning)}table [data-content=low]:after{content:"\uE404";font-weight:normal;color:var(--colour-complete)}table [data-content=unknown]:after{content:"\uE404";font-weight:normal;color:var(--colour-muted)}table :is([data-content=overdue],[data-content=due],[data-content=incomplete]):after{content:"\uF024";color:var(--colour-danger)}table :is([data-content="not started"],[data-content="to do"],[data-content="on track"]):after{content:"\uF024";color:var(--colour-muted)}table :is([data-content="requires approval"],[data-content="approval required"],[data-content="action required"],[data-content=upcoming]):after{content:"\uF024";color:var(--colour-warning)}table :is([data-content=warning]):after{content:"\uF071";color:var(--colour-warning)}table :is([data-content="manually verified"],[data-content=verified],[data-content=completed],[data-content=complete],[data-content=successful]):after{content:"\uF00C";font-weight:normal;color:var(--colour-complete)}table :is([data-content=failed]):after{content:"\uF00D";font-weight:normal;color:var(--colour-danger)}table .alert-status:not([data-content="0"]):not([data-content=""]):not(:empty):after{content:"\uF0F3";color:var(--colour-primary)}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth).table--cta tbody tr td:last-child{display:block !important}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) iam-actionbar{margin:0 1.5rem 1rem 1.5rem}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) iam-actionbar{box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:.5rem}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth:has(iam-actionbar){padding-top:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth iam-actionbar{margin:-2rem -2rem 2rem -2rem;box-shadow:none;border-radius:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth iam-actionbar:has(+table input:checked){margin:-2rem -2rem 2rem -2rem;box-shadow:none;border-radius:0}@media screen and (prefers-color-scheme: light){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth iam-actionbar:has(+table input:checked){background-color:#e6eaec}}.actionbar__sticky-wrapper{container-type:inline-size}@media screen and (min-width: 36em){.actionbar__sticky-wrapper{padding:0 !important}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):is(.actionbar__sticky-wrapper)>.actionbar__sticky{display:block;position:sticky;left:0;top:calc(var(--sticky-padding) + 1rem);z-index:var(--index-menu);pointer-events:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):is(.actionbar__sticky-wrapper)>.actionbar__sticky:after{content:"";display:block;width:100%;height:calc(100vh - 6.75rem);pointer-events:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):is(.actionbar__sticky-wrapper)>.actionbar__sticky+*{margin-top:calc(-100vh + 6.75rem)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):is(.actionbar__sticky)>iam-actionbar{pointer-events:all !important;display:block;border:none;background:var(--colour-canvas-2);border-radius:.5rem;margin-bottom:1.5rem}}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth iam-actionbar,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) iam-actionbar{margin-left:-2rem;margin-right:-2rem;margin-top:-2rem;margin-bottom:2rem}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.75rem !important;left:.25rem !important;--border-radius: 0.25rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100vw;height:100%;max-height:var(--row-height);max-width:100vw;cursor:pointer;pointer-events:all;top:auto;margin:0;margin-top:0rem}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tr:has([type=checkbox]:checked){height:calc(4.625rem - 2px)}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tr:has([type=checkbox]:hover,[type=checkbox]:focus){--row-bg: #eeeeee}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tr:has([type=checkbox]:hover:checked,[type=checkbox]:focus:checked,[type=checkbox]:checked){--row-bg: #e0e0e0}@container (width < 23.4375em){@media screen and (prefers-color-scheme: light){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) iam-actionbar{background-color:#e6eaec}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .actionbar__sticky+*{margin-top:0 !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick){padding-left:0 !important;margin:0 !important;min-height:2rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick):before,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) input:is([type=radio],[type=checkbox])+label:not(.radio--tick):after{top:.25rem !important;left:0 !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):has([type=checkbox]:checked) tr:has([type=checkbox]) [type=checkbox]{width:100%;height:100%;max-height:100%;max-width:100%;margin-top:-2rem}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] td:has([data-expand-button]),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] .expand-button-heading{display:table-cell}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth [data-expand-button]{margin:.25rem 0 0 0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth [data-expand-button]:not(:hover,:focus){background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF078";font-weight:500}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth [data-expand-button][aria-expanded]:before{content:"\uF077"}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth tr:not(:has(p)) [data-expand-button]{display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable].table--fullwidth tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-width:10rem}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] [data-expand-button]{margin:.25rem 0 0 0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] [data-expand-button]:not(:hover,:focus){background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF078";font-weight:500}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] [data-expand-button][aria-expanded]:before{content:"\uF077"}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] tr:not(:has(p)) [data-expand-button]{display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit)[data-expandable] tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-width:10rem}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr{position:relative}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) .td--fixed+.td--fixed{border:none}}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed{position:absolute;left:auto;top:auto;z-index:3;padding:0 0 0 0;min-width:3.375rem;height:calc(var(--row-height) - 2px);text-align:left;background:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed:has([open]),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed:has([open]){z-index:4}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed:has(+th:not(.th--fixed)),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed:has(+td:not(.td--fixed)){background:linear-gradient(90deg, var(--row-bg) calc(100% - 1rem), transparent 100%)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed+th:not(.th--fixed),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed+td:not(.td--fixed){padding-left:calc(3.375rem) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed+.th--fixed,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed+.td--fixed{left:3rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed+.th--fixed+th:not(.th--fixed),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed+.td--fixed+td:not(.td--fixed){padding-left:calc(6.375rem) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed+.th--fixed+.th--fixed,:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed+.td--fixed+.td--fixed{left:6rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .th--fixed+.th--fixed+.th--fixed+th:not(.th--fixed),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .td--fixed+.td--fixed+.td--fixed+td:not(.td--fixed){padding-left:calc(9.375rem) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .dialog__wrapper{z-index:10}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .dialog__wrapper:has([open]){z-index:20}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) td:has(.dialog__wrapper){padding-top:.25rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth th[data-sort]{background-repeat:no-repeat;background-size:1rem 1rem;background-position:calc(100% - .5rem) 50%;padding-top:.75rem;cursor:pointer}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth th[data-sort]:hover{background-color:var(--colour-light);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3e%3c!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L128 370.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-96 96zm352-333.3c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L448 141.3 448 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-306.7-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96z'/%3e%3c/svg%3e")}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth:has(th[data-sort]) :is(th,td){padding-left:.25rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth th[data-sort][data-order-by=asc]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3e%3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license %28Commercial License%29 Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M209.4 39.4C204.8 34.7 198.6 32 192 32s-12.8 2.7-17.4 7.4l-168 176c-9.2 9.6-8.8 24.8 .8 33.9s24.8 8.8 33.9-.8L168 115.9 168 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-340.1L342.6 248.6c9.2 9.6 24.3 9.9 33.9 .8s9.9-24.3 .8-33.9l-168-176z'/%3e%3c/svg%3e")}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--fullwidth th[data-sort][data-order-by=desc]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3e%3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license %28Commercial License%29 Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M174.6 472.6c4.5 4.7 10.8 7.4 17.4 7.4s12.8-2.7 17.4-7.4l168-176c9.2-9.6 8.8-24.8-.8-33.9s-24.8-8.8-33.9 .8L216 396.1 216 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 340.1L41.4 263.4c-9.2-9.6-24.3-9.9-33.9-.8s-9.9 24.3-.8 33.9l168 176z'/%3e%3c/svg%3e")}@container (width >= 32em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) th[data-sort]{background-repeat:no-repeat;background-size:1rem 1rem;background-position:calc(100% - .5rem) 50%;padding-top:.75rem;cursor:pointer}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) th[data-sort]:hover{background-color:var(--colour-light);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3e%3c!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L128 370.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-96 96zm352-333.3c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L448 141.3 448 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-306.7-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96z'/%3e%3c/svg%3e")}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):has(th[data-sort]) :is(th,td){padding-left:.25rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) th[data-sort][data-order-by=asc]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3e%3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license %28Commercial License%29 Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M209.4 39.4C204.8 34.7 198.6 32 192 32s-12.8 2.7-17.4 7.4l-168 176c-9.2 9.6-8.8 24.8 .8 33.9s24.8 8.8 33.9-.8L168 115.9 168 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-340.1L342.6 248.6c9.2 9.6 24.3 9.9 33.9 .8s9.9-24.3 .8-33.9l-168-176z'/%3e%3c/svg%3e")}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) th[data-sort][data-order-by=desc]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3e%3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license %28Commercial License%29 Copyright 2025 Fonticons, Inc.--%3e%3cpath d='M174.6 472.6c4.5 4.7 10.8 7.4 17.4 7.4s12.8-2.7 17.4-7.4l168-176c9.2-9.6 8.8-24.8-.8-33.9s-24.8-8.8-33.9 .8L216 396.1 216 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 340.1L41.4 263.4c-9.2-9.6-24.3-9.9-33.9-.8s-9.9 24.3-.8 33.9l168 176z'/%3e%3c/svg%3e")}}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col1]+table :is(thead,tbody) :is(th,td):nth-child(1){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col2]+table :is(thead,tbody) :is(th,td):nth-child(2){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col3]+table :is(thead,tbody) :is(th,td):nth-child(3){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col4]+table :is(thead,tbody) :is(th,td):nth-child(4){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col5]+table :is(thead,tbody) :is(th,td):nth-child(5){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col6]+table :is(thead,tbody) :is(th,td):nth-child(6){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col7]+table :is(thead,tbody) :is(th,td):nth-child(7){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col8]+table :is(thead,tbody) :is(th,td):nth-child(8){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col9]+table :is(thead,tbody) :is(th,td):nth-child(9){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col10]+table :is(thead,tbody) :is(th,td):nth-child(10){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col11]+table :is(thead,tbody) :is(th,td):nth-child(11){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col12]+table :is(thead,tbody) :is(th,td):nth-child(12){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col13]+table :is(thead,tbody) :is(th,td):nth-child(13){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col14]+table :is(thead,tbody) :is(th,td):nth-child(14){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col15]+table :is(thead,tbody) :is(th,td):nth-child(15){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col16]+table :is(thead,tbody) :is(th,td):nth-child(16){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col17]+table :is(thead,tbody) :is(th,td):nth-child(17){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col18]+table :is(thead,tbody) :is(th,td):nth-child(18){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col19]+table :is(thead,tbody) :is(th,td):nth-child(19){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col20]+table :is(thead,tbody) :is(th,td):nth-child(20){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col21]+table :is(thead,tbody) :is(th,td):nth-child(21){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col22]+table :is(thead,tbody) :is(th,td):nth-child(22){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col23]+table :is(thead,tbody) :is(th,td):nth-child(23){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col24]+table :is(thead,tbody) :is(th,td):nth-child(24){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col25]+table :is(thead,tbody) :is(th,td):nth-child(25){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col26]+table :is(thead,tbody) :is(th,td):nth-child(26){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col27]+table :is(thead,tbody) :is(th,td):nth-child(27){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col28]+table :is(thead,tbody) :is(th,td):nth-child(28){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col29]+table :is(thead,tbody) :is(th,td):nth-child(29){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) [data-hide-col30]+table :is(thead,tbody) :is(th,td):nth-child(30){display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) .table--filtered tbody tr:not(.filtered--show){display:none !important}iam-table-basic:is(.mh-lg,.mh-md,.mh-sm) thead{position:sticky;top:0;z-index:9999}iam-table-basic:is(.mh-lg,.mh-md,.mh-sm) thead tr{background:var(--row-bg);background:linear-gradient(0deg, var(--colour-primary) 2px, var(--row-bg) 2px);border:none}/*# sourceMappingURL=assets/css/components/table.global.css.map */
21
+ </style>`)}connectedCallback(){const e=this.shadowRoot.querySelector("iam-pagination"),a=this.querySelector("table"),i=O(this,a);E(this,a,i,e),C(this,a),G(this,a,i,e),N(component,a,i,e,()=>{y(component,a,i,e)})}}export{K as default};
22
+ //# sourceMappingURL=table-ajax.component.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-ajax.component.min.js","sources":["../../modules/helpers.js","../../modules/table.js","table-ajax.component.js"],"sourcesContent":["/**\n * Global helper functions to help maintain and enhance framework elements.\n * @module Helpers\n */\n/**\n * Add global classes used by the CSS and later JavaScript.\n * @param {HTMLElement} body Dom element, this doesn't have to be the body but it is recommended.\n */\nexport const addBodyClasses = (body) => {\n body.classList.add('js-enabled');\n if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {\n body.classList.add('ie');\n }\n};\n/**\n * Add global events.\n * @param {HTMLElement} body Dom element, this doesn't have to be the body but it is recommended.\n */\nexport const addGlobalEvents = (body) => {\n const checkElements = function (hash) {\n const label = document.querySelector(`label[for=\"${hash.replace('#', '')}\"]`);\n const summary = document.querySelector(hash + ' summary');\n const dialog = document.querySelector(`dialog${hash}`);\n const detail = document.querySelector(`detail${hash}`);\n if (label instanceof HTMLElement)\n label.click();\n else if (summary instanceof HTMLElement)\n summary.click();\n else if (dialog instanceof HTMLElement)\n dialog.showModal();\n else if (detail instanceof HTMLElement)\n detail.addAttribute('open');\n };\n if (location.hash)\n checkElements(location.hash);\n window.addEventListener('hashchange', function () {\n checkElements(location.hash);\n }, false);\n addEventListener('popstate', (event) => {\n if (event && event.state && event.state.type && event.state.type == 'pagination') {\n const form = document.querySelector(`#${event.state.form}`);\n const pageInput = document.querySelector(`#${event.state.form} [data-pagination]`);\n if (pageInput)\n pageInput.value = event.state.page;\n else\n form.innerHTML += `<input name=\"page\" type=\"hidden\" data-pagination=\"true\" value=\"${event.state.page}\" />`;\n form.dispatchEvent(new Event('submit'));\n }\n });\n document.addEventListener('submit', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.matches('form')) {\n const form = event.target;\n // Reset password types\n Array.from(form.querySelectorAll('[data-password-type]')).forEach((input) => {\n input.setAttribute('type', 'password');\n });\n if (form.querySelector(':invalid') ||\n form.querySelector('.pwd-checker[data-strength=\"1\"]') ||\n form.querySelector('.pwd-checker[data-strength=\"2\"]')) {\n form.classList.add('was-validated');\n event.preventDefault();\n }\n if (form.querySelector('iam-multiselect[data-is-required][data-error]')) {\n form.classList.add('was-validated');\n event.preventDefault();\n }\n }\n });\n document.addEventListener('keydown', (e) => {\n if (e.key === 'Escape') {\n if (document.querySelector('.dialog--transactional[open], .dialog--acknowledgement[open]')) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n });\n Array.from(document.querySelectorAll('label progress')).forEach((progress) => {\n const label = progress.closest('label');\n label.setAttribute('data-percent', progress.getAttribute('value'));\n });\n};\nexport const isNumeric = function (str) {\n if (typeof str != 'string')\n return false; // we only process strings!\n return (!isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...\n !isNaN(parseFloat(str))); // ...and ensure strings of whitespace fail\n};\nexport const zeroPad = (num, places) => String(num).padStart(places, '0');\nexport const ucfirst = (str) => str.charAt(0).toUpperCase() + str.slice(1);\nexport const ucwords = (str) => str\n .split(' ')\n .map((s) => ucfirst(s))\n .join(' ');\nexport const unsnake = (str) => str.replace(/_/g, ' ');\nexport const snake = (str) => str.replace(/ /g, '_');\nexport const safeID = function (str) {\n str = str.toLowerCase();\n str = snake(str);\n str = str.replace(/\\W/g, '');\n return str;\n};\nexport const numberOfDays = function (startDateString, endDateString) {\n const convertStart = startDateString.split('/');\n const convertEnd = endDateString.split('/');\n const dateStart = new Date(convertStart[1] + '/' + convertStart[0] + '/' + convertStart[2]);\n const dateEnd = new Date(convertEnd[1] + '/' + convertEnd[0] + '/' + convertEnd[2]);\n if (dateStart == 'Invalid Date')\n throw 'Start date is not a valid date';\n if (dateEnd == 'Invalid Date')\n throw 'End date is not a valid date';\n // To calculate the time difference of two dates\n const diffTime = dateEnd.getTime() - dateStart.getTime();\n const numberOfDays = diffTime / (1000 * 3600 * 24) + 1;\n if (numberOfDays < 0)\n throw 'The start date should be before the end date';\n return numberOfDays;\n};\n// Used to get values from nested json objects\nexport const resolvePath = (object, path, defaultValue) => path\n // eslint-disable-next-line no-useless-escape\n .split(/[\\.\\[\\]\\'\\\"]/)\n .filter((p) => p)\n .reduce((o, p) => (o ? o[p] : defaultValue), object);\nexport const isTraversable = (o) => Array.isArray(o) || (o !== null && ['function', 'object'].includes(typeof o));\nexport const getSwipeDirection = (touchstartX, touchstartY, touchendX, touchendY) => {\n const limit = Math.tan(((45 * 1.5) / 180) * Math.PI);\n const pageWidth = window.innerWidth || document.body.clientWidth;\n const treshold = Math.max(1, Math.floor(0.01 * pageWidth));\n const x = touchendX - touchstartX;\n const y = touchendY - touchstartY;\n const xy = Math.abs(x / y);\n const yx = Math.abs(y / x);\n if (Math.abs(x) > treshold || Math.abs(y) > treshold) {\n if (yx <= limit) {\n if (x < 0) {\n return 'left';\n }\n else {\n return 'right';\n }\n }\n if (xy <= limit) {\n if (y < 0) {\n return 'top';\n }\n else {\n return 'bottom';\n }\n }\n }\n else {\n return 'tap';\n }\n};\nexport const uniqueID = (index = 1) => {\n const ID = Math.floor(Math.random() * Date.now() * (index + 1));\n return ID;\n};\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { zeroPad, isNumeric, ucfirst, resolvePath, uniqueID } from './helpers.js';\n// #region Helpers\nexport const formatCell = (format, cellOutput) => {\n switch (format) {\n case 'datetime':\n return (new Date(cellOutput).toLocaleDateString('en-gb', {\n weekday: 'short',\n year: '2-digit',\n month: 'long',\n day: 'numeric',\n }) +\n ' ' +\n new Date(cellOutput).toLocaleTimeString('en-gb', { hour: '2-digit', minute: '2-digit' }));\n case 'date':\n return new Date(cellOutput).toLocaleDateString('en-gb', {\n day: 'numeric',\n month: 'long',\n year: '2-digit',\n });\n case 'capitalise':\n return (cellOutput = ucfirst(cellOutput));\n }\n};\nconst filterFilters = function (form) {\n const filters = new Object();\n // Filter\n const filterInputs = Array.from(form.querySelectorAll('[data-filter]'));\n filterInputs.forEach((filterInput) => {\n // Ignore uncked radio inputs\n if (filterInput.type == 'radio' && !filterInput.checked) {\n return;\n }\n if (filterInput.type == 'checkbox' && !filterInput.checked) {\n return;\n }\n if (filterInput && filterInput.value) {\n const dataFilter = filterInput.getAttribute('data-filter');\n let filterValue = filterInput.value;\n if (filterInput.hasAttribute('data-date-from'))\n filterValue += '-date-from';\n if (filterInput.hasAttribute('data-date-to'))\n filterValue += '-date-to';\n if (!filters[dataFilter])\n filters[dataFilter] = [];\n filters[dataFilter].push(filterValue);\n }\n });\n return filters;\n};\nexport const moveAttributesToComponents = (component) => {\n let form = document.createElement('form');\n const table = component.querySelector('table');\n if (component.hasAttribute('data-filterby')) {\n form = document.querySelector(`#${component.getAttribute('data-filterby')}`);\n }\n else if (component.closest('form')) {\n form = component.closest('form');\n }\n else {\n table.parentNode.insertBefore(form, table.nextSibling);\n }\n if (form.hasAttribute('data-ajax'))\n component.setAttribute('data-ajax', form.getAttribute('data-ajax'));\n if (form.hasAttribute('data-schema'))\n component.setAttribute('data-schema', form.getAttribute('data-schema'));\n};\nexport const paginateTable = (component, table, form, pagination, callback) => {\n if (!form.querySelector('[name=show]'))\n form.insertAdjacentHTML('beforeend', `<input name=\"show\" type=\"hidden\" value=\"${component.getAttribute('data-show')}\" />`);\n if (!form.querySelector('[name=page]'))\n form.insertAdjacentHTML('beforeend', `<input name=\"page\" type=\"hidden\" value=\"${component.getAttribute('data-page')}\" />`);\n pagination.addEventListener('update-show', (event) => {\n if (form.querySelector('[name=show]').value != event.detail.show) {\n form.querySelector('[name=show]').value = event.detail.show;\n const updateEvent = new CustomEvent('update-show', { detail: { show: event.detail.show } });\n component.dispatchEvent(updateEvent);\n updateAttributes(component, pagination);\n callback();\n }\n });\n pagination.addEventListener('update-page', (event) => {\n if (form.querySelector('[name=page]').value != event.detail.page) {\n form.querySelector('[name=page]').value = event.detail.page;\n const updateEvent = new CustomEvent('update-page', { detail: { page: event.detail.page } });\n component.dispatchEvent(updateEvent);\n updateAttributes(component, pagination);\n callback();\n // scroll back to the top of the table\n if (!component.hasAttribute('data-no-scroll')) {\n const yOffset = -250;\n const y = table.getBoundingClientRect().top + window.pageYOffset + yOffset;\n window.scrollTo({ top: y, behavior: 'smooth' });\n }\n }\n });\n};\nexport const findForm = (component, table) => {\n let form = document.createElement('form');\n if (component.hasAttribute('data-filterby')) {\n form = document.querySelector(`#${component.getAttribute('data-filterby')}`);\n }\n else if (component.closest('form')) {\n form = component.closest('form');\n }\n else {\n table.parentNode.insertBefore(form, table.nextSibling);\n }\n return form;\n};\n// #endregion\nexport const setupBasicTable = (component, table, form, pagination) => {\n const tableWrapper = component.shadowRoot.querySelector('.table__wrapper');\n if (!component.hasAttribute('data-total'))\n component.setAttribute('data-total', component.querySelectorAll('tbody tr').length);\n if (!component.hasAttribute('data-page'))\n component.setAttribute('data-page', 1);\n if (!component.hasAttribute('data-show'))\n component.setAttribute('data-show', 5);\n if (!component.hasAttribute('data-increment'))\n component.setAttribute('data-increment', component.getAttribute('data-show'));\n transferAttributes(component, pagination);\n addDataAttributes(table);\n createMobileButton(component, table);\n // Max height\n if (component.classList.contains('mh-sm'))\n tableWrapper.classList.add('mh-sm');\n if (component.classList.contains('mh-md'))\n tableWrapper.classList.add('mh-md');\n if (component.classList.contains('mh-lg'))\n tableWrapper.classList.add('mh-lg');\n if (component.classList.contains('table--cta')) {\n getLargestLastColWidth(component, table);\n getRowHeight(component, table);\n }\n};\n// #region Basic table fnctions\nexport const transferAttributes = (component, pagination) => {\n if (component.hasAttribute('data-total'))\n pagination.setAttribute('data-total', component.getAttribute('data-total'));\n if (component.hasAttribute('data-page'))\n pagination.setAttribute('data-page', component.getAttribute('data-page'));\n if (component.hasAttribute('data-show'))\n pagination.setAttribute('data-show', component.getAttribute('data-show'));\n if (component.hasAttribute('data-increment'))\n pagination.setAttribute('data-increment', component.getAttribute('data-show'));\n if (component.hasAttribute('data-page-jump'))\n pagination.setAttribute('data-page-jump', 'true');\n if (component.hasAttribute('data-per-page'))\n pagination.setAttribute('data-per-page', 'true');\n if (component.hasAttribute('data-item-count'))\n pagination.setAttribute('data-item-count', 'true');\n if (component.hasAttribute('data-loading'))\n pagination.setAttribute('data-loading', 'true');\n if (component.classList.contains('table--fullwidth'))\n pagination.setAttribute('data-minimal', 'true');\n};\nexport const updateAttributes = (component, pagination) => {\n component.setAttribute('data-total', pagination.getAttribute('data-total'));\n component.setAttribute('data-page', pagination.getAttribute('data-page'));\n component.setAttribute('data-show', pagination.getAttribute('data-show'));\n component.setAttribute('data-increment', pagination.getAttribute('data-show'));\n};\nexport const paginateRows = (component) => {\n const total = component.getAttribute('data-total');\n const page = component.getAttribute('data-page');\n const show = component.getAttribute('data-show');\n const increment = component.getAttribute('data-increment');\n const table = component.querySelector('table');\n const end = page * show;\n const start = end - show;\n Array.from(table.querySelectorAll('tbody tr')).forEach((row, index) => {\n if (index >= start && index < end) {\n row.classList.add('show');\n }\n else {\n row.classList.remove('show');\n }\n });\n};\nexport const addDataAttributes = (table) => {\n const colHeadings = Array.from(table.querySelectorAll('thead th'));\n const colRows = Array.from(table.querySelectorAll('tbody tr'));\n colRows.forEach((row) => {\n const cells = Array.from(row.querySelectorAll('th, td'));\n const statuses = [\n '0',\n 'low',\n 'medium',\n 'high',\n 'unknown',\n 'n/a',\n 'pending',\n 'verified',\n 'due',\n 'overdue',\n 'incomplete',\n 'complete',\n 'completed',\n 'approval required',\n 'upcoming',\n 'requires approval',\n 'to do',\n 'on track',\n 'not started',\n 'warning',\n 'successful',\n 'failed',\n ];\n cells.forEach((cell, cellIndex) => {\n const heading = colHeadings[cellIndex];\n if (typeof heading != 'undefined') {\n const tempDiv = document.createElement('div');\n tempDiv.innerHTML = heading.innerHTML;\n const headingText = tempDiv.textContent || tempDiv.innerText || '';\n cell.setAttribute('data-label', headingText);\n if (heading.hasAttribute('data-td-class'))\n cell.setAttribute('class', heading.getAttribute('data-td-class'));\n if (heading.hasAttribute('data-format')) {\n cell.setAttribute('data-format', heading.getAttribute('data-format'));\n cell.innerHTML = formatCell(heading.getAttribute('data-format'), cell.textContent.trim()); //Make sure date format is consistent\n }\n if (statuses.includes(cell.textContent.trim().toLowerCase())) {\n cell.setAttribute('data-content', cell.textContent.trim().toLowerCase());\n }\n }\n });\n });\n};\nexport const createMobileButton = (component, table) => {\n if (component.classList.contains('table--fullwidth') && !component.hasAttribute('data-expandable'))\n return false;\n if (table.querySelectorAll('thead tr th').length < 4 && !component.hasAttribute('data-expandable'))\n return false;\n //If the expand column already exists we don't need to add a new one.\n Array.from(table.querySelectorAll('thead tr')).forEach((row) => {\n if (!table.querySelectorAll('thead tr th.expand-button-heading').length) {\n row.insertAdjacentHTML('afterbegin', `<th class=\"${component.hasAttribute('data-expandable') ? 'th--fixed ' : ''}expand-button-heading\"></th>`);\n }\n });\n Array.from(table.querySelectorAll('tbody tr')).forEach((row, index) => {\n const preExpanded = row.getAttribute('data-view') === 'full' ? 'aria-expanded' : '';\n row.insertAdjacentHTML('afterbegin', `<td class=\"${component.hasAttribute('data-expandable') ? 'td--fixed ' : ''}td--expand\"><button class=\"btn btn-compact btn-secondary btn-sm\" data-expand-button ${preExpanded} data-index=\"${index}\">Expand</button></td>`);\n });\n table.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-expand-button]')) {\n const button = event.target.closest('[data-expand-button]');\n const tableRow = button.closest('tr');\n button.toggleAttribute('aria-expanded');\n if (tableRow.getAttribute('data-view') == 'full')\n tableRow.setAttribute('data-view', 'default');\n else\n tableRow.setAttribute('data-view', 'full');\n button.blur();\n component.dispatchEvent(new CustomEvent('row-expanded', { detail: { row: button.getAttribute('data-index') } }));\n }\n });\n};\nexport const getLargestLastColWidth = (component, table) => {\n let largestWidth = 0;\n Array.from(table.querySelectorAll('tbody tr')).forEach((row) => {\n const htmlStyles = window.getComputedStyle(document.querySelector('html'));\n const lastColChild = row.querySelector(':scope > *:last-child > *:first-child');\n if (lastColChild) {\n lastColChild.classList.add('text-nowrap');\n let responsiveWidth = lastColChild.offsetWidth / parseFloat(htmlStyles.fontSize);\n responsiveWidth += 1.8;\n largestWidth = largestWidth > responsiveWidth ? largestWidth : responsiveWidth;\n }\n });\n component.style.setProperty('--cta-width', `${largestWidth}rem`);\n};\nexport const getRowHeight = (component, table) => {\n function outputsize() {\n Array.from(table.querySelectorAll('tr')).forEach((row) => {\n const rowHeight = row.offsetHeight;\n row.style.setProperty('--row-height', `${rowHeight}px`);\n });\n }\n new ResizeObserver(outputsize).observe(table);\n};\n// #endregion\nexport const setupAdvancedTable = (component, table) => {\n if (component.querySelector('iam-actionbar[data-selectall]') ||\n document.querySelector(`iam-actionbar[data-for='${component.getAttribute('id')}']`)) {\n const actionbar = component.querySelector('iam-actionbar[data-selectall]')\n ? component.querySelector('iam-actionbar[data-selectall]')\n : document.querySelector(`iam-actionbar[data-for='${component.getAttribute('id')}']`);\n addSelectboxes(component, table, actionbar);\n }\n component.querySelectorAll('.dialog__wrapper .btn-compact').forEach((btn) => {\n btn.classList.add('btn-sm');\n btn.classList.add('m-0');\n const tr = btn.closest('tr');\n const td = btn.closest('td');\n const trChildren = Array.prototype.slice.call(tr.children);\n const cellIndex = trChildren.indexOf(td);\n td.classList.add('td--fixed');\n table.querySelector(`thead tr th:nth-child(${cellIndex + 1})`).classList.add('th--fixed');\n });\n};\n// #region Advanced table functions\nexport const addSelectboxes = (component, table, actionbar) => {\n Array.from(table.querySelectorAll('thead tr')).forEach((row) => {\n if (row.querySelector('.expand-button-heading'))\n row.querySelector('.expand-button-heading').insertAdjacentHTML('afterend', `<th class=\"th--fixed\"></th>`);\n else\n row.insertAdjacentHTML('afterbegin', `<th class=\"th--fixed\"></th>`);\n });\n Array.from(table.querySelectorAll('tbody tr')).forEach((row, index) => {\n row.setAttribute('data-index', index + 1);\n if (!row.querySelector('.selectrow')) {\n const rowID = `row${uniqueID(index)}`;\n if (row.querySelector('.td--expand'))\n row\n .querySelector('.td--expand')\n .insertAdjacentHTML('afterend', `<td class=\"td--fixed selectrow selected\"><input type=\"checkbox\" name=\"row\" id=\"${rowID}\" ${row.hasAttribute('data-selected') ? `checked=\"true\"` : ''}/><label for=\"${rowID}\"><span class=\"visually-hidden\">Select row</span></label></td>`);\n else\n row.insertAdjacentHTML('afterbegin', `<td class=\"td--fixed selectrow selected\"><input type=\"checkbox\" name=\"row\" id=\"${rowID}\" ${row.hasAttribute('data-selected') ? `checked=\"true\"` : ''}/><label for=\"${rowID}\"><span class=\"visually-hidden\">Select row</span></label></td>`);\n }\n });\n table.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.selectrow input')) {\n const input = event.target.closest('.selectrow input');\n const row = event.target.closest('tr');\n const count = table.querySelectorAll('.selectrow input[type=\"checkbox\"]').length;\n const countChecked = table.querySelectorAll('.selectrow input[type=\"checkbox\"]:checked').length;\n actionbar.setAttribute('data-selected', count == countChecked ? 'all' : countChecked);\n const dispatchedEvent = new CustomEvent('row-selected', {\n detail: {\n rowIndex: row.getAttribute('data-index'),\n checked: input.checked ? true : false,\n },\n });\n component.dispatchEvent(dispatchedEvent);\n }\n });\n actionbar.addEventListener('selected', (event) => {\n if (event.detail.selected == '0') {\n Array.from(table.querySelectorAll('.selectrow input[type=\"checkbox\"]')).forEach((input) => {\n input.checked = false;\n });\n const dispatchedEvent = new CustomEvent('all-rows-unselected');\n component.dispatchEvent(dispatchedEvent);\n }\n else if (event.detail.selected == 'all') {\n Array.from(table.querySelectorAll('.selectrow input[type=\"checkbox\"]')).forEach((input) => {\n input.checked = true;\n });\n const dispatchedEvent = new CustomEvent('all-rows-selected');\n component.dispatchEvent(dispatchedEvent);\n }\n });\n};\n// Export CSV Data\nexport const addExportEventListeners = (button, table) => {\n if (!button) {\n return false;\n }\n button.addEventListener('click', () => {\n exportAsCSV(table);\n });\n};\nexport const exportAsCSV = function (table) {\n let csvData = [];\n // Get each row data\n const rows = table.getElementsByTagName('tr');\n for (let i = 0; i < rows.length; i++) {\n // Get each column data\n const cols = rows[i].querySelectorAll('td,th');\n // Stores each csv row data\n const csvRow = [];\n for (let j = 0; j < cols.length; j++) {\n // Get the text data of each cell of a row and push it to csvrow\n csvRow.push(`\"${cols[j].textContent}\"`);\n }\n // Combine each column value with comma\n csvData.push(csvRow.join(','));\n }\n // Combine each row data with new line character\n csvData = csvData.join('\\n');\n // Create CSV file object and feed our csvData into it\n const CSVFile = new Blob([csvData], {\n type: 'text/csv',\n });\n // Create to temporary link to initiate download process\n const tempLink = document.createElement('a');\n tempLink.download = 'export.csv';\n const url = window.URL.createObjectURL(CSVFile);\n tempLink.href = url;\n // This link should not be displayed\n tempLink.style.display = 'none';\n document.body.appendChild(tempLink);\n // Automatically click the link to trigger download\n tempLink.click();\n document.body.removeChild(tempLink);\n};\n// #endregion\nexport const setupNoSubmitTable = (component, table, form, pagination, savedTableBody) => {\n sortViaHeaders(component, table);\n createSearchDataList(component, table);\n form.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-sort]')) {\n sortTable(table, form, savedTableBody);\n }\n });\n addFilterEventListeners(component, table, form, pagination, savedTableBody);\n};\n// #region No submit table functions\nexport const sortViaHeaders = (component, table) => {\n table.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-sort]')) {\n const heading = event.target.closest('[data-sort]');\n heading.setAttribute('data-sort', 'true');\n // Turn other headings off\n Array.from(table.querySelectorAll('th[data-sort]')).forEach((element) => {\n if (element != heading) {\n element.setAttribute('data-sort', '');\n element.removeAttribute('data-order-by');\n heading.setAttribute('title', 'Click to sort ascending');\n }\n });\n if (heading.hasAttribute('data-order-by') && heading.getAttribute('data-order-by') == 'asc') {\n heading.setAttribute('data-order-by', 'desc');\n heading.setAttribute('title', 'Click to sort ascending');\n }\n else {\n heading.setAttribute('data-order-by', 'asc');\n heading.setAttribute('title', 'Click to sort descending');\n }\n // dispath event\n const dispatchedEvent = new CustomEvent('sort-by-heading', {\n detail: {\n heading: heading.textContent,\n sortBy: heading.getAttribute('data-order-by'),\n ref: heading.getAttribute('data-ref'),\n },\n });\n component.dispatchEvent(dispatchedEvent);\n const sortBy = heading.textContent.trim();\n const order = heading.getAttribute('data-order-by');\n if (!component.hasAttribute('data-submit')) {\n // TODO\n sortTableByValues(table, sortBy, order);\n }\n }\n });\n};\nexport const createSearchDataList = (component, table) => {\n var _a;\n const actionbar = component.querySelector('iam-actionbar');\n if (!actionbar)\n return false;\n const searchInput = (_a = actionbar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input#search');\n if (!searchInput)\n return false;\n const searchID = searchInput.getAttribute('id');\n const inputWrapper = searchInput.parentNode;\n const searchableTerms = {};\n table.querySelectorAll('tbody td:not(.td--fixed)').forEach((td) => {\n if (td.querySelector('.td__content'))\n searchableTerms[td.querySelector('.td__content').textContent] = td.querySelector('.td__content').textContent;\n else\n searchableTerms[td.textContent] = td.textContent;\n });\n searchInput.setAttribute('list', `${searchID}_list`);\n searchInput.setAttribute('autocomplete', 'off');\n if (!inputWrapper.querySelector('datalist'))\n inputWrapper.innerHTML += `<datalist id=\"${searchID}_list\"></datalist>`;\n inputWrapper.querySelector('datalist').innerHTML = `${Object.keys(searchableTerms)\n .map((term) => `<option value=\"${term}\"></option>`)\n .join('')}`;\n};\nexport const sortTable = (table, form, savedTableBody) => {\n if (form.getAttribute('data-ajax')) {\n return false;\n }\n const tbody = table.querySelector('tbody');\n let selectedOption = form.querySelector(`input[type=\"radio\"][data-sort]:checked`);\n if (form.querySelector('select[data-sort]')) {\n const select = form.querySelector('select[data-sort]');\n selectedOption = form.querySelector(`select[data-sort] option:nth-child(${select.selectedIndex + 1})`);\n }\n const sortBy = selectedOption.getAttribute('data-sort');\n const order = selectedOption.getAttribute('data-order');\n const format = selectedOption.getAttribute('data-format');\n if (!sortBy) {\n tbody.innerHTML = savedTableBody.innerHTML;\n addDataAttributes(table);\n return false;\n }\n sortTableByValues(table, sortBy, order, format);\n};\nexport const sortTableByValues = (table, sortBy, order, format = '') => {\n const tbody = table.querySelector('tbody');\n let orderArray = [];\n if (!['asc', 'desc', 'descending'].includes(order)) {\n orderArray = order.split(',');\n }\n // Create an array from the table rows, the index created is then used to sort the array\n let tableArr = [];\n Array.from(tbody.querySelectorAll('tr')).forEach((tableRow) => {\n let rowIndex = tableRow\n .querySelector('td[data-label=\"' + sortBy + '\"], th[data-label=\"' + sortBy + '\"]')\n .textContent.trim();\n if (tableRow.querySelector('[data-label=\"' + sortBy + '\"] .td__content')) {\n rowIndex = tableRow.querySelector('[data-label=\"' + sortBy + '\"] .td__content').textContent.trim();\n }\n // If a predefined order set replace the search term with an ordered numeric value so it can be sorted\n if (orderArray.length && orderArray.includes(rowIndex)) {\n rowIndex = orderArray.indexOf(rowIndex);\n }\n if (isNumeric(rowIndex)) {\n rowIndex = zeroPad(rowIndex, 10);\n }\n // If the sort format is date then lets transform the index to a sortable date (this is never displayed)\n if (format && format == 'date') {\n rowIndex = new Date(rowIndex);\n }\n const dataRow = {\n index: rowIndex,\n row: tableRow,\n };\n tableArr.push(dataRow);\n });\n // Sort array alphabetically\n tableArr.sort((a, b) => (a.index > b.index ? 1 : -1));\n // Reverse if descending\n if (order == 'descending' || order == 'desc') {\n tableArr = tableArr.reverse();\n }\n // Create a string to return and populate the tbody\n let strTbody = '';\n tableArr.forEach((tableRow) => {\n strTbody += tableRow.row.outerHTML;\n });\n tbody.innerHTML = strTbody;\n};\nexport const addFilterEventListeners = (component, table, form, pagination, savedTableBody) => {\n let timer;\n // Check what conditions are set on the table to see what the form actions are\n const formSubmit = function (event, paginate = false) {\n if (form.classList.contains('processing'))\n return false;\n Array.from(form.querySelectorAll('iam-applied-filters')).forEach((element) => {\n const event = new Event('tags-set');\n element.dispatchEvent(event);\n });\n // Before submitting check if any duplicate checkboxes within the filters dialog needs to upset the original input\n if (event.type == 'submit') {\n form.classList.add('processing');\n Array.from(form.querySelectorAll('[data-duplicate]')).forEach((element) => {\n const id = element.getAttribute('data-duplicate');\n const input = document.getElementById(id);\n const card = document.querySelector(`[for=\"${id}\"] iam-card`);\n if (input.checked != element.checked) {\n if (card) {\n const clickEvent = new Event('click');\n card.dispatchEvent(clickEvent);\n }\n else {\n input.checked = element.checked;\n }\n }\n });\n form.classList.remove('processing');\n }\n filterTable(component, table, form, pagination);\n populateDataQueries(component, table, form);\n /*\n // Pass post data back to the page\n if (form.hasAttribute('data-ajax-post')) {\n const formData = new FormData(form);\n const queryString = new URLSearchParams(formData).toString();\n const http = new XMLHttpRequest();\n http.open('GET', `${window.location.href}?ajax=true&${queryString}`);\n http.send();\n }\n */\n };\n if (component.querySelector('iam-actionbar[data-search]')) {\n component.querySelector('iam-actionbar[data-search]').addEventListener('search-submit', (event) => {\n if (form.querySelector('input[data-search]')) {\n form.querySelector('input[data-search]').value = event.detail.search;\n }\n else {\n form.insertAdjacentHTML('beforeend', `<input type=\"hidden\" name=\"search\" data-search=\"${component.querySelector('iam-actionbar[data-search]').getAttribute('data-search')}\" value=\"${event.detail.search}\"/>`);\n }\n const submitEvent = new CustomEvent('search-submit', {\n detail: event.details,\n });\n component.dispatchEvent(submitEvent);\n clearTimeout(timer);\n formSubmit(event);\n });\n }\n if (component.querySelector('iam-actionbar') && !component.querySelector('iam-actionbar').closest('form')) {\n component.querySelector('iam-actionbar').addEventListener('change', (event) => {\n if (!form.querySelector('.duplicate-actionbar')) {\n form.insertAdjacentHTML('beforeend', `<div class=\"duplicate-actionbar\" style=\"visibility: hidden; pointer-events: none; position: absolute;\"></div>`);\n }\n form.querySelector('.duplicate-actionbar').innerHTML = component.querySelector('iam-actionbar').innerHTML;\n filterTable(component, table, form, pagination);\n });\n }\n form.addEventListener('keyup', (event) => {\n clearTimeout(timer);\n if (event && event.target instanceof HTMLElement && event.target.closest('input[data-search]')) {\n timer = setTimeout(function () {\n formSubmit(event);\n }, 500);\n }\n });\n form.addEventListener('change', (event) => {\n clearTimeout(timer);\n if (event && event.target instanceof HTMLElement && event.target.closest('input[data-search]')) {\n formSubmit(event);\n }\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-filter][data-no-ajax]')) {\n // Allow for input fields to filter the current results without a new ajax call\n filterTable(component, table, form, pagination);\n populateDataQueries(table, form);\n }\n else if (event &&\n event.target instanceof HTMLElement &&\n event.target.closest('[data-filter]') &&\n event.target.closest('form .dialog__wrapper > dialog')) {\n formSubmit(event);\n }\n else if (event &&\n event.target instanceof HTMLElement &&\n event.target.closest('[data-filter]') &&\n !event.target.closest('form dialog')) {\n formSubmit(event);\n }\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-show]')) {\n formSubmit(event);\n }\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-mimic]')) {\n formSubmit(event);\n }\n if (event && event.target instanceof HTMLElement && event.target.hasAttribute('id')) {\n const id = event.target.getAttribute('id');\n if (document.querySelector(`[data-duplicate=\"${id}\"]`)) {\n document.querySelector(`[data-duplicate=\"${id}\"]`).checked = event.target.checked;\n }\n }\n });\n form.addEventListener('click', (event) => {\n clearTimeout(timer);\n if (event && event.target instanceof HTMLElement && event.target.closest('dialog button:not([type=\"button\"])')) {\n const button = event.target.closest('dialog button:not([type=\"button\"])');\n const modal = button.closest('dialog');\n modal.close();\n }\n // Prevent the form from submitting\n if (event && event.target instanceof HTMLElement && event.target.closest('.dialog__close')) {\n event.preventDefault();\n event.stopPropagation();\n }\n if (event && event.target instanceof HTMLElement && event.target.closest('[data-clear]')) {\n form.classList.add('processing');\n // Make sure any applied filters have been removed\n Array.from(form.querySelectorAll('.applied-filters')).forEach((filters) => {\n filters.innerHTML = '';\n });\n // Make sure cards are unlicked\n const frm_elements = form.elements;\n for (let i = 0; i < frm_elements.length; i++) {\n const field_type = frm_elements[i].type.toLowerCase() ? frm_elements[i].type.toLowerCase() : 'text';\n switch (field_type) {\n case 'text':\n case 'password':\n case 'textarea':\n frm_elements[i].value = '';\n break;\n case 'radio':\n case 'checkbox':\n if (frm_elements[i].checked) {\n const input = frm_elements[i];\n const id = input.getAttribute('id');\n const label = document.querySelector(`[for=\"${id}\"`);\n if (label.querySelector('iam-card')) {\n const card = label.querySelector('iam-card');\n const clickEvent = new Event('click');\n card.dispatchEvent(clickEvent);\n }\n input.checked = false;\n }\n break;\n case 'select-one':\n case 'select-multi':\n frm_elements[i].selectedIndex = -1;\n break;\n case 'hidden':\n default:\n break;\n }\n }\n form.classList.remove('processing');\n if (!form.hasAttribute('data-submit')) {\n sortTable(table, form, savedTableBody);\n }\n formSubmit(event);\n }\n });\n form.addEventListener('submit', (event) => {\n clearTimeout(timer);\n if (!form.hasAttribute('data-submit')) {\n event.preventDefault();\n }\n formSubmit(event);\n });\n form.addEventListener('force', (event) => {\n formSubmit(event);\n });\n form.addEventListener('paginate', (event) => {\n formSubmit(event, true);\n });\n // Mmimic fields\n const forms = [];\n const fields = [];\n // Collect the forms that we need to add an event listener for.\n Array.from(form.querySelectorAll('[data-mimic]')).forEach((input) => {\n const mimicField = input.getAttribute('data-mimic');\n Array.from(document.querySelectorAll(`[name=\"${mimicField}\"]`)).forEach((mimicInput) => {\n const parentForm = mimicInput.closest('form');\n if (!forms.includes(parentForm)) {\n forms.push(parentForm);\n }\n if (!fields.includes(mimicField)) {\n fields.push(mimicField);\n }\n });\n });\n // For each form add change listener\n forms.forEach((parentForm) => {\n const updateMimicInput = function () {\n const mimickedAlready = [];\n const formData = new FormData(parentForm);\n let i = 1;\n for (const [key, value] of formData) {\n if (document.querySelector(`[data-mimic=\"${key}\"]`) && !mimickedAlready.includes(key)) {\n mimickedAlready.push(key);\n document.querySelector(`[data-mimic=\"${key}\"]`).value = value;\n }\n else if (document.querySelector(`[data-mimic=\"${key}\"]`))\n document.querySelector(`[data-mimic=\"${key}\"]`).value += ',' + value;\n i++;\n }\n for (const value of mimickedAlready) {\n const event = new Event('force');\n form.dispatchEvent(event);\n }\n // Check for empties\n for (const field of fields) {\n if (!formData.has(field) && parentForm.querySelector(`[name=\"${field}\"]`)) {\n document.querySelector(`[data-mimic=\"${field}\"]`).value = '';\n const event = new Event('force');\n form.dispatchEvent(event);\n }\n }\n };\n parentForm.addEventListener('force', () => {\n updateMimicInput();\n });\n parentForm.addEventListener('change', () => {\n updateMimicInput();\n });\n });\n};\nexport const filterTable = (component, table, form, pagination) => {\n table.classList.remove('table--filtered');\n const filters = filterFilters(form);\n const searches = [];\n let matched = 0;\n const page = form.querySelector('[data-pagination]') ? parseInt(form.querySelector('[data-pagination]').value) : 1;\n const showRows = form.querySelector('[data-show]') ? parseInt(form.querySelector('[data-show]').value) : 15;\n // Reset\n Array.from(table.querySelectorAll('tbody tr')).forEach((row) => {\n row.classList.remove('filtered');\n row.classList.remove('filtered--matched');\n row.classList.remove('filtered--show');\n row.removeAttribute('data-filtered-by');\n });\n // Add search columns too\n if (form.querySelector('input[data-search]')) {\n const searchInput = form.querySelector('input[data-search]');\n //const searchColumns = form.querySelector('input[data-search],[part=\"search-input\"]').getAttribute('data-search').split(',');\n table.querySelectorAll('thead tr th').forEach((column) => {\n searches.push({ column: `${column.textContent.trim()}`, value: `${searchInput.value}` });\n });\n }\n //Display the filter count\n Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element) => {\n element.innerHTML = '';\n element.parentNode.classList.remove('hover');\n });\n let filterCount = 0;\n Object.values(filters).forEach((filter) => {\n if (typeof filter == 'object' && Object.values(filter).length) {\n filterCount += Object.values(filter).length;\n }\n else {\n filterCount++;\n }\n });\n if (filterCount) {\n Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element) => {\n element.innerHTML += `(${filterCount})`;\n element.parentNode.classList.add('hover');\n });\n }\n // Filter the table\n table.classList.add('table--filtered');\n for (const [key, filterValue] of Object.entries(filters)) {\n Array.from(table.querySelectorAll('tbody tr:not(.filtered)')).forEach((row) => {\n let isMatched = false;\n filterValue.forEach((filter) => {\n const filterTd = row.querySelector(`[data-label=\"${key}\"]`);\n if (filter.includes('-date-from')) {\n const fromDate = new Date(filter.replace('-date-from', ''));\n const checkDate = new Date(filterTd.textContent.toLowerCase());\n fromDate.setHours(0, 0, 0, 0);\n checkDate.setHours(0, 0, 0, 0);\n if (checkDate < fromDate) {\n row.classList.add('less-than-from-date');\n isMatched = false;\n }\n else if (!row.classList.contains('less-than-from-date') &&\n !row.classList.contains('greater-than-to-date')) {\n isMatched = true;\n }\n }\n else if (filter.includes('-date-to')) {\n const toDate = new Date(filter.replace('-date-to', ''));\n const checkDate = new Date(filterTd.textContent.toLowerCase());\n toDate.setHours(0, 0, 0, 0);\n checkDate.setHours(0, 0, 0, 0);\n if (checkDate > toDate) {\n row.classList.add('greater-than-to-date');\n isMatched = false;\n }\n else if (!row.classList.contains('less-than-from-date') &&\n !row.classList.contains('greater-than-to-date')) {\n isMatched = true;\n }\n }\n // Dynamic values\n if (filter && filter == '$today') {\n filter = formatCell('date', new Date());\n }\n else if (filter && filter == '$yesterday') {\n const yesterday = new Date();\n yesterday.setDate(yesterday.getDate() - 1);\n filter = formatCell('date', yesterday);\n }\n else if (filter && (filter == '$thisWeek' || filter == '$lastWeek')) {\n const today = new Date();\n const mondayThisWeek = new Date(today.setDate(today.getDate() - (today.getDay() - 1)));\n const sundayThisWeek = new Date(today.setDate(today.getDate() - today.getDay() + 7));\n const checkDate = new Date(filterTd.textContent.toLowerCase());\n today.setHours(0, 0, 0, 0);\n mondayThisWeek.setHours(0, 0, 0, 0);\n sundayThisWeek.setHours(0, 0, 0, 0);\n checkDate.setHours(0, 0, 0, 0);\n if (filter == '$thisWeek') {\n isMatched = checkDate >= mondayThisWeek && checkDate <= sundayThisWeek;\n }\n else {\n const mondayLastWeek = new Date(mondayThisWeek.setDate(mondayThisWeek.getDate() - 7));\n const sundayLastWeek = new Date(sundayThisWeek.setDate(sundayThisWeek.getDate() - 7));\n mondayLastWeek.setHours(0, 0, 0, 0);\n sundayLastWeek.setHours(0, 0, 0, 0);\n isMatched = checkDate >= mondayLastWeek && checkDate <= sundayLastWeek;\n }\n }\n else if (filter && filter == '$thisMonth') {\n const today = new Date(), year = today.getFullYear(), month = today.getMonth();\n const firstDayMonth = new Date(year, month, 1);\n const lastDayMonth = new Date(year, month + 1, 0);\n const checkDate = new Date(filterTd.textContent.toLowerCase());\n firstDayMonth.setHours(0, 0, 0, 0);\n lastDayMonth.setHours(0, 0, 0, 0);\n checkDate.setHours(0, 0, 0, 0);\n isMatched = checkDate >= firstDayMonth && checkDate <= lastDayMonth;\n }\n else if (filter && filter == '$lastMonth') {\n const today = new Date(), year = today.getFullYear(), month = today.getMonth();\n const firstDayLastMonth = new Date(year, month - 1, 1);\n const lastDayLastMonth = new Date(year, month, 0);\n const checkDate = new Date(filterTd.textContent.toLowerCase());\n firstDayLastMonth.setHours(0, 0, 0, 0);\n lastDayLastMonth.setHours(0, 0, 0, 0);\n checkDate.setHours(0, 0, 0, 0);\n isMatched = checkDate >= firstDayLastMonth && checkDate <= lastDayLastMonth;\n }\n if (filterTd && filterTd.textContent.toLowerCase().includes(filter.replace('-', ' ').toLowerCase())) {\n isMatched = true;\n }\n });\n if (!isMatched) {\n row.classList.add('filtered');\n row.setAttribute('data-filtered-by', key);\n }\n });\n }\n // Search whats left of the table after filtering\n Array.from(table.querySelectorAll('tbody tr:not(.filtered)')).forEach((row) => {\n let isSearched = searches.length > 0 && searches[0].value.length >= 3 ? false : true;\n searches.forEach((search) => {\n const searchTd = row.querySelector(`[data-label=\"${search.column}\"]`);\n if (searchTd &&\n search.value.length >= 3 &&\n searchTd.textContent.toLowerCase().includes(search.value.toLowerCase())) {\n isSearched = true;\n }\n });\n if (!isSearched) {\n row.classList.add('filtered');\n }\n });\n // Work out what to display after pagination\n Array.from(table.querySelectorAll('tbody tr:not(.filtered)')).forEach((row) => {\n matched++;\n row.classList.add('filtered--matched');\n // pagination bit\n const matchesPage = Math.ceil(matched / showRows);\n if (matchesPage == parseInt(page)) {\n row.classList.add('filtered--show');\n }\n });\n if (pagination) {\n pagination.setAttribute('data-total', matched);\n pagination.setAttribute('data-show', showRows);\n pagination.setAttribute('data-page', page);\n }\n};\nexport const populateDataQueries = (component, table, form) => {\n const dataQueries = Array.from(form.querySelectorAll('[data-query]'));\n dataQueries.forEach((queryElement) => {\n const query = queryElement.getAttribute('data-query');\n let numberOfMatchedRows = 0;\n if (query == 'total') {\n if (component.hasAttribute('data-total'))\n numberOfMatchedRows = component.getAttribute('data-total');\n else\n numberOfMatchedRows = table.classList.contains('table--filtered')\n ? table.querySelectorAll('tbody tr').length\n : table.querySelectorAll('tbody tr').length;\n }\n else if (!query.includes(' == ') && query.includes(' & ')) {\n const queries = query.split(' & ');\n let selector = '';\n queries.forEach((element) => {\n selector += `:not([data-filtered-by=\"${element}\"])`;\n });\n numberOfMatchedRows = Array.from(table.querySelectorAll(`tbody tr${selector}`)).length;\n }\n else if (!query.includes(' == ')) {\n numberOfMatchedRows = Array.from(table.querySelectorAll(`tbody tr:not([data-filtered-by=\"${query}\"])`)).length;\n }\n else if (query.includes(' && ')) {\n const queries = query.split(' && ');\n numberOfMatchedRows = Array.from(table.querySelectorAll(`tbody tr:not(.filtered)`)).filter(function (row) {\n let matched = true;\n for (const value of Object.entries(queries)) {\n const queryParts = value.split(' == ');\n if (!row.querySelector(`td[data-label=\"${queryParts[0]}\"]`) ||\n row.querySelector(`td[data-label=\"${queryParts[0]}\"]`).textContent != `${queryParts[1]}`)\n matched = false;\n }\n return matched;\n }).length;\n }\n else {\n const queryParts = query.split(' == ');\n numberOfMatchedRows = Array.from(table.querySelectorAll(`tbody tr.filtered--matched td[data-label=\"${queryParts[0]}\"], tbody tr[data-filtered-by=\"${queryParts[0]}\"] td[data-label=\"${queryParts[0]}\"]`)).filter(function (element) {\n return element.textContent === queryParts[1];\n }).length;\n }\n if (queryElement.hasAttribute('data-total')) {\n queryElement.setAttribute('data-total', numberOfMatchedRows);\n }\n else {\n queryElement.innerHTML = numberOfMatchedRows;\n }\n });\n};\n// #endregion\nexport const setupSubmitTable = (component, table, form, pagination) => {\n form.setAttribute('method', 'get');\n const actionbar = component.querySelector('iam-actionbar');\n if (actionbar) {\n actionbar.addEventListener('change', (event) => {\n form.submit();\n });\n }\n};\n// #region submit tables functions\n// #endregion\nexport const setupAjaxTable = (component, table, form, pagination) => {\n loadAjaxTable(component, table, form, pagination);\n const actionbar = component.querySelector('iam-actionbar');\n form.addEventListener('submit', (event) => {\n loadAjaxTable(component, table, form, pagination);\n event.preventDefault();\n });\n if (actionbar) {\n actionbar.addEventListener('change', (event) => {\n loadAjaxTable(component, table, form, pagination);\n });\n }\n};\n// #region ajax tables functions\nexport const loadAjaxTable = function (component, table, form, pagination) {\n return __awaiter(this, void 0, void 0, function* () {\n // Add actionbar inputs into form\n if (component.querySelector('iam-actionbar') && !component.querySelector('iam-actionbar').closest('form')) {\n if (!form.querySelector('.duplicate-actionbar'))\n form.insertAdjacentHTML('beforeend', `<div class=\"duplicate-actionbar\" style=\"visibility: hidden; pointer-events: none; position: absolute;\"></div>`);\n form.querySelector('.duplicate-actionbar').innerHTML = component.querySelector('iam-actionbar').innerHTML;\n }\n // Add pagination inputs into form\n if (!form.querySelector('input[name=show]'))\n form.insertAdjacentHTML('beforeend', `<input name=\"show\" type=\"hidden\" value=\"${component.getAttribute('data-show')}\" />`);\n if (!form.querySelector('input[name=page]'))\n form.insertAdjacentHTML('beforeend', `<input name=\"page\" type=\"hidden\" value=\"${component.getAttribute('data-page')}\" />`);\n form.querySelector('input[name=page]').value = component.getAttribute('data-page');\n form.querySelector('input[name=show]').value = component.getAttribute('data-show');\n // Construct form data to send to api\n const formData = new FormData(form);\n const queryString = new URLSearchParams(formData).toString();\n const columns = table.querySelectorAll('thead tr th:not(.expand-button-heading)');\n const tbody = table.querySelector('tbody');\n const ajaxURL = form.getAttribute('data-ajax');\n component.classList.add('table--loading');\n // Display the filter count\n const filters = filterFilters(form);\n Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element) => {\n element.innerHTML = '';\n element.parentNode.classList.remove('hover');\n });\n let filterCount = 0;\n Object.values(filters).forEach((filter) => {\n if (typeof filter == 'object' && Object.values(filter).length)\n filterCount += Object.values(filter).length;\n else\n filterCount++;\n });\n if (filterCount) {\n Array.from(form.querySelectorAll('[data-filter-count]')).forEach((element) => {\n element.innerHTML += `(${filterCount})`;\n element.parentNode.classList.add('hover');\n });\n }\n // Setup controller vars if not already set\n if (!window.controller)\n window.controller = [];\n // Abort if controller already present for this url\n if (window.controller[ajaxURL])\n window.controller[ajaxURL].abort();\n // Create a new controller so it can be aborted if new fetch made\n window.controller[ajaxURL] = new AbortController();\n const { signal } = controller[ajaxURL];\n // Set loading on the pagination\n pagination.setAttribute('data-loading', 'true');\n form.classList.add('processing');\n try {\n yield fetch(ajaxURL + '?' + queryString, {\n signal: signal,\n method: 'get',\n credentials: 'same-origin',\n headers: new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n }),\n })\n .then((response) => response.json())\n .then((response) => {\n const schema = form.hasAttribute('data-schema') ? form.getAttribute('data-schema') : 'data';\n const totalNumberSchema = form.hasAttribute('data-schema-total')\n ? form.getAttribute('data-schema-total')\n : 'meta.total';\n const currentPageSchema = form.hasAttribute('data-schema-page')\n ? form.getAttribute('data-schema-page')\n : 'meta.current_page';\n const totalNumber = resolvePath(response, totalNumberSchema, 15);\n const currentPage = resolvePath(response, currentPageSchema, 1);\n const data = resolvePath(response, schema);\n const emptyMsg = component.hasAttribute('data-empty-msg')\n ? component.getAttribute('data-empty-msg')\n : 'No results found';\n if (data) {\n tbody.innerHTML = '';\n data.forEach((row) => {\n const table_row = document.createElement('tr');\n columns.forEach((col) => {\n let cellOutput = '';\n const table_cell = document.createElement('td');\n // Add some data to help with the mobile layout design\n table_cell.setAttribute('data-label', col.innerText);\n if (col.getAttribute('data-output')) {\n const cellTemplate = col.getAttribute('data-output');\n // Use a regex to replace {var} with actual values from the json data\n cellOutput = cellTemplate.replace(new RegExp(/{(.*?)}/, 'gm'), function (matched) {\n return resolvePath(row, matched.replace('{', '').replace('}', ''));\n });\n }\n // If an output array is defined then the content is going to made of of multiple values from an array\n if (col.hasAttribute('data-output-array')) {\n const cellTemplate = col.getAttribute('data-output');\n const arrValue = resolvePath(row, cellTemplate.replace('{', '').replace('}', ''));\n cellOutput = '';\n arrValue.forEach((rowValue) => {\n const cellTemplateValue = col.getAttribute('data-output-array');\n let cellOutputValue = '';\n // If we need to transform some of the data\n if (col.hasAttribute('data-output-array-property') &&\n col.hasAttribute('data-output-array-transform')) {\n const propertyValue = resolvePath(rowValue, col.getAttribute('data-output-array-property'));\n const transforms = JSON.parse(col.getAttribute('data-output-array-transform'));\n const transformValue = transforms[propertyValue];\n cellOutputValue = cellTemplateValue.replace(`{${col.getAttribute('data-output-array-property')}}`, transformValue);\n }\n cellOutputValue = cellOutputValue.replace(new RegExp(/{(.*?)}/, 'gm'), function (matched) {\n return resolvePath(rowValue, matched.replace('{', '').replace('}', ''));\n });\n cellOutput += cellOutputValue;\n });\n }\n if (col.hasAttribute('data-transform')) {\n const transforms = JSON.parse(col.getAttribute('data-transform'));\n cellOutput = transforms[cellOutput];\n if (!cellOutput && col.hasAttribute('data-default'))\n cellOutput = col.getAttribute('data-default');\n }\n table_cell.innerHTML = cellOutput;\n table_row.appendChild(table_cell);\n });\n tbody.appendChild(table_row);\n });\n component.setAttribute('data-total', parseInt(totalNumber));\n component.setAttribute('data-page', parseInt(currentPage));\n pagination.setAttribute('data-total', totalNumber);\n pagination.setAttribute('data-page', currentPage);\n Array.from(form.querySelectorAll('[data-ajax-query]')).forEach((queryElement) => {\n const totalNumber = resolvePath(response, queryElement.getAttribute('data-ajax-query'), '');\n if (queryElement.hasAttribute('data-total'))\n queryElement.setAttribute('data-total', totalNumber);\n else\n queryElement.innerHTML = totalNumber;\n });\n if (parseInt(totalNumber) == 0) {\n tbody.innerHTML = `<tr><td colspan=\"100%\"><span>${emptyMsg}</span></td></tr>`;\n }\n component.classList.remove('table--loading');\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n event: 'Ajax table loaded',\n url: ajaxURL,\n formData: queryString,\n });\n setupBasicTable(component, table, form, pagination);\n setupAdvancedTable(component, table, form, pagination);\n }\n else {\n tbody.innerHTML = '<tr><td colspan=\"100%\"><span>Error loading table</span></td></tr>';\n }\n // Remove loading on the pagination\n pagination.removeAttribute('data-loading');\n form.classList.remove('processing');\n });\n }\n catch (error) {\n console.log(error);\n }\n });\n};\n// #endregion\n/*\n// Pagination - still needed?\nexport const addPaginationEventListeners = function (component, table, form, pagination): void | boolean {\n\n \n pagination.addEventListener('update-page', (event) => {\n const paginationInput = form.querySelector('[data-pagination]');\n const newPage = event.detail.page;\n\n // Set the filter value\n paginationInput.value = newPage;\n form.dispatchEvent(new Event('paginate'));\n\n // Reset the data attribute\n component.setAttribute('data-page', newPage);\n\n if (table.hasAttribute('data-show-history')) {\n const url = new URL(location);\n url.searchParams.set('page', newPage);\n history.pushState({ type: 'pagination', form: form.getAttribute('id'), page: newPage }, '', url);\n }\n\n // scroll back to the top of the table\n if (!component.hasAttribute('data-no-scroll')) {\n const yOffset = -250;\n const y = table.getBoundingClientRect().top + window.pageYOffset + yOffset;\n window.scrollTo({ top: y, behavior: 'smooth' });\n }\n });\n\n pagination.addEventListener('update-show', (event) => {\n const showInput = form.querySelector('[data-show]');\n const showRows = event.detail.show;\n showInput.value = showRows;\n component.setAttribute('data-show', showRows);\n form.dispatchEvent(new Event('submit'));\n });\n};\n*/\n","import { setupBasicTable, findForm, setupAdvancedTable, setupAjaxTable, paginateTable, loadAjaxTable, } from '../../modules/table.js';\nclass iamTableAjax extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location')\n ? document.body.getAttribute('data-assets-location')\n : '/assets';\n const loadCSS = `@import \"${assetLocation}/css/components/table.component.css\";`;\n const loadExtraCSS = `@import \"${assetLocation}/css/components/table.global.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n ${loadCSS}\n\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"table__container\">\n <slot name=\"before\"></slot>\n <div class=\"table--cta\">\n <div class=\"table__wrapper\">\n <slot></slot>\n </div>\n </div>\n <iam-pagination part=\"pagination\" class=\"pagination--table\" ${this.hasAttribute('data-page') ? `data-page=\"${this.getAttribute('data-page')}\"` : ''} ></iam-pagination>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n // insert extra CSS\n if (!document.getElementById('tableSingleExtras') && !document.getElementById('tableExtras')) {\n document.head.insertAdjacentHTML('beforeend', `<style id=\"tableSingleExtras\">${loadExtraCSS}</style>`);\n }\n }\n connectedCallback() {\n const pagination = this.shadowRoot.querySelector('iam-pagination');\n const table = this.querySelector('table');\n const form = findForm(this, table);\n setupBasicTable(this, table, form, pagination);\n setupAdvancedTable(this, table, form, pagination);\n setupAjaxTable(this, table, form, pagination);\n paginateTable(component, table, form, pagination, () => {\n loadAjaxTable(component, table, form, pagination);\n });\n }\n}\nexport default iamTableAjax;\n"],"names":["ucfirst","str","resolvePath","object","path","defaultValue","p","o","uniqueID","index","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","formatCell","format","cellOutput","filterFilters","form","filters","filterInput","dataFilter","filterValue","paginateTable","component","table","pagination","callback","event","updateEvent","updateAttributes","y","findForm","setupBasicTable","tableWrapper","transferAttributes","addDataAttributes","createMobileButton","getLargestLastColWidth","getRowHeight","colHeadings","row","cells","statuses","cell","cellIndex","heading","tempDiv","headingText","preExpanded","button","tableRow","largestWidth","htmlStyles","lastColChild","responsiveWidth","outputsize","rowHeight","setupAdvancedTable","actionbar","addSelectboxes","btn","tr","td","rowID","input","count","countChecked","dispatchedEvent","setupAjaxTable","loadAjaxTable","formData","queryString","columns","tbody","ajaxURL","element","filterCount","filter","signal","response","schema","totalNumberSchema","currentPageSchema","totalNumber","currentPage","data","emptyMsg","table_row","col","table_cell","matched","cellTemplate","arrValue","rowValue","cellTemplateValue","cellOutputValue","propertyValue","transformValue","queryElement","error","iamTableAjax","template"],"mappings":";;;IAwFO,MAAMA,EAAWC,GAAQA,EAAI,OAAO,CAAC,EAAE,cAAgBA,EAAI,MAAM,CAAC,EA8B5DC,EAAc,CAACC,EAAQC,EAAMC,IAAiBD,EAEtD,MAAM,cAAc,EACpB,OAAQE,GAAMA,CAAC,EACf,OAAO,CAACC,EAAGD,IAAOC,EAAIA,EAAED,CAAC,EAAID,EAAeF,CAAM,EAgC1CK,EAAW,CAACC,EAAQ,IAClB,KAAK,MAAM,KAAK,SAAW,KAAK,IAAG,GAAMA,EAAQ,EAAE,EC3JlE,IAAIC,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,EAAW,CACrF,SAASC,EAAMC,EAAO,CAAE,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,EAAE,SAAUI,EAAS,CAAEA,EAAQD,CAAK,CAAI,CAAA,CAAE,CAC1G,OAAO,IAAKH,IAAMA,EAAI,UAAU,SAAUI,EAASC,EAAQ,CACvD,SAASC,EAAUH,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,KAAKE,CAAK,CAAC,CAAI,OAAQK,EAAG,CAAEH,EAAOG,CAAC,CAAI,CAAA,CACzF,SAASC,EAASN,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,MAASE,CAAK,CAAC,CAAI,OAAQK,EAAG,CAAEH,EAAOG,CAAC,CAAI,CAAA,CAC5F,SAASD,EAAKG,EAAQ,CAAEA,EAAO,KAAON,EAAQM,EAAO,KAAK,EAA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AA;AAAA,MAGjJ,KAAK,WAAW,YAAYA,EAAS,QAAQ,UAAU,EAAI,CAAC,EAExD,CAAC,SAAS,eAAe,mBAAmB,GAAK,CAAC,SAAS,eAAe,aAAa,GACvF,SAAS,KAAK,mBAAmB,YAAa;AAAA,SAAuD,CAEjH,CACI,mBAAoB,CAChB,MAAM5E,EAAa,KAAK,WAAW,cAAc,gBAAgB,EAC3DD,EAAQ,KAAK,cAAc,OAAO,EAClCP,EAAOc,EAAS,KAAMP,CAAK,EACjCQ,EAAgB,KAAMR,EAAOP,EAAMQ,CAAU,EAC7CgC,EAAmB,KAAMjC,CAAuB,EAChD4C,EAAe,KAAM5C,EAAOP,EAAMQ,CAAU,EAC5CH,EAAc,UAAWE,EAAOP,EAAMQ,EAAY,IAAM,CACpD4C,EAAc,UAAW7C,EAAOP,EAAMQ,CAAU,CAC5D,CAAS,CACT,CACA"}
@@ -0,0 +1,46 @@
1
+ import { setupBasicTable, paginateRows, findForm, paginateTable } from '../../modules/table.js';
2
+ class iamTableBasic extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ this.attachShadow({ mode: 'open' });
6
+ const assetLocation = document.body.hasAttribute('data-assets-location')
7
+ ? document.body.getAttribute('data-assets-location')
8
+ : '/assets';
9
+ const loadCSS = `@import "${assetLocation}/css/components/table.component.css";`;
10
+ const loadExtraCSS = `@import "${assetLocation}/css/components/table-basic.global.css";`;
11
+ const template = document.createElement('template');
12
+ template.innerHTML = `
13
+ <style>
14
+ ${loadCSS}
15
+
16
+ ${this.hasAttribute('css') ? `@import "${this.getAttribute('css')}";` : ``}
17
+ </style>
18
+ <div class="table__container" part="container">
19
+ <slot name="before"></slot>
20
+ <div class="table--cta">
21
+ <div class="table__wrapper" part="wrapper">
22
+ <slot></slot>
23
+ </div>
24
+ </div>
25
+ <iam-pagination part="pagination" class="pagination--table" ${this.hasAttribute('data-page') ? `data-page="${this.getAttribute('data-page')}"` : ''} ></iam-pagination>
26
+ </div>
27
+ `;
28
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
29
+ // insert extra CSS
30
+ if (!document.getElementById('tableBasicExtras') &&
31
+ !document.getElementById('tableSingleExtras') &&
32
+ !document.getElementById('tableExtras')) {
33
+ document.head.insertAdjacentHTML('beforeend', `<style id="tableBasicExtras">${loadExtraCSS}</style>`);
34
+ }
35
+ }
36
+ connectedCallback() {
37
+ const pagination = this.shadowRoot.querySelector('iam-pagination');
38
+ const table = this.querySelector('table');
39
+ const form = findForm(this, table);
40
+ setupBasicTable(this, table, form, pagination);
41
+ paginateTable(this, table, form, pagination, () => {
42
+ paginateRows(component);
43
+ });
44
+ }
45
+ }
46
+ export default iamTableBasic;
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * iamKey v7.2.1--beta2
3
+ * Copyright 2022-2025 iamproperty
4
+ */const u=t=>t.charAt(0).toUpperCase()+t.slice(1),h=(t,a)=>{switch(t){case"datetime":return new Date(a).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(a).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(a).toLocaleDateString("en-gb",{day:"numeric",month:"long",year:"2-digit"});case"capitalise":return a=u(a)}},g=(t,a,e,i,n)=>{e.querySelector("[name=show]")||e.insertAdjacentHTML("beforeend",`<input name="show" type="hidden" value="${t.getAttribute("data-show")}" />`),e.querySelector("[name=page]")||e.insertAdjacentHTML("beforeend",`<input name="page" type="hidden" value="${t.getAttribute("data-page")}" />`),i.addEventListener("update-show",r=>{if(e.querySelector("[name=show]").value!=r.detail.show){e.querySelector("[name=show]").value=r.detail.show;const o=new CustomEvent("update-show",{detail:{show:r.detail.show}});t.dispatchEvent(o),c(t,i),n()}}),i.addEventListener("update-page",r=>{if(e.querySelector("[name=page]").value!=r.detail.page){e.querySelector("[name=page]").value=r.detail.page;const o=new CustomEvent("update-page",{detail:{page:r.detail.page}});if(t.dispatchEvent(o),c(t,i),n(),!t.hasAttribute("data-no-scroll")){const l=a.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:l,behavior:"smooth"})}}})},f=(t,a)=>{let e=document.createElement("form");return t.hasAttribute("data-filterby")?e=document.querySelector(`#${t.getAttribute("data-filterby")}`):t.closest("form")?e=t.closest("form"):a.parentNode.insertBefore(e,a.nextSibling),e},p=(t,a,e,i)=>{const n=t.shadowRoot.querySelector(".table__wrapper");t.hasAttribute("data-total")||t.setAttribute("data-total",t.querySelectorAll("tbody tr").length),t.hasAttribute("data-page")||t.setAttribute("data-page",1),t.hasAttribute("data-show")||t.setAttribute("data-show",5),t.hasAttribute("data-increment")||t.setAttribute("data-increment",t.getAttribute("data-show")),w(t,i),y(a),A(t,a),t.classList.contains("mh-sm")&&n.classList.add("mh-sm"),t.classList.contains("mh-md")&&n.classList.add("mh-md"),t.classList.contains("mh-lg")&&n.classList.add("mh-lg"),t.classList.contains("table--cta")&&(x(t,a),k(t,a))},w=(t,a)=>{t.hasAttribute("data-total")&&a.setAttribute("data-total",t.getAttribute("data-total")),t.hasAttribute("data-page")&&a.setAttribute("data-page",t.getAttribute("data-page")),t.hasAttribute("data-show")&&a.setAttribute("data-show",t.getAttribute("data-show")),t.hasAttribute("data-increment")&&a.setAttribute("data-increment",t.getAttribute("data-show")),t.hasAttribute("data-page-jump")&&a.setAttribute("data-page-jump","true"),t.hasAttribute("data-per-page")&&a.setAttribute("data-per-page","true"),t.hasAttribute("data-item-count")&&a.setAttribute("data-item-count","true"),t.hasAttribute("data-loading")&&a.setAttribute("data-loading","true"),t.classList.contains("table--fullwidth")&&a.setAttribute("data-minimal","true")},c=(t,a)=>{t.setAttribute("data-total",a.getAttribute("data-total")),t.setAttribute("data-page",a.getAttribute("data-page")),t.setAttribute("data-show",a.getAttribute("data-show")),t.setAttribute("data-increment",a.getAttribute("data-show"))},v=t=>{t.getAttribute("data-total");const a=t.getAttribute("data-page"),e=t.getAttribute("data-show");t.getAttribute("data-increment");const i=t.querySelector("table"),n=a*e,r=n-e;Array.from(i.querySelectorAll("tbody tr")).forEach((o,s)=>{s>=r&&s<n?o.classList.add("show"):o.classList.remove("show")})},y=t=>{const a=Array.from(t.querySelectorAll("thead th"));Array.from(t.querySelectorAll("tbody tr")).forEach(i=>{const n=Array.from(i.querySelectorAll("th, td")),r=["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","successful","failed"];n.forEach((o,s)=>{const l=a[s];if(typeof l<"u"){const m=document.createElement("div");m.innerHTML=l.innerHTML;const d=m.textContent||m.innerText||"";o.setAttribute("data-label",d),l.hasAttribute("data-td-class")&&o.setAttribute("class",l.getAttribute("data-td-class")),l.hasAttribute("data-format")&&(o.setAttribute("data-format",l.getAttribute("data-format")),o.innerHTML=h(l.getAttribute("data-format"),o.textContent.trim())),r.includes(o.textContent.trim().toLowerCase())&&o.setAttribute("data-content",o.textContent.trim().toLowerCase())}})})},A=(t,a)=>{if(t.classList.contains("table--fullwidth")&&!t.hasAttribute("data-expandable")||a.querySelectorAll("thead tr th").length<4&&!t.hasAttribute("data-expandable"))return!1;Array.from(a.querySelectorAll("thead tr")).forEach(e=>{a.querySelectorAll("thead tr th.expand-button-heading").length||e.insertAdjacentHTML("afterbegin",`<th class="${t.hasAttribute("data-expandable")?"th--fixed ":""}expand-button-heading"></th>`)}),Array.from(a.querySelectorAll("tbody tr")).forEach((e,i)=>{const n=e.getAttribute("data-view")==="full"?"aria-expanded":"";e.insertAdjacentHTML("afterbegin",`<td class="${t.hasAttribute("data-expandable")?"td--fixed ":""}td--expand"><button class="btn btn-compact btn-secondary btn-sm" data-expand-button ${n} data-index="${i}">Expand</button></td>`)}),a.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){const i=e.target.closest("[data-expand-button]"),n=i.closest("tr");i.toggleAttribute("aria-expanded"),n.getAttribute("data-view")=="full"?n.setAttribute("data-view","default"):n.setAttribute("data-view","full"),i.blur(),t.dispatchEvent(new CustomEvent("row-expanded",{detail:{row:i.getAttribute("data-index")}}))}})},x=(t,a)=>{let e=0;Array.from(a.querySelectorAll("tbody tr")).forEach(i=>{const n=window.getComputedStyle(document.querySelector("html")),r=i.querySelector(":scope > *:last-child > *:first-child");if(r){r.classList.add("text-nowrap");let o=r.offsetWidth/parseFloat(n.fontSize);o+=1.8,e=e>o?e:o}}),t.style.setProperty("--cta-width",`${e}rem`)},k=(t,a)=>{function e(){Array.from(a.querySelectorAll("tr")).forEach(i=>{const n=i.offsetHeight;i.style.setProperty("--row-height",`${n}px`)})}new ResizeObserver(e).observe(a)};class _ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const a=document.createElement("template");a.innerHTML=`
5
+ <style>
6
+ :is(.mh-sm,.mh-md,.mh-lg,.mh-sm-sm,.mh-sm-md,.mh-sm-lg,.mh-md-sm,.mh-md-md,.mh-md-lg,.mh-fluid):not(iam-table):not(.table__wrapper){padding-inline:var(--mh-padding-inline, 0);margin-inline:calc(var(--mh-padding-inline, 0)*-1)}:is(.mh-sm,.mh-md,.mh-lg,.mh-sm-sm,.mh-sm-md,.mh-sm-lg,.mh-md-sm,.mh-md-md,.mh-md-lg,.mh-fluid)::before{top:calc(100% - 1.5rem);bottom:0;left:0;right:0;height:1.5rem;position:sticky;display:block;background:linear-gradient(180deg, transparent 0%, var(--colour-canvas-2) 100%);z-index:2;margin-bottom:-1.5rem}:is(.mh-sm,.mh-md,.mh-lg,.mh-fluid){overflow:auto;overscroll-behavior:contain}:is(.mh-sm,.mh-md,.mh-lg,.mh-fluid)::before{content:""}.mh-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}.mh-fluid{max-height:100%}@media screen and (min-width: 36em){:is(.mh-sm-sm,.mh-sm-md,.mh-sm-lg){overflow:auto;overscroll-behavior:contain}:is(.mh-sm-sm,.mh-sm-md,.mh-sm-lg)::before{content:""}.mh-sm-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-sm-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-sm-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}}@media screen and (min-width: 62em){:is(.mh-md-sm,.mh-md-md,.mh-md-lg){overflow:auto;overscroll-behavior:contain}:is(.mh-md-sm,.mh-md-md,.mh-md-lg)::before{content:""}.mh-md-sm{max-height:calc(12.5rem - var(--mh-modifier, 0rem))}.mh-md-md{max-height:calc(25rem - var(--mh-modifier, 0rem))}.mh-md-lg{max-height:calc(37.5rem - var(--mh-modifier, 0rem))}}:host{container-type:inline-size;display:block}.table__container{--wrapper-padding: 2rem;--bg-colour: #ffffff;display:block;background:#fff;padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.625rem;margin-bottom:2rem;overflow:hidden}.table__container:before{display:none !important}@media screen and (prefers-color-scheme: dark){.table__container{background:var(--colour-canvas-2)}}@media(forced-colors: active){.table__container{--wrapper-padding: 0;background:var(--colour-canvas-2)}}:host-context(.admin-panel) .table__container{display:contents}:host(.mh-sm){max-height:none !important}:host(.mh-md){max-height:none !important}:host(.mh-lg){max-height:none !important}.table__wrapper{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}@container (width < 23.4375em){:host(:not(.table--fullwidth)) .table__container{margin-left:-1.5rem;margin-right:-1.5rem;margin-bottom:0;background:var(--colour-canvas-2);border-radius:0;background:none;padding:0;box-shadow:none;overflow:visible}:host(:not(.table--fullwidth)) .table__container .table__wrapper{overflow:hidden;max-height:none !important}:host(:not(.table--fullwidth)) .table__container ::slotted(table){overflow:visible !important;margin-inline:1.5rem;margin-bottom:1.5rem !important;width:calc(100% - 3rem) !important;display:block}:host(:not(.table--fullwidth)) .table__container .table--cta{border-bottom:0}:host(:not(.table--fullwidth)) .table__container .table--cta:after{content:none;display:none !important}}@container (width > 23.4375em){:host{--cta-width: 8rem}:host(.table--loading){--cta-width: 1.5rem !important}.table--cta{position:relative}.table--cta .table__wrapper{overflow-y:hidden;margin-bottom:0}}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg){position:relative;overflow:auto}.table__wrapper:is(.mh-sm,.mh-md,.mh-lg)::before{top:calc(100% - 1.2rem);bottom:2px;height:1.2rem;border-bottom:2px solid var(--colour-border);margin-bottom:-1.2rem}/*# sourceMappingURL=assets/css/components/table-basic.component.css.map */
7
+
8
+
9
+ ${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
10
+ </style>
11
+ <div class="table__container" part="container">
12
+ <slot name="before"></slot>
13
+ <div class="table--cta">
14
+ <div class="table__wrapper" part="wrapper">
15
+ <slot></slot>
16
+ </div>
17
+ </div>
18
+ <iam-pagination part="pagination" class="pagination--table" ${this.hasAttribute("data-page")?`data-page="${this.getAttribute("data-page")}"`:""} ></iam-pagination>
19
+ </div>
20
+ `,this.shadowRoot.appendChild(a.content.cloneNode(!0)),!document.getElementById("tableBasicExtras")&&!document.getElementById("tableSingleExtras")&&!document.getElementById("tableExtras")&&document.head.insertAdjacentHTML("beforeend",`<style id="tableBasicExtras">:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit){--hover-background: var(--colour-light);--row-bg: var(--colour-canvas-2)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table{margin-bottom:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table thead tr th{position:relative;padding-right:2rem !important;padding-left:0rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) td{background-color:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tr td p{min-width:10rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tbody tr{background:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) tbody tr:is(:hover,:focus-within,.hover){--bg-colour-rgb: 238, 238, 238;--row-bg: var(--hover-background);background:var(--row-bg)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit) table:has(tr.show) tbody tr:not(.show){display:none !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:has([data-expand-button]),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) .expand-button-heading{display:none}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button]){height:0;padding:0;position:relative;display:block !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button])+td{border-top:none !important;padding-top:0 !important;padding-right:3rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) td:has([data-expand-button])+.td--fixed+td{border-top:none !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button]{top:0;right:0;background:rgba(0,0,0,0) !important;border:none;position:absolute;overflow:hidden;--compact-size: 2rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button]:before{font-family:"Font Awesome 6 Pro";content:"\uF055";font-weight:300 !important;font-size:1.75rem;line-height:var(--compact-size) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth):not(.table--fullwidth) [data-expand-button][aria-expanded]:before{content:"\uF056";font-weight:900 !important}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) thead{display:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody{--status-pt: 2.5rem;display:block;overflow:visible}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr td:first-child{padding-top:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr{display:block;position:relative;border:none;background:var(--row-bg);padding:var(--wrapper-padding);box-shadow:0px 6px 12px rgba(0,0,0,.11);border-radius:0.5rem;height:auto}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr+tr{margin-top:2rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr:is(:hover,:focus,.hover){--row-bg: var(--colour-canvas-2)}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:has([data-expand-button]){display:block}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th){display:block;border-color:var(--colour-border);padding-right:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th):nth-child(1){border-top:none}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) :is(td,th)[data-label]:not([data-label=""]):before{content:attr(data-label);color:var(--colour-heading);padding:0 0 0.375rem 0;margin-bottom:0;display:block;font-weight:bold}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td:first-child::after{top:1.75rem !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) td::after{top:2.5rem}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) .td--fixed{padding-right:50%}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr td:not(:first-child){border-top:var(--border-width) solid currentColor;border-color:var(--colour-border) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tr:not([data-view=full]) td p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth) tbody tr:not([data-view=full]) td:not(.td--fixed)+td:not(.td--fixed)+td+td{display:none}}@container (width < 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit):not(.table--fullwidth).table--cta tbody tr td:last-child{display:block !important}}@container (width > 23.4375em){:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta{padding-right:calc(var(--wrapper-padding) + 1.5rem) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>th:nth-last-child(2),:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>td:nth-last-child(2){padding-right:var(--cta-width) !important}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>*:not(:first-child):last-child{position:absolute;left:calc(100% - var(--cta-width));top:auto;background:rgba(0,0,0,0);width:var(--cta-width);min-height:calc(var(--row-height) - 2px);text-align:right;background:linear-gradient(90deg, transparent 0%, var(--row-bg, var(--colour-canvs-2)) 1.25rem);cursor:default;padding-bottom:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tr>*:not(:first-child):last-child a{white-space:nowrap;padding-right:.2rem;padding-bottom:0;margin:0}:is(iam-table,iam-table-basic,iam-table-no-submit,iam-table-submit).table--cta tbody tr:hover>*:not(:first-child):last-child{background:linear-gradient(90deg, transparent 0%, var(--row-bg, var(--colour-canvs-2)) 1.25rem)}}table .hide-status:after{display:none}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)){position:relative;padding-left:1.5rem}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty))::before{margin-left:-1.5rem !important}table :not(.hide-status):is([data-content=low],[data-content=medium],[data-content=high],[data-content=unknown],[data-content=due],[data-content=overdue],[data-content=incomplete],[data-content="requires approval"],[data-content=upcoming],[data-content="approval required"],[data-content=warning],[data-content=verified],[data-content="not started"],[data-content="to do"],[data-content="on track"],[data-content=completed],[data-content=complete],[data-content=successful],[data-content=failed],.alert-status:not([data-content="0"]):not([data-content=""]):not(:empty)):after{font-family:"Font Awesome 6 Pro";position:absolute;top:var(--status-pt, 1rem);left:0;font-size:1rem;line-height:1;height:1rem;width:1rem;display:inline-block}table [data-content=high]:after{content:"\uF325";font-weight:normal;color:var(--colour-danger)}table [data-content=medium]:after{content:"\uF7A4";font-weight:normal;color:var(--colour-warning)}table [data-content=low]:after{content:"\uE404";font-weight:normal;color:var(--colour-complete)}table [data-content=unknown]:after{content:"\uE404";font-weight:normal;color:var(--colour-muted)}table :is([data-content=overdue],[data-content=due],[data-content=incomplete]):after{content:"\uF024";color:var(--colour-danger)}table :is([data-content="not started"],[data-content="to do"],[data-content="on track"]):after{content:"\uF024";color:var(--colour-muted)}table :is([data-content="requires approval"],[data-content="approval required"],[data-content="action required"],[data-content=upcoming]):after{content:"\uF024";color:var(--colour-warning)}table :is([data-content=warning]):after{content:"\uF071";color:var(--colour-warning)}table :is([data-content="manually verified"],[data-content=verified],[data-content=completed],[data-content=complete],[data-content=successful]):after{content:"\uF00C";font-weight:normal;color:var(--colour-complete)}table :is([data-content=failed]):after{content:"\uF00D";font-weight:normal;color:var(--colour-danger)}table .alert-status:not([data-content="0"]):not([data-content=""]):not(:empty):after{content:"\uF0F3";color:var(--colour-primary)}/*# sourceMappingURL=assets/css/components/table-basic.global.css.map */
21
+ </style>`)}connectedCallback(){const a=this.shadowRoot.querySelector("iam-pagination"),e=this.querySelector("table"),i=f(this,e);p(this,e,i,a),g(this,e,i,a,()=>{v(component)})}}export{_ as default};
22
+ //# sourceMappingURL=table-basic.component.min.js.map