@coldsmirk/ledger-mantine 0.8.0 → 0.9.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/index.cjs +91 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +92 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.css +101 -33
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
/* `radius` (the --ledger-radius variable): the root rounds with the frame so a `bg` or the
|
|
45
45
|
pagination bar follows the same corners. */
|
|
46
46
|
border-radius: var(--ledger-radius, 0);
|
|
47
|
+
|
|
48
|
+
/* The table's own layers — pinned cells and rows (2), scrollbars (3), the loading overlay —
|
|
49
|
+
stack inside the table. Without a stacking context of its own they stacked in the page's,
|
|
50
|
+
and a pinned column painted over the page's own sticky bars below z-index 2. */
|
|
51
|
+
isolation: isolate;
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
/* Secondary text (captions, counts, the state panels' titles, the pagination words): the text
|
|
@@ -135,22 +140,27 @@
|
|
|
135
140
|
z-index: 2;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
|
-
.
|
|
143
|
+
/* Body and footer cells are `<td>`s, which Mantine leaves aligned by inheritance. A header
|
|
144
|
+
cell's own alignment is Mantine's, unlayered (`text-align: start`), so header content aligns
|
|
145
|
+
through the label box instead (`.ledger-header-label[data-align]`). */
|
|
139
146
|
.ledger-cell[data-align="center"],
|
|
140
147
|
.ledger-footer-cell[data-align="center"] {
|
|
141
148
|
text-align: center;
|
|
142
149
|
}
|
|
143
150
|
|
|
144
|
-
.ledger-header-cell[data-align="end"],
|
|
145
151
|
.ledger-cell[data-align="end"],
|
|
146
152
|
.ledger-footer-cell[data-align="end"] {
|
|
147
153
|
text-align: end;
|
|
148
154
|
}
|
|
149
155
|
|
|
156
|
+
/* A block box, sized to its content: an inline one sat on the cell's text baseline, which
|
|
157
|
+
pushed the header row two pixels past a body row and dropped each label by however its own
|
|
158
|
+
baseline fell — a sort mark leading an end-aligned label lifted that one by a pixel. */
|
|
150
159
|
.ledger-header-label {
|
|
151
|
-
display:
|
|
160
|
+
display: flex;
|
|
152
161
|
gap: 6px;
|
|
153
162
|
align-items: center;
|
|
163
|
+
width: fit-content;
|
|
154
164
|
max-width: 100%;
|
|
155
165
|
font: inherit;
|
|
156
166
|
color: inherit;
|
|
@@ -161,6 +171,7 @@
|
|
|
161
171
|
author rules always beat UA button styles, whereas Mantine's UnstyledButton carries an
|
|
162
172
|
unlayered font-size that would defeat the layered `font: inherit` above (the unlayered-host
|
|
163
173
|
rule, docs/styling.md). */
|
|
174
|
+
|
|
164
175
|
.ledger-header-label[type="button"] {
|
|
165
176
|
padding: 0;
|
|
166
177
|
appearance: none;
|
|
@@ -174,8 +185,12 @@
|
|
|
174
185
|
width: 100%;
|
|
175
186
|
}
|
|
176
187
|
|
|
188
|
+
/* An end-aligned label leads with its sort mark, so the text ends where the column's values
|
|
189
|
+
end: the mark keeps its room while hidden, and on the trailing side it held every header of
|
|
190
|
+
a numeric column a glyph short of the figures under it. */
|
|
177
191
|
.ledger-header-label[data-align="end"] {
|
|
178
|
-
|
|
192
|
+
flex-direction: row-reverse;
|
|
193
|
+
justify-content: flex-start;
|
|
179
194
|
width: 100%;
|
|
180
195
|
}
|
|
181
196
|
|
|
@@ -193,6 +208,15 @@
|
|
|
193
208
|
white-space: nowrap;
|
|
194
209
|
}
|
|
195
210
|
|
|
211
|
+
/* A group header's label stays in view while its columns scroll beneath it: it sticks just past
|
|
212
|
+
the start-pinned block for as long as the group reaches that far, as a spreadsheet's merged
|
|
213
|
+
heading does. Scrolled off with the group's first column, a month over a year of daily
|
|
214
|
+
columns left a blank band over every other day of it. */
|
|
215
|
+
.ledger-header-cell:not([colspan="1"], [data-pinned]) > .ledger-header-label {
|
|
216
|
+
position: sticky;
|
|
217
|
+
inset-inline-start: calc(var(--ledger-pinned-start-width, 0px) + var(--table-horizontal-spacing, 0px));
|
|
218
|
+
}
|
|
219
|
+
|
|
196
220
|
/* Sort affordance: invisible until hover on unsorted columns, always visible once sorted. */
|
|
197
221
|
.ledger-sort-indicator {
|
|
198
222
|
display: inline-flex;
|
|
@@ -244,6 +268,13 @@
|
|
|
244
268
|
inset-inline-end: 12px;
|
|
245
269
|
}
|
|
246
270
|
|
|
271
|
+
/* An end-aligned label fills the trailing edge, so its actions overlay the leading one — on
|
|
272
|
+
the trailing edge they covered the label itself. */
|
|
273
|
+
.ledger-header-cell[data-align="end"] .ledger-header-actions {
|
|
274
|
+
inset-inline: 4px auto;
|
|
275
|
+
padding-inline: 0 4px;
|
|
276
|
+
}
|
|
277
|
+
|
|
247
278
|
/* Resize handle on the trailing edge; the visible line appears on hover or while dragging. */
|
|
248
279
|
.ledger-resizer {
|
|
249
280
|
position: absolute;
|
|
@@ -403,9 +434,12 @@
|
|
|
403
434
|
drawn only while content is actually scrolled past that edge. The edge is a hairline in the
|
|
404
435
|
border color — the plane the rows pass beneath — and the shade only its depth: narrow, and in
|
|
405
436
|
`--ledger-edge-shade`, the ink thinned to a breath on light and a dusk on dark, so the edge
|
|
406
|
-
reads as one plane over another and never as a bar beside it.
|
|
437
|
+
reads as one plane over another and never as a bar beside it. The dark tone follows Mantine's
|
|
438
|
+
scheme attribute, never `light-dark()`: a consumer's bundler lowers that for older targets
|
|
439
|
+
into variables it defines only beside a literal `color-scheme`, which Mantine sets through a
|
|
440
|
+
variable — lowered, the shade would be no color at all. */
|
|
407
441
|
[data-pinned-edge]::after {
|
|
408
|
-
--ledger-pinned-shade: var(--ledger-edge-shade,
|
|
442
|
+
--ledger-pinned-shade: var(--ledger-edge-shade, rgb(15 19 24 / 7%));
|
|
409
443
|
position: absolute;
|
|
410
444
|
inset-block: 0;
|
|
411
445
|
width: 7px;
|
|
@@ -414,6 +448,10 @@
|
|
|
414
448
|
opacity: 0;
|
|
415
449
|
}
|
|
416
450
|
|
|
451
|
+
:where([data-mantine-color-scheme="dark"]) [data-pinned-edge]::after {
|
|
452
|
+
--ledger-pinned-shade: var(--ledger-edge-shade, rgb(0 0 0 / 36%));
|
|
453
|
+
}
|
|
454
|
+
|
|
417
455
|
[data-pinned-edge="start"]::after {
|
|
418
456
|
inset-inline-end: 0;
|
|
419
457
|
background-image: linear-gradient(to right, var(--ledger-pinned-shade), transparent);
|
|
@@ -456,23 +494,22 @@
|
|
|
456
494
|
text-align: center;
|
|
457
495
|
}
|
|
458
496
|
|
|
459
|
-
/* The reorder handle:
|
|
460
|
-
|
|
497
|
+
/* The reorder handle: quiet dim while something else controls the order (the tooltip says
|
|
498
|
+
what — labels.rowOrderingUnavailable). Its cursor is set inline, since Mantine's button
|
|
499
|
+
carries an unlayered one. */
|
|
461
500
|
.ledger-row-drag-cell button {
|
|
462
501
|
vertical-align: middle;
|
|
463
|
-
cursor: grab;
|
|
464
502
|
}
|
|
465
503
|
|
|
466
504
|
.ledger-row-drag-cell button[aria-disabled] {
|
|
467
|
-
cursor: default;
|
|
468
505
|
opacity: 0.4;
|
|
469
506
|
}
|
|
470
507
|
|
|
471
508
|
/* An icon-only ActionIcon is an inline-flex box whose baseline is its bottom edge, so the
|
|
472
509
|
default `vertical-align: baseline` rides it a few pixels high of the middle-aligned cell's
|
|
473
|
-
center — the row chevron
|
|
474
|
-
|
|
475
|
-
.ledger-
|
|
510
|
+
center — the row chevron needs pinning to the middle. (The tree header's expand-all sits in
|
|
511
|
+
the label box, a flex line that centers it already.) */
|
|
512
|
+
.ledger-expander-cell button {
|
|
476
513
|
vertical-align: middle;
|
|
477
514
|
}
|
|
478
515
|
|
|
@@ -490,11 +527,14 @@
|
|
|
490
527
|
rotate: 90deg;
|
|
491
528
|
}
|
|
492
529
|
|
|
530
|
+
/* Top-aligned in the cell's line: on the text baseline the box hung its descent below the line
|
|
531
|
+
and made every group row two pixels taller than the rows it groups. */
|
|
493
532
|
[data-group-cell] {
|
|
494
533
|
display: inline-flex;
|
|
495
534
|
gap: 6px;
|
|
496
535
|
align-items: center;
|
|
497
536
|
font-weight: 500;
|
|
537
|
+
vertical-align: top;
|
|
498
538
|
}
|
|
499
539
|
|
|
500
540
|
[data-group-count] {
|
|
@@ -502,13 +542,15 @@
|
|
|
502
542
|
color: var(--ledger-color-dimmed);
|
|
503
543
|
}
|
|
504
544
|
|
|
545
|
+
/* Cell padding is Mantine's, set unlayered from the spacing variables its table carries — so
|
|
546
|
+
a cell's padding changes through those variables, never through its padding property. */
|
|
505
547
|
.ledger-cell[data-editing] {
|
|
506
|
-
|
|
548
|
+
--table-vertical-spacing: 2px;
|
|
507
549
|
}
|
|
508
550
|
|
|
509
551
|
/* An `xs` row is as tall as the smallest input Mantine draws: the editor takes the whole of it. */
|
|
510
552
|
.ledger-root[data-size="xs"] .ledger-cell[data-editing] {
|
|
511
|
-
|
|
553
|
+
--table-vertical-spacing: 0px;
|
|
512
554
|
}
|
|
513
555
|
|
|
514
556
|
.ledger-cell-editor {
|
|
@@ -518,6 +560,19 @@
|
|
|
518
560
|
width: 100%;
|
|
519
561
|
}
|
|
520
562
|
|
|
563
|
+
/* The editor follows the column's alignment: a control that does not fill the cell sits where
|
|
564
|
+
the column's values do, and a Mantine input's text aligns the same way, through the variable
|
|
565
|
+
its (possibly unlayered) rule reads — a number no longer jumps to the start as it opens. */
|
|
566
|
+
.ledger-cell[data-align="center"] .ledger-cell-editor {
|
|
567
|
+
--input-text-align: center;
|
|
568
|
+
justify-content: center;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.ledger-cell[data-align="end"] .ledger-cell-editor {
|
|
572
|
+
--input-text-align: end;
|
|
573
|
+
justify-content: flex-end;
|
|
574
|
+
}
|
|
575
|
+
|
|
521
576
|
.ledger-cell-editor[data-pending] {
|
|
522
577
|
opacity: 0.7;
|
|
523
578
|
}
|
|
@@ -585,7 +640,8 @@
|
|
|
585
640
|
* Detail panels, footer, states, chrome
|
|
586
641
|
* ------------------------------------------------------------------------------------------ */
|
|
587
642
|
.ledger-detail-panel {
|
|
588
|
-
|
|
643
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
644
|
+
--table-horizontal-spacing: var(--mantine-spacing-md);
|
|
589
645
|
}
|
|
590
646
|
|
|
591
647
|
.ledger-footer-cell {
|
|
@@ -624,9 +680,8 @@
|
|
|
624
680
|
}
|
|
625
681
|
|
|
626
682
|
.ledger-loader-row td {
|
|
627
|
-
|
|
683
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
628
684
|
color: var(--ledger-color-dimmed);
|
|
629
|
-
border-bottom: 0;
|
|
630
685
|
}
|
|
631
686
|
|
|
632
687
|
/* The cell holds a centred pair — spinner + text, or message + retry — so it is laid out as
|
|
@@ -762,9 +817,9 @@
|
|
|
762
817
|
opacity: 0.4;
|
|
763
818
|
}
|
|
764
819
|
|
|
765
|
-
/* A translucent grip is enough of a "this list reorders" hint; the hovered row sharpens it.
|
|
820
|
+
/* A translucent grip is enough of a "this list reorders" hint; the hovered row sharpens it.
|
|
821
|
+
Its cursor is set inline, since Mantine's button carries an unlayered one. */
|
|
766
822
|
.ledger-columns-panel-handle {
|
|
767
|
-
cursor: grab;
|
|
768
823
|
opacity: 0.3;
|
|
769
824
|
transition: opacity 120ms ease;
|
|
770
825
|
}
|
|
@@ -774,10 +829,6 @@
|
|
|
774
829
|
opacity: 1;
|
|
775
830
|
}
|
|
776
831
|
|
|
777
|
-
.ledger-columns-panel-item[data-dragging] .ledger-columns-panel-handle {
|
|
778
|
-
cursor: grabbing;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
832
|
/* The checkbox's label wrapper. Mantine already clears min-width on the body between them, so
|
|
782
833
|
this is the last link in the chain that must be allowed to shrink; without it the nowrap
|
|
783
834
|
title below sets an unshrinkable floor and shoves the rest of the row out of alignment. */
|
|
@@ -849,10 +900,11 @@
|
|
|
849
900
|
opacity: 1;
|
|
850
901
|
}
|
|
851
902
|
|
|
852
|
-
/* Widths are numbers the table's own cells would show right-aligned and tabular.
|
|
903
|
+
/* Widths are numbers the table's own cells would show right-aligned and tabular. The
|
|
904
|
+
alignment rides the variable Mantine's input reads, since its rule may be unlayered. */
|
|
853
905
|
.ledger-columns-panel-width-input {
|
|
906
|
+
--input-text-align: end;
|
|
854
907
|
font-variant-numeric: tabular-nums;
|
|
855
|
-
text-align: end;
|
|
856
908
|
}
|
|
857
909
|
|
|
858
910
|
/* ------------------------------------------------------------------------------------------
|
|
@@ -861,11 +913,12 @@
|
|
|
861
913
|
* positions; our tables are border-collapse: separate (inline), so every cell carries its
|
|
862
914
|
* border wherever it sticks.
|
|
863
915
|
*
|
|
864
|
-
* Three edges, one line each (docs/styling.md#borders): row separators sit BETWEEN rows
|
|
865
|
-
*
|
|
866
|
-
*
|
|
867
|
-
*
|
|
868
|
-
* seam and the footer's trailing line stay
|
|
916
|
+
* Three edges, one line each (docs/styling.md#borders): row separators sit BETWEEN rows — the
|
|
917
|
+
* last one included while empty body continues under it, but never on the body's bottom edge
|
|
918
|
+
* (Mantine's Table rule — a bordered host closes the table with its own edge); the closing line
|
|
919
|
+
* on that edge is the opt-in `withBottomBorder` seam; the `withTableBorder` frame is four real
|
|
920
|
+
* borders and owns every edge, so under it the body's seam and the footer's trailing line stay
|
|
921
|
+
* off.
|
|
869
922
|
* ------------------------------------------------------------------------------------------ */
|
|
870
923
|
|
|
871
924
|
/* Row separators, header half: the header's bottom edge. (The body half follows the column
|
|
@@ -879,8 +932,8 @@
|
|
|
879
932
|
Body rows do not: `spanRows` drops the cells a merged run covers, which promotes whatever
|
|
880
933
|
renders next to `:first-child` and would strip the border off a mid-table column. The cell
|
|
881
934
|
carries `data-leading` for its real (pinning-aware) display position instead. */
|
|
882
|
-
.ledger-root[data-with-column-borders] .ledger-
|
|
883
|
-
.ledger-root[data-with-column-borders] .ledger-
|
|
935
|
+
.ledger-root[data-with-column-borders] :is(.ledger-thead, .ledger-tfoot) > tr > :not(:first-child),
|
|
936
|
+
.ledger-root[data-with-column-borders] .ledger-tbody > tr > td:not([data-leading]) {
|
|
884
937
|
border-inline-start: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
885
938
|
}
|
|
886
939
|
|
|
@@ -890,6 +943,21 @@
|
|
|
890
943
|
border-block-end: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
891
944
|
}
|
|
892
945
|
|
|
946
|
+
/* …and the last row's, while the rows end above the body's bottom edge (`data-underfilled`,
|
|
947
|
+
measured): with empty body under it, the last row is a row between like any other. Painted
|
|
948
|
+
inside the cells rather than as a border, so drawing it moves nothing and cannot change the
|
|
949
|
+
measurement that decides it. */
|
|
950
|
+
.ledger-root[data-with-row-borders][data-underfilled] .ledger-tbody :is(.ledger-row[data-last] > td, td[data-last]) {
|
|
951
|
+
background-image:
|
|
952
|
+
linear-gradient(
|
|
953
|
+
var(--ledger-border-color, var(--mantine-color-default-border)),
|
|
954
|
+
var(--ledger-border-color, var(--mantine-color-default-border))
|
|
955
|
+
);
|
|
956
|
+
background-repeat: no-repeat;
|
|
957
|
+
background-position: bottom;
|
|
958
|
+
background-size: 100% 1px;
|
|
959
|
+
}
|
|
960
|
+
|
|
893
961
|
/* The body's bottom seam: an inset overlay on the scroller's last pixel — it adds no height
|
|
894
962
|
and stays put under scroll. It paints as the closing line (`withBottomBorder`, unframed: the
|
|
895
963
|
frame's own bottom border would stack under it) and, with row borders, as the separator
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coldsmirk/ledger-mantine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Mantine-native <DataTable> on TanStack Table and TanStack Virtual: sorting, filtering, pagination, selection, pinning, inline editing, and adaptive row virtualization.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-table",
|