devexpress-richedit 24.1.5-build-24211-0105 → 24.1.5
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 +43 -19
- package/dist/dx.richedit.min.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/common/canvas/renderes/view-manager.js +6 -9
- package/lib/common/event-manager.d.ts +4 -0
- package/lib/common/event-manager.js +14 -0
- package/lib/common/input-controller.d.ts +4 -3
- package/lib/common/input-controller.js +22 -9
- package/lib/common/interfaces/i-event-manager.d.ts +1 -0
- package/package.json +3 -3
package/dist/dx.richedit.js
CHANGED
@@ -109657,6 +109657,7 @@ class EventManager {
|
|
109657
109657
|
this.control = control;
|
109658
109658
|
this.mouseHandler = new MouseHandler(control, boxVisualizerManager);
|
109659
109659
|
this.touchHandler = new TouchHandler(control, boxVisualizerManager);
|
109660
|
+
this.inputTypeHandlers = this.createInputTypeHandlers();
|
109660
109661
|
}
|
109661
109662
|
set mouseWheelEvent(val) {
|
109662
109663
|
this.mouseHandler.mouseWheelEvent = val;
|
@@ -109829,6 +109830,19 @@ class EventManager {
|
|
109829
109830
|
this.moveLocked = true;
|
109830
109831
|
this.lockMouseMoveTimerId = setTimeout(() => this.moveLocked = false, 0);
|
109831
109832
|
}
|
109833
|
+
onInput(inputType) {
|
109834
|
+
const commandId = this.inputTypeHandlers[inputType];
|
109835
|
+
if (!commandId)
|
109836
|
+
return false;
|
109837
|
+
const command = this.control.commandManager.getCommand(commandId);
|
109838
|
+
command.execute(false);
|
109839
|
+
return true;
|
109840
|
+
}
|
109841
|
+
createInputTypeHandlers() {
|
109842
|
+
const result = {};
|
109843
|
+
result["insertParagraph"] = RichEditClientCommand.InsertParagraph;
|
109844
|
+
return result;
|
109845
|
+
}
|
109832
109846
|
}
|
109833
109847
|
class RichMouseEvent {
|
109834
109848
|
constructor(evt, layoutPoint, source, scrollTop, scrollLeft) {
|
@@ -111820,7 +111834,6 @@ class SelectionRenderer extends SelectionRendererBase {
|
|
111820
111834
|
|
111821
111835
|
|
111822
111836
|
|
111823
|
-
|
111824
111837
|
|
111825
111838
|
|
111826
111839
|
class ViewManager {
|
@@ -111899,14 +111912,12 @@ class ViewManager {
|
|
111899
111912
|
this.selection.renderAllPageSelection(this.layout, 0, true);
|
111900
111913
|
else
|
111901
111914
|
this.selection.applySelectionChanges(this.layout);
|
111902
|
-
|
111903
|
-
|
111904
|
-
|
111905
|
-
|
111906
|
-
|
111907
|
-
|
111908
|
-
this.inputController.setPosition(layoutPage.x + this.cache[pageIndex].page.offsetLeft + item.x, this.sizes.getPageOffsetY(layoutPage) + item.y);
|
111909
|
-
}
|
111915
|
+
const pageIndex = utils_list.ListUtils.reverseIndexBy(layoutSelection.selectionInfo.pageInfos, pageInfo => pageInfo.oldItems.length > 0);
|
111916
|
+
if (pageIndex > -1) {
|
111917
|
+
const pageInfo = layoutSelection.selectionInfo.pageInfos[pageIndex];
|
111918
|
+
const item = pageInfo.oldItems[0];
|
111919
|
+
const layoutPage = this.layout.pages[pageIndex];
|
111920
|
+
this.inputController.setPosition(layoutPage.x + this.cache[pageIndex].page.offsetLeft + item.x, this.sizes.getPageOffsetY(layoutPage) + item.y);
|
111910
111921
|
}
|
111911
111922
|
}
|
111912
111923
|
NotifySearchSelectionLayoutChanged() {
|
@@ -112558,6 +112569,7 @@ const TAB_KEYCODE = 9;
|
|
112558
112569
|
const IDEOGRAPHIC_SPACE_CHARCODE = 12288;
|
112559
112570
|
class InputEditorBase {
|
112560
112571
|
constructor(control, eventManager, parent) {
|
112572
|
+
this.newLineRegexp = /(\r\n|\n|\r)/gm;
|
112561
112573
|
this.processTextOnKeyPress = false;
|
112562
112574
|
this.evtHandlersHolder = new event_handlers_holder/* DomEventHandlersHolder */.$();
|
112563
112575
|
this.control = control;
|
@@ -112596,8 +112608,7 @@ class InputEditorBase {
|
|
112596
112608
|
this.evtHandlersHolder.addListener(this.getEditableDocument(), "focus", this.onFocus.bind(this));
|
112597
112609
|
this.evtHandlersHolder.addListener(this.getEditableDocument(), "blur", (evt) => this.onBlurTimerId = setTimeout(() => this.onBlur(evt), 10));
|
112598
112610
|
this.evtHandlersHolder.addListener(this.getEditableDocument(), "contextmenu", this.onContextMenu.bind(this));
|
112599
|
-
|
112600
|
-
this.evtHandlersHolder.addListener(this.getEditableDocument(), "input", (evt) => this.onInput(evt));
|
112611
|
+
this.evtHandlersHolder.addListener(this.getEditableDocument(), "input", (evt) => this.onInput(evt));
|
112601
112612
|
}
|
112602
112613
|
createHierarchy(parent) {
|
112603
112614
|
this.inputElement = this.createInputElement();
|
@@ -112611,8 +112622,21 @@ class InputEditorBase {
|
|
112611
112622
|
return null;
|
112612
112623
|
}
|
112613
112624
|
onInput(evt) {
|
112614
|
-
if (this.
|
112615
|
-
|
112625
|
+
if (!this.processTextOnKeyPress) {
|
112626
|
+
if (evt.inputType === "insertText") {
|
112627
|
+
const text = this.getEditableTextOwner().innerText;
|
112628
|
+
if (utils_string.StringUtils.isNullOrEmpty(text))
|
112629
|
+
return;
|
112630
|
+
if (this.newLineRegexp.test(text)) {
|
112631
|
+
this.eventManager.onInput("insertParagraph");
|
112632
|
+
this.clearInputElement();
|
112633
|
+
}
|
112634
|
+
else
|
112635
|
+
this.onInputTimerId = setTimeout(() => this.onTextInput(evt.data), 0);
|
112636
|
+
}
|
112637
|
+
else if (this.eventManager.onInput(evt.inputType))
|
112638
|
+
this.clearInputElement();
|
112639
|
+
}
|
112616
112640
|
}
|
112617
112641
|
onBlur(_evt) {
|
112618
112642
|
const targetElement = document.activeElement;
|
@@ -112668,11 +112692,10 @@ class InputEditorBase {
|
|
112668
112692
|
this.keyPressTimerId = setTimeout(() => this.onTextInput(undefined), 0);
|
112669
112693
|
else if (this.processTextOnKeyPress) {
|
112670
112694
|
this.imeTimerId = setTimeout(() => {
|
112671
|
-
|
112672
|
-
|
112695
|
+
this.onTextInput(undefined);
|
112696
|
+
this.processTextOnKeyPress = false;
|
112673
112697
|
}, 0);
|
112674
112698
|
}
|
112675
|
-
this.processTextOnKeyPress = false;
|
112676
112699
|
this.inputWithAlt = false;
|
112677
112700
|
}
|
112678
112701
|
}
|
@@ -112733,8 +112756,9 @@ class InputEditorBase {
|
|
112733
112756
|
canUseInputEvent() {
|
112734
112757
|
return browser.Browser.Firefox && browser.Browser.MajorVersion >= 14 || browser.Browser.WebKitTouchUI;
|
112735
112758
|
}
|
112736
|
-
getEditableDocumentText() {
|
112737
|
-
|
112759
|
+
getEditableDocumentText(keepLineBreakes = false) {
|
112760
|
+
const text = dom.DomUtils.getInnerText(this.getEditableTextOwner());
|
112761
|
+
return keepLineBreakes ? text : text.replace(this.newLineRegexp, "");
|
112738
112762
|
}
|
112739
112763
|
getEditableTextOwner() {
|
112740
112764
|
return null;
|
@@ -143775,7 +143799,7 @@ class ClientRichEdit {
|
|
143775
143799
|
this.contextMenuSettings = settings.contextMenuSettings;
|
143776
143800
|
this.fullScreenHelper = new FullScreenHelper(element);
|
143777
143801
|
if (true)
|
143778
|
-
external_DevExpress_config_default()(JSON.parse(atob('
|
143802
|
+
external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWExcHBaR1pSWjA1WGEyVkxaVmx6U2tJNFdHcFhaeUlLZlE9PS5mL01XY3Z5bDUyTFJMRWlMaEVyYnF1eW5yQ3FEQjdvZ0U1QVgxcGdpMXduSW9sT1MySFluNjBWeDBTb0VJVVpEUGhIRlBSQkdpSzg2cFA1K0xjMG56dUd6RFpEZkVUUS9CeklldjJoNTYzdWc2SzlKMCswMER0eTlvVW1GU2xvRTl6WTdQZz09In0=')));
|
143779
143803
|
this.prepareElement(element, settings);
|
143780
143804
|
this.initDefaultFontsAndStyles();
|
143781
143805
|
this.initBars(settings.ribbon, settings.fonts);
|