@particle-academy/fancy-sheets 0.7.2 → 0.7.3
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 +13 -0
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,19 @@ pnpm --filter @particle-academy/fancy-sheets clean # Remove dist/
|
|
|
66
66
|
- **Features** — editing, navigation, selection (single, range, multi-range), formatting (bold/italic/align), clipboard (copy/cut/paste with TSV), column resize, freeze rows/cols, undo/redo (50 steps), drag-to-select
|
|
67
67
|
- **Zero third-party dependencies** — custom lexer, parser, evaluator, and dependency graph
|
|
68
68
|
|
|
69
|
+
## Inertia.js integration
|
|
70
|
+
|
|
71
|
+
Spreadsheet uses canvas grid measurement and is **not SSR-safe**. In an Inertia app, wrap with [`<FancyClientOnly>`](https://github.com/Particle-Academy/fancy-inertia/blob/main/docs/USAGE.md#fancyclientonly) from `@particle-academy/fancy-inertia`:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { FancyClientOnly } from "@particle-academy/fancy-inertia";
|
|
75
|
+
import { Spreadsheet } from "@particle-academy/fancy-sheets";
|
|
76
|
+
|
|
77
|
+
<FancyClientOnly fallback={<div className="h-96 animate-pulse rounded bg-zinc-100" />}>
|
|
78
|
+
<Spreadsheet rows={100} cols={26} />
|
|
79
|
+
</FancyClientOnly>
|
|
80
|
+
```
|
|
81
|
+
|
|
69
82
|
## License
|
|
70
83
|
|
|
71
84
|
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -879,8 +879,9 @@ registerFunction("VLOOKUP", (args) => {
|
|
|
879
879
|
const colIdx = Number(flat[2] ?? flat[args[1]?.length ?? 0]);
|
|
880
880
|
if (key === null || isNaN(colIdx)) return "#VALUE!";
|
|
881
881
|
for (let i = 0; i < range.length; i++) {
|
|
882
|
-
|
|
883
|
-
|
|
882
|
+
const v = range[i];
|
|
883
|
+
if (v === key || typeof v === "string" && typeof key === "string" && v.toLowerCase() === key.toLowerCase()) {
|
|
884
|
+
return v ?? "#N/A";
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
887
|
return "#N/A";
|
|
@@ -890,8 +891,9 @@ registerFunction("HLOOKUP", (args) => {
|
|
|
890
891
|
const key = flat[0];
|
|
891
892
|
const range = args[1] ?? [];
|
|
892
893
|
for (let i = 0; i < range.length; i++) {
|
|
893
|
-
|
|
894
|
-
|
|
894
|
+
const v = range[i];
|
|
895
|
+
if (v === key || typeof v === "string" && typeof key === "string" && v.toLowerCase() === key.toLowerCase()) {
|
|
896
|
+
return v ?? "#N/A";
|
|
895
897
|
}
|
|
896
898
|
}
|
|
897
899
|
return "#N/A";
|
|
@@ -908,10 +910,11 @@ registerFunction("MATCH", (args) => {
|
|
|
908
910
|
const key = flat[0];
|
|
909
911
|
const range = args[1] ?? [];
|
|
910
912
|
for (let i = 0; i < range.length; i++) {
|
|
911
|
-
|
|
913
|
+
const v = range[i];
|
|
914
|
+
if (v === key || typeof v === "number" && typeof key === "number" && v === key) {
|
|
912
915
|
return i + 1;
|
|
913
916
|
}
|
|
914
|
-
if (typeof
|
|
917
|
+
if (typeof v === "string" && typeof key === "string" && v.toLowerCase() === key.toLowerCase()) {
|
|
915
918
|
return i + 1;
|
|
916
919
|
}
|
|
917
920
|
}
|