@gridsheet/preact-core 2.0.3 → 2.0.5-0

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
@@ -8,7 +8,7 @@ Spreadsheet component for Preact
8
8
  npm install @gridsheet/preact-core
9
9
  ```
10
10
 
11
- ## Peer Dependencies
11
+ ### Peer Dependencies
12
12
 
13
13
  This package requires the following peer dependencies:
14
14
 
@@ -67,6 +67,11 @@ This package exports all the core GridSheet functionality along with Preact comp
67
67
  - Core GridSheet components and utilities
68
68
  - Preact-specific exports (`h`, `render`)
69
69
 
70
+ ## Docs
71
+
72
+ - [GridSheet document](https://gridsheet.walkframe.com/)
73
+ - [Examples](https://gridsheet.walkframe.com/examples/case1)
74
+
70
75
  ## Development
71
76
 
72
77
  ```bash
@@ -1,2 +1,6 @@
1
- export declare const FormulaBar: () => JSX.Element;
1
+ type FormulaBarProps = {
2
+ ready: boolean;
3
+ };
4
+ export declare const FormulaBar: ({ ready }: FormulaBarProps) => JSX.Element;
5
+ export {};
2
6
  //# sourceMappingURL=FormulaBar.d.ts.map
package/dist/index.js CHANGED
@@ -10416,7 +10416,7 @@ const embedStyle = () => {
10416
10416
  style.setAttribute("data-modified-at", `${LAST_MODIFIED}`);
10417
10417
  style.innerText = CSS;
10418
10418
  };
10419
- const FormulaBar = () => {
10419
+ const FormulaBar = ({ ready }) => {
10420
10420
  var _a;
10421
10421
  const { store, dispatch } = useContext(Context);
10422
10422
  const [before, setBefore] = useState("");
@@ -10465,7 +10465,6 @@ const FormulaBar = () => {
10465
10465
  }, []);
10466
10466
  const largeInput = largeEditorRef.current;
10467
10467
  const handleInput = useCallback((e) => {
10468
- console.log("e.currentTarget.value", e.currentTarget.value);
10469
10468
  dispatch(setInputting(e.currentTarget.value));
10470
10469
  }, []);
10471
10470
  const updateScroll = useCallback(() => {
@@ -10557,14 +10556,15 @@ const FormulaBar = () => {
10557
10556
  },
10558
10557
  [table, choosing, before, writeCell, updateScroll]
10559
10558
  );
10559
+ const style = ready ? {} : { visibility: "hidden" };
10560
10560
  if (!table) {
10561
- return /* @__PURE__ */ jsxs("label", { className: "gs-formula-bar gs-hidden", children: [
10561
+ return /* @__PURE__ */ jsxs("label", { className: "gs-formula-bar gs-hidden", style, children: [
10562
10562
  /* @__PURE__ */ jsx("div", { className: "gs-selecting-address" }),
10563
10563
  /* @__PURE__ */ jsx("div", { className: "gs-fx", children: "Fx" }),
10564
10564
  /* @__PURE__ */ jsx("div", { className: "gs-formula-bar-editor-inner", children: /* @__PURE__ */ jsx("textarea", {}) })
10565
10565
  ] });
10566
10566
  }
10567
- return /* @__PURE__ */ jsxs("label", { className: "gs-formula-bar", children: [
10567
+ return /* @__PURE__ */ jsxs("label", { className: "gs-formula-bar", "data-sheet-id": store.sheetId, style, children: [
10568
10568
  /* @__PURE__ */ jsx(ScrollHandle, { style: { position: "absolute", left: 0, top: 0, zIndex: 2 }, vertical: -1 }),
10569
10569
  /* @__PURE__ */ jsx("div", { className: "gs-selecting-address", children: address }),
10570
10570
  /* @__PURE__ */ jsx("div", { className: "gs-fx", children: "Fx" }),
@@ -10852,7 +10852,7 @@ function GridSheet({
10852
10852
  /* @__PURE__ */ jsx(ScrollHandle, { style: { position: "fixed", top: 0, left: 0 } }),
10853
10853
  /* @__PURE__ */ jsx(ScrollHandle, { style: { position: "absolute", zIndex: 4, right: 0, top: 0, width: 5 }, horizontal: 1 }),
10854
10854
  /* @__PURE__ */ jsx(ScrollHandle, { style: { position: "absolute", zIndex: 4, left: 0, bottom: 0, height: 5 }, vertical: 1 }),
10855
- typeof store.searchQuery === "undefined" ? showFormulaBar && /* @__PURE__ */ jsx(FormulaBar, {}) : /* @__PURE__ */ jsx(SearchBar, {}),
10855
+ typeof store.searchQuery === "undefined" ? showFormulaBar && /* @__PURE__ */ jsx(FormulaBar, { ready: wire.ready }) : /* @__PURE__ */ jsx(SearchBar, {}),
10856
10856
  /* @__PURE__ */ jsxs(
10857
10857
  "div",
10858
10858
  {