import{r as i,h as e,H as t,g as s}from"./p-05ee992c.js";const a=":host{--box-shadow-fixed:3px 3px 6px -2px rgba(0, 0, 0, 0.2);--color-background-fixed:var(--pine-color-white);--color-cell-default:var(--pine-color-charcoal-200);--dimension-fixed-cell-position:0;--dimension-max-width-truncated:100px;--font-size-cell-default:var(--pine-font-size-087);--number-fixed-column-index:0;--spacing-line-height-cell-default:var(--pine-line-height-125);--spacing-padding-cell-default:calc(var(--pine-spacing-300) / 2);--spacing-padding-compact:var(--pine-spacing-050);color:var(--color-cell-default);display:table-cell;font-size:var(--font-size-cell-default);line-height:var(--spacing-line-height-cell-default);padding:var(--spacing-padding-cell-default);vertical-align:inherit}:host(.is-compact){padding-block:var(--spacing-padding-compact)}:host(.is-fixed){background:var(--color-background-fixed);left:var(--dimension-fixed-cell-position);position:-webkit-sticky;position:sticky;z-index:1}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-fixed);box-shadow:var(--box-shadow-fixed)}:host(.is-truncated){max-width:var(--dimension-max-width-truncated);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.has-checkbox){vertical-align:middle;width:16px}";const o=a;const l=class{constructor(e){i(this,e);this.handleScroll=()=>{if(this.tableRef.scrollLeft>0){this.tableScrolling=true}else{this.tableScrolling=false}};this.truncate=undefined;this.tableScrolling=false}componentWillRender(){this.tableRef=this.hostElement.closest("pds-table")}componentDidLoad(){if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.tableRef.addEventListener("scroll",this.handleScroll)}}classNames(){const i=[];if(this.tableRef&&this.tableRef.compact){i.push("is-compact")}if(this.truncate){i.push("is-truncated")}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){i.push("has-scrolled")}return i.join(" ")}render(){return e(t,{key:"91ed20b4338792e6d72834d81d966c154fa2bc6d",class:this.classNames(),role:"gridcell",style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},e("slot",{key:"40dafc4697ba077a121979b604100107f51e9ff1"}))}get hostElement(){return s(this)}};l.style=o;export{l as pds_table_cell};
//# sourceMappingURL=p-d1038811.entry.js.map