UNPKG

@deepbag/react-grid-x

Version:

ReactGridX is a customizable and flexible React table component that supports pagination, dynamic rendering of table data, and customizable column rendering. It provides an easy-to-use interface for displaying tabular data with configurable columns, pagin

2 lines 20.6 kB
import Fe,{useEffect as te,useMemo as Le,useState as T}from"react";import{jsx as Ce}from"react/jsx-runtime";var ye=({color:a="currentColor",svgPath:i,style:c={},className:n="",...x})=>{let b=i.match(/width=["']?(\d+)["']?/),t=i.match(/height=["']?(\d+)["']?/),r=b?`${b[1]}px`:"24px",w=t?`${t[1]}px`:"24px";return Ce("span",{className:n,style:{display:"inline-block",width:r,height:w,...c},dangerouslySetInnerHTML:{__html:i.replace(/currentColor/g,a)},...x})},h=ye;import{jsx as C,jsxs as E}from"react/jsx-runtime";var Ne=({currentPage:a,totalPages:i,rowsPerPage:c,totalRows:n,onPageChange:x,onRowsPerPageChange:b,rowsPerPageOptions:t=[5,10,15],style:r={},loading:w=!1,mode:F="light"})=>{let o=F==="dark";return E("div",{className:"rgx-arrow-pagination",style:{...r["rgx-arrow-pagination"]},children:[E("div",{className:`rgx-arrow-pagination-info ${o&&"rgx-arrow-pagination-info-dark"}`,style:{...r["rgx-arrow-pagination-info"],...o&&{...r["rgx-arrow-pagination-info-dark"]}},children:["Showing ",(a-1)*c+1," to"," ",Math.min(a*c,n)," of ",n]}),E("div",{className:"rgx-arrow-pagination-row-per-page",style:{...r["rgx-arrow-pagination-row-per-page"]},children:[E("div",{className:"rgx-arrow-pagination-rows-per-page",style:{...r["rgx-arrow-pagination-rows-per-page"]},children:[C("label",{htmlFor:"rowsPerPage",className:`rgx-arrow-pagination-rows-per-page-label ${o&&"rgx-arrow-pagination-rows-per-page-label-dark"}`,style:{...r["rgx-arrow-pagination-rows-per-page-label"],...o&&{...r["rgx-arrow-pagination-rows-per-page-label-dark"]}},children:"Rows per page:"}),C("select",{id:"rowsPerPage",className:`rgx-arrow-pagination-rows-per-page-select ${o&&"rgx-arrow-pagination-rows-per-page-select-dark"}`,style:{...r["rgx-arrow-pagination-rows-per-page-select"],...o&&{...r["rgx-arrow-pagination-rows-per-page-select-dark"]}},value:c,onChange:m=>b(Number(m.target.value)),disabled:w,children:t?.map(m=>C("option",{value:m,children:m},m))})]}),E("div",{className:"rgx-arrow-pagination-controls",style:{...r["rgx-arrow-pagination-controls"]},children:[C("button",{disabled:a===1||w,onClick:()=>x(1),className:`rgx-arrow-pagination-button ${o&&"rgx-arrow-pagination-button-dark"}`,style:{...r["rgx-arrow-pagination-button"],...o&&{...r["rgx-arrow-pagination-button-dark"]}},children:C(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-left"><path d="m11 17-5-5 5-5"/><path d="m18 17-5-5 5-5"/></svg>'})}),C("button",{disabled:a===1||w,onClick:()=>x(a-1),className:`rgx-arrow-pagination-button ${o&&"rgx-arrow-pagination-button-dark"}`,style:{...r["rgx-arrow-pagination-button"],...o&&{...r["rgx-arrow-pagination-button-dark"]}},children:C(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left"><path d="m15 18-6-6 6-6"/></svg>'})}),E("div",{className:`rgx-arrow-pagination-page-of ${o&&"rgx-arrow-pagination-page-of-dark"}`,style:{...r["rgx-arrow-pagination-page-of"],...o&&{...r["rgx-arrow-pagination-page-of-dark"]}},children:["Page ",a," of ",i]}),C("button",{disabled:a===i||w,onClick:()=>x(a+1),className:`rgx-arrow-pagination-button ${o&&"rgx-arrow-pagination-button-dark"}`,style:{...r["rgx-arrow-pagination-button"],...o&&{...r["rgx-arrow-pagination-button-dark"]}},children:C(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"/></svg>'})}),C("button",{disabled:a===i||w,onClick:()=>x(i),className:`rgx-arrow-pagination-button ${o&&"rgx-arrow-pagination-button-dark"}`,style:{...r["rgx-arrow-pagination-button"],...o&&{...r["rgx-arrow-pagination-button-dark"]}},children:C(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevrons-right"><path d="m6 17 5-5-5-5"/><path d="m13 17 5-5-5-5"/></svg>'})})]})]})]})},Y=Ne;import{jsx as R,jsxs as H}from"react/jsx-runtime";var Re=({currentPage:a,totalPages:i,rowsPerPage:c,totalRows:n,onPageChange:x,onRowsPerPageChange:b,rowsPerPageOptions:t=[5,10,15],style:r={},loading:w=!1,mode:F="light"})=>{let o=F==="dark",L=(()=>{let p=[];if(i<=4)for(let X=1;X<=i;X++)p.push(X);else{a>2?p.push(1,"..."):p.push(1);let X=Math.max(2,a-1),V=Math.min(i-1,a+1);for(let f=X;f<=V;f++)p.push(f);a<i-1?p.push("...",i):p.push(i)}return p})();return H("div",{className:"rgx-table-pagination",style:{...r["rgx-table-pagination"]},children:[H("div",{className:`rgx-table-pagination-info ${o&&"rgx-table-pagination-info-dark"}`,style:{...r["rgx-table-pagination-info"],...o&&{...r["rgx-table-pagination-info-dark"]}},children:["Showing ",(a-1)*c+1," to"," ",Math.min(a*c,n)," of ",n]}),H("div",{className:"rgx-table-pagination-row-per-page",style:{...r["rgx-table-pagination-row-per-page"]},children:[H("div",{className:"rgx-table-pagination-rows-per-page",style:{...r["rgx-table-pagination-rows-per-page"]},children:[R("label",{htmlFor:"rowsPerPage",className:`rgx-table-pagination-rows-per-page-label ${o&&"rgx-table-pagination-rows-per-page-label-dark"}`,style:{...r["rgx-table-pagination-rows-per-page-label"],...o&&{...r["rgx-table-pagination-rows-per-page-label-dark"]}},children:"Rows per page:"}),R("select",{id:"rowsPerPage",className:`rgx-table-pagination-rows-per-page-select ${o&&"rgx-table-pagination-rows-per-page-select-dark"}`,style:{...r["rgx-table-pagination-rows-per-page-select"],...o&&{...r["rgx-table-pagination-rows-per-page-select-dark"]}},value:c,onChange:p=>b(Number(p.target.value)),disabled:w,children:t?.map(p=>R("option",{value:p,children:p},p))})]}),H("div",{className:"rgx-table-pagination-controls",style:{...r["rgx-table-pagination-controls"]},children:[R("button",{disabled:a===1||w,onClick:()=>x(a-1),className:`rgx-table-pagination-button-icon ${o&&"rgx-table-pagination-button-icon-dark"}`,style:{...r["rgx-table-pagination-button-icon"],...o&&{...r["rgx-table-pagination-button-icon-dark"]}},children:R(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left"><path d="m15 18-6-6 6-6"/></svg>'})}),L.map((p,M)=>typeof p=="number"?R("button",{className:`rgx-table-pagination-button ${a===p&&"rgx-table-pagination-active"} ${o&&"rgx-table-pagination-button-dark"}`,style:{...r["rgx-table-pagination-button"],...a===p&&{...r["rgx-table-pagination-button-active"]},...o&&{...r["rgx-table-pagination-button-dark"]}},onClick:()=>x(p),disabled:w,children:p},M):R("button",{disabled:!0,className:`rgx-table-pagination-button rgx-table-pagination-ellipsis ${o&&"rgx-table-pagination-button-dark rgx-table-pagination-ellipsis-dark"}`,style:{...r["rgx-table-pagination-button"],...r["rgx-table-pagination-ellipsis"],...o&&{...r["rgx-table-pagination-button-dark"],...r["rgx-table-pagination-ellipsis-dark"]},cursor:"default",opacity:.6},children:p},M)),R("button",{disabled:a===i||w,onClick:()=>x(a+1),className:`rgx-table-pagination-button-icon ${o&&"rgx-table-pagination-button-icon-dark"}`,style:{...r["rgx-table-pagination-button-icon"],...o&&{...r["rgx-table-pagination-button-icon-dark"]}},children:R(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"/></svg>'})})]})]})]})},Z=Re;import{jsx as Xe,jsxs as Ge}from"react/jsx-runtime";var Me=({content:a,children:i,style:c={}})=>Ge("div",{className:"rgx-tooltip-container",style:{...c["rgx-tooltip-container"]},children:[i,Xe("span",{className:"rgx-tooltip-text",style:{minWidth:String(a)?.length*5,...c["rgx-tooltip-text"]},children:a})]}),S=Me;import{jsx as he,jsxs as $e}from"react/jsx-runtime";var Ae=({message:a="Loading, please wait...",style:i={}})=>$e("div",{className:"rgx-loader-container",style:{...i["rgx-loader-container"]},children:[he("div",{className:"rgx-loader-spinner",style:{...i["rgx-loader-spinner"]}}),he("div",{className:"rgx-loader-message",style:{...i["rgx-loader-message"]},children:a})]}),ee=Ae;import{useRef as Pe,useEffect as Be}from"react";import{jsx as je,jsxs as Ee}from"react/jsx-runtime";var Te=({children:a,isOpen:i,onClose:c,style:n={},mode:x="light"})=>{let b=x==="dark",t=Pe(null);return Be(()=>{let r=w=>{t.current&&!t.current.contains(w.target)&&c()};return i&&document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[i,c]),i?Ee("div",{className:`rgx-popover-content rgx-popover-show ${b&&"rgx-popover-content-dark"}`,ref:t,style:{...n["rgx-popover-content"],...n["rgx-popover-show"],...b&&{...n["rgx-popover-content-dark"]}},children:[je("div",{className:`rgx-popover-arrow ${b&&"rgx-popover-arrow-dark"}`,style:{...n["rgx-popover-arrow"],...b&&{...n["rgx-popover-arrow-dark"]}}}),a," "]}):null},xe=Te;function k(...a){let i=[];function c(n){n&&(typeof n=="string"?n.trim()&&i.push(n.trim()):Array.isArray(n)?n.forEach(c):typeof n=="object"&&n!==null&&Object.entries(n).forEach(([x,b])=>{b&&i.push(x)}))}return a.forEach(c),i.join(" ")}import{Fragment as De,jsx as l,jsxs as u}from"react/jsx-runtime";var Ve=({columns:a,data:i,theme:c="rgx-theme",rowsPerPageOptions:n=[5,10,15],paginationType:x="rgx-table-pagination",paginationStyle:b={},tableStyle:t={},loaderStyle:r={},popupStyle:w={},tooltipStyle:F={},serverSidePagination:o=!1,onPaginationAndRowSizeChange:m,totalRows:L,serverSideSorting:p=!1,onSorting:M,onRowClick:X,expandedComponent:V,loading:f=!1,loaderComponent:re=({style:d})=>l(ee,{style:d}),multiColumnSort:be=!1,selectionCheckbox:ae=!1,onSelectionCheck:W,rowPerPage:_=10,page:q=1,mode:z="light"})=>{let d=z==="dark",[J,O]=T(q),[D,we]=T(i),[G,K]=T([]),[$,oe]=T(n[0]),[U,ie]=T(null),[Q,se]=T(null),[j,ne]=T({selectedRows:[],selectAllChecked:!1}),le=e=>{O(e),ie(null),m&&m(e,$)},de=e=>{oe(e),O(1),m&&m(1,e)},ue=()=>{let e=!j.selectAllChecked,g=e?i.map(s=>s.id):[];ne({selectedRows:g,selectAllChecked:e}),W&&W(g,e)},ke=e=>{let g=j.selectedRows.includes(e)?j.selectedRows.filter(N=>N!==e):[...j.selectedRows,e],s=g.length===i.length;ne({selectedRows:g,selectAllChecked:s}),W&&W(g,s)},I=(e,g)=>{K(s=>{if(!be)return[{key:e.key,direction:g||(s[0]?.key===e.key&&s[0].direction==="asc"?"desc":"asc")}];let N=s.find(y=>y.key===e.key),v;return N?v=s.map(y=>y.key===e.key?{key:y.key,direction:g||(y.direction==="asc"?"desc":"asc")}:y):v=[...s,{key:e.key,direction:g||"asc"}],v=v.filter(y=>y.direction!==void 0),p&&M?M(v):K(v),v})},me=()=>{K([]),p&&M&&M([])},pe=Le(()=>p?i:[...i].sort((g,s)=>{for(let{key:N,direction:v}of G){let y=a.find(A=>A.key===N),P=g[N],B=s[N];if(y?.onSort){let A=y.onSort(P,B,v);if(A!==0)return A}else if(typeof P=="string"&&typeof B=="string"){let A=P.localeCompare(B);if(A!==0)return v==="asc"?A:-A}else if(typeof P=="number"&&typeof B=="number"&&P!==B)return v==="asc"?P-B:B-P}return 0}),[i,G,a,p]),ge=Math.ceil(o?(L||0)/$:D.length/$),fe=o?D:D.slice((J-1)*$,J*$),ce=a.reduce((e,g)=>e+(g.width?g.width:100),0),ve={"rgx-table-pagination":l(Z,{currentPage:J,totalPages:ge,rowsPerPage:$,totalRows:o?L??0:D.length,onPageChange:le,onRowsPerPageChange:de,rowsPerPageOptions:n,style:b,loading:f,mode:z}),"rgx-arrow-pagination":l(Y,{currentPage:J,totalPages:ge,rowsPerPage:$,totalRows:o?L??0:D.length,onPageChange:le,onRowsPerPageChange:de,rowsPerPageOptions:n,style:b,loading:f,mode:z})};return te(()=>{we(pe)},[pe]),te(()=>{oe(n?.includes(_)?_:n[0])},[_]),te(()=>{o&&q&&_&&O(q)},[q,o,_]),u("div",{className:c,children:[u("div",{className:k("rgx-table-container",f&&"rgx-table-container-loading",d&&"rgx-table-container-dark"),style:{...t["rgx-table-container"],...f&&{...t["rgx-table-container-loading"]},...d&&{...t["rgx-table-container-dark"]}},children:[f&&re&&re({style:r}),u("table",{className:"rgx-table",style:{...ce<1150?{width:"100%"}:{minWidth:`${ce}px`},...t["rgx-table"]},children:[l("thead",{className:k("rgx-table-head",d&&"rgx-table-head-dark"),style:{...t["rgx-table-head"],...d&&{...t["rgx-table-head-dark"]}},children:u("tr",{className:"rgx-table-head-tr",style:{...t["rgx-table-head-tr"]},children:[ae&&l("th",{className:k("rgx-table-head-th-checkbox",d&&"rgx-table-head-th-checkbox-dark"),style:{width:"20px",...t["rgx-table-head-th-checkbox"],...d&&{...t["rgx-table-head-th-checkbox-dark"]}},children:l("input",{type:"checkbox",className:"rgx-table-header-checkbox",style:{...t["rgx-table-header-checkbox"]},checked:j.selectAllChecked,onChange:ue})}),a?.map((e,g)=>l("th",{className:k("rgx-table-head-th",d&&"rgx-table-head-th-dark"),style:{textAlign:"left",width:e.width?`${e.width}px`:"100px",...t["rgx-table-head-th"],...d&&{...t["rgx-table-head-th-dark"]}},children:u("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[u("div",{onClick:()=>e.sortable&&I(e),style:{display:"flex",cursor:e.sortable?"pointer":"default"},children:[e.name," ",e.sortable&&l(h,{svgPath:G.some(s=>s.key===e.key)?G.find(s=>s.key===e.key)?.direction==="asc"?'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-wide-narrow"><path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h10"/><path d="M11 16h7"/><path d="M11 20h4"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-wide-narrow"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-up"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="m21 8-4-4-4 4"/><path d="M17 4v16"/></svg>',className:"rgx-table-sort-icon",style:{marginLeft:"8px",...t["rgx-table-sort-icon"]}})]}),e.sortable&&u("div",{children:[l("div",{style:{cursor:"pointer",display:"inline-block"},onClick:()=>{se(Q===e.key?null:e.key)},children:l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>',className:"rgx-table-ellipsis-vertical-icon",style:{marginRight:"8px",marginTop:"4px",marginBottom:"-4px",...t["rgx-table-ellipsis-vertical-icon"]}})}),Q===e.key&&u(xe,{isOpen:Q===e.key,onClose:()=>{se(null)},style:w,mode:z,children:[G.find(s=>s.key===e.key)?.direction==="desc"&&u("div",{className:k("rgx-table-popup-items",d&&"rgx-table-popup-items-dark"),style:{...t["rgx-table-popup-items"],...d&&{...t["rgx-table-popup-items-dark"]}},onClick:()=>{e.sortable&&I(e,"asc")},children:[l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-wide-narrow"><path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h10"/><path d="M11 16h7"/><path d="M11 20h4"/></svg>',style:{marginRight:"8px",fontSize:"14px",...t["rgx-table-asc-sort-icon"]},className:"rgx-table-asc-sort-icon"}),l("span",{children:"Sort Ascending"})]}),G.find(s=>s.key===e.key)?.direction==="asc"&&u("div",{className:k("rgx-table-popup-items",d&&"rgx-table-popup-items-dark"),style:{...t["rgx-table-popup-items"],...d&&{...t["rgx-table-popup-items-dark"]}},onClick:()=>{e.sortable&&I(e,"desc")},children:[l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-wide-narrow"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/></svg>',style:{marginRight:"8px",fontSize:"14px",...t["rgx-table-desc-sort-icon"]},className:"rgx-table-desc-sort-icon"}),l("span",{children:"Sort Descending"})]}),!G.some(s=>s.key===e.key)&&u(De,{children:[u("div",{className:k("rgx-table-popup-items",d&&"rgx-table-popup-items-dark"),style:{...t["rgx-table-popup-items"],...d&&{...t["rgx-table-popup-items-dark"]}},onClick:()=>{e.sortable&&I(e,"asc")},children:[l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-wide-narrow"><path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h10"/><path d="M11 16h7"/><path d="M11 20h4"/></svg>',style:{marginRight:"8px",fontSize:"14px",...t["rgx-table-asc-sort-icon"]},className:"rgx-table-asc-sort-icon"}),l("span",{children:"Sort Ascending"})]}),u("div",{className:k("rgx-table-popup-items",d&&"rgx-table-popup-items-dark"),style:{...t["rgx-table-popup-items"],...d&&{...t["rgx-table-popup-items-dark"]}},onClick:()=>{e.sortable&&I(e,"desc")},children:[l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-wide-narrow"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/></svg>',style:{marginRight:"8px",fontSize:"14px",...t["rgx-table-desc-sort-icon"]},className:"rgx-table-desc-sort-icon"}),l("span",{children:"Sort Descending"})]})]}),!!G.some(s=>s.key===e.key)&&u("div",{className:k("rgx-table-popup-items",d&&"rgx-table-popup-items-dark"),style:{...t["rgx-table-popup-items"],...d&&{...t["rgx-table-popup-items-dark"]}},onClick:()=>{me()},children:[l(h,{svgPath:'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-up"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="m21 8-4-4-4 4"/><path d="M17 4v16"/></svg>',style:{marginRight:"8px",fontSize:"14px",...t["rgx-table-asc-desc-sort-icon"]},className:"rgx-table-asc-desc-sort-icon"}),l("span",{children:"Clear Sort"})]})]})]})]})},g))]})}),l("tbody",{className:k("rgx-table-body",f&&"rgx-table-tobody-loading"),style:{...t["rgx-table-body"],...f&&{...t["rgx-table-tobody-loading"]}},children:fe.map((e,g)=>u(Fe.Fragment,{children:[u("tr",{className:k("rgx-table-body-tr",U===g&&"rgx-table-body-tr-expanded",d&&"rgx-table-body-tr-dark"),style:{...t["rgx-table-body-tr"],...U===g&&{...t["rgx-table-body-tr-expanded"]},...d&&{...t["rgx-table-body-tr-dark"]}},onClick:()=>{V&&ie(U===g?null:g),X&&X(e)},children:[ae&&l("td",{className:k("rgx-table-body-td-checkbox",d&&"rgx-table-body-td-checkbox-dark"),style:{width:"20px",...t["rgx-table-body-td-checkbox"],...d&&{...t["rgx-table-body-td-checkbox-dark"]}},children:l("input",{type:"checkbox",className:"rgx-table-row-checkbox",style:{...t["rgx-table-row-checkbox"]},checked:j.selectedRows.includes(e.id),onChange:()=>ke(e.id)})}),a.map((s,N)=>l("td",{className:k("rgx-table-body-td",d&&"rgx-table-body-td-dark"),style:{width:s.width||"auto",...t["rgx-table-body-td"],...d&&{...t["rgx-table-body-td-dark"]}},children:s.tooltip?l(S,{content:s.tooltipCustomContent?s.tooltipCustomContent(e):e[s.key],style:F,children:s.render?s.render(e):e[s.key]??""}):s.render?s.render(e):e[s.key]??""},N))]},e.id||g),U===g&&V&&l("tr",{className:"rgx-table-expanded-row-tr",style:{...t["rgx-table-expanded-row-tr"]},children:l("td",{colSpan:a.length,className:"rgx-table-expanded-row-td",style:{...t["rgx-table-expanded-row-td"]},children:V(e)})})]},e.id||g))})]})]}),ve[x]]})},_e=Ve;export{Y as RGXArrowPagination,ee as RGXLoader,h as RGXSVGIcon,Z as RGXTablePagination,S as RGXTooltip,_e as ReactGridX}; //# sourceMappingURL=index.mjs.map