@coldsmirk/ledger-mantine 0.8.1 → 0.9.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.
- package/dist/index.cjs +95 -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 +96 -42
- package/dist/index.js.map +1 -1
- package/dist/styles.css +99 -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,29 @@
|
|
|
463
494
|
text-align: center;
|
|
464
495
|
}
|
|
465
496
|
|
|
466
|
-
/*
|
|
467
|
-
the
|
|
497
|
+
/* A Mantine checkbox or radio is a block whose body is a flex row, so the cell's text alignment
|
|
498
|
+
never reached the box: it stood at the cell's start, off the header's box — which the label
|
|
499
|
+
box centres — by half of what the column is wider than the control. The body centres it. */
|
|
500
|
+
.ledger-selection-control {
|
|
501
|
+
justify-content: center;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/* The reorder handle: quiet dim while something else controls the order (the tooltip says
|
|
505
|
+
what — labels.rowOrderingUnavailable). Its cursor is set inline, since Mantine's button
|
|
506
|
+
carries an unlayered one. */
|
|
468
507
|
.ledger-row-drag-cell button {
|
|
469
508
|
vertical-align: middle;
|
|
470
|
-
cursor: grab;
|
|
471
509
|
}
|
|
472
510
|
|
|
473
511
|
.ledger-row-drag-cell button[aria-disabled] {
|
|
474
|
-
cursor: default;
|
|
475
512
|
opacity: 0.4;
|
|
476
513
|
}
|
|
477
514
|
|
|
478
515
|
/* An icon-only ActionIcon is an inline-flex box whose baseline is its bottom edge, so the
|
|
479
516
|
default `vertical-align: baseline` rides it a few pixels high of the middle-aligned cell's
|
|
480
|
-
center — the row chevron
|
|
481
|
-
|
|
482
|
-
.ledger-
|
|
517
|
+
center — the row chevron needs pinning to the middle. (The tree header's expand-all sits in
|
|
518
|
+
the label box, a flex line that centers it already.) */
|
|
519
|
+
.ledger-expander-cell button {
|
|
483
520
|
vertical-align: middle;
|
|
484
521
|
}
|
|
485
522
|
|
|
@@ -497,11 +534,14 @@
|
|
|
497
534
|
rotate: 90deg;
|
|
498
535
|
}
|
|
499
536
|
|
|
537
|
+
/* Top-aligned in the cell's line: on the text baseline the box hung its descent below the line
|
|
538
|
+
and made every group row two pixels taller than the rows it groups. */
|
|
500
539
|
[data-group-cell] {
|
|
501
540
|
display: inline-flex;
|
|
502
541
|
gap: 6px;
|
|
503
542
|
align-items: center;
|
|
504
543
|
font-weight: 500;
|
|
544
|
+
vertical-align: top;
|
|
505
545
|
}
|
|
506
546
|
|
|
507
547
|
[data-group-count] {
|
|
@@ -509,13 +549,15 @@
|
|
|
509
549
|
color: var(--ledger-color-dimmed);
|
|
510
550
|
}
|
|
511
551
|
|
|
552
|
+
/* Cell padding is Mantine's, set unlayered from the spacing variables its table carries — so
|
|
553
|
+
a cell's padding changes through those variables, never through its padding property. */
|
|
512
554
|
.ledger-cell[data-editing] {
|
|
513
|
-
|
|
555
|
+
--table-vertical-spacing: 2px;
|
|
514
556
|
}
|
|
515
557
|
|
|
516
558
|
/* An `xs` row is as tall as the smallest input Mantine draws: the editor takes the whole of it. */
|
|
517
559
|
.ledger-root[data-size="xs"] .ledger-cell[data-editing] {
|
|
518
|
-
|
|
560
|
+
--table-vertical-spacing: 0px;
|
|
519
561
|
}
|
|
520
562
|
|
|
521
563
|
.ledger-cell-editor {
|
|
@@ -525,6 +567,19 @@
|
|
|
525
567
|
width: 100%;
|
|
526
568
|
}
|
|
527
569
|
|
|
570
|
+
/* The editor follows the column's alignment: a control that does not fill the cell sits where
|
|
571
|
+
the column's values do, and a Mantine input's text aligns the same way, through the variable
|
|
572
|
+
its (possibly unlayered) rule reads — a number no longer jumps to the start as it opens. */
|
|
573
|
+
.ledger-cell[data-align="center"] .ledger-cell-editor {
|
|
574
|
+
--input-text-align: center;
|
|
575
|
+
justify-content: center;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.ledger-cell[data-align="end"] .ledger-cell-editor {
|
|
579
|
+
--input-text-align: end;
|
|
580
|
+
justify-content: flex-end;
|
|
581
|
+
}
|
|
582
|
+
|
|
528
583
|
.ledger-cell-editor[data-pending] {
|
|
529
584
|
opacity: 0.7;
|
|
530
585
|
}
|
|
@@ -592,7 +647,8 @@
|
|
|
592
647
|
* Detail panels, footer, states, chrome
|
|
593
648
|
* ------------------------------------------------------------------------------------------ */
|
|
594
649
|
.ledger-detail-panel {
|
|
595
|
-
|
|
650
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
651
|
+
--table-horizontal-spacing: var(--mantine-spacing-md);
|
|
596
652
|
}
|
|
597
653
|
|
|
598
654
|
.ledger-footer-cell {
|
|
@@ -631,9 +687,8 @@
|
|
|
631
687
|
}
|
|
632
688
|
|
|
633
689
|
.ledger-loader-row td {
|
|
634
|
-
|
|
690
|
+
--table-vertical-spacing: var(--mantine-spacing-sm);
|
|
635
691
|
color: var(--ledger-color-dimmed);
|
|
636
|
-
border-bottom: 0;
|
|
637
692
|
}
|
|
638
693
|
|
|
639
694
|
/* The cell holds a centred pair — spinner + text, or message + retry — so it is laid out as
|
|
@@ -769,9 +824,9 @@
|
|
|
769
824
|
opacity: 0.4;
|
|
770
825
|
}
|
|
771
826
|
|
|
772
|
-
/* A translucent grip is enough of a "this list reorders" hint; the hovered row sharpens it.
|
|
827
|
+
/* A translucent grip is enough of a "this list reorders" hint; the hovered row sharpens it.
|
|
828
|
+
Its cursor is set inline, since Mantine's button carries an unlayered one. */
|
|
773
829
|
.ledger-columns-panel-handle {
|
|
774
|
-
cursor: grab;
|
|
775
830
|
opacity: 0.3;
|
|
776
831
|
transition: opacity 120ms ease;
|
|
777
832
|
}
|
|
@@ -781,10 +836,6 @@
|
|
|
781
836
|
opacity: 1;
|
|
782
837
|
}
|
|
783
838
|
|
|
784
|
-
.ledger-columns-panel-item[data-dragging] .ledger-columns-panel-handle {
|
|
785
|
-
cursor: grabbing;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
839
|
/* The checkbox's label wrapper. Mantine already clears min-width on the body between them, so
|
|
789
840
|
this is the last link in the chain that must be allowed to shrink; without it the nowrap
|
|
790
841
|
title below sets an unshrinkable floor and shoves the rest of the row out of alignment. */
|
|
@@ -856,10 +907,11 @@
|
|
|
856
907
|
opacity: 1;
|
|
857
908
|
}
|
|
858
909
|
|
|
859
|
-
/* Widths are numbers the table's own cells would show right-aligned and tabular.
|
|
910
|
+
/* Widths are numbers the table's own cells would show right-aligned and tabular. The
|
|
911
|
+
alignment rides the variable Mantine's input reads, since its rule may be unlayered. */
|
|
860
912
|
.ledger-columns-panel-width-input {
|
|
913
|
+
--input-text-align: end;
|
|
861
914
|
font-variant-numeric: tabular-nums;
|
|
862
|
-
text-align: end;
|
|
863
915
|
}
|
|
864
916
|
|
|
865
917
|
/* ------------------------------------------------------------------------------------------
|
|
@@ -868,11 +920,12 @@
|
|
|
868
920
|
* positions; our tables are border-collapse: separate (inline), so every cell carries its
|
|
869
921
|
* border wherever it sticks.
|
|
870
922
|
*
|
|
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
|
|
923
|
+
* Three edges, one line each (docs/styling.md#borders): row separators sit BETWEEN rows — the
|
|
924
|
+
* last one included while empty body continues under it, but never on the body's bottom edge
|
|
925
|
+
* (Mantine's Table rule — a bordered host closes the table with its own edge); the closing line
|
|
926
|
+
* on that edge is the opt-in `withBottomBorder` seam; the `withTableBorder` frame is four real
|
|
927
|
+
* borders and owns every edge, so under it the body's seam and the footer's trailing line stay
|
|
928
|
+
* off.
|
|
876
929
|
* ------------------------------------------------------------------------------------------ */
|
|
877
930
|
|
|
878
931
|
/* Row separators, header half: the header's bottom edge. (The body half follows the column
|
|
@@ -886,8 +939,8 @@
|
|
|
886
939
|
Body rows do not: `spanRows` drops the cells a merged run covers, which promotes whatever
|
|
887
940
|
renders next to `:first-child` and would strip the border off a mid-table column. The cell
|
|
888
941
|
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-
|
|
942
|
+
.ledger-root[data-with-column-borders] :is(.ledger-thead, .ledger-tfoot) > tr > :not(:first-child),
|
|
943
|
+
.ledger-root[data-with-column-borders] .ledger-tbody > tr > td:not([data-leading]) {
|
|
891
944
|
border-inline-start: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
892
945
|
}
|
|
893
946
|
|
|
@@ -897,6 +950,21 @@
|
|
|
897
950
|
border-block-end: 1px solid var(--ledger-border-color, var(--mantine-color-default-border));
|
|
898
951
|
}
|
|
899
952
|
|
|
953
|
+
/* …and the last row's, while the rows end above the body's bottom edge (`data-underfilled`,
|
|
954
|
+
measured): with empty body under it, the last row is a row between like any other. Painted
|
|
955
|
+
inside the cells rather than as a border, so drawing it moves nothing and cannot change the
|
|
956
|
+
measurement that decides it. */
|
|
957
|
+
.ledger-root[data-with-row-borders][data-underfilled] .ledger-tbody :is(.ledger-row[data-last] > td, td[data-last]) {
|
|
958
|
+
background-image:
|
|
959
|
+
linear-gradient(
|
|
960
|
+
var(--ledger-border-color, var(--mantine-color-default-border)),
|
|
961
|
+
var(--ledger-border-color, var(--mantine-color-default-border))
|
|
962
|
+
);
|
|
963
|
+
background-repeat: no-repeat;
|
|
964
|
+
background-position: bottom;
|
|
965
|
+
background-size: 100% 1px;
|
|
966
|
+
}
|
|
967
|
+
|
|
900
968
|
/* The body's bottom seam: an inset overlay on the scroller's last pixel — it adds no height
|
|
901
969
|
and stays put under scroll. It paints as the closing line (`withBottomBorder`, unframed: the
|
|
902
970
|
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.1",
|
|
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",
|