@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,25 @@
|
|
|
1
|
+
import { WListLevel } from './list-level';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export declare class WAbstractList {
|
|
6
|
+
private abstractListIdIn;
|
|
7
|
+
nsid: number;
|
|
8
|
+
levels: WListLevel[];
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
* @returns {string} Uppercase hex NSID.
|
|
13
|
+
*/
|
|
14
|
+
static generateNsid(): string;
|
|
15
|
+
abstractListId: number;
|
|
16
|
+
clear(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Disposes the internal objects which are maintained.
|
|
19
|
+
*
|
|
20
|
+
* @private
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
destroy(): void;
|
|
24
|
+
clone(): WAbstractList;
|
|
25
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
var WAbstractList = /** @class */ (function () {
|
|
6
|
+
function WAbstractList() {
|
|
7
|
+
this.abstractListIdIn = -1;
|
|
8
|
+
this.nsid = -1;
|
|
9
|
+
this.levels = [];
|
|
10
|
+
this.nsid = parseInt(WAbstractList.generateNsid(), 16);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
* @returns {string} Uppercase hex NSID.
|
|
15
|
+
*/
|
|
16
|
+
WAbstractList.generateNsid = function () {
|
|
17
|
+
return (Math.floor(Math.random() * (4000000000 - 270000000)) + 270000000).toString(16).toUpperCase();
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(WAbstractList.prototype, "abstractListId", {
|
|
20
|
+
get: function () {
|
|
21
|
+
return this.abstractListIdIn;
|
|
22
|
+
},
|
|
23
|
+
set: function (abstractListId) {
|
|
24
|
+
this.abstractListIdIn = abstractListId;
|
|
25
|
+
},
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true
|
|
28
|
+
});
|
|
29
|
+
WAbstractList.prototype.clear = function () {
|
|
30
|
+
if (!isNullOrUndefined(this.levels)) {
|
|
31
|
+
for (var i = 0; i < this.levels.length; i++) {
|
|
32
|
+
var listLevel = this.levels[parseInt(i.toString(), 10)];
|
|
33
|
+
listLevel.clearFormat();
|
|
34
|
+
this.levels.splice(this.levels.indexOf(listLevel), 1);
|
|
35
|
+
i--;
|
|
36
|
+
}
|
|
37
|
+
this.levels = [];
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Disposes the internal objects which are maintained.
|
|
42
|
+
*
|
|
43
|
+
* @private
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
WAbstractList.prototype.destroy = function () {
|
|
47
|
+
if (!isNullOrUndefined(this.levels)) {
|
|
48
|
+
for (var i = 0; i < this.levels.length; i++) {
|
|
49
|
+
var listLevel = this.levels[parseInt(i.toString(), 10)];
|
|
50
|
+
listLevel.destroy();
|
|
51
|
+
this.levels.splice(this.levels.indexOf(listLevel), 1);
|
|
52
|
+
i--;
|
|
53
|
+
}
|
|
54
|
+
this.levels = [];
|
|
55
|
+
}
|
|
56
|
+
this.levels = undefined;
|
|
57
|
+
};
|
|
58
|
+
WAbstractList.prototype.clone = function () {
|
|
59
|
+
var absList = new WAbstractList();
|
|
60
|
+
for (var i = 0; i < this.levels.length; i++) {
|
|
61
|
+
absList.levels.push(this.levels[parseInt(i.toString(), 10)].clone(absList));
|
|
62
|
+
}
|
|
63
|
+
return absList;
|
|
64
|
+
};
|
|
65
|
+
return WAbstractList;
|
|
66
|
+
}());
|
|
67
|
+
export { WAbstractList };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WListLevel } from './list-level';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export declare class WLevelOverride {
|
|
6
|
+
startAt: number;
|
|
7
|
+
levelNumber: number;
|
|
8
|
+
overrideListLevel: WListLevel;
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
clear(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Disposes the internal objects which are maintained.
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
* @returns {void}
|
|
19
|
+
*/
|
|
20
|
+
destroy(): void;
|
|
21
|
+
clone(): WLevelOverride;
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
var WLevelOverride = /** @class */ (function () {
|
|
6
|
+
function WLevelOverride() {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
WLevelOverride.prototype.clear = function () {
|
|
13
|
+
if (!isNullOrUndefined(this.overrideListLevel)) {
|
|
14
|
+
this.overrideListLevel.clearFormat();
|
|
15
|
+
}
|
|
16
|
+
this.overrideListLevel = undefined;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Disposes the internal objects which are maintained.
|
|
20
|
+
*
|
|
21
|
+
* @private
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
WLevelOverride.prototype.destroy = function () {
|
|
25
|
+
if (!isNullOrUndefined(this.overrideListLevel)) {
|
|
26
|
+
this.overrideListLevel.destroy();
|
|
27
|
+
}
|
|
28
|
+
this.levelNumber = undefined;
|
|
29
|
+
this.startAt = undefined;
|
|
30
|
+
this.overrideListLevel = undefined;
|
|
31
|
+
};
|
|
32
|
+
WLevelOverride.prototype.clone = function () {
|
|
33
|
+
var levelOverride = new WLevelOverride();
|
|
34
|
+
levelOverride.startAt = this.startAt;
|
|
35
|
+
levelOverride.levelNumber = this.levelNumber;
|
|
36
|
+
if (!isNullOrUndefined(this.overrideListLevel)) {
|
|
37
|
+
levelOverride.overrideListLevel = this.overrideListLevel.clone(levelOverride);
|
|
38
|
+
}
|
|
39
|
+
return levelOverride;
|
|
40
|
+
};
|
|
41
|
+
return WLevelOverride;
|
|
42
|
+
}());
|
|
43
|
+
export { WLevelOverride };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Dictionary } from '../base/dictionary';
|
|
2
|
+
import { ListLevelPattern, FollowCharacterType, ListNumberAlignment } from '../base/types';
|
|
3
|
+
import { WCharacterFormat } from '../format/character-format';
|
|
4
|
+
import { WParagraphFormat } from '../format/paragraph-format';
|
|
5
|
+
import { WAbstractList } from './abstract-list';
|
|
6
|
+
import { WLevelOverride } from './level-override';
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export declare class WListLevel {
|
|
11
|
+
static dotBullet: string;
|
|
12
|
+
static squareBullet: string;
|
|
13
|
+
static arrowBullet: string;
|
|
14
|
+
static circleBullet: string;
|
|
15
|
+
private uniqueListLevel;
|
|
16
|
+
private static uniqueListLevels;
|
|
17
|
+
private static uniqueFormatType;
|
|
18
|
+
paragraphFormat: WParagraphFormat;
|
|
19
|
+
characterFormat: WCharacterFormat;
|
|
20
|
+
ownerBase: WAbstractList | WLevelOverride;
|
|
21
|
+
listLevelPattern: ListLevelPattern;
|
|
22
|
+
followCharacter: FollowCharacterType;
|
|
23
|
+
numberAlignment: ListNumberAlignment;
|
|
24
|
+
startAt: number;
|
|
25
|
+
numberFormat: string;
|
|
26
|
+
paraStyleName: string;
|
|
27
|
+
restartLevel: number;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the boolean that specifies that the format for the numbering at this level should be in the decimal format.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Sets the boolean that specifies that the format for the numbering at this level should be in the decimal format.
|
|
33
|
+
*
|
|
34
|
+
* @param {boolean} isLegalStyleNumbering - Specifies the value.
|
|
35
|
+
*/
|
|
36
|
+
isLegalStyleNumbering: boolean;
|
|
37
|
+
constructor(node: WAbstractList | WLevelOverride);
|
|
38
|
+
getPropertyValue(property: string): Object;
|
|
39
|
+
setPropertyValue(property: string, value: Object): void;
|
|
40
|
+
initializeUniqueWListLevel(property: string, propValue: object): void;
|
|
41
|
+
addUniqueWListLevel(property: string, modifiedProperty: string, propValue: object, uniqueCharFormatTemp: Dictionary<number, object>): void;
|
|
42
|
+
static getPropertyDefaultValue(property: string): Object;
|
|
43
|
+
/**
|
|
44
|
+
* Disposes the internal objects which are maintained.
|
|
45
|
+
*
|
|
46
|
+
* @private
|
|
47
|
+
* @returns {void}
|
|
48
|
+
*/
|
|
49
|
+
destroy(): void;
|
|
50
|
+
/**
|
|
51
|
+
* @private
|
|
52
|
+
* @returns {void}
|
|
53
|
+
*/
|
|
54
|
+
clearFormat(): void;
|
|
55
|
+
static clear(): void;
|
|
56
|
+
clone(node: WAbstractList | WLevelOverride): WListLevel;
|
|
57
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Dictionary } from '../base/dictionary';
|
|
2
|
+
import { WUniqueFormat } from '../base/unique-format';
|
|
3
|
+
import { WUniqueFormats } from '../base/unique-formats';
|
|
4
|
+
import { WCharacterFormat } from '../format/character-format';
|
|
5
|
+
import { WParagraphFormat } from '../format/paragraph-format';
|
|
6
|
+
import { WAbstractList } from './abstract-list';
|
|
7
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
var WListLevel = /** @class */ (function () {
|
|
12
|
+
function WListLevel(node) {
|
|
13
|
+
this.uniqueListLevel = undefined;
|
|
14
|
+
this.paragraphFormat = undefined;
|
|
15
|
+
this.characterFormat = undefined;
|
|
16
|
+
if (node instanceof WAbstractList) {
|
|
17
|
+
this.ownerBase = node;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.ownerBase = node;
|
|
21
|
+
}
|
|
22
|
+
this.characterFormat = new WCharacterFormat(undefined);
|
|
23
|
+
this.paragraphFormat = new WParagraphFormat(undefined);
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(WListLevel.prototype, "listLevelPattern", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return this.getPropertyValue('listLevelPattern');
|
|
28
|
+
},
|
|
29
|
+
set: function (listLevelPattern) {
|
|
30
|
+
this.setPropertyValue('listLevelPattern', listLevelPattern);
|
|
31
|
+
},
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(WListLevel.prototype, "followCharacter", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return this.getPropertyValue('followCharacter');
|
|
38
|
+
},
|
|
39
|
+
set: function (followCharacter) {
|
|
40
|
+
this.setPropertyValue('followCharacter', followCharacter);
|
|
41
|
+
},
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(WListLevel.prototype, "numberAlignment", {
|
|
46
|
+
get: function () {
|
|
47
|
+
return this.getPropertyValue('numberAlignment');
|
|
48
|
+
},
|
|
49
|
+
set: function (numberAlignment) {
|
|
50
|
+
this.setPropertyValue('numberAlignment', numberAlignment);
|
|
51
|
+
},
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(WListLevel.prototype, "startAt", {
|
|
56
|
+
get: function () {
|
|
57
|
+
return this.getPropertyValue('startAt');
|
|
58
|
+
},
|
|
59
|
+
set: function (startAt) {
|
|
60
|
+
this.setPropertyValue('startAt', startAt);
|
|
61
|
+
},
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(WListLevel.prototype, "numberFormat", {
|
|
66
|
+
get: function () {
|
|
67
|
+
return this.getPropertyValue('numberFormat');
|
|
68
|
+
},
|
|
69
|
+
set: function (numberFormat) {
|
|
70
|
+
this.setPropertyValue('numberFormat', numberFormat);
|
|
71
|
+
},
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(WListLevel.prototype, "paraStyleName", {
|
|
76
|
+
get: function () {
|
|
77
|
+
return this.getPropertyValue('paraStyleName');
|
|
78
|
+
},
|
|
79
|
+
set: function (paraStyleName) {
|
|
80
|
+
this.setPropertyValue('paraStyleName', paraStyleName);
|
|
81
|
+
},
|
|
82
|
+
enumerable: true,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(WListLevel.prototype, "restartLevel", {
|
|
86
|
+
get: function () {
|
|
87
|
+
return this.getPropertyValue('restartLevel');
|
|
88
|
+
},
|
|
89
|
+
set: function (restartLevel) {
|
|
90
|
+
this.setPropertyValue('restartLevel', restartLevel);
|
|
91
|
+
},
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(WListLevel.prototype, "isLegalStyleNumbering", {
|
|
96
|
+
// eslint-disable-next-line jsdoc/require-returns
|
|
97
|
+
/**
|
|
98
|
+
* Gets the boolean that specifies that the format for the numbering at this level should be in the decimal format.
|
|
99
|
+
*/
|
|
100
|
+
get: function () {
|
|
101
|
+
return this.getPropertyValue('isLegalStyleNumbering');
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Sets the boolean that specifies that the format for the numbering at this level should be in the decimal format.
|
|
105
|
+
*
|
|
106
|
+
* @param {boolean} isLegalStyleNumbering - Specifies the value.
|
|
107
|
+
*/
|
|
108
|
+
set: function (isLegalStyleNumbering) {
|
|
109
|
+
this.setPropertyValue('isLegalStyleNumbering', isLegalStyleNumbering);
|
|
110
|
+
},
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true
|
|
113
|
+
});
|
|
114
|
+
/* eslint-disable */
|
|
115
|
+
WListLevel.prototype.getPropertyValue = function (property) {
|
|
116
|
+
var propertyType = WUniqueFormat.getPropertyType(WListLevel.uniqueFormatType, property);
|
|
117
|
+
if (!isNullOrUndefined(this.uniqueListLevel) && this.uniqueListLevel.propertiesHash.containsKey(propertyType)) {
|
|
118
|
+
return this.uniqueListLevel.propertiesHash.get(propertyType);
|
|
119
|
+
}
|
|
120
|
+
return WListLevel.getPropertyDefaultValue(property);
|
|
121
|
+
};
|
|
122
|
+
WListLevel.prototype.setPropertyValue = function (property, value) {
|
|
123
|
+
if (isNullOrUndefined(value) || value === '') {
|
|
124
|
+
value = WListLevel.getPropertyDefaultValue(property);
|
|
125
|
+
}
|
|
126
|
+
if (isNullOrUndefined(this.uniqueListLevel)) {
|
|
127
|
+
this.initializeUniqueWListLevel(property, value);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
var propertyType = WUniqueFormat.getPropertyType(this.uniqueListLevel.uniqueFormatType, property);
|
|
131
|
+
if (this.uniqueListLevel.propertiesHash.containsKey(propertyType) &&
|
|
132
|
+
this.uniqueListLevel.propertiesHash.get(propertyType) === value) { //Do nothing, since no change in property value and return
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.uniqueListLevel = WListLevel.uniqueListLevels.updateUniqueFormat(this.uniqueListLevel, property, value);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
WListLevel.prototype.initializeUniqueWListLevel = function (property, propValue) {
|
|
139
|
+
var uniqueListLevelTemp = new Dictionary();
|
|
140
|
+
this.addUniqueWListLevel('listLevelPattern', property, propValue, uniqueListLevelTemp);
|
|
141
|
+
this.addUniqueWListLevel('startAt', property, propValue, uniqueListLevelTemp);
|
|
142
|
+
this.addUniqueWListLevel('followCharacter', property, propValue, uniqueListLevelTemp);
|
|
143
|
+
this.addUniqueWListLevel('numberFormat', property, propValue, uniqueListLevelTemp);
|
|
144
|
+
this.addUniqueWListLevel('paraStyleName', property, propValue, uniqueListLevelTemp);
|
|
145
|
+
this.addUniqueWListLevel('restartLevel', property, propValue, uniqueListLevelTemp);
|
|
146
|
+
this.addUniqueWListLevel('isLegalStyleNumbering', property, propValue, uniqueListLevelTemp);
|
|
147
|
+
this.addUniqueWListLevel('numberAlignment', property, propValue, uniqueListLevelTemp);
|
|
148
|
+
this.uniqueListLevel = WListLevel.uniqueListLevels.addUniqueFormat(uniqueListLevelTemp, WListLevel.uniqueFormatType);
|
|
149
|
+
};
|
|
150
|
+
WListLevel.prototype.addUniqueWListLevel = function (property, modifiedProperty, propValue, uniqueCharFormatTemp) {
|
|
151
|
+
var propertyType;
|
|
152
|
+
propertyType = WUniqueFormat.getPropertyType(WListLevel.uniqueFormatType, property);
|
|
153
|
+
if (property === modifiedProperty) {
|
|
154
|
+
uniqueCharFormatTemp.add(propertyType, propValue);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
uniqueCharFormatTemp.add(propertyType, WListLevel.getPropertyDefaultValue(property));
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
WListLevel.getPropertyDefaultValue = function (property) {
|
|
161
|
+
/* eslint-disable */
|
|
162
|
+
var value = undefined;
|
|
163
|
+
switch (property) {
|
|
164
|
+
case 'listLevelPattern':
|
|
165
|
+
value = 'Arabic';
|
|
166
|
+
break;
|
|
167
|
+
case 'startAt':
|
|
168
|
+
value = 0;
|
|
169
|
+
break;
|
|
170
|
+
case 'followCharacter':
|
|
171
|
+
value = 'Tab';
|
|
172
|
+
break;
|
|
173
|
+
case 'numberAlignment':
|
|
174
|
+
value = 'Left';
|
|
175
|
+
break;
|
|
176
|
+
case 'paraStyleName':
|
|
177
|
+
case 'numberFormat':
|
|
178
|
+
value = '';
|
|
179
|
+
break;
|
|
180
|
+
case 'restartLevel':
|
|
181
|
+
value = 0;
|
|
182
|
+
break;
|
|
183
|
+
case 'isLegalStyleNumbering':
|
|
184
|
+
value = false;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
return value;
|
|
188
|
+
/* eslint-enable */
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Disposes the internal objects which are maintained.
|
|
192
|
+
*
|
|
193
|
+
* @private
|
|
194
|
+
* @returns {void}
|
|
195
|
+
*/
|
|
196
|
+
WListLevel.prototype.destroy = function () {
|
|
197
|
+
if (!isNullOrUndefined(this.uniqueListLevel)) {
|
|
198
|
+
WListLevel.uniqueListLevels.remove(this.uniqueListLevel);
|
|
199
|
+
}
|
|
200
|
+
this.uniqueListLevel = undefined;
|
|
201
|
+
if (!isNullOrUndefined(this.characterFormat)) {
|
|
202
|
+
this.characterFormat.destroy();
|
|
203
|
+
this.characterFormat = undefined;
|
|
204
|
+
}
|
|
205
|
+
if (!isNullOrUndefined(this.paragraphFormat)) {
|
|
206
|
+
this.paragraphFormat.destroy();
|
|
207
|
+
this.paragraphFormat = undefined;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @private
|
|
212
|
+
* @returns {void}
|
|
213
|
+
*/
|
|
214
|
+
WListLevel.prototype.clearFormat = function () {
|
|
215
|
+
if (!isNullOrUndefined(this.uniqueListLevel)) {
|
|
216
|
+
WListLevel.uniqueListLevels.remove(this.uniqueListLevel);
|
|
217
|
+
}
|
|
218
|
+
this.uniqueListLevel = undefined;
|
|
219
|
+
if (this.characterFormat) {
|
|
220
|
+
this.characterFormat.clearFormat();
|
|
221
|
+
}
|
|
222
|
+
this.characterFormat = undefined;
|
|
223
|
+
if (this.paragraphFormat) {
|
|
224
|
+
this.paragraphFormat.clearFormat();
|
|
225
|
+
}
|
|
226
|
+
this.paragraphFormat = undefined;
|
|
227
|
+
};
|
|
228
|
+
WListLevel.clear = function () {
|
|
229
|
+
this.uniqueListLevels.clear();
|
|
230
|
+
};
|
|
231
|
+
WListLevel.prototype.clone = function (node) {
|
|
232
|
+
var listLevel = new WListLevel(node);
|
|
233
|
+
listLevel.paragraphFormat = this.paragraphFormat.cloneFormat();
|
|
234
|
+
listLevel.characterFormat = this.characterFormat.cloneFormat();
|
|
235
|
+
if (this.uniqueListLevel) {
|
|
236
|
+
listLevel.uniqueListLevel = this.uniqueListLevel;
|
|
237
|
+
listLevel.uniqueListLevel.referenceCount++;
|
|
238
|
+
}
|
|
239
|
+
return listLevel;
|
|
240
|
+
};
|
|
241
|
+
WListLevel.dotBullet = String.fromCharCode(61623);
|
|
242
|
+
WListLevel.squareBullet = String.fromCharCode(61607); //Symbol font \u25aa.
|
|
243
|
+
WListLevel.arrowBullet = String.fromCharCode(10148);
|
|
244
|
+
WListLevel.circleBullet = String.fromCharCode(61551) + String.fromCharCode(32);
|
|
245
|
+
WListLevel.uniqueListLevels = new WUniqueFormats();
|
|
246
|
+
WListLevel.uniqueFormatType = 9;
|
|
247
|
+
return WListLevel;
|
|
248
|
+
}());
|
|
249
|
+
export { WListLevel };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WLevelOverride } from './level-override';
|
|
2
|
+
import { WAbstractList } from './abstract-list';
|
|
3
|
+
import { WListLevel } from './list-level';
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
export declare class WList {
|
|
8
|
+
nsid: number;
|
|
9
|
+
listId: number;
|
|
10
|
+
sourceListId: number;
|
|
11
|
+
abstractListId: number;
|
|
12
|
+
abstractList: WAbstractList;
|
|
13
|
+
levelOverrides: WLevelOverride[];
|
|
14
|
+
getListLevel(levelNumber: number): WListLevel;
|
|
15
|
+
getLevelOverride(levelNumber: number): WLevelOverride;
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
* @returns {void}
|
|
19
|
+
*/
|
|
20
|
+
clear(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Disposes the internal objects which are maintained.
|
|
23
|
+
*
|
|
24
|
+
* @private
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
destroy(): void;
|
|
28
|
+
mergeList(list: WList): void;
|
|
29
|
+
clone(): WList;
|
|
30
|
+
}
|
package/src/list/list.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
import { WLevelOverride } from './level-override';
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
var WList = /** @class */ (function () {
|
|
7
|
+
function WList() {
|
|
8
|
+
this.nsid = -1;
|
|
9
|
+
this.listId = -1;
|
|
10
|
+
this.sourceListId = -1;
|
|
11
|
+
this.abstractListId = -1;
|
|
12
|
+
this.abstractList = undefined;
|
|
13
|
+
this.levelOverrides = [];
|
|
14
|
+
}
|
|
15
|
+
WList.prototype.getListLevel = function (levelNumber) {
|
|
16
|
+
var listLevel = undefined;
|
|
17
|
+
var levelOverride = this.getLevelOverride(levelNumber);
|
|
18
|
+
if (!isNullOrUndefined(levelOverride) && !isNullOrUndefined(levelOverride.overrideListLevel)) {
|
|
19
|
+
listLevel = levelOverride.overrideListLevel;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
listLevel = this.abstractList.levels[parseInt(levelNumber.toString(), 10)];
|
|
23
|
+
}
|
|
24
|
+
return listLevel;
|
|
25
|
+
};
|
|
26
|
+
WList.prototype.getLevelOverride = function (levelNumber) {
|
|
27
|
+
for (var i = 0; i < this.levelOverrides.length; i++) {
|
|
28
|
+
if (this.levelOverrides[parseInt(i.toString(), 10)] instanceof WLevelOverride) {
|
|
29
|
+
var levelOverride = this.levelOverrides[parseInt(i.toString(), 10)];
|
|
30
|
+
if (levelOverride.levelNumber === levelNumber) {
|
|
31
|
+
return levelOverride;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
WList.prototype.clear = function () {
|
|
42
|
+
if (!isNullOrUndefined(this.levelOverrides)) {
|
|
43
|
+
for (var i = 0; i < this.levelOverrides.length; i++) {
|
|
44
|
+
var levelOverride = this.levelOverrides[parseInt(i.toString(), 10)];
|
|
45
|
+
levelOverride.clear();
|
|
46
|
+
}
|
|
47
|
+
this.levelOverrides = [];
|
|
48
|
+
}
|
|
49
|
+
if (this.abstractList) {
|
|
50
|
+
this.abstractList.clear();
|
|
51
|
+
}
|
|
52
|
+
this.abstractList = undefined;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Disposes the internal objects which are maintained.
|
|
56
|
+
*
|
|
57
|
+
* @private
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
WList.prototype.destroy = function () {
|
|
61
|
+
if (!isNullOrUndefined(this.levelOverrides)) {
|
|
62
|
+
for (var i = 0; i < this.levelOverrides.length; i++) {
|
|
63
|
+
var levelOverride = this.levelOverrides[parseInt(i.toString(), 10)];
|
|
64
|
+
levelOverride.destroy();
|
|
65
|
+
}
|
|
66
|
+
this.levelOverrides = [];
|
|
67
|
+
}
|
|
68
|
+
this.levelOverrides = undefined;
|
|
69
|
+
if (this.abstractList) {
|
|
70
|
+
this.abstractList.destroy();
|
|
71
|
+
this.abstractList = undefined;
|
|
72
|
+
}
|
|
73
|
+
this.abstractListId = undefined;
|
|
74
|
+
this.listId = undefined;
|
|
75
|
+
this.sourceListId = undefined;
|
|
76
|
+
};
|
|
77
|
+
WList.prototype.mergeList = function (list) {
|
|
78
|
+
if (!isNullOrUndefined(this.abstractListId) && this.abstractListId !== -1) {
|
|
79
|
+
this.abstractListId = list.abstractListId;
|
|
80
|
+
}
|
|
81
|
+
if (!isNullOrUndefined(this.listId) && this.listId !== -1) {
|
|
82
|
+
this.listId = list.listId;
|
|
83
|
+
}
|
|
84
|
+
if (!isNullOrUndefined(this.sourceListId) && this.sourceListId !== -1) {
|
|
85
|
+
this.sourceListId = list.sourceListId;
|
|
86
|
+
}
|
|
87
|
+
if (!isNullOrUndefined(this.levelOverrides) && this.levelOverrides.length !== 0) {
|
|
88
|
+
this.levelOverrides = list.levelOverrides;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
WList.prototype.clone = function () {
|
|
92
|
+
var list = new WList();
|
|
93
|
+
for (var i = 0; i < this.levelOverrides.length; i++) {
|
|
94
|
+
list.levelOverrides.push(this.levelOverrides[parseInt(i.toString(), 10)].clone());
|
|
95
|
+
}
|
|
96
|
+
return list;
|
|
97
|
+
};
|
|
98
|
+
return WList;
|
|
99
|
+
}());
|
|
100
|
+
export { WList };
|