Compare commits

...

11 Commits
6.0.0 ... 6.0.1

Author SHA1 Message Date
9ec7b4969d Version bump 2021-03-23 01:52:49 +00:00
e78696fbac Add README picture psd 2021-03-23 01:51:25 +00:00
f4102d2e30 Update README.md 2021-03-22 17:09:58 +00:00
658814d9ca Merge pull request #845 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.33
build(deps-dev): bump typedoc from 0.20.32 to 0.20.33
2021-03-22 11:47:23 +00:00
fd86122881 Merge pull request #846 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.2.2
build(deps-dev): bump @types/mocha from 8.2.1 to 8.2.2
2021-03-22 11:47:12 +00:00
ce335c7a3d Merge pull request #844 from dolanmiu/feat/fix-styles-xml
#842 Move table styles to the top
2021-03-22 11:46:12 +00:00
bd456d3864 build(deps-dev): bump @types/mocha from 8.2.1 to 8.2.2
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-22 08:27:13 +00:00
2414c7c356 build(deps-dev): bump typedoc from 0.20.32 to 0.20.33
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.32 to 0.20.33.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.32...v0.20.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-22 08:26:45 +00:00
bc6644be0b #842 Move table styles to the top 2021-03-22 05:54:48 +00:00
46846b6e6c Fix imports 2021-03-22 05:23:30 +00:00
ac4b5839c2 Update README.md 2021-03-21 18:36:15 +00:00
6 changed files with 19 additions and 18 deletions

View File

@ -19,7 +19,7 @@
[![codecov][codecov-image]][codecov-url] [![codecov][codecov-image]][codecov-url]
<p align="center"> <p align="center">
<img src="https://i.imgur.com/tBO0XBR.png" alt="drawing"/> <img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>
</p> </p>
# Demo # Demo
@ -29,7 +29,7 @@
Here are examples of `docx` being used with basic `HTML/JS` in a browser environment: Here are examples of `docx` being used with basic `HTML/JS` in a browser environment:
* https://codepen.io/dolanmiu/pen/RwNeObg * https://codepen.io/dolanmiu/pen/RwNeObg
* https://jsfiddle.net/dolanmiu/kqxrj35u/1/ * https://jsfiddle.net/dolanmiu/onadx1gu/
Here is an example of `docx` working in `Angular`: Here is an example of `docx` working in `Angular`:

BIN
logo/readme-demo.psd Normal file

Binary file not shown.

20
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "docx", "name": "docx",
"version": "5.5.0", "version": "6.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -560,9 +560,9 @@
} }
}, },
"@types/mocha": { "@types/mocha": {
"version": "8.2.1", "version": "8.2.2",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz",
"integrity": "sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==", "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==",
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
@ -8106,9 +8106,9 @@
} }
}, },
"typedoc": { "typedoc": {
"version": "0.20.32", "version": "0.20.33",
"resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.20.32.tgz", "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.20.33.tgz",
"integrity": "sha512-GSopd/tiqoKE3fEdvhoaEpR9yrEPsR9tknAjkoeSPL6p1Rq5aVsKxBhhF6cwoDJ7oWjpvnm8vs0rQN0BxEHuWQ==", "integrity": "sha512-jzNdHmjZRQKwguhpXjIPuIjz+TpdgG2AVY8ta+qpAukv+3rBhTs4AAVd+mkonrHVYlC0EAbuAJ4urkfnn42Hwg==",
"dev": true, "dev": true,
"requires": { "requires": {
"colors": "^1.4.0", "colors": "^1.4.0",
@ -8173,9 +8173,9 @@
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
"version": "3.13.1", "version": "3.13.2",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.1.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.2.tgz",
"integrity": "sha512-EWhx3fHy3M9JbaeTnO+rEqzCe1wtyQClv6q3YWq0voOj4E+bMZBErVS1GAHPDiRGONYq34M1/d8KuQMgvi6Gjw==", "integrity": "sha512-SbMu4D2Vo95LMC/MetNaso1194M1htEA+JrqE9Hk+G2DhI+itfS9TRu9ZKeCahLDNa/J3n4MqUJ/fOHMzQpRWw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "docx", "name": "docx",
"version": "6.0.0", "version": "6.0.1",
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.", "description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
"main": "build/index.js", "main": "build/index.js",
"scripts": { "scripts": {

View File

@ -1,10 +1,11 @@
import { uniqueId } from "convenience-functions"; import { uniqueId } from "convenience-functions";
import { IContext, IXmlableObject } from "file/xml-components";
import { Drawing, IFloating } from "../../drawing"; import { Drawing, IFloating } from "../../drawing";
import { IMediaTransformation } from "../../media"; import { IMediaTransformation } from "../../media";
import { IMediaData } from "../../media/data"; import { IMediaData } from "../../media/data";
import { Run } from "../run"; import { Run } from "../run";
import { IContext, IXmlableObject } from "/file/xml-components";
export interface IImageOptions { export interface IImageOptions {
readonly data: Buffer | string | Uint8Array | ArrayBuffer; readonly data: Buffer | string | Uint8Array | ArrayBuffer;

View File

@ -31,6 +31,10 @@ export class TableProperties extends IgnoreIfEmptyXmlComponent {
constructor(options: ITablePropertiesOptions) { constructor(options: ITablePropertiesOptions) {
super("w:tblPr"); super("w:tblPr");
if (options.style) {
this.root.push(new TableStyle(options.style));
}
this.root.push(new TableCellMargin(options.cellMargin || {})); this.root.push(new TableCellMargin(options.cellMargin || {}));
if (options.borders) { if (options.borders) {
@ -60,9 +64,5 @@ export class TableProperties extends IgnoreIfEmptyXmlComponent {
if (options.visuallyRightToLeft) { if (options.visuallyRightToLeft) {
this.root.push(new VisuallyRightToLeft()); this.root.push(new VisuallyRightToLeft());
} }
if (options.style) {
this.root.push(new TableStyle(options.style));
}
} }
} }