import{r as e,c as t,h as s,H as c,g as o}from"./p-db677b4c.js";const i=":host{--background-fixed:var(--pine-color-base-white);--background-interactive:var(--pine-color-neutral-grey-200);border-color:inherit;display:table-row;vertical-align:inherit}:host::part(checkbox-cell){background-color:var(--background-fixed);left:0;position:-webkit-sticky;position:sticky;z-index:1}:host(:hover),:host(:hover)::part(checkbox-cell),:host(:hover) ::slotted(pds-table-cell),:host(.is-selected),:host(.is-selected)::part(checkbox-cell),:host(.is-selected) ::slotted(pds-table-cell){background:var(--background-interactive)}";const l=i;const r=class{constructor(s){e(this,s);this.pdsTableRowSelected=t(this,"pdsTableRowSelected",7);this.handleCheckboxClick=()=>{this.isSelected=!this.isSelected;const e=Array.from(this.hostElement.parentNode.children).indexOf(this.hostElement);this.pdsTableRowSelected.emit({rowIndex:e,isSelected:this.isSelected})};this.generateUniqueId=()=>{const e=Math.random().toString(36).substring(2,8);const t=(new Date).toISOString().replace(/[:.]/g,"-");const s=`${e}-${t}`;return s};this.isSelected=false}classNames(){const e=[];if(this.isSelected){e.push("is-selected")}return e.join("  ")}componentWillRender(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){const e=this.hostElement.querySelector("pds-table-cell");e===null||e===void 0?void 0:e.classList.add("is-fixed")}}render(){return s(c,{key:"b809dac3a76a195446be9cec359887f701213c83",class:this.classNames(),role:"row"},this.tableRef&&this.tableRef.selectable&&s("pds-table-cell",{part:this.tableRef.fixedColumn?"checkbox-cell":"",class:this.tableRef.selectable?"has-checkbox":""},s("pds-checkbox",{componentId:this.generateUniqueId(),onClick:this.handleCheckboxClick,label:"Select Row",labelHidden:true,checked:this.isSelected})),s("slot",{key:"30e8125faa0238ff4c9d2e2ce4dc927173ab35ef"}))}get hostElement(){return o(this)}};r.style=l;export{r as pds_table_row};
//# sourceMappingURL=p-20266cb6.entry.js.map