devexpress-richedit 24.1.12-build-25093-0104 → 24.1.12-build-25107-0103

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.
@@ -95579,7 +95579,7 @@ class RowTabInfo {
95579
95579
  const lastInterval = utils_list.ListUtils.last(this.rowFormatter.rowSizesManager.rowFormattingInfo.intervals);
95580
95580
  if (tabXPosRelativePage > lastInterval.end) {
95581
95581
  if (lastInterval.end < this.rowFormatter.paragraphHorizontalBounds.end) {
95582
- if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013) {
95582
+ if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013 && tabPosition !== null) {
95583
95583
  this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER - this.currInterval.busyWidth;
95584
95584
  this.currInterval.length = Number.MAX_SAFE_INTEGER;
95585
95585
  this.row.width = Number.MAX_SAFE_INTEGER;
@@ -102164,18 +102164,16 @@ class SimpleViewCanvasSizeManager {
102164
102164
  this.sizeUpdated = true;
102165
102165
  }
102166
102166
  changeSizeCore() {
102167
- {
102168
- utils_list.ListUtils.forEach(this.control.viewManager.cache, (_val) => this.control.viewManager.renderer.removePage(1), 1);
102169
- this.control.viewManager.ensureFirstPageIsRendered();
102170
- this.control.innerClientProperties.viewsSettings.widthOfPage = this.canvasManager.getCanvasWidth();
102171
- if (this.control.layoutFormatterManager) {
102172
- this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
102173
- this.control.selection.scrollManager.setScroll(new ScrollState().byModelPosition(this.control.selection)
102174
- .setModelPosition(this.control.selection.lastSelectedInterval.start).useStdRelativePosition().useStdOffset());
102175
- }
102176
- this.control.owner.adjustControl();
102177
- this.control.horizontalRulerControl.update();
102167
+ utils_list.ListUtils.forEach(this.control.viewManager.cache, (_val) => this.control.viewManager.renderer.removePage(1), 1);
102168
+ this.control.viewManager.ensureFirstPageIsRendered();
102169
+ this.control.innerClientProperties.viewsSettings.widthOfPage = this.canvasManager.getCanvasWidth();
102170
+ if (this.control.layoutFormatterManager) {
102171
+ this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
102172
+ this.control.selection.scrollManager.setScroll(new ScrollState().byModelPosition(this.control.selection)
102173
+ .setModelPosition(this.control.selection.lastSelectedInterval.start).useStdRelativePosition().useStdOffset());
102178
102174
  }
102175
+ this.control.owner.adjustControl();
102176
+ this.control.horizontalRulerControl.update();
102179
102177
  }
102180
102178
  }
102181
102179
  class DocumentRenderer {
@@ -102359,7 +102357,7 @@ class DocumentRenderer {
102359
102357
  }
102360
102358
  }
102361
102359
  updatePageSize(page, pageElement) {
102362
- if (pageElement.offsetHeight != page.height || pageElement.offsetWidth != page.width)
102360
+ if (pageElement.offsetHeight != Math.round(page.height) || pageElement.offsetWidth != Math.round(page.width))
102363
102361
  dom.DomUtils.setStyleSize(pageElement.style, page);
102364
102362
  }
102365
102363
  updatePageClasses(pageElement) {
@@ -106213,40 +106211,31 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
106213
106211
  this.processMouseDownOnMaxDetailsLevel(evt, htr, activeSubDocument);
106214
106212
  }
106215
106213
  processMouseDownOnMaxDetailsLevel(evt, htr, activeSubDocument) {
106214
+ const selection = this.handler.control.selection;
106216
106215
  if (htr.floatingObject) {
106217
- if (htr.floatingObject.belongsToSubDocId != this.handler.control.selection.activeSubDocument.id)
106218
- MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
106219
106216
  const box = htr.floatingObject;
106220
- this.selectFloatingObject(box);
106221
- const specRunInfo = this.handler.control.selection.specialRunInfo;
106222
- if (specRunInfo.isSelectedAnchorObject) {
106223
- if (box.getType() == LayoutBoxType.AnchorTextBox &&
106224
- HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, activeSubDocument.isTextBox() ? 0 : box.rotationInRadians)) {
106217
+ const rotationAngle = activeSubDocument.isTextBox() ? 0 : box.rotationInRadians;
106218
+ if (box.getType() == LayoutBoxType.AnchorTextBox && HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, rotationAngle)) {
106219
+ const textbox = box;
106220
+ if (textbox.internalSubDocId !== selection.activeSubDocument.id && this.selectFloatingObject(box)) {
106225
106221
  this.handler.control.commandManager.getCommand(RichEditClientCommand.ChangeActiveSubDocumentToTextBox).execute(this.handler.control.commandManager.isPublicApiCall);
106226
106222
  this.handler.boxVisualizerManager.resizeBoxVisualizer.show(htr.pageIndex, null, null, null, box);
106227
- htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, DocumentLayoutDetailsLevel.Max, this.handler.control.selection.activeSubDocument);
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
- }
106223
+ htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, DocumentLayoutDetailsLevel.Max, selection.activeSubDocument);
106242
106224
  }
106243
106225
  }
106226
+ else {
106227
+ if (this.selectFloatingObject(box) && this.resizeRotationChecker(() => {
106228
+ const dragFloatingObjectState = new MouseHandlerDragFloatingObjectState(this.handler, evt);
106229
+ this.handler.switchState(new MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, dragFloatingObjectState));
106230
+ }))
106231
+ return;
106232
+ }
106244
106233
  }
106245
106234
  if (browser.Browser.TouchUI && htr.subDocument.isMain() && htr.exactlyDetailLevel < DocumentLayoutDetailsLevel.PageArea) {
106246
106235
  if (htr.deviations[DocumentLayoutDetailsLevel.PageArea] & rectangle.HitTestDeviation.Top || htr.deviations[DocumentLayoutDetailsLevel.PageArea] & rectangle.HitTestDeviation.Bottom)
106247
106236
  this.handler.control.viewManager.canvasScrollManager.waitForDblClick();
106248
106237
  }
106249
- if (evt.button === MouseButton.Right && this.handler.control.selection.lastSelectedInterval.contains(htr.getPosition()))
106238
+ if (evt.button === MouseButton.Right && selection.lastSelectedInterval.contains(htr.getPosition()))
106250
106239
  return;
106251
106240
  if (this.shouldSelectEntireTableColumn(htr))
106252
106241
  this.beginSelectEntireTableColumn(htr, evt);
@@ -106261,7 +106250,7 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
106261
106250
  this.beginSelectEntireTableCell(htr, evt);
106262
106251
  }
106263
106252
  else if (this.isLeftArea(htr, evt)) {
106264
- if (evt.modifiers & key/* ModifierKey */.tx.Ctrl && this.handler.control.selection.isCollapsed())
106253
+ if (evt.modifiers & key/* ModifierKey */.tx.Ctrl && selection.isCollapsed())
106265
106254
  this.handler.control.commandManager.getCommand(RichEditClientCommand.SelectAll).execute(this.handler.control.commandManager.isPublicApiCall, htr.getPosition());
106266
106255
  else if (this.isLeftAreaOffset(htr, evt))
106267
106256
  this.beginLineSelection(htr, evt);
@@ -106469,8 +106458,14 @@ class MouseHandlerDefaultState extends MouseHandlerStateBase {
106469
106458
  this.handler.switchState(state);
106470
106459
  }
106471
106460
  selectFloatingObject(box) {
106461
+ const selection = this.handler.control.selection;
106462
+ if (box.belongsToSubDocId !== selection.activeSubDocument.id)
106463
+ MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
106464
+ if (box.belongsToSubDocId !== selection.activeSubDocument.id)
106465
+ return false;
106472
106466
  const pos = this.handler.control.layout.anchorObjectsPositionInfo.getPosition(box.objectId);
106473
- this.handler.control.selection.setSelection(new SetSelectionParams().setInterval(new fixed.FixedInterval(pos, 1)));
106467
+ selection.setSelection(new SetSelectionParams().setInterval(new fixed.FixedInterval(pos, 1)));
106468
+ return selection.specialRunInfo.isSelectedAnchorObject;
106474
106469
  }
106475
106470
  }
106476
106471
  class MouseHandlerHelper {
@@ -107643,31 +107638,56 @@ ResizeBoxListener.directionToSource = {
107643
107638
  };
107644
107639
 
107645
107640
  ;// CONCATENATED MODULE: ./src/common/utils/size-utils.ts
107641
+
107646
107642
  class SizeUtils {
107643
+ static getScrollbarsWidth() {
107644
+ if (!(0,common.isDefined)(this._scrollbarsWidth)) {
107645
+ const scrollDiv = document.createElement('div');
107646
+ scrollDiv.style.visibility = 'hidden';
107647
+ scrollDiv.style.overflow = 'scroll';
107648
+ scrollDiv.style.position = 'absolute';
107649
+ scrollDiv.style.top = '-9999px';
107650
+ scrollDiv.style.width = '100px';
107651
+ scrollDiv.style.height = '100px';
107652
+ document.body.appendChild(scrollDiv);
107653
+ const innerDiv = document.createElement('div');
107654
+ innerDiv.style.width = '100%';
107655
+ innerDiv.style.height = '100%';
107656
+ scrollDiv.appendChild(innerDiv);
107657
+ this._scrollbarsWidth = {
107658
+ horizontal: SizeUtils.getOffsetHeight(scrollDiv) - SizeUtils.getOffsetHeight(innerDiv),
107659
+ vertical: SizeUtils.getOffsetWidth(scrollDiv) - SizeUtils.getOffsetWidth(innerDiv)
107660
+ };
107661
+ scrollDiv.remove();
107662
+ }
107663
+ return this._scrollbarsWidth;
107664
+ }
107647
107665
  static getWidthInfo(element) {
107648
- const offsetSize = SizeUtils.getOffsetWidth(element);
107649
- const style = getComputedStyle(element);
107650
- const inset = parseCssValue(style.borderLeftWidth)
107651
- + parseCssValue(style.borderRightWidth)
107652
- + parseCssValue(style.paddingLeft)
107653
- + parseCssValue(style.paddingRight);
107654
- const sizeWithScrollBar = offsetSize - inset;
107655
- const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
107656
- return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
107666
+ const computedStyle = getComputedStyle(element);
107667
+ const offsetWidth = this.getOffsetWidth(element);
107668
+ const offsetWidthWithoutBorder = offsetWidth
107669
+ - parseCssValue(computedStyle.borderLeftWidth)
107670
+ - parseCssValue(computedStyle.borderRightWidth);
107671
+ let scrollbarWidth = 0;
107672
+ if (Math.round(offsetWidthWithoutBorder) > element.clientWidth)
107673
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().vertical;
107674
+ const clientWidth = offsetWidthWithoutBorder - scrollbarWidth;
107675
+ return new DimensionInfo(offsetWidth, clientWidth, scrollbarWidth);
107657
107676
  }
107658
107677
  static getClientWidth(element) {
107659
107678
  return this.getWidthInfo(element).clientSize;
107660
107679
  }
107661
107680
  static getHeightInfo(element) {
107662
- const offsetSize = SizeUtils.getOffsetHeight(element);
107663
- const style = getComputedStyle(element);
107664
- const inset = parseCssValue(style.borderTopWidth)
107665
- + parseCssValue(style.borderBottomWidth)
107666
- + parseCssValue(style.paddingTop)
107667
- + parseCssValue(style.paddingBottom);
107668
- const sizeWithScrollBar = offsetSize - inset;
107669
- const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
107670
- return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
107681
+ const computedStyle = getComputedStyle(element);
107682
+ const offsetHeight = this.getOffsetHeight(element);
107683
+ const offsetHeightWithoutBorder = offsetHeight
107684
+ - parseCssValue(computedStyle.borderTopWidth)
107685
+ - parseCssValue(computedStyle.borderBottomWidth);
107686
+ let scrollbarWidth = 0;
107687
+ if (Math.round(offsetHeightWithoutBorder) > element.clientHeight)
107688
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().horizontal;
107689
+ const clientHeight = offsetHeightWithoutBorder - scrollbarWidth;
107690
+ return new DimensionInfo(offsetHeight, clientHeight, scrollbarWidth);
107671
107691
  }
107672
107692
  static getClientHeight(element) {
107673
107693
  return this.getHeightInfo(element).clientSize;
@@ -108014,17 +108034,23 @@ class CanvasManager extends batch_updatable/* BatchUpdatableObject */.IS {
108014
108034
  onScrollIntervalTick() {
108015
108035
  const evtX = this.lastMousePosition.x;
108016
108036
  const evtY = this.lastMousePosition.y;
108017
- const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true);
108018
- const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true);
108037
+ const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false);
108038
+ const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false);
108019
108039
  if (!inHorizontalArea && !inVerticalArea)
108020
108040
  return;
108041
+ const yOffsetWithoutScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false) - evtY;
108042
+ const yOffsetWithScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY;
108043
+ const outsideHorizontalScrollbar = yOffsetWithoutScrollbar > 0 || yOffsetWithScrollbar < 0;
108021
108044
  if (inHorizontalArea && evtY - this.canvasPosition.y <= AUTOSCROLL_AREA_SIZE)
108022
108045
  this.viewManager.canvas.scrollTop -= AUTOSCROLL_STEP;
108023
- else if (inHorizontalArea && this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY <= AUTOSCROLL_AREA_SIZE)
108046
+ else if (inHorizontalArea && yOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideHorizontalScrollbar)
108024
108047
  this.viewManager.canvas.scrollTop += AUTOSCROLL_STEP;
108048
+ const xOffsetWithoutScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false) - evtX;
108049
+ const xOffsetWithScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX;
108050
+ const outsideVerticalScrollbar = xOffsetWithoutScrollbar > 0 || xOffsetWithScrollbar < 0;
108025
108051
  if (inVerticalArea && evtX - this.canvasPosition.x <= AUTOSCROLL_AREA_SIZE)
108026
108052
  this.viewManager.canvas.scrollLeft -= AUTOSCROLL_STEP;
108027
- else if (inVerticalArea && this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX <= AUTOSCROLL_AREA_SIZE)
108053
+ else if (inVerticalArea && xOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideVerticalScrollbar)
108028
108054
  this.viewManager.canvas.scrollLeft += AUTOSCROLL_STEP;
108029
108055
  }
108030
108056
  static getCursorClassName(pointer) {
@@ -110314,17 +110340,17 @@ class InputEditorBase {
110314
110340
  clearTimeout(this.onKeyUpTimerId);
110315
110341
  }
110316
110342
  initialize() {
110317
- this.initializeIfNotReadOnly();
110343
+ this.initializeEditableState();
110318
110344
  this.initEvents();
110319
110345
  this.prevKeyCode = EMPTY_KEYCODE;
110320
110346
  }
110321
- initializeIfNotReadOnly() {
110322
- if ((this.control.readOnly !== ReadOnlyMode.Persistent || this.control.modelManager.clientMode) && !this.initializedIfNotReadOnly) {
110323
- this.initializedIfNotReadOnly = true;
110324
- this.initializeIfNotReadOnlyCore();
110347
+ initializeEditableState() {
110348
+ if (!this.editableStateInitialized) {
110349
+ this.editableStateInitialized = true;
110350
+ this.initializeEditableStateCore();
110325
110351
  }
110326
110352
  }
110327
- initializeIfNotReadOnlyCore() {
110353
+ initializeEditableStateCore() {
110328
110354
  }
110329
110355
  initEvents() {
110330
110356
  this.evtHandlersHolder.addListener(this.getEditableDocument(), "keydown", this.onKeyDown.bind(this));
@@ -110544,8 +110570,8 @@ class DivInputEditor extends InputEditorBase {
110544
110570
  clearTimeout(this.composEndTimerId);
110545
110571
  clearTimeout(this.onTextInputTimerId);
110546
110572
  }
110547
- initializeIfNotReadOnlyCore() {
110548
- this.inputElement.contentEditable = "true";
110573
+ initializeEditableStateCore() {
110574
+ this.inputElement.contentEditable = String(!this.control.isReadOnlyPersistent);
110549
110575
  this.clearInputElement();
110550
110576
  }
110551
110577
  setPosition(left, top) {
@@ -110793,11 +110819,11 @@ class IFrameInputEditor extends InputEditorBase {
110793
110819
  body.style.margin = "0px";
110794
110820
  body.style.overflow = "hidden";
110795
110821
  }
110796
- initializeIfNotReadOnlyCore() {
110822
+ initializeEditableStateCore() {
110797
110823
  if (browser.Browser.WebKitFamily)
110798
- this.editableDocument.body.setAttribute("contenteditable", "true");
110824
+ this.editableDocument.body.setAttribute("contenteditable", String(!this.control.isReadOnlyPersistent));
110799
110825
  else
110800
- this.editableDocument.designMode = "on";
110826
+ this.editableDocument.designMode = this.control.isReadOnlyPersistent ? "off" : "on";
110801
110827
  }
110802
110828
  createInputElement() {
110803
110829
  const element = document.createElement("IFRAME");
@@ -110936,7 +110962,7 @@ class IFrameInputEditor extends InputEditorBase {
110936
110962
  recreateIfNeeded() {
110937
110963
  const iframeDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
110938
110964
  if (!iframeDocument.body.hasAttribute("loaded")) {
110939
- this.initializedIfNotReadOnly = false;
110965
+ this.editableStateInitialized = false;
110940
110966
  this.createHierarchyCore();
110941
110967
  this.initialize();
110942
110968
  }
@@ -115242,7 +115268,7 @@ class RichEditCore {
115242
115268
  this.invalidateLayoutAfterFontsLoaded();
115243
115269
  });
115244
115270
  }
115245
- get isReadOnlyPersistent() { return this.readOnly == ReadOnlyMode.Persistent; }
115271
+ get isReadOnlyPersistent() { return this.readOnly === ReadOnlyMode.Persistent; }
115246
115272
  get model() { return this.modelManager.model; }
115247
115273
  get isDisposed() {
115248
115274
  return this._isDisposed;
@@ -115406,8 +115432,8 @@ class RichEditCore {
115406
115432
  this.readOnly = ReadOnlyMode.Persistent;
115407
115433
  else if (!readOnly && this.readOnly === ReadOnlyMode.Persistent) {
115408
115434
  this.readOnly = ReadOnlyMode.None;
115409
- this.inputController.inputEditor.initializeIfNotReadOnly();
115410
115435
  }
115436
+ this.inputController.inputEditor.initializeEditableStateCore();
115411
115437
  }
115412
115438
  setWorkSession(sessionGuid, documentInfo) {
115413
115439
  this.sessionGuid = sessionGuid;
@@ -144094,11 +144120,11 @@ class RichEditPublic {
144094
144120
  command.execute(true, type);
144095
144121
  }
144096
144122
  get readOnly() {
144097
- return this._native.core.readOnly == ReadOnlyMode.Persistent;
144123
+ return this._native.core.readOnly === ReadOnlyMode.Persistent;
144098
144124
  }
144099
144125
  set readOnly(value) {
144100
144126
  if (this.readOnly != value) {
144101
- this._native.core.readOnly = value ? ReadOnlyMode.Persistent : ReadOnlyMode.None;
144127
+ this._native.core.setPersistentReadOnly(value);
144102
144128
  this._native.core.barHolder.updateItemsState();
144103
144129
  this._native.core.horizontalRulerControl.update();
144104
144130
  this._native.core.beginUpdate();