Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0400a87

Browse files
committed
version bump 0.18.5: basic NUMBERS write
1 parente69ecd4 commit0400a87

38 files changed

+5846
-2031
lines changed

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@ This log is intended to keep track of backwards-incompatible changes, including
44
but not limited to API changes and file location changes. Minor behavioral
55
changes may not be included if they are not expected to break existing code.
66

7+
##v0.18.5
8+
9+
* Enabled`sideEffects: false` in package.json
10+
* Basic NUMBERS write support
11+
12+
##v0.18.4
13+
714
* CSV output omits trailing record separator
15+
* Properly terminate NodeJS Streams
16+
* DBF preserve column types on import and use when applicable on export
17+
18+
##v0.18.3
19+
20+
* Removed references to`require` and`process` in browser builds
821

922
##v0.18.2
1023

‎Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ dist: dist-deps $(TARGET) bower.json ## Prepare JS files for distribution
9595
misc/strip_sourcemap.sh dist/$(LIB).mini.min.js
9696
@# extendscript
9797
cat<(head -n 1 bits/00_header.js) shim.js$(DISTHDR)$(REQS) dist/$(TARGET)> dist/$(LIB).extendscript.js
98+
@# zahl
99+
cp modules/xlsx.zahl.js modules/xlsx.zahl.mjs dist/
98100
@#
99101
rm dist/$(TARGET) dist/$(MINITGT)
100102

‎README.md‎

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,61 @@ stream.pipe(conv); conv.pipe(process.stdout);
17641764

17651765
</details>
17661766

1767+
<details>
1768+
<summary><b>Exporting NUMBERS files</b> (click to show)</summary>
1769+
1770+
The NUMBERS writer requires a fairly large base. The supplementary`xlsx.zahl`
1771+
scripts provide support.`xlsx.zahl.js` is designed for standalone and NodeJS
1772+
use, while`xlsx.zahl.mjs` is suitable for ESM.
1773+
1774+
_Browser_
1775+
1776+
```html
1777+
<metacharset="utf8">
1778+
<scriptsrc="xlsx.full.min.js"></script>
1779+
<scriptsrc="xlsx.zahl.js"></script>
1780+
<script>
1781+
var wb=XLSX.utils.book_new();var ws=XLSX.utils.aoa_to_sheet([
1782+
["SheetJS","<3","விரிதாள்"],
1783+
[72,,"Arbeitsblätter"],
1784+
[,62,"数据"],
1785+
[true,false,],
1786+
]);XLSX.utils.book_append_sheet(wb, ws,"Sheet1");
1787+
XLSX.writeFile(wb,"textport.numbers", {numbers:XLSX_ZAHL, compression:true});
1788+
</script>
1789+
```
1790+
1791+
_Node_
1792+
1793+
```js
1794+
varXLSX=require("./xlsx.flow");
1795+
varXLSX_ZAHL=require("./dist/xlsx.zahl");
1796+
var wb=XLSX.utils.book_new();var ws=XLSX.utils.aoa_to_sheet([
1797+
["SheetJS","<3","விரிதாள்"],
1798+
[72,,"Arbeitsblätter"],
1799+
[,62,"数据"],
1800+
[true,false,],
1801+
]);XLSX.utils.book_append_sheet(wb, ws,"Sheet1");
1802+
XLSX.writeFile(wb,"textport.numbers", {numbers:XLSX_ZAHL, compression:true});
1803+
```
1804+
1805+
_Deno_
1806+
1807+
```ts
1808+
import*asXLSXfrom'./xlsx.mjs';
1809+
importXLSX_ZAHLfrom'./dist/xlsx.zahl.mjs';
1810+
1811+
var wb=XLSX.utils.book_new();var ws=XLSX.utils.aoa_to_sheet([
1812+
["SheetJS","<3","விரிதாள்"],
1813+
[72,,"Arbeitsblätter"],
1814+
[,62,"数据"],
1815+
[true,false,],
1816+
]);XLSX.utils.book_append_sheet(wb,ws,"Sheet1");
1817+
XLSX.writeFile(wb,"textports.numbers", {numbers:XLSX_ZAHL, compression:true});
1818+
```
1819+
1820+
</details>
1821+
17671822
<https://github.com/sheetjs/sheetaki> pipes write streams to nodejs response.
17681823

17691824
###Generating JSON and JS Data
@@ -3366,6 +3421,7 @@ The exported `write` and `writeFile` functions accept an options argument:
33663421
|`Props` | | Override workbook properties when writing ** |
33673422
|`themeXLSX` | | Override theme XML when writing XLSX/XLSB/XLSM ** |
33683423
|`ignoreEC` |`true` | Suppress "number as text" errors ** |
3424+
|`numbers` | | Payload for NUMBERS export ** |
33693425
33703426
-`bookSST` is slower and more memory intensive, but has better compatibility
33713427
with older versions of iOS Numbers
@@ -3381,6 +3437,8 @@ The exported `write` and `writeFile` functions accept an options argument:
33813437
- Due to a bug in the program, some features like "Text to Columns" will crash
33823438
Excel on worksheets where error conditions are ignored. The writer will mark
33833439
files to ignore the error by default. Set`ignoreEC` to`false` to suppress.
3440+
- Due to the size of the data, the NUMBERS data is not included by default. The
3441+
included`xlsx.zahl.js` and`xlsx.zahl.mjs` scripts include the data.
33843442
33853443
### Supported Output Formats
33863444
@@ -3398,6 +3456,7 @@ output formats. The specific file type is controlled with `bookType` option:
33983456
|`biff3` |`.xls` | none | single | Excel 3.0 Worksheet Format |
33993457
|`biff2` |`.xls` | none | single | Excel 2.0 Worksheet Format |
34003458
|`xlml` |`.xls` | none | multi | Excel 2003-2004 (SpreadsheetML) |
3459+
|`numbers` |`.numbers`| ZIP | single | Numbers 3.0+ Spreadsheet |
34013460
|`ods` |`.ods` | ZIP | multi | OpenDocument Spreadsheet |
34023461
|`fods` |`.fods` | none | multi | Flat OpenDocument Spreadsheet |
34033462
|`wk3` |`.wk3` | none | multi | Lotus Workbook (WK3) |
@@ -3950,7 +4009,7 @@ Despite the library name `xlsx`, it supports numerous spreadsheet file formats:
39504009
| Lotus Formatted Text (PRN) | ✔ | ✔ |
39514010
| UTF-16 Unicode Text (TXT) | ✔ | ✔ |
39524011
| **Other Workbook/Worksheet Formats** |:-----:|:-----:|
3953-
| Numbers 3.0+ / iWork 2013+ Spreadsheet (NUMBERS) | ✔ | |
4012+
| Numbers 3.0+ / iWork 2013+ Spreadsheet (NUMBERS) | ✔ | |
39544013
| OpenDocument Spreadsheet (ODS) | ✔ | ✔ |
39554014
| Flat XML ODF Spreadsheet (FODS) | ✔ | ✔ |
39564015
| Uniform Office Format Spreadsheet (标文通 UOS1/UOS2) | ✔ | |
@@ -4099,6 +4158,8 @@ The parser focuses on extracting raw data from tables. Numbers technically
40994158
supports multiple tables in a logical worksheet, including custom titles. This
41004159
parser will generate one worksheet per Numbers table.
41014160
4161+
The writer currently exports a small range from the first worksheet.
4162+
41024163
- **OpenDocument Spreadsheet (ODS/FODS)**
41034164
41044165
ODS is an XML-in-ZIP format akin to XLSX while FODS is an XML format akin to

‎bin/xlsx.njs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ program
4444
.option('-6, --xlml','emit SSML to <sheetname> or <file>.xls (2003 XML)')
4545
.option('-T, --fods','emit FODS to <sheetname> or <file>.fods (Flat ODS)')
4646
.option('--wk3','emit WK3 to <sheetname> or <file>.txt (Lotus WK3)')
47+
.option('--numbers','emit NUMBERS to <sheetname> or <file>.numbers')
4748

4849
.option('-S, --formulae','emit list of values and formulae')
4950
.option('-j, --json','emit formatted JSON (all fields text)')
@@ -90,6 +91,7 @@ var workbook_formats = [
9091
['xls','xls','xls'],
9192
['xla','xla','xla'],
9293
['biff5','biff5','xls'],
94+
['numbers','numbers','numbers'],
9395
['ods','ods','ods'],
9496
['fods','fods','fods'],
9597
['wk3','wk3','wk3']
@@ -192,6 +194,10 @@ if(program.props) {
192194
/* full workbook formats */
193195
workbook_formats.forEach(function(m){if(program[m[0]]||isfmt(m[0])){
194196
wopts.bookType=m[1];
197+
if(wopts.bookType=="numbers")try{
198+
varXLSX_ZAHL=require("../dist/xlsx.zahl");
199+
wopts.numbers=XLSX_ZAHL;
200+
}catch(e){}
195201
if(wb)X.writeFile(wb,program.output||sheetname||((filename||"")+"."+m[2]),wopts);
196202
process.exit(0);
197203
}});

‎bits/01_version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
XLSX.version='0.18.4';
1+
XLSX.version='0.18.5';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp