@jetbrains/ring-ui-built 8.0.0-beta.13 → 8.0.0-beta.14
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/table.js +1 -1
- package/components/column-resize/column-group.js +69 -0
- package/components/column-resize/column-resize-drag.js +147 -0
- package/components/column-resize/column-resize-handle.js +86 -0
- package/components/column-resize/column-sizing-context.js +200 -0
- package/components/internal/column-indicator-vertical-span.js +23 -0
- package/components/internal/drag-auto-scroll.js +118 -0
- package/components/internal/reorder-handle.js +198 -210
- package/components/internal/table-header.js +152 -113
- package/components/style.css +1 -1
- package/components/table/default-item-renderer.js +6 -4
- package/components/table/internal/column-indicator-vertical-span.d.ts +8 -0
- package/components/table/internal/column-resize/column-group.d.ts +8 -0
- package/components/table/internal/column-resize/column-resize-drag.d.ts +27 -0
- package/components/table/internal/column-resize/column-resize-handle.d.ts +5 -0
- package/components/table/internal/column-resize/column-sizing-context.d.ts +27 -0
- package/components/table/internal/drag-auto-scroll.d.ts +18 -0
- package/components/table/item-virtualization.d.ts +2 -1
- package/components/table/table-const.d.ts +6 -0
- package/components/table/table-const.js +7 -1
- package/components/table/table-primitives.js +2 -0
- package/components/table/table-props.d.ts +39 -0
- package/components/table/table.d.ts +8 -0
- package/components/table/table.js +239 -165
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { use, useState, useRef } from 'react';
|
|
2
|
+
import { use, useState, useRef, useId } 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';
|
|
@@ -13,6 +13,7 @@ import { ReorderHandle } from './reorder-handle.js';
|
|
|
13
13
|
import { ReorderAnimationContext } from './reorder-animation-context.js';
|
|
14
14
|
import { useReorderLayoutContextValue, ReorderLayoutContext } from './reorder-layout-context.js';
|
|
15
15
|
import { useReorderItemLayout } from '../table/reorder-item-layout.js';
|
|
16
|
+
import { ColumnResizeHandle } from '../column-resize/column-resize-handle.js';
|
|
16
17
|
import { s as styles } from '../_helpers/table.js';
|
|
17
18
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
18
19
|
import 'util-deprecate';
|
|
@@ -23,15 +24,20 @@ import '@jetbrains/icons/drag-12px';
|
|
|
23
24
|
import '../global/compose-refs.js';
|
|
24
25
|
import 'memoize-one';
|
|
25
26
|
import '../global/parse-css-duration.js';
|
|
27
|
+
import './drag-auto-scroll.js';
|
|
28
|
+
import './column-indicator-vertical-span.js';
|
|
26
29
|
import '../global/schedule-with-cleanup.js';
|
|
30
|
+
import 'react-dom';
|
|
31
|
+
import '../column-resize/column-sizing-context.js';
|
|
32
|
+
import '../column-resize/column-resize-drag.js';
|
|
27
33
|
|
|
28
34
|
function TableHeader() {
|
|
29
35
|
const $ = c(30);
|
|
30
|
-
if ($[0] !== "
|
|
36
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
31
37
|
for (let $i = 0; $i < 30; $i += 1) {
|
|
32
38
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
33
39
|
}
|
|
34
|
-
$[0] = "
|
|
40
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
35
41
|
}
|
|
36
42
|
const {
|
|
37
43
|
columns,
|
|
@@ -168,12 +174,12 @@ function TableHeader() {
|
|
|
168
174
|
return t9;
|
|
169
175
|
}
|
|
170
176
|
function TableHeaderCell(t0) {
|
|
171
|
-
const $ = c(
|
|
172
|
-
if ($[0] !== "
|
|
173
|
-
for (let $i = 0; $i <
|
|
177
|
+
const $ = c(53);
|
|
178
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
179
|
+
for (let $i = 0; $i < 53; $i += 1) {
|
|
174
180
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
175
181
|
}
|
|
176
|
-
$[0] = "
|
|
182
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
177
183
|
}
|
|
178
184
|
const {
|
|
179
185
|
columnIndex,
|
|
@@ -181,10 +187,12 @@ function TableHeaderCell(t0) {
|
|
|
181
187
|
handleEditColumnsButtonClick
|
|
182
188
|
} = t0;
|
|
183
189
|
const ref = useRef(null);
|
|
190
|
+
const labelId = useId();
|
|
184
191
|
const {
|
|
185
192
|
columns,
|
|
186
193
|
columnEditButton
|
|
187
194
|
} = use(TablePropsContext);
|
|
195
|
+
const column = columns[columnIndex];
|
|
188
196
|
const {
|
|
189
197
|
key,
|
|
190
198
|
name,
|
|
@@ -192,8 +200,9 @@ function TableHeaderCell(t0) {
|
|
|
192
200
|
sortOrder,
|
|
193
201
|
deletable,
|
|
194
202
|
canReorder,
|
|
203
|
+
resizable,
|
|
195
204
|
thClassName
|
|
196
|
-
} =
|
|
205
|
+
} = column;
|
|
197
206
|
const {
|
|
198
207
|
reorderAnimation
|
|
199
208
|
} = use(ReorderAnimationContext);
|
|
@@ -207,10 +216,22 @@ function TableHeaderCell(t0) {
|
|
|
207
216
|
} else {
|
|
208
217
|
t1 = $[4];
|
|
209
218
|
}
|
|
210
|
-
const children = t1;
|
|
211
219
|
let t2;
|
|
212
|
-
if ($[5]
|
|
213
|
-
t2 = (
|
|
220
|
+
if ($[5] !== labelId || $[6] !== t1) {
|
|
221
|
+
t2 = /*#__PURE__*/jsx("span", {
|
|
222
|
+
id: labelId,
|
|
223
|
+
children: t1
|
|
224
|
+
});
|
|
225
|
+
$[5] = labelId;
|
|
226
|
+
$[6] = t1;
|
|
227
|
+
$[7] = t2;
|
|
228
|
+
} else {
|
|
229
|
+
t2 = $[7];
|
|
230
|
+
}
|
|
231
|
+
const children = t2;
|
|
232
|
+
let t3;
|
|
233
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
234
|
+
t3 = () => {
|
|
214
235
|
var _r$left, _r$right;
|
|
215
236
|
const r = ref.current?.getBoundingClientRect();
|
|
216
237
|
return {
|
|
@@ -218,153 +239,171 @@ function TableHeaderCell(t0) {
|
|
|
218
239
|
end: (_r$right = r?.right) !== null && _r$right !== void 0 ? _r$right : 0
|
|
219
240
|
};
|
|
220
241
|
};
|
|
221
|
-
$[
|
|
242
|
+
$[8] = t3;
|
|
222
243
|
} else {
|
|
223
|
-
|
|
244
|
+
t3 = $[8];
|
|
224
245
|
}
|
|
225
|
-
let
|
|
226
|
-
if ($[
|
|
227
|
-
|
|
246
|
+
let t4;
|
|
247
|
+
if ($[9] !== columnIndex) {
|
|
248
|
+
t4 = {
|
|
228
249
|
index: columnIndex,
|
|
229
|
-
getBounds:
|
|
250
|
+
getBounds: t3
|
|
230
251
|
};
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
252
|
+
$[9] = columnIndex;
|
|
253
|
+
$[10] = t4;
|
|
233
254
|
} else {
|
|
234
|
-
|
|
255
|
+
t4 = $[10];
|
|
235
256
|
}
|
|
236
|
-
useReorderItemLayout(
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
257
|
+
useReorderItemLayout(t4);
|
|
258
|
+
const t5 = resizable && styles.resizableHeaderCell;
|
|
259
|
+
const t6 = reorderAnimation?.direction === "columns" && reorderAnimation.index === columnIndex && reorderAnimation.className;
|
|
260
|
+
let t7;
|
|
261
|
+
if ($[11] !== t5 || $[12] !== t6 || $[13] !== thClassName) {
|
|
262
|
+
t7 = classNames(styles.headerCell, t5, t6, thClassName);
|
|
263
|
+
$[11] = t5;
|
|
264
|
+
$[12] = t6;
|
|
265
|
+
$[13] = thClassName;
|
|
266
|
+
$[14] = t7;
|
|
244
267
|
} else {
|
|
245
|
-
|
|
268
|
+
t7 = $[14];
|
|
246
269
|
}
|
|
247
|
-
let
|
|
248
|
-
if ($[
|
|
249
|
-
|
|
270
|
+
let t8;
|
|
271
|
+
if ($[15] !== canReorder || $[16] !== columnIndex) {
|
|
272
|
+
t8 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandle, {
|
|
250
273
|
columnIndex: columnIndex
|
|
251
274
|
});
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
275
|
+
$[15] = canReorder;
|
|
276
|
+
$[16] = columnIndex;
|
|
277
|
+
$[17] = t8;
|
|
255
278
|
} else {
|
|
256
|
-
|
|
279
|
+
t8 = $[17];
|
|
257
280
|
}
|
|
258
|
-
let
|
|
259
|
-
if ($[
|
|
260
|
-
|
|
281
|
+
let t9;
|
|
282
|
+
if ($[18] !== children || $[19] !== columnIndex || $[20] !== sortOrder) {
|
|
283
|
+
t9 = sortOrder ? /*#__PURE__*/jsx(SortButton, {
|
|
261
284
|
columnIndex: columnIndex,
|
|
262
285
|
"aria-description": `Sort order: ${sortOrder}`,
|
|
263
286
|
children: children
|
|
264
287
|
}) : children;
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
288
|
+
$[18] = children;
|
|
289
|
+
$[19] = columnIndex;
|
|
290
|
+
$[20] = sortOrder;
|
|
291
|
+
$[21] = t9;
|
|
269
292
|
} else {
|
|
270
|
-
|
|
293
|
+
t9 = $[21];
|
|
271
294
|
}
|
|
272
|
-
let
|
|
273
|
-
if ($[
|
|
274
|
-
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
295
|
+
let t10;
|
|
296
|
+
if ($[22] !== canReorder) {
|
|
297
|
+
t10 = canReorder && /*#__PURE__*/jsx(ColumnReorderHandleMirror, {});
|
|
298
|
+
$[22] = canReorder;
|
|
299
|
+
$[23] = t10;
|
|
277
300
|
} else {
|
|
278
|
-
|
|
301
|
+
t10 = $[23];
|
|
279
302
|
}
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
303
|
+
let t11;
|
|
304
|
+
if ($[24] !== t10 || $[25] !== t8 || $[26] !== t9) {
|
|
305
|
+
t11 = /*#__PURE__*/jsxs("div", {
|
|
283
306
|
className: styles.sortAndHeader,
|
|
284
|
-
children: [
|
|
307
|
+
children: [t8, t9, t10]
|
|
285
308
|
});
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
309
|
+
$[24] = t10;
|
|
310
|
+
$[25] = t8;
|
|
311
|
+
$[26] = t9;
|
|
312
|
+
$[27] = t11;
|
|
290
313
|
} else {
|
|
291
|
-
|
|
314
|
+
t11 = $[27];
|
|
292
315
|
}
|
|
293
|
-
let
|
|
294
|
-
if ($[
|
|
295
|
-
|
|
316
|
+
let t12;
|
|
317
|
+
if ($[28] !== columnIndex || $[29] !== deletable) {
|
|
318
|
+
t12 = deletable && /*#__PURE__*/jsx(DeleteColumnButton, {
|
|
296
319
|
columnIndex: columnIndex
|
|
297
320
|
});
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
321
|
+
$[28] = columnIndex;
|
|
322
|
+
$[29] = deletable;
|
|
323
|
+
$[30] = t12;
|
|
301
324
|
} else {
|
|
302
|
-
|
|
325
|
+
t12 = $[30];
|
|
303
326
|
}
|
|
304
|
-
let
|
|
305
|
-
if ($[
|
|
306
|
-
|
|
327
|
+
let t13;
|
|
328
|
+
if ($[31] !== columnEditButton || $[32] !== columnEditing || $[33] !== columnIndex || $[34] !== columns.length || $[35] !== handleEditColumnsButtonClick) {
|
|
329
|
+
t13 = columnIndex === columns.length - 1 && columnEditButton && /*#__PURE__*/jsx(EditColumnsButton, {
|
|
307
330
|
columnEditing: columnEditing,
|
|
308
331
|
onClick: handleEditColumnsButtonClick
|
|
309
332
|
});
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
333
|
+
$[31] = columnEditButton;
|
|
334
|
+
$[32] = columnEditing;
|
|
335
|
+
$[33] = columnIndex;
|
|
336
|
+
$[34] = columns.length;
|
|
337
|
+
$[35] = handleEditColumnsButtonClick;
|
|
338
|
+
$[36] = t13;
|
|
316
339
|
} else {
|
|
317
|
-
|
|
340
|
+
t13 = $[36];
|
|
318
341
|
}
|
|
319
|
-
let
|
|
320
|
-
if ($[
|
|
321
|
-
|
|
342
|
+
let t14;
|
|
343
|
+
if ($[37] !== t12 || $[38] !== t13) {
|
|
344
|
+
t14 = /*#__PURE__*/jsxs("div", {
|
|
322
345
|
className: styles.rightButtons,
|
|
323
|
-
children: [
|
|
346
|
+
children: [t12, t13]
|
|
324
347
|
});
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
348
|
+
$[37] = t12;
|
|
349
|
+
$[38] = t13;
|
|
350
|
+
$[39] = t14;
|
|
328
351
|
} else {
|
|
329
|
-
|
|
352
|
+
t14 = $[39];
|
|
330
353
|
}
|
|
331
|
-
let
|
|
332
|
-
if ($[
|
|
333
|
-
|
|
354
|
+
let t15;
|
|
355
|
+
if ($[40] !== t11 || $[41] !== t14) {
|
|
356
|
+
t15 = /*#__PURE__*/jsxs("div", {
|
|
334
357
|
className: styles.headerCellInnerWrapper,
|
|
335
|
-
children: [
|
|
358
|
+
children: [t11, t14]
|
|
336
359
|
});
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
360
|
+
$[40] = t11;
|
|
361
|
+
$[41] = t14;
|
|
362
|
+
$[42] = t15;
|
|
340
363
|
} else {
|
|
341
|
-
|
|
364
|
+
t15 = $[42];
|
|
342
365
|
}
|
|
343
|
-
let
|
|
344
|
-
if ($[
|
|
345
|
-
|
|
366
|
+
let t16;
|
|
367
|
+
if ($[43] !== column || $[44] !== columnIndex || $[45] !== resizable) {
|
|
368
|
+
t16 = resizable && /*#__PURE__*/jsx(ColumnResizeHandle, {
|
|
369
|
+
column: column,
|
|
370
|
+
columnIndex: columnIndex
|
|
371
|
+
});
|
|
372
|
+
$[43] = column;
|
|
373
|
+
$[44] = columnIndex;
|
|
374
|
+
$[45] = resizable;
|
|
375
|
+
$[46] = t16;
|
|
376
|
+
} else {
|
|
377
|
+
t16 = $[46];
|
|
378
|
+
}
|
|
379
|
+
let t17;
|
|
380
|
+
if ($[47] !== labelId || $[48] !== sortOrder || $[49] !== t15 || $[50] !== t16 || $[51] !== t7) {
|
|
381
|
+
t17 = /*#__PURE__*/jsxs("th", {
|
|
346
382
|
ref: ref,
|
|
347
|
-
className:
|
|
383
|
+
className: t7,
|
|
348
384
|
scope: "col",
|
|
349
385
|
"aria-sort": sortOrder,
|
|
350
|
-
|
|
386
|
+
"aria-labelledby": labelId,
|
|
387
|
+
children: [t15, t16]
|
|
351
388
|
});
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
389
|
+
$[47] = labelId;
|
|
390
|
+
$[48] = sortOrder;
|
|
391
|
+
$[49] = t15;
|
|
392
|
+
$[50] = t16;
|
|
393
|
+
$[51] = t7;
|
|
394
|
+
$[52] = t17;
|
|
356
395
|
} else {
|
|
357
|
-
|
|
396
|
+
t17 = $[52];
|
|
358
397
|
}
|
|
359
|
-
return
|
|
398
|
+
return t17;
|
|
360
399
|
}
|
|
361
400
|
function SortButton(t0) {
|
|
362
401
|
const $ = c(22);
|
|
363
|
-
if ($[0] !== "
|
|
402
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
364
403
|
for (let $i = 0; $i < 22; $i += 1) {
|
|
365
404
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
366
405
|
}
|
|
367
|
-
$[0] = "
|
|
406
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
368
407
|
}
|
|
369
408
|
let children;
|
|
370
409
|
let className;
|
|
@@ -459,11 +498,11 @@ function SortButton(t0) {
|
|
|
459
498
|
function DeleteColumnButton(t0) {
|
|
460
499
|
var _column$name;
|
|
461
500
|
const $ = c(18);
|
|
462
|
-
if ($[0] !== "
|
|
501
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
463
502
|
for (let $i = 0; $i < 18; $i += 1) {
|
|
464
503
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
465
504
|
}
|
|
466
|
-
$[0] = "
|
|
505
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
467
506
|
}
|
|
468
507
|
let className;
|
|
469
508
|
let columnIndex;
|
|
@@ -551,11 +590,11 @@ function DeleteColumnButton(t0) {
|
|
|
551
590
|
}
|
|
552
591
|
function EditColumnsButton(t0) {
|
|
553
592
|
const $ = c(14);
|
|
554
|
-
if ($[0] !== "
|
|
593
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
555
594
|
for (let $i = 0; $i < 14; $i += 1) {
|
|
556
595
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
557
596
|
}
|
|
558
|
-
$[0] = "
|
|
597
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
559
598
|
}
|
|
560
599
|
let columnEditing;
|
|
561
600
|
let hint;
|
|
@@ -623,11 +662,11 @@ function EditColumnsButton(t0) {
|
|
|
623
662
|
}
|
|
624
663
|
function ColumnReorderHandle(t0) {
|
|
625
664
|
const $ = c(7);
|
|
626
|
-
if ($[0] !== "
|
|
665
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
627
666
|
for (let $i = 0; $i < 7; $i += 1) {
|
|
628
667
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
629
668
|
}
|
|
630
|
-
$[0] = "
|
|
669
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
631
670
|
}
|
|
632
671
|
let columnIndex;
|
|
633
672
|
let restProps;
|
|
@@ -663,11 +702,11 @@ function ColumnReorderHandle(t0) {
|
|
|
663
702
|
*/
|
|
664
703
|
function ColumnReorderHandleMirror() {
|
|
665
704
|
const $ = c(2);
|
|
666
|
-
if ($[0] !== "
|
|
705
|
+
if ($[0] !== "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df") {
|
|
667
706
|
for (let $i = 0; $i < 2; $i += 1) {
|
|
668
707
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
669
708
|
}
|
|
670
|
-
$[0] = "
|
|
709
|
+
$[0] = "d2be4026b6c8a643afb512c3eea0cb78b5cab4ec2be6d006114b8dac105ad6df";
|
|
671
710
|
}
|
|
672
711
|
let t0;
|
|
673
712
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|