style-xlsx-m 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +6 -125
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -2,144 +2,25 @@
2
2
 
3
3
  ## ℹ️ About
4
4
 
5
- SheetJS with Style! Get and Export Excel with basic styling options using JavaScript.
5
+ SheetJS and with Style! Get and Export Excel with basic styling options using JavaScript. But only get in xlsx and xlsm format.
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://github.com/gitbrent/xlsx-js-style/">
9
- <img alt="xlsx-js-style sheetjs styles" title="xlsx-js-style sheetjs styles" src="https://github.com/gitbrent/xlsx-js-style/blob/7664a045cd8f96b6b1b92ad563babebb8d6e0b4a/demos/browser/images/readme_banner.png"/>
9
+ <img alt="xlsx-js-style sheetjs styles" title="style-xlsx-m sheetjs styles" src="https://github.com/gitbrent/xlsx-js-style/blob/7664a045cd8f96b6b1b92ad563babebb8d6e0b4a/demos/browser/images/readme_banner.png"/>
10
10
  </a>
11
11
  </p>
12
12
  <br/>
13
13
 
14
- [![Known Vulnerabilities](https://snyk.io/test/npm/xlsx-js-style/badge.svg)](https://snyk.io/test/npm/xlsx-js-style) [![npm downloads](https://img.shields.io/npm/dm/xlsx-js-style.svg)](https://www.npmjs.com/package/xlsx-js-style)
15
- [![typescripts definitions](https://img.shields.io/npm/types/xlsx-js-style)](https://img.shields.io/npm/types/xlsx-js-style)
16
-
17
14
  ## 🔌 Installation
18
15
 
19
- Install [npm](https://www.npmjs.org/package/xlsx-js-style):
16
+ Install [npm](https://www.npmjs.org/package/style-xlsx-m):
20
17
 
21
18
  ```sh
22
- npm install xlsx-js-style
19
+ npm install style-xlsx-m
23
20
  ```
24
21
 
25
22
  Install browser:
26
23
 
27
24
  ```html
28
- <script src="dist/xlsx.bundle.js"></script>
29
- ```
30
-
31
- ## 🗒 Core API
32
-
33
- - Refer to the [SheetJS](https://sheetjs.com/) documentation for core API reference
34
- - Current version of sheetjs used: **0.18.5**
35
-
36
- ## 🗒 Style API
37
-
38
- ### Cell Style Example
39
-
40
- ```js
41
- // STEP 1: Create a new workbook
42
- const wb = XLSX.utils.book_new();
43
-
44
- // STEP 2: Create data rows and styles
45
- let row = [
46
- { v: "Courier: 24", t: "s", s: { font: { name: "Courier", sz: 24 } } },
47
- { v: "bold & color", t: "s", s: { font: { bold: true, color: { rgb: "FF0000" } } } },
48
- { v: "fill: color", t: "s", s: { fill: { fgColor: { rgb: "E9E9E9" } } } },
49
- { v: "line\nbreak", t: "s", s: { alignment: { wrapText: true } } },
50
- ];
51
-
52
- // STEP 3: Create worksheet with rows; Add worksheet to workbook
53
- const ws = XLSX.utils.aoa_to_sheet([row]);
54
- XLSX.utils.book_append_sheet(wb, ws, "readme demo");
55
-
56
- // STEP 4: Write Excel file to browser
57
- XLSX.writeFile(wb, "xlsx-js-style-demo.xlsx");
58
- ```
59
-
60
- ### Cell Style Properties
61
-
62
- - Cell styles are specified by a style object that roughly parallels the OpenXML structure.
63
- - Style properties currently supported are: `alignment`, `border`, `fill`, `font`, `numFmt`.
64
-
65
- | Style Prop | Sub Prop | Default | Description/Values |
66
- | :---------- | :------------- | :---------- | ------------------------------------------------------------------------------------------------- |
67
- | `alignment` | `vertical` | `bottom` | `"top"` or `"center"` or `"bottom"` |
68
- | | `horizontal` | `left` | `"left"` or `"center"` or `"right"` |
69
- | | `wrapText` | `false` | `true` or `false` |
70
- | | `textRotation` | `0` | `0` to `180`, or `255` // `180` is rotated down 180 degrees, `255` is special, aligned vertically |
71
- | `border` | `top` | | `{ style: BORDER_STYLE, color: COLOR_STYLE }` |
72
- | | `bottom` | | `{ style: BORDER_STYLE, color: COLOR_STYLE }` |
73
- | | `left` | | `{ style: BORDER_STYLE, color: COLOR_STYLE }` |
74
- | | `right` | | `{ style: BORDER_STYLE, color: COLOR_STYLE }` |
75
- | | `diagonal` | | `{ style: BORDER_STYLE, color: COLOR_STYLE, diagonalUp: true/false, diagonalDown: true/false }` |
76
- | `fill` | `patternType` | `"none"` | `"solid"` or `"none"` |
77
- | | `fgColor` | | foreground color: see `COLOR_STYLE` |
78
- | | `bgColor` | | background color: see `COLOR_STYLE` |
79
- | `font` | `bold` | `false` | font bold `true` or `false` |
80
- | | `color` | | font color `COLOR_STYLE` |
81
- | | `italic` | `false` | font italic `true` or `false` |
82
- | | `name` | `"Calibri"` | font name |
83
- | | `strike` | `false` | font strikethrough `true` or `false` |
84
- | | `sz` | `"11"` | font size (points) |
85
- | | `underline` | `false` | font underline `true` or `false` |
86
- | | `vertAlign` | | `"superscript"` or `"subscript"` |
87
- | `numFmt` | | `0` | Ex: `"0"` // integer index to built in formats, see StyleBuilder.SSF property |
88
- | | | | Ex: `"0.00%"` // string matching a built-in format, see StyleBuilder.SSF |
89
- | | | | Ex: `"0.0%"` // string specifying a custom format |
90
- | | | | Ex: `"0.00%;\\(0.00%\\);\\-;@"` // string specifying a custom format, escaping special characters |
91
- | | | | Ex: `"m/dd/yy"` // string a date format using Excel's format notation |
92
-
93
- ### `COLOR_STYLE` {object} Properties
94
-
95
- Colors for `border`, `fill`, `font` are specified as an name/value object - use one of the following:
96
-
97
- | Color Prop | Description | Example |
98
- | :--------- | ----------------- | --------------------------------------------------------------- |
99
- | `rgb` | hex RGB value | `{rgb: "FFCC00"}` |
100
- | `theme` | theme color index | `{theme: 4}` // (0-n) // Theme color index 4 ("Blue, Accent 1") |
101
- | `tint` | tint by percent | `{theme: 1, tint: 0.4}` // ("Blue, Accent 1, Lighter 40%") |
102
-
103
- ### `BORDER_STYLE` {string} Properties
104
-
105
- Border style property is one of the following values:
106
-
107
- - `dashDotDot`
108
- - `dashDot`
109
- - `dashed`
110
- - `dotted`
111
- - `hair`
112
- - `mediumDashDotDot`
113
- - `mediumDashDot`
114
- - `mediumDashed`
115
- - `medium`
116
- - `slantDashDot`
117
- - `thick`
118
- - `thin`
119
-
120
- **Border Notes**
121
-
122
- Borders for merged areas are specified for each cell within the merged area. For example, to apply a box border to a merged area of 3x3 cells, border styles would need to be specified for eight different cells:
123
-
124
- - left borders (for the three cells on the left)
125
- - right borders (for the cells on the right)
126
- - top borders (for the cells on the top)
127
- - bottom borders (for the cells on the left)
128
-
129
- ## 🙏 Thanks
130
-
131
- This project is a fork of [SheetJS/sheetjs](https://github.com/sheetjs/sheetjs) combined with code from
132
- [sheetjs-style](https://www.npmjs.com/package/sheetjs-style) (by [ShanaMaid](https://github.com/ShanaMaid/))
133
- and [sheetjs-style-v2](https://www.npmjs.com/package/sheetjs-style-v2) (by [Raul Gonzalez](https://www.npmjs.com/~armandourbina)).
134
-
135
- All projects are under the Apache 2.0 License
136
-
137
- - [sheetjs](https://github.com/SheetJS/sheetjs)
138
- - [js-xlsx](https://github.com/protobi/js-xlsx)
139
- - [sheetjs-style](https://www.npmjs.com/package/sheetjs-style)
140
- - [sheetjs-style-v2](https://www.npmjs.com/package/sheetjs-style-v2)
141
-
142
- ## 🔖 License
143
-
144
- Please consult the attached [LICENSE](https://github.com/gitbrent/xlsx-js-style/blob/master/LICENSE) file for details. All rights not explicitly
145
- granted by the Apache 2.0 License are reserved by the Original Author.
25
+ <script src="dist/xlsx.js"></script>
26
+ ```
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "style-xlsx-m",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "author": "mor8t",
5
- "description": "SheetJS with Style! Get and Export Excel with basic styling options using JavaScript.",
5
+ "description": "SheetJS and with Style! Get and Export Excel with basic styling options using JavaScript. But only get in xlsx and xlsm format.",
6
6
  "keywords": [
7
7
  "excel",
8
8
  "xls",
@@ -90,9 +90,9 @@
90
90
  "holes"
91
91
  ]
92
92
  },
93
- "homepage": "https://sheetjs.com/",
93
+ "homepage": "https://github.com/MOR8T/STYLE-XSLX-M",
94
94
  "bugs": {
95
- "url": "https://github.com/SheetJS/sheetjs/issues"
95
+ "url": "https://github.com/MOR8T/STYLE-XSLX-M"
96
96
  },
97
97
  "license": "Apache-2.0",
98
98
  "engines": {