Compare commits

..

84 Commits
7.7.0 ... 7.8.1

Author SHA1 Message Date
a481518470 Version bump 2022-12-30 16:21:00 +00:00
2435ebf16e Correctly return value from constructor 2022-12-30 16:16:59 +00:00
62d0767ceb Version bump 2022-12-10 15:43:26 +00:00
8024c01a82 Merge pull request #1831 from dolanmiu/dependabot/npm_and_yarn/qs-6.5.3
build(deps): bump qs from 6.5.2 to 6.5.3
2022-12-10 01:35:59 +00:00
1b380c3fdb Merge pull request #1825 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.1
build(deps-dev): bump prettier from 2.8.0 to 2.8.1
2022-12-10 00:13:12 +00:00
06b67bd292 build(deps): bump qs from 6.5.2 to 6.5.3
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-10 00:12:40 +00:00
8a1087f601 Merge pull request #1824 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.46.0
build(deps-dev): bump @typescript-eslint/parser from 5.45.1 to 5.46.0
2022-12-10 00:12:37 +00:00
ff09d6515c Merge pull request #1826 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.46.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.45.1 to 5.46.0
2022-12-10 00:12:29 +00:00
ebe85d8e14 Merge pull request #1827 from dolanmiu/dependabot/npm_and_yarn/typescript-4.9.4
build(deps-dev): bump typescript from 4.9.3 to 4.9.4
2022-12-10 00:12:20 +00:00
5dc27ac46a Merge pull request #1828 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.12
build(deps): bump @types/node from 18.11.11 to 18.11.12
2022-12-10 00:12:11 +00:00
1dcc8ee761 Merge pull request #1830 from dolanmiu/feat/optional-background
Optional background property
2022-12-10 00:12:01 +00:00
f789f60e22 Optional background property 2022-12-09 21:07:08 +00:00
32e3f07d57 build(deps): bump @types/node from 18.11.11 to 18.11.12
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.11 to 18.11.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 11:01:11 +00:00
9ea41ab3ce build(deps-dev): bump typescript from 4.9.3 to 4.9.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.3 to 4.9.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.3...v4.9.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:02:37 +00:00
4b8d062862 build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.45.1 to 5.46.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.46.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:02:17 +00:00
d9408029f3 build(deps-dev): bump prettier from 2.8.0 to 2.8.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:01:36 +00:00
9fe0406078 build(deps-dev): bump @typescript-eslint/parser from 5.45.1 to 5.46.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.45.1 to 5.46.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.46.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:01:18 +00:00
3ea453a07f Merge pull request #1822 from dolanmiu/feat/underline-none
#1807 Add underline none
2022-12-06 23:51:05 +00:00
984e762a53 Fix test 2022-12-06 23:42:22 +00:00
1592aa7117 Add underline none
Add space options for Text
2022-12-06 22:04:30 +00:00
62b4522c94 Merge pull request #1819 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.45.1
build(deps-dev): bump @typescript-eslint/parser from 5.45.0 to 5.45.1
2022-12-06 13:53:02 +00:00
8b86751c95 build(deps-dev): bump @typescript-eslint/parser from 5.45.0 to 5.45.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.45.0 to 5.45.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 13:19:01 +00:00
afa380e336 Merge pull request #1818 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.11
build(deps): bump @types/node from 18.11.10 to 18.11.11
2022-12-06 13:18:20 +00:00
feebff9077 Merge pull request #1816 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.45.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.45.0 to 5.45.1
2022-12-06 13:18:13 +00:00
028b50ff99 Merge pull request #1815 from dolanmiu/dependabot/npm_and_yarn/cspell-6.17.0
build(deps-dev): bump cspell from 6.16.0 to 6.17.0
2022-12-06 13:18:03 +00:00
559e81c3fe Merge pull request #1817 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-5.0.1
build(deps-dev): bump webpack-cli from 5.0.0 to 5.0.1
2022-12-06 13:17:55 +00:00
4da6b98437 build(deps): bump @types/node from 18.11.10 to 18.11.11
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.10 to 18.11.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:03:55 +00:00
5b2409c76f build(deps-dev): bump webpack-cli from 5.0.0 to 5.0.1
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@5.0.0...webpack-cli@5.0.1)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:03:32 +00:00
ff027d172e build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.45.0 to 5.45.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:03:20 +00:00
3f23290a46 build(deps-dev): bump cspell from 6.16.0 to 6.17.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.16.0 to 6.17.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.16.0...v6.17.0)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:02:53 +00:00
f1a10d32e6 Merge pull request #1813 from dolanmiu/dependabot/npm_and_yarn/cspell-6.16.0
build(deps-dev): bump cspell from 6.15.1 to 6.16.0
2022-12-05 17:14:33 +00:00
a71f40e873 Merge pull request #1810 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-4.1.1
build(deps-dev): bump tsconfig-paths from 4.1.0 to 4.1.1
2022-12-05 17:14:27 +00:00
7f449319cd Merge pull request #1809 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.10
build(deps): bump @types/node from 18.11.9 to 18.11.10
2022-12-05 17:14:20 +00:00
ab5c8ea698 Merge pull request #1814 from dolanmiu/dependabot/npm_and_yarn/eslint-8.29.0
build(deps-dev): bump eslint from 8.28.0 to 8.29.0
2022-12-05 17:14:12 +00:00
68cfa9360b build(deps-dev): bump eslint from 8.28.0 to 8.29.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.28.0 to 8.29.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.28.0...v8.29.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 11:01:36 +00:00
f627e3d994 build(deps-dev): bump cspell from 6.15.1 to 6.16.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.15.1 to 6.16.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.15.1...v6.16.0)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 11:01:06 +00:00
7c870548d9 Merge pull request #1811 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.4.2
build(deps-dev): bump ts-loader from 9.4.1 to 9.4.2
2022-12-02 14:34:36 +00:00
57ccc41547 Merge pull request #1812 from dolanmiu/dependabot/npm_and_yarn/cspell-6.15.1
build(deps-dev): bump cspell from 6.15.0 to 6.15.1
2022-12-02 14:34:25 +00:00
988ba45197 build(deps-dev): bump cspell from 6.15.0 to 6.15.1
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.15.0 to 6.15.1.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.15.0...v6.15.1)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:02:12 +00:00
df6606041b build(deps-dev): bump ts-loader from 9.4.1 to 9.4.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.4.1 to 9.4.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/9.4.1...v9.4.2)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:53 +00:00
3ae27b466f build(deps-dev): bump tsconfig-paths from 4.1.0 to 4.1.1
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:25 +00:00
69f5e21435 build(deps): bump @types/node from 18.11.9 to 18.11.10
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.9 to 18.11.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:05 +00:00
6da73c612a Add demo for thai distributed 2022-11-30 03:54:01 +00:00
e1b1c1492f Merge pull request #1803 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.45.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.44.0 to 5.45.0
2022-11-30 01:47:32 +00:00
6ca13c4fce Merge pull request #1802 from dolanmiu/dependabot/npm_and_yarn/types/mocha-10.0.1
build(deps-dev): bump @types/mocha from 10.0.0 to 10.0.1
2022-11-30 01:47:24 +00:00
b474567d20 Merge pull request #1801 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.45.0
build(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0
2022-11-30 01:47:13 +00:00
c07170902e Merge pull request #1804 from dolanmiu/dependabot/npm_and_yarn/sinon-15.0.0
build(deps-dev): bump sinon from 14.0.2 to 15.0.0
2022-11-30 01:47:04 +00:00
0f201d2f4b Update README.md 2022-11-29 19:29:32 +00:00
b875d6f183 build(deps-dev): bump sinon from 14.0.2 to 15.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.2 to 15.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.2...v15.0.0)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:02:17 +00:00
831b92239d build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.44.0 to 5.45.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:01:30 +00:00
66b91c22dd build(deps-dev): bump @types/mocha from 10.0.0 to 10.0.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:01:14 +00:00
1242c0689f build(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.44.0 to 5.45.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:01:01 +00:00
4386d02526 Merge pull request #1799 from dolanmiu/dependabot/npm_and_yarn/cspell-6.15.0
build(deps-dev): bump cspell from 6.14.3 to 6.15.0
2022-11-29 10:32:39 +00:00
3ba521f8cc Merge pull request #1800 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-45.0.1
build(deps-dev): bump eslint-plugin-unicorn from 45.0.0 to 45.0.1
2022-11-29 10:32:30 +00:00
85bb818ae6 build(deps-dev): bump eslint-plugin-unicorn from 45.0.0 to 45.0.1
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 45.0.0 to 45.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.0...v45.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 11:01:03 +00:00
be7e2aa8fe build(deps-dev): bump cspell from 6.14.3 to 6.15.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.14.3 to 6.15.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.14.3...v6.15.0)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 11:00:50 +00:00
7f71f6e3f1 Add demo for data source for tables 2022-11-26 20:32:32 +00:00
a94d23e2ae Add default npmrc 2022-11-26 19:33:58 +00:00
133c255ce2 Merge pull request #1798 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.4
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.2 to 39.6.4
2022-11-25 11:11:26 +00:00
863e27ff9b build(deps-dev): bump eslint-plugin-jsdoc from 39.6.2 to 39.6.4
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.2 to 39.6.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.6.2...v39.6.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 11:00:50 +00:00
5c63e6ae12 Merge pull request #1797 from dolanmiu/feat/new-levels
#212 Add more levels support
2022-11-25 01:48:30 +00:00
10dd36569d #212 Add more levels support 2022-11-25 01:36:59 +00:00
be5985fb6a Merge pull request #1795 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.0
build(deps-dev): bump prettier from 2.7.1 to 2.8.0
2022-11-23 20:17:39 +00:00
0d7f169613 build(deps-dev): bump prettier from 2.7.1 to 2.8.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-23 11:01:16 +00:00
eaddcb83ab Merge pull request #1792 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.44.0
build(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0
2022-11-23 01:00:45 +00:00
9a6885f124 Add Thai Distributed demo 2022-11-23 00:36:54 +00:00
7284ee818b build(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.43.0 to 5.44.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.44.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 23:51:30 +00:00
20964454c4 Merge pull request #1793 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.44.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.43.0 to 5.44.0
2022-11-22 23:50:51 +00:00
d7670929d1 build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.43.0 to 5.44.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.44.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 11:02:02 +00:00
58f0761423 Merge pull request #1790 from dolanmiu/dependabot/npm_and_yarn/eslint-8.28.0
build(deps-dev): bump eslint from 8.27.0 to 8.28.0
2022-11-21 23:26:13 +00:00
3f28bc09bc Merge pull request #1791 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-45.0.0
build(deps-dev): bump eslint-plugin-unicorn from 44.0.2 to 45.0.0
2022-11-21 23:26:02 +00:00
6efa734e81 build(deps-dev): bump eslint-plugin-unicorn from 44.0.2 to 45.0.0
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 44.0.2 to 45.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.2...v45.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 11:01:31 +00:00
47d64af737 build(deps-dev): bump eslint from 8.27.0 to 8.28.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.27.0 to 8.28.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.27.0...v8.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 11:00:53 +00:00
4a2b91ce07 Update sidebar for docs 2022-11-19 22:16:04 +00:00
080a77cc73 Merge pull request #1787 from dolanmiu/feat/more-alignment-options
#1784 Add more alignment options according to spec
2022-11-19 22:08:12 +00:00
9b874b0061 #1784 Add more alignment options according to spec 2022-11-19 20:14:15 +00:00
ff8a2ed538 Merge pull request #1785 from dolanmiu/feat/exact
#1773 Add `exact` for spacing
2022-11-19 16:24:07 +00:00
251eafe103 #1773 Add exact for spacing 2022-11-19 15:51:41 +00:00
64b604c9ac Merge pull request #1782 from dolanmiu/dependabot/npm_and_yarn/cspell-6.14.3
build(deps-dev): bump cspell from 6.14.2 to 6.14.3
2022-11-18 17:11:29 +00:00
72fc5f9874 Merge pull request #1783 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-5.0.0
build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.0
2022-11-18 17:11:22 +00:00
71dcdf0ca2 build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.10.0 to 5.0.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.10.0...webpack-cli@5.0.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 11:02:49 +00:00
e23fc987a7 build(deps-dev): bump cspell from 6.14.2 to 6.14.3
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.14.2 to 6.14.3.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.14.2...v6.14.3)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 11:01:56 +00:00
36dba1a36f Merge pull request #1781 from dolanmiu/dependabot/npm_and_yarn/typescript-4.9.3
build(deps-dev): bump typescript from 4.8.4 to 4.9.3
2022-11-17 00:39:57 +00:00
1b1547d4b6 build(deps-dev): bump typescript from 4.8.4 to 4.9.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.4 to 4.9.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 11:01:25 +00:00
19 changed files with 1181 additions and 598 deletions

1
.npmrc Normal file
View File

@ -0,0 +1 @@
registry=https://registry.npmjs.org/

View File

@ -29,11 +29,12 @@ Here are examples of `docx` being used with basic `HTML/JS` in a browser environ
- https://codepen.io/dolanmiu/pen/RwNeObg - https://codepen.io/dolanmiu/pen/RwNeObg
- https://jsfiddle.net/dolanmiu/onadx1gu/ - https://jsfiddle.net/dolanmiu/onadx1gu/
Here is an example of `docx` working in `Angular`: Here are examples of `docx` working in `Angular`:
- https://stackblitz.com/edit/angular-docx - https://stackblitz.com/edit/angular-docx
- https://stackblitz.com/edit/angular-wmd6k3
Here is an example of `docx` working in `React`: Here are examples of `docx` working in `React`:
- https://stackblitz.com/edit/react-docx - https://stackblitz.com/edit/react-docx
- https://stackblitz.com/edit/react-docx-images (adding images to Word Document) - https://stackblitz.com/edit/react-docx-images (adding images to Word Document)

View File

@ -14,6 +14,7 @@ const doc = new Document({
new TextRun({ new TextRun({
text: "Foo Bar", text: "Foo Bar",
bold: true, bold: true,
size: 40,
}), }),
new TextRun({ new TextRun({
children: [new Tab(), "Github is the best"], children: [new Tab(), "Github is the best"],

View File

@ -222,6 +222,15 @@ const doc = new Document({
new TextRun({ new TextRun({
text: "Underline and Strike", text: "Underline and Strike",
}), }),
new TextRun({
text: " Override Underline ",
underline: {
type: UnderlineType.NONE,
},
}),
new TextRun({
text: "Strike and Underline",
}),
], ],
}), }),
new Paragraph({ new Paragraph({

View File

@ -0,0 +1,27 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
alignment: AlignmentType.THAI_DISTRIBUTE,
children: [
new TextRun({
text: "บริษัท บิสกิด จำกัด (บริษัทฯ) ได้จดทะเบียนจัดตั้งขึ้นเป็นบริษัทจำกัดตามประมวลกฎหมายแพ่งและพาณิชย์ของประเทศไทย เมื่อวันที่ 30 พฤษภาคม 2561 ทะเบียนนิติบุคคลเลขที่ 0845561005665",
size: 36,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,193 @@
// Example of how you would create a table and add data to it from a data source
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
Document,
HeadingLevel,
Packer,
Paragraph,
Table,
TableCell,
TableRow,
VerticalAlign,
TextDirection,
TextRun,
WidthType,
} from "../build";
interface StockPrice {
readonly date: Date;
readonly ticker: string;
readonly price: number;
}
const DATA: StockPrice[] = [
{
date: new Date("2007-08-28"),
ticker: "Apple",
price: 18.12,
},
{
date: new Date("2007-08-29"),
ticker: "Apple",
price: 19.15,
},
{
date: new Date("2007-08-30"),
ticker: "Apple",
price: 19.46,
},
{
date: new Date("2007-08-31"),
ticker: "Apple",
price: 19.78,
},
{
date: new Date("2007-09-04"),
ticker: "Apple",
price: 20.59,
},
{
date: new Date("2007-09-05"),
ticker: "Apple",
price: 19.54,
},
{
date: new Date("2007-09-06"),
ticker: "Apple",
price: 19.29,
},
{
date: new Date("2007-09-07"),
ticker: "Apple",
price: 18.82,
},
{
date: new Date("2007-09-10"),
ticker: "Apple",
price: 19.53,
},
{
date: new Date("2007-09-11"),
ticker: "Apple",
price: 19.36,
},
{
date: new Date("2007-09-12"),
ticker: "Apple",
price: 19.55,
},
{
date: new Date("2007-09-13"),
ticker: "Apple",
price: 19.6,
},
{
date: new Date("2007-09-14"),
ticker: "Apple",
price: 19.83,
},
{
date: new Date("2007-09-17"),
ticker: "Apple",
price: 19.77,
},
];
const generateRows = (prices: StockPrice[]): TableRow[] =>
prices.map(
({ date, ticker, price }) =>
new TableRow({
children: [
new TableCell({
children: [new Paragraph(date.toString())],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [new Paragraph(ticker)],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [new Paragraph(price.toString())],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
);
const doc = new Document({
sections: [
{
children: [
new Table({
width: {
size: 9070,
type: WidthType.DXA,
},
rows: [
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Date",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Ticker",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Price",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
...generateRows(DATA),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,49 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
styles: {
paragraphStyles: [
{
id: "test",
name: "Test",
basedOn: "Normal",
next: "Normal",
paragraph: {
indent: { left: convertMillimetersToTwip(6.4) },
},
},
],
},
sections: [
{
properties: {
page: {
margin: {
top: 0,
right: convertMillimetersToTwip(24),
bottom: convertMillimetersToTwip(24),
left: convertMillimetersToTwip(24),
},
},
},
children: [
new Paragraph({
alignment: AlignmentType.THAI_DISTRIBUTE,
children: [
new TextRun({
text: "บริษัทฯ มีเงินสด 41,985.00 บาท และ 25,855.66 บาทตามลำดับ เงินสดทั้งจำนวนอยู่ในความดูแลและรับผิดชอบของกรรมการ บริษัทฯบันทึกการรับชำระเงินและการจ่ายชำระเงินผ่านบัญชีเงินสดเพียงเท่านั้น ซึ่งอาจกระทบต่อความถูกต้องครบถ้วนของการบันทึกบัญชี ทั้งนี้ขึ้นอยู่กับระบบการควบคุมภายในของบริษัท",
size: 28,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -11,8 +11,10 @@
- [Document](usage/document.md) - [Document](usage/document.md)
- [Sections](usage/sections.md) - [Sections](usage/sections.md)
- [Paragraph](usage/paragraph.md) - [Paragraph](usage/paragraph.md)
- [Text Frames](usage/text-frames.md)
- [Symbols](usage/symbols.md)
- [Text](usage/text.md) - [Text](usage/text.md)
- [Image](usage/images.md) - [Images](usage/images.md)
- [Headers & Footers](usage/headers-and-footers.md) - [Headers & Footers](usage/headers-and-footers.md)
- [Bullet Points](usage/bullet-points.md) - [Bullet Points](usage/bullet-points.md)
- [Hyperlinks](usage/hyperlinks.md) - [Hyperlinks](usage/hyperlinks.md)
@ -23,10 +25,12 @@
- [Page Numbers](usage/page-numbers.md) - [Page Numbers](usage/page-numbers.md)
- [Change Tracking](usage/change-tracking.md) - [Change Tracking](usage/change-tracking.md)
- [Math](usage/math.md) - [Math](usage/math.md)
- [Text Frames](usage/text-frames.md) - [Comments](usage/comments.md)
- [Footnotes](usage/footnotes.md)
- [Fields](usage/fields.md)
- Styling - Styling
_ [Styling with JS](usage/styling-with-js.md) - [Styling with JS](usage/styling-with-js.md)
_ [Styling with XML](usage/styling-with-xml.md) - [Styling with XML](usage/styling-with-xml.md)
- Exporting - Exporting

View File

@ -60,29 +60,29 @@ const doc = new Document({
This is the list of options for a paragraph. A detailed explanation is below: This is the list of options for a paragraph. A detailed explanation is below:
| Property | Type | Mandatory? | Possible Values | | Property | Type | Mandatory? | Possible Values |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------- | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [text](#text) | `string` | Optional | | | [text](#text) | `string` | Optional | |
| [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` | | [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` |
| [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example | | [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example |
| [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties | | [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties |
| [outlineLevel](#outline-level) | `number` | Optional | | | [outlineLevel](#outline-level) | `number` | Optional | |
| alignment | `AlignmentType` | Optional | | | alignment | `AlignmentType` | Optional | `START`, `CENTER`, `END`, `BOTH`, `MEDIUM_KASHIDA`, `DISTRIBUTE`, `NUM_TAB`, `HIGH_KASHIDA`, `LOW_KASHIDA`, `THAI_DISTRIBUTE`, `LEFT`, `RIGHT`, `JUSTIFIED` |
| heading | `HeadingLevel` | Optional | | | heading | `HeadingLevel` | Optional | |
| bidirectional | `boolean` | Optional | | | bidirectional | `boolean` | Optional | |
| thematicBreak | `boolean` | Optional | | | thematicBreak | `boolean` | Optional | |
| pageBreakBefore | `boolean` | Optional | | | pageBreakBefore | `boolean` | Optional | |
| contextualSpacing | `boolean` | Optional | | | contextualSpacing | `boolean` | Optional | |
| indent | `IIndentAttributesProperties` | Optional | | | indent | `IIndentAttributesProperties` | Optional | |
| keepLines | `boolean` | Optional | | | keepLines | `boolean` | Optional | |
| keepNext | `boolean` | Optional | | | keepNext | `boolean` | Optional | |
| children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | | | children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | |
| style | `string` | Optional | | | style | `string` | Optional | |
| [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | | | [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | |
| [bullet](usage/bullet-points) | `{ level: number }` | Optional | | | [bullet](usage/bullet-points) | `{ level: number }` | Optional | |
| [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | | | [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | |
| [widowControl](#widow-control) | `boolean` | Optional | | | [widowControl](#widow-control) | `boolean` | Optional | |
| [frame](usage/text-frames.md) | `IFrameOptions` | Optional | | | [frame](usage/text-frames.md) | `IFrameOptions` | Optional | |
## Text ## Text
@ -180,12 +180,14 @@ Adding spacing between paragraphs
### ISpacingProperties ### ISpacingProperties
| Property | Type | Notes | Possible Values | | Property | Type | Notes | Possible Values |
| -------- | -------------- | -------- | ----------------------------- | | -------- | -------------- | -------- | -------------------------------------- |
| after | `number` | Optional | | | after | `number` | Optional | |
| before | `number` | Optional | | | before | `number` | Optional | |
| line | `number` | Optional | | | line | `number` | Optional | |
| lineRule | `LineRuleType` | Optional | `AT_LEAST`, `EXACTLY`, `AUTO` | | lineRule | `LineRuleType` | Optional | `AT_LEAST`, `EXACTLY`, `EXACT`, `AUTO` |
Note: The `lineRule` property has different values depending on the version of Word you are using. The `EXACTLY` value is only available in Word 2016 and above. Use `EXACT` for greater support, including LibreOffice etc. Read this issue for more information: https://github.com/dolanmiu/docx/issues/1773.
**Example:** **Example:**

1175
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "docx", "name": "docx",
"version": "7.7.0", "version": "7.8.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": {
@ -84,7 +84,7 @@
"eslint-plugin-jsdoc": "^39.3.6", "eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^44.0.0", "eslint-plugin-unicorn": "^45.0.0",
"glob": "^8.0.1", "glob": "^8.0.1",
"jszip": "^3.1.5", "jszip": "^3.1.5",
"mocha": "^10.0.0", "mocha": "^10.0.0",
@ -98,17 +98,17 @@
"request-promise": "^4.2.2", "request-promise": "^4.2.2",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"shelljs": "^0.8.4", "shelljs": "^0.8.4",
"sinon": "^14.0.0", "sinon": "^15.0.0",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"ts-loader": "^9.0.0", "ts-loader": "^9.0.0",
"ts-node": "^10.2.1", "ts-node": "^10.2.1",
"tsconfig-paths": "^4.0.0", "tsconfig-paths": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.0.0", "tsconfig-paths-webpack-plugin": "^4.0.0",
"typedoc": "^0.23.2", "typedoc": "^0.23.2",
"typescript": "4.8.4", "typescript": "4.9.4",
"unzipper": "^0.10.11", "unzipper": "^0.10.11",
"webpack": "^5.28.0", "webpack": "^5.28.0",
"webpack-cli": "^4.6.0" "webpack-cli": "^5.0.0"
}, },
"engines": { "engines": {
"node": ">=10" "node": ">=10"

View File

@ -8,7 +8,7 @@ import { DocumentAttributes } from "./document-attributes";
import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background"; import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background";
export interface IDocumentOptions { export interface IDocumentOptions {
readonly background: IDocumentBackgroundOptions; readonly background?: IDocumentBackgroundOptions;
} }
// <xsd:element name="document" type="CT_Document"/> // <xsd:element name="document" type="CT_Document"/>
@ -73,7 +73,9 @@ export class Document extends XmlComponent {
}), }),
); );
this.body = new Body(); this.body = new Body();
this.root.push(new DocumentBackground(options.background)); if (options.background) {
this.root.push(new DocumentBackground(options.background));
}
this.root.push(this.body); this.root.push(this.body);
} }

View File

@ -73,7 +73,7 @@ export class File {
this.appProperties = new AppProperties(); this.appProperties = new AppProperties();
this.footnotesWrapper = new FootnotesWrapper(); this.footnotesWrapper = new FootnotesWrapper();
this.contentTypes = new ContentTypes(); this.contentTypes = new ContentTypes();
this.documentWrapper = new DocumentWrapper({ background: options.background || {} }); this.documentWrapper = new DocumentWrapper({ background: options.background });
this.settings = new Settings({ this.settings = new Settings({
compatibilityModeVersion: options.compatabilityModeVersion, compatibilityModeVersion: options.compatabilityModeVersion,
compatibility: options.compatibility, compatibility: options.compatibility,

View File

@ -1,4 +1,5 @@
// http://officeopenxml.com/WPnumbering-numFmt.php // http://officeopenxml.com/WPnumbering-numFmt.php
// http://www.datypic.com/sc/ooxml/a-w_val-57.html
import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber } from "@util/values"; import { decimalNumber } from "@util/values";
@ -6,21 +7,138 @@ import { AlignmentType } from "../paragraph/formatting";
import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties"; import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties";
import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties"; import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties";
// TODO: Breaking change - consolidate with number-format
// <xsd:simpleType name="ST_NumberFormat">
// <xsd:restriction base="xsd:string">
// <xsd:enumeration value="decimal"/>
// <xsd:enumeration value="upperRoman"/>
// <xsd:enumeration value="lowerRoman"/>
// <xsd:enumeration value="upperLetter"/>
// <xsd:enumeration value="lowerLetter"/>
// <xsd:enumeration value="ordinal"/>
// <xsd:enumeration value="cardinalText"/>
// <xsd:enumeration value="ordinalText"/>
// <xsd:enumeration value="hex"/>
// <xsd:enumeration value="chicago"/>
// <xsd:enumeration value="ideographDigital"/>
// <xsd:enumeration value="japaneseCounting"/>
// <xsd:enumeration value="aiueo"/>
// <xsd:enumeration value="iroha"/>
// <xsd:enumeration value="decimalFullWidth"/>
// <xsd:enumeration value="decimalHalfWidth"/>
// <xsd:enumeration value="japaneseLegal"/>
// <xsd:enumeration value="japaneseDigitalTenThousand"/>
// <xsd:enumeration value="decimalEnclosedCircle"/>
// <xsd:enumeration value="decimalFullWidth2"/>
// <xsd:enumeration value="aiueoFullWidth"/>
// <xsd:enumeration value="irohaFullWidth"/>
// <xsd:enumeration value="decimalZero"/>
// <xsd:enumeration value="bullet"/>
// <xsd:enumeration value="ganada"/>
// <xsd:enumeration value="chosung"/>
// <xsd:enumeration value="decimalEnclosedFullstop"/>
// <xsd:enumeration value="decimalEnclosedParen"/>
// <xsd:enumeration value="decimalEnclosedCircleChinese"/>
// <xsd:enumeration value="ideographEnclosedCircle"/>
// <xsd:enumeration value="ideographTraditional"/>
// <xsd:enumeration value="ideographZodiac"/>
// <xsd:enumeration value="ideographZodiacTraditional"/>
// <xsd:enumeration value="taiwaneseCounting"/>
// <xsd:enumeration value="ideographLegalTraditional"/>
// <xsd:enumeration value="taiwaneseCountingThousand"/>
// <xsd:enumeration value="taiwaneseDigital"/>
// <xsd:enumeration value="chineseCounting"/>
// <xsd:enumeration value="chineseLegalSimplified"/>
// <xsd:enumeration value="chineseCountingThousand"/>
// <xsd:enumeration value="koreanDigital"/>
// <xsd:enumeration value="koreanCounting"/>
// <xsd:enumeration value="koreanLegal"/>
// <xsd:enumeration value="koreanDigital2"/>
// <xsd:enumeration value="vietnameseCounting"/>
// <xsd:enumeration value="russianLower"/>
// <xsd:enumeration value="russianUpper"/>
// <xsd:enumeration value="none"/>
// <xsd:enumeration value="numberInDash"/>
// <xsd:enumeration value="hebrew1"/>
// <xsd:enumeration value="hebrew2"/>
// <xsd:enumeration value="arabicAlpha"/>
// <xsd:enumeration value="arabicAbjad"/>
// <xsd:enumeration value="hindiVowels"/>
// <xsd:enumeration value="hindiConsonants"/>
// <xsd:enumeration value="hindiNumbers"/>
// <xsd:enumeration value="hindiCounting"/>
// <xsd:enumeration value="thaiLetters"/>
// <xsd:enumeration value="thaiNumbers"/>
// <xsd:enumeration value="thaiCounting"/>
// <xsd:enumeration value="bahtText"/>
// <xsd:enumeration value="dollarText"/>
// <xsd:enumeration value="custom"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum LevelFormat { export enum LevelFormat {
BULLET = "bullet",
CARDINAL_TEXT = "cardinalText",
CHICAGO = "chicago",
DECIMAL = "decimal", DECIMAL = "decimal",
UPPER_ROMAN = "upperRoman",
LOWER_ROMAN = "lowerRoman",
UPPER_LETTER = "upperLetter",
LOWER_LETTER = "lowerLetter",
ORDINAL = "ordinal",
CARDINAL_TEXT = "cardinalText",
ORDINAL_TEXT = "ordinalText",
HEX = "hex",
CHICAGO = "chicago",
IDEOGRAPH__DIGITAL = "ideographDigital",
JAPANESE_COUNTING = "japaneseCounting",
AIUEO = "aiueo",
IROHA = "iroha",
DECIMAL_FULL_WIDTH = "decimalFullWidth",
DECIMAL_HALF_WIDTH = "decimalHalfWidth",
JAPANESE_LEGAL = "japaneseLegal",
JAPANESE_DIGITAL_TEN_THOUSAND = "japaneseDigitalTenThousand",
DECIMAL_ENCLOSED_CIRCLE = "decimalEnclosedCircle", DECIMAL_ENCLOSED_CIRCLE = "decimalEnclosedCircle",
DECIMAL_FULL_WIDTH2 = "decimalFullWidth2",
AIUEO_FULL_WIDTH = "aiueoFullWidth",
IROHA_FULL_WIDTH = "irohaFullWidth",
DECIMAL_ZERO = "decimalZero",
BULLET = "bullet",
GANADA = "ganada",
CHOSUNG = "chosung",
DECIMAL_ENCLOSED_FULLSTOP = "decimalEnclosedFullstop", DECIMAL_ENCLOSED_FULLSTOP = "decimalEnclosedFullstop",
DECIMAL_ENCLOSED_PARENTHESES = "decimalEnclosedParen", DECIMAL_ENCLOSED_PARENTHESES = "decimalEnclosedParen",
DECIMAL_ZERO = "decimalZero", DECIMAL_ENCLOSED_CIRCLE_CHINESE = "decimalEnclosedCircleChinese",
LOWER_LETTER = "lowerLetter", IDEOGRAPH_ENCLOSED_CIRCLE = "ideographEnclosedCircle",
LOWER_ROMAN = "lowerRoman", IDEOGRAPH_TRADITIONAL = "ideographTraditional",
IDEOGRAPH_ZODIAC = "ideographZodiac",
IDEOGRAPH_ZODIAC_TRADITIONAL = "ideographZodiacTraditional",
TAIWANESE_COUNTING = "taiwaneseCounting",
IDEOGRAPH_LEGAL_TRADITIONAL = "ideographLegalTraditional",
TAIWANESE_COUNTING_THOUSAND = "taiwaneseCountingThousand",
TAIWANESE_DIGITAL = "taiwaneseDigital",
CHINESE_COUNTING = "chineseCounting",
CHINESE_LEGAL_SIMPLIFIED = "chineseLegalSimplified",
CHINESE_COUNTING_THOUSAND = "chineseCountingThousand",
KOREAN_DIGITAL = "koreanDigital",
KOREAN_COUNTING = "koreanCounting",
KOREAN_LEGAL = "koreanLegal",
KOREAN_DIGITAL2 = "koreanDigital2",
VIETNAMESE_COUNTING = "vietnameseCounting",
RUSSIAN_LOWER = "russianLower",
RUSSIAN_UPPER = "russianUpper",
NONE = "none", NONE = "none",
ORDINAL_TEXT = "ordinalText", NUMBER_IN_DASH = "numberInDash",
UPPER_LETTER = "upperLetter", HEBREW1 = "hebrew1",
UPPER_ROMAN = "upperRoman", HEBREW2 = "hebrew2",
ARABIC_ALPHA = "arabicAlpha",
ARABIC_ABJAD = "arabicAbjad",
HINDI_VOWELS = "hindiVowels",
HINDI_CONSONANTS = "hindiConsonants",
HINDI_NUMBERS = "hindiNumbers",
HINDI_COUNTING = "hindiCounting",
THAI_LETTERS = "thaiLetters",
THAI_NUMBERS = "thaiNumbers",
THAI_COUNTING = "thaiCounting",
BAHT_TEXT = "bahtText",
DOLLAR_TEXT = "dollarText",
CUSTOM = "custom",
} }
class LevelAttributes extends XmlAttributeComponent<{ class LevelAttributes extends XmlAttributeComponent<{

View File

@ -1,16 +1,51 @@
// http://officeopenxml.com/WPalignment.php // http://officeopenxml.com/WPalignment.php
// http://officeopenxml.com/WPtableAlignment.php // http://officeopenxml.com/WPtableAlignment.php
// http://www.datypic.com/sc/ooxml/t-w_ST_Jc.html
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
// <xsd:simpleType name="ST_Jc">
// <xsd:restriction base="xsd:string">
// <xsd:enumeration value="start"/>
// <xsd:enumeration value="center"/>
// <xsd:enumeration value="end"/>
// <xsd:enumeration value="both"/>
// <xsd:enumeration value="mediumKashida"/>
// <xsd:enumeration value="distribute"/>
// <xsd:enumeration value="numTab"/>
// <xsd:enumeration value="highKashida"/>
// <xsd:enumeration value="lowKashida"/>
// <xsd:enumeration value="thaiDistribute"/>
// <xsd:enumeration value="left"/>
// <xsd:enumeration value="right"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum AlignmentType { export enum AlignmentType {
/** Align Start */
START = "start", START = "start",
END = "end", /** Align Center */
CENTER = "center", CENTER = "center",
/** End */
END = "end",
/** Justified */
BOTH = "both", BOTH = "both",
JUSTIFIED = "both", /** Medium Kashida Length */
MEDIUM_KASHIDA = "mediumKashida",
/** Distribute All Characters Equally */
DISTRIBUTE = "distribute", DISTRIBUTE = "distribute",
/** Align to List Tab */
NUM_TAB = "numTab",
/** Widest Kashida Length */
HIGH_KASHIDA = "highKashida",
/** Low Kashida Length */
LOW_KASHIDA = "lowKashida",
/** Thai Language Justification */
THAI_DISTRIBUTE = "thaiDistribute",
/** Align Left */
LEFT = "left", LEFT = "left",
/** Align Right */
RIGHT = "right", RIGHT = "right",
/** Justified */
JUSTIFIED = "both",
} }
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> { export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {

View File

@ -4,6 +4,7 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export enum LineRuleType { export enum LineRuleType {
AT_LEAST = "atLeast", AT_LEAST = "atLeast",
EXACTLY = "exactly", EXACTLY = "exactly",
EXACT = "exact",
AUTO = "auto", AUTO = "auto",
} }
export interface ISpacingProperties { export interface ISpacingProperties {

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; import { expect } from "chai";
import { Formatter } from "@export/formatter"; import { Formatter } from "@export/formatter";
import { SpaceType } from "@file/shared";
import { Text } from "./text"; import { Text } from "./text";
@ -13,5 +14,26 @@ describe("Text", () => {
"w:t": [{ _attr: { "xml:space": "preserve" } }, " this is\n text"], "w:t": [{ _attr: { "xml:space": "preserve" } }, " this is\n text"],
}); });
}); });
it("adds the passed in text to the component with options", () => {
const t = new Text({
text: " this is\n text",
space: SpaceType.PRESERVE,
});
const f = new Formatter().format(t);
expect(f).to.deep.equal({
"w:t": [{ _attr: { "xml:space": "preserve" } }, " this is\n text"],
});
});
it("adds the passed in text to the component with options and sets default space type", () => {
const t = new Text({
text: " this is\n text",
});
const f = new Formatter().format(t);
expect(f).to.deep.equal({
"w:t": [{ _attr: { "xml:space": "default" } }, " this is\n text"],
});
});
}); });
}); });

View File

@ -3,11 +3,31 @@ import { XmlComponent } from "@file/xml-components";
import { TextAttributes } from "../text-attributes"; import { TextAttributes } from "../text-attributes";
export class Text extends XmlComponent { // <xsd:complexType name="CT_Text">
public constructor(text: string) { // <xsd:simpleContent>
super("w:t"); // <xsd:extension base="s:ST_String">
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE })); // <xsd:attribute ref="xml:space" use="optional" />
// </xsd:extension>
// </xsd:simpleContent>
// </xsd:complexType>
this.root.push(text); interface ITextOptions {
readonly space?: SpaceType;
readonly text?: string;
}
export class Text extends XmlComponent {
public constructor(options: string | ITextOptions) {
super("w:t");
if (typeof options === "string") {
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
this.root.push(options);
return this;
} else {
this.root.push(new TextAttributes({ space: options.space ?? SpaceType.DEFAULT }));
this.root.push(options.text);
return this;
}
} }
} }

View File

@ -19,6 +19,7 @@ export enum UnderlineType {
WAVE = "wave", WAVE = "wave",
WAVYHEAVY = "wavyHeavy", WAVYHEAVY = "wavyHeavy",
WAVYDOUBLE = "wavyDouble", WAVYDOUBLE = "wavyDouble",
NONE = "none",
} }
export class Underline extends XmlComponent { export class Underline extends XmlComponent {