@iamproperty/components 7.7.1--beta9 → 7.7.1--beta10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/components/table-basic.global.css +1 -1
- package/assets/css/components/table-basic.global.css.map +1 -1
- package/assets/css/components/table.global.css +1 -1
- package/assets/css/components/table.global.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/advanced-select/advanced-select.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/barchart/barchart.component.min.js +1 -1
- package/assets/js/components/bento-grid/bento-grid.component.min.js +1 -1
- package/assets/js/components/calendar/calendar.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/carousel/carousel.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/config/config.component.min.js +1 -1
- package/assets/js/components/content/content.component.min.js +1 -1
- package/assets/js/components/darkmode/darkmode.component.min.js +1 -1
- package/assets/js/components/doughnutchart/doughnutchart.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/filter-card/filter-card.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/form/form.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
- package/assets/js/components/input/input.component.min.js +1 -1
- package/assets/js/components/input-range/input-range.component.min.js +1 -1
- package/assets/js/components/marketing/marketing.component.min.js +1 -1
- package/assets/js/components/menu/menu.component.min.js +1 -1
- package/assets/js/components/milestone/milestone.component.min.js +1 -1
- package/assets/js/components/milestone-group/milestone-group.component.min.js +1 -1
- package/assets/js/components/modal/modal.component.js +7 -7
- package/assets/js/components/modal/modal.component.min.js +3 -3
- package/assets/js/components/modal/modal.component.min.js.map +1 -1
- package/assets/js/components/multi-step/multi-step.component.min.js +1 -1
- package/assets/js/components/multi-step-modal/multi-step-modal.component.min.js +1 -1
- package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/password/password.component.min.js +1 -1
- package/assets/js/components/popover/popover.component.min.js +1 -1
- package/assets/js/components/rank/rank.component.min.js +1 -1
- package/assets/js/components/rankings/rankings.component.min.js +1 -1
- package/assets/js/components/rating/rating.component.min.js +1 -1
- package/assets/js/components/record-card/record-card.component.min.js +1 -1
- package/assets/js/components/search/search.component.min.js +1 -1
- package/assets/js/components/slider/slider.component.min.js +1 -1
- package/assets/js/components/split-button/split-button.component.min.js +1 -1
- package/assets/js/components/std-address-lookup/std-address-lookup.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +6 -6
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/table-ajax/table-ajax.component.min.js +5 -5
- package/assets/js/components/table-ajax/table-ajax.component.min.js.map +1 -1
- package/assets/js/components/table-basic/table-basic.component.min.js +5 -5
- package/assets/js/components/table-basic/table-basic.component.min.js.map +1 -1
- package/assets/js/components/table-no-submit/table-no-submit.component.min.js +6 -6
- package/assets/js/components/table-no-submit/table-no-submit.component.min.js.map +1 -1
- package/assets/js/components/table-submit/table-submit.component.min.js +6 -6
- package/assets/js/components/table-submit/table-submit.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/components/tag/tag.component.min.js +1 -1
- package/assets/js/components/tooltip/tooltip.component.min.js +1 -1
- package/assets/js/components/video/video.component.min.js +1 -1
- package/assets/js/components/video-card/video-card.component.min.js +1 -1
- package/assets/js/components/video-modal/video-modal.component.min.js +1 -1
- package/assets/js/components/word-count/word-count.component.min.js +1 -1
- package/assets/js/modules/table.js +20 -6
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/sass/components/table-basic.global.scss +1 -1
- package/assets/sass/components/table.global.scss +7 -3
- package/assets/ts/components/modal/modal.component.ts +7 -7
- package/assets/ts/modules/table.ts +29 -9
- package/dist/components.es.js +25 -25
- package/dist/components.umd.js +11 -11
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.7.1--
|
|
2
|
+
* iamKey v7.7.1--beta10
|
|
3
3
|
* Copyright 2022-2026 iamproperty
|
|
4
4
|
*/const o=i=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:i})};o("iam-word-count");class n extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),document.body.hasAttribute("data-assets-location")&&document.body.getAttribute("data-assets-location");const t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -261,21 +261,35 @@ export const createMobileButton = (component, table) => {
|
|
|
261
261
|
}
|
|
262
262
|
});
|
|
263
263
|
Array.from(table.querySelectorAll('tbody tr')).forEach((row, index) => {
|
|
264
|
+
Array.from(row.querySelectorAll('p')).forEach((p, index) => {
|
|
265
|
+
const lineHeight = window.getComputedStyle(p, null).getPropertyValue('line-height');
|
|
266
|
+
console.log(parseInt(lineHeight));
|
|
267
|
+
const lines = Math.ceil(p.offsetHeight / parseInt(lineHeight));
|
|
268
|
+
p.setAttribute('data-lines', lines);
|
|
269
|
+
if (lines >= 3) {
|
|
270
|
+
p.classList.add('three-lines');
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
if (row.querySelector('p')) {
|
|
274
|
+
row.setAttribute('data-view', 'default');
|
|
275
|
+
}
|
|
264
276
|
const preExpanded = row.getAttribute('data-view') === 'full' ? 'aria-expanded' : '';
|
|
265
|
-
row.
|
|
277
|
+
if (!row.querySelectorAll('td.td--expand').length) {
|
|
278
|
+
row.insertAdjacentHTML('afterbegin', `<td class="${component.hasAttribute('data-expandable') ? 'td--fixed ' : ''}td--expand"><button class="btn btn-compact btn-secondary btn-sm fa-chevron-down" data-expand-button ${preExpanded} data-index="${index}">Expand</button></td>`);
|
|
279
|
+
}
|
|
266
280
|
});
|
|
267
281
|
table.addEventListener('click', (event) => {
|
|
268
282
|
if (event && event.target instanceof HTMLElement && event.target.closest('[data-expand-button]')) {
|
|
269
283
|
const button = event.target.closest('[data-expand-button]');
|
|
270
284
|
const tableRow = button.closest('tr');
|
|
271
285
|
button.toggleAttribute('aria-expanded');
|
|
272
|
-
if (button.classList.contains('fa-
|
|
273
|
-
button.classList.remove('fa-
|
|
274
|
-
button.classList.add('fa-
|
|
286
|
+
if (button.classList.contains('fa-chevron-down')) {
|
|
287
|
+
button.classList.remove('fa-chevron-down');
|
|
288
|
+
button.classList.add('fa-chevron-up');
|
|
275
289
|
}
|
|
276
290
|
else {
|
|
277
|
-
button.classList.remove('fa-
|
|
278
|
-
button.classList.add('fa-
|
|
291
|
+
button.classList.remove('fa-chevron-up');
|
|
292
|
+
button.classList.add('fa-chevron-down');
|
|
279
293
|
}
|
|
280
294
|
if (tableRow.getAttribute('data-view') == 'full')
|
|
281
295
|
tableRow.setAttribute('data-view', 'default');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.7.1--
|
|
2
|
+
* iamKey v7.7.1--beta10
|
|
3
3
|
* Copyright 2022-2026 iamproperty
|
|
4
4
|
*/(function(w){typeof define=="function"&&define.amd?define(w):w()})((function(){"use strict";var w=a=>{a.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&a.classList.add("ie")},H=a=>{var e=function(n){var r=document.querySelector('label[for="'.concat(n.replace("#",""),'"]')),s=document.querySelector(n+" summary"),u=document.querySelector("dialog".concat(n)),i=document.querySelector("detail".concat(n));r instanceof HTMLElement?r.click():s instanceof HTMLElement?s.click():u instanceof HTMLElement?u.showModal():i instanceof HTMLElement&&i.addAttribute("open")};location.hash&&e(location.hash),window.addEventListener("hashchange",function(){e(location.hash)},!1),addEventListener("popstate",o=>{if(o&&o.state&&o.state.type&&o.state.type=="pagination"){var n=document.querySelector("#".concat(o.state.form)),r=document.querySelector("#".concat(o.state.form," [data-pagination]"));r?r.value=o.state.page:n.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(o.state.page,'" />'),n.dispatchEvent(new Event("submit"))}}),Array.from(document.querySelectorAll("form")).forEach(o=>{o?.closest("iam-form")||o.addEventListener("submit",n=>{var r;o.querySelector(":invalid")&&(o.classList.add("was-validated"),(r=o?.querySelector("input:invalid"))===null||r===void 0||r.scrollIntoView(),n.preventDefault())})}),document.addEventListener("click",o=>{var n;if(o&&o.target instanceof HTMLElement&&o.target.matches("form button:not([type=button])")){var r=o.target.closest("form");r?.closest("iam-form")||(Array.from(r.querySelectorAll("[data-password-type]")).forEach(s=>{s.setAttribute("type","password")}),(r.querySelector(":invalid")||r.querySelector('.pwd-checker[data-strength="1"]')||r.querySelector('.pwd-checker[data-strength="2"]'))&&(r.classList.add("was-validated"),(n=r?.querySelector("input:invalid"))===null||n===void 0||n.scrollIntoView(),o.preventDefault()),r.querySelector("iam-multiselect[data-is-required][data-error]")&&(r.classList.add("was-validated"),o.preventDefault()))}}),document.addEventListener("keydown",o=>{o.key==="Escape"&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(o.preventDefault(),o.stopPropagation())}),Array.from(document.querySelectorAll("label progress")).forEach(o=>{var n=o.closest("label");n.setAttribute("data-percent",o.getAttribute("value"))})};function N(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",a=>{var e=a.target.closest("[open] summary");if(e)window.dataLayer.push({event:"closeDetails",detailsTitle:e.textContent||""});else{var o=a.target.closest("summary"),n=a.target.closest("a"),r=a.target.closest("button");o&&window.dataLayer.push({event:"openDetails",detailsTitle:o.textContent||""}),n&&window.dataLayer.push({event:"linkClicked",linkText:n.hasAttribute("title")?n.getAttribute("title")||"":n.textContent||"",class:n.hasAttribute("class")&&n.getAttribute("class")||"",href:n.getAttribute("href")||""}),r&&window.dataLayer.push({event:"buttonClicked",buttonText:r.textContent||"",class:r.hasAttribute("class")&&r.getAttribute("class")||""})}})}window.triggerDynamicEvent=function(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"change";console.log("event"),a.hasAttribute("data-change-events")&&e=="change"&&v(a,a.getAttribute("data-change-events")),a.hasAttribute("data-click-events")&&e=="click"&&v(a,a.getAttribute("data-click-events"))};var M=()=>{document.addEventListener("change",a=>{a&&a.target instanceof HTMLElement&&a.target.closest("[data-change-events]")&&v(a.target,a.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("keyup",a=>{a&&a.target instanceof HTMLElement&&a.target.closest("[data-change-events]")&&v(a.target,a.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("click",a=>{a&&a.target instanceof HTMLElement&&a.target.closest("[data-click-events]")&&v(a.target,a.target.closest("[data-click-events]").getAttribute("data-click-events"))})},v=(a,e)=>{if(e||(e=a.parentNode.getAttribute("data-change-events")),!e)return!1;Array.from(JSON.parse(e)).forEach(o=>{C(a,o)})},C=(a,e)=>{if("matches"in e)return e.matches=="any"||a.value==e.matches?f(a,e,"if"):f(a,e,"else"),!1;if("in-list"in e){var o=document.querySelector("".concat(e["in-list"],' option[value="').concat(a.value,'"]'));return document.querySelector("".concat(e["in-list"],' option[value="').concat(a.value,'"]'))?f(o,e,"if"):f(o,e,"else"),!1}else"event"in e&&f(a,e,"event")},f=(a,e,o)=>{if(!(o in e))return!1;switch(e[o]){case"hide":if(document.querySelector(e.target)){var n=document.querySelector(e.target);n.classList.add("js-hide"),Array.from(n.querySelectorAll("[data-required]")).forEach(i=>{i.removeAttribute("required")})}break;case"show":if(document.querySelector(e.target)){var r=document.querySelector(e.target);r.classList.remove("js-hide"),Array.from(r.querySelectorAll("[data-required]")).forEach(i=>{i.closest(".js-hide")||i.setAttribute("required","true")})}break;case"populate-form":D(a,e);break;case"dispatchEvent":var s=new Event(e.value);document.querySelector("".concat(e.target)).dispatchEvent(s);break;case"setAttribute":Array.from(document.querySelectorAll("".concat(e.target))).forEach(function(i){i.setAttribute(e.attribute,e.value)});break;case"focus":document.querySelector("".concat(e.target)).focus();break;case"removeAttribute":Array.from(document.querySelectorAll("".concat(e.target))).forEach(function(i){i.removeAttribute(e.attribute)});break;case"updateValue":document.querySelector("".concat(e.target)).value=e.value?e.value:"";var u=new Event("change");document.querySelector("".concat(e.target)).dispatchEvent(u);break;case"submitForm":document.querySelector("".concat(e.target)).submit();break;case"openLink":document.querySelector("".concat(e.target)).value&&(window.location.href=document.querySelector("".concat(e.target)).value);break}},D=function(e,o){var n=JSON.parse(e.getAttribute("data-values")),r=document.querySelector(o.target);if(!n)return!1;Object.keys(n).forEach(s=>{document.getElementById(s)&&document.getElementById(s).tagName=="SPAN"&&(document.getElementById(s).innerHTML=n[s]),r.querySelector('select[name="'.concat(s,'"] [value="').concat(n[s],'"]'))?(r.querySelector('select[name="'.concat(s,'"]')).value=n[s],e.hasAttribute("data-lock-fields")&&(r.querySelector('select[name="'.concat(s,'"]')).disabled=!0)):r.querySelector('input[name="'.concat(s,'"][type="radio"][value="').concat(n[s],'"]'))?(Array.from(r.querySelectorAll('input[name="'.concat(s,'"][type="radio"]'))).forEach(function(u){u.disabled=!0}),r.querySelector('input[name="'.concat(s,'"][type="radio"][value="').concat(n[s],'"]')).checked=!0,r.querySelector('input[name="'.concat(s,'"][type="radio"][value="').concat(n[s],'"]')).disabled=!1):r.querySelector('input[name="'.concat(s,'"]'))&&(r.querySelector('input[name="'.concat(s,'"]')).value=n[s],e.hasAttribute("data-lock-fields")&&r.querySelector('input[name="'.concat(s,'"]')).setAttribute("readonly","true"))})},F=()=>{var a=[],e={},o="These tests run against mark-up and content meant to test how a component or element has been integrated. Making sure that guidance setout in the design system is being followed.";window.integrationTestsIntro=o,console.log("%cVirgin Money Framework Tests","color: #E10A0A; font-size: 24px; font-weight: bold; margin-top: 20px; margin-bottom: 10px;"),console.log("%c"+o,"font-size: 14px; margin-bottom: 20px;"),console.log("%cKey","font-size: 16px;font-weight:bold;"),console.log("%c %cSuccessfully implemented","background-color: green; margin-right: 10px","background-color: transparent"),console.log("%c %cNOT implemented correctly","background-color: red; margin-right: 10px","background-color: transparent"),console.log("%c %cN/A","background-color: grey; margin-right: 10px","background-color: transparent"),console.log("%c %cWarning - No action needed","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("%c ? %cWarning - Action needed","background-color: orange; margin-right: 10px","background-color: transparent"),e={Test:"Each card with in a card deck has a footer with some CTA text via a button link",Total:0,Passes:0,Fails:0},Array.from(document.querySelectorAll(".card-deck .card")).forEach((t,c)=>{if(t.closest(".navbar")==null){var l=t.querySelector(".btn-link");l!=null&&l.textContent.length?e.Passes++:e.Fails++}}),e.Total=e.Passes+e.Fails,a.push(e),e={Test:"Article Decks need to have a background colour applied",Total:0,Passes:0,Fails:0},Array.from(document.querySelectorAll(".article-deck")).forEach((t,c)=>{var l=t.closest(".container");l!=null&&l.matches('[class*="bg-"]')?e.Passes++:e.Fails++}),e.Total=e.Passes+e.Fails,a.push(e),e={Test:"Tabs Carousel has a h2 title with a display-4 class. It should always have a strapline next to it also.",Total:0,Passes:0,Fails:0,Notes:"The site nav contains cards without a footer by design."},Array.from(document.querySelectorAll(".tabs__container--carousel")).forEach((t,c)=>{var l=t.querySelector("h2.display-4:first-child"),d=t.querySelector("h2.display-4:first-child + .strapline");l!=null&&d!=null?e.Passes++:e.Fails++}),e.Total=e.Passes+e.Fails,a.push(e),e={Test:"Split Containers can only have multiple of two columns. So either 2, 4, 6 and so on.",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--split")).forEach((t,c)=>{t.querySelectorAll(':scope > .row > [class*="col"]').length%2===0?e.Passes++:e.Fails++}),e.Total=e.Passes+e.Fails,a.push(e),e={Test:"Statement Containers with only one paragraph or text element should have the class of .h6",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--statement")).forEach((t,c)=>{t.querySelectorAll(":scope > *").length==1&&t.querySelectorAll(":scope > .h6:first-child").length==1?e.Passes++:t.querySelectorAll(":scope > *").length==1&&e.Fails++}),e.Total=e.Passes+e.Fails,a.push(e),e={Test:"CTA Containers title should always have the class of .h1",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--cta")).forEach((t,c)=>{t.querySelectorAll("h2.h1:first-child").length==1?e.Passes++:e.Fails++}),e.Total=e.Passes+e.Fails,a.push(e),console.log("%cImplementation Tests","font-size: 16px;font-weight:bold; margin-top: 20px;"),a.forEach(function(t){var c="green";t.Total===0?c="grey":t.Fails!=0&&(c="red"),t.Type=="warning"&&(c="orange"),console.groupCollapsed("%c %c"+t.Test,"background-color: "+c+"; margin-right: 10px","background-color: transparent"),console.table({Passed:{value:t.Passes},Failed:{value:t.Fails},Total:{value:t.Total}}),t.Notes!=""&&console.log(t.Notes),console.groupEnd()}),window.integrationTests=a;var n=[];e={Test:"There are XX padding classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="p-"],[class*="pt-"],[class*="pb-"],[class*="pl-"],[class*="pr-"],[class*="px-"],[class*="py-"]')).forEach((t,c)=>{e.Total++}),e.Test=e.Test.replace("XX",e.Total),n.push(e),e={Test:"There are XX margin classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="m-"],[class*="mt-"],[class*="mb-"],[class*="ml-"],[class*="mr-"],[class*="mx-"],[class*="my-"]')).forEach((t,c)=>{e.Total++}),e.Test=e.Test.replace("XX",e.Total),n.push(e),e={Test:"There are XX text modifier classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="text-"]')).forEach((t,c)=>{e.Total++}),e.Test=e.Test.replace("XX",e.Total),n.push(e),console.log("%cUtility classes","font-size: 16px;font-weight:bold;"),console.log("The use of certain utility classes is necessary at times but the over use of these classes will lead to design/layout inconsistencies."),n.forEach(function(t){var c="green";t.Total===0?c="grey":t.Fails!=0&&(c="red"),t.Type=="warning"&&(c="orange"),console.groupCollapsed("%c %c"+t.Test,"background-color: "+c+"; margin-right: 10px","background-color: transparent"),console.table({Total:{value:t.Total}}),t.Notes!=""&&console.log(t.Notes),console.groupEnd()}),console.log("%cAccessibility and Best practice Tests","font-size: 16px;font-weight:bold;");var r="green",s=1,u={};Array.from(document.querySelectorAll("h1,h2,h3,h4,h5,h6")).forEach((t,c)=>{var l=1,d=t.textContent;t.matches("h2")?l=2:t.matches("h3")?l=3:t.matches("h4")?l=4:t.matches("h5")?l=5:t.matches("h6")&&(l=6);var h=l-s<=1;c==0&&l!=1&&(h=!1);var p={"Heading Level":l,"In order":h};h?s=l:r="red",u[d]=p}),console.groupCollapsed("%c %cHeadings are in the correct order","background-color: "+r+"; margin-right: 10px","background-color: transparent"),console.table(u),console.groupEnd(),console.groupCollapsed("%c ? %cDo all of the headings make sense out of context and do they introduce the content that follows?","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("You should be able to read the below table and get an understanding of what the page content consists of. The titles should make sense when read in order and child titles should be relevant to the parent title."),console.table(u),console.groupEnd();var i={};Array.from(document.querySelectorAll("a")).forEach((t,c)=>{var l=t.getAttribute("href"),d=t.textContent,h=t.getAttribute("title"),p={Text:d,Title:h};i[l]=p}),console.groupCollapsed("%c ? %cDo all of the links make sense out of context and do they describe the page/section that it links to?","background-color: orange; margin-right: 10px","background-color: transparent"),console.table(i),console.groupEnd();var A={},m={};Array.from(document.querySelectorAll("img[alt]")).forEach((t,c)=>{var l=t.getAttribute("src"),d=t.getAttribute("alt");if(d!=""){var h={Alt:d};A[l]=h}else{var l=t.getAttribute("src"),p={};m[l]=p}}),console.groupCollapsed("%c ? %cDo all of the images with an alt tag make sense out of context and describes the image appropriately?","background-color: orange; margin-right: 10px","background-color: transparent"),console.table(A),console.log("%cImages with an empty alt tag:","font-weight: bold;"),console.table(m),console.groupEnd(),console.groupCollapsed("%c ? %cCan you navigation the page links by tabbing through the page?","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("Are all of the links, input fields and buttons accessible through using the keyboard only?"),console.groupEnd(),console.log("%cLighthouse","font-size: 16px;font-weight:bold;"),console.groupCollapsed("%c ? %cHave you ran a lighthouse report on this page","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("If you are in a modern version of chrome you can a lighthouse report by opening the lighthouse window within the devtools. This should appear as a tab link above."),console.log("This report will give you more detail about the above the tests aswell as extra tests. "),console.groupEnd(),console.log("%cImage sizes","font-size: 16px;font-weight:bold;"),console.log("The below tests work from the current screen size, so if you have your screen at a mobile viewport the scaling and sizes of images will reflect that. It is worth running the image tests in both mobile and desktop views. Simply change the screen size and refresh the page."),Array.from(document.querySelectorAll("img")).forEach((t,c)=>{if(!t.matches("[src*='http']")&&!t.matches("[src$='.svg']")){var l=t.getAttribute("src"),d=new XMLHttpRequest;d.open("HEAD",l,!0),d.onreadystatechange=function(){if(d.readyState==4)if(d.status==200){var h=d.getResponseHeader("Content-Length");if(h>1024){var p=t.naturalWidth,P=t.naturalHeight,S=t.clientWidth,O=t.clientHeight,k=(S/p).toFixed(2)=="0.00"?"Hidden":(S/p).toFixed(2),B=Math.floor(h/1024),E=(h/(p*P)).toFixed(2),b="green",L="green",q="green",x="",T="";E>.5?(b="red",L="red",x="The image has a VERY large 'Bytes per pixel' score, trying optimising the image using https://tinypng.com/."):E>.2&&(b="orange",L="orange",x="The image has a large 'Bytes per pixel' score, trying optimising the image using https://tinypng.com/."),k>1.2?(b="red",q="red",T="The image size is smaller than the size shown on screen this may cause the image to appear blurry and low quality."):k<.5?(b="red",q="red",T="The image size is VERY large compared to the size shown on screen, this means unnecessary kb's are being downloaded. Try resizing the image in photoshop or other image editing software."):k<.8&&(b="orange",q="orange",T="The image size is large compared to the size shown on screen, this means unnecessary kb's are being downloaded. Try resizing the image in photoshop or other image editing software."),console.log("%c %c "+t.src,"background: url("+t.src+"); border: 3px solid "+b+"; line-height: 30px; width: 30px; background-size: cover;","background-color: transparent"),x!=""&&console.log("%c %c"+x,"background-color: "+L+"; margin-right: 10px","background-color: transparent"),T!=""&&console.log("%c %c"+T,"background-color: "+q+"; margin-right: 10px","background-color: transparent"),console.table({Image:{Dimensions:p+"x"+P,"Scaled to":S+"x"+O,Scale:k,Filesize:B+"Kb","Bytes per pixel":E}}),console.groupEnd()}}else console.log("%c %c"+t.src+" not loaded","background-color: red; margin-right: 10px","background-color: transparent")},d.send(null)}});var g=[];if(typeof window.integrationTests<"u"&&window.integrationTests.forEach(function(t){t.Total!=0&&t.Type!="warning"&&g.push(t.Test)}),g.length!=0){var y=document.querySelector("#vmtests-display");if(y!=null){y.innerHTML=`<div class="container">
|
|
5
5
|
<h2>Integration notes</h2>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v7.7.1--
|
|
2
|
+
* iamKey v7.7.1--beta10
|
|
3
3
|
* Copyright 2022-2026 iamproperty
|
|
4
4
|
*/
|
|
5
5
|
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";window.triggerDynamicEvent=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"change";console.log("event"),t.hasAttribute("data-change-events")&&"change"==a&&e(t,t.getAttribute("data-change-events")),t.hasAttribute("data-click-events")&&"click"==a&&e(t,t.getAttribute("data-click-events"))};var e=(e,a)=>{if(a||(a=e.parentNode.getAttribute("data-change-events")),!a)return!1;Array.from(JSON.parse(a)).forEach(a=>{t(e,a)})},t=(e,t)=>{if("matches"in t)return"any"==t.matches||e.value==t.matches?a(e,t,"if"):a(e,t,"else"),!1;if("in-list"in t){var o=document.querySelector("".concat(t["in-list"],' option[value="').concat(e.value,'"]'));return document.querySelector("".concat(t["in-list"],' option[value="').concat(e.value,'"]'))?a(o,t,"if"):a(o,t,"else"),!1}"event"in t&&a(e,t,"event")},a=(e,t,a)=>{if(!(a in t))return!1;switch(t[a]){case"hide":if(document.querySelector(t.target)){var n=document.querySelector(t.target);n.classList.add("js-hide"),Array.from(n.querySelectorAll("[data-required]")).forEach(e=>{e.removeAttribute("required")})}break;case"show":if(document.querySelector(t.target)){var r=document.querySelector(t.target);r.classList.remove("js-hide"),Array.from(r.querySelectorAll("[data-required]")).forEach(e=>{e.closest(".js-hide")||e.setAttribute("required","true")})}break;case"populate-form":o(e,t);break;case"dispatchEvent":var s=new Event(t.value);document.querySelector("".concat(t.target)).dispatchEvent(s);break;case"setAttribute":Array.from(document.querySelectorAll("".concat(t.target))).forEach(function(e){e.setAttribute(t.attribute,t.value)});break;case"focus":document.querySelector("".concat(t.target)).focus();break;case"removeAttribute":Array.from(document.querySelectorAll("".concat(t.target))).forEach(function(e){e.removeAttribute(t.attribute)});break;case"updateValue":document.querySelector("".concat(t.target)).value=t.value?t.value:"";var l=new Event("change");document.querySelector("".concat(t.target)).dispatchEvent(l);break;case"submitForm":document.querySelector("".concat(t.target)).submit();break;case"openLink":document.querySelector("".concat(t.target)).value&&(window.location.href=document.querySelector("".concat(t.target)).value)}},o=function(e,t){var a=JSON.parse(e.getAttribute("data-values")),o=document.querySelector(t.target);if(!a)return!1;Object.keys(a).forEach(t=>{document.getElementById(t)&&"SPAN"==document.getElementById(t).tagName&&(document.getElementById(t).innerHTML=a[t]),o.querySelector('select[name="'.concat(t,'"] [value="').concat(a[t],'"]'))?(o.querySelector('select[name="'.concat(t,'"]')).value=a[t],e.hasAttribute("data-lock-fields")&&(o.querySelector('select[name="'.concat(t,'"]')).disabled=!0)):o.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]'))?(Array.from(o.querySelectorAll('input[name="'.concat(t,'"][type="radio"]'))).forEach(function(e){e.disabled=!0}),o.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]')).checked=!0,o.querySelector('input[name="'.concat(t,'"][type="radio"][value="').concat(a[t],'"]')).disabled=!1):o.querySelector('input[name="'.concat(t,'"]'))&&(o.querySelector('input[name="'.concat(t,'"]')).value=a[t],e.hasAttribute("data-lock-fields")&&o.querySelector('input[name="'.concat(t,'"]')).setAttribute("readonly","true"))})},n=()=>{var e=[],t={},a="These tests run against mark-up and content meant to test how a component or element has been integrated. Making sure that guidance setout in the design system is being followed.";window.integrationTestsIntro=a,console.log("%cVirgin Money Framework Tests","color: #E10A0A; font-size: 24px; font-weight: bold; margin-top: 20px; margin-bottom: 10px;"),console.log("%c"+a,"font-size: 14px; margin-bottom: 20px;"),console.log("%cKey","font-size: 16px;font-weight:bold;"),console.log("%c %cSuccessfully implemented","background-color: green; margin-right: 10px","background-color: transparent"),console.log("%c %cNOT implemented correctly","background-color: red; margin-right: 10px","background-color: transparent"),console.log("%c %cN/A","background-color: grey; margin-right: 10px","background-color: transparent"),console.log("%c %cWarning - No action needed","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("%c ? %cWarning - Action needed","background-color: orange; margin-right: 10px","background-color: transparent"),t={Test:"Each card with in a card deck has a footer with some CTA text via a button link",Total:0,Passes:0,Fails:0},Array.from(document.querySelectorAll(".card-deck .card")).forEach((e,a)=>{if(null==e.closest(".navbar")){var o=e.querySelector(".btn-link");null!=o&&o.textContent.length?t.Passes++:t.Fails++}}),t.Total=t.Passes+t.Fails,e.push(t),t={Test:"Article Decks need to have a background colour applied",Total:0,Passes:0,Fails:0},Array.from(document.querySelectorAll(".article-deck")).forEach((e,a)=>{var o=e.closest(".container");null!=o&&o.matches('[class*="bg-"]')?t.Passes++:t.Fails++}),t.Total=t.Passes+t.Fails,e.push(t),t={Test:"Tabs Carousel has a h2 title with a display-4 class. It should always have a strapline next to it also.",Total:0,Passes:0,Fails:0,Notes:"The site nav contains cards without a footer by design."},Array.from(document.querySelectorAll(".tabs__container--carousel")).forEach((e,a)=>{var o=e.querySelector("h2.display-4:first-child"),n=e.querySelector("h2.display-4:first-child + .strapline");null!=o&&null!=n?t.Passes++:t.Fails++}),t.Total=t.Passes+t.Fails,e.push(t),t={Test:"Split Containers can only have multiple of two columns. So either 2, 4, 6 and so on.",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--split")).forEach((e,a)=>{e.querySelectorAll(':scope > .row > [class*="col"]').length%2==0?t.Passes++:t.Fails++}),t.Total=t.Passes+t.Fails,e.push(t),t={Test:"Statement Containers with only one paragraph or text element should have the class of .h6",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--statement")).forEach((e,a)=>{1==e.querySelectorAll(":scope > *").length&&1==e.querySelectorAll(":scope > .h6:first-child").length?t.Passes++:1==e.querySelectorAll(":scope > *").length&&t.Fails++}),t.Total=t.Passes+t.Fails,e.push(t),t={Test:"CTA Containers title should always have the class of .h1",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll(".container.container--cta")).forEach((e,a)=>{1==e.querySelectorAll("h2.h1:first-child").length?t.Passes++:t.Fails++}),t.Total=t.Passes+t.Fails,e.push(t),console.log("%cImplementation Tests","font-size: 16px;font-weight:bold; margin-top: 20px;"),e.forEach(function(e){var t="green";0===e.Total?t="grey":0!=e.Fails&&(t="red"),"warning"==e.Type&&(t="orange"),console.groupCollapsed("%c %c"+e.Test,"background-color: "+t+"; margin-right: 10px","background-color: transparent"),console.table({Passed:{value:e.Passes},Failed:{value:e.Fails},Total:{value:e.Total}}),""!=e.Notes&&console.log(e.Notes),console.groupEnd()}),window.integrationTests=e;var o=[];t={Test:"There are XX padding classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="p-"],[class*="pt-"],[class*="pb-"],[class*="pl-"],[class*="pr-"],[class*="px-"],[class*="py-"]')).forEach((e,a)=>{t.Total++}),t.Test=t.Test.replace("XX",t.Total),o.push(t),t={Test:"There are XX margin classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="m-"],[class*="mt-"],[class*="mb-"],[class*="ml-"],[class*="mr-"],[class*="mx-"],[class*="my-"]')).forEach((e,a)=>{t.Total++}),t.Test=t.Test.replace("XX",t.Total),o.push(t),t={Test:"There are XX text modifier classes being used on this page",Type:"warning",Total:0,Passes:0,Fails:0,Notes:""},Array.from(document.querySelectorAll('[class*="text-"]')).forEach((e,a)=>{t.Total++}),t.Test=t.Test.replace("XX",t.Total),o.push(t),console.log("%cUtility classes","font-size: 16px;font-weight:bold;"),console.log("The use of certain utility classes is necessary at times but the over use of these classes will lead to design/layout inconsistencies."),o.forEach(function(e){var t="green";0===e.Total?t="grey":0!=e.Fails&&(t="red"),"warning"==e.Type&&(t="orange"),console.groupCollapsed("%c %c"+e.Test,"background-color: "+t+"; margin-right: 10px","background-color: transparent"),console.table({Total:{value:e.Total}}),""!=e.Notes&&console.log(e.Notes),console.groupEnd()}),console.log("%cAccessibility and Best practice Tests","font-size: 16px;font-weight:bold;");var n="green",r=1,s={};Array.from(document.querySelectorAll("h1,h2,h3,h4,h5,h6")).forEach((e,t)=>{var a=1,o=e.textContent;e.matches("h2")?a=2:e.matches("h3")?a=3:e.matches("h4")?a=4:e.matches("h5")?a=5:e.matches("h6")&&(a=6);var l=a-r<=1;0==t&&1!=a&&(l=!1);var c={"Heading Level":a,"In order":l};l?r=a:n="red",s[o]=c}),console.groupCollapsed("%c %cHeadings are in the correct order","background-color: "+n+"; margin-right: 10px","background-color: transparent"),console.table(s),console.groupEnd(),console.groupCollapsed("%c ? %cDo all of the headings make sense out of context and do they introduce the content that follows?","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("You should be able to read the below table and get an understanding of what the page content consists of. The titles should make sense when read in order and child titles should be relevant to the parent title."),console.table(s),console.groupEnd();var l={};Array.from(document.querySelectorAll("a")).forEach((e,t)=>{var a=e.getAttribute("href"),o={Text:e.textContent,Title:e.getAttribute("title")};l[a]=o}),console.groupCollapsed("%c ? %cDo all of the links make sense out of context and do they describe the page/section that it links to?","background-color: orange; margin-right: 10px","background-color: transparent"),console.table(l),console.groupEnd();var c={},i={};Array.from(document.querySelectorAll("img[alt]")).forEach((e,t)=>{var a=e.getAttribute("src"),o=e.getAttribute("alt");if(""!=o){var n={Alt:o};c[a]=n}else a=e.getAttribute("src"),i[a]={}}),console.groupCollapsed("%c ? %cDo all of the images with an alt tag make sense out of context and describes the image appropriately?","background-color: orange; margin-right: 10px","background-color: transparent"),console.table(c),console.log("%cImages with an empty alt tag:","font-weight: bold;"),console.table(i),console.groupEnd(),console.groupCollapsed("%c ? %cCan you navigation the page links by tabbing through the page?","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("Are all of the links, input fields and buttons accessible through using the keyboard only?"),console.groupEnd(),console.log("%cLighthouse","font-size: 16px;font-weight:bold;"),console.groupCollapsed("%c ? %cHave you ran a lighthouse report on this page","background-color: orange; margin-right: 10px","background-color: transparent"),console.log("If you are in a modern version of chrome you can a lighthouse report by opening the lighthouse window within the devtools. This should appear as a tab link above."),console.log("This report will give you more detail about the above the tests aswell as extra tests. "),console.groupEnd(),console.log("%cImage sizes","font-size: 16px;font-weight:bold;"),console.log("The below tests work from the current screen size, so if you have your screen at a mobile viewport the scaling and sizes of images will reflect that. It is worth running the image tests in both mobile and desktop views. Simply change the screen size and refresh the page."),Array.from(document.querySelectorAll("img")).forEach((e,t)=>{if(!e.matches("[src*='http']")&&!e.matches("[src$='.svg']")){var a=e.getAttribute("src"),o=new XMLHttpRequest;o.open("HEAD",a,!0),o.onreadystatechange=function(){if(4==o.readyState)if(200==o.status){var t=o.getResponseHeader("Content-Length");if(t>1024){var a=e.naturalWidth,n=e.naturalHeight,r=e.clientWidth,s=e.clientHeight,l="0.00"==(r/a).toFixed(2)?"Hidden":(r/a).toFixed(2),c=Math.floor(t/1024),i=(t/(a*n)).toFixed(2),u="green",d="green",g="green",h="",p="";i>.5?(u="red",d="red",h="The image has a VERY large 'Bytes per pixel' score, trying optimising the image using https://tinypng.com/."):i>.2&&(u="orange",d="orange",h="The image has a large 'Bytes per pixel' score, trying optimising the image using https://tinypng.com/."),l>1.2?(u="red",g="red",p="The image size is smaller than the size shown on screen this may cause the image to appear blurry and low quality."):l<.5?(u="red",g="red",p="The image size is VERY large compared to the size shown on screen, this means unnecessary kb's are being downloaded. Try resizing the image in photoshop or other image editing software."):l<.8&&(u="orange",g="orange",p="The image size is large compared to the size shown on screen, this means unnecessary kb's are being downloaded. Try resizing the image in photoshop or other image editing software."),console.log("%c %c "+e.src,"background: url("+e.src+"); border: 3px solid "+u+"; line-height: 30px; width: 30px; background-size: cover;","background-color: transparent"),""!=h&&console.log("%c %c"+h,"background-color: "+d+"; margin-right: 10px","background-color: transparent"),""!=p&&console.log("%c %c"+p,"background-color: "+g+"; margin-right: 10px","background-color: transparent"),console.table({Image:{Dimensions:a+"x"+n,"Scaled to":r+"x"+s,Scale:l,Filesize:c+"Kb","Bytes per pixel":i}}),console.groupEnd()}}else console.log("%c %c"+e.src+" not loaded","background-color: red; margin-right: 10px","background-color: transparent")},o.send(null)}});var u=[];if(typeof window.integrationTests<"u"&&window.integrationTests.forEach(function(e){0!=e.Total&&"warning"!=e.Type&&u.push(e.Test)}),0!=u.length){var d=document.querySelector("#vmtests-display");if(null!=d){d.innerHTML='<div class="container">\n <h2>Integration notes</h2>\n <ul id="integrationTests"></ul>\n </div>';var g=document.getElementById("integrationTests");null!=g&&u.forEach(function(e){g.innerHTML+="<li>"+e+"</li>"})}}return null},r=Object.freeze({__proto__:null,default:n});["localhost"].includes(window.location.hostname)&&Promise.resolve().then(function(){return r}).then(e=>{window.iamTest=()=>{n()}}).catch(e=>{console.log(e.message)}),document.addEventListener("DOMContentLoaded",()=>{return t=void 0,a=void 0,n=function*(){var t,a;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",e=>{var t=e.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var a=e.target.closest("summary"),o=e.target.closest("a"),n=e.target.closest("button");a&&window.dataLayer.push({event:"openDetails",detailsTitle:a.textContent||""}),o&&window.dataLayer.push({event:"linkClicked",linkText:o.hasAttribute("title")?o.getAttribute("title")||"":o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||"",href:o.getAttribute("href")||""}),n&&window.dataLayer.push({event:"buttonClicked",buttonText:n.textContent||"",class:n.hasAttribute("class")&&n.getAttribute("class")||""})}}),document.addEventListener("change",t=>{t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-events]")&&e(t.target,t.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("keyup",t=>{t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-events]")&&e(t.target,t.target.closest("[data-change-events]").getAttribute("data-change-events"))}),document.addEventListener("click",t=>{t&&t.target instanceof HTMLElement&&t.target.closest("[data-click-events]")&&e(t.target,t.target.closest("[data-click-events]").getAttribute("data-click-events"))}),(a=document.body).classList.add("js-enabled"),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&a.classList.add("ie"),t=function(e){var t=document.querySelector('label[for="'.concat(e.replace("#",""),'"]')),a=document.querySelector(e+" summary"),o=document.querySelector("dialog".concat(e)),n=document.querySelector("detail".concat(e));t instanceof HTMLElement?t.click():a instanceof HTMLElement?a.click():o instanceof HTMLElement?o.showModal():n instanceof HTMLElement&&n.addAttribute("open")},location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state&&e.state.type&&"pagination"==e.state.type){var t=document.querySelector("#".concat(e.state.form)),a=document.querySelector("#".concat(e.state.form," [data-pagination]"));a?a.value=e.state.page:t.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),t.dispatchEvent(new Event("submit"))}}),Array.from(document.querySelectorAll("form")).forEach(e=>{e?.closest("iam-form")||e.addEventListener("submit",t=>{var a;e.querySelector(":invalid")&&(e.classList.add("was-validated"),null===(a=e?.querySelector("input:invalid"))||void 0===a||a.scrollIntoView(),t.preventDefault())})}),document.addEventListener("click",e=>{var t;if(e&&e.target instanceof HTMLElement&&e.target.matches("form button:not([type=button])")){var a=e.target.closest("form");a?.closest("iam-form")||(Array.from(a.querySelectorAll("[data-password-type]")).forEach(e=>{e.setAttribute("type","password")}),(a.querySelector(":invalid")||a.querySelector('.pwd-checker[data-strength="1"]')||a.querySelector('.pwd-checker[data-strength="2"]'))&&(a.classList.add("was-validated"),null===(t=a?.querySelector("input:invalid"))||void 0===t||t.scrollIntoView(),e.preventDefault()),a.querySelector("iam-multiselect[data-is-required][data-error]")&&(a.classList.add("was-validated"),e.preventDefault()))}}),document.addEventListener("keydown",e=>{"Escape"===e.key&&document.querySelector(".dialog--transactional[open], .dialog--acknowledgement[open]")&&(e.preventDefault(),e.stopPropagation())}),Array.from(document.querySelectorAll("label progress")).forEach(e=>{e.closest("label").setAttribute("data-percent",e.getAttribute("value"))})},new((o=void 0)||(o=Promise))(function(e,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function l(e){try{c(n.throw(e))}catch(e){r(e)}}function c(t){t.done?e(t.value):function(e){return e instanceof o?e:new o(function(t){t(e)})}(t.value).then(s,l)}c((n=n.apply(t,a||[])).next())});var t,a,o,n})});
|
|
@@ -188,7 +188,7 @@ $selector: 'iam-table, iam-table-basic, iam-table-no-submit, iam-table-submit, i
|
|
|
188
188
|
border-color: var(--colour-border) !important;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
tr:not([data-view='full']) td p {
|
|
191
|
+
tr:not([data-view='full']):has(p.three-lines) td p {
|
|
192
192
|
display: -webkit-box;
|
|
193
193
|
-webkit-box-orient: vertical;
|
|
194
194
|
-webkit-line-clamp: 2;
|
|
@@ -212,11 +212,15 @@ $selector: 'iam-table, iam-table-basic, iam-table-no-submit, iam-table-submit, i
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
tr:not(:has(p)) [data-expand-button] {
|
|
216
|
-
display: none;
|
|
215
|
+
tr:not(:has(p.three-lines)) [data-expand-button] {
|
|
216
|
+
display: none!important;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
tr
|
|
219
|
+
tr td p:last-child {
|
|
220
|
+
padding-bottom: 0!important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
tr:not([data-view='full']):has(p.three-lines) td p {
|
|
220
224
|
display: -webkit-box;
|
|
221
225
|
-webkit-box-orient: vertical;
|
|
222
226
|
-webkit-line-clamp: 2;
|
|
@@ -56,7 +56,7 @@ class iamModal extends HTMLElement {
|
|
|
56
56
|
|
|
57
57
|
this.dispatchEvent(agreedEvent);
|
|
58
58
|
|
|
59
|
-
closeModal(
|
|
59
|
+
closeModal(this);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
document.addEventListener('click', (e) => {
|
|
@@ -94,7 +94,7 @@ class iamModal extends HTMLElement {
|
|
|
94
94
|
|
|
95
95
|
e.preventDefault();
|
|
96
96
|
|
|
97
|
-
closeModal(
|
|
97
|
+
closeModal(this);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
// Move the submit button so that the slot functionality works
|
|
@@ -105,11 +105,11 @@ class iamModal extends HTMLElement {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
closeButton?.addEventListener('click', () => {
|
|
108
|
-
closeModal(
|
|
108
|
+
closeModal(this);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
cancelButton?.addEventListener('click', () => {
|
|
112
|
-
closeModal(
|
|
112
|
+
closeModal(this);
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
agreedButton?.addEventListener('click', () => {
|
|
@@ -119,7 +119,7 @@ class iamModal extends HTMLElement {
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
this.addEventListener('close-modal', () => {
|
|
122
|
-
closeModal(
|
|
122
|
+
closeModal(this);
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
// Hijack the default form submission
|
|
@@ -127,7 +127,7 @@ class iamModal extends HTMLElement {
|
|
|
127
127
|
|
|
128
128
|
if(e.submitter && e.submitter.hasAttribute('formmethod') && e.submitter.getAttribute('formmethod') =="dialog"){
|
|
129
129
|
|
|
130
|
-
closeModal(
|
|
130
|
+
closeModal(this);
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
133
|
agreed();
|
|
@@ -164,7 +164,7 @@ class iamModal extends HTMLElement {
|
|
|
164
164
|
event.clientY > dialogDimensions.bottom
|
|
165
165
|
) {
|
|
166
166
|
if (!event.target.closest('dialog *'))
|
|
167
|
-
closeModal(
|
|
167
|
+
closeModal(this); // Weird bug when interacting with radio input fields within dialogs cuases it to close
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
});
|
|
@@ -297,11 +297,31 @@ export const createMobileButton = (component, table): void => {
|
|
|
297
297
|
});
|
|
298
298
|
|
|
299
299
|
Array.from(table.querySelectorAll('tbody tr')).forEach((row, index) => {
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
Array.from(row.querySelectorAll('p')).forEach((p, index) => {
|
|
303
|
+
|
|
304
|
+
const lineHeight = window.getComputedStyle(p, null).getPropertyValue('line-height');
|
|
305
|
+
console.log(parseInt(lineHeight));
|
|
306
|
+
const lines = Math.ceil(p.offsetHeight / parseInt(lineHeight));
|
|
307
|
+
p.setAttribute('data-lines',lines);
|
|
308
|
+
if(lines >= 3){
|
|
309
|
+
p.classList.add('three-lines');
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
if(row.querySelector('p')){
|
|
315
|
+
row.setAttribute('data-view', 'default');
|
|
316
|
+
}
|
|
317
|
+
|
|
300
318
|
const preExpanded = row.getAttribute('data-view') === 'full' ? 'aria-expanded' : '';
|
|
301
|
-
row.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
319
|
+
if (!row.querySelectorAll('td.td--expand').length) {
|
|
320
|
+
row.insertAdjacentHTML(
|
|
321
|
+
'afterbegin',
|
|
322
|
+
`<td class="${component.hasAttribute('data-expandable') ? 'td--fixed ' : ''}td--expand"><button class="btn btn-compact btn-secondary btn-sm fa-chevron-down" data-expand-button ${preExpanded} data-index="${index}">Expand</button></td>`
|
|
323
|
+
);
|
|
324
|
+
}
|
|
305
325
|
});
|
|
306
326
|
|
|
307
327
|
table.addEventListener('click', (event) => {
|
|
@@ -311,14 +331,14 @@ export const createMobileButton = (component, table): void => {
|
|
|
311
331
|
|
|
312
332
|
button.toggleAttribute('aria-expanded');
|
|
313
333
|
|
|
314
|
-
if(button.classList.contains('fa-
|
|
315
|
-
button.classList.remove('fa-
|
|
316
|
-
button.classList.add('fa-
|
|
334
|
+
if(button.classList.contains('fa-chevron-down')){
|
|
335
|
+
button.classList.remove('fa-chevron-down');
|
|
336
|
+
button.classList.add('fa-chevron-up');
|
|
317
337
|
}
|
|
318
338
|
else {
|
|
319
339
|
|
|
320
|
-
button.classList.remove('fa-
|
|
321
|
-
button.classList.add('fa-
|
|
340
|
+
button.classList.remove('fa-chevron-up');
|
|
341
|
+
button.classList.add('fa-chevron-down');
|
|
322
342
|
}
|
|
323
343
|
|
|
324
344
|
if (tableRow.getAttribute('data-view') == 'full') tableRow.setAttribute('data-view', 'default');
|