@kumix/ui 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/dist/components/agents/approval-card/index.d.ts +2 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -0
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/citations.d.ts +14 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +11 -7
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +3 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -2
- package/dist/components/charts/bump-chart/plot.js +1 -2
- package/dist/components/charts/bump-chart/point.js +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +1 -0
- package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/context.js +69 -0
- package/dist/components/charts/candlestick-chart/context.js.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.js +56 -0
- package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.js +218 -0
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
- package/dist/components/charts/candlestick-chart.d.ts +18 -0
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart.js +34 -0
- package/dist/components/charts/candlestick-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.js +1 -2
- package/dist/components/charts/composition-chart/plot.js +1 -1
- package/dist/components/charts/donut-chart/center.d.ts +16 -0
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/center.js +78 -0
- package/dist/components/charts/donut-chart/center.js.map +1 -0
- package/dist/components/charts/donut-chart/context.d.ts +68 -0
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/context.js +2 -0
- package/dist/components/charts/donut-chart/legend.d.ts +17 -0
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/legend.js +85 -0
- package/dist/components/charts/donut-chart/legend.js.map +1 -0
- package/dist/components/charts/donut-chart/plot.d.ts +10 -0
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/plot.js +108 -0
- package/dist/components/charts/donut-chart/plot.js.map +1 -0
- package/dist/components/charts/donut-chart.d.ts +22 -0
- package/dist/components/charts/donut-chart.d.ts.map +1 -0
- package/dist/components/charts/donut-chart.js +37 -0
- package/dist/components/charts/donut-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +1 -2
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +1 -1
- package/dist/components/charts/liquidity-heatmap.js +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +8 -2
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +11 -3
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +33 -1
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +92 -17
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +1 -1
- package/dist/components/charts/status-bar/tooltip.js +1 -1
- package/dist/components/charts/treemap/tooltip.js +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +3 -0
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +1 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -2
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.d.ts +1 -0
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +34 -42
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +3 -0
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card.d.ts +44 -0
- package/dist/components/motion/card.d.ts.map +1 -0
- package/dist/components/motion/card.js +122 -0
- package/dist/components/motion/card.js.map +1 -0
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +18 -6
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +110 -0
- package/dist/components/motion/color-picker.d.ts.map +1 -0
- package/dist/components/motion/color-picker.js +1053 -0
- package/dist/components/motion/color-picker.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +9 -2
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +1 -0
- package/dist/components/motion/command-palette.js +2 -2
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +1 -0
- package/dist/components/motion/digit-swap.d.ts +9 -1
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +18 -7
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +1 -0
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +1 -2
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +54 -0
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
- package/dist/components/motion/morphing-search-chips.js +599 -0
- package/dist/components/motion/morphing-search-chips.js.map +1 -0
- package/dist/components/motion/multi-select/content.d.ts +1 -0
- package/dist/components/motion/not-found/shared.d.ts +1 -0
- package/dist/components/motion/number-ticker.d.ts +6 -1
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +19 -9
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +1 -0
- package/dist/components/motion/popover-morph.js +3 -0
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- package/dist/components/motion/prediction-market-card.js +2 -3
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/radio.d.ts +3 -1
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +17 -5
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/shader-background.d.ts +1 -0
- package/dist/components/motion/sortable-list.d.ts +1 -0
- package/dist/components/motion/sortable-stack.js +1 -2
- package/dist/components/motion/tabs.d.ts +1 -0
- package/dist/components/motion/text-reveal.d.ts +1 -0
- package/dist/components/motion/tooltip/positioner.d.ts +8 -26
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -2
- package/dist/components/motion/tooltip.d.ts +62 -20
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -135
- package/dist/components/motion/wallet-card/account-avatar.js +1 -2
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/color-picker.d.ts +280 -0
- package/dist/components/reui/color-picker.d.ts.map +1 -0
- package/dist/components/reui/color-picker.js +2013 -0
- package/dist/components/reui/color-picker.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +43 -21
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +9 -3
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +12 -8
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +52 -13
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +35 -41
- package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.d.ts +168 -5
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +203 -69
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +39 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +33 -1
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +1 -0
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/emoji-picker.d.ts +367 -0
- package/dist/components/reui/emoji-picker.d.ts.map +1 -0
- package/dist/components/reui/emoji-picker.js +1768 -0
- package/dist/components/reui/emoji-picker.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
- package/dist/components/reui/file-type.d.ts +496 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +964 -0
- package/dist/components/reui/file-type.js.map +1 -0
- package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-chip.d.ts +5 -1
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +2 -2
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/icon-tile.js +8 -7
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts +3 -3
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/rating.d.ts +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +3 -3
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/item.d.ts +2 -2
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-BXUh52bu.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-BXUh52bu.js.map} +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +1 -0
- package/dist/hooks/use-scroll-position.d.ts +1 -0
- package/dist/hooks/use-slider-input.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +1 -0
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-NSIg2p7a.d.ts +20 -0
- package/dist/model-NSIg2p7a.d.ts.map +1 -0
- package/dist/model-_mRyI6V9.d.ts +18 -0
- package/dist/model-_mRyI6V9.d.ts.map +1 -0
- package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
- package/dist/positioner-3r3cfkqT.js.map +1 -0
- package/dist/tooltip-Bam5KeYe.js +535 -0
- package/dist/tooltip-Bam5KeYe.js.map +1 -0
- package/dist/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/model-DfeFradZ.d.ts +0 -9
- package/dist/model-DfeFradZ.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Button } from "../../ui/button.js";
|
|
3
3
|
import { Spinner } from "../../ui/spinner.js";
|
|
4
4
|
import { Checkbox } from "../../ui/checkbox.js";
|
|
5
|
-
import { dataGridCellSelectionCellClasses, getDataGridCellSelectionCellAttrs, toDataGridDomId, useDataGrid } from "./data-grid.js";
|
|
5
|
+
import { dataGridCellSelectionCellClasses, getDataGridCellSelectionCellAttrs, getDataGridHeaderSpans, toDataGridDomId, useDataGrid } from "./data-grid.js";
|
|
6
6
|
import { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
7
7
|
import { cn } from "@kumix/utils";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -107,12 +107,17 @@ function startDataGridColumnResizeOnEnd(event, header, table, live = false, auto
|
|
|
107
107
|
const liveContainerWidth = liveViewportElement ? getDataGridTableFillMeasurementTarget(liveViewportElement).clientWidth : 0;
|
|
108
108
|
const totalSizeStart = table.getTotalSize();
|
|
109
109
|
const fillColumnId = table.getVisibleLeafColumns().find((visibleColumn) => visibleColumn.columnDef.meta?.fillWidth)?.id;
|
|
110
|
-
const
|
|
110
|
+
const leafColumns = getDataGridHeaderLeafColumns(header);
|
|
111
|
+
const resizeRtl = table.options.columnResizeDirection === "rtl" !== (leafColumns[0]?.getIsPinned() === "end");
|
|
111
112
|
const startOffset = headerRect && Number.isFinite(resizeRtl ? headerRect.left : headerRect.right) ? resizeRtl ? headerRect.left : headerRect.right : dragStartClientX;
|
|
112
113
|
if (typeof dragStartClientX !== "number" || typeof startOffset !== "number") return;
|
|
113
114
|
ownerDocument.body.style.cursor = "col-resize";
|
|
114
115
|
ownerDocument.documentElement.style.cursor = "col-resize";
|
|
115
|
-
const columnSizingStart =
|
|
116
|
+
const columnSizingStart = leafColumns.map((leafColumn) => [leafColumn.id, leafColumn.getSize()]);
|
|
117
|
+
const liveSpanningHeaders = liveTableElement ? getDataGridTableAllFlatHeaders(table).filter((flatHeader) => flatHeader.subHeaders.length > 0).map((flatHeader) => ({
|
|
118
|
+
id: flatHeader.id,
|
|
119
|
+
leaves: getDataGridHeaderLeafColumns(flatHeader).map((leafColumn) => [leafColumn.id, leafColumn.getSize()])
|
|
120
|
+
})) : [];
|
|
116
121
|
const directionMultiplier = resizeRtl ? -1 : 1;
|
|
117
122
|
let minDeltaPercentage = -.999999;
|
|
118
123
|
let maxDeltaPercentage = Number.POSITIVE_INFINITY;
|
|
@@ -153,6 +158,11 @@ function startDataGridColumnResizeOnEnd(event, header, table, live = false, auto
|
|
|
153
158
|
liveTableElement.style.setProperty(`--col-${preview.columnId}-size`, preview.columnId === fillColumnId ? `calc(${preview.size} + var(--data-grid-fill, 0))` : String(preview.size));
|
|
154
159
|
liveTableElement.style.setProperty(`--header-${preview.columnId}-size`, String(preview.size));
|
|
155
160
|
}
|
|
161
|
+
for (const spanningHeader of liveSpanningHeaders) {
|
|
162
|
+
let size = 0;
|
|
163
|
+
for (const [columnId, startSize] of spanningHeader.leaves) size += nextColumnSizing[columnId] ?? (autoSizePreview?.columnId === columnId ? autoSizePreview.size : startSize);
|
|
164
|
+
liveTableElement.style.setProperty(`--header-${spanningHeader.id}-size`, String(size));
|
|
165
|
+
}
|
|
156
166
|
const width = `calc(${totalSize}px + var(--data-grid-fill-size, 0px))`;
|
|
157
167
|
liveTableElement.style.width = width;
|
|
158
168
|
if (liveViewportElement) {
|
|
@@ -327,6 +337,29 @@ function getDataGridTableMergedHeaderGroups(table) {
|
|
|
327
337
|
const centerHeaderGroups = table.getCenterHeaderGroups();
|
|
328
338
|
const rightHeaderGroups = table.getEndHeaderGroups();
|
|
329
339
|
const headerGroupCount = Math.max(leftHeaderGroups.length, centerHeaderGroups.length, rightHeaderGroups.length);
|
|
340
|
+
const spans = getDataGridHeaderSpans(table);
|
|
341
|
+
const coveredHeaders = /* @__PURE__ */ new Map();
|
|
342
|
+
const getRenderedHeaders = (headers = []) => {
|
|
343
|
+
const rendered = headers.filter((header) => header.rowSpan !== 0);
|
|
344
|
+
if (!spans.size) return rendered;
|
|
345
|
+
const cells = [];
|
|
346
|
+
for (let index = 0; index < rendered.length; index++) {
|
|
347
|
+
const header = rendered[index];
|
|
348
|
+
cells.push(header);
|
|
349
|
+
const coveredColumns = header.column.columns.length ? void 0 : spans.get(header.column.id);
|
|
350
|
+
if (!coveredColumns) continue;
|
|
351
|
+
const covered = [];
|
|
352
|
+
for (const coveredColumn of coveredColumns) {
|
|
353
|
+
const next = rendered[index + 1 + covered.length];
|
|
354
|
+
if (next?.column.id !== coveredColumn.id || next.rowSpan !== header.rowSpan) break;
|
|
355
|
+
covered.push(next);
|
|
356
|
+
}
|
|
357
|
+
if (!covered.length) continue;
|
|
358
|
+
coveredHeaders.set(header.id, covered);
|
|
359
|
+
index += covered.length;
|
|
360
|
+
}
|
|
361
|
+
return cells;
|
|
362
|
+
};
|
|
330
363
|
return Array.from({ length: headerGroupCount }, (_, index) => {
|
|
331
364
|
const leftGroup = leftHeaderGroups[index];
|
|
332
365
|
const centerGroup = centerHeaderGroups[index];
|
|
@@ -341,10 +374,61 @@ function getDataGridTableMergedHeaderGroups(table) {
|
|
|
341
374
|
...leftGroup?.headers ?? [],
|
|
342
375
|
...centerGroup?.headers ?? [],
|
|
343
376
|
...rightGroup?.headers ?? []
|
|
344
|
-
]
|
|
377
|
+
],
|
|
378
|
+
startHeaders: getRenderedHeaders(leftGroup?.headers),
|
|
379
|
+
centerHeaders: getRenderedHeaders(centerGroup?.headers),
|
|
380
|
+
endHeaders: getRenderedHeaders(rightGroup?.headers),
|
|
381
|
+
coveredHeaders
|
|
345
382
|
};
|
|
346
383
|
});
|
|
347
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* Every header the head rows may render: the unpinned tree plus each
|
|
387
|
+
* pinning family's, whose ids carry a family prefix above the leaf row.
|
|
388
|
+
*/
|
|
389
|
+
function getDataGridTableAllFlatHeaders(table) {
|
|
390
|
+
return [
|
|
391
|
+
...table.getFlatHeaders(),
|
|
392
|
+
...table.getStartFlatHeaders(),
|
|
393
|
+
...table.getCenterFlatHeaders(),
|
|
394
|
+
...table.getEndFlatHeaders()
|
|
395
|
+
];
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* The leaf columns under a header, in render order: a group's leaves, or the
|
|
399
|
+
* column itself for a leaf or a merged cell. v9 `getLeafHeaders` also returns
|
|
400
|
+
* the header itself and every intermediate header, so those are dropped.
|
|
401
|
+
*/
|
|
402
|
+
function getDataGridHeaderLeafColumns(header) {
|
|
403
|
+
if (!header.subHeaders.length) return [header.column];
|
|
404
|
+
const leafColumns = header.getLeafHeaders().filter((leafHeader) => !leafHeader.subHeaders.length).map((leafHeader) => leafHeader.column);
|
|
405
|
+
return leafColumns.length ? leafColumns : [header.column];
|
|
406
|
+
}
|
|
407
|
+
function renderDataGridTableHeadCellContent(header) {
|
|
408
|
+
return header.isPlaceholder && header.rowSpan <= 1 ? null : flexRender(header.column.columnDef.header, header.getContext());
|
|
409
|
+
}
|
|
410
|
+
function getDataGridHeadCellResizeHeader(header, coveredHeaders) {
|
|
411
|
+
return coveredHeaders?.length && header.column.getIsPinned() !== "end" ? coveredHeaders[coveredHeaders.length - 1] : header;
|
|
412
|
+
}
|
|
413
|
+
function getDataGridHeadCellSizeVar(header, coveredHeaders = []) {
|
|
414
|
+
if (!coveredHeaders.length) return `calc(var(--header-${header.id}-size) * 1px)`;
|
|
415
|
+
return `calc((${[header, ...coveredHeaders].map((spanned) => `var(--header-${spanned.id}-size)`).join(" + ")}) * 1px)`;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Which edge of a leaf column's header draws a resting divider line, or null
|
|
419
|
+
* for none. Mirrors the branches of DataGridTableHeadRowCellResize, so a
|
|
420
|
+
* group cell above can continue exactly the lines its leaves draw.
|
|
421
|
+
*/
|
|
422
|
+
function getDataGridHeaderLineEdge(table, tableLayout, column) {
|
|
423
|
+
if (!tableLayout?.columnsResizable || !column.getCanResize()) return null;
|
|
424
|
+
const isPinned = column.getIsPinned();
|
|
425
|
+
if (isPinned === "end") return tableLayout.columnsPinnable ? null : "start";
|
|
426
|
+
if (getDataGridTableColumnEdges(table, column.id).isLast) return null;
|
|
427
|
+
if (isPinned) return tableLayout.columnsPinnable ? null : "end";
|
|
428
|
+
if (tableLayout.cellBorder) return null;
|
|
429
|
+
if (tableLayout.columnsPinnable && column.getIsLastColumn("center") && hasDataGridTableRightPinnedColumns(table)) return null;
|
|
430
|
+
return "end";
|
|
431
|
+
}
|
|
348
432
|
function hasDataGridTableRightPinnedColumns(table) {
|
|
349
433
|
return (table.state.columnPinning.end?.length ?? 0) > 0;
|
|
350
434
|
}
|
|
@@ -359,11 +443,12 @@ function DataGridTableFillCol() {
|
|
|
359
443
|
style: { width: hasDataGridFillColumn(table) ? 0 : "var(--data-grid-fill-size, 0px)" }
|
|
360
444
|
});
|
|
361
445
|
}
|
|
362
|
-
function DataGridTableFillHeadCell() {
|
|
446
|
+
function DataGridTableFillHeadCell({ rowSpan } = {}) {
|
|
363
447
|
const { props, table } = useDataGrid();
|
|
364
448
|
if (!props.tableLayout?.columnsResizable) return null;
|
|
365
449
|
return /* @__PURE__ */ jsx("th", {
|
|
366
450
|
"data-slot": "data-grid-table-fill-head-cell",
|
|
451
|
+
rowSpan: rowSpan && rowSpan > 1 ? rowSpan : void 0,
|
|
367
452
|
style: { width: hasDataGridFillColumn(table) ? 0 : "var(--data-grid-fill-size, 0px)" },
|
|
368
453
|
className: cn("p-0", props.tableLayout?.headerBackground && "bg-muted")
|
|
369
454
|
});
|
|
@@ -437,7 +522,7 @@ function DataGridTableBase({ children }) {
|
|
|
437
522
|
*/
|
|
438
523
|
const columnSizeVars = useMemo(() => {
|
|
439
524
|
if (!props.tableLayout?.columnsResizable) return void 0;
|
|
440
|
-
const headers = table
|
|
525
|
+
const headers = getDataGridTableAllFlatHeaders(table);
|
|
441
526
|
const fillColumnId = table.getVisibleLeafColumns().find((column) => column.columnDef.meta?.fillWidth)?.id;
|
|
442
527
|
const colSizes = {};
|
|
443
528
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -448,8 +533,13 @@ function DataGridTableBase({ children }) {
|
|
|
448
533
|
return colSizes;
|
|
449
534
|
}, [
|
|
450
535
|
props.tableLayout?.columnsResizable,
|
|
451
|
-
table.
|
|
452
|
-
table.
|
|
536
|
+
table.state.columnSizing,
|
|
537
|
+
table.state.columnVisibility,
|
|
538
|
+
table.state.columnOrder,
|
|
539
|
+
table.state.columnPinning,
|
|
540
|
+
table.options.columns,
|
|
541
|
+
table.getVisibleLeafColumns,
|
|
542
|
+
table
|
|
453
543
|
]);
|
|
454
544
|
const cellSelectionOn = !!props.tableLayout?.cellSelection && table.atoms.cellSelection != null;
|
|
455
545
|
return /* @__PURE__ */ jsxs("table", {
|
|
@@ -553,43 +643,87 @@ function DataGridTableHead({ children }) {
|
|
|
553
643
|
});
|
|
554
644
|
}
|
|
555
645
|
function DataGridTableHeadRow({ children }) {
|
|
556
|
-
const { props } = useDataGrid();
|
|
646
|
+
const { props, table } = useDataGrid();
|
|
647
|
+
const isMultiLevel = table.getHeaderGroups().length > 1;
|
|
557
648
|
return /* @__PURE__ */ jsx("tr", {
|
|
558
649
|
"aria-rowindex": props.tableLayout?.cellSelection ? 1 : void 0,
|
|
559
|
-
className: cn(props.tableLayout?.headerBorder && "[&>th]:border-b", props.tableLayout?.cellBorder && "*:last:border-e-0", props.tableLayout?.stripped && "bg-transparent", props.tableLayout?.headerBackground === false && "bg-transparent", props.tableClassNames?.headerRow),
|
|
650
|
+
className: cn(props.tableLayout?.headerBorder && "[&>th]:border-b", props.tableLayout?.cellBorder && !isMultiLevel && "*:last:border-e-0", props.tableLayout?.stripped && "bg-transparent", props.tableLayout?.headerBackground === false && "bg-transparent", props.tableClassNames?.headerRow),
|
|
560
651
|
children
|
|
561
652
|
});
|
|
562
653
|
}
|
|
563
|
-
function DataGridTableHeadRowCell({ children, header, dndRef, dndStyle }) {
|
|
654
|
+
function DataGridTableHeadRowCell({ children, header, coveredHeaders = [], dndRef, dndStyle }) {
|
|
564
655
|
const { props, table } = useDataGrid();
|
|
565
656
|
const { column } = header;
|
|
566
|
-
const
|
|
567
|
-
const
|
|
568
|
-
const
|
|
569
|
-
const
|
|
570
|
-
const
|
|
571
|
-
const
|
|
657
|
+
const isGroup = column.columns.length > 0;
|
|
658
|
+
const isSpan = coveredHeaders.length > 0;
|
|
659
|
+
const leafColumns = isSpan ? [column, ...coveredHeaders.map((covered) => covered.column)] : getDataGridHeaderLeafColumns(header);
|
|
660
|
+
const colSpan = coveredHeaders.reduce((sum, covered) => sum + covered.colSpan, header.colSpan);
|
|
661
|
+
const size = coveredHeaders.reduce((sum, covered) => sum + covered.getSize(), header.getSize());
|
|
662
|
+
const resizeColumn = getDataGridHeadCellResizeHeader(header, coveredHeaders).column;
|
|
663
|
+
const firstLeaf = leafColumns[0] ?? column;
|
|
664
|
+
const lastLeaf = leafColumns[leafColumns.length - 1] ?? column;
|
|
665
|
+
const isPinned = firstLeaf.getIsPinned();
|
|
666
|
+
const isFirstStartPinned = isPinned === "start" && firstLeaf.getIsFirstColumn("start");
|
|
667
|
+
const isLastStartPinned = isPinned === "start" && lastLeaf.getIsLastColumn("start");
|
|
668
|
+
const isFirstEndPinned = isPinned === "end" && firstLeaf.getIsFirstColumn("end");
|
|
669
|
+
const isLastEndPinned = isPinned === "end" && lastLeaf.getIsLastColumn("end");
|
|
670
|
+
const edges = {
|
|
671
|
+
isFirst: getDataGridTableColumnEdges(table, firstLeaf.id).isFirst,
|
|
672
|
+
isLast: getDataGridTableColumnEdges(table, lastLeaf.id).isLast
|
|
673
|
+
};
|
|
674
|
+
const isMultiLevel = table.getHeaderGroups().length > 1;
|
|
675
|
+
const isBanded = header.rowSpan > 1 || isMultiLevel && header.subHeaders.length === 0;
|
|
676
|
+
const groupLineEdge = isGroup && !column.getCanResize() ? getDataGridHeaderLineEdge(table, props.tableLayout, lastLeaf) === "end" ? "end" : getDataGridHeaderLineEdge(table, props.tableLayout, firstLeaf) === "start" ? "start" : null : null;
|
|
677
|
+
const hasColumnDividers = !!props.tableLayout?.cellBorder || !!props.tableLayout?.columnsResizable;
|
|
572
678
|
const headerCellSpacing = headerCellSpacingVariants({ size: props.tableLayout?.dense ? "dense" : "default" });
|
|
573
679
|
const sortDirection = column.getIsSorted();
|
|
574
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ jsxs("th", {
|
|
575
681
|
ref: dndRef,
|
|
576
682
|
scope: "col",
|
|
577
|
-
colSpan:
|
|
683
|
+
colSpan: colSpan > 1 ? colSpan : void 0,
|
|
684
|
+
rowSpan: header.rowSpan > 1 ? header.rowSpan : void 0,
|
|
578
685
|
"aria-sort": sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : column.getCanSort() ? "none" : void 0,
|
|
579
|
-
"aria-colindex": props.tableLayout?.cellSelection ?
|
|
686
|
+
"aria-colindex": props.tableLayout?.cellSelection ? firstLeaf.getIndex() + 1 : void 0,
|
|
580
687
|
"data-col-id": column.id,
|
|
688
|
+
"data-header-id": header.id,
|
|
689
|
+
"data-header-depth": header.headerGroup?.depth,
|
|
690
|
+
"data-group": isGroup || void 0,
|
|
691
|
+
"data-merged": header.rowSpan > 1 || void 0,
|
|
692
|
+
"data-span": isSpan ? colSpan : void 0,
|
|
581
693
|
style: {
|
|
582
|
-
...props.tableLayout?.width === "fixed" && !props.tableLayout?.columnsResizable && { width:
|
|
583
|
-
...props.tableLayout?.columnsPinnable && column.getCanPin() &&
|
|
694
|
+
...props.tableLayout?.width === "fixed" && !props.tableLayout?.columnsResizable && { width: size },
|
|
695
|
+
...props.tableLayout?.columnsPinnable && column.getCanPin() && (isGroup || isSpan ? {
|
|
696
|
+
...getPinningStyles(isPinned === "end" ? lastLeaf : firstLeaf),
|
|
697
|
+
width: size
|
|
698
|
+
} : getPinningStyles(column)),
|
|
584
699
|
...props.tableLayout?.headerSticky && isPinned && { top: 0 },
|
|
585
|
-
...props.tableLayout?.columnsResizable && { width:
|
|
700
|
+
...props.tableLayout?.columnsResizable && { width: getDataGridHeadCellSizeVar(header, coveredHeaders) },
|
|
586
701
|
...dndStyle ? dndStyle : null
|
|
587
702
|
},
|
|
588
703
|
"data-pinned": isPinned || void 0,
|
|
589
704
|
"data-outer-pinned-col": isFirstStartPinned ? "start" : isLastEndPinned ? "end" : void 0,
|
|
590
705
|
"data-last-col": isLastStartPinned ? "start" : isFirstEndPinned ? "end" : void 0,
|
|
591
|
-
className: cn("relative h-10 text-left align-middle font-medium text-foreground rtl:text-right [&:has([role=checkbox])]:pe-0", headerCellSpacing, props.tableLayout?.headerBackground && "bg-muted", props.tableLayout?.cellBorder && "border-e", props.tableLayout?.cellBorder && props.tableLayout?.columnsResizable && (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) && !isPinned &&
|
|
592
|
-
children
|
|
706
|
+
className: cn("relative h-10 text-left align-middle font-medium text-foreground rtl:text-right [&:has([role=checkbox])]:pe-0", headerCellSpacing, isBanded && "align-bottom", props.tableLayout?.headerBackground && "bg-muted", props.tableLayout?.cellBorder && "border-e", props.tableLayout?.cellBorder && isMultiLevel && edges.isLast && "border-e-0", props.tableLayout?.cellBorder && props.tableLayout?.columnsResizable && (props.tableLayout?.columnsPinnable || !hasDataGridTableRightPinnedColumns(table)) && !isPinned && lastLeaf.getIsLastColumn("center") && "border-e-0", isGroup && (hasColumnDividers ? "border-b" : "border-b-transparent"), props.tableLayout?.columnsResizable && resizeColumn.getCanResize() && (isPinned ? "overflow-hidden" : "overflow-visible"), props.tableLayout?.columnsResizable && resizeColumn.getCanResize() && edges.isLast && isPinned !== "end" && "pe-8", props.tableLayout?.columnsPinnable && column.getCanPin() && cn("data-pinned:isolate data-pinned:bg-muted data-outer-pinned-col:bg-clip-padding", "[&[data-pinned=end][data-last-col=end]]:shadow-[inset_calc(1px*var(--data-grid-dir,1))_0_0_0_var(--border)] [&[data-pinned=start][data-last-col=start]]:shadow-[inset_calc(-1px*var(--data-grid-dir,1))_0_0_0_var(--border)]"), header.column.columnDef.meta?.headerClassName, edges.isFirst || edges.isLast ? props.tableClassNames?.edgeCell : ""),
|
|
707
|
+
children: [
|
|
708
|
+
isBanded ? /* @__PURE__ */ jsx("div", {
|
|
709
|
+
"data-slot": "data-grid-table-head-cell-band",
|
|
710
|
+
className: cn("table w-full table-fixed", props.tableLayout?.dense ? props.tableLayout?.headerBorder ? "h-[calc(--spacing(8)-1px)]" : "h-8" : props.tableLayout?.headerBorder ? "h-[calc(--spacing(10)-1px)]" : "h-10"),
|
|
711
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
712
|
+
className: "table-cell align-middle",
|
|
713
|
+
children
|
|
714
|
+
})
|
|
715
|
+
}) : children,
|
|
716
|
+
isGroup && !hasColumnDividers ? /* @__PURE__ */ jsx("span", {
|
|
717
|
+
"aria-hidden": "true",
|
|
718
|
+
"data-slot": "data-grid-table-head-group-rule",
|
|
719
|
+
className: cn("pointer-events-none absolute h-px bg-border", props.tableLayout?.headerBorder ? "-bottom-px" : "bottom-0", props.tableLayout?.dense ? "inset-x-2" : "inset-x-3")
|
|
720
|
+
}) : null,
|
|
721
|
+
groupLineEdge ? /* @__PURE__ */ jsx("span", {
|
|
722
|
+
"aria-hidden": "true",
|
|
723
|
+
"data-slot": "data-grid-table-head-divider",
|
|
724
|
+
className: cn("pointer-events-none absolute inset-y-0 w-px bg-border", groupLineEdge === "end" ? "end-0" : "start-0")
|
|
725
|
+
}) : null
|
|
726
|
+
]
|
|
593
727
|
});
|
|
594
728
|
}
|
|
595
729
|
/**
|
|
@@ -610,9 +744,11 @@ function getDataGridColumnResizeMode(layoutMode, tableMode) {
|
|
|
610
744
|
function DataGridTableHeadRowCellResize({ header }) {
|
|
611
745
|
const { props, table, autoSize } = useDataGrid();
|
|
612
746
|
const { column } = header;
|
|
613
|
-
const
|
|
614
|
-
const
|
|
615
|
-
const
|
|
747
|
+
const leafColumns = getDataGridHeaderLeafColumns(header);
|
|
748
|
+
const isPinned = (leafColumns[0] ?? column).getIsPinned();
|
|
749
|
+
const edgeColumn = (isPinned === "end" ? leafColumns[0] : leafColumns[leafColumns.length - 1]) ?? column;
|
|
750
|
+
const isLastVisibleColumn = getDataGridTableColumnEdges(table, edgeColumn.id).isLast;
|
|
751
|
+
const hidesLastCenterLine = props.tableLayout?.columnsPinnable && edgeColumn.getIsLastColumn("center") && hasDataGridTableRightPinnedColumns(table);
|
|
616
752
|
const isResizeModeOnEnd = getDataGridColumnResizeMode(props.tableLayout?.columnsResizeMode, table.options.columnResizeMode) === "onEnd";
|
|
617
753
|
const stopResizeSessionRef = useRef(void 0);
|
|
618
754
|
useEffect(() => {
|
|
@@ -639,7 +775,7 @@ function DataGridTableHeadRowCellResize({ header }) {
|
|
|
639
775
|
onDoubleClick: () => column.resetSize(),
|
|
640
776
|
onMouseDown: handleMouseDown,
|
|
641
777
|
onTouchStart: handleTouchStart,
|
|
642
|
-
className: cn("absolute top-0 z-10 flex h-full cursor-col-resize touch-none select-none", isPinned === "end" ? cn("start-0 w-5 justify-start", props.tableLayout?.columnsPinnable ? "before:hidden" : "before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-border") : isLastVisibleColumn ? "end-0 w-5 justify-end before:hidden" : isPinned ? cn("end-0 w-5 justify-end", props.tableLayout?.columnsPinnable ? "before:hidden" : "before:absolute before:inset-y-0 before:end-0 before:w-px before:bg-border") : cn("-end-2 w-5 justify-center", props.tableLayout?.cellBorder || hidesLastCenterLine ? "before:hidden" : "before:absolute before:inset-y-0 before:
|
|
778
|
+
className: cn("absolute top-0 z-10 flex h-full cursor-col-resize touch-none select-none", isPinned === "end" ? cn("start-0 w-5 justify-start", props.tableLayout?.columnsPinnable ? "before:hidden" : "before:absolute before:inset-y-0 before:start-0 before:w-px before:bg-border") : isLastVisibleColumn ? "end-0 w-5 justify-end before:hidden" : isPinned ? cn("end-0 w-5 justify-end", props.tableLayout?.columnsPinnable ? "before:hidden" : "before:absolute before:inset-y-0 before:end-0 before:w-px before:bg-border") : cn("-end-2 w-5 justify-center", props.tableLayout?.cellBorder || hidesLastCenterLine ? "before:hidden" : "before:absolute before:inset-y-0 before:end-2 before:w-px before:bg-border"), column.getIsResizing() && (isResizeModeOnEnd ? "opacity-100" : isLastVisibleColumn && isPinned !== "end" ? "opacity-100 before:absolute before:inset-y-0 before:end-0 before:block before:w-0.5 before:bg-primary" : isPinned ? "opacity-100 before:block before:w-0.5 before:bg-primary" : cn("opacity-100 before:absolute before:inset-y-0 before:block before:w-0.5 before:bg-primary", props.tableLayout?.cellBorder && !hidesLastCenterLine ? "before:end-[calc(--spacing(2)-1px)]" : "before:end-2")))
|
|
643
779
|
});
|
|
644
780
|
}
|
|
645
781
|
function DataGridTableResizeIndicator({ viewportNodeRef }) {
|
|
@@ -669,7 +805,8 @@ function DataGridTableResizeIndicator({ viewportNodeRef }) {
|
|
|
669
805
|
value: viewportRoot?.querySelector("[data-slot=\"data-grid-table\"] thead")?.getBoundingClientRect().height ?? 0
|
|
670
806
|
};
|
|
671
807
|
const headerHeight = headerHeightCacheRef.current.value;
|
|
672
|
-
const
|
|
808
|
+
const spanOwnerId = [...getDataGridHeaderSpans(table)].find(([, covered]) => covered.some((leaf) => leaf.id === resizingHeader.column.id))?.[0];
|
|
809
|
+
const headerCellElement = viewportRoot?.querySelector(`thead th[data-col-id="${CSS.escape(spanOwnerId ?? resizingHeader.column.id)}"]`);
|
|
673
810
|
let indicatorLeft;
|
|
674
811
|
if (headerCellElement && viewportRoot) {
|
|
675
812
|
const anchorRect = headerCellElement.getBoundingClientRect();
|
|
@@ -758,7 +895,7 @@ function DataGridTableBodyRowSkeletonCell({ children, column }) {
|
|
|
758
895
|
children
|
|
759
896
|
});
|
|
760
897
|
}
|
|
761
|
-
function DataGridTableBodyRow({ children, row, pinnedBoundary, rowRef, dndRef, dndStyle, dataIndex }) {
|
|
898
|
+
function DataGridTableBodyRow({ children, row, pinnedBoundary, rowRef, dndRef, dndStyle, dndDragging, dataIndex }) {
|
|
762
899
|
const { props, table } = useDataGrid();
|
|
763
900
|
const isRowPinned = row.getIsPinned();
|
|
764
901
|
const rowStatus = props.getRowStatus?.(row.original);
|
|
@@ -776,6 +913,7 @@ function DataGridTableBodyRow({ children, row, pinnedBoundary, rowRef, dndRef, d
|
|
|
776
913
|
"data-row-pinned": isRowPinned || void 0,
|
|
777
914
|
"data-row-pinned-boundary": pinnedBoundary,
|
|
778
915
|
"data-row-status": rowStatus,
|
|
916
|
+
"data-dragging": dndDragging || void 0,
|
|
779
917
|
"aria-rowindex": props.tableLayout?.cellSelection ? row.index + 2 : void 0,
|
|
780
918
|
onClick: (event) => {
|
|
781
919
|
if (isDataGridPortalEvent(event)) return;
|
|
@@ -893,7 +1031,7 @@ function DataGridTableRenderedRow({ row, pinnedBoundary, rowRef, rowIndex, cente
|
|
|
893
1031
|
}, cell.id)),
|
|
894
1032
|
leadingSpacerSpan > 0 && /* @__PURE__ */ jsx("td", {
|
|
895
1033
|
"aria-hidden": "true",
|
|
896
|
-
"data-
|
|
1034
|
+
"data-col-spacer": "start",
|
|
897
1035
|
colSpan: leadingSpacerSpan
|
|
898
1036
|
}),
|
|
899
1037
|
windowedCenterCells.map((cell, cellIndex) => /* @__PURE__ */ jsx(DataGridTableBodyRowCell, {
|
|
@@ -903,7 +1041,7 @@ function DataGridTableRenderedRow({ row, pinnedBoundary, rowRef, rowIndex, cente
|
|
|
903
1041
|
}, cell.id)),
|
|
904
1042
|
trailingSpacerSpan > 0 && /* @__PURE__ */ jsx("td", {
|
|
905
1043
|
"aria-hidden": "true",
|
|
906
|
-
"data-
|
|
1044
|
+
"data-col-spacer": "end",
|
|
907
1045
|
colSpan: trailingSpacerSpan
|
|
908
1046
|
}),
|
|
909
1047
|
props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillBodyCell, {}) : null,
|
|
@@ -1106,7 +1244,7 @@ function DataGridTableBodyRows({ table }) {
|
|
|
1106
1244
|
] }, rowIndex)) });
|
|
1107
1245
|
}
|
|
1108
1246
|
if (isLoading && props.loadingMode === "spinner") return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
1109
|
-
colSpan: table
|
|
1247
|
+
colSpan: getDataGridTableOrderedVisibleColumns(table).length + (props.tableLayout?.columnsResizable ? 1 : 0),
|
|
1110
1248
|
className: "p-8",
|
|
1111
1249
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1112
1250
|
className: "flex items-center justify-center",
|
|
@@ -1150,26 +1288,24 @@ function DataGridTableHeader() {
|
|
|
1150
1288
|
const { table, props } = useDataGrid();
|
|
1151
1289
|
const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);
|
|
1152
1290
|
const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
|
|
1153
|
-
return /* @__PURE__ */ jsx(DataGridTableViewport, { children: /* @__PURE__ */ jsx(DataGridTableBase, { children: /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup) => {
|
|
1291
|
+
return /* @__PURE__ */ jsx(DataGridTableViewport, { children: /* @__PURE__ */ jsx(DataGridTableBase, { children: /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup, rowIndex) => {
|
|
1292
|
+
const fillHeadCell = props.tableLayout?.columnsResizable && rowIndex === 0 ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, { rowSpan: mergedHeaderGroups.length }) : null;
|
|
1293
|
+
const renderHeadCell = (header) => {
|
|
1294
|
+
const coveredHeaders = headerGroup.coveredHeaders.get(header.id);
|
|
1295
|
+
const resizeHeader = getDataGridHeadCellResizeHeader(header, coveredHeaders);
|
|
1296
|
+
return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
|
|
1297
|
+
header,
|
|
1298
|
+
coveredHeaders,
|
|
1299
|
+
children: [renderDataGridTableHeadCellContent(header), props.tableLayout?.columnsResizable && resizeHeader.column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header: resizeHeader })]
|
|
1300
|
+
}, header.id);
|
|
1301
|
+
};
|
|
1154
1302
|
return /* @__PURE__ */ jsxs(DataGridTableHeadRow, {
|
|
1155
1303
|
rowId: headerGroup.id,
|
|
1156
1304
|
children: [
|
|
1157
|
-
headerGroup.
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
|
|
1162
|
-
}, header.id);
|
|
1163
|
-
}),
|
|
1164
|
-
props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null,
|
|
1165
|
-
headerGroup.headers.filter((header) => header.column.getIsPinned() === "end").map((header) => {
|
|
1166
|
-
const { column } = header;
|
|
1167
|
-
return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
|
|
1168
|
-
header,
|
|
1169
|
-
children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
|
|
1170
|
-
}, header.id);
|
|
1171
|
-
}),
|
|
1172
|
-
props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null
|
|
1305
|
+
[...headerGroup.startHeaders, ...headerGroup.centerHeaders].map(renderHeadCell),
|
|
1306
|
+
hasRightPinnedColumns ? fillHeadCell : null,
|
|
1307
|
+
headerGroup.endHeaders.map(renderHeadCell),
|
|
1308
|
+
!hasRightPinnedColumns ? fillHeadCell : null
|
|
1173
1309
|
]
|
|
1174
1310
|
}, headerGroup.id);
|
|
1175
1311
|
}) }) }) });
|
|
@@ -1179,26 +1315,24 @@ function DataGridTable({ footerContent, renderHeader = true }) {
|
|
|
1179
1315
|
const mergedHeaderGroups = getDataGridTableMergedHeaderGroups(table);
|
|
1180
1316
|
const hasRightPinnedColumns = hasDataGridTableRightPinnedColumns(table);
|
|
1181
1317
|
return /* @__PURE__ */ jsx(DataGridTableViewport, { children: /* @__PURE__ */ jsxs(DataGridTableBase, { children: [
|
|
1182
|
-
renderHeader && /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup) => {
|
|
1318
|
+
renderHeader && /* @__PURE__ */ jsx(DataGridTableHead, { children: mergedHeaderGroups.map((headerGroup, rowIndex) => {
|
|
1319
|
+
const fillHeadCell = props.tableLayout?.columnsResizable && rowIndex === 0 ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, { rowSpan: mergedHeaderGroups.length }) : null;
|
|
1320
|
+
const renderHeadCell = (header) => {
|
|
1321
|
+
const coveredHeaders = headerGroup.coveredHeaders.get(header.id);
|
|
1322
|
+
const resizeHeader = getDataGridHeadCellResizeHeader(header, coveredHeaders);
|
|
1323
|
+
return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
|
|
1324
|
+
header,
|
|
1325
|
+
coveredHeaders,
|
|
1326
|
+
children: [renderDataGridTableHeadCellContent(header), props.tableLayout?.columnsResizable && resizeHeader.column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header: resizeHeader })]
|
|
1327
|
+
}, header.id);
|
|
1328
|
+
};
|
|
1183
1329
|
return /* @__PURE__ */ jsxs(DataGridTableHeadRow, {
|
|
1184
1330
|
rowId: headerGroup.id,
|
|
1185
1331
|
children: [
|
|
1186
|
-
headerGroup.
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
|
|
1191
|
-
}, header.id);
|
|
1192
|
-
}),
|
|
1193
|
-
props.tableLayout?.columnsResizable && hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null,
|
|
1194
|
-
headerGroup.headers.filter((header) => header.column.getIsPinned() === "end").map((header) => {
|
|
1195
|
-
const { column } = header;
|
|
1196
|
-
return /* @__PURE__ */ jsxs(DataGridTableHeadRowCell, {
|
|
1197
|
-
header,
|
|
1198
|
-
children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), props.tableLayout?.columnsResizable && column.getCanResize() && /* @__PURE__ */ jsx(DataGridTableHeadRowCellResize, { header })]
|
|
1199
|
-
}, header.id);
|
|
1200
|
-
}),
|
|
1201
|
-
props.tableLayout?.columnsResizable && !hasRightPinnedColumns ? /* @__PURE__ */ jsx(DataGridTableFillHeadCell, {}) : null
|
|
1332
|
+
[...headerGroup.startHeaders, ...headerGroup.centerHeaders].map(renderHeadCell),
|
|
1333
|
+
hasRightPinnedColumns ? fillHeadCell : null,
|
|
1334
|
+
headerGroup.endHeaders.map(renderHeadCell),
|
|
1335
|
+
!hasRightPinnedColumns ? fillHeadCell : null
|
|
1202
1336
|
]
|
|
1203
1337
|
}, headerGroup.id);
|
|
1204
1338
|
}) }),
|
|
@@ -1212,6 +1346,6 @@ function DataGridTable({ footerContent, renderHeader = true }) {
|
|
|
1212
1346
|
] }) });
|
|
1213
1347
|
}
|
|
1214
1348
|
//#endregion
|
|
1215
|
-
export { DataGridTable, DataGridTableAddRow, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpandded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableFillBodyCell, DataGridTableFillHeadCell, DataGridTableFoot, DataGridTableFootRow, DataGridTableFootRowCell, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableHeader, DataGridTableLoader, DataGridTableRenderedRow, DataGridTableRowExpand, DataGridTableRowPin, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer, DataGridTableViewport, getDataGridScrollAreaViewport, getDataGridTableMergedHeaderGroups, getDataGridTableResolvedRows, getDataGridTableRowSections, getDataGridTreeIndentStyle, getPinningStyles, hasDataGridTableRightPinnedColumns };
|
|
1349
|
+
export { DataGridTable, DataGridTableAddRow, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpandded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableFillBodyCell, DataGridTableFillHeadCell, DataGridTableFoot, DataGridTableFootRow, DataGridTableFootRowCell, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableHeader, DataGridTableLoader, DataGridTableRenderedRow, DataGridTableRowExpand, DataGridTableRowPin, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer, DataGridTableViewport, getDataGridHeadCellResizeHeader, getDataGridHeadCellSizeVar, getDataGridScrollAreaViewport, getDataGridTableMergedHeaderGroups, getDataGridTableResolvedRows, getDataGridTableRowSections, getDataGridTreeIndentStyle, getPinningStyles, hasDataGridTableRightPinnedColumns, renderDataGridTableHeadCellContent };
|
|
1216
1350
|
|
|
1217
1351
|
//# sourceMappingURL=data-grid-table.js.map
|