diff --git a/docz/docs/03-demos/02-frontend/03-angular.md b/docz/docs/03-demos/02-frontend/03-angular.md index 9143c5f..1f16cbf 100644 --- a/docz/docs/03-demos/02-frontend/03-angular.md +++ b/docz/docs/03-demos/02-frontend/03-angular.md @@ -321,9 +321,9 @@ interface President { Name: string; Index: number }; {{row.Index}} // highlight-end - + - + ` }) @@ -379,9 +379,9 @@ interface President { Name: string; Index: number }; } // highlight-end - + - + ` }) @@ -425,6 +425,7 @@ This demo was tested in the following environments: | Angular | Date | |:----------|:-----------| +| `20.2.3` | 2025-09-03 | | `19.0.5` | 2025-01-03 | | `18.2.13` | 2025-01-03 | | `17.3.12` | 2025-01-03 | @@ -441,7 +442,7 @@ npx @angular/cli analytics disable -g 1) Create a new project: ```bash -npx @angular/cli@19 new --minimal --defaults --no-interactive sheetjs-angular +npx @angular/cli@20 new --minimal --defaults --no-interactive sheetjs-angular ``` :::note pass @@ -468,8 +469,20 @@ npm start`} 3) Open a web browser and access the displayed URL (`http://localhost:4200`) 4) In the previous `src/app/app.component.ts` code snippet, select the tab for -the appropriate version of Angular ("Angular 2-16" or "Angular 17+"), copy the -code contents and replace `src/app/app.component.ts` in the project. +the appropriate version of Angular ("Angular 2-16" or "Angular 17+") and copy +the code. Replace `src/app/app.component.ts` or `src/app/app.ts` in the project. + +For Angular 20+, after replacing `src/app/app.ts`, edit the script and change +the exported class name to `App`: + +```ts title="src/app/app.ts (edit highlighted line if file exists)" +// ... +}) + // highlight-next-line +export class App { + rows: President[] = [ { Name: "SheetJS", Index: 0 }]; +// ... +``` The page will refresh and show a table with an Export button. Click the button and the page will attempt to download `SheetJSAngularAoO.xlsx`. Open the file diff --git a/docz/docs/03-demos/02-frontend/05-svelte.md b/docz/docs/03-demos/02-frontend/05-svelte.md index 9b0216e..41e878c 100644 --- a/docz/docs/03-demos/02-frontend/05-svelte.md +++ b/docz/docs/03-demos/02-frontend/05-svelte.md @@ -130,7 +130,7 @@ function exportFile() { - + ``` @@ -143,7 +143,7 @@ This demo was tested in the following environments: | SvelteJS | ViteJS | Date | |:---------|:---------|:-----------| -| `5.25.3` | `6.2.3` | 2025-03-30 | +| `5.38.6` | `7.1.1` | 2025-09-03 | ::: diff --git a/docz/docs/03-demos/19-desktop/01-electron.md b/docz/docs/03-demos/19-desktop/01-electron.md index 85d350b..6409158 100644 --- a/docz/docs/03-demos/19-desktop/01-electron.md +++ b/docz/docs/03-demos/19-desktop/01-electron.md @@ -44,7 +44,7 @@ The [SheetJS NodeJS Module](/docs/getting-started/installation/nodejs) can be imported from the main or the renderer thread. The SheetJS `readFile` and `writeFile` methods will use the Electron `fs` module -where available. +where available.
Renderer Configuration (click to show) @@ -57,6 +57,37 @@ Electron 12 and later also require `worldSafeExecuteJavascript: true` and
+:::caution pass + +The [SheetJS Standalone scripts](/docs/getting-started/installation/standalone) +can be loaded from the renderer thread using a standard `SCRIPT` tag, but it is +strongly discouraged. + +[Issue 3314](https://git.sheetjs.com/sheetjs/sheetjs/issues/3314) in the SheetJS +CE issue tracker describes the required HTML configuration. + +
+ HTML Configuration (click to show) + +The following CSP directives should be specified in the `HEAD` block: + +```html + + +``` + +Without these settings, newer Electron versions will not run the scripts. + +
+ +::: + ### Reading Files Electron offers 3 different ways to read files, two of which use Web APIs. @@ -208,7 +239,7 @@ This demo was tested in the following environments: | OS and Version | Architecture | Electron | Date | |:---------------|:-------------|:---------|:-----------| | macOS 15.3 | `darwin-x64` | `35.1.2` | 2025-03-31 | -| macOS 14.5 | `darwin-arm` | `35.1.2` | 2025-03-30 | +| macOS 14.5 | `darwin-arm` | `35.1.2` | 2025-08-30 | | Windows 11 | `win11-x64` | `33.2.1` | 2025-02-11 | | Windows 11 | `win11-arm` | `33.2.1` | 2025-02-23 | | Linux (Ubuntu) | `linux-x64` | `35.1.2` | 2025-07-06 | diff --git a/docz/docs/03-demos/42-engines/01-duktape.md b/docz/docs/03-demos/42-engines/01-duktape.md index 4351bd4..1193bed 100644 --- a/docz/docs/03-demos/42-engines/01-duktape.md +++ b/docz/docs/03-demos/42-engines/01-duktape.md @@ -129,7 +129,7 @@ This demo was tested in the following deployments: | Architecture | Version | Date | |:-------------|:--------|:-----------| | `darwin-x64` | `2.7.0` | 2025-03-31 | -| `darwin-arm` | `2.7.0` | 2025-02-13 | +| `darwin-arm` | `2.7.0` | 2025-09-03 | | `win11-x64` | `2.7.0` | 2025-04-28 | | `win11-arm` | `2.7.0` | 2025-02-23 | | `linux-x64` | `2.7.0` | 2025-04-21 | diff --git a/docz/docs/03-demos/42-engines/08-quickjs.md b/docz/docs/03-demos/42-engines/08-quickjs.md index 333b022..4bb71ca 100644 --- a/docz/docs/03-demos/42-engines/08-quickjs.md +++ b/docz/docs/03-demos/42-engines/08-quickjs.md @@ -264,7 +264,7 @@ This demo was tested in the following deployments: | Architecture | Library | Git Commit | Date | |:-------------|:-----------|:-----------|:-----------| | `darwin-x64` | QuickJS | `0d7aaed` | 2025-03-31 | -| `darwin-arm` | QuickJS | `3306254` | 2025-04-24 | +| `darwin-arm` | QuickJS | `3306254` | 2025-09-03 | | `win11-x64` | QuickJS-NG | `865ba1f` | 2025-04-18 | | `win11-arm` | QuickJS-NG | `865ba1f` | 2025-04-18 | | `linux-x64` | QuickJS | `3306254` | 2025-06-18 | diff --git a/docz/docs/03-demos/42-engines/09-hermes.md b/docz/docs/03-demos/42-engines/09-hermes.md index 1413a4d..3f3f48a 100644 --- a/docz/docs/03-demos/42-engines/09-hermes.md +++ b/docz/docs/03-demos/42-engines/09-hermes.md @@ -365,7 +365,7 @@ This demo was tested in the following deployments: | Architecture | Git Commit | Date | |:-------------|:-----------|:-----------| | `darwin-x64` | `8ef11b4` | 2025-03-31 | -| `darwin-arm` | `8ef11b4` | 2025-08-07 | +| `darwin-arm` | `8ef11b4` | 2025-09-03 | | `linux-x64` | `8ef11b4` | 2025-04-21 | | `linux-arm` | `388376f` | 2025-02-15 | diff --git a/docz/docs/03-demos/42-engines/15-rb.md b/docz/docs/03-demos/42-engines/15-rb.md index 82b2108..c30c3b2 100644 --- a/docz/docs/03-demos/42-engines/15-rb.md +++ b/docz/docs/03-demos/42-engines/15-rb.md @@ -88,7 +88,7 @@ This demo was tested in the following deployments: | Platform | Ruby | ExecJS | Date | |:-------------|:---------|:---------|:-----------| | `darwin-x64` | `2.6.10` | `2.10.0` | 2025-03-31 | -| `darwin-arm` | `2.6.10` | `2.10.0` | 2025-02-13 | +| `darwin-arm` | `2.6.10` | `2.10.0` | 2025-09-03 | | `win11-x64` | `3.3.8` | `2.10.0` | 2025-04-28 | | `win11-arm` | `3.2.3` | `2.10.0` | 2025-02-23 | | `linux-x64` | `3.2.3` | `2.10.0` | 2025-04-21 | diff --git a/docz/docs/03-demos/42-engines/20-chakra.md b/docz/docs/03-demos/42-engines/20-chakra.md index eeee27d..d7afe28 100644 --- a/docz/docs/03-demos/42-engines/20-chakra.md +++ b/docz/docs/03-demos/42-engines/20-chakra.md @@ -133,7 +133,7 @@ This demo was tested in the following deployments: | Architecture | Git Commit | Date | |:-------------|:-----------|:-----------| | `darwin-x64` | `36becec` | 2025-03-31 | -| `darwin-arm` | `36becec` | 2025-06-20 | +| `darwin-arm` | `36becec` | 2025-09-03 | | `win11-x64` | `36becec` | 2025-04-28 | | `win11-arm` | `e26c81f` | 2025-02-23 | | `linux-x64` | `36becec` | 2025-06-18 | diff --git a/docz/docs/03-demos/42-engines/21-boa.md b/docz/docs/03-demos/42-engines/21-boa.md index 330c179..a6c0093 100644 --- a/docz/docs/03-demos/42-engines/21-boa.md +++ b/docz/docs/03-demos/42-engines/21-boa.md @@ -105,7 +105,7 @@ This demo was tested in the following deployments: | Architecture | Boa | Date | |:-------------|:---------|:-----------| | `darwin-x64` | `0.20.0` | 2025-03-31 | -| `darwin-arm` | `0.20.0` | 2025-02-13 | +| `darwin-arm` | `0.20.0` | 2025-09-03 | | `win11-x64` | `0.20.0` | 2025-04-28 | | `win11-arm` | `0.20.0` | 2025-02-23 | | `linux-x64` | `0.20.0` | 2025-04-21 | diff --git a/docz/docs/03-demos/42-engines/22-perl.md b/docz/docs/03-demos/42-engines/22-perl.md index 93bb076..1e073c3 100644 --- a/docz/docs/03-demos/42-engines/22-perl.md +++ b/docz/docs/03-demos/42-engines/22-perl.md @@ -128,7 +128,7 @@ This demo was tested in the following deployments: | Architecture | Version | Date | |:-------------|:--------|:-----------| | `darwin-x64` | `0.066` | 2025-03-31 | -| `darwin-arm` | `0.066` | 2025-02-13 | +| `darwin-arm` | `0.066` | 2025-09-03 | | `linux-x64` | `0.066` | 2025-06-16 | | `linux-arm` | `0.066` | 2025-02-15 | diff --git a/docz/docs/03-demos/42-engines/23-jerryscript.md b/docz/docs/03-demos/42-engines/23-jerryscript.md index ed4fe5e..f9cb9a1 100644 --- a/docz/docs/03-demos/42-engines/23-jerryscript.md +++ b/docz/docs/03-demos/42-engines/23-jerryscript.md @@ -37,7 +37,7 @@ This demo was tested in the following environments: | Architecture | Commit | Date | |:-------------|:----------|:-----------| | `darwin-x64` | `5020015` | 2025-03-31 | -| `darwin-arm` | `d2d30df` | 2025-02-13 | +| `darwin-arm` | `355ab24` | 2025-09-03 | | `win11-x64` | `5020015` | 2025-04-23 | | `win11-arm` | `5020015` | 2025-02-23 | | `linux-x64` | `5020015` | 2025-04-21 | diff --git a/docz/docs/03-demos/42-engines/25-mujs.md b/docz/docs/03-demos/42-engines/25-mujs.md index a67c454..f4ac259 100644 --- a/docz/docs/03-demos/42-engines/25-mujs.md +++ b/docz/docs/03-demos/42-engines/25-mujs.md @@ -323,7 +323,7 @@ This demo was tested in the following deployments: | Architecture | Version | Date | |:-------------|:--------|:-----------| | `darwin-x64` | `1.3.6` | 2025-03-31 | -| `darwin-arm` | `1.3.5` | 2025-02-13 | +| `darwin-arm` | `1.3.6` | 2025-09-03 | | `win11-x64` | `1.3.6` | 2025-04-23 | | `win11-arm` | `1.3.5` | 2025-02-23 | | `linux-x64` | `1.3.6` | 2025-06-16 | diff --git a/docz/docs/03-demos/42-engines/26-jurassic.md b/docz/docs/03-demos/42-engines/26-jurassic.md index b889d5d..6355a94 100644 --- a/docz/docs/03-demos/42-engines/26-jurassic.md +++ b/docz/docs/03-demos/42-engines/26-jurassic.md @@ -177,7 +177,7 @@ This demo was tested in the following deployments: | Architecture | Jurassic | Date | |:-------------|:---------|:-----------| | `darwin-x64` | `3.2.9` | 2025-03-31 | -| `darwin-arm` | `3.2.9` | 2025-03-30 | +| `darwin-arm` | `3.2.9` | 2025-09-03 | | `win11-x64` | `3.2.9` | 2025-04-23 | | `win11-arm` | `3.2.9` | 2025-02-23 | | `linux-x64` | `3.2.9` | 2025-06-16 | diff --git a/docz/docs/07-csf/07-features/07-vba.md b/docz/docs/07-csf/07-features/07-vba.md index a02721c..d4ae160 100644 --- a/docz/docs/07-csf/07-features/07-vba.md +++ b/docz/docs/07-csf/07-features/07-vba.md @@ -69,7 +69,9 @@ the VBA project, and exporting new VBA blobs. ## Demos The export demos focus on [an example](pathname:///vba/SheetJSVBAFormula.xlsm) -that includes the following user-defined functions: +that includes the following macros: + +_User-defined functions_ ```vb Function GetFormulaA1(Cell As Range) As String @@ -81,6 +83,13 @@ Function GetFormulaRC(Cell As Range) As String End Function ``` +_Event Handlers_ + +```vb +Sub Workbook_Open() + MsgBox "Hello from SheetJS!", vbOKOnly +End Sub +``` ### Copying Macros @@ -239,34 +248,53 @@ To ensure the writers export the VBA blob: - The output format must support VBA (`xlsm` or `xlsb` or `xls` or `biff8`) - The workbook object must have a valid `vbaraw` field +- The option `bookVBA: true` must be passed to `write` or `writeFile` This example uses [`vbaProject.bin`](pathname:///vba/vbaProject.bin) from the -[sample file](pathname:///vba/SheetJSVBAFormula.xlsm): +[sample file](pathname:///vba/SheetJSVBAFormula.xlsm). When the files are +opened, if macros are enabled, the application will display a popup. + +:::note pass + +Cells `A2:C2` in the worksheet include formulae that use user-defined functions. +Not all file formats support formula exports. [The "Formulae" page](./formulae) +includes a table of supported file formats. + +::: ```jsx live -function SheetJSVBAPrepared() { return ( ); } + /* export data to the specified file format */ + XLSX.writeFile(workbook, `SheetJSVBAPreparedNeu.${ext}`); + } + + return ["xlsm", "xlsb", "xls"].map((ext) => ( <> + +
+ )); +} ``` ## Details diff --git a/docz/static/vba/SheetJSVBAFormula.xlsm b/docz/static/vba/SheetJSVBAFormula.xlsm index 148b405..49f815d 100644 Binary files a/docz/static/vba/SheetJSVBAFormula.xlsm and b/docz/static/vba/SheetJSVBAFormula.xlsm differ diff --git a/docz/static/vba/vbaProject.bin b/docz/static/vba/vbaProject.bin index a112350..c91507d 100644 Binary files a/docz/static/vba/vbaProject.bin and b/docz/static/vba/vbaProject.bin differ diff --git a/tests/engines-boa.sh b/tests/engines/boa.sh similarity index 89% rename from tests/engines-boa.sh rename to tests/engines/boa.sh index b80e6b9..24a5b54 100755 --- a/tests/engines-boa.sh +++ b/tests/engines/boa.sh @@ -14,4 +14,4 @@ curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js curl -LO https://sheetjs.com/pres.xlsx curl -L -o src/main.rs https://docs.sheetjs.com/boa/main.rs -cargo run --release; echo $? +cargo run --release pres.xlsx; echo $? diff --git a/tests/engines-chakracore.sh b/tests/engines/chakracore.sh similarity index 100% rename from tests/engines-chakracore.sh rename to tests/engines/chakracore.sh diff --git a/tests/engines-duktape.sh b/tests/engines/duktape.sh similarity index 100% rename from tests/engines-duktape.sh rename to tests/engines/duktape.sh diff --git a/tests/engines-execjs.sh b/tests/engines/execjs.sh similarity index 100% rename from tests/engines-execjs.sh rename to tests/engines/execjs.sh diff --git a/tests/engines-hermes.sh b/tests/engines/hermes.sh similarity index 100% rename from tests/engines-hermes.sh rename to tests/engines/hermes.sh diff --git a/tests/engines-jerryscript.sh b/tests/engines/jerryscript.sh similarity index 100% rename from tests/engines-jerryscript.sh rename to tests/engines/jerryscript.sh diff --git a/tests/engines-jurassic.sh b/tests/engines/jurassic.sh similarity index 97% rename from tests/engines-jurassic.sh rename to tests/engines/jurassic.sh index 95ee447..3225f85 100755 --- a/tests/engines-jurassic.sh +++ b/tests/engines/jurassic.sh @@ -9,7 +9,7 @@ cd SheetJSJurassic dotnet new console dotnet run -dotnet add package Jurassic --version 3.2.8 +dotnet add package Jurassic --version 3.2.9 curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/shim.min.js curl -LO https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.mini.min.js diff --git a/tests/engines-mujs.sh b/tests/engines/mujs.sh similarity index 91% rename from tests/engines-mujs.sh rename to tests/engines/mujs.sh index 9f3db60..92cd75c 100755 --- a/tests/engines-mujs.sh +++ b/tests/engines/mujs.sh @@ -7,7 +7,7 @@ rm -rf sheetjs-mu mkdir sheetjs-mu cd sheetjs-mu -curl -LO https://mujs.com/downloads/mujs-1.3.5.zip +curl -LO https://mujs.com/downloads/mujs-1.3.6.zip unzip mujs-*.zip rm mujs-*.zip cd mujs-* diff --git a/tests/engines-perl.sh b/tests/engines/perl.sh similarity index 100% rename from tests/engines-perl.sh rename to tests/engines/perl.sh diff --git a/tests/engines-quickjs.sh b/tests/engines/quickjs.sh similarity index 96% rename from tests/engines-quickjs.sh rename to tests/engines/quickjs.sh index 39cdd5a..83a7d3e 100755 --- a/tests/engines-quickjs.sh +++ b/tests/engines/quickjs.sh @@ -7,7 +7,7 @@ cd sheetjs-quickjs git clone https://github.com/bellard/quickjs cd quickjs -git checkout 6e2e68f +git checkout 3306254 make cd .. diff --git a/tests/engines-v8-rust.sh b/tests/engines/v8-rust.sh similarity index 100% rename from tests/engines-v8-rust.sh rename to tests/engines/v8-rust.sh diff --git a/tests/engines-v8-snapshot.sh b/tests/engines/v8-snapshot.sh similarity index 100% rename from tests/engines-v8-snapshot.sh rename to tests/engines/v8-snapshot.sh diff --git a/tests/server-express-worker.sh b/tests/server/express-worker.sh similarity index 100% rename from tests/server-express-worker.sh rename to tests/server/express-worker.sh diff --git a/tests/static-vite.sh b/tests/static/vite.sh similarity index 100% rename from tests/static-vite.sh rename to tests/static/vite.sh