style-xlsx-m 0.1.16 → 0.1.18
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 +39 -3
- package/package.json +7 -3
- package/xlsx-js-style/dist/xlsx.min.js +26563 -1
- package/xlsx.js +110 -10
package/README.md
CHANGED
|
@@ -33,9 +33,9 @@ Install browser:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
## 🗒 What I added?
|
|
36
|
-
--
|
|
36
|
+
-- When you use read (second property put {type:'file'}) or readFile your file get cells style.
|
|
37
37
|
|
|
38
|
-
### read or readFile
|
|
38
|
+
### 1. read or readFile
|
|
39
39
|
|
|
40
40
|
```js
|
|
41
41
|
// STEP 1
|
|
@@ -61,6 +61,42 @@ XLSX.writeFile(wb, "style-xlsx-m-example.xlsm");
|
|
|
61
61
|
```
|
|
62
62
|
This example shows how you can change the contents of a file without removing its old style.
|
|
63
63
|
|
|
64
|
+
### 2. read or readFile
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
// new keys on worksheet
|
|
68
|
+
const ws = [...]
|
|
69
|
+
|
|
70
|
+
// #1 default null
|
|
71
|
+
ws['!pageSetup'] = {
|
|
72
|
+
paperSize: "9",
|
|
73
|
+
scale: "91",
|
|
74
|
+
fitToWidth: "0",
|
|
75
|
+
orientation: "landscape"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// #2 default null
|
|
79
|
+
ws['!colBreaks'] = {
|
|
80
|
+
colBreaks: {
|
|
81
|
+
count: "22",
|
|
82
|
+
manualBreakCount: "22"
|
|
83
|
+
}
|
|
84
|
+
brk: [
|
|
85
|
+
{
|
|
86
|
+
id: "12",
|
|
87
|
+
min: "1",
|
|
88
|
+
max: "37",
|
|
89
|
+
man: "1"
|
|
90
|
+
},
|
|
91
|
+
...
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// #3 default null
|
|
96
|
+
ws['!headerFooter'] = {
|
|
97
|
+
alignWithMargins: "0"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
64
100
|
|
|
65
101
|
## 🗒 Style API
|
|
66
102
|
-- Method to export file in excel with style get from [xlsx-js-style](https://www.npmjs.com/package/xlsx-js-style) (only function writeFile)
|
|
@@ -74,7 +110,7 @@ XLSX.writeFile(wb, "style-xlsx-m-example.xlsm");
|
|
|
74
110
|
|
|
75
111
|
```js
|
|
76
112
|
|
|
77
|
-
const A1 = { v: "line\nbreak", t: "s" } // key s is a style key for your cell
|
|
113
|
+
const A1 = { v: "line\nbreak", t: "s", s:{} } // key s is a style key for your cell
|
|
78
114
|
|
|
79
115
|
const BORDER_STYLE = 'think'
|
|
80
116
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "style-xlsx-m",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"author": "mor8t (Shukurov Shahrom)",
|
|
5
5
|
"description": "style-xlsx-m is a custom xlsx and xlsx-js-style version library",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"excel",
|
|
8
8
|
"xls",
|
|
9
9
|
"xlsx",
|
|
10
|
-
"xlsb",
|
|
11
10
|
"xlsm",
|
|
11
|
+
"xlsb",
|
|
12
12
|
"ods",
|
|
13
13
|
"csv",
|
|
14
14
|
"dbf",
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
"sylk",
|
|
17
17
|
"office",
|
|
18
18
|
"spreadsheet",
|
|
19
|
-
"style"
|
|
19
|
+
"style",
|
|
20
|
+
"print",
|
|
21
|
+
"format",
|
|
22
|
+
"workbook",
|
|
23
|
+
"worksheet"
|
|
20
24
|
],
|
|
21
25
|
"bin": {
|
|
22
26
|
"xlsx": "./bin/xlsx.njs"
|