devexpress-richedit 25.1.1-alpha → 25.1.2-beta
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/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +714 -379
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/client-rich-edit.js +1 -1
- package/lib/client/commands/mail-merge-command.js +2 -1
- package/lib/client/formats/docx/export/data.d.ts +5 -1
- package/lib/client/formats/docx/export/data.js +3 -2
- package/lib/client/formats/docx/export/exporter.d.ts +2 -3
- package/lib/client/formats/docx/export/exporter.js +3 -3
- package/lib/client/formats/docx/export/exporters/base/sections.d.ts +0 -1
- package/lib/client/formats/docx/export/exporters/base/sections.js +2 -10
- package/lib/client/formats/docx/export/exporters/base/table/table.d.ts +1 -1
- package/lib/client/formats/docx/export/exporters/base/table/table.js +4 -4
- package/lib/client/formats/docx/import/destination/paragraph-properties/properties/paragraph-spacing-destination.js +6 -4
- package/lib/client/model-api/formats/exporter.js +2 -2
- package/lib/client/model-api/sub-document.js +1 -1
- package/lib/client/public/rich-edit.js +2 -2
- package/lib/common/canvas/canvas-manager.js +38 -24
- package/lib/common/canvas/canvas-scroll-info.d.ts +6 -3
- package/lib/common/canvas/canvas-scroll-info.js +9 -4
- package/lib/common/canvas/canvas-scroll-manager.d.ts +4 -1
- package/lib/common/canvas/canvas-scroll-manager.js +28 -20
- package/lib/common/canvas/canvas-size-info.d.ts +3 -2
- package/lib/common/canvas/canvas-size-info.js +4 -6
- package/lib/common/canvas/renderes/canvas-listener/print-layout-view-canvas-listener.js +2 -2
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +4 -1
- package/lib/common/canvas/renderes/common/document-renderer.js +15 -12
- package/lib/common/canvas/renderes/view-manager.d.ts +5 -1
- package/lib/common/canvas/renderes/view-manager.js +15 -7
- package/lib/common/formats/i-document-exporter.d.ts +3 -0
- package/lib/common/formats/rtf/export/exporter.d.ts +2 -3
- package/lib/common/formats/rtf/export/exporter.js +3 -3
- package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.d.ts +4 -2
- package/lib/common/formats/rtf/export/exporters/rtf-content-exporter.js +13 -9
- package/lib/common/formats/rtf/export/exporters/table/rtf-table-exporter.d.ts +3 -2
- package/lib/common/formats/rtf/export/exporters/table/rtf-table-exporter.js +4 -4
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-nested-table-exporter-state.d.ts +2 -1
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-nested-table-exporter-state.js +2 -2
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state-base.d.ts +4 -2
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state-base.js +16 -9
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state.d.ts +2 -1
- package/lib/common/formats/rtf/export/exporters/table/states/rtf-table-exporter-state.js +2 -2
- package/lib/common/formats/rtf/import/table/normalization/apply-use-values.d.ts +6 -0
- package/lib/common/formats/rtf/import/table/normalization/apply-use-values.js +90 -0
- package/lib/common/formats/rtf/import/table/table-converter.js +7 -2
- package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -2
- package/lib/common/formats/rtf/importer-in-subdocument.js +4 -3
- package/lib/common/input-controller.d.ts +5 -5
- package/lib/common/input-controller.js +16 -12
- package/lib/common/layout/document-layout.d.ts +5 -0
- package/lib/common/layout/document-layout.js +10 -0
- package/lib/common/layout/main-structures/layout-page-area.d.ts +3 -0
- package/lib/common/layout/main-structures/layout-page-area.js +6 -0
- package/lib/common/layout/main-structures/layout-page.d.ts +3 -0
- package/lib/common/layout/main-structures/layout-page.js +8 -0
- package/lib/common/layout/main-structures/layout-row.js +1 -2
- package/lib/common/layout-formatter/floating/position-calculators/horizontal.d.ts +1 -0
- package/lib/common/layout-formatter/floating/position-calculators/horizontal.js +16 -12
- package/lib/common/layout-formatter/row/size-engine/row-formatting-info.d.ts +4 -1
- package/lib/common/layout-formatter/row/size-engine/row-formatting-info.js +36 -2
- package/lib/common/layout-formatter/row/states.js +0 -2
- package/lib/common/layout-formatter/row/tab-info.js +5 -4
- package/lib/common/layout-formatter/table/info/table-info.d.ts +0 -1
- package/lib/common/layout-formatter/table/info/table-info.js +2 -18
- package/lib/common/layout-formatter/table/size-compressor.js +9 -2
- package/lib/common/layout-formatter/table/table-alignment-applier.js +0 -2
- package/lib/common/model/changes/change.d.ts +2 -1
- package/lib/common/model/changes/enums.d.ts +2 -1
- package/lib/common/model/changes/enums.js +1 -0
- package/lib/common/model/changes/model/zoom-level.d.ts +8 -0
- package/lib/common/model/changes/model/zoom-level.js +8 -0
- package/lib/common/model/creator/creator.js +6 -0
- package/lib/common/model/manipulators/model-manipulator.d.ts +2 -1
- package/lib/common/model/manipulators/model-manipulator.js +4 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +2 -1
- package/lib/common/model/paragraph/paragraph-style.js +2 -1
- package/lib/common/model/tables/secondary-structures/table-base-structures.d.ts +2 -1
- package/lib/common/model/tables/secondary-structures/table-base-structures.js +1 -0
- package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.d.ts +1 -1
- package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.js +22 -25
- package/lib/common/rich-edit-core.js +18 -18
- package/lib/common/ui/ruler/ruler.js +2 -0
- package/lib/common/utils/mixed-size.d.ts +27 -0
- package/lib/common/utils/mixed-size.js +91 -0
- package/lib/common/utils/size-utils.d.ts +14 -7
- package/lib/common/utils/size-utils.js +43 -18
- package/package.json +3 -3
@@ -17,7 +17,7 @@ export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
|
|
17
17
|
previousText: string;
|
18
18
|
canInsertTextOnInputEvent: boolean;
|
19
19
|
needProcessShortcut: boolean;
|
20
|
-
|
20
|
+
editableStateInitialized: boolean;
|
21
21
|
prevKeyCode: number;
|
22
22
|
IMEState: IMEState;
|
23
23
|
private inputWithAlt;
|
@@ -31,8 +31,8 @@ export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
|
|
31
31
|
constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
|
32
32
|
dispose(): void;
|
33
33
|
initialize(): void;
|
34
|
-
|
35
|
-
|
34
|
+
initializeEditableState(): void;
|
35
|
+
initializeEditableStateCore(): void;
|
36
36
|
initEvents(): void;
|
37
37
|
createHierarchy(parent: HTMLElement): void;
|
38
38
|
createHierarchyCore(): void;
|
@@ -78,7 +78,7 @@ export declare class DivInputEditor extends InputEditorBase<HTMLElement> {
|
|
78
78
|
private onTextInputTimerId;
|
79
79
|
constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
|
80
80
|
dispose(): void;
|
81
|
-
|
81
|
+
initializeEditableStateCore(): void;
|
82
82
|
setPosition(left: number, top: number): void;
|
83
83
|
createInputElement(): HTMLElement;
|
84
84
|
initEvents(): void;
|
@@ -114,7 +114,7 @@ export declare class IFrameInputEditor extends InputEditorBase<HTMLIFrameElement
|
|
114
114
|
constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
|
115
115
|
dispose(): void;
|
116
116
|
createHierarchyCore(): void;
|
117
|
-
|
117
|
+
initializeEditableStateCore(): void;
|
118
118
|
createInputElement(): HTMLIFrameElement;
|
119
119
|
initEvents(): void;
|
120
120
|
private isModifyEnabled;
|
@@ -51,17 +51,17 @@ export class InputEditorBase {
|
|
51
51
|
clearTimeout(this.onKeyUpTimerId);
|
52
52
|
}
|
53
53
|
initialize() {
|
54
|
-
this.
|
54
|
+
this.initializeEditableState();
|
55
55
|
this.initEvents();
|
56
56
|
this.prevKeyCode = EMPTY_KEYCODE;
|
57
57
|
}
|
58
|
-
|
59
|
-
if (
|
60
|
-
this.
|
61
|
-
this.
|
58
|
+
initializeEditableState() {
|
59
|
+
if (!this.editableStateInitialized) {
|
60
|
+
this.editableStateInitialized = true;
|
61
|
+
this.initializeEditableStateCore();
|
62
62
|
}
|
63
63
|
}
|
64
|
-
|
64
|
+
initializeEditableStateCore() {
|
65
65
|
}
|
66
66
|
initEvents() {
|
67
67
|
this.evtHandlersHolder.addListener(this.getEditableDocument(), "keydown", this.onKeyDown.bind(this));
|
@@ -281,8 +281,8 @@ export class DivInputEditor extends InputEditorBase {
|
|
281
281
|
clearTimeout(this.composEndTimerId);
|
282
282
|
clearTimeout(this.onTextInputTimerId);
|
283
283
|
}
|
284
|
-
|
285
|
-
this.inputElement.contentEditable =
|
284
|
+
initializeEditableStateCore() {
|
285
|
+
this.inputElement.contentEditable = String(!this.control.isReadOnlyPersistent);
|
286
286
|
this.clearInputElement();
|
287
287
|
}
|
288
288
|
setPosition(left, top) {
|
@@ -530,11 +530,11 @@ export class IFrameInputEditor extends InputEditorBase {
|
|
530
530
|
body.style.margin = "0px";
|
531
531
|
body.style.overflow = "hidden";
|
532
532
|
}
|
533
|
-
|
533
|
+
initializeEditableStateCore() {
|
534
534
|
if (Browser.WebKitFamily)
|
535
|
-
this.editableDocument.body.setAttribute("contenteditable",
|
535
|
+
this.editableDocument.body.setAttribute("contenteditable", String(!this.control.isReadOnlyPersistent));
|
536
536
|
else
|
537
|
-
this.editableDocument.designMode = "on";
|
537
|
+
this.editableDocument.designMode = this.control.isReadOnlyPersistent ? "off" : "on";
|
538
538
|
}
|
539
539
|
createInputElement() {
|
540
540
|
const element = document.createElement("IFRAME");
|
@@ -673,7 +673,7 @@ export class IFrameInputEditor extends InputEditorBase {
|
|
673
673
|
recreateIfNeeded() {
|
674
674
|
const iframeDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
|
675
675
|
if (!iframeDocument.body.hasAttribute("loaded")) {
|
676
|
-
this.
|
676
|
+
this.editableStateInitialized = false;
|
677
677
|
this.createHierarchyCore();
|
678
678
|
this.initialize();
|
679
679
|
}
|
@@ -708,6 +708,7 @@ export class IFrameInputEditor extends InputEditorBase {
|
|
708
708
|
}
|
709
709
|
startInputIME() {
|
710
710
|
this.inputElement.style.position = "absolute";
|
711
|
+
this.inputElement.style.zoom = this.control.viewManager.zoomLevel;
|
711
712
|
const lastSelectedIntervalStartPosition = this.control.selection.lastSelectedInterval.start;
|
712
713
|
const subDocument = this.control.selection.activeSubDocument;
|
713
714
|
const layoutPosition = subDocument.isMain() ?
|
@@ -721,6 +722,9 @@ export class IFrameInputEditor extends InputEditorBase {
|
|
721
722
|
const propChar = HtmlConverter.getSizeSignificantRules(this.control.inputPosition.getMergedCharacterPropertiesRaw()).join(";");
|
722
723
|
this.editableDocument.body.style.cssText = "padding: 0px; margin: 0px; overflow: hidden; color: transparent; " + propChar;
|
723
724
|
this.editableDocument.body.style.textIndent = currentTextIndent;
|
725
|
+
if (Browser.Firefox) {
|
726
|
+
this.editableDocument.body.style.zoom = this.control.viewManager.zoomLevel;
|
727
|
+
}
|
724
728
|
let layoutX = layoutPosition.getLayoutX(this.control.measurer, DocumentLayoutDetailsLevel.Row);
|
725
729
|
const layoutPoint = new LayoutPoint(layoutPosition.pageIndex, layoutX, layoutPosition.getLayoutY(DocumentLayoutDetailsLevel.Row));
|
726
730
|
const pageElement = this.control.viewManager.cache[layoutPoint.pageIndex].page;
|
@@ -2,6 +2,9 @@ import { DocumentModel } from '../model/document-model';
|
|
2
2
|
import { PositionManager } from '../model/position/position-manager';
|
3
3
|
import { LayoutAnchoredObjectBox } from './main-structures/layout-boxes/layout-anchored-object-box';
|
4
4
|
import { LayoutPage } from './main-structures/layout-page';
|
5
|
+
import { CanvasSizeInfo } from '../canvas/canvas-size-info';
|
6
|
+
import { Grid } from '../layout-formatter/table/grid-engine/grid';
|
7
|
+
import { Table } from '../model/tables/main-structures/table';
|
5
8
|
export declare class ModelPositionHolder {
|
6
9
|
private pos;
|
7
10
|
private posManager;
|
@@ -25,9 +28,11 @@ export declare class DocumentLayout {
|
|
25
28
|
isFullyFormatted: boolean;
|
26
29
|
anchorObjectsPositionInfo: AnchorObjectsPositionInfo;
|
27
30
|
pageColor: number;
|
31
|
+
get grids(): Map<Table, Grid>;
|
28
32
|
constructor(anchorObjectsPositionInfo: AnchorObjectsPositionInfo);
|
29
33
|
setEmptyLayout(pageColor: number): void;
|
30
34
|
getLastValidPage(): LayoutPage;
|
31
35
|
isPageValid(pageIndex: number): boolean;
|
32
36
|
getPageBySubDocumentId(subDocumentId: number): LayoutPage;
|
37
|
+
findPageIndexByOffsetY(offsetY: number, sizeInfo: CanvasSizeInfo): number;
|
33
38
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
|
2
2
|
import { ColorHelper } from '../model/color/color';
|
3
|
+
import { SearchUtils } from '@devexpress/utils/lib/utils/search';
|
3
4
|
export class ModelPositionHolder {
|
4
5
|
constructor(pos, posManager) {
|
5
6
|
this.pos = posManager.registerPosition(pos);
|
@@ -37,6 +38,12 @@ export class AnchorObjectsPositionInfo {
|
|
37
38
|
}
|
38
39
|
}
|
39
40
|
export class DocumentLayout {
|
41
|
+
get grids() {
|
42
|
+
return this.pages.reduce((res, page) => {
|
43
|
+
page.grids.forEach((grid, table) => res.set(table, grid));
|
44
|
+
return res;
|
45
|
+
}, new Map());
|
46
|
+
}
|
40
47
|
constructor(anchorObjectsPositionInfo) {
|
41
48
|
this.anchorObjectsPositionInfo = anchorObjectsPositionInfo;
|
42
49
|
this.setEmptyLayout(ColorHelper.NO_COLOR);
|
@@ -58,4 +65,7 @@ export class DocumentLayout {
|
|
58
65
|
getPageBySubDocumentId(subDocumentId) {
|
59
66
|
return this.pages.find((page) => !!page.mainSubDocumentPageAreas[subDocumentId] || !!page.otherPageAreas[subDocumentId]);
|
60
67
|
}
|
68
|
+
findPageIndexByOffsetY(offsetY, sizeInfo) {
|
69
|
+
return Math.max(0, SearchUtils.normedInterpolationIndexOf(this.pages, (p) => sizeInfo.getPageOffsetY(p), offsetY));
|
70
|
+
}
|
61
71
|
}
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
|
2
2
|
import { SubDocument } from '../../model/sub-document';
|
3
3
|
import { LayoutColumn } from './layout-column';
|
4
|
+
import { Grid } from '../../layout-formatter/table/grid-engine/grid';
|
5
|
+
import { Table } from '../../model/tables/main-structures/table';
|
4
6
|
export declare class LayoutPageArea extends Rectangle {
|
5
7
|
subDocument: SubDocument;
|
6
8
|
columns: LayoutColumn[];
|
7
9
|
pageOffset: number;
|
10
|
+
get grids(): Map<Table, Grid>;
|
8
11
|
constructor(subDocument: SubDocument);
|
9
12
|
getEndPosition(): number;
|
10
13
|
getLastColumn(): LayoutColumn;
|
@@ -1,6 +1,12 @@
|
|
1
1
|
import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
|
2
2
|
import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
3
3
|
export class LayoutPageArea extends Rectangle {
|
4
|
+
get grids() {
|
5
|
+
return this.columns.reduce((res, column) => {
|
6
|
+
column.tablesInfo.forEach(tableInfo => res.set(tableInfo.logicInfo.grid.table, tableInfo.logicInfo.grid));
|
7
|
+
return res;
|
8
|
+
}, new Map());
|
9
|
+
}
|
4
10
|
constructor(subDocument) {
|
5
11
|
super(0, 0, 0, 0);
|
6
12
|
this.columns = [];
|
@@ -8,6 +8,8 @@ import { AnchorObjectsPositionInfo } from '../document-layout';
|
|
8
8
|
import { LayoutAnchoredObjectBox } from './layout-boxes/layout-anchored-object-box';
|
9
9
|
import { LayoutPageArea } from './layout-page-area';
|
10
10
|
import { TableAnchoredObjectsHolder } from '../../layout-formatter/table/utils/table-anchored-objects-holder';
|
11
|
+
import { Grid } from '../../layout-formatter/table/grid-engine/grid';
|
12
|
+
import { Table } from '../../model/tables/main-structures/table';
|
11
13
|
export declare enum LayoutPageFlags {
|
12
14
|
MustBeRendered = 1,
|
13
15
|
ContentRendered = 2,
|
@@ -42,6 +44,7 @@ export declare class LayoutPage extends Rectangle {
|
|
42
44
|
tableAnchoredObjectsHolder: TableAnchoredObjectsHolder;
|
43
45
|
renderLevelCalculator: RenderLevelCalculator;
|
44
46
|
private contentIntervals;
|
47
|
+
get grids(): Map<Table, Grid>;
|
45
48
|
constructor();
|
46
49
|
setRenderLevelCalculator(anchorObjectsPositionInfo: AnchorObjectsPositionInfo, compatibilityMode: CompatibilityMode): void;
|
47
50
|
setAbsolutePosition(pos: number): void;
|
@@ -38,6 +38,14 @@ export class LayoutOtherPageAreasInfo {
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
export class LayoutPage extends Rectangle {
|
41
|
+
get grids() {
|
42
|
+
const result = new Map();
|
43
|
+
for (let pageArea of this.mainSubDocumentPageAreas)
|
44
|
+
pageArea.grids.forEach((grid, table) => result.set(table, grid));
|
45
|
+
for (let pageArea of Object.values(this.otherPageAreas))
|
46
|
+
pageArea.grids.forEach((grid, table) => result.set(table, grid));
|
47
|
+
return result;
|
48
|
+
}
|
41
49
|
constructor() {
|
42
50
|
super(0, 0, 0, 0);
|
43
51
|
this.mainSubDocumentPageAreas = [];
|
@@ -2,7 +2,6 @@ import { Flag } from '@devexpress/utils/lib/class/flag';
|
|
2
2
|
import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
|
3
3
|
import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
|
4
4
|
import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
5
|
-
import { LayoutBoxType } from './layout-boxes/layout-box';
|
6
5
|
export var LayoutRowStateFlags;
|
7
6
|
(function (LayoutRowStateFlags) {
|
8
7
|
LayoutRowStateFlags[LayoutRowStateFlags["NormallyEnd"] = 0] = "NormallyEnd";
|
@@ -129,7 +128,7 @@ export class LayoutRow extends Rectangle {
|
|
129
128
|
return lastBoxIndexWhatCanStrikeoutAndUnderline;
|
130
129
|
}
|
131
130
|
containsSpacesOnly() {
|
132
|
-
return this.boxes.length > 0 && ListUtils.allOf(this.boxes, val => val.isWhitespace()
|
131
|
+
return this.boxes.length > 0 && ListUtils.allOf(this.boxes, val => val.isWhitespace());
|
133
132
|
}
|
134
133
|
}
|
135
134
|
export class LayoutRowWithIndex extends LayoutRow {
|
@@ -41,7 +41,7 @@ export class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositi
|
|
41
41
|
alignment(type, alignment) {
|
42
42
|
switch (type) {
|
43
43
|
case AnchorObjectHorizontalPositionType.Character:
|
44
|
-
return this.getAlignPosition(alignment, 0);
|
44
|
+
return this.getAnchorXPosition() + this.getAlignPosition(alignment, 0);
|
45
45
|
case AnchorObjectHorizontalPositionType.Column:
|
46
46
|
return this.isRelativeCell ?
|
47
47
|
this.relativeColumnPos() + this.lp.row.tableCellInfo.x +
|
@@ -90,17 +90,8 @@ export class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositi
|
|
90
90
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x : 0;
|
91
91
|
case AnchorObjectHorizontalPositionType.Column:
|
92
92
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin : this.relativeColumnPos();
|
93
|
-
case AnchorObjectHorizontalPositionType.Character:
|
94
|
-
|
95
|
-
const ancBoxAbsPos = this.obj.rowOffset;
|
96
|
-
const boxIndex = SearchUtils.normedInterpolationIndexOf(this.lp.row.boxes, (box) => rowAbsPos + box.rowOffset, ancBoxAbsPos);
|
97
|
-
const box = this.lp.row.boxes[boxIndex];
|
98
|
-
if (!box)
|
99
|
-
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row);
|
100
|
-
const symbolCount = Math.max(0, ancBoxAbsPos - rowAbsPos - box.rowOffset);
|
101
|
-
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row) + box.x +
|
102
|
-
box.getCharOffsetXInPixels(this.manager.measurer, symbolCount);
|
103
|
-
}
|
93
|
+
case AnchorObjectHorizontalPositionType.Character:
|
94
|
+
return this.getAnchorXPosition();
|
104
95
|
case AnchorObjectHorizontalPositionType.Margin:
|
105
96
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin :
|
106
97
|
this.manager.boundsCalculator.marginLeft;
|
@@ -117,6 +108,19 @@ export class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositi
|
|
117
108
|
throw new Error(Errors.InternalException);
|
118
109
|
}
|
119
110
|
}
|
111
|
+
getAnchorXPosition() {
|
112
|
+
const rowAbsPos = this.lp.getLogPosition(DocumentLayoutDetailsLevel.Row);
|
113
|
+
const ancBoxAbsPos = this.obj.rowOffset;
|
114
|
+
let boxIndex = SearchUtils.normedInterpolationIndexOf(this.lp.row.boxes, (box) => rowAbsPos + box.rowOffset, ancBoxAbsPos);
|
115
|
+
if (boxIndex < 0)
|
116
|
+
boxIndex = 0;
|
117
|
+
const box = this.lp.row.boxes[boxIndex];
|
118
|
+
if (!box)
|
119
|
+
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row);
|
120
|
+
const symbolCount = Math.max(0, ancBoxAbsPos - rowAbsPos - box.rowOffset);
|
121
|
+
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row) + box.x +
|
122
|
+
box.getCharOffsetXInPixels(this.manager.measurer, symbolCount);
|
123
|
+
}
|
120
124
|
bookLayout() {
|
121
125
|
return this.alignment(this.anchorInfo.horizontalPositionType, AnchorObjectHorizontalPositionCalculator.mapBookLayoutALignmentType[this.anchorInfo.horizontalPositionAlignment]);
|
122
126
|
}
|
@@ -25,7 +25,10 @@ export declare class RowFormattingInfo {
|
|
25
25
|
get currInterval(): RowIntervalInfo;
|
26
26
|
indexOfFreeInterval(width: number): number;
|
27
27
|
indexOfIntervalContainsPositon(pos: number): number;
|
28
|
-
calculate(): void;
|
28
|
+
calculate(outerHorizontalRowContentBounds?: FixedInterval): void;
|
29
|
+
private calculateFreeIntervals;
|
30
|
+
recalculate(outerHorizontalRowContentBounds?: FixedInterval): void;
|
31
|
+
private findIntervalIndexByPosition;
|
29
32
|
canIncrementHeightTo(newHeight: number): boolean;
|
30
33
|
findNextYPos(): void;
|
31
34
|
findNextYPosWhatHasNeededSpace(requiredWidth: number): void;
|
@@ -45,10 +45,10 @@ export class RowFormattingInfo {
|
|
45
45
|
const ind = ListUtils.indexBy(this.intervals, (curr) => curr.start > pos || pos < curr.end, this.currIndex + 1);
|
46
46
|
return ind < 0 ? this.intervals.length - 1 : ind;
|
47
47
|
}
|
48
|
-
calculate() {
|
48
|
+
calculate(outerHorizontalRowContentBounds) {
|
49
49
|
this.setIntersectObjects();
|
50
50
|
this.busyIntervals = IntervalAlgorithms.getMergedIntervals(ListUtils.map(this.intersectsObjects, (objBnds) => new FixedInterval(objBnds.x, objBnds.width)), true);
|
51
|
-
const freeIntervals =
|
51
|
+
const freeIntervals = this.calculateFreeIntervals(this.busyIntervals, outerHorizontalRowContentBounds !== null && outerHorizontalRowContentBounds !== void 0 ? outerHorizontalRowContentBounds : this.outerHorizontalRowContentBounds);
|
52
52
|
if (freeIntervals.length) {
|
53
53
|
this.intervals = ListUtils.map(freeIntervals, (curr) => new RowIntervalInfo(curr.start, curr.length));
|
54
54
|
return;
|
@@ -56,6 +56,40 @@ export class RowFormattingInfo {
|
|
56
56
|
this.resetMinY(ListUtils.min);
|
57
57
|
Log.print(LogSource.RowFormatter, "RowFormattingInfo.calculate ", `minY:${this.minY}, height:${this.height}, currIndex: ${this.currIndex} intervals:\n${Log.join("\n", ListUtils.map(this.intervals, (curr) => LogObjToStr.fixedInterval(curr)))}`);
|
58
58
|
}
|
59
|
+
calculateFreeIntervals(busyIntervals, outerHorizontalRowContentBounds) {
|
60
|
+
const intervals = ListUtils.reducedMap(busyIntervals, val => IntervalAlgorithms.getIntersectionNonNullLength(val, outerHorizontalRowContentBounds));
|
61
|
+
if (!intervals.length)
|
62
|
+
return [outerHorizontalRowContentBounds.clone()];
|
63
|
+
const lastIntervalEnd = ListUtils.last(intervals).end;
|
64
|
+
const result = ListUtils.reducedMap(intervals, (curr, i) => FixedInterval.fromPositions(busyIntervals[i - 1].end, curr.start), 1);
|
65
|
+
if (outerHorizontalRowContentBounds.start < busyIntervals[0].start)
|
66
|
+
result.unshift(FixedInterval.fromPositions(outerHorizontalRowContentBounds.start, busyIntervals[0].start));
|
67
|
+
if (outerHorizontalRowContentBounds.end > lastIntervalEnd)
|
68
|
+
result.push(FixedInterval.fromPositions(lastIntervalEnd, outerHorizontalRowContentBounds.end));
|
69
|
+
return result;
|
70
|
+
}
|
71
|
+
recalculate(outerHorizontalRowContentBounds) {
|
72
|
+
const currInterval = this.currInterval;
|
73
|
+
this.calculate(outerHorizontalRowContentBounds);
|
74
|
+
const pos = currInterval.start + currInterval.busyWidth;
|
75
|
+
const index = this.findIntervalIndexByPosition(pos);
|
76
|
+
const interval = this.intervals[index];
|
77
|
+
if (interval && interval.start < pos) {
|
78
|
+
const avaliableWidth = interval.length - (pos - interval.start);
|
79
|
+
interval.avaliableWidth = avaliableWidth;
|
80
|
+
}
|
81
|
+
this.currIndex = index;
|
82
|
+
}
|
83
|
+
findIntervalIndexByPosition(position) {
|
84
|
+
let index = 0;
|
85
|
+
while (index < this.intervals.length) {
|
86
|
+
const interval = this.intervals[index];
|
87
|
+
if (interval.start <= position && position < interval.end || position < interval.start)
|
88
|
+
break;
|
89
|
+
index++;
|
90
|
+
}
|
91
|
+
return index;
|
92
|
+
}
|
59
93
|
canIncrementHeightTo(newHeight) {
|
60
94
|
const contentBounds = ListUtils.map(this.intervals, (c) => new Rectangle(c.start, this.minY, c.busyWidth, newHeight));
|
61
95
|
const intersectedObjects = this.calcIntersectObjects(newHeight);
|
@@ -39,7 +39,7 @@ export class RowTabInfo {
|
|
39
39
|
const tab = this.tabPositions[ind];
|
40
40
|
const oldTabPos = tab ? tab.position : Number.MAX_VALUE;
|
41
41
|
if (oldTabPos != pos)
|
42
|
-
this.tabPositions.splice(pos > oldTabPos ? ind + 1 : ind, 0, new TabInfo(pos, TabAlign.Left, TabLeaderType.None, false, false));
|
42
|
+
this.tabPositions.splice(pos > oldTabPos ? ind + 1 : ind, 0, new TabInfo(pos, TabAlign.Left, TabLeaderType.None, false, false, true));
|
43
43
|
}
|
44
44
|
for (let pos of this.tabPositions)
|
45
45
|
pos.position += this.paragraphHorizontalBoundsStart;
|
@@ -85,9 +85,10 @@ export class RowTabInfo {
|
|
85
85
|
const lastInterval = ListUtils.last(this.rowFormatter.rowSizesManager.rowFormattingInfo.intervals);
|
86
86
|
if (tabXPosRelativePage > lastInterval.end) {
|
87
87
|
if (lastInterval.end < this.rowFormatter.paragraphHorizontalBounds.end) {
|
88
|
-
if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013) {
|
89
|
-
|
90
|
-
|
88
|
+
if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013 && tabPosition && !tabPosition.isParagraphIndent) {
|
89
|
+
const interval = this.rowFormatter.rowSizesManager.rowFormattingInfo.outerHorizontalRowContentBounds;
|
90
|
+
interval.length = Number.MAX_SAFE_INTEGER - interval.start;
|
91
|
+
this.rowFormatter.rowSizesManager.rowFormattingInfo.recalculate(interval);
|
91
92
|
this.row.width = Number.MAX_SAFE_INTEGER;
|
92
93
|
this.row.flags.set(LayoutRowStateFlags.InfinityWidth, true);
|
93
94
|
return this.addTabBox();
|
@@ -53,7 +53,6 @@ export declare class TableInfo {
|
|
53
53
|
constructor(rowFormatter: RowFormatter, table: Table, tableMaxWidth: number, xPosition: number, yOffset: number, pageIndexFromWhichTableWasMoved: number | null);
|
54
54
|
static checkIsTableCannotBePlacedOnCurrentPage(rowFormatter: RowFormatter, table: Table, yOffset: number, maxWidth: number): boolean;
|
55
55
|
private init;
|
56
|
-
private getShiftHorizontalPosition;
|
57
56
|
private static getEstimatedTableWidth;
|
58
57
|
private static getRelationByColumnY;
|
59
58
|
private static getRelationByColumnX;
|
@@ -8,7 +8,7 @@ import { LayoutTableColumnInfo, LayoutTableInfo } from '../../../layout/table/la
|
|
8
8
|
import { TablePosition, TablePositionIndexes } from '../../../model/tables/main-structures/table';
|
9
9
|
import { TableCellPropertiesMergerMarginLeft, TableCellPropertiesMergerMarginRight } from '../../../model/tables/properties-mergers/table-cell-properties-merger';
|
10
10
|
import { TablePropertiesMergerShadingInfo } from '../../../model/tables/properties-mergers/table-properties-merger';
|
11
|
-
import { ConditionalTableStyleFormatting, TableLayoutType
|
11
|
+
import { ConditionalTableStyleFormatting, TableLayoutType } from '../../../model/tables/secondary-structures/table-base-structures';
|
12
12
|
import { TableWidthUnitType } from '../../../model/tables/secondary-structures/table-units';
|
13
13
|
import { BorderHelper } from '../borders/border-helper';
|
14
14
|
import { createGrid } from '../grid-engine/creator';
|
@@ -79,25 +79,9 @@ export class TableInfo {
|
|
79
79
|
tableIndent.value = 0;
|
80
80
|
}
|
81
81
|
const tableIndentInPixels = tableIndent.asNumberNoPercentType(UnitConverter.twipsToPixels);
|
82
|
-
this.xPositionStart = xPosition + tableIndentInPixels + (diff.xDiff ? diff.xDiff : -firstCellLeftMargin)
|
83
|
-
this.getShiftHorizontalPosition(xPosition);
|
82
|
+
this.xPositionStart = xPosition + tableIndentInPixels + (diff.xDiff ? diff.xDiff : -firstCellLeftMargin);
|
84
83
|
this.yPositionStart = yOffset + diff.yDiff;
|
85
84
|
}
|
86
|
-
getShiftHorizontalPosition(xPosition) {
|
87
|
-
const freeSpaceFromTable = this.columnWidth - this.grid.commonWidth;
|
88
|
-
if (freeSpaceFromTable >= 0)
|
89
|
-
return 0;
|
90
|
-
const tableAlignment = this.table.getActualTableAlignment();
|
91
|
-
if (tableAlignment == TableRowAlignment.Center) {
|
92
|
-
let result = freeSpaceFromTable / 2 - xPosition;
|
93
|
-
if (result < 0 && this.isSimpleView)
|
94
|
-
result = 0;
|
95
|
-
return result;
|
96
|
-
}
|
97
|
-
else if (tableAlignment == TableRowAlignment.Right)
|
98
|
-
return freeSpaceFromTable - xPosition;
|
99
|
-
return 0;
|
100
|
-
}
|
101
85
|
static getEstimatedTableWidth(table, maxWidth) {
|
102
86
|
const preferredWidth = table.preferredWidth;
|
103
87
|
const minWidth = 3 * table.rows[0].getTotalCellsInRowConsiderGrid();
|
@@ -11,6 +11,12 @@ export class LayoutTableSizeCompressor {
|
|
11
11
|
LayoutTableSizeCompressor.cellCompress(cell, cell.createRectangle());
|
12
12
|
}
|
13
13
|
static tableCompress(tableInfo, boundsRelativeColumn) {
|
14
|
+
const intersection = Rectangle.getIntersection(tableInfo, boundsRelativeColumn);
|
15
|
+
const headOffset = intersection.x - tableInfo.x;
|
16
|
+
if (headOffset > 0) {
|
17
|
+
tableInfo.verticalBorders.forEach(b => b.xPos -= headOffset);
|
18
|
+
tableInfo.verticalCursorBorders.forEach(b => b.xPos -= headOffset);
|
19
|
+
}
|
14
20
|
LayoutTableSizeCompressor.compress(tableInfo, boundsRelativeColumn, true, false);
|
15
21
|
const boundsRelativeTable = tableInfo.clone().moveRectangle(-tableInfo.x, -tableInfo.y);
|
16
22
|
for (let row of tableInfo.tableRows)
|
@@ -79,8 +85,9 @@ export class LayoutTableSizeCompressor {
|
|
79
85
|
}
|
80
86
|
border.length = Math.min(border.yPos + border.length, bounds.bottom) - border.yPos;
|
81
87
|
if (border.xPos < bounds.x)
|
82
|
-
|
83
|
-
|
88
|
+
border.xPos = bounds.x;
|
89
|
+
else
|
90
|
+
border.xPos = bounds.right;
|
84
91
|
border.borderInfo.width = 0;
|
85
92
|
return false;
|
86
93
|
}
|
@@ -33,8 +33,6 @@ export class TableAlignmentApplier {
|
|
33
33
|
offset = 0;
|
34
34
|
break;
|
35
35
|
}
|
36
|
-
if (offset <= 0)
|
37
|
-
return;
|
38
36
|
TableAlignmentApplier.moveAllTable(currTableColumnInfo, (rect) => rect.x += offset);
|
39
37
|
}
|
40
38
|
static applyCellsVerticalAlignment(defaultTableCellProps, grid, currTableColumnInfo, rowInfo) {
|
@@ -17,6 +17,7 @@ import { LoadFontInfoModelChange } from './model/load-font';
|
|
17
17
|
import { PageColorModelChange } from './model/page-color';
|
18
18
|
import { SectionsFormattingChangedModelChange } from './model/section-formatting-changed';
|
19
19
|
import { SectionMergedSubDocumentChange } from './model/section-merged';
|
20
|
+
import { ZoomLevelChange } from './model/zoom-level';
|
20
21
|
import { AnchorInfoPropertyChangedSubDocumentChange } from './sub-document/anchor/anchor-info-property-changed';
|
21
22
|
import { AnchoredTextBoxPropertiesChangedSubDocumentChange } from './sub-document/anchor/anchored-text-box-properties-changed';
|
22
23
|
import { AnchoredTextBoxSizeChangedSubDocumentChange } from './sub-document/anchor/anchored-text-box-size-changed';
|
@@ -66,4 +67,4 @@ import { ParagraphMergedSubDocumentChange } from './sub-document/text/paragraph-
|
|
66
67
|
import { SectionInsertedSubDocumentChange } from './sub-document/text/section-inserted';
|
67
68
|
import { SimpleRunInsertedSubDocumentChange } from './sub-document/text/simple-run-inserted';
|
68
69
|
import { TextBufferChangedSubDocumentChange } from './sub-document/text/text-buffer-changed';
|
69
|
-
export type ModelChange = PageColorModelChange | DefaultTabWidthModelChange | DifferentOddAndEvenPagesModelChange | HeaderFooterCreatedModelChange | HeaderFooterIndexChangedModelChange | LoadFontInfoModelChange | SectionsFormattingChangedModelChange | CreateStyleLinkModelChange | DeleteStyleLinkModelChange | DocumentProtectionChangedModelChange | AbstractNumberingListAddedModelChange | AbstractNumberingListDeletedModelChange | NumberingListAddedModelChange | NumberingListDeletedModelChange | ListLevelPropertyChangedModelChange | ListLevelParagraphPropertyChangedModelChange | ListLevelCharacterPropertyChangedModelChange | IOverrideListLevelChangedModelChange | BookmarkCreatedSubDocumentChange | BookmarkDeletedSubDocumentChange | TabInsertedSubDocumentChange | TabDeletedSubDocumentChange | LoadPicturesInfoSubDocumentChange | InlinePictureInsertedSubDocumentChange | InlinePicturesUpdatedSubDocumentChange | AnchoredPictureInsertedSubDocumentChange | AnchoredPictureSizeChangedSubDocumentChange | InlineObjectRunPropertyChangedSubDocumentChange | FieldInsertedSubDocumentChange | FieldDeletedSubDocumentChange | HyperlinkInfoChangedSubDocumentChange | FieldsShowCodeChangedSubDocumentChange | SimpleRunInsertedSubDocumentChange | TextBufferChangedSubDocumentChange | ParagraphInsertedSubDocumentChange | SectionInsertedSubDocumentChange | AnchoredTextBoxInsertedSubDocumentChange | AnchorObjectRemovedSubDocumentChange | IntervalRemovedSubDocumentChange | ParagraphMergedSubDocumentChange | SectionMergedSubDocumentChange | CharacterFormattingChangedSubDocumentChange | CharacterPropertiesChangedSubDocumentChange | ParagraphFormattingChangedSubDocumentChange | ParagraphPropertiesChangedSubDocumentChange | ParagraphAndCharacterMergedPropertiesResetSubDocumentChange | AnchoredTextBoxSizeChangedSubDocumentChange | AnchoredTextBoxPropertiesChangedSubDocumentChange | AnchorInfoPropertyChangedSubDocumentChange | ShapeChangedSubDocumentChange | ShapePropertyChangedSubDocumentChange | CharacterStyleAppliedSubDocumentChange | ParagraphStyleAppliedSubDocumentChange | TableStyleChangedSubDocumentChange | ParagraphNumberingListChangedSubDocumentChange | TableCreatedSubDocumentChange | TableRemovedSubDocumentChange | TableStartPositionShiftedSubDocumentChange | TableCellPropertyChangedSubDocumentChange | TablePropertyChangedSubDocumentChange | TableRowPropertyChangedSubDocumentChange | TableCellSplittedHorizontallySubDocumentChange | TableCellMergedHorizontallySubDocumentChange | TableRowInsertedSubDocumentChange | TableRowRemovedSubDocumentChange | TableCellRemovedSubDocumentChange | TableCellInsertedSubDocumentChange | RangePermissionsChangedSubDocumentChange | RangePermissionsPropertiesChange;
|
70
|
+
export type ModelChange = PageColorModelChange | DefaultTabWidthModelChange | DifferentOddAndEvenPagesModelChange | HeaderFooterCreatedModelChange | HeaderFooterIndexChangedModelChange | LoadFontInfoModelChange | SectionsFormattingChangedModelChange | CreateStyleLinkModelChange | DeleteStyleLinkModelChange | DocumentProtectionChangedModelChange | AbstractNumberingListAddedModelChange | AbstractNumberingListDeletedModelChange | NumberingListAddedModelChange | NumberingListDeletedModelChange | ListLevelPropertyChangedModelChange | ListLevelParagraphPropertyChangedModelChange | ListLevelCharacterPropertyChangedModelChange | IOverrideListLevelChangedModelChange | BookmarkCreatedSubDocumentChange | BookmarkDeletedSubDocumentChange | TabInsertedSubDocumentChange | TabDeletedSubDocumentChange | LoadPicturesInfoSubDocumentChange | InlinePictureInsertedSubDocumentChange | InlinePicturesUpdatedSubDocumentChange | AnchoredPictureInsertedSubDocumentChange | AnchoredPictureSizeChangedSubDocumentChange | InlineObjectRunPropertyChangedSubDocumentChange | FieldInsertedSubDocumentChange | FieldDeletedSubDocumentChange | HyperlinkInfoChangedSubDocumentChange | FieldsShowCodeChangedSubDocumentChange | SimpleRunInsertedSubDocumentChange | TextBufferChangedSubDocumentChange | ParagraphInsertedSubDocumentChange | SectionInsertedSubDocumentChange | AnchoredTextBoxInsertedSubDocumentChange | AnchorObjectRemovedSubDocumentChange | IntervalRemovedSubDocumentChange | ParagraphMergedSubDocumentChange | SectionMergedSubDocumentChange | CharacterFormattingChangedSubDocumentChange | CharacterPropertiesChangedSubDocumentChange | ParagraphFormattingChangedSubDocumentChange | ParagraphPropertiesChangedSubDocumentChange | ParagraphAndCharacterMergedPropertiesResetSubDocumentChange | AnchoredTextBoxSizeChangedSubDocumentChange | AnchoredTextBoxPropertiesChangedSubDocumentChange | AnchorInfoPropertyChangedSubDocumentChange | ShapeChangedSubDocumentChange | ShapePropertyChangedSubDocumentChange | CharacterStyleAppliedSubDocumentChange | ParagraphStyleAppliedSubDocumentChange | TableStyleChangedSubDocumentChange | ParagraphNumberingListChangedSubDocumentChange | TableCreatedSubDocumentChange | TableRemovedSubDocumentChange | TableStartPositionShiftedSubDocumentChange | TableCellPropertyChangedSubDocumentChange | TablePropertyChangedSubDocumentChange | TableRowPropertyChangedSubDocumentChange | TableCellSplittedHorizontallySubDocumentChange | TableCellMergedHorizontallySubDocumentChange | TableRowInsertedSubDocumentChange | TableRowRemovedSubDocumentChange | TableCellRemovedSubDocumentChange | TableCellInsertedSubDocumentChange | RangePermissionsChangedSubDocumentChange | RangePermissionsPropertiesChange | ZoomLevelChange;
|
@@ -69,4 +69,5 @@ export var ModelChangeType;
|
|
69
69
|
ModelChangeType[ModelChangeType["TableCellInserted"] = 66] = "TableCellInserted";
|
70
70
|
ModelChangeType[ModelChangeType["RangePermissionsChanged"] = 67] = "RangePermissionsChanged";
|
71
71
|
ModelChangeType[ModelChangeType["RangePermissionsPropertiesChanged"] = 68] = "RangePermissionsPropertiesChanged";
|
72
|
+
ModelChangeType[ModelChangeType["ZoomLevelChanged"] = 69] = "ZoomLevelChanged";
|
72
73
|
})(ModelChangeType || (ModelChangeType = {}));
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ModelChangeBase } from '../change-base';
|
2
|
+
import { ModelChangeType } from '../enums';
|
3
|
+
export declare class ZoomLevelChange implements ModelChangeBase {
|
4
|
+
zoomLevel: number;
|
5
|
+
prevZoomLevel: number;
|
6
|
+
readonly type = ModelChangeType.ZoomLevelChanged;
|
7
|
+
constructor(zoomLevel: number, prevZoomLevel: number);
|
8
|
+
}
|
@@ -27,6 +27,7 @@ import { TableRowProperties, TableRowPropertiesMask } from '../tables/properties
|
|
27
27
|
import { TableConditionalStyle } from '../tables/styles/table-conditional-style';
|
28
28
|
import { TableStyle } from '../tables/styles/table-style';
|
29
29
|
import { SystemColorValues } from '../themes/enums';
|
30
|
+
import { TableWidthUnitType } from '../tables/secondary-structures/table-units';
|
30
31
|
export class ModelCreator {
|
31
32
|
constructor(options) {
|
32
33
|
this.options = options;
|
@@ -122,6 +123,11 @@ export class ModelCreator {
|
|
122
123
|
}
|
123
124
|
if (this.options.fillTableStyles) {
|
124
125
|
const tableConditionalStyle = new TableConditionalStyle(templateTableProp, templateTableRowProp, templateTableCellProp, templateParProp, templateCharProps, templateTabProp);
|
126
|
+
tableConditionalStyle.tableProperties.cellMargins.left.type = TableWidthUnitType.ModelUnits;
|
127
|
+
tableConditionalStyle.tableProperties.cellMargins.left.value = 108;
|
128
|
+
tableConditionalStyle.tableProperties.cellMargins.right.type = TableWidthUnitType.ModelUnits;
|
129
|
+
tableConditionalStyle.tableProperties.cellMargins.right.value = 108;
|
130
|
+
tableConditionalStyle.tableProperties.mask = TablePropertiesMask.UseLeftMargin | TablePropertiesMask.UseRightMargin;
|
125
131
|
model.stylesManager.addTableStyle(new TableStyle(TableStyle.DEFAULT_STYLENAME, TableStyle.DEFAULT_STYLENAME, false, false, false, true, {}, tableConditionalStyle, null));
|
126
132
|
}
|
127
133
|
if (this.options.initOfficeTheme)
|
@@ -62,10 +62,11 @@ export declare class ModelManipulator {
|
|
62
62
|
textBox: TextBoxManipulator;
|
63
63
|
paragraph: ParagraphManipulator;
|
64
64
|
documentMerger: DocumentMerger;
|
65
|
-
modelListeners
|
65
|
+
private modelListeners;
|
66
66
|
onFontsChanged: EventDispatcher<IFontsChangesListener>;
|
67
67
|
constructor(modelManager: IModelManager, batchUpdatableObject: IBatchUpdatableObject);
|
68
68
|
notifyModelChanged(change: ModelChange): void;
|
69
|
+
addModelListener(listener: IModelChangesListener): void;
|
69
70
|
removeModelListener(listener: IModelChangesListener): void;
|
70
71
|
raiseFontAdded(newFontInfo: FontInfo | null): void;
|
71
72
|
raiseFontRemoved(font: FontInfo | null): void;
|
@@ -61,6 +61,10 @@ export class ModelManipulator {
|
|
61
61
|
notifyModelChanged(change) {
|
62
62
|
this.modelListeners.forEach(listener => listener.modelChanged(change));
|
63
63
|
}
|
64
|
+
addModelListener(listener) {
|
65
|
+
if (this.modelListeners.indexOf(listener) < 0)
|
66
|
+
this.modelListeners.push(listener);
|
67
|
+
}
|
64
68
|
removeModelListener(listener) {
|
65
69
|
const index = this.modelListeners.indexOf(listener);
|
66
70
|
if (index >= 0)
|
@@ -53,7 +53,8 @@ export declare abstract class TabInfoBase<T extends TabInfoBase<T>> implements I
|
|
53
53
|
}
|
54
54
|
export declare class TabInfo extends TabInfoBase<TabInfo> {
|
55
55
|
position: number;
|
56
|
-
|
56
|
+
readonly isParagraphIndent: boolean;
|
57
|
+
constructor(position: number, alignment: TabAlign, leader: TabLeaderType, deleted: boolean, isDefault: boolean, isParagraphIndent?: boolean);
|
57
58
|
equals(obj: TabInfo): boolean;
|
58
59
|
clone(): TabInfo;
|
59
60
|
}
|
@@ -123,9 +123,10 @@ export class TabInfoBase {
|
|
123
123
|
}
|
124
124
|
}
|
125
125
|
export class TabInfo extends TabInfoBase {
|
126
|
-
constructor(position, alignment, leader, deleted, isDefault) {
|
126
|
+
constructor(position, alignment, leader, deleted, isDefault, isParagraphIndent = false) {
|
127
127
|
super(alignment, leader, deleted, isDefault);
|
128
128
|
this.position = position;
|
129
|
+
this.isParagraphIndent = isParagraphIndent;
|
129
130
|
}
|
130
131
|
equals(obj) {
|
131
132
|
return super.equals(obj) && this.position == obj.position;
|