@coldsmirk/ledger-mantine 0.8.1 → 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 +92 -31
- 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;
|
|
@@ -463,23 +494,22 @@
|
|
|
463
494
|
text-align: center;
|
|
464
495
|
}
|
|
465
496
|
|
|
466
|
-
/* The reorder handle:
|
|
467
|
-
|
|
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. */
|
|
468
500
|
.ledger-row-drag-cell button {
|
|
469
501
|
vertical-align: middle;
|
|
470
|
-
cursor: grab;
|
|
471
502
|
}
|
|
472
503
|
|
|
473
504
|
.ledger-row-drag-cell button[aria-disabled] {
|
|
474
|
-
cursor: default;
|
|
475
505
|
opacity: 0.4;
|
|
476
506
|
}
|
|
477
507
|
|
|
478
508
|
/* An icon-only ActionIcon is an inline-flex box whose baseline is its bottom edge, so the
|
|
479
509
|
default `vertical-align: baseline` rides it a few pixels high of the middle-aligned cell's
|
|
480
|
-
center — the row chevron
|
|
481
|
-
|
|
482
|
-
.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 {
|
|
483
513
|
vertical-align: middle;
|
|
484
514
|
}
|
|
485
515
|
|
|
@@ -497,11 +527,14 @@
|
|
|
497
527
|
rotate: 90deg;
|
|
498
528
|
}
|
|
499
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. */
|
|
500
532
|
[data-group-cell] {
|
|
501
533
|
display: inline-flex;
|
|
502
534
|
gap: 6px;
|
|
503
535
|
align-items: center;
|
|
504
536
|
font-weight: 500;
|
|
537
|
+
vertical-align: top;
|
|
505
538
|
}
|
|
506
539
|
|
|
507
540
|
[data-group-count] {
|
|
@@ -509,13 +542,15 @@
|
|
|
509
542
|
color: var(--ledger-color-dimmed);
|
|
510
543
|
}
|
|
511
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. */
|
|
512
547
|
.ledger-cell[data-editing] {
|
|
513
|
-
|
|
548
|
+
--table-vertical-spacing: 2px;
|
|
514
549
|
}
|
|
515
550
|
|
|
516
551
|
/* An `xs` row is as tall as the smallest input Mantine draws: the editor takes the whole of it. */
|
|
517
552
|
.ledger-root[data-size="xs"] .ledger-cell[data-editing] {
|
|
518
|
-
|
|
553
|
+
--table-vertical-spacing: 0px;
|
|
519
554
|
}
|
|
520
555
|
|
|
521
556
|
.ledger-cell-editor {
|
|
@@ -525,6 +560,19 @@
|
|
|
525
560
|
width: 100%;
|
|
526
561
|
}
|
|
527
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
|
+
|
|
528
576
|
.ledger-cell-editor[data-pending] {
|
|
529
577
|
opacity: 0.7;
|
|
530
578
|
}
|
|
@@ -592,7 +640,8 @@
|
|
|
592
640
|
* Detail panels, footer, states, chrome
|
|
593
641
|
* ------------------------------------------------------------------------------------------ */
|
|
594
642
|
.ledger-detail-panel {
|
|
595
|
-
|
|
643
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
644
|
+
--table-horizontal-spacing: var(--mantine-spacing-md);
|
|
596
645
|
}
|
|
597
646
|
|
|
598
647
|
.ledger-footer-cell {
|
|
@@ -631,9 +680,8 @@
|
|
|
631
680
|
}
|
|
632
681
|
|
|
633
682
|
.ledger-loader-row td {
|
|
634
|
-
|
|
683
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
635
684
|
color: var(--ledger-color-dimmed);
|
|
636
|
-
border-bottom: 0;
|
|
637
685
|
}
|
|
638
686
|
|
|
639
687
|
/* The cell holds a centred pair — spinner + text, or message + retry — so it is laid out as
|
|
@@ -769,9 +817,9 @@
|
|
|
769
817
|
opacity: 0.4;
|
|
770
818
|
}
|
|
771
819
|
|
|
772
|
-
/* 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. */
|
|
773
822
|
.ledger-columns-panel-handle {
|
|
774
|
-
cursor: grab;
|
|
775
823
|
opacity: 0.3;
|
|
776
824
|
transition: opacity 120ms ease;
|
|
777
825
|
}
|
|
@@ -781,10 +829,6 @@
|
|
|
781
829
|
opacity: 1;
|
|
782
830
|
}
|
|
783
831
|
|
|
784
|
-
.ledger-columns-panel-item[data-dragging] .ledger-columns-panel-handle {
|
|
785
|
-
cursor: grabbing;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
832
|
/* The checkbox's label wrapper. Mantine already clears min-width on the body between them, so
|
|
789
833
|
this is the last link in the chain that must be allowed to shrink; without it the nowrap
|
|
790
834
|
title below sets an unshrinkable floor and shoves the rest of the row out of alignment. */
|
|
@@ -856,10 +900,11 @@
|
|
|
856
900
|
opacity: 1;
|
|
857
901
|
}
|
|
858
902
|
|
|
859
|
-
/* 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. */
|
|
860
905
|
.ledger-columns-panel-width-input {
|
|
906
|
+
--input-text-align: end;
|
|
861
907
|
font-variant-numeric: tabular-nums;
|
|
862
|
-
text-align: end;
|
|
863
908
|
}
|
|
864
909
|
|
|
865
910
|
/* ------------------------------------------------------------------------------------------
|
|
@@ -868,11 +913,12 @@
|
|
|
868
913
|
* positions; our tables are border-collapse: separate (inline), so every cell carries its
|
|
869
914
|
* border wherever it sticks.
|
|
870
915
|
*
|
|
871
|
-
* Three edges, one line each (docs/styling.md#borders): row separators sit BETWEEN rows
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
*
|
|
875
|
-
* 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.
|
|
876
922
|
* ------------------------------------------------------------------------------------------ */
|
|
877
923
|
|
|
878
924
|
/* Row separators, header half: the header's bottom edge. (The body half follows the column
|
|
@@ -886,8 +932,8 @@
|
|
|
886
932
|
Body rows do not: `spanRows` drops the cells a merged run covers, which promotes whatever
|
|
887
933
|
renders next to `:first-child` and would strip the border off a mid-table column. The cell
|
|
888
934
|
carries `data-leading` for its real (pinning-aware) display position instead. */
|
|
889
|
-
.ledger-root[data-with-column-borders] .ledger-
|
|
890
|
-
.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]) {
|
|
891
937
|
border-inline-start: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
892
938
|
}
|
|
893
939
|
|
|
@@ -897,6 +943,21 @@
|
|
|
897
943
|
border-block-end: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
898
944
|
}
|
|
899
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
|
+
|
|
900
961
|
/* The body's bottom seam: an inset overlay on the scroller's last pixel — it adds no height
|
|
901
962
|
and stays put under scroll. It paints as the closing line (`withBottomBorder`, unframed: the
|
|
902
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",
|