@syncfusion/ej2-docx-renderer 0.0.0-stage → 35.2.15

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.
Files changed (129) hide show
  1. package/README.md +2 -2
  2. package/base.d.ts +4 -0
  3. package/base.js +4 -0
  4. package/dist/ej2-docx-renderer.umd.min.js +2 -0
  5. package/dist/ej2-docx-renderer.umd.min.js.map +1 -0
  6. package/dist/es6/ej2-docx-renderer.es2015.js +52432 -0
  7. package/dist/es6/ej2-docx-renderer.es2015.js.map +1 -0
  8. package/dist/es6/ej2-docx-renderer.es5.js +54425 -0
  9. package/dist/es6/ej2-docx-renderer.es5.js.map +1 -0
  10. package/dist/global/ej2-docx-renderer.min.js +2 -0
  11. package/dist/global/ej2-docx-renderer.min.js.map +1 -0
  12. package/dist/global/index.d.ts +5 -0
  13. package/format.d.ts +4 -0
  14. package/format.js +4 -0
  15. package/helper.d.ts +4 -0
  16. package/helper.js +4 -0
  17. package/index.d.ts +4 -0
  18. package/index.js +4 -0
  19. package/license +10 -0
  20. package/list.d.ts +4 -0
  21. package/list.js +4 -0
  22. package/package.json +26 -4
  23. package/parser.d.ts +4 -0
  24. package/parser.js +4 -0
  25. package/src/base/constants.d.ts +2 -0
  26. package/src/base/constants.js +2 -0
  27. package/src/base/dictionary.d.ts +52 -0
  28. package/src/base/dictionary.js +137 -0
  29. package/src/base/index.d.ts +9 -0
  30. package/src/base/index.js +9 -0
  31. package/src/base/keywords.d.ts +422 -0
  32. package/src/base/keywords.js +422 -0
  33. package/src/base/types.d.ts +2590 -0
  34. package/src/base/types.js +1056 -0
  35. package/src/base/unique-format.d.ts +87 -0
  36. package/src/base/unique-format.js +858 -0
  37. package/src/base/unique-formats.d.ts +32 -0
  38. package/src/base/unique-formats.js +87 -0
  39. package/src/document-canvas.d.ts +61 -0
  40. package/src/document-canvas.js +221 -0
  41. package/src/docx-renderer.d.ts +941 -0
  42. package/src/docx-renderer.js +2251 -0
  43. package/src/format/border.d.ts +53 -0
  44. package/src/format/border.js +600 -0
  45. package/src/format/borders.d.ts +44 -0
  46. package/src/format/borders.js +314 -0
  47. package/src/format/cell-format.d.ts +42 -0
  48. package/src/format/cell-format.js +309 -0
  49. package/src/format/character-format.d.ts +152 -0
  50. package/src/format/character-format.js +1224 -0
  51. package/src/format/index.d.ts +14 -0
  52. package/src/format/index.js +14 -0
  53. package/src/format/list-format.d.ts +32 -0
  54. package/src/format/list-format.js +238 -0
  55. package/src/format/paragraph-format.d.ts +103 -0
  56. package/src/format/paragraph-format.js +854 -0
  57. package/src/format/row-format.d.ts +119 -0
  58. package/src/format/row-format.js +545 -0
  59. package/src/format/section-format.d.ts +89 -0
  60. package/src/format/section-format.js +689 -0
  61. package/src/format/shading.d.ts +24 -0
  62. package/src/format/shading.js +137 -0
  63. package/src/format/style.d.ts +106 -0
  64. package/src/format/style.js +286 -0
  65. package/src/format/table-format.d.ts +51 -0
  66. package/src/format/table-format.js +395 -0
  67. package/src/global.js +1 -0
  68. package/src/helper/document-editor-helper.d.ts +515 -0
  69. package/src/helper/document-editor-helper.js +1302 -0
  70. package/src/helper/document-editor-settings.d.ts +293 -0
  71. package/src/helper/document-editor-settings.js +94 -0
  72. package/src/helper/index.d.ts +5 -0
  73. package/src/helper/index.js +5 -0
  74. package/src/helper/layout-helper-methods.d.ts +539 -0
  75. package/src/helper/layout-helper-methods.js +1065 -0
  76. package/src/helper/renderer-hooks.d.ts +74 -0
  77. package/src/helper/renderer-hooks.js +14 -0
  78. package/src/helper/revision-helper-methods.d.ts +199 -0
  79. package/src/helper/revision-helper-methods.js +362 -0
  80. package/src/index.d.ts +18 -0
  81. package/src/index.js +18 -0
  82. package/src/layout-helper.d.ts +190 -0
  83. package/src/layout-helper.js +1368 -0
  84. package/src/layout.d.ts +779 -0
  85. package/src/layout.js +17232 -0
  86. package/src/list/abstract-list.d.ts +25 -0
  87. package/src/list/abstract-list.js +67 -0
  88. package/src/list/index.d.ts +7 -0
  89. package/src/list/index.js +7 -0
  90. package/src/list/level-override.d.ts +22 -0
  91. package/src/list/level-override.js +43 -0
  92. package/src/list/list-level.d.ts +57 -0
  93. package/src/list/list-level.js +249 -0
  94. package/src/list/list.d.ts +30 -0
  95. package/src/list/list.js +100 -0
  96. package/src/page.d.ts +4155 -0
  97. package/src/page.js +11342 -0
  98. package/src/parser/index.d.ts +1 -0
  99. package/src/parser/index.js +1 -0
  100. package/src/parser/sfdt-reader.d.ts +254 -0
  101. package/src/parser/sfdt-reader.js +4569 -0
  102. package/src/render.d.ts +226 -0
  103. package/src/render.js +4222 -0
  104. package/src/text-helper.d.ts +144 -0
  105. package/src/text-helper.js +1079 -0
  106. package/src/text-helpers/index.d.ts +2 -0
  107. package/src/text-helpers/index.js +2 -0
  108. package/src/text-helpers/optimized.d.ts +45 -0
  109. package/src/text-helpers/optimized.js +121 -0
  110. package/src/text-helpers/regular.d.ts +37 -0
  111. package/src/text-helpers/regular.js +93 -0
  112. package/src/themes/font-scheme.d.ts +28 -0
  113. package/src/themes/font-scheme.js +107 -0
  114. package/src/themes/index.d.ts +6 -0
  115. package/src/themes/index.js +6 -0
  116. package/src/themes/major-minor-font-scheme.d.ts +14 -0
  117. package/src/themes/major-minor-font-scheme.js +45 -0
  118. package/src/themes/themes.d.ts +11 -0
  119. package/src/themes/themes.js +31 -0
  120. package/src/utility/index.d.ts +1 -0
  121. package/src/utility/index.js +1 -0
  122. package/src/utility/path-util.d.ts +133 -0
  123. package/src/utility/path-util.js +639 -0
  124. package/text-helpers.d.ts +4 -0
  125. package/text-helpers.js +4 -0
  126. package/themes.d.ts +4 -0
  127. package/themes.js +4 -0
  128. package/utility.d.ts +4 -0
  129. package/utility.js +4 -0
@@ -0,0 +1,395 @@
1
+ import { Dictionary } from '../base/dictionary';
2
+ import { WUniqueFormat } from '../base/unique-format';
3
+ import { WUniqueFormats } from '../base/unique-formats';
4
+ import { WBorders } from './borders';
5
+ import { WShading } from './shading';
6
+ import { isNullOrUndefined } from '@syncfusion/ej2-base';
7
+ /**
8
+ * @private
9
+ */
10
+ var WTableFormat = /** @class */ (function () {
11
+ function WTableFormat(owner) {
12
+ this.uniqueTableFormat = undefined;
13
+ this.borders = new WBorders(this);
14
+ this.shading = new WShading(this);
15
+ this._title = undefined;
16
+ this._description = undefined;
17
+ this.ownerBase = undefined;
18
+ this._styleName = undefined;
19
+ /**
20
+ * @private
21
+ */
22
+ this.isRTFTable = false;
23
+ this.ownerBase = owner;
24
+ this.assignTableMarginValue(5.4, 0, 5.4, 0);
25
+ }
26
+ Object.defineProperty(WTableFormat.prototype, "title", {
27
+ get: function () {
28
+ return this._title;
29
+ },
30
+ set: function (value) {
31
+ this._title = value;
32
+ },
33
+ enumerable: true,
34
+ configurable: true
35
+ });
36
+ Object.defineProperty(WTableFormat.prototype, "description", {
37
+ get: function () {
38
+ return this._description;
39
+ },
40
+ set: function (value) {
41
+ this._description = value;
42
+ },
43
+ enumerable: true,
44
+ configurable: true
45
+ });
46
+ Object.defineProperty(WTableFormat.prototype, "allowAutoFit", {
47
+ get: function () {
48
+ return this.getPropertyValue('allowAutoFit');
49
+ },
50
+ set: function (value) {
51
+ this.setPropertyValue('allowAutoFit', value);
52
+ },
53
+ enumerable: true,
54
+ configurable: true
55
+ });
56
+ Object.defineProperty(WTableFormat.prototype, "cellSpacing", {
57
+ get: function () {
58
+ return this.getPropertyValue('cellSpacing');
59
+ },
60
+ set: function (value) {
61
+ if (value < 0 || value > 264.6) {
62
+ throw new RangeError('The measurement must be between 0 px and 264.6 px.');
63
+ }
64
+ this.setPropertyValue('cellSpacing', value);
65
+ },
66
+ enumerable: true,
67
+ configurable: true
68
+ });
69
+ Object.defineProperty(WTableFormat.prototype, "leftMargin", {
70
+ get: function () {
71
+ return this.getPropertyValue('leftMargin');
72
+ },
73
+ set: function (value) {
74
+ this.setPropertyValue('leftMargin', value);
75
+ },
76
+ enumerable: true,
77
+ configurable: true
78
+ });
79
+ Object.defineProperty(WTableFormat.prototype, "topMargin", {
80
+ get: function () {
81
+ return this.getPropertyValue('topMargin');
82
+ },
83
+ set: function (value) {
84
+ this.setPropertyValue('topMargin', value);
85
+ },
86
+ enumerable: true,
87
+ configurable: true
88
+ });
89
+ Object.defineProperty(WTableFormat.prototype, "rightMargin", {
90
+ get: function () {
91
+ return this.getPropertyValue('rightMargin');
92
+ },
93
+ set: function (value) {
94
+ this.setPropertyValue('rightMargin', value);
95
+ },
96
+ enumerable: true,
97
+ configurable: true
98
+ });
99
+ Object.defineProperty(WTableFormat.prototype, "bottomMargin", {
100
+ get: function () {
101
+ return this.getPropertyValue('bottomMargin');
102
+ },
103
+ set: function (value) {
104
+ this.setPropertyValue('bottomMargin', value);
105
+ },
106
+ enumerable: true,
107
+ configurable: true
108
+ });
109
+ Object.defineProperty(WTableFormat.prototype, "tableAlignment", {
110
+ get: function () {
111
+ return this.getPropertyValue('tableAlignment');
112
+ },
113
+ set: function (value) {
114
+ this.setPropertyValue('tableAlignment', value);
115
+ },
116
+ enumerable: true,
117
+ configurable: true
118
+ });
119
+ Object.defineProperty(WTableFormat.prototype, "leftIndent", {
120
+ get: function () {
121
+ return this.getPropertyValue('leftIndent');
122
+ },
123
+ set: function (value) {
124
+ if (value < -1440 || value > 1440) {
125
+ throw new RangeError('The measurement must be between -1440 px and 1440 px.');
126
+ }
127
+ this.setPropertyValue('leftIndent', value);
128
+ },
129
+ enumerable: true,
130
+ configurable: true
131
+ });
132
+ Object.defineProperty(WTableFormat.prototype, "preferredWidth", {
133
+ get: function () {
134
+ return this.getPropertyValue('preferredWidth');
135
+ },
136
+ set: function (value) {
137
+ this.setPropertyValue('preferredWidth', value);
138
+ },
139
+ enumerable: true,
140
+ configurable: true
141
+ });
142
+ Object.defineProperty(WTableFormat.prototype, "preferredWidthType", {
143
+ get: function () {
144
+ return this.getPropertyValue('preferredWidthType');
145
+ },
146
+ set: function (value) {
147
+ this.setPropertyValue('preferredWidthType', value);
148
+ },
149
+ enumerable: true,
150
+ configurable: true
151
+ });
152
+ Object.defineProperty(WTableFormat.prototype, "bidi", {
153
+ get: function () {
154
+ return this.getPropertyValue('bidi');
155
+ },
156
+ set: function (value) {
157
+ this.setPropertyValue('bidi', value);
158
+ },
159
+ enumerable: true,
160
+ configurable: true
161
+ });
162
+ Object.defineProperty(WTableFormat.prototype, "horizontalPositionAbs", {
163
+ get: function () {
164
+ return this.getPropertyValue('horizontalPositionAbs');
165
+ },
166
+ set: function (value) {
167
+ this.setPropertyValue('horizontalPositionAbs', value);
168
+ },
169
+ enumerable: true,
170
+ configurable: true
171
+ });
172
+ Object.defineProperty(WTableFormat.prototype, "horizontalPosition", {
173
+ get: function () {
174
+ return this.getPropertyValue('horizontalPosition');
175
+ },
176
+ set: function (value) {
177
+ this.setPropertyValue('horizontalPosition', value);
178
+ },
179
+ enumerable: true,
180
+ configurable: true
181
+ });
182
+ Object.defineProperty(WTableFormat.prototype, "styleName", {
183
+ get: function () {
184
+ return this._styleName;
185
+ },
186
+ set: function (value) {
187
+ this._styleName = value;
188
+ },
189
+ enumerable: true,
190
+ configurable: true
191
+ });
192
+ /* eslint-disable */
193
+ WTableFormat.prototype.getPropertyValue = function (property) {
194
+ var hasValue = this.hasValue(property);
195
+ if (hasValue) {
196
+ var propertyType = WUniqueFormat.getPropertyType(WTableFormat.uniqueFormatType, property);
197
+ if (!isNullOrUndefined(this.uniqueTableFormat) && this.uniqueTableFormat.propertiesHash.containsKey(propertyType)) {
198
+ return this.uniqueTableFormat.propertiesHash.get(propertyType);
199
+ }
200
+ }
201
+ return WTableFormat.getPropertyDefaultValue(property);
202
+ };
203
+ WTableFormat.prototype.setPropertyValue = function (property, value) {
204
+ if (isNullOrUndefined(value) || value === '') {
205
+ value = WTableFormat.getPropertyDefaultValue(property);
206
+ }
207
+ if (isNullOrUndefined(this.uniqueTableFormat)) {
208
+ this.initializeUniqueTableFormat(property, value);
209
+ }
210
+ else {
211
+ var propertyType = WUniqueFormat.getPropertyType(this.uniqueTableFormat.uniqueFormatType, property);
212
+ if (this.uniqueTableFormat.propertiesHash.containsKey(propertyType) &&
213
+ this.uniqueTableFormat.propertiesHash.get(propertyType) === value) {
214
+ //Do nothing, since no change in property value and return
215
+ return;
216
+ }
217
+ this.uniqueTableFormat = WTableFormat.uniqueTableFormats.updateUniqueFormat(this.uniqueTableFormat, property, value);
218
+ }
219
+ };
220
+ WTableFormat.prototype.initializeUniqueTableFormat = function (property, propValue) {
221
+ var uniqueTableFormatTemp = new Dictionary();
222
+ this.addUniqueTableFormat('allowAutoFit', property, propValue, uniqueTableFormatTemp);
223
+ this.addUniqueTableFormat('cellSpacing', property, propValue, uniqueTableFormatTemp);
224
+ this.addUniqueTableFormat('leftMargin', property, propValue, uniqueTableFormatTemp);
225
+ this.addUniqueTableFormat('topMargin', property, propValue, uniqueTableFormatTemp);
226
+ this.addUniqueTableFormat('bottomMargin', property, propValue, uniqueTableFormatTemp);
227
+ this.addUniqueTableFormat('rightMargin', property, propValue, uniqueTableFormatTemp);
228
+ this.addUniqueTableFormat('leftIndent', property, propValue, uniqueTableFormatTemp);
229
+ this.addUniqueTableFormat('tableAlignment', property, propValue, uniqueTableFormatTemp);
230
+ this.addUniqueTableFormat('preferredWidth', property, propValue, uniqueTableFormatTemp);
231
+ this.addUniqueTableFormat('preferredWidthType', property, propValue, uniqueTableFormatTemp);
232
+ this.addUniqueTableFormat('bidi', property, propValue, uniqueTableFormatTemp);
233
+ this.addUniqueTableFormat('horizontalPositionAbs', property, propValue, uniqueTableFormatTemp);
234
+ this.addUniqueTableFormat('horizontalPosition', property, propValue, uniqueTableFormatTemp);
235
+ this.uniqueTableFormat = WTableFormat.uniqueTableFormats.addUniqueFormat(uniqueTableFormatTemp, WTableFormat.uniqueFormatType);
236
+ };
237
+ WTableFormat.prototype.addUniqueTableFormat = function (property, modifiedProperty, propValue, uniqueTableFormatTemp) {
238
+ var propertyType;
239
+ propertyType = WUniqueFormat.getPropertyType(WTableFormat.uniqueFormatType, property);
240
+ if (property === modifiedProperty) {
241
+ uniqueTableFormatTemp.add(propertyType, propValue);
242
+ }
243
+ };
244
+ WTableFormat.getPropertyDefaultValue = function (property) {
245
+ var value = undefined;
246
+ switch (property) {
247
+ case 'allowAutoFit':
248
+ value = false;
249
+ break;
250
+ case 'cellSpacing':
251
+ value = 0;
252
+ break;
253
+ case 'leftMargin':
254
+ value = 5.4;
255
+ break;
256
+ case 'topMargin':
257
+ value = 0;
258
+ break;
259
+ case 'bottomMargin':
260
+ value = 0;
261
+ break;
262
+ case 'rightMargin':
263
+ value = 5.4;
264
+ break;
265
+ case 'leftIndent':
266
+ value = 0;
267
+ break;
268
+ case 'tableAlignment':
269
+ value = 'Left';
270
+ break;
271
+ case 'preferredWidth':
272
+ value = 0;
273
+ break;
274
+ case 'preferredWidthType':
275
+ value = 'Point';
276
+ break;
277
+ case 'bidi':
278
+ value = false;
279
+ break;
280
+ case 'horizontalPositionAbs':
281
+ value = null;
282
+ break;
283
+ case 'horizontalPosition':
284
+ value = 0;
285
+ break;
286
+ }
287
+ return value;
288
+ };
289
+ WTableFormat.prototype.assignTableMarginValue = function (left, top, right, bottom) {
290
+ this.leftMargin = left;
291
+ this.topMargin = top;
292
+ this.rightMargin = right;
293
+ this.bottomMargin = bottom;
294
+ };
295
+ WTableFormat.prototype.initializeTableBorders = function () {
296
+ this.borders.left.lineStyle = 'Single';
297
+ this.borders.left.lineWidth = 0.5;
298
+ this.borders.right.lineStyle = 'Single';
299
+ this.borders.right.lineWidth = 0.5;
300
+ this.borders.top.lineStyle = 'Single';
301
+ this.borders.top.lineWidth = 0.5;
302
+ this.borders.bottom.lineStyle = 'Single';
303
+ this.borders.bottom.lineWidth = 0.5;
304
+ this.borders.horizontal.lineStyle = 'Single';
305
+ this.borders.horizontal.lineWidth = 0.5;
306
+ this.borders.vertical.lineStyle = 'Single';
307
+ this.borders.vertical.lineWidth = 0.5;
308
+ };
309
+ WTableFormat.prototype.destroy = function () {
310
+ if (!isNullOrUndefined(this.borders)) {
311
+ this.borders.destroy();
312
+ }
313
+ if (!isNullOrUndefined(this.shading)) {
314
+ this.shading.destroy();
315
+ }
316
+ if (!isNullOrUndefined(this.uniqueTableFormat)) {
317
+ WTableFormat.uniqueTableFormats.remove(this.uniqueTableFormat);
318
+ }
319
+ this.uniqueTableFormat = undefined;
320
+ this.ownerBase = undefined;
321
+ this.borders = undefined;
322
+ this.shading = undefined;
323
+ };
324
+ WTableFormat.prototype.cloneFormat = function () {
325
+ var tableFormat = new WTableFormat(undefined);
326
+ tableFormat.leftIndent = this.leftIndent;
327
+ tableFormat.tableAlignment = this.tableAlignment;
328
+ tableFormat.cellSpacing = this.cellSpacing;
329
+ tableFormat.leftMargin = this.leftMargin;
330
+ tableFormat.rightMargin = this.rightMargin;
331
+ tableFormat.topMargin = this.topMargin;
332
+ tableFormat.bottomMargin = this.bottomMargin;
333
+ tableFormat.preferredWidth = this.preferredWidth;
334
+ tableFormat.preferredWidthType = this.preferredWidthType;
335
+ tableFormat.horizontalPositionAbs = this.horizontalPositionAbs;
336
+ tableFormat.horizontalPosition = this.horizontalPosition;
337
+ tableFormat.borders = isNullOrUndefined(this.borders) ? undefined : this.borders.cloneFormat();
338
+ tableFormat.shading = isNullOrUndefined(this.shading) ? undefined : this.shading.cloneFormat();
339
+ tableFormat.bidi = this.bidi;
340
+ tableFormat.allowAutoFit = this.allowAutoFit;
341
+ tableFormat.styleName = this.styleName;
342
+ tableFormat.title = this.title;
343
+ tableFormat.description = this.description;
344
+ return tableFormat;
345
+ };
346
+ WTableFormat.prototype.hasValue = function (property) {
347
+ if (!isNullOrUndefined(this.uniqueTableFormat)) {
348
+ var propertyType = WUniqueFormat.getPropertyType(this.uniqueTableFormat.uniqueFormatType, property);
349
+ return this.uniqueTableFormat.propertiesHash.containsKey(propertyType);
350
+ }
351
+ return false;
352
+ };
353
+ WTableFormat.prototype.copyFormat = function (format) {
354
+ if (!isNullOrUndefined(format)) {
355
+ if (!isNullOrUndefined(format.uniqueTableFormat)) {
356
+ this.cellSpacing = format.cellSpacing;
357
+ this.leftMargin = format.leftMargin;
358
+ this.topMargin = format.topMargin;
359
+ this.rightMargin = format.rightMargin;
360
+ this.bottomMargin = format.bottomMargin;
361
+ this.leftIndent = format.leftIndent;
362
+ this.tableAlignment = format.tableAlignment;
363
+ this.preferredWidth = format.preferredWidth;
364
+ this.preferredWidthType = format.preferredWidthType;
365
+ this.bidi = format.bidi;
366
+ this.allowAutoFit = format.allowAutoFit;
367
+ this.horizontalPosition = format.horizontalPosition;
368
+ this.horizontalPositionAbs = format.horizontalPositionAbs;
369
+ this.styleName = format.styleName;
370
+ }
371
+ if (!isNullOrUndefined(format.borders)) {
372
+ this.borders = new WBorders(this);
373
+ this.borders.copyFormat(format.borders);
374
+ }
375
+ if (!isNullOrUndefined(format.shading)) {
376
+ this.shading = new WShading(this);
377
+ this.shading.copyFormat(format.shading);
378
+ }
379
+ if (!isNullOrUndefined(format.title)) {
380
+ this.title = format.title;
381
+ }
382
+ if (!isNullOrUndefined(format.description)) {
383
+ this.description = format.description;
384
+ }
385
+ this.isRTFTable = format.isRTFTable;
386
+ }
387
+ };
388
+ WTableFormat.clear = function () {
389
+ this.uniqueTableFormats.clear();
390
+ };
391
+ WTableFormat.uniqueTableFormats = new WUniqueFormats();
392
+ WTableFormat.uniqueFormatType = 8;
393
+ return WTableFormat;
394
+ }());
395
+ export { WTableFormat };
package/src/global.js ADDED
@@ -0,0 +1 @@
1
+ export * from './index';