@lavalogic/scoria 0.37.10 → 0.37.11
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.
|
@@ -205,6 +205,7 @@
|
|
|
205
205
|
.virtual-spacer {
|
|
206
206
|
display: block;
|
|
207
207
|
border: none;
|
|
208
|
-
background: transparent;
|
|
209
208
|
pointer-events: none;
|
|
209
|
+
--row-stripe-height: var(--height, 3rem);
|
|
210
|
+
background-image: repeating-linear-gradient(to bottom, #ffffff 0, #ffffff var(--row-stripe-height), #f4f7f9 var(--row-stripe-height), #f4f7f9 calc(2 * var(--row-stripe-height)));
|
|
210
211
|
}</style>
|
|
@@ -100,7 +100,14 @@ function commonProps(opts, kind) {
|
|
|
100
100
|
const defaultWidth = KIND_DEFAULT_WIDTHS[kind];
|
|
101
101
|
return {
|
|
102
102
|
header: opts.header,
|
|
103
|
-
minSize
|
|
103
|
+
// Set minSize from the per-kind default too so
|
|
104
|
+
// `TableContext.registerDefs` does NOT run the canvas-based
|
|
105
|
+
// `measureHeaderWidth` fallback. That fallback floors every
|
|
106
|
+
// accessor column to ~130px when quick-filtering is enabled
|
|
107
|
+
// (it returns max(headerWidth, "Lorem Ipsum Dolor" width)),
|
|
108
|
+
// which equalises every accessor column width and erases the
|
|
109
|
+
// per-kind differentiation the factory just put in place.
|
|
110
|
+
minSize: opts.minWidth ?? defaultWidth,
|
|
104
111
|
width: opts.width ?? defaultWidth,
|
|
105
112
|
allowSorting: opts.allowSorting,
|
|
106
113
|
allowFiltering: opts.allowFiltering,
|
|
@@ -307,7 +314,7 @@ export function createColumnFactory() {
|
|
|
307
314
|
const def = new ValidityDef({
|
|
308
315
|
id,
|
|
309
316
|
header: opts?.header ?? '',
|
|
310
|
-
minSize: opts?.minWidth,
|
|
317
|
+
minSize: opts?.minWidth ?? KIND_DEFAULT_WIDTHS.validity,
|
|
311
318
|
width: opts?.width ?? KIND_DEFAULT_WIDTHS.validity,
|
|
312
319
|
defaultHidden: opts?.defaultHidden,
|
|
313
320
|
resizable: opts?.resizable ?? false,
|
|
@@ -50,7 +50,17 @@ export class VirtualisationState {
|
|
|
50
50
|
constructor(deps, options = {}) {
|
|
51
51
|
this._deps = deps;
|
|
52
52
|
this._virtualisationThreshold = options.threshold ?? 100;
|
|
53
|
-
|
|
53
|
+
// Overscan controls how many rows above/below the viewport are
|
|
54
|
+
// kept rendered so a fast wheel-scroll does not surface an empty
|
|
55
|
+
// grey band before the next paint. The previous default of 10
|
|
56
|
+
// was too tight on tables with hundreds of rows: a single wheel
|
|
57
|
+
// flick easily moves the viewport past the overscan band before
|
|
58
|
+
// the `$derived` chain reschedules and re-renders the visible
|
|
59
|
+
// slice. 30 rows is enough to absorb a typical wheel flick at
|
|
60
|
+
// 60Hz while still keeping the rendered cell count bounded
|
|
61
|
+
// (~52 rows for a 600px viewport at the default 28-48px row
|
|
62
|
+
// height: 12 visible + 30 below + 10 above = 52).
|
|
63
|
+
this._overscan = options.overscan ?? 30;
|
|
54
64
|
}
|
|
55
65
|
get virtualisationThreshold() {
|
|
56
66
|
return this._virtualisationThreshold;
|