@bendyline/squisq-grid-react 2.11.2 → 2.11.4

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.d.ts CHANGED
@@ -325,6 +325,12 @@ interface DataGridProps {
325
325
  onSave?: () => void | Promise<void>;
326
326
  saving?: boolean;
327
327
  height?: number;
328
+ /** Virtual row height in CSS pixels (default 28). */
329
+ rowHeight?: number;
330
+ /** Show the per-column filter controls beneath the sortable header. */
331
+ showFilters?: boolean;
332
+ /** Initial/fallback widths for columns before user resizing. */
333
+ defaultColumnWidths?: readonly number[];
328
334
  /** Reason editing is unavailable (e.g. parquet sidecars). */
329
335
  readOnlyReason?: string;
330
336
  /**
@@ -371,6 +377,6 @@ interface FormulaSupport {
371
377
  getFormula(rowId: number, col: number): string | undefined;
372
378
  commitFormula(rowId: number, col: number, formula: string): Promise<FormulaCommitResult>;
373
379
  }
374
- declare function DataGrid({ provider, journal, view, onViewChange, viewPersisted, onSave, saving, height, readOnlyReason, isCellLocked, lockedReason, formulaSupport, onCellEdited, extraDirtyCount, onDiscardExtra, className, }: DataGridProps): ReactElement;
380
+ declare function DataGrid({ provider, journal, view, onViewChange, viewPersisted, onSave, saving, height, rowHeight, showFilters, defaultColumnWidths, readOnlyReason, isCellLocked, lockedReason, formulaSupport, onCellEdited, extraDirtyCount, onDiscardExtra, className, }: DataGridProps): ReactElement;
375
381
 
376
382
  export { type ColumnarTable, DataGrid, type DataGridProps, EditJournal, type FormulaCommitResult, type FormulaSupport, type IngestCell, type IngestColumnHint, type IngestTable, type JournalEntry, type KernelCellEdit, type KernelColumnPayload, type KernelRequest, type KernelResponse, type KernelScope, LocalKernelHost, type StoreColumn, TableStoreClient, type TableStoreClientOptions, buildColumnarTable, buildKernelSource, columnCellValue, discardJournal, journalFor, tableKernel };
package/dist/index.js CHANGED
@@ -738,6 +738,9 @@ function DataGrid({
738
738
  onSave,
739
739
  saving = false,
740
740
  height = DEFAULT_HEIGHT,
741
+ rowHeight = ROW_HEIGHT,
742
+ showFilters = true,
743
+ defaultColumnWidths,
741
744
  readOnlyReason,
742
745
  isCellLocked,
743
746
  lockedReason,
@@ -816,7 +819,7 @@ function DataGrid({
816
819
  const virtualizer = useVirtualizer({
817
820
  count: viewRowCount,
818
821
  getScrollElement: () => bodyRef.current,
819
- estimateSize: () => ROW_HEIGHT,
822
+ estimateSize: () => rowHeight,
820
823
  overscan: OVERSCAN,
821
824
  // Correct first paint before the scroll element is measured — and the
822
825
  // only measurement available in layout-less environments (jsdom).
@@ -1364,9 +1367,9 @@ function DataGrid({
1364
1367
  const count = schema?.columns.length ?? 0;
1365
1368
  return Array.from(
1366
1369
  { length: count },
1367
- (_, col) => `${colWidths[col] ?? DEFAULT_COL_WIDTH}px`
1370
+ (_, col) => `${colWidths[col] ?? defaultColumnWidths?.[col] ?? DEFAULT_COL_WIDTH}px`
1368
1371
  ).join(" ");
1369
- }, [colWidths, schema]);
1372
+ }, [colWidths, defaultColumnWidths, schema]);
1370
1373
  const range = selection ? normalizedRange(selection) : null;
1371
1374
  const filterValueFor = (name) => view.filter.find((clause) => clause.column === name)?.value ?? "";
1372
1375
  return /* @__PURE__ */ jsxs(
@@ -1436,7 +1439,7 @@ function DataGrid({
1436
1439
  ]
1437
1440
  }
1438
1441
  ),
1439
- /* @__PURE__ */ jsx("div", { className: "squisq-grid-filterrow", children: (() => {
1442
+ showFilters && /* @__PURE__ */ jsx("div", { className: "squisq-grid-filterrow", children: (() => {
1440
1443
  const opState = opStateFor(col, column.name);
1441
1444
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1442
1445
  /* @__PURE__ */ jsxs(
@@ -1490,7 +1493,11 @@ function DataGrid({
1490
1493
  className: "squisq-grid-resizer",
1491
1494
  onPointerDown: (event) => {
1492
1495
  event.preventDefault();
1493
- startResize(col, event.clientX, colWidths[col] ?? DEFAULT_COL_WIDTH);
1496
+ startResize(
1497
+ col,
1498
+ event.clientX,
1499
+ colWidths[col] ?? defaultColumnWidths?.[col] ?? DEFAULT_COL_WIDTH
1500
+ );
1494
1501
  }
1495
1502
  }
1496
1503
  )
@@ -1512,7 +1519,7 @@ function DataGrid({
1512
1519
  style: {
1513
1520
  transform: `translateY(${item.start}px)`,
1514
1521
  gridTemplateColumns: gridTemplate,
1515
- height: ROW_HEIGHT
1522
+ height: rowHeight
1516
1523
  },
1517
1524
  children: schema?.columns.map((column, col) => {
1518
1525
  const inRange = range && item.index >= range.r0 && item.index <= range.r1 && col >= range.c0 && col <= range.c1;
@@ -7,7 +7,7 @@
7
7
  border-radius: 8px;
8
8
  background: var(--squisq-grid-bg, #ffffff);
9
9
  color: var(--squisq-grid-text, #1f2937);
10
- font-size: 0.82rem;
10
+ font-size: var(--squisq-grid-font-size, 0.82rem);
11
11
  overflow: hidden;
12
12
  }
13
13
  .squisq-grid-scroller {
@@ -39,6 +39,7 @@
39
39
  border: none;
40
40
  background: none;
41
41
  font: inherit;
42
+ font-family: var(--squisq-grid-header-font-family, inherit);
42
43
  font-weight: 600;
43
44
  color: var(--squisq-grid-header-text, #374151);
44
45
  padding: 4px 8px 2px;
@@ -197,6 +198,9 @@
197
198
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
198
199
  font-weight: 400;
199
200
  }
201
+ .squisq-grid-valuemenu > * {
202
+ flex: none;
203
+ }
200
204
  .squisq-grid-valueoption {
201
205
  display: block;
202
206
  overflow: hidden;
@@ -298,7 +302,7 @@
298
302
  padding: 4px 10px;
299
303
  border-top: 1px solid var(--squisq-grid-border, #d1d5db);
300
304
  background: var(--squisq-grid-header-bg, #f9fafb);
301
- font-size: 0.74rem;
305
+ font-size: var(--squisq-grid-footer-font-size, 0.74rem);
302
306
  color: var(--squisq-grid-text-muted, #6b7280);
303
307
  }
304
308
  .squisq-grid-status {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-grid-react",
3
- "version": "2.11.2",
3
+ "version": "2.11.4",
4
4
  "description": "Virtualized data grid for squisq data sidecars: columnar worker store, TableQueryProvider, and a TanStack-Virtual React renderer",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -53,7 +53,7 @@
53
53
  "typecheck": "tsc --noEmit"
54
54
  },
55
55
  "dependencies": {
56
- "@bendyline/squisq": "2.11.1",
56
+ "@bendyline/squisq": "2.11.3",
57
57
  "@tanstack/react-virtual": "3.14.10"
58
58
  },
59
59
  "peerDependencies": {