@omnigrid/react 0.1.33 → 0.1.34

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/README.md CHANGED
@@ -69,7 +69,7 @@ include their own light and dark variants; they are not light/dark mode toggles.
69
69
  ## Links
70
70
 
71
71
  - **Source:** https://github.com/KRZK-Apps/omnigrid/tree/main/adapters/react
72
- - **Demo:** https://omnigrid-demo.vercel.app/
72
+ - **Demo:** https://omnigrid.cc/
73
73
  - **Issues:** https://github.com/KRZK-Apps/omnigrid/issues
74
74
 
75
75
  ## License
package/dist/OmniGrid.js CHANGED
@@ -156,6 +156,20 @@ export function OmniGrid({ className, style, slotComponents, cellTooltipRenderer
156
156
  useEffect(() => {
157
157
  onGridReadyRef.current?.(grid);
158
158
  }, [grid]);
159
+ // Row class rules are resolved when pooled rows rebind (grid revision
160
+ // change), not on every React render. When the `rowClassRules` prop
161
+ // reference changes, bump the revision so every visible row re-evaluates
162
+ // its predicates in a single batch. `rowClassRules` must be referentially
163
+ // stable between renders unless its dependencies actually changed
164
+ // (memoize with `useMemo`); otherwise this effect re-fires every render.
165
+ const prevRowClassRulesRef = useRef(undefined);
166
+ useEffect(() => {
167
+ const next = options.rowClassRules;
168
+ if (next !== prevRowClassRulesRef.current) {
169
+ prevRowClassRulesRef.current = next;
170
+ grid.refresh();
171
+ }
172
+ }, [grid, options.rowClassRules]);
159
173
  const autoHeight = style?.height === undefined;
160
174
  const rowHeight = grid.getState().rowHeight;
161
175
  // Column-group header stack: `headerRowCount` group rows (one per depth) above
@@ -220,6 +234,7 @@ export function OmniGrid({ className, style, slotComponents, cellTooltipRenderer
220
234
  // only cedes space to the scrollbar once it is really needed.
221
235
  const verticalScrollbarGutter = "auto";
222
236
  const suppressRowHoverHighlight = options.suppressRowHoverHighlight ?? false;
237
+ const suppressColumnBorders = options.suppressColumnBorders ?? false;
223
238
  const cellFlashRaw = options.cellFlash;
224
239
  const cellFlashDurationMs = cellFlashRaw === true ? 1000 : typeof cellFlashRaw === "number" && cellFlashRaw > 0 ? cellFlashRaw : false;
225
240
  const viewportStyle = {
@@ -227,7 +242,7 @@ export function OmniGrid({ className, style, slotComponents, cellTooltipRenderer
227
242
  height: autoHeight ? measuredHeight : style?.height,
228
243
  ...(cellFlashDurationMs !== false ? { "--omnigrid-flash-duration": `${cellFlashDurationMs}ms` } : {}),
229
244
  };
230
- const viewportClassName = ["omnigrid", className, suppressRowHoverHighlight ? "omnigrid-no-row-hover" : null]
245
+ const viewportClassName = ["omnigrid", className, suppressRowHoverHighlight ? "omnigrid-no-row-hover" : null, suppressColumnBorders ? "omnigrid-no-column-borders" : null]
231
246
  .filter(Boolean)
232
247
  .join(" ");
233
248
  const overlayState = state.overlay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/react",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "React adapter and renderer for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",