better-table 1.1.0 → 1.2.0

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 CHANGED
@@ -2,13 +2,29 @@
2
2
 
3
3
  A modern, flexible, and fully typed data table component for React.
4
4
 
5
+ ## ✨ Features
6
+
7
+ - 🔍 **Search & Filter** — Global search with debounce + Floating Filters (inline in header) / Filter Panel / Both
8
+ - 📊 **Sorting** — Single & multi-sort with 3-state cycle (asc → desc → unsorted)
9
+ - 👁️ **Column Visibility** — Interactive toggle to show/hide columns at runtime
10
+ - ✅ **Selection** — Single or multiple row selection with global actions
11
+ - 📱 **Responsive** — Card layout for mobile, collapsible toolbar
12
+ - 🎬 **Row Actions** — Callbacks, modals, links + overflow menu
13
+ - 📄 **Pagination** — Configurable page sizes, quick jumper
14
+ - 🌐 **i18n** — Preset locales (EN/ES/PT) + custom overrides
15
+ - 🎨 **Customizable** — CSS variables, custom renderers, class overrides
16
+ - 💪 **TypeScript** — Full type safety with generics
17
+
5
18
  ## 📚 Documentation
6
19
 
7
- - **[Getting Started](https://github.com/jrodrigopuca/BetterTable#readme)** - Installation and basic usage
8
- - **[Architecture](./docs/architecture.md)** - Design patterns and technical decisions
9
- - **[Components](./docs/components.md)** - Detailed API reference
10
- - **[Interaction Flows](./docs/interaction-flows.md)** - Sequence diagrams and component interactions
11
- - **[Known Issues](./docs/known-issues.md)** - Known bugs and limitations
20
+ | Document | Description |
21
+ | ------------------------------------------------ | -------------------------------------------- |
22
+ | [Architecture](./docs/architecture.md) | Design patterns and technical decisions |
23
+ | [Components](./docs/components.md) | Detailed API reference for all components |
24
+ | [Interaction Flows](./docs/interaction-flows.md) | Sequence diagrams and component interactions |
25
+ | [Known Issues](./docs/known-issues.md) | Known bugs, limitations and workarounds |
26
+ | [Development](./docs/development.md) | Contributing guide and local setup |
27
+ | [Roadmap](./docs/ROADMAP.md) | Future improvements and features |
12
28
 
13
29
  ## 🚀 Quick Start
14
30
 
@@ -16,23 +32,206 @@ A modern, flexible, and fully typed data table component for React.
16
32
  npm install better-table
17
33
  ```
18
34
 
19
- ```typescript
20
- import { BetterTable } from 'better-table';
21
- import 'better-table/styles.css';
35
+ ### Basic Usage
36
+
37
+ ```tsx
38
+ import { BetterTable } from "better-table";
39
+ import "better-table/styles.css";
22
40
 
23
41
  const MyTable = () => {
24
- const data = [
25
- { id: 1, name: 'Juan', email: 'juan@example.com' },
26
- { id: 2, name: 'María', email: 'maria@example.com' }
27
- ];
42
+ const data = [
43
+ { id: 1, name: "Juan", email: "juan@example.com", active: true },
44
+ { id: 2, name: "María", email: "maria@example.com", active: false },
45
+ ];
28
46
 
29
- const columns = [
30
- { id: 'name', accessor: 'name', header: 'Name' },
31
- { id: 'email', accessor: 'email', header: 'Email' }
32
- ];
47
+ const columns = [
48
+ { id: "name", accessor: "name", header: "Name" },
49
+ { id: "email", accessor: "email", header: "Email" },
50
+ { id: "active", accessor: "active", header: "Status", type: "boolean" },
51
+ ];
33
52
 
34
- return <BetterTable data={data} columns={columns} />;
53
+ return <BetterTable data={data} columns={columns} />;
35
54
  };
36
55
  ```
37
56
 
38
- For full documentation, see the [main README](https://github.com/jrodrigopuca/BetterTable#readme).
57
+ ### Multi-Sort & Column Visibility
58
+
59
+ ```tsx
60
+ <BetterTable
61
+ data={users}
62
+ columns={columns}
63
+ rowKey="id"
64
+ multiSort // Each column cycles: unsorted → asc → desc → unsorted
65
+ columnVisibility // Show/hide columns dropdown in toolbar
66
+ onMultiSortChange={(sorts) => console.log(sorts)}
67
+ onColumnVisibilityChange={(hidden) => console.log(hidden)}
68
+ />
69
+ ```
70
+
71
+ ### With Search, Pagination & Actions
72
+
73
+ ```tsx
74
+ <BetterTable
75
+ data={users}
76
+ columns={columns}
77
+ rowKey="id"
78
+ searchable
79
+ searchDebounceMs={300}
80
+ selectable
81
+ pagination={{ pageSize: 10, showSizeChanger: true }}
82
+ rowActions={[
83
+ {
84
+ id: "edit",
85
+ label: "Edit",
86
+ icon: "✏️",
87
+ mode: "callback",
88
+ onClick: (row) => handleEdit(row),
89
+ },
90
+ {
91
+ id: "delete",
92
+ label: "Delete",
93
+ mode: "callback",
94
+ variant: "danger",
95
+ onClick: (row) => handleDelete(row),
96
+ },
97
+ ]}
98
+ globalActions={[
99
+ {
100
+ id: "export",
101
+ label: "Export",
102
+ onClick: (selected, all) => exportData(all),
103
+ },
104
+ ]}
105
+ maxVisibleActions={3}
106
+ onSelectionChange={(selected) => console.log("Selected:", selected)}
107
+ />
108
+ ```
109
+
110
+ ### Filter Mode
111
+
112
+ ```tsx
113
+ {
114
+ /* Default: floating filters inline in header row */
115
+ }
116
+ <BetterTable data={data} columns={columns} />;
117
+
118
+ {
119
+ /* Panel: collapsible filter panel (toggle button in toolbar) */
120
+ }
121
+ <BetterTable data={data} columns={columns} filterMode="panel" />;
122
+
123
+ {
124
+ /* Both: floating filters + panel toggle */
125
+ }
126
+ <BetterTable data={data} columns={columns} filterMode="both" />;
127
+ ```
128
+
129
+ ### Custom Cell Rendering
130
+
131
+ ```tsx
132
+ const columns = [
133
+ { id: "name", accessor: "name", header: "Name" },
134
+ {
135
+ id: "status",
136
+ accessor: "active",
137
+ header: "Status",
138
+ cell: (value) => (
139
+ <span className={value ? "badge-success" : "badge-danger"}>
140
+ {value ? "✅ Active" : "❌ Inactive"}
141
+ </span>
142
+ ),
143
+ },
144
+ {
145
+ id: "profile",
146
+ accessor: "user.profile.avatar", // Dot notation for nested data
147
+ header: "Avatar",
148
+ cell: (value) => <img src={value} alt="avatar" />,
149
+ },
150
+ ];
151
+ ```
152
+
153
+ ### Internationalization (i18n)
154
+
155
+ BetterTable defaults to English. Choose a preset locale or provide custom overrides:
156
+
157
+ ```tsx
158
+ // Spanish preset
159
+ <BetterTable data={data} columns={columns} locale="es" />
160
+
161
+ // Portuguese preset
162
+ <BetterTable data={data} columns={columns} locale="pt" />
163
+
164
+ // Custom overrides (merged over English defaults)
165
+ <BetterTable
166
+ data={data}
167
+ columns={columns}
168
+ locale={{ noData: "Nothing to show", search: "Find" }}
169
+ />
170
+ ```
171
+
172
+ Available presets: `en` (default), `es`, `pt`. You can also import them directly:
173
+
174
+ ```tsx
175
+ import { locales, defaultLocale } from "better-table";
176
+ // locales.en, locales.es, locales.pt
177
+ ```
178
+
179
+ ````
180
+
181
+ ## 🎨 Customization
182
+
183
+ ### CSS Variables
184
+
185
+ ```css
186
+ :root {
187
+ --bt-primary-color: #3b82f6;
188
+ --bt-border-color: #e5e7eb;
189
+ --bt-hover-bg: #f3f4f6;
190
+ --bt-selected-bg: #dbeafe;
191
+ --bt-font-size-medium: 14px;
192
+ }
193
+ ````
194
+
195
+ ### Custom Class Names
196
+
197
+ ```tsx
198
+ <BetterTable
199
+ data={data}
200
+ columns={columns}
201
+ classNames={{
202
+ container: "my-table-container",
203
+ table: "my-table",
204
+ row: "my-row",
205
+ cell: "my-cell",
206
+ }}
207
+ />
208
+ ```
209
+
210
+ ## 📦 API Reference
211
+
212
+ See [Components Documentation](./docs/components.md) for complete API reference.
213
+
214
+ ### Main Props
215
+
216
+ | Prop | Type | Default | Description |
217
+ | ------------------- | --------------------------------- | ------------ | ---------------------------------- |
218
+ | `data` | `T[]` | - | Array of data to display |
219
+ | `columns` | `Column<T>[]` | - | Column configuration |
220
+ | `rowKey` | `keyof T \| Function` | `'id'` | Unique key for rows |
221
+ | `searchable` | `boolean` | `false` | Enable search toolbar |
222
+ | `searchDebounceMs` | `number` | `300` | Search debounce delay (ms) |
223
+ | `searchColumns` | `string[]` | all | Columns to search (by accessor) |
224
+ | `selectable` | `boolean` | auto | Enable row selection |
225
+ | `pagination` | `PaginationConfig \| false` | `false` | Pagination settings |
226
+ | `rowActions` | `RowAction<T>[]` | `[]` | Per-row actions |
227
+ | `globalActions` | `GlobalAction<T>[]` | `[]` | Global toolbar actions |
228
+ | `maxVisibleActions` | `number` | `3` | Inline actions before overflow (⋯) |
229
+ | `locale` | `LocaleKey \| TableLocale` | `'en'` | Locale preset or custom strings |
230
+ | `loading` | `boolean` | `false` | Loading state |
231
+ | `multiSort` | `boolean` | `false` | Enable multi-column sorting |
232
+ | `columnVisibility` | `boolean` | `false` | Show column visibility toggle |
233
+ | `filterMode` | `'floating' \| 'panel' \| 'both'` | `'floating'` | Filter display mode |
234
+
235
+ ## 📄 License
236
+
237
+ MIT
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),t=require("react/jsx-runtime");require("./styles.cjs");const Ne={search:"Buscar",searchPlaceholder:"Buscar...",noData:"No hay datos",loading:"Cargando...",page:"Página",of:"de",items:"elementos",selected:"seleccionados",rowsPerPage:"Filas por página",actions:"Acciones",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpiar filtros",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo"},De=d.createContext(null);function D(){const e=d.useContext(De);if(!e)throw new Error("useTableContext must be used within a TableProvider");return e}function Te({value:e,children:s}){return t.jsx(De.Provider,{value:e,children:s})}function Pe(e){var s,n,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(s=0;s<r;s++)e[s]&&(n=Pe(e[s]))&&(l&&(l+=" "),l+=n)}else for(n in e)e[n]&&(l&&(l+=" "),l+=n);return l}function S(){for(var e,s,n=0,l="",r=arguments.length;n<r;n++)(e=arguments[n])&&(s=Pe(e))&&(l&&(l+=" "),l+=s);return l}function He({column:e}){const{sortState:s,handleSort:n,filters:l,setFilter:r,locale:a}=D(),i=s.columnId===e.id,u=i?s.direction:null,o=d.useCallback(()=>{e.sortable!==!1&&n(e.id)},[e.id,e.sortable,n]),h=d.useCallback(f=>{const C=f.target.value;e.type==="boolean"?C===""?r(e.id,null):r(e.id,C==="true"):r(e.id,C||null)},[e.id,e.type,r]),p=d.useCallback(f=>{f.key==="Enter"&&e.sortable!==!1&&n(e.id)},[e.id,e.sortable,n]),x=()=>e.sortable===!1||e.type==="custom"?null:t.jsx("button",{className:S("bt-sort-btn",i&&"bt-active"),onClick:o,"aria-label":u==="asc"?a.sortDesc:a.sortAsc,type:"button",children:i?u==="asc"?"↑":"↓":"⇅"}),g=()=>{if(e.filterable===!1||e.type==="custom")return null;const f=l[e.id];return e.type==="boolean"?t.jsxs("select",{className:"bt-filter-select",value:f==null?"":String(f),onChange:h,"aria-label":`${a.filterBy} ${e.header}`,children:[t.jsx("option",{value:"",children:"-"}),t.jsx("option",{value:"true",children:"✅"}),t.jsx("option",{value:"false",children:"❌"})]}):t.jsx("input",{type:e.type==="number"?"number":"text",className:"bt-filter-input",placeholder:`${a.filterBy}...`,value:f!=null?String(f):"",onChange:h,"aria-label":`${a.filterBy} ${e.header}`})};return e.headerCell?t.jsx("th",{className:S("bt-th",e.align&&`bt-align-${e.align}`),style:{width:e.width},children:e.headerCell(e)}):t.jsx("th",{className:S("bt-th",e.align&&`bt-align-${e.align}`),style:{width:e.width},role:"columnheader","aria-sort":i?u==="asc"?"ascending":"descending":void 0,tabIndex:e.sortable!==!1?0:void 0,onKeyDown:e.sortable!==!1?p:void 0,children:t.jsxs("div",{className:"bt-th-content",children:[t.jsxs("div",{className:"bt-th-header",children:[t.jsx("span",{className:"bt-th-title",children:e.header}),x()]}),e.filterable!==!1&&g()]})})}const _e=d.memo(He);function Je(){const{columns:e,selectable:s,selectionMode:n,rowActions:l,isAllSelected:r,isPartiallySelected:a,selectAll:i,deselectAll:u,locale:o,stickyHeader:h}=D(),p=e.filter(f=>!f.hidden),x=l&&l.length>0,g=()=>{r?u():i()};return t.jsx("thead",{className:S("bt-thead",h&&"bt-sticky"),children:t.jsxs("tr",{className:"bt-tr",children:[s&&t.jsx("th",{className:"bt-th bt-checkbox-cell",children:n==="multiple"&&t.jsx("input",{type:"checkbox",className:"bt-checkbox",checked:r,ref:f=>{f&&(f.indeterminate=a)},onChange:g,"aria-label":r?o.deselectAll:o.selectAll})}),p.map(f=>t.jsx(_e,{column:f},f.id)),x&&t.jsx("th",{className:"bt-th bt-actions-cell",children:o.actions})]})})}const Qe=Je;function M(e,s){if(!e||!s)return;const n=s.split(".");let l=e;for(const r of n){if(l==null)return;if(typeof l=="object")l=l[r];else return}return l}function Ae(e,s,n){return[...e].sort((l,r)=>{const a=M(l,s),i=M(r,s);if(a==null)return n==="asc"?1:-1;if(i==null)return n==="asc"?-1:1;if(typeof a=="string"&&typeof i=="string"){const p=a.localeCompare(i,void 0,{sensitivity:"base",numeric:!0});return n==="asc"?p:-p}if(typeof a=="number"&&typeof i=="number")return n==="asc"?a-i:i-a;if(typeof a=="boolean"&&typeof i=="boolean"){const p=a===i?0:a?-1:1;return n==="asc"?p:-p}if(a instanceof Date&&i instanceof Date){const p=a.getTime()-i.getTime();return n==="asc"?p:-p}const u=String(a),o=String(i),h=u.localeCompare(o);return n==="asc"?h:-h})}function Me(e,s,n){const l=Object.entries(s).filter(([,r])=>r!=null&&r!=="");return l.length===0?e:e.filter(r=>l.every(([a,i])=>{const u=n.find(p=>p.id===a);if(!u)return!0;const o=M(r,String(u.accessor));if(o==null)return!1;switch(u.type??"string"){case"boolean":return o===i;case"number":return String(o)===String(i);case"date":if(o instanceof Date&&i){const p=new Date(String(i));return o.toDateString()===p.toDateString()}return String(o).includes(String(i));default:return String(o).toLowerCase().includes(String(i).toLowerCase())}}))}function we(e,s,n,l){if(!s.trim())return e;const r=s.toLowerCase().trim(),a=l?n.filter(i=>l.includes(i.id)):n.filter(i=>i.type!=="custom");return e.filter(i=>a.some(u=>{const o=M(i,String(u.accessor));return o==null?!1:String(o).toLowerCase().includes(r)}))}function Ge({row:e,column:s,rowIndex:n}){const l=M(e,String(s.accessor)),a=(()=>{if(s.cell)return s.cell(l,e,n);if(l==null)return t.jsx("span",{className:"bt-cell-empty",children:"—"});switch(s.type){case"boolean":return l?"✅":"❌";case"date":if(l instanceof Date)return l.toLocaleDateString();const i=new Date(String(l));return isNaN(i.getTime())?String(l):i.toLocaleDateString();case"number":return typeof l=="number"?l.toLocaleString():l;default:return String(l)}})();return t.jsx("td",{className:S("bt-td",s.align&&`bt-align-${s.align}`),style:{width:s.width},children:a})}const Ue=d.memo(Ge);function We({row:e,rowIndex:s}){const{rowActions:n,openModal:l}=D(),r=d.useCallback(a=>{if(a.mode==="callback"&&a.onClick)a.onClick(e,s);else if(a.mode==="modal"&&a.modalContent){const i=a.modalContent;l(t.jsx(i,{data:e,onClose:()=>{}}))}else if(a.mode==="link"&&a.href){const i=typeof a.href=="function"?a.href(e):a.href;window.open(i,"_blank")}},[e,s,l]);return!n||n.length===0?null:t.jsx("td",{className:"bt-td bt-actions-cell",children:t.jsx("div",{className:"bt-actions-wrapper",children:n.map(a=>{if(a.visible&&!a.visible(e))return null;const i=a.disabled?a.disabled(e):!1;if(a.mode==="link"&&a.href){const u=typeof a.href=="function"?a.href(e):a.href;return t.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:S("bt-action-btn",a.variant&&`bt-variant-${a.variant}`),"aria-label":a.label,children:a.icon&&t.jsx("span",{className:"bt-action-icon",children:a.icon})},a.id)}return t.jsx("button",{className:S("bt-action-btn",a.variant&&`bt-variant-${a.variant}`),onClick:()=>r(a),disabled:i,"aria-label":a.label,title:a.label,type:"button",children:a.icon&&t.jsx("span",{className:"bt-action-icon",children:a.icon})},a.id)})})})}const Xe=d.memo(We);function Ye({row:e,rowIndex:s}){const{columns:n,selectable:l,rowActions:r,isSelected:a,toggleRow:i,striped:u,hoverable:o,onRowClick:h,onRowDoubleClick:p}=D(),x=n.filter(j=>!j.hidden),g=r&&r.length>0,f=l&&a(e,s),C=!!h,y=d.useCallback(()=>{h?.(e,s)},[e,s,h]),k=d.useCallback(()=>{p?.(e,s)},[e,s,p]),P=d.useCallback(()=>{i(e,s)},[e,s,i]),N=d.useCallback(j=>{j.key==="Enter"&&h&&y()},[y,h]);return t.jsxs("tr",{className:S("bt-tr",u&&"bt-striped",o&&"bt-hoverable",f&&"bt-selected",C&&"bt-clickable"),onClick:C?y:void 0,onDoubleClick:p?k:void 0,onKeyDown:C?N:void 0,tabIndex:C?0:void 0,role:C?"button":void 0,"aria-selected":l?f:void 0,children:[l&&t.jsx("td",{className:"bt-td bt-checkbox-cell",children:t.jsx("input",{type:"checkbox",className:"bt-checkbox",checked:f,onChange:P,onClick:j=>j.stopPropagation(),"aria-label":`Select row ${s+1}`})}),x.map(j=>t.jsx(Ue,{row:e,column:j,rowIndex:s},j.id)),g&&t.jsx(Xe,{row:e,rowIndex:s})]})}const Ze=d.memo(Ye);function et(){const{processedData:e,rowKey:s}=D(),n=(l,r)=>{if(typeof s=="function")return s(l,r);const a=l[s];return String(a!==void 0?a:r)};return t.jsx("tbody",{className:"bt-tbody",children:e.map((l,r)=>t.jsx(Ze,{row:l,rowIndex:r},n(l,r)))})}const tt=et;function st({row:e,rowIndex:s}){const{columns:n,selectable:l,rowActions:r,isSelected:a,toggleRow:i,hoverable:u,onRowClick:o,openModal:h}=D(),p=n.filter(c=>!c.hidden),x=r&&r.length>0,g=l&&a(e,s),f=p[0],C=p.slice(1),y=d.useCallback(()=>{i(e,s)},[e,s,i]),k=d.useCallback(()=>{o?.(e,s)},[e,s,o]),P=d.useCallback(c=>{c.key==="Enter"&&o&&k()},[k,o]),N=d.useCallback(c=>{if(c.mode==="callback"&&c.onClick)c.onClick(e,s);else if(c.mode==="modal"&&c.modalContent){const m=c.modalContent;h(t.jsx(m,{data:e,onClose:()=>{}}))}else if(c.mode==="link"&&c.href){const m=typeof c.href=="function"?c.href(e):c.href;window.open(m,"_blank")}},[e,s,h]),j=(c,m)=>{if(c.cell)return c.cell(m,e,s);if(m==null)return t.jsx("span",{className:"bt-card-value-empty",children:"—"});switch(c.type){case"boolean":return m?"✅":"❌";case"date":if(m instanceof Date)return m.toLocaleDateString();const v=new Date(String(m));return isNaN(v.getTime())?String(m):v.toLocaleDateString();case"number":return typeof m=="number"?m.toLocaleString():String(m);default:return String(m)}},b=f?M(e,String(f.accessor)):"";return t.jsxs("div",{className:S("bt-card",u&&"bt-hoverable",g&&"bt-selected",o&&"bt-clickable"),onClick:o?k:void 0,onKeyDown:o?P:void 0,tabIndex:o?0:void 0,role:o?"button":void 0,"aria-selected":l?g:void 0,children:[t.jsxs("div",{className:"bt-card-header",children:[l&&t.jsx("input",{type:"checkbox",className:"bt-checkbox",checked:g,onChange:y,onClick:c=>c.stopPropagation(),"aria-label":`Select row ${s+1}`}),t.jsx("span",{className:"bt-card-title",children:f?j(f,b):`Item ${s+1}`})]}),C.map(c=>{const m=M(e,String(c.accessor)),v=j(c,m);return t.jsxs("div",{className:"bt-card-row",children:[t.jsx("span",{className:"bt-card-label",children:c.header}),t.jsx("span",{className:"bt-card-value",children:v})]},c.id)}),x&&t.jsx("div",{className:"bt-card-actions",children:r.map(c=>{if(c.visible&&!c.visible(e))return null;const m=c.disabled?c.disabled(e):!1;if(c.mode==="link"&&c.href){const v=typeof c.href=="function"?c.href(e):c.href;return t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:S("bt-action-btn",c.variant&&`bt-variant-${c.variant}`),onClick:T=>T.stopPropagation(),children:[c.icon&&t.jsx("span",{className:"bt-action-icon",children:c.icon}),t.jsx("span",{children:c.label})]},c.id)}return t.jsxs("button",{className:S("bt-action-btn",c.variant&&`bt-variant-${c.variant}`),onClick:v=>{v.stopPropagation(),N(c)},disabled:m,type:"button",children:[c.icon&&t.jsx("span",{className:"bt-action-icon",children:c.icon}),t.jsx("span",{children:c.label})]},c.id)})})]})}const at=d.memo(st);function lt(){const{processedData:e,rowKey:s}=D(),n=(l,r)=>{if(typeof s=="function")return s(l,r);const a=l[s];return String(a!==void 0?a:r)};return t.jsx("div",{className:"bt-cards",children:e.map((l,r)=>t.jsx(at,{row:l,rowIndex:r},n(l,r)))})}const nt=lt;function rt(){const{page:e,pageSize:s,totalPages:n,totalItems:l,goToPage:r,nextPage:a,prevPage:i,changePageSize:u,hasNextPage:o,hasPrevPage:h,startIndex:p,endIndex:x,paginationEnabled:g,pageSizeOptions:f,showSizeChanger:C,locale:y,classNames:k}=D(),P=d.useCallback(b=>{u(Number(b.target.value))},[u]),N=d.useCallback(b=>{if(b.key==="Enter"){const c=parseInt(b.target.value,10);!isNaN(c)&&c>=1&&c<=n&&r(c)}},[r,n]),j=d.useMemo(()=>{const b=[];if(n<=5)for(let m=1;m<=n;m++)b.push(m);else{b.push(1),e>3&&b.push("ellipsis");const m=Math.max(2,e-1),v=Math.min(n-1,e+1);for(let T=m;T<=v;T++)b.push(T);e<n-2&&b.push("ellipsis"),n>1&&b.push(n)}return b},[e,n]);return g?t.jsxs("div",{className:`bt-pagination ${k.pagination||""}`,children:[t.jsx("div",{className:"bt-pagination-info",children:l>0?`${p}-${x} ${y.of} ${l} ${y.items}`:`0 ${y.items}`}),t.jsxs("div",{className:"bt-pagination-controls",children:[C&&t.jsxs("div",{className:"bt-page-size",children:[t.jsxs("span",{className:"bt-page-size-label",children:[y.rowsPerPage,":"]}),t.jsx("select",{className:"bt-page-size-select",value:s,onChange:P,"aria-label":y.rowsPerPage,children:f.map(b=>t.jsx("option",{value:b,children:b},b))})]}),t.jsx("button",{className:"bt-pagination-btn",onClick:i,disabled:!h,"aria-label":"Previous page",type:"button",children:"←"}),t.jsx("div",{className:"bt-pagination-pages",children:j.map((b,c)=>b==="ellipsis"?t.jsx("span",{className:"bt-pagination-ellipsis",children:"..."},`ellipsis-${c}`):t.jsx("button",{className:`bt-pagination-btn ${e===b?"bt-active":""}`,onClick:()=>r(b),"aria-label":`${y.page} ${b}`,"aria-current":e===b?"page":void 0,type:"button",children:b},b))}),t.jsx("button",{className:"bt-pagination-btn",onClick:a,disabled:!o,"aria-label":"Next page",type:"button",children:"→"}),t.jsxs("div",{className:"bt-quick-jumper",children:[t.jsxs("span",{className:"bt-quick-jumper-label",children:[y.page,":"]}),t.jsx("input",{type:"number",className:"bt-quick-jumper-input",min:1,max:n,defaultValue:e,onKeyDown:N,"aria-label":"Jump to page"})]})]})]}):null}function it(){const{searchable:e,searchValue:s,handleSearch:n,clearSearch:l,globalActions:r,selectedRows:a,selectedCount:i,deselectAll:u,data:o,locale:h,classNames:p,selectable:x}=D(),g=d.useCallback(C=>{n(C.target.value)},[n]);return e||r&&r.length>0||x&&i>0?t.jsxs("div",{className:`bt-toolbar ${p.toolbar||""}`,children:[t.jsxs("div",{className:"bt-toolbar-left",children:[e&&t.jsxs("div",{className:"bt-search",children:[t.jsx("span",{className:"bt-search-icon",children:"🔍"}),t.jsx("input",{type:"text",className:"bt-search-input",placeholder:h.searchPlaceholder,value:s,onChange:g,"aria-label":h.search}),s&&t.jsx("button",{className:"bt-search-clear",onClick:l,"aria-label":"Clear search",type:"button",children:"✕"})]}),x&&i>0&&t.jsxs("div",{className:"bt-selection-info",children:[t.jsxs("span",{children:[i," ",h.selected]}),t.jsx("button",{className:"bt-selection-clear",onClick:u,type:"button",children:h.deselectAll})]})]}),r&&r.length>0&&t.jsx("div",{className:"bt-toolbar-right",children:t.jsx("div",{className:"bt-global-actions",children:r.map(C=>{const y=C.requiresSelection&&a.length===0;return t.jsxs("button",{className:S("bt-global-btn",C.variant&&`bt-variant-${C.variant}`),onClick:()=>C.onClick(a,o),disabled:y,title:C.label,type:"button",children:[C.icon&&t.jsx("span",{className:"bt-global-icon",children:C.icon}),t.jsx("span",{children:C.label})]},C.id)})})})]}):null}const ct=it;function ot(){const{locale:e,emptyComponent:s,columns:n,selectable:l,rowActions:r}=D(),a=n.filter(o=>!o.hidden),i=r&&r.length>0,u=a.length+(l?1:0)+(i?1:0);return s?t.jsx("tbody",{className:"bt-tbody",children:t.jsx("tr",{className:"bt-tr",children:t.jsx("td",{className:"bt-td",colSpan:u,children:s})})}):t.jsx("tbody",{className:"bt-tbody",children:t.jsx("tr",{className:"bt-tr",children:t.jsx("td",{className:"bt-td",colSpan:u,children:t.jsxs("div",{className:"bt-empty",children:[t.jsx("div",{className:"bt-empty-icon",children:"📭"}),t.jsx("div",{className:"bt-empty-text",children:e.noData})]})})})})}function dt({show:e}){const{loadingComponent:s,locale:n}=D();return e?t.jsx("div",{className:"bt-loading-overlay",role:"status","aria-live":"polite",children:s||t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bt-loading-spinner","aria-hidden":"true"}),t.jsx("span",{className:"bt-loading-text",children:n.loading})]})}):null}function bt(){const{isModalOpen:e,modalContent:s,closeModal:n}=D(),l=d.useCallback(a=>{a.target===a.currentTarget&&n()},[n]),r=d.useCallback(a=>{a.key==="Escape"&&n()},[n]);return d.useEffect(()=>(e&&(document.addEventListener("keydown",r),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",r),document.body.style.overflow=""}),[e,r]),!e||!s?null:t.jsx("div",{className:"bt-modal-backdrop",onClick:l,role:"dialog","aria-modal":"true",children:t.jsxs("div",{className:"bt-modal bt-modal-md",children:[t.jsxs("div",{className:"bt-modal-header",children:[t.jsx("h2",{className:"bt-modal-title",children:"Detalles"}),t.jsx("button",{className:"bt-modal-close",onClick:n,"aria-label":"Close modal",type:"button",children:"✕"})]}),t.jsx("div",{className:"bt-modal-body",children:s})]})})}function $e({data:e,initialSort:s,controlledSort:n,onSortChange:l}){const[r,a]=d.useState(s??{columnId:null,direction:"asc"}),i=n??r,u=d.useCallback(p=>{const x={columnId:p,direction:i.columnId===p&&i.direction==="asc"?"desc":"asc"};n||a(x),l?.(x)},[i,n,l]),o=d.useCallback(()=>{const p={columnId:null,direction:"asc"};n||a(p),l?.(p)},[n,l]);return{sortedData:d.useMemo(()=>i.columnId?Ae(e,i.columnId,i.direction):e,[e,i]),sortState:i,handleSort:u,clearSort:o}}function Re({data:e,columns:s,initialFilters:n,controlledFilters:l,onFilterChange:r}){const[a,i]=d.useState(n??{}),u=l??a,o=d.useCallback((g,f)=>{const C={...u};f==null||f===""?delete C[g]:C[g]=f,l||i(C),r?.(C)},[u,l,r]),h=d.useCallback(g=>{const f={...u};delete f[g],l||i(f),r?.(f)},[u,l,r]),p=d.useCallback(()=>{l||i({}),r?.({})},[l,r]);return{filteredData:d.useMemo(()=>Me(e,u,s),[e,u,s]),filters:u,setFilter:o,clearFilters:p,clearFilter:h}}function ze({data:e,config:s,onPageChange:n}){const l=s!==!1,r=s&&typeof s=="object"?s.page??1:1,a=s&&typeof s=="object"?s.pageSize??10:10,i=s&&typeof s=="object"?s.totalItems:void 0,[u,o]=d.useState(r),[h,p]=d.useState(a),x=i??e.length,g=Math.max(1,Math.ceil(x/h)),f=d.useCallback(b=>{const c=Math.max(1,Math.min(b,g));o(c),n?.(c,h)},[g,h,n]),C=d.useCallback(()=>{u<g&&f(u+1)},[u,g,f]),y=d.useCallback(()=>{u>1&&f(u-1)},[u,f]),k=d.useCallback(b=>{p(b),o(1),n?.(1,b)},[n]),P=d.useMemo(()=>{if(!l||i!==void 0)return e;const b=(u-1)*h;return e.slice(b,b+h)},[e,u,h,l,i]),N=(u-1)*h+1,j=Math.min(u*h,x);return{paginatedData:P,page:u,pageSize:h,totalPages:g,totalItems:x,goToPage:f,nextPage:C,prevPage:y,changePageSize:k,hasNextPage:u<g,hasPrevPage:u>1,startIndex:N,endIndex:j}}function Le({data:e,rowKey:s,mode:n="multiple",initialSelection:l,controlledSelection:r,onSelectionChange:a}){const[i,u]=d.useState(l??[]),o=r??i,h=d.useCallback((b,c)=>typeof s=="function"?s(b,c):String(b[s]),[s]),p=d.useMemo(()=>new Set(o.map((b,c)=>h(b,c))),[o,h]),x=d.useCallback((b,c)=>{const m=h(b,c);return p.has(m)},[h,p]),g=d.useCallback(b=>{r||u(b),a?.(b)},[r,a]),f=d.useCallback((b,c)=>{const m=h(b,c);let v;n==="single"?v=p.has(m)?[]:[b]:p.has(m)?v=o.filter((T,w)=>h(T,w)!==m):v=[...o,b],g(v)},[n,p,o,h,g]),C=d.useCallback((b,c)=>{if(!x(b,c)){const m=n==="single"?[b]:[...o,b];g(m)}},[x,n,o,g]),y=d.useCallback((b,c)=>{const m=h(b,c),v=o.filter((T,w)=>h(T,w)!==m);g(v)},[o,h,g]),k=d.useCallback(()=>{n==="multiple"&&g([...e])},[e,n,g]),P=d.useCallback(()=>{g([])},[g]),N=e.length>0&&o.length===e.length,j=o.length>0&&o.length<e.length;return{selectedRows:o,isSelected:x,toggleRow:f,selectRow:C,deselectRow:y,selectAll:k,deselectAll:P,isAllSelected:N,isPartiallySelected:j,selectedCount:o.length}}function Ie({data:e,columns:s,searchColumns:n,initialValue:l,controlledValue:r,onSearchChange:a}){const[i,u]=d.useState(l??""),o=r??i,h=d.useCallback(g=>{r===void 0&&u(g),a?.(g)},[r,a]),p=d.useCallback(()=>{r===void 0&&u(""),a?.("")},[r,a]);return{searchedData:d.useMemo(()=>we(e,o,s,n),[e,o,s,n]),searchValue:o,handleSearch:h,clearSearch:p}}function ut(e){const{data:s,columns:n,rowKey:l="id",rowActions:r,globalActions:a,pagination:i={pageSize:10},onPageChange:u,sort:o,onSortChange:h,filters:p,onFilterChange:x,searchable:g=!1,searchValue:f,onSearchChange:C,searchColumns:y,selectable:k,selectedRows:P,onSelectionChange:N,selectionMode:j="multiple",loading:b=!1,loadingComponent:c,emptyComponent:m,classNames:v={},styles:T={},locale:w,stickyHeader:E=!1,maxHeight:Be,bordered:$=!1,striped:R=!1,hoverable:z=!0,size:L="medium",onRowClick:F,onRowDoubleClick:K,ariaLabel:Ee,ariaDescribedBy:Fe}=e,O=d.useMemo(()=>k!==void 0?k:a?.some(qe=>qe.requiresSelection)||N!==void 0,[k,a,N]),V=d.useMemo(()=>({...Ne,...w}),[w]),[q,H]=d.useState(!1),[_,J]=d.useState(null),Q=d.useCallback(Se=>{J(Se),H(!0)},[]),G=d.useCallback(()=>{H(!1),J(null)},[]),A=d.useMemo(()=>i===!1?!1:{pageSize:10,pageSizeOptions:[10,20,50,100],showSizeChanger:!1,...i},[i]),{searchedData:Ke,searchValue:U,handleSearch:W,clearSearch:X}=Ie({data:s,columns:n,searchColumns:y,controlledValue:f,onSearchChange:C}),{filteredData:Oe,filters:Y,setFilter:Z,clearFilters:ee}=Re({data:Ke,columns:n,controlledFilters:p,onFilterChange:x}),{sortedData:te,sortState:se,handleSort:ae}=$e({data:Oe,controlledSort:o,onSortChange:h}),{selectedRows:le,isSelected:ne,toggleRow:re,selectAll:ie,deselectAll:ce,isAllSelected:oe,isPartiallySelected:de,selectedCount:be}=Le({data:te,rowKey:l,mode:j,controlledSelection:P,onSelectionChange:N}),{paginatedData:I,page:ue,pageSize:he,totalPages:fe,totalItems:pe,goToPage:ge,nextPage:me,prevPage:Ce,changePageSize:xe,hasNextPage:ve,hasPrevPage:ye,startIndex:je,endIndex:ke}=ze({data:te,config:A,onPageChange:u}),Ve=d.useMemo(()=>({data:s,processedData:I,columns:n,rowKey:l,rowActions:r,globalActions:a,sortState:se,handleSort:ae,filters:Y,setFilter:Z,clearFilters:ee,searchValue:U,handleSearch:W,clearSearch:X,searchable:g,selectedRows:le,isSelected:ne,toggleRow:re,selectAll:ie,deselectAll:ce,isAllSelected:oe,isPartiallySelected:de,selectable:O,selectionMode:j,selectedCount:be,page:ue,pageSize:he,totalPages:fe,totalItems:pe,goToPage:ge,nextPage:me,prevPage:Ce,changePageSize:xe,hasNextPage:ve,hasPrevPage:ye,startIndex:je,endIndex:ke,paginationEnabled:i!==!1,pageSizeOptions:A&&typeof A=="object"?A.pageSizeOptions??[10,20,50,100]:[10,20,50,100],showSizeChanger:A&&typeof A=="object"?A.showSizeChanger??!1:!1,loading:b,loadingComponent:c,emptyComponent:m,locale:V,classNames:v,size:L,bordered:$,striped:R,hoverable:z,stickyHeader:E,onRowClick:F,onRowDoubleClick:K,openModal:Q,closeModal:G,modalContent:_,isModalOpen:q}),[s,I,n,l,r,a,se,ae,Y,Z,ee,U,W,X,g,le,ne,re,ie,ce,oe,de,O,j,be,ue,he,fe,pe,ge,me,Ce,xe,ve,ye,je,ke,i,A,b,c,m,V,v,L,$,R,z,E,F,K,Q,G,_,q]),B=I.length>0;return t.jsx(Te,{value:Ve,children:t.jsxs("div",{className:S("bt-container",`bt-size-${L}`,R&&"bt-striped",$&&"bt-bordered",z&&"bt-hoverable",b&&"bt-container-loading",v.container),style:T.container,children:[t.jsx(ct,{}),t.jsxs("div",{className:"bt-table-wrapper",style:{maxHeight:Be},children:[t.jsxs("table",{className:S("bt-table",v.table),style:T.table,role:"grid","aria-label":Ee,"aria-describedby":Fe,"aria-busy":b,children:[t.jsx(Qe,{}),B?t.jsx(tt,{}):t.jsx(ot,{})]}),B&&t.jsx(nt,{}),t.jsx(dt,{show:b&&B})]}),i!==!1&&t.jsx(rt,{}),t.jsx(bt,{})]})})}const ht=ut;exports.BetterTable=ht;exports.TableProvider=Te;exports.defaultLocale=Ne;exports.filterData=Me;exports.getValueFromPath=M;exports.searchData=we;exports.sortData=Ae;exports.useTableContext=D;exports.useTableFilter=Re;exports.useTablePagination=ze;exports.useTableSearch=Ie;exports.useTableSelection=Le;exports.useTableSort=$e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),e=require("react/jsx-runtime"),wt=require("react-dom");require("./styles.cjs");const Z={search:"Search",searchPlaceholder:"Search...",noData:"No data",loading:"Loading...",page:"Page",of:"of",items:"items",selected:"selected",rowsPerPage:"Rows per page",actions:"Actions",sortAsc:"Sort ascending",sortDesc:"Sort descending",filterBy:"Filter by",clearFilters:"Clear filters",dateFrom:"From",dateTo:"To",selectAll:"Select all",deselectAll:"Deselect all",moreActions:"More actions",clearSearch:"Clear search",closeModal:"Close",previousPage:"Previous page",nextPage:"Next page",jumpToPage:"Go to page",details:"Details",columns:"Columns",showAllColumns:"Show all",hideColumn:"Hide column",sortPriority:"Sort priority",clearSort:"Clear sort"},Xe={en:Z,es:{search:"Buscar",searchPlaceholder:"Buscar...",noData:"No hay datos",loading:"Cargando...",page:"Página",of:"de",items:"elementos",selected:"seleccionados",rowsPerPage:"Filas por página",actions:"Acciones",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpiar filtros",dateFrom:"Desde",dateTo:"Hasta",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo",moreActions:"Más acciones",clearSearch:"Limpiar búsqueda",closeModal:"Cerrar",previousPage:"Página anterior",nextPage:"Página siguiente",jumpToPage:"Ir a página",details:"Detalles",columns:"Columnas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar columna",sortPriority:"Prioridad de orden",clearSort:"Quitar orden"},pt:{search:"Pesquisar",searchPlaceholder:"Pesquisar...",noData:"Sem dados",loading:"Carregando...",page:"Página",of:"de",items:"itens",selected:"selecionados",rowsPerPage:"Linhas por página",actions:"Ações",sortAsc:"Ordenar ascendente",sortDesc:"Ordenar descendente",filterBy:"Filtrar por",clearFilters:"Limpar filtros",dateFrom:"De",dateTo:"Até",selectAll:"Selecionar tudo",deselectAll:"Desselecionar tudo",moreActions:"Mais ações",clearSearch:"Limpar pesquisa",closeModal:"Fechar",previousPage:"Página anterior",nextPage:"Próxima página",jumpToPage:"Ir para página",details:"Detalhes",columns:"Colunas",showAllColumns:"Mostrar todas",hideColumn:"Ocultar coluna",sortPriority:"Prioridade de ordem",clearSort:"Remover ordem"}},Ye=o.createContext(null);function A(){const t=o.useContext(Ye);if(!t)throw new Error("useTableContext must be used within a TableProvider");return t}function et({value:t,children:s}){return e.jsx(Ye.Provider,{value:t,children:s})}function tt(t){var s,l,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(s=0;s<i;s++)t[s]&&(l=tt(t[s]))&&(n&&(n+=" "),n+=l)}else for(l in t)t[l]&&(n&&(n+=" "),n+=l);return n}function N(){for(var t,s,l=0,n="",i=arguments.length;l<i;l++)(t=arguments[l])&&(s=tt(t))&&(n&&(n+=" "),n+=s);return n}function Nt(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.4"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.4"})]})}function St(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor",opacity:"0.2"})]})}function Pt(){return e.jsxs("svg",{className:"bt-sort-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M7 2.5L10 5.5H4L7 2.5Z",fill:"currentColor",opacity:"0.2"}),e.jsx("path",{d:"M7 11.5L4 8.5H10L7 11.5Z",fill:"currentColor"})]})}function Tt({column:t}){const{sortState:s,handleSort:l,locale:n,multiSortState:i,isMultiSort:c}=A(),r=s.columnId===t.id,b=c?i.findIndex(C=>C.columnId===t.id):-1,d=b>=0,a=d?i[b].direction:null,u=c&&i.length>1&&d,h=c?d:r,f=c?a:r?s.direction:null,g=o.useCallback(()=>{t.sortable!==!1&&l(t.id)},[t.id,t.sortable,l]),x=o.useCallback(C=>{C.key==="Enter"&&t.sortable!==!1&&l(t.id)},[t.id,t.sortable,l]),y=()=>{if(t.sortable===!1||t.type==="custom")return null;const C=h?f==="asc"?St:Pt:Nt;return e.jsxs("button",{className:N("bt-sort-btn",h&&"bt-active"),onClick:g,"aria-label":f==="asc"?n.sortDesc:n.sortAsc,type:"button",children:[e.jsx(C,{}),u&&e.jsx("span",{className:"bt-sort-priority","aria-label":`${n.sortPriority} ${b+1}`,children:b+1})]})};return t.headerCell?e.jsx("th",{className:N("bt-th",t.align&&`bt-align-${t.align}`),style:{width:t.width},children:t.headerCell(t)}):e.jsx("th",{className:N("bt-th",t.align&&`bt-align-${t.align}`,h&&"bt-sorted"),style:{width:t.width},role:"columnheader","aria-sort":h?f==="asc"?"ascending":"descending":void 0,tabIndex:t.sortable!==!1?0:void 0,onKeyDown:t.sortable!==!1?x:void 0,children:e.jsx("div",{className:"bt-th-content",children:e.jsxs("div",{className:"bt-th-header",children:[e.jsx("span",{className:"bt-th-title",children:t.header}),y()]})})})}const Dt=o.memo(Tt),Ze=()=>e.jsx("svg",{className:"bt-ff-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M1.5 2h13L9.5 8.5V14l-3-1.5V8.5z"})});function At(){const{visibleColumns:t,filters:s,setFilter:l,selectable:n,selectionMode:i,rowActions:c,locale:r,stickyHeader:b}=A(),d=c&&c.length>0;return t.some(u=>u.filterable!==!1&&u.type!=="custom")?e.jsxs("tr",{className:N("bt-tr","bt-floating-filter-row",b&&"bt-sticky-filter"),children:[n&&i==="multiple"&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),n&&i==="single"&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-checkbox-cell"}),t.map(u=>e.jsx("th",{className:N("bt-th","bt-floating-filter-cell",u.align&&`bt-align-${u.align}`),style:{width:u.width},children:u.filterable!==!1&&u.type!=="custom"?e.jsx(Mt,{column:u,value:s[u.id],setFilter:l,locale:r}):null},u.id)),d&&e.jsx("th",{className:"bt-th bt-floating-filter-cell bt-actions-cell"})]}):null}function Lt({column:t,value:s,setFilter:l,locale:n}){const i=o.useCallback(d=>{const a=d.target.value;t.type==="boolean"?a===""?l(t.id,null):l(t.id,a==="true"):l(t.id,a||null)},[t.id,t.type,l]),c=o.useCallback((d,a)=>{const h={...s??{},[d]:a||void 0};l(t.id,h)},[t.id,s,l]),r=`bt-ff-${t.id}`,b=o.useMemo(()=>{if(s==null)return!1;if(typeof s=="object"){const d=s;return!!(d.from||d.to)}return s!==""},[s]);if(t.type==="boolean")return e.jsxs("div",{className:N("bt-ff-wrapper",b&&"bt-ff-active"),children:[e.jsx(Ze,{}),e.jsxs("select",{id:r,name:r,className:"bt-floating-filter-select",value:s==null?"":String(s),onChange:i,"aria-label":`${n.filterBy} ${t.header}`,children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"true",children:"✅"}),e.jsx("option",{value:"false",children:"❌"})]})]});if(t.type==="date"){const d=s??{};return e.jsxs("div",{className:N("bt-floating-filter-dates",b&&"bt-ff-active"),children:[e.jsx("input",{id:`${r}-from`,name:`${r}-from`,type:"date",className:"bt-floating-filter-input",value:d.from??"",onChange:a=>c("from",a.target.value),"aria-label":`${n.dateFrom} ${t.header}`,title:n.dateFrom}),e.jsx("span",{className:"bt-ff-date-sep",children:"–"}),e.jsx("input",{id:`${r}-to`,name:`${r}-to`,type:"date",className:"bt-floating-filter-input",value:d.to??"",onChange:a=>c("to",a.target.value),"aria-label":`${n.dateTo} ${t.header}`,title:n.dateTo})]})}return e.jsxs("div",{className:N("bt-ff-wrapper",b&&"bt-ff-active"),children:[e.jsx(Ze,{}),e.jsx("input",{id:r,name:r,type:t.type==="number"?"number":"text",className:"bt-floating-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:i,"aria-label":`${n.filterBy} ${t.header}`})]})}const Mt=o.memo(Lt),It=o.memo(At);function $t(){const{visibleColumns:t,selectable:s,selectionMode:l,rowActions:n,isAllSelected:i,isPartiallySelected:c,selectAll:r,deselectAll:b,locale:d,stickyHeader:a,filterMode:u}=A(),h=n&&n.length>0,f=u==="floating"||u==="both",g=()=>{i?b():r()};return e.jsxs("thead",{className:N("bt-thead",a&&"bt-sticky"),children:[e.jsxs("tr",{className:"bt-tr",children:[s&&e.jsx("th",{className:"bt-th bt-checkbox-cell",children:l==="multiple"&&e.jsx("input",{id:"bt-select-all",name:"bt-select-all",type:"checkbox",className:"bt-checkbox",checked:i,ref:x=>{x&&(x.indeterminate=c)},onChange:g,"aria-label":i?d.deselectAll:d.selectAll})}),t.map(x=>e.jsx(Dt,{column:x},x.id)),h&&e.jsx("th",{className:"bt-th bt-actions-cell",children:d.actions})]}),f&&e.jsx(It,{})]})}const Ft=$t;function M(t,s){if(!t||!s)return;const l=s.split(".");let n=t;for(const i of l){if(n==null)return;if(typeof n=="object")n=n[i];else return}return n}function st(t,s,l){if(t==null)return l==="asc"?1:-1;if(s==null)return l==="asc"?-1:1;if(typeof t=="string"&&typeof s=="string"){const r=t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0});return l==="asc"?r:-r}if(typeof t=="number"&&typeof s=="number")return l==="asc"?t-s:s-t;if(typeof t=="boolean"&&typeof s=="boolean"){const r=t===s?0:t?-1:1;return l==="asc"?r:-r}if(t instanceof Date&&s instanceof Date){const r=t.getTime()-s.getTime();return l==="asc"?r:-r}const n=String(t),i=String(s),c=n.localeCompare(i);return l==="asc"?c:-c}function nt(t,s,l){return[...t].sort((n,i)=>{const c=M(n,s),r=M(i,s);return st(c,r,l)})}function Rt(t,s){const l=s.filter(n=>n.columnId!==null);return l.length===0?t:[...t].sort((n,i)=>{for(const c of l){const r=M(n,c.columnId),b=M(i,c.columnId),d=st(r,b,c.direction);if(d!==0)return d}return 0})}function z(t){if(t instanceof Date)return t;if(typeof t=="string"||typeof t=="number"){const s=new Date(t);return isNaN(s.getTime())?null:s}return null}function lt(t,s,l){const n=Object.entries(s).filter(([,i])=>i!=null&&i!=="");return n.length===0?t:t.filter(i=>n.every(([c,r])=>{const b=l.find(u=>u.id===c);if(!b)return!0;const d=M(i,String(b.accessor));if(d==null)return!1;switch(b.type??"string"){case"boolean":return d===r;case"number":return String(d)===String(r);case"date":{const u=z(d);if(!u)return!1;if(r&&typeof r=="object"&&("from"in r||"to"in r)){const f=r;if(f.from){const g=z(f.from);if(g&&u<g)return!1}if(f.to){const g=z(f.to);if(g){const x=new Date(g);if(x.setHours(23,59,59,999),u>x)return!1}}return!0}const h=z(r);return h?u.toDateString()===h.toDateString():String(d).includes(String(r))}default:return String(d).toLowerCase().includes(String(r).toLowerCase())}}))}function at(t,s,l,n){if(!s.trim())return t;const i=s.toLowerCase().trim(),c=n?l.filter(r=>n.includes(r.id)||n.includes(String(r.accessor))):l.filter(r=>r.type!=="custom");return t.filter(r=>c.some(b=>{const d=M(r,String(b.accessor));return d==null?!1:String(d).toLowerCase().includes(i)}))}function Et({row:t,column:s,rowIndex:l}){const n=M(t,String(s.accessor)),c=(()=>{if(s.cell)return s.cell(n,t,l);if(n==null)return e.jsx("span",{className:"bt-cell-empty",children:"—"});switch(s.type){case"boolean":return n?"✅":"❌";case"date":if(n instanceof Date)return n.toLocaleDateString();const r=new Date(String(n));return isNaN(r.getTime())?String(n):r.toLocaleDateString();case"number":return typeof n=="number"?n.toLocaleString():n;default:return String(n)}})();return e.jsx("td",{className:N("bt-td",s.align&&`bt-align-${s.align}`),style:{width:s.width},children:c})}const Ot=o.memo(Et),Bt="📦";function zt({actions:t,row:s,rowIndex:l,onActionClick:n,direction:i="down"}){const{locale:c}=A(),[r,b]=o.useState(!1),[d,a]=o.useState({top:0,left:0,openUp:!1}),u=o.useRef(null),h=o.useRef(null),f=o.useCallback(j=>{j.stopPropagation(),b(m=>{if(!m&&u.current){const v=u.current.getBoundingClientRect(),S=window.innerHeight-v.bottom,T=i==="up"||S<200;a({top:T?v.top:v.bottom,left:v.right,openUp:T})}return!m})},[i]);o.useEffect(()=>{if(!r)return;const j=m=>{const v=m.target;u.current&&!u.current.contains(v)&&h.current&&!h.current.contains(v)&&b(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[r]),o.useEffect(()=>{if(!r)return;const j=m=>{m.key==="Escape"&&b(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[r]),o.useEffect(()=>{if(!r)return;const j=()=>b(!1);return window.addEventListener("scroll",j,!0),()=>window.removeEventListener("scroll",j,!0)},[r]);const g=t.filter(j=>j.variant!=="danger"),x=t.filter(j=>j.variant==="danger"),y=[...g,...x],C=g.length>0&&x.length>0,P=g.length,k=d.openUp?{position:"fixed",bottom:window.innerHeight-d.top,right:window.innerWidth-d.left}:{position:"fixed",top:d.top,right:window.innerWidth-d.left};return e.jsxs("div",{className:"bt-overflow-container",children:[e.jsx("button",{ref:u,className:"bt-action-btn bt-overflow-trigger",onClick:f,"aria-label":c.moreActions,"aria-expanded":r,"aria-haspopup":"menu",title:c.moreActions,type:"button",children:e.jsx("span",{className:"bt-overflow-icon",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"3",cy:"8",r:"1.5"}),e.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),e.jsx("circle",{cx:"13",cy:"8",r:"1.5"})]})})}),r&&wt.createPortal(e.jsx("div",{ref:h,className:N("bt-overflow-menu",d.openUp&&"bt-overflow-menu-up"),style:k,role:"menu",children:y.map((j,m)=>{if(j.visible&&!j.visible(s))return null;const v=j.disabled?j.disabled(s):!1,S=j.icon??Bt,T=C&&m===P;return e.jsxs(o.Fragment,{children:[T&&e.jsx("div",{className:"bt-overflow-separator",role:"separator"}),j.mode==="link"&&j.href?e.jsxs("a",{href:typeof j.href=="function"?j.href(s):j.href,target:"_blank",rel:"noopener noreferrer",className:N("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",onClick:p=>{p.stopPropagation(),b(!1)},children:[e.jsx("span",{className:"bt-overflow-item-icon",children:S}),e.jsx("span",{className:"bt-overflow-item-label",children:j.label})]}):e.jsxs("button",{className:N("bt-overflow-item",j.variant==="danger"&&"bt-overflow-item-danger"),role:"menuitem",disabled:v,onClick:p=>{p.stopPropagation(),n(j),b(!1)},type:"button",children:[e.jsx("span",{className:"bt-overflow-item-icon",children:S}),e.jsx("span",{className:"bt-overflow-item-label",children:j.label})]})]},j.id)})}),document.body)]})}const it=o.memo(zt),Vt="📦";function Ht({row:t,rowIndex:s}){const{rowActions:l,openModal:n,closeModal:i,maxVisibleActions:c}=A(),r=o.useCallback(a=>{if(a.mode==="callback"&&a.onClick)a.onClick(t,s);else if(a.mode==="modal"&&a.modalContent){const u=a.modalContent;n(e.jsx(u,{data:t,onClose:i}))}else if(a.mode==="link"&&a.href){const u=typeof a.href=="function"?a.href(t):a.href;window.open(u,"_blank")}},[t,s,n,i]),{inlineActions:b,overflowActions:d}=o.useMemo(()=>{if(!l)return{inlineActions:[],overflowActions:[]};const a=l.filter(h=>!h.visible||h.visible(t));if(a.length<=c)return{inlineActions:a,overflowActions:[]};const u=c-1;return{inlineActions:a.slice(0,u),overflowActions:a.slice(u)}},[l,c,t]);return!l||l.length===0?null:e.jsx("td",{className:"bt-td bt-actions-cell",children:e.jsxs("div",{className:"bt-actions-wrapper",children:[b.map(a=>{const u=a.disabled?a.disabled(t):!1,h=a.icon??Vt;if(a.mode==="link"&&a.href){const f=typeof a.href=="function"?a.href(t):a.href;return e.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:N("bt-action-btn bt-action-icon-only",a.variant&&`bt-variant-${a.variant}`),"aria-label":a.label,title:a.label,children:e.jsx("span",{className:"bt-action-icon",children:h})},a.id)}return e.jsx("button",{className:N("bt-action-btn bt-action-icon-only",a.variant&&`bt-variant-${a.variant}`),onClick:()=>r(a),disabled:u,"aria-label":a.label,title:a.label,type:"button",children:e.jsx("span",{className:"bt-action-icon",children:h})},a.id)}),d.length>0&&e.jsx(it,{actions:d,row:t,rowIndex:s,onActionClick:r,direction:"down"})]})})}const Wt=o.memo(Ht);function qt({row:t,rowIndex:s}){const{visibleColumns:l,selectable:n,rowActions:i,isSelected:c,toggleRow:r,striped:b,hoverable:d,onRowClick:a,onRowDoubleClick:u}=A(),h=i&&i.length>0,f=n&&c(t,s),g=!!a,x=o.useCallback(()=>{a?.(t,s)},[t,s,a]),y=o.useCallback(()=>{u?.(t,s)},[t,s,u]),C=o.useCallback(()=>{r(t,s)},[t,s,r]),P=o.useCallback(k=>{k.key==="Enter"&&a&&x()},[x,a]);return e.jsxs("tr",{className:N("bt-tr",b&&"bt-striped",d&&"bt-hoverable",f&&"bt-selected",g&&"bt-clickable"),onClick:g?x:void 0,onDoubleClick:u?y:void 0,onKeyDown:g?P:void 0,tabIndex:g?0:void 0,role:g?"button":void 0,"aria-selected":n?f:void 0,children:[n&&e.jsx("td",{className:"bt-td bt-checkbox-cell",children:e.jsx("input",{id:`bt-row-select-${s}`,name:`bt-row-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:f,onChange:C,onClick:k=>k.stopPropagation(),"aria-label":`Select row ${s+1}`})}),l.map(k=>e.jsx(Ot,{row:t,column:k,rowIndex:s},k.id)),h&&e.jsx(Wt,{row:t,rowIndex:s})]})}const Kt=o.memo(qt);function _t(){const{processedData:t,rowKey:s}=A(),l=(n,i)=>{if(typeof s=="function")return s(n,i);const c=n[s];return String(c!==void 0?c:i)};return e.jsx("tbody",{className:"bt-tbody",children:t.map((n,i)=>e.jsx(Kt,{row:n,rowIndex:i},l(n,i)))})}const Ut=_t,Zt="📦";function Qt({row:t,rowIndex:s}){const{visibleColumns:l,selectable:n,rowActions:i,maxVisibleActions:c,isSelected:r,toggleRow:b,hoverable:d,onRowClick:a,openModal:u,closeModal:h}=A(),f=i&&i.length>0,g=n&&r(t,s),x=l[0],y=l.slice(1),{inlineActions:C,overflowActions:P}=o.useMemo(()=>{if(!i)return{inlineActions:[],overflowActions:[]};const p=i.filter(L=>!L.visible||L.visible(t));if(p.length<=c)return{inlineActions:p,overflowActions:[]};const w=c-1;return{inlineActions:p.slice(0,w),overflowActions:p.slice(w)}},[i,c,t]),k=o.useCallback(()=>{b(t,s)},[t,s,b]),j=o.useCallback(()=>{a?.(t,s)},[t,s,a]),m=o.useCallback(p=>{p.key==="Enter"&&a&&j()},[j,a]),v=o.useCallback(p=>{if(p.mode==="callback"&&p.onClick)p.onClick(t,s);else if(p.mode==="modal"&&p.modalContent){const w=p.modalContent;u(e.jsx(w,{data:t,onClose:h}))}else if(p.mode==="link"&&p.href){const w=typeof p.href=="function"?p.href(t):p.href;window.open(w,"_blank")}},[t,s,u,h]),S=(p,w)=>{if(p.cell)return p.cell(w,t,s);if(w==null)return e.jsx("span",{className:"bt-card-value-empty",children:"—"});switch(p.type){case"boolean":return w?"✅":"❌";case"date":if(w instanceof Date)return w.toLocaleDateString();const L=new Date(String(w));return isNaN(L.getTime())?String(w):L.toLocaleDateString();case"number":return typeof w=="number"?w.toLocaleString():String(w);default:return String(w)}},T=x?M(t,String(x.accessor)):"";return e.jsxs("div",{className:N("bt-card",d&&"bt-hoverable",g&&"bt-selected",a&&"bt-clickable"),onClick:a?j:void 0,onKeyDown:a?m:void 0,tabIndex:a?0:void 0,role:a?"button":void 0,"aria-selected":n?g:void 0,children:[e.jsxs("div",{className:"bt-card-header",children:[n&&e.jsx("input",{id:`bt-card-select-${s}`,name:`bt-card-select-${s}`,type:"checkbox",className:"bt-checkbox",checked:g,onChange:k,onClick:p=>p.stopPropagation(),"aria-label":`Select row ${s+1}`}),e.jsx("span",{className:"bt-card-title",children:x?S(x,T):`Item ${s+1}`})]}),y.map(p=>{const w=M(t,String(p.accessor)),L=S(p,w);return e.jsxs("div",{className:"bt-card-row",children:[e.jsx("span",{className:"bt-card-label",children:p.header}),e.jsx("span",{className:"bt-card-value",children:L})]},p.id)}),f&&e.jsxs("div",{className:"bt-card-actions",children:[C.map(p=>{const w=p.disabled?p.disabled(t):!1,L=p.icon??Zt;if(p.mode==="link"&&p.href){const F=typeof p.href=="function"?p.href(t):p.href;return e.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:N("bt-action-btn bt-action-icon-only",p.variant&&`bt-variant-${p.variant}`),"aria-label":p.label,title:p.label,onClick:R=>R.stopPropagation(),children:e.jsx("span",{className:"bt-action-icon",children:L})},p.id)}return e.jsx("button",{className:N("bt-action-btn bt-action-icon-only",p.variant&&`bt-variant-${p.variant}`),onClick:F=>{F.stopPropagation(),v(p)},disabled:w,"aria-label":p.label,title:p.label,type:"button",children:e.jsx("span",{className:"bt-action-icon",children:L})},p.id)}),P.length>0&&e.jsx(it,{actions:P,row:t,rowIndex:s,onActionClick:v,direction:"up"})]})]})}const Gt=o.memo(Qt);function Jt(){const{processedData:t,rowKey:s}=A(),l=(n,i)=>{if(typeof s=="function")return s(n,i);const c=n[s];return String(c!==void 0?c:i)};return e.jsx("div",{className:"bt-cards",children:t.map((n,i)=>e.jsx(Gt,{row:n,rowIndex:i},l(n,i)))})}const Xt=Jt;function Qe(){return e.jsx("svg",{className:"bt-fp-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M1.5 2H10.5L7 5.87V9.5L5 8.5V5.87L1.5 2Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Yt({open:t}){const{columns:s,filters:l,setFilter:n,clearFilter:i,clearFilters:c,locale:r}=A(),b=s.filter(a=>a.filterable!==!1&&a.type!=="custom"&&!a.hidden);if(!t||b.length===0)return null;const d=Object.keys(l).length;return e.jsxs("div",{className:"bt-filter-panel",role:"region","aria-label":r.filterBy,children:[e.jsx("div",{className:"bt-filter-panel-grid",children:b.map(a=>e.jsx(ts,{column:a,value:l[a.id],setFilter:n,clearFilter:i,locale:r},a.id))}),d>0&&e.jsx("div",{className:"bt-filter-panel-footer",children:e.jsx("button",{className:"bt-filter-panel-clear",onClick:c,type:"button",children:r.clearFilters})})]})}function es({column:t,value:s,setFilter:l,locale:n}){const i=o.useCallback(u=>{const h=u.target.value;t.type==="boolean"?h===""?l(t.id,null):l(t.id,h==="true"):l(t.id,h||null)},[t.id,t.type,l]),c=o.useCallback((u,h)=>{const g={...s??{},[u]:h||void 0};l(t.id,g)},[t.id,s,l]),r=s!=null&&s!=="",b=r&&typeof s=="object"&&("from"in s||"to"in s)&&!!(s.from||s.to),d=t.type==="date"?b:r,a=()=>{const u=`bt-filter-${t.id}`;if(t.type==="boolean")return e.jsxs("div",{className:N("bt-fp-wrapper",d&&"bt-fp-active"),children:[e.jsx(Qe,{}),e.jsxs("select",{id:u,name:u,className:"bt-filter-select",value:s==null?"":String(s),onChange:i,"aria-label":`${n.filterBy} ${t.header}`,children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"true",children:"✅"}),e.jsx("option",{value:"false",children:"❌"})]})]});if(t.type==="date"){const h=s??{};return e.jsxs("div",{className:N("bt-fp-wrapper bt-filter-field-dates",d&&"bt-fp-active"),children:[e.jsx("input",{id:`${u}-from`,name:`${u}-from`,type:"date",className:"bt-filter-input",value:h.from??"",onChange:f=>c("from",f.target.value),"aria-label":`${n.dateFrom} ${t.header}`,placeholder:n.dateFrom}),e.jsx("span",{className:"bt-filter-field-separator",children:"–"}),e.jsx("input",{id:`${u}-to`,name:`${u}-to`,type:"date",className:"bt-filter-input",value:h.to??"",onChange:f=>c("to",f.target.value),"aria-label":`${n.dateTo} ${t.header}`,placeholder:n.dateTo})]})}return e.jsxs("div",{className:N("bt-fp-wrapper",d&&"bt-fp-active"),children:[e.jsx(Qe,{}),e.jsx("input",{id:u,name:u,type:t.type==="number"?"number":"text",className:"bt-filter-input",placeholder:"...",value:s!=null?String(s):"",onChange:i,"aria-label":`${n.filterBy} ${t.header}`})]})};return e.jsxs("div",{className:N("bt-filter-field",d&&"bt-filter-field-active"),children:[e.jsx("label",{className:"bt-filter-field-label",htmlFor:`bt-filter-${t.id}`,children:t.header}),a()]})}const ts=o.memo(es),ss=o.memo(Yt);function ns(){return e.jsxs("svg",{className:"bt-columns-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("rect",{x:"1.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("rect",{x:"8.5",y:"2",width:"4",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})}function ls(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function as(){const{columns:t,hiddenColumnIds:s,toggleColumn:l,showAllColumns:n,isColumnVisible:i,locale:c,columnVisibilityEnabled:r}=A(),[b,d]=o.useState(!1),a=o.useRef(null),u=o.useRef(null),h=s.size;o.useEffect(()=>{if(!b)return;const x=C=>{a.current&&!a.current.contains(C.target)&&d(!1)},y=C=>{C.key==="Escape"&&(d(!1),u.current?.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y)}},[b]);const f=o.useCallback(()=>{d(x=>!x)},[]);if(!r)return null;const g=t.filter(x=>x.type!=="custom");return e.jsxs("div",{className:"bt-column-visibility",ref:a,children:[e.jsxs("button",{ref:u,className:N("bt-column-visibility-btn",b&&"bt-column-visibility-btn-active"),onClick:f,"aria-expanded":b,"aria-haspopup":"true","aria-label":c.columns,title:c.columns,type:"button",children:[e.jsx(ns,{}),e.jsx("span",{className:"bt-column-visibility-label",children:c.columns}),h>0&&e.jsx("span",{className:"bt-column-visibility-badge",children:h})]}),b&&e.jsxs("div",{className:"bt-column-visibility-dropdown",role:"menu",children:[e.jsxs("div",{className:"bt-column-visibility-header",children:[e.jsx("span",{className:"bt-column-visibility-title",children:c.columns}),h>0&&e.jsx("button",{className:"bt-column-visibility-show-all",onClick:n,type:"button",children:c.showAllColumns})]}),e.jsx("div",{className:"bt-column-visibility-list",children:g.map(x=>{const y=i(x.id);return e.jsxs("button",{className:N("bt-column-visibility-item",!y&&"bt-column-visibility-item-hidden"),onClick:()=>l(x.id),role:"menuitemcheckbox","aria-checked":y,type:"button",children:[e.jsx("span",{className:N("bt-column-visibility-check",y&&"bt-column-visibility-check-active"),children:y&&e.jsx(ls,{})}),e.jsx("span",{className:"bt-column-visibility-item-label",children:x.header})]},x.id)})})]})]})}const is=as;function rs(){return e.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M9 3L5 7L9 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function os(){return e.jsx("svg",{className:"bt-pagination-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cs(){const{page:t,pageSize:s,totalPages:l,totalItems:n,goToPage:i,nextPage:c,prevPage:r,changePageSize:b,hasNextPage:d,hasPrevPage:a,startIndex:u,endIndex:h,paginationEnabled:f,pageSizeOptions:g,showSizeChanger:x,locale:y,classNames:C}=A(),P=o.useCallback(m=>{b(Number(m.target.value))},[b]),k=o.useCallback(m=>{if(m.key==="Enter"){const v=parseInt(m.target.value,10);!isNaN(v)&&v>=1&&v<=l&&i(v)}},[i,l]),j=o.useMemo(()=>{const m=[];if(l<=5)for(let S=1;S<=l;S++)m.push(S);else{m.push(1),t>3&&m.push("ellipsis");const S=Math.max(2,t-1),T=Math.min(l-1,t+1);for(let p=S;p<=T;p++)m.push(p);t<l-2&&m.push("ellipsis"),l>1&&m.push(l)}return m},[t,l]);return f?e.jsxs("div",{className:`bt-pagination ${C.pagination||""}`,children:[e.jsx("div",{className:"bt-pagination-info",children:n>0?`${u}-${h} ${y.of} ${n} ${y.items}`:`0 ${y.items}`}),e.jsxs("div",{className:"bt-pagination-controls",children:[x&&e.jsxs("div",{className:"bt-page-size",children:[e.jsxs("label",{className:"bt-page-size-label",htmlFor:"bt-page-size",children:[y.rowsPerPage,":"]}),e.jsx("select",{id:"bt-page-size",name:"bt-page-size",className:"bt-page-size-select",value:s,onChange:P,"aria-label":y.rowsPerPage,children:g.map(m=>e.jsx("option",{value:m,children:m},m))})]}),e.jsx("button",{className:"bt-pagination-btn",onClick:r,disabled:!a,"aria-label":y.previousPage,type:"button",children:e.jsx(rs,{})}),e.jsx("div",{className:"bt-pagination-pages",children:j.map((m,v)=>m==="ellipsis"?e.jsx("span",{className:"bt-pagination-ellipsis",children:"..."},`ellipsis-${v}`):e.jsx("button",{className:`bt-pagination-btn ${t===m?"bt-active":""}`,onClick:()=>i(m),"aria-label":`${y.page} ${m}`,"aria-current":t===m?"page":void 0,type:"button",children:m},m))}),e.jsx("button",{className:"bt-pagination-btn",onClick:c,disabled:!d,"aria-label":y.nextPage,type:"button",children:e.jsx(os,{})}),e.jsxs("div",{className:"bt-quick-jumper",children:[e.jsxs("label",{className:"bt-quick-jumper-label",htmlFor:"bt-quick-jumper",children:[y.page,":"]}),e.jsxs("div",{className:"bt-qj-wrapper",children:[e.jsx("input",{id:"bt-quick-jumper",name:"bt-quick-jumper",type:"number",className:"bt-quick-jumper-input",min:1,max:l,defaultValue:t,onKeyDown:k,"aria-label":y.jumpToPage},t),e.jsx("span",{className:"bt-qj-hint","aria-hidden":"true",children:"↵"})]})]})]})]}):null}function rt(t){const[s,l]=o.useState(()=>typeof window>"u"?!1:window.matchMedia(t).matches);return o.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(t);l(n.matches);const i=c=>l(c.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[t]),s}function Ge(){return e.jsxs("svg",{className:"bt-search-svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M9.5 9.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Je(){return e.jsx("svg",{className:"bt-clear-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function ds(){return e.jsx("svg",{className:"bt-check-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function bs(){return e.jsx("svg",{className:"bt-filter-toggle-svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M1 2.5H11L7.5 6.5V10L4.5 9V6.5L1 2.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function us(){const{searchable:t,searchValue:s,handleSearch:l,clearSearch:n,globalActions:i,selectedRows:c,selectedCount:r,deselectAll:b,data:d,locale:a,classNames:u,selectable:h,filters:f,filterPanelOpen:g,toggleFilterPanel:x,hasFilterableColumns:y,filterMode:C,columnVisibilityEnabled:P}=A(),k=rt("(max-width: 640px)"),[j,m]=o.useState(!1),v=o.useRef(null),S=Object.keys(f).length,T=o.useCallback(D=>{l(D.target.value)},[l]),p=o.useCallback(()=>{m(D=>(D?s&&n():setTimeout(()=>v.current?.focus(),50),!D))},[s,n]);o.useEffect(()=>{s&&!j&&m(!0)},[s,j]);const w=y&&(C==="panel"||C==="both");if(!(t||w||P||i&&i.length>0||h&&r>0))return null;const F=k&&t&&!j,R=t&&(!k||j);return e.jsxs("div",{className:N("bt-toolbar",u.toolbar),children:[e.jsxs("div",{className:"bt-toolbar-left",children:[F&&e.jsx("button",{className:"bt-search-toggle",onClick:p,"aria-label":a.search,title:a.search,type:"button",children:e.jsx(Ge,{})}),R&&e.jsxs("div",{className:N("bt-search",k&&"bt-search-mobile"),children:[e.jsx("span",{className:"bt-search-icon",children:e.jsx(Ge,{})}),e.jsx("input",{id:"bt-search",name:"bt-search",ref:v,type:"text",className:"bt-search-input",placeholder:a.searchPlaceholder,value:s,onChange:T,"aria-label":a.search}),(s||k)&&e.jsx("button",{className:"bt-search-clear",onClick:k?p:n,"aria-label":a.clearSearch,type:"button",children:e.jsx(Je,{})})]}),w&&e.jsxs("button",{className:N("bt-filter-toggle",g&&"bt-filter-toggle-active"),onClick:x,"aria-expanded":g,"aria-label":a.filterBy,title:a.filterBy,type:"button",children:[e.jsx("span",{className:"bt-filter-toggle-icon",children:e.jsx(bs,{})}),!k&&e.jsx("span",{children:a.filterBy}),S>0&&e.jsx("span",{className:"bt-filter-toggle-badge",children:S})]}),e.jsx(is,{}),h&&r>0&&e.jsxs("div",{className:"bt-selection-info",children:[e.jsx(ds,{}),e.jsxs("span",{className:"bt-selection-count",children:[r," ",k?"sel.":a.selected]}),e.jsx("button",{className:"bt-selection-clear",onClick:b,type:"button",children:k?e.jsx(Je,{}):a.deselectAll})]})]}),i&&i.length>0&&e.jsx("div",{className:"bt-toolbar-right",children:e.jsx("div",{className:"bt-global-actions",children:i.map(D=>{const O=D.requiresSelection&&c.length===0;return e.jsxs("button",{className:N("bt-global-btn",D.variant&&`bt-variant-${D.variant}`,k&&"bt-global-btn-mobile"),onClick:()=>D.onClick(c,d),disabled:O,title:D.label,"aria-label":D.label,type:"button",children:[D.icon&&e.jsx("span",{className:"bt-global-icon",children:D.icon}),!k&&e.jsx("span",{children:D.label})]},D.id)})})})]})}const hs=us;function fs(){return e.jsxs("svg",{className:"bt-empty-svg",width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("rect",{x:"12",y:"18",width:"40",height:"32",rx:"3",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),e.jsx("path",{d:"M12 28H52",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"}),e.jsx("path",{d:"M24 38H40",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.4"}),e.jsx("path",{d:"M28 44H36",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",opacity:"0.25"}),e.jsx("circle",{cx:"32",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"2",opacity:"0.2"})]})}function ms(){const{locale:t,emptyComponent:s,visibleColumns:l,selectable:n,rowActions:i}=A(),c=i&&i.length>0,r=l.length+(n?1:0)+(c?1:0);return s?e.jsx("tbody",{className:"bt-tbody",children:e.jsx("tr",{className:"bt-tr",children:e.jsx("td",{className:"bt-td",colSpan:r,children:s})})}):e.jsx("tbody",{className:"bt-tbody",children:e.jsx("tr",{className:"bt-tr",children:e.jsx("td",{className:"bt-td",colSpan:r,children:e.jsxs("div",{className:"bt-empty",children:[e.jsx("div",{className:"bt-empty-icon",children:e.jsx(fs,{})}),e.jsx("div",{className:"bt-empty-text",children:t.noData})]})})})})}function ps({show:t}){const{loadingComponent:s,locale:l}=A();return t?e.jsx("div",{className:"bt-loading-overlay",role:"status","aria-live":"polite",children:s||e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bt-loading-spinner","aria-hidden":"true"}),e.jsx("span",{className:"bt-loading-text",children:l.loading})]})}):null}function gs(){return e.jsx("svg",{className:"bt-modal-close-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function xs(){const{isModalOpen:t,modalContent:s,closeModal:l,locale:n}=A(),i=o.useCallback(r=>{r.target===r.currentTarget&&l()},[l]),c=o.useCallback(r=>{r.key==="Escape"&&l()},[l]);return o.useEffect(()=>(t&&(document.addEventListener("keydown",c),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=""}),[t,c]),!t||!s?null:e.jsx("div",{className:"bt-modal-backdrop",onClick:i,role:"dialog","aria-modal":"true",children:e.jsxs("div",{className:"bt-modal bt-modal-md",children:[e.jsxs("div",{className:"bt-modal-header",children:[e.jsx("h2",{className:"bt-modal-title",children:n.details}),e.jsx("button",{className:"bt-modal-close",onClick:l,"aria-label":n.closeModal,type:"button",children:e.jsx(gs,{})})]}),e.jsx("div",{className:"bt-modal-body",children:s})]})})}function ot({data:t,initialSort:s,controlledSort:l,onSortChange:n,multiSort:i=!1,controlledMultiSort:c,onMultiSortChange:r}){const[b,d]=o.useState(s??{columnId:null,direction:"asc"}),[a,u]=o.useState([]),h=l??b,f=c??a,g=o.useCallback(C=>{if(i){const P=f.findIndex(v=>v.columnId===C);let k;P>=0?f[P].direction==="asc"?(k=[...f],k[P]={columnId:C,direction:"desc"}):k=f.filter((S,T)=>T!==P):k=[...f,{columnId:C,direction:"asc"}],c||u(k),r?.(k);const j=k[0],m=j?{columnId:j.columnId,direction:j.direction}:{columnId:null,direction:"asc"};l||d(m),n?.(m)}else{let P;h.columnId!==C?P={columnId:C,direction:"asc"}:h.direction==="asc"?P={columnId:C,direction:"desc"}:P={columnId:null,direction:"asc"},l||d(P),n?.(P)}},[h,f,l,c,n,r,i]),x=o.useCallback(()=>{const C={columnId:null,direction:"asc"};l||d(C),n?.(C),i&&(c||u([]),r?.([]))},[l,c,n,r,i]);return{sortedData:o.useMemo(()=>i&&f.length>0?Rt(t,f):h.columnId?nt(t,h.columnId,h.direction):t,[t,h,f,i]),sortState:h,handleSort:g,clearSort:x,multiSortState:f,isMultiSort:i}}function ct({data:t,columns:s,initialFilters:l,controlledFilters:n,onFilterChange:i}){const[c,r]=o.useState(l??{}),b=n??c,d=o.useCallback((f,g)=>{const x={...b};if(g!==null&&typeof g=="object"&&"from"in g){const y=g;!y.from&&!y.to?delete x[f]:x[f]=g}else g==null||g===""?delete x[f]:x[f]=g;n||r(x),i?.(x)},[b,n,i]),a=o.useCallback(f=>{const g={...b};delete g[f],n||r(g),i?.(g)},[b,n,i]),u=o.useCallback(()=>{n||r({}),i?.({})},[n,i]);return{filteredData:o.useMemo(()=>lt(t,b,s),[t,b,s]),filters:b,setFilter:d,clearFilters:u,clearFilter:a}}function dt({data:t,config:s,onPageChange:l}){const n=s!==!1,i=s&&typeof s=="object"?s.page??1:1,c=s&&typeof s=="object"?s.pageSize??10:10,r=s&&typeof s=="object"?s.totalItems:void 0,[b,d]=o.useState(i),[a,u]=o.useState(c),h=r??t.length,f=Math.max(1,Math.ceil(h/a)),g=o.useCallback(m=>{const v=Math.max(1,Math.min(m,f));d(v),l?.(v,a)},[f,a,l]),x=o.useCallback(()=>{b<f&&g(b+1)},[b,f,g]),y=o.useCallback(()=>{b>1&&g(b-1)},[b,g]),C=o.useCallback(m=>{u(m),d(1),l?.(1,m)},[l]),P=o.useMemo(()=>{if(!n||r!==void 0)return t;const m=(b-1)*a;return t.slice(m,m+a)},[t,b,a,n,r]),k=(b-1)*a+1,j=Math.min(b*a,h);return{paginatedData:P,page:b,pageSize:a,totalPages:f,totalItems:h,goToPage:g,nextPage:x,prevPage:y,changePageSize:C,hasNextPage:b<f,hasPrevPage:b>1,startIndex:k,endIndex:j}}function bt({data:t,rowKey:s,mode:l="multiple",initialSelection:n,controlledSelection:i,onSelectionChange:c}){const[r,b]=o.useState(n??[]),d=i??r,a=o.useCallback((m,v)=>typeof s=="function"?s(m,v):String(m[s]),[s]),u=o.useMemo(()=>new Set(d.map((m,v)=>a(m,v))),[d,a]),h=o.useCallback((m,v)=>{const S=a(m,v);return u.has(S)},[a,u]),f=o.useCallback(m=>{i||b(m),c?.(m)},[i,c]),g=o.useCallback((m,v)=>{const S=a(m,v);let T;l==="single"?T=u.has(S)?[]:[m]:u.has(S)?T=d.filter((p,w)=>a(p,w)!==S):T=[...d,m],f(T)},[l,u,d,a,f]),x=o.useCallback((m,v)=>{if(!h(m,v)){const S=l==="single"?[m]:[...d,m];f(S)}},[h,l,d,f]),y=o.useCallback((m,v)=>{const S=a(m,v),T=d.filter((p,w)=>a(p,w)!==S);f(T)},[d,a,f]),C=o.useCallback(()=>{l==="multiple"&&f([...t])},[t,l,f]),P=o.useCallback(()=>{f([])},[f]),k=t.length>0&&d.length===t.length,j=d.length>0&&d.length<t.length;return{selectedRows:d,isSelected:h,toggleRow:g,selectRow:x,deselectRow:y,selectAll:C,deselectAll:P,isAllSelected:k,isPartiallySelected:j,selectedCount:d.length}}function ut({data:t,columns:s,searchColumns:l,initialValue:n,controlledValue:i,onSearchChange:c,debounceMs:r=0}){const[b,d]=o.useState(n??""),[a,u]=o.useState(n??""),h=o.useRef(null),f=i??b;o.useEffect(()=>{if(r<=0){u(f);return}return h.current=setTimeout(()=>{u(f)},r),()=>{h.current&&clearTimeout(h.current)}},[f,r]);const g=o.useCallback(C=>{i===void 0&&d(C),c?.(C)},[i,c]),x=o.useCallback(()=>{i===void 0&&d(""),h.current&&clearTimeout(h.current),u(""),c?.("")},[i,c]);return{searchedData:o.useMemo(()=>at(t,a,s,l),[t,a,s,l]),searchValue:f,handleSearch:g,clearSearch:x}}function ht({columns:t,controlledHiddenColumns:s,onColumnVisibilityChange:l}){const[n,i]=o.useState(()=>t.filter(h=>h.hidden).map(h=>h.id)),c=s??n,r=o.useMemo(()=>new Set(c),[c]),b=o.useCallback(h=>{const f=r.has(h)?c.filter(g=>g!==h):[...c,h];s||i(f),l?.(f)},[c,r,s,l]),d=o.useCallback(()=>{s||i([]),l?.([])},[s,l]),a=o.useCallback(h=>!r.has(h),[r]);return{visibleColumns:o.useMemo(()=>t.filter(h=>!r.has(h.id)),[t,r]),hiddenColumnIds:r,toggleColumn:b,showAllColumns:d,isColumnVisible:a,hiddenColumns:c}}function js(t){const{data:s,columns:l,rowKey:n="id",rowActions:i,globalActions:c,maxVisibleActions:r=3,pagination:b={pageSize:10},onPageChange:d,sort:a,onSortChange:u,multiSort:h=!1,multiSortState:f,onMultiSortChange:g,filters:x,onFilterChange:y,filterMode:C="floating",searchable:P=!1,searchValue:k,onSearchChange:j,searchColumns:m,searchDebounceMs:v=300,selectable:S,selectedRows:T,onSelectionChange:p,selectionMode:w="multiple",columnVisibility:L=!1,hiddenColumns:F,onColumnVisibilityChange:R,loading:D=!1,loadingComponent:O,emptyComponent:Q,classNames:B={},styles:G={},locale:E,stickyHeader:J=!1,maxHeight:ft,bordered:V=!1,striped:H=!1,hoverable:W=!0,size:q="medium",onRowClick:X,onRowDoubleClick:Y,ariaLabel:mt,ariaDescribedBy:pt}=t,ee=o.useMemo(()=>S!==void 0?S:c?.some(kt=>kt.requiresSelection)||p!==void 0,[S,c,p]),te=o.useMemo(()=>({...typeof E=="string"?Xe[E]:Z,...typeof E=="object"?E:{}}),[E]),[se,ne]=o.useState(!1),[le,ae]=o.useState(null),[K,gt]=o.useState(!1),ie=o.useCallback(()=>{gt(I=>!I)},[]),re=o.useMemo(()=>l.some(I=>I.filterable!==!1&&I.type!=="custom"&&!I.hidden),[l]),oe=o.useCallback(I=>{ae(I),ne(!0)},[]),ce=o.useCallback(()=>{ne(!1),ae(null)},[]),$=o.useMemo(()=>b===!1?!1:{pageSize:10,pageSizeOptions:[10,20,50,100],showSizeChanger:!1,...b},[b]),{searchedData:xt,searchValue:de,handleSearch:be,clearSearch:ue}=ut({data:s,columns:l,searchColumns:m,controlledValue:k,onSearchChange:j,debounceMs:v}),{filteredData:jt,filters:he,setFilter:fe,clearFilter:me,clearFilters:pe}=ct({data:xt,columns:l,controlledFilters:x,onFilterChange:y}),{sortedData:ge,sortState:xe,handleSort:je,clearSort:ve,multiSortState:Ce,isMultiSort:ye}=ot({data:jt,controlledSort:a,onSortChange:u,multiSort:h,controlledMultiSort:f,onMultiSortChange:g}),{visibleColumns:ke,hiddenColumnIds:we,toggleColumn:Ne,showAllColumns:Se,isColumnVisible:Pe}=ht({columns:l,controlledHiddenColumns:F,onColumnVisibilityChange:R}),{selectedRows:Te,isSelected:De,toggleRow:Ae,selectAll:Le,deselectAll:Me,isAllSelected:Ie,isPartiallySelected:$e,selectedCount:Fe}=bt({data:ge,rowKey:n,mode:w,controlledSelection:T,onSelectionChange:p}),{paginatedData:_,page:Re,pageSize:Ee,totalPages:Oe,totalItems:Be,goToPage:ze,nextPage:Ve,prevPage:He,changePageSize:We,hasNextPage:qe,hasPrevPage:Ke,startIndex:_e,endIndex:Ue}=dt({data:ge,config:$,onPageChange:d}),vt=o.useMemo(()=>({data:s,processedData:_,columns:l,visibleColumns:ke,rowKey:n,rowActions:i,globalActions:c,maxVisibleActions:r,sortState:xe,handleSort:je,multiSortState:Ce,isMultiSort:ye,clearSort:ve,columnVisibilityEnabled:L,hiddenColumnIds:we,toggleColumn:Ne,showAllColumns:Se,isColumnVisible:Pe,filters:he,setFilter:fe,clearFilter:me,clearFilters:pe,searchValue:de,handleSearch:be,clearSearch:ue,searchable:P,selectedRows:Te,isSelected:De,toggleRow:Ae,selectAll:Le,deselectAll:Me,isAllSelected:Ie,isPartiallySelected:$e,selectable:ee,selectionMode:w,selectedCount:Fe,page:Re,pageSize:Ee,totalPages:Oe,totalItems:Be,goToPage:ze,nextPage:Ve,prevPage:He,changePageSize:We,hasNextPage:qe,hasPrevPage:Ke,startIndex:_e,endIndex:Ue,paginationEnabled:b!==!1,pageSizeOptions:$&&typeof $=="object"?$.pageSizeOptions??[10,20,50,100]:[10,20,50,100],showSizeChanger:$&&typeof $=="object"?$.showSizeChanger??!1:!1,loading:D,loadingComponent:O,emptyComponent:Q,locale:te,classNames:B,size:q,bordered:V,striped:H,hoverable:W,stickyHeader:J,onRowClick:X,onRowDoubleClick:Y,openModal:oe,closeModal:ce,modalContent:le,isModalOpen:se,filterPanelOpen:K,toggleFilterPanel:ie,hasFilterableColumns:re,filterMode:C}),[s,_,l,ke,n,i,c,r,xe,je,Ce,ye,ve,L,we,Ne,Se,Pe,he,fe,me,pe,de,be,ue,P,Te,De,Ae,Le,Me,Ie,$e,ee,w,Fe,Re,Ee,Oe,Be,ze,Ve,He,We,qe,Ke,_e,Ue,b,$,D,O,Q,te,B,q,V,H,W,J,X,Y,oe,ce,le,se,K,ie,re,C]),U=_.length>0,Ct=rt("(max-width: 640px)");return e.jsx(et,{value:vt,children:e.jsxs("div",{className:N("bt-container",`bt-size-${q}`,H&&"bt-striped",V&&"bt-bordered",W&&"bt-hoverable",D&&"bt-container-loading",B.container),style:G.container,children:[e.jsx(hs,{}),(C==="panel"||C==="both")&&e.jsx(ss,{open:K}),e.jsxs("div",{className:"bt-table-wrapper",style:{maxHeight:ft},children:[Ct?U&&e.jsx(Xt,{}):e.jsxs("table",{className:N("bt-table",B.table),style:G.table,role:"grid","aria-label":mt,"aria-describedby":pt,"aria-busy":D,children:[e.jsx(Ft,{}),U?e.jsx(Ut,{}):e.jsx(ms,{})]}),e.jsx(ps,{show:D&&U})]}),b!==!1&&e.jsx(cs,{}),e.jsx(xs,{})]})})}const vs=js;exports.BetterTable=vs;exports.TableProvider=et;exports.defaultLocale=Z;exports.filterData=lt;exports.getValueFromPath=M;exports.locales=Xe;exports.searchData=at;exports.sortData=nt;exports.useColumnVisibility=ht;exports.useTableContext=A;exports.useTableFilter=ct;exports.useTablePagination=dt;exports.useTableSearch=ut;exports.useTableSelection=bt;exports.useTableSort=ot;
2
2
  //# sourceMappingURL=better-table.cjs.js.map