@gridsheet/preact-core 3.4.0 → 3.4.2

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { h, render } from "preact";
2
- import { f as fe, u as ue, p as pe, k as ks, _, t as te, D as Dn, a as useBrowser, s as setEditingAddress, o as oe, G, w as write, b as setInputting, c as updateSheet, d as bt, e as te$1, g as ae, r as redo, h as undo, i as cut, P as Pe, j as fillRight, l as setSearchQuery, m as setEntering, n as fillDown, q as copy, v as select, x as selectToDataEdge, y as arrow, z as escape, A as clear, R, B as walk, M as Mn, C as ee, E as paste, F as setEditorHovering, H as Pn, I as setStore, J as submitAutofill, K as setDragging, L as setAutofillDraggingTo, N as drag, O as he, Q as rt, S as setResizingPositionY, T as setResizingPositionX, U as nn, V as cn, W as M, X as qr, Z as Zr, Y as filterRows, $ as sortRows, a0 as an, a1 as removeCols, a2 as removeRows, a3 as insertColsRight, a4 as insertColsLeft, a5 as insertRowsBelow, a6 as insertRowsAbove, a7 as setContextMenuPosition, a8 as Ln, a9 as setColumnMenu, aa as setRowMenu, ab as isXSheetFocused, ac as setEditorRect, ad as S, ae as L, af as choose, ag as q, ah as rn, ai as ce, aj as be, ak as on, al as le, am as re, an as selectCols, ao as useDebounceCallback, ap as selectRows, aq as W, ar as Hn, as as Q, at as T, au as ge, av as se, aw as ne, ax as en, ay as bn, az as Z, aA as ie, aB as de, aC as search, aD as setSearchCaseSensitive, aE as setSearchRegex, aF as wn, aG as setSearchRange, aH as useBook, aI as Y, aJ as reducer, aK as me, aL as isAsyncMutationAction, aM as isMutationAction, aN as commitAsyncOp, aO as Hs, aP as $e, aQ as $t, aR as jr, aS as Le, aT as kt, aU as Gr } from "./hooks-BTcuh87d.mjs";
3
- import { bi, bj, bA, bk, bz, bx, bn as bn2, bl, b6, bB, by, b1, bm, aW, a_, a$, b0, aX, aY, b2, b5, bs, bv, b7, bu, b8, bt as bt2, bq, br, bp, bo, aZ, aV, b3, b4, bw, bh, be as be2, bf, bg, bd, b9, ba, bb, bc, bC } from "./hooks-BTcuh87d.mjs";
2
+ import { f as fe, u as ue, p as pe, k as ks, _, t as te, D as Dn, a as useBrowser, s as setEditingAddress, o as oe, G, w as write, b as setInputting, c as updateSheet, d as bt, e as te$1, g as ae, r as redo, h as undo, i as cut, P as Pe, j as fillRight, l as setSearchQuery, m as setEntering, n as fillDown, q as copy, v as select, x as selectToDataEdge, y as arrow, z as escape, A as clear, R, B as walk, M as Mn, C as ee, E as paste, F as setEditorHovering, H as Pn, I as setStore, J as submitAutofill, K as setDragging, L as setAutofillDraggingTo, N as drag, O as he, Q as rt, S as setResizingPositionY, T as setResizingPositionX, U as nn, V as cn, W as M, X as qr, Z as Zr, Y as filterRows, $ as sortRows, a0 as an, a1 as removeCols, a2 as removeRows, a3 as insertColsRight, a4 as insertColsLeft, a5 as insertRowsBelow, a6 as insertRowsAbove, a7 as setContextMenuPosition, a8 as Ln, a9 as setColumnMenu, aa as setRowMenu, ab as isXSheetFocused, ac as setEditorRect, ad as S, ae as L, af as choose, ag as q, ah as rn, ai as ce, aj as be, ak as on, al as le, am as re, an as selectCols, ao as useDebounceCallback, ap as selectRows, aq as W, ar as Hn, as as Q, at as T, au as ge, av as se, aw as ne, ax as en, ay as bn, az as Z, aA as ie, aB as de, aC as search, aD as setSearchCaseSensitive, aE as setSearchRegex, aF as wn, aG as setSearchRange, aH as useBook, aI as Y, aJ as reducer, aK as me, aL as isAsyncMutationAction, aM as isMutationAction, aN as commitAsyncOp, aO as Hs, aP as $e, aQ as $t, aR as jr, aS as Le, aT as kt, aU as Gr } from "./hooks-Ij1DTX5N.mjs";
3
+ import { bi, bj, bA, bk, bz, bx, bn as bn2, bl, b6, bB, by, b1, bm, aW, a_, a$, b0, aX, aY, b2, b5, bs, bv, b7, bu, b8, bt as bt2, bq, br, bp, bo, aZ, aV, b3, b4, bw, bh, be as be2, bf, bg, bd, b9, ba, bb, bc, bC } from "./hooks-Ij1DTX5N.mjs";
4
4
  import { jsx, jsxs, Fragment } from "preact/compat/jsx-runtime";
5
5
  import React, { createContext, forwardRef, useState, useImperativeHandle, useRef, useContext, useLayoutEffect, useMemo, useCallback, createPortal, memo, useEffect, createRef, useReducer } from "preact/compat";
6
6
  import { Children, Component, Fragment as Fragment2, PureComponent, StrictMode, Suspense, SuspenseList, cloneElement, render as render2, createContext as createContext2, createElement, createFactory, createPortal as createPortal2, createRef as createRef2, findDOMNode, forwardRef as forwardRef2, hydrate, isValidElement, lazy, memo as memo2, unmountComponentAtNode, unstable_batchedUpdates, useCallback as useCallback2, useContext as useContext2, useDebugValue, useEffect as useEffect2, useImperativeHandle as useImperativeHandle2, useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useReducer as useReducer2, useRef as useRef2, useState as useState2, version } from "preact/compat";
@@ -5413,7 +5413,9 @@ function GridSheet({
5413
5413
  }
5414
5414
  }
5415
5415
  const root = rootRef.current;
5416
- setSheetHeight(root ? Math.min(el.clientHeight, root.clientHeight) : el.clientHeight);
5416
+ if (fillHeight || el.style.height) {
5417
+ setSheetHeight(root ? Math.min(el.clientHeight, root.clientHeight) : el.clientHeight);
5418
+ }
5417
5419
  setSheetWidth(root ? Math.min(el.clientWidth, root.clientWidth) : el.clientWidth);
5418
5420
  });
5419
5421
  ro.observe(el);
@@ -5533,8 +5535,11 @@ function GridSheet({
5533
5535
  ...fillWidth ? { width: "100%" } : null,
5534
5536
  maxWidth: "100%",
5535
5537
  // In fill-height mode the parent's height is the limit (flex:1 fills the remaining
5536
- // space below the formula bar); otherwise cap at the viewport bottom as before.
5537
- ...fillHeight ? { flex: 1, minHeight: 0, maxHeight: "100%" } : {
5538
+ // space below the formula bar). With an explicit fixed height, honor it exactly
5539
+ // (never shrink to the viewport — otherwise a grid placed low on a page or in a
5540
+ // short viewport collapses). Only the shrink-to-content case caps at the viewport
5541
+ // bottom so a very tall grid stays usable within the current view.
5542
+ ...fillHeight ? { flex: 1, minHeight: 0, maxHeight: "100%" } : fixedHeight ? { maxHeight: sheetHeight } : {
5538
5543
  maxHeight: mainRef.current ? window.innerHeight - mainRef.current.getBoundingClientRect().top : (((_c = store.sheetReactive.current) == null ? void 0 : _c.fullHeight) || 0) + 2
5539
5544
  },
5540
5545
  resize: sheetResize,