@crisp-ui-kit/crisp 0.32.0 → 0.32.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.
|
@@ -402,21 +402,29 @@ function DataTable({ columns: columnsProp, data, selectable = false, selectedIds
|
|
|
402
402
|
// sticky attrs for the leading column(s): grip col (index -2) + selection
|
|
403
403
|
// col (-1) + first data column (0). Each offsets by whatever leading
|
|
404
404
|
// columns come before it, so the group stays contiguous when scrolled.
|
|
405
|
+
// `insetInlineStart`, never `left`: the offset pins the column to the
|
|
406
|
+
// LEADING edge, which is the right one under `dir="rtl"`. A physical `left`
|
|
407
|
+
// pins to the trailing edge instead, and the column scrolls out of view the
|
|
408
|
+
// moment sticky would have engaged (#285). RecordsTable does the same job in
|
|
409
|
+
// CSS and has used the logical property since #91 -- this offset is computed
|
|
410
|
+
// here rather than in a recipe, which is why that sweep could not reach it.
|
|
405
411
|
const stickyCol = (index) => {
|
|
406
412
|
if (!stickyFirst)
|
|
407
413
|
return {};
|
|
408
414
|
if (showGrip && index === -2)
|
|
409
|
-
return { "data-sticky": "", style: {
|
|
415
|
+
return { "data-sticky": "", style: { insetInlineStart: 0 } };
|
|
410
416
|
if (selectable && index === -1)
|
|
411
417
|
return {
|
|
412
418
|
"data-sticky": "",
|
|
413
|
-
style: {
|
|
419
|
+
style: { insetInlineStart: showGrip ? GRIP_W : 0 },
|
|
414
420
|
};
|
|
415
421
|
if (index === 0)
|
|
416
422
|
return {
|
|
417
423
|
"data-sticky": "",
|
|
418
424
|
"data-sticky-edge": "",
|
|
419
|
-
style: {
|
|
425
|
+
style: {
|
|
426
|
+
insetInlineStart: (showGrip ? GRIP_W : 0) + (selectable ? CHECK_W : 0),
|
|
427
|
+
},
|
|
420
428
|
};
|
|
421
429
|
return {};
|
|
422
430
|
};
|
|
@@ -366,21 +366,29 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
366
366
|
// sticky attrs for the leading column(s): grip col (index -2) + selection
|
|
367
367
|
// col (-1) + first data column (0). Each offsets by whatever leading
|
|
368
368
|
// columns come before it, so the group stays contiguous when scrolled.
|
|
369
|
+
// `insetInlineStart`, never `left`: the offset pins the column to the
|
|
370
|
+
// LEADING edge, which is the right one under `dir="rtl"`. A physical `left`
|
|
371
|
+
// pins to the trailing edge instead, and the column scrolls out of view the
|
|
372
|
+
// moment sticky would have engaged (#285). RecordsTable does the same job in
|
|
373
|
+
// CSS and has used the logical property since #91 -- this offset is computed
|
|
374
|
+
// here rather than in a recipe, which is why that sweep could not reach it.
|
|
369
375
|
const stickyCol = (index) => {
|
|
370
376
|
if (!stickyFirst)
|
|
371
377
|
return {};
|
|
372
378
|
if (showGrip && index === -2)
|
|
373
|
-
return { "data-sticky": "", style: {
|
|
379
|
+
return { "data-sticky": "", style: { insetInlineStart: 0 } };
|
|
374
380
|
if (selectable && index === -1)
|
|
375
381
|
return {
|
|
376
382
|
"data-sticky": "",
|
|
377
|
-
style: {
|
|
383
|
+
style: { insetInlineStart: showGrip ? GRIP_W : 0 },
|
|
378
384
|
};
|
|
379
385
|
if (index === 0)
|
|
380
386
|
return {
|
|
381
387
|
"data-sticky": "",
|
|
382
388
|
"data-sticky-edge": "",
|
|
383
|
-
style: {
|
|
389
|
+
style: {
|
|
390
|
+
insetInlineStart: (showGrip ? GRIP_W : 0) + (selectable ? CHECK_W : 0),
|
|
391
|
+
},
|
|
384
392
|
};
|
|
385
393
|
return {};
|
|
386
394
|
};
|