From 60dd5da9f6d5ddbc31acecc0d2b5eff42f1fbcd2 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Tue, 23 Aug 2022 20:51:18 -0400 Subject: [PATCH] index --- .spelling | 14 ++++ .../01-installation/06-amd.md | 2 +- docz/docs/03-demos/01-salesforce.md | 3 +- docz/docs/03-demos/23-angular.md | 2 +- docz/docs/03-demos/24-server.md | 2 +- docz/docs/03-demos/25-azure.md | 2 +- docz/docs/07-csf/03-sheet.md | 4 +- docz/docs/08-api/09-utilities.md | 2 +- docz/docs/09-miscellany/05-contributing.md | 4 +- docz/docs/index.md | 65 ++++++++++++------- 10 files changed, 67 insertions(+), 33 deletions(-) diff --git a/.spelling b/.spelling index 1ef86a4..71fb8de 100644 --- a/.spelling +++ b/.spelling @@ -25,6 +25,8 @@ DIF Dialogsheet Dialogsheets ECMA-376 +FM3 +FMT FODS FoxPro IEEE754 @@ -49,20 +51,25 @@ SYLK SpreadsheetML TSV TXT +UOS UOS1 UOS2 Unhide VBA +VFP Visicalc +WB WB1 WB2 WB3 +WK WK1 WK2 WK3 WK4 WKS WK_ +WQ WQ1 WQ2 WQ3 @@ -101,11 +108,13 @@ Base64 Booleans Browserify Bundlers +CLI CMS CS6 CapacitorJS CommonJS Cordova +DOM Deno Drash Ethercalc @@ -115,6 +124,7 @@ GatsbyJS HTML HTML5 IE +IE8 IE10 IE11 IE6 @@ -147,6 +157,8 @@ RequireJS Rollup SQLite SWC +SWF +Serverless SessionStorage Snowpack SuiteScript @@ -169,6 +181,7 @@ WebSQL Webpack XHR XMLHttpRequest +XP async axios bundler @@ -192,6 +205,7 @@ iWork javascript lifecycle metadata +middleware natively node.js nodejs diff --git a/docz/docs/02-getting-started/01-installation/06-amd.md b/docz/docs/02-getting-started/01-installation/06-amd.md index 7e56716..f860380 100644 --- a/docz/docs/02-getting-started/01-installation/06-amd.md +++ b/docz/docs/02-getting-started/01-installation/06-amd.md @@ -53,7 +53,7 @@ sap.ui.define([ :::warning -The [SAP Website has a note about including third-party JS libraries.](https://blogs.sap.com/2017/04/30/how-to-include-third-party-libraries-modules-in-sapui5/SAPUI5) +The [SAP Website has a note about including third-party JS libraries.](https://blogs.sap.com/2017/04/30/how-to-include-third-party-libraries-modules-in-sapui5/) It recommends copying and pasting JavaScript code. **Copy and pasting code does not work** for SheetJS scripts as they contain diff --git a/docz/docs/03-demos/01-salesforce.md b/docz/docs/03-demos/01-salesforce.md index 676ff56..8618695 100644 --- a/docz/docs/03-demos/01-salesforce.md +++ b/docz/docs/03-demos/01-salesforce.md @@ -1,9 +1,8 @@ --- sidebar_position: 1 +title: Salesforce LWC --- -# Salesforce LWC - Salesforce apps can use third-party libraries in "Lightning Web Components". This demo assumes familiarity with Lightning Web Components. Salesforce has a diff --git a/docz/docs/03-demos/23-angular.md b/docz/docs/03-demos/23-angular.md index 445c0c3..386411f 100644 --- a/docz/docs/03-demos/23-angular.md +++ b/docz/docs/03-demos/23-angular.md @@ -30,7 +30,7 @@ issues should be directed to the Angular project. ## Installation [The "Frameworks" section](../getting-started/installation/frameworks) covers -installation with pnpm and other package managers. +installation with `pnpm` and other package managers. The library can be imported directly from JS or TS code with: diff --git a/docz/docs/03-demos/24-server.md b/docz/docs/03-demos/24-server.md index 453b2bd..070a9c8 100644 --- a/docz/docs/03-demos/24-server.md +++ b/docz/docs/03-demos/24-server.md @@ -370,7 +370,7 @@ npx @nestjs/cli generate module sheetjs npx @nestjs/cli generate controller sheetjs ``` -3) Add Multer to the new module by editing `src/sheetjs/sheetjs.module.ts`. +3) Add `multer` to the new module by editing `src/sheetjs/sheetjs.module.ts`. Changes are highlighted below: ```ts title="src/sheetjs/sheetjs.module.ts" diff --git a/docz/docs/03-demos/25-azure.md b/docz/docs/03-demos/25-azure.md index 12a2128..d9f0849 100644 --- a/docz/docs/03-demos/25-azure.md +++ b/docz/docs/03-demos/25-azure.md @@ -210,7 +210,7 @@ the generated file. Confirm it is a valid file. func azure functionapp publish NAME_OF_FUNCTION_APP ``` -Get the function url and test using the same sequence as in step 5. +Get the function URL and test using the same sequence as in step 5. diff --git a/docz/docs/07-csf/03-sheet.md b/docz/docs/07-csf/03-sheet.md index 5cb6752..a87daba 100644 --- a/docz/docs/07-csf/03-sheet.md +++ b/docz/docs/07-csf/03-sheet.md @@ -84,8 +84,8 @@ In addition to the aforementioned sheet keys, worksheets also add: | key | Excel feature | default | |:----------|:----------------------------------------------|:--------| -| `above` | Uncheck "Summary rows below detail" | `false` | -| `left` | Uncheck "Summary rows to the right of detail" | `false` | +| `above` | Disable "Summary rows below detail" | `false` | +| `left` | Disable "Summary rows to the right of detail" | `false` | - `ws['!protect']`: object of write sheet protection properties. The `password` key specifies the password for formats that support password-protected sheets diff --git a/docz/docs/08-api/09-utilities.md b/docz/docs/08-api/09-utilities.md index 806995a..3100bfa 100644 --- a/docz/docs/08-api/09-utilities.md +++ b/docz/docs/08-api/09-utilities.md @@ -533,7 +533,7 @@ takes an options argument: | Option Name | Default | Description | | :---------- | :------: | :-------------------------------------------------- | |`raw` | `true` | Use raw values (true) or formatted strings (false) | -|`range` | from WS | Override Range (see table below) | +|`range` | ** | Override Range (see table below) | |`header` | | Control output format (see table below) | |`dateNF` | FMT 14 | Use specified date format in string output | |`defval` | | Use specified value in place of null or undefined | diff --git a/docz/docs/09-miscellany/05-contributing.md b/docz/docs/09-miscellany/05-contributing.md index 72e3af7..9740ea1 100644 --- a/docz/docs/09-miscellany/05-contributing.md +++ b/docz/docs/09-miscellany/05-contributing.md @@ -147,8 +147,8 @@ curl https://bun.sh/install | bash ## Development The `xlsx.js` and `xlsx.mjs` files are constructed from the files in the `bits` -subdirectory. The build script (run `make`) will concatenate the individual -bits to produce the scripts. +subfolder. The build script (run `make`) will concatenate the individual bits +to produce the scripts. To produce the dist files, run `make dist`. The dist files are updated in each version release and *should not be committed between versions*. diff --git a/docz/docs/index.md b/docz/docs/index.md index 0c27499..6f9840c 100644 --- a/docz/docs/index.md +++ b/docz/docs/index.md @@ -23,9 +23,8 @@ port calculations to web apps; automate common spreadsheet tasks, and much more! ## Simple Examples -The code editors are live -- feel free to edit! Due to technical limitations, -they showcase ReactJS patterns. Other parts of the documentation will cover -more common use cases including plain JavaScript. +The code editors are live -- feel free to edit! They use ReactJS components and +run entirely in the web browser. ### Export an HTML Table to Excel XLSX @@ -51,17 +50,26 @@ more common use cases including plain JavaScript. 4) Add an event handler for the `click` event to create a workbook and download: -```js +```html + ``` +
How to automate with NodeJS (click to show) + +[The "Headless Automation" demo](http://localhost:3000/docs/demos/headless) +includes complete examples using the `puppeteer` and `playwright` libraries. + +
+
Live Example (click to hide) ```jsx live @@ -164,50 +172,63 @@ support for CSS styling and rich text.
-### Convert a CSV file to HTML Table and Excel XLSX +### Preview a workbook on your device -
Live Example (click to show) +
Live Example (click to hide) + +This example starts from a CSV string. Use the File Input element to select +a workbook to load. Use the "Export XLSX" button to write the table to XLSX. ```jsx live /* The live editor requires this function wrapper */ function Tabeller(props) { + const [__html, setHTML] = React.useState(""); - /* Starting CSV data -- change data here */ - const csv = `\ + /* Load sample data once */ + React.useEffect(() => { + /* Starting CSV data -- change data here */ + const csv = `\ This,is,a,Test வணக்கம்,สวัสดี,你好,가지마 1,2,3,4`; - /* Parse CSV into a workbook object */ - const wb = XLSX.read(csv, {type: "string"}); + /* Parse CSV into a workbook object */ + const wb = XLSX.read(csv, {type: "string"}); - /* Get the worksheet (default name "Sheet1") */ - const ws = wb.Sheets.Sheet1; + /* Get the worksheet (default name "Sheet1") */ + const ws = wb.Sheets.Sheet1; - /* Create HTML table */ - const id = "tabeller"; // HTML TABLE ID - const __html = XLSX.utils.sheet_to_html(ws, { id }); + /* Create HTML table */ + setHTML(XLSX.utils.sheet_to_html(ws, { id: "tabeller" })); + }, []); return (<> + {/* Import Button */} + { + /* get data as an ArrayBuffer */ + const file = e.target.files[0]; + const data = await file.arrayBuffer(); - {/* Show HTML preview */} -
+ /* parse and load first worksheet */ + const wb = XLSX.read(data); + const ws = wb.Sheets[wb.SheetNames[0]]; + setHTML(XLSX.utils.sheet_to_html(ws, { id: "tabeller" })); + }}/> {/* Export Button */} + }}>Export XLSX! + {/* Show HTML preview */} +
); - } ```