@ukic/canary-web-components 2.0.0-canary.41 → 2.0.0-canary.43
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/dist/cjs/core.cjs.js +1 -1
 - package/dist/cjs/ic-data-table.cjs.entry.js +37 -15
 - package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
 - package/dist/cjs/ic-pagination_4.cjs.entry.js +10 -4
 - package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
 - package/dist/cjs/loader.cjs.js +1 -1
 - package/dist/collection/components/ic-data-table/ic-data-table.js +37 -15
 - package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
 - package/dist/collection/components/ic-data-table/ic-data-table.stories.js +8 -1
 - package/dist/collection/components/ic-data-table/ic-data-table.stories.js.map +1 -1
 - package/dist/collection/components/ic-data-table/story-data.js +32 -3
 - package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
 - package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +23 -0
 - package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
 - package/dist/components/ic-data-table.js +37 -15
 - package/dist/components/ic-data-table.js.map +1 -1
 - package/dist/components/ic-text-field2.js +11 -4
 - package/dist/components/ic-text-field2.js.map +1 -1
 - package/dist/core/core.esm.js +1 -1
 - package/dist/core/core.esm.js.map +1 -1
 - package/dist/core/{p-61848e6b.entry.js → p-12f5911d.entry.js} +2 -2
 - package/dist/core/p-12f5911d.entry.js.map +1 -0
 - package/dist/core/p-4a89994a.entry.js +2 -0
 - package/dist/core/p-4a89994a.entry.js.map +1 -0
 - package/dist/esm/core.js +1 -1
 - package/dist/esm/ic-data-table.entry.js +37 -15
 - package/dist/esm/ic-data-table.entry.js.map +1 -1
 - package/dist/esm/ic-pagination_4.entry.js +10 -4
 - package/dist/esm/ic-pagination_4.entry.js.map +1 -1
 - package/dist/esm/loader.js +1 -1
 - package/dist/types/components/ic-data-table/ic-data-table.d.ts +1 -0
 - package/dist/types/components/ic-data-table/ic-data-table.stories.d.ts +14 -8
 - package/dist/types/components/ic-data-table/story-data.d.ts +1 -0
 - package/hydrate/index.js +48 -19
 - package/package.json +3 -3
 - package/dist/core/p-3ebd4703.entry.js +0 -2
 - package/dist/core/p-3ebd4703.entry.js.map +0 -1
 - package/dist/core/p-61848e6b.entry.js.map +0 -1
 
| 
         @@ -0,0 +1,2 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import{r as t,c as i,h as e,F as s,H as n,g as o}from"./p-8455d1bb.js";import{d as l,b as a,p as h,i as r,c as d,e as c,f as u,h as v,j as p}from"./p-8ab58daa.js";const g=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">\n    <path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>\n</svg>`;const f=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(-90deg);">\n    <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const m=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(90deg)">\n    <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const b=':host{position:relative;display:inline-flex;max-height:100%;width:var(--table-width, 100%);height:100%;min-width:var(--table-min-width);max-width:var(--table-max-width)}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column;width:100%}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden;height:var(--row-height)}.truncation-show-hide{display:block}.cell-icon.truncation-show-hide{display:flex}.cell-container:not(.data-type-element,.truncation-show-hide){overflow-x:hidden}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination="true"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:var(--table-layout, "fixed");border-spacing:0;width:100%;height:var(--table-height, auto)}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded="true"]) .table-row-container{border:var(--ic-border-light)}.column-header-inner-container{padding:var(--ic-space-xs);box-sizing:border-box}.column-header-inner-container ic-tooltip{pointer-events:none}.column-header-inner-container ic-tooltip.show-trunc-tooltip{pointer-events:auto}.column-header-inner-container ic-tooltip .column-header-text{--ic-line-clamp:1}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n    rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-table-row-selected) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-action-dark-bg-hover)}.sort-button:active{background-color:var(--ic-action-dark-bg-active)}.sort-button svg{color:var(--ic-architectural-black)}.sort-button-unsorted svg{color:var(--ic-color-tertiary-text)}.table-density-dense .column-header-inner-container,td.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious .column-header-inner-container,td.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.dummy-column-header-text{white-space:nowrap;overflow:hidden;height:0;width:-moz-fit-content;width:fit-content}.row-header,.column-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-architectural-40);border-right:var(--ic-border-light);border-bottom:var(--ic-border-light)}.column-header{padding:0;width:var(--column-width);min-width:var(--column-min-width, 4rem);max-width:var(--column-max-width)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-border-light) !important}:host([embedded="true"]) tr:last-child .table-cell,:host([embedded="true"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography{padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.cell-alignment-right.truncation-show-hide ic-typography{--ellipsis-padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row:nth-child(even){background-color:var(--ic-architectural-20)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-architectural-100) var(--ic-space-1px);overflow:hidden;box-sizing:border-box;max-width:var(--column-max-width);min-width:var(--column-min-width)}.table-cell.with-overflow{overflow:visible}.data-type-string,.data-type-address{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top;align-items:flex-start}.cell-alignment-middle{vertical-align:middle;align-items:center}.cell-alignment-bottom{vertical-align:bottom;align-items:flex-end}.cell-emphasis-low{color:var(--ic-color-secondary-text)}.cell-emphasis-high{font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-architectural-40);border-top:var(--ic-border-light)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-border-light)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow);z-index:calc(var(--ic-z-index-dialog) - 1)}.loading.show-background{background-color:var(--ic-architectural-white);border:var(--ic-border-light)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.column-header-alignment-center>.cell-text-wrapper,.row-header-alignment-right>ic-typography,.row-header-alignment-right>.cell-text-wrapper,.cell-alignment-center>ic-typography,.cell-alignment-center>.cell-text-wrapper{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.truncation-tooltip ic-typography{display:-webkit-box;-webkit-line-clamp:var(--ic-line-clamp, 0);-webkit-box-orient:vertical;overflow:hidden}.truncation-tooltip ic-typography,.truncation-show-hide ic-typography{white-space:normal}.ic-tooltip-overflow{overflow:hidden;width:100%}.action-element{display:flex;justify-content:right}.cell-grid-wrapper{display:grid;grid-template-columns:auto auto}.loading-overlay{visibility:hidden;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--ic-architectural-black);z-index:calc(var(--ic-z-index-dialog) - 2);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading-overlay.show{visibility:visible;opacity:0.6}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){.loading-overlay{transition:none}}.cell-text-wrapper{overflow:hidden}.cell-text-wrapper>ic-typography{margin-left:2px}.cell-text-no-wrap{word-wrap:initial}.cell-container-with-description{display:flex;flex-direction:row}.cell-description{display:flex;flex-direction:row;margin-top:var(--ic-space-xxs);word-break:break-all}.cell-description-text{color:var(--ic-color-secondary-text)}.cell-description-icon{padding-right:var(--ic-space-xs)}.cell-description-icon>svg{height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs));display:flex}@media (min-width: 577px){.column-header-inner-container{display:flex;align-items:center}}@media (max-width: 577px){.cell-icon{flex-wrap:wrap}.cell-description-icon{padding-right:0}}@media (forced-colors: active){.icon,::slotted(svg),.cell-description-icon>svg{fill:currentcolor}.sort-button svg{color:currentcolor}.table-row-selected{background-color:Highlight !important}}';const w=class{constructor(n){t(this,n);this.icRowHeightChange=i(this,"icRowHeightChange",7);this.icSelectedRowChange=i(this,"icSelectedRowChange",7);this.icSortChange=i(this,"icSortChange",7);this.DENSITY_HEIGHT_MULTIPLIER={dense:.8,default:1,spacious:1.2};this.DENSITY_PADDING_HEIGHT_DIFF={dense:8,default:16,spacious:20};this.SORT_ICONS={unsorted:g,ascending:f,descending:m};this.hasLoadedForOneSecond=true;this.resizeObserver=null;this.SHOW_HIDE_STRING="show-hide";this.SHOW_HIDE_CSS_CLASS=`${this.SHOW_HIDE_STRING}-wrap`;this.TOOLTIP_STRING="tooltip";this.TOOLTIP=`ic-${this.TOOLTIP_STRING}`;this.TEXT_WRAP_STRING="text-wrap";this.TEXT_WRAP_CLASS=`.${this.TEXT_WRAP_STRING}`;this.dataUpdated=false;this.rowHeightSet=false;this.initialLoad=false;this.icPageChangeEvent=false;this.itemsPerPageChange=false;this.DATA_ROW_HEIGHT_STRING="data-row-height";this.ROW_HEIGHT_CSS_VARIABLE="--row-height";this.LINE_CLAMP_CSS_VARIABLE="--ic-line-clamp";this.DEFAULT_LINE_HEIGHT=24;this.densityUpdate=false;this.truncationPatternUpdated=false;this.isNewDebounceDelaySet=false;this.headerResizeObserver=null;this.IC_TOOLTIP_STRING="ic-tooltip";this.SHOW_TRUNC_TOOLTIP_STRING="show-trunc-tooltip";this.CELL_DESCRIPTION_STRING=".cell-description";this.CELL_CONTAINER_WITH_DESCRIPTION_STRING="cell-container-with-description";this.CELL_TEXT_WRAPPER_STRING=".cell-text-wrapper";this.IC_TYPOGRAPHY_STRING="ic-typography";this.runHeaderResizeObserver=()=>{this.headerResizeObserver=new ResizeObserver((()=>{this.headerResizeCallback()}));this.headerResizeObserver.observe(this.el)};this.headerResizeCallback=()=>{if(!this.hideColumnHeaders&&this.columnHeaderTruncation){const t=this.el.shadowRoot.querySelector(".table-container").clientWidth;if(t!==this.prevTableContainerWidth){const i=this.el.shadowRoot.querySelectorAll("th.column-header");i.forEach((t=>{const i=t.querySelector(this.IC_TOOLTIP_STRING);const e=t.querySelectorAll(this.IC_TYPOGRAPHY_STRING);if(i&&e&&e.length===2){i.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);if(e[1].clientWidth>e[0].clientWidth){i.classList.add(this.SHOW_TRUNC_TOOLTIP_STRING)}}}));this.prevTableContainerWidth=t}}};this.updateSetRowHeight=t=>{const i=parseInt(getComputedStyle(document.documentElement).fontSize);if(t){const e=this.getCellContainer(t);const s=i*parseFloat(e.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(t.scrollHeight>s){e.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE)}}else{this.getTypographyElements().forEach((t=>{const e=this.getCellContainer(t);const s=i*parseFloat(e.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(t.scrollHeight>s){e.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE)}}))}};this.debounceDataTruncation=()=>{this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.resizeObserver=new ResizeObserver(l((()=>{this.dataTruncation(t);if(!this.isNewDebounceDelaySet){this.setNewDebounceDelay(200)}}),(()=>this.debounceDelay)));this.resizeObserver.observe(t)}}))};this.setNewDebounceDelay=t=>{this.debounceDelay=t;this.isNewDebounceDelaySet=true};this.getLines=t=>Math.floor(t/this.DEFAULT_LINE_HEIGHT);this.truncate=(t,i,e)=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(i===null||i===void 0?void 0:i.clientHeight)){if(!t.closest(this.TEXT_WRAP_CLASS)){if(this.truncationPattern===this.TOOLTIP_STRING){this.addTooltipTruncation(t,i,e)}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.addShowHideTruncation(i,t)}}}else{if(this.truncationPattern===this.TOOLTIP_STRING&&e){t.setAttribute("style",`${this.LINE_CLAMP_CSS_VARIABLE}: 0`);const s=i.querySelector(this.CELL_TEXT_WRAPPER_STRING);s.prepend(t);e.remove()}if(this.truncationPattern===this.SHOW_HIDE_STRING&&!a(t.getAttribute("max-lines"))){this.resetShowHideTruncation(t)}}};this.dataTruncation=t=>{const i=this.getTooltip(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.classList.contains("data-type-element"))||this.dataUpdated){return}if(this.truncationPattern===this.SHOW_HIDE_STRING&&t.shadowRoot.querySelector("button")){const i=t.shadowRoot.querySelector("button");if(i){const i=this.getTruncWrapper(t);if(this.getLines(i.scrollHeight)===+t.getAttribute("max-lines")){this.resetShowHideTruncation(t)}}}if(this.rowHeightSet&&this.truncationPattern===this.SHOW_HIDE_STRING){const i=this.getTruncWrapper(t);if(i&&e.clientHeight-this.DEFAULT_LINE_HEIGHT>i.scrollHeight){this.resetShowHideTruncation(t);return}if(t.scrollHeight>e.clientHeight){this.addShowHideTruncation(e,t);return}}if((t===null||t===void 0?void 0:t.scrollHeight)>0&&(e===null||e===void 0?void 0:e.clientHeight)>0&&(t===null||t===void 0?void 0:t.scrollHeight)===(e===null||e===void 0?void 0:e.clientHeight)){if(i){this.removeTooltip(e,t,i)}return}this.truncate(t,e,i)};this.getTruncWrapper=t=>t.shadowRoot.querySelector(".trunc-wrapper");this.removeTextWrap=()=>{this.getTypographyElements().forEach((t=>{const i=t.closest("td");if(i.classList.contains(this.TEXT_WRAP_STRING)){i.classList.remove(this.TEXT_WRAP_STRING)}}))};this.getCellContainer=t=>t.closest(".cell-container");this.deleteTextWrapDataKey=t=>Array.isArray(t)&&t.forEach((t=>t.textWrap&&delete t.textWrap));this.startLoadingTimer=()=>{this.hasLoadedForOneSecond=false;this.timerStarted=Date.now();setTimeout((()=>{this.hasLoadedForOneSecond=true;this.timerStarted=null}),this.minimumLoadingDisplayDuration)};this.isObject=t=>t!==undefined&&t!==null&&typeof t==="object";this.notDefaultDensity=()=>this.density!=="default";this.getCellContent=(t,i)=>{switch(i){case"element":return undefined;case"date":return(t instanceof Date?t:new Date(t)).toLocaleDateString();default:return t}};this.getCellAlignment=(t,i)=>{if(this.isObject(t)&&Object.keys(t).includes("cellAlignment")){return this.getObjectValue(this.getObjectValue(t,"cellAlignment"),i)}};this.getCellOptions=(t,i)=>{if(!(this.isObject(t)&&Object.keys(t).includes(i)))return;return this.getObjectValue(t,i)};this.createUpdatingIndicator=()=>{const{appearance:t,description:i,max:s,min:n,progress:o}=this.updatingOptions||{};return e("th",{colSpan:this.columns.length,class:"updating-state"},e("ic-loading-indicator",{appearance:t,description:i||"Updating table data",fullWidth:true,max:s,min:n,progress:o,type:"linear",size:"small"}))};this.setRowHeight=t=>h(`${t*this.DENSITY_HEIGHT_MULTIPLIER[this.density]-this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);this.setTruncationClass=()=>this.truncationPattern?{[`truncation-${this.truncationPattern}`]:true}:{};this.getColumnWidth=t=>{let i={};if(t){if(typeof t==="string"){i=Object.assign(Object.assign({},i),{["--column-width"]:t})}if(typeof t==="object"&&!!Object.keys(t)){if(t===null||t===void 0?void 0:t.minWidth){i=Object.assign(Object.assign({},i),{["--column-min-width"]:t===null||t===void 0?void 0:t.minWidth})}if(t===null||t===void 0?void 0:t.maxWidth){i=Object.assign(Object.assign({},i),{["--column-max-width"]:t===null||t===void 0?void 0:t.maxWidth})}}}return i};this.getRowHeight=(t,i,e,s)=>{if((this.truncationPattern||t)&&!(i===null||i===void 0?void 0:i.textWrap)&&!e&&!this.getCellOptions(s,"textWrap")&&(i===null||i===void 0?void 0:i.dataType)!=="element"){return{[this.ROW_HEIGHT_CSS_VARIABLE]:this.setRowHeight(t)}}return{}};this.adjustWidthForActionElement=()=>{var t;const i=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelectorAll(".action-element");i===null||i===void 0?void 0:i.forEach((t=>{let i=0;const e=t.firstChild;if(e.tagName.toLowerCase()==="slot"){const t=this.getSlottedActionElement(e);if(t){i=t.getBoundingClientRect().width}}else{i=e.getBoundingClientRect().width}const s=t.closest(".cell-grid-wrapper");if(s){s.style.gridTemplateColumns=`auto calc(${i}px + var(--ic-space-xs))`}}))};this.createCellContent=(t,i,n,o,l,a,h,d,c)=>{var u,v,p,g,f,m,b,w,y,x,O,$,j,k,H;return e("div",{innerHTML:(t===null||t===void 0?void 0:t.dataType)==="element"&&!r(this.el,n)?i:null,class:Object.assign(Object.assign({"cell-container":(t===null||t===void 0?void 0:t.dataType)!=="element",[`cell-alignment-${((u=t===null||t===void 0?void 0:t.columnAlignment)===null||u===void 0?void 0:u.vertical)||((v=o===null||o===void 0?void 0:o.rowAlignment)===null||v===void 0?void 0:v.vertical)||l||this.getCellAlignment(i,"vertical")}`]:!!((p=t===null||t===void 0?void 0:t.columnAlignment)===null||p===void 0?void 0:p.vertical)||!!((g=o===null||o===void 0?void 0:o.rowAlignment)===null||g===void 0?void 0:g.vertical)||!!l||!!this.getCellAlignment(i,"vertical"),[`cell-alignment-${((f=t===null||t===void 0?void 0:t.columnAlignment)===null||f===void 0?void 0:f.horizontal)||((m=o===null||o===void 0?void 0:o.rowAlignment)===null||m===void 0?void 0:m.horizontal)||this.getCellAlignment(i,"horizontal")}`]:!!((b=t===null||t===void 0?void 0:t.columnAlignment)===null||b===void 0?void 0:b.horizontal)||!!((w=o===null||o===void 0?void 0:o.rowAlignment)===null||w===void 0?void 0:w.horizontal)||!!this.getCellAlignment(i,"horizontal"),[`data-type-${t===null||t===void 0?void 0:t.dataType}`]:true,[this.TEXT_WRAP_STRING]:(t===null||t===void 0?void 0:t.textWrap)||(o===null||o===void 0?void 0:o.textWrap)||!!this.getCellOptions(i,"textWrap"),["cell-icon"]:a||!!((y=t===null||t===void 0?void 0:t.icon)===null||y===void 0?void 0:y.icon)},this.setTruncationClass()),{[this.CELL_CONTAINER_WITH_DESCRIPTION_STRING]:this.isObject(i)&&Object.keys(i).includes("description")}),style:Object.assign(Object.assign({},this.getRowHeight(h,t,o===null||o===void 0?void 0:o.textWrap,i)),this.getColumnWidth(t===null||t===void 0?void 0:t.columnWidth)),"data-row-height":this.truncationPattern||h?this.setRowHeight(h):null},r(this.el,n)?e("slot",{name:n}):e(s,null,r(this.el,`${n}-icon`)?e("slot",{name:`${n}-icon`}):(a||((x=t===null||t===void 0?void 0:t.icon)===null||x===void 0?void 0:x.onAllCells))&&(d("icon")||((O=t===null||t===void 0?void 0:t.icon)===null||O===void 0?void 0:O.icon))&&e("span",{class:"icon",innerHTML:d("icon")||(($=t===null||t===void 0?void 0:t.icon)===null||$===void 0?void 0:$.icon)}),(t===null||t===void 0?void 0:t.dataType)!=="element"&&!r(this.el,n)&&e("div",{class:{"cell-text-wrapper":true,"cell-text-no-wrap":!this.truncationPattern}},e("ic-typography",{variant:"body",class:{[`cell-emphasis-${this.isObject(i)&&d("emphasis")||(t===null||t===void 0?void 0:t.emphasis)||c}`]:this.isObject(i)&&!!d("emphasis")||!!(t===null||t===void 0?void 0:t.emphasis)||!!c,[`text-${this.density}`]:this.notDefaultDensity()}},this.isObject(i)&&(t===null||t===void 0?void 0:t.dataType)!=="date"?Object.keys(i).includes("href")?e("ic-link",{href:d("href"),target:d("target")||undefined,rel:d("rel")||undefined},d("data")):d("data"):this.getCellContent(i,t===null||t===void 0?void 0:t.dataType)),this.isObject(i)&&Object.keys(i).includes("description")&&e("div",{class:{["cell-description"]:true,[`data-type-${t===null||t===void 0?void 0:t.dataType}`]:true}},((j=d("description"))===null||j===void 0?void 0:j.icon)&&e("span",{class:"cell-description-icon",innerHTML:d("description").icon}),e("ic-typography",{variant:"caption",class:"cell-description-text"},(H=(k=d("description"))===null||k===void 0?void 0:k.data)!==null&&H!==void 0?H:d("description"))))))};this.createCells=(t,i)=>{var s;const n=Object.values(t);const o=Object.keys(t);const l=this.getRowOptions(o,n);let a;let h;const d=o.indexOf("header");if(d>-1){a=this.getObjectValue(n[d],"rowAlignment");h=this.getObjectValue(n[d],"emphasis")}const c=(s=this.variableRowHeight)===null||s===void 0?void 0:s.call(this,Object.assign(Object.assign({},t),{index:i}));const u=c?c!=="auto"&&c:this.globalRowHeight!=="auto"&&this.globalRowHeight;return n.map(((t,s)=>{const n=this.columns[s];const d=`${n===null||n===void 0?void 0:n.key}-${i}`;const c=this.isObject(t)&&Object.keys(t).includes("icon");const v=i=>this.getObjectValue(t,i);const p=this.createCellContent(n,t,d,l,a,c,u,v,h);if(o[s]==="header"){return e("th",{scope:"row",colSpan:v("colspan"),class:{["row-header"]:true,[`row-header-alignment-${v("cellAlignment")}`]:!!v("cellAlignment"),["row-header-sticky"]:this.stickyRowHeaders}},v("title"))}if(o[s]!=="rowOptions"){return e("td",{class:{["table-cell"]:true,[`table-density-${this.density}`]:this.notDefaultDensity(),["with-overflow"]:(n===null||n===void 0?void 0:n.dataType)==="element"},style:Object.assign({},this.getColumnWidth(n.columnWidth))},r(this.el,`${d}-action-element`)?e("div",{class:"cell-grid-wrapper"},p,e("span",{class:"action-element"},e("slot",{name:`${d}-action-element`}))):this.isObject(t)&&Object.keys(t).includes("actionElement")?e("div",{class:"cell-grid-wrapper"},p,e("span",{class:"action-element",innerHTML:v("actionElement"),onClick:t.actionOnClick?i=>this.handleClick(i,t.actionOnClick):undefined})):p)}}))};this.createColumnHeaders=()=>(this.columns||[]).map((({cellAlignment:t,colspan:i,icon:s,key:n,title:o,columnWidth:l,excludeColumnFromSort:a},h)=>e("th",{scope:"col",class:{["column-header"]:true,[`table-density-${this.density}`]:this.notDefaultDensity(),["updating-state-headers"]:this.updating&&!this.loading},style:Object.assign({},this.getColumnWidth(l)),colSpan:i},e("div",{class:{"column-header-inner-container":true,"truncation-tooltip":this.columnHeaderTruncation,[`column-header-alignment-${t}`]:!!t}},r(this.el,`${n}-column-icon`)?e("slot",{name:`${n}-column-icon`}):s&&!s.hideOnHeader&&e("span",{class:"icon",innerHTML:s.icon}),this.columnHeaderTruncation?e("ic-tooltip",{label:o,target:`column-header-${h}`},e("ic-typography",{id:`column-header-${h}`,variant:"body",class:{["column-header-text"]:true,[`text-${this.density}`]:this.notDefaultDensity()}},o)):e("ic-typography",{variant:"body",class:{["column-header-text"]:true,[`text-${this.density}`]:this.notDefaultDensity()}},o),this.sortable&&!a&&e("ic-button",{variant:"icon",id:`sort-button-${n}`,"aria-label":this.getSortButtonLabel(n),onClick:()=>this.sortRows(n),innerHTML:this.SORT_ICONS[this.sortedColumn===n?this.sortedColumnOrder:"unsorted"],class:{["sort-button"]:true,["sort-button-unsorted"]:this.sortedColumn!==n||this.sortedColumnOrder==="unsorted"}})),this.columnHeaderTruncation&&e("ic-typography",{variant:"body","aria-hidden":"true",class:{["column-header-text"]:true,["dummy-column-header-text"]:this.columnHeaderTruncation,[`text-${this.density}`]:this.notDefaultDensity()}},o))));this.onRowClick=t=>{if(!this.loading&&!this.updating){this.icSelectedRowChange.emit(this.selectedRow!==t?t:null)}this.selectedRow=this.selectedRow!==t&&!this.loading&&!this.updating&&t};this.createRows=()=>{const t=this.showPagination?this.data.slice(this.fromRow,this.toRow):this.data.slice();const i=this.showPagination?this.fromRow:0;const s=t.map(((t,e)=>{const s=this.columns.map((({key:t},s)=>r(this.el,`${t}-${e+i}`)&&{key:t,index:s})).filter((i=>!!i&&!Object.prototype.hasOwnProperty.call(t,i.key)));return s.length>0?d(t,s,""):t}));return s.sort(!this.sortable||this.disableAutoSort?undefined:this.getSortFunction()).map(((t,s)=>e("tr",{onClick:()=>this.onRowClick(t),class:{["table-row"]:true,["table-row-selected"]:this.highlightSelectedRow&&this.selectedRow===t}},this.createCells(t,s+i))))};this.getSlottedActionElement=t=>{const i=t.getAttribute("name");return this.el.querySelector(`[slot="${i}"]`)};this.getObjectValue=(t,i)=>Object.values(t)[Object.keys(t).indexOf(i)];this.getSortButtonLabel=t=>{let i="";const e=t=>{const i=this.sortOptions.sortOrders;return i[(i.indexOf(t)+1)%i.length]};if(this.sortedColumn===t){const t=e(this.sortedColumnOrder);i=t!=="unsorted"?`Sort ${t}`:"Remove sort"}else{i=`Sort ${e("unsorted")}`}return i};this.getComparison=(t,i)=>{const e=t[this.sortedColumn];const s=i[this.sortedColumn];return this.columns.find((t=>t.key===this.sortedColumn)).dataType==="date"?new Date(e).valueOf()-new Date(s).valueOf():String(this.isObject(e)?Object.values(e)[0]:e).localeCompare(String(this.isObject(s)?Object.values(s)[0]:s),undefined,{numeric:true,sensitivity:"base"})};this.getSortFunction=()=>{switch(this.sortedColumnOrder){case"ascending":return(t,i)=>this.getComparison(t,i);case"descending":return(t,i)=>this.getComparison(i,t);default:return undefined}};this.sortRows=t=>{const i=this.el.shadowRoot.querySelector(`#sort-button-${t}`);const e=this.sortOptions.sortOrders;if(t!==this.sortedColumn){if(this.sortedColumn){const i=this.el.shadowRoot.querySelector(`#sort-button-${this.sortedColumn}`);i.setAttribute("aria-label",this.getSortButtonLabel(t))}this.sortedColumn=t;this.sortedColumnOrder="unsorted"}let s=e.indexOf(this.sortedColumnOrder)+1;if(s>e.length-1){s=0}this.sortedColumnOrder=e[s];i.setAttribute("aria-label",this.getSortButtonLabel(t));this.tableSorted=true;this.icSortChange.emit({columnName:t,sorted:this.sortedColumnOrder})};this.getTypographyElements=()=>Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text,.cell-description-text)"));this.getTooltip=t=>t.closest(this.TOOLTIP);this.updateTruncationTooltip=(t=false)=>{this.getTypographyElements().forEach((i=>{const e=this.getTooltip(i);const s=this.getCellContainer(i);if(i.closest(this.TEXT_WRAP_CLASS)){this.removeTooltip(s,i,e);i.setAttribute("style",`${this.LINE_CLAMP_CSS_VARIABLE}: 0`);return}this.regenerateTooltip(s,i,e,t)}))};this.updateScrollOffset=()=>{this.scrollOffset=this.el.shadowRoot.querySelector(".table-row-container").scrollTop};this.updateRowHeightForDescriptions=(t,i)=>{i.setAttribute("data-row-height",t.toString());i.setAttribute("style",`${this.ROW_HEIGHT_CSS_VARIABLE}: ${t}px`)};this.updateCellHeightsWithDescriptions=()=>{const t=this.el.shadowRoot.querySelectorAll(this.CELL_DESCRIPTION_STRING);t.forEach((t=>{const i=t.closest(`.${this.CELL_CONTAINER_WITH_DESCRIPTION_STRING}`);const e=i.querySelector(this.IC_TYPOGRAPHY_STRING);const s=window.getComputedStyle(t).getPropertyValue("margin-top");const n=t.clientHeight+parseInt(s,10);if(this.globalRowHeight&&this.globalRowHeight!=="auto"){if(!e.textContent&&n+this.DEFAULT_LINE_HEIGHT>this.globalRowHeight){this.updateRowHeightForDescriptions(n,i)}else if(this.truncationPattern===this.TOOLTIP_STRING){if(n+this.DEFAULT_LINE_HEIGHT>this.globalRowHeight){const t=i===null||i===void 0?void 0:i.querySelector(".icon");if(c(p.XS)&&t){this.updateRowHeightForDescriptions(n+this.DEFAULT_LINE_HEIGHT+t.clientHeight,i)}else{this.updateRowHeightForDescriptions(n+this.DEFAULT_LINE_HEIGHT,i)}}this.addLineClampCSS(e,i)}else if(this.truncationPattern===this.SHOW_HIDE_STRING&&n+this.DEFAULT_LINE_HEIGHT>this.globalRowHeight&&e.style.getPropertyValue("--truncation-max-lines")!=="initial"){this.updateRowHeightForDescriptions(n+this.DEFAULT_LINE_HEIGHT,i);if(n){this.createShowHideTruncation(e,i,n)}}}}))};this.setTableDimensions=()=>{let t={};if(this.width){t=Object.assign(Object.assign({},t),{["--table-width"]:this.width})}if(this.height){t=Object.assign(Object.assign({},t),{["--table-height"]:this.height})}if(this.maxWidth){t=Object.assign(Object.assign({},t),{["--table-max-width"]:this.maxWidth})}if(this.minWidth){t=Object.assign(Object.assign({},t),{["--table-min-width"]:this.minWidth})}return t};this.fixCellTooltip=t=>{var i;const e=t.tagName==="IC-TOOLTIP"?t:(i=t.shadowRoot)===null||i===void 0?void 0:i.querySelector(this.IC_TOOLTIP_STRING);if(e){e.setExternalPopperProps({strategy:"fixed"})}};this.fixCellTooltips=()=>{var t,i,e,s;(i=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelectorAll(".data-type-element"))===null||i===void 0?void 0:i.forEach((t=>{const i=u(t);i===null||i===void 0?void 0:i.forEach((t=>{this.fixCellTooltip(t)}))}));(s=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll(".action-element"))===null||s===void 0?void 0:s.forEach((t=>{const i=t.firstChild;if(i.tagName.toLowerCase()==="slot"){const t=this.getSlottedActionElement(i);if(t){this.fixCellTooltip(t)}}else{this.fixCellTooltip(t)}}))};this.handleClick=(t,i)=>i(t);this.renderTableBody=(t,i,s)=>{if(!(t===null||t===void 0?void 0:t.length))return;if(s&&i){return e("tbody",null,this.createRows())}else if(i&&!s){return null}else{return e("tbody",null,this.createRows())}};this.renderLoadingIndicator=(t,i)=>{if(!t)return null;return e(s,null,e("div",{class:"loading-overlay",ref:t=>this.loadingOverlay=t}),e("ic-loading-indicator",{appearance:i===null||i===void 0?void 0:i.appearance,class:{"loading-empty":t,loading:true,"show-background":i.showBackground||i.overlay},description:i.description||"Loading table data",label:i.label||"Loading...",labelDuration:i===null||i===void 0?void 0:i.labelDuration,max:i===null||i===void 0?void 0:i.max,min:i===null||i===void 0?void 0:i.min,progress:i===null||i===void 0?void 0:i.progress,ref:t=>this.loadingIndicator=t}))};this.renderAriaLiveLoading=()=>{var t,i;if(this.loading){return((t=this.loadingOptions)===null||t===void 0?void 0:t.label)||"Loading..."}else if(this.updating){return((i=this.updatingOptions)===null||i===void 0?void 0:i.description)||"Updating table data"}else{return""}};this.renderEmptyState=(t,i,s)=>{const n=r(this.el,"empty-state")?e("slot",{name:"empty-state"}):e("ic-empty-state",{aligned:"center",heading:"No Data",class:"loading-empty"});if(i&&!(t===null||t===void 0?void 0:t.length)&&s){return n}else if(!i&&!(t===null||t===void 0?void 0:t.length)){return n}else{return null}};this.fromRow=0;this.previousRowsPerPage=undefined;this.rowsPerPage=undefined;this.scrollable=false;this.scrollOffset=0;this.selectedRow=undefined;this.sortedColumn=undefined;this.sortedColumnOrder=undefined;this.toRow=undefined;this.currentRowHeight=undefined;this.debounceDelay=0;this.caption=undefined;this.columnHeaderTruncation=false;this.columns=undefined;this.data=undefined;this.disableAutoSort=false;this.density="default";this.embedded=false;this.globalRowHeight="auto";this.height=undefined;this.highlightSelectedRow=true;this.hideColumnHeaders=false;this.loading=false;this.loadingOptions=undefined;this.maxWidth=undefined;this.minWidth=undefined;this.minimumLoadingDisplayDuration=1e3;this.paginationBarOptions={alignment:"right",appearance:"default",hideAllFromItemsPerPage:false,hideRangeLabel:false,itemLabel:"Item",itemsPerPageOptions:[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"}],pageLabel:"Page",rangeLabelType:"page",selectedItemsPerPage:10,setToFirstPageOnPaginationChange:false,showGoToPageControl:true,showItemsPerPageControl:true,type:"simple"};this.showPagination=false;this.sortable=false;this.sortOptions={sortOrders:["unsorted","ascending","descending"],defaultColumn:""};this.stickyColumnHeaders=false;this.stickyRowHeaders=false;this.tableLayout="fixed";this.truncationPattern=undefined;this.updating=false;this.updatingOptions=undefined;this.variableRowHeight=undefined;this.width=undefined}headerTruncationChangeHandler(){if(this.columnHeaderTruncation){this.prevTableContainerWidth=0}else{const t=this.el.shadowRoot.querySelectorAll("th.column-header");t.forEach((t=>{const i=t.querySelector(this.IC_TOOLTIP_STRING);if(i){i.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING)}}))}}disconnectedCallback(){var t,i;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.headerResizeObserver)===null||i===void 0?void 0:i.disconnect()}componentWillLoad(){var t,i;this.rowsPerPage=Number(this.paginationBarOptions.itemsPerPageOptions[0].value);this.previousRowsPerPage=this.rowsPerPage;this.toRow=this.rowsPerPage;this.sortedColumn=this.sortOptions.defaultColumn;this.sortedColumnOrder=this.sortOptions.sortOrders[0];this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:((t=this.data)===null||t===void 0?void 0:t.length)>0||!!((i=this.loadingOptions)===null||i===void 0?void 0:i.overlay)});this.initialLoad=true;this.previousItemsPerPage=this.rowsPerPage}componentDidLoad(){const t=this.el.shadowRoot.querySelector("table");const i=this.el.shadowRoot.querySelector(".table-container");v(this.runHeaderResizeObserver);if(this.dataUpdated){this.dataUpdated=false}if((t===null||t===void 0?void 0:t.clientHeight)>(i===null||i===void 0?void 0:i.clientHeight)||(t===null||t===void 0?void 0:t.clientWidth)>(i===null||i===void 0?void 0:i.clientWidth)){this.scrollable=true}if(this.loading){this.startLoadingTimer();this.showLoadingIndicator()}if(this.truncationPattern){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.dataTruncation(t)}}));this.debounceDataTruncation()}if(this.globalRowHeight!=="auto"){this.updateSetRowHeight()}window.addEventListener("resize",this.updateCellHeightsWithDescriptions)}componentDidUpdate(){if(this.truncationPattern===this.SHOW_HIDE_STRING||this.truncationPattern===this.TOOLTIP_STRING){this.truncateUpdatedData()}}componentDidRender(){this.fixCellTooltips();this.updateCellHeightsWithDescriptions();this.adjustWidthForActionElement()}truncateUpdatedData(){if(this.dataUpdated){if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>=(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}setTimeout((()=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}),150)}))}if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}this.dataUpdated=false}if(this.tableSorted){if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.createShowHideTruncation(t,i)}else{t.resetTruncation().then((()=>{i.removeAttribute("style")}))}}))}this.tableSorted=false}if(this.rowHeightSet){const t=parseInt(getComputedStyle(document.documentElement).fontSize);const i=this.globalRowHeight==="auto";this.getTypographyElements().forEach((e=>{var s;const n=this.getCellContainer(e);const o=this.getTooltip(e);if(i){n.style.height=null;if(this.truncationPattern===this.TOOLTIP_STRING){this.removeTooltip(n,e,o);e.setAttribute("style",`${this.LINE_CLAMP_CSS_VARIABLE}: 0`)}else if(this.truncationPattern===this.SHOW_HIDE_STRING){this.resetShowHideTruncation(e)}return}const l=t*parseFloat(n.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(!n.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)&&!((s=n===null||n===void 0?void 0:n.style)===null||s===void 0?void 0:s.height)&&l>n.clientHeight&&!n.classList.contains(this.TEXT_WRAP_STRING)){n.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,n.getAttribute(this.DATA_ROW_HEIGHT_STRING))}if(this.truncationPattern){if(this.truncationPattern===this.SHOW_HIDE_STRING){const t=this.getTruncWrapper(e);const i=e.shadowRoot.querySelector("button");if(i&&(t===null||t===void 0?void 0:t.scrollHeight)<=n.clientHeight){this.resetShowHideTruncation(e);return}}this.truncate(e,n,o)}else{this.updateSetRowHeight(e)}}));this.rowHeightSet=false}if(this.itemsPerPageChange){const t=this.el.shadowRoot.querySelectorAll(".table-row");if(this.rowsPerPage>this.previousItemsPerPage){const i=Array.from(t).slice(this.previousItemsPerPage);i.forEach((t=>{t.querySelectorAll(this.IC_TYPOGRAPHY_STRING).forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}))}))}this.previousItemsPerPage=this.rowsPerPage;this.itemsPerPageChange=false}if(!this.initialLoad&&this.icPageChangeEvent){if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=t.shadowRoot.querySelector("button");if((t===null||t===void 0?void 0:t.scrollHeight)>i.clientHeight&&!e){this.addShowHideTruncation(i,t)}}))}this.icPageChangeEvent=false}if(this.densityUpdate){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}));this.densityUpdate=false}if(this.truncationPatternUpdated){if(this.truncationPattern===this.TOOLTIP_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);if(t.scrollHeight>i.clientHeight){this.addTooltipTruncation(t,i,e)}}))}else if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}))}}}createShowHideTruncation(t,i,e){t.checkMaxLines(t.scrollHeight);t.setAttribute("max-lines",`${Math.floor((i===null||i===void 0?void 0:i.clientHeight)/this.DEFAULT_LINE_HEIGHT)}`);if(i.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)&&e){t.setAttribute("max-lines",`${Math.floor(((i===null||i===void 0?void 0:i.clientHeight)-e)/this.DEFAULT_LINE_HEIGHT)}`)}else{t.setAttribute("max-lines",`${Math.floor((i===null||i===void 0?void 0:i.clientHeight)/this.DEFAULT_LINE_HEIGHT)}`)}t.setShowHideExpanded(false);i.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,null)}addTooltipTruncation(t,i,e){this.addLineClampCSS(t,i);if(!e){this.createTruncationTooltip(t,i)}}addShowHideTruncation(t,i){t.classList.add(this.SHOW_HIDE_CSS_CLASS);this.createShowHideTruncation(i,t)}handleTypographyTruncationExpandToggle({detail:t}){const{expanded:i,typographyEl:e}=t;const s=this.getCellContainer(e);if(s.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE)&&i){s.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,"inherit")}}handlePageChange({detail:t,target:i}){if(i.parentElement!==this.el){this.fromRow=(t.value-1)*this.rowsPerPage;this.toRow=this.fromRow+this.rowsPerPage;const i=this.el.shadowRoot.querySelector(".table-row-container");if(this.previousRowsPerPage===this.rowsPerPage){i.scrollTop=0}else if(this.previousRowsPerPage<this.rowsPerPage){i.scrollTop=this.scrollOffset;this.previousRowsPerPage=this.rowsPerPage}else{this.previousRowsPerPage=this.rowsPerPage}}if(!this.initialLoad&&this.previousPaginationPage!==t.value){this.icPageChangeEvent=true}this.previousPaginationPage=t.value;this.initialLoad=false}handleItemsPerPageChange({detail:t,target:i}){if(i.parentElement!==this.el){this.previousRowsPerPage=this.rowsPerPage;this.rowsPerPage=t.value}this.itemsPerPageChange=true}handleDensityChange(t){this.density=t.detail.value}clickListener(t){if(t.target!==this.el)this.selectedRow=undefined}loadingHandler(t){if(t)this.startLoadingTimer();if(this.loading){setTimeout((()=>{this.showLoadingIndicator()}),500)}}truncationPatternHandler(t){if(t===this.TOOLTIP_STRING){this.resetShowHideTruncation();this.updateTruncationTooltip(true);this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}))}if(t===this.SHOW_HIDE_STRING){this.updateTruncationTooltip(true);this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}setTimeout((()=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}),150)}))}this.truncationPatternUpdated=true}async dataHandler(t){var i;this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:(t===null||t===void 0?void 0:t.length)>0||!!((i=this.loadingOptions)===null||i===void 0?void 0:i.overlay)});if(this.loading){!this.hasLoadedForOneSecond?setTimeout((()=>this.loading=false),this.minimumLoadingDisplayDuration-(Date.now()-this.timerStarted)):this.loading=false}if(this.updating)this.updating=false;this.dataUpdated=true}async densityHandler(){this.densityUpdate=true}resetShowHideTruncation(t){if(t){const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((i===null||i===void 0?void 0:i.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)&&!a(t.getAttribute("max-lines"))&&Math.floor((e===null||e===void 0?void 0:e.clientHeight)/this.DEFAULT_LINE_HEIGHT)!==+t.getAttribute("max-lines")){t.checkMaxLines(i.scrollHeight);t.setAttribute("max-lines",`${Math.floor((e===null||e===void 0?void 0:e.clientHeight)/this.DEFAULT_LINE_HEIGHT)}`);t.setShowHideExpanded(false);e.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,null)}else if(!e.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)){t.resetTruncation().then((()=>{if(!t.closest(this.TEXT_WRAP_CLASS)){e.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,e.getAttribute(this.DATA_ROW_HEIGHT_STRING))}}))}}else{this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);t.resetTruncation().then((()=>{if(!t.closest(this.TEXT_WRAP_CLASS)){i.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,i.getAttribute(this.DATA_ROW_HEIGHT_STRING))}}))}))}}rowHeightChangeHandler(t,i){if(+t!==+i){this.deleteTextWrapDataKey(this.data);this.deleteTextWrapDataKey(this.columns);this.removeTextWrap();this.icRowHeightChange.emit();this.rowHeightSet=true}}async resetRowHeights(t){this.globalRowHeight=t||"auto";this.variableRowHeight=null}showLoadingIndicator(){var t,i,e;if((t=this.loadingOptions)===null||t===void 0?void 0:t.overlay){(i=this.loadingOverlay)===null||i===void 0?void 0:i.classList.add("show")}(e=this.loadingIndicator)===null||e===void 0?void 0:e.classList.add("show")}getRowOptions(t,i){const e=t.indexOf("rowOptions");return e>-1&&i[e]}regenerateTooltip(t,i,e,s){if(e){if(this.tableSorted){e.setAttribute("target",i.id);e.setAttribute("label",i.textContent)}else{this.removeTooltip(t,i,e)}if(s){return}}if(!i.getAttribute("style")&&this.dataUpdated){this.addLineClampCSS(i,t)}if((i===null||i===void 0?void 0:i.scrollHeight)>(t===null||t===void 0?void 0:t.clientHeight)&&this.truncationPattern===this.TOOLTIP_STRING){if(!i.getAttribute("style")||i.style.cssText.includes(`${this.LINE_CLAMP_CSS_VARIABLE}: 0;`)){this.addLineClampCSS(i,t)}if(!t.querySelector(this.IC_TOOLTIP_STRING))this.createTruncationTooltip(i,t)}}removeTooltip(t,i,e){const s=t.querySelector(this.CELL_TEXT_WRAPPER_STRING);s.prepend(i);if(e){e.remove()}}addLineClampCSS(t,i){var e,s;const n=(e=i.querySelector(this.CELL_DESCRIPTION_STRING))===null||e===void 0?void 0:e.clientHeight;if(i.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)&&(i===null||i===void 0?void 0:i.clientHeight)>n){let e;if(c(p.XS)){const t=i===null||i===void 0?void 0:i.querySelector(".icon");e=t?t.clientHeight:0}else{e=0}const n=(i===null||i===void 0?void 0:i.clientHeight)-((s=i.querySelector(this.CELL_DESCRIPTION_STRING))===null||s===void 0?void 0:s.clientHeight)-e;t.setAttribute("style",`${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(n||0)}`)}else{t.setAttribute("style",`${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(i===null||i===void 0?void 0:i.clientHeight)}`)}}createTruncationTooltip(t,i){const e=document.createElement(this.IC_TOOLTIP_STRING);e.setAttribute("target",t.id);e.setAttribute("label",t.textContent);e.classList.add("ic-tooltip-overflow");e.setExternalPopperProps({strategy:"fixed"});const s=i.querySelector(this.CELL_TEXT_WRAPPER_STRING);s.prepend(e);e.prepend(t)}render(){var t,i;const{caption:s,createColumnHeaders:o,createUpdatingIndicator:l,data:a,hideColumnHeaders:h,loading:d,loadingOptions:c,paginationBarOptions:u,scrollable:v,scrollOffset:p,showPagination:g,sortable:f,sortedColumn:m,sortedColumnOrder:b,stickyColumnHeaders:w,updateScrollOffset:y,updating:x}=this;return e(n,{style:Object.assign({},this.setTableDimensions())},e("div",{class:"table-container"},r(this.el,"title-bar")&&e("slot",{name:"title-bar"}),e("div",{class:{["table-row-container"]:true,scrollable:v},tabIndex:v?0:null,onScroll:y},r(this.el,"title-bar")&&e("slot",{name:"title-bar"}),e("table",{style:{["--table-layout"]:this.tableLayout}},e("caption",{class:"table-caption"},s),!h&&e("thead",{class:{["column-header-sticky"]:w,["column-header-overlay"]:w&&p!==0}},e("tr",null,o())),x&&!d&&(h?e("thead",null,l()):l()),this.renderTableBody(a,d,c.overlay)),this.renderEmptyState(a,d,c.overlay)),e("div",{"aria-live":"assertive",class:"sr-only"},this.renderAriaLiveLoading()),this.renderLoadingIndicator(d,c),(g||r(this.el,"pagination-bar"))&&e("div",{class:"pagination-container"},r(this.el,"pagination-bar")?e("slot",{name:"pagination-bar"}):e("ic-pagination-bar",{alignment:u.alignment,appearance:u.appearance,hideAllFromItemsPerPage:u.hideAllFromItemsPerPage,hideRangeLabel:u.hideRangeLabel,itemLabel:u.itemLabel,itemsPerPageOptions:u.itemsPerPageOptions,pageLabel:u.pageLabel,rangeLabelType:u.rangeLabelType,selectedItemsPerPage:u.selectedItemsPerPage,setToFirstPageOnPaginationChange:u.setToFirstPageOnPaginationChange,showGoToPageControl:u.showGoToPageControl,showItemsPerPageControl:u.showItemsPerPageControl,totalItems:(t=a===null||a===void 0?void 0:a.length)!==null&&t!==void 0?t:0,type:u.type})),f&&e("div",{class:"screen-reader-sort-text","aria-live":"polite"},b!=="unsorted"&&m?`${((i=this.columns.find((t=>t.key===m)))===null||i===void 0?void 0:i.title)||m} sorted ${b}`:"table unsorted")))}get el(){return o(this)}static get watchers(){return{columnHeaderTruncation:["headerTruncationChangeHandler"],loading:["loadingHandler"],truncationPattern:["truncationPatternHandler"],data:["dataHandler"],density:["densityHandler"],globalRowHeight:["rowHeightChangeHandler"],variableRowHeight:["rowHeightChangeHandler"]}}};w.style=b;export{w as ic_data_table};
         
     | 
| 
      
 2 
     | 
    
         
            +
            //# sourceMappingURL=p-4a89994a.entry.js.map
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {"version":3,"names":["icDataTableCss","DataTable","this","DENSITY_HEIGHT_MULTIPLIER","dense","default","spacious","DENSITY_PADDING_HEIGHT_DIFF","SORT_ICONS","unsorted","unsortedIcon","ascending","ascendingIcon","descending","descendingIcon","hasLoadedForOneSecond","resizeObserver","SHOW_HIDE_STRING","SHOW_HIDE_CSS_CLASS","TOOLTIP_STRING","TOOLTIP","TEXT_WRAP_STRING","TEXT_WRAP_CLASS","dataUpdated","rowHeightSet","initialLoad","icPageChangeEvent","itemsPerPageChange","DATA_ROW_HEIGHT_STRING","ROW_HEIGHT_CSS_VARIABLE","LINE_CLAMP_CSS_VARIABLE","DEFAULT_LINE_HEIGHT","densityUpdate","truncationPatternUpdated","isNewDebounceDelaySet","headerResizeObserver","IC_TOOLTIP_STRING","SHOW_TRUNC_TOOLTIP_STRING","CELL_DESCRIPTION_STRING","CELL_CONTAINER_WITH_DESCRIPTION_STRING","CELL_TEXT_WRAPPER_STRING","IC_TYPOGRAPHY_STRING","runHeaderResizeObserver","ResizeObserver","headerResizeCallback","observe","el","hideColumnHeaders","columnHeaderTruncation","tableContainerWidth","shadowRoot","querySelector","clientWidth","prevTableContainerWidth","headers","querySelectorAll","forEach","header","tooltip","typographyEls","length","classList","remove","add","updateSetRowHeight","typographyEl","fontSize","parseInt","getComputedStyle","document","documentElement","cellContainer","getCellContainer","rowHeight","parseFloat","getAttribute","scrollHeight","style","removeProperty","getTypographyElements","debounceDataTruncation","contains","dynamicDebounce","dataTruncation","setNewDebounceDelay","debounceDelay","delay","getLines","height","Math","floor","truncate","clientHeight","closest","truncationPattern","addTooltipTruncation","addShowHideTruncation","setAttribute","cellTextWrapper","prepend","isEmptyString","resetShowHideTruncation","getTooltip","showHideBtn","truncWrapper","getTruncWrapper","removeTooltip","removeTextWrap","tableCell","deleteTextWrapDataKey","array","Array","isArray","val","textWrap","startLoadingTimer","timerStarted","Date","now","setTimeout","minimumLoadingDisplayDuration","isObject","value","undefined","notDefaultDensity","density","getCellContent","cell","dataType","toLocaleDateString","getCellAlignment","alignment","Object","keys","includes","getObjectValue","getCellOptions","key","createUpdatingIndicator","appearance","description","max","min","progress","updatingOptions","h","colSpan","columns","class","fullWidth","type","size","setRowHeight","pxToRem","setTruncationClass","getColumnWidth","columnWidth","columnWidthStyling","assign","minWidth","maxWidth","getRowHeight","currentRowHeight","columnProps","rowTextWrap","adjustWidthForActionElement","elements","_a","actionElementSpan","width","actionElement","firstChild","tagName","toLowerCase","slottedActionElement","getSlottedActionElement","getBoundingClientRect","gridWrapper","gridTemplateColumns","createCellContent","cellSlotName","rowOptions","rowAlignment","hasIcon","cellValue","rowEmphasis","innerHTML","isSlotUsed","columnAlignment","vertical","_b","_c","_d","_e","horizontal","_f","_g","_h","_j","icon","name","Fragment","_k","onAllCells","_l","_m","variant","emphasis","href","target","rel","_o","_q","_p","data","createCells","row","rowIndex","rowValues","values","rowKeys","getRowOptions","headerIndex","indexOf","variableRowHeightVal","variableRowHeight","call","index","globalRowHeight","map","CellContent","scope","stickyRowHeaders","onClick","actionOnClick","event","handleClick","createColumnHeaders","cellAlignment","colspan","title","excludeColumnFromSort","updating","loading","hideOnHeader","label","id","sortable","getSortButtonLabel","sortRows","sortedColumn","sortedColumnOrder","onRowClick","icSelectedRowChange","emit","selectedRow","createRows","showPagination","slice","fromRow","toRow","paginationOffset","organisedData","slottedColumns","filter","col","prototype","hasOwnProperty","addDataToPosition","sort","disableAutoSort","getSortFunction","highlightSelectedRow","slotName","getNextSortOption","option","sortOrders","sortOptions","sortOption","getComparison","targetRow","comparisonRow","targetRowValue","comparisonRowValue","find","valueOf","String","localeCompare","numeric","sensitivity","a","b","column","sortButton","previousSortedButton","nextSortOrderIndex","tableSorted","icSortChange","columnName","sorted","from","updateTruncationTooltip","removeTooltipOnly","regenerateTooltip","updateScrollOffset","scrollOffset","scrollTop","updateRowHeightForDescriptions","toString","updateCellHeightsWithDescriptions","descriptions","typography","descriptionMarginTop","window","getPropertyValue","descriptionHeight","textContent","cellIcon","deviceSizeMatches","IC_DEVICE_SIZES","XS","addLineClampCSS","createShowHideTruncation","setTableDimensions","tableHostDimensions","fixCellTooltip","element","tooltipEl","setExternalPopperProps","strategy","fixCellTooltips","slotElements","getSlotElements","slottedEl","callback","renderTableBody","overlay","renderLoadingIndicator","isLoading","loadingOptions","ref","loadingOverlay","showBackground","labelDuration","loadingIndicator","renderAriaLiveLoading","renderEmptyState","emptyStateEl","aligned","heading","hideAllFromItemsPerPage","hideRangeLabel","itemLabel","itemsPerPageOptions","pageLabel","rangeLabelType","selectedItemsPerPage","setToFirstPageOnPaginationChange","showGoToPageControl","showItemsPerPageControl","defaultColumn","headerTruncationChangeHandler","disconnectedCallback","disconnect","componentWillLoad","rowsPerPage","Number","paginationBarOptions","previousRowsPerPage","previousItemsPerPage","componentDidLoad","tableElement","tableContainer","checkResizeObserver","scrollable","showLoadingIndicator","addEventListener","componentDidUpdate","truncateUpdatedData","componentDidRender","resetTruncation","then","removeAttribute","hasAutoRowHeight","setProperty","allRows","newRows","checkMaxLines","setShowHideExpanded","createTruncationTooltip","handleTypographyTruncationExpandToggle","detail","expanded","handlePageChange","parentElement","tableRowsContainer","previousPaginationPage","handleItemsPerPageChange","handleDensityChange","ev","clickListener","loadingHandler","newValue","truncationPatternHandler","dataHandler","newData","densityHandler","rowHeightChangeHandler","oldValue","icRowHeightChange","resetRowHeights","rowOptionsIndex","cssText","descriptionCellHeight","iconHeight","createElement","render","caption","stickyColumnHeaders","Host","tabIndex","onScroll","tableLayout","totalItems"],"sources":["src/components/ic-data-table/ic-data-table.css?tag=ic-data-table&encapsulation=shadow","src/components/ic-data-table/ic-data-table.tsx"],"sourcesContent":[":host {\n  position: relative;\n  display: inline-flex;\n  max-height: 100%;\n  width: var(--table-width, 100%);\n  height: 100%;\n  min-width: var(--table-min-width);\n  max-width: var(--table-max-width);\n}\n\ntbody {\n  vertical-align: top;\n}\n\n.table-container {\n  position: relative;\n  height: calc(100% - var(--ic-space-xxxs));\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n}\n\n.cell-container {\n  display: flex;\n  min-height: 1.5rem;\n  overflow-y: hidden;\n  height: var(--row-height);\n}\n\n.truncation-show-hide {\n  display: block;\n}\n\n.cell-icon.truncation-show-hide {\n  display: flex;\n}\n\n.cell-container:not(.data-type-element, .truncation-show-hide) {\n  overflow-x: hidden;\n}\n\nic-loading-indicator {\n  position: sticky;\n  top: 20px;\n}\n\n.table-row-container {\n  position: relative;\n  height: 100%;\n  overflow: auto;\n  transition: var(--ic-easing-transition-fast);\n  overflow-anchor: none;\n}\n\n:host([show-pagination=\"true\"]) .table-row-container {\n  height: calc(100% - 3.5625rem);\n}\n\ntable {\n  table-layout: var(--table-layout, \"fixed\");\n  border-spacing: 0;\n  width: 100%;\n  height: var(--table-height, auto);\n}\n\n.table-row-container:focus {\n  outline: none;\n  box-shadow: var(--ic-border-focus);\n  border-radius: var(--ic-border-radius);\n  transition: var(--ic-easing-transition-fast);\n  z-index: 1;\n}\n\n:host([embedded=\"true\"]) .table-row-container {\n  border: var(--ic-border-light);\n}\n\n.column-header-inner-container {\n  padding: var(--ic-space-xs);\n  box-sizing: border-box;\n}\n\n.column-header-inner-container ic-tooltip {\n  pointer-events: none;\n}\n\n.column-header-inner-container ic-tooltip.show-trunc-tooltip {\n  pointer-events: auto;\n}\n\n.column-header-inner-container ic-tooltip .column-header-text {\n  --ic-line-clamp: 1;\n}\n\n.column-header-sticky {\n  position: sticky;\n  top: 0;\n  z-index: 1;\n}\n\n.column-header-overlay {\n  position: sticky;\n  top: 0;\n  z-index: 1;\n  box-shadow: 0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n    rgb(0 0 0 / 20%);\n}\n\n.row-header-sticky {\n  position: sticky;\n  left: 0;\n}\n\n.column-header,\n.table-row {\n  box-sizing: border-box;\n}\n\n.table-row-selected {\n  background-color: var(--ic-table-row-selected) !important;\n}\n\n.sort-button {\n  margin-left: auto;\n}\n\n.sort-button:hover {\n  background-color: var(--ic-action-dark-bg-hover);\n}\n\n.sort-button:active {\n  background-color: var(--ic-action-dark-bg-active);\n}\n\n.sort-button svg {\n  color: var(--ic-architectural-black);\n}\n\n.sort-button-unsorted svg {\n  color: var(--ic-color-tertiary-text);\n}\n\n.table-density-dense .column-header-inner-container,\ntd.table-density-dense {\n  padding: var(--ic-space-xxs) var(--ic-space-xs) !important;\n}\n\n.text-dense {\n  font-size: var(--ic-font-size-label);\n}\n\n.table-density-spacious .column-header-inner-container,\ntd.table-density-spacious {\n  padding: 0.625rem var(--ic-space-xs) !important;\n}\n\n.text-spacious {\n  font-size: 1.125rem;\n}\n\n.column-header-text {\n  font-weight: var(--ic-font-weight-bold);\n}\n\n.dummy-column-header-text {\n  white-space: nowrap;\n  overflow: hidden;\n  height: 0;\n  width: fit-content;\n}\n\n.row-header,\n.column-header {\n  text-align: left;\n  padding: var(--ic-space-xs);\n  background-color: var(--ic-architectural-40);\n  border-right: var(--ic-border-light);\n  border-bottom: var(--ic-border-light);\n}\n\n.column-header {\n  padding: 0;\n  width: var(--column-width);\n  min-width: var(--column-min-width, 4rem);\n  max-width: var(--column-max-width);\n}\n\n.column-header:last-child {\n  border-right: none;\n}\n\n.scrollable .column-header:last-child {\n  border-right: var(--ic-border-light) !important;\n}\n\n:host([embedded=\"true\"]) tr:last-child .table-cell,\n:host([embedded=\"true\"]) tr:last-child .row-header {\n  border-bottom: none;\n}\n\n.column-header-alignment-left,\n.row-header-alignment-left,\n.cell-alignment-left {\n  text-align: left !important;\n  justify-content: start !important;\n}\n\n.column-header-alignment-right,\n.row-header-alignment-right,\n.cell-alignment-right {\n  text-align: right !important;\n  justify-content: end !important;\n}\n\n.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography {\n  padding-right: calc(var(--ic-space-xxs) + var(--ic-space-xs));\n}\n\n.cell-alignment-right.truncation-show-hide ic-typography {\n  --ellipsis-padding-right: calc(var(--ic-space-xxs) + var(--ic-space-xs));\n}\n\n.column-header-alignment-center,\n.row-header-alignment-center,\n.cell-alignment-center {\n  text-align: center !important;\n  justify-content: center !important;\n}\n\n.table-row:nth-child(even) {\n  background-color: var(--ic-architectural-20);\n}\n\n.table-cell {\n  padding: var(--ic-space-xs);\n  border-bottom: solid var(--ic-architectural-100) var(--ic-space-1px);\n  overflow: hidden;\n  box-sizing: border-box;\n  max-width: var(--column-max-width);\n  min-width: var(--column-min-width);\n}\n\n.table-cell.with-overflow {\n  overflow: visible;\n}\n\n.data-type-string,\n.data-type-address {\n  text-align: left;\n  vertical-align: top;\n}\n\n.data-type-number,\n.data-type-date {\n  text-align: right;\n  justify-content: end;\n  vertical-align: top;\n}\n\n.cell-alignment-top {\n  vertical-align: top;\n  align-items: flex-start;\n}\n\n.cell-alignment-middle {\n  vertical-align: middle;\n  align-items: center;\n}\n\n.cell-alignment-bottom {\n  vertical-align: bottom;\n  align-items: flex-end;\n}\n\n.cell-emphasis-low {\n  color: var(--ic-color-secondary-text);\n}\n\n.cell-emphasis-high {\n  font-weight: var(--ic-font-weight-bold);\n}\n\n.pagination-container {\n  background-color: var(--ic-architectural-40);\n  border-top: var(--ic-border-light);\n}\n\n.screen-reader-sort-text,\n.table-caption {\n  position: absolute;\n  left: -100rem;\n}\n\n.table-cell,\n.column-header,\n.row-header {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n}\n\n.loading-empty {\n  padding: var(--ic-space-xl) var(--ic-space-xxl);\n  margin-top: var(--ic-space-xl);\n}\n\n.updating-state {\n  padding: 0;\n  border-bottom: var(--ic-border-light);\n}\n\n.updating-state-headers {\n  border-bottom: none;\n}\n\n.loading {\n  position: absolute;\n  left: calc(50% - 5.9741rem);\n  opacity: 0;\n  transition: opacity var(--ic-transition-duration-slow);\n  z-index: calc(var(--ic-z-index-dialog) - 1);\n}\n\n.loading.show-background {\n  background-color: var(--ic-architectural-white);\n  border: var(--ic-border-light);\n}\n\n.loading.show {\n  opacity: 1;\n}\n\n.icon,\n::slotted(svg) {\n  height: var(--ic-space-lg);\n  width: var(--ic-space-lg);\n  margin-right: var(--ic-space-xxs);\n}\n\n.column-header-alignment-right > .icon,\n.row-header-alignment-right > .icon,\n.cell-alignment-right > .icon,\n.column-header-alignment-right > ::slotted(svg),\n.row-header-alignment-right > ::slotted(svg),\n.cell-alignment-right > ::slotted(svg) {\n  margin-right: auto;\n}\n\n.column-header-alignment-center > ic-typography,\n.column-header-alignment-center > .cell-text-wrapper,\n.row-header-alignment-right > ic-typography,\n.row-header-alignment-right > .cell-text-wrapper,\n.cell-alignment-center > ic-typography,\n.cell-alignment-center > .cell-text-wrapper {\n  flex: 1;\n}\n\n.icon > svg {\n  height: var(--ic-space-lg);\n  width: var(--ic-space-lg);\n  display: inline-block;\n}\n\n.truncation-tooltip ic-typography {\n  display: -webkit-box;\n  -webkit-line-clamp: var(--ic-line-clamp, 0);\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n.truncation-tooltip ic-typography,\n.truncation-show-hide ic-typography {\n  white-space: normal;\n}\n\n.ic-tooltip-overflow {\n  overflow: hidden;\n  width: 100%;\n}\n\n.action-element {\n  display: flex;\n  justify-content: right;\n}\n\n.cell-grid-wrapper {\n  display: grid;\n  grid-template-columns: auto auto;\n}\n\n.loading-overlay {\n  visibility: hidden;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  background: var(--ic-architectural-black);\n  z-index: calc(var(--ic-z-index-dialog) - 2);\n  opacity: 0;\n  transition: opacity var(--ic-transition-duration-slow);\n}\n\n.loading-overlay.show {\n  visibility: visible;\n  opacity: 0.6;\n}\n\n.sr-only {\n  position: absolute;\n  left: -9999px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .loading-overlay {\n    transition: none;\n  }\n}\n\n.cell-text-wrapper {\n  overflow: hidden;\n}\n\n.cell-text-wrapper > ic-typography {\n  margin-left: 2px;\n}\n\n.cell-text-no-wrap {\n  word-wrap: initial;\n}\n\n.cell-container-with-description {\n  display: flex;\n  flex-direction: row;\n}\n\n.cell-description {\n  display: flex;\n  flex-direction: row;\n  margin-top: var(--ic-space-xxs);\n  word-break: break-all;\n}\n\n.cell-description-text {\n  color: var(--ic-color-secondary-text);\n}\n\n.cell-description-icon {\n  padding-right: var(--ic-space-xs);\n}\n\n.cell-description-icon > svg {\n  height: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n  width: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n  display: flex;\n}\n\n@media (min-width: 577px) {\n  .column-header-inner-container {\n    display: flex;\n    align-items: center;\n  }\n}\n\n@media (max-width: 577px) {\n  .cell-icon {\n    flex-wrap: wrap;\n  }\n\n  .cell-description-icon {\n    padding-right: 0;\n  }\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n  .icon,\n  ::slotted(svg),\n  .cell-description-icon > svg {\n    fill: currentcolor;\n  }\n\n  .sort-button svg {\n    color: currentcolor;\n  }\n\n  .table-row-selected {\n    background-color: Highlight !important;\n  }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n  Component,\n  Element,\n  h,\n  Prop,\n  State,\n  Listen,\n  Watch,\n  Fragment,\n  Method,\n  Event,\n  EventEmitter,\n  Host,\n} from \"@stencil/core\";\nimport unsortedIcon from \"./assets/unsorted-icon.svg\";\nimport ascendingIcon from \"./assets/ascending-icon.svg\";\nimport descendingIcon from \"./assets/descending-icon.svg\";\nimport {\n  IcDataTableDataType,\n  IcDataTableColumnDataTypes,\n  IcDataTableColumnObject,\n  IcDataTableColumnWidthTypes,\n  IcDataTableDensityOptions,\n  IcDataTableRowHeights,\n  IcDataTableSortOrderOptions,\n  IcDataTableTruncationTypes,\n  IcDensityUpdateEventDetail,\n  IcSortEventDetail,\n  IcLoadingOptions,\n} from \"./ic-data-table.types\";\nimport { IcThemeForegroundNoDefault } from \"@ukic/web-components/dist/types/utils/types\";\nimport { IcPaginationBarOptions } from \"../../utils/types\";\n// Unable to import helper functions via @ukic/web-components\nimport {\n  isEmptyString,\n  isSlotUsed,\n  pxToRem,\n  addDataToPosition,\n  dynamicDebounce,\n  getSlotElements,\n  checkResizeObserver,\n  deviceSizeMatches,\n} from \"../../utils/helpers\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\n\n/**\n * @slot empty-state - Content is slotted below the table header when there is no data and the table is not loading.\n * @slot {COLUMN_KEY}-{ROW_INDEX}[-icon] - Each cell should have its own slot, named using the column tag and the row index, allowing for custom elements to be displayed. Include `-icon` at the end for that cell's icon slot.\n * @slot {COLUMN_KEY}-column-icon - The icon slot for a column header.\n * @slot title-bar - A custom ic-data-table-title-bar can be slotted above the column headers to display additional information about the table.\n * @slot pagination-bar - A custom ic-pagination-bar can be slotted below the data to provide enhanced control over how the data is interacted with when being fetched externally.\n */\n@Component({\n  tag: \"ic-data-table\",\n  styleUrl: \"ic-data-table.css\",\n  shadow: true,\n})\nexport class DataTable {\n  private DENSITY_HEIGHT_MULTIPLIER = {\n    dense: 0.8,\n    default: 1,\n    spacious: 1.2,\n  };\n\n  private DENSITY_PADDING_HEIGHT_DIFF = {\n    dense: 8,\n    default: 16,\n    spacious: 20,\n  };\n\n  private SORT_ICONS = {\n    unsorted: unsortedIcon,\n    ascending: ascendingIcon,\n    descending: descendingIcon,\n  };\n\n  private hasLoadedForOneSecond = true;\n  private loadingIndicator: HTMLIcLoadingIndicatorElement;\n  private loadingOverlay: HTMLDivElement;\n  private timerStarted: number;\n  private resizeObserver: ResizeObserver = null;\n  private SHOW_HIDE_STRING = \"show-hide\";\n  private SHOW_HIDE_CSS_CLASS = `${this.SHOW_HIDE_STRING}-wrap`;\n  private TOOLTIP_STRING = \"tooltip\";\n  private TOOLTIP = `ic-${this.TOOLTIP_STRING}`;\n  private TEXT_WRAP_STRING = \"text-wrap\";\n  private TEXT_WRAP_CLASS = `.${this.TEXT_WRAP_STRING}`;\n  private dataUpdated = false;\n  private tableSorted: boolean;\n  private rowHeightSet = false;\n  private initialLoad = false;\n  private icPageChangeEvent = false;\n  private itemsPerPageChange = false;\n  private DATA_ROW_HEIGHT_STRING = \"data-row-height\";\n  private ROW_HEIGHT_CSS_VARIABLE = \"--row-height\";\n  private LINE_CLAMP_CSS_VARIABLE = \"--ic-line-clamp\";\n  private previousItemsPerPage: number;\n  private DEFAULT_LINE_HEIGHT = 24;\n  private densityUpdate = false;\n  private previousPaginationPage: number;\n  private truncationPatternUpdated: boolean = false;\n  private isNewDebounceDelaySet = false;\n  private headerResizeObserver: ResizeObserver = null;\n  private prevTableContainerWidth: number;\n  private IC_TOOLTIP_STRING = \"ic-tooltip\";\n  private SHOW_TRUNC_TOOLTIP_STRING = \"show-trunc-tooltip\";\n  private CELL_DESCRIPTION_STRING = \".cell-description\";\n  private CELL_CONTAINER_WITH_DESCRIPTION_STRING =\n    \"cell-container-with-description\";\n  private CELL_TEXT_WRAPPER_STRING = \".cell-text-wrapper\";\n  private IC_TYPOGRAPHY_STRING = \"ic-typography\";\n\n  @Element() el: HTMLIcDataTableElement;\n\n  @State() fromRow: number = 0;\n\n  @State() previousRowsPerPage: number;\n\n  @State() rowsPerPage: number;\n\n  @State() scrollable: boolean = false;\n\n  @State() scrollOffset: number = 0;\n\n  @State() selectedRow: object;\n\n  @State() sortedColumn: string;\n\n  @State() sortedColumnOrder: IcDataTableSortOrderOptions;\n\n  @State() toRow: number;\n\n  @State() currentRowHeight: number;\n\n  @State() debounceDelay = 0;\n\n  /**\n   * The title for the table only visible to screen readers.\n   */\n  @Prop() caption!: string;\n\n  /**\n   * Determines whether the column header should be truncated and display a tooltip. Default is `false`.\n   */\n  @Prop() columnHeaderTruncation: boolean = false;\n\n  @Watch(\"columnHeaderTruncation\")\n  headerTruncationChangeHandler(): void {\n    if (this.columnHeaderTruncation) {\n      this.prevTableContainerWidth = 0;\n    } else {\n      const headers = this.el.shadowRoot.querySelectorAll(\"th.column-header\");\n      headers.forEach((header) => {\n        const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);\n        if (tooltip) {\n          tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);\n        }\n      });\n    }\n  }\n\n  /**\n   * The column headers for the table.\n   */\n  @Prop() columns!: IcDataTableColumnObject[];\n\n  /**\n   * The row content for the table.\n   */\n  @Prop() data?: IcDataTableDataType[];\n\n  /**\n   * If `true`, the built in sort functionality will be disabled. For example, if rows will already be sorted from an external source.\n   */\n  @Prop() disableAutoSort?: boolean = false;\n\n  /**\n   * Set the density of the table including font and padding.\n   */\n  @Prop({ mutable: true }) density?: IcDataTableDensityOptions = \"default\";\n\n  /**\n   * Applies a border to the table container.\n   */\n  @Prop() embedded?: boolean = false;\n\n  /**\n   * Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method.\n   */\n  @Prop({ mutable: true }) globalRowHeight?: IcDataTableRowHeights = \"auto\";\n\n  /**\n   * Sets the table height. Can be set to `auto` or a specific value in `px`, `rem`, or `%`.\n   */\n  @Prop() height?: string;\n\n  /**\n   * If `true`, the selected row is highlighted using a background colour.\n   */\n  @Prop() highlightSelectedRow?: boolean = true;\n\n  /**\n   * If `true`, column headers will not be visible.\n   */\n  @Prop() hideColumnHeaders?: boolean = false;\n\n  /**\n   * When set to `true`, the full table will show a loading state, featuring a radial indicator.\n   */\n  @Prop({ mutable: true }) loading?: boolean = false;\n\n  /**\n   * Sets the props for the circular loading indicator used in the loading state.\n   */\n  @Prop() loadingOptions?: {\n    appearance?: IcThemeForegroundNoDefault;\n    description?: string;\n    label?: string;\n    labelDuration?: number;\n    max?: number;\n    min?: number;\n    progress?: number;\n    showBackground?: boolean;\n    overlay?: boolean;\n  };\n\n  /**\n   * Sets the maximum width of the data table. Can be set in `px`, `rem`, or `%`.\n   */\n  @Prop() maxWidth?: string;\n\n  /**\n   * Sets the minimum width of the data table. Can be set in `px`, `rem`, or `%`.\n   */\n  @Prop() minWidth?: string;\n\n  /**\n   * The minimum amount of time the `loading` state displays for before showing the data. Used to prevent flashing in the component.\n   */\n  @Prop() minimumLoadingDisplayDuration?: number = 1000;\n\n  /**\n   * Sets the props for the built-in pagination bar. If the `pagination-bar` slot is used then this prop is ignored.\n   */\n  @Prop() paginationBarOptions?: IcPaginationBarOptions = {\n    alignment: \"right\",\n    appearance: \"default\",\n    hideAllFromItemsPerPage: false,\n    hideRangeLabel: false,\n    itemLabel: \"Item\",\n    itemsPerPageOptions: [\n      { label: \"10\", value: \"10\" },\n      { label: \"25\", value: \"25\" },\n      { label: \"50\", value: \"50\" },\n    ],\n    pageLabel: \"Page\",\n    rangeLabelType: \"page\",\n    selectedItemsPerPage: 10,\n    setToFirstPageOnPaginationChange: false,\n    showGoToPageControl: true,\n    showItemsPerPageControl: true,\n    type: \"simple\",\n  };\n\n  /**\n   * If `true`, adds a pagination bar to the bottom of the table.\n   */\n  @Prop() showPagination?: boolean = false;\n\n  /**\n   * If `true`, allows table columns to be sorted using applied sort buttons.\n   */\n  @Prop() sortable?: boolean = false;\n\n  /**\n   * Sets the order columns will be sorted in and allows for 'default' sorts to be added.\n   */\n  @Prop() sortOptions?: {\n    sortOrders: IcDataTableSortOrderOptions[];\n    defaultColumn?: string;\n  } = {\n    sortOrders: [\"unsorted\", \"ascending\", \"descending\"],\n    defaultColumn: \"\",\n  };\n\n  /**\n   * If `true`, column headers will remain at the top of the table when scrolling vertically.\n   */\n  @Prop() stickyColumnHeaders?: boolean = false;\n\n  /**\n   * If `true`, row headers will remain to the left when scrolling horizontally.\n   */\n  @Prop() stickyRowHeaders?: boolean = false;\n  /**\n   * Sets the layout of the table\n   */\n  @Prop() tableLayout?: \"fixed\" | \"auto\" = \"fixed\";\n\n  /**\n   * Sets the method used to truncate long text in cells where textWrap is `false`. The `tooltip` truncation pattern allows the overflowing text to be seen in a tooltip. The `show-hide` truncation pattern allows the overflowing text to be shown and hidden using the ic-typography \"See more\"/\"See less\" buttons.\n   */\n  @Prop() truncationPattern?: IcDataTableTruncationTypes;\n\n  /**\n   * If `true`, the table displays a linear loading indicator below the header row to indicate an updating state.\n   */\n  @Prop() updating?: boolean = false;\n\n  /**\n   * Sets the props for the linear loading indicator used in the updating state.\n   */\n  @Prop() updatingOptions?: {\n    appearance?: IcThemeForegroundNoDefault;\n    description?: string;\n    max?: number;\n    min?: number;\n    progress?: number;\n  };\n\n  /**\n   * Allows for custom setting of row heights on individual rows based on an individual value from the `data` prop and the row index.\n   * If the function returns `null`, that row's height will be set to the `globalRowHeight` property.\n   */\n  @Prop({ mutable: true }) variableRowHeight?: (params: {\n    [key: string]: any;\n    index: number;\n  }) => IcDataTableRowHeights | null;\n\n  /**\n   * Sets the table width. Can be set to `auto` or a specific value in `px`, `rem`, or `%`.\n   */\n  @Prop() width?: string;\n\n  /**\n   * Emitted when the `globalRowHeight` or `variableRowHeight` properties change in the data table.\n   */\n  @Event() icRowHeightChange: EventEmitter<void>;\n\n  /**\n   * Emitted when the selected row changes in the data table.\n   */\n  @Event() icSelectedRowChange: EventEmitter<object>;\n\n  /**\n   * Emitted when a column sort button is clicked.\n   */\n  @Event() icSortChange: EventEmitter<IcSortEventDetail>;\n\n  disconnectedCallback(): void {\n    this.resizeObserver?.disconnect();\n    this.headerResizeObserver?.disconnect();\n  }\n\n  componentWillLoad(): void {\n    this.rowsPerPage = Number(\n      this.paginationBarOptions.itemsPerPageOptions[0].value\n    );\n    this.previousRowsPerPage = this.rowsPerPage;\n    this.toRow = this.rowsPerPage;\n    this.sortedColumn = this.sortOptions.defaultColumn;\n    this.sortedColumnOrder = this.sortOptions.sortOrders[0];\n    this.loadingOptions = {\n      ...this.loadingOptions,\n      showBackground: this.data?.length > 0 || !!this.loadingOptions?.overlay,\n    };\n    this.initialLoad = true;\n    this.previousItemsPerPage = this.rowsPerPage;\n  }\n\n  componentDidLoad(): void {\n    const tableElement = this.el.shadowRoot.querySelector(\"table\");\n    const tableContainer = this.el.shadowRoot.querySelector(\".table-container\");\n\n    checkResizeObserver(this.runHeaderResizeObserver);\n\n    if (this.dataUpdated) {\n      this.dataUpdated = false;\n    }\n\n    if (\n      tableElement?.clientHeight > tableContainer?.clientHeight ||\n      tableElement?.clientWidth > tableContainer?.clientWidth\n    ) {\n      this.scrollable = true;\n    }\n    if (this.loading) {\n      this.startLoadingTimer();\n      this.showLoadingIndicator();\n    }\n\n    if (this.truncationPattern) {\n      this.getTypographyElements().forEach(\n        (typographyEl: HTMLIcTypographyElement) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n          if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {\n            this.dataTruncation(typographyEl);\n          }\n        }\n      );\n\n      this.debounceDataTruncation();\n    }\n\n    if (this.globalRowHeight !== \"auto\") {\n      this.updateSetRowHeight();\n    }\n    window.addEventListener(\"resize\", this.updateCellHeightsWithDescriptions);\n  }\n\n  componentDidUpdate(): void {\n    // truncation updates invoked here once new/updated data has\n    // rendered to take into account updated .cell-container/ic-typography box model updates.\n    if (\n      this.truncationPattern === this.SHOW_HIDE_STRING ||\n      this.truncationPattern === this.TOOLTIP_STRING\n    ) {\n      this.truncateUpdatedData();\n    }\n  }\n\n  componentDidRender(): void {\n    this.fixCellTooltips();\n    this.updateCellHeightsWithDescriptions();\n    this.adjustWidthForActionElement();\n  }\n\n  private runHeaderResizeObserver = () => {\n    this.headerResizeObserver = new ResizeObserver(() => {\n      this.headerResizeCallback();\n    });\n    this.headerResizeObserver.observe(this.el);\n  };\n\n  private headerResizeCallback = () => {\n    if (!this.hideColumnHeaders && this.columnHeaderTruncation) {\n      const tableContainerWidth =\n        this.el.shadowRoot.querySelector(\".table-container\").clientWidth;\n      if (tableContainerWidth !== this.prevTableContainerWidth) {\n        const headers = this.el.shadowRoot.querySelectorAll(\"th.column-header\");\n        headers.forEach((header) => {\n          const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);\n          const typographyEls = header.querySelectorAll(\n            this.IC_TYPOGRAPHY_STRING\n          );\n          if (tooltip && typographyEls && typographyEls.length === 2) {\n            tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);\n            if (typographyEls[1].clientWidth > typographyEls[0].clientWidth) {\n              tooltip.classList.add(this.SHOW_TRUNC_TOOLTIP_STRING);\n            }\n          }\n        });\n        this.prevTableContainerWidth = tableContainerWidth;\n      }\n    }\n  };\n\n  private truncateUpdatedData() {\n    if (this.dataUpdated) {\n      if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n        this.getTypographyElements().forEach(\n          (typographyEl: HTMLIcTypographyElement) => {\n            const truncWrapper = this.getTruncWrapper(typographyEl);\n            const cellContainer = this.getCellContainer(typographyEl);\n\n            if (\n              cellContainer?.clientHeight - this.DEFAULT_LINE_HEIGHT >=\n              truncWrapper?.scrollHeight\n            ) {\n              this.resetShowHideTruncation(typographyEl);\n              return;\n            }\n\n            setTimeout(() => {\n              // slight delay due to data rendering\n              if (typographyEl?.scrollHeight > cellContainer?.clientHeight) {\n                this.addShowHideTruncation(cellContainer, typographyEl);\n              }\n            }, 150);\n          }\n        );\n      }\n\n      if (this.truncationPattern === this.TOOLTIP_STRING) {\n        this.updateTruncationTooltip();\n      }\n\n      this.dataUpdated = false;\n    }\n\n    if (this.tableSorted) {\n      if (this.truncationPattern === this.TOOLTIP_STRING) {\n        this.updateTruncationTooltip();\n      }\n\n      if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n        this.getTypographyElements().forEach(\n          (typographyEl: HTMLIcTypographyElement) => {\n            const cellContainer = this.getCellContainer(typographyEl);\n\n            if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {\n              this.createShowHideTruncation(typographyEl, cellContainer);\n            } else {\n              typographyEl.resetTruncation().then(() => {\n                cellContainer.removeAttribute(\"style\");\n              });\n            }\n          }\n        );\n      }\n\n      this.tableSorted = false;\n    }\n\n    // This function recalculates the tooltip truncation when the rowHeight has been set.\n    // This is in componentDidUpdate so a setTimeout is not used to wait for the render to be complete\n    if (this.rowHeightSet) {\n      const fontSize = parseInt(\n        getComputedStyle(document.documentElement).fontSize\n      );\n      const hasAutoRowHeight = this.globalRowHeight === \"auto\";\n\n      this.getTypographyElements().forEach(\n        (typographyEl: HTMLIcTypographyElement) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n          const tooltipEl = this.getTooltip(typographyEl);\n\n          if (hasAutoRowHeight) {\n            cellContainer.style.height = null;\n\n            if (this.truncationPattern === this.TOOLTIP_STRING) {\n              this.removeTooltip(cellContainer, typographyEl, tooltipEl);\n              typographyEl.setAttribute(\n                \"style\",\n                `${this.LINE_CLAMP_CSS_VARIABLE}: 0`\n              );\n            } else if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n              this.resetShowHideTruncation(typographyEl);\n            }\n\n            return;\n          }\n\n          const rowHeight =\n            fontSize *\n            parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));\n\n          // If the set row height is bigger than the cell container even\n          // with textWrap, set the row height\n          if (\n            !cellContainer.classList.contains(\n              this.CELL_CONTAINER_WITH_DESCRIPTION_STRING\n            ) &&\n            !cellContainer?.style?.height &&\n            rowHeight > cellContainer.clientHeight &&\n            !cellContainer.classList.contains(this.TEXT_WRAP_STRING)\n          ) {\n            cellContainer.style.setProperty(\n              this.ROW_HEIGHT_CSS_VARIABLE,\n              cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING)\n            );\n          }\n\n          if (this.truncationPattern) {\n            // If the set row height is bigger than the typography truncation wrapper\n            // scroll height, remove see more / see less button\n            if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n              const truncWrapper = this.getTruncWrapper(typographyEl);\n              const showHideBtn =\n                typographyEl.shadowRoot.querySelector(\"button\");\n\n              if (\n                showHideBtn &&\n                truncWrapper?.scrollHeight <= cellContainer.clientHeight\n              ) {\n                this.resetShowHideTruncation(typographyEl);\n                return;\n              }\n            }\n            this.truncate(typographyEl, cellContainer, tooltipEl);\n          } else {\n            this.updateSetRowHeight(typographyEl);\n          }\n        }\n      );\n\n      this.rowHeightSet = false;\n    }\n\n    // Only run truncation on the new rows\n    // when the number of items per page has increased\n    if (this.itemsPerPageChange) {\n      const allRows = this.el.shadowRoot.querySelectorAll(\".table-row\");\n\n      if (this.rowsPerPage > this.previousItemsPerPage) {\n        const newRows = Array.from(allRows).slice(this.previousItemsPerPage);\n\n        newRows.forEach((row) => {\n          row\n            .querySelectorAll(this.IC_TYPOGRAPHY_STRING)\n            .forEach((typographyEl: HTMLIcTypographyElement) => {\n              const cellContainer = this.getCellContainer(typographyEl);\n              const tooltipEl = this.getTooltip(typographyEl);\n\n              this.truncate(typographyEl, cellContainer, tooltipEl);\n            });\n        });\n      }\n\n      this.previousItemsPerPage = this.rowsPerPage;\n      this.itemsPerPageChange = false;\n    }\n\n    if (!this.initialLoad && this.icPageChangeEvent) {\n      if (this.truncationPattern === this.TOOLTIP_STRING) {\n        this.updateTruncationTooltip();\n      }\n\n      // set truncation to see more if opened and next/previous page is pressed\n      if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n        this.getTypographyElements().forEach((typographyEl) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n          const showHideBtn = typographyEl.shadowRoot.querySelector(\"button\");\n\n          if (\n            typographyEl?.scrollHeight > cellContainer.clientHeight &&\n            !showHideBtn\n          ) {\n            this.addShowHideTruncation(cellContainer, typographyEl);\n          }\n        });\n      }\n\n      this.icPageChangeEvent = false;\n    }\n\n    if (this.densityUpdate) {\n      this.getTypographyElements().forEach((typographyEl) => {\n        const cellContainer = this.getCellContainer(typographyEl);\n        const tooltipEl = this.getTooltip(typographyEl);\n\n        this.truncate(typographyEl, cellContainer, tooltipEl);\n      });\n\n      this.densityUpdate = false;\n    }\n\n    if (this.truncationPatternUpdated) {\n      if (this.truncationPattern === this.TOOLTIP_STRING) {\n        this.getTypographyElements().forEach((typographyEl) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n          const tooltipEl = this.getTooltip(typographyEl);\n\n          if (typographyEl.scrollHeight > cellContainer.clientHeight) {\n            this.addTooltipTruncation(typographyEl, cellContainer, tooltipEl);\n          }\n        });\n      } else if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n        this.getTypographyElements().forEach(\n          (typographyEl: HTMLIcTypographyElement) => {\n            const truncWrapper = this.getTruncWrapper(typographyEl);\n            const cellContainer = this.getCellContainer(typographyEl);\n\n            if (\n              cellContainer?.clientHeight - this.DEFAULT_LINE_HEIGHT >\n              truncWrapper?.scrollHeight\n            ) {\n              this.resetShowHideTruncation(typographyEl);\n              return;\n            }\n\n            if (typographyEl?.scrollHeight > cellContainer?.clientHeight) {\n              this.addShowHideTruncation(cellContainer, typographyEl);\n            }\n          }\n        );\n      }\n    }\n  }\n\n  private updateSetRowHeight = (typographyEl?: HTMLIcTypographyElement) => {\n    const fontSize = parseInt(\n      getComputedStyle(document.documentElement).fontSize\n    );\n\n    if (typographyEl) {\n      const cellContainer = this.getCellContainer(typographyEl);\n\n      const rowHeight =\n        fontSize *\n        parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));\n\n      if (typographyEl.scrollHeight > rowHeight) {\n        cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);\n      }\n    } else {\n      this.getTypographyElements().forEach(\n        (typographyEl: HTMLIcTypographyElement) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n\n          const rowHeight =\n            fontSize *\n            parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));\n\n          if (typographyEl.scrollHeight > rowHeight) {\n            cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);\n          }\n        }\n      );\n    }\n  };\n\n  private createShowHideTruncation(\n    typographyEl: HTMLIcTypographyElement,\n    cellContainer: HTMLElement,\n    descriptionHeight?: number\n  ) {\n    typographyEl.checkMaxLines(typographyEl.scrollHeight);\n    typographyEl.setAttribute(\n      \"max-lines\",\n      `${Math.floor(cellContainer?.clientHeight / this.DEFAULT_LINE_HEIGHT)}`\n    );\n    if (\n      cellContainer.classList.contains(\n        this.CELL_CONTAINER_WITH_DESCRIPTION_STRING\n      ) &&\n      descriptionHeight\n    ) {\n      typographyEl.setAttribute(\n        \"max-lines\",\n        `${Math.floor(\n          (cellContainer?.clientHeight - descriptionHeight) /\n            this.DEFAULT_LINE_HEIGHT\n        )}`\n      );\n    } else {\n      typographyEl.setAttribute(\n        \"max-lines\",\n        `${Math.floor(cellContainer?.clientHeight / this.DEFAULT_LINE_HEIGHT)}`\n      );\n    }\n    typographyEl.setShowHideExpanded(false);\n\n    cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);\n  }\n\n  private debounceDataTruncation = () => {\n    this.getTypographyElements().forEach(\n      (typographyEl: HTMLIcTypographyElement) => {\n        const cellContainer = this.getCellContainer(typographyEl);\n        if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {\n          this.resizeObserver = new ResizeObserver(\n            // This gets triggered twice due to updated data and see more/see less button\n            dynamicDebounce(\n              () => {\n                this.dataTruncation(typographyEl);\n\n                if (!this.isNewDebounceDelaySet) {\n                  this.setNewDebounceDelay(200);\n                }\n              },\n              () => this.debounceDelay\n            ) as ResizeObserverCallback\n          );\n\n          this.resizeObserver.observe(typographyEl);\n        }\n      }\n    );\n  };\n\n  private setNewDebounceDelay = (delay: number) => {\n    this.debounceDelay = delay;\n\n    this.isNewDebounceDelaySet = true;\n  };\n\n  private getLines = (height: number): number =>\n    Math.floor(height / this.DEFAULT_LINE_HEIGHT);\n\n  private truncate = (\n    typographyEl: HTMLIcTypographyElement,\n    cellContainer: HTMLElement,\n    tooltip: HTMLIcTooltipElement\n  ) => {\n    if (typographyEl?.scrollHeight > cellContainer?.clientHeight) {\n      //24 is the height of a single line\n      if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {\n        if (this.truncationPattern === this.TOOLTIP_STRING) {\n          this.addTooltipTruncation(typographyEl, cellContainer, tooltip);\n        }\n        if (this.truncationPattern === this.SHOW_HIDE_STRING) {\n          this.addShowHideTruncation(cellContainer, typographyEl);\n        }\n      }\n    } else {\n      if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {\n        typographyEl.setAttribute(\n          \"style\",\n          `${this.LINE_CLAMP_CSS_VARIABLE}: 0`\n        );\n\n        const cellTextWrapper = cellContainer.querySelector(\n          this.CELL_TEXT_WRAPPER_STRING\n        );\n        cellTextWrapper.prepend(typographyEl);\n        tooltip.remove();\n      }\n\n      if (\n        this.truncationPattern === this.SHOW_HIDE_STRING &&\n        !isEmptyString(typographyEl.getAttribute(\"max-lines\"))\n      ) {\n        this.resetShowHideTruncation(typographyEl);\n      }\n    }\n  };\n\n  private addTooltipTruncation(\n    typographyEl: HTMLIcTypographyElement,\n    cellContainer: HTMLElement,\n    tooltip: HTMLIcTooltipElement\n  ) {\n    this.addLineClampCSS(typographyEl, cellContainer);\n\n    if (!tooltip) {\n      this.createTruncationTooltip(typographyEl, cellContainer);\n    }\n  }\n\n  private addShowHideTruncation(\n    cellContainer: HTMLElement,\n    typographyEl: HTMLIcTypographyElement\n  ) {\n    cellContainer.classList.add(this.SHOW_HIDE_CSS_CLASS);\n    this.createShowHideTruncation(typographyEl, cellContainer);\n  }\n\n  private dataTruncation = (typographyEl: HTMLIcTypographyElement) => {\n    // Tooltip truncation mentioned in AC. Will need revisiting\n    const tooltip: HTMLIcTooltipElement = this.getTooltip(typographyEl);\n    const cellContainer = this.getCellContainer(typographyEl);\n    if (\n      cellContainer?.classList.contains(\"data-type-element\") ||\n      this.dataUpdated\n    ) {\n      return;\n    }\n\n    if (\n      this.truncationPattern === this.SHOW_HIDE_STRING &&\n      typographyEl.shadowRoot.querySelector(\"button\")\n    ) {\n      const showHideBtn = typographyEl.shadowRoot.querySelector(\"button\");\n      // If the see more/see less is present and the max lines is equal to the cell container\n      // remove the see more/see less button\n      if (showHideBtn) {\n        const truncWrapper = this.getTruncWrapper(typographyEl);\n\n        if (\n          this.getLines(truncWrapper.scrollHeight) ===\n          +typographyEl.getAttribute(\"max-lines\")\n        ) {\n          this.resetShowHideTruncation(typographyEl);\n        }\n      }\n    }\n\n    // Deals with setting and resetting row height and re-truncating data\n    if (this.rowHeightSet && this.truncationPattern === this.SHOW_HIDE_STRING) {\n      const truncWrapper = this.getTruncWrapper(typographyEl);\n      // cellContainer.clientHeight - 24 removes the extra line by see more/see less\n      if (\n        truncWrapper &&\n        cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >\n          truncWrapper.scrollHeight\n      ) {\n        this.resetShowHideTruncation(typographyEl);\n        return;\n      }\n\n      if (typographyEl.scrollHeight > cellContainer.clientHeight) {\n        this.addShowHideTruncation(cellContainer, typographyEl);\n        return;\n      }\n    }\n\n    if (\n      typographyEl?.scrollHeight > 0 &&\n      cellContainer?.clientHeight > 0 &&\n      typographyEl?.scrollHeight === cellContainer?.clientHeight\n    ) {\n      if (tooltip) {\n        this.removeTooltip(cellContainer, typographyEl, tooltip);\n      }\n      return;\n    }\n\n    this.truncate(typographyEl, cellContainer, tooltip);\n  };\n\n  private getTruncWrapper = (typographyEl: HTMLIcTypographyElement) =>\n    typographyEl.shadowRoot.querySelector(\".trunc-wrapper\");\n\n  // Set the height to initial if row height is set and the show / hide truncation\n  // is clicked\n  @Listen(\"typographyTruncationExpandToggle\")\n  handleTypographyTruncationExpandToggle({\n    detail,\n  }: CustomEvent<{\n    expanded: boolean;\n    typographyEl: HTMLIcTypographyElement;\n  }>): void {\n    const { expanded, typographyEl } = detail;\n    const cellContainer = this.getCellContainer(typographyEl);\n\n    if (\n      cellContainer.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE) &&\n      expanded\n    ) {\n      cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, \"inherit\");\n    }\n  }\n\n  @Listen(\"icPageChange\")\n  handlePageChange({ detail, target }: CustomEvent<{ value: number }>): void {\n    if ((target as HTMLIcPaginationBarElement).parentElement !== this.el) {\n      this.fromRow = (detail.value - 1) * this.rowsPerPage;\n      this.toRow = this.fromRow + this.rowsPerPage;\n      const tableRowsContainer = this.el.shadowRoot.querySelector(\n        \".table-row-container\"\n      );\n      if (this.previousRowsPerPage === this.rowsPerPage) {\n        tableRowsContainer.scrollTop = 0;\n      } else if (this.previousRowsPerPage < this.rowsPerPage) {\n        tableRowsContainer.scrollTop = this.scrollOffset;\n        this.previousRowsPerPage = this.rowsPerPage;\n      } else {\n        this.previousRowsPerPage = this.rowsPerPage;\n      }\n    }\n\n    if (!this.initialLoad && this.previousPaginationPage !== detail.value) {\n      // This is to prevent icPageChange from triggering truncation on first load\n      this.icPageChangeEvent = true;\n    }\n\n    this.previousPaginationPage = detail.value;\n    this.initialLoad = false;\n  }\n\n  @Listen(\"icItemsPerPageChange\")\n  handleItemsPerPageChange({\n    detail,\n    target,\n  }: CustomEvent<{ value: number }>): void {\n    if ((target as HTMLIcPaginationBarElement).parentElement !== this.el) {\n      this.previousRowsPerPage = this.rowsPerPage;\n      this.rowsPerPage = detail.value;\n    }\n\n    this.itemsPerPageChange = true;\n  }\n\n  @Listen(\"icTableDensityUpdate\")\n  handleDensityChange(ev: CustomEvent<IcDensityUpdateEventDetail>): void {\n    this.density = ev.detail.value;\n  }\n\n  @Listen(\"click\", { target: \"window\" })\n  clickListener(ev: MouseEvent): void {\n    if (ev.target !== this.el) this.selectedRow = undefined;\n  }\n\n  @Watch(\"loading\")\n  loadingHandler(newValue: boolean): void {\n    if (newValue) this.startLoadingTimer();\n\n    if (this.loading) {\n      setTimeout(() => {\n        this.showLoadingIndicator();\n      }, 500);\n    }\n  }\n\n  @Watch(\"truncationPattern\")\n  truncationPatternHandler(newValue: IcDataTableTruncationTypes): void {\n    if (newValue === this.TOOLTIP_STRING) {\n      this.resetShowHideTruncation();\n      this.updateTruncationTooltip(true);\n\n      // Not using debounceDataTruncation here due to resizeObserver not being triggered\n      this.getTypographyElements().forEach(\n        (typographyEl: HTMLIcTypographyElement) => {\n          const cellContainer = this.getCellContainer(typographyEl);\n          const tooltip: HTMLIcTooltipElement = this.getTooltip(typographyEl);\n\n          this.truncate(typographyEl, cellContainer, tooltip);\n        }\n      );\n    }\n\n    if (newValue === this.SHOW_HIDE_STRING) {\n      // ResizeObserver is trigger here due to the see more/see less links being removed.\n      // The resizeObserver will also apply the tooltip where relevant\n      this.updateTruncationTooltip(true);\n      this.getTypographyElements().forEach(\n        (typographyEl: HTMLIcTypographyElement) => {\n          const truncWrapper = this.getTruncWrapper(typographyEl);\n          const cellContainer = this.getCellContainer(typographyEl);\n\n          if (\n            cellContainer?.clientHeight - this.DEFAULT_LINE_HEIGHT >\n            truncWrapper?.scrollHeight\n          ) {\n            this.resetShowHideTruncation(typographyEl);\n            return;\n          }\n\n          setTimeout(() => {\n            // slight delay due to data rendering\n            if (typographyEl?.scrollHeight > cellContainer?.clientHeight) {\n              this.addShowHideTruncation(cellContainer, typographyEl);\n            }\n          }, 150);\n        }\n      );\n    }\n\n    this.truncationPatternUpdated = true;\n  }\n\n  @Watch(\"data\")\n  async dataHandler(newData: IcDataTableDataType[]): Promise<void> {\n    this.loadingOptions = {\n      ...this.loadingOptions,\n      showBackground: newData?.length > 0 || !!this.loadingOptions?.overlay,\n    };\n    if (this.loading) {\n      !this.hasLoadedForOneSecond\n        ? setTimeout(\n            () => (this.loading = false),\n            this.minimumLoadingDisplayDuration -\n              (Date.now() - this.timerStarted)\n          )\n        : (this.loading = false);\n    }\n    if (this.updating) this.updating = false;\n\n    this.dataUpdated = true;\n  }\n\n  @Watch(\"density\")\n  async densityHandler(): Promise<void> {\n    this.densityUpdate = true;\n  }\n\n  private removeTextWrap = (): void => {\n    this.getTypographyElements().forEach(\n      (typographyEl: HTMLIcTypographyElement) => {\n        const tableCell = typographyEl.closest(\"td\");\n        if (tableCell.classList.contains(this.TEXT_WRAP_STRING)) {\n          tableCell.classList.remove(this.TEXT_WRAP_STRING);\n        }\n      }\n    );\n  };\n\n  private getCellContainer = (\n    typographyEl: HTMLIcTypographyElement\n  ): HTMLElement => {\n    return typographyEl.closest(\".cell-container\");\n  };\n\n  private deleteTextWrapDataKey = (\n    array: IcDataTableColumnObject[] | object[]\n  ) =>\n    Array.isArray(array) &&\n    array.forEach((val) => val.textWrap && delete val.textWrap);\n\n  private resetShowHideTruncation(typographyEl?: HTMLIcTypographyElement) {\n    if (typographyEl) {\n      const truncWrapper = this.getTruncWrapper(typographyEl);\n      const cellContainer = this.getCellContainer(typographyEl);\n\n      if (\n        truncWrapper?.scrollHeight > cellContainer?.clientHeight &&\n        !isEmptyString(typographyEl.getAttribute(\"max-lines\")) &&\n        Math.floor(cellContainer?.clientHeight / this.DEFAULT_LINE_HEIGHT) !==\n          +typographyEl.getAttribute(\"max-lines\")\n      ) {\n        typographyEl.checkMaxLines(truncWrapper.scrollHeight);\n        typographyEl.setAttribute(\n          \"max-lines\",\n          `${Math.floor(\n            cellContainer?.clientHeight / this.DEFAULT_LINE_HEIGHT\n          )}`\n        );\n        typographyEl.setShowHideExpanded(false);\n\n        cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);\n      } else if (\n        !cellContainer.classList.contains(\n          this.CELL_CONTAINER_WITH_DESCRIPTION_STRING\n        )\n      ) {\n        typographyEl.resetTruncation().then(() => {\n          if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {\n            cellContainer.style.setProperty(\n              this.ROW_HEIGHT_CSS_VARIABLE,\n              cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING)\n            );\n          }\n        });\n      }\n    } else {\n      this.getTypographyElements().forEach((typographyEl) => {\n        const cellContainer = this.getCellContainer(typographyEl);\n\n        typographyEl.resetTruncation().then(() => {\n          if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {\n            cellContainer.style.setProperty(\n              this.ROW_HEIGHT_CSS_VARIABLE,\n              cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING)\n            );\n          }\n        });\n      });\n    }\n  }\n\n  @Watch(\"globalRowHeight\")\n  @Watch(\"variableRowHeight\")\n  rowHeightChangeHandler(newValue: number, oldValue: number): void {\n    if (+newValue !== +oldValue) {\n      this.deleteTextWrapDataKey(this.data);\n      this.deleteTextWrapDataKey(this.columns);\n      this.removeTextWrap();\n\n      this.icRowHeightChange.emit();\n\n      this.rowHeightSet = true;\n    }\n  }\n\n  /**\n   * Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`.\n   */\n  @Method()\n  async resetRowHeights(rowHeight?: number | \"auto\"): Promise<void> {\n    this.globalRowHeight = rowHeight || \"auto\";\n    this.variableRowHeight = null;\n  }\n\n  private showLoadingIndicator() {\n    if (this.loadingOptions?.overlay) {\n      this.loadingOverlay?.classList.add(\"show\");\n    }\n    this.loadingIndicator?.classList.add(\"show\");\n  }\n\n  private startLoadingTimer = (): void => {\n    this.hasLoadedForOneSecond = false;\n    this.timerStarted = Date.now();\n    setTimeout(() => {\n      this.hasLoadedForOneSecond = true;\n      this.timerStarted = null;\n    }, this.minimumLoadingDisplayDuration);\n  };\n\n  private isObject = (value: any) =>\n    value !== undefined && value !== null && typeof value === \"object\";\n\n  private notDefaultDensity = () => this.density !== \"default\";\n\n  private getCellContent = (\n    cell: any,\n    dataType: IcDataTableColumnDataTypes\n  ): any => {\n    switch (dataType) {\n      case \"element\":\n        return undefined;\n      case \"date\":\n        return (\n          cell instanceof Date ? cell : new Date(cell)\n        ).toLocaleDateString();\n      default:\n        return cell;\n    }\n  };\n\n  private getCellAlignment = (\n    cell: any,\n    alignment: \"horizontal\" | \"vertical\"\n  ) => {\n    if (this.isObject(cell) && Object.keys(cell).includes(\"cellAlignment\")) {\n      return this.getObjectValue(\n        this.getObjectValue(cell, \"cellAlignment\"),\n        alignment\n      );\n    }\n  };\n\n  private getCellOptions = (cell: any, key: string) => {\n    if (!(this.isObject(cell) && Object.keys(cell).includes(key))) return;\n\n    return this.getObjectValue(cell, key);\n  };\n\n  private createUpdatingIndicator = () => {\n    const { appearance, description, max, min, progress } =\n      this.updatingOptions || {};\n    return (\n      <th colSpan={this.columns.length} class=\"updating-state\">\n        <ic-loading-indicator\n          appearance={appearance}\n          description={description || \"Updating table data\"}\n          fullWidth={true}\n          max={max}\n          min={min}\n          progress={progress}\n          type=\"linear\"\n          size=\"small\"\n        ></ic-loading-indicator>\n      </th>\n    );\n  };\n\n  private setRowHeight = (height: number) => {\n    return pxToRem(\n      `${\n        height * this.DENSITY_HEIGHT_MULTIPLIER[this.density] -\n        this.DENSITY_PADDING_HEIGHT_DIFF[this.density]\n      }px`\n    );\n  };\n\n  private setTruncationClass = () =>\n    this.truncationPattern\n      ? { [`truncation-${this.truncationPattern}`]: true }\n      : {};\n\n  private getColumnWidth = (\n    columnWidth?: string | IcDataTableColumnWidthTypes\n  ) => {\n    // TODO: Setting max width on columns\n    let columnWidthStyling = {};\n\n    if (columnWidth) {\n      if (typeof columnWidth === \"string\") {\n        columnWidthStyling = {\n          ...columnWidthStyling,\n          [\"--column-width\"]: columnWidth,\n        };\n      }\n\n      if (typeof columnWidth === \"object\" && !!Object.keys(columnWidth)) {\n        if (columnWidth?.minWidth) {\n          columnWidthStyling = {\n            ...columnWidthStyling,\n            [\"--column-min-width\"]: columnWidth?.minWidth,\n          };\n        }\n\n        if (columnWidth?.maxWidth) {\n          columnWidthStyling = {\n            ...columnWidthStyling,\n            [\"--column-max-width\"]: columnWidth?.maxWidth,\n          };\n        }\n      }\n    }\n\n    return columnWidthStyling;\n  };\n\n  private getRowHeight = (\n    currentRowHeight: number,\n    columnProps: IcDataTableColumnObject,\n    rowTextWrap: boolean,\n    cell: any\n  ) => {\n    if (\n      (this.truncationPattern || currentRowHeight) &&\n      !columnProps?.textWrap &&\n      !rowTextWrap &&\n      !this.getCellOptions(cell, \"textWrap\") &&\n      columnProps?.dataType !== \"element\"\n    ) {\n      return {\n        [this.ROW_HEIGHT_CSS_VARIABLE]: this.setRowHeight(currentRowHeight),\n      };\n    }\n\n    return {};\n  };\n\n  private adjustWidthForActionElement = () => {\n    const elements = this.el.shadowRoot?.querySelectorAll(\".action-element\");\n    elements?.forEach((actionElementSpan) => {\n      let width = 0;\n      const actionElement = actionElementSpan.firstChild as HTMLElement;\n      if (actionElement.tagName.toLowerCase() === \"slot\") {\n        const slottedActionElement =\n          this.getSlottedActionElement(actionElement);\n        if (slottedActionElement) {\n          width = slottedActionElement.getBoundingClientRect().width;\n        }\n      } else {\n        width = actionElement.getBoundingClientRect().width;\n      }\n      const gridWrapper =\n        actionElementSpan.closest<HTMLElement>(\".cell-grid-wrapper\");\n      if (gridWrapper) {\n        gridWrapper.style.gridTemplateColumns = `auto calc(${width}px + var(--ic-space-xs))`;\n      }\n    });\n  };\n\n  private createCellContent = (\n    columnProps: IcDataTableColumnObject,\n    cell: any,\n    cellSlotName: string,\n    rowOptions: any,\n    rowAlignment: string,\n    hasIcon: boolean,\n    currentRowHeight: number,\n    cellValue: (key: string) => any,\n    rowEmphasis: string\n  ) => (\n    <div\n      innerHTML={\n        columnProps?.dataType === \"element\" &&\n        !isSlotUsed(this.el, cellSlotName)\n          ? (cell as string)\n          : null\n      }\n      class={{\n        \"cell-container\": columnProps?.dataType !== \"element\",\n        [`cell-alignment-${\n          columnProps?.columnAlignment?.vertical ||\n          rowOptions?.rowAlignment?.vertical ||\n          rowAlignment ||\n          this.getCellAlignment(cell, \"vertical\")\n        }`]:\n          !!columnProps?.columnAlignment?.vertical ||\n          !!rowOptions?.rowAlignment?.vertical ||\n          !!rowAlignment ||\n          !!this.getCellAlignment(cell, \"vertical\"),\n        [`cell-alignment-${\n          columnProps?.columnAlignment?.horizontal ||\n          rowOptions?.rowAlignment?.horizontal ||\n          this.getCellAlignment(cell, \"horizontal\")\n        }`]:\n          !!columnProps?.columnAlignment?.horizontal ||\n          !!rowOptions?.rowAlignment?.horizontal ||\n          !!this.getCellAlignment(cell, \"horizontal\"),\n        [`data-type-${columnProps?.dataType}`]: true,\n        [this.TEXT_WRAP_STRING]:\n          columnProps?.textWrap ||\n          rowOptions?.textWrap ||\n          !!this.getCellOptions(cell, \"textWrap\"),\n        [\"cell-icon\"]: hasIcon || !!columnProps?.icon?.icon,\n        ...this.setTruncationClass(),\n        [this.CELL_CONTAINER_WITH_DESCRIPTION_STRING]:\n          this.isObject(cell) && Object.keys(cell).includes(\"description\"),\n      }}\n      style={{\n        ...this.getRowHeight(\n          currentRowHeight,\n          columnProps,\n          rowOptions?.textWrap,\n          cell\n        ),\n        ...this.getColumnWidth(columnProps?.columnWidth),\n      }}\n      data-row-height={\n        this.truncationPattern || currentRowHeight\n          ? this.setRowHeight(currentRowHeight)\n          : null\n      }\n    >\n      {isSlotUsed(this.el, cellSlotName) ? (\n        <slot name={cellSlotName} />\n      ) : (\n        <Fragment>\n          {isSlotUsed(this.el, `${cellSlotName}-icon`) ? (\n            <slot name={`${cellSlotName}-icon`} />\n          ) : (\n            (hasIcon || columnProps?.icon?.onAllCells) &&\n            (cellValue(\"icon\") || columnProps?.icon?.icon) && (\n              <span\n                class=\"icon\"\n                innerHTML={cellValue(\"icon\") || columnProps?.icon?.icon}\n              ></span>\n            )\n          )}\n          {columnProps?.dataType !== \"element\" &&\n            !isSlotUsed(this.el, cellSlotName) && (\n              <div\n                class={{\n                  \"cell-text-wrapper\": true,\n                  \"cell-text-no-wrap\": !this.truncationPattern,\n                }}\n              >\n                <ic-typography\n                  variant=\"body\"\n                  class={{\n                    [`cell-emphasis-${\n                      (this.isObject(cell) && cellValue(\"emphasis\")) ||\n                      columnProps?.emphasis ||\n                      rowEmphasis\n                    }`]:\n                      (this.isObject(cell) && !!cellValue(\"emphasis\")) ||\n                      !!columnProps?.emphasis ||\n                      !!rowEmphasis,\n                    [`text-${this.density}`]: this.notDefaultDensity(),\n                  }}\n                >\n                  {this.isObject(cell) && columnProps?.dataType !== \"date\" ? (\n                    Object.keys(cell).includes(\"href\") ? (\n                      <ic-link\n                        href={cellValue(\"href\")}\n                        target={cellValue(\"target\") || undefined}\n                        rel={cellValue(\"rel\") || undefined}\n                      >\n                        {cellValue(\"data\")}\n                      </ic-link>\n                    ) : (\n                      cellValue(\"data\")\n                    )\n                  ) : (\n                    this.getCellContent(cell, columnProps?.dataType)\n                  )}\n                </ic-typography>\n                {this.isObject(cell) &&\n                  Object.keys(cell).includes(\"description\") && (\n                    <div\n                      class={{\n                        [\"cell-description\"]: true,\n                        [`data-type-${columnProps?.dataType}`]: true,\n                      }}\n                    >\n                      {cellValue(\"description\")?.icon && (\n                        <span\n                          class=\"cell-description-icon\"\n                          innerHTML={cellValue(\"description\").icon}\n                        ></span>\n                      )}\n                      <ic-typography\n                        variant=\"caption\"\n                        class=\"cell-description-text\"\n                      >\n                        {cellValue(\"description\")?.data ??\n                          cellValue(\"description\")}\n                      </ic-typography>\n                    </div>\n                  )}\n              </div>\n            )}\n        </Fragment>\n      )}\n    </div>\n  );\n\n  private createCells = (row: IcDataTableDataType, rowIndex: number) => {\n    const rowValues = Object.values(row);\n    const rowKeys = Object.keys(row);\n\n    const rowOptions = this.getRowOptions(rowKeys, rowValues);\n    let rowAlignment: string;\n    let rowEmphasis: string;\n\n    const headerIndex = rowKeys.indexOf(\"header\");\n    if (headerIndex > -1) {\n      rowAlignment = this.getObjectValue(\n        rowValues[headerIndex],\n        \"rowAlignment\"\n      );\n      rowEmphasis = this.getObjectValue(rowValues[headerIndex], \"emphasis\");\n    }\n\n    const variableRowHeightVal = this.variableRowHeight?.({\n      ...row,\n      index: rowIndex,\n    });\n    const currentRowHeight = variableRowHeightVal\n      ? variableRowHeightVal !== \"auto\" && variableRowHeightVal\n      : this.globalRowHeight !== \"auto\" && this.globalRowHeight;\n\n    return rowValues.map((cell, index) => {\n      const columnProps = this.columns[index];\n      const cellSlotName = `${columnProps?.key}-${rowIndex}`;\n      const hasIcon = this.isObject(cell) && Object.keys(cell).includes(\"icon\");\n      const cellValue = (key: string) => this.getObjectValue(cell, key);\n\n      const CellContent = this.createCellContent(\n        columnProps,\n        cell,\n        cellSlotName,\n        rowOptions,\n        rowAlignment,\n        hasIcon,\n        currentRowHeight,\n        cellValue,\n        rowEmphasis\n      );\n\n      if (rowKeys[index] === \"header\") {\n        return (\n          <th\n            scope=\"row\"\n            colSpan={cellValue(\"colspan\")}\n            class={{\n              [\"row-header\"]: true,\n              [`row-header-alignment-${cellValue(\"cellAlignment\")}`]:\n                !!cellValue(\"cellAlignment\"),\n              [\"row-header-sticky\"]: this.stickyRowHeaders,\n            }}\n          >\n            {cellValue(\"title\")}\n          </th>\n        );\n      }\n\n      if (rowKeys[index] !== \"rowOptions\") {\n        return (\n          <td\n            class={{\n              [\"table-cell\"]: true,\n              [`table-density-${this.density}`]: this.notDefaultDensity(),\n              [\"with-overflow\"]: columnProps?.dataType === \"element\",\n            }}\n            style={{ ...this.getColumnWidth(columnProps.columnWidth) }}\n          >\n            {isSlotUsed(this.el, `${cellSlotName}-action-element`) ? (\n              <div class=\"cell-grid-wrapper\">\n                {CellContent}\n                <span class=\"action-element\">\n                  <slot name={`${cellSlotName}-action-element`} />\n                </span>\n              </div>\n            ) : this.isObject(cell) &&\n              Object.keys(cell).includes(\"actionElement\") ? (\n              <div class=\"cell-grid-wrapper\">\n                {CellContent}\n                <span\n                  class=\"action-element\"\n                  innerHTML={cellValue(\"actionElement\")}\n                  // eslint-disable-next-line react/jsx-no-bind\n                  onClick={\n                    cell.actionOnClick\n                      ? (event) => this.handleClick(event, cell.actionOnClick)\n                      : undefined\n                  }\n                ></span>\n              </div>\n            ) : (\n              CellContent\n            )}\n          </td>\n        );\n      }\n    });\n  };\n\n  private createColumnHeaders = () =>\n    (this.columns || []).map(\n      (\n        {\n          cellAlignment,\n          colspan,\n          icon,\n          key,\n          title,\n          columnWidth,\n          excludeColumnFromSort,\n        },\n        index\n      ) => (\n        <th\n          scope=\"col\"\n          class={{\n            [\"column-header\"]: true,\n            [`table-density-${this.density}`]: this.notDefaultDensity(),\n            [\"updating-state-headers\"]: this.updating && !this.loading,\n          }}\n          style={{ ...this.getColumnWidth(columnWidth) }}\n          colSpan={colspan}\n        >\n          <div\n            class={{\n              \"column-header-inner-container\": true,\n              \"truncation-tooltip\": this.columnHeaderTruncation,\n              [`column-header-alignment-${cellAlignment}`]: !!cellAlignment,\n            }}\n          >\n            {isSlotUsed(this.el, `${key}-column-icon`) ? (\n              <slot name={`${key}-column-icon`} />\n            ) : (\n              icon &&\n              !icon.hideOnHeader && (\n                <span class=\"icon\" innerHTML={icon.icon}></span>\n              )\n            )}\n            {this.columnHeaderTruncation ? (\n              <ic-tooltip label={title} target={`column-header-${index}`}>\n                <ic-typography\n                  id={`column-header-${index}`}\n                  variant=\"body\"\n                  class={{\n                    [\"column-header-text\"]: true,\n                    [`text-${this.density}`]: this.notDefaultDensity(),\n                  }}\n                >\n                  {title}\n                </ic-typography>\n              </ic-tooltip>\n            ) : (\n              <ic-typography\n                variant=\"body\"\n                class={{\n                  [\"column-header-text\"]: true,\n                  [`text-${this.density}`]: this.notDefaultDensity(),\n                }}\n              >\n                {title}\n              </ic-typography>\n            )}\n            {this.sortable && !excludeColumnFromSort && (\n              <ic-button\n                variant=\"icon\"\n                id={`sort-button-${key}`}\n                aria-label={this.getSortButtonLabel(key)}\n                // eslint-disable-next-line react/jsx-no-bind\n                onClick={() => this.sortRows(key)}\n                innerHTML={\n                  this.SORT_ICONS[\n                    this.sortedColumn === key\n                      ? this.sortedColumnOrder\n                      : \"unsorted\"\n                  ]\n                }\n                class={{\n                  [\"sort-button\"]: true,\n                  [\"sort-button-unsorted\"]:\n                    this.sortedColumn !== key ||\n                    this.sortedColumnOrder === \"unsorted\",\n                }}\n              ></ic-button>\n            )}\n          </div>\n          {this.columnHeaderTruncation && (\n            <ic-typography\n              variant=\"body\"\n              aria-hidden=\"true\"\n              class={{\n                [\"column-header-text\"]: true,\n                [\"dummy-column-header-text\"]: this.columnHeaderTruncation,\n                [`text-${this.density}`]: this.notDefaultDensity(),\n              }}\n            >\n              {title}\n            </ic-typography>\n          )}\n        </th>\n      )\n    );\n\n  private onRowClick = (row: object) => {\n    if (!this.loading && !this.updating) {\n      this.icSelectedRowChange.emit(this.selectedRow !== row ? row : null);\n    }\n\n    this.selectedRow =\n      this.selectedRow !== row && !this.loading && !this.updating && row;\n  };\n\n  private createRows = () => {\n    const data = this.showPagination\n      ? this.data.slice(this.fromRow, this.toRow)\n      : this.data.slice();\n\n    const paginationOffset = this.showPagination ? this.fromRow : 0;\n\n    /**\n     * Ensures that createCells has a value in data to map over to actually render the slot.\n     * Removes the need for the user to add it multiple times.\n     * `addDataToPosition` used to add the element in the correct column order.\n     * Adding empty string value in to give `createCells` something to loop over.\n     */\n    const organisedData = data.map((row, rowIndex) => {\n      const slottedColumns = this.columns\n        .map(\n          ({ key }, index) =>\n            isSlotUsed(this.el, `${key}-${rowIndex + paginationOffset}`) && {\n              key,\n              index,\n            }\n        )\n        .filter(\n          (col) =>\n            !!col &&\n            // skip the column if its already in the row\n            !Object.prototype.hasOwnProperty.call(row, col.key)\n        );\n      return slottedColumns.length > 0\n        ? addDataToPosition(row, slottedColumns, \"\")\n        : row;\n    });\n\n    return organisedData\n      .sort(\n        !this.sortable || this.disableAutoSort\n          ? undefined\n          : this.getSortFunction()\n      )\n      .map((row, index) => {\n        return (\n          <tr\n            // eslint-disable-next-line react/jsx-no-bind\n            onClick={() => this.onRowClick(row)}\n            class={{\n              [\"table-row\"]: true,\n              [\"table-row-selected\"]:\n                this.highlightSelectedRow && this.selectedRow === row,\n            }}\n          >\n            {this.createCells(row, index + paginationOffset)}\n          </tr>\n        );\n      });\n  };\n\n  private getSlottedActionElement = (\n    actionElement: HTMLElement\n  ): Element | null => {\n    const slotName = actionElement.getAttribute(\"name\");\n    return this.el.querySelector(`[slot=\"${slotName}\"]`);\n  };\n\n  private getObjectValue = (cell: object, key: string) =>\n    Object.values(cell)[Object.keys(cell).indexOf(key)];\n\n  private getSortButtonLabel = (key: string) => {\n    let label = \"\";\n    const getNextSortOption = (option: IcDataTableSortOrderOptions) => {\n      const sortOrders = this.sortOptions.sortOrders;\n      return sortOrders[(sortOrders.indexOf(option) + 1) % sortOrders.length];\n    };\n\n    if (this.sortedColumn === key) {\n      const sortOption = getNextSortOption(this.sortedColumnOrder);\n      label = sortOption !== \"unsorted\" ? `Sort ${sortOption}` : \"Remove sort\";\n    } else {\n      label = `Sort ${getNextSortOption(\"unsorted\")}`;\n    }\n\n    return label;\n  };\n\n  private getComparison = (targetRow: any, comparisonRow: any): number => {\n    const targetRowValue = targetRow[this.sortedColumn];\n    const comparisonRowValue = comparisonRow[this.sortedColumn];\n    return this.columns.find((col) => col.key === this.sortedColumn)\n      .dataType === \"date\"\n      ? new Date(targetRowValue).valueOf() -\n          new Date(comparisonRowValue).valueOf()\n      : String(\n          this.isObject(targetRowValue)\n            ? Object.values(targetRowValue)[0]\n            : targetRowValue\n        ).localeCompare(\n          String(\n            this.isObject(comparisonRowValue)\n              ? Object.values(comparisonRowValue)[0]\n              : comparisonRowValue\n          ),\n          undefined,\n          { numeric: true, sensitivity: \"base\" }\n        );\n  };\n\n  private getSortFunction = () => {\n    switch (this.sortedColumnOrder) {\n      case \"ascending\":\n        return (a: any, b: any) => this.getComparison(a, b);\n      case \"descending\":\n        return (a: any, b: any) => this.getComparison(b, a);\n      default:\n        return undefined;\n    }\n  };\n\n  private sortRows = (column: string) => {\n    const sortButton = this.el.shadowRoot.querySelector(\n      `#sort-button-${column}`\n    ) as HTMLIcButtonElement;\n\n    const sortOrders = this.sortOptions.sortOrders;\n\n    if (column !== this.sortedColumn) {\n      if (this.sortedColumn) {\n        const previousSortedButton = this.el.shadowRoot.querySelector(\n          `#sort-button-${this.sortedColumn}`\n        ) as HTMLIcButtonElement;\n        previousSortedButton.setAttribute(\n          \"aria-label\",\n          this.getSortButtonLabel(column)\n        ); // Passing through unsorted column returns correct label for newly unsorted column\n      }\n      this.sortedColumn = column;\n      this.sortedColumnOrder = \"unsorted\";\n    }\n\n    let nextSortOrderIndex = sortOrders.indexOf(this.sortedColumnOrder) + 1;\n\n    if (nextSortOrderIndex > sortOrders.length - 1) {\n      nextSortOrderIndex = 0;\n    }\n\n    this.sortedColumnOrder = sortOrders[nextSortOrderIndex];\n\n    sortButton.setAttribute(\"aria-label\", this.getSortButtonLabel(column));\n\n    this.tableSorted = true;\n\n    this.icSortChange.emit({\n      columnName: column,\n      sorted: this.sortedColumnOrder,\n    });\n  };\n\n  private getTypographyElements = (): HTMLIcTypographyElement[] => {\n    // Filter out column headers and cell descriptions\n    return Array.from(\n      this.el.shadowRoot.querySelectorAll(\n        \"ic-typography:not(.column-header-text,.cell-description-text)\"\n      )\n    );\n  };\n\n  private getTooltip = (\n    typographyEl: HTMLIcTypographyElement\n  ): HTMLIcTooltipElement => {\n    return typographyEl.closest(this.TOOLTIP);\n  };\n\n  private updateTruncationTooltip = (removeTooltipOnly = false) => {\n    this.getTypographyElements().forEach(\n      (typographyEl: HTMLIcTypographyElement) => {\n        const tooltip = this.getTooltip(typographyEl);\n        const cellContainer = this.getCellContainer(typographyEl);\n\n        if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {\n          this.removeTooltip(cellContainer, typographyEl, tooltip);\n          typographyEl.setAttribute(\n            \"style\",\n            `${this.LINE_CLAMP_CSS_VARIABLE}: 0`\n          );\n          return;\n        }\n\n        this.regenerateTooltip(\n          cellContainer,\n          typographyEl,\n          tooltip,\n          removeTooltipOnly\n        );\n      }\n    );\n  };\n\n  private updateScrollOffset = () => {\n    this.scrollOffset = this.el.shadowRoot.querySelector(\n      \".table-row-container\"\n    ).scrollTop;\n  };\n\n  private updateRowHeightForDescriptions = (\n    rowHeight: number,\n    cellContainer: Element\n  ) => {\n    cellContainer.setAttribute(\"data-row-height\", rowHeight.toString());\n    cellContainer.setAttribute(\n      \"style\",\n      `${this.ROW_HEIGHT_CSS_VARIABLE}: ${rowHeight}px`\n    );\n  };\n\n  // Method to update the row heights on cells with descriptions and tooltip truncation\n  private updateCellHeightsWithDescriptions = () => {\n    const descriptions = this.el.shadowRoot.querySelectorAll(\n      this.CELL_DESCRIPTION_STRING\n    );\n\n    descriptions.forEach((description) => {\n      const cellContainer = description.closest(\n        `.${this.CELL_CONTAINER_WITH_DESCRIPTION_STRING}`\n      ) as HTMLElement;\n      const typography = cellContainer.querySelector(\n        this.IC_TYPOGRAPHY_STRING\n      ) as HTMLIcTypographyElement;\n\n      const descriptionMarginTop = window\n        .getComputedStyle(description)\n        .getPropertyValue(\"margin-top\");\n\n      const descriptionHeight =\n        description.clientHeight + parseInt(descriptionMarginTop, 10);\n\n      if (this.globalRowHeight && this.globalRowHeight !== \"auto\") {\n        if (\n          !typography.textContent &&\n          descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight\n        ) {\n          this.updateRowHeightForDescriptions(descriptionHeight, cellContainer);\n        } else if (this.truncationPattern === this.TOOLTIP_STRING) {\n          if (\n            descriptionHeight + this.DEFAULT_LINE_HEIGHT >\n            this.globalRowHeight\n          ) {\n            const cellIcon = cellContainer?.querySelector(\".icon\");\n            if (deviceSizeMatches(IC_DEVICE_SIZES.XS) && cellIcon) {\n              // recalculate descriptionHeight as when a word break occurs this value changes\n              // Additional spacing given for 300-400% zoom\n              this.updateRowHeightForDescriptions(\n                descriptionHeight +\n                  this.DEFAULT_LINE_HEIGHT +\n                  cellIcon.clientHeight,\n                cellContainer\n              );\n            } else {\n              this.updateRowHeightForDescriptions(\n                descriptionHeight + this.DEFAULT_LINE_HEIGHT,\n                cellContainer\n              );\n            }\n          }\n          this.addLineClampCSS(typography, cellContainer);\n          // Additional case for show/hide truncation for when a description is present, but the text\n          // isn't overflowing the cell to trigger the show more button to appear.\n        } else if (\n          this.truncationPattern === this.SHOW_HIDE_STRING &&\n          descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight &&\n          typography.style.getPropertyValue(\"--truncation-max-lines\") !==\n            \"initial\"\n        ) {\n          this.updateRowHeightForDescriptions(\n            descriptionHeight + this.DEFAULT_LINE_HEIGHT,\n            cellContainer\n          );\n\n          if (descriptionHeight) {\n            this.createShowHideTruncation(\n              typography,\n              cellContainer as HTMLElement,\n              descriptionHeight\n            );\n          }\n        }\n      }\n    });\n  };\n\n  private getRowOptions(rowKeys: string[], rowValues: any[]) {\n    const rowOptionsIndex = rowKeys.indexOf(\"rowOptions\");\n    return rowOptionsIndex > -1 && rowValues[rowOptionsIndex];\n  }\n\n  private regenerateTooltip(\n    cellContainer: HTMLElement,\n    typographyEl: HTMLIcTypographyElement,\n    tooltip: HTMLIcTooltipElement,\n    removeTooltipOnly?: boolean\n  ) {\n    // When sorting the table, instead of regenerating the tooltip,\n    // the tooltip details are updated\n\n    if (tooltip) {\n      if (this.tableSorted) {\n        tooltip.setAttribute(\"target\", typographyEl.id);\n        tooltip.setAttribute(\"label\", typographyEl.textContent);\n      } else {\n        this.removeTooltip(cellContainer, typographyEl, tooltip);\n      }\n      if (removeTooltipOnly) {\n        return;\n      }\n    }\n\n    // This add line clamp to data only when\n    // the data object has been updated\n    if (!typographyEl.getAttribute(\"style\") && this.dataUpdated) {\n      this.addLineClampCSS(typographyEl, cellContainer);\n    }\n\n    if (\n      typographyEl?.scrollHeight > cellContainer?.clientHeight &&\n      this.truncationPattern === this.TOOLTIP_STRING\n    ) {\n      if (\n        !typographyEl.getAttribute(\"style\") ||\n        typographyEl.style.cssText.includes(\n          `${this.LINE_CLAMP_CSS_VARIABLE}: 0;`\n        )\n      ) {\n        this.addLineClampCSS(typographyEl, cellContainer);\n      }\n      if (!cellContainer.querySelector(this.IC_TOOLTIP_STRING))\n        this.createTruncationTooltip(typographyEl, cellContainer);\n    }\n  }\n  private setTableDimensions = () => {\n    let tableHostDimensions = {};\n\n    if (this.width) {\n      tableHostDimensions = {\n        ...tableHostDimensions,\n        [\"--table-width\"]: this.width,\n      };\n    }\n\n    if (this.height) {\n      tableHostDimensions = {\n        ...tableHostDimensions,\n        [\"--table-height\"]: this.height,\n      };\n    }\n\n    if (this.maxWidth) {\n      tableHostDimensions = {\n        ...tableHostDimensions,\n        [\"--table-max-width\"]: this.maxWidth,\n      };\n    }\n\n    if (this.minWidth) {\n      tableHostDimensions = {\n        ...tableHostDimensions,\n        [\"--table-min-width\"]: this.minWidth,\n      };\n    }\n\n    return tableHostDimensions;\n  };\n\n  private removeTooltip(\n    cellContainer: HTMLElement,\n    typographyEl: HTMLIcTypographyElement,\n    tooltip: HTMLIcTooltipElement\n  ) {\n    const cellTextWrapper = cellContainer.querySelector(\n      this.CELL_TEXT_WRAPPER_STRING\n    );\n    cellTextWrapper.prepend(typographyEl);\n    if (tooltip) {\n      tooltip.remove();\n    }\n  }\n\n  private addLineClampCSS(\n    typographyEl: HTMLIcTypographyElement,\n    cellContainer: HTMLElement\n  ) {\n    const descriptionCellHeight = cellContainer.querySelector(\n      this.CELL_DESCRIPTION_STRING\n    )?.clientHeight;\n    if (\n      cellContainer.classList.contains(\n        this.CELL_CONTAINER_WITH_DESCRIPTION_STRING\n      ) &&\n      cellContainer?.clientHeight > descriptionCellHeight\n    ) {\n      let iconHeight: number;\n      if (deviceSizeMatches(IC_DEVICE_SIZES.XS)) {\n        const cellIcon = cellContainer?.querySelector(\".icon\");\n        iconHeight = cellIcon ? cellIcon.clientHeight : 0;\n      } else {\n        iconHeight = 0;\n      }\n\n      const height =\n        cellContainer?.clientHeight -\n        cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)\n          ?.clientHeight -\n        iconHeight;\n\n      typographyEl.setAttribute(\n        \"style\",\n        `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(height || 0)}`\n      );\n    } else {\n      typographyEl.setAttribute(\n        \"style\",\n        `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(\n          cellContainer?.clientHeight\n        )}`\n      );\n    }\n  }\n\n  private createTruncationTooltip(\n    typographyEl: HTMLIcTypographyElement,\n    cellContainer: HTMLElement\n  ) {\n    const tooltipEl = document.createElement(\n      this.IC_TOOLTIP_STRING\n    ) as HTMLIcTooltipElement;\n    tooltipEl.setAttribute(\"target\", typographyEl.id);\n    tooltipEl.setAttribute(\"label\", typographyEl.textContent);\n    tooltipEl.classList.add(\"ic-tooltip-overflow\");\n    tooltipEl.setExternalPopperProps({\n      // This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly\n      strategy: \"fixed\",\n    });\n    const cellTextWrapper = cellContainer.querySelector(\n      this.CELL_TEXT_WRAPPER_STRING\n    );\n    cellTextWrapper.prepend(tooltipEl);\n    tooltipEl.prepend(typographyEl);\n  }\n\n  private fixCellTooltip = (element: HTMLElement) => {\n    const tooltipEl = (\n      element.tagName === \"IC-TOOLTIP\"\n        ? element\n        : element.shadowRoot?.querySelector(this.IC_TOOLTIP_STRING)\n    ) as HTMLIcTooltipElement;\n\n    if (tooltipEl) {\n      tooltipEl.setExternalPopperProps({\n        strategy: \"fixed\",\n      });\n    }\n  };\n\n  private fixCellTooltips = () => {\n    this.el.shadowRoot\n      ?.querySelectorAll(\".data-type-element\")\n      ?.forEach((element) => {\n        const slotElements = getSlotElements(element);\n        slotElements?.forEach((slottedEl) => {\n          this.fixCellTooltip(slottedEl as HTMLElement);\n        });\n      });\n\n    this.el.shadowRoot\n      ?.querySelectorAll(\".action-element\")\n      ?.forEach((actionElementSpan) => {\n        const actionElement = actionElementSpan.firstChild as HTMLElement;\n        if (actionElement.tagName.toLowerCase() === \"slot\") {\n          const slottedActionElement =\n            this.getSlottedActionElement(actionElement);\n          if (slottedActionElement) {\n            this.fixCellTooltip(slottedActionElement as HTMLElement);\n          }\n        } else {\n          this.fixCellTooltip(actionElementSpan as HTMLElement);\n        }\n      });\n  };\n\n  private handleClick = (event: Event, callback: (event: Event) => void) =>\n    callback(event);\n\n  private renderTableBody = (\n    data: IcDataTableDataType[],\n    loading: boolean,\n    overlay: boolean\n  ) => {\n    if (!data?.length) return;\n\n    if (overlay && loading) {\n      return <tbody>{this.createRows()}</tbody>;\n    } else if (loading && !overlay) {\n      return null;\n    } else {\n      return <tbody>{this.createRows()}</tbody>;\n    }\n  };\n\n  private renderLoadingIndicator = (\n    isLoading: boolean,\n    loadingOptions: IcLoadingOptions\n  ) => {\n    if (!isLoading) return null;\n\n    return (\n      <Fragment>\n        <div\n          class=\"loading-overlay\"\n          ref={(el) => (this.loadingOverlay = el)}\n        ></div>\n        <ic-loading-indicator\n          appearance={loadingOptions?.appearance}\n          class={{\n            \"loading-empty\": isLoading,\n            loading: true,\n            \"show-background\":\n              loadingOptions.showBackground || loadingOptions.overlay,\n          }}\n          description={loadingOptions.description || \"Loading table data\"}\n          label={loadingOptions.label || \"Loading...\"}\n          labelDuration={loadingOptions?.labelDuration}\n          max={loadingOptions?.max}\n          min={loadingOptions?.min}\n          progress={loadingOptions?.progress}\n          ref={(el: HTMLIcLoadingIndicatorElement) =>\n            (this.loadingIndicator = el)\n          }\n        ></ic-loading-indicator>\n      </Fragment>\n    );\n  };\n\n  private renderAriaLiveLoading = () => {\n    if (this.loading) {\n      return this.loadingOptions?.label || \"Loading...\";\n    } else if (this.updating) {\n      return this.updatingOptions?.description || \"Updating table data\";\n    } else {\n      return \"\";\n    }\n  };\n\n  private renderEmptyState = (\n    data: IcDataTableDataType[],\n    loading: boolean,\n    overlay: boolean\n  ) => {\n    const emptyStateEl = isSlotUsed(this.el, \"empty-state\") ? (\n      <slot name=\"empty-state\" />\n    ) : (\n      <ic-empty-state\n        aligned=\"center\"\n        heading=\"No Data\"\n        class=\"loading-empty\"\n      ></ic-empty-state>\n    );\n\n    if (loading && !data?.length && overlay) {\n      return emptyStateEl;\n    } else if (!loading && !data?.length) {\n      return emptyStateEl;\n    } else {\n      return null;\n    }\n  };\n\n  render() {\n    const {\n      caption,\n      createColumnHeaders,\n      createUpdatingIndicator,\n      data,\n      hideColumnHeaders,\n      loading,\n      loadingOptions,\n      paginationBarOptions,\n      scrollable,\n      scrollOffset,\n      showPagination,\n      sortable,\n      sortedColumn,\n      sortedColumnOrder,\n      stickyColumnHeaders,\n      updateScrollOffset,\n      updating,\n    } = this;\n\n    return (\n      <Host style={{ ...this.setTableDimensions() }}>\n        <div class=\"table-container\">\n          {isSlotUsed(this.el, \"title-bar\") && <slot name=\"title-bar\" />}\n          <div\n            class={{\n              [\"table-row-container\"]: true,\n              scrollable,\n            }}\n            tabIndex={scrollable ? 0 : null}\n            onScroll={updateScrollOffset}\n          >\n            {isSlotUsed(this.el, \"title-bar\") && <slot name=\"title-bar\" />}\n            <table\n              style={{\n                [\"--table-layout\"]: this.tableLayout,\n              }}\n            >\n              <caption class=\"table-caption\">{caption}</caption>\n              {!hideColumnHeaders && (\n                <thead\n                  class={{\n                    [\"column-header-sticky\"]: stickyColumnHeaders,\n                    [\"column-header-overlay\"]:\n                      stickyColumnHeaders && scrollOffset !== 0,\n                  }}\n                >\n                  <tr>{createColumnHeaders()}</tr>\n                </thead>\n              )}\n              {updating &&\n                !loading &&\n                (hideColumnHeaders ? (\n                  <thead>{createUpdatingIndicator()}</thead>\n                ) : (\n                  createUpdatingIndicator()\n                ))}\n              {this.renderTableBody(data, loading, loadingOptions.overlay)}\n            </table>\n            {this.renderEmptyState(data, loading, loadingOptions.overlay)}\n          </div>\n          <div aria-live=\"assertive\" class=\"sr-only\">\n            {this.renderAriaLiveLoading()}\n          </div>\n          {this.renderLoadingIndicator(loading, loadingOptions)}\n          {(showPagination || isSlotUsed(this.el, \"pagination-bar\")) && (\n            <div class=\"pagination-container\">\n              {isSlotUsed(this.el, \"pagination-bar\") ? (\n                <slot name=\"pagination-bar\" />\n              ) : (\n                <ic-pagination-bar\n                  alignment={paginationBarOptions.alignment}\n                  appearance={paginationBarOptions.appearance}\n                  hideAllFromItemsPerPage={\n                    paginationBarOptions.hideAllFromItemsPerPage\n                  }\n                  hideRangeLabel={paginationBarOptions.hideRangeLabel}\n                  itemLabel={paginationBarOptions.itemLabel}\n                  itemsPerPageOptions={paginationBarOptions.itemsPerPageOptions}\n                  pageLabel={paginationBarOptions.pageLabel}\n                  rangeLabelType={paginationBarOptions.rangeLabelType}\n                  selectedItemsPerPage={\n                    paginationBarOptions.selectedItemsPerPage\n                  }\n                  setToFirstPageOnPaginationChange={\n                    paginationBarOptions.setToFirstPageOnPaginationChange\n                  }\n                  showGoToPageControl={paginationBarOptions.showGoToPageControl}\n                  showItemsPerPageControl={\n                    paginationBarOptions.showItemsPerPageControl\n                  }\n                  totalItems={data?.length ?? 0}\n                  type={paginationBarOptions.type}\n                ></ic-pagination-bar>\n              )}\n            </div>\n          )}\n          {sortable && (\n            <div class=\"screen-reader-sort-text\" aria-live=\"polite\">\n              {sortedColumnOrder !== \"unsorted\" && sortedColumn\n                ? `${\n                    this.columns.find((col) => col.key === sortedColumn)\n                      ?.title || sortedColumn\n                  } sorted ${sortedColumnOrder}`\n                : \"table unsorted\"}\n            </div>\n          )}\n        </div>\n      </Host>\n    );\n  }\n}\n"],"mappings":"+qBAAA,MAAMA,EAAiB,uqP,MC0DVC,EAAS,M,kLACZC,KAAAC,0BAA4B,CAClCC,MAAO,GACPC,QAAS,EACTC,SAAU,KAGJJ,KAAAK,4BAA8B,CACpCH,MAAO,EACPC,QAAS,GACTC,SAAU,IAGJJ,KAAAM,WAAa,CACnBC,SAAUC,EACVC,UAAWC,EACXC,WAAYC,GAGNZ,KAAAa,sBAAwB,KAIxBb,KAAAc,eAAiC,KACjCd,KAAAe,iBAAmB,YACnBf,KAAAgB,oBAAsB,GAAGhB,KAAKe,wBAC9Bf,KAAAiB,eAAiB,UACjBjB,KAAAkB,QAAU,MAAMlB,KAAKiB,iBACrBjB,KAAAmB,iBAAmB,YACnBnB,KAAAoB,gBAAkB,IAAIpB,KAAKmB,mBAC3BnB,KAAAqB,YAAc,MAEdrB,KAAAsB,aAAe,MACftB,KAAAuB,YAAc,MACdvB,KAAAwB,kBAAoB,MACpBxB,KAAAyB,mBAAqB,MACrBzB,KAAA0B,uBAAyB,kBACzB1B,KAAA2B,wBAA0B,eAC1B3B,KAAA4B,wBAA0B,kBAE1B5B,KAAA6B,oBAAsB,GACtB7B,KAAA8B,cAAgB,MAEhB9B,KAAA+B,yBAAoC,MACpC/B,KAAAgC,sBAAwB,MACxBhC,KAAAiC,qBAAuC,KAEvCjC,KAAAkC,kBAAoB,aACpBlC,KAAAmC,0BAA4B,qBAC5BnC,KAAAoC,wBAA0B,oBAC1BpC,KAAAqC,uCACN,kCACMrC,KAAAsC,yBAA2B,qBAC3BtC,KAAAuC,qBAAuB,gBA6TvBvC,KAAAwC,wBAA0B,KAChCx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