@krak-stack/registry 0.1.25 → 0.1.27
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/components/ui/data-table.js +212 -207
- package/dist/components/ui/effect-form.js +170 -169
- package/dist/components/ui/form.js +113 -112
- package/dist/components/ui/icon-input.js +43 -40
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/sidebar-layout.d.ts +5 -2
- package/dist/components/ui/sidebar-layout.js +88 -80
- package/dist/components/ui/theme-switcher.js +3 -3
- package/dist/components/ui/virtualized-combobox.js +34 -31
- package/dist/lib/docs.d.ts +3 -1
- package/dist/lib/docs.js +181 -162
- package/dist/lib/docs.server.js +62 -36
- package/dist/lib/documentation-toolkit.js +63 -37
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/httpapi-client.js +3 -3
- package/dist/lib/httpapi-helpers.js +11 -11
- package/dist/lib/httpapi-mcp.js +2 -2
- package/dist/lib/httpapi-toolkit.js +2 -2
- package/dist/lib/query.js +7 -7
- package/dist/lib/seo.js +2 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/services/agent/client/index.js +129 -128
- package/dist/services/agent/schema.js +5 -5
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.d.ts +2 -2
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +5 -5
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.d.ts +868 -0
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.d.ts +2 -0
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.d.ts +143 -0
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +7 -7
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/package.json +2 -2
|
@@ -1457,9 +1457,14 @@ import {
|
|
|
1457
1457
|
|
|
1458
1458
|
// ../../src/components/ui/input-group.tsx
|
|
1459
1459
|
import { cva as cva3 } from "class-variance-authority";
|
|
1460
|
+
|
|
1461
|
+
// ../../src/components/ui/textarea.tsx
|
|
1460
1462
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1463
|
+
|
|
1464
|
+
// ../../src/components/ui/input-group.tsx
|
|
1465
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1461
1466
|
function InputGroup({ className, ...props }) {
|
|
1462
|
-
return /* @__PURE__ */
|
|
1467
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
1463
1468
|
"data-slot": "input-group",
|
|
1464
1469
|
role: "group",
|
|
1465
1470
|
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
@@ -1492,7 +1497,7 @@ function InputGroupInput({
|
|
|
1492
1497
|
className,
|
|
1493
1498
|
...props
|
|
1494
1499
|
}) {
|
|
1495
|
-
return /* @__PURE__ */
|
|
1500
|
+
return /* @__PURE__ */ jsx16(Input, {
|
|
1496
1501
|
"data-slot": "input-group-control",
|
|
1497
1502
|
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
1498
1503
|
...props
|
|
@@ -1500,7 +1505,7 @@ function InputGroupInput({
|
|
|
1500
1505
|
}
|
|
1501
1506
|
|
|
1502
1507
|
// ../../src/components/ui/virtualized-combobox.tsx
|
|
1503
|
-
import { jsx as
|
|
1508
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1504
1509
|
"use client";
|
|
1505
1510
|
var messages2 = {
|
|
1506
1511
|
en: {
|
|
@@ -1576,19 +1581,19 @@ var VirtualizedComboboxList = ({
|
|
|
1576
1581
|
virtualizer.measure();
|
|
1577
1582
|
}, [virtualizer]);
|
|
1578
1583
|
if (filteredItems.length === 0) {
|
|
1579
|
-
return /* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ jsx17("div", {
|
|
1580
1585
|
className: "text-muted-foreground py-6 text-center text-sm",
|
|
1581
1586
|
children: emptyLabel
|
|
1582
1587
|
});
|
|
1583
1588
|
}
|
|
1584
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsx17(ComboboxPrimitive.List, {
|
|
1585
1590
|
className: "scroll-py-1 overflow-auto overscroll-contain p-1",
|
|
1586
1591
|
ref: handleScrollElementRef,
|
|
1587
1592
|
style: {
|
|
1588
1593
|
height: Math.min(virtualizer.getTotalSize() + 8, 288),
|
|
1589
1594
|
maxHeight: "var(--available-height)"
|
|
1590
1595
|
},
|
|
1591
|
-
children: /* @__PURE__ */
|
|
1596
|
+
children: /* @__PURE__ */ jsx17("div", {
|
|
1592
1597
|
className: "relative w-full",
|
|
1593
1598
|
role: "presentation",
|
|
1594
1599
|
style: { height: virtualizer.getTotalSize() },
|
|
@@ -1601,9 +1606,9 @@ var VirtualizedComboboxList = ({
|
|
|
1601
1606
|
transform: `translateY(${virtualItem.start}px)`
|
|
1602
1607
|
};
|
|
1603
1608
|
if (entry.kind === "group") {
|
|
1604
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx17(ComboboxPrimitive.Group, {
|
|
1605
1610
|
className: "contents",
|
|
1606
|
-
children: /* @__PURE__ */
|
|
1611
|
+
children: /* @__PURE__ */ jsx17(ComboboxPrimitive.GroupLabel, {
|
|
1607
1612
|
className: "text-muted-foreground absolute top-0 left-0 w-full px-2 pt-3 pb-1 text-xs",
|
|
1608
1613
|
"data-index": virtualItem.index,
|
|
1609
1614
|
ref: virtualizer.measureElement,
|
|
@@ -1622,13 +1627,13 @@ var VirtualizedComboboxList = ({
|
|
|
1622
1627
|
style,
|
|
1623
1628
|
value: entry.item,
|
|
1624
1629
|
children: [
|
|
1625
|
-
renderItem?.(entry.item) ?? /* @__PURE__ */
|
|
1630
|
+
renderItem?.(entry.item) ?? /* @__PURE__ */ jsx17("span", {
|
|
1626
1631
|
className: "min-w-0 truncate",
|
|
1627
1632
|
children: entry.item.label
|
|
1628
1633
|
}),
|
|
1629
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ jsx17(ComboboxPrimitive.ItemIndicator, {
|
|
1630
1635
|
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
1631
|
-
children: /* @__PURE__ */
|
|
1636
|
+
children: /* @__PURE__ */ jsx17(Check, {})
|
|
1632
1637
|
})
|
|
1633
1638
|
]
|
|
1634
1639
|
}, entry.item.value);
|
|
@@ -1647,8 +1652,8 @@ var VirtualizedComboboxContent = ({
|
|
|
1647
1652
|
virtualizerRef
|
|
1648
1653
|
}) => {
|
|
1649
1654
|
const labels2 = virtualizedComboboxMessages(messageOverrides);
|
|
1650
|
-
return /* @__PURE__ */
|
|
1651
|
-
children: /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsx17(ComboboxPrimitive.Portal, {
|
|
1656
|
+
children: /* @__PURE__ */ jsx17(ComboboxPrimitive.Positioner, {
|
|
1652
1657
|
align: "start",
|
|
1653
1658
|
className: "isolate z-50",
|
|
1654
1659
|
side: "bottom",
|
|
@@ -1656,17 +1661,17 @@ var VirtualizedComboboxContent = ({
|
|
|
1656
1661
|
children: /* @__PURE__ */ jsxs8(ComboboxPrimitive.Popup, {
|
|
1657
1662
|
className: cn("relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-in-95", contentClassName),
|
|
1658
1663
|
children: [
|
|
1659
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsx17("div", {
|
|
1660
1665
|
className: "min-w-0 p-1 pb-0",
|
|
1661
|
-
children: /* @__PURE__ */
|
|
1666
|
+
children: /* @__PURE__ */ jsx17(InputGroup, {
|
|
1662
1667
|
className: "border-input/30 bg-input/30 h-8 w-full min-w-0 shadow-none",
|
|
1663
|
-
children: /* @__PURE__ */
|
|
1668
|
+
children: /* @__PURE__ */ jsx17(ComboboxPrimitive.Input, {
|
|
1664
1669
|
placeholder: labels2.search,
|
|
1665
|
-
render: /* @__PURE__ */
|
|
1670
|
+
render: /* @__PURE__ */ jsx17(InputGroupInput, {})
|
|
1666
1671
|
})
|
|
1667
1672
|
})
|
|
1668
1673
|
}),
|
|
1669
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ jsx17(VirtualizedComboboxList, {
|
|
1670
1675
|
emptyLabel,
|
|
1671
1676
|
groupSelections,
|
|
1672
1677
|
itemIndexRef,
|
|
@@ -1689,20 +1694,20 @@ var defaultTrigger = (ariaLabel, ariaInvalid, disabled, label, triggerId) => /*
|
|
|
1689
1694
|
type: "button",
|
|
1690
1695
|
variant: "outline",
|
|
1691
1696
|
children: [
|
|
1692
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx17("span", {
|
|
1693
1698
|
className: "min-w-0 flex-1 truncate pr-7 text-left",
|
|
1694
1699
|
children: label
|
|
1695
1700
|
}),
|
|
1696
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ jsx17(ChevronsUpDown, {
|
|
1697
1702
|
className: "text-muted-foreground shrink-0 opacity-70"
|
|
1698
1703
|
})
|
|
1699
1704
|
]
|
|
1700
1705
|
});
|
|
1701
|
-
var defaultClear = (label) => /* @__PURE__ */
|
|
1706
|
+
var defaultClear = (label) => /* @__PURE__ */ jsx17(ComboboxPrimitive.Clear, {
|
|
1702
1707
|
"aria-label": label,
|
|
1703
1708
|
className: "text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute top-1/2 right-7 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-sm outline-none focus-visible:border focus-visible:ring-3",
|
|
1704
1709
|
type: "button",
|
|
1705
|
-
children: /* @__PURE__ */
|
|
1710
|
+
children: /* @__PURE__ */ jsx17(X, {
|
|
1706
1711
|
className: "size-3.5"
|
|
1707
1712
|
})
|
|
1708
1713
|
});
|
|
@@ -1741,13 +1746,13 @@ var VirtualizedComboboxSingle = (props) => {
|
|
|
1741
1746
|
/* @__PURE__ */ jsxs8("div", {
|
|
1742
1747
|
className: "relative",
|
|
1743
1748
|
children: [
|
|
1744
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ jsx17(ComboboxPrimitive.Trigger, {
|
|
1745
1750
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1746
1751
|
}),
|
|
1747
1752
|
props.trigger ? null : defaultClear(labels2.clear)
|
|
1748
1753
|
]
|
|
1749
1754
|
}),
|
|
1750
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ jsx17(VirtualizedComboboxContent, {
|
|
1751
1756
|
...props,
|
|
1752
1757
|
groupSelections: false,
|
|
1753
1758
|
itemIndexRef,
|
|
@@ -1783,13 +1788,13 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
1783
1788
|
/* @__PURE__ */ jsxs8("div", {
|
|
1784
1789
|
className: "relative",
|
|
1785
1790
|
children: [
|
|
1786
|
-
/* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ jsx17(ComboboxPrimitive.Trigger, {
|
|
1787
1792
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1788
1793
|
}),
|
|
1789
1794
|
props.trigger ? null : defaultClear(labels2.clear)
|
|
1790
1795
|
]
|
|
1791
1796
|
}),
|
|
1792
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsx17(VirtualizedComboboxContent, {
|
|
1793
1798
|
...props,
|
|
1794
1799
|
groupSelections: true,
|
|
1795
1800
|
itemIndexRef,
|
|
@@ -1800,15 +1805,15 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
1800
1805
|
});
|
|
1801
1806
|
};
|
|
1802
1807
|
function VirtualizedCombobox(props) {
|
|
1803
|
-
return props.multiple ? /* @__PURE__ */
|
|
1808
|
+
return props.multiple ? /* @__PURE__ */ jsx17(VirtualizedComboboxMultiple, {
|
|
1804
1809
|
...props
|
|
1805
|
-
}) : /* @__PURE__ */
|
|
1810
|
+
}) : /* @__PURE__ */ jsx17(VirtualizedComboboxSingle, {
|
|
1806
1811
|
...props
|
|
1807
1812
|
});
|
|
1808
1813
|
}
|
|
1809
1814
|
|
|
1810
1815
|
// ../../src/components/ui/data-table.tsx
|
|
1811
|
-
import { jsx as
|
|
1816
|
+
import { jsx as jsx18, jsxs as jsxs9, Fragment } from "react/jsx-runtime";
|
|
1812
1817
|
var DataTablePersistedUiStateSchema = Schema.Struct({
|
|
1813
1818
|
columnVisibility: Schema.Record(Schema.String, Schema.Boolean),
|
|
1814
1819
|
columnSizing: Schema.Record(Schema.String, Schema.Number),
|
|
@@ -2154,7 +2159,7 @@ var renderCell = (row, column) => {
|
|
|
2154
2159
|
};
|
|
2155
2160
|
const CellRenderer = column.colDef.cellRenderer;
|
|
2156
2161
|
if (CellRenderer)
|
|
2157
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ jsx18(CellRenderer, {
|
|
2158
2163
|
...params
|
|
2159
2164
|
});
|
|
2160
2165
|
return column.colDef.valueFormatter?.(params) ?? (value === null || value === undefined ? null : String(value));
|
|
@@ -2202,30 +2207,30 @@ var DataTableRowActions = ({
|
|
|
2202
2207
|
return null;
|
|
2203
2208
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
2204
2209
|
children: [
|
|
2205
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, {
|
|
2206
2211
|
onClick: (event) => event.stopPropagation(),
|
|
2207
2212
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
2208
2213
|
className: "size-8 focus-visible:ring-inset [&_svg:not([class*='size-'])]:size-4",
|
|
2209
2214
|
size: "icon",
|
|
2210
2215
|
variant: "ghost",
|
|
2211
2216
|
children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2213
2218
|
className: "sr-only",
|
|
2214
2219
|
children: title
|
|
2215
2220
|
}),
|
|
2216
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ jsx18(MoreHorizontal, {})
|
|
2217
2222
|
]
|
|
2218
2223
|
})
|
|
2219
2224
|
}),
|
|
2220
|
-
/* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ jsx18(DropdownMenuContent, {
|
|
2221
2226
|
align: "end",
|
|
2222
2227
|
className: "w-max",
|
|
2223
2228
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
2224
2229
|
children: [
|
|
2225
|
-
/* @__PURE__ */
|
|
2230
|
+
/* @__PURE__ */ jsx18(DropdownMenuLabel, {
|
|
2226
2231
|
children: title
|
|
2227
2232
|
}),
|
|
2228
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2229
2234
|
visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
2230
2235
|
onClick: (event) => {
|
|
2231
2236
|
event.stopPropagation();
|
|
@@ -2263,7 +2268,7 @@ var DataTableRowActionMenu = ({
|
|
|
2263
2268
|
reorderActions.push({
|
|
2264
2269
|
id: "data-table-move-up",
|
|
2265
2270
|
name: store.config.labels.moveUp,
|
|
2266
|
-
icon: /* @__PURE__ */
|
|
2271
|
+
icon: /* @__PURE__ */ jsx18(ArrowUp, {}),
|
|
2267
2272
|
onClick: () => move(rowIndex - 1)
|
|
2268
2273
|
});
|
|
2269
2274
|
}
|
|
@@ -2271,12 +2276,12 @@ var DataTableRowActionMenu = ({
|
|
|
2271
2276
|
reorderActions.push({
|
|
2272
2277
|
id: "data-table-move-down",
|
|
2273
2278
|
name: store.config.labels.moveDown,
|
|
2274
|
-
icon: /* @__PURE__ */
|
|
2279
|
+
icon: /* @__PURE__ */ jsx18(ArrowDown, {}),
|
|
2275
2280
|
onClick: () => move(rowIndex + 1)
|
|
2276
2281
|
});
|
|
2277
2282
|
}
|
|
2278
2283
|
}
|
|
2279
|
-
return /* @__PURE__ */
|
|
2284
|
+
return /* @__PURE__ */ jsx18(DataTableRowActions, {
|
|
2280
2285
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
2281
2286
|
row: row.data,
|
|
2282
2287
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -2303,10 +2308,10 @@ var DataTableToolbar = ({
|
|
|
2303
2308
|
features.search !== false ? /* @__PURE__ */ jsxs9("div", {
|
|
2304
2309
|
className: "relative min-w-0",
|
|
2305
2310
|
children: [
|
|
2306
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsx18(Search, {
|
|
2307
2312
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
2308
2313
|
}),
|
|
2309
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsx18(Input, {
|
|
2310
2315
|
className: "px-9",
|
|
2311
2316
|
onChange: (event) => update((state) => ({
|
|
2312
2317
|
...state,
|
|
@@ -2316,7 +2321,7 @@ var DataTableToolbar = ({
|
|
|
2316
2321
|
placeholder: labels2.filter,
|
|
2317
2322
|
value: store.state.globalFilter ?? ""
|
|
2318
2323
|
}),
|
|
2319
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2324
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx18(Button, {
|
|
2320
2325
|
"aria-label": labels2.filter,
|
|
2321
2326
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2",
|
|
2322
2327
|
onClick: () => update((state) => ({
|
|
@@ -2326,11 +2331,11 @@ var DataTableToolbar = ({
|
|
|
2326
2331
|
})),
|
|
2327
2332
|
size: "icon",
|
|
2328
2333
|
variant: "ghost",
|
|
2329
|
-
children: /* @__PURE__ */
|
|
2334
|
+
children: /* @__PURE__ */ jsx18(X2, {})
|
|
2330
2335
|
}) : null
|
|
2331
2336
|
]
|
|
2332
2337
|
}) : null,
|
|
2333
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ jsx18("div", {
|
|
2334
2339
|
className: "-m-1 flex overflow-x-auto p-1",
|
|
2335
2340
|
children: /* @__PURE__ */ jsxs9(Menubar, {
|
|
2336
2341
|
className: "h-auto w-max min-w-full justify-start bg-transparent shadow-none [&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4",
|
|
@@ -2341,22 +2346,22 @@ var DataTableToolbar = ({
|
|
|
2341
2346
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 aria-expanded:bg-primary/90",
|
|
2342
2347
|
children: [
|
|
2343
2348
|
labels2.selected,
|
|
2344
|
-
/* @__PURE__ */
|
|
2349
|
+
/* @__PURE__ */ jsx18(Badge, {
|
|
2345
2350
|
variant: "secondary",
|
|
2346
2351
|
children: selectedRows.length
|
|
2347
2352
|
}),
|
|
2348
|
-
/* @__PURE__ */
|
|
2353
|
+
/* @__PURE__ */ jsx18(ChevronDown, {})
|
|
2349
2354
|
]
|
|
2350
2355
|
}),
|
|
2351
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2352
2357
|
align: "end",
|
|
2353
2358
|
className: "w-max",
|
|
2354
2359
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2355
2360
|
children: [
|
|
2356
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx18(MenubarLabel, {
|
|
2357
2362
|
children: bulkActions && bulkActions.label ? bulkActions.label : labels2.actions
|
|
2358
2363
|
}),
|
|
2359
|
-
/* @__PURE__ */
|
|
2364
|
+
/* @__PURE__ */ jsx18(MenubarSeparator, {}),
|
|
2360
2365
|
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2361
2366
|
onClick: () => action.onClick(selectedRows),
|
|
2362
2367
|
variant: action.variant,
|
|
@@ -2375,22 +2380,22 @@ var DataTableToolbar = ({
|
|
|
2375
2380
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2376
2381
|
"aria-label": labels2.groupBy,
|
|
2377
2382
|
children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx18(Rows3, {}),
|
|
2384
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2380
2385
|
className: "hidden sm:inline",
|
|
2381
2386
|
children: labels2.groupBy
|
|
2382
2387
|
})
|
|
2383
2388
|
]
|
|
2384
2389
|
}),
|
|
2385
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2386
2391
|
align: "end",
|
|
2387
2392
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2388
2393
|
children: [
|
|
2389
|
-
/* @__PURE__ */
|
|
2394
|
+
/* @__PURE__ */ jsx18(MenubarLabel, {
|
|
2390
2395
|
children: labels2.groupBy
|
|
2391
2396
|
}),
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ jsx18(MenubarSeparator, {}),
|
|
2398
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx18(MenubarCheckboxItem, {
|
|
2394
2399
|
checked: store.state.grouping.includes(field.id),
|
|
2395
2400
|
onCheckedChange: (checked) => update((state) => ({
|
|
2396
2401
|
...state,
|
|
@@ -2403,22 +2408,22 @@ var DataTableToolbar = ({
|
|
|
2403
2408
|
})
|
|
2404
2409
|
]
|
|
2405
2410
|
}) : null,
|
|
2406
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2411
|
+
features.sorting !== false ? /* @__PURE__ */ jsx18(SortMenu, {
|
|
2407
2412
|
tableAtom
|
|
2408
2413
|
}) : null,
|
|
2409
|
-
features.gallery ? /* @__PURE__ */
|
|
2414
|
+
features.gallery ? /* @__PURE__ */ jsx18(ViewMenu, {
|
|
2410
2415
|
tableAtom
|
|
2411
2416
|
}) : null,
|
|
2412
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2417
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx18(ColumnMenu, {
|
|
2413
2418
|
tableAtom
|
|
2414
2419
|
}) : null,
|
|
2415
|
-
features.refresh ? /* @__PURE__ */
|
|
2420
|
+
features.refresh ? /* @__PURE__ */ jsx18(MenubarMenu, {
|
|
2416
2421
|
children: /* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2417
2422
|
"aria-label": labels2.refresh,
|
|
2418
2423
|
onClick: features.refresh,
|
|
2419
2424
|
children: [
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ jsx18(RefreshCw, {}),
|
|
2426
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2422
2427
|
className: "hidden sm:inline",
|
|
2423
2428
|
children: labels2.refresh
|
|
2424
2429
|
})
|
|
@@ -2431,25 +2436,25 @@ var DataTableToolbar = ({
|
|
|
2431
2436
|
"aria-label": labels2.export,
|
|
2432
2437
|
disabled: !exportRows.length,
|
|
2433
2438
|
children: [
|
|
2434
|
-
/* @__PURE__ */
|
|
2435
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsx18(Download, {}),
|
|
2440
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2436
2441
|
className: "hidden sm:inline",
|
|
2437
2442
|
children: labels2.export
|
|
2438
2443
|
})
|
|
2439
2444
|
]
|
|
2440
2445
|
}),
|
|
2441
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2442
2447
|
align: "end",
|
|
2443
2448
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2444
2449
|
children: [
|
|
2445
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ jsx18(MenubarLabel, {
|
|
2446
2451
|
children: labels2.export
|
|
2447
2452
|
}),
|
|
2448
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx18(MenubarSeparator, {}),
|
|
2449
2454
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2450
2455
|
onClick: () => downloadCsv(model.visibleColumns.map(columnLabel), exportRows.map((row) => model.visibleColumns.map((column) => String(row.values.get(column.id) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
2451
2456
|
children: [
|
|
2452
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ jsx18(FileText, {}),
|
|
2453
2458
|
labels2.exportCsv
|
|
2454
2459
|
]
|
|
2455
2460
|
}),
|
|
@@ -2459,7 +2464,7 @@ var DataTableToolbar = ({
|
|
|
2459
2464
|
row.values.get(column.id)
|
|
2460
2465
|
]))), features.export ? features.export.baseName : "table"),
|
|
2461
2466
|
children: [
|
|
2462
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsx18(FileJson, {}),
|
|
2463
2468
|
labels2.exportJson
|
|
2464
2469
|
]
|
|
2465
2470
|
})
|
|
@@ -2492,14 +2497,14 @@ var SortMenu = ({
|
|
|
2492
2497
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2493
2498
|
"aria-label": store.config.labels.sortBy,
|
|
2494
2499
|
children: [
|
|
2495
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2500
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx18(ArrowDown, {}) : /* @__PURE__ */ jsx18(ArrowUp, {}) : /* @__PURE__ */ jsx18(ChevronsUpDown2, {}),
|
|
2501
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2497
2502
|
className: "hidden sm:inline",
|
|
2498
2503
|
children: store.config.labels.sortBy
|
|
2499
2504
|
})
|
|
2500
2505
|
]
|
|
2501
2506
|
}),
|
|
2502
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2503
2508
|
align: "end",
|
|
2504
2509
|
className: "w-52",
|
|
2505
2510
|
children: columns.map((column) => {
|
|
@@ -2508,7 +2513,7 @@ var SortMenu = ({
|
|
|
2508
2513
|
children: [
|
|
2509
2514
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2510
2515
|
children: [
|
|
2511
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
2516
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx18(ArrowDown, {}) : /* @__PURE__ */ jsx18(ArrowUp, {}) : null,
|
|
2512
2517
|
columnLabel(column)
|
|
2513
2518
|
]
|
|
2514
2519
|
}),
|
|
@@ -2517,7 +2522,7 @@ var SortMenu = ({
|
|
|
2517
2522
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2518
2523
|
onClick: () => sort(column.id, "asc"),
|
|
2519
2524
|
children: [
|
|
2520
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsx18(ArrowUp, {}),
|
|
2521
2526
|
" ",
|
|
2522
2527
|
store.config.labels.sortAsc
|
|
2523
2528
|
]
|
|
@@ -2525,21 +2530,21 @@ var SortMenu = ({
|
|
|
2525
2530
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2526
2531
|
onClick: () => sort(column.id, "desc"),
|
|
2527
2532
|
children: [
|
|
2528
|
-
/* @__PURE__ */
|
|
2533
|
+
/* @__PURE__ */ jsx18(ArrowDown, {}),
|
|
2529
2534
|
" ",
|
|
2530
2535
|
store.config.labels.sortDesc
|
|
2531
2536
|
]
|
|
2532
2537
|
}),
|
|
2533
2538
|
sortState ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2534
2539
|
children: [
|
|
2535
|
-
/* @__PURE__ */
|
|
2540
|
+
/* @__PURE__ */ jsx18(MenubarSeparator, {}),
|
|
2536
2541
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2537
2542
|
onClick: () => changeState(setStore, (state) => ({
|
|
2538
2543
|
...state,
|
|
2539
2544
|
sort: state.sort?.filter(({ id }) => id !== column.id)
|
|
2540
2545
|
})),
|
|
2541
2546
|
children: [
|
|
2542
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx18(X2, {}),
|
|
2543
2548
|
" ",
|
|
2544
2549
|
store.config.labels.sortClear
|
|
2545
2550
|
]
|
|
@@ -2564,14 +2569,14 @@ var ViewMenu = ({
|
|
|
2564
2569
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2565
2570
|
"aria-label": store.config.labels.view,
|
|
2566
2571
|
children: [
|
|
2567
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2572
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx18(LayoutGrid, {}) : /* @__PURE__ */ jsx18(Rows3, {}),
|
|
2573
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2569
2574
|
className: "hidden sm:inline",
|
|
2570
2575
|
children: store.config.labels.view
|
|
2571
2576
|
})
|
|
2572
2577
|
]
|
|
2573
2578
|
}),
|
|
2574
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2575
2580
|
align: "end",
|
|
2576
2581
|
children: /* @__PURE__ */ jsxs9(MenubarRadioGroup, {
|
|
2577
2582
|
onValueChange: (view) => {
|
|
@@ -2584,7 +2589,7 @@ var ViewMenu = ({
|
|
|
2584
2589
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2585
2590
|
value: "table",
|
|
2586
2591
|
children: [
|
|
2587
|
-
/* @__PURE__ */
|
|
2592
|
+
/* @__PURE__ */ jsx18(Rows3, {}),
|
|
2588
2593
|
" ",
|
|
2589
2594
|
store.config.labels.tableView
|
|
2590
2595
|
]
|
|
@@ -2592,7 +2597,7 @@ var ViewMenu = ({
|
|
|
2592
2597
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2593
2598
|
value: "gallery",
|
|
2594
2599
|
children: [
|
|
2595
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ jsx18(LayoutGrid, {}),
|
|
2596
2601
|
" ",
|
|
2597
2602
|
store.config.labels.galleryView
|
|
2598
2603
|
]
|
|
@@ -2615,22 +2620,22 @@ var ColumnMenu = ({
|
|
|
2615
2620
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2616
2621
|
"aria-label": store.config.labels.columns,
|
|
2617
2622
|
children: [
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2623
|
+
/* @__PURE__ */ jsx18(Settings2, {}),
|
|
2624
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2620
2625
|
className: "hidden sm:inline",
|
|
2621
2626
|
children: store.config.labels.columns
|
|
2622
2627
|
})
|
|
2623
2628
|
]
|
|
2624
2629
|
}),
|
|
2625
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ jsx18(MenubarContent, {
|
|
2626
2631
|
align: "end",
|
|
2627
2632
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2628
2633
|
children: [
|
|
2629
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ jsx18(MenubarLabel, {
|
|
2630
2635
|
children: store.config.labels.columns
|
|
2631
2636
|
}),
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
columns.map((column) => /* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx18(MenubarSeparator, {}),
|
|
2638
|
+
columns.map((column) => /* @__PURE__ */ jsx18(MenubarCheckboxItem, {
|
|
2634
2639
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
2635
2640
|
onCheckedChange: (visible) => changeState(setStore, (state) => ({
|
|
2636
2641
|
...state,
|
|
@@ -2675,7 +2680,7 @@ var ResizeHandle = ({
|
|
|
2675
2680
|
const startWidth = Number(event.currentTarget.dataset.startWidth);
|
|
2676
2681
|
resize(startWidth + event.clientX - startX);
|
|
2677
2682
|
};
|
|
2678
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsx18("button", {
|
|
2679
2684
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
2680
2685
|
"aria-orientation": "vertical",
|
|
2681
2686
|
"aria-valuemax": column.colDef.maxWidth ?? DEFAULT_MAX_WIDTH,
|
|
@@ -2796,7 +2801,7 @@ var DragHandle = ({
|
|
|
2796
2801
|
};
|
|
2797
2802
|
return /* @__PURE__ */ jsxs9(Fragment, {
|
|
2798
2803
|
children: [
|
|
2799
|
-
/* @__PURE__ */
|
|
2804
|
+
/* @__PURE__ */ jsx18(Button, {
|
|
2800
2805
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
2801
2806
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
2802
2807
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -2814,9 +2819,9 @@ var DragHandle = ({
|
|
|
2814
2819
|
onPointerUp: finish,
|
|
2815
2820
|
size: "icon",
|
|
2816
2821
|
variant: "ghost",
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2822
|
+
children: /* @__PURE__ */ jsx18(GripVertical, {})
|
|
2818
2823
|
}),
|
|
2819
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
2824
|
+
overlay ? createPortal(/* @__PURE__ */ jsx18("div", {
|
|
2820
2825
|
"aria-hidden": "true",
|
|
2821
2826
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
2822
2827
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -2859,36 +2864,36 @@ var TableDataRow = ({
|
|
|
2859
2864
|
},
|
|
2860
2865
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
2861
2866
|
children: [
|
|
2862
|
-
selection ? /* @__PURE__ */
|
|
2867
|
+
selection ? /* @__PURE__ */ jsx18(TableCell, {
|
|
2863
2868
|
className: "w-10 pr-0",
|
|
2864
2869
|
onClick: (event) => event.stopPropagation(),
|
|
2865
|
-
children: /* @__PURE__ */
|
|
2870
|
+
children: /* @__PURE__ */ jsx18(Checkbox, {
|
|
2866
2871
|
"aria-label": store.config.labels.selectRow,
|
|
2867
2872
|
checked: !!store.state.rowSelection[row.id],
|
|
2868
2873
|
disabled: !selectable,
|
|
2869
2874
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked)
|
|
2870
2875
|
})
|
|
2871
2876
|
}) : null,
|
|
2872
|
-
draggable ? /* @__PURE__ */
|
|
2877
|
+
draggable ? /* @__PURE__ */ jsx18(TableCell, {
|
|
2873
2878
|
className: "w-10 pr-0",
|
|
2874
|
-
children: /* @__PURE__ */
|
|
2879
|
+
children: /* @__PURE__ */ jsx18(DragHandle, {
|
|
2875
2880
|
tableAtom
|
|
2876
2881
|
})
|
|
2877
2882
|
}) : null,
|
|
2878
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
2883
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx18(TableCell, {
|
|
2879
2884
|
className: cn("min-w-24 overflow-hidden", column.colDef.truncate ? "whitespace-nowrap" : "whitespace-normal"),
|
|
2880
2885
|
style: { width: column.width },
|
|
2881
|
-
children: /* @__PURE__ */
|
|
2886
|
+
children: /* @__PURE__ */ jsx18("div", {
|
|
2882
2887
|
className: cn("min-w-0", column.colDef.truncate && "truncate"),
|
|
2883
2888
|
children: renderCell(row, column)
|
|
2884
2889
|
})
|
|
2885
2890
|
}, column.id)),
|
|
2886
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
2891
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx18(TableCell, {
|
|
2887
2892
|
className: "bg-background group-data-[state=selected]/row:bg-muted sticky right-0 z-20 w-10 min-w-10 cursor-default p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
2888
2893
|
onClick: (event) => event.stopPropagation(),
|
|
2889
|
-
children: /* @__PURE__ */
|
|
2894
|
+
children: /* @__PURE__ */ jsx18("div", {
|
|
2890
2895
|
className: "flex h-16 items-center justify-center",
|
|
2891
|
-
children: /* @__PURE__ */
|
|
2896
|
+
children: /* @__PURE__ */ jsx18(DataTableRowActionMenu, {
|
|
2892
2897
|
tableAtom
|
|
2893
2898
|
})
|
|
2894
2899
|
})
|
|
@@ -2906,23 +2911,23 @@ var GroupActions = ({
|
|
|
2906
2911
|
return null;
|
|
2907
2912
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
2908
2913
|
children: [
|
|
2909
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, {
|
|
2910
2915
|
onClick: (event) => event.stopPropagation(),
|
|
2911
2916
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
2912
2917
|
size: "icon",
|
|
2913
2918
|
variant: "ghost",
|
|
2914
2919
|
children: [
|
|
2915
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2916
2921
|
className: "sr-only",
|
|
2917
2922
|
children: title
|
|
2918
2923
|
}),
|
|
2919
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ jsx18(MoreHorizontal, {})
|
|
2920
2925
|
]
|
|
2921
2926
|
})
|
|
2922
2927
|
}),
|
|
2923
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsx18(DropdownMenuContent, {
|
|
2924
2929
|
align: "end",
|
|
2925
|
-
children: /* @__PURE__ */
|
|
2930
|
+
children: /* @__PURE__ */ jsx18(DropdownMenuGroup, {
|
|
2926
2931
|
children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
2927
2932
|
onClick: () => action.onClick(groupId),
|
|
2928
2933
|
variant: action.variant,
|
|
@@ -2958,10 +2963,10 @@ var GroupedTable = ({
|
|
|
2958
2963
|
className: "data-[drop-target=true]:outline-primary relative data-[drop-target=true]:z-30 data-[drop-target=true]:outline-2 data-[drop-target=true]:-outline-offset-2 data-[drop-target=true]:[&>tr]:border-transparent data-[drop-target=true]:[&>tr>td:last-child]:z-0",
|
|
2959
2964
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
2960
2965
|
children: [
|
|
2961
|
-
/* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ jsx18(TableRow, {
|
|
2962
2967
|
className: "bg-muted/40 hover:bg-accent! cursor-pointer",
|
|
2963
2968
|
onClick: toggleCollapsed,
|
|
2964
|
-
children: /* @__PURE__ */
|
|
2969
|
+
children: /* @__PURE__ */ jsx18(TableCell, {
|
|
2965
2970
|
colSpan: model.visibleColumns.length + extra,
|
|
2966
2971
|
children: /* @__PURE__ */ jsxs9("div", {
|
|
2967
2972
|
className: "flex items-center gap-2",
|
|
@@ -2972,22 +2977,22 @@ var GroupedTable = ({
|
|
|
2972
2977
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
2973
2978
|
type: "button",
|
|
2974
2979
|
children: [
|
|
2975
|
-
collapsed ? /* @__PURE__ */
|
|
2980
|
+
collapsed ? /* @__PURE__ */ jsx18(ChevronRight2, {
|
|
2976
2981
|
className: "size-4"
|
|
2977
|
-
}) : /* @__PURE__ */
|
|
2982
|
+
}) : /* @__PURE__ */ jsx18(ChevronDown, {
|
|
2978
2983
|
className: "size-4"
|
|
2979
2984
|
}),
|
|
2980
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx18("span", {
|
|
2981
2986
|
className: "flex-1",
|
|
2982
2987
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
2983
2988
|
})
|
|
2984
2989
|
]
|
|
2985
2990
|
}),
|
|
2986
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ jsx18(Badge, {
|
|
2987
2992
|
variant: "secondary",
|
|
2988
2993
|
children: section.rows.length
|
|
2989
2994
|
}),
|
|
2990
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx18(GroupActions, {
|
|
2991
2996
|
actions: section.field.actions,
|
|
2992
2997
|
groupId: section.groupId,
|
|
2993
2998
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -2996,14 +3001,14 @@ var GroupedTable = ({
|
|
|
2996
3001
|
})
|
|
2997
3002
|
})
|
|
2998
3003
|
}),
|
|
2999
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3004
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx18(RowIdContext.Provider, {
|
|
3000
3005
|
value: row.id,
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3006
|
+
children: /* @__PURE__ */ jsx18(TableDataRow, {
|
|
3002
3007
|
tableAtom
|
|
3003
3008
|
})
|
|
3004
3009
|
}, `${section.key}:${row.id}`)) : [
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
-
children: /* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx18(TableRow, {
|
|
3011
|
+
children: /* @__PURE__ */ jsx18(TableCell, {
|
|
3007
3012
|
className: "text-muted-foreground h-16",
|
|
3008
3013
|
colSpan: model.visibleColumns.length + extra,
|
|
3009
3014
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -3014,7 +3019,7 @@ var GroupedTable = ({
|
|
|
3014
3019
|
}, section.key);
|
|
3015
3020
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
3016
3021
|
});
|
|
3017
|
-
return /* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ jsx18(Fragment, {
|
|
3018
3023
|
children: renderSections(sections)
|
|
3019
3024
|
});
|
|
3020
3025
|
};
|
|
@@ -3037,29 +3042,29 @@ var ColumnHeaderMenu = ({
|
|
|
3037
3042
|
}));
|
|
3038
3043
|
const label = columnLabel(column);
|
|
3039
3044
|
if (!sortingEnabled && !hidingEnabled) {
|
|
3040
|
-
return /* @__PURE__ */
|
|
3045
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3041
3046
|
className: "truncate",
|
|
3042
3047
|
children: column.colDef.headerName
|
|
3043
3048
|
});
|
|
3044
3049
|
}
|
|
3045
3050
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3046
3051
|
children: [
|
|
3047
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, {
|
|
3048
3053
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3049
3054
|
"aria-label": label,
|
|
3050
3055
|
className: "h-8 max-w-full justify-start px-2",
|
|
3051
3056
|
size: "sm",
|
|
3052
3057
|
variant: "ghost",
|
|
3053
3058
|
children: [
|
|
3054
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ jsx18("span", {
|
|
3055
3060
|
className: "truncate",
|
|
3056
3061
|
children: column.colDef.headerName
|
|
3057
3062
|
}),
|
|
3058
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3063
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx18(ArrowDown, {}) : /* @__PURE__ */ jsx18(ArrowUp, {}) : sortingEnabled ? /* @__PURE__ */ jsx18(ChevronsUpDown2, {}) : null
|
|
3059
3064
|
]
|
|
3060
3065
|
})
|
|
3061
3066
|
}),
|
|
3062
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ jsx18(DropdownMenuContent, {
|
|
3063
3068
|
align: "start",
|
|
3064
3069
|
className: "w-48",
|
|
3065
3070
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
@@ -3069,7 +3074,7 @@ var ColumnHeaderMenu = ({
|
|
|
3069
3074
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3070
3075
|
onClick: () => setSort("asc"),
|
|
3071
3076
|
children: [
|
|
3072
|
-
/* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ jsx18(ArrowUp, {}),
|
|
3073
3078
|
" ",
|
|
3074
3079
|
store.config.labels.sortAsc
|
|
3075
3080
|
]
|
|
@@ -3077,7 +3082,7 @@ var ColumnHeaderMenu = ({
|
|
|
3077
3082
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3078
3083
|
onClick: () => setSort("desc"),
|
|
3079
3084
|
children: [
|
|
3080
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ jsx18(ArrowDown, {}),
|
|
3081
3086
|
" ",
|
|
3082
3087
|
store.config.labels.sortDesc
|
|
3083
3088
|
]
|
|
@@ -3088,14 +3093,14 @@ var ColumnHeaderMenu = ({
|
|
|
3088
3093
|
sort: state.sort?.filter(({ id }) => id !== column.id)
|
|
3089
3094
|
})),
|
|
3090
3095
|
children: [
|
|
3091
|
-
/* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ jsx18(X2, {}),
|
|
3092
3097
|
" ",
|
|
3093
3098
|
store.config.labels.sortClear
|
|
3094
3099
|
]
|
|
3095
3100
|
}) : null
|
|
3096
3101
|
]
|
|
3097
3102
|
}) : null,
|
|
3098
|
-
sortingEnabled && hidingEnabled ? /* @__PURE__ */
|
|
3103
|
+
sortingEnabled && hidingEnabled ? /* @__PURE__ */ jsx18(DropdownMenuSeparator, {}) : null,
|
|
3099
3104
|
hidingEnabled ? /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3100
3105
|
onClick: () => update((state) => ({
|
|
3101
3106
|
...state,
|
|
@@ -3105,7 +3110,7 @@ var ColumnHeaderMenu = ({
|
|
|
3105
3110
|
}
|
|
3106
3111
|
})),
|
|
3107
3112
|
children: [
|
|
3108
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ jsx18(EyeOff, {}),
|
|
3109
3114
|
" ",
|
|
3110
3115
|
store.config.labels.hideColumn
|
|
3111
3116
|
]
|
|
@@ -3127,12 +3132,12 @@ var DataTableHeader = ({
|
|
|
3127
3132
|
const selectableRows = getDataTableSelectableRows(model, grouped, selection ? selection.isRowSelectable : undefined);
|
|
3128
3133
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
3129
3134
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
3130
|
-
return /* @__PURE__ */
|
|
3135
|
+
return /* @__PURE__ */ jsx18(TableHeader, {
|
|
3131
3136
|
children: /* @__PURE__ */ jsxs9(TableRow, {
|
|
3132
3137
|
children: [
|
|
3133
|
-
selection ? /* @__PURE__ */
|
|
3138
|
+
selection ? /* @__PURE__ */ jsx18(TableHead, {
|
|
3134
3139
|
className: "w-10 pr-0",
|
|
3135
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ jsx18(Checkbox, {
|
|
3136
3141
|
"aria-label": store.config.labels.selectAllRows,
|
|
3137
3142
|
checked: allSelected,
|
|
3138
3143
|
indeterminate: someSelected && !allSelected,
|
|
@@ -3146,27 +3151,27 @@ var DataTableHeader = ({
|
|
|
3146
3151
|
}
|
|
3147
3152
|
})
|
|
3148
3153
|
}) : null,
|
|
3149
|
-
draggable ? /* @__PURE__ */
|
|
3154
|
+
draggable ? /* @__PURE__ */ jsx18(TableHead, {
|
|
3150
3155
|
className: "w-10"
|
|
3151
3156
|
}) : null,
|
|
3152
3157
|
model.visibleColumns.map((column) => {
|
|
3153
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ jsx18(TableHead, {
|
|
3154
3159
|
className: "relative h-12",
|
|
3155
3160
|
style: { width: column.width },
|
|
3156
3161
|
children: /* @__PURE__ */ jsxs9(ColumnIdContext.Provider, {
|
|
3157
3162
|
value: column.id,
|
|
3158
3163
|
children: [
|
|
3159
|
-
/* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ jsx18(ColumnHeaderMenu, {
|
|
3160
3165
|
tableAtom
|
|
3161
3166
|
}),
|
|
3162
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx18(ResizeHandle, {
|
|
3163
3168
|
tableAtom
|
|
3164
3169
|
})
|
|
3165
3170
|
]
|
|
3166
3171
|
})
|
|
3167
3172
|
}, column.id);
|
|
3168
3173
|
}),
|
|
3169
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3174
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx18(TableHead, {
|
|
3170
3175
|
className: "w-10"
|
|
3171
3176
|
}) : null
|
|
3172
3177
|
]
|
|
@@ -3182,28 +3187,28 @@ var DataTableBody = ({
|
|
|
3182
3187
|
const rows = grouped ? model.sortedRows : model.pageRows;
|
|
3183
3188
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
3184
3189
|
if (grouped && rows.length && !store.config.status.error) {
|
|
3185
|
-
return /* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ jsx18(GroupedTable, {
|
|
3186
3191
|
tableAtom
|
|
3187
3192
|
});
|
|
3188
3193
|
}
|
|
3189
|
-
return /* @__PURE__ */
|
|
3190
|
-
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
3191
|
-
children: /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ jsx18(TableBody, {
|
|
3195
|
+
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx18(TableRow, {
|
|
3196
|
+
children: /* @__PURE__ */ jsx18(TableCell, {
|
|
3192
3197
|
className: "h-24 text-center",
|
|
3193
3198
|
colSpan: Math.max(colSpan, 1),
|
|
3194
3199
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
3195
3200
|
})
|
|
3196
|
-
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
3197
|
-
children: /* @__PURE__ */
|
|
3201
|
+
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx18(TableRow, {
|
|
3202
|
+
children: /* @__PURE__ */ jsx18(TableCell, {
|
|
3198
3203
|
className: "h-24 text-center",
|
|
3199
3204
|
colSpan: Math.max(colSpan, 1),
|
|
3200
|
-
children: /* @__PURE__ */
|
|
3205
|
+
children: /* @__PURE__ */ jsx18(Loading, {
|
|
3201
3206
|
label: store.config.labels.loading
|
|
3202
3207
|
})
|
|
3203
3208
|
})
|
|
3204
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
3209
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx18(RowIdContext.Provider, {
|
|
3205
3210
|
value: row.id,
|
|
3206
|
-
children: /* @__PURE__ */
|
|
3211
|
+
children: /* @__PURE__ */ jsx18(TableDataRow, {
|
|
3207
3212
|
tableAtom
|
|
3208
3213
|
})
|
|
3209
3214
|
}, row.id))
|
|
@@ -3226,7 +3231,7 @@ var GalleryCard = ({
|
|
|
3226
3231
|
const selection = store.config.features.selection;
|
|
3227
3232
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
3228
3233
|
const draggable = canDragRows(store);
|
|
3229
|
-
return /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsx18(Card, {
|
|
3230
3235
|
className: cn("relative gap-3 data-[drag-source=true]:opacity-40 data-[drop-position=before]:border-t-2 data-[drop-position=before]:border-t-primary data-[drop-position=after]:border-b-2 data-[drop-position=after]:border-b-primary", store.config.onRowClicked && "cursor-pointer"),
|
|
3231
3236
|
"data-table-row": row.id,
|
|
3232
3237
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -3243,14 +3248,14 @@ var GalleryCard = ({
|
|
|
3243
3248
|
/* @__PURE__ */ jsxs9("div", {
|
|
3244
3249
|
className: "flex items-center gap-2",
|
|
3245
3250
|
children: [
|
|
3246
|
-
selection ? /* @__PURE__ */
|
|
3251
|
+
selection ? /* @__PURE__ */ jsx18(Checkbox, {
|
|
3247
3252
|
"aria-label": store.config.labels.selectRow,
|
|
3248
3253
|
checked: !!store.state.rowSelection[row.id],
|
|
3249
3254
|
disabled: !selectable,
|
|
3250
3255
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked),
|
|
3251
3256
|
onClick: (event) => event.stopPropagation()
|
|
3252
3257
|
}) : null,
|
|
3253
|
-
draggable ? /* @__PURE__ */
|
|
3258
|
+
draggable ? /* @__PURE__ */ jsx18(DragHandle, {
|
|
3254
3259
|
tableAtom
|
|
3255
3260
|
}) : null,
|
|
3256
3261
|
tag ? /* @__PURE__ */ jsxs9(Badge, {
|
|
@@ -3262,17 +3267,17 @@ var GalleryCard = ({
|
|
|
3262
3267
|
}) : null
|
|
3263
3268
|
]
|
|
3264
3269
|
}),
|
|
3265
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsx18(CardTitle, {
|
|
3266
3271
|
children: name ? renderCell(row, name) : row.id
|
|
3267
3272
|
}),
|
|
3268
|
-
description ? /* @__PURE__ */
|
|
3273
|
+
description ? /* @__PURE__ */ jsx18("div", {
|
|
3269
3274
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
3270
3275
|
children: renderCell(row, description)
|
|
3271
3276
|
}) : null,
|
|
3272
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3277
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx18("div", {
|
|
3273
3278
|
className: "absolute top-4 right-4",
|
|
3274
3279
|
onClick: (event) => event.stopPropagation(),
|
|
3275
|
-
children: /* @__PURE__ */
|
|
3280
|
+
children: /* @__PURE__ */ jsx18(DataTableRowActionMenu, {
|
|
3276
3281
|
tableAtom
|
|
3277
3282
|
})
|
|
3278
3283
|
}) : null
|
|
@@ -3288,31 +3293,31 @@ var DataTableGallery = ({
|
|
|
3288
3293
|
const fields = getActiveGrouping(store);
|
|
3289
3294
|
const rows = fields.length ? model.sortedRows : model.pageRows;
|
|
3290
3295
|
if (store.config.status.error) {
|
|
3291
|
-
return /* @__PURE__ */
|
|
3296
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3292
3297
|
className: "text-destructive rounded-lg border border-dashed p-10 text-center",
|
|
3293
3298
|
children: store.config.status.error
|
|
3294
3299
|
});
|
|
3295
3300
|
}
|
|
3296
3301
|
if (store.config.status.loading && !rows.length) {
|
|
3297
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3298
3303
|
className: "rounded-lg border border-dashed p-10 text-center",
|
|
3299
|
-
children: /* @__PURE__ */
|
|
3304
|
+
children: /* @__PURE__ */ jsx18(Loading, {
|
|
3300
3305
|
label: store.config.labels.loading
|
|
3301
3306
|
})
|
|
3302
3307
|
});
|
|
3303
3308
|
}
|
|
3304
3309
|
if (!rows.length) {
|
|
3305
|
-
return /* @__PURE__ */
|
|
3310
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3306
3311
|
className: "text-muted-foreground rounded-lg border border-dashed p-10 text-center",
|
|
3307
3312
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
3308
3313
|
});
|
|
3309
3314
|
}
|
|
3310
3315
|
if (!fields.length) {
|
|
3311
|
-
return /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3312
3317
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3313
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
3318
|
+
children: rows.map((row) => /* @__PURE__ */ jsx18(RowIdContext.Provider, {
|
|
3314
3319
|
value: row.id,
|
|
3315
|
-
children: /* @__PURE__ */
|
|
3320
|
+
children: /* @__PURE__ */ jsx18(GalleryCard, {
|
|
3316
3321
|
tableAtom
|
|
3317
3322
|
})
|
|
3318
3323
|
}, row.id))
|
|
@@ -3341,44 +3346,44 @@ var DataTableGallery = ({
|
|
|
3341
3346
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3342
3347
|
type: "button",
|
|
3343
3348
|
children: [
|
|
3344
|
-
collapsed ? /* @__PURE__ */
|
|
3349
|
+
collapsed ? /* @__PURE__ */ jsx18(ChevronRight2, {
|
|
3345
3350
|
className: "size-4"
|
|
3346
|
-
}) : /* @__PURE__ */
|
|
3351
|
+
}) : /* @__PURE__ */ jsx18(ChevronDown, {
|
|
3347
3352
|
className: "size-4"
|
|
3348
3353
|
}),
|
|
3349
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ jsx18("span", {
|
|
3350
3355
|
className: "flex-1",
|
|
3351
3356
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3352
3357
|
}),
|
|
3353
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx18(Badge, {
|
|
3354
3359
|
variant: "secondary",
|
|
3355
3360
|
children: section.rows.length
|
|
3356
3361
|
})
|
|
3357
3362
|
]
|
|
3358
3363
|
}),
|
|
3359
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx18(GroupActions, {
|
|
3360
3365
|
actions: section.field.actions,
|
|
3361
3366
|
groupId: section.groupId,
|
|
3362
3367
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
3363
3368
|
})
|
|
3364
3369
|
]
|
|
3365
3370
|
}),
|
|
3366
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
3371
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx18("div", {
|
|
3367
3372
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3368
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
3373
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx18(RowIdContext.Provider, {
|
|
3369
3374
|
value: row.id,
|
|
3370
|
-
children: /* @__PURE__ */
|
|
3375
|
+
children: /* @__PURE__ */ jsx18(GalleryCard, {
|
|
3371
3376
|
tableAtom
|
|
3372
3377
|
})
|
|
3373
3378
|
}, `${section.key}:${row.id}`))
|
|
3374
|
-
}) : /* @__PURE__ */
|
|
3379
|
+
}) : /* @__PURE__ */ jsx18("div", {
|
|
3375
3380
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
3376
3381
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
3377
3382
|
}) : null
|
|
3378
3383
|
]
|
|
3379
3384
|
}, section.key);
|
|
3380
3385
|
});
|
|
3381
|
-
return /* @__PURE__ */
|
|
3386
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3382
3387
|
className: "space-y-4",
|
|
3383
3388
|
children: renderSections(groupDataTableRows(rows, fields))
|
|
3384
3389
|
});
|
|
@@ -3405,9 +3410,9 @@ var DataTablePagination = ({
|
|
|
3405
3410
|
return null;
|
|
3406
3411
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
3407
3412
|
const setPagination = (next) => changeState(setStore, (state) => ({ ...state, ...next }));
|
|
3408
|
-
return /* @__PURE__ */
|
|
3413
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3409
3414
|
className: "pt-4",
|
|
3410
|
-
children: /* @__PURE__ */
|
|
3415
|
+
children: /* @__PURE__ */ jsx18(Pagination, {
|
|
3411
3416
|
messages: store.config.labels,
|
|
3412
3417
|
onPageChange: (page) => setPagination({ page, pageSize: store.state.pageSize }),
|
|
3413
3418
|
onPageSizeChange: (pageSize) => setPagination({ page: 0, pageSize }),
|
|
@@ -3499,13 +3504,13 @@ var HydratedDataTable = ({
|
|
|
3499
3504
|
className: "w-full max-w-full min-w-0 rounded-md",
|
|
3500
3505
|
"data-table-root": "",
|
|
3501
3506
|
children: [
|
|
3502
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsx18(DataTableToolbar, {
|
|
3503
3508
|
tableAtom
|
|
3504
3509
|
}),
|
|
3505
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsx18(DataTableContent, {
|
|
3506
3511
|
tableAtom
|
|
3507
3512
|
}),
|
|
3508
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ jsx18(DataTablePagination, {
|
|
3509
3514
|
tableAtom
|
|
3510
3515
|
})
|
|
3511
3516
|
]
|
|
@@ -3527,13 +3532,13 @@ var DataTable = (props) => {
|
|
|
3527
3532
|
}
|
|
3528
3533
|
const [persistedUiResult, setPersistedUiState] = useAtom(persistedUiAtomRef.current);
|
|
3529
3534
|
if (!AsyncResult.isSuccess(persistedUiResult) || AsyncResult.isWaiting(persistedUiResult)) {
|
|
3530
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
3531
3536
|
"aria-busy": "true",
|
|
3532
3537
|
className: "invisible w-full max-w-full min-w-0 rounded-md",
|
|
3533
3538
|
"data-table-root": ""
|
|
3534
3539
|
});
|
|
3535
3540
|
}
|
|
3536
|
-
return /* @__PURE__ */
|
|
3541
|
+
return /* @__PURE__ */ jsx18(HydratedDataTable, {
|
|
3537
3542
|
...props,
|
|
3538
3543
|
persistedUiState: persistedUiResult.value,
|
|
3539
3544
|
setPersistedUiState
|
|
@@ -3544,7 +3549,7 @@ var DataTableContent = ({
|
|
|
3544
3549
|
}) => {
|
|
3545
3550
|
const [store] = useTableAtom(tableAtom);
|
|
3546
3551
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
3547
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx18(DataTableGallery, {
|
|
3548
3553
|
tableAtom
|
|
3549
3554
|
});
|
|
3550
3555
|
}
|
|
@@ -3557,15 +3562,15 @@ var DataTableContent = ({
|
|
|
3557
3562
|
className: "table-fixed",
|
|
3558
3563
|
style: { width: `max(100%, ${width}px)` },
|
|
3559
3564
|
children: [
|
|
3560
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ jsx18(DataTableHeader, {
|
|
3561
3566
|
tableAtom
|
|
3562
3567
|
}),
|
|
3563
|
-
/* @__PURE__ */
|
|
3568
|
+
/* @__PURE__ */ jsx18(DataTableBody, {
|
|
3564
3569
|
tableAtom
|
|
3565
3570
|
})
|
|
3566
3571
|
]
|
|
3567
3572
|
}),
|
|
3568
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ jsx18(ScrollBar, {
|
|
3569
3574
|
orientation: "horizontal"
|
|
3570
3575
|
})
|
|
3571
3576
|
]
|
|
@@ -3582,7 +3587,7 @@ var DataTableRelationshipCell = ({
|
|
|
3582
3587
|
const [selected, setSelected] = useState([...value]);
|
|
3583
3588
|
useLayoutEffect(() => setSelected([...value]), [value]);
|
|
3584
3589
|
const selectedValues = new Set(selected.map((item) => item.value));
|
|
3585
|
-
return /* @__PURE__ */
|
|
3590
|
+
return /* @__PURE__ */ jsx18(VirtualizedCombobox, {
|
|
3586
3591
|
ariaLabel: manageLabel,
|
|
3587
3592
|
emptyLabel,
|
|
3588
3593
|
items: [...options].sort((left, right) => Number(selectedValues.has(right.value)) - Number(selectedValues.has(left.value))),
|
|
@@ -3599,13 +3604,13 @@ var DataTableRelationshipCell = ({
|
|
|
3599
3604
|
className: "h-full min-h-16 w-full justify-between rounded-none",
|
|
3600
3605
|
variant: "ghost",
|
|
3601
3606
|
children: [
|
|
3602
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ jsx18(DataTableListSummary, {
|
|
3603
3608
|
emptyLabel,
|
|
3604
3609
|
expandable: false,
|
|
3605
3610
|
items: selected,
|
|
3606
3611
|
variant: selected.some((item) => item.icon) ? "icon" : "text"
|
|
3607
3612
|
}),
|
|
3608
|
-
/* @__PURE__ */
|
|
3613
|
+
/* @__PURE__ */ jsx18(ChevronDown, {})
|
|
3609
3614
|
]
|
|
3610
3615
|
}),
|
|
3611
3616
|
value: selected
|
|
@@ -3623,13 +3628,13 @@ var DataTableListSummary = ({
|
|
|
3623
3628
|
const labels2 = dataTableMessages();
|
|
3624
3629
|
const normalized = items.map((item) => Schema.is(Schema.String)(item) ? { label: item } : item);
|
|
3625
3630
|
if (!normalized.length)
|
|
3626
|
-
return /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ jsx18("span", {
|
|
3627
3632
|
className: "text-muted-foreground",
|
|
3628
3633
|
children: emptyLabel
|
|
3629
3634
|
});
|
|
3630
3635
|
const visible = normalized.slice(0, visibleCount);
|
|
3631
3636
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
3632
|
-
const details = /* @__PURE__ */
|
|
3637
|
+
const details = /* @__PURE__ */ jsx18(PopoverContent, {
|
|
3633
3638
|
align: "start",
|
|
3634
3639
|
className: "max-h-72 w-72 overflow-y-auto p-2",
|
|
3635
3640
|
children: normalized.map((item, index) => /* @__PURE__ */ jsxs9("div", {
|
|
@@ -3641,27 +3646,27 @@ var DataTableListSummary = ({
|
|
|
3641
3646
|
}, item.value ?? `${item.label}-${index}`))
|
|
3642
3647
|
});
|
|
3643
3648
|
if (variant === "icon") {
|
|
3644
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsx18(TooltipProvider, {
|
|
3645
3650
|
children: /* @__PURE__ */ jsxs9("span", {
|
|
3646
3651
|
className: "flex items-center",
|
|
3647
3652
|
children: [
|
|
3648
3653
|
visible.map((item) => /* @__PURE__ */ jsxs9(Tooltip, {
|
|
3649
3654
|
children: [
|
|
3650
|
-
/* @__PURE__ */
|
|
3651
|
-
render: /* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, {
|
|
3656
|
+
render: /* @__PURE__ */ jsx18("span", {
|
|
3652
3657
|
"aria-label": item.label,
|
|
3653
3658
|
className: "bg-muted -ml-1 flex size-8 items-center justify-center rounded-full",
|
|
3654
3659
|
children: item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
3655
3660
|
})
|
|
3656
3661
|
}),
|
|
3657
|
-
/* @__PURE__ */
|
|
3662
|
+
/* @__PURE__ */ jsx18(TooltipContent, {
|
|
3658
3663
|
children: item.label
|
|
3659
3664
|
})
|
|
3660
3665
|
]
|
|
3661
3666
|
}, item.value ?? item.label)),
|
|
3662
3667
|
remaining && expandable ? /* @__PURE__ */ jsxs9(Popover, {
|
|
3663
3668
|
children: [
|
|
3664
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ jsx18(PopoverTrigger, {
|
|
3665
3670
|
render: /* @__PURE__ */ jsxs9("button", {
|
|
3666
3671
|
"aria-label": labels2.listOthers(remaining),
|
|
3667
3672
|
className: "bg-muted -ml-1 flex size-8 items-center justify-center rounded-full",
|
|
@@ -3693,8 +3698,8 @@ var DataTableListSummary = ({
|
|
|
3693
3698
|
});
|
|
3694
3699
|
return remaining && expandable ? /* @__PURE__ */ jsxs9(Popover, {
|
|
3695
3700
|
children: [
|
|
3696
|
-
/* @__PURE__ */
|
|
3697
|
-
render: /* @__PURE__ */
|
|
3701
|
+
/* @__PURE__ */ jsx18(PopoverTrigger, {
|
|
3702
|
+
render: /* @__PURE__ */ jsx18("button", {
|
|
3698
3703
|
className: "text-left text-sm",
|
|
3699
3704
|
type: "button",
|
|
3700
3705
|
children: summary
|
|
@@ -3702,26 +3707,26 @@ var DataTableListSummary = ({
|
|
|
3702
3707
|
}),
|
|
3703
3708
|
details
|
|
3704
3709
|
]
|
|
3705
|
-
}) : /* @__PURE__ */
|
|
3710
|
+
}) : /* @__PURE__ */ jsx18("span", {
|
|
3706
3711
|
className: "text-sm",
|
|
3707
3712
|
children: summary
|
|
3708
3713
|
});
|
|
3709
3714
|
};
|
|
3710
3715
|
export {
|
|
3711
|
-
|
|
3712
|
-
DataTableListSummary,
|
|
3713
|
-
DataTableRelationshipCell,
|
|
3714
|
-
DataTableRowActions,
|
|
3715
|
-
buildDataTableRows,
|
|
3716
|
-
dataTableMessages,
|
|
3717
|
-
downloadCsv,
|
|
3718
|
-
downloadJson,
|
|
3719
|
-
filterDataTableRows,
|
|
3720
|
-
getDataTableSelectableRows,
|
|
3721
|
-
getDataTableWidth,
|
|
3722
|
-
groupDataTableRows,
|
|
3723
|
-
normalizeDataTableColumns,
|
|
3724
|
-
paginateDataTableRows,
|
|
3716
|
+
sortDataTableRows,
|
|
3725
3717
|
reorderDataTableRows,
|
|
3726
|
-
|
|
3718
|
+
paginateDataTableRows,
|
|
3719
|
+
normalizeDataTableColumns,
|
|
3720
|
+
groupDataTableRows,
|
|
3721
|
+
getDataTableWidth,
|
|
3722
|
+
getDataTableSelectableRows,
|
|
3723
|
+
filterDataTableRows,
|
|
3724
|
+
downloadJson,
|
|
3725
|
+
downloadCsv,
|
|
3726
|
+
dataTableMessages,
|
|
3727
|
+
buildDataTableRows,
|
|
3728
|
+
DataTableRowActions,
|
|
3729
|
+
DataTableRelationshipCell,
|
|
3730
|
+
DataTableListSummary,
|
|
3731
|
+
DataTable
|
|
3727
3732
|
};
|