@crispy-seed/data-table 0.11.1 → 0.12.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/dist/data-table-recipe.css +17 -2
- package/dist/data-table-recipe.layered.css +19 -2
- package/dist/index.cjs +305 -51
- package/dist/index.d.ts +27 -0
- package/dist/index.js +305 -51
- package/dist/styles.css +19 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1179,6 +1179,51 @@ function isStringArray(value) {
|
|
|
1179
1179
|
/** Removes the view with this `id`. */ function removeDataTableView(views, id) {
|
|
1180
1180
|
return views.filter((view)=>view.id !== id);
|
|
1181
1181
|
}
|
|
1182
|
+
// -- row virtualization ---------------------------------------------------------------
|
|
1183
|
+
// `virtualized` renders only the rows inside (and a little around) the scroll
|
|
1184
|
+
// container's viewport, with two spacer rows standing in for the rest so the scroll
|
|
1185
|
+
// height -- and therefore the scrollbar -- still matches the full data set. Rows are a
|
|
1186
|
+
// fixed height, so which rows are visible is plain arithmetic on `scrollTop`; no
|
|
1187
|
+
// per-row measurement, no ResizeObserver per row.
|
|
1188
|
+
/** The recipe's own row height (`--seed-dimension-x9` = 36px, `row.height`). */ const DEFAULT_VIRTUAL_ROW_HEIGHT = 36;
|
|
1189
|
+
/** Rows rendered beyond each edge of the viewport, so a fast scroll never outruns the
|
|
1190
|
+
* render and flashes an empty gap. */ const DEFAULT_VIRTUAL_OVERSCAN = 8;
|
|
1191
|
+
/** Distance from the bottom (px) at which `onLoadMore` fires in virtualized mode --
|
|
1192
|
+
* the same 160px look-ahead the IntersectionObserver's rootMargin gives a non-
|
|
1193
|
+
* virtualized table. */ const LOAD_MORE_THRESHOLD = 160;
|
|
1194
|
+
/**
|
|
1195
|
+
* Which slice `[start, end)` of `count` uniform-height rows to render for a viewport,
|
|
1196
|
+
* plus the heights of the two spacers that keep the total scroll height at
|
|
1197
|
+
* `count * rowHeight` (`topSpacer + rendered rows + bottomSpacer`). Pure -- the hook
|
|
1198
|
+
* measures the DOM, this decides.
|
|
1199
|
+
*/ function computeVirtualWindow(input) {
|
|
1200
|
+
const { count, rowHeight, viewportHeight, overscan } = input;
|
|
1201
|
+
if (count <= 0 || rowHeight <= 0) return {
|
|
1202
|
+
start: 0,
|
|
1203
|
+
end: 0,
|
|
1204
|
+
topSpacer: 0,
|
|
1205
|
+
bottomSpacer: 0
|
|
1206
|
+
};
|
|
1207
|
+
const scrollTop = Math.max(0, input.scrollTop);
|
|
1208
|
+
const firstVisible = Math.floor(scrollTop / rowHeight);
|
|
1209
|
+
const lastVisibleExclusive = Math.ceil((scrollTop + Math.max(0, viewportHeight)) / rowHeight);
|
|
1210
|
+
const start = Math.min(count, Math.max(0, firstVisible - overscan));
|
|
1211
|
+
const end = Math.min(count, Math.max(start, lastVisibleExclusive + overscan));
|
|
1212
|
+
return {
|
|
1213
|
+
start,
|
|
1214
|
+
end,
|
|
1215
|
+
topSpacer: start * rowHeight,
|
|
1216
|
+
bottomSpacer: (count - end) * rowHeight
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Scroll-position replacement for the sentinel row's IntersectionObserver: a
|
|
1221
|
+
* virtualized table can't rely on a sentinel (it would be windowed out along with the
|
|
1222
|
+
* rows), so "close enough to the bottom" is read straight off the scroll container.
|
|
1223
|
+
* The 1px slop matches `useDataTableScroll`'s own sub-pixel tolerance.
|
|
1224
|
+
*/ function isNearBottom(scrollTop, clientHeight, scrollHeight, threshold = LOAD_MORE_THRESHOLD) {
|
|
1225
|
+
return scrollTop + clientHeight >= scrollHeight - threshold - 1;
|
|
1226
|
+
}
|
|
1182
1227
|
const EMPTY_STRINGS = [];
|
|
1183
1228
|
const EMPTY_RECORD = {};
|
|
1184
1229
|
/**
|
|
@@ -1510,7 +1555,7 @@ const ROOT_MARGIN = "160px";
|
|
|
1510
1555
|
* wires this to useDataTableScroll's own scroll container) so a BOUNDED table
|
|
1511
1556
|
* triggers off its own internal scroll, not the browsing viewport.
|
|
1512
1557
|
*/ function useDataTableInfiniteScroll(props) {
|
|
1513
|
-
const { onLoadMore, hasMore = true, loadingMore: loadingMoreProp, scrollRootRef } = props;
|
|
1558
|
+
const { onLoadMore, hasMore = true, loadingMore: loadingMoreProp, scrollRootRef, virtualized = false } = props;
|
|
1514
1559
|
const [internalLoadingMore, setInternalLoadingMore] = React.useState(false);
|
|
1515
1560
|
const loadingMore = loadingMoreProp ?? internalLoadingMore;
|
|
1516
1561
|
// Mirrors the latest props into a ref the observer callback reads -- the callback
|
|
@@ -1550,6 +1595,7 @@ const ROOT_MARGIN = "160px";
|
|
|
1550
1595
|
const [sentinelNode, setSentinelNode] = React.useState(null);
|
|
1551
1596
|
const sentinelRef = React.useCallback((node)=>setSentinelNode(node), []);
|
|
1552
1597
|
React.useEffect(()=>{
|
|
1598
|
+
if (virtualized) return;
|
|
1553
1599
|
if (!sentinelNode || !onLoadMore || typeof IntersectionObserver === "undefined") return;
|
|
1554
1600
|
// Effects run after every ref callback of the SAME commit (including
|
|
1555
1601
|
// `scrollRootRef`'s own, set by useDataTableScroll's `scrollAreaRef`) regardless
|
|
@@ -1570,6 +1616,23 @@ const ROOT_MARGIN = "160px";
|
|
|
1570
1616
|
sentinelNode,
|
|
1571
1617
|
onLoadMore,
|
|
1572
1618
|
scrollRootRef,
|
|
1619
|
+
triggerLoadMore,
|
|
1620
|
+
virtualized
|
|
1621
|
+
]);
|
|
1622
|
+
// Virtualized mode's trigger: near the bottom of the scroll container (same gate --
|
|
1623
|
+
// `hasMore`, not already loading -- via `triggerLoadMore`). Called on every scroll
|
|
1624
|
+
// and again after the row count / loading state changes (a page that lands while
|
|
1625
|
+
// the user is still at the bottom, or too short to overflow, must chain the next
|
|
1626
|
+
// load rather than wait for a scroll that can never come).
|
|
1627
|
+
const checkScrollPosition = React.useCallback(()=>{
|
|
1628
|
+
const element = scrollRootRef?.current;
|
|
1629
|
+
if (!virtualized || !element) return;
|
|
1630
|
+
if (isNearBottom(element.scrollTop, element.clientHeight, element.scrollHeight)) {
|
|
1631
|
+
triggerLoadMore();
|
|
1632
|
+
}
|
|
1633
|
+
}, [
|
|
1634
|
+
virtualized,
|
|
1635
|
+
scrollRootRef,
|
|
1573
1636
|
triggerLoadMore
|
|
1574
1637
|
]);
|
|
1575
1638
|
return {
|
|
@@ -1583,7 +1646,9 @@ const ROOT_MARGIN = "160px";
|
|
|
1583
1646
|
/** Fires `onLoadMore` directly, subject to the same `hasMore`/`loadingMore` gate
|
|
1584
1647
|
* the observer itself uses -- exposed for a consumer that wants a manual retry
|
|
1585
1648
|
* affordance (e.g. after a failed load) rather than only the observer's own
|
|
1586
|
-
* scroll trigger. */ triggerLoadMore
|
|
1649
|
+
* scroll trigger. */ triggerLoadMore,
|
|
1650
|
+
/** Virtualized mode's scroll-position check (no-op otherwise); `useDataTable`
|
|
1651
|
+
* calls it from the scroll container's `onScroll`. */ checkScrollPosition
|
|
1587
1652
|
};
|
|
1588
1653
|
}
|
|
1589
1654
|
|
|
@@ -1595,19 +1660,53 @@ const ROOT_MARGIN = "160px";
|
|
|
1595
1660
|
* real ref to a real scrollable element, re-measured on every scroll (and whenever the
|
|
1596
1661
|
* styled layer calls `remeasure`, e.g. after a column resize/reorder changes the
|
|
1597
1662
|
* scrollable width without the element itself ever firing a `scroll` event).
|
|
1598
|
-
*/ function useDataTableScroll() {
|
|
1663
|
+
*/ function useDataTableScroll(props = {}) {
|
|
1664
|
+
const { virtualized = false, rowHeight = DEFAULT_VIRTUAL_ROW_HEIGHT } = props;
|
|
1665
|
+
const overscan = props.overscan ?? DEFAULT_VIRTUAL_OVERSCAN;
|
|
1599
1666
|
const elementRef = React.useRef(null);
|
|
1600
1667
|
const [scrolledStart, setScrolledStart] = React.useState(false);
|
|
1601
1668
|
const [scrolledEnd, setScrolledEnd] = React.useState(false);
|
|
1669
|
+
const [viewport, setViewport] = React.useState({
|
|
1670
|
+
scrollTop: 0,
|
|
1671
|
+
viewportHeight: 0
|
|
1672
|
+
});
|
|
1602
1673
|
const remeasure = React.useCallback(()=>{
|
|
1603
1674
|
const element = elementRef.current;
|
|
1604
1675
|
if (!element) return;
|
|
1676
|
+
if (virtualized) {
|
|
1677
|
+
// Row 0 starts below the sticky header, so measure from there. Snapping to whole
|
|
1678
|
+
// rows keeps re-renders to one per row scrolled (not one per scroll event); the
|
|
1679
|
+
// extra `rowHeight` of viewport makes up for the rows the snap rounded away.
|
|
1680
|
+
const headerHeight = element.querySelector("thead")?.offsetHeight ?? 0;
|
|
1681
|
+
const scrollTop = Math.max(0, element.scrollTop - headerHeight);
|
|
1682
|
+
const snapped = Math.floor(scrollTop / rowHeight) * rowHeight;
|
|
1683
|
+
const viewportHeight = element.clientHeight + rowHeight;
|
|
1684
|
+
setViewport((prev)=>prev.scrollTop === snapped && prev.viewportHeight === viewportHeight ? prev : {
|
|
1685
|
+
scrollTop: snapped,
|
|
1686
|
+
viewportHeight
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1605
1689
|
setScrolledStart(element.scrollLeft > 0);
|
|
1606
1690
|
// A 1px slop: sub-pixel layout can leave `scrollLeft + clientWidth` a fraction
|
|
1607
1691
|
// short of `scrollWidth` even when fully scrolled, which would otherwise leave
|
|
1608
1692
|
// the trailing shadow stuck on forever.
|
|
1609
1693
|
setScrolledEnd(element.scrollLeft + element.clientWidth < element.scrollWidth - 1);
|
|
1610
|
-
}, [
|
|
1694
|
+
}, [
|
|
1695
|
+
virtualized,
|
|
1696
|
+
rowHeight
|
|
1697
|
+
]);
|
|
1698
|
+
// The container can resize without scrolling (window resize, a bounded parent
|
|
1699
|
+
// changing height) -- the viewport height feeds the window, so re-measure then too.
|
|
1700
|
+
React.useEffect(()=>{
|
|
1701
|
+
const element = elementRef.current;
|
|
1702
|
+
if (!virtualized || !element || typeof ResizeObserver === "undefined") return;
|
|
1703
|
+
const observer = new ResizeObserver(()=>remeasure());
|
|
1704
|
+
observer.observe(element);
|
|
1705
|
+
return ()=>observer.disconnect();
|
|
1706
|
+
}, [
|
|
1707
|
+
virtualized,
|
|
1708
|
+
remeasure
|
|
1709
|
+
]);
|
|
1611
1710
|
const scrollAreaRef = React.useCallback((node)=>{
|
|
1612
1711
|
elementRef.current = node;
|
|
1613
1712
|
if (node) remeasure();
|
|
@@ -1623,6 +1722,12 @@ const ROOT_MARGIN = "160px";
|
|
|
1623
1722
|
scrolledEnd,
|
|
1624
1723
|
onScroll,
|
|
1625
1724
|
remeasure,
|
|
1725
|
+
/** Row-virtualization state; `enabled: false` (the default) means render every row. */ virtual: {
|
|
1726
|
+
enabled: virtualized,
|
|
1727
|
+
rowHeight,
|
|
1728
|
+
overscan,
|
|
1729
|
+
...viewport
|
|
1730
|
+
},
|
|
1626
1731
|
// The raw ref object itself (not just the callback ref above) -- useDataTable.ts
|
|
1627
1732
|
// hands this to useDataTableInfiniteScroll as the IntersectionObserver `root` for
|
|
1628
1733
|
// its sentinel row, so a scrolled/bounded table (DATATABLE-ATTIO-SPEC.md's
|
|
@@ -2021,7 +2126,7 @@ function useDataTable(props) {
|
|
|
2021
2126
|
const toolbarFilter = useDataTableToolbarFilter(props);
|
|
2022
2127
|
const columns = useDataTableColumns(props);
|
|
2023
2128
|
const columnCalc = useDataTableColumnCalc(props);
|
|
2024
|
-
const scroll = useDataTableScroll();
|
|
2129
|
+
const scroll = useDataTableScroll(props);
|
|
2025
2130
|
const edit = useDataTableEdit(props);
|
|
2026
2131
|
// Feature C (#12) -- which single cell (if any) is showing its read-only "show
|
|
2027
2132
|
// full content" overlay. Independent of `edit` above -- see
|
|
@@ -2035,6 +2140,28 @@ function useDataTable(props) {
|
|
|
2035
2140
|
...props,
|
|
2036
2141
|
scrollRootRef: scroll.elementRef
|
|
2037
2142
|
});
|
|
2143
|
+
// Virtualized mode swaps the sentinel's IntersectionObserver for a scroll-position
|
|
2144
|
+
// check: on every scroll (below), and again whenever the row count or loading state
|
|
2145
|
+
// changes -- new rows can leave the user still at the bottom.
|
|
2146
|
+
const { checkScrollPosition } = infiniteScroll;
|
|
2147
|
+
const rowCount = props.rowIds?.length;
|
|
2148
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: rowCount/loadingMore/hasMore are the triggers, not values read in the effect
|
|
2149
|
+
React.useEffect(()=>{
|
|
2150
|
+
checkScrollPosition();
|
|
2151
|
+
}, [
|
|
2152
|
+
checkScrollPosition,
|
|
2153
|
+
rowCount,
|
|
2154
|
+
infiniteScroll.loadingMore,
|
|
2155
|
+
infiniteScroll.hasMore
|
|
2156
|
+
]);
|
|
2157
|
+
const { onScroll: measureScroll } = scroll;
|
|
2158
|
+
const onScroll = React.useCallback(()=>{
|
|
2159
|
+
measureScroll();
|
|
2160
|
+
checkScrollPosition();
|
|
2161
|
+
}, [
|
|
2162
|
+
measureScroll,
|
|
2163
|
+
checkScrollPosition
|
|
2164
|
+
]);
|
|
2038
2165
|
// Unifies `sort` (the header's own single click-to-sort column, above) with
|
|
2039
2166
|
// `toolbarSort.toolbarSorts` (the toolbar Sort popover's ordered list, above) into
|
|
2040
2167
|
// ONE state instead of two -- before this, a header click only ever moved `sort`,
|
|
@@ -2146,6 +2273,7 @@ function useDataTable(props) {
|
|
|
2146
2273
|
...edit,
|
|
2147
2274
|
...peek,
|
|
2148
2275
|
...infiniteScroll,
|
|
2276
|
+
onScroll,
|
|
2149
2277
|
rootProps: domUtils.elementProps({
|
|
2150
2278
|
role: "table"
|
|
2151
2279
|
})
|
|
@@ -2188,7 +2316,7 @@ function useDataTableRowContext({ strict = true } = {}) {
|
|
|
2188
2316
|
return context;
|
|
2189
2317
|
}
|
|
2190
2318
|
const DataTableRoot = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
2191
|
-
const { sort, defaultSort, onSortChange, rowIds, selectable, selectedIds, defaultSelectedIds, onSelectionChange, query, defaultQuery, onQueryChange, toolbarSorts, defaultToolbarSorts, onToolbarSortsChange, toolbarFilters, defaultToolbarFilters, onToolbarFiltersChange, columnKeys, actionsColumnKey, columnOrder, defaultColumnOrder, onColumnOrderChange, hiddenColumnKeys, defaultHiddenColumnKeys, onHiddenColumnKeysChange, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnLabels, defaultColumnLabels, onColumnLabelsChange, pinnedColumnKeys, defaultPinnedColumnKeys, onPinnedColumnKeysChange, columnCalcOps, defaultColumnCalcOps, onColumnCalcOpsChange, onEdit, onLoadMore, hasMore, loadingMore, ...otherProps } = props;
|
|
2319
|
+
const { sort, defaultSort, onSortChange, rowIds, selectable, selectedIds, defaultSelectedIds, onSelectionChange, query, defaultQuery, onQueryChange, toolbarSorts, defaultToolbarSorts, onToolbarSortsChange, toolbarFilters, defaultToolbarFilters, onToolbarFiltersChange, columnKeys, actionsColumnKey, columnOrder, defaultColumnOrder, onColumnOrderChange, hiddenColumnKeys, defaultHiddenColumnKeys, onHiddenColumnKeysChange, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnLabels, defaultColumnLabels, onColumnLabelsChange, pinnedColumnKeys, defaultPinnedColumnKeys, onPinnedColumnKeysChange, columnCalcOps, defaultColumnCalcOps, onColumnCalcOpsChange, onEdit, onLoadMore, hasMore, loadingMore, virtualized, rowHeight, overscan, ...otherProps } = props;
|
|
2192
2320
|
const api = useDataTable({
|
|
2193
2321
|
sort,
|
|
2194
2322
|
defaultSort,
|
|
@@ -2230,7 +2358,10 @@ const DataTableRoot = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
|
2230
2358
|
onEdit,
|
|
2231
2359
|
onLoadMore,
|
|
2232
2360
|
hasMore,
|
|
2233
|
-
loadingMore
|
|
2361
|
+
loadingMore,
|
|
2362
|
+
virtualized,
|
|
2363
|
+
rowHeight,
|
|
2364
|
+
overscan
|
|
2234
2365
|
});
|
|
2235
2366
|
return /*#__PURE__*/ jsxRuntime.jsx(DataTableProvider, {
|
|
2236
2367
|
value: api,
|
|
@@ -3011,6 +3142,40 @@ function EntityCell({ value, className, nameClassName, actionsClassName, actionC
|
|
|
3011
3142
|
name: String(value ?? "")
|
|
3012
3143
|
};
|
|
3013
3144
|
if (!entity.name) return null;
|
|
3145
|
+
// Click-to-navigate (your-moon/crisp, Attio parity) -- `onOpenRecord` wins over a
|
|
3146
|
+
// plain `href` when both are set (see `onOpenRecord`'s own doc comment,
|
|
3147
|
+
// `DataTable.tsx`); neither -> the original plain, non-clickable `<span>`. Both
|
|
3148
|
+
// clickable variants carry `data-clickable` -- the ONLY thing the recipe's
|
|
3149
|
+
// `entityName` hover-underline rule keys off (`data-table.ts`), so a plain name
|
|
3150
|
+
// never underlines and a clickable one always does, regardless of which variant
|
|
3151
|
+
// rendered it.
|
|
3152
|
+
const nameNode = column?.onOpenRecord && row !== undefined ? // A real `<button>`, not a `<span role="link">` -- `onOpenRecord` is an
|
|
3153
|
+
// arbitrary consumer callback (like `onOpenPreview`'s own button below), never
|
|
3154
|
+
// a genuine URL, so `<button>` is the correct semantic element (native
|
|
3155
|
+
// keyboard activation/focusability for free, no `role`/`tabIndex`/`onKeyDown`
|
|
3156
|
+
// needed) -- unlike the `href` branch just below, which IS a real URL and
|
|
3157
|
+
// gets a real `<a>`. The recipe's `entityName` slot resets this button's own
|
|
3158
|
+
// chrome (border/background/padding/font/color/text-align) back to plain
|
|
3159
|
+
// inline text (`data-table.ts`).
|
|
3160
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
3161
|
+
type: "button",
|
|
3162
|
+
className: nameClassName,
|
|
3163
|
+
"data-clickable": "",
|
|
3164
|
+
onClick: (event)=>{
|
|
3165
|
+
event.stopPropagation();
|
|
3166
|
+
column.onOpenRecord?.(row);
|
|
3167
|
+
},
|
|
3168
|
+
children: entity.name
|
|
3169
|
+
}) : entity.href ? /*#__PURE__*/ jsxRuntime.jsx("a", {
|
|
3170
|
+
className: nameClassName,
|
|
3171
|
+
"data-clickable": "",
|
|
3172
|
+
href: entity.href,
|
|
3173
|
+
onClick: (event)=>event.stopPropagation(),
|
|
3174
|
+
children: entity.name
|
|
3175
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
3176
|
+
className: nameClassName,
|
|
3177
|
+
children: entity.name
|
|
3178
|
+
});
|
|
3014
3179
|
return /*#__PURE__*/ jsxRuntime.jsxs("span", {
|
|
3015
3180
|
className: className,
|
|
3016
3181
|
children: [
|
|
@@ -3026,10 +3191,7 @@ function EntityCell({ value, className, nameClassName, actionsClassName, actionC
|
|
|
3026
3191
|
})
|
|
3027
3192
|
]
|
|
3028
3193
|
}),
|
|
3029
|
-
|
|
3030
|
-
className: nameClassName,
|
|
3031
|
-
children: entity.name
|
|
3032
|
-
}),
|
|
3194
|
+
nameNode,
|
|
3033
3195
|
column?.onOpenPreview && row !== undefined && /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
3034
3196
|
className: actionsClassName,
|
|
3035
3197
|
children: /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
@@ -3964,7 +4126,7 @@ const TextFieldTextarea = /*#__PURE__*/ React.forwardRef(({ className, autoresiz
|
|
|
3964
4126
|
});
|
|
3965
4127
|
TextFieldTextarea.displayName = "TextFieldTextarea";
|
|
3966
4128
|
|
|
3967
|
-
__insertCSS(".seed-data-table__root{box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;border-width:1px;border-style:solid;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}.seed-data-table__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.seed-data-table__headerCell{box-sizing:border-box;position:sticky;top:0;z-index:2;vertical-align:middle;text-align:start;padding:0;height:var(--seed-dimension-x10);background-color:var(--seed-color-bg-layer-default);border-top:1px solid var(--seed-color-stroke-neutral-muted);border-bottom:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-inline-start:none;color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-medium);letter-spacing:-.14px}.seed-data-table__headerCell:last-child{border-inline-end:none}.seed-data-table__headerCell[data-sortable]{cursor:pointer;user-select:none}.seed-data-table__headerCell [data-chevron]{opacity:0;transition:opacity .12s}.seed-data-table__headerCell[data-sortable]:hover [data-chevron]{opacity:.6}.seed-data-table__headerCell[data-sorted] [data-chevron]{opacity:1;color:var(--seed-color-fg-neutral)}.seed-data-table__headerCell:hover [data-column-menu]{opacity:1}.seed-data-table__headerCell [data-column-menu]:focus-visible,.seed-data-table__headerCell [data-column-menu][data-open]{opacity:1}.seed-data-table__headerCell[data-dragging]{opacity:.5}.seed-data-table__headerCell[data-sticky]{position:sticky;z-index:3;background-color:var(--seed-color-bg-layer-default)}.seed-data-table__headerCell{outline:var(--seed-dimension-x0_5) solid transparent;outline-offset:calc(var(--seed-dimension-x0_5) * -1)}.seed-data-table__headerCell:is(:focus-visible,[data-focus-visible]){outline:var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);outline-offset:calc(var(--seed-dimension-x0_5) * -1)}.seed-data-table__headerCell .seed-data-table-resize-handle{position:absolute;top:0;inset-inline-end:calc(7px / -2);width:7px;height:100%;z-index:4;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.seed-data-table__headerCell .seed-data-table-resize-handle-inner{width:3px;height:100%;border-radius:3px;background-color:#0298d9;opacity:0;transition:opacity .1s}.seed-data-table__headerCell .seed-data-table-resize-handle:hover .seed-data-table-resize-handle-inner,.seed-data-table__headerCell .seed-data-table-resize-handle[data-resizing] .seed-data-table-resize-handle-inner{opacity:1}.seed-data-table__headerCellInner{box-sizing:border-box;display:flex;align-items:center;width:100%;height:100%;min-width:0;gap:var(--seed-dimension-x1_5);padding-inline:var(--seed-dimension-x3)}.seed-data-table__headerCellLabel{min-width:0;flex:1 1 0%;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__headerCellIcon{flex-shrink:0;margin-inline-start:auto;display:inline-flex;align-items:center;justify-content:center;width:var(--seed-dimension-x4);height:var(--seed-dimension-x4);color:var(--seed-color-fg-neutral-subtle);border:none;background:0 0;padding:0;font:inherit;cursor:pointer}.seed-data-table__headerCellIcon[data-active]{color:var(--seed-color-fg-neutral)}.seed-data-table__headerCellIcon[data-column-menu]{opacity:0;transition:opacity .12s}.seed-data-table__row{position:relative;background-color:var(--seed-color-bg-layer-default);--seed-data-table-row-bg:var(--seed-color-bg-layer-default)}.seed-data-table__row[data-clickable]{cursor:pointer}.seed-data-table__row:is([aria-selected=true],[data-selected]){background-color:color-mix(in srgb,#0298d9 10%,var(--seed-color-bg-layer-default));--seed-data-table-row-bg:color-mix(in srgb, #0298d9 10%, var(--seed-color-bg-layer-default))}.seed-data-table__row:is([aria-selected=true],[data-selected]):is(:hover,[data-hover]){background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 3%,color-mix(in srgb,#0298d9 10%,var(--seed-color-bg-layer-default)));--seed-data-table-row-bg:color-mix(in srgb, var(--seed-color-fg-neutral) 3%, color-mix(in srgb, #0298d9 10%, var(--seed-color-bg-layer-default)))}.seed-data-table__cell{box-sizing:border-box;position:relative;vertical-align:middle;text-align:start;height:var(--seed-dimension-x9);border-bottom:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-top:none;border-inline-start:none;padding-block:0;padding-inline:var(--seed-dimension-x3);color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-regular);letter-spacing:-.14px;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__cell:not([data-editable]){user-select:none}.seed-data-table__cell:last-child{border-inline-end:none}tbody tr:last-child .seed-data-table__cell{border-bottom:none}.seed-data-table__cell[data-numeric]{text-align:end;font-variant-numeric:tabular-nums}.seed-data-table__cell[data-sticky]{position:sticky;z-index:1;background-color:var(--seed-data-table-row-bg)}.seed-data-table__cell[data-overlay-open]{overflow:visible;z-index:20}.seed-data-table__cell[data-editable]{cursor:default}.seed-data-table__cell .seed-data-table-edit-picker{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);min-width:0}.seed-data-table__cell .seed-data-table-edit-pending{flex-shrink:0;color:var(--seed-color-fg-neutral-subtle);animation:rotate .6s linear infinite}.seed-data-table__cell .seed-data-table-edit-error{position:absolute;top:100%;inset-inline-start:var(--seed-dimension-x3);inset-inline-end:var(--seed-dimension-x3);z-index:2;padding-top:2px;font-size:12px;line-height:1.3;color:var(--seed-color-fg-critical);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__entity{display:flex;align-items:center;min-width:0;gap:var(--seed-dimension-x1_5)}.seed-data-table__entityName{min-width:0;font-weight:var(--seed-font-weight-medium);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__tagList{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);overflow:hidden;min-width:0}.seed-data-table__entityActions{display:flex;align-items:center;gap:6px;margin-inline-start:auto;flex-shrink:0;opacity:0;transition:opacity .15s}tr:hover .seed-data-table__entityActions{opacity:1}.seed-data-table__entityActions:focus-within{opacity:1}.seed-data-table__entityAction{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0;padding:2px;border:none;border-radius:6px;background:0 0;font-family:inherit;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent);cursor:pointer;flex-shrink:0;transition:background-color .2s,color .2s,box-shadow .2s}.seed-data-table__entityAction:hover{background:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__link{color:var(--seed-color-fg-neutral);text-decoration:none;min-width:0;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__link:is(:hover,[data-hover]){text-decoration:underline}.seed-data-table__chip{box-sizing:border-box;display:inline-flex;align-items:center;flex-shrink:0;max-width:100%;height:22px;padding:0 4px;border-radius:7px;font-size:10px;font-weight:var(--seed-font-weight-regular);line-height:15px;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__chipList{position:relative;display:flex;align-items:center;flex-wrap:nowrap;gap:3px;overflow:hidden;min-width:0;width:100%}.seed-data-table__chipOverflow{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;height:20px;padding:0 4px;border-radius:6px;background-color:#f6f7f7;color:#000;font-size:10px;font-weight:var(--seed-font-weight-regular);line-height:15px;white-space:nowrap}.seed-data-table__chipListEditor{display:flex;align-items:center;flex-wrap:wrap;gap:3px;min-width:0;width:100%}.seed-data-table__chipRemove{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:12px;height:12px;margin:0;margin-inline-start:2px;padding:0;border:none;border-radius:999px;background:0 0;color:inherit;opacity:.6;cursor:pointer;transition:opacity .12s,background-color .12s}.seed-data-table__chipRemove:hover{opacity:1;background-color:rgba(0,0,0,.08)}.seed-data-table__chipInput{flex:1 1 auto;min-width:40px;height:22px;margin:0;padding:0;border:none;outline:0;background:0 0;font-family:inherit;font-size:var(--seed-font-size-t4);color:var(--seed-color-fg-neutral);letter-spacing:-.14px}.seed-data-table__expandOverlay{box-sizing:border-box;position:absolute;top:-1px;inset-inline-start:-1px;inset-inline-end:-1px;z-index:10;min-height:calc(100% + 2px);display:flex;align-items:flex-start;padding-inline:var(--seed-dimension-x3);padding-block:var(--seed-dimension-x3);background-color:var(--seed-color-bg-layer-floating);border-radius:4px;box-shadow:none;border:1px solid #266df0;color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);letter-spacing:-.14px;cursor:default}.seed-data-table__expandOverlayText{width:100%;min-width:0;white-space:normal;word-break:break-word}.seed-data-table__cellSuffixRow{display:flex;align-items:center;gap:4px;min-width:0;width:100%}.seed-data-table__cellSuffixText{flex:1 1 0%;min-width:0;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__cellSuffixIcon{flex-shrink:0;display:inline-flex;align-items:center;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent)}.seed-data-table__toolbar{box-sizing:border-box;display:flex;align-items:center;width:100%;flex-shrink:0;min-height:49px;gap:var(--seed-dimension-x2);padding-inline:var(--seed-dimension-x3);border-top:1px solid var(--seed-color-stroke-neutral-muted)}.seed-data-table__search{position:relative;display:inline-flex;align-items:center;flex:1 1 0%;max-width:280px}.seed-data-table__search svg{position:absolute;inset-inline-start:var(--seed-dimension-x2);width:var(--seed-dimension-x4);height:var(--seed-dimension-x4);color:var(--seed-color-fg-neutral-muted);pointer-events:none}.seed-data-table__search input{width:100%;height:var(--seed-dimension-x8);padding-inline-start:var(--seed-dimension-x7);padding-inline-end:var(--seed-dimension-x2);border:none;border-radius:var(--seed-radius-r2);background-color:var(--seed-color-bg-layer-default);box-shadow:inset 0 0 0 1px var(--seed-color-stroke-neutral-weak);font-family:inherit;font-size:var(--seed-font-size-t4);color:var(--seed-color-fg-neutral);outline:0;transition:box-shadow .1s var(--seed-timing-function-easing)}.seed-data-table__search input::placeholder{color:var(--seed-color-fg-neutral-subtle)}.seed-data-table__search input:focus{box-shadow:inset 0 0 0 2px var(--seed-color-stroke-neutral-contrast)}.seed-data-table__count{flex-shrink:0;color:var(--seed-color-fg-neutral-subtle);font-size:var(--seed-font-size-t3);font-variant-numeric:tabular-nums}.seed-data-table__toolbarEnd{flex-shrink:0;margin-inline-start:auto;display:inline-flex;align-items:center;gap:var(--seed-dimension-x2)}.seed-data-table__scrollArea{position:relative;display:flex;flex-direction:column;width:100%;min-width:0;flex:1 1 auto;min-height:0;overflow-x:auto;overflow-y:auto}.seed-data-table__scrollArea[data-scrolled-start] [data-sticky-edge]{clip-path:inset(0 -38px 0 0);box-shadow:6px 0 16px 4px rgba(0,0,0,.12)}.seed-data-table__scrollArea[data-scrolled-end] [data-sticky-edge-end]{clip-path:inset(0 0 0 -38px);box-shadow:-6px 0 16px 4px rgba(0,0,0,.12)}.seed-data-table__footerCell{box-sizing:border-box;position:sticky;bottom:0;z-index:2;vertical-align:middle;padding:0;height:var(--seed-dimension-x9);background-color:var(--seed-color-bg-layer-default);border-top:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-inline-start:none}.seed-data-table__footerCell:last-child{border-inline-end:none}.seed-data-table__footerCell .seed-data-table-column-calc-trigger{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);width:100%;height:100%;min-width:0;margin:0;padding:0 var(--seed-dimension-x3);border:none;background:0 0;color:var(--seed-color-fg-neutral-subtle);font-family:inherit;font-size:var(--seed-font-size-t4);font-weight:var(--seed-font-weight-medium);white-space:nowrap;overflow:clip;cursor:pointer;transition:background-color .12s,color .12s}.seed-data-table__footerCell .seed-data-table-column-calc-trigger:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__footerCell .seed-data-table-column-calc-trigger[data-align=right]{justify-content:flex-end}.seed-data-table__footerCell .seed-data-table-column-calc-trigger svg{flex-shrink:0;opacity:.7}.seed-data-table__footerCell .seed-data-table-column-calc-placeholder{overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__footerCell .seed-data-table-column-calc-value{min-width:0;flex-shrink:1;color:var(--seed-color-fg-neutral);font-variant-numeric:tabular-nums;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__footerCell .seed-data-table-column-calc-op{min-width:0;flex-shrink:1;color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__emptyState{box-sizing:border-box;text-align:center;padding-block:var(--seed-dimension-x8);padding-inline:var(--seed-dimension-x3);color:var(--seed-color-fg-neutral-subtle);font-size:var(--seed-font-size-t4)}.seed-data-table__loadingState{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:10px;padding-block:var(--seed-dimension-x8);padding-inline:var(--seed-dimension-x3);color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-medium)}.seed-data-table__loadingState[data-inline]{padding-block:0;padding-inline:0;height:var(--seed-dimension-x9)}.seed-data-table__loadingState .seed-data-table-loading-spinner{flex-shrink:0;color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);animation:rotate .6s linear infinite}.seed-data-table__addRowCell{box-sizing:border-box;padding:0;border-top:none}.seed-data-table__addRow{box-sizing:border-box;display:flex;align-items:center;width:100%;margin:0;border:none;border-top:1px solid var(--seed-color-stroke-neutral-muted);background-color:var(--seed-color-bg-layer-default);height:var(--seed-dimension-x9);gap:var(--seed-dimension-x2);padding-inline:var(--seed-dimension-x2);color:var(--seed-color-fg-neutral-subtle);font-family:inherit;font-size:var(--seed-font-size-t4);cursor:pointer;transition:background-color .12s,color .12s}.seed-data-table__addRow:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,var(--seed-color-bg-layer-default));color:var(--seed-color-fg-neutral)}.seed-data-table__addRow svg{flex-shrink:0}.seed-data-table__selectionCell{text-align:center;padding:0}.seed-data-table__bulkBar{box-sizing:border-box;position:absolute;inset-inline-start:50%;transform:translateX(-50%);bottom:var(--seed-dimension-x4);z-index:30;display:flex;align-items:center;gap:var(--seed-dimension-x3);min-height:36px;padding-inline:var(--seed-dimension-x3_5);padding-block:var(--seed-dimension-x2);border-radius:var(--seed-radius-full);box-shadow:var(--seed-shadow-s3);background-color:var(--seed-color-bg-layer-floating);color:var(--seed-color-fg-neutral);font-family:inherit;font-size:var(--seed-font-size-t4);font-weight:var(--seed-font-weight-medium);white-space:nowrap}.seed-data-table__bulkBarCount{flex-shrink:0;color:var(--seed-color-fg-neutral);font-variant-numeric:tabular-nums}.seed-data-table__bulkBarClear{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:0;padding:2px;border:none;border-radius:6px;background:0 0;font-family:inherit;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent);cursor:pointer;transition:background-color .2s,color .2s}.seed-data-table__bulkBarClear:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 8%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__bulkBarActions{display:flex;align-items:center;flex-shrink:0;gap:var(--seed-dimension-x3);padding-inline-start:var(--seed-dimension-x3);border-inline-start:1px solid color-mix(in srgb,var(--seed-color-fg-neutral) 16%,transparent)}.seed-data-table__root--surface_card{border-color:var(--seed-color-stroke-neutral-muted);background-color:var(--seed-color-bg-layer-default);border-radius:var(--seed-radius-r3)}.seed-data-table__root--surface_bleed{border-color:var(--seed-color-bg-transparent);background-color:var(--seed-color-bg-transparent)}.seed-data-table__row--interactive_true{transition:background-color .12s}.seed-data-table__row--interactive_true:is(:hover,[data-hover]){background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 3%,transparent);--seed-data-table-row-bg:color-mix(in srgb, var(--seed-color-fg-neutral) 3%, var(--seed-color-bg-layer-default))}");
|
|
4129
|
+
__insertCSS(".seed-data-table__root{box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;border-width:1px;border-style:solid;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif}.seed-data-table__table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.seed-data-table__headerCell{box-sizing:border-box;position:sticky;top:0;z-index:2;vertical-align:middle;text-align:start;padding:0;height:var(--seed-dimension-x10);background-color:var(--seed-color-bg-layer-default);border-top:1px solid var(--seed-color-stroke-neutral-muted);border-bottom:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-inline-start:none;color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-medium);letter-spacing:-.14px}.seed-data-table__headerCell:last-child{border-inline-end:none}.seed-data-table__headerCell[data-sortable]{cursor:pointer;user-select:none}.seed-data-table__headerCell [data-chevron]{opacity:0;transition:opacity .12s}.seed-data-table__headerCell[data-sortable]:hover [data-chevron]{opacity:.6}.seed-data-table__headerCell[data-sorted] [data-chevron]{opacity:1;color:var(--seed-color-fg-neutral)}.seed-data-table__headerCell:hover [data-column-menu]{opacity:1}.seed-data-table__headerCell [data-column-menu]:focus-visible,.seed-data-table__headerCell [data-column-menu][data-open]{opacity:1}.seed-data-table__headerCell[data-dragging]{opacity:.5}.seed-data-table__headerCell[data-sticky]{position:sticky;z-index:3;background-color:var(--seed-color-bg-layer-default)}.seed-data-table__headerCell{outline:var(--seed-dimension-x0_5) solid transparent;outline-offset:calc(var(--seed-dimension-x0_5) * -1)}.seed-data-table__headerCell:is(:focus-visible,[data-focus-visible]){outline:var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);outline-offset:calc(var(--seed-dimension-x0_5) * -1)}.seed-data-table__headerCell .seed-data-table-resize-handle{position:absolute;top:0;inset-inline-end:calc(7px / -2);width:7px;height:100%;z-index:4;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.seed-data-table__headerCell .seed-data-table-resize-handle-inner{width:3px;height:100%;border-radius:3px;background-color:#0298d9;opacity:0;transition:opacity .1s}.seed-data-table__headerCell .seed-data-table-resize-handle:hover .seed-data-table-resize-handle-inner,.seed-data-table__headerCell .seed-data-table-resize-handle[data-resizing] .seed-data-table-resize-handle-inner{opacity:1}.seed-data-table__headerCellInner{box-sizing:border-box;display:flex;align-items:center;width:100%;height:100%;min-width:0;gap:var(--seed-dimension-x1_5);padding-inline:var(--seed-dimension-x3)}.seed-data-table__headerCellLabel{min-width:0;flex:1 1 0%;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__headerCellIcon{flex-shrink:0;margin-inline-start:auto;display:inline-flex;align-items:center;justify-content:center;width:var(--seed-dimension-x4);height:var(--seed-dimension-x4);color:var(--seed-color-fg-neutral-subtle);border:none;background:0 0;padding:0;font:inherit;cursor:pointer}.seed-data-table__headerCellIcon[data-active]{color:var(--seed-color-fg-neutral)}.seed-data-table__headerCellIcon[data-column-menu]{opacity:0;transition:opacity .12s}.seed-data-table__row{position:relative;background-color:var(--seed-color-bg-layer-default);--seed-data-table-row-bg:var(--seed-color-bg-layer-default)}.seed-data-table__row[data-clickable]{cursor:pointer}.seed-data-table__row:is([aria-selected=true],[data-selected]){background-color:color-mix(in srgb,#0298d9 10%,var(--seed-color-bg-layer-default));--seed-data-table-row-bg:color-mix(in srgb, #0298d9 10%, var(--seed-color-bg-layer-default))}.seed-data-table__row:is([aria-selected=true],[data-selected]):is(:hover,[data-hover]){background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 3%,color-mix(in srgb,#0298d9 10%,var(--seed-color-bg-layer-default)));--seed-data-table-row-bg:color-mix(in srgb, var(--seed-color-fg-neutral) 3%, color-mix(in srgb, #0298d9 10%, var(--seed-color-bg-layer-default)))}.seed-data-table__cell{box-sizing:border-box;position:relative;vertical-align:middle;text-align:start;height:var(--seed-dimension-x9);border-bottom:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-top:none;border-inline-start:none;padding-block:0;padding-inline:var(--seed-dimension-x3);color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-regular);letter-spacing:-.14px;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__cell:not([data-editable]){user-select:none}.seed-data-table__cell:last-child{border-inline-end:none}tbody tr:last-child .seed-data-table__cell{border-bottom:none}.seed-data-table__cell[data-numeric]{text-align:end;font-variant-numeric:tabular-nums}.seed-data-table__cell[data-sticky]{position:sticky;z-index:1;background-color:var(--seed-data-table-row-bg)}.seed-data-table__cell[data-overlay-open]{overflow:visible;z-index:20}.seed-data-table__cell[data-editable]{cursor:default}.seed-data-table__cell .seed-data-table-edit-picker{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);min-width:0}.seed-data-table__cell .seed-data-table-edit-pending{flex-shrink:0;color:var(--seed-color-fg-neutral-subtle);animation:rotate .6s linear infinite}.seed-data-table__cell .seed-data-table-edit-error{position:absolute;top:100%;inset-inline-start:var(--seed-dimension-x3);inset-inline-end:var(--seed-dimension-x3);z-index:2;padding-top:2px;font-size:12px;line-height:1.3;color:var(--seed-color-fg-critical);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__entity{display:flex;align-items:center;min-width:0;gap:var(--seed-dimension-x1_5)}.seed-data-table__entityName{min-width:0;font-weight:var(--seed-font-weight-medium);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__entityName[data-clickable]{cursor:pointer;border:none;background:0 0;padding:0;margin:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;text-align:start}.seed-data-table__entityName[data-clickable]:is(:hover,[data-hover]){text-decoration:underline}.seed-data-table__tagList{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);overflow:hidden;min-width:0}.seed-data-table__entityActions{display:flex;align-items:center;gap:6px;margin-inline-start:auto;flex-shrink:0;opacity:0;transition:opacity .15s}tr:hover .seed-data-table__entityActions{opacity:1}.seed-data-table__entityActions:focus-within{opacity:1}.seed-data-table__entityAction{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0;padding:2px;border:none;border-radius:6px;background:0 0;font-family:inherit;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent);cursor:pointer;flex-shrink:0;transition:background-color .2s,color .2s,box-shadow .2s}.seed-data-table__entityAction:hover{background:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__link{color:var(--seed-color-fg-neutral);text-decoration:none;min-width:0;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__link:is(:hover,[data-hover]){text-decoration:underline}.seed-data-table__chip{box-sizing:border-box;display:inline-flex;align-items:center;flex-shrink:0;max-width:100%;height:22px;padding:0 4px;border-radius:7px;font-size:13px;font-weight:var(--seed-font-weight-medium);line-height:15px;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__chipList{position:relative;display:flex;align-items:center;flex-wrap:nowrap;gap:3px;overflow:hidden;min-width:0;width:100%}.seed-data-table__chipOverflow{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;height:20px;padding:0 4px;border-radius:6px;background-color:#f6f7f7;color:#000;font-size:10px;font-weight:var(--seed-font-weight-regular);line-height:15px;white-space:nowrap}.seed-data-table__chipListEditor{display:flex;align-items:center;flex-wrap:wrap;gap:3px;min-width:0;width:100%}.seed-data-table__chipRemove{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:12px;height:12px;margin:0;margin-inline-start:2px;padding:0;border:none;border-radius:999px;background:0 0;color:inherit;opacity:.6;cursor:pointer;transition:opacity .12s,background-color .12s}.seed-data-table__chipRemove:hover{opacity:1;background-color:rgba(0,0,0,.08)}.seed-data-table__chipInput{flex:1 1 auto;min-width:40px;height:22px;margin:0;padding:0;border:none;outline:0;background:0 0;font-family:inherit;font-size:var(--seed-font-size-t4);color:var(--seed-color-fg-neutral);letter-spacing:-.14px}.seed-data-table__expandOverlay{box-sizing:border-box;position:absolute;top:-1px;inset-inline-start:-1px;inset-inline-end:-1px;z-index:10;min-height:calc(100% + 2px);display:flex;align-items:flex-start;padding-inline:var(--seed-dimension-x3);padding-block:var(--seed-dimension-x3);background-color:var(--seed-color-bg-layer-floating);border-radius:4px;box-shadow:none;border:1px solid #266df0;color:var(--seed-color-fg-neutral);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);letter-spacing:-.14px;cursor:default}.seed-data-table__expandOverlayText{width:100%;min-width:0;white-space:normal;word-break:break-word}.seed-data-table__cellSuffixRow{display:flex;align-items:center;gap:4px;min-width:0;width:100%}.seed-data-table__cellSuffixText{flex:1 1 0%;min-width:0;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__cellSuffixIcon{flex-shrink:0;display:inline-flex;align-items:center;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent)}.seed-data-table__toolbar{box-sizing:border-box;display:flex;align-items:center;width:100%;flex-shrink:0;min-height:49px;gap:var(--seed-dimension-x2);padding-inline:var(--seed-dimension-x3);border-top:1px solid var(--seed-color-stroke-neutral-muted)}.seed-data-table__search{position:relative;display:inline-flex;align-items:center;flex:1 1 0%;max-width:280px}.seed-data-table__search svg{position:absolute;inset-inline-start:var(--seed-dimension-x2);width:var(--seed-dimension-x4);height:var(--seed-dimension-x4);color:var(--seed-color-fg-neutral-muted);pointer-events:none}.seed-data-table__search input{width:100%;height:var(--seed-dimension-x8);padding-inline-start:var(--seed-dimension-x7);padding-inline-end:var(--seed-dimension-x2);border:none;border-radius:var(--seed-radius-r2);background-color:var(--seed-color-bg-layer-default);box-shadow:inset 0 0 0 1px var(--seed-color-stroke-neutral-weak);font-family:inherit;font-size:var(--seed-font-size-t4);color:var(--seed-color-fg-neutral);outline:0;transition:box-shadow .1s var(--seed-timing-function-easing)}.seed-data-table__search input::placeholder{color:var(--seed-color-fg-neutral-subtle)}.seed-data-table__search input:focus{box-shadow:inset 0 0 0 2px var(--seed-color-stroke-neutral-contrast)}.seed-data-table__count{flex-shrink:0;color:var(--seed-color-fg-neutral-subtle);font-size:var(--seed-font-size-t3);font-variant-numeric:tabular-nums}.seed-data-table__toolbarEnd{flex-shrink:0;margin-inline-start:auto;display:inline-flex;align-items:center;gap:var(--seed-dimension-x2)}.seed-data-table__scrollArea{position:relative;display:flex;flex-direction:column;width:100%;min-width:0;flex:1 1 auto;min-height:0;overflow-x:auto;overflow-y:auto}.seed-data-table__scrollArea[data-scrolled-start] [data-sticky-edge]{clip-path:inset(0 -38px 0 0);box-shadow:6px 0 16px 4px rgba(0,0,0,.12)}.seed-data-table__scrollArea[data-scrolled-end] [data-sticky-edge-end]{clip-path:inset(0 0 0 -38px);box-shadow:-6px 0 16px 4px rgba(0,0,0,.12)}.seed-data-table__footerCell{box-sizing:border-box;position:sticky;bottom:0;z-index:2;vertical-align:middle;padding:0;height:var(--seed-dimension-x9);background-color:var(--seed-color-bg-layer-default);border-top:1px solid var(--seed-color-stroke-neutral-muted);border-inline-end:1px solid var(--seed-color-stroke-neutral-muted);border-inline-start:none}.seed-data-table__footerCell:last-child{border-inline-end:none}.seed-data-table__footerCell .seed-data-table-column-calc-trigger{display:flex;align-items:center;gap:var(--seed-dimension-x1_5);width:100%;height:100%;min-width:0;margin:0;padding:0 var(--seed-dimension-x3);border:none;background:0 0;color:var(--seed-color-fg-neutral-subtle);font-family:inherit;font-size:var(--seed-font-size-t4);font-weight:var(--seed-font-weight-medium);white-space:nowrap;overflow:clip;cursor:pointer;transition:background-color .12s,color .12s}.seed-data-table__footerCell .seed-data-table-column-calc-trigger:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__footerCell .seed-data-table-column-calc-trigger[data-align=right]{justify-content:flex-end}.seed-data-table__footerCell .seed-data-table-column-calc-trigger svg{flex-shrink:0;opacity:.7}.seed-data-table__footerCell .seed-data-table-column-calc-placeholder{overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__footerCell .seed-data-table-column-calc-value{min-width:0;flex-shrink:1;color:var(--seed-color-fg-neutral);font-variant-numeric:tabular-nums;overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__footerCell .seed-data-table-column-calc-op{min-width:0;flex-shrink:1;color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);overflow:clip;text-overflow:ellipsis;white-space:nowrap}.seed-data-table__emptyState{box-sizing:border-box;text-align:center;padding-block:var(--seed-dimension-x8);padding-inline:var(--seed-dimension-x3);color:var(--seed-color-fg-neutral-subtle);font-size:var(--seed-font-size-t4)}.seed-data-table__loadingState{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:10px;padding-block:var(--seed-dimension-x8);padding-inline:var(--seed-dimension-x3);color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);font-size:var(--seed-font-size-t4);line-height:var(--seed-line-height-t4);font-weight:var(--seed-font-weight-medium)}.seed-data-table__loadingState[data-inline]{padding-block:0;padding-inline:0;height:var(--seed-dimension-x9)}.seed-data-table__loadingState .seed-data-table-loading-spinner{flex-shrink:0;color:color-mix(in srgb,var(--seed-color-fg-neutral) 63%,transparent);animation:rotate .6s linear infinite}.seed-data-table__addRowCell{box-sizing:border-box;padding:0;border-top:none}.seed-data-table__addRow{box-sizing:border-box;display:flex;align-items:center;width:100%;margin:0;border:none;border-top:1px solid var(--seed-color-stroke-neutral-muted);background-color:var(--seed-color-bg-layer-default);height:var(--seed-dimension-x9);gap:var(--seed-dimension-x2);padding-inline:var(--seed-dimension-x2);color:var(--seed-color-fg-neutral-subtle);font-family:inherit;font-size:var(--seed-font-size-t4);cursor:pointer;transition:background-color .12s,color .12s}.seed-data-table__addRow:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 4%,var(--seed-color-bg-layer-default));color:var(--seed-color-fg-neutral)}.seed-data-table__addRow svg{flex-shrink:0}.seed-data-table__selectionCell{text-align:center;padding:0}.seed-data-table__bulkBar{box-sizing:border-box;position:absolute;inset-inline-start:50%;transform:translateX(-50%);bottom:var(--seed-dimension-x4);z-index:30;display:flex;align-items:center;gap:var(--seed-dimension-x3);min-height:36px;padding-inline:var(--seed-dimension-x3_5);padding-block:var(--seed-dimension-x2);border-radius:var(--seed-radius-full);box-shadow:var(--seed-shadow-s3);background-color:var(--seed-color-bg-layer-floating);color:var(--seed-color-fg-neutral);font-family:inherit;font-size:var(--seed-font-size-t4);font-weight:var(--seed-font-weight-medium);white-space:nowrap}.seed-data-table__bulkBarCount{flex-shrink:0;color:var(--seed-color-fg-neutral);font-variant-numeric:tabular-nums}.seed-data-table__bulkBarClear{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:0;padding:2px;border:none;border-radius:6px;background:0 0;font-family:inherit;color:color-mix(in srgb,var(--seed-color-fg-neutral) 55%,transparent);cursor:pointer;transition:background-color .2s,color .2s}.seed-data-table__bulkBarClear:hover{background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 8%,transparent);color:var(--seed-color-fg-neutral)}.seed-data-table__bulkBarActions{display:flex;align-items:center;flex-shrink:0;gap:var(--seed-dimension-x3);padding-inline-start:var(--seed-dimension-x3);border-inline-start:1px solid color-mix(in srgb,var(--seed-color-fg-neutral) 16%,transparent)}.seed-data-table__root--surface_card{border-color:var(--seed-color-stroke-neutral-muted);background-color:var(--seed-color-bg-layer-default);border-radius:var(--seed-radius-r3)}.seed-data-table__root--surface_bleed{border-color:var(--seed-color-bg-transparent);background-color:var(--seed-color-bg-transparent)}.seed-data-table__row--interactive_true{transition:background-color .12s}.seed-data-table__row--interactive_true:is(:hover,[data-hover]){background-color:color-mix(in srgb,var(--seed-color-fg-neutral) 3%,transparent);--seed-data-table-row-bg:color-mix(in srgb, var(--seed-color-fg-neutral) 3%, var(--seed-color-bg-layer-default))}");
|
|
3968
4130
|
|
|
3969
4131
|
const createClassName = (className, variants, compoundVariants = [])=>{
|
|
3970
4132
|
const variantKeys = Object.keys(variants);
|
|
@@ -5600,9 +5762,20 @@ function formatCalcValue(value, op) {
|
|
|
5600
5762
|
size: 14
|
|
5601
5763
|
})
|
|
5602
5764
|
]
|
|
5603
|
-
}) : /*#__PURE__*/ jsxRuntime.
|
|
5765
|
+
}) : /*#__PURE__*/ jsxRuntime.jsxs("span", {
|
|
5604
5766
|
className: "seed-data-table-column-calc-placeholder",
|
|
5605
|
-
|
|
5767
|
+
style: {
|
|
5768
|
+
display: "inline-flex",
|
|
5769
|
+
alignItems: "center",
|
|
5770
|
+
gap: 4
|
|
5771
|
+
},
|
|
5772
|
+
children: [
|
|
5773
|
+
/*#__PURE__*/ jsxRuntime.jsx(IconPlusLine_default, {
|
|
5774
|
+
size: 13,
|
|
5775
|
+
strokeWidth: 1.75
|
|
5776
|
+
}),
|
|
5777
|
+
"Add calculation"
|
|
5778
|
+
]
|
|
5606
5779
|
})
|
|
5607
5780
|
})
|
|
5608
5781
|
}),
|
|
@@ -11668,7 +11841,7 @@ function RowCount({ shown, total, countLabel }) {
|
|
|
11668
11841
|
}
|
|
11669
11842
|
|
|
11670
11843
|
function DataTableInner(props, ref) {
|
|
11671
|
-
const { columns, data, surface, className, locale = "en-US", sort, defaultSort, onSortChange, sortIcon, selectable, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel = "Select all rows", getRowSelectionLabel = ()=>"Select row", selectionCheckedIcon, selectionIndeterminateIcon, bulkActions, clearSelectionLabel, query, defaultQuery, onQueryChange, searchPlaceholder = "Search…", searchLabel = "Search table", toolbarSorts, defaultToolbarSorts, onToolbarSortsChange, toolbarFilters, defaultToolbarFilters, onToolbarFiltersChange, showCount = true, countLabel, toolbarActions, columnMenu = false, reorderable = true, resizable = true, columnOrder, defaultColumnOrder, onColumnOrderChange, hiddenColumnKeys, defaultHiddenColumnKeys, onHiddenColumnKeysChange, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnLabels, defaultColumnLabels, onColumnLabelsChange, pinnedColumnKeys, defaultPinnedColumnKeys, onPinnedColumnKeysChange, onColumnsChange, columnCalcOps, defaultColumnCalcOps, onColumnCalcOpsChange, stickyFirst = false, stickyLast = false, onEdit, cellContextMenu = true, onViewEditHistory, cellContextMenuItems, interactive = false, onRowClick, onAddRow, addRowLabel = "New record", loading = false, loadingLabel = "Loading...", error, empty = "No results.", onLoadMore, hasMore, loadingMore, scrollProps, ...restProps } = props;
|
|
11844
|
+
const { columns, data, surface, className, locale = "en-US", sort, defaultSort, onSortChange, sortIcon, selectable, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel = "Select all rows", getRowSelectionLabel = ()=>"Select row", selectionCheckedIcon, selectionIndeterminateIcon, bulkActions, clearSelectionLabel, query, defaultQuery, onQueryChange, searchPlaceholder = "Search…", searchLabel = "Search table", toolbarSorts, defaultToolbarSorts, onToolbarSortsChange, toolbarFilters, defaultToolbarFilters, onToolbarFiltersChange, showCount = true, countLabel, toolbarActions, columnMenu = false, reorderable = true, resizable = true, columnOrder, defaultColumnOrder, onColumnOrderChange, hiddenColumnKeys, defaultHiddenColumnKeys, onHiddenColumnKeysChange, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnLabels, defaultColumnLabels, onColumnLabelsChange, pinnedColumnKeys, defaultPinnedColumnKeys, onPinnedColumnKeysChange, onColumnsChange, columnCalcOps, defaultColumnCalcOps, onColumnCalcOpsChange, stickyFirst = false, stickyLast = false, onEdit, cellContextMenu = true, onViewEditHistory, cellContextMenuItems, interactive = false, onRowClick, onAddRow, addRowLabel = "New record", loading = false, loadingLabel = "Loading...", error, empty = "No results.", onLoadMore, hasMore, loadingMore, scrollProps, virtualized = false, rowHeight, overscan, ...restProps } = props;
|
|
11672
11845
|
const classNames = dataTable({
|
|
11673
11846
|
surface,
|
|
11674
11847
|
interactive
|
|
@@ -11841,6 +12014,9 @@ function DataTableInner(props, ref) {
|
|
|
11841
12014
|
onLoadMore: onLoadMore,
|
|
11842
12015
|
hasMore: hasMore,
|
|
11843
12016
|
loadingMore: loadingMore,
|
|
12017
|
+
virtualized: virtualized,
|
|
12018
|
+
rowHeight: rowHeight,
|
|
12019
|
+
overscan: overscan,
|
|
11844
12020
|
...restProps,
|
|
11845
12021
|
children: [
|
|
11846
12022
|
onColumnsChange && /*#__PURE__*/ jsxRuntime.jsx(ColumnsChangeEffect, {
|
|
@@ -11873,7 +12049,9 @@ function DataTableInner(props, ref) {
|
|
|
11873
12049
|
}),
|
|
11874
12050
|
/*#__PURE__*/ jsxRuntime.jsx(DataTableScrollBody, {
|
|
11875
12051
|
scrollProps: scrollProps,
|
|
12052
|
+
virtualized: virtualized,
|
|
11876
12053
|
children: /*#__PURE__*/ jsxRuntime.jsxs(DataTableTable, {
|
|
12054
|
+
"aria-rowcount": virtualized ? sortedData.length + 1 : undefined,
|
|
11877
12055
|
children: [
|
|
11878
12056
|
/*#__PURE__*/ jsxRuntime.jsx(DataTableColGroup, {
|
|
11879
12057
|
columns: columns,
|
|
@@ -11929,39 +12107,47 @@ function DataTableInner(props, ref) {
|
|
|
11929
12107
|
})
|
|
11930
12108
|
}) : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11931
12109
|
children: [
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
12110
|
+
/*#__PURE__*/ jsxRuntime.jsx(WindowedRows, {
|
|
12111
|
+
rows: sortedData,
|
|
12112
|
+
virtualized: virtualized,
|
|
12113
|
+
colSpan: totalCols,
|
|
12114
|
+
children: (windowRows, firstIndex)=>/*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
12115
|
+
children: windowRows.map((row, offset)=>/*#__PURE__*/ jsxRuntime.jsxs(DataTableRow, {
|
|
12116
|
+
rowId: row.id,
|
|
12117
|
+
"aria-rowindex": virtualized ? firstIndex + offset + 2 : undefined,
|
|
12118
|
+
"data-clickable": onRowClick ? "" : undefined,
|
|
12119
|
+
onClick: onRowClick ? ()=>onRowClick(row) : undefined,
|
|
12120
|
+
children: [
|
|
12121
|
+
selectable && /*#__PURE__*/ jsxRuntime.jsx(SelectionCell, {
|
|
12122
|
+
// The row itself carries `onClick={onRowClick}` above, and a
|
|
12123
|
+
// native click on this cell's checkbox bubbles up through it
|
|
12124
|
+
// (React attaches DataTableRow's handler on the <tr>, which
|
|
12125
|
+
// sits between the checkbox and anything a consumer could stop
|
|
12126
|
+
// it from at -- so this has to live here, not in the consumer).
|
|
12127
|
+
// Without this, checking a row's box also fires `onRowClick`.
|
|
12128
|
+
onClick: (event)=>event.stopPropagation(),
|
|
12129
|
+
stickyFirst: stickyFirst,
|
|
12130
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(RowCheckbox, {
|
|
12131
|
+
label: getRowSelectionLabel(row),
|
|
12132
|
+
checkedIcon: selectionCheckedIcon ?? DEFAULT_CHECKED_ICON
|
|
12133
|
+
})
|
|
12134
|
+
}),
|
|
12135
|
+
/*#__PURE__*/ jsxRuntime.jsx(ColumnBodyCells, {
|
|
12136
|
+
columns: columns,
|
|
12137
|
+
row: row,
|
|
12138
|
+
classNames: classNames,
|
|
12139
|
+
locale: locale,
|
|
12140
|
+
selectable: !!selectable,
|
|
12141
|
+
stickyFirst: stickyFirst,
|
|
12142
|
+
stickyLast: resolvedStickyLast,
|
|
12143
|
+
cellContextMenu: cellContextMenu,
|
|
12144
|
+
onViewEditHistory: onViewEditHistory,
|
|
12145
|
+
cellContextMenuItems: cellContextMenuItems
|
|
12146
|
+
})
|
|
12147
|
+
]
|
|
12148
|
+
}, row.id))
|
|
12149
|
+
})
|
|
12150
|
+
}),
|
|
11965
12151
|
onLoadMore && /*#__PURE__*/ jsxRuntime.jsx(InfiniteScrollRow, {
|
|
11966
12152
|
colSpan: totalCols,
|
|
11967
12153
|
classNames: classNames,
|
|
@@ -12062,7 +12248,69 @@ const DataTableTable = withContext$1(DataTableTable$1, "table");
|
|
|
12062
12248
|
* out of sync between the three. A column with no explicit width gets a bare `<col>`
|
|
12063
12249
|
* (no `style`): `table-layout: fixed`'s own algorithm gives every such column an equal
|
|
12064
12250
|
* share of whatever space is left, matching the old flex grid's `flex: 1 1 0%`
|
|
12065
|
-
* default with no extra code needed here. */
|
|
12251
|
+
* default with no extra code needed here. */ /**
|
|
12252
|
+
* Row virtualization's render slice. Lives inside `DataTableRoot` (it reads the
|
|
12253
|
+
* windowing state off context, which `DataTableInner` above can't) and hands its
|
|
12254
|
+
* children the visible `[start, end)` slice of `rows` plus that slice's first index,
|
|
12255
|
+
* flanked by a spacer row each side that stands in for everything cut off -- so the
|
|
12256
|
+
* scroll height stays `rows.length * rowHeight` and the scrollbar matches the full
|
|
12257
|
+
* data set. `virtualized` off: every row, no spacers, the pre-0.12 output exactly.
|
|
12258
|
+
*/ function WindowedRows({ rows, virtualized, colSpan, children }) {
|
|
12259
|
+
const { virtual } = useDataTableContext();
|
|
12260
|
+
const windowed = React__namespace.useMemo(()=>virtualized ? computeVirtualWindow({
|
|
12261
|
+
count: rows.length,
|
|
12262
|
+
rowHeight: virtual.rowHeight,
|
|
12263
|
+
scrollTop: virtual.scrollTop,
|
|
12264
|
+
viewportHeight: virtual.viewportHeight,
|
|
12265
|
+
overscan: virtual.overscan
|
|
12266
|
+
}) : null, [
|
|
12267
|
+
virtualized,
|
|
12268
|
+
rows.length,
|
|
12269
|
+
virtual.rowHeight,
|
|
12270
|
+
virtual.scrollTop,
|
|
12271
|
+
virtual.viewportHeight,
|
|
12272
|
+
virtual.overscan
|
|
12273
|
+
]);
|
|
12274
|
+
if (!windowed) return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
12275
|
+
children: children(rows, 0)
|
|
12276
|
+
});
|
|
12277
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12278
|
+
children: [
|
|
12279
|
+
windowed.topSpacer > 0 && /*#__PURE__*/ jsxRuntime.jsx(VirtualSpacerRow, {
|
|
12280
|
+
height: windowed.topSpacer,
|
|
12281
|
+
colSpan: colSpan
|
|
12282
|
+
}),
|
|
12283
|
+
children(rows.slice(windowed.start, windowed.end), windowed.start),
|
|
12284
|
+
windowed.bottomSpacer > 0 && /*#__PURE__*/ jsxRuntime.jsx(VirtualSpacerRow, {
|
|
12285
|
+
height: windowed.bottomSpacer,
|
|
12286
|
+
colSpan: colSpan
|
|
12287
|
+
})
|
|
12288
|
+
]
|
|
12289
|
+
});
|
|
12290
|
+
}
|
|
12291
|
+
/** A plain `<tr><td colSpan>` of a given height -- deliberately NOT a `DataTableRow`/
|
|
12292
|
+
* `DataTableCell` (no hover tint, no cell chrome, no border, no 36px min height).
|
|
12293
|
+
* `colSpan` covers every column, so the `<colgroup>` still drives widths and sticky
|
|
12294
|
+
* columns are unaffected. */ function VirtualSpacerRow({ height, colSpan }) {
|
|
12295
|
+
return /*#__PURE__*/ jsxRuntime.jsx("tr", {
|
|
12296
|
+
"data-virtual-spacer": "",
|
|
12297
|
+
style: {
|
|
12298
|
+
height
|
|
12299
|
+
},
|
|
12300
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("td", {
|
|
12301
|
+
"aria-hidden": "true",
|
|
12302
|
+
colSpan: colSpan,
|
|
12303
|
+
style: {
|
|
12304
|
+
height,
|
|
12305
|
+
padding: 0,
|
|
12306
|
+
border: 0,
|
|
12307
|
+
display: "table-cell",
|
|
12308
|
+
lineHeight: 0
|
|
12309
|
+
}
|
|
12310
|
+
})
|
|
12311
|
+
});
|
|
12312
|
+
}
|
|
12313
|
+
function DataTableColGroup({ columns, selectable, stickyFirst }) {
|
|
12066
12314
|
// MUST use the same pinned-first ordering every OTHER row (header/body/footer)
|
|
12067
12315
|
// renders in (`useEffectiveColumns`'s own doc comment) -- a `<colgroup>`'s `<col>`s
|
|
12068
12316
|
// are matched positionally to each row's cells, so if a pinned column visually moves
|
|
@@ -12137,7 +12385,7 @@ const DataTableSelectionCell = withSelectionCell(DataTableCell$1, "cell");
|
|
|
12137
12385
|
// to clip), so it never introduces a second vertical scrollbar next to whatever
|
|
12138
12386
|
// ambient container the whole DataTable already sits in.
|
|
12139
12387
|
const DataTableScrollBodyBase = withContext$1(Primitive.div, "scrollArea");
|
|
12140
|
-
function DataTableScrollBody({ children, scrollProps }) {
|
|
12388
|
+
function DataTableScrollBody({ children, virtualized, scrollProps }) {
|
|
12141
12389
|
const { scrollAreaRef, scrolledStart, scrolledEnd, onScroll } = useDataTableContext();
|
|
12142
12390
|
const { className: scrollClassName, style: scrollStyle, ...otherScrollProps } = scrollProps ?? {};
|
|
12143
12391
|
return /*#__PURE__*/ jsxRuntime.jsx(DataTableScrollBodyBase, {
|
|
@@ -12145,7 +12393,13 @@ function DataTableScrollBody({ children, scrollProps }) {
|
|
|
12145
12393
|
ref: scrollAreaRef,
|
|
12146
12394
|
onScroll: onScroll,
|
|
12147
12395
|
className: scrollClassName,
|
|
12148
|
-
|
|
12396
|
+
// Virtualized: the browser's scroll anchoring would try to hold the visible rows
|
|
12397
|
+
// steady as the spacer heights change under it, fighting the scroll position
|
|
12398
|
+
// this windowing itself derives from -- turn it off.
|
|
12399
|
+
style: virtualized ? {
|
|
12400
|
+
...scrollStyle,
|
|
12401
|
+
overflowAnchor: "none"
|
|
12402
|
+
} : scrollStyle,
|
|
12149
12403
|
"data-scrolled-start": domUtils.dataAttr(scrolledStart),
|
|
12150
12404
|
"data-scrolled-end": domUtils.dataAttr(scrolledEnd),
|
|
12151
12405
|
children: children
|