import{ContextMenuColumnSortClickEvent}from"./DataGridUtils.js";function toggleColumnVisibility(t,o){const e=!o.visible,i=t.data.columns.map((t=>(t===o&&(t.visible=e),t)));t.data={...t.data,columns:i}}export function addColumnVisibilityCheckboxes(t,o){const{columns:e}=t.data;for(const i of e)i.hideable&&o.defaultSection().appendCheckboxItem(i.title,(()=>{toggleColumnVisibility(t,i)}),i.visible)}export function addSortableColumnItems(t,o){const e=t.data.columns.filter((t=>!0===t.sortable));if(e.length>0)for(const i of e)o.defaultSection().appendItem(i.title,(()=>{t.dispatchEvent(new ContextMenuColumnSortClickEvent(i))}))}