@wallarm-org/design-system 4.20.0-rc-feat-modal-manager.1 → 4.20.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/components/Table/StickyGroupParent.js +3 -0
- package/dist/components/Table/TableBody/TableBodyCell.js +40 -43
- package/dist/components/Table/TableColumnMenu/TableColumnMenuMoveLeftItem.js +1 -2
- package/dist/components/Table/TableColumnMenu/TableColumnMenuMoveRightItem.js +1 -2
- package/dist/components/Table/TableContext/TableProvider.js +64 -63
- package/dist/components/Table/TableContext/types.d.ts +2 -1
- package/dist/components/Table/TableHeadCell.js +1 -0
- package/dist/components/Table/TableInner/TableInnerWindow.js +37 -25
- package/dist/components/Table/TableSettingsMenu/TableSettingsMenu.js +1 -2
- package/dist/components/Table/TableSettingsMenu/TableSettingsMenuReset.js +30 -19
- package/dist/components/Table/lib/columnDndStyles.d.ts +15 -0
- package/dist/components/Table/lib/columnDndStyles.js +38 -0
- package/dist/components/Table/lib/index.d.ts +1 -0
- package/dist/components/Table/lib/index.js +1 -0
- package/dist/components/Table/lib/useColumnDnd.d.ts +2 -1
- package/dist/components/Table/lib/useColumnDnd.js +23 -13
- package/dist/components/Table/primitives/TBody.js +1 -0
- package/dist/components/Table/primitives/THead.js +1 -0
- package/dist/components/Table/primitives/Td.js +1 -0
- package/dist/components/Table/primitives/Th.js +1 -0
- package/dist/components/Table/primitives/Tr.js +1 -0
- package/dist/guidelines/foundations/layering.md +1 -2
- package/dist/guidelines/patterns/confirmation-dialogs.md +2 -64
- package/dist/metadata/components.json +1 -63
- package/dist/metadata/guidelines.json +6 -8
- package/package.json +2 -2
- package/dist/components/OverlayManager/InstanceErrorBoundary.d.ts +0 -19
- package/dist/components/OverlayManager/InstanceErrorBoundary.js +0 -18
- package/dist/components/OverlayManager/OverlayProvider.d.ts +0 -7
- package/dist/components/OverlayManager/OverlayProvider.js +0 -202
- package/dist/components/OverlayManager/OverlayStoreContext.d.ts +0 -3
- package/dist/components/OverlayManager/OverlayStoreContext.js +0 -3
- package/dist/components/OverlayManager/defineOverlay.d.ts +0 -13
- package/dist/components/OverlayManager/defineOverlay.js +0 -13
- package/dist/components/OverlayManager/index.d.ts +0 -4
- package/dist/components/OverlayManager/index.js +0 -3
- package/dist/components/OverlayManager/overlayStore.d.ts +0 -39
- package/dist/components/OverlayManager/overlayStore.js +0 -150
- package/dist/components/OverlayManager/types.d.ts +0 -49
- package/dist/components/OverlayManager/types.js +0 -0
- package/dist/components/OverlayManager/useOverlay.d.ts +0 -7
- package/dist/components/OverlayManager/useOverlay.js +0 -23
|
@@ -76,6 +76,9 @@ const StickyGroupParent = ({ tableWidth, headerHeight, windowScrollRoot, headerR
|
|
|
76
76
|
stickyRow,
|
|
77
77
|
containerRef
|
|
78
78
|
]);
|
|
79
|
+
useLayoutEffect(()=>{
|
|
80
|
+
for (const el of anchorRef.current?.querySelectorAll('a[href], button, input, select, textarea, [tabindex]') ?? [])el.tabIndex = -1;
|
|
81
|
+
});
|
|
79
82
|
return /*#__PURE__*/ jsx("div", {
|
|
80
83
|
ref: anchorRef,
|
|
81
84
|
className: cn('pointer-events-none', !useWindowScroll && 'sticky z-[21] h-0 overflow-visible'),
|
|
@@ -6,12 +6,12 @@ import { useTestId } from "../../../utils/testId.js";
|
|
|
6
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../Tooltip/index.js";
|
|
7
7
|
import { DROP_INDICATOR_BASE } from "../classes.js";
|
|
8
8
|
import { useMasterCell } from "../hooks/index.js";
|
|
9
|
-
import { TABLE_EXPAND_COLUMN_ID, getAlignClass, getExpandBorderClass,
|
|
9
|
+
import { TABLE_EXPAND_COLUMN_ID, getAlignClass, getExpandBorderClass, useColumnDndStyle, useColumnPinning, useRenderEveryTime, useTableValue } from "../lib/index.js";
|
|
10
10
|
import { Td } from "../primitives/index.js";
|
|
11
11
|
import { useTableContext } from "../TableContext/index.js";
|
|
12
12
|
import { TableMasterCellActions } from "../TableMasterCellActions.js";
|
|
13
13
|
const TableBodyCell = (t0)=>{
|
|
14
|
-
const $ = c(
|
|
14
|
+
const $ = c(54);
|
|
15
15
|
const { cell, colSpan, className, disablePinnedShadow, lastRow, dragListeners, dragAttributes, dropIndicator, empty } = t0;
|
|
16
16
|
const { masterColumnId } = useTableContext();
|
|
17
17
|
const testId = useTestId("body-cell");
|
|
@@ -33,7 +33,7 @@ const TableBodyCell = (t0)=>{
|
|
|
33
33
|
$[3] = t2;
|
|
34
34
|
} else t2 = $[3];
|
|
35
35
|
const size = useTableValue(t2);
|
|
36
|
-
const
|
|
36
|
+
const dndStyle = useColumnDndStyle(column.id);
|
|
37
37
|
const { isPinned, pinningStyles, lastPinnedLeft: lastLeft } = useColumnPinning(column);
|
|
38
38
|
const { isMasterTrigger, handleClick, tooltipText } = useMasterCell(column.id, cell.row.id);
|
|
39
39
|
const isCut = column.id === masterColumnId || meta?.resizeType === "cut";
|
|
@@ -121,80 +121,77 @@ const TableBodyCell = (t0)=>{
|
|
|
121
121
|
} else t6 = $[27];
|
|
122
122
|
const t7 = "start" === isPinned;
|
|
123
123
|
const t8 = disablePinnedShadow ? false : lastLeft;
|
|
124
|
-
const t9 =
|
|
125
|
-
|
|
126
|
-
let t11;
|
|
124
|
+
const t9 = isMasterTrigger ? handleClick : void 0;
|
|
125
|
+
let t10;
|
|
127
126
|
if ($[28] !== isCut) {
|
|
128
|
-
|
|
127
|
+
t10 = isCut && {
|
|
129
128
|
overflow: "hidden"
|
|
130
129
|
};
|
|
131
130
|
$[28] = isCut;
|
|
132
|
-
$[29] =
|
|
133
|
-
} else
|
|
134
|
-
let
|
|
131
|
+
$[29] = t10;
|
|
132
|
+
} else t10 = $[29];
|
|
133
|
+
let t11;
|
|
135
134
|
if ($[30] !== dropIndicator) {
|
|
136
|
-
|
|
135
|
+
t11 = dropIndicator && {
|
|
137
136
|
overflow: "visible"
|
|
138
137
|
};
|
|
139
138
|
$[30] = dropIndicator;
|
|
140
|
-
$[31] =
|
|
141
|
-
} else
|
|
142
|
-
let
|
|
143
|
-
if ($[32] !== dndStyle || $[33] !== pinningStyles || $[34] !== size || $[35] !==
|
|
144
|
-
|
|
139
|
+
$[31] = t11;
|
|
140
|
+
} else t11 = $[31];
|
|
141
|
+
let t12;
|
|
142
|
+
if ($[32] !== dndStyle || $[33] !== pinningStyles || $[34] !== size || $[35] !== t10 || $[36] !== t11) {
|
|
143
|
+
t12 = {
|
|
145
144
|
...pinningStyles,
|
|
146
145
|
width: size,
|
|
147
146
|
...dndStyle,
|
|
148
|
-
...
|
|
149
|
-
...
|
|
147
|
+
...t10,
|
|
148
|
+
...t11
|
|
150
149
|
};
|
|
151
150
|
$[32] = dndStyle;
|
|
152
151
|
$[33] = pinningStyles;
|
|
153
152
|
$[34] = size;
|
|
154
|
-
$[35] =
|
|
155
|
-
$[36] =
|
|
156
|
-
$[37] =
|
|
157
|
-
} else
|
|
158
|
-
let
|
|
153
|
+
$[35] = t10;
|
|
154
|
+
$[36] = t11;
|
|
155
|
+
$[37] = t12;
|
|
156
|
+
} else t12 = $[37];
|
|
157
|
+
let t13;
|
|
159
158
|
if ($[38] !== empty || $[39] !== renderContent) {
|
|
160
|
-
|
|
159
|
+
t13 = !empty && renderContent();
|
|
161
160
|
$[38] = empty;
|
|
162
161
|
$[39] = renderContent;
|
|
163
|
-
$[40] =
|
|
164
|
-
} else
|
|
165
|
-
let
|
|
166
|
-
if ($[41] !== colSpan || $[42] !== dragAttributes || $[43] !== dragListeners || $[44] !== isExpandedToggle || $[45] !== lastRow || $[46] !==
|
|
167
|
-
|
|
162
|
+
$[40] = t13;
|
|
163
|
+
} else t13 = $[40];
|
|
164
|
+
let t14;
|
|
165
|
+
if ($[41] !== colSpan || $[42] !== dragAttributes || $[43] !== dragListeners || $[44] !== isExpandedToggle || $[45] !== lastRow || $[46] !== t12 || $[47] !== t13 || $[48] !== t6 || $[49] !== t7 || $[50] !== t8 || $[51] !== t9 || $[52] !== testId) {
|
|
166
|
+
t14 = /*#__PURE__*/ jsx(Td, {
|
|
168
167
|
"data-testid": testId,
|
|
169
168
|
className: t6,
|
|
170
169
|
pinned: t7,
|
|
171
170
|
lastPinnedLeft: t8,
|
|
172
171
|
expanded: isExpandedToggle,
|
|
173
172
|
lastRow: lastRow,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
style: t13,
|
|
173
|
+
onClick: t9,
|
|
174
|
+
style: t12,
|
|
177
175
|
colSpan: colSpan,
|
|
178
176
|
...dragListeners,
|
|
179
177
|
...dragAttributes,
|
|
180
|
-
children:
|
|
178
|
+
children: t13
|
|
181
179
|
});
|
|
182
180
|
$[41] = colSpan;
|
|
183
181
|
$[42] = dragAttributes;
|
|
184
182
|
$[43] = dragListeners;
|
|
185
183
|
$[44] = isExpandedToggle;
|
|
186
184
|
$[45] = lastRow;
|
|
187
|
-
$[46] =
|
|
185
|
+
$[46] = t12;
|
|
188
186
|
$[47] = t13;
|
|
189
|
-
$[48] =
|
|
190
|
-
$[49] =
|
|
191
|
-
$[50] =
|
|
192
|
-
$[51] =
|
|
193
|
-
$[52] =
|
|
194
|
-
$[53] =
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
return t15;
|
|
187
|
+
$[48] = t6;
|
|
188
|
+
$[49] = t7;
|
|
189
|
+
$[50] = t8;
|
|
190
|
+
$[51] = t9;
|
|
191
|
+
$[52] = testId;
|
|
192
|
+
$[53] = t14;
|
|
193
|
+
} else t14 = $[53];
|
|
194
|
+
return t14;
|
|
198
195
|
};
|
|
199
196
|
TableBodyCell.displayName = "TableBodyCell";
|
|
200
197
|
export { TableBodyCell };
|
|
@@ -48,8 +48,7 @@ const TableColumnMenuMoveLeftItem = (t0)=>{
|
|
|
48
48
|
t3 = ()=>{
|
|
49
49
|
onSelect?.();
|
|
50
50
|
const allColumns = ctx.table.getAllLeafColumns();
|
|
51
|
-
const
|
|
52
|
-
const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map(_temp);
|
|
51
|
+
const currentOrder = allColumns.map(_temp);
|
|
53
52
|
const fromIdx = currentOrder.indexOf(column.id);
|
|
54
53
|
const toIdx = fromIdx - 1;
|
|
55
54
|
if (toIdx < 0) return;
|
|
@@ -49,8 +49,7 @@ const TableColumnMenuMoveRightItem = (t0)=>{
|
|
|
49
49
|
t3 = ()=>{
|
|
50
50
|
onSelect?.();
|
|
51
51
|
const allColumns = ctx.table.getAllLeafColumns();
|
|
52
|
-
const
|
|
53
|
-
const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map(_temp);
|
|
52
|
+
const currentOrder = allColumns.map(_temp);
|
|
54
53
|
const fromIdx = currentOrder.indexOf(column.id);
|
|
55
54
|
const toIdx = fromIdx + 1;
|
|
56
55
|
if (toIdx >= currentOrder.length) return;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as compiler_runtime_c } from "react/compiler-runtime";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
|
|
5
5
|
import { SortableContext, arrayMove, horizontalListSortingStrategy, sortableKeyboardCoordinates } from "@dnd-kit/sortable";
|
|
6
6
|
import { useTable } from "@tanstack/react-table";
|
|
7
7
|
import { useControlled, useIsKeyPressed } from "../../../hooks/index.js";
|
|
8
8
|
import { useTableState } from "../hooks/index.js";
|
|
9
|
-
import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_MIN_COLUMN_WIDTH, TABLE_SELECT_COLUMN_ID, TABLE_SKELETON_ROWS, TABLE_VIRTUALIZATION_OVERSCAN, createDragHandleColumn, createExpandColumn, createSelectionColumn, dsTableFeatures } from "../lib/index.js";
|
|
9
|
+
import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_MIN_COLUMN_WIDTH, TABLE_SELECT_COLUMN_ID, TABLE_SKELETON_ROWS, TABLE_VIRTUALIZATION_OVERSCAN, createColumnDndStyles, createDragHandleColumn, createExpandColumn, createSelectionColumn, dsTableFeatures } from "../lib/index.js";
|
|
10
10
|
import { TableContext } from "./TableContext.js";
|
|
11
11
|
const toTanStackPinning = (p, pinnedLeft)=>({
|
|
12
12
|
start: [
|
|
@@ -430,6 +430,7 @@ const TableProvider = (props)=>{
|
|
|
430
430
|
const shiftKeyRef = useIsKeyPressed("Shift");
|
|
431
431
|
const containerRef = useRef(null);
|
|
432
432
|
const headerScrollRef = useRef(null);
|
|
433
|
+
const [columnDndStyles] = useState(createColumnDndStyles);
|
|
433
434
|
const tbodyRef = useRef(null);
|
|
434
435
|
const virtualizerRef = useRef(null);
|
|
435
436
|
const t46 = !!getSubRows;
|
|
@@ -438,7 +439,7 @@ const TableProvider = (props)=>{
|
|
|
438
439
|
const t49 = "full" === groupRowSpan ? renderGroupRow : void 0;
|
|
439
440
|
const t50 = renderFullWidthRow;
|
|
440
441
|
let t51;
|
|
441
|
-
if ($[101] !== allLeafColumns || $[102] !== alwaysPinnedLeft || $[103] !== columnDndEnabled || $[104] !==
|
|
442
|
+
if ($[101] !== allLeafColumns || $[102] !== alwaysPinnedLeft || $[103] !== columnDndEnabled || $[104] !== columnDndStyles || $[105] !== columnGroups || $[106] !== defaultColumnOrder || $[107] !== defaultColumnVisibility || $[108] !== deferColumnVisibility || $[109] !== enableSelectAllRows || $[110] !== estimateRowHeight || $[111] !== expandingEnabled || $[112] !== groupingEnabled || $[113] !== initialScrollToRowId || $[114] !== isLoading || $[115] !== isLoadingPrevious || $[116] !== masterCellActiveRowId || $[117] !== masterColumnId || $[118] !== onEndReached || $[119] !== onEndReachedThreshold || $[120] !== onMasterCellClick || $[121] !== onRowReorder || $[122] !== onSelectAllRows || $[123] !== onSettingsOpenChange || $[124] !== onStartReached || $[125] !== onStartReachedThreshold || $[126] !== overscan || $[127] !== pinningEnabled || $[128] !== resizingEnabled || $[129] !== rowDndEnabled || $[130] !== selectionEnabled || $[131] !== setColumnOrder || $[132] !== shiftKeyRef || $[133] !== showEmptyGroups || $[134] !== skeletonCount || $[135] !== sortingEnabled || $[136] !== stretch || $[137] !== t46 || $[138] !== t47 || $[139] !== t48 || $[140] !== t49 || $[141] !== t50 || $[142] !== table || $[143] !== virtualized || $[144] !== visibilityEnabled) {
|
|
442
443
|
t51 = {
|
|
443
444
|
table,
|
|
444
445
|
isLoading,
|
|
@@ -473,6 +474,7 @@ const TableProvider = (props)=>{
|
|
|
473
474
|
onSelectAllRows,
|
|
474
475
|
containerRef,
|
|
475
476
|
headerScrollRef,
|
|
477
|
+
columnDndStyles,
|
|
476
478
|
tbodyRef,
|
|
477
479
|
virtualizerRef,
|
|
478
480
|
onEndReached,
|
|
@@ -492,52 +494,53 @@ const TableProvider = (props)=>{
|
|
|
492
494
|
$[101] = allLeafColumns;
|
|
493
495
|
$[102] = alwaysPinnedLeft;
|
|
494
496
|
$[103] = columnDndEnabled;
|
|
495
|
-
$[104] =
|
|
496
|
-
$[105] =
|
|
497
|
-
$[106] =
|
|
498
|
-
$[107] =
|
|
499
|
-
$[108] =
|
|
500
|
-
$[109] =
|
|
501
|
-
$[110] =
|
|
502
|
-
$[111] =
|
|
503
|
-
$[112] =
|
|
504
|
-
$[113] =
|
|
505
|
-
$[114] =
|
|
506
|
-
$[115] =
|
|
507
|
-
$[116] =
|
|
508
|
-
$[117] =
|
|
509
|
-
$[118] =
|
|
510
|
-
$[119] =
|
|
511
|
-
$[120] =
|
|
512
|
-
$[121] =
|
|
513
|
-
$[122] =
|
|
514
|
-
$[123] =
|
|
515
|
-
$[124] =
|
|
516
|
-
$[125] =
|
|
517
|
-
$[126] =
|
|
518
|
-
$[127] =
|
|
519
|
-
$[128] =
|
|
520
|
-
$[129] =
|
|
521
|
-
$[130] =
|
|
522
|
-
$[131] =
|
|
523
|
-
$[132] =
|
|
524
|
-
$[133] =
|
|
525
|
-
$[134] =
|
|
526
|
-
$[135] =
|
|
527
|
-
$[136] =
|
|
528
|
-
$[137] =
|
|
529
|
-
$[138] =
|
|
530
|
-
$[139] =
|
|
531
|
-
$[140] =
|
|
532
|
-
$[141] =
|
|
533
|
-
$[142] =
|
|
534
|
-
$[143] =
|
|
535
|
-
$[144] =
|
|
536
|
-
|
|
497
|
+
$[104] = columnDndStyles;
|
|
498
|
+
$[105] = columnGroups;
|
|
499
|
+
$[106] = defaultColumnOrder;
|
|
500
|
+
$[107] = defaultColumnVisibility;
|
|
501
|
+
$[108] = deferColumnVisibility;
|
|
502
|
+
$[109] = enableSelectAllRows;
|
|
503
|
+
$[110] = estimateRowHeight;
|
|
504
|
+
$[111] = expandingEnabled;
|
|
505
|
+
$[112] = groupingEnabled;
|
|
506
|
+
$[113] = initialScrollToRowId;
|
|
507
|
+
$[114] = isLoading;
|
|
508
|
+
$[115] = isLoadingPrevious;
|
|
509
|
+
$[116] = masterCellActiveRowId;
|
|
510
|
+
$[117] = masterColumnId;
|
|
511
|
+
$[118] = onEndReached;
|
|
512
|
+
$[119] = onEndReachedThreshold;
|
|
513
|
+
$[120] = onMasterCellClick;
|
|
514
|
+
$[121] = onRowReorder;
|
|
515
|
+
$[122] = onSelectAllRows;
|
|
516
|
+
$[123] = onSettingsOpenChange;
|
|
517
|
+
$[124] = onStartReached;
|
|
518
|
+
$[125] = onStartReachedThreshold;
|
|
519
|
+
$[126] = overscan;
|
|
520
|
+
$[127] = pinningEnabled;
|
|
521
|
+
$[128] = resizingEnabled;
|
|
522
|
+
$[129] = rowDndEnabled;
|
|
523
|
+
$[130] = selectionEnabled;
|
|
524
|
+
$[131] = setColumnOrder;
|
|
525
|
+
$[132] = shiftKeyRef;
|
|
526
|
+
$[133] = showEmptyGroups;
|
|
527
|
+
$[134] = skeletonCount;
|
|
528
|
+
$[135] = sortingEnabled;
|
|
529
|
+
$[136] = stretch;
|
|
530
|
+
$[137] = t46;
|
|
531
|
+
$[138] = t47;
|
|
532
|
+
$[139] = t48;
|
|
533
|
+
$[140] = t49;
|
|
534
|
+
$[141] = t50;
|
|
535
|
+
$[142] = table;
|
|
536
|
+
$[143] = virtualized;
|
|
537
|
+
$[144] = visibilityEnabled;
|
|
538
|
+
$[145] = t51;
|
|
539
|
+
} else t51 = $[145];
|
|
537
540
|
const contextValue = t51;
|
|
538
541
|
let t52;
|
|
539
542
|
let t53;
|
|
540
|
-
if ($[
|
|
543
|
+
if ($[146] !== selectionEnabled || $[147] !== table) {
|
|
541
544
|
t52 = ()=>{
|
|
542
545
|
if (!selectionEnabled) return;
|
|
543
546
|
const container = containerRef.current;
|
|
@@ -552,47 +555,45 @@ const TableProvider = (props)=>{
|
|
|
552
555
|
selectionEnabled,
|
|
553
556
|
table
|
|
554
557
|
];
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
557
|
-
$[
|
|
558
|
-
$[
|
|
558
|
+
$[146] = selectionEnabled;
|
|
559
|
+
$[147] = table;
|
|
560
|
+
$[148] = t52;
|
|
561
|
+
$[149] = t53;
|
|
559
562
|
} else {
|
|
560
|
-
t52 = $[
|
|
561
|
-
t53 = $[
|
|
563
|
+
t52 = $[148];
|
|
564
|
+
t53 = $[149];
|
|
562
565
|
}
|
|
563
566
|
useEffect(t52, t53);
|
|
564
567
|
let t54;
|
|
565
|
-
if ($[
|
|
568
|
+
if ($[150] === Symbol.for("react.memo_cache_sentinel")) {
|
|
566
569
|
t54 = {
|
|
567
570
|
activationConstraint: {
|
|
568
571
|
distance: 5
|
|
569
572
|
}
|
|
570
573
|
};
|
|
571
|
-
$[
|
|
572
|
-
} else t54 = $[
|
|
574
|
+
$[150] = t54;
|
|
575
|
+
} else t54 = $[150];
|
|
573
576
|
let t55;
|
|
574
|
-
if ($[
|
|
577
|
+
if ($[151] === Symbol.for("react.memo_cache_sentinel")) {
|
|
575
578
|
t55 = {
|
|
576
579
|
coordinateGetter: sortableKeyboardCoordinates
|
|
577
580
|
};
|
|
578
|
-
$[
|
|
579
|
-
} else t55 = $[
|
|
581
|
+
$[151] = t55;
|
|
582
|
+
} else t55 = $[151];
|
|
580
583
|
const sensors = useSensors(useSensor(PointerSensor, t54), useSensor(KeyboardSensor, t55));
|
|
581
584
|
let t56;
|
|
582
|
-
if ($[
|
|
585
|
+
if ($[152] !== setColumnOrder || $[153] !== table) {
|
|
583
586
|
t56 = (event)=>{
|
|
584
587
|
const { active, over } = event;
|
|
585
588
|
if (!over || active.id === over.id) return;
|
|
586
|
-
const
|
|
587
|
-
const currentOrder = columnOrderAtom.length ? columnOrderAtom : allLeafColumns.map(_temp2);
|
|
589
|
+
const currentOrder = table.getAllLeafColumns().map(_temp2);
|
|
588
590
|
const oldIndex = currentOrder.indexOf(String(active.id));
|
|
589
591
|
const newIndex = currentOrder.indexOf(String(over.id));
|
|
590
592
|
const newOrder_0 = arrayMove(currentOrder, oldIndex, newIndex);
|
|
591
593
|
setColumnOrder(newOrder_0);
|
|
592
594
|
};
|
|
593
|
-
$[151] = allLeafColumns;
|
|
594
595
|
$[152] = setColumnOrder;
|
|
595
|
-
$[153] = table
|
|
596
|
+
$[153] = table;
|
|
596
597
|
$[154] = t56;
|
|
597
598
|
} else t56 = $[154];
|
|
598
599
|
const handleDragEnd = t56;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from 'react';
|
|
2
2
|
import type { Column, ColumnVisibilityState, ReactTable, Row, RowData } from '@tanstack/react-table';
|
|
3
3
|
import type { Virtualizer } from '@tanstack/react-virtual';
|
|
4
|
-
import type { DSTableFeatures } from '../lib/index.js';
|
|
4
|
+
import type { ColumnDndStyles, DSTableFeatures } from '../lib/index.js';
|
|
5
5
|
import type { TableColumnGroup, TableProps, TableRowReorderEvent, TableVirtualized } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Union covers both virtualizer flavors used by the Table (`useVirtualizer`
|
|
@@ -43,6 +43,7 @@ export interface TableContextValue<T extends RowData> {
|
|
|
43
43
|
masterColumnId: string | null;
|
|
44
44
|
containerRef: RefObject<HTMLDivElement | null>;
|
|
45
45
|
headerScrollRef: RefObject<HTMLDivElement | null>;
|
|
46
|
+
columnDndStyles: ColumnDndStyles;
|
|
46
47
|
tbodyRef: RefObject<HTMLTableSectionElement | null>;
|
|
47
48
|
virtualizerRef: RefObject<TableVirtualizerInstance | null>;
|
|
48
49
|
onEndReached?: () => void;
|
|
@@ -67,10 +67,20 @@ const TableInnerWindow = (t0)=>{
|
|
|
67
67
|
if (headerScrollRef.current) headerScrollRef.current.scrollLeft = scrollEl.scrollLeft;
|
|
68
68
|
if (groupScrollRef.current) groupScrollRef.current.scrollLeft = scrollEl.scrollLeft;
|
|
69
69
|
};
|
|
70
|
+
const header = headerScrollRef.current;
|
|
71
|
+
const onHeaderScroll = ()=>{
|
|
72
|
+
if (header && scrollEl.scrollLeft !== header.scrollLeft) scrollEl.scrollLeft = header.scrollLeft;
|
|
73
|
+
};
|
|
70
74
|
scrollEl.addEventListener("scroll", onScroll, {
|
|
71
75
|
passive: true
|
|
72
76
|
});
|
|
73
|
-
|
|
77
|
+
header?.addEventListener("scroll", onHeaderScroll, {
|
|
78
|
+
passive: true
|
|
79
|
+
});
|
|
80
|
+
return ()=>{
|
|
81
|
+
scrollEl.removeEventListener("scroll", onScroll);
|
|
82
|
+
header?.removeEventListener("scroll", onHeaderScroll);
|
|
83
|
+
};
|
|
74
84
|
};
|
|
75
85
|
t5 = [
|
|
76
86
|
containerRef,
|
|
@@ -137,7 +147,7 @@ const TableInnerWindow = (t0)=>{
|
|
|
137
147
|
t12 = /*#__PURE__*/ jsxs("table", {
|
|
138
148
|
className: "table-fixed border-separate border-spacing-0",
|
|
139
149
|
style: t9,
|
|
140
|
-
"
|
|
150
|
+
role: "presentation",
|
|
141
151
|
children: [
|
|
142
152
|
t10,
|
|
143
153
|
t11
|
|
@@ -238,24 +248,23 @@ const TableInnerWindow = (t0)=>{
|
|
|
238
248
|
$[56] = t20;
|
|
239
249
|
} else t20 = $[56];
|
|
240
250
|
let t21;
|
|
241
|
-
if ($[57] !==
|
|
251
|
+
if ($[57] !== t18 || $[58] !== t19 || $[59] !== t20) {
|
|
242
252
|
t21 = /*#__PURE__*/ jsxs("table", {
|
|
243
253
|
className: "table-fixed border-separate border-spacing-0",
|
|
244
254
|
style: t18,
|
|
245
|
-
"
|
|
255
|
+
role: "presentation",
|
|
246
256
|
children: [
|
|
247
257
|
t19,
|
|
248
258
|
t20
|
|
249
259
|
]
|
|
250
260
|
});
|
|
251
|
-
$[57] =
|
|
252
|
-
$[58] =
|
|
253
|
-
$[59] =
|
|
254
|
-
$[60] =
|
|
255
|
-
|
|
256
|
-
} else t21 = $[61];
|
|
261
|
+
$[57] = t18;
|
|
262
|
+
$[58] = t19;
|
|
263
|
+
$[59] = t20;
|
|
264
|
+
$[60] = t21;
|
|
265
|
+
} else t21 = $[60];
|
|
257
266
|
let t22;
|
|
258
|
-
if ($[
|
|
267
|
+
if ($[61] !== children || $[62] !== containerRef || $[63] !== t21) {
|
|
259
268
|
t22 = /*#__PURE__*/ jsxs(ScrollAreaViewport, {
|
|
260
269
|
ref: containerRef,
|
|
261
270
|
"data-table-scroll-container": true,
|
|
@@ -265,20 +274,20 @@ const TableInnerWindow = (t0)=>{
|
|
|
265
274
|
children
|
|
266
275
|
]
|
|
267
276
|
});
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t22 = $[
|
|
277
|
+
$[61] = children;
|
|
278
|
+
$[62] = containerRef;
|
|
279
|
+
$[63] = t21;
|
|
280
|
+
$[64] = t22;
|
|
281
|
+
} else t22 = $[64];
|
|
273
282
|
let t23;
|
|
274
|
-
if ($[
|
|
283
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
275
284
|
t23 = /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
276
285
|
orientation: "horizontal"
|
|
277
286
|
});
|
|
278
|
-
$[
|
|
279
|
-
} else t23 = $[
|
|
287
|
+
$[65] = t23;
|
|
288
|
+
} else t23 = $[65];
|
|
280
289
|
let t24;
|
|
281
|
-
if ($[
|
|
290
|
+
if ($[66] !== t16 || $[67] !== t22) {
|
|
282
291
|
t24 = /*#__PURE__*/ jsxs(ScrollArea, {
|
|
283
292
|
className: "group/scroll rounded-12 border border-border-primary-light",
|
|
284
293
|
children: [
|
|
@@ -287,18 +296,21 @@ const TableInnerWindow = (t0)=>{
|
|
|
287
296
|
t23
|
|
288
297
|
]
|
|
289
298
|
});
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
} else t24 = $[
|
|
299
|
+
$[66] = t16;
|
|
300
|
+
$[67] = t22;
|
|
301
|
+
$[68] = t24;
|
|
302
|
+
} else t24 = $[68];
|
|
294
303
|
let t25;
|
|
295
|
-
if ($[70] !== t24 || $[71] !== testId) {
|
|
304
|
+
if ($[69] !== ariaLabel || $[70] !== t24 || $[71] !== testId) {
|
|
296
305
|
t25 = /*#__PURE__*/ jsx("div", {
|
|
297
306
|
ref: rootRef,
|
|
298
307
|
"data-testid": testId,
|
|
308
|
+
role: "table",
|
|
309
|
+
"aria-label": ariaLabel,
|
|
299
310
|
className: "group/scroll relative outline-none",
|
|
300
311
|
children: t24
|
|
301
312
|
});
|
|
313
|
+
$[69] = ariaLabel;
|
|
302
314
|
$[70] = t24;
|
|
303
315
|
$[71] = testId;
|
|
304
316
|
$[72] = t25;
|
|
@@ -136,8 +136,7 @@ const TableSettingsMenu = ({ 'data-testid': testIdProp, children, ...rest })=>{
|
|
|
136
136
|
const handleDragEnd = (event)=>{
|
|
137
137
|
const { active, over } = event;
|
|
138
138
|
if (!over || active.id === over.id) return;
|
|
139
|
-
const
|
|
140
|
-
const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map((c)=>c.id);
|
|
139
|
+
const currentOrder = allColumns.map((c)=>c.id);
|
|
141
140
|
const oldIndex = currentOrder.indexOf(String(active.id));
|
|
142
141
|
const newIndex = currentOrder.indexOf(String(over.id));
|
|
143
142
|
const newOrder = arrayMove(currentOrder, oldIndex, newIndex);
|
|
@@ -6,7 +6,7 @@ import { Button } from "../../Button/index.js";
|
|
|
6
6
|
import { useTableContext } from "../TableContext/index.js";
|
|
7
7
|
import { resolveVisibilityDraft, useTableSettingsMenuContentContext } from "./TableSettingsMenuContentContext.js";
|
|
8
8
|
const TableSettingsMenuReset = (t0)=>{
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(29);
|
|
10
10
|
let onClick;
|
|
11
11
|
let rest;
|
|
12
12
|
let testIdProp;
|
|
@@ -22,7 +22,7 @@ const TableSettingsMenuReset = (t0)=>{
|
|
|
22
22
|
testIdProp = $[3];
|
|
23
23
|
}
|
|
24
24
|
const testId = useTestId("settings-menu-reset", testIdProp);
|
|
25
|
-
const { table, visibilityEnabled, columnDndEnabled, defaultColumnVisibility, defaultColumnOrder, setColumnOrder, deferColumnVisibility } = useTableContext();
|
|
25
|
+
const { table, visibilityEnabled, columnDndEnabled, defaultColumnVisibility, defaultColumnOrder, setColumnOrder, alwaysPinnedLeft, deferColumnVisibility } = useTableContext();
|
|
26
26
|
const { visibilityDraft, setVisibilityDraft } = useTableSettingsMenuContentContext();
|
|
27
27
|
let t1;
|
|
28
28
|
if ($[4] !== columnDndEnabled || $[5] !== defaultColumnOrder || $[6] !== defaultColumnVisibility || $[7] !== deferColumnVisibility || $[8] !== onClick || $[9] !== setColumnOrder || $[10] !== setVisibilityDraft || $[11] !== table || $[12] !== visibilityEnabled) {
|
|
@@ -60,17 +60,28 @@ const TableSettingsMenuReset = (t0)=>{
|
|
|
60
60
|
} else t2 = $[17];
|
|
61
61
|
const visibilityMatch = t2;
|
|
62
62
|
let t3;
|
|
63
|
-
if ($[18] !==
|
|
64
|
-
t3 =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
if ($[18] !== alwaysPinnedLeft) {
|
|
64
|
+
t3 = (t4)=>{
|
|
65
|
+
const order = void 0 === t4 ? [] : t4;
|
|
66
|
+
return order.filter((id)=>!alwaysPinnedLeft.includes(id));
|
|
67
|
+
};
|
|
68
|
+
$[18] = alwaysPinnedLeft;
|
|
69
|
+
$[19] = t3;
|
|
70
|
+
} else t3 = $[19];
|
|
71
|
+
const movable = t3;
|
|
71
72
|
let t4;
|
|
72
|
-
if ($[
|
|
73
|
-
t4 =
|
|
73
|
+
if ($[20] !== defaultColumnOrder || $[21] !== effectiveOrder || $[22] !== movable) {
|
|
74
|
+
t4 = !defaultColumnOrder || isEqual(movable(effectiveOrder), movable(defaultColumnOrder));
|
|
75
|
+
$[20] = defaultColumnOrder;
|
|
76
|
+
$[21] = effectiveOrder;
|
|
77
|
+
$[22] = movable;
|
|
78
|
+
$[23] = t4;
|
|
79
|
+
} else t4 = $[23];
|
|
80
|
+
const orderMatch = t4;
|
|
81
|
+
const isDefaultState = visibilityMatch && orderMatch;
|
|
82
|
+
let t5;
|
|
83
|
+
if ($[24] !== handleClick || $[25] !== isDefaultState || $[26] !== rest || $[27] !== testId) {
|
|
84
|
+
t5 = /*#__PURE__*/ jsx(Button, {
|
|
74
85
|
...rest,
|
|
75
86
|
type: "button",
|
|
76
87
|
"data-testid": testId,
|
|
@@ -82,13 +93,13 @@ const TableSettingsMenuReset = (t0)=>{
|
|
|
82
93
|
fullWidth: true,
|
|
83
94
|
children: "Reset to default"
|
|
84
95
|
});
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
} else
|
|
91
|
-
return
|
|
96
|
+
$[24] = handleClick;
|
|
97
|
+
$[25] = isDefaultState;
|
|
98
|
+
$[26] = rest;
|
|
99
|
+
$[27] = testId;
|
|
100
|
+
$[28] = t5;
|
|
101
|
+
} else t5 = $[28];
|
|
102
|
+
return t5;
|
|
92
103
|
};
|
|
93
104
|
TableSettingsMenuReset.displayName = "TableSettingsMenuReset";
|
|
94
105
|
export { TableSettingsMenuReset };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A column's drag style, written by its header cell and read by its body
|
|
4
|
+
* cells. Only the header registers the column with dnd-kit: dnd-kit keeps one
|
|
5
|
+
* node per id, so a body cell registering the same id and then unmounting (a
|
|
6
|
+
* virtualized row, a refetched page) dropped the column, and it no longer moved.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createColumnDndStyles: () => {
|
|
9
|
+
get: (id: string) => CSSProperties;
|
|
10
|
+
set: (id: string, style: CSSProperties) => void;
|
|
11
|
+
subscribe: (listener: () => void) => () => void;
|
|
12
|
+
};
|
|
13
|
+
export type ColumnDndStyles = ReturnType<typeof createColumnDndStyles>;
|
|
14
|
+
/** The drag style of the column, as its header cell has it. */
|
|
15
|
+
export declare const useColumnDndStyle: (columnId: string) => CSSProperties;
|