devexpress-richedit 24.1.12-build-25093-0104 → 24.1.12
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/dist/dx.richedit.js +159 -106
- package/dist/dx.richedit.min.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- 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/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 +1 -1
- package/lib/client/public/rich-edit.js +2 -2
- package/lib/common/canvas/canvas-manager.js +10 -4
- package/lib/common/canvas/renderes/common/document-renderer.js +10 -12
- package/lib/common/formats/i-document-exporter.d.ts +3 -0
- package/lib/common/input-controller.d.ts +5 -5
- package/lib/common/input-controller.js +12 -12
- package/lib/common/layout/document-layout.d.ts +3 -0
- package/lib/common/layout/document-layout.js +6 -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-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/states.js +0 -2
- package/lib/common/layout-formatter/row/tab-info.js +1 -1
- 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 +3 -2
- package/lib/common/utils/size-utils.d.ts +14 -7
- package/lib/common/utils/size-utils.js +43 -18
- package/package.json +3 -3
package/dist/dx.richedit.js
CHANGED
@@ -32115,6 +32115,14 @@ class LayoutPage extends rectangle.Rectangle {
|
|
32115
32115
|
this.anchoredObjectHolder = new PageAnchoredObjectHolder(this);
|
32116
32116
|
this.tableAnchoredObjectsHolder = new TableAnchoredObjectsHolder();
|
32117
32117
|
}
|
32118
|
+
get grids() {
|
32119
|
+
const result = new Map();
|
32120
|
+
for (let pageArea of this.mainSubDocumentPageAreas)
|
32121
|
+
pageArea.grids.forEach((grid, table) => result.set(table, grid));
|
32122
|
+
for (let pageArea of Object.values(this.otherPageAreas))
|
32123
|
+
pageArea.grids.forEach((grid, table) => result.set(table, grid));
|
32124
|
+
return result;
|
32125
|
+
}
|
32118
32126
|
setRenderLevelCalculator(anchorObjectsPositionInfo, compatibilityMode) {
|
32119
32127
|
this.renderLevelCalculator = new RenderLevelCalculator();
|
32120
32128
|
this.renderLevelCalculator.calcLevels(this.anchoredObjectHolder, anchorObjectsPositionInfo, compatibilityMode);
|
@@ -70460,6 +70468,12 @@ class DocumentLayout {
|
|
70460
70468
|
this.anchorObjectsPositionInfo = anchorObjectsPositionInfo;
|
70461
70469
|
this.setEmptyLayout(ColorHelper.NO_COLOR);
|
70462
70470
|
}
|
70471
|
+
get grids() {
|
70472
|
+
return this.pages.reduce((res, page) => {
|
70473
|
+
page.grids.forEach((grid, table) => res.set(table, grid));
|
70474
|
+
return res;
|
70475
|
+
}, new Map());
|
70476
|
+
}
|
70463
70477
|
setEmptyLayout(pageColor) {
|
70464
70478
|
this.pages = [];
|
70465
70479
|
this.validPageCount = 0;
|
@@ -81456,10 +81470,12 @@ class ParagraphSpacingDestination extends ParagraphFormattingLeafElementDestinat
|
|
81456
81470
|
const spacingBefore = this.data.readerHelper.getWpSTIntegerValue(reader, 'before', constants.Constants.MIN_SAFE_INTEGER);
|
81457
81471
|
if (spacingBefore >= 0)
|
81458
81472
|
this.paragraphProperties.setValue(ParagraphPropertyDescriptor.spacingBefore, spacingBefore);
|
81459
|
-
this.
|
81460
|
-
|
81461
|
-
|
81462
|
-
|
81473
|
+
const beforeAutoSpacing = this.data.readerHelper.getWpSTOnOffValue(reader, 'beforeAutospacing', null);
|
81474
|
+
if (spacingBefore == -1 || beforeAutoSpacing != null)
|
81475
|
+
this.paragraphProperties.setValue(ParagraphPropertyDescriptor.beforeAutoSpacing, spacingBefore == -1 || beforeAutoSpacing);
|
81476
|
+
const afterAutoSpacing = this.data.readerHelper.getWpSTOnOffValue(reader, 'afterAutospacing', null);
|
81477
|
+
if (spacingAfter == -1 || afterAutoSpacing != null)
|
81478
|
+
this.paragraphProperties.setValue(ParagraphPropertyDescriptor.afterAutoSpacing, spacingAfter == -1 || afterAutoSpacing);
|
81463
81479
|
const lineSpacing = this.data.readerHelper.getWpSTIntegerValue(reader, 'line', constants.Constants.MIN_SAFE_INTEGER);
|
81464
81480
|
if (lineSpacing != constants.Constants.MIN_SAFE_INTEGER && lineSpacing > 0) {
|
81465
81481
|
const attribute = new WordProcessingMLValue('lineRule', 'line-rule');
|
@@ -90299,6 +90315,7 @@ class EffectExtent {
|
|
90299
90315
|
|
90300
90316
|
|
90301
90317
|
|
90318
|
+
|
90302
90319
|
class TableExporter extends BaseExporter {
|
90303
90320
|
constructor() {
|
90304
90321
|
super(...arguments);
|
@@ -90328,10 +90345,9 @@ class TableExporter extends BaseExporter {
|
|
90328
90345
|
}
|
90329
90346
|
}
|
90330
90347
|
getTableGrid(table) {
|
90331
|
-
|
90332
|
-
|
90333
|
-
|
90334
|
-
return colGrid;
|
90348
|
+
var _a, _b;
|
90349
|
+
const grid = this.data.grids.get(table);
|
90350
|
+
return ((_b = (_a = grid === null || grid === void 0 ? void 0 : grid.columns) === null || _a === void 0 ? void 0 : _a.width) === null || _b === void 0 ? void 0 : _b.map(unit_converter/* UnitConverter */.u.pixelsToTwips)) || [];
|
90335
90351
|
}
|
90336
90352
|
initNewTables(newIndexes, allowInitNextTable) {
|
90337
90353
|
for (let levelIndex = this.tableIndexes.length; levelIndex < newIndexes.length; levelIndex++) {
|
@@ -90836,11 +90852,12 @@ class IdGenerator {
|
|
90836
90852
|
|
90837
90853
|
|
90838
90854
|
class data_Data {
|
90839
|
-
constructor(
|
90855
|
+
constructor(exportModelOptions, options) {
|
90840
90856
|
this.drawingElementId = 1;
|
90841
90857
|
this.exportSubDocumentsList = [];
|
90842
90858
|
this.relationExporters = [];
|
90843
|
-
this.model = model;
|
90859
|
+
this.model = exportModelOptions.modelManager.model;
|
90860
|
+
this.grids = exportModelOptions.grids;
|
90844
90861
|
this.options = options;
|
90845
90862
|
this.constants = new DocxConstants();
|
90846
90863
|
this.writerStack = new stack/* Stack */.K();
|
@@ -91629,10 +91646,10 @@ class EndNoteExporter extends NoteExporter {
|
|
91629
91646
|
|
91630
91647
|
|
91631
91648
|
class DocxExporter {
|
91632
|
-
constructor(
|
91633
|
-
this.modelManipulator = modelManipulator;
|
91649
|
+
constructor(exportModelOptions, options) {
|
91650
|
+
this.modelManipulator = exportModelOptions.modelManager.modelManipulator;
|
91634
91651
|
this.options = options;
|
91635
|
-
this.data = new data_Data(
|
91652
|
+
this.data = new data_Data(exportModelOptions, options);
|
91636
91653
|
}
|
91637
91654
|
exportToBlob(callback) {
|
91638
91655
|
this.modelManipulator.picture.loader.ensureAllPicturesLoaded(this.options.ensurePictureLoadedTimeout, (_loaded) => {
|
@@ -91739,7 +91756,7 @@ function exportModelToBlob(exportModelOptions, callback) {
|
|
91739
91756
|
function getExporter(exportModelOptions) {
|
91740
91757
|
const { modelManipulator } = exportModelOptions.modelManager;
|
91741
91758
|
switch (exportModelOptions.documentFormat) {
|
91742
|
-
case DocumentFormat.OpenXml: return new DocxExporter(
|
91759
|
+
case DocumentFormat.OpenXml: return new DocxExporter(exportModelOptions, new DocxExportOptions());
|
91743
91760
|
case DocumentFormat.Rtf: return new RtfExporter(modelManipulator, new RtfDocumentExporterOptions());
|
91744
91761
|
case DocumentFormat.PlainText: return new TxtExporter(modelManipulator, new DocumentExporterOptions());
|
91745
91762
|
case DocumentFormat.Html: return new HtmlDocumentExporter(exportModelOptions, new DocumentExporterOptions());
|
@@ -92251,7 +92268,7 @@ class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositionCalcu
|
|
92251
92268
|
alignment(type, alignment) {
|
92252
92269
|
switch (type) {
|
92253
92270
|
case AnchorObjectHorizontalPositionType.Character:
|
92254
|
-
return this.getAlignPosition(alignment, 0);
|
92271
|
+
return this.getAnchorXPosition() + this.getAlignPosition(alignment, 0);
|
92255
92272
|
case AnchorObjectHorizontalPositionType.Column:
|
92256
92273
|
return this.isRelativeCell ?
|
92257
92274
|
this.relativeColumnPos() + this.lp.row.tableCellInfo.x +
|
@@ -92300,17 +92317,8 @@ class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositionCalcu
|
|
92300
92317
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x : 0;
|
92301
92318
|
case AnchorObjectHorizontalPositionType.Column:
|
92302
92319
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin : this.relativeColumnPos();
|
92303
|
-
case AnchorObjectHorizontalPositionType.Character:
|
92304
|
-
|
92305
|
-
const ancBoxAbsPos = this.obj.rowOffset;
|
92306
|
-
const boxIndex = search.SearchUtils.normedInterpolationIndexOf(this.lp.row.boxes, (box) => rowAbsPos + box.rowOffset, ancBoxAbsPos);
|
92307
|
-
const box = this.lp.row.boxes[boxIndex];
|
92308
|
-
if (!box)
|
92309
|
-
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row);
|
92310
|
-
const symbolCount = Math.max(0, ancBoxAbsPos - rowAbsPos - box.rowOffset);
|
92311
|
-
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row) + box.x +
|
92312
|
-
box.getCharOffsetXInPixels(this.manager.measurer, symbolCount);
|
92313
|
-
}
|
92320
|
+
case AnchorObjectHorizontalPositionType.Character:
|
92321
|
+
return this.getAnchorXPosition();
|
92314
92322
|
case AnchorObjectHorizontalPositionType.Margin:
|
92315
92323
|
return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin :
|
92316
92324
|
this.manager.boundsCalculator.marginLeft;
|
@@ -92327,6 +92335,19 @@ class AnchorObjectHorizontalPositionCalculator extends AnchorObjectPositionCalcu
|
|
92327
92335
|
throw new Error(errors/* Errors */.D.InternalException);
|
92328
92336
|
}
|
92329
92337
|
}
|
92338
|
+
getAnchorXPosition() {
|
92339
|
+
const rowAbsPos = this.lp.getLogPosition(DocumentLayoutDetailsLevel.Row);
|
92340
|
+
const ancBoxAbsPos = this.obj.rowOffset;
|
92341
|
+
let boxIndex = search.SearchUtils.normedInterpolationIndexOf(this.lp.row.boxes, (box) => rowAbsPos + box.rowOffset, ancBoxAbsPos);
|
92342
|
+
if (boxIndex < 0)
|
92343
|
+
boxIndex = 0;
|
92344
|
+
const box = this.lp.row.boxes[boxIndex];
|
92345
|
+
if (!box)
|
92346
|
+
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row);
|
92347
|
+
const symbolCount = Math.max(0, ancBoxAbsPos - rowAbsPos - box.rowOffset);
|
92348
|
+
return this.lp.getLayoutX(null, DocumentLayoutDetailsLevel.Row) + box.x +
|
92349
|
+
box.getCharOffsetXInPixels(this.manager.measurer, symbolCount);
|
92350
|
+
}
|
92330
92351
|
bookLayout() {
|
92331
92352
|
return this.alignment(this.anchorInfo.horizontalPositionType, AnchorObjectHorizontalPositionCalculator.mapBookLayoutALignmentType[this.anchorInfo.horizontalPositionAlignment]);
|
92332
92353
|
}
|
@@ -92557,6 +92578,12 @@ class LayoutPageArea extends rectangle.Rectangle {
|
|
92557
92578
|
this.columns = [];
|
92558
92579
|
this.subDocument = subDocument;
|
92559
92580
|
}
|
92581
|
+
get grids() {
|
92582
|
+
return this.columns.reduce((res, column) => {
|
92583
|
+
column.tablesInfo.forEach(tableInfo => res.set(tableInfo.logicInfo.grid.table, tableInfo.logicInfo.grid));
|
92584
|
+
return res;
|
92585
|
+
}, new Map());
|
92586
|
+
}
|
92560
92587
|
getEndPosition() {
|
92561
92588
|
return this.pageOffset + utils_list.ListUtils.last(this.columns).getEndPosition();
|
92562
92589
|
}
|
@@ -95400,8 +95427,6 @@ class RowBaseFormatterState {
|
|
95400
95427
|
this.rowFormatter.finishRow();
|
95401
95428
|
}
|
95402
95429
|
addAnchorObject() {
|
95403
|
-
if (!this.rowFormatter.wordHolder.pushBoxes())
|
95404
|
-
return;
|
95405
95430
|
this.rowFormatter.addAnchorObject();
|
95406
95431
|
}
|
95407
95432
|
addTextBox() {
|
@@ -95579,7 +95604,7 @@ class RowTabInfo {
|
|
95579
95604
|
const lastInterval = utils_list.ListUtils.last(this.rowFormatter.rowSizesManager.rowFormattingInfo.intervals);
|
95580
95605
|
if (tabXPosRelativePage > lastInterval.end) {
|
95581
95606
|
if (lastInterval.end < this.rowFormatter.paragraphHorizontalBounds.end) {
|
95582
|
-
if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013) {
|
95607
|
+
if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013 && tabPosition !== null) {
|
95583
95608
|
this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER - this.currInterval.busyWidth;
|
95584
95609
|
this.currInterval.length = Number.MAX_SAFE_INTEGER;
|
95585
95610
|
this.row.width = Number.MAX_SAFE_INTEGER;
|
@@ -102164,18 +102189,16 @@ class SimpleViewCanvasSizeManager {
|
|
102164
102189
|
this.sizeUpdated = true;
|
102165
102190
|
}
|
102166
102191
|
changeSizeCore() {
|
102167
|
-
|
102168
|
-
|
102169
|
-
|
102170
|
-
|
102171
|
-
|
102172
|
-
|
102173
|
-
this.control.selection.
|
102174
|
-
.setModelPosition(this.control.selection.lastSelectedInterval.start).useStdRelativePosition().useStdOffset());
|
102175
|
-
}
|
102176
|
-
this.control.owner.adjustControl();
|
102177
|
-
this.control.horizontalRulerControl.update();
|
102192
|
+
utils_list.ListUtils.forEach(this.control.viewManager.cache, (_val) => this.control.viewManager.renderer.removePage(1), 1);
|
102193
|
+
this.control.viewManager.ensureFirstPageIsRendered();
|
102194
|
+
this.control.innerClientProperties.viewsSettings.widthOfPage = this.canvasManager.getCanvasWidth();
|
102195
|
+
if (this.control.layoutFormatterManager) {
|
102196
|
+
this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
|
102197
|
+
this.control.selection.scrollManager.setScroll(new ScrollState().byModelPosition(this.control.selection)
|
102198
|
+
.setModelPosition(this.control.selection.lastSelectedInterval.start).useStdRelativePosition().useStdOffset());
|
102178
102199
|
}
|
102200
|
+
this.control.owner.adjustControl();
|
102201
|
+
this.control.horizontalRulerControl.update();
|
102179
102202
|
}
|
102180
102203
|
}
|
102181
102204
|
class DocumentRenderer {
|
@@ -102359,7 +102382,7 @@ class DocumentRenderer {
|
|
102359
102382
|
}
|
102360
102383
|
}
|
102361
102384
|
updatePageSize(page, pageElement) {
|
102362
|
-
if (pageElement.offsetHeight != page.height || pageElement.offsetWidth != page.width)
|
102385
|
+
if (pageElement.offsetHeight != Math.round(page.height) || pageElement.offsetWidth != Math.round(page.width))
|
102363
102386
|
dom.DomUtils.setStyleSize(pageElement.style, page);
|
102364
102387
|
}
|
102365
102388
|
updatePageClasses(pageElement) {
|
@@ -106213,40 +106236,31 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
106213
106236
|
this.processMouseDownOnMaxDetailsLevel(evt, htr, activeSubDocument);
|
106214
106237
|
}
|
106215
106238
|
processMouseDownOnMaxDetailsLevel(evt, htr, activeSubDocument) {
|
106239
|
+
const selection = this.handler.control.selection;
|
106216
106240
|
if (htr.floatingObject) {
|
106217
|
-
if (htr.floatingObject.belongsToSubDocId != this.handler.control.selection.activeSubDocument.id)
|
106218
|
-
MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
|
106219
106241
|
const box = htr.floatingObject;
|
106220
|
-
|
106221
|
-
|
106222
|
-
|
106223
|
-
if (
|
106224
|
-
HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, activeSubDocument.isTextBox() ? 0 : box.rotationInRadians)) {
|
106242
|
+
const rotationAngle = activeSubDocument.isTextBox() ? 0 : box.rotationInRadians;
|
106243
|
+
if (box.getType() == LayoutBoxType.AnchorTextBox && HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, rotationAngle)) {
|
106244
|
+
const textbox = box;
|
106245
|
+
if (textbox.internalSubDocId !== selection.activeSubDocument.id && this.selectFloatingObject(box)) {
|
106225
106246
|
this.handler.control.commandManager.getCommand(RichEditClientCommand.ChangeActiveSubDocumentToTextBox).execute(this.handler.control.commandManager.isPublicApiCall);
|
106226
106247
|
this.handler.boxVisualizerManager.resizeBoxVisualizer.show(htr.pageIndex, null, null, null, box);
|
106227
|
-
htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, DocumentLayoutDetailsLevel.Max,
|
106228
|
-
}
|
106229
|
-
else {
|
106230
|
-
if (this.resizeRotationChecker(() => {
|
106231
|
-
const dragFloatingObjectState = new MouseHandlerDragFloatingObjectState(this.handler, evt);
|
106232
|
-
this.handler.switchState(new MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, dragFloatingObjectState));
|
106233
|
-
}))
|
106234
|
-
return;
|
106235
|
-
else {
|
106236
|
-
if (specRunInfo.isPictureSelected()) {
|
106237
|
-
this.handler.control.selection.setSelection(new SetSelectionParams()
|
106238
|
-
.setInterval(new fixed.FixedInterval(specRunInfo.getPicturePosition(), 1)));
|
106239
|
-
return;
|
106240
|
-
}
|
106241
|
-
}
|
106248
|
+
htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, DocumentLayoutDetailsLevel.Max, selection.activeSubDocument);
|
106242
106249
|
}
|
106243
106250
|
}
|
106251
|
+
else {
|
106252
|
+
if (this.selectFloatingObject(box) && this.resizeRotationChecker(() => {
|
106253
|
+
const dragFloatingObjectState = new MouseHandlerDragFloatingObjectState(this.handler, evt);
|
106254
|
+
this.handler.switchState(new MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, dragFloatingObjectState));
|
106255
|
+
}))
|
106256
|
+
return;
|
106257
|
+
}
|
106244
106258
|
}
|
106245
106259
|
if (browser.Browser.TouchUI && htr.subDocument.isMain() && htr.exactlyDetailLevel < DocumentLayoutDetailsLevel.PageArea) {
|
106246
106260
|
if (htr.deviations[DocumentLayoutDetailsLevel.PageArea] & rectangle.HitTestDeviation.Top || htr.deviations[DocumentLayoutDetailsLevel.PageArea] & rectangle.HitTestDeviation.Bottom)
|
106247
106261
|
this.handler.control.viewManager.canvasScrollManager.waitForDblClick();
|
106248
106262
|
}
|
106249
|
-
if (evt.button === MouseButton.Right &&
|
106263
|
+
if (evt.button === MouseButton.Right && selection.lastSelectedInterval.contains(htr.getPosition()))
|
106250
106264
|
return;
|
106251
106265
|
if (this.shouldSelectEntireTableColumn(htr))
|
106252
106266
|
this.beginSelectEntireTableColumn(htr, evt);
|
@@ -106261,7 +106275,7 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
106261
106275
|
this.beginSelectEntireTableCell(htr, evt);
|
106262
106276
|
}
|
106263
106277
|
else if (this.isLeftArea(htr, evt)) {
|
106264
|
-
if (evt.modifiers & key/* ModifierKey */.tx.Ctrl &&
|
106278
|
+
if (evt.modifiers & key/* ModifierKey */.tx.Ctrl && selection.isCollapsed())
|
106265
106279
|
this.handler.control.commandManager.getCommand(RichEditClientCommand.SelectAll).execute(this.handler.control.commandManager.isPublicApiCall, htr.getPosition());
|
106266
106280
|
else if (this.isLeftAreaOffset(htr, evt))
|
106267
106281
|
this.beginLineSelection(htr, evt);
|
@@ -106469,8 +106483,14 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
106469
106483
|
this.handler.switchState(state);
|
106470
106484
|
}
|
106471
106485
|
selectFloatingObject(box) {
|
106486
|
+
const selection = this.handler.control.selection;
|
106487
|
+
if (box.belongsToSubDocId !== selection.activeSubDocument.id)
|
106488
|
+
MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
|
106489
|
+
if (box.belongsToSubDocId !== selection.activeSubDocument.id)
|
106490
|
+
return false;
|
106472
106491
|
const pos = this.handler.control.layout.anchorObjectsPositionInfo.getPosition(box.objectId);
|
106473
|
-
|
106492
|
+
selection.setSelection(new SetSelectionParams().setInterval(new fixed.FixedInterval(pos, 1)));
|
106493
|
+
return selection.specialRunInfo.isSelectedAnchorObject;
|
106474
106494
|
}
|
106475
106495
|
}
|
106476
106496
|
class MouseHandlerHelper {
|
@@ -107643,31 +107663,56 @@ ResizeBoxListener.directionToSource = {
|
|
107643
107663
|
};
|
107644
107664
|
|
107645
107665
|
;// CONCATENATED MODULE: ./src/common/utils/size-utils.ts
|
107666
|
+
|
107646
107667
|
class SizeUtils {
|
107668
|
+
static getScrollbarsWidth() {
|
107669
|
+
if (!(0,common.isDefined)(this._scrollbarsWidth)) {
|
107670
|
+
const scrollDiv = document.createElement('div');
|
107671
|
+
scrollDiv.style.visibility = 'hidden';
|
107672
|
+
scrollDiv.style.overflow = 'scroll';
|
107673
|
+
scrollDiv.style.position = 'absolute';
|
107674
|
+
scrollDiv.style.top = '-9999px';
|
107675
|
+
scrollDiv.style.width = '100px';
|
107676
|
+
scrollDiv.style.height = '100px';
|
107677
|
+
document.body.appendChild(scrollDiv);
|
107678
|
+
const innerDiv = document.createElement('div');
|
107679
|
+
innerDiv.style.width = '100%';
|
107680
|
+
innerDiv.style.height = '100%';
|
107681
|
+
scrollDiv.appendChild(innerDiv);
|
107682
|
+
this._scrollbarsWidth = {
|
107683
|
+
horizontal: SizeUtils.getOffsetHeight(scrollDiv) - SizeUtils.getOffsetHeight(innerDiv),
|
107684
|
+
vertical: SizeUtils.getOffsetWidth(scrollDiv) - SizeUtils.getOffsetWidth(innerDiv)
|
107685
|
+
};
|
107686
|
+
scrollDiv.remove();
|
107687
|
+
}
|
107688
|
+
return this._scrollbarsWidth;
|
107689
|
+
}
|
107647
107690
|
static getWidthInfo(element) {
|
107648
|
-
const
|
107649
|
-
const
|
107650
|
-
const
|
107651
|
-
|
107652
|
-
|
107653
|
-
|
107654
|
-
|
107655
|
-
|
107656
|
-
|
107691
|
+
const computedStyle = getComputedStyle(element);
|
107692
|
+
const offsetWidth = this.getOffsetWidth(element);
|
107693
|
+
const offsetWidthWithoutBorder = offsetWidth
|
107694
|
+
- parseCssValue(computedStyle.borderLeftWidth)
|
107695
|
+
- parseCssValue(computedStyle.borderRightWidth);
|
107696
|
+
let scrollbarWidth = 0;
|
107697
|
+
if (Math.round(offsetWidthWithoutBorder) > element.clientWidth)
|
107698
|
+
scrollbarWidth = SizeUtils.getScrollbarsWidth().vertical;
|
107699
|
+
const clientWidth = offsetWidthWithoutBorder - scrollbarWidth;
|
107700
|
+
return new DimensionInfo(offsetWidth, clientWidth, scrollbarWidth);
|
107657
107701
|
}
|
107658
107702
|
static getClientWidth(element) {
|
107659
107703
|
return this.getWidthInfo(element).clientSize;
|
107660
107704
|
}
|
107661
107705
|
static getHeightInfo(element) {
|
107662
|
-
const
|
107663
|
-
const
|
107664
|
-
const
|
107665
|
-
|
107666
|
-
|
107667
|
-
|
107668
|
-
|
107669
|
-
|
107670
|
-
|
107706
|
+
const computedStyle = getComputedStyle(element);
|
107707
|
+
const offsetHeight = this.getOffsetHeight(element);
|
107708
|
+
const offsetHeightWithoutBorder = offsetHeight
|
107709
|
+
- parseCssValue(computedStyle.borderTopWidth)
|
107710
|
+
- parseCssValue(computedStyle.borderBottomWidth);
|
107711
|
+
let scrollbarWidth = 0;
|
107712
|
+
if (Math.round(offsetHeightWithoutBorder) > element.clientHeight)
|
107713
|
+
scrollbarWidth = SizeUtils.getScrollbarsWidth().horizontal;
|
107714
|
+
const clientHeight = offsetHeightWithoutBorder - scrollbarWidth;
|
107715
|
+
return new DimensionInfo(offsetHeight, clientHeight, scrollbarWidth);
|
107671
107716
|
}
|
107672
107717
|
static getClientHeight(element) {
|
107673
107718
|
return this.getHeightInfo(element).clientSize;
|
@@ -108014,17 +108059,23 @@ class CanvasManager extends batch_updatable/* BatchUpdatableObject */.IS {
|
|
108014
108059
|
onScrollIntervalTick() {
|
108015
108060
|
const evtX = this.lastMousePosition.x;
|
108016
108061
|
const evtY = this.lastMousePosition.y;
|
108017
|
-
const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(
|
108018
|
-
const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(
|
108062
|
+
const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false);
|
108063
|
+
const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false);
|
108019
108064
|
if (!inHorizontalArea && !inVerticalArea)
|
108020
108065
|
return;
|
108066
|
+
const yOffsetWithoutScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false) - evtY;
|
108067
|
+
const yOffsetWithScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY;
|
108068
|
+
const outsideHorizontalScrollbar = yOffsetWithoutScrollbar > 0 || yOffsetWithScrollbar < 0;
|
108021
108069
|
if (inHorizontalArea && evtY - this.canvasPosition.y <= AUTOSCROLL_AREA_SIZE)
|
108022
108070
|
this.viewManager.canvas.scrollTop -= AUTOSCROLL_STEP;
|
108023
|
-
else if (inHorizontalArea &&
|
108071
|
+
else if (inHorizontalArea && yOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideHorizontalScrollbar)
|
108024
108072
|
this.viewManager.canvas.scrollTop += AUTOSCROLL_STEP;
|
108073
|
+
const xOffsetWithoutScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false) - evtX;
|
108074
|
+
const xOffsetWithScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX;
|
108075
|
+
const outsideVerticalScrollbar = xOffsetWithoutScrollbar > 0 || xOffsetWithScrollbar < 0;
|
108025
108076
|
if (inVerticalArea && evtX - this.canvasPosition.x <= AUTOSCROLL_AREA_SIZE)
|
108026
108077
|
this.viewManager.canvas.scrollLeft -= AUTOSCROLL_STEP;
|
108027
|
-
else if (inVerticalArea &&
|
108078
|
+
else if (inVerticalArea && xOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideVerticalScrollbar)
|
108028
108079
|
this.viewManager.canvas.scrollLeft += AUTOSCROLL_STEP;
|
108029
108080
|
}
|
108030
108081
|
static getCursorClassName(pointer) {
|
@@ -110314,17 +110365,17 @@ class InputEditorBase {
|
|
110314
110365
|
clearTimeout(this.onKeyUpTimerId);
|
110315
110366
|
}
|
110316
110367
|
initialize() {
|
110317
|
-
this.
|
110368
|
+
this.initializeEditableState();
|
110318
110369
|
this.initEvents();
|
110319
110370
|
this.prevKeyCode = EMPTY_KEYCODE;
|
110320
110371
|
}
|
110321
|
-
|
110322
|
-
if (
|
110323
|
-
this.
|
110324
|
-
this.
|
110372
|
+
initializeEditableState() {
|
110373
|
+
if (!this.editableStateInitialized) {
|
110374
|
+
this.editableStateInitialized = true;
|
110375
|
+
this.initializeEditableStateCore();
|
110325
110376
|
}
|
110326
110377
|
}
|
110327
|
-
|
110378
|
+
initializeEditableStateCore() {
|
110328
110379
|
}
|
110329
110380
|
initEvents() {
|
110330
110381
|
this.evtHandlersHolder.addListener(this.getEditableDocument(), "keydown", this.onKeyDown.bind(this));
|
@@ -110544,8 +110595,8 @@ class DivInputEditor extends InputEditorBase {
|
|
110544
110595
|
clearTimeout(this.composEndTimerId);
|
110545
110596
|
clearTimeout(this.onTextInputTimerId);
|
110546
110597
|
}
|
110547
|
-
|
110548
|
-
this.inputElement.contentEditable =
|
110598
|
+
initializeEditableStateCore() {
|
110599
|
+
this.inputElement.contentEditable = String(!this.control.isReadOnlyPersistent);
|
110549
110600
|
this.clearInputElement();
|
110550
110601
|
}
|
110551
110602
|
setPosition(left, top) {
|
@@ -110793,11 +110844,11 @@ class IFrameInputEditor extends InputEditorBase {
|
|
110793
110844
|
body.style.margin = "0px";
|
110794
110845
|
body.style.overflow = "hidden";
|
110795
110846
|
}
|
110796
|
-
|
110847
|
+
initializeEditableStateCore() {
|
110797
110848
|
if (browser.Browser.WebKitFamily)
|
110798
|
-
this.editableDocument.body.setAttribute("contenteditable",
|
110849
|
+
this.editableDocument.body.setAttribute("contenteditable", String(!this.control.isReadOnlyPersistent));
|
110799
110850
|
else
|
110800
|
-
this.editableDocument.designMode = "on";
|
110851
|
+
this.editableDocument.designMode = this.control.isReadOnlyPersistent ? "off" : "on";
|
110801
110852
|
}
|
110802
110853
|
createInputElement() {
|
110803
110854
|
const element = document.createElement("IFRAME");
|
@@ -110936,7 +110987,7 @@ class IFrameInputEditor extends InputEditorBase {
|
|
110936
110987
|
recreateIfNeeded() {
|
110937
110988
|
const iframeDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
|
110938
110989
|
if (!iframeDocument.body.hasAttribute("loaded")) {
|
110939
|
-
this.
|
110990
|
+
this.editableStateInitialized = false;
|
110940
110991
|
this.createHierarchyCore();
|
110941
110992
|
this.initialize();
|
110942
110993
|
}
|
@@ -115242,7 +115293,7 @@ class RichEditCore {
|
|
115242
115293
|
this.invalidateLayoutAfterFontsLoaded();
|
115243
115294
|
});
|
115244
115295
|
}
|
115245
|
-
get isReadOnlyPersistent() { return this.readOnly
|
115296
|
+
get isReadOnlyPersistent() { return this.readOnly === ReadOnlyMode.Persistent; }
|
115246
115297
|
get model() { return this.modelManager.model; }
|
115247
115298
|
get isDisposed() {
|
115248
115299
|
return this._isDisposed;
|
@@ -115406,8 +115457,8 @@ class RichEditCore {
|
|
115406
115457
|
this.readOnly = ReadOnlyMode.Persistent;
|
115407
115458
|
else if (!readOnly && this.readOnly === ReadOnlyMode.Persistent) {
|
115408
115459
|
this.readOnly = ReadOnlyMode.None;
|
115409
|
-
this.inputController.inputEditor.initializeIfNotReadOnly();
|
115410
115460
|
}
|
115461
|
+
this.inputController.inputEditor.initializeEditableStateCore();
|
115411
115462
|
}
|
115412
115463
|
setWorkSession(sessionGuid, documentInfo) {
|
115413
115464
|
this.sessionGuid = sessionGuid;
|
@@ -115533,6 +115584,7 @@ class RichEditCore {
|
|
115533
115584
|
pictureRenderer: this.viewManager.renderer,
|
115534
115585
|
uiUnitConverter: this.uiUnitConverter,
|
115535
115586
|
lastMaxNumPages: this.layout.lastMaxNumPages,
|
115587
|
+
grids: this.layout.grids,
|
115536
115588
|
pageIndex: this.selection.pageIndex,
|
115537
115589
|
sessionGuid: this.sessionGuid,
|
115538
115590
|
clientGuid: this.clientGuid,
|
@@ -136878,7 +136930,8 @@ class MailMergeCommand extends CommandBase {
|
|
136878
136930
|
return true;
|
136879
136931
|
}
|
136880
136932
|
executeCore(_state, options) {
|
136881
|
-
const
|
136933
|
+
const exportModelOptions = this.control.getExportModelOptions();
|
136934
|
+
const docxExporter = new DocxExporter(exportModelOptions, new DocxExportOptions());
|
136882
136935
|
docxExporter.exportToBlob((blob) => {
|
136883
136936
|
const docxImporter = new Importer(new ImporterOptions());
|
136884
136937
|
docxImporter.importFromFile(blob, this.control.modelManager.richOptions, (documentModel, formatImagesImporter) => {
|
@@ -141647,7 +141700,7 @@ class ClientRichEdit {
|
|
141647
141700
|
this.contextMenuSettings = settings.contextMenuSettings;
|
141648
141701
|
this.fullScreenHelper = new FullScreenHelper(element);
|
141649
141702
|
if (true)
|
141650
|
-
external_DevExpress_config_default()(JSON.parse(atob('
|
141703
|
+
external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVREZzBkbWxZYUZOS1MyWnRRams0U0VOTVkxTTRNaUlLZlE9PS53SkN1UVJhY3dIaU9DMEdWZFBPVlNacDJsRThrcTdTbUZTTWpIMXgvamxEMnowbzQvYWFkVm9zK1g2ZzlwSDZaYjdUUXdOdlZvQkduRUNwblB2M0ZaOUV4eWlkK3pybUxITE8yZnIyVzFTOEJOWE1YaE1mSlNPdjJ3aCs5SDBSd2lMejJxUT09In0=')));
|
141651
141704
|
this.prepareElement(element, settings);
|
141652
141705
|
this.initDefaultFontsAndStyles();
|
141653
141706
|
this.initBars(settings.ribbon, settings.fonts);
|
@@ -144094,11 +144147,11 @@ class RichEditPublic {
|
|
144094
144147
|
command.execute(true, type);
|
144095
144148
|
}
|
144096
144149
|
get readOnly() {
|
144097
|
-
return this._native.core.readOnly
|
144150
|
+
return this._native.core.readOnly === ReadOnlyMode.Persistent;
|
144098
144151
|
}
|
144099
144152
|
set readOnly(value) {
|
144100
144153
|
if (this.readOnly != value) {
|
144101
|
-
this._native.core.
|
144154
|
+
this._native.core.setPersistentReadOnly(value);
|
144102
144155
|
this._native.core.barHolder.updateItemsState();
|
144103
144156
|
this._native.core.horizontalRulerControl.update();
|
144104
144157
|
this._native.core.beginUpdate();
|