From 405f17a023335dfb7481aadd1ff911057397bfc1 Mon Sep 17 00:00:00 2001 From: lkarthee Date: Thu, 4 Jan 2024 01:48:20 +0530 Subject: [PATCH] fix list cell click bug (#376) --- assets/data_table/main.js | 4 ++-- lib/assets/data_table/build/main.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/data_table/main.js b/assets/data_table/main.js index 30402304..6267064a 100644 --- a/assets/data_table/main.js +++ b/assets/data_table/main.js @@ -41,7 +41,7 @@ const headerIcons = { number: GridColumnIcon.HeaderNumber, uri: GridColumnIcon.HeaderUri, date: GridColumnIcon.HeaderDate, - list: GridColumnIcon.HeaderNumber, + list: GridColumnIcon.HeaderArray, }; const cellKind = { @@ -49,7 +49,7 @@ const cellKind = { number: GridCellKind.Number, uri: GridCellKind.Uri, date: GridCellKind.Text, - list: GridCellKind.Number, + list: GridCellKind.Text, }; const theme = { diff --git a/lib/assets/data_table/build/main.js b/lib/assets/data_table/build/main.js index 4db86fb5..e2f3144b 100644 --- a/lib/assets/data_table/build/main.js +++ b/lib/assets/data_table/build/main.js @@ -196,7 +196,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,arrowDown:t=>` - `},N_={text:Na.HeaderString,number:Na.HeaderNumber,uri:Na.HeaderUri,date:Na.HeaderDate,list:Na.HeaderNumber},$_={text:n1.Text,number:n1.Number,uri:n1.Uri,date:n1.Text,list:n1.Number},wm={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function nD(t,a){t.importCSS("main.css"),t.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),t.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,Lm.createRoot)(t.root).render(g1.default.createElement(U_,{ctx:t,data:a}))}function U_({ctx:t,data:a}){let e=[],r=[],n=a.content.columns.map(h1=>{let e1=h1.summary,u1=h1.label,M1=h1.key;return r.push({[u1]:250}),e1&&e.push(e1.keys.length),{title:u1,id:M1,type:h1.type,icon:N_[h1.type]||Na.HeaderString,hasMenu:h1.type!=="list",summary:e1}}),i=a.features.includes("refetch"),l=a.features.includes("export"),o=a.content.columns.length!==0,h=e.length>0,c=a.features.includes("sorting"),v=l?a.export?.formats:null,g=l&&v,d={rows:mt.empty(),columns:mt.empty()},[u,p]=(0,g1.useState)(a.content),[z,w]=(0,g1.useState)(!1),[s,f]=(0,g1.useState)(n),[m,H]=(0,g1.useState)(r),[x,y]=(0,g1.useState)(null),[R,L]=(0,g1.useState)(!1),[V,C]=(0,g1.useState)(d),[k,b]=(0,g1.useState)(0),[F,_]=(0,g1.useState)(null),j=u.total_rows,i1=o&&j>0,Z=a.features.includes("pagination")&&(j===null||j>0),d1=u.limit===j,O=44,a1=h&&i1?Math.max(...e):0,W=O+a1*22,L1=c?140:70,p1=440+W,H1=j&&j<(c?3:2)&&x?L1+W:null,P1=j>=10&&d1?p1:H1,K1=(u.page-1)*u.limit+1,W1=h?150:50,Bt=a.content.columns.length===1?800:350,T1=u.page_length,X1=(0,g1.useCallback)(h1=>{let{ctx:e1,theme:u1,rect:M1,column:I1,menuBounds:Q1,isHovered:St,isSelected:jt,spriteManager:Ut}=h1;if(I1.sourceIndex===0)return!0;if(!i1)return!1;e1.rect(M1.x,M1.y,M1.width,M1.height);let Et=10,ot=19,J1=jt?u1.textHeaderSelected:u1.textHeader,Jt=jt?u1.accentLight:u1.textDark,Mt=I1.hasMenu===!0&&St,C0=!!I1.summary,Z0=35,B0=M1.width-Z0,t0=M1.width-Z0*.7,Ma=B0/M1.width,dt=t0/M1.width,At=e1.createLinearGradient(M1.x,0,M1.x+M1.width,0),h0=fr(J1,0),wt=$a(e1,`${u1.headerFontStyle} ${u1.fontFamily}`);if(At.addColorStop(0,J1),At.addColorStop(Ma,J1),At.addColorStop(dt,h0),At.addColorStop(1,h0),e1.fillStyle=Mt?At:J1,I1.icon){let Ft=jt?"selected":I1.style==="highlight"?"special":"normal",qt=u1.headerIconSize;Ut.drawSprite(I1.icon,Ft,e1,M1.x+Et,M1.y+Et,qt,u1),I1.overlayIcon&&Ut.drawSprite(I1.overlayIcon,jt?"selected":"special",e1,M1.x+Et+ot/2,M1.y+Et+ot/2,ot,u1)}if(e1.fillText(I1.title,Q1.x-M1.width+u1.headerIconSize*2.5+14,C0?M1.y+Et+u1.headerIconSize/2+wt:Q1.y+Q1.height/2+wt),C0){let Ft=u.columns[I1.sourceIndex-1].summary,qt=Object.fromEntries(Ft.keys.map((j0,g2)=>[j0,Ft.values[g2]])),c2=13,v2=c2+Et,Ua=`${c2}px ${u1.fontFamily}`,O2=`bold ${Ua}`;e1.fillStyle=Jt,Object.entries(qt).forEach(([j0,g2],D2)=>{e1.font=O2,e1.fillText(`${j0}:`,M1.x+v2/2,M1.y+v2*(D2+1)+v2),e1.font=Ua,e1.fillText(g2,M1.x+e1.measureText(j0).width+v2,M1.y+v2*(D2+1)+v2)})}if(Mt){e1.fillStyle=At;let Ft=Q1.x+Q1.width/2-Et*1.5,qt=u1.headerIconSize/2-2,c2=new Path2D("M12 16l-6-6h12z");e1.translate(Ft,qt),e1.fill(c2)}return!0},[u]),Y=(0,g1.useCallback)(([h1,e1])=>{let u1=$_[u.columns[h1].type]||n1.Text,I1=u.data_orientation==="columns"?u.data[h1][e1]:u.data[e1][h1];return{kind:u1,data:I1,displayData:I1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[u]),N=()=>{w(!z)},s1=h1=>{let e1=h1!=="none"?x.columnKey:null;t.pushEvent("order_by",{key:e1,direction:h1??"asc"}),y(null)},x1=()=>{t.pushEvent("show_page",{page:u.page-1}),C({...d,columns:V.columns})},f1=()=>{t.pushEvent("show_page",{page:u.page+1}),C({...d,columns:V.columns})},U=()=>{let h1={...d,columns:mt.fromSingleSelection(x.column)};C(h1),y(null)},{layerProps:v1,renderLayer:D}=xm({isOpen:R,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>y(null),trigger:{getBounds:()=>({left:x?.bounds.x??0,top:x?.bounds.y??0,width:x?.bounds.width??0,height:x?.bounds.height??0,right:(x?.bounds.x??0)+(x?.bounds.width??0),bottom:(x?.bounds.y??0)+(x?.bounds.height??0)})}}),I=(0,g1.useCallback)((h1,e1)=>{H(u1=>({...u1,[h1.title]:e1}))},[]),C1=(0,g1.useCallback)((h1,e1)=>{let{summary:u1,id:M1,type:I1}=s[h1];u1||y({column:h1,bounds:e1,columnKey:M1,columnType:I1})},[]),D1=(0,g1.useCallback)((h1,{bounds:e1})=>{let{id:u1,type:M1}=s[h1];y({column:h1,bounds:e1,columnKey:u1,columnType:M1})},[]),et=(0,g1.useCallback)(h1=>{let[e1,u1]=h1.location;u1===-1&&e1===-1&&h1.kind==="header"?_([...Array.from({length:T1},(M1,I1)=>I1)]):e1===-1&&h1.kind==="cell"?_([u1]):_(null)},[T1]),B1=(0,g1.useCallback)(h1=>F?.includes(h1)?{bgCell:wm.bgHeaderHovered}:null,[F]);return(0,g1.useEffect)(()=>{V.rows?.items.length>0?b(1):b(0)},[V]),(0,g1.useEffect)(()=>{t.handleEvent("update_content",h1=>{p(h1)}),t.handleEvent("download_content",([h1,e1])=>{let u1=new Blob([e1],{type:h1.type}),M1=document.createElement("a");M1.href=window.URL.createObjectURL(u1),M1.download=`${h1.filename}-${+new Date}${h1.format}`,M1.click()})},[]),(0,g1.useEffect)(()=>{let h1=u.order?.direction==="asc"?"arrowUp":"arrowDown",e1=s.map(u1=>({...u1,overlayIcon:u1.id===u.order?.key?h1:null}));f(e1)},[u.order?.direction,u.order?.key]),(0,g1.useEffect)(()=>{let h1=s.map(e1=>({...e1,width:m[e1.title]}));f(h1)},[m]),(0,g1.useEffect)(()=>{let h1=x?.columnKey,e1={bgHeader:"#F0F5F9"},u1=s.map(M1=>({...M1,themeOverride:M1.id===h1?e1:null}));f(u1),L(!!x)},[x]),g1.default.createElement("div",{className:"app"},g1.default.createElement("div",{className:"navigation"},g1.default.createElement("div",{className:"navigation__info"},g1.default.createElement("h2",{className:"navigation__name"},a.name),g1.default.createElement("span",{className:"navigation__details"},j||"?"," ",j===1?"entry":"entries"),jt.pushEvent("download",{format:h1})}),g1.default.createElement("div",{className:"navigation__space"}),i&&g1.default.createElement(j_,{onRefetch:()=>t.pushEvent("refetch")}),g1.default.createElement(q_,{toggleSearch:N}),g1.default.createElement(G_,{limit:u.limit,totalRows:j,onChange:h1=>t.pushEvent("limit",{limit:h1})}),Z&&g1.default.createElement(K_,{page:u.page,maxPage:u.max_page,onPrev:x1,onNext:f1,rows:T1})),o&&g1.default.createElement(Yz,{className:"table-container",theme:wm,getCellContent:Y,columns:s,rows:T1,width:"100%",height:P1,rowHeight:44,headerHeight:W,drawHeader:X1,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:C1,onHeaderClicked:D1,showSearch:z,getCellsForSelection:!0,onSearchClose:N,headerIcons:D_,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:I,columnSelect:"none",gridSelection:V,onGridSelectionChange:h1=>C(h1),rowMarkerStartIndex:K1,minColumnWidth:W1,maxColumnAutoWidth:Bt,fillHandle:!0,onItemHovered:et,getRowThemeOverride:B1}),R&&D(g1.default.createElement(X_,{layerProps:v1,menu:x,orderBy:s1,selectAllCurrent:U,hasSorting:c})),!o&&g1.default.createElement("p",{className:"no-data"},"No data"),g1.default.createElement("div",{id:"portal"}))}function W_({supportedFormats:t,onDownload:a}){let e=t.map(r=>g1.default.createElement("option",null,r));return g1.default.createElement("div",{className:"download"},g1.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},g1.default.createElement("form",null,g1.default.createElement("select",{className:"input__icon",value:"",onChange:r=>a(r.target.value)},g1.default.createElement("option",{selected:!0,disabled:!0,value:""},"Export to"),e))))}function j_({onRefetch:t}){return g1.default.createElement("button",{className:"icon-button","aria-label":"refresh",onClick:t},g1.default.createElement(rm,null))}function q_({toggleSearch:t}){return g1.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},g1.default.createElement("button",{className:"icon-button search","aria-label":"search",onClick:t},g1.default.createElement(nm,{className:"search-icon"})))}function G_({limit:t,totalRows:a,onChange:e}){return g1.default.createElement("div",null,g1.default.createElement("form",null,g1.default.createElement("label",{className:"input-label"},"Show"),g1.default.createElement("select",{className:"input",value:t,onChange:r=>e(parseInt(r.target.value))},g1.default.createElement("option",{value:"10"},"10"),g1.default.createElement("option",{value:"20"},"20"),g1.default.createElement("option",{value:"50"},"50"),g1.default.createElement("option",{value:"100"},"100"),a?g1.default.createElement("option",{value:a},"All"):null)))}function K_({page:t,maxPage:a,onPrev:e,onNext:r,rows:n}){return g1.default.createElement("div",{className:"pagination"},g1.default.createElement("button",{className:"pagination__button",onClick:e,disabled:t===1},g1.default.createElement(am,null),g1.default.createElement("span",null,"Prev")),g1.default.createElement("div",{className:"pagination__info"},g1.default.createElement("span",null,t," of ",a||"?")),g1.default.createElement("button",{className:"pagination__button",onClick:r,disabled:t===a||n===0},g1.default.createElement("span",null,"Next"),g1.default.createElement(em,null)))}function X_({layerProps:t,selectAllCurrent:a,hasSorting:e,orderBy:r}){return g1.default.createElement("div",{className:"header-menu",...t},g1.default.createElement("button",{className:"header-menu-item button",onClick:a},"Select this column"),e&&g1.default.createElement(g1.default.Fragment,null,g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("asc")},g1.default.createElement(Jz,null),g1.default.createElement("span",null,"Sort: ascending")),g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("desc")},g1.default.createElement(tm,null),g1.default.createElement("span",null,"Sort: descending")),g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("none")},g1.default.createElement(Zz,null),g1.default.createElement("span",null,"Sort: none"))))}export{nD as init}; + `},N_={text:Na.HeaderString,number:Na.HeaderNumber,uri:Na.HeaderUri,date:Na.HeaderDate,list:Na.HeaderArray},$_={text:n1.Text,number:n1.Number,uri:n1.Uri,date:n1.Text,list:n1.Text},wm={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function nD(t,a){t.importCSS("main.css"),t.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),t.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,Lm.createRoot)(t.root).render(g1.default.createElement(U_,{ctx:t,data:a}))}function U_({ctx:t,data:a}){let e=[],r=[],n=a.content.columns.map(h1=>{let e1=h1.summary,u1=h1.label,M1=h1.key;return r.push({[u1]:250}),e1&&e.push(e1.keys.length),{title:u1,id:M1,type:h1.type,icon:N_[h1.type]||Na.HeaderString,hasMenu:h1.type!=="list",summary:e1}}),i=a.features.includes("refetch"),l=a.features.includes("export"),o=a.content.columns.length!==0,h=e.length>0,c=a.features.includes("sorting"),v=l?a.export?.formats:null,g=l&&v,d={rows:mt.empty(),columns:mt.empty()},[u,p]=(0,g1.useState)(a.content),[z,w]=(0,g1.useState)(!1),[s,f]=(0,g1.useState)(n),[m,H]=(0,g1.useState)(r),[x,y]=(0,g1.useState)(null),[R,L]=(0,g1.useState)(!1),[V,C]=(0,g1.useState)(d),[k,b]=(0,g1.useState)(0),[F,_]=(0,g1.useState)(null),j=u.total_rows,i1=o&&j>0,Z=a.features.includes("pagination")&&(j===null||j>0),d1=u.limit===j,O=44,a1=h&&i1?Math.max(...e):0,W=O+a1*22,L1=c?140:70,p1=440+W,H1=j&&j<(c?3:2)&&x?L1+W:null,P1=j>=10&&d1?p1:H1,K1=(u.page-1)*u.limit+1,W1=h?150:50,Bt=a.content.columns.length===1?800:350,T1=u.page_length,X1=(0,g1.useCallback)(h1=>{let{ctx:e1,theme:u1,rect:M1,column:I1,menuBounds:Q1,isHovered:St,isSelected:jt,spriteManager:Ut}=h1;if(I1.sourceIndex===0)return!0;if(!i1)return!1;e1.rect(M1.x,M1.y,M1.width,M1.height);let Et=10,ot=19,J1=jt?u1.textHeaderSelected:u1.textHeader,Jt=jt?u1.accentLight:u1.textDark,Mt=I1.hasMenu===!0&&St,C0=!!I1.summary,Z0=35,B0=M1.width-Z0,t0=M1.width-Z0*.7,Ma=B0/M1.width,dt=t0/M1.width,At=e1.createLinearGradient(M1.x,0,M1.x+M1.width,0),h0=fr(J1,0),wt=$a(e1,`${u1.headerFontStyle} ${u1.fontFamily}`);if(At.addColorStop(0,J1),At.addColorStop(Ma,J1),At.addColorStop(dt,h0),At.addColorStop(1,h0),e1.fillStyle=Mt?At:J1,I1.icon){let Ft=jt?"selected":I1.style==="highlight"?"special":"normal",qt=u1.headerIconSize;Ut.drawSprite(I1.icon,Ft,e1,M1.x+Et,M1.y+Et,qt,u1),I1.overlayIcon&&Ut.drawSprite(I1.overlayIcon,jt?"selected":"special",e1,M1.x+Et+ot/2,M1.y+Et+ot/2,ot,u1)}if(e1.fillText(I1.title,Q1.x-M1.width+u1.headerIconSize*2.5+14,C0?M1.y+Et+u1.headerIconSize/2+wt:Q1.y+Q1.height/2+wt),C0){let Ft=u.columns[I1.sourceIndex-1].summary,qt=Object.fromEntries(Ft.keys.map((j0,g2)=>[j0,Ft.values[g2]])),c2=13,v2=c2+Et,Ua=`${c2}px ${u1.fontFamily}`,O2=`bold ${Ua}`;e1.fillStyle=Jt,Object.entries(qt).forEach(([j0,g2],D2)=>{e1.font=O2,e1.fillText(`${j0}:`,M1.x+v2/2,M1.y+v2*(D2+1)+v2),e1.font=Ua,e1.fillText(g2,M1.x+e1.measureText(j0).width+v2,M1.y+v2*(D2+1)+v2)})}if(Mt){e1.fillStyle=At;let Ft=Q1.x+Q1.width/2-Et*1.5,qt=u1.headerIconSize/2-2,c2=new Path2D("M12 16l-6-6h12z");e1.translate(Ft,qt),e1.fill(c2)}return!0},[u]),Y=(0,g1.useCallback)(([h1,e1])=>{let u1=$_[u.columns[h1].type]||n1.Text,I1=u.data_orientation==="columns"?u.data[h1][e1]:u.data[e1][h1];return{kind:u1,data:I1,displayData:I1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[u]),N=()=>{w(!z)},s1=h1=>{let e1=h1!=="none"?x.columnKey:null;t.pushEvent("order_by",{key:e1,direction:h1??"asc"}),y(null)},x1=()=>{t.pushEvent("show_page",{page:u.page-1}),C({...d,columns:V.columns})},f1=()=>{t.pushEvent("show_page",{page:u.page+1}),C({...d,columns:V.columns})},U=()=>{let h1={...d,columns:mt.fromSingleSelection(x.column)};C(h1),y(null)},{layerProps:v1,renderLayer:D}=xm({isOpen:R,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>y(null),trigger:{getBounds:()=>({left:x?.bounds.x??0,top:x?.bounds.y??0,width:x?.bounds.width??0,height:x?.bounds.height??0,right:(x?.bounds.x??0)+(x?.bounds.width??0),bottom:(x?.bounds.y??0)+(x?.bounds.height??0)})}}),I=(0,g1.useCallback)((h1,e1)=>{H(u1=>({...u1,[h1.title]:e1}))},[]),C1=(0,g1.useCallback)((h1,e1)=>{let{summary:u1,id:M1,type:I1}=s[h1];u1||y({column:h1,bounds:e1,columnKey:M1,columnType:I1})},[]),D1=(0,g1.useCallback)((h1,{bounds:e1})=>{let{id:u1,type:M1}=s[h1];y({column:h1,bounds:e1,columnKey:u1,columnType:M1})},[]),et=(0,g1.useCallback)(h1=>{let[e1,u1]=h1.location;u1===-1&&e1===-1&&h1.kind==="header"?_([...Array.from({length:T1},(M1,I1)=>I1)]):e1===-1&&h1.kind==="cell"?_([u1]):_(null)},[T1]),B1=(0,g1.useCallback)(h1=>F?.includes(h1)?{bgCell:wm.bgHeaderHovered}:null,[F]);return(0,g1.useEffect)(()=>{V.rows?.items.length>0?b(1):b(0)},[V]),(0,g1.useEffect)(()=>{t.handleEvent("update_content",h1=>{p(h1)}),t.handleEvent("download_content",([h1,e1])=>{let u1=new Blob([e1],{type:h1.type}),M1=document.createElement("a");M1.href=window.URL.createObjectURL(u1),M1.download=`${h1.filename}-${+new Date}${h1.format}`,M1.click()})},[]),(0,g1.useEffect)(()=>{let h1=u.order?.direction==="asc"?"arrowUp":"arrowDown",e1=s.map(u1=>({...u1,overlayIcon:u1.id===u.order?.key?h1:null}));f(e1)},[u.order?.direction,u.order?.key]),(0,g1.useEffect)(()=>{let h1=s.map(e1=>({...e1,width:m[e1.title]}));f(h1)},[m]),(0,g1.useEffect)(()=>{let h1=x?.columnKey,e1={bgHeader:"#F0F5F9"},u1=s.map(M1=>({...M1,themeOverride:M1.id===h1?e1:null}));f(u1),L(!!x)},[x]),g1.default.createElement("div",{className:"app"},g1.default.createElement("div",{className:"navigation"},g1.default.createElement("div",{className:"navigation__info"},g1.default.createElement("h2",{className:"navigation__name"},a.name),g1.default.createElement("span",{className:"navigation__details"},j||"?"," ",j===1?"entry":"entries"),jt.pushEvent("download",{format:h1})}),g1.default.createElement("div",{className:"navigation__space"}),i&&g1.default.createElement(j_,{onRefetch:()=>t.pushEvent("refetch")}),g1.default.createElement(q_,{toggleSearch:N}),g1.default.createElement(G_,{limit:u.limit,totalRows:j,onChange:h1=>t.pushEvent("limit",{limit:h1})}),Z&&g1.default.createElement(K_,{page:u.page,maxPage:u.max_page,onPrev:x1,onNext:f1,rows:T1})),o&&g1.default.createElement(Yz,{className:"table-container",theme:wm,getCellContent:Y,columns:s,rows:T1,width:"100%",height:P1,rowHeight:44,headerHeight:W,drawHeader:X1,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:C1,onHeaderClicked:D1,showSearch:z,getCellsForSelection:!0,onSearchClose:N,headerIcons:D_,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:I,columnSelect:"none",gridSelection:V,onGridSelectionChange:h1=>C(h1),rowMarkerStartIndex:K1,minColumnWidth:W1,maxColumnAutoWidth:Bt,fillHandle:!0,onItemHovered:et,getRowThemeOverride:B1}),R&&D(g1.default.createElement(X_,{layerProps:v1,menu:x,orderBy:s1,selectAllCurrent:U,hasSorting:c})),!o&&g1.default.createElement("p",{className:"no-data"},"No data"),g1.default.createElement("div",{id:"portal"}))}function W_({supportedFormats:t,onDownload:a}){let e=t.map(r=>g1.default.createElement("option",null,r));return g1.default.createElement("div",{className:"download"},g1.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},g1.default.createElement("form",null,g1.default.createElement("select",{className:"input__icon",value:"",onChange:r=>a(r.target.value)},g1.default.createElement("option",{selected:!0,disabled:!0,value:""},"Export to"),e))))}function j_({onRefetch:t}){return g1.default.createElement("button",{className:"icon-button","aria-label":"refresh",onClick:t},g1.default.createElement(rm,null))}function q_({toggleSearch:t}){return g1.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},g1.default.createElement("button",{className:"icon-button search","aria-label":"search",onClick:t},g1.default.createElement(nm,{className:"search-icon"})))}function G_({limit:t,totalRows:a,onChange:e}){return g1.default.createElement("div",null,g1.default.createElement("form",null,g1.default.createElement("label",{className:"input-label"},"Show"),g1.default.createElement("select",{className:"input",value:t,onChange:r=>e(parseInt(r.target.value))},g1.default.createElement("option",{value:"10"},"10"),g1.default.createElement("option",{value:"20"},"20"),g1.default.createElement("option",{value:"50"},"50"),g1.default.createElement("option",{value:"100"},"100"),a?g1.default.createElement("option",{value:a},"All"):null)))}function K_({page:t,maxPage:a,onPrev:e,onNext:r,rows:n}){return g1.default.createElement("div",{className:"pagination"},g1.default.createElement("button",{className:"pagination__button",onClick:e,disabled:t===1},g1.default.createElement(am,null),g1.default.createElement("span",null,"Prev")),g1.default.createElement("div",{className:"pagination__info"},g1.default.createElement("span",null,t," of ",a||"?")),g1.default.createElement("button",{className:"pagination__button",onClick:r,disabled:t===a||n===0},g1.default.createElement("span",null,"Next"),g1.default.createElement(em,null)))}function X_({layerProps:t,selectAllCurrent:a,hasSorting:e,orderBy:r}){return g1.default.createElement("div",{className:"header-menu",...t},g1.default.createElement("button",{className:"header-menu-item button",onClick:a},"Select this column"),e&&g1.default.createElement(g1.default.Fragment,null,g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("asc")},g1.default.createElement(Jz,null),g1.default.createElement("span",null,"Sort: ascending")),g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("desc")},g1.default.createElement(tm,null),g1.default.createElement("span",null,"Sort: descending")),g1.default.createElement("div",{className:"header-menu-item",onClick:()=>r("none")},g1.default.createElement(Zz,null),g1.default.createElement("span",null,"Sort: none"))))}export{nD as init}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see