Commit Graph

53 Commits

Author SHA1 Message Date
Dolan
410152441b fixed tslinting issues 2017-04-15 17:54:47 +01:00
felipe
0453f28951 add keepLines and keepNext support for paragraph formatting
This commit adds it to the three places where paragraph formatting can
be applied right now (directly on the paragraph, paragraph styles, and
bullets/numbering styles). I'm separately adding an entry to the wiki
regarding what these methods do (widow/orphan control)
2017-04-14 21:13:11 +02:00
felipe
b1c8b2beb8 add xml:space="preserve" to text runs
In MS Word 2015 (and possibly others), leading and trailing spaces are
ignored in text runs. This means that calling TextRun with
leading/trailing space would result in a document that didn't include
those spaces. The fix here (per http://officeopenxml.com/WPtext.php)
is to include an extra attribute on the "w:t" element that forces word
to recognize those spaces.
2017-04-14 11:08:19 +02:00
Dolan Miu
91a757619e fixed unit tests 2017-04-01 12:30:27 +01:00
Dolan Miu
fa44acca1b added the remaining classes required 2017-03-13 00:02:56 +00:00
Dolan Miu
34ce662f70 added basic test for drawing 2017-03-12 23:32:02 +00:00
felipe
8c6cd012e7 eliminated duplicate implementation of strikethrough 2017-03-12 17:51:52 +01:00
felipe
90049a31ee added #style method to runs 2017-03-12 17:35:15 +01:00
felipe
3dbd917667 added #color and #size methods to Run 2017-03-12 17:31:36 +01:00
felipe
d85c6ce56a allow Run#underline to take style and color arguments 2017-03-12 17:28:52 +01:00
felipe
fb6a4383ff renamed cell#push to cell#addContent 2017-03-11 21:15:45 +01:00
felipe
70f4613e1b appease the linter 2017-03-11 10:30:25 +01:00
felipe
bd9d6b74f5 added Cell#createParagraph method 2017-03-11 10:30:08 +01:00
felipe
bd3eb3e214 move the cell-paragraph validation into prepForXml
Instead of forcing table cells to only have a single paragraph as
their content, we now check whether they end in a paragraph (and
insert one if necessary) during #prepForXml
2017-03-11 10:22:30 +01:00
felipe
c10b576a3a added fixedWidthLayout option and method 2017-03-11 09:59:29 +01:00
felipe
210b97d00b added document#createTable 2017-03-11 09:02:36 +01:00
felipe
62a238de84 more sane width management 2017-03-11 09:02:22 +01:00
felipe
7b6f5bbaef forgot to test #getCell 2017-03-10 17:48:05 +01:00
felipe
a45048a464 fix a handful of strict null errors; make test config also be strict
These errors only arose because I didn't run `npm build`, only `npm
test`. Then, when I tried building the null checks failed. Keeping the
two config fiels in sync will help prevent this issue in the future
2017-03-10 17:45:37 +01:00
felipe
c0b0649f37 added tests for table v1 2017-03-10 17:39:37 +01:00
felipe
9d7573ed9c fix unused imports linter warnings 2017-03-10 16:09:21 +01:00
felipe
35ddda444a rename paragraph#createRun to paragraph#createTextRun 2017-03-10 14:44:25 +01:00
felipe
8d11ec3422 add paragraph.createRun method 2017-03-10 14:36:16 +01:00
felipe
ea647d84df add document.createParagraph method 2017-03-10 14:31:21 +01:00
felipe
62911d6e44 make XmlAttributeComponent into a generic class
This change brings increased type safety to uses of
XmlAttributeComponent. Now the compiler is checkign for us that the
properties that get passed in to every subclass match the intended
interface, and also that the xmlKeys property -> xml attribute mapping
has all the right keys
2017-03-10 14:19:45 +01:00
felipe
7ff838357a removed empty Attributes from ParagraphProperties
I checked the spec, and "w:pPr" does not take any attributes. I also
converted the paragraph tests to use the deep.equal style to get rid
of some more jsonify!
2017-03-10 10:32:40 +01:00
Dolan
7022b39d2e linting 2017-03-09 22:56:08 +00:00
Dolan
5fac776dca listing stuff 2017-03-09 22:31:55 +00:00
felipe
11e918114d clear out clearVariables! In comes toXml 2017-03-09 20:49:14 +01:00
felipe
879b9163a3 Allow XmlComponent to take strings and remove XmlUnit 2017-03-09 20:21:49 +01:00
felipe
766bcabcb8 allow Underline to be called with type and color; fix default 2017-03-09 12:42:19 +01:00
felipe
f06094c91d clean up underlineTests linter warnings 2017-03-09 12:36:33 +01:00
felipe
3b18b8267a fix paragraphTests.ts linter warnings 2017-03-09 12:25:59 +01:00
felipe
20ec9b679e added Spacing for paragraphs and ParagraphStyle 2017-03-09 12:16:49 +01:00
felipe
18ca93e50a add paragraph#style method to quickly set the style 2017-03-09 11:11:07 +01:00
felipe
2684f16579 move indent.ts over to paragraph and add a #indent method 2017-03-09 09:59:48 +01:00
felipe
1a37242a3d add #font method to Run 2017-03-08 20:47:36 +01:00
felipe
81e0d56918 fix linter warnings in runTest.ts 2017-03-08 20:47:35 +01:00
felipe
237be76d33 move run-fonts to docx/run and add a test 2017-03-08 20:47:35 +01:00
felipe
0e9532d835 added #setNumbering method to paragraph 2017-03-08 18:23:00 +01:00
felipe
52c4e3cabd allow NumberProperties to specify custom id/level
This change allows callers to create custom numbering styles and
attach them to paragraphs
2017-03-08 16:20:44 +01:00
Dolan
9c3023019f huge clean up of project. Now uses @types, and removed committed typings.
Formatted the imports too
2017-03-07 22:15:53 +00:00
Dolan Miu
078196c6d6 wrote lots of tests 2016-07-18 19:17:19 +01:00
Dolan Miu
d23583f9b5 break tests 2016-07-18 18:49:11 +01:00
Dolan Miu
81e7d01556 unordered list tests 2016-07-17 16:28:54 +01:00
Dolan Miu
f4bc0613a6 page break tests 2016-07-17 16:18:20 +01:00
Dolan Miu
016cffd66c added new tests for xml components 2016-07-17 16:03:31 +01:00
Dolan Miu
f8cf0431c0 wrote tab stop tests 2016-07-15 18:50:54 +01:00
Dolan Miu
8752c63345 moved test into correct location 2016-07-13 18:49:32 +01:00
Dolan Miu
4ffedc7756 wrote tests for underlines 2016-07-13 18:49:02 +01:00