import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-b1696fed.js";import{c as closest}from"./closest-d2d192be.js";var baseCss=":where(*:not(slot),*:not(slot)::before,*:not(slot)::after){-webkit-box-sizing:border-box;box-sizing:border-box}:where(*:not(slot)){margin:0}:where(img,picture,video,canvas,svg){display:block;max-width:100%}:where(input,button,textarea,select){font:inherit}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}:where(a:not([href]):not([class])){color:currentColor;text-decoration:none}:where(a:not([href]):not([class]):hover){color:currentColor;text-decoration:none}:where(ul[role=list],ol[role=list]){list-style:none}:where(table){border-collapse:collapse;border-spacing:0}:where(*:not(slot)){font:var(--pine-typography-body-md-default);letter-spacing:var(--pine-letter-spacing-body-md)}:where(h1,h2,h3,h4,h5,h6){font-family:var(--pine-font-family-heading);color:var(--pine-color-grey-950)}:where(h1){font:var(--pine-typography-heading-h1);letter-spacing:var(--pine-letter-spacing-heading-h1)}:where(h2){font:var(--pine-typography-heading-h2);letter-spacing:var(--pine-letter-spacing-heading-h2)}:where(h3){font:var(--pine-typography-heading-h3);letter-spacing:var(--pine-letter-spacing-heading-h3)}:where(h4){font:var(--pine-typography-heading-h4);letter-spacing:var(--pine-letter-spacing-heading-h4)}:where(h5){font:var(--pine-typography-heading-h5);letter-spacing:var(--pine-letter-spacing-heading-h5)}:where(h6){font:var(--pine-typography-heading-h6);letter-spacing:var(--pine-letter-spacing-heading-h6)}:where(div,label,p,span){color:var(--pine-color-text-default)}:where(code,kbd,pre,samp){font-family:monospace}:where([role=button]){cursor:pointer}:where(:focus){outline:0}:where(:focus-visible){outline:var(--pine-border-width-thick) solid var(--pine-color-purple-500)}:where([hidden]){display:none !important}";var PdsTableHeadStyle0=baseCss;var pdsTableHeadCss=":host{--border-head-default:var(--pine-border-width-thin) solid var(--pine-color-grey-100);--color-background-fixed:var(--pine-color-base-white);border-color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:table-header-group;vertical-align:middle}:host::part(checkbox-cell){background-color:var(--color-background-fixed);left:0;position:-webkit-sticky;position:sticky;z-index:1}:host pds-table-checkbox-cell{-webkit-border-after:var(--border-head-default);border-block-end:var(--border-head-default)}";var PdsTableHeadStyle1=pdsTableHeadCss;var PdsTableHead=function(){function e(e){var t=this;registerInstance(this,e);this.pdsTableSelectAll=createEvent(this,"pdsTableSelectAll",7);this.generateUniqueId=function(){var e=Math.random().toString(36).substring(2,8);var t=(new Date).toISOString().replace(/[:.]/g,"-");var r="".concat(e,"-").concat(t);return r};this.handleInput=function(e){t.isSelected=!e.target.checked;t.handleSelect(t.isSelected)};this.handleSelect=function(e){t.indeterminate=false;if(closest("pds-table-head",t.hostElement)){t.pdsTableSelectAll.emit({isSelected:e})}};this.indeterminate=undefined;this.isSelected=undefined}e.prototype.componentWillLoad=function(){if(this.isSelected){this.handleSelect(this.isSelected)}};e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table");if(this.tableRef&&this.tableRef.fixedColumn){var e=this.hostElement.querySelector("pds-table-head-cell:first-child");e===null||e===void 0?void 0:e.classList.add("is-fixed")}};e.prototype.render=function(){return h(Host,{key:"eb7e9eef443d0f222482b427a5ced7eaa4c0acf4",role:"row"},this.tableRef&&this.tableRef.selectable&&h("pds-table-head-cell",{key:"6b7c87f0d07aac6e5b12b9e3a63914061f850da7",part:this.tableRef.selectable?"checkbox-cell":""},h("pds-checkbox",{key:"74a7b333189bf92219b5a82bf0897d476b7adc8a",componentId:this.generateUniqueId(),indeterminate:this.indeterminate,onInput:this.handleInput,label:"Select All Rows",labelHidden:true,checked:this.isSelected})),h("slot",{key:"5ef8daf29f10505b082619755b61014a52dbd00c"}))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsTableHead.style=PdsTableHeadStyle0+PdsTableHeadStyle1;export{PdsTableHead as pds_table_head};
//# sourceMappingURL=pds-table-head.entry.js.map