@stereopt/data-table 0.1.11 → 0.1.13
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/dist/index.cjs +64 -39
- package/dist/index.js +53 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -138,8 +138,26 @@ function Input({ className, type, ...props }) {
|
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
// src/dataTable/
|
|
141
|
+
// src/dataTable/filters/DataTableFilter.tsx
|
|
142
142
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
143
|
+
var DataTableFilter = ({
|
|
144
|
+
table,
|
|
145
|
+
filter
|
|
146
|
+
}) => {
|
|
147
|
+
switch (filter.type) {
|
|
148
|
+
case "select": {
|
|
149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { children: '"Select Filter not implemented yet"' });
|
|
150
|
+
}
|
|
151
|
+
case "date": {
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { children: '"Date Filter not implemented yet"' });
|
|
153
|
+
}
|
|
154
|
+
default:
|
|
155
|
+
throw new Error(`Type not Implemented: ${filter.type}`);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// src/dataTable/DataTableControls.tsx
|
|
160
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
143
161
|
var DataTableControls = ({
|
|
144
162
|
table,
|
|
145
163
|
search,
|
|
@@ -147,9 +165,9 @@ var DataTableControls = ({
|
|
|
147
165
|
}) => {
|
|
148
166
|
const value = table.getState().globalFilter ?? "";
|
|
149
167
|
const setValue = table.setGlobalFilter;
|
|
150
|
-
if (!filters
|
|
151
|
-
return /* @__PURE__ */ (0,
|
|
152
|
-
search && /* @__PURE__ */ (0,
|
|
168
|
+
if (!filters && !search) return null;
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-4 pb-4", children: [
|
|
170
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
153
171
|
Input,
|
|
154
172
|
{
|
|
155
173
|
className: "max-w-sm",
|
|
@@ -159,7 +177,14 @@ var DataTableControls = ({
|
|
|
159
177
|
}
|
|
160
178
|
),
|
|
161
179
|
filters?.map((filter) => {
|
|
162
|
-
return
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
181
|
+
DataTableFilter,
|
|
182
|
+
{
|
|
183
|
+
filter,
|
|
184
|
+
table
|
|
185
|
+
},
|
|
186
|
+
filter.column.toString()
|
|
187
|
+
);
|
|
163
188
|
})
|
|
164
189
|
] });
|
|
165
190
|
};
|
|
@@ -213,7 +238,7 @@ function composeRefs(...refs) {
|
|
|
213
238
|
}
|
|
214
239
|
|
|
215
240
|
// node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
216
|
-
var
|
|
241
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
217
242
|
// @__NO_SIDE_EFFECTS__
|
|
218
243
|
function createSlot(ownerName) {
|
|
219
244
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
@@ -231,9 +256,9 @@ function createSlot(ownerName) {
|
|
|
231
256
|
return child;
|
|
232
257
|
}
|
|
233
258
|
});
|
|
234
|
-
return /* @__PURE__ */ (0,
|
|
259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
|
|
235
260
|
}
|
|
236
|
-
return /* @__PURE__ */ (0,
|
|
261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
237
262
|
});
|
|
238
263
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
239
264
|
return Slot2;
|
|
@@ -260,7 +285,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
|
260
285
|
// @__NO_SIDE_EFFECTS__
|
|
261
286
|
function createSlottable(ownerName) {
|
|
262
287
|
const Slottable2 = ({ children }) => {
|
|
263
|
-
return /* @__PURE__ */ (0,
|
|
288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
264
289
|
};
|
|
265
290
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
266
291
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -309,7 +334,7 @@ function getElementRef(element) {
|
|
|
309
334
|
}
|
|
310
335
|
|
|
311
336
|
// src/components/ui/button.tsx
|
|
312
|
-
var
|
|
337
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
313
338
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
314
339
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
315
340
|
{
|
|
@@ -347,7 +372,7 @@ function Button({
|
|
|
347
372
|
...props
|
|
348
373
|
}) {
|
|
349
374
|
const Comp = asChild ? dist_exports.Root : "button";
|
|
350
|
-
return /* @__PURE__ */ (0,
|
|
375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
351
376
|
Comp,
|
|
352
377
|
{
|
|
353
378
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -480,25 +505,25 @@ var __iconNode4 = [
|
|
|
480
505
|
var ChevronsRight = createLucideIcon("chevrons-right", __iconNode4);
|
|
481
506
|
|
|
482
507
|
// src/dataTable/pagination/DataTablePagination.tsx
|
|
483
|
-
var
|
|
508
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
484
509
|
function DataTablePagination({
|
|
485
510
|
table
|
|
486
511
|
}) {
|
|
487
|
-
return /* @__PURE__ */ (0,
|
|
488
|
-
/* @__PURE__ */ (0,
|
|
512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between px-2 pt-4", children: [
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "text-muted-foreground flex-1 text-sm", children: [
|
|
489
514
|
table.getFilteredRowModel().rows.length,
|
|
490
515
|
" rows"
|
|
491
516
|
] }),
|
|
492
|
-
/* @__PURE__ */ (0,
|
|
493
|
-
/* @__PURE__ */ (0,
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
494
519
|
"Page ",
|
|
495
520
|
table.getState().pagination.pageIndex + 1,
|
|
496
521
|
" of",
|
|
497
522
|
" ",
|
|
498
523
|
table.getPageCount() || 1
|
|
499
524
|
] }),
|
|
500
|
-
/* @__PURE__ */ (0,
|
|
501
|
-
/* @__PURE__ */ (0,
|
|
525
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
502
527
|
Button,
|
|
503
528
|
{
|
|
504
529
|
className: "hidden size-8 lg:flex",
|
|
@@ -507,12 +532,12 @@ function DataTablePagination({
|
|
|
507
532
|
size: "icon",
|
|
508
533
|
variant: "outline",
|
|
509
534
|
children: [
|
|
510
|
-
/* @__PURE__ */ (0,
|
|
511
|
-
/* @__PURE__ */ (0,
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Go to first page" }),
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronsLeft, {})
|
|
512
537
|
]
|
|
513
538
|
}
|
|
514
539
|
),
|
|
515
|
-
/* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
516
541
|
Button,
|
|
517
542
|
{
|
|
518
543
|
className: "size-8",
|
|
@@ -521,12 +546,12 @@ function DataTablePagination({
|
|
|
521
546
|
size: "icon",
|
|
522
547
|
variant: "outline",
|
|
523
548
|
children: [
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
525
|
-
/* @__PURE__ */ (0,
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Go to previous page" }),
|
|
550
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronLeft, {})
|
|
526
551
|
]
|
|
527
552
|
}
|
|
528
553
|
),
|
|
529
|
-
/* @__PURE__ */ (0,
|
|
554
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
530
555
|
Button,
|
|
531
556
|
{
|
|
532
557
|
className: "size-8",
|
|
@@ -535,12 +560,12 @@ function DataTablePagination({
|
|
|
535
560
|
size: "icon",
|
|
536
561
|
variant: "outline",
|
|
537
562
|
children: [
|
|
538
|
-
/* @__PURE__ */ (0,
|
|
539
|
-
/* @__PURE__ */ (0,
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Go to next page" }),
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronRight, {})
|
|
540
565
|
]
|
|
541
566
|
}
|
|
542
567
|
),
|
|
543
|
-
/* @__PURE__ */ (0,
|
|
568
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
544
569
|
Button,
|
|
545
570
|
{
|
|
546
571
|
className: "hidden size-8 lg:flex",
|
|
@@ -549,8 +574,8 @@ function DataTablePagination({
|
|
|
549
574
|
size: "icon",
|
|
550
575
|
variant: "outline",
|
|
551
576
|
children: [
|
|
552
|
-
/* @__PURE__ */ (0,
|
|
553
|
-
/* @__PURE__ */ (0,
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Go to last page" }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronsRight, {})
|
|
554
579
|
]
|
|
555
580
|
}
|
|
556
581
|
)
|
|
@@ -571,7 +596,7 @@ var fuzzyFilterFn = (searchableColumns) => (row, columnId, filterValue, addMeta)
|
|
|
571
596
|
|
|
572
597
|
// src/dataTable/DataTable.tsx
|
|
573
598
|
var import_react_table = require("@tanstack/react-table");
|
|
574
|
-
var
|
|
599
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
575
600
|
function DataTable({
|
|
576
601
|
columns,
|
|
577
602
|
data,
|
|
@@ -591,8 +616,8 @@ function DataTable({
|
|
|
591
616
|
columnVisibility: config?.columnVisibility
|
|
592
617
|
}
|
|
593
618
|
});
|
|
594
|
-
return /* @__PURE__ */ (0,
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full", children: [
|
|
620
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
596
621
|
DataTableControls,
|
|
597
622
|
{
|
|
598
623
|
filters: config?.filters,
|
|
@@ -600,9 +625,9 @@ function DataTable({
|
|
|
600
625
|
table
|
|
601
626
|
}
|
|
602
627
|
),
|
|
603
|
-
/* @__PURE__ */ (0,
|
|
604
|
-
/* @__PURE__ */ (0,
|
|
605
|
-
return /* @__PURE__ */ (0,
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Table, { children: [
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
|
|
630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
606
631
|
TableHead,
|
|
607
632
|
{
|
|
608
633
|
colSpan: header.colSpan,
|
|
@@ -615,17 +640,17 @@ function DataTable({
|
|
|
615
640
|
header.id
|
|
616
641
|
);
|
|
617
642
|
}) }, headerGroup.id)) }),
|
|
618
|
-
/* @__PURE__ */ (0,
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
619
644
|
TableRow,
|
|
620
645
|
{
|
|
621
646
|
"data-state": row.getIsSelected() && "selected",
|
|
622
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
647
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableCell, { className: "truncate max-w-0", children: (0, import_react_table.flexRender)(
|
|
623
648
|
cell.column.columnDef.cell,
|
|
624
649
|
cell.getContext()
|
|
625
650
|
) }, cell.id))
|
|
626
651
|
},
|
|
627
652
|
row.id
|
|
628
|
-
)) : /* @__PURE__ */ (0,
|
|
653
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
629
654
|
TableCell,
|
|
630
655
|
{
|
|
631
656
|
className: "h-24 text-center",
|
|
@@ -634,7 +659,7 @@ function DataTable({
|
|
|
634
659
|
}
|
|
635
660
|
) }) })
|
|
636
661
|
] }) }),
|
|
637
|
-
/* @__PURE__ */ (0,
|
|
662
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DataTablePagination, { table })
|
|
638
663
|
] });
|
|
639
664
|
}
|
|
640
665
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js
CHANGED
|
@@ -107,8 +107,26 @@ function Input({ className, type, ...props }) {
|
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
// src/dataTable/filters/DataTableFilter.tsx
|
|
111
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
112
|
+
var DataTableFilter = ({
|
|
113
|
+
table,
|
|
114
|
+
filter
|
|
115
|
+
}) => {
|
|
116
|
+
switch (filter.type) {
|
|
117
|
+
case "select": {
|
|
118
|
+
return /* @__PURE__ */ jsx3("pre", { children: '"Select Filter not implemented yet"' });
|
|
119
|
+
}
|
|
120
|
+
case "date": {
|
|
121
|
+
return /* @__PURE__ */ jsx3("pre", { children: '"Date Filter not implemented yet"' });
|
|
122
|
+
}
|
|
123
|
+
default:
|
|
124
|
+
throw new Error(`Type not Implemented: ${filter.type}`);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
110
128
|
// src/dataTable/DataTableControls.tsx
|
|
111
|
-
import { jsx as
|
|
129
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
112
130
|
var DataTableControls = ({
|
|
113
131
|
table,
|
|
114
132
|
search,
|
|
@@ -116,9 +134,9 @@ var DataTableControls = ({
|
|
|
116
134
|
}) => {
|
|
117
135
|
const value = table.getState().globalFilter ?? "";
|
|
118
136
|
const setValue = table.setGlobalFilter;
|
|
119
|
-
if (!filters
|
|
137
|
+
if (!filters && !search) return null;
|
|
120
138
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 pb-4", children: [
|
|
121
|
-
search && /* @__PURE__ */
|
|
139
|
+
search && /* @__PURE__ */ jsx4(
|
|
122
140
|
Input,
|
|
123
141
|
{
|
|
124
142
|
className: "max-w-sm",
|
|
@@ -128,7 +146,14 @@ var DataTableControls = ({
|
|
|
128
146
|
}
|
|
129
147
|
),
|
|
130
148
|
filters?.map((filter) => {
|
|
131
|
-
return
|
|
149
|
+
return /* @__PURE__ */ jsx4(
|
|
150
|
+
DataTableFilter,
|
|
151
|
+
{
|
|
152
|
+
filter,
|
|
153
|
+
table
|
|
154
|
+
},
|
|
155
|
+
filter.column.toString()
|
|
156
|
+
);
|
|
132
157
|
})
|
|
133
158
|
] });
|
|
134
159
|
};
|
|
@@ -182,7 +207,7 @@ function composeRefs(...refs) {
|
|
|
182
207
|
}
|
|
183
208
|
|
|
184
209
|
// node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
185
|
-
import { Fragment as Fragment2, jsx as
|
|
210
|
+
import { Fragment as Fragment2, jsx as jsx5 } from "react/jsx-runtime";
|
|
186
211
|
// @__NO_SIDE_EFFECTS__
|
|
187
212
|
function createSlot(ownerName) {
|
|
188
213
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
@@ -200,9 +225,9 @@ function createSlot(ownerName) {
|
|
|
200
225
|
return child;
|
|
201
226
|
}
|
|
202
227
|
});
|
|
203
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ jsx5(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
|
|
204
229
|
}
|
|
205
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ jsx5(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
206
231
|
});
|
|
207
232
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
208
233
|
return Slot2;
|
|
@@ -229,7 +254,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
|
229
254
|
// @__NO_SIDE_EFFECTS__
|
|
230
255
|
function createSlottable(ownerName) {
|
|
231
256
|
const Slottable2 = ({ children }) => {
|
|
232
|
-
return /* @__PURE__ */
|
|
257
|
+
return /* @__PURE__ */ jsx5(Fragment2, { children });
|
|
233
258
|
};
|
|
234
259
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
235
260
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -278,7 +303,7 @@ function getElementRef(element) {
|
|
|
278
303
|
}
|
|
279
304
|
|
|
280
305
|
// src/components/ui/button.tsx
|
|
281
|
-
import { jsx as
|
|
306
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
282
307
|
var buttonVariants = cva(
|
|
283
308
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
284
309
|
{
|
|
@@ -316,7 +341,7 @@ function Button({
|
|
|
316
341
|
...props
|
|
317
342
|
}) {
|
|
318
343
|
const Comp = asChild ? dist_exports.Root : "button";
|
|
319
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ jsx6(
|
|
320
345
|
Comp,
|
|
321
346
|
{
|
|
322
347
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -449,7 +474,7 @@ var __iconNode4 = [
|
|
|
449
474
|
var ChevronsRight = createLucideIcon("chevrons-right", __iconNode4);
|
|
450
475
|
|
|
451
476
|
// src/dataTable/pagination/DataTablePagination.tsx
|
|
452
|
-
import { jsx as
|
|
477
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
453
478
|
function DataTablePagination({
|
|
454
479
|
table
|
|
455
480
|
}) {
|
|
@@ -476,8 +501,8 @@ function DataTablePagination({
|
|
|
476
501
|
size: "icon",
|
|
477
502
|
variant: "outline",
|
|
478
503
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Go to first page" }),
|
|
505
|
+
/* @__PURE__ */ jsx7(ChevronsLeft, {})
|
|
481
506
|
]
|
|
482
507
|
}
|
|
483
508
|
),
|
|
@@ -490,8 +515,8 @@ function DataTablePagination({
|
|
|
490
515
|
size: "icon",
|
|
491
516
|
variant: "outline",
|
|
492
517
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Go to previous page" }),
|
|
519
|
+
/* @__PURE__ */ jsx7(ChevronLeft, {})
|
|
495
520
|
]
|
|
496
521
|
}
|
|
497
522
|
),
|
|
@@ -504,8 +529,8 @@ function DataTablePagination({
|
|
|
504
529
|
size: "icon",
|
|
505
530
|
variant: "outline",
|
|
506
531
|
children: [
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Go to next page" }),
|
|
533
|
+
/* @__PURE__ */ jsx7(ChevronRight, {})
|
|
509
534
|
]
|
|
510
535
|
}
|
|
511
536
|
),
|
|
@@ -518,8 +543,8 @@ function DataTablePagination({
|
|
|
518
543
|
size: "icon",
|
|
519
544
|
variant: "outline",
|
|
520
545
|
children: [
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Go to last page" }),
|
|
547
|
+
/* @__PURE__ */ jsx7(ChevronsRight, {})
|
|
523
548
|
]
|
|
524
549
|
}
|
|
525
550
|
)
|
|
@@ -548,7 +573,7 @@ import {
|
|
|
548
573
|
getPaginationRowModel,
|
|
549
574
|
useReactTable
|
|
550
575
|
} from "@tanstack/react-table";
|
|
551
|
-
import { jsx as
|
|
576
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
552
577
|
function DataTable({
|
|
553
578
|
columns,
|
|
554
579
|
data,
|
|
@@ -569,7 +594,7 @@ function DataTable({
|
|
|
569
594
|
}
|
|
570
595
|
});
|
|
571
596
|
return /* @__PURE__ */ jsxs3("div", { className: "w-full", children: [
|
|
572
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ jsx8(
|
|
573
598
|
DataTableControls,
|
|
574
599
|
{
|
|
575
600
|
filters: config?.filters,
|
|
@@ -577,9 +602,9 @@ function DataTable({
|
|
|
577
602
|
table
|
|
578
603
|
}
|
|
579
604
|
),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
return /* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ jsx8("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ jsxs3(Table, { children: [
|
|
606
|
+
/* @__PURE__ */ jsx8(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx8(TableRow, { children: headerGroup.headers.map((header) => {
|
|
607
|
+
return /* @__PURE__ */ jsx8(
|
|
583
608
|
TableHead,
|
|
584
609
|
{
|
|
585
610
|
colSpan: header.colSpan,
|
|
@@ -592,17 +617,17 @@ function DataTable({
|
|
|
592
617
|
header.id
|
|
593
618
|
);
|
|
594
619
|
}) }, headerGroup.id)) }),
|
|
595
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ jsx8(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx8(
|
|
596
621
|
TableRow,
|
|
597
622
|
{
|
|
598
623
|
"data-state": row.getIsSelected() && "selected",
|
|
599
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
624
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx8(TableCell, { className: "truncate max-w-0", children: flexRender(
|
|
600
625
|
cell.column.columnDef.cell,
|
|
601
626
|
cell.getContext()
|
|
602
627
|
) }, cell.id))
|
|
603
628
|
},
|
|
604
629
|
row.id
|
|
605
|
-
)) : /* @__PURE__ */
|
|
630
|
+
)) : /* @__PURE__ */ jsx8(TableRow, { children: /* @__PURE__ */ jsx8(
|
|
606
631
|
TableCell,
|
|
607
632
|
{
|
|
608
633
|
className: "h-24 text-center",
|
|
@@ -611,7 +636,7 @@ function DataTable({
|
|
|
611
636
|
}
|
|
612
637
|
) }) })
|
|
613
638
|
] }) }),
|
|
614
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ jsx8(DataTablePagination, { table })
|
|
615
640
|
] });
|
|
616
641
|
}
|
|
617
642
|
export {
|