docxmlater 0.31.0 → 1.1.0
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.
- package/README.md +277 -193
- package/dist/core/Document.d.ts +29 -0
- package/dist/core/Document.d.ts.map +1 -1
- package/dist/core/Document.js +123 -2
- package/dist/core/Document.js.map +1 -1
- package/dist/core/DocumentGenerator.d.ts +3 -2
- package/dist/core/DocumentGenerator.d.ts.map +1 -1
- package/dist/core/DocumentGenerator.js +264 -199
- package/dist/core/DocumentGenerator.js.map +1 -1
- package/dist/core/DocumentParser.d.ts +18 -0
- package/dist/core/DocumentParser.d.ts.map +1 -1
- package/dist/core/DocumentParser.js +1311 -26
- package/dist/core/DocumentParser.js.map +1 -1
- package/dist/elements/Field.d.ts +7 -1
- package/dist/elements/Field.d.ts.map +1 -1
- package/dist/elements/Field.js +74 -0
- package/dist/elements/Field.js.map +1 -1
- package/dist/elements/Hyperlink.d.ts +0 -1
- package/dist/elements/Hyperlink.d.ts.map +1 -1
- package/dist/elements/Hyperlink.js +0 -32
- package/dist/elements/Hyperlink.js.map +1 -1
- package/dist/elements/Image.d.ts +94 -0
- package/dist/elements/Image.d.ts.map +1 -1
- package/dist/elements/Image.js +311 -25
- package/dist/elements/Image.js.map +1 -1
- package/dist/elements/Paragraph.d.ts +109 -31
- package/dist/elements/Paragraph.d.ts.map +1 -1
- package/dist/elements/Paragraph.js +274 -0
- package/dist/elements/Paragraph.js.map +1 -1
- package/dist/elements/Run.d.ts +68 -0
- package/dist/elements/Run.d.ts.map +1 -1
- package/dist/elements/Run.js +243 -39
- package/dist/elements/Run.js.map +1 -1
- package/dist/elements/Section.d.ts +16 -0
- package/dist/elements/Section.d.ts.map +1 -1
- package/dist/elements/Section.js +61 -1
- package/dist/elements/Section.js.map +1 -1
- package/dist/elements/Shape.d.ts +86 -0
- package/dist/elements/Shape.d.ts.map +1 -0
- package/dist/elements/Shape.js +461 -0
- package/dist/elements/Shape.js.map +1 -0
- package/dist/elements/StructuredDocumentTag.d.ts +61 -0
- package/dist/elements/StructuredDocumentTag.d.ts.map +1 -1
- package/dist/elements/StructuredDocumentTag.js +235 -0
- package/dist/elements/StructuredDocumentTag.js.map +1 -1
- package/dist/elements/Table.d.ts +33 -0
- package/dist/elements/Table.d.ts.map +1 -1
- package/dist/elements/Table.js +82 -8
- package/dist/elements/Table.js.map +1 -1
- package/dist/elements/TableCell.d.ts +17 -1
- package/dist/elements/TableCell.d.ts.map +1 -1
- package/dist/elements/TableCell.js +61 -8
- package/dist/elements/TableCell.js.map +1 -1
- package/dist/elements/TableRow.d.ts +29 -0
- package/dist/elements/TableRow.d.ts.map +1 -1
- package/dist/elements/TableRow.js +106 -0
- package/dist/elements/TableRow.js.map +1 -1
- package/dist/elements/TextBox.d.ts +77 -0
- package/dist/elements/TextBox.d.ts.map +1 -0
- package/dist/elements/TextBox.js +440 -0
- package/dist/elements/TextBox.js.map +1 -0
- package/dist/formatting/Style.d.ts +100 -0
- package/dist/formatting/Style.d.ts.map +1 -1
- package/dist/formatting/Style.js +396 -1
- package/dist/formatting/Style.js.map +1 -1
- package/dist/formatting/StylesManager.d.ts +6 -0
- package/dist/formatting/StylesManager.d.ts.map +1 -1
- package/dist/formatting/StylesManager.js +50 -0
- package/dist/formatting/StylesManager.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/managers/DrawingManager.d.ts +42 -0
- package/dist/managers/DrawingManager.d.ts.map +1 -0
- package/dist/managers/DrawingManager.js +160 -0
- package/dist/managers/DrawingManager.js.map +1 -0
- package/dist/xml/XMLBuilder.d.ts +2 -0
- package/dist/xml/XMLBuilder.d.ts.map +1 -1
- package/dist/xml/XMLBuilder.js +14 -0
- package/dist/xml/XMLBuilder.js.map +1 -1
- package/dist/xml/XMLParser.d.ts.map +1 -1
- package/dist/xml/XMLParser.js +7 -1
- package/dist/xml/XMLParser.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextBox = void 0;
|
|
4
|
+
const XMLBuilder_1 = require("../xml/XMLBuilder");
|
|
5
|
+
class TextBox {
|
|
6
|
+
width;
|
|
7
|
+
height;
|
|
8
|
+
paragraphs = [];
|
|
9
|
+
position;
|
|
10
|
+
anchor;
|
|
11
|
+
fill;
|
|
12
|
+
borders;
|
|
13
|
+
margins;
|
|
14
|
+
name;
|
|
15
|
+
description;
|
|
16
|
+
docPrId = 1;
|
|
17
|
+
constructor(properties) {
|
|
18
|
+
this.width = properties.width;
|
|
19
|
+
this.height = properties.height;
|
|
20
|
+
if (properties.paragraphs) {
|
|
21
|
+
this.paragraphs = properties.paragraphs;
|
|
22
|
+
}
|
|
23
|
+
this.position = properties.position;
|
|
24
|
+
this.anchor = properties.anchor;
|
|
25
|
+
this.fill = properties.fill;
|
|
26
|
+
this.borders = properties.borders;
|
|
27
|
+
this.margins = properties.margins;
|
|
28
|
+
this.name = properties.name || 'TextBox';
|
|
29
|
+
this.description = properties.description || '';
|
|
30
|
+
}
|
|
31
|
+
static create(width, height) {
|
|
32
|
+
return new TextBox({ width, height });
|
|
33
|
+
}
|
|
34
|
+
getWidth() {
|
|
35
|
+
return this.width;
|
|
36
|
+
}
|
|
37
|
+
getHeight() {
|
|
38
|
+
return this.height;
|
|
39
|
+
}
|
|
40
|
+
addParagraph(paragraph) {
|
|
41
|
+
this.paragraphs.push(paragraph);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
getParagraphs() {
|
|
45
|
+
return this.paragraphs;
|
|
46
|
+
}
|
|
47
|
+
setPosition(horizontal, vertical) {
|
|
48
|
+
this.position = { horizontal, vertical };
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
getPosition() {
|
|
52
|
+
return this.position;
|
|
53
|
+
}
|
|
54
|
+
setAnchor(options) {
|
|
55
|
+
this.anchor = options;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
getAnchor() {
|
|
59
|
+
return this.anchor;
|
|
60
|
+
}
|
|
61
|
+
setFill(color, transparency) {
|
|
62
|
+
this.fill = { color, transparency };
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
getFill() {
|
|
66
|
+
return this.fill;
|
|
67
|
+
}
|
|
68
|
+
setBorders(borders) {
|
|
69
|
+
this.borders = borders;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
getBorders() {
|
|
73
|
+
return this.borders;
|
|
74
|
+
}
|
|
75
|
+
setMargins(margins) {
|
|
76
|
+
this.margins = margins;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
getMargins() {
|
|
80
|
+
return this.margins;
|
|
81
|
+
}
|
|
82
|
+
setName(name) {
|
|
83
|
+
this.name = name;
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
getName() {
|
|
87
|
+
return this.name;
|
|
88
|
+
}
|
|
89
|
+
setDescription(description) {
|
|
90
|
+
this.description = description;
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
getDescription() {
|
|
94
|
+
return this.description;
|
|
95
|
+
}
|
|
96
|
+
setDocPrId(id) {
|
|
97
|
+
this.docPrId = id;
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
isFloating() {
|
|
101
|
+
return this.anchor !== undefined || this.position !== undefined;
|
|
102
|
+
}
|
|
103
|
+
toXML() {
|
|
104
|
+
const textboxElement = this.isFloating() ? this.createAnchor() : this.createInline();
|
|
105
|
+
return XMLBuilder_1.XMLBuilder.w('drawing', undefined, [textboxElement]);
|
|
106
|
+
}
|
|
107
|
+
createInline() {
|
|
108
|
+
const children = [];
|
|
109
|
+
children.push({
|
|
110
|
+
name: 'wp:extent',
|
|
111
|
+
attributes: {
|
|
112
|
+
cx: this.width.toString(),
|
|
113
|
+
cy: this.height.toString(),
|
|
114
|
+
},
|
|
115
|
+
selfClosing: true,
|
|
116
|
+
});
|
|
117
|
+
children.push({
|
|
118
|
+
name: 'wp:effectExtent',
|
|
119
|
+
attributes: {
|
|
120
|
+
l: '0',
|
|
121
|
+
t: '0',
|
|
122
|
+
r: '0',
|
|
123
|
+
b: '0',
|
|
124
|
+
},
|
|
125
|
+
selfClosing: true,
|
|
126
|
+
});
|
|
127
|
+
children.push({
|
|
128
|
+
name: 'wp:docPr',
|
|
129
|
+
attributes: {
|
|
130
|
+
id: this.docPrId.toString(),
|
|
131
|
+
name: this.name,
|
|
132
|
+
descr: this.description,
|
|
133
|
+
},
|
|
134
|
+
selfClosing: true,
|
|
135
|
+
});
|
|
136
|
+
children.push({
|
|
137
|
+
name: 'wp:cNvGraphicFramePr',
|
|
138
|
+
selfClosing: true,
|
|
139
|
+
});
|
|
140
|
+
children.push(this.createGraphic());
|
|
141
|
+
return {
|
|
142
|
+
name: 'wp:inline',
|
|
143
|
+
attributes: {
|
|
144
|
+
distT: '0',
|
|
145
|
+
distB: '0',
|
|
146
|
+
distL: '0',
|
|
147
|
+
distR: '0',
|
|
148
|
+
},
|
|
149
|
+
children,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
createAnchor() {
|
|
153
|
+
const children = [];
|
|
154
|
+
const anchorConfig = this.anchor || {
|
|
155
|
+
behindDoc: false,
|
|
156
|
+
locked: false,
|
|
157
|
+
layoutInCell: true,
|
|
158
|
+
allowOverlap: false,
|
|
159
|
+
relativeHeight: 251658240,
|
|
160
|
+
};
|
|
161
|
+
if (this.position) {
|
|
162
|
+
const posH = this.position.horizontal;
|
|
163
|
+
const posHChildren = [];
|
|
164
|
+
if (posH.offset !== undefined) {
|
|
165
|
+
posHChildren.push({
|
|
166
|
+
name: 'wp:posOffset',
|
|
167
|
+
children: [posH.offset.toString()],
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
else if (posH.alignment) {
|
|
171
|
+
posHChildren.push({
|
|
172
|
+
name: 'wp:align',
|
|
173
|
+
children: [posH.alignment],
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
children.push({
|
|
177
|
+
name: 'wp:positionH',
|
|
178
|
+
attributes: {
|
|
179
|
+
relativeFrom: posH.anchor,
|
|
180
|
+
},
|
|
181
|
+
children: posHChildren,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (this.position) {
|
|
185
|
+
const posV = this.position.vertical;
|
|
186
|
+
const posVChildren = [];
|
|
187
|
+
if (posV.offset !== undefined) {
|
|
188
|
+
posVChildren.push({
|
|
189
|
+
name: 'wp:posOffset',
|
|
190
|
+
children: [posV.offset.toString()],
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
else if (posV.alignment) {
|
|
194
|
+
posVChildren.push({
|
|
195
|
+
name: 'wp:align',
|
|
196
|
+
children: [posV.alignment],
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
children.push({
|
|
200
|
+
name: 'wp:positionV',
|
|
201
|
+
attributes: {
|
|
202
|
+
relativeFrom: posV.anchor,
|
|
203
|
+
},
|
|
204
|
+
children: posVChildren,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
children.push({
|
|
208
|
+
name: 'wp:extent',
|
|
209
|
+
attributes: {
|
|
210
|
+
cx: this.width.toString(),
|
|
211
|
+
cy: this.height.toString(),
|
|
212
|
+
},
|
|
213
|
+
selfClosing: true,
|
|
214
|
+
});
|
|
215
|
+
children.push({
|
|
216
|
+
name: 'wp:effectExtent',
|
|
217
|
+
attributes: {
|
|
218
|
+
l: '0',
|
|
219
|
+
t: '0',
|
|
220
|
+
r: '0',
|
|
221
|
+
b: '0',
|
|
222
|
+
},
|
|
223
|
+
selfClosing: true,
|
|
224
|
+
});
|
|
225
|
+
children.push({
|
|
226
|
+
name: 'wp:wrapSquare',
|
|
227
|
+
attributes: {
|
|
228
|
+
wrapText: 'bothSides',
|
|
229
|
+
},
|
|
230
|
+
selfClosing: true,
|
|
231
|
+
});
|
|
232
|
+
children.push({
|
|
233
|
+
name: 'wp:docPr',
|
|
234
|
+
attributes: {
|
|
235
|
+
id: this.docPrId.toString(),
|
|
236
|
+
name: this.name,
|
|
237
|
+
descr: this.description,
|
|
238
|
+
},
|
|
239
|
+
selfClosing: true,
|
|
240
|
+
});
|
|
241
|
+
children.push({
|
|
242
|
+
name: 'wp:cNvGraphicFramePr',
|
|
243
|
+
selfClosing: true,
|
|
244
|
+
});
|
|
245
|
+
children.push(this.createGraphic());
|
|
246
|
+
return {
|
|
247
|
+
name: 'wp:anchor',
|
|
248
|
+
attributes: {
|
|
249
|
+
distT: '0',
|
|
250
|
+
distB: '0',
|
|
251
|
+
distL: '0',
|
|
252
|
+
distR: '0',
|
|
253
|
+
simplePos: '0',
|
|
254
|
+
relativeHeight: anchorConfig.relativeHeight.toString(),
|
|
255
|
+
behindDoc: anchorConfig.behindDoc ? '1' : '0',
|
|
256
|
+
locked: anchorConfig.locked ? '1' : '0',
|
|
257
|
+
layoutInCell: anchorConfig.layoutInCell ? '1' : '0',
|
|
258
|
+
allowOverlap: anchorConfig.allowOverlap ? '1' : '0',
|
|
259
|
+
},
|
|
260
|
+
children,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
createGraphic() {
|
|
264
|
+
return {
|
|
265
|
+
name: 'a:graphic',
|
|
266
|
+
attributes: {
|
|
267
|
+
'xmlns:a': 'http://schemas.openxmlformats.org/drawingml/2006/main',
|
|
268
|
+
},
|
|
269
|
+
children: [
|
|
270
|
+
{
|
|
271
|
+
name: 'a:graphicData',
|
|
272
|
+
attributes: {
|
|
273
|
+
uri: 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
|
|
274
|
+
},
|
|
275
|
+
children: [this.createWps()],
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
createWps() {
|
|
281
|
+
const children = [];
|
|
282
|
+
children.push({
|
|
283
|
+
name: 'wps:cNvSpPr',
|
|
284
|
+
attributes: {
|
|
285
|
+
'xmlns:wps': 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
|
|
286
|
+
txBox: '1',
|
|
287
|
+
},
|
|
288
|
+
selfClosing: true,
|
|
289
|
+
});
|
|
290
|
+
children.push(this.createSpPr());
|
|
291
|
+
children.push(this.createTextBoxContent());
|
|
292
|
+
return {
|
|
293
|
+
name: 'wps:wsp',
|
|
294
|
+
attributes: {
|
|
295
|
+
'xmlns:wps': 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
|
|
296
|
+
},
|
|
297
|
+
children,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
createSpPr() {
|
|
301
|
+
const children = [];
|
|
302
|
+
children.push({
|
|
303
|
+
name: 'a:xfrm',
|
|
304
|
+
children: [
|
|
305
|
+
{
|
|
306
|
+
name: 'a:off',
|
|
307
|
+
attributes: { x: '0', y: '0' },
|
|
308
|
+
selfClosing: true,
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: 'a:ext',
|
|
312
|
+
attributes: {
|
|
313
|
+
cx: this.width.toString(),
|
|
314
|
+
cy: this.height.toString(),
|
|
315
|
+
},
|
|
316
|
+
selfClosing: true,
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
});
|
|
320
|
+
children.push({
|
|
321
|
+
name: 'a:prstGeom',
|
|
322
|
+
attributes: {
|
|
323
|
+
prst: 'rect',
|
|
324
|
+
},
|
|
325
|
+
children: [
|
|
326
|
+
{
|
|
327
|
+
name: 'a:avLst',
|
|
328
|
+
selfClosing: true,
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
});
|
|
332
|
+
if (this.fill) {
|
|
333
|
+
const fillChildren = [];
|
|
334
|
+
if (this.fill.transparency !== undefined) {
|
|
335
|
+
const alpha = 100 - this.fill.transparency;
|
|
336
|
+
fillChildren.push({
|
|
337
|
+
name: 'a:alpha',
|
|
338
|
+
attributes: {
|
|
339
|
+
val: Math.round(alpha * 1000).toString(),
|
|
340
|
+
},
|
|
341
|
+
selfClosing: true,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
children.push({
|
|
345
|
+
name: 'a:solidFill',
|
|
346
|
+
children: [
|
|
347
|
+
{
|
|
348
|
+
name: 'a:srgbClr',
|
|
349
|
+
attributes: {
|
|
350
|
+
val: this.fill.color.toUpperCase(),
|
|
351
|
+
},
|
|
352
|
+
...(fillChildren.length > 0 ? { children: fillChildren } : { selfClosing: true }),
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
children.push({
|
|
359
|
+
name: 'a:noFill',
|
|
360
|
+
selfClosing: true,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
if (this.borders && this.borders.size !== undefined) {
|
|
364
|
+
const lnAttrs = {
|
|
365
|
+
w: (this.borders.size * 12700).toString(),
|
|
366
|
+
};
|
|
367
|
+
const lnChildren = [];
|
|
368
|
+
lnChildren.push({
|
|
369
|
+
name: 'a:solidFill',
|
|
370
|
+
children: [
|
|
371
|
+
{
|
|
372
|
+
name: 'a:srgbClr',
|
|
373
|
+
attributes: {
|
|
374
|
+
val: (this.borders.color || '000000').toUpperCase(),
|
|
375
|
+
},
|
|
376
|
+
selfClosing: true,
|
|
377
|
+
},
|
|
378
|
+
],
|
|
379
|
+
});
|
|
380
|
+
if (this.borders.style && this.borders.style !== 'single') {
|
|
381
|
+
const dashMap = {
|
|
382
|
+
dash: 'dash',
|
|
383
|
+
dot: 'dot',
|
|
384
|
+
dashDot: 'dashDot',
|
|
385
|
+
dashDotDot: 'lgDashDotDot',
|
|
386
|
+
};
|
|
387
|
+
const dashStyle = dashMap[this.borders.style] || 'solid';
|
|
388
|
+
if (dashStyle !== 'solid') {
|
|
389
|
+
lnChildren.push({
|
|
390
|
+
name: 'a:prstDash',
|
|
391
|
+
attributes: {
|
|
392
|
+
val: dashStyle,
|
|
393
|
+
},
|
|
394
|
+
selfClosing: true,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
children.push({
|
|
399
|
+
name: 'a:ln',
|
|
400
|
+
attributes: lnAttrs,
|
|
401
|
+
children: lnChildren,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
return {
|
|
405
|
+
name: 'wps:spPr',
|
|
406
|
+
children,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
createTextBoxContent() {
|
|
410
|
+
if (this.paragraphs.length === 0) {
|
|
411
|
+
return {
|
|
412
|
+
name: 'wps:txbx',
|
|
413
|
+
children: [
|
|
414
|
+
{
|
|
415
|
+
name: 'w:txbxContent',
|
|
416
|
+
children: [
|
|
417
|
+
XMLBuilder_1.XMLBuilder.w('p', undefined, [
|
|
418
|
+
XMLBuilder_1.XMLBuilder.w('r', undefined, [
|
|
419
|
+
XMLBuilder_1.XMLBuilder.w('t', undefined, [''])
|
|
420
|
+
])
|
|
421
|
+
])
|
|
422
|
+
],
|
|
423
|
+
},
|
|
424
|
+
],
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
const paragraphXml = this.paragraphs.map(p => p.toXML());
|
|
428
|
+
return {
|
|
429
|
+
name: 'wps:txbx',
|
|
430
|
+
children: [
|
|
431
|
+
{
|
|
432
|
+
name: 'w:txbxContent',
|
|
433
|
+
children: paragraphXml,
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
exports.TextBox = TextBox;
|
|
440
|
+
//# sourceMappingURL=TextBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextBox.js","sourceRoot":"","sources":["../../src/elements/TextBox.ts"],"names":[],"mappings":";;;AAUA,kDAA2D;AAgE3D,MAAa,OAAO;IACV,KAAK,CAAS;IACd,MAAM,CAAS;IACf,UAAU,GAAgB,EAAE,CAAC;IAC7B,QAAQ,CAAiB;IACzB,MAAM,CAAe;IACrB,IAAI,CAAe;IACn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;gBAChB,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,eAAe;wBACrB,QAAQ,EAAE;4BACR,uBAAU,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE;gCAC3B,uBAAU,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE;oCAC3B,uBAAU,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;iCACnC,CAAC;6BACH,CAAC;yBACH;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAGD,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAEzD,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,eAAe;oBACrB,QAAQ,EAAE,YAAY;iBACvB;aACF;SACF,CAAC;IACJ,CAAC;CACF;AArpBD,0BAqpBC"}
|
|
@@ -2,6 +2,73 @@ import { XMLElement } from '../xml/XMLBuilder';
|
|
|
2
2
|
import { ParagraphFormatting } from '../elements/Paragraph';
|
|
3
3
|
import { RunFormatting } from '../elements/Run';
|
|
4
4
|
export type StyleType = 'paragraph' | 'character' | 'table' | 'numbering';
|
|
5
|
+
export type TableAlignment = 'left' | 'center' | 'right';
|
|
6
|
+
export interface BorderProperties {
|
|
7
|
+
style?: 'none' | 'single' | 'double' | 'dashed' | 'dotted' | 'thick';
|
|
8
|
+
size?: number;
|
|
9
|
+
space?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TableBorders {
|
|
13
|
+
top?: BorderProperties;
|
|
14
|
+
bottom?: BorderProperties;
|
|
15
|
+
left?: BorderProperties;
|
|
16
|
+
right?: BorderProperties;
|
|
17
|
+
insideH?: BorderProperties;
|
|
18
|
+
insideV?: BorderProperties;
|
|
19
|
+
}
|
|
20
|
+
export interface CellBorders extends TableBorders {
|
|
21
|
+
tl2br?: BorderProperties;
|
|
22
|
+
tr2bl?: BorderProperties;
|
|
23
|
+
}
|
|
24
|
+
export interface ShadingProperties {
|
|
25
|
+
fill?: string;
|
|
26
|
+
color?: string;
|
|
27
|
+
val?: 'clear' | 'solid' | 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40' | 'pct50' | 'pct60' | 'pct70' | 'pct75' | 'pct80' | 'pct90' | 'diagStripe' | 'horzStripe' | 'vertStripe' | 'reverseDiagStripe' | 'horzCross' | 'diagCross';
|
|
28
|
+
}
|
|
29
|
+
export interface CellMargins {
|
|
30
|
+
top?: number;
|
|
31
|
+
bottom?: number;
|
|
32
|
+
left?: number;
|
|
33
|
+
right?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TableStyleFormatting {
|
|
36
|
+
indent?: number;
|
|
37
|
+
cellSpacing?: number;
|
|
38
|
+
borders?: TableBorders;
|
|
39
|
+
cellMargins?: CellMargins;
|
|
40
|
+
shading?: ShadingProperties;
|
|
41
|
+
alignment?: TableAlignment;
|
|
42
|
+
}
|
|
43
|
+
export interface TableCellStyleFormatting {
|
|
44
|
+
borders?: CellBorders;
|
|
45
|
+
shading?: ShadingProperties;
|
|
46
|
+
margins?: CellMargins;
|
|
47
|
+
verticalAlignment?: 'top' | 'center' | 'bottom';
|
|
48
|
+
}
|
|
49
|
+
export interface TableRowStyleFormatting {
|
|
50
|
+
cantSplit?: boolean;
|
|
51
|
+
isHeader?: boolean;
|
|
52
|
+
height?: number;
|
|
53
|
+
heightRule?: 'auto' | 'exact' | 'atLeast';
|
|
54
|
+
}
|
|
55
|
+
export type ConditionalFormattingType = 'wholeTable' | 'firstRow' | 'lastRow' | 'firstCol' | 'lastCol' | 'band1Vert' | 'band2Vert' | 'band1Horz' | 'band2Horz' | 'nwCell' | 'neCell' | 'swCell' | 'seCell';
|
|
56
|
+
export interface ConditionalTableFormatting {
|
|
57
|
+
type: ConditionalFormattingType;
|
|
58
|
+
paragraphFormatting?: ParagraphFormatting;
|
|
59
|
+
runFormatting?: RunFormatting;
|
|
60
|
+
tableFormatting?: TableStyleFormatting;
|
|
61
|
+
cellFormatting?: TableCellStyleFormatting;
|
|
62
|
+
rowFormatting?: TableRowStyleFormatting;
|
|
63
|
+
}
|
|
64
|
+
export interface TableStyleProperties {
|
|
65
|
+
table?: TableStyleFormatting;
|
|
66
|
+
cell?: TableCellStyleFormatting;
|
|
67
|
+
row?: TableRowStyleFormatting;
|
|
68
|
+
rowBandSize?: number;
|
|
69
|
+
colBandSize?: number;
|
|
70
|
+
conditionalFormatting?: ConditionalTableFormatting[];
|
|
71
|
+
}
|
|
5
72
|
export interface StyleProperties {
|
|
6
73
|
styleId: string;
|
|
7
74
|
name: string;
|
|
@@ -12,6 +79,16 @@ export interface StyleProperties {
|
|
|
12
79
|
customStyle?: boolean;
|
|
13
80
|
paragraphFormatting?: ParagraphFormatting;
|
|
14
81
|
runFormatting?: RunFormatting;
|
|
82
|
+
tableStyle?: TableStyleProperties;
|
|
83
|
+
qFormat?: boolean;
|
|
84
|
+
uiPriority?: number;
|
|
85
|
+
semiHidden?: boolean;
|
|
86
|
+
unhideWhenUsed?: boolean;
|
|
87
|
+
locked?: boolean;
|
|
88
|
+
personal?: boolean;
|
|
89
|
+
link?: string;
|
|
90
|
+
autoRedefine?: boolean;
|
|
91
|
+
aliases?: string;
|
|
15
92
|
}
|
|
16
93
|
export declare class Style {
|
|
17
94
|
private properties;
|
|
@@ -24,10 +101,31 @@ export declare class Style {
|
|
|
24
101
|
setNext(styleId: string): this;
|
|
25
102
|
setParagraphFormatting(formatting: ParagraphFormatting): this;
|
|
26
103
|
setRunFormatting(formatting: RunFormatting): this;
|
|
104
|
+
setQFormat(enabled: boolean): this;
|
|
105
|
+
setUiPriority(priority: number): this;
|
|
106
|
+
setSemiHidden(hidden: boolean): this;
|
|
107
|
+
setUnhideWhenUsed(enabled: boolean): this;
|
|
108
|
+
setLocked(locked: boolean): this;
|
|
109
|
+
setPersonal(personal: boolean): this;
|
|
110
|
+
setLink(styleId: string): this;
|
|
111
|
+
setAutoRedefine(enabled: boolean): this;
|
|
112
|
+
setAliases(aliases: string): this;
|
|
113
|
+
setTableFormatting(formatting: TableStyleFormatting): this;
|
|
114
|
+
setTableCellFormatting(formatting: TableCellStyleFormatting): this;
|
|
115
|
+
setTableRowFormatting(formatting: TableRowStyleFormatting): this;
|
|
116
|
+
setRowBandSize(size: number): this;
|
|
117
|
+
setColBandSize(size: number): this;
|
|
118
|
+
addConditionalFormatting(conditional: ConditionalTableFormatting): this;
|
|
27
119
|
isValid(): boolean;
|
|
28
120
|
toXML(): XMLElement;
|
|
29
121
|
private generateParagraphProperties;
|
|
30
122
|
private generateRunProperties;
|
|
123
|
+
private generateTableProperties;
|
|
124
|
+
private generateTableCellProperties;
|
|
125
|
+
private generateTableRowProperties;
|
|
126
|
+
private generateConditionalFormatting;
|
|
127
|
+
private generateBorderElements;
|
|
128
|
+
private generateShadingElement;
|
|
31
129
|
static create(properties: StyleProperties): Style;
|
|
32
130
|
static createNormalStyle(): Style;
|
|
33
131
|
static createHeadingStyle(level: number): Style;
|
|
@@ -35,6 +133,8 @@ export declare class Style {
|
|
|
35
133
|
static createSubtitleStyle(): Style;
|
|
36
134
|
static createListParagraphStyle(): Style;
|
|
37
135
|
static createTOCHeadingStyle(): Style;
|
|
136
|
+
static createTableNormalStyle(): Style;
|
|
137
|
+
static createTableGridStyle(): Style;
|
|
38
138
|
clone(): Style;
|
|
39
139
|
mergeWith(otherStyle: Style): this;
|
|
40
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Style.d.ts","sourceRoot":"","sources":["../../src/formatting/Style.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,MAAM,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