react-column-drag-resize-table 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +357 -315
- package/dist/react-column-drag-resize-table.css +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -59,13 +59,16 @@ export function Example() {
|
|
|
59
59
|
|
|
60
60
|
## Advanced example
|
|
61
61
|
|
|
62
|
-
Filtering, pagination,
|
|
62
|
+
Filtering, pagination, a **`renderSummary`** line, and **custom cells** with **`render`** (see [Column cells](#column-cells-accessor-and-render)):
|
|
63
63
|
|
|
64
64
|
```jsx
|
|
65
65
|
import { useMemo } from 'react';
|
|
66
66
|
import { DataTable } from 'react-column-drag-resize-table';
|
|
67
67
|
import 'react-column-drag-resize-table/styles.css';
|
|
68
68
|
|
|
69
|
+
const money = (n) =>
|
|
70
|
+
new Intl.NumberFormat(undefined, { style: 'currency', currency: 'USD' }).format(n);
|
|
71
|
+
|
|
69
72
|
const rows = [
|
|
70
73
|
{ id: 1, user_name: 'alice', amount: 100, status: 'ok' },
|
|
71
74
|
{ id: 2, user_name: 'bob', amount: 200, status: 'pending' }
|
|
@@ -76,8 +79,30 @@ export function AdvancedExample() {
|
|
|
76
79
|
() => [
|
|
77
80
|
{ id: 'id', title: 'ID', accessor: 'id' },
|
|
78
81
|
{ id: 'user_name', title: 'User', accessor: 'user_name' },
|
|
79
|
-
{
|
|
80
|
-
|
|
82
|
+
{
|
|
83
|
+
id: 'amount',
|
|
84
|
+
title: 'Amount',
|
|
85
|
+
accessor: 'amount',
|
|
86
|
+
render: (row) => money(row.amount)
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'status',
|
|
90
|
+
title: 'Status',
|
|
91
|
+
accessor: 'status',
|
|
92
|
+
render: (row) => (
|
|
93
|
+
<span
|
|
94
|
+
style={{
|
|
95
|
+
display: 'inline-block',
|
|
96
|
+
padding: '2px 8px',
|
|
97
|
+
borderRadius: 4,
|
|
98
|
+
fontSize: '0.875rem',
|
|
99
|
+
background: row.status === 'ok' ? '#e8f5e9' : '#fff3e0'
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{row.status}
|
|
103
|
+
</span>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
81
106
|
],
|
|
82
107
|
[]
|
|
83
108
|
);
|
|
@@ -148,12 +173,18 @@ export function AdvancedExample() {
|
|
|
148
173
|
|
|
149
174
|
Used for each entry in **`columns`**.
|
|
150
175
|
|
|
176
|
+
#### Column cells: `accessor` and `render`
|
|
177
|
+
|
|
178
|
+
- **Plain value:** use a **string `accessor`** with the row field name (e.g. `accessor: 'user_name'`), or omit `accessor` and rely on **`id`** matching a key on the row (`row[id]`).
|
|
179
|
+
- **Custom content:** use **`render: (row) => …`** for formatting, badges, links, or any JSX. When **`render`** is set, it **replaces** the default cell value for that column (string `accessor` is then only documentary for you; it is not used for display).
|
|
180
|
+
- A **function `accessor`** is still accepted for custom cells, but **`render`** is the preferred API for that so the column definition stays clear: *field key vs cell UI*.
|
|
181
|
+
|
|
151
182
|
| Property | Required | Type | Default | Possible values / notes | Description |
|
|
152
183
|
|----------|----------|------|---------|-------------------------|-------------|
|
|
153
184
|
| `id` | **yes** | `string` | — | Unique among columns | Stable id (order, resize, filters, storage). |
|
|
154
185
|
| `title` | **yes** | `string` | — | — | Header label. |
|
|
155
|
-
| `accessor` | no | `keyof T \| ((row: T) => ReactNode)` | — | — |
|
|
156
|
-
| `render` | no | `(row: T) => ReactNode` | — | — |
|
|
186
|
+
| `accessor` | no | `keyof T \| ((row: T) => ReactNode)` | — | — | Row field key for simple columns, or legacy function form; see [above](#column-cells-accessor-and-render). If omitted, cell value defaults to `row[id]`. |
|
|
187
|
+
| `render` | no | `(row: T) => ReactNode` | — | — | Custom cell; if set, used instead of the value from string `accessor` / `row[id]`. |
|
|
157
188
|
|
|
158
189
|
### `FilterField`
|
|
159
190
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react");function pt(s,a){if(!a||typeof a!="object")return s;let n=s;for(const c of Object.keys(a)){const x=/(.*)_from$/.exec(c),f=/(.*)_to$/.exec(c),j=/(.*)_datefrom$/.exec(c),g=/(.*)_dateto$/.exec(c);if(x){const l=x[1];if(a[c]===""||a[c]==null)continue;n=n.filter(p=>{const o=p[l];return parseFloat(o)>=parseFloat(a[c])})}else if(f){const l=f[1];if(a[c]===""||a[c]==null)continue;n=n.filter(p=>{const o=p[l];return parseFloat(o)<=parseFloat(a[c])})}else if(j){const l=j[1];if(!a[c])continue;n=n.filter(p=>{const o=p[l];return o==null?!1:String(o).slice(0,10)>=a[c]})}else if(g){const l=g[1];if(!a[c])continue;n=n.filter(p=>{const o=p[l];if(o==null)return!1;const m=String(o).slice(0,10);return a[c]>=m})}else{if(a[c]===""||a[c]==null)continue;n=n.filter(l=>l[c]==a[c])}}return n}function Bt({currentPage:s,totalPages:a,onPageChange:n,className:c="",getPageHref:x}){if(a<=1)return null;const f=[];for(let l=1;l<=a;l+=1)f.push(l);const j=l=>{l<1||l>a||l===s||n(l)},g=({page:l,children:p})=>{const o=l===s;return x?e.jsx("li",{className:o?"active":"waves-effect",children:e.jsx("a",{href:x(l),onClick:m=>{m.preventDefault(),j(l)},children:p})},l):e.jsx("li",{className:o?"active":"waves-effect",onClick:()=>j(l),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),j(l))},role:"button",tabIndex:0,children:e.jsx("a",{href:"#",children:p})},l)};return e.jsx("div",{className:`pagination react-data-table-pagination ${c}`.trim(),children:e.jsxs("ul",{className:"pagination right",children:[s===1?e.jsx("li",{className:"disabled",children:e.jsx("span",{className:"react-data-table-pagination__nav","aria-hidden":!0,children:"‹"})}):e.jsx("li",{className:"waves-effect",children:e.jsx("a",{href:"#",onClick:l=>{l.preventDefault(),j(s-1)},"aria-label":"Previous page",children:"‹"})}),f.map(l=>e.jsx(g,{page:l,children:l},l)),s===a?e.jsx("li",{className:"disabled",children:e.jsx("span",{className:"react-data-table-pagination__nav","aria-hidden":!0,children:"›"})}):e.jsx("li",{className:"waves-effect",children:e.jsx("a",{href:"#",onClick:l=>{l.preventDefault(),j(s+1)},"aria-label":"Next page",children:"›"})})]})})}const Rt="react-column-drag-resize-table:v1:order:",Jt="react-column-drag-resize-table:v1:widths:";function K(s,a){const n=Array.isArray(s)?s:[],c=new Set(a),x=[];for(const f of n)c.has(f)&&x.push(f);for(const f of a)x.includes(f)||x.push(f);return x}function qt(s){if(!s||typeof localStorage>"u")return null;try{const a=localStorage.getItem(s);if(!a)return null;const n=JSON.parse(a);return Array.isArray(n)?n:null}catch{return null}}function Ht(s,a){if(!(!s||typeof localStorage>"u"))try{localStorage.setItem(s,JSON.stringify(a))}catch{}}function Gt(s){if(!s||typeof localStorage>"u")return null;try{const a=localStorage.getItem(s);if(!a)return null;const n=JSON.parse(a);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Ut(s,a){if(!(!s||typeof localStorage>"u"))try{localStorage.setItem(s,JSON.stringify(a))}catch{}}function Qt(s,a){return s&&s.id!=null?String(s.id):String(a)}function Yt(s,a){return s.render?s.render(a):typeof s.accessor=="function"?s.accessor(a):s.accessor!=null?a[s.accessor]:a[s.id]}function Zt(s,a,n,c){const x=a!=null,f=d.useMemo(()=>(s||[]).map(_=>_.id),[s]),[j,g]=d.useState(null),l=d.useRef(c);d.useEffect(()=>{if(x)return;const _=l.current!==c;l.current=c,g(h=>{const b=c?qt(c):null;return K(h===null||_?b??f:h,f)})},[f,x,c]);const p=d.useMemo(()=>{const _=x?a:j||f,h=new Map((s||[]).map(v=>[v.id,v])),b=new Set,L=[];for(const v of _)h.has(v)&&!b.has(v)&&(L.push(v),b.add(v));for(const v of f)b.has(v)||L.push(v);return L},[s,a,j,f,x]),o=d.useMemo(()=>{const _=new Map((s||[]).map(h=>[h.id,h]));return p.map(h=>_.get(h)).filter(Boolean)},[s,p]),m=d.useCallback(_=>{const h=K(_,f);x||(g(h),c&&Ht(c,h)),n==null||n(h)},[x,n,c,f]);return{columns:o,orderedIds:p,setOrder:m}}function Vt({columns:s,rows:a,getRowId:n=Qt,loading:c=!1,emptyMessage:x="No rows to display.",summary:f,className:j="",tableClassName:g="highlight",columnOrder:l,onColumnOrderChange:p,enableColumnReorder:o=!0,columnWidths:m,onColumnWidthsChange:_,enableColumnResize:h=!0,minColumnWidth:b=64,layoutStorageKey:L,enableFiltering:v=!1,filterFields:W=[],filters:P,onFiltersChange:B,defaultFilters:mt,enablePagination:N=!1,defaultPageSize:bt=10,pageSizeOptions:R=[5,10,20,50],currentPage:C,onPageChange:S,pageSize:tt,onPageSizeChange:J,filterBarClassName:et="",paginationClassName:jt="",renderSummary:at}){const z=d.useId(),G=P!==void 0,[vt,Nt]=d.useState(()=>({...mt??{}})),w=C!==void 0,U=tt!==void 0,[yt,q]=d.useState(1),[St,gt]=d.useState(bt),I=G?P:vt,M=U?tt:St,st=d.useMemo(()=>(s||[]).map(t=>t.id),[s]),rt=d.useMemo(()=>L??[...st].sort().join("|"),[L,st]),wt=p==null&&l==null?`${Rt}${rt}`:null,k=_==null&&m===void 0?`${Jt}${rt}`:null,E=m!==void 0,[Dt,lt]=d.useState({}),F=E?m:Dt;d.useEffect(()=>{if(E||!k)return;const t=Gt(k);t&<(t)},[E,k]);const Q=d.useCallback((t,r)=>{E?_==null||_({...m,[t]:r}):lt(u=>{const i={...u,[t]:r};return _==null||_(i),k&&Ut(k,i),i})},[E,m,_,k]),Y=d.useRef(null),{columns:Z,orderedIds:ct,setOrder:it}=Zt(s,l,p,wt),T=d.useMemo(()=>v?pt(a,I):a,[a,v,I]),Mt=a.length,It=T.length,D=d.useMemo(()=>N?Math.max(1,Math.ceil(T.length/M)):1,[N,T.length,M]),nt=w?C:yt,H=d.useMemo(()=>N?Math.min(Math.max(1,nt),D):1,[N,nt,D]);d.useEffect(()=>{!N||w||q(t=>t>D?D:t)},[D,N,w]);const dt=d.useMemo(()=>{if(!N)return T;const t=(H-1)*M;return T.slice(t,t+M)},[N,T,H,M]),$t=d.useCallback(t=>{const r=Math.min(Math.max(1,t),D);w?S==null||S(r):q(r)},[D,w,S]),Lt=d.useCallback((t,r)=>{const u=typeof r=="string"?r.trim():r,i={...I};u===""||u==null?delete i[t]:i[t]=u,G?B==null||B(i):Nt(i),N&&(w?S==null||S(1):q(1))},[I,G,B,N,w,S]),ot=d.useCallback(t=>{const r=Number(t.target.value);Number.isNaN(r)||r<1||(U?J==null||J(r):gt(r),w?S==null||S(1):q(1))},[U,J,w,S]),kt=d.useCallback(t=>{var u;const r=(u=t.currentTarget)==null?void 0:u.id;r&&o&&(t.dataTransfer.setData("text",r),t.dataTransfer.effectAllowed="move")},[o]),Tt=d.useCallback(t=>{var xt,_t;if(!o)return;const r=t.dataTransfer.getData("text"),u=(_t=(xt=t.target).closest)==null?void 0:_t.call(xt,"th"),i=u==null?void 0:u.id;if(!i||!r||i===r)return;const y=[...ct],A=y.indexOf(r),O=y.indexOf(i);if(A<0||O<0)return;const $=u.getBoundingClientRect(),V=t.clientX>=$.x+parseFloat($.width)/2,X=y.filter(Xt=>Xt!==r);let ht=X.indexOf(i);V&&(ht+=1),X.splice(ht,0,r),it(X),t.dataTransfer.clearData()},[ct,o,it]),At=d.useCallback((t,r)=>{if(!h)return;r.preventDefault(),r.stopPropagation();const u=r.currentTarget.closest("th"),i=F[t]??(u?u.getBoundingClientRect().width:b);Y.current={colId:t,startX:r.clientX,startW:i},document.body.classList.add("react-data-table--resizing");const y=O=>{const $=Y.current;if(!$)return;const V=O.clientX-$.startX,X=Math.max(b,$.startW+V);Q($.colId,X)},A=()=>{Y.current=null,document.body.classList.remove("react-data-table--resizing"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",A)},[h,F,b,Q]);if(c)return e.jsx("div",{className:`table react-data-table react-data-table--loading ${j}`.trim(),children:e.jsx("div",{className:"react-data-table__spinner","aria-busy":"true","aria-label":"Loading"})});if(!s||s.length===0)return null;const zt=o||h,ut=v&&W.length>0,ft=N&&Array.isArray(R)&&R.length>0,Et=at?at({totalRows:Mt,filteredCount:It,currentPage:H,pageSize:M,totalPages:D}):f,Ft=Z.map(t=>{const r=F[t.id],u=r!=null?{width:r,minWidth:b,maxWidth:r}:{minWidth:b};return e.jsxs("th",{id:t.id,className:["react-data-table__th",o&&"react-data-table__th--draggable"].filter(Boolean).join(" "),style:u,draggable:o?"true":"false",onDrop:Tt,onDragStart:kt,onDragOver:i=>i.preventDefault(),title:o&&h?"Drag to reorder · Drag the right edge to resize":o?"Drag to reorder columns":h?"Drag the right edge to resize":void 0,children:[e.jsxs("div",{className:"react-data-table__th-main",children:[o?e.jsx("span",{className:"react-data-table__drag-grip","aria-hidden":"true",title:"Drag to reorder"}):null,e.jsx("span",{className:"react-data-table__th-title",children:t.title})]}),h?e.jsx("span",{className:"react-data-table__resize-handle",role:"separator","aria-orientation":"vertical",tabIndex:0,"aria-label":"Resize column",title:"Drag to resize",onMouseDown:i=>At(t.id,i),onKeyDown:i=>{var y;if(i.key==="ArrowLeft"||i.key==="ArrowRight"){i.preventDefault();const A=i.key==="ArrowLeft"?-8:8,O=F[t.id]??((y=i.currentTarget.closest("th"))==null?void 0:y.getBoundingClientRect().width)??b;Q(t.id,Math.max(b,O+A))}}}):null]},t.id)}),Ot=dt.length>0?dt.map((t,r)=>e.jsx("tr",{children:Z.map(u=>{const i=F[u.id],y=i!=null?{width:i,minWidth:b,maxWidth:i}:{minWidth:b};return e.jsx("td",{style:y,children:Yt(u,t)},u.id)})},n(t,r))):[e.jsx("tr",{children:e.jsx("td",{colSpan:Z.length,className:"react-data-table__empty",children:x})},"__empty")];return e.jsxs("div",{className:`table react-data-table ${j}`.trim(),children:[ut?e.jsxs("div",{className:`react-data-table__filter-bar ${et}`.trim(),role:"search",children:[W.map(t=>{const r=t.field,u=`${z}-filter-${r}`,i=I[r]!=null&&I[r]!==""?String(I[r]):"";return e.jsxs("div",{className:"react-data-table__filter-field",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:u,children:t.label}),e.jsx("input",{id:u,className:"react-data-table__filter-input",type:"text",placeholder:t.placeholder??"",value:i,onChange:y=>Lt(r,y.target.value),autoComplete:"off"})]},r)}),ft?e.jsxs("div",{className:"react-data-table__filter-field react-data-table__filter-field--page-size",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:`${z}-page-size`,children:"Rows per page"}),e.jsx("select",{id:`${z}-page-size`,className:"react-data-table__filter-select",value:M,onChange:ot,children:R.map(t=>e.jsx("option",{value:t,children:t},t))})]}):null]}):null,!ut&&N&&ft?e.jsx("div",{className:`react-data-table__toolbar react-data-table__toolbar--pagination-only ${et}`.trim(),children:e.jsxs("div",{className:"react-data-table__filter-field react-data-table__filter-field--page-size",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:`${z}-page-size-solo`,children:"Rows per page"}),e.jsx("select",{id:`${z}-page-size-solo`,className:"react-data-table__filter-select",value:M,onChange:ot,children:R.map(t=>e.jsx("option",{value:t,children:t},t))})]})}):null,zt?e.jsxs("div",{className:"react-data-table__hints",role:"note",children:[o?e.jsxs("span",{className:"react-data-table__hint react-data-table__hint--drag",children:[e.jsx("span",{className:"react-data-table__hint-icon react-data-table__hint-icon--grip","aria-hidden":"true"}),"Drag column headers to reorder"]}):null,h?e.jsxs("span",{className:"react-data-table__hint react-data-table__hint--resize",children:[e.jsx("span",{className:"react-data-table__hint-icon react-data-table__hint-icon--arrows","aria-hidden":"true"}),"Drag the right edge of a header to resize"]}):null]}):null,e.jsx("div",{className:"react-data-table__scroll",children:e.jsxs("table",{className:g,style:{tableLayout:"fixed"},children:[e.jsx("thead",{className:"grey lighten-3",children:e.jsx("tr",{children:Ft})}),e.jsx("tbody",{children:Ot})]})}),Et,N?e.jsx(Bt,{currentPage:H,totalPages:D,onPageChange:$t,className:jt}):null]})}exports.DataTable=Vt;exports.filterRows=pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),Ht=require("react-dom");function jt(s,r){if(!r||typeof r!="object")return s;let l=s;for(const c of Object.keys(r)){const h=/(.*)_from$/.exec(c),d=/(.*)_to$/.exec(c),L=/(.*)_datefrom$/.exec(c),u=/(.*)_dateto$/.exec(c);if(h){const x=h[1];if(r[c]===""||r[c]==null)continue;l=l.filter(b=>{const f=b[x];return parseFloat(f)>=parseFloat(r[c])})}else if(d){const x=d[1];if(r[c]===""||r[c]==null)continue;l=l.filter(b=>{const f=b[x];return parseFloat(f)<=parseFloat(r[c])})}else if(L){const x=L[1];if(!r[c])continue;l=l.filter(b=>{const f=b[x];return f==null?!1:String(f).slice(0,10)>=r[c]})}else if(u){const x=u[1];if(!r[c])continue;l=l.filter(b=>{const f=b[x];if(f==null)return!1;const D=String(f).slice(0,10);return r[c]>=D})}else{if(r[c]===""||r[c]==null)continue;l=l.filter(x=>x[c]==r[c])}}return l}function Jt({currentPage:s,totalPages:r,onPageChange:l,className:c=""}){if(r<=1)return null;const h=[];for(let u=1;u<=r;u+=1)h.push(u);const d=u=>{u<1||u>r||u===s||l(u)},L=({page:u,children:x})=>{const b=u===s;return e.jsx("li",{className:b?"active":"waves-effect",children:e.jsx("button",{type:"button",onClick:()=>d(u),"aria-current":b?"page":void 0,children:x})})};return e.jsx("div",{className:`pagination react-data-table-pagination ${c}`.trim(),children:e.jsxs("ul",{className:"pagination right",children:[s===1?e.jsx("li",{className:"disabled",children:e.jsx("span",{className:"react-data-table-pagination__nav","aria-hidden":"true",children:"‹"})}):e.jsx("li",{className:"waves-effect",children:e.jsx("button",{type:"button",onClick:()=>d(s-1),"aria-label":"Previous page",children:"‹"})}),h.map(u=>e.jsx(L,{page:u,children:u},u)),s===r?e.jsx("li",{className:"disabled",children:e.jsx("span",{className:"react-data-table-pagination__nav","aria-hidden":"true",children:"›"})}):e.jsx("li",{className:"waves-effect",children:e.jsx("button",{type:"button",onClick:()=>d(s+1),"aria-label":"Next page",children:"›"})})]})})}const Gt="react-column-drag-resize-table:v1:order:",Ut="react-column-drag-resize-table:v1:widths:";function et(s,r){const l=Array.isArray(s)?s:[],c=new Set(r),h=[];for(const d of l)c.has(d)&&h.push(d);for(const d of r)h.includes(d)||h.push(d);return h}function Qt(s){if(!s||typeof localStorage>"u")return null;try{const r=localStorage.getItem(s);if(!r)return null;const l=JSON.parse(r);return Array.isArray(l)?l:null}catch{return null}}function Zt(s,r){if(!(!s||typeof localStorage>"u"))try{localStorage.setItem(s,JSON.stringify(r))}catch{}}function Vt(s){if(!s||typeof localStorage>"u")return null;try{const r=localStorage.getItem(s);if(!r)return null;const l=JSON.parse(r);return l&&typeof l=="object"&&!Array.isArray(l)?l:null}catch{return null}}function Kt(s,r){if(!(!s||typeof localStorage>"u"))try{localStorage.setItem(s,JSON.stringify(r))}catch{}}function Wt(s,r){return s&&s.id!=null?String(s.id):String(r)}function Pt(s,r){return s.render?s.render(r):typeof s.accessor=="function"?s.accessor(r):s.accessor!=null?r[s.accessor]:r[s.id]}function Ct(s,r,l,c){const h=r!=null,d=o.useMemo(()=>(s||[]).map(_=>_.id),[s]),[L,u]=o.useState(null),x=o.useRef(c);o.useEffect(()=>{if(h)return;const _=x.current!==c;x.current=c,u(p=>{const m=c?Qt(c):null;return et(p===null||_?m??d:p,d)})},[d,h,c]);const b=o.useMemo(()=>{const _=h?r:L||d,p=new Map((s||[]).map(j=>[j.id,j])),m=new Set,F=[];for(const j of _)p.has(j)&&!m.has(j)&&(F.push(j),m.add(j));for(const j of d)m.has(j)||F.push(j);return F},[s,r,L,d,h]),f=o.useMemo(()=>{const _=new Map((s||[]).map(p=>[p.id,p]));return b.map(p=>_.get(p)).filter(Boolean)},[s,b]),D=o.useCallback(_=>{const p=et(_,d);h||(u(p),c&&Zt(c,p)),l==null||l(p)},[h,l,c,d]);return{columns:f,orderedIds:b,setOrder:D}}function te({columns:s,rows:r,getRowId:l=Wt,loading:c=!1,emptyMessage:h="No rows to display.",summary:d,className:L="",tableClassName:u="highlight",columnOrder:x,onColumnOrderChange:b,enableColumnReorder:f=!0,columnWidths:D,onColumnWidthsChange:_,enableColumnResize:p=!0,minColumnWidth:m=64,layoutStorageKey:F,enableFiltering:j=!1,filterFields:rt=[],filters:at,onFiltersChange:J,defaultFilters:yt,enablePagination:N=!1,defaultPageSize:Nt=10,pageSizeOptions:G=[5,10,20,50],currentPage:st,onPageChange:g,pageSize:it,onPageSizeChange:U,filterBarClassName:nt="",paginationClassName:St="",renderSummary:ct}){const B=o.useId(),V=at!==void 0,[gt,wt]=o.useState(()=>({...yt??{}})),E=st!==void 0,K=it!==void 0,[It,Q]=o.useState(1),[Mt,Lt]=o.useState(Nt),R=V?at:gt,A=K?it:Mt,lt=o.useMemo(()=>(s||[]).map(t=>t.id),[s]),ot=o.useMemo(()=>F??[...lt].sort().join("|"),[F,lt]),Dt=b==null&&x==null?`${Gt}${ot}`:null,T=_==null&&D===void 0?`${Ut}${ot}`:null,q=D!==void 0,[$t,dt]=o.useState({}),H=q?D:$t;o.useEffect(()=>{if(q||!T)return;const t=Vt(T);t&&dt(t)},[q,T]);const W=o.useCallback((t,a)=>{q?_==null||_({...D,[t]:a}):dt(n=>{const i={...n,[t]:a};return _==null||_(i),T&&Kt(T,i),i})},[q,D,_,T]),P=o.useRef(null),ut=o.useRef([]),[M,C]=o.useState(null),{columns:tt,orderedIds:Et,setOrder:ft}=Ct(s,x,b,Dt);ut.current=Et;const pt=o.useCallback((t,a,n)=>{var vt;const i=document.elementFromPoint(a,n);if(!i)return;const v=(vt=i.closest)==null?void 0:vt.call(i,"th.react-data-table__th"),S=v==null?void 0:v.id;if(!S||!t||S===t)return;const w=[...ut.current],X=w.indexOf(t),I=w.indexOf(S);if(X<0||I<0)return;const $=v.getBoundingClientRect(),O=a>=$.x+parseFloat($.width)/2,y=w.filter(qt=>qt!==t);let k=y.indexOf(S);O&&(k+=1),y.splice(k,0,t),ft(y)},[ft]),zt=o.useCallback((t,a)=>{var $,O;if(!f||!a.isPrimary||a.pointerType==="mouse"&&a.button!==0||(O=($=a.target).closest)!=null&&O.call($,".react-data-table__resize-handle"))return;const n=a.currentTarget,i=n.getBoundingClientRect(),v=a.clientX-i.left,S=a.clientY-i.top;a.preventDefault();try{n.setPointerCapture(a.pointerId)}catch{}C({colId:t.id,title:t.title,width:i.width,height:i.height,offsetX:v,offsetY:S,pointerX:a.clientX,pointerY:a.clientY});const w=a.pointerId,X=y=>{y.pointerId===w&&(y.preventDefault(),C(k=>k&&k.colId===t.id?{...k,pointerX:y.clientX,pointerY:y.clientY}:k))},I=y=>{if(y.pointerId===w){try{n.releasePointerCapture(w)}catch{}n.removeEventListener("pointermove",X),n.removeEventListener("pointerup",I),n.removeEventListener("pointercancel",I),C(null),pt(t.id,y.clientX,y.clientY)}};n.addEventListener("pointermove",X,{passive:!1}),n.addEventListener("pointerup",I),n.addEventListener("pointercancel",I)},[f,pt]),Y=o.useMemo(()=>j?jt(r,R):r,[r,j,R]),Xt=r.length,At=Y.length,z=o.useMemo(()=>N?Math.max(1,Math.ceil(Y.length/A)):1,[N,Y.length,A]),ht=E?st:It,Z=o.useMemo(()=>N?Math.min(Math.max(1,ht),z):1,[N,ht,z]);o.useEffect(()=>{!N||E||Q(t=>t>z?z:t)},[z,N,E]);const _t=o.useMemo(()=>{if(!N)return Y;const t=(Z-1)*A;return Y.slice(t,t+A)},[N,Y,Z,A]),Rt=o.useCallback(t=>{const a=Math.min(Math.max(1,t),z);E?g==null||g(a):Q(a)},[z,E,g]),kt=o.useCallback((t,a)=>{const n=typeof a=="string"?a.trim():a,i={...R};n===""||n==null?delete i[t]:i[t]=n,V?J==null||J(i):wt(i),N&&(E?g==null||g(1):Q(1))},[R,V,J,N,E,g]),xt=o.useCallback(t=>{const a=Number(t.target.value);Number.isNaN(a)||a<1||(K?U==null||U(a):Lt(a),E?g==null||g(1):Q(1))},[K,U,E,g]),Ft=o.useCallback((t,a)=>{if(!p||!a.isPrimary)return;a.preventDefault(),a.stopPropagation();const n=a.currentTarget,i=n.closest("th"),v=H[t]??(i?i.getBoundingClientRect().width:m);P.current={colId:t,startX:a.clientX,startW:v},document.body.classList.add("react-data-table--resizing");const S=a.pointerId;try{n.setPointerCapture(S)}catch{}const w=I=>{if(I.pointerId!==S)return;I.preventDefault();const $=P.current;if(!$)return;const O=I.clientX-$.startX,y=Math.max(m,$.startW+O);W($.colId,y)},X=I=>{if(I.pointerId===S){try{n.releasePointerCapture(S)}catch{}P.current=null,document.body.classList.remove("react-data-table--resizing"),n.removeEventListener("pointermove",w),n.removeEventListener("pointerup",X),n.removeEventListener("pointercancel",X)}};n.addEventListener("pointermove",w,{passive:!1}),n.addEventListener("pointerup",X),n.addEventListener("pointercancel",X)},[p,H,m,W]);if(c)return e.jsx("div",{className:`table react-data-table react-data-table--loading ${L}`.trim(),children:e.jsx("div",{className:"react-data-table__spinner","aria-busy":"true","aria-label":"Loading"})});if(!s||s.length===0)return null;const Tt=f||p,bt=j&&rt.length>0,mt=N&&Array.isArray(G)&&G.length>0,Yt=ct?ct({totalRows:Xt,filteredCount:At,currentPage:Z,pageSize:A,totalPages:z}):d,Ot=tt.map(t=>{const a=H[t.id],n=a!=null?{width:a,minWidth:m,maxWidth:a}:{minWidth:m};return e.jsxs("th",{id:t.id,scope:"col",className:["react-data-table__th",f&&"react-data-table__th--draggable",(M==null?void 0:M.colId)===t.id&&"react-data-table__th--reorder-source"].filter(Boolean).join(" "),style:n,onPointerDown:f?i=>zt(t,i):void 0,title:f&&p?"Drag to reorder · Drag the right edge to resize":f?"Drag to reorder columns":p?"Drag the right edge to resize":void 0,children:[e.jsxs("div",{className:"react-data-table__th-main",children:[f?e.jsx("span",{className:"react-data-table__drag-grip","aria-hidden":"true",title:"Drag to reorder"}):null,e.jsx("span",{className:"react-data-table__th-title",children:t.title})]}),p?e.jsx("span",{className:"react-data-table__resize-handle",role:"separator","aria-orientation":"vertical",tabIndex:0,"aria-label":"Resize column",title:"Drag to resize",onPointerDown:i=>Ft(t.id,i),onKeyDown:i=>{var v;if(i.key==="ArrowLeft"||i.key==="ArrowRight"){i.preventDefault();const S=i.key==="ArrowLeft"?-8:8,w=H[t.id]??((v=i.currentTarget.closest("th"))==null?void 0:v.getBoundingClientRect().width)??m;W(t.id,Math.max(m,w+S))}}}):null]},t.id)}),Bt=_t.length>0?_t.map((t,a)=>e.jsx("tr",{children:tt.map(n=>{const i=H[n.id],v=i!=null?{width:i,minWidth:m,maxWidth:i}:{minWidth:m};return e.jsx("td",{style:v,children:Pt(n,t)},n.id)})},l(t,a))):[e.jsx("tr",{children:e.jsx("td",{colSpan:tt.length,className:"react-data-table__empty",children:h})},"__empty")];return e.jsxs("div",{className:`table react-data-table ${L}`.trim(),children:[bt?e.jsxs("div",{className:`react-data-table__filter-bar ${nt}`.trim(),role:"search",children:[rt.map(t=>{const a=t.field,n=`${B}-filter-${a}`,i=R[a]!=null&&R[a]!==""?String(R[a]):"";return e.jsxs("div",{className:"react-data-table__filter-field",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:n,children:t.label}),e.jsx("input",{id:n,className:"react-data-table__filter-input",type:"text",placeholder:t.placeholder??"",value:i,onChange:v=>kt(a,v.target.value),autoComplete:"off"})]},a)}),mt?e.jsxs("div",{className:"react-data-table__filter-field react-data-table__filter-field--page-size",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:`${B}-page-size`,children:"Rows per page"}),e.jsx("select",{id:`${B}-page-size`,className:"react-data-table__filter-select",value:A,onChange:xt,children:G.map(t=>e.jsx("option",{value:t,children:t},t))})]}):null]}):null,!bt&&N&&mt?e.jsx("div",{className:`react-data-table__toolbar react-data-table__toolbar--pagination-only ${nt}`.trim(),children:e.jsxs("div",{className:"react-data-table__filter-field react-data-table__filter-field--page-size",children:[e.jsx("label",{className:"react-data-table__filter-label",htmlFor:`${B}-page-size-solo`,children:"Rows per page"}),e.jsx("select",{id:`${B}-page-size-solo`,className:"react-data-table__filter-select",value:A,onChange:xt,children:G.map(t=>e.jsx("option",{value:t,children:t},t))})]})}):null,Tt?e.jsxs("div",{className:"react-data-table__hints",role:"note",children:[f?e.jsxs("span",{className:"react-data-table__hint react-data-table__hint--drag",children:[e.jsx("span",{className:"react-data-table__hint-icon react-data-table__hint-icon--grip","aria-hidden":"true"}),"Drag or touch column headers to reorder"]}):null,p?e.jsxs("span",{className:"react-data-table__hint react-data-table__hint--resize",children:[e.jsx("span",{className:"react-data-table__hint-icon react-data-table__hint-icon--arrows","aria-hidden":"true"}),"Drag or touch the right edge of a header to resize"]}):null]}):null,e.jsx("div",{className:"react-data-table__scroll",children:e.jsxs("table",{className:u,style:{tableLayout:"fixed"},children:[e.jsx("thead",{className:"grey lighten-3",children:e.jsx("tr",{children:Ot})}),e.jsx("tbody",{children:Bt})]})}),Yt,N?e.jsx(Jt,{currentPage:Z,totalPages:z,onPageChange:Rt,className:St}):null,typeof document<"u"&&M&&Ht.createPortal(e.jsx("div",{className:"react-data-table__reorder-ghost",style:{position:"fixed",left:0,top:0,width:M.width,minHeight:M.height,pointerEvents:"none",zIndex:1e4,transform:`translate(${M.pointerX-M.offsetX}px, ${M.pointerY-M.offsetY}px)`,boxSizing:"border-box"},"aria-hidden":"true",children:e.jsxs("div",{className:"react-data-table__reorder-ghost-inner",children:[e.jsx("span",{className:"react-data-table__drag-grip","aria-hidden":"true"}),e.jsx("span",{className:"react-data-table__th-title",children:M.title})]})}),document.body)]})}exports.DataTable=te;exports.filterRows=jt;
|
package/dist/index.js
CHANGED
|
@@ -1,350 +1,367 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
|
|
1
|
+
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Qt, useState as J, useMemo as F, useEffect as nt, useCallback as R, useRef as st } from "react";
|
|
3
|
+
import { createPortal as Zt } from "react-dom";
|
|
4
|
+
function Vt(a, e) {
|
|
4
5
|
if (!e || typeof e != "object")
|
|
5
6
|
return a;
|
|
6
|
-
let
|
|
7
|
-
for (const
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
if (e[
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
return parseFloat(
|
|
7
|
+
let l = a;
|
|
8
|
+
for (const c of Object.keys(e)) {
|
|
9
|
+
const p = /(.*)_from$/.exec(c), o = /(.*)_to$/.exec(c), $ = /(.*)_datefrom$/.exec(c), d = /(.*)_dateto$/.exec(c);
|
|
10
|
+
if (p) {
|
|
11
|
+
const _ = p[1];
|
|
12
|
+
if (e[c] === "" || e[c] == null) continue;
|
|
13
|
+
l = l.filter((m) => {
|
|
14
|
+
const f = m[_];
|
|
15
|
+
return parseFloat(f) >= parseFloat(e[c]);
|
|
15
16
|
});
|
|
16
|
-
} else if (
|
|
17
|
-
const
|
|
18
|
-
if (e[
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return parseFloat(
|
|
17
|
+
} else if (o) {
|
|
18
|
+
const _ = o[1];
|
|
19
|
+
if (e[c] === "" || e[c] == null) continue;
|
|
20
|
+
l = l.filter((m) => {
|
|
21
|
+
const f = m[_];
|
|
22
|
+
return parseFloat(f) <= parseFloat(e[c]);
|
|
22
23
|
});
|
|
23
|
-
} else if (
|
|
24
|
-
const
|
|
25
|
-
if (!e[
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
return
|
|
24
|
+
} else if ($) {
|
|
25
|
+
const _ = $[1];
|
|
26
|
+
if (!e[c]) continue;
|
|
27
|
+
l = l.filter((m) => {
|
|
28
|
+
const f = m[_];
|
|
29
|
+
return f == null ? !1 : String(f).slice(0, 10) >= e[c];
|
|
29
30
|
});
|
|
30
|
-
} else if (
|
|
31
|
-
const
|
|
32
|
-
if (!e[
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
return e[
|
|
31
|
+
} else if (d) {
|
|
32
|
+
const _ = d[1];
|
|
33
|
+
if (!e[c]) continue;
|
|
34
|
+
l = l.filter((m) => {
|
|
35
|
+
const f = m[_];
|
|
36
|
+
if (f == null) return !1;
|
|
37
|
+
const M = String(f).slice(0, 10);
|
|
38
|
+
return e[c] >= M;
|
|
38
39
|
});
|
|
39
40
|
} else {
|
|
40
|
-
if (e[
|
|
41
|
-
|
|
41
|
+
if (e[c] === "" || e[c] == null) continue;
|
|
42
|
+
l = l.filter((_) => _[c] == e[c]);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
return
|
|
45
|
+
return l;
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function Kt({
|
|
47
48
|
currentPage: a,
|
|
48
49
|
totalPages: e,
|
|
49
|
-
onPageChange:
|
|
50
|
-
className:
|
|
51
|
-
getPageHref: h
|
|
50
|
+
onPageChange: l,
|
|
51
|
+
className: c = ""
|
|
52
52
|
}) {
|
|
53
53
|
if (e <= 1)
|
|
54
54
|
return null;
|
|
55
|
-
const
|
|
56
|
-
for (let
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}, children: p }) }, s) : /* @__PURE__ */ c(
|
|
65
|
-
"li",
|
|
66
|
-
{
|
|
67
|
-
className: d ? "active" : "waves-effect",
|
|
68
|
-
onClick: () => b(s),
|
|
69
|
-
onKeyDown: (m) => {
|
|
70
|
-
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), b(s));
|
|
71
|
-
},
|
|
72
|
-
role: "button",
|
|
73
|
-
tabIndex: 0,
|
|
74
|
-
children: /* @__PURE__ */ c("a", { href: "#", children: p })
|
|
75
|
-
},
|
|
76
|
-
s
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
return /* @__PURE__ */ c("div", { className: `pagination react-data-table-pagination ${l}`.trim(), children: /* @__PURE__ */ w("ul", { className: "pagination right", children: [
|
|
80
|
-
a === 1 ? /* @__PURE__ */ c("li", { className: "disabled", children: /* @__PURE__ */ c("span", { className: "react-data-table-pagination__nav", "aria-hidden": !0, children: "‹" }) }) : /* @__PURE__ */ c("li", { className: "waves-effect", children: /* @__PURE__ */ c(
|
|
81
|
-
"a",
|
|
55
|
+
const p = [];
|
|
56
|
+
for (let d = 1; d <= e; d += 1)
|
|
57
|
+
p.push(d);
|
|
58
|
+
const o = (d) => {
|
|
59
|
+
d < 1 || d > e || d === a || l(d);
|
|
60
|
+
}, $ = ({ page: d, children: _ }) => {
|
|
61
|
+
const m = d === a;
|
|
62
|
+
return /* @__PURE__ */ i("li", { className: m ? "active" : "waves-effect", children: /* @__PURE__ */ i(
|
|
63
|
+
"button",
|
|
82
64
|
{
|
|
83
|
-
|
|
84
|
-
onClick: (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"aria-label": "Previous page",
|
|
88
|
-
children: "‹"
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: () => o(d),
|
|
67
|
+
"aria-current": m ? "page" : void 0,
|
|
68
|
+
children: _
|
|
89
69
|
}
|
|
90
|
-
) })
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
onClick: (s) => {
|
|
97
|
-
s.preventDefault(), b(a + 1);
|
|
98
|
-
},
|
|
99
|
-
"aria-label": "Next page",
|
|
100
|
-
children: "›"
|
|
101
|
-
}
|
|
102
|
-
) })
|
|
70
|
+
) });
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ i("div", { className: `pagination react-data-table-pagination ${c}`.trim(), children: /* @__PURE__ */ x("ul", { className: "pagination right", children: [
|
|
73
|
+
a === 1 ? /* @__PURE__ */ i("li", { className: "disabled", children: /* @__PURE__ */ i("span", { className: "react-data-table-pagination__nav", "aria-hidden": "true", children: "‹" }) }) : /* @__PURE__ */ i("li", { className: "waves-effect", children: /* @__PURE__ */ i("button", { type: "button", onClick: () => o(a - 1), "aria-label": "Previous page", children: "‹" }) }),
|
|
74
|
+
p.map((d) => /* @__PURE__ */ i($, { page: d, children: d }, d)),
|
|
75
|
+
a === e ? /* @__PURE__ */ i("li", { className: "disabled", children: /* @__PURE__ */ i("span", { className: "react-data-table-pagination__nav", "aria-hidden": "true", children: "›" }) }) : /* @__PURE__ */ i("li", { className: "waves-effect", children: /* @__PURE__ */ i("button", { type: "button", onClick: () => o(a + 1), "aria-label": "Next page", children: "›" }) })
|
|
103
76
|
] }) });
|
|
104
77
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
for (const
|
|
109
|
-
|
|
110
|
-
for (const
|
|
111
|
-
|
|
112
|
-
return
|
|
78
|
+
const Wt = "react-column-drag-resize-table:v1:order:", Pt = "react-column-drag-resize-table:v1:widths:";
|
|
79
|
+
function it(a, e) {
|
|
80
|
+
const l = Array.isArray(a) ? a : [], c = new Set(e), p = [];
|
|
81
|
+
for (const o of l)
|
|
82
|
+
c.has(o) && p.push(o);
|
|
83
|
+
for (const o of e)
|
|
84
|
+
p.includes(o) || p.push(o);
|
|
85
|
+
return p;
|
|
113
86
|
}
|
|
114
|
-
function
|
|
87
|
+
function Ct(a) {
|
|
115
88
|
if (!a || typeof localStorage > "u") return null;
|
|
116
89
|
try {
|
|
117
90
|
const e = localStorage.getItem(a);
|
|
118
91
|
if (!e) return null;
|
|
119
|
-
const
|
|
120
|
-
return Array.isArray(
|
|
92
|
+
const l = JSON.parse(e);
|
|
93
|
+
return Array.isArray(l) ? l : null;
|
|
121
94
|
} catch {
|
|
122
95
|
return null;
|
|
123
96
|
}
|
|
124
97
|
}
|
|
125
|
-
function
|
|
98
|
+
function te(a, e) {
|
|
126
99
|
if (!(!a || typeof localStorage > "u"))
|
|
127
100
|
try {
|
|
128
101
|
localStorage.setItem(a, JSON.stringify(e));
|
|
129
102
|
} catch {
|
|
130
103
|
}
|
|
131
104
|
}
|
|
132
|
-
function
|
|
105
|
+
function ee(a) {
|
|
133
106
|
if (!a || typeof localStorage > "u") return null;
|
|
134
107
|
try {
|
|
135
108
|
const e = localStorage.getItem(a);
|
|
136
109
|
if (!e) return null;
|
|
137
|
-
const
|
|
138
|
-
return
|
|
110
|
+
const l = JSON.parse(e);
|
|
111
|
+
return l && typeof l == "object" && !Array.isArray(l) ? l : null;
|
|
139
112
|
} catch {
|
|
140
113
|
return null;
|
|
141
114
|
}
|
|
142
115
|
}
|
|
143
|
-
function
|
|
116
|
+
function re(a, e) {
|
|
144
117
|
if (!(!a || typeof localStorage > "u"))
|
|
145
118
|
try {
|
|
146
119
|
localStorage.setItem(a, JSON.stringify(e));
|
|
147
120
|
} catch {
|
|
148
121
|
}
|
|
149
122
|
}
|
|
150
|
-
function
|
|
123
|
+
function ae(a, e) {
|
|
151
124
|
return a && a.id != null ? String(a.id) : String(e);
|
|
152
125
|
}
|
|
153
|
-
function
|
|
126
|
+
function ie(a, e) {
|
|
154
127
|
return a.render ? a.render(e) : typeof a.accessor == "function" ? a.accessor(e) : a.accessor != null ? e[a.accessor] : e[a.id];
|
|
155
128
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
() => (a || []).map((
|
|
129
|
+
function ne(a, e, l, c) {
|
|
130
|
+
const p = e != null, o = F(
|
|
131
|
+
() => (a || []).map((h) => h.id),
|
|
159
132
|
[a]
|
|
160
|
-
), [
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
return
|
|
133
|
+
), [$, d] = J(null), _ = st(c);
|
|
134
|
+
nt(() => {
|
|
135
|
+
if (p) return;
|
|
136
|
+
const h = _.current !== c;
|
|
137
|
+
_.current = c, d((u) => {
|
|
138
|
+
const b = c ? Ct(c) : null;
|
|
139
|
+
return it(u === null || h ? b ?? o : u, o);
|
|
167
140
|
});
|
|
168
|
-
}, [
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
for (const
|
|
172
|
-
u.has(
|
|
173
|
-
for (const
|
|
174
|
-
|
|
175
|
-
return
|
|
176
|
-
}, [a, e,
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
}, [a,
|
|
180
|
-
(
|
|
181
|
-
const u =
|
|
182
|
-
|
|
141
|
+
}, [o, p, c]);
|
|
142
|
+
const m = F(() => {
|
|
143
|
+
const h = p ? e : $ || o, u = new Map((a || []).map((y) => [y.id, y])), b = /* @__PURE__ */ new Set(), B = [];
|
|
144
|
+
for (const y of h)
|
|
145
|
+
u.has(y) && !b.has(y) && (B.push(y), b.add(y));
|
|
146
|
+
for (const y of o)
|
|
147
|
+
b.has(y) || B.push(y);
|
|
148
|
+
return B;
|
|
149
|
+
}, [a, e, $, o, p]), f = F(() => {
|
|
150
|
+
const h = new Map((a || []).map((u) => [u.id, u]));
|
|
151
|
+
return m.map((u) => h.get(u)).filter(Boolean);
|
|
152
|
+
}, [a, m]), M = R(
|
|
153
|
+
(h) => {
|
|
154
|
+
const u = it(h, o);
|
|
155
|
+
p || (d(u), c && te(c, u)), l == null || l(u);
|
|
183
156
|
},
|
|
184
|
-
[
|
|
157
|
+
[p, l, c, o]
|
|
185
158
|
);
|
|
186
|
-
return { columns:
|
|
159
|
+
return { columns: f, orderedIds: m, setOrder: M };
|
|
187
160
|
}
|
|
188
|
-
function
|
|
161
|
+
function de({
|
|
189
162
|
columns: a,
|
|
190
163
|
rows: e,
|
|
191
|
-
getRowId:
|
|
192
|
-
loading:
|
|
193
|
-
emptyMessage:
|
|
194
|
-
summary:
|
|
195
|
-
className:
|
|
196
|
-
tableClassName:
|
|
197
|
-
columnOrder:
|
|
198
|
-
onColumnOrderChange:
|
|
199
|
-
enableColumnReorder:
|
|
200
|
-
columnWidths:
|
|
201
|
-
onColumnWidthsChange:
|
|
164
|
+
getRowId: l = ae,
|
|
165
|
+
loading: c = !1,
|
|
166
|
+
emptyMessage: p = "No rows to display.",
|
|
167
|
+
summary: o,
|
|
168
|
+
className: $ = "",
|
|
169
|
+
tableClassName: d = "highlight",
|
|
170
|
+
columnOrder: _,
|
|
171
|
+
onColumnOrderChange: m,
|
|
172
|
+
enableColumnReorder: f = !0,
|
|
173
|
+
columnWidths: M,
|
|
174
|
+
onColumnWidthsChange: h,
|
|
202
175
|
enableColumnResize: u = !0,
|
|
203
|
-
minColumnWidth:
|
|
204
|
-
layoutStorageKey:
|
|
205
|
-
enableFiltering:
|
|
206
|
-
filterFields:
|
|
207
|
-
filters:
|
|
208
|
-
onFiltersChange:
|
|
176
|
+
minColumnWidth: b = 64,
|
|
177
|
+
layoutStorageKey: B,
|
|
178
|
+
enableFiltering: y = !1,
|
|
179
|
+
filterFields: ct = [],
|
|
180
|
+
filters: lt,
|
|
181
|
+
onFiltersChange: Q,
|
|
209
182
|
defaultFilters: St,
|
|
210
|
-
enablePagination:
|
|
211
|
-
defaultPageSize:
|
|
212
|
-
pageSizeOptions:
|
|
213
|
-
currentPage:
|
|
214
|
-
onPageChange:
|
|
215
|
-
pageSize:
|
|
216
|
-
onPageSizeChange:
|
|
217
|
-
filterBarClassName:
|
|
218
|
-
paginationClassName:
|
|
219
|
-
renderSummary:
|
|
183
|
+
enablePagination: g = !1,
|
|
184
|
+
defaultPageSize: Lt = 10,
|
|
185
|
+
pageSizeOptions: Z = [5, 10, 20, 50],
|
|
186
|
+
currentPage: ot,
|
|
187
|
+
onPageChange: I,
|
|
188
|
+
pageSize: dt,
|
|
189
|
+
onPageSizeChange: V,
|
|
190
|
+
filterBarClassName: ft = "",
|
|
191
|
+
paginationClassName: Dt = "",
|
|
192
|
+
renderSummary: ut
|
|
220
193
|
}) {
|
|
221
|
-
const
|
|
194
|
+
const q = Qt(), P = lt !== void 0, [$t, Mt] = J(() => ({
|
|
222
195
|
...St ?? {}
|
|
223
|
-
})),
|
|
196
|
+
})), z = ot !== void 0, C = dt !== void 0, [Et, K] = J(1), [zt, Xt] = J(Lt), Y = P ? lt : $t, T = C ? dt : zt, pt = F(
|
|
224
197
|
() => (a || []).map((t) => t.id),
|
|
225
198
|
[a]
|
|
226
|
-
),
|
|
227
|
-
() =>
|
|
228
|
-
[
|
|
229
|
-
),
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
const t =
|
|
233
|
-
t &&
|
|
234
|
-
}, [
|
|
235
|
-
const
|
|
199
|
+
), ht = F(
|
|
200
|
+
() => B ?? [...pt].sort().join("|"),
|
|
201
|
+
[B, pt]
|
|
202
|
+
), At = m == null && _ == null ? `${Wt}${ht}` : null, O = h == null && M === void 0 ? `${Pt}${ht}` : null, G = M !== void 0, [Ft, _t] = J({}), U = G ? M : Ft;
|
|
203
|
+
nt(() => {
|
|
204
|
+
if (G || !O) return;
|
|
205
|
+
const t = ee(O);
|
|
206
|
+
t && _t(t);
|
|
207
|
+
}, [G, O]);
|
|
208
|
+
const tt = R(
|
|
236
209
|
(t, r) => {
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
return
|
|
210
|
+
G ? h == null || h({ ...M, [t]: r }) : _t((s) => {
|
|
211
|
+
const n = { ...s, [t]: r };
|
|
212
|
+
return h == null || h(n), O && re(O, n), n;
|
|
240
213
|
});
|
|
241
214
|
},
|
|
242
|
-
[
|
|
243
|
-
),
|
|
215
|
+
[G, M, h, O]
|
|
216
|
+
), et = st(null), mt = st([]), [D, rt] = J(null), { columns: at, orderedIds: Tt, setOrder: bt } = ne(
|
|
244
217
|
a,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
218
|
+
_,
|
|
219
|
+
m,
|
|
220
|
+
At
|
|
221
|
+
);
|
|
222
|
+
mt.current = Tt;
|
|
223
|
+
const vt = R(
|
|
224
|
+
(t, r, s) => {
|
|
225
|
+
var It;
|
|
226
|
+
const n = document.elementFromPoint(r, s);
|
|
227
|
+
if (!n) return;
|
|
228
|
+
const v = (It = n.closest) == null ? void 0 : It.call(n, "th.react-data-table__th"), w = v == null ? void 0 : v.id;
|
|
229
|
+
if (!w || !t || w === t) return;
|
|
230
|
+
const S = [...mt.current], A = S.indexOf(t), L = S.indexOf(w);
|
|
231
|
+
if (A < 0 || L < 0) return;
|
|
232
|
+
const E = v.getBoundingClientRect(), H = r >= E.x + parseFloat(E.width) / 2, N = S.filter((Ut) => Ut !== t);
|
|
233
|
+
let j = N.indexOf(w);
|
|
234
|
+
H && (j += 1), N.splice(j, 0, t), bt(N);
|
|
235
|
+
},
|
|
236
|
+
[bt]
|
|
237
|
+
), Rt = R(
|
|
238
|
+
(t, r) => {
|
|
239
|
+
var E, H;
|
|
240
|
+
if (!f || !r.isPrimary || r.pointerType === "mouse" && r.button !== 0 || (H = (E = r.target).closest) != null && H.call(E, ".react-data-table__resize-handle")) return;
|
|
241
|
+
const s = r.currentTarget, n = s.getBoundingClientRect(), v = r.clientX - n.left, w = r.clientY - n.top;
|
|
242
|
+
r.preventDefault();
|
|
243
|
+
try {
|
|
244
|
+
s.setPointerCapture(r.pointerId);
|
|
245
|
+
} catch {
|
|
246
|
+
}
|
|
247
|
+
rt({
|
|
248
|
+
colId: t.id,
|
|
249
|
+
title: t.title,
|
|
250
|
+
width: n.width,
|
|
251
|
+
height: n.height,
|
|
252
|
+
offsetX: v,
|
|
253
|
+
offsetY: w,
|
|
254
|
+
pointerX: r.clientX,
|
|
255
|
+
pointerY: r.clientY
|
|
256
|
+
});
|
|
257
|
+
const S = r.pointerId, A = (N) => {
|
|
258
|
+
N.pointerId === S && (N.preventDefault(), rt(
|
|
259
|
+
(j) => j && j.colId === t.id ? { ...j, pointerX: N.clientX, pointerY: N.clientY } : j
|
|
260
|
+
));
|
|
261
|
+
}, L = (N) => {
|
|
262
|
+
if (N.pointerId === S) {
|
|
263
|
+
try {
|
|
264
|
+
s.releasePointerCapture(S);
|
|
265
|
+
} catch {
|
|
266
|
+
}
|
|
267
|
+
s.removeEventListener("pointermove", A), s.removeEventListener("pointerup", L), s.removeEventListener("pointercancel", L), rt(null), vt(t.id, N.clientX, N.clientY);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
s.addEventListener("pointermove", A, { passive: !1 }), s.addEventListener("pointerup", L), s.addEventListener("pointercancel", L);
|
|
271
|
+
},
|
|
272
|
+
[f, vt]
|
|
273
|
+
), k = F(() => y ? Vt(e, Y) : e, [e, y, Y]), Yt = e.length, jt = k.length, X = F(() => g ? Math.max(1, Math.ceil(k.length / T)) : 1, [g, k.length, T]), yt = z ? ot : Et, W = F(() => g ? Math.min(Math.max(1, yt), X) : 1, [g, yt, X]);
|
|
274
|
+
nt(() => {
|
|
275
|
+
!g || z || K((t) => t > X ? X : t);
|
|
276
|
+
}, [X, g, z]);
|
|
277
|
+
const Nt = F(() => {
|
|
278
|
+
if (!g) return k;
|
|
279
|
+
const t = (W - 1) * T;
|
|
280
|
+
return k.slice(t, t + T);
|
|
281
|
+
}, [g, k, W, T]), Bt = R(
|
|
257
282
|
(t) => {
|
|
258
|
-
const r = Math.min(Math.max(1, t),
|
|
259
|
-
|
|
283
|
+
const r = Math.min(Math.max(1, t), X);
|
|
284
|
+
z ? I == null || I(r) : K(r);
|
|
260
285
|
},
|
|
261
|
-
[
|
|
262
|
-
),
|
|
286
|
+
[X, z, I]
|
|
287
|
+
), Ot = R(
|
|
263
288
|
(t, r) => {
|
|
264
|
-
const
|
|
265
|
-
|
|
289
|
+
const s = typeof r == "string" ? r.trim() : r, n = { ...Y };
|
|
290
|
+
s === "" || s == null ? delete n[t] : n[t] = s, P ? Q == null || Q(n) : Mt(n), g && (z ? I == null || I(1) : K(1));
|
|
266
291
|
},
|
|
267
292
|
[
|
|
268
|
-
A,
|
|
269
293
|
Y,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
294
|
+
P,
|
|
295
|
+
Q,
|
|
296
|
+
g,
|
|
297
|
+
z,
|
|
298
|
+
I
|
|
274
299
|
]
|
|
275
|
-
),
|
|
300
|
+
), gt = R(
|
|
276
301
|
(t) => {
|
|
277
302
|
const r = Number(t.target.value);
|
|
278
|
-
Number.isNaN(r) || r < 1 || (
|
|
303
|
+
Number.isNaN(r) || r < 1 || (C ? V == null || V(r) : Xt(r), z ? I == null || I(1) : K(1));
|
|
279
304
|
},
|
|
280
|
-
[
|
|
281
|
-
), kt =
|
|
282
|
-
(t) => {
|
|
283
|
-
var o;
|
|
284
|
-
const r = (o = t.currentTarget) == null ? void 0 : o.id;
|
|
285
|
-
r && d && (t.dataTransfer.setData("text", r), t.dataTransfer.effectAllowed = "move");
|
|
286
|
-
},
|
|
287
|
-
[d]
|
|
288
|
-
), Ot = L(
|
|
289
|
-
(t) => {
|
|
290
|
-
var bt, Nt;
|
|
291
|
-
if (!d) return;
|
|
292
|
-
const r = t.dataTransfer.getData("text"), o = (Nt = (bt = t.target).closest) == null ? void 0 : Nt.call(bt, "th"), i = o == null ? void 0 : o.id;
|
|
293
|
-
if (!i || !r || i === r) return;
|
|
294
|
-
const S = [...ot], k = S.indexOf(r), B = S.indexOf(i);
|
|
295
|
-
if (k < 0 || B < 0) return;
|
|
296
|
-
const T = o.getBoundingClientRect(), P = t.clientX >= T.x + parseFloat(T.width) / 2, J = S.filter((Ht) => Ht !== r);
|
|
297
|
-
let vt = J.indexOf(i);
|
|
298
|
-
P && (vt += 1), J.splice(vt, 0, r), ft(J), t.dataTransfer.clearData();
|
|
299
|
-
},
|
|
300
|
-
[ot, d, ft]
|
|
301
|
-
), jt = L(
|
|
305
|
+
[C, V, z, I]
|
|
306
|
+
), kt = R(
|
|
302
307
|
(t, r) => {
|
|
303
|
-
if (!u) return;
|
|
308
|
+
if (!u || !r.isPrimary) return;
|
|
304
309
|
r.preventDefault(), r.stopPropagation();
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
const s = r.currentTarget, n = s.closest("th"), v = U[t] ?? (n ? n.getBoundingClientRect().width : b);
|
|
311
|
+
et.current = { colId: t, startX: r.clientX, startW: v }, document.body.classList.add("react-data-table--resizing");
|
|
312
|
+
const w = r.pointerId;
|
|
313
|
+
try {
|
|
314
|
+
s.setPointerCapture(w);
|
|
315
|
+
} catch {
|
|
316
|
+
}
|
|
317
|
+
const S = (L) => {
|
|
318
|
+
if (L.pointerId !== w) return;
|
|
319
|
+
L.preventDefault();
|
|
320
|
+
const E = et.current;
|
|
321
|
+
if (!E) return;
|
|
322
|
+
const H = L.clientX - E.startX, N = Math.max(b, E.startW + H);
|
|
323
|
+
tt(E.colId, N);
|
|
324
|
+
}, A = (L) => {
|
|
325
|
+
if (L.pointerId === w) {
|
|
326
|
+
try {
|
|
327
|
+
s.releasePointerCapture(w);
|
|
328
|
+
} catch {
|
|
329
|
+
}
|
|
330
|
+
et.current = null, document.body.classList.remove("react-data-table--resizing"), s.removeEventListener("pointermove", S), s.removeEventListener("pointerup", A), s.removeEventListener("pointercancel", A);
|
|
331
|
+
}
|
|
314
332
|
};
|
|
315
|
-
|
|
333
|
+
s.addEventListener("pointermove", S, { passive: !1 }), s.addEventListener("pointerup", A), s.addEventListener("pointercancel", A);
|
|
316
334
|
},
|
|
317
|
-
[u,
|
|
335
|
+
[u, U, b, tt]
|
|
318
336
|
);
|
|
319
|
-
if (
|
|
320
|
-
return /* @__PURE__ */
|
|
337
|
+
if (c)
|
|
338
|
+
return /* @__PURE__ */ i("div", { className: `table react-data-table react-data-table--loading ${$}`.trim(), children: /* @__PURE__ */ i("div", { className: "react-data-table__spinner", "aria-busy": "true", "aria-label": "Loading" }) });
|
|
321
339
|
if (!a || a.length === 0)
|
|
322
340
|
return null;
|
|
323
|
-
const
|
|
324
|
-
totalRows:
|
|
325
|
-
filteredCount:
|
|
326
|
-
currentPage:
|
|
327
|
-
pageSize:
|
|
328
|
-
totalPages:
|
|
329
|
-
}) :
|
|
330
|
-
const r =
|
|
331
|
-
return /* @__PURE__ */
|
|
341
|
+
const Ht = f || u, wt = y && ct.length > 0, xt = g && Array.isArray(Z) && Z.length > 0, Jt = ut ? ut({
|
|
342
|
+
totalRows: Yt,
|
|
343
|
+
filteredCount: jt,
|
|
344
|
+
currentPage: W,
|
|
345
|
+
pageSize: T,
|
|
346
|
+
totalPages: X
|
|
347
|
+
}) : o, qt = at.map((t) => {
|
|
348
|
+
const r = U[t.id], s = r != null ? { width: r, minWidth: b, maxWidth: r } : { minWidth: b };
|
|
349
|
+
return /* @__PURE__ */ x(
|
|
332
350
|
"th",
|
|
333
351
|
{
|
|
334
352
|
id: t.id,
|
|
353
|
+
scope: "col",
|
|
335
354
|
className: [
|
|
336
355
|
"react-data-table__th",
|
|
337
|
-
|
|
356
|
+
f && "react-data-table__th--draggable",
|
|
357
|
+
(D == null ? void 0 : D.colId) === t.id && "react-data-table__th--reorder-source"
|
|
338
358
|
].filter(Boolean).join(" "),
|
|
339
|
-
style:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
onDragStart: kt,
|
|
343
|
-
onDragOver: (i) => i.preventDefault(),
|
|
344
|
-
title: d && u ? "Drag to reorder · Drag the right edge to resize" : d ? "Drag to reorder columns" : u ? "Drag the right edge to resize" : void 0,
|
|
359
|
+
style: s,
|
|
360
|
+
onPointerDown: f ? (n) => Rt(t, n) : void 0,
|
|
361
|
+
title: f && u ? "Drag to reorder · Drag the right edge to resize" : f ? "Drag to reorder columns" : u ? "Drag the right edge to resize" : void 0,
|
|
345
362
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
363
|
+
/* @__PURE__ */ x("div", { className: "react-data-table__th-main", children: [
|
|
364
|
+
f ? /* @__PURE__ */ i(
|
|
348
365
|
"span",
|
|
349
366
|
{
|
|
350
367
|
className: "react-data-table__drag-grip",
|
|
@@ -352,9 +369,9 @@ function se({
|
|
|
352
369
|
title: "Drag to reorder"
|
|
353
370
|
}
|
|
354
371
|
) : null,
|
|
355
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ i("span", { className: "react-data-table__th-title", children: t.title })
|
|
356
373
|
] }),
|
|
357
|
-
u ? /* @__PURE__ */
|
|
374
|
+
u ? /* @__PURE__ */ i(
|
|
358
375
|
"span",
|
|
359
376
|
{
|
|
360
377
|
className: "react-data-table__resize-handle",
|
|
@@ -363,13 +380,13 @@ function se({
|
|
|
363
380
|
tabIndex: 0,
|
|
364
381
|
"aria-label": "Resize column",
|
|
365
382
|
title: "Drag to resize",
|
|
366
|
-
|
|
367
|
-
onKeyDown: (
|
|
368
|
-
var
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
|
|
383
|
+
onPointerDown: (n) => kt(t.id, n),
|
|
384
|
+
onKeyDown: (n) => {
|
|
385
|
+
var v;
|
|
386
|
+
if (n.key === "ArrowLeft" || n.key === "ArrowRight") {
|
|
387
|
+
n.preventDefault();
|
|
388
|
+
const w = n.key === "ArrowLeft" ? -8 : 8, S = U[t.id] ?? ((v = n.currentTarget.closest("th")) == null ? void 0 : v.getBoundingClientRect().width) ?? b;
|
|
389
|
+
tt(t.id, Math.max(b, S + w));
|
|
373
390
|
}
|
|
374
391
|
}
|
|
375
392
|
}
|
|
@@ -378,99 +395,124 @@ function se({
|
|
|
378
395
|
},
|
|
379
396
|
t.id
|
|
380
397
|
);
|
|
381
|
-
}),
|
|
382
|
-
const
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
}) },
|
|
385
|
-
/* @__PURE__ */
|
|
398
|
+
}), Gt = Nt.length > 0 ? Nt.map((t, r) => /* @__PURE__ */ i("tr", { children: at.map((s) => {
|
|
399
|
+
const n = U[s.id], v = n != null ? { width: n, minWidth: b, maxWidth: n } : { minWidth: b };
|
|
400
|
+
return /* @__PURE__ */ i("td", { style: v, children: ie(s, t) }, s.id);
|
|
401
|
+
}) }, l(t, r))) : [
|
|
402
|
+
/* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i("td", { colSpan: at.length, className: "react-data-table__empty", children: p }) }, "__empty")
|
|
386
403
|
];
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
|
|
404
|
+
return /* @__PURE__ */ x("div", { className: `table react-data-table ${$}`.trim(), children: [
|
|
405
|
+
wt ? /* @__PURE__ */ x(
|
|
389
406
|
"div",
|
|
390
407
|
{
|
|
391
|
-
className: `react-data-table__filter-bar ${
|
|
408
|
+
className: `react-data-table__filter-bar ${ft}`.trim(),
|
|
392
409
|
role: "search",
|
|
393
410
|
children: [
|
|
394
|
-
|
|
395
|
-
const r = t.field,
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
411
|
+
ct.map((t) => {
|
|
412
|
+
const r = t.field, s = `${q}-filter-${r}`, n = Y[r] != null && Y[r] !== "" ? String(Y[r]) : "";
|
|
413
|
+
return /* @__PURE__ */ x("div", { className: "react-data-table__filter-field", children: [
|
|
414
|
+
/* @__PURE__ */ i("label", { className: "react-data-table__filter-label", htmlFor: s, children: t.label }),
|
|
415
|
+
/* @__PURE__ */ i(
|
|
399
416
|
"input",
|
|
400
417
|
{
|
|
401
|
-
id:
|
|
418
|
+
id: s,
|
|
402
419
|
className: "react-data-table__filter-input",
|
|
403
420
|
type: "text",
|
|
404
421
|
placeholder: t.placeholder ?? "",
|
|
405
|
-
value:
|
|
406
|
-
onChange: (
|
|
422
|
+
value: n,
|
|
423
|
+
onChange: (v) => Ot(r, v.target.value),
|
|
407
424
|
autoComplete: "off"
|
|
408
425
|
}
|
|
409
426
|
)
|
|
410
427
|
] }, r);
|
|
411
428
|
}),
|
|
412
|
-
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
429
|
+
xt ? /* @__PURE__ */ x("div", { className: "react-data-table__filter-field react-data-table__filter-field--page-size", children: [
|
|
430
|
+
/* @__PURE__ */ i("label", { className: "react-data-table__filter-label", htmlFor: `${q}-page-size`, children: "Rows per page" }),
|
|
431
|
+
/* @__PURE__ */ i(
|
|
415
432
|
"select",
|
|
416
433
|
{
|
|
417
|
-
id: `${
|
|
434
|
+
id: `${q}-page-size`,
|
|
418
435
|
className: "react-data-table__filter-select",
|
|
419
|
-
value:
|
|
420
|
-
onChange:
|
|
421
|
-
children:
|
|
436
|
+
value: T,
|
|
437
|
+
onChange: gt,
|
|
438
|
+
children: Z.map((t) => /* @__PURE__ */ i("option", { value: t, children: t }, t))
|
|
422
439
|
}
|
|
423
440
|
)
|
|
424
441
|
] }) : null
|
|
425
442
|
]
|
|
426
443
|
}
|
|
427
444
|
) : null,
|
|
428
|
-
!
|
|
445
|
+
!wt && g && xt ? /* @__PURE__ */ i(
|
|
429
446
|
"div",
|
|
430
447
|
{
|
|
431
|
-
className: `react-data-table__toolbar react-data-table__toolbar--pagination-only ${
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
448
|
+
className: `react-data-table__toolbar react-data-table__toolbar--pagination-only ${ft}`.trim(),
|
|
449
|
+
children: /* @__PURE__ */ x("div", { className: "react-data-table__filter-field react-data-table__filter-field--page-size", children: [
|
|
450
|
+
/* @__PURE__ */ i("label", { className: "react-data-table__filter-label", htmlFor: `${q}-page-size-solo`, children: "Rows per page" }),
|
|
451
|
+
/* @__PURE__ */ i(
|
|
435
452
|
"select",
|
|
436
453
|
{
|
|
437
|
-
id: `${
|
|
454
|
+
id: `${q}-page-size-solo`,
|
|
438
455
|
className: "react-data-table__filter-select",
|
|
439
|
-
value:
|
|
440
|
-
onChange:
|
|
441
|
-
children:
|
|
456
|
+
value: T,
|
|
457
|
+
onChange: gt,
|
|
458
|
+
children: Z.map((t) => /* @__PURE__ */ i("option", { value: t, children: t }, t))
|
|
442
459
|
}
|
|
443
460
|
)
|
|
444
461
|
] })
|
|
445
462
|
}
|
|
446
463
|
) : null,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
"Drag column headers to reorder"
|
|
464
|
+
Ht ? /* @__PURE__ */ x("div", { className: "react-data-table__hints", role: "note", children: [
|
|
465
|
+
f ? /* @__PURE__ */ x("span", { className: "react-data-table__hint react-data-table__hint--drag", children: [
|
|
466
|
+
/* @__PURE__ */ i("span", { className: "react-data-table__hint-icon react-data-table__hint-icon--grip", "aria-hidden": "true" }),
|
|
467
|
+
"Drag or touch column headers to reorder"
|
|
451
468
|
] }) : null,
|
|
452
|
-
u ? /* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
"Drag the right edge of a header to resize"
|
|
469
|
+
u ? /* @__PURE__ */ x("span", { className: "react-data-table__hint react-data-table__hint--resize", children: [
|
|
470
|
+
/* @__PURE__ */ i("span", { className: "react-data-table__hint-icon react-data-table__hint-icon--arrows", "aria-hidden": "true" }),
|
|
471
|
+
"Drag or touch the right edge of a header to resize"
|
|
455
472
|
] }) : null
|
|
456
473
|
] }) : null,
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ i("div", { className: "react-data-table__scroll", children: /* @__PURE__ */ x("table", { className: d, style: { tableLayout: "fixed" }, children: [
|
|
475
|
+
/* @__PURE__ */ i("thead", { className: "grey lighten-3", children: /* @__PURE__ */ i("tr", { children: qt }) }),
|
|
476
|
+
/* @__PURE__ */ i("tbody", { children: Gt })
|
|
460
477
|
] }) }),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
478
|
+
Jt,
|
|
479
|
+
g ? /* @__PURE__ */ i(
|
|
480
|
+
Kt,
|
|
464
481
|
{
|
|
465
|
-
currentPage:
|
|
466
|
-
totalPages:
|
|
467
|
-
onPageChange:
|
|
468
|
-
className:
|
|
482
|
+
currentPage: W,
|
|
483
|
+
totalPages: X,
|
|
484
|
+
onPageChange: Bt,
|
|
485
|
+
className: Dt
|
|
469
486
|
}
|
|
470
|
-
) : null
|
|
487
|
+
) : null,
|
|
488
|
+
typeof document < "u" && D && Zt(
|
|
489
|
+
/* @__PURE__ */ i(
|
|
490
|
+
"div",
|
|
491
|
+
{
|
|
492
|
+
className: "react-data-table__reorder-ghost",
|
|
493
|
+
style: {
|
|
494
|
+
position: "fixed",
|
|
495
|
+
left: 0,
|
|
496
|
+
top: 0,
|
|
497
|
+
width: D.width,
|
|
498
|
+
minHeight: D.height,
|
|
499
|
+
pointerEvents: "none",
|
|
500
|
+
zIndex: 1e4,
|
|
501
|
+
transform: `translate(${D.pointerX - D.offsetX}px, ${D.pointerY - D.offsetY}px)`,
|
|
502
|
+
boxSizing: "border-box"
|
|
503
|
+
},
|
|
504
|
+
"aria-hidden": "true",
|
|
505
|
+
children: /* @__PURE__ */ x("div", { className: "react-data-table__reorder-ghost-inner", children: [
|
|
506
|
+
/* @__PURE__ */ i("span", { className: "react-data-table__drag-grip", "aria-hidden": "true" }),
|
|
507
|
+
/* @__PURE__ */ i("span", { className: "react-data-table__th-title", children: D.title })
|
|
508
|
+
] })
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
document.body
|
|
512
|
+
)
|
|
471
513
|
] });
|
|
472
514
|
}
|
|
473
515
|
export {
|
|
474
|
-
|
|
475
|
-
|
|
516
|
+
de as DataTable,
|
|
517
|
+
Vt as filterRows
|
|
476
518
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rdt-border: #c5cae9;--rdt-border-divider: #e0e0e0;--rdt-border-cell: #f0f0f0;--rdt-accent: #3949ab;--rdt-accent-soft: #e8eaf6;--rdt-accent-muted: #5c6bc0;--rdt-accent-blue: #1976d2;--rdt-accent-blue-soft: #e3f2fd;--rdt-pagination-active-bg: var(--rdt-accent-blue);--rdt-pagination-hover-bg: var(--rdt-accent-blue-soft);--rdt-spinner-track: var(--rdt-accent-blue-soft);--rdt-spinner-thumb: var(--rdt-accent-blue);--rdt-resize-hover: rgba(57, 73, 171, .35);--rdt-resize-handle-mid: rgba(25, 118, 210, .12);--rdt-resize-handle-end: rgba(25, 118, 210, .22);--rdt-resize-handle-inset: rgba(25, 118, 210, .12);--rdt-focus-ring: rgba(57, 73, 171, .2);--rdt-focus-outline-contrast: #ffffff;--rdt-surface: #ffffff;--rdt-surface-elevated: #f5f5f5;--rdt-surface-muted: #eeeeee;--rdt-surface-toolbar-start: #ffffff;--rdt-surface-toolbar-end: #f5f5f5;--rdt-surface-hints-start: #fafbff;--rdt-surface-hints-end: #eef0fb;--rdt-surface-header-start: #f5f5f5;--rdt-surface-header-end: #eeeeee;--rdt-surface-summary: #eeeeee;--rdt-surface-row-hover: #f5f5f5;--rdt-text: #424242;--rdt-text-strong: #263238;--rdt-text-muted: #757575;--rdt-text-label: #546e7a;--rdt-text-hint-drag: #283593;--rdt-text-hint-resize: #1565c0;--rdt-input-border: #b0bec5;--rdt-input-border-hover: #78909c;--rdt-pagination-active-fg: #ffffff;--rdt-pagination-disabled-opacity: .45;--rdt-hint-icon-opacity: .85;--rdt-drag-grip-opacity: .85}.react-data-table{color:var(--rdt-text)}.react-data-table__filter-bar,.react-data-table__toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 24px;padding:10px 12px;border:1px solid var(--rdt-border);border-bottom:none;border-radius:6px 6px 0 0;background:linear-gradient(180deg,var(--rdt-surface-toolbar-start) 0%,var(--rdt-surface-toolbar-end) 100%)}.react-data-table__toolbar--pagination-only{justify-content:flex-end}.react-data-table__filter-field{display:flex;flex-direction:column;gap:4px;min-width:140px}.react-data-table__filter-field--page-size{margin-left:auto;min-width:0}.react-data-table__filter-label{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--rdt-text-label)}.react-data-table__filter-input,.react-data-table__filter-select{font:inherit;font-size:13px;padding:6px 10px;border:1px solid var(--rdt-input-border);border-radius:4px;background:var(--rdt-surface);color:var(--rdt-text-strong);min-width:0;max-width:100%}.react-data-table__filter-input:hover,.react-data-table__filter-select:hover{border-color:var(--rdt-input-border-hover)}.react-data-table__filter-input:focus,.react-data-table__filter-select:focus{outline:none;border-color:var(--rdt-accent);box-shadow:0 0 0 2px var(--rdt-focus-ring)}.react-data-table__filter-bar+.react-data-table__hints{border-top:none;border-radius:0}.react-data-table__toolbar--pagination-only+.react-data-table__hints{border-top:none;border-radius:0}.react-data-table__filter-bar+.react-data-table__scroll,.react-data-table__toolbar--pagination-only+.react-data-table__scroll{border-top:none;border-radius:0 0 6px 6px}.react-data-table__hints{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1.25rem;font-size:12px;line-height:1.35;color:var(--rdt-text);border:1px solid var(--rdt-border);border-bottom:none;border-radius:6px 6px 0 0;padding:8px 12px;background:linear-gradient(180deg,var(--rdt-surface-hints-start) 0%,var(--rdt-surface-hints-end) 100%)}.react-data-table__hint{display:inline-flex;align-items:center;gap:.45rem}.react-data-table__hint--drag{color:var(--rdt-text-hint-drag)}.react-data-table__hint--resize{color:var(--rdt-text-hint-resize)}.react-data-table__hint-icon{flex-shrink:0;width:1.1rem;height:1rem;border-radius:3px}.react-data-table__hint-icon--grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.3px);background-size:5px 5px;background-position:0 0;opacity:var(--rdt-hint-icon-opacity)}.react-data-table__hint-icon--arrows{background:var(--rdt-accent-soft);border:1px solid var(--rdt-border);position:relative}.react-data-table__hint-icon--arrows:before,.react-data-table__hint-icon--arrows:after{content:"";position:absolute;top:50%;width:0;height:0;margin-top:-3px;border-style:solid}.react-data-table__hint-icon--arrows:before{left:2px;border-width:3px 4px 3px 0;border-color:transparent transparent transparent var(--rdt-accent)}.react-data-table__hint-icon--arrows:after{right:2px;border-width:3px 0 3px 4px;border-color:transparent var(--rdt-accent) transparent transparent}.react-data-table__scroll{overflow-x:auto;border:1px solid var(--rdt-border);border-radius:6px}.react-data-table__hints+.react-data-table__scroll{border-top:none;border-radius:0 0 6px 6px}.react-data-table table{width:100%;border-collapse:separate;border-spacing:0}.react-data-table__th{position:relative;text-align:left;padding:0;vertical-align:middle;border-right:1px solid var(--rdt-border-divider);background:linear-gradient(180deg,var(--rdt-surface-header-start) 0%,var(--rdt-surface-header-end) 100%);-webkit-user-select:none;user-select:none}.react-data-table__th:last-child{border-right:none}.react-data-table__th--draggable{cursor:grab}.react-data-table__th--draggable:active{cursor:grabbing}.react-data-table__th-main{display:flex;align-items:center;gap:.4rem;min-height:2.5rem;padding:8px 14px 8px 12px}.react-data-table__drag-grip{flex-shrink:0;width:10px;height:18px;border-radius:3px;cursor:grab;background-image:radial-gradient(var(--rdt-accent-muted) 1.2px,transparent 1.3px);background-size:4px 4px;background-position:0 0;opacity:var(--rdt-drag-grip-opacity)}.react-data-table__th--draggable:active .react-data-table__drag-grip{cursor:grabbing}.react-data-table__th-title{flex:1;min-width:0;font-weight:600;font-size:12px;letter-spacing:.02em}.react-data-table__resize-handle{position:absolute;top:0;right:0;width:10px;height:100%;margin:0;padding:0;cursor:col-resize;z-index:2;border-radius:0 0 2px;background:linear-gradient(90deg,transparent 0%,transparent 35%,var(--rdt-resize-handle-mid) 50%,var(--rdt-resize-handle-end) 100%);box-shadow:inset 1px 0 0 var(--rdt-resize-handle-inset)}.react-data-table__resize-handle:hover,.react-data-table__resize-handle:focus-visible{outline:none;background:linear-gradient(90deg,transparent 0%,var(--rdt-resize-hover) 100%);box-shadow:inset 2px 0 0 var(--rdt-accent)}.react-data-table__resize-handle:focus-visible{box-shadow:inset 2px 0 0 var(--rdt-accent),0 0 0 2px var(--rdt-focus-outline-contrast),0 0 0 4px var(--rdt-accent)}body.react-data-table--resizing{cursor:col-resize!important;-webkit-user-select:none!important;user-select:none!important}.react-data-table tbody td{padding:8px 12px;border-bottom:1px solid var(--rdt-border-divider);border-right:1px solid var(--rdt-border-cell);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.react-data-table tbody td:last-child{border-right:none}.react-data-table__empty{text-align:center;color:var(--rdt-text-muted);padding:24px!important}.react-data-table--loading{min-height:120px;display:flex;align-items:center;justify-content:center}.react-data-table__spinner{width:40px;height:40px;border:3px solid var(--rdt-spinner-track);border-top-color:var(--rdt-spinner-thumb);border-radius:50%;animation:react-data-table-spin .8s linear infinite}@keyframes react-data-table-spin{to{transform:rotate(360deg)}}.summary-line{padding:16px 20px;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px 40px;background:var(--rdt-surface-summary)}.summary-line .bold{font-weight:700}.react-data-table-pagination ul.pagination{list-style:none;display:flex;flex-wrap:wrap;gap:4px;margin:12px 0 0;padding:0;justify-content:flex-end;align-items:center}.react-data-table-pagination ul.pagination li{display:inline-block;min-width:32px;text-align:center}.react-data-table-pagination ul.pagination li a,.react-data-table-pagination ul.pagination span{display:inline-block;padding:6px 10px;text-decoration:none;color:var(--rdt-text);border-radius:2px}.react-data-table-pagination ul.pagination li.active a{background:var(--rdt-pagination-active-bg);color:var(--rdt-pagination-active-fg)}.react-data-table-pagination ul.pagination li.waves-effect a:hover{background:var(--rdt-pagination-hover-bg)}.react-data-table-pagination ul.pagination li.disabled{opacity:var(--rdt-pagination-disabled-opacity);pointer-events:none}thead.grey.lighten-3{background-color:var(--rdt-surface-muted)}table.highlight tbody tr:hover{background-color:var(--rdt-surface-row-hover)}
|
|
1
|
+
:root{--rdt-border: #c5cae9;--rdt-border-divider: #e0e0e0;--rdt-border-cell: #f0f0f0;--rdt-accent: #3949ab;--rdt-accent-soft: #e8eaf6;--rdt-accent-muted: #5c6bc0;--rdt-accent-blue: #1976d2;--rdt-accent-blue-soft: #e3f2fd;--rdt-pagination-active-bg: var(--rdt-accent-blue);--rdt-pagination-hover-bg: var(--rdt-accent-blue-soft);--rdt-spinner-track: var(--rdt-accent-blue-soft);--rdt-spinner-thumb: var(--rdt-accent-blue);--rdt-resize-hover: rgba(57, 73, 171, .35);--rdt-resize-handle-mid: rgba(25, 118, 210, .12);--rdt-resize-handle-end: rgba(25, 118, 210, .22);--rdt-resize-handle-inset: rgba(25, 118, 210, .12);--rdt-focus-ring: rgba(57, 73, 171, .2);--rdt-focus-outline-contrast: #ffffff;--rdt-surface: #ffffff;--rdt-surface-elevated: #f5f5f5;--rdt-surface-muted: #eeeeee;--rdt-surface-toolbar-start: #ffffff;--rdt-surface-toolbar-end: #f5f5f5;--rdt-surface-hints-start: #fafbff;--rdt-surface-hints-end: #eef0fb;--rdt-surface-header-start: #f5f5f5;--rdt-surface-header-end: #eeeeee;--rdt-surface-summary: #eeeeee;--rdt-surface-row-hover: #f5f5f5;--rdt-text: #424242;--rdt-text-strong: #263238;--rdt-text-muted: #757575;--rdt-text-label: #546e7a;--rdt-text-hint-drag: #283593;--rdt-text-hint-resize: #1565c0;--rdt-input-border: #b0bec5;--rdt-input-border-hover: #78909c;--rdt-pagination-active-fg: #ffffff;--rdt-pagination-disabled-opacity: .45;--rdt-hint-icon-opacity: .85;--rdt-drag-grip-opacity: .85}.react-data-table{color:var(--rdt-text)}.react-data-table__filter-bar,.react-data-table__toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 24px;padding:10px 12px;border:1px solid var(--rdt-border);border-bottom:none;border-radius:6px 6px 0 0;background:linear-gradient(180deg,var(--rdt-surface-toolbar-start) 0%,var(--rdt-surface-toolbar-end) 100%)}.react-data-table__toolbar--pagination-only{justify-content:flex-end}.react-data-table__filter-field{display:flex;flex-direction:column;gap:4px;min-width:140px}.react-data-table__filter-field--page-size{margin-left:auto;min-width:0}.react-data-table__filter-label{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--rdt-text-label)}.react-data-table__filter-input,.react-data-table__filter-select{font:inherit;font-size:13px;padding:6px 10px;border:1px solid var(--rdt-input-border);border-radius:4px;background:var(--rdt-surface);color:var(--rdt-text-strong);min-width:0;max-width:100%}.react-data-table__filter-input:hover,.react-data-table__filter-select:hover{border-color:var(--rdt-input-border-hover)}.react-data-table__filter-input:focus,.react-data-table__filter-select:focus{outline:none;border-color:var(--rdt-accent);box-shadow:0 0 0 2px var(--rdt-focus-ring)}.react-data-table__filter-bar+.react-data-table__hints{border-top:none;border-radius:0}.react-data-table__toolbar--pagination-only+.react-data-table__hints{border-top:none;border-radius:0}.react-data-table__filter-bar+.react-data-table__scroll,.react-data-table__toolbar--pagination-only+.react-data-table__scroll{border-top:none;border-radius:0 0 6px 6px}.react-data-table__hints{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1.25rem;font-size:12px;line-height:1.35;color:var(--rdt-text);border:1px solid var(--rdt-border);border-bottom:none;border-radius:6px 6px 0 0;padding:8px 12px;background:linear-gradient(180deg,var(--rdt-surface-hints-start) 0%,var(--rdt-surface-hints-end) 100%)}.react-data-table__hint{display:inline-flex;align-items:center;gap:.45rem}.react-data-table__hint--drag{color:var(--rdt-text-hint-drag)}.react-data-table__hint--resize{color:var(--rdt-text-hint-resize)}.react-data-table__hint-icon{flex-shrink:0;width:1.1rem;height:1rem;border-radius:3px}.react-data-table__hint-icon--grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.3px);background-size:5px 5px;background-position:0 0;opacity:var(--rdt-hint-icon-opacity)}.react-data-table__hint-icon--arrows{background:var(--rdt-accent-soft);border:1px solid var(--rdt-border);position:relative}.react-data-table__hint-icon--arrows:before,.react-data-table__hint-icon--arrows:after{content:"";position:absolute;top:50%;width:0;height:0;margin-top:-3px;border-style:solid}.react-data-table__hint-icon--arrows:before{left:2px;border-width:3px 4px 3px 0;border-color:transparent transparent transparent var(--rdt-accent)}.react-data-table__hint-icon--arrows:after{right:2px;border-width:3px 0 3px 4px;border-color:transparent var(--rdt-accent) transparent transparent}.react-data-table__scroll{overflow-x:auto;border:1px solid var(--rdt-border);border-radius:6px}.react-data-table__hints+.react-data-table__scroll{border-top:none;border-radius:0 0 6px 6px}.react-data-table table{width:100%;border-collapse:separate;border-spacing:0}.react-data-table__th{position:relative;text-align:left;padding:0;vertical-align:middle;border-right:1px solid var(--rdt-border-divider);background:linear-gradient(180deg,var(--rdt-surface-header-start) 0%,var(--rdt-surface-header-end) 100%);-webkit-user-select:none;user-select:none}.react-data-table__th:last-child{border-right:none}.react-data-table__th--draggable{cursor:grab;touch-action:none}.react-data-table__th--draggable:active{cursor:grabbing}.react-data-table__th--reorder-source{opacity:.35}.react-data-table__reorder-ghost{will-change:transform}.react-data-table__reorder-ghost-inner{display:flex;align-items:center;gap:.4rem;min-height:2.5rem;padding:8px 14px 8px 12px;box-sizing:border-box;border:1px solid var(--rdt-border);border-radius:4px;background:linear-gradient(180deg,var(--rdt-surface-header-start) 0%,var(--rdt-surface-header-end) 100%);box-shadow:0 8px 24px #0000002e,0 2px 8px #3949ab33;color:var(--rdt-text-strong);-webkit-user-select:none;user-select:none}.react-data-table__th-main{display:flex;align-items:center;gap:.4rem;min-height:2.5rem;padding:8px 14px 8px 12px}.react-data-table__drag-grip{flex-shrink:0;width:10px;height:18px;border-radius:3px;cursor:grab;background-image:radial-gradient(var(--rdt-accent-muted) 1.2px,transparent 1.3px);background-size:4px 4px;background-position:0 0;opacity:var(--rdt-drag-grip-opacity)}.react-data-table__th--draggable:active .react-data-table__drag-grip{cursor:grabbing}.react-data-table__th-title{flex:1;min-width:0;font-weight:600;font-size:12px;letter-spacing:.02em}.react-data-table__resize-handle{position:absolute;top:0;right:0;width:10px;height:100%;margin:0;padding:0;cursor:col-resize;touch-action:none;z-index:2;border-radius:0 0 2px;background:linear-gradient(90deg,transparent 0%,transparent 35%,var(--rdt-resize-handle-mid) 50%,var(--rdt-resize-handle-end) 100%);box-shadow:inset 1px 0 0 var(--rdt-resize-handle-inset)}.react-data-table__resize-handle:hover,.react-data-table__resize-handle:focus-visible{outline:none;background:linear-gradient(90deg,transparent 0%,var(--rdt-resize-hover) 100%);box-shadow:inset 2px 0 0 var(--rdt-accent)}.react-data-table__resize-handle:focus-visible{box-shadow:inset 2px 0 0 var(--rdt-accent),0 0 0 2px var(--rdt-focus-outline-contrast),0 0 0 4px var(--rdt-accent)}body.react-data-table--resizing{cursor:col-resize!important;-webkit-user-select:none!important;user-select:none!important;touch-action:none!important}.react-data-table tbody td{padding:8px 12px;border-bottom:1px solid var(--rdt-border-divider);border-right:1px solid var(--rdt-border-cell);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.react-data-table tbody td:last-child{border-right:none}.react-data-table__empty{text-align:center;color:var(--rdt-text-muted);padding:24px!important}.react-data-table--loading{min-height:120px;display:flex;align-items:center;justify-content:center}.react-data-table__spinner{width:40px;height:40px;border:3px solid var(--rdt-spinner-track);border-top-color:var(--rdt-spinner-thumb);border-radius:50%;animation:react-data-table-spin .8s linear infinite}@keyframes react-data-table-spin{to{transform:rotate(360deg)}}.summary-line{padding:16px 20px;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px 40px;background:var(--rdt-surface-summary)}.summary-line .bold{font-weight:700}.react-data-table-pagination ul.pagination{list-style:none;display:flex;flex-wrap:wrap;gap:4px;margin:12px 0 0;padding:0;justify-content:flex-end;align-items:center}.react-data-table-pagination ul.pagination li{display:inline-block;min-width:32px;text-align:center}.react-data-table-pagination ul.pagination li a,.react-data-table-pagination ul.pagination li button,.react-data-table-pagination ul.pagination span{display:inline-block;padding:6px 10px;text-decoration:none;color:var(--rdt-text);border-radius:2px}.react-data-table-pagination ul.pagination li button{margin:0;border:none;background:none;font:inherit;line-height:inherit;cursor:pointer;text-align:center}.react-data-table-pagination ul.pagination li.active a,.react-data-table-pagination ul.pagination li.active button{background:var(--rdt-pagination-active-bg);color:var(--rdt-pagination-active-fg)}.react-data-table-pagination ul.pagination li.waves-effect a:hover,.react-data-table-pagination ul.pagination li.waves-effect button:hover{background:var(--rdt-pagination-hover-bg)}.react-data-table-pagination ul.pagination li.disabled{opacity:var(--rdt-pagination-disabled-opacity);pointer-events:none}thead.grey.lighten-3{background-color:var(--rdt-surface-muted)}table.highlight tbody tr:hover{background-color:var(--rdt-surface-row-hover)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-column-drag-resize-table",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "React data table component: draggable column reorder, resizable columns, text filters, pagination, optional localStorage column layout, CSS variables theming. For admin dashboards and internal tools.",
|
|
5
5
|
"author": "Armine Inants",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
-
"README.md"
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
22
23
|
],
|
|
23
24
|
"sideEffects": [
|
|
24
25
|
"**/*.css"
|