@jetbrains/ring-ui-built 8.0.0-beta.4 → 8.0.0-beta.5
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/components/_helpers/alert.js +3 -0
- package/components/_helpers/caption.js +1 -1
- package/components/_helpers/header.js +1 -1
- package/components/_helpers/table.js +1 -1
- package/components/alert/alert-actions.d.ts +4 -0
- package/components/alert/alert-actions.js +51 -0
- package/components/alert/alert-heading.d.ts +4 -0
- package/components/alert/alert-heading.js +62 -0
- package/components/alert/alert.d.ts +14 -1
- package/components/alert/alert.js +43 -25
- package/components/alert-service/alert-service.d.ts +2 -1
- package/components/alert-service/alert-service.js +15 -5
- package/components/auth/auth-core.d.ts +5 -9
- package/components/auth/auth-core.js +71 -17
- package/components/auth/auth.js +7 -1
- package/components/auth/down-notification.js +7 -1
- package/components/auth/storage.js +7 -1
- package/components/clipboard/clipboard.js +7 -1
- package/components/date-picker/consts.d.ts +1 -0
- package/components/date-picker/date-input.js +3 -2
- package/components/header/header.js +7 -1
- package/components/header/smart-profile.js +7 -1
- package/components/http/http.d.ts +2 -2
- package/components/http/http.js +2 -2
- package/components/i18n/i18n.d.ts +1 -0
- package/components/i18n/i18n.js +2 -0
- package/components/internal/reorder-animation-context.js +159 -0
- package/components/internal/reorder-handle.js +750 -0
- package/components/internal/reorder-layout-context.js +141 -0
- package/components/internal/table-header.js +221 -645
- package/components/internal/{virtual-items.js → virtualization.js} +29 -14
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/storage/storage-local.js +7 -1
- package/components/storage/storage.js +7 -1
- package/components/style.css +1 -1
- package/components/table/default-item-renderer.d.ts +7 -1
- package/components/table/default-item-renderer.js +119 -67
- package/components/table/internal/reorder-animation-context.d.ts +21 -0
- package/components/table/internal/reorder-handle.d.ts +9 -0
- package/components/table/internal/reorder-layout-context.d.ts +16 -0
- package/components/table/internal/table-header.d.ts +1 -4
- package/components/table/internal/{virtual-items.d.ts → virtualization.d.ts} +10 -3
- package/components/table/item-virtualization.d.ts +5 -3
- package/components/table/item-virtualization.js +13 -11
- package/components/table/reorder-animation.d.ts +37 -0
- package/components/table/reorder-animation.js +18 -0
- package/components/table/reorder-item-layout.d.ts +32 -0
- package/components/table/reorder-item-layout.js +57 -0
- package/components/table/table-const.d.ts +0 -32
- package/components/table/table-const.js +1 -8
- package/components/table/table-primitives.d.ts +43 -0
- package/components/table/table-primitives.js +62 -5
- package/components/table/table-props.d.ts +29 -5
- package/components/table/table.d.ts +31 -5
- package/components/table/table.js +177 -170
- package/components/user-agreement/service.js +7 -1
- package/components/user-card/card.js +7 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +7 -1
- package/components/user-card/tooltip.js +7 -1
- package/components/user-card/user-card.js +7 -1
- package/components/util-stories.d.ts +2 -2
- package/package.json +2 -2
- package/components/internal/column-animation.js +0 -133
- package/components/table/internal/column-animation.d.ts +0 -16
|
@@ -3,34 +3,36 @@ import { use, useState, useRef } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import arrowDownIcon from '@jetbrains/icons/arrow-12px-down';
|
|
5
5
|
import arrowUpIcon from '@jetbrains/icons/arrow-12px-up';
|
|
6
|
-
import dragIcon from '@jetbrains/icons/drag-12px';
|
|
7
6
|
import settingsIcon from '@jetbrains/icons/settings-12px';
|
|
8
7
|
import trashIcon from '@jetbrains/icons/trash-12px';
|
|
9
8
|
import sortableIcon from '@jetbrains/icons/unsorted-12px';
|
|
10
|
-
import { TablePropsContext
|
|
9
|
+
import { TablePropsContext } from '../table/table-const.js';
|
|
11
10
|
import Icon from '../icon/icon.js';
|
|
12
|
-
import { useComposedRef } from '../global/compose-refs.js';
|
|
13
11
|
import { isWithinInteractiveElement } from '../global/is-within-interactive-element.js';
|
|
14
|
-
import {
|
|
12
|
+
import { ReorderHandle } from './reorder-handle.js';
|
|
13
|
+
import { ReorderAnimationContext } from './reorder-animation-context.js';
|
|
14
|
+
import { useReorderLayoutContextValue, ReorderLayoutContext } from './reorder-layout-context.js';
|
|
15
|
+
import { useReorderItemLayout } from '../table/reorder-item-layout.js';
|
|
15
16
|
import { s as styles } from '../_helpers/table.js';
|
|
16
17
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
18
|
import 'util-deprecate';
|
|
18
19
|
import '../icon/icon.constants.js';
|
|
19
20
|
import '../_helpers/icon-svg.js';
|
|
20
21
|
import '../global/memoize.js';
|
|
22
|
+
import '@jetbrains/icons/drag-12px';
|
|
23
|
+
import '../global/compose-refs.js';
|
|
21
24
|
import 'memoize-one';
|
|
25
|
+
import '../global/parse-css-duration.js';
|
|
26
|
+
import '../global/schedule-with-cleanup.js';
|
|
22
27
|
|
|
23
|
-
function TableHeader(
|
|
24
|
-
const $ = c(
|
|
25
|
-
if ($[0] !== "
|
|
26
|
-
for (let $i = 0; $i <
|
|
28
|
+
function TableHeader() {
|
|
29
|
+
const $ = c(30);
|
|
30
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
31
|
+
for (let $i = 0; $i < 30; $i += 1) {
|
|
27
32
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
28
33
|
}
|
|
29
|
-
$[0] = "
|
|
34
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
30
35
|
}
|
|
31
|
-
const {
|
|
32
|
-
expectColumnReorder
|
|
33
|
-
} = t0;
|
|
34
36
|
const {
|
|
35
37
|
columns,
|
|
36
38
|
noHeader,
|
|
@@ -42,9 +44,9 @@ function TableHeader(t0) {
|
|
|
42
44
|
} = use(TablePropsContext);
|
|
43
45
|
const [localColumnEditing, setLocalColumnEditing] = useState(false);
|
|
44
46
|
const effectiveColumnEditing = columnEditing !== null && columnEditing !== void 0 ? columnEditing : localColumnEditing;
|
|
45
|
-
let
|
|
47
|
+
let t0;
|
|
46
48
|
if ($[1] !== columnEditing || $[2] !== localColumnEditing || $[3] !== onColumnEditingRequest) {
|
|
47
|
-
|
|
49
|
+
t0 = source => {
|
|
48
50
|
let newColumnEditing;
|
|
49
51
|
if (columnEditing == null) {
|
|
50
52
|
newColumnEditing = !localColumnEditing;
|
|
@@ -57,118 +59,128 @@ function TableHeader(t0) {
|
|
|
57
59
|
$[1] = columnEditing;
|
|
58
60
|
$[2] = localColumnEditing;
|
|
59
61
|
$[3] = onColumnEditingRequest;
|
|
60
|
-
$[4] =
|
|
62
|
+
$[4] = t0;
|
|
61
63
|
} else {
|
|
62
|
-
|
|
64
|
+
t0 = $[4];
|
|
63
65
|
}
|
|
64
|
-
const toggleColumnEditing =
|
|
65
|
-
let
|
|
66
|
+
const toggleColumnEditing = t0;
|
|
67
|
+
let t1;
|
|
66
68
|
if ($[5] !== toggleColumnEditing) {
|
|
67
|
-
|
|
69
|
+
t1 = e => {
|
|
68
70
|
if (window.matchMedia("(hover: none)").matches && !isWithinInteractiveElement(e.target)) {
|
|
69
71
|
toggleColumnEditing("header");
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
74
|
$[5] = toggleColumnEditing;
|
|
73
|
-
$[6] =
|
|
75
|
+
$[6] = t1;
|
|
74
76
|
} else {
|
|
75
|
-
|
|
77
|
+
t1 = $[6];
|
|
76
78
|
}
|
|
77
|
-
const handleTheadClick =
|
|
78
|
-
let
|
|
79
|
+
const handleTheadClick = t1;
|
|
80
|
+
let t2;
|
|
79
81
|
if ($[7] !== toggleColumnEditing) {
|
|
80
|
-
|
|
82
|
+
t2 = () => {
|
|
81
83
|
toggleColumnEditing("edit-button");
|
|
82
84
|
};
|
|
83
85
|
$[7] = toggleColumnEditing;
|
|
84
|
-
$[8] =
|
|
86
|
+
$[8] = t2;
|
|
85
87
|
} else {
|
|
86
|
-
|
|
88
|
+
t2 = $[8];
|
|
87
89
|
}
|
|
88
|
-
const handleEditColumnsButtonClick =
|
|
90
|
+
const handleEditColumnsButtonClick = t2;
|
|
91
|
+
const reorderContextValue = useReorderLayoutContextValue();
|
|
89
92
|
if (noHeader) {
|
|
90
93
|
return null;
|
|
91
94
|
}
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
let
|
|
95
|
-
if ($[9] !==
|
|
96
|
-
|
|
97
|
-
$[9] =
|
|
98
|
-
$[10] =
|
|
95
|
+
const t3 = effectiveColumnEditing && styles.theadColumnEditing;
|
|
96
|
+
const t4 = stickyHeader && styles.stickyHeader;
|
|
97
|
+
let t5;
|
|
98
|
+
if ($[9] !== t3 || $[10] !== t4 || $[11] !== theadClassName) {
|
|
99
|
+
t5 = classNames(theadClassName, t3, t4);
|
|
100
|
+
$[9] = t3;
|
|
101
|
+
$[10] = t4;
|
|
99
102
|
$[11] = theadClassName;
|
|
100
|
-
$[12] =
|
|
103
|
+
$[12] = t5;
|
|
101
104
|
} else {
|
|
102
|
-
|
|
105
|
+
t5 = $[12];
|
|
103
106
|
}
|
|
104
|
-
let
|
|
105
|
-
if ($[13] !== columns || $[14] !== effectiveColumnEditing || $[15] !==
|
|
106
|
-
let
|
|
107
|
-
if ($[
|
|
108
|
-
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[13] !== columns || $[14] !== effectiveColumnEditing || $[15] !== handleEditColumnsButtonClick) {
|
|
109
|
+
let t7;
|
|
110
|
+
if ($[17] !== effectiveColumnEditing || $[18] !== handleEditColumnsButtonClick) {
|
|
111
|
+
t7 = (column, columnIndex) => /*#__PURE__*/jsx(TableHeaderCell, {
|
|
109
112
|
columnIndex: columnIndex,
|
|
110
113
|
columnEditing: effectiveColumnEditing,
|
|
111
|
-
handleEditColumnsButtonClick: handleEditColumnsButtonClick
|
|
112
|
-
expectColumnReorder: expectColumnReorder
|
|
114
|
+
handleEditColumnsButtonClick: handleEditColumnsButtonClick
|
|
113
115
|
}, column.key);
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[21] = t8;
|
|
116
|
+
$[17] = effectiveColumnEditing;
|
|
117
|
+
$[18] = handleEditColumnsButtonClick;
|
|
118
|
+
$[19] = t7;
|
|
118
119
|
} else {
|
|
119
|
-
|
|
120
|
+
t7 = $[19];
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
+
t6 = columns.map(t7);
|
|
122
123
|
$[13] = columns;
|
|
123
124
|
$[14] = effectiveColumnEditing;
|
|
124
|
-
$[15] =
|
|
125
|
-
$[16] =
|
|
126
|
-
$[17] = t7;
|
|
125
|
+
$[15] = handleEditColumnsButtonClick;
|
|
126
|
+
$[16] = t6;
|
|
127
127
|
} else {
|
|
128
|
-
|
|
128
|
+
t6 = $[16];
|
|
129
|
+
}
|
|
130
|
+
let t7;
|
|
131
|
+
if ($[20] !== reorderContextValue || $[21] !== t6) {
|
|
132
|
+
t7 = /*#__PURE__*/jsx(ReorderLayoutContext, {
|
|
133
|
+
value: reorderContextValue,
|
|
134
|
+
children: t6
|
|
135
|
+
});
|
|
136
|
+
$[20] = reorderContextValue;
|
|
137
|
+
$[21] = t6;
|
|
138
|
+
$[22] = t7;
|
|
139
|
+
} else {
|
|
140
|
+
t7 = $[22];
|
|
129
141
|
}
|
|
130
142
|
let t8;
|
|
131
|
-
if ($[
|
|
143
|
+
if ($[23] !== t7 || $[24] !== theadTrClassName) {
|
|
132
144
|
t8 = /*#__PURE__*/jsx("tr", {
|
|
133
145
|
className: theadTrClassName,
|
|
134
146
|
children: t7
|
|
135
147
|
});
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
148
|
+
$[23] = t7;
|
|
149
|
+
$[24] = theadTrClassName;
|
|
150
|
+
$[25] = t8;
|
|
139
151
|
} else {
|
|
140
|
-
t8 = $[
|
|
152
|
+
t8 = $[25];
|
|
141
153
|
}
|
|
142
154
|
let t9;
|
|
143
|
-
if ($[
|
|
155
|
+
if ($[26] !== handleTheadClick || $[27] !== t5 || $[28] !== t8) {
|
|
144
156
|
t9 = /*#__PURE__*/jsx("thead", {
|
|
145
|
-
className:
|
|
157
|
+
className: t5,
|
|
146
158
|
onClick: handleTheadClick,
|
|
147
159
|
children: t8
|
|
148
160
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
161
|
+
$[26] = handleTheadClick;
|
|
162
|
+
$[27] = t5;
|
|
163
|
+
$[28] = t8;
|
|
164
|
+
$[29] = t9;
|
|
153
165
|
} else {
|
|
154
|
-
t9 = $[
|
|
166
|
+
t9 = $[29];
|
|
155
167
|
}
|
|
156
168
|
return t9;
|
|
157
169
|
}
|
|
158
170
|
function TableHeaderCell(t0) {
|
|
159
|
-
const $ = c(
|
|
160
|
-
if ($[0] !== "
|
|
161
|
-
for (let $i = 0; $i <
|
|
171
|
+
const $ = c(43);
|
|
172
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
173
|
+
for (let $i = 0; $i < 43; $i += 1) {
|
|
162
174
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
163
175
|
}
|
|
164
|
-
$[0] = "
|
|
176
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
165
177
|
}
|
|
166
178
|
const {
|
|
167
179
|
columnIndex,
|
|
168
180
|
columnEditing,
|
|
169
|
-
handleEditColumnsButtonClick
|
|
170
|
-
expectColumnReorder
|
|
181
|
+
handleEditColumnsButtonClick
|
|
171
182
|
} = t0;
|
|
183
|
+
const ref = useRef(null);
|
|
172
184
|
const {
|
|
173
185
|
columns,
|
|
174
186
|
columnEditButton
|
|
@@ -182,7 +194,9 @@ function TableHeaderCell(t0) {
|
|
|
182
194
|
canReorder,
|
|
183
195
|
thClassName
|
|
184
196
|
} = columns[columnIndex];
|
|
185
|
-
const
|
|
197
|
+
const {
|
|
198
|
+
reorderAnimation
|
|
199
|
+
} = use(ReorderAnimationContext);
|
|
186
200
|
let t1;
|
|
187
201
|
if ($[1] !== key || $[2] !== name || $[3] !== renderHeader) {
|
|
188
202
|
t1 = renderHeader ? renderHeader() : name !== null && name !== void 0 ? name : String(key);
|
|
@@ -194,138 +208,163 @@ function TableHeaderCell(t0) {
|
|
|
194
208
|
t1 = $[4];
|
|
195
209
|
}
|
|
196
210
|
const children = t1;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
211
|
+
let t2;
|
|
212
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
213
|
+
t2 = () => {
|
|
214
|
+
var _r$left, _r$right;
|
|
215
|
+
const r = ref.current?.getBoundingClientRect();
|
|
216
|
+
return {
|
|
217
|
+
start: (_r$left = r?.left) !== null && _r$left !== void 0 ? _r$left : 0,
|
|
218
|
+
end: (_r$right = r?.right) !== null && _r$right !== void 0 ? _r$right : 0
|
|
219
|
+
};
|
|
220
|
+
};
|
|
201
221
|
$[5] = t2;
|
|
202
|
-
|
|
222
|
+
} else {
|
|
223
|
+
t2 = $[5];
|
|
224
|
+
}
|
|
225
|
+
let t3;
|
|
226
|
+
if ($[6] !== columnIndex) {
|
|
227
|
+
t3 = {
|
|
228
|
+
index: columnIndex,
|
|
229
|
+
getBounds: t2
|
|
230
|
+
};
|
|
231
|
+
$[6] = columnIndex;
|
|
203
232
|
$[7] = t3;
|
|
204
233
|
} else {
|
|
205
234
|
t3 = $[7];
|
|
206
235
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
236
|
+
useReorderItemLayout(t3);
|
|
237
|
+
const t4 = reorderAnimation?.direction === "columns" && reorderAnimation.index === columnIndex && reorderAnimation.className;
|
|
238
|
+
let t5;
|
|
239
|
+
if ($[8] !== t4 || $[9] !== thClassName) {
|
|
240
|
+
t5 = classNames(styles.headerCell, t4, thClassName);
|
|
241
|
+
$[8] = t4;
|
|
242
|
+
$[9] = thClassName;
|
|
243
|
+
$[10] = t5;
|
|
244
|
+
} else {
|
|
245
|
+
t5 = $[10];
|
|
246
|
+
}
|
|
247
|
+
let t6;
|
|
248
|
+
if ($[11] !== canReorder || $[12] !== columnIndex) {
|
|
249
|
+
t6 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandle, {
|
|
250
|
+
columnIndex: columnIndex
|
|
212
251
|
});
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[11] = t4;
|
|
252
|
+
$[11] = canReorder;
|
|
253
|
+
$[12] = columnIndex;
|
|
254
|
+
$[13] = t6;
|
|
217
255
|
} else {
|
|
218
|
-
|
|
256
|
+
t6 = $[13];
|
|
219
257
|
}
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
258
|
+
let t7;
|
|
259
|
+
if ($[14] !== children || $[15] !== columnIndex || $[16] !== sortOrder) {
|
|
260
|
+
t7 = sortOrder ? /*#__PURE__*/jsx(SortButton, {
|
|
223
261
|
columnIndex: columnIndex,
|
|
224
262
|
"aria-description": `Sort order: ${sortOrder}`,
|
|
225
263
|
children: children
|
|
226
264
|
}) : children;
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
265
|
+
$[14] = children;
|
|
266
|
+
$[15] = columnIndex;
|
|
267
|
+
$[16] = sortOrder;
|
|
268
|
+
$[17] = t7;
|
|
231
269
|
} else {
|
|
232
|
-
|
|
270
|
+
t7 = $[17];
|
|
233
271
|
}
|
|
234
|
-
let
|
|
235
|
-
if ($[
|
|
236
|
-
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
272
|
+
let t8;
|
|
273
|
+
if ($[18] !== canReorder) {
|
|
274
|
+
t8 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandleMirror, {});
|
|
275
|
+
$[18] = canReorder;
|
|
276
|
+
$[19] = t8;
|
|
239
277
|
} else {
|
|
240
|
-
|
|
278
|
+
t8 = $[19];
|
|
241
279
|
}
|
|
242
|
-
let
|
|
243
|
-
if ($[
|
|
244
|
-
|
|
280
|
+
let t9;
|
|
281
|
+
if ($[20] !== t6 || $[21] !== t7 || $[22] !== t8) {
|
|
282
|
+
t9 = /*#__PURE__*/jsxs("div", {
|
|
245
283
|
className: styles.sortAndHeader,
|
|
246
|
-
children: [
|
|
284
|
+
children: [t6, t7, t8]
|
|
247
285
|
});
|
|
248
|
-
$[18] = t4;
|
|
249
|
-
$[19] = t5;
|
|
250
286
|
$[20] = t6;
|
|
251
287
|
$[21] = t7;
|
|
288
|
+
$[22] = t8;
|
|
289
|
+
$[23] = t9;
|
|
252
290
|
} else {
|
|
253
|
-
|
|
291
|
+
t9 = $[23];
|
|
254
292
|
}
|
|
255
|
-
let
|
|
256
|
-
if ($[
|
|
257
|
-
|
|
293
|
+
let t10;
|
|
294
|
+
if ($[24] !== columnIndex || $[25] !== deletable) {
|
|
295
|
+
t10 = deletable && /*#__PURE__*/jsx(DeleteColumnButton, {
|
|
258
296
|
columnIndex: columnIndex
|
|
259
297
|
});
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
298
|
+
$[24] = columnIndex;
|
|
299
|
+
$[25] = deletable;
|
|
300
|
+
$[26] = t10;
|
|
263
301
|
} else {
|
|
264
|
-
|
|
302
|
+
t10 = $[26];
|
|
265
303
|
}
|
|
266
|
-
let
|
|
267
|
-
if ($[
|
|
268
|
-
|
|
304
|
+
let t11;
|
|
305
|
+
if ($[27] !== columnEditButton || $[28] !== columnEditing || $[29] !== columnIndex || $[30] !== columns.length || $[31] !== handleEditColumnsButtonClick) {
|
|
306
|
+
t11 = columnIndex === columns.length - 1 && columnEditButton && /*#__PURE__*/jsx(EditColumnsButton, {
|
|
269
307
|
columnEditing: columnEditing,
|
|
270
308
|
onClick: handleEditColumnsButtonClick
|
|
271
309
|
});
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
310
|
+
$[27] = columnEditButton;
|
|
311
|
+
$[28] = columnEditing;
|
|
312
|
+
$[29] = columnIndex;
|
|
313
|
+
$[30] = columns.length;
|
|
314
|
+
$[31] = handleEditColumnsButtonClick;
|
|
315
|
+
$[32] = t11;
|
|
278
316
|
} else {
|
|
279
|
-
|
|
317
|
+
t11 = $[32];
|
|
280
318
|
}
|
|
281
|
-
let
|
|
282
|
-
if ($[
|
|
283
|
-
|
|
319
|
+
let t12;
|
|
320
|
+
if ($[33] !== t10 || $[34] !== t11) {
|
|
321
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
284
322
|
className: styles.rightButtons,
|
|
285
|
-
children: [
|
|
323
|
+
children: [t10, t11]
|
|
286
324
|
});
|
|
287
|
-
$[31] = t8;
|
|
288
|
-
$[32] = t9;
|
|
289
325
|
$[33] = t10;
|
|
326
|
+
$[34] = t11;
|
|
327
|
+
$[35] = t12;
|
|
290
328
|
} else {
|
|
291
|
-
|
|
329
|
+
t12 = $[35];
|
|
292
330
|
}
|
|
293
|
-
let
|
|
294
|
-
if ($[
|
|
295
|
-
|
|
331
|
+
let t13;
|
|
332
|
+
if ($[36] !== t12 || $[37] !== t9) {
|
|
333
|
+
t13 = /*#__PURE__*/jsxs("div", {
|
|
296
334
|
className: styles.headerCellInnerWrapper,
|
|
297
|
-
children: [
|
|
335
|
+
children: [t9, t12]
|
|
298
336
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
337
|
+
$[36] = t12;
|
|
338
|
+
$[37] = t9;
|
|
339
|
+
$[38] = t13;
|
|
302
340
|
} else {
|
|
303
|
-
|
|
341
|
+
t13 = $[38];
|
|
304
342
|
}
|
|
305
|
-
let
|
|
306
|
-
if ($[
|
|
307
|
-
|
|
308
|
-
|
|
343
|
+
let t14;
|
|
344
|
+
if ($[39] !== sortOrder || $[40] !== t13 || $[41] !== t5) {
|
|
345
|
+
t14 = /*#__PURE__*/jsx("th", {
|
|
346
|
+
ref: ref,
|
|
347
|
+
className: t5,
|
|
309
348
|
scope: "col",
|
|
310
349
|
"aria-sort": sortOrder,
|
|
311
|
-
children:
|
|
350
|
+
children: t13
|
|
312
351
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
352
|
+
$[39] = sortOrder;
|
|
353
|
+
$[40] = t13;
|
|
354
|
+
$[41] = t5;
|
|
355
|
+
$[42] = t14;
|
|
317
356
|
} else {
|
|
318
|
-
|
|
357
|
+
t14 = $[42];
|
|
319
358
|
}
|
|
320
|
-
return
|
|
359
|
+
return t14;
|
|
321
360
|
}
|
|
322
361
|
function SortButton(t0) {
|
|
323
362
|
const $ = c(22);
|
|
324
|
-
if ($[0] !== "
|
|
363
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
325
364
|
for (let $i = 0; $i < 22; $i += 1) {
|
|
326
365
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
327
366
|
}
|
|
328
|
-
$[0] = "
|
|
367
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
329
368
|
}
|
|
330
369
|
let children;
|
|
331
370
|
let className;
|
|
@@ -380,7 +419,7 @@ function SortButton(t0) {
|
|
|
380
419
|
}
|
|
381
420
|
let t2;
|
|
382
421
|
if ($[12] !== className) {
|
|
383
|
-
t2 = classNames(styles.
|
|
422
|
+
t2 = classNames(styles.tableButton, className);
|
|
384
423
|
$[12] = className;
|
|
385
424
|
$[13] = t2;
|
|
386
425
|
} else {
|
|
@@ -420,11 +459,11 @@ function SortButton(t0) {
|
|
|
420
459
|
function DeleteColumnButton(t0) {
|
|
421
460
|
var _column$name;
|
|
422
461
|
const $ = c(18);
|
|
423
|
-
if ($[0] !== "
|
|
462
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
424
463
|
for (let $i = 0; $i < 18; $i += 1) {
|
|
425
464
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
426
465
|
}
|
|
427
|
-
$[0] = "
|
|
466
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
428
467
|
}
|
|
429
468
|
let className;
|
|
430
469
|
let columnIndex;
|
|
@@ -455,7 +494,8 @@ function DeleteColumnButton(t0) {
|
|
|
455
494
|
t1 = e => {
|
|
456
495
|
onClick?.(e);
|
|
457
496
|
if (!e.defaultPrevented) {
|
|
458
|
-
|
|
497
|
+
const columns = tableProps.columns;
|
|
498
|
+
tableProps.onColumnDelete?.(columns[columnIndex], columnIndex, columns);
|
|
459
499
|
}
|
|
460
500
|
};
|
|
461
501
|
$[6] = columnIndex;
|
|
@@ -472,7 +512,7 @@ function DeleteColumnButton(t0) {
|
|
|
472
512
|
const hint = `Delete column ${(_column$name = column.name) !== null && _column$name !== void 0 ? _column$name : String(column.key)}.`;
|
|
473
513
|
let t2;
|
|
474
514
|
if ($[10] !== className) {
|
|
475
|
-
t2 = classNames(styles.
|
|
515
|
+
t2 = classNames(styles.tableButton, styles.deleteColumnButton, className);
|
|
476
516
|
$[10] = className;
|
|
477
517
|
$[11] = t2;
|
|
478
518
|
} else {
|
|
@@ -511,11 +551,11 @@ function DeleteColumnButton(t0) {
|
|
|
511
551
|
}
|
|
512
552
|
function EditColumnsButton(t0) {
|
|
513
553
|
const $ = c(14);
|
|
514
|
-
if ($[0] !== "
|
|
554
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
515
555
|
for (let $i = 0; $i < 14; $i += 1) {
|
|
516
556
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
517
557
|
}
|
|
518
|
-
$[0] = "
|
|
558
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
519
559
|
}
|
|
520
560
|
let columnEditing;
|
|
521
561
|
let hint;
|
|
@@ -535,7 +575,7 @@ function EditColumnsButton(t0) {
|
|
|
535
575
|
restProps = t4;
|
|
536
576
|
hint = columnEditing ? "Hide column controls." : "Show column controls.";
|
|
537
577
|
t1 = "button";
|
|
538
|
-
t2 = classNames(styles.
|
|
578
|
+
t2 = classNames(styles.tableButton, styles.editColumnsButton, className);
|
|
539
579
|
$[1] = t0;
|
|
540
580
|
$[2] = columnEditing;
|
|
541
581
|
$[3] = hint;
|
|
@@ -582,516 +622,52 @@ function EditColumnsButton(t0) {
|
|
|
582
622
|
return t4;
|
|
583
623
|
}
|
|
584
624
|
function ColumnReorderHandle(t0) {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
for (let $i = 0; $i < 59; $i += 1) {
|
|
625
|
+
const $ = c(7);
|
|
626
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
627
|
+
for (let $i = 0; $i < 7; $i += 1) {
|
|
589
628
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
590
629
|
}
|
|
591
|
-
$[0] = "
|
|
630
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
592
631
|
}
|
|
593
|
-
let className;
|
|
594
632
|
let columnIndex;
|
|
595
|
-
let expectColumnReorder;
|
|
596
|
-
let onKeyDown;
|
|
597
|
-
let onLostPointerCapture;
|
|
598
|
-
let onPointerCancel;
|
|
599
|
-
let onPointerDown;
|
|
600
|
-
let onPointerMove;
|
|
601
|
-
let onPointerUp;
|
|
602
633
|
let restProps;
|
|
603
|
-
let userRef;
|
|
604
634
|
if ($[1] !== t0) {
|
|
605
635
|
({
|
|
606
636
|
columnIndex,
|
|
607
|
-
expectColumnReorder,
|
|
608
|
-
ref: userRef,
|
|
609
|
-
className,
|
|
610
|
-
onPointerDown,
|
|
611
|
-
onPointerMove,
|
|
612
|
-
onPointerUp,
|
|
613
|
-
onPointerCancel,
|
|
614
|
-
onLostPointerCapture,
|
|
615
|
-
onKeyDown,
|
|
616
637
|
...restProps
|
|
617
638
|
} = t0);
|
|
618
639
|
$[1] = t0;
|
|
619
|
-
$[2] =
|
|
620
|
-
$[3] =
|
|
621
|
-
$[4] = expectColumnReorder;
|
|
622
|
-
$[5] = onKeyDown;
|
|
623
|
-
$[6] = onLostPointerCapture;
|
|
624
|
-
$[7] = onPointerCancel;
|
|
625
|
-
$[8] = onPointerDown;
|
|
626
|
-
$[9] = onPointerMove;
|
|
627
|
-
$[10] = onPointerUp;
|
|
628
|
-
$[11] = restProps;
|
|
629
|
-
$[12] = userRef;
|
|
640
|
+
$[2] = columnIndex;
|
|
641
|
+
$[3] = restProps;
|
|
630
642
|
} else {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
expectColumnReorder = $[4];
|
|
634
|
-
onKeyDown = $[5];
|
|
635
|
-
onLostPointerCapture = $[6];
|
|
636
|
-
onPointerCancel = $[7];
|
|
637
|
-
onPointerDown = $[8];
|
|
638
|
-
onPointerMove = $[9];
|
|
639
|
-
onPointerUp = $[10];
|
|
640
|
-
restProps = $[11];
|
|
641
|
-
userRef = $[12];
|
|
643
|
+
columnIndex = $[2];
|
|
644
|
+
restProps = $[3];
|
|
642
645
|
}
|
|
643
|
-
const tableProps = use(TablePropsContext);
|
|
644
|
-
const column = tableProps?.columns[columnIndex];
|
|
645
|
-
const canReorder = column?.canReorder;
|
|
646
646
|
let t1;
|
|
647
|
-
if ($[
|
|
648
|
-
t1 =
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
} else {
|
|
653
|
-
t1 = $[15];
|
|
654
|
-
}
|
|
655
|
-
const canReorderCb = t1;
|
|
656
|
-
const localRef = useRef(null);
|
|
657
|
-
const composedRef = useComposedRef(localRef, userRef);
|
|
658
|
-
const activeDragRef = useRef(null);
|
|
659
|
-
const getDragFrame = _temp;
|
|
660
|
-
let t2;
|
|
661
|
-
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
662
|
-
t2 = clientX => {
|
|
663
|
-
const {
|
|
664
|
-
startColumnIndex,
|
|
665
|
-
startClientX,
|
|
666
|
-
headerTopClientY,
|
|
667
|
-
columnsClientX,
|
|
668
|
-
indicatorHeight
|
|
669
|
-
} = activeDragRef.current;
|
|
670
|
-
const {
|
|
671
|
-
l,
|
|
672
|
-
r
|
|
673
|
-
} = columnsClientX[startColumnIndex];
|
|
674
|
-
let dragFrame = getDragFrame();
|
|
675
|
-
if (!dragFrame) {
|
|
676
|
-
dragFrame = document.createElement("div");
|
|
677
|
-
dragFrame.className = styles.columnDragFrame;
|
|
678
|
-
dragFrame.style.setProperty("top", `calc(max(0px, ${headerTopClientY - 2}px))`);
|
|
679
|
-
dragFrame.style.setProperty("width", `${r - l}px`);
|
|
680
|
-
dragFrame.style.setProperty("height", indicatorHeight);
|
|
681
|
-
document.body.appendChild(dragFrame);
|
|
682
|
-
}
|
|
683
|
-
dragFrame.style.setProperty("left", `${l + clientX - startClientX}px`);
|
|
684
|
-
};
|
|
685
|
-
$[16] = t2;
|
|
686
|
-
} else {
|
|
687
|
-
t2 = $[16];
|
|
688
|
-
}
|
|
689
|
-
const renderDragFrame = t2;
|
|
690
|
-
let t3;
|
|
691
|
-
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
692
|
-
t3 = clientX_0 => {
|
|
693
|
-
if (!localRef.current || !activeDragRef.current) {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
const {
|
|
697
|
-
startClientX: startClientX_0
|
|
698
|
-
} = activeDragRef.current;
|
|
699
|
-
localRef.current.style.setProperty("transform", `translateX(${clientX_0 - startClientX_0}px)`);
|
|
700
|
-
};
|
|
701
|
-
$[17] = t3;
|
|
702
|
-
} else {
|
|
703
|
-
t3 = $[17];
|
|
704
|
-
}
|
|
705
|
-
const translateXButton = t3;
|
|
706
|
-
let t4;
|
|
707
|
-
if ($[18] !== canReorderCb) {
|
|
708
|
-
t4 = clientX_1 => {
|
|
709
|
-
let bestDistance = Infinity;
|
|
710
|
-
let index_0 = -1;
|
|
711
|
-
let after = false;
|
|
712
|
-
activeDragRef.current?.columnsClientX.forEach((t5, i) => {
|
|
713
|
-
const {
|
|
714
|
-
l: l_0,
|
|
715
|
-
r: r_0
|
|
716
|
-
} = t5;
|
|
717
|
-
const distanceToLeft = Math.abs(l_0 - clientX_1);
|
|
718
|
-
const distanceToRight = Math.abs(r_0 - clientX_1);
|
|
719
|
-
if (distanceToLeft < bestDistance && canReorderCb(i)) {
|
|
720
|
-
bestDistance = distanceToLeft;
|
|
721
|
-
index_0 = i;
|
|
722
|
-
after = false;
|
|
723
|
-
}
|
|
724
|
-
if (distanceToRight < bestDistance && canReorderCb(i + 1)) {
|
|
725
|
-
bestDistance = distanceToRight;
|
|
726
|
-
index_0 = i;
|
|
727
|
-
after = true;
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
return {
|
|
731
|
-
index: index_0,
|
|
732
|
-
after
|
|
733
|
-
};
|
|
734
|
-
};
|
|
735
|
-
$[18] = canReorderCb;
|
|
736
|
-
$[19] = t4;
|
|
737
|
-
} else {
|
|
738
|
-
t4 = $[19];
|
|
739
|
-
}
|
|
740
|
-
const getClosestInsertionPoint = t4;
|
|
741
|
-
const getInsertionIndicator = _temp2;
|
|
742
|
-
let t5;
|
|
743
|
-
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
744
|
-
t5 = insertionPoint => {
|
|
745
|
-
const {
|
|
746
|
-
index: index_1,
|
|
747
|
-
after: after_0
|
|
748
|
-
} = insertionPoint;
|
|
749
|
-
const {
|
|
750
|
-
headerTopClientY: headerTopClientY_0,
|
|
751
|
-
columnsClientX: columnsClientX_0,
|
|
752
|
-
indicatorHeight: indicatorHeight_0
|
|
753
|
-
} = activeDragRef.current;
|
|
754
|
-
const {
|
|
755
|
-
l: l_1,
|
|
756
|
-
r: r_1
|
|
757
|
-
} = columnsClientX_0[index_1];
|
|
758
|
-
let indicator = getInsertionIndicator();
|
|
759
|
-
if (!indicator) {
|
|
760
|
-
indicator = document.createElement("div");
|
|
761
|
-
indicator.className = styles.columnInsertionIndicator;
|
|
762
|
-
indicator.style.setProperty("top", `${headerTopClientY_0}px`);
|
|
763
|
-
indicator.style.setProperty("height", indicatorHeight_0);
|
|
764
|
-
document.body.appendChild(indicator);
|
|
765
|
-
}
|
|
766
|
-
indicator.style.setProperty("left", `${(after_0 ? r_1 : l_1) - 1}px`);
|
|
767
|
-
};
|
|
768
|
-
$[20] = t5;
|
|
769
|
-
} else {
|
|
770
|
-
t5 = $[20];
|
|
771
|
-
}
|
|
772
|
-
const renderInsertionIndicator = t5;
|
|
773
|
-
let t6;
|
|
774
|
-
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
775
|
-
t6 = () => {
|
|
776
|
-
if (activeDragRef.current) {
|
|
777
|
-
activeDragRef.current.cleanup();
|
|
778
|
-
activeDragRef.current = null;
|
|
779
|
-
}
|
|
780
|
-
const btn = localRef.current;
|
|
781
|
-
if (btn) {
|
|
782
|
-
btn.style.removeProperty("transform");
|
|
783
|
-
btn.style.removeProperty("transition");
|
|
784
|
-
}
|
|
785
|
-
getDragFrame()?.remove();
|
|
786
|
-
getInsertionIndicator()?.remove();
|
|
787
|
-
};
|
|
788
|
-
$[21] = t6;
|
|
789
|
-
} else {
|
|
790
|
-
t6 = $[21];
|
|
791
|
-
}
|
|
792
|
-
const cleanupDrag = t6;
|
|
793
|
-
let t7;
|
|
794
|
-
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
795
|
-
t7 = () => {
|
|
796
|
-
if (activeDragRef.current?.state === "is-dragging") {
|
|
797
|
-
activeDragRef.current.state = "ended-with-no-change";
|
|
798
|
-
activeDragRef.current.cleanup();
|
|
799
|
-
activeDragRef.current.cleanup = _temp3;
|
|
800
|
-
const dragFrame_0 = getDragFrame();
|
|
801
|
-
if (dragFrame_0) {
|
|
802
|
-
const {
|
|
803
|
-
columnsClientX: columnsClientX_1,
|
|
804
|
-
startColumnIndex: startColumnIndex_0
|
|
805
|
-
} = activeDragRef.current;
|
|
806
|
-
dragFrame_0.style.left = `${columnsClientX_1[startColumnIndex_0].l}px`;
|
|
807
|
-
dragFrame_0.style.opacity = "0";
|
|
808
|
-
dragFrame_0.style.transition = "left var(--ring-ease), opacity var(--ring-ease)";
|
|
809
|
-
}
|
|
810
|
-
const indicator_0 = getInsertionIndicator();
|
|
811
|
-
if (indicator_0) {
|
|
812
|
-
indicator_0.style.opacity = "0";
|
|
813
|
-
indicator_0.style.transition = "opacity var(--ring-ease)";
|
|
814
|
-
}
|
|
815
|
-
const btn_0 = localRef.current;
|
|
816
|
-
if (btn_0) {
|
|
817
|
-
btn_0.style.transform = "translateX(0)";
|
|
818
|
-
btn_0.style.transition = "transform var(--ring-ease)";
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
const ringEaseMs = parseCssDuration(window.getComputedStyle(document.documentElement).getPropertyValue("--ring-ease"));
|
|
822
|
-
setTimeout(cleanupDrag, ringEaseMs);
|
|
823
|
-
};
|
|
824
|
-
$[22] = t7;
|
|
825
|
-
} else {
|
|
826
|
-
t7 = $[22];
|
|
827
|
-
}
|
|
828
|
-
const animateNoChangeThenCleanup = t7;
|
|
829
|
-
let t8;
|
|
830
|
-
if ($[23] !== columnIndex || $[24] !== onPointerDown) {
|
|
831
|
-
t8 = e => {
|
|
832
|
-
onPointerDown?.(e);
|
|
833
|
-
if (e.defaultPrevented) {
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
836
|
-
const {
|
|
837
|
-
clientX: startClientX_1,
|
|
838
|
-
pointerId,
|
|
839
|
-
currentTarget
|
|
840
|
-
} = e;
|
|
841
|
-
const thead = currentTarget.closest("thead");
|
|
842
|
-
const table = thead?.closest("table");
|
|
843
|
-
if (!thead || !table) {
|
|
844
|
-
return;
|
|
845
|
-
}
|
|
846
|
-
const headerTopClientY_1 = thead.getBoundingClientRect().top;
|
|
847
|
-
const columnsClientX_2 = [...thead.querySelectorAll("th")].map(_temp4);
|
|
848
|
-
const {
|
|
849
|
-
bottom
|
|
850
|
-
} = table.getBoundingClientRect();
|
|
851
|
-
const visibleTableHeight = bottom - headerTopClientY_1;
|
|
852
|
-
const viewportBottomRelativeToHeaderTop = window.innerHeight - headerTopClientY_1;
|
|
853
|
-
const indicatorHeight_1 = `min(${visibleTableHeight}px, calc(${viewportBottomRelativeToHeaderTop}px - .5rem))`;
|
|
854
|
-
currentTarget.setPointerCapture(pointerId);
|
|
855
|
-
const keydownListener = function keydownListener(keyEvent) {
|
|
856
|
-
if (keyEvent.key === "Escape") {
|
|
857
|
-
animateNoChangeThenCleanup();
|
|
858
|
-
keyEvent.stopPropagation();
|
|
859
|
-
keyEvent.preventDefault();
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
document.addEventListener("keydown", keydownListener);
|
|
863
|
-
currentTarget.style.cursor = "grabbing";
|
|
864
|
-
activeDragRef.current = {
|
|
865
|
-
state: "is-dragging",
|
|
866
|
-
startColumnIndex: columnIndex,
|
|
867
|
-
startClientX: startClientX_1,
|
|
868
|
-
headerTopClientY: headerTopClientY_1,
|
|
869
|
-
columnsClientX: columnsClientX_2,
|
|
870
|
-
indicatorHeight: indicatorHeight_1,
|
|
871
|
-
cleanup: () => {
|
|
872
|
-
document.removeEventListener("keydown", keydownListener);
|
|
873
|
-
currentTarget.releasePointerCapture(pointerId);
|
|
874
|
-
currentTarget.style.removeProperty("cursor");
|
|
875
|
-
}
|
|
876
|
-
};
|
|
877
|
-
renderDragFrame(startClientX_1);
|
|
878
|
-
e.preventDefault();
|
|
879
|
-
};
|
|
880
|
-
$[23] = columnIndex;
|
|
881
|
-
$[24] = onPointerDown;
|
|
882
|
-
$[25] = t8;
|
|
883
|
-
} else {
|
|
884
|
-
t8 = $[25];
|
|
885
|
-
}
|
|
886
|
-
const handlePointerDown = t8;
|
|
887
|
-
let t9;
|
|
888
|
-
if ($[26] !== getClosestInsertionPoint || $[27] !== onPointerMove) {
|
|
889
|
-
t9 = e_0 => {
|
|
890
|
-
onPointerMove?.(e_0);
|
|
891
|
-
if (e_0.defaultPrevented || activeDragRef.current?.state !== "is-dragging") {
|
|
892
|
-
return;
|
|
893
|
-
}
|
|
894
|
-
const {
|
|
895
|
-
clientX: clientX_2
|
|
896
|
-
} = e_0;
|
|
897
|
-
renderDragFrame(clientX_2);
|
|
898
|
-
translateXButton(clientX_2);
|
|
899
|
-
const insertionPoint_0 = getClosestInsertionPoint(clientX_2);
|
|
900
|
-
if (insertionPoint_0) {
|
|
901
|
-
renderInsertionIndicator(insertionPoint_0);
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
$[26] = getClosestInsertionPoint;
|
|
905
|
-
$[27] = onPointerMove;
|
|
906
|
-
$[28] = t9;
|
|
907
|
-
} else {
|
|
908
|
-
t9 = $[28];
|
|
909
|
-
}
|
|
910
|
-
const handlePointerMove = t9;
|
|
911
|
-
let t10;
|
|
912
|
-
if ($[29] !== columnIndex || $[30] !== expectColumnReorder || $[31] !== getClosestInsertionPoint || $[32] !== onPointerUp || $[33] !== tableProps) {
|
|
913
|
-
t10 = e_1 => {
|
|
914
|
-
onPointerUp?.(e_1);
|
|
915
|
-
if (e_1.defaultPrevented || activeDragRef.current?.state !== "is-dragging") {
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
const table_0 = e_1.currentTarget.closest("table");
|
|
919
|
-
if (!table_0) {
|
|
920
|
-
cleanupDrag();
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
const {
|
|
924
|
-
index: index_2,
|
|
925
|
-
after: after_1
|
|
926
|
-
} = getClosestInsertionPoint(e_1.clientX);
|
|
927
|
-
const insertionIndex = after_1 ? index_2 + 1 : index_2;
|
|
928
|
-
if (insertionIndex === columnIndex || insertionIndex === columnIndex + 1) {
|
|
929
|
-
animateNoChangeThenCleanup();
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
cleanupDrag();
|
|
933
|
-
expectColumnReorder({
|
|
934
|
-
fromIndex: columnIndex,
|
|
935
|
-
insertionIndex
|
|
936
|
-
});
|
|
937
|
-
tableProps.onColumnReorder?.(columnIndex, insertionIndex, tableProps.columns);
|
|
938
|
-
};
|
|
939
|
-
$[29] = columnIndex;
|
|
940
|
-
$[30] = expectColumnReorder;
|
|
941
|
-
$[31] = getClosestInsertionPoint;
|
|
942
|
-
$[32] = onPointerUp;
|
|
943
|
-
$[33] = tableProps;
|
|
944
|
-
$[34] = t10;
|
|
945
|
-
} else {
|
|
946
|
-
t10 = $[34];
|
|
947
|
-
}
|
|
948
|
-
const handlePointerUp = t10;
|
|
949
|
-
let t11;
|
|
950
|
-
if ($[35] !== onPointerCancel) {
|
|
951
|
-
t11 = e_2 => {
|
|
952
|
-
onPointerCancel?.(e_2);
|
|
953
|
-
if (e_2.defaultPrevented) {
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
animateNoChangeThenCleanup();
|
|
957
|
-
};
|
|
958
|
-
$[35] = onPointerCancel;
|
|
959
|
-
$[36] = t11;
|
|
960
|
-
} else {
|
|
961
|
-
t11 = $[36];
|
|
962
|
-
}
|
|
963
|
-
const handlePointerCancel = t11;
|
|
964
|
-
let t12;
|
|
965
|
-
if ($[37] !== onLostPointerCapture) {
|
|
966
|
-
t12 = e_3 => {
|
|
967
|
-
onLostPointerCapture?.(e_3);
|
|
968
|
-
if (e_3.defaultPrevented) {
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
animateNoChangeThenCleanup();
|
|
972
|
-
};
|
|
973
|
-
$[37] = onLostPointerCapture;
|
|
974
|
-
$[38] = t12;
|
|
975
|
-
} else {
|
|
976
|
-
t12 = $[38];
|
|
977
|
-
}
|
|
978
|
-
const handleLostPointerCapture = t12;
|
|
979
|
-
let t13;
|
|
980
|
-
if ($[39] !== canReorderCb || $[40] !== columnIndex || $[41] !== expectColumnReorder || $[42] !== onKeyDown || $[43] !== tableProps) {
|
|
981
|
-
t13 = e_4 => {
|
|
982
|
-
onKeyDown?.(e_4);
|
|
983
|
-
if (e_4.defaultPrevented || !tableProps) {
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
const left = e_4.key === "ArrowLeft";
|
|
987
|
-
const right = e_4.key === "ArrowRight";
|
|
988
|
-
if (!left && !right) {
|
|
989
|
-
return;
|
|
990
|
-
}
|
|
991
|
-
const initialInsertionIndex = left ? columnIndex - 1 : columnIndex + 2;
|
|
992
|
-
const step = left ? -1 : 1;
|
|
993
|
-
for (let i_0 = initialInsertionIndex; 0 <= i_0 && i_0 <= tableProps.columns.length; i_0 = i_0 + step, i_0) {
|
|
994
|
-
if (canReorderCb(i_0)) {
|
|
995
|
-
expectColumnReorder({
|
|
996
|
-
fromIndex: columnIndex,
|
|
997
|
-
insertionIndex: i_0
|
|
998
|
-
});
|
|
999
|
-
tableProps.onColumnReorder?.(columnIndex, i_0, tableProps.columns);
|
|
1000
|
-
e_4.preventDefault();
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
};
|
|
1005
|
-
$[39] = canReorderCb;
|
|
1006
|
-
$[40] = columnIndex;
|
|
1007
|
-
$[41] = expectColumnReorder;
|
|
1008
|
-
$[42] = onKeyDown;
|
|
1009
|
-
$[43] = tableProps;
|
|
1010
|
-
$[44] = t13;
|
|
1011
|
-
} else {
|
|
1012
|
-
t13 = $[44];
|
|
1013
|
-
}
|
|
1014
|
-
const handleKeyDown = t13;
|
|
1015
|
-
if (!tableProps || !column) {
|
|
1016
|
-
return null;
|
|
1017
|
-
}
|
|
1018
|
-
const hint = `Reorder column ${(_column$name2 = column.name) !== null && _column$name2 !== void 0 ? _column$name2 : String(column.key)}.`;
|
|
1019
|
-
let t14;
|
|
1020
|
-
if ($[45] !== className) {
|
|
1021
|
-
t14 = classNames(styles.headerButton, styles.columnReorderHandle, className);
|
|
1022
|
-
$[45] = className;
|
|
1023
|
-
$[46] = t14;
|
|
1024
|
-
} else {
|
|
1025
|
-
t14 = $[46];
|
|
1026
|
-
}
|
|
1027
|
-
let t15;
|
|
1028
|
-
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1029
|
-
t15 = /*#__PURE__*/jsx(Icon, {
|
|
1030
|
-
glyph: dragIcon,
|
|
1031
|
-
"aria-hidden": "true"
|
|
1032
|
-
});
|
|
1033
|
-
$[47] = t15;
|
|
1034
|
-
} else {
|
|
1035
|
-
t15 = $[47];
|
|
1036
|
-
}
|
|
1037
|
-
let t16;
|
|
1038
|
-
if ($[48] !== composedRef || $[49] !== handleKeyDown || $[50] !== handleLostPointerCapture || $[51] !== handlePointerCancel || $[52] !== handlePointerDown || $[53] !== handlePointerMove || $[54] !== handlePointerUp || $[55] !== hint || $[56] !== restProps || $[57] !== t14) {
|
|
1039
|
-
t16 = /*#__PURE__*/jsx("button", {
|
|
1040
|
-
ref: composedRef,
|
|
1041
|
-
type: "button",
|
|
1042
|
-
className: t14,
|
|
1043
|
-
"aria-label": hint,
|
|
1044
|
-
"aria-description": "Use Left and Right arrow keys to move the column.",
|
|
1045
|
-
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
1046
|
-
onKeyDown: handleKeyDown,
|
|
1047
|
-
onPointerDown: handlePointerDown,
|
|
1048
|
-
onPointerMove: handlePointerMove,
|
|
1049
|
-
onPointerUp: handlePointerUp,
|
|
1050
|
-
onPointerCancel: handlePointerCancel,
|
|
1051
|
-
onLostPointerCapture: handleLostPointerCapture,
|
|
1052
|
-
...restProps,
|
|
1053
|
-
children: t15
|
|
647
|
+
if ($[4] !== columnIndex || $[5] !== restProps) {
|
|
648
|
+
t1 = /*#__PURE__*/jsx(ReorderHandle, {
|
|
649
|
+
direction: "columns",
|
|
650
|
+
index: columnIndex,
|
|
651
|
+
...restProps
|
|
1054
652
|
});
|
|
1055
|
-
$[
|
|
1056
|
-
$[
|
|
1057
|
-
$[
|
|
1058
|
-
$[51] = handlePointerCancel;
|
|
1059
|
-
$[52] = handlePointerDown;
|
|
1060
|
-
$[53] = handlePointerMove;
|
|
1061
|
-
$[54] = handlePointerUp;
|
|
1062
|
-
$[55] = hint;
|
|
1063
|
-
$[56] = restProps;
|
|
1064
|
-
$[57] = t14;
|
|
1065
|
-
$[58] = t16;
|
|
653
|
+
$[4] = columnIndex;
|
|
654
|
+
$[5] = restProps;
|
|
655
|
+
$[6] = t1;
|
|
1066
656
|
} else {
|
|
1067
|
-
|
|
657
|
+
t1 = $[6];
|
|
1068
658
|
}
|
|
1069
|
-
return
|
|
659
|
+
return t1;
|
|
1070
660
|
}
|
|
1071
661
|
/**
|
|
1072
662
|
* Reserves the space for the reorder handle and prevents layout shift when the handle appears on hover.
|
|
1073
663
|
*/
|
|
1074
|
-
function _temp4(th) {
|
|
1075
|
-
const rect = th.getBoundingClientRect();
|
|
1076
|
-
return {
|
|
1077
|
-
l: rect.x,
|
|
1078
|
-
r: rect.x + rect.width
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
function _temp3() {}
|
|
1082
|
-
function _temp2() {
|
|
1083
|
-
return document.body.querySelector(`.${styles.columnInsertionIndicator}`);
|
|
1084
|
-
}
|
|
1085
|
-
function _temp() {
|
|
1086
|
-
return document.body.querySelector(`.${styles.columnDragFrame}`);
|
|
1087
|
-
}
|
|
1088
664
|
function ColumnReorderHandleMirror() {
|
|
1089
665
|
const $ = c(2);
|
|
1090
|
-
if ($[0] !== "
|
|
666
|
+
if ($[0] !== "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d") {
|
|
1091
667
|
for (let $i = 0; $i < 2; $i += 1) {
|
|
1092
668
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1093
669
|
}
|
|
1094
|
-
$[0] = "
|
|
670
|
+
$[0] = "b3c0ce09616b10368937eafd2419f39baff21b41a15b2e7de8de6c88d493b96d";
|
|
1095
671
|
}
|
|
1096
672
|
let t0;
|
|
1097
673
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|