@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.
- package/README.md +2 -2
- package/base.d.ts +4 -0
- package/base.js +4 -0
- package/dist/ej2-docx-renderer.umd.min.js +2 -0
- package/dist/ej2-docx-renderer.umd.min.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es2015.js +52432 -0
- package/dist/es6/ej2-docx-renderer.es2015.js.map +1 -0
- package/dist/es6/ej2-docx-renderer.es5.js +54425 -0
- package/dist/es6/ej2-docx-renderer.es5.js.map +1 -0
- package/dist/global/ej2-docx-renderer.min.js +2 -0
- package/dist/global/ej2-docx-renderer.min.js.map +1 -0
- package/dist/global/index.d.ts +5 -0
- package/format.d.ts +4 -0
- package/format.js +4 -0
- package/helper.d.ts +4 -0
- package/helper.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/list.d.ts +4 -0
- package/list.js +4 -0
- package/package.json +26 -4
- package/parser.d.ts +4 -0
- package/parser.js +4 -0
- package/src/base/constants.d.ts +2 -0
- package/src/base/constants.js +2 -0
- package/src/base/dictionary.d.ts +52 -0
- package/src/base/dictionary.js +137 -0
- package/src/base/index.d.ts +9 -0
- package/src/base/index.js +9 -0
- package/src/base/keywords.d.ts +422 -0
- package/src/base/keywords.js +422 -0
- package/src/base/types.d.ts +2590 -0
- package/src/base/types.js +1056 -0
- package/src/base/unique-format.d.ts +87 -0
- package/src/base/unique-format.js +858 -0
- package/src/base/unique-formats.d.ts +32 -0
- package/src/base/unique-formats.js +87 -0
- package/src/document-canvas.d.ts +61 -0
- package/src/document-canvas.js +221 -0
- package/src/docx-renderer.d.ts +941 -0
- package/src/docx-renderer.js +2251 -0
- package/src/format/border.d.ts +53 -0
- package/src/format/border.js +600 -0
- package/src/format/borders.d.ts +44 -0
- package/src/format/borders.js +314 -0
- package/src/format/cell-format.d.ts +42 -0
- package/src/format/cell-format.js +309 -0
- package/src/format/character-format.d.ts +152 -0
- package/src/format/character-format.js +1224 -0
- package/src/format/index.d.ts +14 -0
- package/src/format/index.js +14 -0
- package/src/format/list-format.d.ts +32 -0
- package/src/format/list-format.js +238 -0
- package/src/format/paragraph-format.d.ts +103 -0
- package/src/format/paragraph-format.js +854 -0
- package/src/format/row-format.d.ts +119 -0
- package/src/format/row-format.js +545 -0
- package/src/format/section-format.d.ts +89 -0
- package/src/format/section-format.js +689 -0
- package/src/format/shading.d.ts +24 -0
- package/src/format/shading.js +137 -0
- package/src/format/style.d.ts +106 -0
- package/src/format/style.js +286 -0
- package/src/format/table-format.d.ts +51 -0
- package/src/format/table-format.js +395 -0
- package/src/global.js +1 -0
- package/src/helper/document-editor-helper.d.ts +515 -0
- package/src/helper/document-editor-helper.js +1302 -0
- package/src/helper/document-editor-settings.d.ts +293 -0
- package/src/helper/document-editor-settings.js +94 -0
- package/src/helper/index.d.ts +5 -0
- package/src/helper/index.js +5 -0
- package/src/helper/layout-helper-methods.d.ts +539 -0
- package/src/helper/layout-helper-methods.js +1065 -0
- package/src/helper/renderer-hooks.d.ts +74 -0
- package/src/helper/renderer-hooks.js +14 -0
- package/src/helper/revision-helper-methods.d.ts +199 -0
- package/src/helper/revision-helper-methods.js +362 -0
- package/src/index.d.ts +18 -0
- package/src/index.js +18 -0
- package/src/layout-helper.d.ts +190 -0
- package/src/layout-helper.js +1368 -0
- package/src/layout.d.ts +779 -0
- package/src/layout.js +17232 -0
- package/src/list/abstract-list.d.ts +25 -0
- package/src/list/abstract-list.js +67 -0
- package/src/list/index.d.ts +7 -0
- package/src/list/index.js +7 -0
- package/src/list/level-override.d.ts +22 -0
- package/src/list/level-override.js +43 -0
- package/src/list/list-level.d.ts +57 -0
- package/src/list/list-level.js +249 -0
- package/src/list/list.d.ts +30 -0
- package/src/list/list.js +100 -0
- package/src/page.d.ts +4155 -0
- package/src/page.js +11342 -0
- package/src/parser/index.d.ts +1 -0
- package/src/parser/index.js +1 -0
- package/src/parser/sfdt-reader.d.ts +254 -0
- package/src/parser/sfdt-reader.js +4569 -0
- package/src/render.d.ts +226 -0
- package/src/render.js +4222 -0
- package/src/text-helper.d.ts +144 -0
- package/src/text-helper.js +1079 -0
- package/src/text-helpers/index.d.ts +2 -0
- package/src/text-helpers/index.js +2 -0
- package/src/text-helpers/optimized.d.ts +45 -0
- package/src/text-helpers/optimized.js +121 -0
- package/src/text-helpers/regular.d.ts +37 -0
- package/src/text-helpers/regular.js +93 -0
- package/src/themes/font-scheme.d.ts +28 -0
- package/src/themes/font-scheme.js +107 -0
- package/src/themes/index.d.ts +6 -0
- package/src/themes/index.js +6 -0
- package/src/themes/major-minor-font-scheme.d.ts +14 -0
- package/src/themes/major-minor-font-scheme.js +45 -0
- package/src/themes/themes.d.ts +11 -0
- package/src/themes/themes.js +31 -0
- package/src/utility/index.d.ts +1 -0
- package/src/utility/index.js +1 -0
- package/src/utility/path-util.d.ts +133 -0
- package/src/utility/path-util.js +639 -0
- package/text-helpers.d.ts +4 -0
- package/text-helpers.js +4 -0
- package/themes.d.ts +4 -0
- package/themes.js +4 -0
- package/utility.d.ts +4 -0
- package/utility.js +4 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { HeightType, WidthType } from '../base/types';
|
|
2
|
+
import { WBorders } from './borders';
|
|
3
|
+
import { TableRowWidget } from '../page';
|
|
4
|
+
import { RevisionBase } from '../helper/revision-helper-methods';
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare class WRowFormat {
|
|
9
|
+
private uniqueRowFormat;
|
|
10
|
+
private static uniqueRowFormats;
|
|
11
|
+
private static uniqueFormatType;
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
borders: WBorders;
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
ownerBase: TableRowWidget;
|
|
20
|
+
/**
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
beforeWidth: number;
|
|
24
|
+
/**
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
afterWidth: number;
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
private revisions;
|
|
32
|
+
/**
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
removedIds: string[];
|
|
36
|
+
gridBefore: number;
|
|
37
|
+
gridBeforeWidth: number;
|
|
38
|
+
gridBeforeWidthType: WidthType;
|
|
39
|
+
gridAfter: number;
|
|
40
|
+
gridAfterWidth: number;
|
|
41
|
+
gridAfterWidthType: WidthType;
|
|
42
|
+
allowBreakAcrossPages: boolean;
|
|
43
|
+
isHeader: boolean;
|
|
44
|
+
rightMargin: number;
|
|
45
|
+
height: number;
|
|
46
|
+
heightType: HeightType;
|
|
47
|
+
bottomMargin: number;
|
|
48
|
+
leftIndent: number;
|
|
49
|
+
topMargin: number;
|
|
50
|
+
leftMargin: number;
|
|
51
|
+
/**
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
verticallyMergedCellsLeftMargin: number;
|
|
58
|
+
/**
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
verticallyMergedCellsRightMargin: number;
|
|
65
|
+
/**
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
verticallyMergedCellsTopMargin: number;
|
|
72
|
+
/**
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
verticallyMergedCellsBottomMargin: number;
|
|
79
|
+
constructor(node?: TableRowWidget);
|
|
80
|
+
getPropertyValue(property: string): Object;
|
|
81
|
+
private setPropertyValue;
|
|
82
|
+
private initializeUniqueRowFormat;
|
|
83
|
+
private addUniqueRowFormat;
|
|
84
|
+
private static getPropertyDefaultValue;
|
|
85
|
+
containsMargins(): boolean;
|
|
86
|
+
cloneFormat(): WRowFormat;
|
|
87
|
+
hasValue(property: string): boolean;
|
|
88
|
+
copyFormat(format: WRowFormat): void;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
static clear(): void;
|
|
91
|
+
/**
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
readonly revisionLength: number;
|
|
95
|
+
/**
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
getRevision(index: number): RevisionBase;
|
|
99
|
+
/**
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
addRevision(revision: RevisionBase): void;
|
|
103
|
+
/**
|
|
104
|
+
* @private
|
|
105
|
+
*/
|
|
106
|
+
insertRevisionAt(index: number, revision: RevisionBase): void;
|
|
107
|
+
/**
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
removeRevision(index: number): void;
|
|
111
|
+
/**
|
|
112
|
+
* @private
|
|
113
|
+
*/
|
|
114
|
+
getAllRevision(): RevisionBase[];
|
|
115
|
+
/**
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
getRevisionRange(revision: RevisionBase): WRowFormat[];
|
|
119
|
+
}
|
|
@@ -0,0 +1,545 @@
|
|
|
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 { WBorders } from './borders';
|
|
6
|
+
import { RevisionBase } from '../helper/revision-helper-methods';
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
var WRowFormat = /** @class */ (function () {
|
|
12
|
+
function WRowFormat(node) {
|
|
13
|
+
this.uniqueRowFormat = undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
this.borders = new WBorders(this);
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
this.ownerBase = undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
this.beforeWidth = 0;
|
|
26
|
+
/**
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
this.afterWidth = 0;
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
this.revisions = [];
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
this.removedIds = [];
|
|
38
|
+
this.ownerBase = node;
|
|
39
|
+
}
|
|
40
|
+
Object.defineProperty(WRowFormat.prototype, "gridBefore", {
|
|
41
|
+
get: function () {
|
|
42
|
+
return this.getPropertyValue('gridBefore');
|
|
43
|
+
},
|
|
44
|
+
set: function (value) {
|
|
45
|
+
this.setPropertyValue('gridBefore', value);
|
|
46
|
+
},
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(WRowFormat.prototype, "gridBeforeWidth", {
|
|
51
|
+
get: function () {
|
|
52
|
+
return this.getPropertyValue('gridBeforeWidth');
|
|
53
|
+
},
|
|
54
|
+
set: function (value) {
|
|
55
|
+
this.setPropertyValue('gridBeforeWidth', value);
|
|
56
|
+
},
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(WRowFormat.prototype, "gridBeforeWidthType", {
|
|
61
|
+
get: function () {
|
|
62
|
+
return this.getPropertyValue('gridBeforeWidthType');
|
|
63
|
+
},
|
|
64
|
+
set: function (value) {
|
|
65
|
+
this.setPropertyValue('gridBeforeWidthType', value);
|
|
66
|
+
},
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(WRowFormat.prototype, "gridAfter", {
|
|
71
|
+
get: function () {
|
|
72
|
+
return this.getPropertyValue('gridAfter');
|
|
73
|
+
},
|
|
74
|
+
set: function (value) {
|
|
75
|
+
this.setPropertyValue('gridAfter', value);
|
|
76
|
+
},
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(WRowFormat.prototype, "gridAfterWidth", {
|
|
81
|
+
get: function () {
|
|
82
|
+
return this.getPropertyValue('gridAfterWidth');
|
|
83
|
+
},
|
|
84
|
+
set: function (value) {
|
|
85
|
+
this.setPropertyValue('gridAfterWidth', value);
|
|
86
|
+
},
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(WRowFormat.prototype, "gridAfterWidthType", {
|
|
91
|
+
get: function () {
|
|
92
|
+
return this.getPropertyValue('gridAfterWidthType');
|
|
93
|
+
},
|
|
94
|
+
set: function (value) {
|
|
95
|
+
this.setPropertyValue('gridAfterWidthType', value);
|
|
96
|
+
},
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(WRowFormat.prototype, "allowBreakAcrossPages", {
|
|
101
|
+
get: function () {
|
|
102
|
+
return this.getPropertyValue('allowBreakAcrossPages');
|
|
103
|
+
},
|
|
104
|
+
set: function (value) {
|
|
105
|
+
this.setPropertyValue('allowBreakAcrossPages', value);
|
|
106
|
+
},
|
|
107
|
+
enumerable: true,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(WRowFormat.prototype, "isHeader", {
|
|
111
|
+
get: function () {
|
|
112
|
+
return this.getPropertyValue('isHeader');
|
|
113
|
+
},
|
|
114
|
+
set: function (value) {
|
|
115
|
+
this.setPropertyValue('isHeader', value);
|
|
116
|
+
},
|
|
117
|
+
enumerable: true,
|
|
118
|
+
configurable: true
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(WRowFormat.prototype, "rightMargin", {
|
|
121
|
+
get: function () {
|
|
122
|
+
return this.getPropertyValue('rightMargin');
|
|
123
|
+
},
|
|
124
|
+
set: function (value) {
|
|
125
|
+
this.setPropertyValue('rightMargin', value);
|
|
126
|
+
},
|
|
127
|
+
enumerable: true,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(WRowFormat.prototype, "height", {
|
|
131
|
+
get: function () {
|
|
132
|
+
return this.getPropertyValue('height');
|
|
133
|
+
},
|
|
134
|
+
set: function (value) {
|
|
135
|
+
if (value === 0 && (this.heightType === 'AtLeast' || this.heightType === 'Exactly')) {
|
|
136
|
+
value = 1;
|
|
137
|
+
}
|
|
138
|
+
else if (this.heightType === 'Auto') {
|
|
139
|
+
value = 0;
|
|
140
|
+
}
|
|
141
|
+
this.setPropertyValue('height', value);
|
|
142
|
+
},
|
|
143
|
+
enumerable: true,
|
|
144
|
+
configurable: true
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(WRowFormat.prototype, "heightType", {
|
|
147
|
+
get: function () {
|
|
148
|
+
return this.getPropertyValue('heightType');
|
|
149
|
+
},
|
|
150
|
+
set: function (value) {
|
|
151
|
+
if (value === 'AtLeast' || value === 'Exactly') {
|
|
152
|
+
this.height = 1;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.height = 0;
|
|
156
|
+
}
|
|
157
|
+
this.setPropertyValue('heightType', value);
|
|
158
|
+
},
|
|
159
|
+
enumerable: true,
|
|
160
|
+
configurable: true
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(WRowFormat.prototype, "bottomMargin", {
|
|
163
|
+
get: function () {
|
|
164
|
+
return this.getPropertyValue('bottomMargin');
|
|
165
|
+
},
|
|
166
|
+
set: function (value) {
|
|
167
|
+
this.setPropertyValue('bottomMargin', value);
|
|
168
|
+
},
|
|
169
|
+
enumerable: true,
|
|
170
|
+
configurable: true
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(WRowFormat.prototype, "leftIndent", {
|
|
173
|
+
get: function () {
|
|
174
|
+
return this.getPropertyValue('leftIndent');
|
|
175
|
+
},
|
|
176
|
+
set: function (value) {
|
|
177
|
+
this.setPropertyValue('leftIndent', value);
|
|
178
|
+
},
|
|
179
|
+
enumerable: true,
|
|
180
|
+
configurable: true
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(WRowFormat.prototype, "topMargin", {
|
|
183
|
+
get: function () {
|
|
184
|
+
return this.getPropertyValue('topMargin');
|
|
185
|
+
},
|
|
186
|
+
set: function (value) {
|
|
187
|
+
this.setPropertyValue('topMargin', value);
|
|
188
|
+
},
|
|
189
|
+
enumerable: true,
|
|
190
|
+
configurable: true
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(WRowFormat.prototype, "leftMargin", {
|
|
193
|
+
get: function () {
|
|
194
|
+
return this.getPropertyValue('leftMargin');
|
|
195
|
+
},
|
|
196
|
+
set: function (value) {
|
|
197
|
+
this.setPropertyValue('leftMargin', value);
|
|
198
|
+
},
|
|
199
|
+
enumerable: true,
|
|
200
|
+
configurable: true
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(WRowFormat.prototype, "verticallyMergedCellsLeftMargin", {
|
|
203
|
+
/**
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
206
|
+
get: function () {
|
|
207
|
+
return this.getPropertyValue('verticallyMergedCellsLeftMargin');
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* @private
|
|
211
|
+
*/
|
|
212
|
+
set: function (value) {
|
|
213
|
+
this.setPropertyValue('verticallyMergedCellsLeftMargin', value);
|
|
214
|
+
},
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(WRowFormat.prototype, "verticallyMergedCellsRightMargin", {
|
|
219
|
+
/**
|
|
220
|
+
* @private
|
|
221
|
+
*/
|
|
222
|
+
get: function () {
|
|
223
|
+
return this.getPropertyValue('verticallyMergedCellsRightMargin');
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
set: function (value) {
|
|
229
|
+
this.setPropertyValue('verticallyMergedCellsRightMargin', value);
|
|
230
|
+
},
|
|
231
|
+
enumerable: true,
|
|
232
|
+
configurable: true
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(WRowFormat.prototype, "verticallyMergedCellsTopMargin", {
|
|
235
|
+
/**
|
|
236
|
+
* @private
|
|
237
|
+
*/
|
|
238
|
+
get: function () {
|
|
239
|
+
return this.getPropertyValue('verticallyMergedCellsTopMargin');
|
|
240
|
+
},
|
|
241
|
+
/**
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
set: function (value) {
|
|
245
|
+
this.setPropertyValue('verticallyMergedCellsTopMargin', value);
|
|
246
|
+
},
|
|
247
|
+
enumerable: true,
|
|
248
|
+
configurable: true
|
|
249
|
+
});
|
|
250
|
+
Object.defineProperty(WRowFormat.prototype, "verticallyMergedCellsBottomMargin", {
|
|
251
|
+
/**
|
|
252
|
+
* @private
|
|
253
|
+
*/
|
|
254
|
+
get: function () {
|
|
255
|
+
return this.getPropertyValue('verticallyMergedCellsBottomMargin');
|
|
256
|
+
},
|
|
257
|
+
/**
|
|
258
|
+
* @private
|
|
259
|
+
*/
|
|
260
|
+
set: function (value) {
|
|
261
|
+
this.setPropertyValue('verticallyMergedCellsBottomMargin', value);
|
|
262
|
+
},
|
|
263
|
+
enumerable: true,
|
|
264
|
+
configurable: true
|
|
265
|
+
});
|
|
266
|
+
WRowFormat.prototype.getPropertyValue = function (property) {
|
|
267
|
+
var hasValue = this.hasValue(property);
|
|
268
|
+
if (hasValue) {
|
|
269
|
+
var propertyType = WUniqueFormat.getPropertyType(WRowFormat.uniqueFormatType, property);
|
|
270
|
+
if (!isNullOrUndefined(this.uniqueRowFormat) && this.uniqueRowFormat.propertiesHash.containsKey(propertyType)) {
|
|
271
|
+
return this.uniqueRowFormat.propertiesHash.get(propertyType);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return WRowFormat.getPropertyDefaultValue(property);
|
|
275
|
+
};
|
|
276
|
+
WRowFormat.prototype.setPropertyValue = function (property, value) {
|
|
277
|
+
if (isNullOrUndefined(value) || value === '') {
|
|
278
|
+
value = WRowFormat.getPropertyDefaultValue(property);
|
|
279
|
+
}
|
|
280
|
+
if (isNullOrUndefined(this.uniqueRowFormat)) {
|
|
281
|
+
this.initializeUniqueRowFormat(property, value);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
var propertyType = WUniqueFormat.getPropertyType(this.uniqueRowFormat.uniqueFormatType, property);
|
|
285
|
+
if (this.uniqueRowFormat.propertiesHash.containsKey(propertyType) &&
|
|
286
|
+
this.uniqueRowFormat.propertiesHash.get(propertyType) === value) {
|
|
287
|
+
//Do nothing, since no change in property value and return
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
this.uniqueRowFormat = WRowFormat.uniqueRowFormats.updateUniqueFormat(this.uniqueRowFormat, property, value);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
WRowFormat.prototype.initializeUniqueRowFormat = function (property, propValue) {
|
|
294
|
+
var uniqueRowFormatTemp = new Dictionary();
|
|
295
|
+
this.addUniqueRowFormat('allowBreakAcrossPages', property, propValue, uniqueRowFormatTemp);
|
|
296
|
+
this.addUniqueRowFormat('isHeader', property, propValue, uniqueRowFormatTemp);
|
|
297
|
+
this.addUniqueRowFormat('height', property, propValue, uniqueRowFormatTemp);
|
|
298
|
+
this.addUniqueRowFormat('heightType', property, propValue, uniqueRowFormatTemp);
|
|
299
|
+
this.addUniqueRowFormat('gridBefore', property, propValue, uniqueRowFormatTemp);
|
|
300
|
+
this.addUniqueRowFormat('gridBeforeWidth', property, propValue, uniqueRowFormatTemp);
|
|
301
|
+
this.addUniqueRowFormat('gridBeforeWidthType', property, propValue, uniqueRowFormatTemp);
|
|
302
|
+
this.addUniqueRowFormat('gridAfter', property, propValue, uniqueRowFormatTemp);
|
|
303
|
+
this.addUniqueRowFormat('gridAfterWidth', property, propValue, uniqueRowFormatTemp);
|
|
304
|
+
this.addUniqueRowFormat('gridgridAfterWidth', property, propValue, uniqueRowFormatTemp);
|
|
305
|
+
this.addUniqueRowFormat('gridBeforeWidthType', property, propValue, uniqueRowFormatTemp);
|
|
306
|
+
this.addUniqueRowFormat('leftMargin', property, propValue, uniqueRowFormatTemp);
|
|
307
|
+
this.addUniqueRowFormat('rightMargin', property, propValue, uniqueRowFormatTemp);
|
|
308
|
+
this.addUniqueRowFormat('topMargin', property, propValue, uniqueRowFormatTemp);
|
|
309
|
+
this.addUniqueRowFormat('bottomMargin', property, propValue, uniqueRowFormatTemp);
|
|
310
|
+
this.addUniqueRowFormat('leftIndent', property, propValue, uniqueRowFormatTemp);
|
|
311
|
+
this.addUniqueRowFormat('verticallyMergedCellsLeftMargin', property, propValue, uniqueRowFormatTemp);
|
|
312
|
+
this.addUniqueRowFormat('verticallyMergedCellsRightMargin', property, propValue, uniqueRowFormatTemp);
|
|
313
|
+
this.addUniqueRowFormat('verticallyMergedCellsTopMargin', property, propValue, uniqueRowFormatTemp);
|
|
314
|
+
this.addUniqueRowFormat('verticallyMergedCellsBottomMargin', property, propValue, uniqueRowFormatTemp);
|
|
315
|
+
this.uniqueRowFormat = WRowFormat.uniqueRowFormats.addUniqueFormat(uniqueRowFormatTemp, WRowFormat.uniqueFormatType);
|
|
316
|
+
};
|
|
317
|
+
WRowFormat.prototype.addUniqueRowFormat = function (property, modifiedProperty, propValue, uniqueRowFormatTemp) {
|
|
318
|
+
var propertyType = WUniqueFormat.getPropertyType(WRowFormat.uniqueFormatType, property);
|
|
319
|
+
if (property === modifiedProperty) {
|
|
320
|
+
uniqueRowFormatTemp.add(propertyType, propValue);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
WRowFormat.getPropertyDefaultValue = function (property) {
|
|
324
|
+
var value = undefined;
|
|
325
|
+
switch (property) {
|
|
326
|
+
case 'allowBreakAcrossPages':
|
|
327
|
+
value = true;
|
|
328
|
+
break;
|
|
329
|
+
case 'isHeader':
|
|
330
|
+
value = false;
|
|
331
|
+
break;
|
|
332
|
+
case 'height':
|
|
333
|
+
value = 0;
|
|
334
|
+
break;
|
|
335
|
+
case 'heightType':
|
|
336
|
+
value = 'Auto';
|
|
337
|
+
break;
|
|
338
|
+
case 'gridBefore':
|
|
339
|
+
value = 0;
|
|
340
|
+
break;
|
|
341
|
+
case 'gridBeforeWidth':
|
|
342
|
+
value = 0;
|
|
343
|
+
break;
|
|
344
|
+
case 'gridBeforeWidthType':
|
|
345
|
+
value = 'Point';
|
|
346
|
+
break;
|
|
347
|
+
case 'gridAfter':
|
|
348
|
+
value = 0;
|
|
349
|
+
break;
|
|
350
|
+
case 'gridAfterWidth':
|
|
351
|
+
value = 0;
|
|
352
|
+
break;
|
|
353
|
+
case 'gridAfterWidthType':
|
|
354
|
+
value = 'Point';
|
|
355
|
+
break;
|
|
356
|
+
case 'leftMargin':
|
|
357
|
+
value = undefined;
|
|
358
|
+
break;
|
|
359
|
+
case 'topMargin':
|
|
360
|
+
value = undefined;
|
|
361
|
+
break;
|
|
362
|
+
case 'bottomMargin':
|
|
363
|
+
value = undefined;
|
|
364
|
+
break;
|
|
365
|
+
case 'rightMargin':
|
|
366
|
+
value = undefined;
|
|
367
|
+
break;
|
|
368
|
+
case 'leftIndent':
|
|
369
|
+
value = 0;
|
|
370
|
+
break;
|
|
371
|
+
case 'verticallyMergedCellsLeftMargin':
|
|
372
|
+
value = undefined;
|
|
373
|
+
break;
|
|
374
|
+
case 'verticallyMergedCellsRightMargin':
|
|
375
|
+
value = undefined;
|
|
376
|
+
break;
|
|
377
|
+
case 'verticallyMergedCellsTopMargin':
|
|
378
|
+
value = undefined;
|
|
379
|
+
break;
|
|
380
|
+
case 'verticallyMergedCellsBottomMargin':
|
|
381
|
+
value = undefined;
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
return value;
|
|
385
|
+
};
|
|
386
|
+
WRowFormat.prototype.containsMargins = function () {
|
|
387
|
+
return (!isNullOrUndefined(this.leftMargin)
|
|
388
|
+
|| !isNullOrUndefined(this.rightMargin)
|
|
389
|
+
|| !isNullOrUndefined(this.bottomMargin)
|
|
390
|
+
|| !isNullOrUndefined(this.topMargin));
|
|
391
|
+
};
|
|
392
|
+
WRowFormat.prototype.cloneFormat = function () {
|
|
393
|
+
var format = new WRowFormat();
|
|
394
|
+
format.allowBreakAcrossPages = this.allowBreakAcrossPages;
|
|
395
|
+
format.heightType = this.heightType;
|
|
396
|
+
format.height = this.height;
|
|
397
|
+
format.isHeader = this.isHeader;
|
|
398
|
+
format.gridBefore = this.gridBefore;
|
|
399
|
+
format.gridBeforeWidth = this.gridBeforeWidth;
|
|
400
|
+
format.gridBeforeWidthType = this.gridBeforeWidthType;
|
|
401
|
+
format.gridAfter = this.gridAfter;
|
|
402
|
+
format.gridAfterWidth = this.gridAfterWidth;
|
|
403
|
+
format.gridAfterWidthType = this.gridAfterWidthType;
|
|
404
|
+
format.leftMargin = this.leftMargin;
|
|
405
|
+
format.rightMargin = this.rightMargin;
|
|
406
|
+
format.topMargin = this.topMargin;
|
|
407
|
+
format.bottomMargin = this.bottomMargin;
|
|
408
|
+
format.leftIndent = this.leftIndent;
|
|
409
|
+
format.verticallyMergedCellsLeftMargin = this.verticallyMergedCellsLeftMargin;
|
|
410
|
+
format.verticallyMergedCellsRightMargin = this.verticallyMergedCellsRightMargin;
|
|
411
|
+
format.verticallyMergedCellsTopMargin = this.verticallyMergedCellsTopMargin;
|
|
412
|
+
format.verticallyMergedCellsBottomMargin = this.verticallyMergedCellsBottomMargin;
|
|
413
|
+
if (this.revisions.length > 0) {
|
|
414
|
+
format.removedIds = RevisionBase.cloneRevisions(this.revisions);
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
format.removedIds = this.removedIds.slice();
|
|
418
|
+
}
|
|
419
|
+
return format;
|
|
420
|
+
};
|
|
421
|
+
WRowFormat.prototype.hasValue = function (property) {
|
|
422
|
+
if (!isNullOrUndefined(this.uniqueRowFormat)) {
|
|
423
|
+
var propertyType = WUniqueFormat.getPropertyType(this.uniqueRowFormat.uniqueFormatType, property);
|
|
424
|
+
return this.uniqueRowFormat.propertiesHash.containsKey(propertyType);
|
|
425
|
+
}
|
|
426
|
+
return false;
|
|
427
|
+
};
|
|
428
|
+
WRowFormat.prototype.copyFormat = function (format) {
|
|
429
|
+
if (!isNullOrUndefined(format)) {
|
|
430
|
+
if (!isNullOrUndefined(format.uniqueRowFormat)) {
|
|
431
|
+
this.allowBreakAcrossPages = format.allowBreakAcrossPages;
|
|
432
|
+
this.isHeader = format.isHeader;
|
|
433
|
+
this.heightType = format.heightType;
|
|
434
|
+
this.height = format.height;
|
|
435
|
+
this.gridBefore = format.gridBefore;
|
|
436
|
+
this.gridBeforeWidth = format.gridBeforeWidth;
|
|
437
|
+
this.gridBeforeWidthType = format.gridBeforeWidthType;
|
|
438
|
+
this.gridAfter = format.gridAfter;
|
|
439
|
+
this.gridAfterWidth = format.gridAfterWidth;
|
|
440
|
+
this.gridAfterWidthType = format.gridAfterWidthType;
|
|
441
|
+
this.leftMargin = format.leftMargin;
|
|
442
|
+
this.topMargin = format.topMargin;
|
|
443
|
+
this.rightMargin = format.rightMargin;
|
|
444
|
+
this.bottomMargin = format.bottomMargin;
|
|
445
|
+
this.leftIndent = format.leftIndent;
|
|
446
|
+
this.verticallyMergedCellsLeftMargin = format.verticallyMergedCellsLeftMargin;
|
|
447
|
+
this.verticallyMergedCellsRightMargin = format.verticallyMergedCellsRightMargin;
|
|
448
|
+
this.verticallyMergedCellsTopMargin = format.verticallyMergedCellsTopMargin;
|
|
449
|
+
this.verticallyMergedCellsBottomMargin = format.verticallyMergedCellsBottomMargin;
|
|
450
|
+
this.revisions = format.revisions;
|
|
451
|
+
}
|
|
452
|
+
if (!isNullOrUndefined(format.borders)) {
|
|
453
|
+
this.borders = new WBorders(this);
|
|
454
|
+
this.borders.ownerBase = format;
|
|
455
|
+
this.borders.copyFormat(format.borders);
|
|
456
|
+
}
|
|
457
|
+
if (format.revisions.length > 0) {
|
|
458
|
+
this.removedIds = RevisionBase.cloneRevisions(format.revisions);
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
this.removedIds = format.removedIds.slice();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
WRowFormat.prototype.destroy = function () {
|
|
466
|
+
if (!isNullOrUndefined(this.borders)) {
|
|
467
|
+
this.borders.destroy();
|
|
468
|
+
}
|
|
469
|
+
if (!isNullOrUndefined(this.uniqueRowFormat)) {
|
|
470
|
+
WRowFormat.uniqueRowFormats.remove(this.uniqueRowFormat);
|
|
471
|
+
}
|
|
472
|
+
this.beforeWidth = undefined;
|
|
473
|
+
this.afterWidth = undefined;
|
|
474
|
+
this.borders = undefined;
|
|
475
|
+
this.uniqueRowFormat = undefined;
|
|
476
|
+
};
|
|
477
|
+
WRowFormat.clear = function () {
|
|
478
|
+
this.uniqueRowFormats.clear();
|
|
479
|
+
};
|
|
480
|
+
Object.defineProperty(WRowFormat.prototype, "revisionLength", {
|
|
481
|
+
/**
|
|
482
|
+
* @private
|
|
483
|
+
*/
|
|
484
|
+
get: function () {
|
|
485
|
+
if (!isNullOrUndefined(this.revisions)) {
|
|
486
|
+
return this.revisions.length;
|
|
487
|
+
}
|
|
488
|
+
return 0;
|
|
489
|
+
},
|
|
490
|
+
enumerable: true,
|
|
491
|
+
configurable: true
|
|
492
|
+
});
|
|
493
|
+
/**
|
|
494
|
+
* @private
|
|
495
|
+
*/
|
|
496
|
+
WRowFormat.prototype.getRevision = function (index) {
|
|
497
|
+
if (!isNullOrUndefined(this.revisions)) {
|
|
498
|
+
return this.revisions[index];
|
|
499
|
+
}
|
|
500
|
+
return undefined;
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* @private
|
|
504
|
+
*/
|
|
505
|
+
WRowFormat.prototype.addRevision = function (revision) {
|
|
506
|
+
if (this.revisions.indexOf(revision) === -1) {
|
|
507
|
+
this.revisions.push(revision);
|
|
508
|
+
}
|
|
509
|
+
revision.hasChanges = true;
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* @private
|
|
513
|
+
*/
|
|
514
|
+
WRowFormat.prototype.insertRevisionAt = function (index, revision) {
|
|
515
|
+
this.revisions.splice(index, 0, revision);
|
|
516
|
+
revision.hasChanges = true;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* @private
|
|
520
|
+
*/
|
|
521
|
+
WRowFormat.prototype.removeRevision = function (index) {
|
|
522
|
+
var revision = this.revisions.splice(index, 1)[0];
|
|
523
|
+
revision.hasChanges = true;
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* @private
|
|
527
|
+
*/
|
|
528
|
+
WRowFormat.prototype.getAllRevision = function () {
|
|
529
|
+
return this.revisions;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* @private
|
|
533
|
+
*/
|
|
534
|
+
WRowFormat.prototype.getRevisionRange = function (revision) {
|
|
535
|
+
var range = [];
|
|
536
|
+
if (this.revisions.indexOf(revision) !== -1) {
|
|
537
|
+
range.push(this);
|
|
538
|
+
}
|
|
539
|
+
return range;
|
|
540
|
+
};
|
|
541
|
+
WRowFormat.uniqueRowFormats = new WUniqueFormats();
|
|
542
|
+
WRowFormat.uniqueFormatType = 6;
|
|
543
|
+
return WRowFormat;
|
|
544
|
+
}());
|
|
545
|
+
export { WRowFormat };
|