Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
9ec7b4969d | |||
e78696fbac | |||
f4102d2e30 | |||
658814d9ca | |||
fd86122881 | |||
ce335c7a3d | |||
bd456d3864 | |||
2414c7c356 | |||
bc6644be0b | |||
46846b6e6c | |||
ac4b5839c2 |
@ -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
BIN
logo/readme-demo.psd
Normal file
Binary file not shown.
20
package-lock.json
generated
20
package-lock.json
generated
@ -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
|
||||||
},
|
},
|
||||||
|
@ -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": {
|
||||||
|
@ -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;
|
||||||
|
@ -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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user