devexpress-richedit 24.2.8-build-25149-0115 → 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.css +1 -1
- package/dist/dx.richedit.d.ts +11 -3
- package/dist/dx.richedit.js +2494 -2002
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/_constants.d.ts +1 -0
- package/lib/client/_constants.js +3 -0
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +11 -0
- package/lib/client/client-rich-edit.js +5 -3
- package/lib/client/commands/commands.js +12 -0
- package/lib/client/i-rich-constructor-settings.d.ts +2 -0
- package/lib/client/model-api/api-utils/parameter-checker.d.ts +1 -1
- package/lib/client/model-api/api-utils/parameter-checker.js +2 -2
- package/lib/client/public/commands/enum.d.ts +3 -1
- package/lib/client/public/commands/enum.js +2 -0
- package/lib/client/public/options.d.ts +2 -0
- package/lib/client/public/options.js +2 -0
- package/lib/client/public/rich-edit.d.ts +4 -0
- package/lib/client/public/rich-edit.js +21 -0
- package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -1
- package/lib/client/settings.js +4 -0
- package/lib/client/utils/focus-helper.js +5 -22
- package/lib/common/canvas/canvas-manager.d.ts +2 -0
- package/lib/common/canvas/canvas-manager.js +34 -20
- 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 +5 -2
- package/lib/common/canvas/renderes/common/document-renderer.js +5 -0
- package/lib/common/canvas/renderes/view-manager.d.ts +9 -1
- package/lib/common/canvas/renderes/view-manager.js +27 -2
- package/lib/common/commands/client-command.d.ts +3 -1
- package/lib/common/commands/client-command.js +2 -0
- package/lib/common/commands/command-manager.js +4 -0
- package/lib/common/commands/layout/apply-style-command.d.ts +2 -2
- package/lib/common/commands/layout/apply-style-command.js +4 -3
- package/lib/common/commands/layout/change-zoom-level-command.d.ts +10 -0
- package/lib/common/commands/layout/change-zoom-level-command.js +30 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +7 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.js +17 -0
- package/lib/common/commands/ruler/ruler-table-column-separators-command.d.ts +9 -2
- package/lib/common/commands/ruler/ruler-table-column-separators-command.js +24 -15
- package/lib/common/commands/toc/set-paragraph-level-command.js +1 -1
- 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/input-controller.js +4 -0
- package/lib/common/interfaces/i-zoom-level-holder.d.ts +3 -0
- package/lib/common/interfaces/i-zoom-level-holder.js +1 -0
- package/lib/common/layout/document-layout.d.ts +2 -0
- package/lib/common/layout/document-layout.js +4 -0
- package/lib/common/layout-formatter/formatter/base-formatter.js +2 -1
- package/lib/common/model/borders/border-info.js +1 -1
- 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/character/character-properties.d.ts +1 -1
- package/lib/common/model/character/character-properties.js +2 -14
- package/lib/common/model/creator/creator.js +6 -0
- package/lib/common/model/history/items/character-properties-history-items.d.ts +1 -2
- package/lib/common/model/history/items/character-properties-history-items.js +2 -3
- package/lib/common/model/json/enums/json-control-enums.d.ts +2 -1
- package/lib/common/model/json/enums/json-control-enums.js +1 -0
- package/lib/common/model/json/exporters/json-control-options-converter.js +2 -0
- package/lib/common/model/json/importers/json-importer.js +2 -0
- package/lib/common/model/manipulators/character-properties-manipulator.js +2 -2
- package/lib/common/model/manipulators/i-properties-manipulator.d.ts +1 -1
- 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/options/control.d.ts +1 -0
- package/lib/common/model/options/control.js +1 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +9 -4
- package/lib/common/model/paragraph/paragraph-style.js +20 -14
- package/lib/common/model/rich-utils.d.ts +2 -0
- package/lib/common/model/rich-utils.js +2 -0
- package/lib/common/mouse-handler/resize-box-helper.js +2 -2
- package/lib/common/rich-edit-core.d.ts +0 -1
- package/lib/common/rich-edit-core.js +17 -22
- package/lib/common/ui/ruler/controls/base.d.ts +7 -2
- package/lib/common/ui/ruler/controls/base.js +11 -3
- package/lib/common/ui/ruler/controls/column.d.ts +17 -5
- package/lib/common/ui/ruler/controls/column.js +37 -21
- package/lib/common/ui/ruler/controls/divisions.d.ts +18 -5
- package/lib/common/ui/ruler/controls/divisions.js +41 -13
- package/lib/common/ui/ruler/controls/indent/first-line.js +2 -2
- package/lib/common/ui/ruler/controls/indent/left.js +2 -2
- package/lib/common/ui/ruler/controls/indent/right.js +2 -2
- package/lib/common/ui/ruler/controls/margin/base.js +3 -3
- package/lib/common/ui/ruler/controls/owner.d.ts +2 -0
- package/lib/common/ui/ruler/controls/owner.js +4 -0
- package/lib/common/ui/ruler/controls/ruler.js +8 -4
- package/lib/common/ui/ruler/controls/tab/tab-info.d.ts +15 -0
- package/lib/common/ui/ruler/controls/tab/tab-info.js +19 -0
- package/lib/common/ui/ruler/controls/tab/tab.d.ts +3 -3
- package/lib/common/ui/ruler/controls/tab/tab.js +10 -11
- package/lib/common/ui/ruler/controls/table.js +5 -4
- package/lib/common/ui/ruler/controls/vertical-line.js +1 -2
- package/lib/common/ui/ruler/controls/zoomable-value.d.ts +8 -0
- package/lib/common/ui/ruler/controls/zoomable-value.js +15 -0
- package/lib/common/ui/ruler/manager.d.ts +6 -2
- package/lib/common/ui/ruler/manager.js +13 -4
- package/lib/common/ui/ruler/model-data.d.ts +1 -0
- package/lib/common/ui/ruler/model-data.js +1 -0
- 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/view-settings/views-settings.d.ts +2 -0
- package/lib/common/view-settings/views-settings.js +3 -0
- package/package.json +7 -7
@@ -1,5 +1,6 @@
|
|
1
1
|
import { RulerControls } from '../manager';
|
2
2
|
import { RulerMultiControl } from './owner';
|
3
|
+
import { IZoomLevelHolder } from '../../../interfaces/i-zoom-level-holder';
|
3
4
|
export declare enum ColumnAction {
|
4
5
|
None = 0,
|
5
6
|
ColumnMove = 1,
|
@@ -7,11 +8,22 @@ export declare enum ColumnAction {
|
|
7
8
|
ColumnWidth = 3
|
8
9
|
}
|
9
10
|
export declare class RulerColumnModelState {
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
private zoomLevelHolder;
|
12
|
+
private zoomableLeftPos;
|
13
|
+
get leftPos(): number;
|
14
|
+
get originalLeftPos(): number;
|
15
|
+
set leftPos(value: number);
|
16
|
+
private zoomableWidth;
|
17
|
+
get width(): number;
|
18
|
+
get originalWidth(): number;
|
19
|
+
set width(value: number);
|
20
|
+
private zoomableSpace;
|
21
|
+
get space(): number;
|
22
|
+
get originalSpace(): number;
|
23
|
+
set space(value: number);
|
13
24
|
get rightPos(): number;
|
14
|
-
|
25
|
+
get originalRightPos(): number;
|
26
|
+
constructor(leftPos: number, width: number, space: number, zoomLevelHolder: IZoomLevelHolder);
|
15
27
|
clone(): RulerColumnModelState;
|
16
28
|
equals(obj: RulerColumnModelState): boolean;
|
17
29
|
}
|
@@ -47,7 +59,7 @@ declare class RulerColumnState {
|
|
47
59
|
showShadow(): void;
|
48
60
|
hideShadow(): void;
|
49
61
|
lineControlSetPosition(): void;
|
50
|
-
setValue(viewState: RulerColumnModelState): void;
|
62
|
+
setValue(viewState: RulerColumnModelState, forceUpdate?: boolean): void;
|
51
63
|
getAction(source: HTMLElement): ColumnAction;
|
52
64
|
}
|
53
65
|
export {};
|
@@ -7,6 +7,7 @@ import { RichEditClientCommand } from '../../../commands/client-command';
|
|
7
7
|
import { RICH_EDIT_CLASS_NAME_PREFIX, RULLER_NUMBER_CORRECTION } from '../settings';
|
8
8
|
import { RulerMultiControl } from './owner';
|
9
9
|
import { RulerLineDisplayType, SnapTo } from './vertical-line';
|
10
|
+
import { RulerValue } from './zoomable-value';
|
10
11
|
const MinColumnWidth = UnitConverter.centimeterToPixel(1.5);
|
11
12
|
const MinColumnSpace = UnitConverter.centimeterToPixel(0.25);
|
12
13
|
const COLUMN_HANDLE_CLASS_NAME = RICH_EDIT_CLASS_NAME_PREFIX + "columnHandle";
|
@@ -33,14 +34,25 @@ export var ColumnAction;
|
|
33
34
|
ColumnAction[ColumnAction["ColumnWidth"] = 3] = "ColumnWidth";
|
34
35
|
})(ColumnAction || (ColumnAction = {}));
|
35
36
|
export class RulerColumnModelState {
|
37
|
+
get leftPos() { return this.zoomableLeftPos.value; }
|
38
|
+
get originalLeftPos() { return this.zoomableLeftPos.originalValue; }
|
39
|
+
set leftPos(value) { this.zoomableLeftPos.value = value; }
|
40
|
+
get width() { return this.zoomableWidth.value; }
|
41
|
+
get originalWidth() { return this.zoomableWidth.originalValue; }
|
42
|
+
set width(value) { this.zoomableWidth.value = value; }
|
43
|
+
get space() { return this.zoomableSpace.value; }
|
44
|
+
get originalSpace() { return this.zoomableSpace.originalValue; }
|
45
|
+
set space(value) { this.zoomableSpace.value = value; }
|
36
46
|
get rightPos() { return this.leftPos + this.width; }
|
37
|
-
|
38
|
-
|
39
|
-
this.
|
40
|
-
this.
|
47
|
+
get originalRightPos() { return this.originalLeftPos + this.originalWidth; }
|
48
|
+
constructor(leftPos, width, space, zoomLevelHolder) {
|
49
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
50
|
+
this.zoomableLeftPos = new RulerValue(leftPos, this.zoomLevelHolder);
|
51
|
+
this.zoomableWidth = new RulerValue(width, this.zoomLevelHolder);
|
52
|
+
this.zoomableSpace = new RulerValue(space, this.zoomLevelHolder);
|
41
53
|
}
|
42
54
|
clone() {
|
43
|
-
return new RulerColumnModelState(this.
|
55
|
+
return new RulerColumnModelState(this.originalLeftPos, this.originalWidth, this.originalSpace, this.zoomLevelHolder);
|
44
56
|
}
|
45
57
|
equals(obj) {
|
46
58
|
return this.leftPos == obj.leftPos &&
|
@@ -57,7 +69,8 @@ export class RulerColumnsModelState {
|
|
57
69
|
}
|
58
70
|
get activeColumn() { return this.columns[this.columnActiveIndex]; }
|
59
71
|
clone() {
|
60
|
-
|
72
|
+
const clonedColumns = ListUtils.deepCopy(this.columns);
|
73
|
+
return new RulerColumnsModelState(clonedColumns, this.equalWidth, this.columnActiveIndex, this.enabled);
|
61
74
|
}
|
62
75
|
}
|
63
76
|
export class RulerColumnsControl extends RulerMultiControl {
|
@@ -65,8 +78,8 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
65
78
|
const state = this.modelData.commandManager.getCommand(RichEditClientCommand.RulerSectionColumnsSettings).getState();
|
66
79
|
let prevColumnLeftPos = 0;
|
67
80
|
const modelColumns = ListUtils.map(state.value, (column) => {
|
68
|
-
const result = new RulerColumnModelState(prevColumnLeftPos, column.width, column.space);
|
69
|
-
prevColumnLeftPos = result.
|
81
|
+
const result = new RulerColumnModelState(prevColumnLeftPos, column.width, column.space, this.modelData);
|
82
|
+
prevColumnLeftPos = result.originalRightPos + result.originalSpace;
|
70
83
|
return result;
|
71
84
|
});
|
72
85
|
return new RulerColumnsModelState(modelColumns, state.equalWidth, state.activeIndex, state.enabled);
|
@@ -84,7 +97,7 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
84
97
|
return result;
|
85
98
|
}, 0, this.currModelState.columns.length - 1);
|
86
99
|
this.setCount(this.viewState.length);
|
87
|
-
ListUtils.forEach2(this.subControls, this.viewState, (control, viewState) => control.setValue(viewState));
|
100
|
+
ListUtils.forEach2(this.subControls, this.viewState, (control, viewState) => control.setValue(viewState, this.zoomChanged));
|
88
101
|
}
|
89
102
|
}
|
90
103
|
createSubControl() {
|
@@ -96,8 +109,8 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
96
109
|
const columnWidthDiff = diff / colCount;
|
97
110
|
let prevColumnLeftPos = 0;
|
98
111
|
this.currModelState.columns = this.prevModelState.columns.map(oldColumn => {
|
99
|
-
const result = new RulerColumnModelState(prevColumnLeftPos, oldColumn.
|
100
|
-
prevColumnLeftPos = result.
|
112
|
+
const result = new RulerColumnModelState(prevColumnLeftPos, oldColumn.originalWidth - columnWidthDiff, oldColumn.originalSpace, this.modelData);
|
113
|
+
prevColumnLeftPos = result.originalRightPos + result.originalSpace;
|
101
114
|
return result;
|
102
115
|
});
|
103
116
|
}
|
@@ -122,7 +135,7 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
122
135
|
}
|
123
136
|
onMouseUp() {
|
124
137
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerSectionColumnsSettings)
|
125
|
-
.execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.columns.map(col => new ColumnSectionProperties(col.
|
138
|
+
.execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.columns.map(col => new ColumnSectionProperties(col.originalWidth, col.originalSpace)));
|
126
139
|
this.finishHandle();
|
127
140
|
}
|
128
141
|
calculateNewModelState(distance) {
|
@@ -139,10 +152,11 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
139
152
|
}
|
140
153
|
}
|
141
154
|
calculateNewModelStateColumnMove(distance) {
|
155
|
+
const minColumnWidth = MinColumnWidth * this.modelData.zoomLevel;
|
142
156
|
const leftMargin = this.controls.leftMargin.prevModelState.modelValue;
|
143
157
|
const column = this.prevModelState.columns[this.handleControlIndex];
|
144
158
|
const initialPos = leftMargin + column.rightPos;
|
145
|
-
const newPos = this.controls.chooseClosestAnchorPosition(initialPos + distance, [initialPos], new MinMaxNumber(leftMargin + column.leftPos +
|
159
|
+
const newPos = this.controls.chooseClosestAnchorPosition(initialPos + distance, [initialPos], new MinMaxNumber(leftMargin + column.leftPos + minColumnWidth, leftMargin + this.prevModelState.columns[this.handleControlIndex + 1].rightPos - minColumnWidth - column.space));
|
146
160
|
const correctedDistance = newPos - initialPos;
|
147
161
|
const currColumn = this.currModelState.columns[this.handleControlIndex] = this.prevModelState.columns[this.handleControlIndex].clone();
|
148
162
|
const nextColumn = this.currModelState.columns[this.handleControlIndex + 1] = this.prevModelState.columns[this.handleControlIndex + 1].clone();
|
@@ -151,15 +165,17 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
151
165
|
nextColumn.width -= correctedDistance;
|
152
166
|
}
|
153
167
|
calculateNewModelStateColumnSpace(distance, leftEdge) {
|
168
|
+
const minColumnWidth = MinColumnWidth * this.modelData.zoomLevel;
|
169
|
+
const minColumnSpace = MinColumnSpace * this.modelData.zoomLevel;
|
154
170
|
if (this.prevModelState.equalWidth) {
|
155
171
|
const columnCount = this.currModelState.columns.length;
|
156
172
|
const leftMargin = this.controls.leftMargin.prevModelState.modelValue;
|
157
173
|
const column = this.prevModelState.columns[this.handleControlIndex];
|
158
|
-
const maxColumnSpace = (ListUtils.last(this.prevModelState.columns).rightPos -
|
159
|
-
const maxColumnWidth = (ListUtils.last(this.prevModelState.columns).rightPos -
|
174
|
+
const maxColumnSpace = (ListUtils.last(this.prevModelState.columns).rightPos - minColumnWidth * columnCount) / (columnCount - 1);
|
175
|
+
const maxColumnWidth = (ListUtils.last(this.prevModelState.columns).rightPos - minColumnSpace * (columnCount - 1)) / columnCount;
|
160
176
|
const bounds = leftEdge ?
|
161
|
-
new MinMaxNumber(leftMargin +
|
162
|
-
new MinMaxNumber(leftMargin + (maxColumnWidth +
|
177
|
+
new MinMaxNumber(leftMargin + minColumnWidth * (this.handleControlIndex + 1) + maxColumnSpace * this.handleControlIndex, leftMargin + maxColumnWidth * (this.handleControlIndex + 1) + minColumnSpace * this.handleControlIndex) :
|
178
|
+
new MinMaxNumber(leftMargin + (maxColumnWidth + minColumnSpace) * (this.handleControlIndex + 1), leftMargin + (minColumnWidth + maxColumnSpace) * (this.handleControlIndex + 1));
|
163
179
|
const initialPos = leftMargin + column.rightPos + (leftEdge ? 0 : column.space);
|
164
180
|
const newPos = this.controls.chooseClosestAnchorPosition(initialPos + distance, [initialPos], bounds);
|
165
181
|
const correctedDistance = newPos - initialPos;
|
@@ -182,8 +198,8 @@ export class RulerColumnsControl extends RulerMultiControl {
|
|
182
198
|
const leftMargin = this.controls.leftMargin.prevModelState.modelValue;
|
183
199
|
const column = this.prevModelState.columns[this.handleControlIndex];
|
184
200
|
const bounds = leftEdge ?
|
185
|
-
new MinMaxNumber(leftMargin + column.leftPos +
|
186
|
-
new MinMaxNumber(leftMargin + column.rightPos +
|
201
|
+
new MinMaxNumber(leftMargin + column.leftPos + minColumnWidth, leftMargin + this.prevModelState.columns[this.handleControlIndex + 1].leftPos - minColumnSpace) :
|
202
|
+
new MinMaxNumber(leftMargin + column.rightPos + minColumnSpace, leftMargin + this.prevModelState.columns[this.handleControlIndex + 1].rightPos - minColumnWidth);
|
187
203
|
const initialPos = leftMargin + column.rightPos + (leftEdge ? 0 : column.space);
|
188
204
|
const newPos = this.controls.chooseClosestAnchorPosition(initialPos + distance, [initialPos], bounds);
|
189
205
|
const correctedDistance = newPos - initialPos;
|
@@ -232,8 +248,8 @@ class RulerColumnState {
|
|
232
248
|
}
|
233
249
|
this.controls.lineControl.setPosition(pos, SnapTo.LeftSide);
|
234
250
|
}
|
235
|
-
setValue(viewState) {
|
236
|
-
if (!this.viewState || !this.viewState.equals(viewState)) {
|
251
|
+
setValue(viewState, forceUpdate = false) {
|
252
|
+
if (forceUpdate || !this.viewState || !this.viewState.equals(viewState)) {
|
237
253
|
this.viewState = viewState.clone();
|
238
254
|
this.rootElement.style.left = RULLER_NUMBER_CORRECTION + viewState.rightPos + "px";
|
239
255
|
this.rootElement.style.width = viewState.space + "px";
|
@@ -2,6 +2,8 @@ import { RichEditUnit } from '../../../utils/unit-converter';
|
|
2
2
|
import { RulerControls } from '../manager';
|
3
3
|
import { RulerModelData } from '../model-data';
|
4
4
|
import { RulerBase } from './base';
|
5
|
+
import { ViewSettings } from '../../../view-settings/views-settings';
|
6
|
+
import { IZoomLevelHolder } from '../../../interfaces/i-zoom-level-holder';
|
5
7
|
export declare const MINOR_TOP_AND_BOTTOM_MARGIN: number;
|
6
8
|
export declare const MAJOR_TOP_AND_BOTTOM_MARGIN: number;
|
7
9
|
export declare const DIVISION_CONTAINER_CLASS_NAME: string;
|
@@ -12,9 +14,15 @@ export declare const DIVISION_NUMBER_CLASS_NAME: string;
|
|
12
14
|
export declare class RulerDivisionsControl extends RulerBase {
|
13
15
|
viewState: number;
|
14
16
|
private initialLeft;
|
15
|
-
|
17
|
+
private divisionInfo;
|
18
|
+
private maxPageWidth;
|
19
|
+
private zoomLevel;
|
20
|
+
private zoomChanged;
|
21
|
+
private _height;
|
22
|
+
get height(): number;
|
16
23
|
protected getRootClassName(): string;
|
17
24
|
constructor(modelData: RulerModelData, controls: RulerControls, divisionInfo: DivisionInfo, maxPageWidth: number);
|
25
|
+
render(): void;
|
18
26
|
update(): void;
|
19
27
|
updateModelState(): void;
|
20
28
|
updateView(): void;
|
@@ -26,9 +34,14 @@ export declare enum DivisionType {
|
|
26
34
|
Major = 2
|
27
35
|
}
|
28
36
|
export declare class DivisionInfo {
|
37
|
+
readonly originalUnitSize: number;
|
38
|
+
private zoomLevelHolder;
|
29
39
|
readonly unitMap: DivisionType[];
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
40
|
+
get unitSize(): number;
|
41
|
+
get stepSize(): number;
|
42
|
+
private _stepSize;
|
43
|
+
private _unitSize;
|
44
|
+
constructor(map: number[], originalUnitSize: number, zoomLevelHolder: IZoomLevelHolder);
|
45
|
+
updateZoomLevel(): void;
|
46
|
+
static create(unitType: RichEditUnit, viewSettings: ViewSettings): DivisionInfo;
|
34
47
|
}
|
@@ -13,25 +13,40 @@ export const DIVISION_MINOR_CLASS_NAME = RULER_CLASS_NAME + "Minor" + DIVISION_C
|
|
13
13
|
export const DIVISION_MAJOR_CLASS_NAME = RULER_CLASS_NAME + "Major" + DIVISION_CLASS_NAME;
|
14
14
|
export const DIVISION_NUMBER_CLASS_NAME = RULER_CLASS_NAME + "Number" + DIVISION_CLASS_NAME;
|
15
15
|
export class RulerDivisionsControl extends RulerBase {
|
16
|
+
get height() { return this._height; }
|
16
17
|
getRootClassName() { return DIVISION_CONTAINER_CLASS_NAME; }
|
17
18
|
constructor(modelData, controls, divisionInfo, maxPageWidth) {
|
18
19
|
super(modelData, controls);
|
19
|
-
this.
|
20
|
-
|
21
|
-
this.
|
20
|
+
this.zoomLevel = 1.0;
|
21
|
+
this.zoomChanged = false;
|
22
|
+
this._height = 0;
|
23
|
+
this.divisionInfo = divisionInfo;
|
24
|
+
this.maxPageWidth = maxPageWidth;
|
22
25
|
this.controls.ruler.rootElement.appendChild(this.rootElement);
|
26
|
+
this._height = SizeUtils.getOffsetHeight(this.rootElement);
|
23
27
|
if (Browser.IE && Browser.MajorVersion <= 9)
|
24
28
|
this.rootElement.offsetParent;
|
25
|
-
this.
|
26
|
-
|
27
|
-
|
29
|
+
this.render();
|
30
|
+
}
|
31
|
+
render() {
|
32
|
+
const unitCount = Math.ceil(this.maxPageWidth / this.divisionInfo.unitSize);
|
33
|
+
this.rootElement.style.width = this.divisionInfo.unitSize * (unitCount * 2 + 1) + "px";
|
34
|
+
createDivisionElements(this.rootElement, unitCount, this.divisionInfo, this.height);
|
35
|
+
this.initialLeft = -(unitCount * this.divisionInfo.unitSize - RULLER_NUMBER_CORRECTION);
|
28
36
|
}
|
29
37
|
update() {
|
30
38
|
this.updateModelState();
|
31
39
|
this.updateView();
|
32
40
|
}
|
33
|
-
updateModelState() {
|
41
|
+
updateModelState() {
|
42
|
+
this.zoomChanged = this.zoomLevel != this.modelData.zoomLevel;
|
43
|
+
this.zoomLevel = this.modelData.zoomLevel;
|
44
|
+
}
|
34
45
|
updateView() {
|
46
|
+
if (this.zoomChanged) {
|
47
|
+
this.render();
|
48
|
+
this.zoomChanged = false;
|
49
|
+
}
|
35
50
|
const newViewState = this.getViewValue();
|
36
51
|
if (newViewState != this.viewState) {
|
37
52
|
this.viewState = newViewState;
|
@@ -48,6 +63,9 @@ export class RulerDivisionsControl extends RulerBase {
|
|
48
63
|
}
|
49
64
|
}
|
50
65
|
function createDivisionElements(rootElement, unitCount, divisionInfo, height) {
|
66
|
+
while (rootElement.firstChild) {
|
67
|
+
rootElement.removeChild(rootElement.lastChild);
|
68
|
+
}
|
51
69
|
let divisionLeftPosition = 0;
|
52
70
|
const createSimpleDivision = (className, topAndBottomMargin) => {
|
53
71
|
const stepSize = divisionInfo.stepSize;
|
@@ -99,15 +117,25 @@ export var DivisionType;
|
|
99
117
|
DivisionType[DivisionType["Major"] = 2] = "Major";
|
100
118
|
})(DivisionType || (DivisionType = {}));
|
101
119
|
export class DivisionInfo {
|
102
|
-
|
120
|
+
get unitSize() { return this._unitSize; }
|
121
|
+
;
|
122
|
+
get stepSize() { return this._stepSize; }
|
123
|
+
;
|
124
|
+
constructor(map, originalUnitSize, zoomLevelHolder) {
|
125
|
+
this.originalUnitSize = originalUnitSize;
|
126
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
103
127
|
this.unitMap = map;
|
104
|
-
this.
|
105
|
-
|
128
|
+
this.updateZoomLevel();
|
129
|
+
}
|
130
|
+
updateZoomLevel() {
|
131
|
+
const zoomLevel = this.zoomLevelHolder.zoomLevel;
|
132
|
+
this._unitSize = this.originalUnitSize * zoomLevel;
|
133
|
+
this._stepSize = this.unitSize / this.unitMap.length;
|
106
134
|
}
|
107
|
-
static create(unitType) {
|
135
|
+
static create(unitType, viewSettings) {
|
108
136
|
return unitType == RichEditUnit.Inch ?
|
109
137
|
new DivisionInfo([DivisionType.Number, DivisionType.Minor, DivisionType.Minor, DivisionType.Minor,
|
110
|
-
DivisionType.Major, DivisionType.Minor, DivisionType.Minor, DivisionType.Minor], UnitConverter.inchesToPixels(1)) :
|
111
|
-
new DivisionInfo([DivisionType.Number, DivisionType.Minor, DivisionType.Major, DivisionType.Minor], UnitConverter.centimeterToPixelF(1));
|
138
|
+
DivisionType.Major, DivisionType.Minor, DivisionType.Minor, DivisionType.Minor], UnitConverter.inchesToPixels(1), viewSettings) :
|
139
|
+
new DivisionInfo([DivisionType.Number, DivisionType.Minor, DivisionType.Major, DivisionType.Minor], UnitConverter.centimeterToPixelF(1), viewSettings);
|
112
140
|
}
|
113
141
|
}
|
@@ -30,7 +30,7 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
30
30
|
}
|
31
31
|
getModelState() {
|
32
32
|
const state = this.modelData.commandManager.getCommand(RichEditClientCommand.RulerParagraphLeftIndents).getState();
|
33
|
-
return new RulerModelState(state.value.firstLine, state.enabled);
|
33
|
+
return new RulerModelState(state.value.firstLine, state.enabled, this.modelData);
|
34
34
|
}
|
35
35
|
updateView() {
|
36
36
|
const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
|
@@ -44,7 +44,7 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
|
|
44
44
|
}
|
45
45
|
canHandle(source) { return source == this.rootElement; }
|
46
46
|
onMouseUp() {
|
47
|
-
const commandValue = new RulerParagraphLeftIndentsCommandValue(null, this.controls.leftIndent.currModelState.
|
47
|
+
const commandValue = new RulerParagraphLeftIndentsCommandValue(null, this.controls.leftIndent.currModelState.originalModelValue, this.currModelState.originalModelValue);
|
48
48
|
commandValue.setIntervalsInfo(this.modelData.selection.intervalsInfo);
|
49
49
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerParagraphLeftIndents)
|
50
50
|
.execute(this.modelData.commandManager.isPublicApiCall, commandValue);
|
@@ -44,7 +44,7 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
|
44
44
|
}
|
45
45
|
getModelState() {
|
46
46
|
const state = this.modelData.commandManager.getCommand(RichEditClientCommand.RulerParagraphLeftIndents).getState();
|
47
|
-
return new RulerModelState(state.value.hanging, state.enabled);
|
47
|
+
return new RulerModelState(state.value.hanging, state.enabled, this.modelData);
|
48
48
|
}
|
49
49
|
updateView() {
|
50
50
|
const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
|
@@ -68,7 +68,7 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
|
|
68
68
|
return false;
|
69
69
|
}
|
70
70
|
onMouseUp() {
|
71
|
-
const commandValue = new RulerParagraphLeftIndentsCommandValue(null, this.currModelState.
|
71
|
+
const commandValue = new RulerParagraphLeftIndentsCommandValue(null, this.currModelState.originalModelValue, this.controls.firstLineIndent.currModelState.originalModelValue);
|
72
72
|
commandValue.setIntervalsInfo(this.modelData.selection.intervalsInfo);
|
73
73
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerParagraphLeftIndents)
|
74
74
|
.execute(this.modelData.commandManager.isPublicApiCall, commandValue);
|
@@ -29,7 +29,7 @@ export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
|
|
29
29
|
getModelState() {
|
30
30
|
const state = this.modelData.commandManager
|
31
31
|
.getCommand(RichEditClientCommand.RulerParagraphRightIndent).getState();
|
32
|
-
return new RulerModelState(state.value.hanging, state.enabled);
|
32
|
+
return new RulerModelState(state.value.hanging, state.enabled, this.modelData);
|
33
33
|
}
|
34
34
|
updateView() {
|
35
35
|
const newViewState = this.correctRelativeLeftIndents(this.controls.ruler.pageWidth - this.controls.paragraphRightPosition + this.currModelState.modelValue);
|
@@ -48,7 +48,7 @@ export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
|
|
48
48
|
canHandle(source) { return source == this.rootElement; }
|
49
49
|
onMouseUp() {
|
50
50
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerParagraphRightIndent)
|
51
|
-
.execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.
|
51
|
+
.execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.originalModelValue);
|
52
52
|
this.finishHandle();
|
53
53
|
}
|
54
54
|
lineControlSetPosition() {
|
@@ -31,12 +31,12 @@ export class RulerBaseMarginControl extends RulerBase {
|
|
31
31
|
}
|
32
32
|
onMouseMove(distance, _source) {
|
33
33
|
this.calculateNewModelState(distance);
|
34
|
-
this.controls.columns.marginsChanged(this.currModelState.
|
34
|
+
this.controls.columns.marginsChanged(this.currModelState.originalModelValue - this.prevModelState.originalModelValue);
|
35
35
|
this.updateView();
|
36
36
|
this.lineControlSetPosition();
|
37
37
|
}
|
38
38
|
onMouseUp() {
|
39
|
-
this.modelData.commandManager.getCommand(this.commandType).execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.
|
39
|
+
this.modelData.commandManager.getCommand(this.commandType).execute(this.modelData.commandManager.isPublicApiCall, this.currModelState.originalModelValue);
|
40
40
|
this.finishHandle();
|
41
41
|
}
|
42
42
|
onEscPress() {
|
@@ -45,7 +45,7 @@ export class RulerBaseMarginControl extends RulerBase {
|
|
45
45
|
}
|
46
46
|
getModelState() {
|
47
47
|
const state = this.modelData.commandManager.getCommand(this.commandType).getState();
|
48
|
-
return new RulerModelState(state.value, state.enabled);
|
48
|
+
return new RulerModelState(state.value, state.enabled, this.modelData);
|
49
49
|
}
|
50
50
|
finishHandle() {
|
51
51
|
this.controls.lineControl.hide();
|
@@ -16,6 +16,8 @@ export declare abstract class RulerMultiControl<TSubControl extends IRulerSubCon
|
|
16
16
|
protected handleControlIndex: number;
|
17
17
|
protected get activeSubControl(): TSubControl;
|
18
18
|
protected viewState: TVisualState[];
|
19
|
+
protected zoomLevel: number;
|
20
|
+
protected zoomChanged: boolean;
|
19
21
|
protected abstract getModelState(): TModelState;
|
20
22
|
abstract updateView(): void;
|
21
23
|
protected abstract createSubControl(): TSubControl;
|
@@ -4,6 +4,8 @@ export class RulerMultiControl {
|
|
4
4
|
this.subControls = [];
|
5
5
|
this.handleControlIndex = -1;
|
6
6
|
this.viewState = [];
|
7
|
+
this.zoomLevel = 1.0;
|
8
|
+
this.zoomChanged = false;
|
7
9
|
this.modelData = modelData;
|
8
10
|
this.controls = controls;
|
9
11
|
}
|
@@ -19,6 +21,8 @@ export class RulerMultiControl {
|
|
19
21
|
updateModelState() {
|
20
22
|
this.currModelState = this.getModelState();
|
21
23
|
this.prevModelState = this.currModelState.clone();
|
24
|
+
this.zoomChanged = this.zoomLevel != this.modelData.zoomLevel;
|
25
|
+
this.zoomLevel = this.modelData.zoomLevel;
|
22
26
|
}
|
23
27
|
onMouseMove(distance, _source) {
|
24
28
|
this.calculateNewModelState(distance);
|
@@ -30,7 +30,7 @@ export class RulerControl extends RulerBase {
|
|
30
30
|
this.rootElement.style.paddingTop = this.controls.firstLineIndent.heightOfProtrudingPart + "px";
|
31
31
|
}
|
32
32
|
updateModelState() {
|
33
|
-
this.currPageWidth = UnitConverter.twipsToPixelsF(this.modelData.inputPosition.getMergedSectionPropertiesRaw().pageSize.width);
|
33
|
+
this.currPageWidth = UnitConverter.twipsToPixelsF(this.modelData.inputPosition.getMergedSectionPropertiesRaw().pageSize.width) * this.modelData.zoomLevel;
|
34
34
|
}
|
35
35
|
updateView() {
|
36
36
|
if (this.prevPageWidth != this.currPageWidth) {
|
@@ -41,9 +41,13 @@ export class RulerControl extends RulerBase {
|
|
41
41
|
}
|
42
42
|
adjust() {
|
43
43
|
const viewWidth = this.controls.canvas.clientWidth;
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
if (viewWidth > this.pageWidth)
|
45
|
+
this.initialMarginLeftElement = (viewWidth - this.pageWidth - RULLER_NUMBER_CORRECTION * 2) / 2;
|
46
|
+
else {
|
47
|
+
const paddingLeft = DomUtils.pxToInt(DomUtils.getCurrentStyle(this.controls.canvas).paddingLeft);
|
48
|
+
const pageAreaBorderWidth = (this.controls.canvas.scrollWidth - paddingLeft - this.pageWidth) / 2;
|
49
|
+
this.initialMarginLeftElement = paddingLeft + pageAreaBorderWidth - RULLER_NUMBER_CORRECTION;
|
50
|
+
}
|
47
51
|
this.rootElement.style.left = this.calculateLeftOffset();
|
48
52
|
this.setPaddings();
|
49
53
|
this.canHandleScroll = this.controls.canvas.scrollWidth > this.controls.canvas.offsetWidth;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { TabAlign } from '../../../../model/paragraph/paragraph';
|
2
|
+
import { TabLeaderType } from '../../../../layout/main-structures/layout-boxes/layout-tab-space-box';
|
3
|
+
import { IZoomLevelHolder } from '../../../../interfaces/i-zoom-level-holder';
|
4
|
+
import { TabInfoBase } from '../../../../model/paragraph/paragraph-style';
|
5
|
+
export declare class RulerTabInfo extends TabInfoBase<RulerTabInfo> {
|
6
|
+
zoomLevelHolder: IZoomLevelHolder;
|
7
|
+
private zoomablePosition;
|
8
|
+
get position(): number;
|
9
|
+
set position(value: number);
|
10
|
+
get originalPosition(): number;
|
11
|
+
set originalPosition(value: number);
|
12
|
+
constructor(position: number, alignment: TabAlign, leader: TabLeaderType, deleted: boolean, isDefault: boolean, zoomLevelHolder: IZoomLevelHolder);
|
13
|
+
clone(): RulerTabInfo;
|
14
|
+
equals(obj: RulerTabInfo): boolean;
|
15
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { RulerValue } from '../zoomable-value';
|
2
|
+
import { TabInfoBase } from '../../../../model/paragraph/paragraph-style';
|
3
|
+
export class RulerTabInfo extends TabInfoBase {
|
4
|
+
get position() { return this.zoomablePosition.value; }
|
5
|
+
set position(value) { this.zoomablePosition.value = value; }
|
6
|
+
get originalPosition() { return this.zoomablePosition.originalValue; }
|
7
|
+
set originalPosition(value) { this.zoomablePosition.originalValue = value; }
|
8
|
+
constructor(position, alignment, leader, deleted, isDefault, zoomLevelHolder) {
|
9
|
+
super(alignment, leader, deleted, isDefault);
|
10
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
11
|
+
this.zoomablePosition = new RulerValue(position, zoomLevelHolder);
|
12
|
+
}
|
13
|
+
clone() {
|
14
|
+
return new RulerTabInfo(this.originalPosition, this.alignment, this.leader, this.deleted, this.isDefault, this.zoomLevelHolder);
|
15
|
+
}
|
16
|
+
equals(obj) {
|
17
|
+
return super.equals(obj) && this.originalPosition == obj.originalPosition;
|
18
|
+
}
|
19
|
+
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { TabAlign } from '../../../../model/paragraph/paragraph';
|
2
|
-
import { TabInfo } from '../../../../model/paragraph/paragraph-style';
|
3
2
|
import { RulerControls } from '../../manager';
|
4
3
|
import { RulerModelData } from '../../model-data';
|
5
4
|
import { RulerMultiControl } from '../owner';
|
6
5
|
import { RulerShadow } from '../shadow';
|
6
|
+
import { RulerTabInfo } from './tab-info';
|
7
7
|
export declare class RulerTabsControlState {
|
8
|
-
tabs:
|
8
|
+
tabs: RulerTabInfo[];
|
9
9
|
enabled: boolean;
|
10
|
-
constructor(tabs:
|
10
|
+
constructor(tabs: RulerTabInfo[], enabled: boolean);
|
11
11
|
clone(): RulerTabsControlState;
|
12
12
|
}
|
13
13
|
export declare class RulerTabViewState {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { EvtUtils } from '@devexpress/utils/lib/utils/evt';
|
2
2
|
import { TabLeaderType } from '../../../../layout/main-structures/layout-boxes/layout-tab-space-box';
|
3
3
|
import { TabAlign } from '../../../../model/paragraph/paragraph';
|
4
|
-
import { TabInfo } from '../../../../model/paragraph/paragraph-style';
|
5
4
|
import { MinMaxNumber } from '@devexpress/utils/lib/class/min-max';
|
6
5
|
import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
|
7
6
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
@@ -13,6 +12,7 @@ import { RulerMultiControl } from '../owner';
|
|
13
12
|
import { RulerShadow } from '../shadow';
|
14
13
|
import { RulerLineDisplayType, SnapTo } from '../vertical-line';
|
15
14
|
import { RulerTabUtils } from './utils';
|
15
|
+
import { RulerTabInfo } from './tab-info';
|
16
16
|
const RULLER_TABMARK_Y_POSITION = 6;
|
17
17
|
var TabAction;
|
18
18
|
(function (TabAction) {
|
@@ -27,7 +27,8 @@ export class RulerTabsControlState {
|
|
27
27
|
this.enabled = enabled;
|
28
28
|
}
|
29
29
|
clone() {
|
30
|
-
|
30
|
+
const clonedTabs = ListUtils.deepCopy(this.tabs);
|
31
|
+
return new RulerTabsControlState(clonedTabs, this.enabled);
|
31
32
|
}
|
32
33
|
}
|
33
34
|
export class RulerTabViewState {
|
@@ -54,9 +55,7 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
54
55
|
if (this.modelData.showTabs) {
|
55
56
|
const paragraph = this.modelData.selection.activeSubDocument.getParagraphByPosition(this.modelData.selection.intervalsInfo.interval.start);
|
56
57
|
const tabs = ListUtils.map(paragraph.getTabs().positions, tab => {
|
57
|
-
|
58
|
-
newTab.position = UnitConverter.twipsToPixelsF(tab.position);
|
59
|
-
return newTab;
|
58
|
+
return new RulerTabInfo(UnitConverter.twipsToPixelsF(tab.position), tab.alignment, tab.leader, tab.deleted, tab.isDefault, this.modelData);
|
60
59
|
});
|
61
60
|
return new RulerTabsControlState(tabs, true);
|
62
61
|
}
|
@@ -106,8 +105,8 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
106
105
|
if (this.isTabMarkZone(evt) && pos >= this.minPosition() && pos <= this.maxPosition()) {
|
107
106
|
this.tabAction = TabAction.Insert;
|
108
107
|
this.handleControlIndex = this.currModelState.tabs.length;
|
109
|
-
const tabPosition = this.controls.chooseClosestAnchorPosition(pos, [], new MinMaxNumber(this.minPosition(), this.maxPosition()));
|
110
|
-
this.newTab = new
|
108
|
+
const tabPosition = this.controls.chooseClosestAnchorPosition(pos, [], new MinMaxNumber(this.minPosition(), this.maxPosition())) / this.modelData.zoomLevel;
|
109
|
+
this.newTab = new RulerTabInfo(tabPosition, this.controls.tabTypeBox.align, TabLeaderType.None, false, false, this.modelData);
|
111
110
|
this.currModelState.tabs.push(this.newTab.clone());
|
112
111
|
this.updateView();
|
113
112
|
this.updatePresentation();
|
@@ -138,20 +137,20 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
138
137
|
else {
|
139
138
|
const tab = this.currModelState.tabs[this.handleControlIndex];
|
140
139
|
this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler)
|
141
|
-
.execute(this.modelData.commandManager.isPublicApiCall, { position: tab.
|
140
|
+
.execute(this.modelData.commandManager.isPublicApiCall, { position: tab.originalPosition, align: tab.alignment });
|
142
141
|
}
|
143
142
|
break;
|
144
143
|
}
|
145
144
|
case TabAction.Move: {
|
146
145
|
if (this.deleteTab) {
|
147
146
|
this.modelData.commandManager.getCommand(RichEditClientCommand.DeleteTabRuler)
|
148
|
-
.execute(this.modelData.commandManager.isPublicApiCall, this.prevModelState.tabs[this.handleControlIndex].
|
147
|
+
.execute(this.modelData.commandManager.isPublicApiCall, this.prevModelState.tabs[this.handleControlIndex].originalPosition);
|
149
148
|
}
|
150
149
|
else {
|
151
150
|
this.modelData.commandManager.getCommand(RichEditClientCommand.MoveTabRuler)
|
152
151
|
.execute(this.modelData.commandManager.isPublicApiCall, {
|
153
|
-
start: this.prevModelState.tabs[this.handleControlIndex].
|
154
|
-
end: this.currModelState.tabs[this.handleControlIndex].
|
152
|
+
start: this.prevModelState.tabs[this.handleControlIndex].originalPosition,
|
153
|
+
end: this.currModelState.tabs[this.handleControlIndex].originalPosition
|
155
154
|
});
|
156
155
|
}
|
157
156
|
break;
|
@@ -39,7 +39,7 @@ export class RulerTablesControl extends RulerMultiControl {
|
|
39
39
|
const state = this.modelData.commandManager.getCommand(RichEditClientCommand.RulerTableColumnSeparators).getState();
|
40
40
|
return state.enabled ?
|
41
41
|
new RulerTableModelState(state.value, state.value.tableIndex, state.enabled) :
|
42
|
-
new RulerTableModelState(new TableColumnSeparatorStruct(), -1, false);
|
42
|
+
new RulerTableModelState(new TableColumnSeparatorStruct(this.modelData), -1, false);
|
43
43
|
}
|
44
44
|
updateView() {
|
45
45
|
const offset = this.controls.leftMargin.currModelState.modelValue + this.controls.columns.currModelState.activeColumn.leftPos;
|
@@ -71,9 +71,10 @@ export class RulerTablesControl extends RulerMultiControl {
|
|
71
71
|
});
|
72
72
|
}
|
73
73
|
onMouseUp() {
|
74
|
-
const oldPos = this.prevModelState.columnSeparators.items[this.handleControlIndex].
|
75
|
-
const newPos = this.currModelState.columnSeparators.items[this.handleControlIndex].
|
76
|
-
const
|
74
|
+
const oldPos = this.prevModelState.columnSeparators.items[this.handleControlIndex].originalPosition;
|
75
|
+
const newPos = this.currModelState.columnSeparators.items[this.handleControlIndex].originalPosition;
|
76
|
+
const diffPos = newPos - oldPos;
|
77
|
+
const param = new RulerChangeTableColumnWidthCommandParameters(this.currModelState.tableIndex, diffPos, null, oldPos, true);
|
77
78
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerChangeTableColumnWidth)
|
78
79
|
.execute(this.modelData.commandManager.isPublicApiCall, param);
|
79
80
|
this.finishHandle();
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
2
2
|
import { DocumentRenderer } from '../../../canvas/renderes/common/document-renderer';
|
3
3
|
import { RULLER_NUMBER_CORRECTION } from '../settings';
|
4
|
-
import { SizeUtils } from '../../../../common/utils/size-utils';
|
5
4
|
export const TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME = " table";
|
6
5
|
export var SnapTo;
|
7
6
|
(function (SnapTo) {
|
@@ -34,7 +33,7 @@ export class RulerVerticalLineControl {
|
|
34
33
|
DomUtils.addClassName(this.rootElement, TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME);
|
35
34
|
else
|
36
35
|
DomUtils.removeClassName(this.rootElement, TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME);
|
37
|
-
this.rootElement.style.height =
|
36
|
+
this.rootElement.style.height = this.canvas.clientHeight + "px";
|
38
37
|
this.rootElement.style.top = this.canvas.offsetTop + "px";
|
39
38
|
this.rulerControlLeft = this.rulerControlElement.offsetLeft;
|
40
39
|
this.rulerControlWidth = this.rulerControlElement.offsetWidth;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { IZoomLevelHolder } from '../../../interfaces/i-zoom-level-holder';
|
2
|
+
export declare class RulerValue {
|
3
|
+
originalValue: number;
|
4
|
+
private zoomLevelHolder;
|
5
|
+
set value(value: number);
|
6
|
+
get value(): number;
|
7
|
+
constructor(originalValue: number, zoomLevelHolder: IZoomLevelHolder);
|
8
|
+
}
|