@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,14 @@
1
+ /**
2
+ * Formats Modules
3
+ */
4
+ export * from './section-format';
5
+ export * from './style';
6
+ export * from './character-format';
7
+ export * from './list-format';
8
+ export * from './paragraph-format';
9
+ export * from './table-format';
10
+ export * from './row-format';
11
+ export * from './cell-format';
12
+ export * from './border';
13
+ export * from './borders';
14
+ export * from './shading';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Formats Modules
3
+ */
4
+ export * from './section-format';
5
+ export * from './style';
6
+ export * from './character-format';
7
+ export * from './list-format';
8
+ export * from './paragraph-format';
9
+ export * from './table-format';
10
+ export * from './row-format';
11
+ export * from './cell-format';
12
+ export * from './border';
13
+ export * from './borders';
14
+ export * from './shading';
@@ -0,0 +1,32 @@
1
+ import { WStyle } from './style';
2
+ import { WList } from '../list/list';
3
+ import { WListLevel } from '../list/list-level';
4
+ /**
5
+ * @private
6
+ */
7
+ export declare class WListFormat {
8
+ private uniqueListFormat;
9
+ private static uniqueListFormats;
10
+ private static uniqueFormatType;
11
+ ownerBase: Object;
12
+ baseStyle: WStyle;
13
+ list: WList;
14
+ nsid: number;
15
+ listId: number;
16
+ listLevelNumber: number;
17
+ readonly listLevel: WListLevel;
18
+ constructor(node?: Object);
19
+ private getPropertyValue;
20
+ private setPropertyValue;
21
+ private initializeUniqueListFormat;
22
+ private addUniqueListFormat;
23
+ private static getPropertyDefaultValue;
24
+ copyFormat(format: WListFormat): void;
25
+ hasValue(property: string): boolean;
26
+ clearFormat(): void;
27
+ destroy(): void;
28
+ static clear(): void;
29
+ applyStyle(baseStyle: WStyle): void;
30
+ getValue(property: string): Object;
31
+ cloneListFormat(): WListFormat;
32
+ }
@@ -0,0 +1,238 @@
1
+ import { isNullOrUndefined } from '@syncfusion/ej2-base';
2
+ import { Dictionary } from '../base/dictionary';
3
+ import { WUniqueFormat } from '../base/unique-format';
4
+ import { WUniqueFormats } from '../base/unique-formats';
5
+ import { WParagraphStyle } from './style';
6
+ /* eslint-disable */
7
+ /**
8
+ * @private
9
+ */
10
+ var WListFormat = /** @class */ (function () {
11
+ function WListFormat(node) {
12
+ this.uniqueListFormat = undefined;
13
+ this.ownerBase = undefined;
14
+ this.baseStyle = undefined;
15
+ this.list = undefined;
16
+ this.ownerBase = node;
17
+ }
18
+ Object.defineProperty(WListFormat.prototype, "nsid", {
19
+ get: function () {
20
+ return this.getPropertyValue('nsid');
21
+ },
22
+ set: function (id) {
23
+ this.setPropertyValue('nsid', id);
24
+ },
25
+ enumerable: true,
26
+ configurable: true
27
+ });
28
+ Object.defineProperty(WListFormat.prototype, "listId", {
29
+ get: function () {
30
+ return this.getPropertyValue('listId');
31
+ },
32
+ set: function (listId) {
33
+ if (listId >= 0) {
34
+ if (!isNullOrUndefined(this.ownerBase)) {
35
+ var helper = this.ownerBase.getDocumentHelperObject();
36
+ if (!isNullOrUndefined(helper)) {
37
+ this.list = helper.getListById(listId);
38
+ }
39
+ }
40
+ }
41
+ else if (!isNullOrUndefined(this.list) && listId < 0) {
42
+ this.list = undefined;
43
+ }
44
+ this.setPropertyValue('listId', listId);
45
+ },
46
+ enumerable: true,
47
+ configurable: true
48
+ });
49
+ Object.defineProperty(WListFormat.prototype, "listLevelNumber", {
50
+ get: function () {
51
+ return this.getPropertyValue('listLevelNumber');
52
+ },
53
+ set: function (value) {
54
+ this.setPropertyValue('listLevelNumber', value);
55
+ },
56
+ enumerable: true,
57
+ configurable: true
58
+ });
59
+ Object.defineProperty(WListFormat.prototype, "listLevel", {
60
+ get: function () {
61
+ var list = undefined;
62
+ if (!isNullOrUndefined(this.list)) {
63
+ list = this.list;
64
+ }
65
+ else {
66
+ var baseListStyle = this.baseStyle;
67
+ while (!isNullOrUndefined(baseListStyle) && baseListStyle instanceof WParagraphStyle) {
68
+ if (baseListStyle.paragraphFormat.listFormat.list) {
69
+ list = baseListStyle.paragraphFormat.listFormat.list;
70
+ break;
71
+ }
72
+ else {
73
+ baseListStyle = baseListStyle.basedOn;
74
+ }
75
+ }
76
+ }
77
+ if (!isNullOrUndefined(list)) {
78
+ return list.getListLevel(this.listLevelNumber);
79
+ }
80
+ else {
81
+ return undefined;
82
+ }
83
+ },
84
+ enumerable: true,
85
+ configurable: true
86
+ });
87
+ WListFormat.prototype.getPropertyValue = function (property) {
88
+ if (!this.hasValue(property)) {
89
+ if (this.baseStyle instanceof WParagraphStyle) {
90
+ var baseStyle = this.baseStyle;
91
+ while (!isNullOrUndefined(baseStyle)) {
92
+ if (baseStyle.paragraphFormat.listFormat.hasValue(property)) {
93
+ break;
94
+ }
95
+ else {
96
+ baseStyle = baseStyle.basedOn;
97
+ }
98
+ }
99
+ if (!isNullOrUndefined(baseStyle)) {
100
+ var propertyType = WUniqueFormat.getPropertyType(WListFormat.uniqueFormatType, property);
101
+ return baseStyle.paragraphFormat.listFormat.uniqueListFormat.propertiesHash.get(propertyType);
102
+ }
103
+ }
104
+ }
105
+ else {
106
+ var propertyType = WUniqueFormat.getPropertyType(WListFormat.uniqueFormatType, property);
107
+ if (!isNullOrUndefined(this.uniqueListFormat) && this.uniqueListFormat.propertiesHash.containsKey(propertyType)) {
108
+ return this.uniqueListFormat.propertiesHash.get(propertyType);
109
+ }
110
+ }
111
+ return WListFormat.getPropertyDefaultValue(property);
112
+ };
113
+ WListFormat.prototype.setPropertyValue = function (property, value) {
114
+ if (isNullOrUndefined(value) || value === '') {
115
+ value = WListFormat.getPropertyDefaultValue(property);
116
+ }
117
+ if (isNullOrUndefined(this.uniqueListFormat)) {
118
+ this.initializeUniqueListFormat(property, value);
119
+ }
120
+ else {
121
+ var propertyType = WUniqueFormat.getPropertyType(this.uniqueListFormat.uniqueFormatType, property);
122
+ if (this.uniqueListFormat.propertiesHash.containsKey(propertyType) &&
123
+ this.uniqueListFormat.propertiesHash.get(propertyType) === value) {
124
+ //Do nothing, since no change in property value and return
125
+ return;
126
+ }
127
+ this.uniqueListFormat = WListFormat.uniqueListFormats.updateUniqueFormat(this.uniqueListFormat, property, value);
128
+ }
129
+ };
130
+ WListFormat.prototype.initializeUniqueListFormat = function (property, propValue) {
131
+ var uniqueListFormatTemp = new Dictionary();
132
+ this.addUniqueListFormat('listId', property, propValue, uniqueListFormatTemp);
133
+ this.addUniqueListFormat('listLevelNumber', property, propValue, uniqueListFormatTemp);
134
+ this.addUniqueListFormat('nsid', property, propValue, uniqueListFormatTemp);
135
+ this.uniqueListFormat = WListFormat.uniqueListFormats.addUniqueFormat(uniqueListFormatTemp, WListFormat.uniqueFormatType);
136
+ };
137
+ WListFormat.prototype.addUniqueListFormat = function (property, modifiedProperty, propValue, uniqueListFormatTemp) {
138
+ var propertyType = WUniqueFormat.getPropertyType(WListFormat.uniqueFormatType, property);
139
+ if (property === modifiedProperty) {
140
+ uniqueListFormatTemp.add(propertyType, propValue);
141
+ }
142
+ };
143
+ WListFormat.getPropertyDefaultValue = function (property) {
144
+ var value = undefined;
145
+ switch (property) {
146
+ case 'listId':
147
+ value = -1;
148
+ break;
149
+ case 'listLevelNumber':
150
+ value = 0;
151
+ break;
152
+ case 'nsid':
153
+ value = -1;
154
+ break;
155
+ }
156
+ return value;
157
+ };
158
+ WListFormat.prototype.copyFormat = function (format) {
159
+ if (!isNullOrUndefined(format)) {
160
+ if (!isNullOrUndefined(format.uniqueListFormat) || (!isNullOrUndefined(format.baseStyle) && !isNullOrUndefined(format.baseStyle.paragraphFormat.listFormat)
161
+ && !isNullOrUndefined(format.baseStyle.paragraphFormat.listFormat.uniqueListFormat) && isNullOrUndefined(format.list))) {
162
+ this.listId = format.listId;
163
+ this.listLevelNumber = format.listLevelNumber;
164
+ this.nsid = format.nsid;
165
+ }
166
+ if (!isNullOrUndefined(format.baseStyle)) {
167
+ this.baseStyle = format.baseStyle;
168
+ }
169
+ if (!isNullOrUndefined(format.list)) {
170
+ this.list = format.list;
171
+ }
172
+ }
173
+ };
174
+ WListFormat.prototype.hasValue = function (property) {
175
+ if (!isNullOrUndefined(this.uniqueListFormat)) {
176
+ var propertyType = WUniqueFormat.getPropertyType(this.uniqueListFormat.uniqueFormatType, property);
177
+ return this.uniqueListFormat.propertiesHash.containsKey(propertyType);
178
+ }
179
+ return false;
180
+ };
181
+ WListFormat.prototype.clearFormat = function () {
182
+ if (!isNullOrUndefined(this.uniqueListFormat) && this.uniqueListFormat.referenceCount === 0) {
183
+ WListFormat.uniqueListFormats.remove(this.uniqueListFormat);
184
+ }
185
+ this.uniqueListFormat = undefined;
186
+ this.list = undefined;
187
+ };
188
+ WListFormat.prototype.destroy = function () {
189
+ if (!isNullOrUndefined(this.uniqueListFormat)) {
190
+ WListFormat.uniqueListFormats.remove(this.uniqueListFormat);
191
+ }
192
+ this.uniqueListFormat = undefined;
193
+ this.list = undefined;
194
+ this.ownerBase = undefined;
195
+ this.baseStyle = undefined;
196
+ };
197
+ WListFormat.clear = function () {
198
+ this.uniqueListFormats.clear();
199
+ };
200
+ WListFormat.prototype.applyStyle = function (baseStyle) {
201
+ this.baseStyle = baseStyle;
202
+ };
203
+ WListFormat.prototype.getValue = function (property) {
204
+ return this.hasValue(property) ? this.getPropertyValue(property) : undefined;
205
+ };
206
+ //This method logic is not correct for changing the style dialog. Instead of this created assign format method and used it..
207
+ // public mergeFormat(format: WListFormat): void {
208
+ // if (isNullOrUndefined(this.getValue('listId'))) {
209
+ // this.listId = format.getValue('listId') as number;
210
+ // }
211
+ // if (isNullOrUndefined(this.getValue('listLevelNumber'))) {
212
+ // this.listLevelNumber = format.getValue('listLevelNumber') as number;
213
+ // }
214
+ // if (isNullOrUndefined(this.getValue('nsid'))) {
215
+ // this.nsid = format.getValue('nsid') as number;
216
+ // }
217
+ // if (!isNullOrUndefined(format.list)) {
218
+ // if (isNullOrUndefined(this.list)) {
219
+ // this.list = new WList();
220
+ // }
221
+ // this.list.mergeList(format.list);
222
+ // }
223
+ // }
224
+ WListFormat.prototype.cloneListFormat = function () {
225
+ var format = new WListFormat(undefined);
226
+ format.list = this.list;
227
+ format.listId = this.listId;
228
+ format.nsid = this.nsid;
229
+ format.baseStyle = this.baseStyle;
230
+ format.listLevelNumber = this.listLevelNumber;
231
+ format.uniqueListFormat = this.uniqueListFormat;
232
+ return format;
233
+ };
234
+ WListFormat.uniqueListFormats = new WUniqueFormats();
235
+ WListFormat.uniqueFormatType = 7;
236
+ return WListFormat;
237
+ }());
238
+ export { WListFormat };
@@ -0,0 +1,103 @@
1
+ import { WBorders } from './borders';
2
+ import { LineSpacingType, TextAlignment, OutlineLevel, TabJustification, TabLeader } from '../base/types';
3
+ import { WUniqueFormat } from '../base/unique-format';
4
+ import { WListFormat } from './list-format';
5
+ import { WStyle } from './style';
6
+ import { DocxRenderer } from '../docx-renderer';
7
+ import { ParagraphFormatInfo } from '../helper/layout-helper-methods';
8
+ /**
9
+ * @private
10
+ */
11
+ export declare class WTabStop {
12
+ private positionIn;
13
+ private deletePositionIn;
14
+ private justification;
15
+ private leader;
16
+ position: number;
17
+ deletePosition: number;
18
+ tabJustification: TabJustification;
19
+ tabLeader: TabLeader;
20
+ clone(): WTabStop;
21
+ equals(tab: WTabStop): boolean;
22
+ destroy(): void;
23
+ }
24
+ /**
25
+ * @private
26
+ */
27
+ export declare class WParagraphFormat {
28
+ uniqueParagraphFormat: WUniqueFormat;
29
+ private static uniqueParagraphFormats;
30
+ private static uniqueFormatType;
31
+ borders: WBorders;
32
+ listFormat: WListFormat;
33
+ ownerBase: Object;
34
+ baseStyle: WStyle;
35
+ tabs: WTabStop[];
36
+ getUpdatedTabs(): WTabStop[];
37
+ private getTabStopsFromListFormat;
38
+ private isValidTabStop;
39
+ private hasTabStop;
40
+ leftIndent: number;
41
+ rightIndent: number;
42
+ firstLineIndent: number;
43
+ beforeSpacing: number;
44
+ afterSpacing: number;
45
+ spaceBeforeAuto: boolean;
46
+ spaceAfterAuto: boolean;
47
+ lineSpacing: number;
48
+ lineSpacingType: LineSpacingType;
49
+ textAlignment: TextAlignment;
50
+ keepWithNext: boolean;
51
+ keepLinesTogether: boolean;
52
+ widowControl: boolean;
53
+ outlineLevel: OutlineLevel;
54
+ bidi: boolean;
55
+ contextualSpacing: boolean;
56
+ constructor(node?: Object);
57
+ private getListFormatParagraphFormat;
58
+ /**
59
+ * @private
60
+ */
61
+ getListPargaraphFormat(property: string): WParagraphFormat;
62
+ getPropertyValue(property: string): Object;
63
+ private getDefaultValue;
64
+ /**
65
+ * @private
66
+ */
67
+ getDocumentParagraphFormat(): ParagraphFormatInfo;
68
+ /**
69
+ * @private
70
+ */
71
+ getDocumentHelperObject(): DocxRenderer;
72
+ private setPropertyValue;
73
+ private initializeUniqueParagraphFormat;
74
+ private addUniqueParaFormat;
75
+ private static getPropertyDefaultValue;
76
+ clearIndent(): void;
77
+ clearPropertyValue(property: string): void;
78
+ clearFormat(): void;
79
+ destroy(): void;
80
+ copyFormat(format: WParagraphFormat): void;
81
+ updateUniqueParagraphFormat(format: WParagraphFormat): void;
82
+ cloneFormat(): WParagraphFormat;
83
+ /**
84
+ *
85
+ * @private
86
+ */
87
+ hasValue(property: string): boolean;
88
+ static clear(): void;
89
+ applyStyle(baseStyle: WStyle): void;
90
+ getValue(property: string): Object;
91
+ /**
92
+ * Assinging the value for style dialog
93
+ * @private
94
+ * @returns {void}
95
+ */
96
+ assignFormat(format: WParagraphFormat, isStyle?: boolean): void;
97
+ /**
98
+ * Returns true if both paragraph formats are equal
99
+ * @private
100
+ * @returns {boolean}
101
+ */
102
+ isSameFormat(format: WParagraphFormat): boolean;
103
+ }