@babylonjs/gui 6.45.0 → 6.45.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,8 @@ export declare class InputText extends Control implements IFocusableControl {
|
|
45
45
|
private _startHighlightIndex;
|
46
46
|
private _endHighlightIndex;
|
47
47
|
private _cursorIndex;
|
48
|
+
private _outlineWidth;
|
49
|
+
private _outlineColor;
|
48
50
|
protected _onFocusSelectAll: boolean;
|
49
51
|
protected _isPointerDown: boolean;
|
50
52
|
protected _onClipboardObserver: Nullable<Observer<ClipboardInfo>>;
|
@@ -55,6 +57,16 @@ export declare class InputText extends Control implements IFocusableControl {
|
|
55
57
|
promptMessage: string;
|
56
58
|
/** Force disable prompt on mobile device */
|
57
59
|
disableMobilePrompt: boolean;
|
60
|
+
/**
|
61
|
+
* Gets or sets outlineWidth of the text to display
|
62
|
+
*/
|
63
|
+
get outlineWidth(): number;
|
64
|
+
set outlineWidth(value: number);
|
65
|
+
/**
|
66
|
+
* Gets or sets outlineColor of the text to display
|
67
|
+
*/
|
68
|
+
get outlineColor(): string;
|
69
|
+
set outlineColor(value: string);
|
58
70
|
/** Observable raised when the text changes */
|
59
71
|
onTextChangedObservable: Observable<InputText>;
|
60
72
|
/** Observable raised just before an entered character is to be added */
|
@@ -63,9 +75,9 @@ export declare class InputText extends Control implements IFocusableControl {
|
|
63
75
|
onFocusObservable: Observable<InputText>;
|
64
76
|
/** Observable raised when the control loses the focus */
|
65
77
|
onBlurObservable: Observable<InputText>;
|
66
|
-
/**Observable raised when the text is highlighted */
|
78
|
+
/** Observable raised when the text is highlighted */
|
67
79
|
onTextHighlightObservable: Observable<InputText>;
|
68
|
-
/**Observable raised when copy event is triggered */
|
80
|
+
/** Observable raised when copy event is triggered */
|
69
81
|
onTextCopyObservable: Observable<InputText>;
|
70
82
|
/** Observable raised when cut event is triggered */
|
71
83
|
onTextCutObservable: Observable<InputText>;
|
@@ -129,6 +141,7 @@ export declare class InputText extends Control implements IFocusableControl {
|
|
129
141
|
get text(): string;
|
130
142
|
set text(value: string);
|
131
143
|
protected _textHasChanged(): void;
|
144
|
+
protected _applyStates(context: ICanvasRenderingContext): void;
|
132
145
|
/** Gets or sets control width */
|
133
146
|
get width(): string | number;
|
134
147
|
set width(value: string | number);
|
package/2D/controls/inputText.js
CHANGED
@@ -11,6 +11,32 @@ import { serialize } from "@babylonjs/core/Misc/decorators.js";
|
|
11
11
|
* Class used to create input text control
|
12
12
|
*/
|
13
13
|
export class InputText extends Control {
|
14
|
+
/**
|
15
|
+
* Gets or sets outlineWidth of the text to display
|
16
|
+
*/
|
17
|
+
get outlineWidth() {
|
18
|
+
return this._outlineWidth;
|
19
|
+
}
|
20
|
+
set outlineWidth(value) {
|
21
|
+
if (this._outlineWidth === value) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
this._outlineWidth = value;
|
25
|
+
this._markAsDirty();
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Gets or sets outlineColor of the text to display
|
29
|
+
*/
|
30
|
+
get outlineColor() {
|
31
|
+
return this._outlineColor;
|
32
|
+
}
|
33
|
+
set outlineColor(value) {
|
34
|
+
if (this._outlineColor === value) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
this._outlineColor = value;
|
38
|
+
this._markAsDirty();
|
39
|
+
}
|
14
40
|
/** Gets or sets the maximum width allowed by the control */
|
15
41
|
get maxWidth() {
|
16
42
|
return this._maxWidth.toString(this._host);
|
@@ -204,6 +230,13 @@ export class InputText extends Control {
|
|
204
230
|
this._markAsDirty();
|
205
231
|
this.onTextChangedObservable.notifyObservers(this);
|
206
232
|
}
|
233
|
+
_applyStates(context) {
|
234
|
+
super._applyStates(context);
|
235
|
+
if (this.outlineWidth) {
|
236
|
+
context.lineWidth = this.outlineWidth;
|
237
|
+
context.strokeStyle = this.outlineColor;
|
238
|
+
}
|
239
|
+
}
|
207
240
|
/** Gets or sets control width */
|
208
241
|
get width() {
|
209
242
|
return this._width.toString(this._host);
|
@@ -247,6 +280,8 @@ export class InputText extends Control {
|
|
247
280
|
this._startHighlightIndex = 0;
|
248
281
|
this._endHighlightIndex = 0;
|
249
282
|
this._cursorIndex = -1;
|
283
|
+
this._outlineWidth = 0;
|
284
|
+
this._outlineColor = "white";
|
250
285
|
this._onFocusSelectAll = false;
|
251
286
|
this._isPointerDown = false;
|
252
287
|
/** Gets or sets a string representing the message displayed on mobile when the control gets the focus */
|
@@ -261,9 +296,9 @@ export class InputText extends Control {
|
|
261
296
|
this.onFocusObservable = new Observable();
|
262
297
|
/** Observable raised when the control loses the focus */
|
263
298
|
this.onBlurObservable = new Observable();
|
264
|
-
/**Observable raised when the text is highlighted */
|
299
|
+
/** Observable raised when the text is highlighted */
|
265
300
|
this.onTextHighlightObservable = new Observable();
|
266
|
-
/**Observable raised when copy event is triggered */
|
301
|
+
/** Observable raised when copy event is triggered */
|
267
302
|
this.onTextCopyObservable = new Observable();
|
268
303
|
/** Observable raised when cut event is triggered */
|
269
304
|
this.onTextCutObservable = new Observable();
|
@@ -806,6 +841,9 @@ export class InputText extends Control {
|
|
806
841
|
else {
|
807
842
|
this._scrollLeft = clipTextLeft;
|
808
843
|
}
|
844
|
+
if (this.outlineWidth) {
|
845
|
+
context.strokeText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);
|
846
|
+
}
|
809
847
|
context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);
|
810
848
|
// Cursor
|
811
849
|
if (this._isFocused) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"inputText.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/inputText.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,mBAAmB,EAAE,kDAAoC;AAElE,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,0CA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BAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\nimport type { ClipboardInfo } from \"core/Events/clipboardEvents\";\r\nimport { ClipboardEventTypes } from \"core/Events/clipboardEvents\";\r\nimport type { PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { IFocusableControl } from \"./focusableControl\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport type { VirtualKeyboard } from \"./virtualKeyboard\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { TextWrapper } from \"./textWrapper\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { IKeyboardEvent, IPointerEvent } from \"core/Events/deviceInputEvents\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/**\r\n * Class used to create input text control\r\n */\r\nexport class InputText extends Control implements IFocusableControl {\r\n protected _textWrapper: TextWrapper;\r\n protected _placeholderText = \"\";\r\n protected _background = \"#222222\";\r\n protected _focusedBackground = \"#000000\";\r\n protected _focusedColor = \"white\";\r\n protected _placeholderColor = \"gray\";\r\n protected _thickness = 1;\r\n protected _margin = new ValueAndUnit(10, ValueAndUnit.UNITMODE_PIXEL);\r\n protected _autoStretchWidth = true;\r\n protected _maxWidth = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n protected _isFocused = false;\r\n /** the type of device that most recently focused the input: \"mouse\", \"touch\" or \"pen\" */\r\n protected _focusedBy: string;\r\n protected _blinkTimeout: number;\r\n protected _blinkIsEven = false;\r\n private _cursorOffset = 0;\r\n protected _scrollLeft: Nullable<number>;\r\n protected _textWidth: number;\r\n protected _clickedCoordinate: Nullable<number>;\r\n protected _deadKey = false;\r\n protected _addKey = true;\r\n protected _currentKey = \"\";\r\n protected _isTextHighlightOn = false;\r\n protected _textHighlightColor = \"#d5e0ff\";\r\n protected _highligherOpacity = 0.4;\r\n protected _highlightedText = \"\";\r\n private _startHighlightIndex = 0;\r\n private _endHighlightIndex = 0;\r\n private _cursorIndex = -1;\r\n protected _onFocusSelectAll = false;\r\n protected _isPointerDown = false;\r\n protected _onClipboardObserver: Nullable<Observer<ClipboardInfo>>;\r\n protected _onPointerDblTapObserver: Nullable<Observer<PointerInfo>>;\r\n\r\n /** @internal */\r\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\r\n\r\n /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */\r\n @serialize()\r\n public promptMessage = \"Please enter text:\";\r\n /** Force disable prompt on mobile device */\r\n @serialize()\r\n public disableMobilePrompt = false;\r\n\r\n /** Observable raised when the text changes */\r\n public onTextChangedObservable = new Observable<InputText>();\r\n /** Observable raised just before an entered character is to be added */\r\n public onBeforeKeyAddObservable = new Observable<InputText>();\r\n /** Observable raised when the control gets the focus */\r\n public onFocusObservable = new Observable<InputText>();\r\n /** Observable raised when the control loses the focus */\r\n public onBlurObservable = new Observable<InputText>();\r\n /**Observable raised when the text is highlighted */\r\n public onTextHighlightObservable = new Observable<InputText>();\r\n /**Observable raised when copy event is triggered */\r\n public onTextCopyObservable = new Observable<InputText>();\r\n /** Observable raised when cut event is triggered */\r\n public onTextCutObservable = new Observable<InputText>();\r\n /** Observable raised when paste event is triggered */\r\n public onTextPasteObservable = new Observable<InputText>();\r\n /** Observable raised when a key event was processed */\r\n public onKeyboardEventProcessedObservable = new Observable<IKeyboardEvent>();\r\n\r\n /** Gets or sets the maximum width allowed by the control */\r\n @serialize()\r\n public get maxWidth(): string | number {\r\n return this._maxWidth.toString(this._host);\r\n }\r\n\r\n /** Gets the maximum width allowed by the control in pixels */\r\n public get maxWidthInPixels(): number {\r\n return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set maxWidth(value: string | number) {\r\n if (this._maxWidth.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._maxWidth.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets the text highlighter transparency; default: 0.4 */\r\n @serialize()\r\n public get highligherOpacity(): number {\r\n return this._highligherOpacity;\r\n }\r\n\r\n public set highligherOpacity(value: number) {\r\n if (this._highligherOpacity === value) {\r\n return;\r\n }\r\n this._highligherOpacity = value;\r\n this._markAsDirty();\r\n }\r\n /** Gets or sets a boolean indicating whether to select complete text by default on input focus */\r\n @serialize()\r\n public get onFocusSelectAll(): boolean {\r\n return this._onFocusSelectAll;\r\n }\r\n\r\n public set onFocusSelectAll(value: boolean) {\r\n if (this._onFocusSelectAll === value) {\r\n return;\r\n }\r\n\r\n this._onFocusSelectAll = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the text hightlight color */\r\n @serialize()\r\n public get textHighlightColor(): string {\r\n return this._textHighlightColor;\r\n }\r\n\r\n public set textHighlightColor(value: string) {\r\n if (this._textHighlightColor === value) {\r\n return;\r\n }\r\n this._textHighlightColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets control margin */\r\n @serialize()\r\n public get margin(): string {\r\n return this._margin.toString(this._host);\r\n }\r\n\r\n /** Gets control margin in pixels */\r\n public get marginInPixels(): number {\r\n return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set margin(value: string) {\r\n if (this._margin.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._margin.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */\r\n @serialize()\r\n public get autoStretchWidth(): boolean {\r\n return this._autoStretchWidth;\r\n }\r\n\r\n public set autoStretchWidth(value: boolean) {\r\n if (this._autoStretchWidth === value) {\r\n return;\r\n }\r\n\r\n this._autoStretchWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets border thickness */\r\n @serialize()\r\n public get thickness(): number {\r\n return this._thickness;\r\n }\r\n\r\n public set thickness(value: number) {\r\n if (this._thickness === value) {\r\n return;\r\n }\r\n\r\n this._thickness = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color when focused */\r\n @serialize()\r\n public get focusedBackground(): string {\r\n return this._focusedBackground;\r\n }\r\n\r\n public set focusedBackground(value: string) {\r\n if (this._focusedBackground === value) {\r\n return;\r\n }\r\n\r\n this._focusedBackground = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color when focused */\r\n @serialize()\r\n public get focusedColor(): string {\r\n return this._focusedColor;\r\n }\r\n\r\n public set focusedColor(value: string) {\r\n if (this._focusedColor === value) {\r\n return;\r\n }\r\n\r\n this._focusedColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color */\r\n @serialize()\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the placeholder color */\r\n @serialize()\r\n public get placeholderColor(): string {\r\n return this._placeholderColor;\r\n }\r\n\r\n public set placeholderColor(value: string) {\r\n if (this._placeholderColor === value) {\r\n return;\r\n }\r\n\r\n this._placeholderColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the text displayed when the control is empty */\r\n @serialize()\r\n public get placeholderText(): string {\r\n return this._placeholderText;\r\n }\r\n\r\n public set placeholderText(value: string) {\r\n if (this._placeholderText === value) {\r\n return;\r\n }\r\n this._placeholderText = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the dead key. 0 to disable. */\r\n @serialize()\r\n public get deadKey(): boolean {\r\n return this._deadKey;\r\n }\r\n\r\n public set deadKey(flag: boolean) {\r\n this._deadKey = flag;\r\n }\r\n\r\n /** Gets or sets the highlight text */\r\n public get highlightedText(): string {\r\n return this._highlightedText;\r\n }\r\n public set highlightedText(text: string) {\r\n if (this._highlightedText === text) {\r\n return;\r\n }\r\n this._highlightedText = text;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets if the current key should be added */\r\n public get addKey(): boolean {\r\n return this._addKey;\r\n }\r\n\r\n public set addKey(flag: boolean) {\r\n this._addKey = flag;\r\n }\r\n\r\n /** Gets or sets the value of the current key being entered */\r\n public get currentKey(): string {\r\n return this._currentKey;\r\n }\r\n\r\n public set currentKey(key: string) {\r\n this._currentKey = key;\r\n }\r\n\r\n /** Gets or sets the text displayed in the control */\r\n @serialize()\r\n public get text(): string {\r\n return this._textWrapper.text;\r\n }\r\n\r\n public set text(value: string) {\r\n const valueAsString = value.toString(); // Forcing convertion\r\n\r\n if (!this._textWrapper) {\r\n this._textWrapper = new TextWrapper();\r\n }\r\n\r\n if (this._textWrapper.text === valueAsString) {\r\n return;\r\n }\r\n this._textWrapper.text = valueAsString;\r\n this._textHasChanged();\r\n }\r\n\r\n protected _textHasChanged(): void {\r\n this._markAsDirty();\r\n this.onTextChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /** Gets or sets control width */\r\n @serialize()\r\n public get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public set width(value: string | number) {\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n\r\n this.autoStretchWidth = false;\r\n }\r\n\r\n /**\r\n * Creates a new InputText\r\n * @param name defines the control name\r\n * @param text defines the text of the control\r\n */\r\n constructor(\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n this.isPointerBlocker = true;\r\n }\r\n\r\n /** @internal */\r\n public onBlur(): void {\r\n this._isFocused = false;\r\n this._scrollLeft = null;\r\n this._cursorOffset = 0;\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n\r\n this.onBlurObservable.notifyObservers(this);\r\n\r\n this._host.unRegisterClipboardEvents();\r\n if (this._onClipboardObserver) {\r\n this._host.onClipboardObservable.remove(this._onClipboardObserver);\r\n }\r\n const scene = this._host.getScene();\r\n if (this._onPointerDblTapObserver && scene) {\r\n scene.onPointerObservable.remove(this._onPointerDblTapObserver);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public onFocus(): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n this._scrollLeft = null;\r\n this._isFocused = true;\r\n this._blinkIsEven = false;\r\n this._cursorOffset = 0;\r\n this._markAsDirty();\r\n\r\n this.onFocusObservable.notifyObservers(this);\r\n\r\n if (this._focusedBy === \"touch\" && !this.disableMobilePrompt) {\r\n const value = prompt(this.promptMessage);\r\n\r\n if (value !== null) {\r\n this.text = value;\r\n }\r\n this._host.focusedControl = null;\r\n return;\r\n }\r\n\r\n this._host.registerClipboardEvents();\r\n\r\n this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => {\r\n // process clipboard event, can be configured.\r\n switch (clipboardInfo.type) {\r\n case ClipboardEventTypes.COPY:\r\n this._onCopyText(clipboardInfo.event);\r\n this.onTextCopyObservable.notifyObservers(this);\r\n break;\r\n case ClipboardEventTypes.CUT:\r\n this._onCutText(clipboardInfo.event);\r\n this.onTextCutObservable.notifyObservers(this);\r\n break;\r\n case ClipboardEventTypes.PASTE:\r\n this._onPasteText(clipboardInfo.event);\r\n this.onTextPasteObservable.notifyObservers(this);\r\n break;\r\n default:\r\n return;\r\n }\r\n });\r\n\r\n const scene = this._host.getScene();\r\n if (scene) {\r\n //register the pointer double tap event\r\n this._onPointerDblTapObserver = scene.onPointerObservable.add((pointerInfo) => {\r\n if (!this._isFocused) {\r\n return;\r\n }\r\n if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) {\r\n this._processDblClick(pointerInfo);\r\n }\r\n });\r\n }\r\n\r\n if (this._onFocusSelectAll) {\r\n this._selectAllText();\r\n }\r\n }\r\n\r\n /**\r\n * Function to focus an inputText programmatically\r\n */\r\n public focus() {\r\n this._host.moveFocusToControl(this);\r\n }\r\n\r\n /**\r\n * Function to unfocus an inputText programmatically\r\n */\r\n public blur() {\r\n this._host.focusedControl = null;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"InputText\";\r\n }\r\n\r\n /**\r\n * Function called to get the list of controls that should not steal the focus from this control\r\n * @returns an array of controls\r\n */\r\n public keepsFocusWith(): Nullable<Control[]> {\r\n if (!this._connectedVirtualKeyboard) {\r\n return null;\r\n }\r\n return [this._connectedVirtualKeyboard];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public processKey(keyCode: number, key?: string, evt?: IKeyboardEvent) {\r\n if (this.isReadOnly) {\r\n return;\r\n }\r\n\r\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\r\n if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) {\r\n return;\r\n }\r\n\r\n //select all\r\n if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) {\r\n this._selectAllText();\r\n evt.preventDefault();\r\n return;\r\n }\r\n // Specific cases\r\n switch (keyCode) {\r\n case 32: //SPACE\r\n key = \" \"; //ie11 key for space is \"Spacebar\"\r\n break;\r\n case 191: //SLASH\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case 8: // BACKSPACE\r\n if (this._textWrapper.text && this._textWrapper.length > 0) {\r\n //delete the highlighted text\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n this._blinkIsEven = false;\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n }\r\n //delete single character\r\n if (this._cursorOffset === 0) {\r\n this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);\r\n } else {\r\n const deletePosition = this._textWrapper.length - this._cursorOffset;\r\n if (deletePosition > 0) {\r\n this._textWrapper.removePart(deletePosition - 1, deletePosition);\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n case 46: // DELETE\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n }\r\n if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {\r\n const deletePosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(deletePosition, deletePosition + 1);\r\n this._textHasChanged();\r\n this._cursorOffset--;\r\n }\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n case 13: // RETURN\r\n this._host.focusedControl = null;\r\n this.isTextHighlightOn = false;\r\n return;\r\n case 35: // END\r\n this._cursorOffset = 0;\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case 36: // HOME\r\n this._cursorOffset = this._textWrapper.length;\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case 37: // LEFT\r\n this._cursorOffset++;\r\n if (this._cursorOffset > this._textWrapper.length) {\r\n this._cursorOffset = this._textWrapper.length;\r\n }\r\n\r\n if (evt && evt.shiftKey) {\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n // shift + ctrl/cmd + <-\r\n if (evt.ctrlKey || evt.metaKey) {\r\n if (!this.isTextHighlightOn) {\r\n if (this._textWrapper.length === this._cursorOffset) {\r\n return;\r\n } else {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;\r\n }\r\n }\r\n this._startHighlightIndex = 0;\r\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\r\n this._cursorOffset = this._textWrapper.length;\r\n this.isTextHighlightOn = true;\r\n this._markAsDirty();\r\n return;\r\n }\r\n //store the starting point\r\n if (!this.isTextHighlightOn) {\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1;\r\n }\r\n //if text is already highlighted\r\n else if (this._cursorIndex === -1) {\r\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\r\n this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1;\r\n }\r\n //set the highlight indexes\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n }\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (this.isTextHighlightOn) {\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n this.isTextHighlightOn = false;\r\n }\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._cursorOffset = this._textWrapper.length;\r\n evt.preventDefault();\r\n }\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n return;\r\n case 39: // RIGHT\r\n this._cursorOffset--;\r\n if (this._cursorOffset < 0) {\r\n this._cursorOffset = 0;\r\n }\r\n if (evt && evt.shiftKey) {\r\n //update the cursor\r\n this._blinkIsEven = false;\r\n //shift + ctrl/cmd + ->\r\n if (evt.ctrlKey || evt.metaKey) {\r\n if (!this.isTextHighlightOn) {\r\n if (this._cursorOffset === 0) {\r\n return;\r\n } else {\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;\r\n }\r\n }\r\n this._endHighlightIndex = this._textWrapper.length;\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\r\n this._cursorOffset = 0;\r\n this._markAsDirty();\r\n return;\r\n }\r\n\r\n if (!this.isTextHighlightOn) {\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1;\r\n }\r\n //if text is already highlighted\r\n else if (this._cursorIndex === -1) {\r\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\r\n this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1;\r\n }\r\n //set the highlight indexes\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n }\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (this.isTextHighlightOn) {\r\n this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;\r\n this.isTextHighlightOn = false;\r\n }\r\n //ctr + ->\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._cursorOffset = 0;\r\n evt.preventDefault();\r\n }\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (keyCode === 32) {\r\n key = evt?.key ?? \" \";\r\n }\r\n this._deadKey = key === \"Dead\";\r\n // Printable characters\r\n if (\r\n key &&\r\n (keyCode === -1 || // Direct access\r\n keyCode === 32 || // Space\r\n keyCode === 34 || // \" add support for single and double quotes\r\n keyCode === 39 || // '\r\n (keyCode > 47 && keyCode < 64) || // Numbers\r\n (keyCode > 64 && keyCode < 91) || // Letters\r\n (keyCode > 159 && keyCode < 193) || // Special characters\r\n (keyCode > 218 && keyCode < 223) || // Special characters\r\n (keyCode > 95 && keyCode < 112))\r\n ) {\r\n // Numpad\r\n this._currentKey = key;\r\n this.onBeforeKeyAddObservable.notifyObservers(this);\r\n key = this._currentKey;\r\n if (this._addKey && !this._deadKey) {\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);\r\n this._textHasChanged();\r\n this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);\r\n this.isTextHighlightOn = false;\r\n this._blinkIsEven = false;\r\n this._markAsDirty();\r\n } else if (this._cursorOffset === 0) {\r\n this.text += this._deadKey && evt?.key ? evt.key : key;\r\n } else {\r\n const insertPosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(insertPosition, insertPosition, key);\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _updateValueFromCursorIndex(offset: number) {\r\n //update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (this._cursorIndex === -1) {\r\n this._cursorIndex = offset;\r\n } else {\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n }\r\n }\r\n this.isTextHighlightOn = true;\r\n this._markAsDirty();\r\n }\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _processDblClick(evt: PointerInfo) {\r\n //pre-find the start and end index of the word under cursor, speeds up the rendering\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._endHighlightIndex = this._startHighlightIndex;\r\n let moveLeft, moveRight;\r\n do {\r\n moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0;\r\n moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;\r\n } while (moveLeft || moveRight);\r\n\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n\r\n this.isTextHighlightOn = true;\r\n this._clickedCoordinate = null;\r\n this._blinkIsEven = true;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n }\r\n /** @internal */\r\n protected _selectAllText() {\r\n this._blinkIsEven = true;\r\n this.isTextHighlightOn = true;\r\n\r\n this._startHighlightIndex = 0;\r\n this._endHighlightIndex = this._textWrapper.length;\r\n this._cursorOffset = this._textWrapper.length;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Handles the keyboard event\r\n * @param evt Defines the KeyboardEvent\r\n */\r\n public processKeyboard(evt: IKeyboardEvent): void {\r\n // process pressed key\r\n this.processKey(evt.keyCode, evt.key, evt);\r\n\r\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _onCopyText(ev: ClipboardEvent): void {\r\n this.isTextHighlightOn = false;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n this._host.clipboardData = this._highlightedText;\r\n }\r\n /**\r\n * @internal\r\n */\r\n protected _onCutText(ev: ClipboardEvent): void {\r\n if (!this._highlightedText) {\r\n return;\r\n }\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n\r\n this._host.clipboardData = this._highlightedText;\r\n this._highlightedText = \"\";\r\n }\r\n /**\r\n * @internal\r\n */\r\n protected _onPasteText(ev: ClipboardEvent): void {\r\n let data: string = \"\";\r\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\r\n data = ev.clipboardData.getData(\"text/plain\");\r\n } else {\r\n //get the cached data; returns blank string by default\r\n data = this._host.clipboardData;\r\n }\r\n const insertPosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(insertPosition, insertPosition, data);\r\n this._textHasChanged();\r\n }\r\n\r\n public _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n // Background\r\n if (this._isFocused) {\r\n if (this._focusedBackground) {\r\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n } else if (this._background) {\r\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n if (!this._fontOffset || this._wasDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n\r\n // Text\r\n const clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);\r\n if (this.color) {\r\n context.fillStyle = this.color;\r\n }\r\n\r\n let text = this._beforeRenderText(this._textWrapper);\r\n\r\n if (!this._isFocused && !this._textWrapper.text && this._placeholderText) {\r\n text = new TextWrapper();\r\n text.text = this._placeholderText;\r\n\r\n if (this._placeholderColor) {\r\n context.fillStyle = this._placeholderColor;\r\n }\r\n }\r\n\r\n this._textWidth = context.measureText(text.text).width;\r\n const marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;\r\n if (this._autoStretchWidth) {\r\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + \"px\";\r\n this._autoStretchWidth = true; // setting the width will have reset _autoStretchWidth to false!\r\n }\r\n\r\n const rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2;\r\n const availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth;\r\n\r\n context.save();\r\n context.beginPath();\r\n context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height);\r\n context.clip();\r\n\r\n if (this._isFocused && this._textWidth > availableWidth) {\r\n const textLeft = clipTextLeft - this._textWidth + availableWidth;\r\n if (!this._scrollLeft) {\r\n this._scrollLeft = textLeft;\r\n }\r\n } else {\r\n this._scrollLeft = clipTextLeft;\r\n }\r\n\r\n context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);\r\n\r\n // Cursor\r\n if (this._isFocused) {\r\n // Need to move cursor\r\n if (this._clickedCoordinate) {\r\n const rightPosition = this._scrollLeft + this._textWidth;\r\n const absoluteCursorPosition = rightPosition - this._clickedCoordinate;\r\n let currentSize = 0;\r\n this._cursorOffset = 0;\r\n let previousDist = 0;\r\n do {\r\n if (this._cursorOffset) {\r\n previousDist = Math.abs(absoluteCursorPosition - currentSize);\r\n }\r\n this._cursorOffset++;\r\n currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;\r\n } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset);\r\n\r\n // Find closest move\r\n if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {\r\n this._cursorOffset--;\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._clickedCoordinate = null;\r\n }\r\n\r\n // Render cursor\r\n if (!this._blinkIsEven) {\r\n const cursorOffsetText = text.substr(text.length - this._cursorOffset);\r\n const cursorOffsetWidth = context.measureText(cursorOffsetText).width;\r\n let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth;\r\n\r\n if (cursorLeft < clipTextLeft) {\r\n this._scrollLeft += clipTextLeft - cursorLeft;\r\n cursorLeft = clipTextLeft;\r\n this._markAsDirty();\r\n } else if (cursorLeft > clipTextLeft + availableWidth) {\r\n this._scrollLeft += clipTextLeft + availableWidth - cursorLeft;\r\n cursorLeft = clipTextLeft + availableWidth;\r\n this._markAsDirty();\r\n }\r\n if (!this.isTextHighlightOn) {\r\n context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);\r\n }\r\n }\r\n\r\n clearTimeout(this._blinkTimeout);\r\n this._blinkTimeout = <any>setTimeout(() => {\r\n this._blinkIsEven = !this._blinkIsEven;\r\n this._markAsDirty();\r\n }, 500);\r\n\r\n //show the highlighted text\r\n if (this.isTextHighlightOn) {\r\n clearTimeout(this._blinkTimeout);\r\n const highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;\r\n let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;\r\n this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex);\r\n let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width;\r\n if (highlightCursorLeft < clipTextLeft) {\r\n width = width - (clipTextLeft - highlightCursorLeft);\r\n if (!width) {\r\n // when using left arrow on text.length > availableWidth;\r\n // assigns the width of the first letter after clipTextLeft\r\n width = context.measureText(text.charAt(text.length - this._cursorOffset)).width;\r\n }\r\n highlightCursorLeft = clipTextLeft;\r\n }\r\n //for transparancy\r\n context.globalAlpha = this._highligherOpacity;\r\n context.fillStyle = this._textHighlightColor;\r\n context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height);\r\n context.globalAlpha = 1.0;\r\n }\r\n }\r\n context.restore();\r\n\r\n // Border\r\n if (this._thickness) {\r\n if (this._isFocused) {\r\n if (this.focusedColor) {\r\n context.strokeStyle = this.focusedColor;\r\n }\r\n } else {\r\n if (this.color) {\r\n context.strokeStyle = this.color;\r\n }\r\n }\r\n\r\n context.lineWidth = this._thickness;\r\n\r\n context.strokeRect(\r\n this._currentMeasure.left + this._thickness / 2,\r\n this._currentMeasure.top + this._thickness / 2,\r\n this._currentMeasure.width - this._thickness,\r\n this._currentMeasure.height - this._thickness\r\n );\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._clickedCoordinate = coordinates.x;\r\n this.isTextHighlightOn = false;\r\n this._highlightedText = \"\";\r\n this._cursorIndex = -1;\r\n this._isPointerDown = true;\r\n this._host._capturingControl[pointerId] = this;\r\n this._focusedBy = (pi.event as IPointerEvent).pointerType;\r\n if (this._host.focusedControl === this) {\r\n // Move cursor\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n return true;\r\n }\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._host.focusedControl = this;\r\n\r\n return true;\r\n }\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\r\n this._clickedCoordinate = coordinates.x;\r\n this._markAsDirty();\r\n this._updateValueFromCursorIndex(this._cursorOffset);\r\n }\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._isPointerDown = false;\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\r\n }\r\n\r\n protected _beforeRenderText(textWrapper: TextWrapper): TextWrapper {\r\n return textWrapper;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private set isTextHighlightOn(value: boolean) {\r\n if (this._isTextHighlightOn === value) {\r\n return;\r\n }\r\n if (value) {\r\n this.onTextHighlightObservable.notifyObservers(this);\r\n }\r\n this._isTextHighlightOn = value;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private get isTextHighlightOn(): boolean {\r\n return this._isTextHighlightOn;\r\n }\r\n\r\n public dispose() {\r\n super.dispose();\r\n\r\n this.onBlurObservable.clear();\r\n this.onFocusObservable.clear();\r\n this.onTextChangedObservable.clear();\r\n this.onTextCopyObservable.clear();\r\n this.onTextCutObservable.clear();\r\n this.onTextPasteObservable.clear();\r\n this.onTextHighlightObservable.clear();\r\n this.onKeyboardEventProcessedObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.InputText\", InputText);\r\n"]}
|
1
|
+
{"version":3,"file":"inputText.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/inputText.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,mBAAmB,EAAE,kDAAoC;AAElE,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/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B,CAAC;IACnC,CAAC;IAEM,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,kCAAkC,CAAC,KAAK,EAAE,CAAC;IACpD,CAAC;CACJ;AAvkCU;IADN,SAAS,EAAE;gDACgC;AAGrC;IADN,SAAS,EAAE;sDACuB;AAqDnC;IADC,SAAS,EAAE;yCAGX;AAmBD;IADC,SAAS,EAAE;kDAGX;AAWD;IADC,SAAS,EAAE;iDAGX;AAaD;IADC,SAAS,EAAE;mDAGX;AAYD;IADC,SAAS,EAAE;uCAGX;AAmBD;IADC,SAAS,EAAE;iDAGX;AAaD;IADC,SAAS,EAAE;0CAGX;AAaD;IADC,SAAS,EAAE;kDAGX;AAaD;IADC,SAAS,EAAE;6CAGX;AAaD;IADC,SAAS,EAAE;2CAGX;AAaD;IADC,SAAS,EAAE;iDAGX;AAaD;IADC,SAAS,EAAE;gDAGX;AAYD;IADC,SAAS,EAAE;wCAGX;AAsCD;IADC,SAAS,EAAE;qCAGX;AA+BD;IADC,SAAS,EAAE;sCAGX;AAywBL,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\nimport type { ClipboardInfo } from \"core/Events/clipboardEvents\";\r\nimport { ClipboardEventTypes } from \"core/Events/clipboardEvents\";\r\nimport type { PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { IFocusableControl } from \"./focusableControl\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport type { VirtualKeyboard } from \"./virtualKeyboard\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { TextWrapper } from \"./textWrapper\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { IKeyboardEvent, IPointerEvent } from \"core/Events/deviceInputEvents\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/**\r\n * Class used to create input text control\r\n */\r\nexport class InputText extends Control implements IFocusableControl {\r\n protected _textWrapper: TextWrapper;\r\n protected _placeholderText = \"\";\r\n protected _background = \"#222222\";\r\n protected _focusedBackground = \"#000000\";\r\n protected _focusedColor = \"white\";\r\n protected _placeholderColor = \"gray\";\r\n protected _thickness = 1;\r\n protected _margin = new ValueAndUnit(10, ValueAndUnit.UNITMODE_PIXEL);\r\n protected _autoStretchWidth = true;\r\n protected _maxWidth = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n protected _isFocused = false;\r\n /** the type of device that most recently focused the input: \"mouse\", \"touch\" or \"pen\" */\r\n protected _focusedBy: string;\r\n protected _blinkTimeout: number;\r\n protected _blinkIsEven = false;\r\n private _cursorOffset = 0;\r\n protected _scrollLeft: Nullable<number>;\r\n protected _textWidth: number;\r\n protected _clickedCoordinate: Nullable<number>;\r\n protected _deadKey = false;\r\n protected _addKey = true;\r\n protected _currentKey = \"\";\r\n protected _isTextHighlightOn = false;\r\n protected _textHighlightColor = \"#d5e0ff\";\r\n protected _highligherOpacity = 0.4;\r\n protected _highlightedText = \"\";\r\n private _startHighlightIndex = 0;\r\n private _endHighlightIndex = 0;\r\n private _cursorIndex = -1;\r\n private _outlineWidth: number = 0;\r\n private _outlineColor: string = \"white\";\r\n protected _onFocusSelectAll = false;\r\n protected _isPointerDown = false;\r\n protected _onClipboardObserver: Nullable<Observer<ClipboardInfo>>;\r\n protected _onPointerDblTapObserver: Nullable<Observer<PointerInfo>>;\r\n\r\n /** @internal */\r\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\r\n\r\n /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */\r\n @serialize()\r\n public promptMessage = \"Please enter text:\";\r\n /** Force disable prompt on mobile device */\r\n @serialize()\r\n public disableMobilePrompt = false;\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n public get outlineWidth(): number {\r\n return this._outlineWidth;\r\n }\r\n\r\n public set outlineWidth(value: number) {\r\n if (this._outlineWidth === value) {\r\n return;\r\n }\r\n this._outlineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n public get outlineColor(): string {\r\n return this._outlineColor;\r\n }\r\n\r\n public set outlineColor(value: string) {\r\n if (this._outlineColor === value) {\r\n return;\r\n }\r\n this._outlineColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Observable raised when the text changes */\r\n public onTextChangedObservable = new Observable<InputText>();\r\n /** Observable raised just before an entered character is to be added */\r\n public onBeforeKeyAddObservable = new Observable<InputText>();\r\n /** Observable raised when the control gets the focus */\r\n public onFocusObservable = new Observable<InputText>();\r\n /** Observable raised when the control loses the focus */\r\n public onBlurObservable = new Observable<InputText>();\r\n /** Observable raised when the text is highlighted */\r\n public onTextHighlightObservable = new Observable<InputText>();\r\n /** Observable raised when copy event is triggered */\r\n public onTextCopyObservable = new Observable<InputText>();\r\n /** Observable raised when cut event is triggered */\r\n public onTextCutObservable = new Observable<InputText>();\r\n /** Observable raised when paste event is triggered */\r\n public onTextPasteObservable = new Observable<InputText>();\r\n /** Observable raised when a key event was processed */\r\n public onKeyboardEventProcessedObservable = new Observable<IKeyboardEvent>();\r\n\r\n /** Gets or sets the maximum width allowed by the control */\r\n @serialize()\r\n public get maxWidth(): string | number {\r\n return this._maxWidth.toString(this._host);\r\n }\r\n\r\n /** Gets the maximum width allowed by the control in pixels */\r\n public get maxWidthInPixels(): number {\r\n return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set maxWidth(value: string | number) {\r\n if (this._maxWidth.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._maxWidth.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets the text highlighter transparency; default: 0.4 */\r\n @serialize()\r\n public get highligherOpacity(): number {\r\n return this._highligherOpacity;\r\n }\r\n\r\n public set highligherOpacity(value: number) {\r\n if (this._highligherOpacity === value) {\r\n return;\r\n }\r\n this._highligherOpacity = value;\r\n this._markAsDirty();\r\n }\r\n /** Gets or sets a boolean indicating whether to select complete text by default on input focus */\r\n @serialize()\r\n public get onFocusSelectAll(): boolean {\r\n return this._onFocusSelectAll;\r\n }\r\n\r\n public set onFocusSelectAll(value: boolean) {\r\n if (this._onFocusSelectAll === value) {\r\n return;\r\n }\r\n\r\n this._onFocusSelectAll = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the text hightlight color */\r\n @serialize()\r\n public get textHighlightColor(): string {\r\n return this._textHighlightColor;\r\n }\r\n\r\n public set textHighlightColor(value: string) {\r\n if (this._textHighlightColor === value) {\r\n return;\r\n }\r\n this._textHighlightColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets control margin */\r\n @serialize()\r\n public get margin(): string {\r\n return this._margin.toString(this._host);\r\n }\r\n\r\n /** Gets control margin in pixels */\r\n public get marginInPixels(): number {\r\n return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set margin(value: string) {\r\n if (this._margin.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._margin.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */\r\n @serialize()\r\n public get autoStretchWidth(): boolean {\r\n return this._autoStretchWidth;\r\n }\r\n\r\n public set autoStretchWidth(value: boolean) {\r\n if (this._autoStretchWidth === value) {\r\n return;\r\n }\r\n\r\n this._autoStretchWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets border thickness */\r\n @serialize()\r\n public get thickness(): number {\r\n return this._thickness;\r\n }\r\n\r\n public set thickness(value: number) {\r\n if (this._thickness === value) {\r\n return;\r\n }\r\n\r\n this._thickness = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color when focused */\r\n @serialize()\r\n public get focusedBackground(): string {\r\n return this._focusedBackground;\r\n }\r\n\r\n public set focusedBackground(value: string) {\r\n if (this._focusedBackground === value) {\r\n return;\r\n }\r\n\r\n this._focusedBackground = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color when focused */\r\n @serialize()\r\n public get focusedColor(): string {\r\n return this._focusedColor;\r\n }\r\n\r\n public set focusedColor(value: string) {\r\n if (this._focusedColor === value) {\r\n return;\r\n }\r\n\r\n this._focusedColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the background color */\r\n @serialize()\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the placeholder color */\r\n @serialize()\r\n public get placeholderColor(): string {\r\n return this._placeholderColor;\r\n }\r\n\r\n public set placeholderColor(value: string) {\r\n if (this._placeholderColor === value) {\r\n return;\r\n }\r\n\r\n this._placeholderColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the text displayed when the control is empty */\r\n @serialize()\r\n public get placeholderText(): string {\r\n return this._placeholderText;\r\n }\r\n\r\n public set placeholderText(value: string) {\r\n if (this._placeholderText === value) {\r\n return;\r\n }\r\n this._placeholderText = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the dead key. 0 to disable. */\r\n @serialize()\r\n public get deadKey(): boolean {\r\n return this._deadKey;\r\n }\r\n\r\n public set deadKey(flag: boolean) {\r\n this._deadKey = flag;\r\n }\r\n\r\n /** Gets or sets the highlight text */\r\n public get highlightedText(): string {\r\n return this._highlightedText;\r\n }\r\n public set highlightedText(text: string) {\r\n if (this._highlightedText === text) {\r\n return;\r\n }\r\n this._highlightedText = text;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets if the current key should be added */\r\n public get addKey(): boolean {\r\n return this._addKey;\r\n }\r\n\r\n public set addKey(flag: boolean) {\r\n this._addKey = flag;\r\n }\r\n\r\n /** Gets or sets the value of the current key being entered */\r\n public get currentKey(): string {\r\n return this._currentKey;\r\n }\r\n\r\n public set currentKey(key: string) {\r\n this._currentKey = key;\r\n }\r\n\r\n /** Gets or sets the text displayed in the control */\r\n @serialize()\r\n public get text(): string {\r\n return this._textWrapper.text;\r\n }\r\n\r\n public set text(value: string) {\r\n const valueAsString = value.toString(); // Forcing convertion\r\n\r\n if (!this._textWrapper) {\r\n this._textWrapper = new TextWrapper();\r\n }\r\n\r\n if (this._textWrapper.text === valueAsString) {\r\n return;\r\n }\r\n this._textWrapper.text = valueAsString;\r\n this._textHasChanged();\r\n }\r\n\r\n protected _textHasChanged(): void {\r\n this._markAsDirty();\r\n this.onTextChangedObservable.notifyObservers(this);\r\n }\r\n\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n super._applyStates(context);\r\n if (this.outlineWidth) {\r\n context.lineWidth = this.outlineWidth;\r\n context.strokeStyle = this.outlineColor;\r\n }\r\n }\r\n\r\n /** Gets or sets control width */\r\n @serialize()\r\n public get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public set width(value: string | number) {\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n\r\n this.autoStretchWidth = false;\r\n }\r\n\r\n /**\r\n * Creates a new InputText\r\n * @param name defines the control name\r\n * @param text defines the text of the control\r\n */\r\n constructor(\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n this.isPointerBlocker = true;\r\n }\r\n\r\n /** @internal */\r\n public onBlur(): void {\r\n this._isFocused = false;\r\n this._scrollLeft = null;\r\n this._cursorOffset = 0;\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n\r\n this.onBlurObservable.notifyObservers(this);\r\n\r\n this._host.unRegisterClipboardEvents();\r\n if (this._onClipboardObserver) {\r\n this._host.onClipboardObservable.remove(this._onClipboardObserver);\r\n }\r\n const scene = this._host.getScene();\r\n if (this._onPointerDblTapObserver && scene) {\r\n scene.onPointerObservable.remove(this._onPointerDblTapObserver);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public onFocus(): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n this._scrollLeft = null;\r\n this._isFocused = true;\r\n this._blinkIsEven = false;\r\n this._cursorOffset = 0;\r\n this._markAsDirty();\r\n\r\n this.onFocusObservable.notifyObservers(this);\r\n\r\n if (this._focusedBy === \"touch\" && !this.disableMobilePrompt) {\r\n const value = prompt(this.promptMessage);\r\n\r\n if (value !== null) {\r\n this.text = value;\r\n }\r\n this._host.focusedControl = null;\r\n return;\r\n }\r\n\r\n this._host.registerClipboardEvents();\r\n\r\n this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => {\r\n // process clipboard event, can be configured.\r\n switch (clipboardInfo.type) {\r\n case ClipboardEventTypes.COPY:\r\n this._onCopyText(clipboardInfo.event);\r\n this.onTextCopyObservable.notifyObservers(this);\r\n break;\r\n case ClipboardEventTypes.CUT:\r\n this._onCutText(clipboardInfo.event);\r\n this.onTextCutObservable.notifyObservers(this);\r\n break;\r\n case ClipboardEventTypes.PASTE:\r\n this._onPasteText(clipboardInfo.event);\r\n this.onTextPasteObservable.notifyObservers(this);\r\n break;\r\n default:\r\n return;\r\n }\r\n });\r\n\r\n const scene = this._host.getScene();\r\n if (scene) {\r\n //register the pointer double tap event\r\n this._onPointerDblTapObserver = scene.onPointerObservable.add((pointerInfo) => {\r\n if (!this._isFocused) {\r\n return;\r\n }\r\n if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) {\r\n this._processDblClick(pointerInfo);\r\n }\r\n });\r\n }\r\n\r\n if (this._onFocusSelectAll) {\r\n this._selectAllText();\r\n }\r\n }\r\n\r\n /**\r\n * Function to focus an inputText programmatically\r\n */\r\n public focus() {\r\n this._host.moveFocusToControl(this);\r\n }\r\n\r\n /**\r\n * Function to unfocus an inputText programmatically\r\n */\r\n public blur() {\r\n this._host.focusedControl = null;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"InputText\";\r\n }\r\n\r\n /**\r\n * Function called to get the list of controls that should not steal the focus from this control\r\n * @returns an array of controls\r\n */\r\n public keepsFocusWith(): Nullable<Control[]> {\r\n if (!this._connectedVirtualKeyboard) {\r\n return null;\r\n }\r\n return [this._connectedVirtualKeyboard];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public processKey(keyCode: number, key?: string, evt?: IKeyboardEvent) {\r\n if (this.isReadOnly) {\r\n return;\r\n }\r\n\r\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\r\n if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) {\r\n return;\r\n }\r\n\r\n //select all\r\n if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) {\r\n this._selectAllText();\r\n evt.preventDefault();\r\n return;\r\n }\r\n // Specific cases\r\n switch (keyCode) {\r\n case 32: //SPACE\r\n key = \" \"; //ie11 key for space is \"Spacebar\"\r\n break;\r\n case 191: //SLASH\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case 8: // BACKSPACE\r\n if (this._textWrapper.text && this._textWrapper.length > 0) {\r\n //delete the highlighted text\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n this._blinkIsEven = false;\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n }\r\n //delete single character\r\n if (this._cursorOffset === 0) {\r\n this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);\r\n } else {\r\n const deletePosition = this._textWrapper.length - this._cursorOffset;\r\n if (deletePosition > 0) {\r\n this._textWrapper.removePart(deletePosition - 1, deletePosition);\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n case 46: // DELETE\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n }\r\n if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {\r\n const deletePosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(deletePosition, deletePosition + 1);\r\n this._textHasChanged();\r\n this._cursorOffset--;\r\n }\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n return;\r\n case 13: // RETURN\r\n this._host.focusedControl = null;\r\n this.isTextHighlightOn = false;\r\n return;\r\n case 35: // END\r\n this._cursorOffset = 0;\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case 36: // HOME\r\n this._cursorOffset = this._textWrapper.length;\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case 37: // LEFT\r\n this._cursorOffset++;\r\n if (this._cursorOffset > this._textWrapper.length) {\r\n this._cursorOffset = this._textWrapper.length;\r\n }\r\n\r\n if (evt && evt.shiftKey) {\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n // shift + ctrl/cmd + <-\r\n if (evt.ctrlKey || evt.metaKey) {\r\n if (!this.isTextHighlightOn) {\r\n if (this._textWrapper.length === this._cursorOffset) {\r\n return;\r\n } else {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;\r\n }\r\n }\r\n this._startHighlightIndex = 0;\r\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\r\n this._cursorOffset = this._textWrapper.length;\r\n this.isTextHighlightOn = true;\r\n this._markAsDirty();\r\n return;\r\n }\r\n //store the starting point\r\n if (!this.isTextHighlightOn) {\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1;\r\n }\r\n //if text is already highlighted\r\n else if (this._cursorIndex === -1) {\r\n this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;\r\n this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1;\r\n }\r\n //set the highlight indexes\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n }\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (this.isTextHighlightOn) {\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n this.isTextHighlightOn = false;\r\n }\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._cursorOffset = this._textWrapper.length;\r\n evt.preventDefault();\r\n }\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n return;\r\n case 39: // RIGHT\r\n this._cursorOffset--;\r\n if (this._cursorOffset < 0) {\r\n this._cursorOffset = 0;\r\n }\r\n if (evt && evt.shiftKey) {\r\n //update the cursor\r\n this._blinkIsEven = false;\r\n //shift + ctrl/cmd + ->\r\n if (evt.ctrlKey || evt.metaKey) {\r\n if (!this.isTextHighlightOn) {\r\n if (this._cursorOffset === 0) {\r\n return;\r\n } else {\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;\r\n }\r\n }\r\n this._endHighlightIndex = this._textWrapper.length;\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\r\n this._cursorOffset = 0;\r\n this._markAsDirty();\r\n return;\r\n }\r\n\r\n if (!this.isTextHighlightOn) {\r\n this.isTextHighlightOn = true;\r\n this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1;\r\n }\r\n //if text is already highlighted\r\n else if (this._cursorIndex === -1) {\r\n this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;\r\n this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1;\r\n }\r\n //set the highlight indexes\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n }\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (this.isTextHighlightOn) {\r\n this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;\r\n this.isTextHighlightOn = false;\r\n }\r\n //ctr + ->\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._cursorOffset = 0;\r\n evt.preventDefault();\r\n }\r\n this._blinkIsEven = false;\r\n this.isTextHighlightOn = false;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n return;\r\n }\r\n if (keyCode === 32) {\r\n key = evt?.key ?? \" \";\r\n }\r\n this._deadKey = key === \"Dead\";\r\n // Printable characters\r\n if (\r\n key &&\r\n (keyCode === -1 || // Direct access\r\n keyCode === 32 || // Space\r\n keyCode === 34 || // \" add support for single and double quotes\r\n keyCode === 39 || // '\r\n (keyCode > 47 && keyCode < 64) || // Numbers\r\n (keyCode > 64 && keyCode < 91) || // Letters\r\n (keyCode > 159 && keyCode < 193) || // Special characters\r\n (keyCode > 218 && keyCode < 223) || // Special characters\r\n (keyCode > 95 && keyCode < 112))\r\n ) {\r\n // Numpad\r\n this._currentKey = key;\r\n this.onBeforeKeyAddObservable.notifyObservers(this);\r\n key = this._currentKey;\r\n if (this._addKey && !this._deadKey) {\r\n if (this.isTextHighlightOn) {\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);\r\n this._textHasChanged();\r\n this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);\r\n this.isTextHighlightOn = false;\r\n this._blinkIsEven = false;\r\n this._markAsDirty();\r\n } else if (this._cursorOffset === 0) {\r\n this.text += this._deadKey && evt?.key ? evt.key : key;\r\n } else {\r\n const insertPosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(insertPosition, insertPosition, key);\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _updateValueFromCursorIndex(offset: number) {\r\n //update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (this._cursorIndex === -1) {\r\n this._cursorIndex = offset;\r\n } else {\r\n if (this._cursorIndex < this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n } else if (this._cursorIndex > this._cursorOffset) {\r\n this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;\r\n } else {\r\n this.isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n }\r\n }\r\n this.isTextHighlightOn = true;\r\n this._markAsDirty();\r\n }\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _processDblClick(evt: PointerInfo) {\r\n //pre-find the start and end index of the word under cursor, speeds up the rendering\r\n this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;\r\n this._endHighlightIndex = this._startHighlightIndex;\r\n let moveLeft, moveRight;\r\n do {\r\n moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0;\r\n moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;\r\n } while (moveLeft || moveRight);\r\n\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n\r\n this.isTextHighlightOn = true;\r\n this._clickedCoordinate = null;\r\n this._blinkIsEven = true;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n }\r\n /** @internal */\r\n protected _selectAllText() {\r\n this._blinkIsEven = true;\r\n this.isTextHighlightOn = true;\r\n\r\n this._startHighlightIndex = 0;\r\n this._endHighlightIndex = this._textWrapper.length;\r\n this._cursorOffset = this._textWrapper.length;\r\n this._cursorIndex = -1;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Handles the keyboard event\r\n * @param evt Defines the KeyboardEvent\r\n */\r\n public processKeyboard(evt: IKeyboardEvent): void {\r\n // process pressed key\r\n this.processKey(evt.keyCode, evt.key, evt);\r\n\r\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _onCopyText(ev: ClipboardEvent): void {\r\n this.isTextHighlightOn = false;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n this._host.clipboardData = this._highlightedText;\r\n }\r\n /**\r\n * @internal\r\n */\r\n protected _onCutText(ev: ClipboardEvent): void {\r\n if (!this._highlightedText) {\r\n return;\r\n }\r\n this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);\r\n this._textHasChanged();\r\n this.isTextHighlightOn = false;\r\n this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n\r\n this._host.clipboardData = this._highlightedText;\r\n this._highlightedText = \"\";\r\n }\r\n /**\r\n * @internal\r\n */\r\n protected _onPasteText(ev: ClipboardEvent): void {\r\n let data: string = \"\";\r\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\r\n data = ev.clipboardData.getData(\"text/plain\");\r\n } else {\r\n //get the cached data; returns blank string by default\r\n data = this._host.clipboardData;\r\n }\r\n const insertPosition = this._textWrapper.length - this._cursorOffset;\r\n this._textWrapper.removePart(insertPosition, insertPosition, data);\r\n this._textHasChanged();\r\n }\r\n\r\n public _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n // Background\r\n if (this._isFocused) {\r\n if (this._focusedBackground) {\r\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n } else if (this._background) {\r\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n if (!this._fontOffset || this._wasDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n\r\n // Text\r\n const clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);\r\n if (this.color) {\r\n context.fillStyle = this.color;\r\n }\r\n\r\n let text = this._beforeRenderText(this._textWrapper);\r\n\r\n if (!this._isFocused && !this._textWrapper.text && this._placeholderText) {\r\n text = new TextWrapper();\r\n text.text = this._placeholderText;\r\n\r\n if (this._placeholderColor) {\r\n context.fillStyle = this._placeholderColor;\r\n }\r\n }\r\n\r\n this._textWidth = context.measureText(text.text).width;\r\n const marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;\r\n if (this._autoStretchWidth) {\r\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + \"px\";\r\n this._autoStretchWidth = true; // setting the width will have reset _autoStretchWidth to false!\r\n }\r\n\r\n const rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2;\r\n const availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth;\r\n\r\n context.save();\r\n context.beginPath();\r\n context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height);\r\n context.clip();\r\n\r\n if (this._isFocused && this._textWidth > availableWidth) {\r\n const textLeft = clipTextLeft - this._textWidth + availableWidth;\r\n if (!this._scrollLeft) {\r\n this._scrollLeft = textLeft;\r\n }\r\n } else {\r\n this._scrollLeft = clipTextLeft;\r\n }\r\n\r\n if (this.outlineWidth) {\r\n context.strokeText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);\r\n }\r\n\r\n context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);\r\n\r\n // Cursor\r\n if (this._isFocused) {\r\n // Need to move cursor\r\n if (this._clickedCoordinate) {\r\n const rightPosition = this._scrollLeft + this._textWidth;\r\n const absoluteCursorPosition = rightPosition - this._clickedCoordinate;\r\n let currentSize = 0;\r\n this._cursorOffset = 0;\r\n let previousDist = 0;\r\n do {\r\n if (this._cursorOffset) {\r\n previousDist = Math.abs(absoluteCursorPosition - currentSize);\r\n }\r\n this._cursorOffset++;\r\n currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;\r\n } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset);\r\n\r\n // Find closest move\r\n if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {\r\n this._cursorOffset--;\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._clickedCoordinate = null;\r\n }\r\n\r\n // Render cursor\r\n if (!this._blinkIsEven) {\r\n const cursorOffsetText = text.substr(text.length - this._cursorOffset);\r\n const cursorOffsetWidth = context.measureText(cursorOffsetText).width;\r\n let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth;\r\n\r\n if (cursorLeft < clipTextLeft) {\r\n this._scrollLeft += clipTextLeft - cursorLeft;\r\n cursorLeft = clipTextLeft;\r\n this._markAsDirty();\r\n } else if (cursorLeft > clipTextLeft + availableWidth) {\r\n this._scrollLeft += clipTextLeft + availableWidth - cursorLeft;\r\n cursorLeft = clipTextLeft + availableWidth;\r\n this._markAsDirty();\r\n }\r\n if (!this.isTextHighlightOn) {\r\n context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);\r\n }\r\n }\r\n\r\n clearTimeout(this._blinkTimeout);\r\n this._blinkTimeout = <any>setTimeout(() => {\r\n this._blinkIsEven = !this._blinkIsEven;\r\n this._markAsDirty();\r\n }, 500);\r\n\r\n //show the highlighted text\r\n if (this.isTextHighlightOn) {\r\n clearTimeout(this._blinkTimeout);\r\n const highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;\r\n let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;\r\n this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex);\r\n let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width;\r\n if (highlightCursorLeft < clipTextLeft) {\r\n width = width - (clipTextLeft - highlightCursorLeft);\r\n if (!width) {\r\n // when using left arrow on text.length > availableWidth;\r\n // assigns the width of the first letter after clipTextLeft\r\n width = context.measureText(text.charAt(text.length - this._cursorOffset)).width;\r\n }\r\n highlightCursorLeft = clipTextLeft;\r\n }\r\n //for transparancy\r\n context.globalAlpha = this._highligherOpacity;\r\n context.fillStyle = this._textHighlightColor;\r\n context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height);\r\n context.globalAlpha = 1.0;\r\n }\r\n }\r\n context.restore();\r\n\r\n // Border\r\n if (this._thickness) {\r\n if (this._isFocused) {\r\n if (this.focusedColor) {\r\n context.strokeStyle = this.focusedColor;\r\n }\r\n } else {\r\n if (this.color) {\r\n context.strokeStyle = this.color;\r\n }\r\n }\r\n\r\n context.lineWidth = this._thickness;\r\n\r\n context.strokeRect(\r\n this._currentMeasure.left + this._thickness / 2,\r\n this._currentMeasure.top + this._thickness / 2,\r\n this._currentMeasure.width - this._thickness,\r\n this._currentMeasure.height - this._thickness\r\n );\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._clickedCoordinate = coordinates.x;\r\n this.isTextHighlightOn = false;\r\n this._highlightedText = \"\";\r\n this._cursorIndex = -1;\r\n this._isPointerDown = true;\r\n this._host._capturingControl[pointerId] = this;\r\n this._focusedBy = (pi.event as IPointerEvent).pointerType;\r\n if (this._host.focusedControl === this) {\r\n // Move cursor\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n return true;\r\n }\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._host.focusedControl = this;\r\n\r\n return true;\r\n }\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\r\n this._clickedCoordinate = coordinates.x;\r\n this._markAsDirty();\r\n this._updateValueFromCursorIndex(this._cursorOffset);\r\n }\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._isPointerDown = false;\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\r\n }\r\n\r\n protected _beforeRenderText(textWrapper: TextWrapper): TextWrapper {\r\n return textWrapper;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private set isTextHighlightOn(value: boolean) {\r\n if (this._isTextHighlightOn === value) {\r\n return;\r\n }\r\n if (value) {\r\n this.onTextHighlightObservable.notifyObservers(this);\r\n }\r\n this._isTextHighlightOn = value;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private get isTextHighlightOn(): boolean {\r\n return this._isTextHighlightOn;\r\n }\r\n\r\n public dispose() {\r\n super.dispose();\r\n\r\n this.onBlurObservable.clear();\r\n this.onFocusObservable.clear();\r\n this.onTextChangedObservable.clear();\r\n this.onTextCopyObservable.clear();\r\n this.onTextCutObservable.clear();\r\n this.onTextPasteObservable.clear();\r\n this.onTextHighlightObservable.clear();\r\n this.onKeyboardEventProcessedObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.InputText\", InputText);\r\n"]}
|
@@ -18,8 +18,6 @@ export declare class InputTextArea extends InputText {
|
|
18
18
|
private _prevText;
|
19
19
|
private _lines;
|
20
20
|
private _lineSpacing;
|
21
|
-
private _outlineWidth;
|
22
|
-
private _outlineColor;
|
23
21
|
private _maxHeight;
|
24
22
|
private _clipTextTop;
|
25
23
|
private _clipTextLeft;
|
@@ -38,22 +36,6 @@ export declare class InputTextArea extends InputText {
|
|
38
36
|
private _availableHeight;
|
39
37
|
private _scrollTop;
|
40
38
|
private _autoStretchHeight;
|
41
|
-
/**
|
42
|
-
* Gets or sets outlineWidth of the text to display
|
43
|
-
*/
|
44
|
-
get outlineWidth(): number;
|
45
|
-
/**
|
46
|
-
* Gets or sets outlineWidth of the text to display
|
47
|
-
*/
|
48
|
-
set outlineWidth(value: number);
|
49
|
-
/**
|
50
|
-
* Gets or sets outlineColor of the text to display
|
51
|
-
*/
|
52
|
-
get outlineColor(): string;
|
53
|
-
/**
|
54
|
-
* Gets or sets outlineColor of the text to display
|
55
|
-
*/
|
56
|
-
set outlineColor(value: string);
|
57
39
|
/** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
|
58
40
|
get autoStretchHeight(): boolean;
|
59
41
|
set autoStretchHeight(value: boolean);
|
@@ -134,7 +116,6 @@ export declare class InputTextArea extends InputText {
|
|
134
116
|
protected _onPasteText(ev: ClipboardEvent): void;
|
135
117
|
_draw(context: ICanvasRenderingContext): void;
|
136
118
|
private _resetBlinking;
|
137
|
-
protected _applyStates(context: ICanvasRenderingContext): void;
|
138
119
|
_onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean;
|
139
120
|
_onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void;
|
140
121
|
/**
|
@@ -9,38 +9,6 @@ import { serialize } from "@babylonjs/core/Misc/decorators.js";
|
|
9
9
|
* Class used to create input text control
|
10
10
|
*/
|
11
11
|
export class InputTextArea extends InputText {
|
12
|
-
/**
|
13
|
-
* Gets or sets outlineWidth of the text to display
|
14
|
-
*/
|
15
|
-
get outlineWidth() {
|
16
|
-
return this._outlineWidth;
|
17
|
-
}
|
18
|
-
/**
|
19
|
-
* Gets or sets outlineWidth of the text to display
|
20
|
-
*/
|
21
|
-
set outlineWidth(value) {
|
22
|
-
if (this._outlineWidth === value) {
|
23
|
-
return;
|
24
|
-
}
|
25
|
-
this._outlineWidth = value;
|
26
|
-
this._markAsDirty();
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* Gets or sets outlineColor of the text to display
|
30
|
-
*/
|
31
|
-
get outlineColor() {
|
32
|
-
return this._outlineColor;
|
33
|
-
}
|
34
|
-
/**
|
35
|
-
* Gets or sets outlineColor of the text to display
|
36
|
-
*/
|
37
|
-
set outlineColor(value) {
|
38
|
-
if (this._outlineColor === value) {
|
39
|
-
return;
|
40
|
-
}
|
41
|
-
this._outlineColor = value;
|
42
|
-
this._markAsDirty();
|
43
|
-
}
|
44
12
|
/** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
|
45
13
|
get autoStretchHeight() {
|
46
14
|
return this._autoStretchHeight;
|
@@ -89,8 +57,6 @@ export class InputTextArea extends InputText {
|
|
89
57
|
this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
90
58
|
this._prevText = this.text;
|
91
59
|
this._lineSpacing = new ValueAndUnit(0);
|
92
|
-
this._outlineWidth = 0;
|
93
|
-
this._outlineColor = "white";
|
94
60
|
this._maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);
|
95
61
|
/**
|
96
62
|
* An event triggered after the text was broken up into lines
|
@@ -845,13 +811,6 @@ export class InputTextArea extends InputText {
|
|
845
811
|
this._markAsDirty();
|
846
812
|
}, 500);
|
847
813
|
}
|
848
|
-
_applyStates(context) {
|
849
|
-
super._applyStates(context);
|
850
|
-
if (this.outlineWidth) {
|
851
|
-
context.lineWidth = this.outlineWidth;
|
852
|
-
context.strokeStyle = this.outlineColor;
|
853
|
-
}
|
854
|
-
}
|
855
814
|
_onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
|
856
815
|
if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {
|
857
816
|
return false;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"inputTextArea.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/inputTextArea.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAoCxC;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,YAAY,CAAC,KAAa;QACjC,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE;YAC9B,OAAO;SACV;QACD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,YAAY,CAAC,KAAa;QACjC,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE;YAC9B,OAAO;SACV;QACD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,C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AAC,WAAW,CAAC,gBAAgB,CAAC;QAC/E,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC;QAEhF,IAAI,CAAC,yBAAyB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAErD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,gBAAgB;IACN,cAAc;QACpB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,CAAC,oBAAoB,GAAG;YACxB,iBAAiB,EAAE,CAAC;YACpB,yBAAyB,EAAE,CAAC;YAC5B,gBAAgB,EAAE,CAAC;SACtB,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG;YACf,gBAAgB,EAAE,CAAC;YACnB,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YACxC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YACjE,kBAAkB,EAAE,CAAC;YACrB,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;SAC3C,CAAC;QAEF,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAEM,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;CACJ;AA9oCG;IADC,SAAS,EAAE;sDAGX;AA0BD;IADC,SAAS,EAAE;8CAGX;AAinCL,aAAa,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"./control\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport type { VirtualKeyboard } from \"./virtualKeyboard\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Measure } from \"../measure\";\r\nimport { InputText } from \"./inputText\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport type { IKeyboardEvent } from \"core/Events/deviceInputEvents\";\r\n\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to create input text control\r\n */\r\nexport class InputTextArea extends InputText {\r\n private _textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n private _textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n private _prevText: string = this.text;\r\n\r\n private _lines: any[];\r\n private _lineSpacing: ValueAndUnit = new ValueAndUnit(0);\r\n private _outlineWidth: number = 0;\r\n private _outlineColor: string = \"white\";\r\n private _maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n\r\n private _clipTextTop: number;\r\n private _clipTextLeft: number;\r\n\r\n private _cursorInfo: { globalStartIndex: number; globalEndIndex: number; relativeStartIndex: number; relativeEndIndex: number; currentLineIndex: number };\r\n private _highlightCursorInfo: { initialStartIndex: number; initialRelativeStartIndex: number; initialLineIndex: number };\r\n\r\n /**\r\n * An event triggered after the text was broken up into lines\r\n */\r\n public onLinesReadyObservable = new Observable<InputTextArea>();\r\n\r\n /** @internal */\r\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\r\n private _contextForBreakLines: ICanvasRenderingContext;\r\n private _clickedCoordinateX: Nullable<number>;\r\n private _clickedCoordinateY: Nullable<number>;\r\n\r\n private _availableWidth: number;\r\n private _availableHeight: number;\r\n\r\n private _scrollTop: Nullable<number>;\r\n\r\n private _autoStretchHeight: boolean;\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n public get outlineWidth(): number {\r\n return this._outlineWidth;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineWidth of the text to display\r\n */\r\n public set outlineWidth(value: number) {\r\n if (this._outlineWidth === value) {\r\n return;\r\n }\r\n this._outlineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n public get outlineColor(): string {\r\n return this._outlineColor;\r\n }\r\n\r\n /**\r\n * Gets or sets outlineColor of the text to display\r\n */\r\n public set outlineColor(value: string) {\r\n if (this._outlineColor === value) {\r\n return;\r\n }\r\n this._outlineColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */\r\n @serialize()\r\n public get autoStretchHeight(): boolean {\r\n return this._autoStretchHeight;\r\n }\r\n\r\n public set autoStretchHeight(value: boolean) {\r\n if (this._autoStretchHeight === value) {\r\n return;\r\n }\r\n\r\n this._autoStretchHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n public set height(value: string | number) {\r\n this.fixedRatioMasterIsWidth = false;\r\n\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n\r\n this._autoStretchHeight = false;\r\n }\r\n\r\n @serialize()\r\n public get maxHeight(): string | number {\r\n return this._maxHeight.toString(this._host);\r\n }\r\n\r\n /** Gets the maximum width allowed by the control in pixels */\r\n public get maxHeightInPixels(): number {\r\n return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set maxHeight(value: string | number) {\r\n if (this._maxHeight.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._maxHeight.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputTextArea\r\n * @param name defines the control name\r\n * @param text defines the text of the control\r\n */\r\n constructor(\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n\r\n this.isPointerBlocker = true;\r\n\r\n this.onLinesReadyObservable.add(() => this._updateCursorPosition());\r\n\r\n this._highlightCursorInfo = {\r\n initialStartIndex: -1,\r\n initialRelativeStartIndex: -1,\r\n initialLineIndex: -1,\r\n };\r\n\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: 0,\r\n relativeEndIndex: 0,\r\n relativeStartIndex: 0,\r\n currentLineIndex: 0,\r\n };\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"InputTextArea\";\r\n }\r\n\r\n /**\r\n * Handles the keyboard event\r\n * @param evt Defines the KeyboardEvent\r\n */\r\n public processKeyboard(evt: IKeyboardEvent): void {\r\n if (this.isReadOnly) {\r\n return;\r\n }\r\n\r\n // process pressed key\r\n this.alternativeProcessKey(evt.code, evt.key, evt);\r\n\r\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\r\n }\r\n\r\n /**\r\n * Process the last keyboard input\r\n *\r\n * @param code The ascii input number\r\n * @param key The key string representation\r\n * @param evt The keyboard event emits with input\r\n * @internal\r\n */\r\n public alternativeProcessKey(code: string, key?: string, evt?: IKeyboardEvent) {\r\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\r\n if (evt && (evt.ctrlKey || evt.metaKey) && (code === \"KeyC\" || code === \"KeyV\" || code === \"KeyX\")) {\r\n return;\r\n }\r\n\r\n // Specific cases\r\n switch (code) {\r\n case \"KeyA\": // A - select all\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._selectAllText();\r\n evt.preventDefault();\r\n return;\r\n }\r\n break;\r\n case \"Period\": //SLASH\r\n if (evt && evt.shiftKey) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case \"Backspace\": // BACKSPACE\r\n if (!this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n break;\r\n case \"Delete\": // DELETE\r\n if (!this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1;\r\n }\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n break;\r\n case \"Enter\": // RETURN\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, \"\\n\");\r\n this._cursorInfo.globalStartIndex++;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n return;\r\n case \"End\": // END\r\n this._cursorInfo.globalStartIndex = this.text.length;\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case \"Home\": // HOME\r\n this._cursorInfo.globalStartIndex = 0;\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case \"ArrowLeft\": // LEFT\r\n this._markAsDirty();\r\n\r\n if (evt && evt.shiftKey) {\r\n // shift + ctrl/cmd + <-\r\n if (evt.ctrlKey || evt.metaKey) {\r\n // Go to line's start by substract the relativeStartIndex to the globalStartIndex\r\n this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n // store the starting point\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex--;\r\n this._isTextHighlightOn = true;\r\n } else {\r\n if (this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalEndIndex--;\r\n } else {\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n }\r\n this._blinkIsEven = true;\r\n evt.preventDefault();\r\n return;\r\n }\r\n\r\n if (this._isTextHighlightOn) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n } else if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n // ctr + <-\r\n this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex;\r\n evt.preventDefault();\r\n } else if (this._cursorInfo.globalStartIndex > 0) {\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n return;\r\n case \"ArrowRight\": // RIGHT\r\n this._markAsDirty();\r\n\r\n if (evt && evt.shiftKey) {\r\n // shift + ctrl/cmd + ->\r\n if (evt.ctrlKey || evt.metaKey) {\r\n const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1;\r\n this._cursorInfo.globalEndIndex += rightDelta;\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n // store the starting point\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalEndIndex++;\r\n this._isTextHighlightOn = true;\r\n } else {\r\n if (this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalStartIndex++;\r\n } else {\r\n this._cursorInfo.globalEndIndex++;\r\n }\r\n }\r\n this._blinkIsEven = true;\r\n evt.preventDefault();\r\n return;\r\n }\r\n if (this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex;\r\n } else if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n //ctr + ->\r\n const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex;\r\n this._cursorInfo.globalStartIndex += rightDelta;\r\n } else if (this._cursorInfo.globalStartIndex < this.text.length) {\r\n this._cursorInfo.globalStartIndex++;\r\n }\r\n\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n return;\r\n case \"ArrowUp\": // UP\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (evt) {\r\n if (evt.shiftKey) {\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n }\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n } else {\r\n this._isTextHighlightOn = false;\r\n }\r\n evt.preventDefault();\r\n }\r\n\r\n if (this._cursorInfo.currentLineIndex === 0) {\r\n // First line\r\n this._cursorInfo.globalStartIndex = 0;\r\n } else {\r\n const currentLine = this._lines[this._cursorInfo.currentLineIndex];\r\n const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1];\r\n\r\n let tmpIndex = 0;\r\n let relativeIndex = 0;\r\n if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n tmpIndex = this._cursorInfo.globalStartIndex;\r\n relativeIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n tmpIndex = this._cursorInfo.globalEndIndex;\r\n relativeIndex = this._cursorInfo.relativeEndIndex;\r\n }\r\n\r\n const currentText = currentLine.text.substr(0, relativeIndex);\r\n const currentWidth = this._contextForBreakLines.measureText(currentText).width;\r\n\r\n let upperWidth = 0;\r\n let previousWidth = 0;\r\n\r\n tmpIndex -= relativeIndex; // Start of current line\r\n tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; // Start of upper line\r\n let upperLineRelativeIndex = 0;\r\n\r\n while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) {\r\n tmpIndex++;\r\n upperLineRelativeIndex++;\r\n previousWidth = Math.abs(currentWidth - upperWidth);\r\n upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(currentWidth - upperWidth) > previousWidth && upperLineRelativeIndex > 0) {\r\n tmpIndex--;\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n } else if (this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n } else {\r\n this._cursorInfo.globalEndIndex = tmpIndex;\r\n }\r\n }\r\n\r\n this._markAsDirty();\r\n return;\r\n case \"ArrowDown\": // DOWN\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (evt) {\r\n if (evt.shiftKey) {\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n }\r\n\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n } else {\r\n this._isTextHighlightOn = false;\r\n }\r\n evt.preventDefault();\r\n }\r\n\r\n if (this._cursorInfo.currentLineIndex === this._lines.length - 1) {\r\n // Last line\r\n this._cursorInfo.globalStartIndex = this.text.length;\r\n } else {\r\n const currentLine = this._lines[this._cursorInfo.currentLineIndex];\r\n const underLine = this._lines[this._cursorInfo.currentLineIndex + 1];\r\n\r\n let tmpIndex = 0;\r\n let relativeIndex = 0;\r\n if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n tmpIndex = this._cursorInfo.globalStartIndex;\r\n relativeIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n tmpIndex = this._cursorInfo.globalEndIndex;\r\n relativeIndex = this._cursorInfo.relativeEndIndex;\r\n }\r\n\r\n const currentText = currentLine.text.substr(0, relativeIndex);\r\n const currentWidth = this._contextForBreakLines.measureText(currentText).width;\r\n\r\n let underWidth = 0;\r\n let previousWidth = 0;\r\n\r\n tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; // Start of current line\r\n let underLineRelativeIndex = 0;\r\n\r\n while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) {\r\n tmpIndex++;\r\n underLineRelativeIndex++;\r\n previousWidth = Math.abs(currentWidth - underWidth);\r\n underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(currentWidth - underWidth) > previousWidth && underLineRelativeIndex > 0) {\r\n tmpIndex--;\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n } else if (this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n if (this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex) {\r\n this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex;\r\n }\r\n } else {\r\n this._cursorInfo.globalEndIndex = tmpIndex;\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n }\r\n\r\n this._markAsDirty();\r\n return;\r\n }\r\n\r\n // Printable characters\r\n if (key?.length === 1) {\r\n evt?.preventDefault();\r\n this._currentKey = key;\r\n this.onBeforeKeyAddObservable.notifyObservers(this);\r\n key = this._currentKey;\r\n if (this._addKey) {\r\n this._isTextHighlightOn = false;\r\n this._blinkIsEven = false;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, key);\r\n this._cursorInfo.globalStartIndex += key.length;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n\r\n protected _parseLineWordWrap(line: string = \"\", width: number, context: ICanvasRenderingContext): { text: string; width: number; lineEnding: string }[] {\r\n const lines = [];\r\n const words = line.split(\" \");\r\n let lineWidth = 0;\r\n\r\n for (let n = 0; n < words.length; n++) {\r\n const testLine = n > 0 ? line + \" \" + words[n] : words[0];\r\n const metrics = context.measureText(testLine);\r\n const testWidth = metrics.width;\r\n if (testWidth > width) {\r\n if (n > 0) {\r\n // Avoid first word duplication if of too long\r\n lineWidth = context.measureText(line).width;\r\n lines.push({ text: line, width: lineWidth, lineEnding: \" \" });\r\n }\r\n\r\n line = words[n];\r\n\r\n let flushedLine = \"\";\r\n\r\n line.split(\"\").map((char) => {\r\n if (context.measureText(flushedLine + char).width > width) {\r\n lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: \"\" });\r\n flushedLine = \"\";\r\n }\r\n flushedLine += char;\r\n });\r\n\r\n line = flushedLine;\r\n // Measure remaining characters\r\n lineWidth = context.measureText(line).width;\r\n } else {\r\n lineWidth = testWidth;\r\n line = testLine;\r\n }\r\n }\r\n lines.push({ text: line, width: lineWidth, lineEnding: \" \" });\r\n\r\n return lines;\r\n }\r\n\r\n protected _breakLines(refWidth: number, context: ICanvasRenderingContext): object[] {\r\n const lines: { text: string; width: number; lineEnding: string }[] = [];\r\n const _lines = (this.text || this.placeholderText).split(\"\\n\");\r\n\r\n if (this.clipContent) {\r\n for (const _line of _lines) {\r\n lines.push(...this._parseLineWordWrap(_line, refWidth, context));\r\n }\r\n } else {\r\n for (const _line of _lines) {\r\n lines.push(this._parseLine(_line, context));\r\n }\r\n }\r\n\r\n lines[lines.length - 1].lineEnding = \"\\n\";\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLine(line: string = \"\", context: ICanvasRenderingContext): { text: string; width: number; lineEnding: string } {\r\n return { text: line, width: context.measureText(line).width, lineEnding: \" \" };\r\n }\r\n\r\n /**\r\n * Processing of child right before the parent measurement update\r\n *\r\n * @param parentMeasure The parent measure\r\n * @param context The rendering canvas\r\n * @internal\r\n */\r\n protected _preMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (!this._fontOffset || this._wasDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n\r\n let text = this._beforeRenderText(this._textWrapper).text;\r\n\r\n // placeholder conditions and color setting\r\n if (!this.text && this._placeholderText) {\r\n text = this._placeholderText;\r\n }\r\n\r\n // measures the textlength -> this.measure.width\r\n this._textWidth = context.measureText(text).width;\r\n // we double up the margin width\r\n const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2;\r\n\r\n if (this._autoStretchWidth) {\r\n const tmpLines = text.split(\"\\n\");\r\n const longerString = tmpLines.reduce((acc: string, val: string) => {\r\n const valueLength = context.measureText(val).width;\r\n const accLength = context.measureText(acc).width;\r\n return valueLength > accLength ? val : acc;\r\n }, \"\");\r\n\r\n const longerStringWidth = context.measureText(longerString).width;\r\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + \"px\";\r\n\r\n this.autoStretchWidth = true;\r\n }\r\n\r\n this._availableWidth = this._width.getValueInPixel(this._host, parentMeasure.width) - marginWidth;\r\n\r\n // Prepare lines\r\n this._lines = this._breakLines(this._availableWidth, context);\r\n // can we find a cleaner implementation here?\r\n this._contextForBreakLines = context;\r\n\r\n if (this._autoStretchHeight) {\r\n const textHeight = this._lines.length * this._fontOffset.height;\r\n const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2;\r\n this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + \"px\";\r\n\r\n this._autoStretchHeight = true;\r\n }\r\n\r\n this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth;\r\n\r\n if (this._isFocused) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n\r\n let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n let tmpLength = 0;\r\n\r\n while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n protected _textHasChanged() {\r\n if (!this._prevText && this._textWrapper.text && this.placeholderText) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n this._cursorInfo.globalStartIndex = 1;\r\n this._cursorInfo.globalEndIndex = 1;\r\n this._cursorInfo.relativeStartIndex = 1;\r\n this._cursorInfo.relativeEndIndex = 1;\r\n }\r\n super._textHasChanged();\r\n }\r\n\r\n private _computeScroll() {\r\n this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n\r\n if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {\r\n const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;\r\n\r\n if (!this._scrollLeft) {\r\n this._scrollLeft = textLeft;\r\n }\r\n } else {\r\n this._scrollLeft = this._clipTextLeft;\r\n }\r\n\r\n if (this._isFocused && !this._autoStretchHeight) {\r\n const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height;\r\n const textTop = this._clipTextTop - selectedHeight;\r\n\r\n if (!this._scrollTop) {\r\n this._scrollTop = textTop;\r\n }\r\n } else {\r\n this._scrollTop = this._clipTextTop;\r\n }\r\n }\r\n\r\n /**\r\n * Processing of child after the parent measurement update\r\n *\r\n * @internal\r\n */\r\n protected _additionalProcessing(): void {\r\n // Flush the highlighted text each frame\r\n this.highlightedText = \"\";\r\n\r\n this.onLinesReadyObservable.notifyObservers(this);\r\n }\r\n\r\n private _drawText(text: string, textWidth: number, y: number, context: ICanvasRenderingContext): void {\r\n const width = this._currentMeasure.width;\r\n let x = this._scrollLeft as number;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x += 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x += width - textWidth;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x += (width - textWidth) / 2;\r\n break;\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n if (this.outlineWidth) {\r\n context.strokeText(text, this._currentMeasure.left + x, y);\r\n }\r\n context.fillText(text, x, y);\r\n }\r\n\r\n /**\r\n * Copy the text in the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onCopyText(ev: ClipboardEvent): void {\r\n this._isTextHighlightOn = false;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n this._host.clipboardData = this._highlightedText;\r\n }\r\n\r\n /**\r\n * Cut the text and copy it in the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onCutText(ev: ClipboardEvent): void {\r\n if (!this._highlightedText) {\r\n return;\r\n }\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n\r\n this._host.clipboardData = this._highlightedText;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._textHasChanged();\r\n }\r\n\r\n /**\r\n * Paste the copied text from the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onPasteText(ev: ClipboardEvent): void {\r\n let data: string = \"\";\r\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\r\n data = ev.clipboardData.getData(\"text/plain\");\r\n } else {\r\n //get the cached data; returns blank string by default\r\n data = this._host.clipboardData;\r\n }\r\n\r\n this._isTextHighlightOn = false;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data);\r\n\r\n const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex);\r\n\r\n this._cursorInfo.globalStartIndex += deltaIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._textHasChanged();\r\n }\r\n\r\n public _draw(context: ICanvasRenderingContext): void {\r\n this._computeScroll();\r\n\r\n this._scrollLeft = this._scrollLeft ?? 0;\r\n this._scrollTop = this._scrollTop ?? 0;\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n // Background\r\n if (this._isFocused) {\r\n if (this._focusedBackground) {\r\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n } else if (this._background) {\r\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n // sets the color of the rectangle (border if background available)\r\n if (this.color) {\r\n context.fillStyle = this.color;\r\n }\r\n\r\n const height = this._currentMeasure.height;\r\n const width = this._currentMeasure.width;\r\n let rootY = 0;\r\n\r\n switch (this._textVerticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n rootY = this._fontOffset.ascent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;\r\n break;\r\n }\r\n\r\n context.save();\r\n context.beginPath();\r\n context.fillStyle = this.fontStyle;\r\n if (!this._textWrapper.text && this.placeholderText) {\r\n context.fillStyle = this._placeholderColor;\r\n }\r\n // here we define the visible reactangle to clip it in next line\r\n context.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2);\r\n context.clip();\r\n\r\n // Text\r\n rootY += this._scrollTop;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (i !== 0 && this._lineSpacing.internalValue !== 0) {\r\n if (this._lineSpacing.isPixel) {\r\n rootY += this._lineSpacing.getValue(this._host);\r\n } else {\r\n rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n }\r\n\r\n this._drawText(line.text, line.width, rootY, context);\r\n rootY += this._fontOffset.height;\r\n }\r\n\r\n context.restore();\r\n\r\n // Cursor\r\n if (this._isFocused) {\r\n // Render cursor\r\n if (!this._blinkIsEven || this._isTextHighlightOn) {\r\n let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width;\r\n\r\n if (cursorLeft < this._clipTextLeft) {\r\n this._scrollLeft += this._clipTextLeft - cursorLeft;\r\n cursorLeft = this._clipTextLeft;\r\n this._markAsDirty();\r\n } else if (cursorLeft > this._clipTextLeft + this._availableWidth) {\r\n this._scrollLeft += this._clipTextLeft + this._availableWidth - cursorLeft;\r\n cursorLeft = this._clipTextLeft + this._availableWidth;\r\n this._markAsDirty();\r\n }\r\n\r\n let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; //cursorTop distance from top to cursor start\r\n\r\n if (cursorTop < this._clipTextTop) {\r\n this._scrollTop += this._clipTextTop - cursorTop;\r\n cursorTop = this._clipTextTop;\r\n this._markAsDirty();\r\n } else if (cursorTop + this._fontOffset.height > this._clipTextTop + this._availableHeight) {\r\n this._scrollTop += this._clipTextTop + this._availableHeight - cursorTop - this._fontOffset.height;\r\n cursorTop = this._clipTextTop + this._availableHeight - this._fontOffset.height;\r\n this._markAsDirty();\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n context.fillRect(cursorLeft, cursorTop, 2, this._fontOffset.height);\r\n }\r\n }\r\n\r\n this._resetBlinking();\r\n\r\n //show the highlighted text\r\n if (this._isTextHighlightOn) {\r\n clearTimeout(this._blinkTimeout);\r\n\r\n this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n context.globalAlpha = this._highligherOpacity;\r\n context.fillStyle = this._textHighlightColor;\r\n\r\n const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);\r\n const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);\r\n\r\n let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height;\r\n\r\n for (let i = startLineIndex; i <= endLineIndex; i++) {\r\n const line = this._lines[i];\r\n\r\n let highlightRootX = this._scrollLeft as number;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n highlightRootX += 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n highlightRootX += width - line.width;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n highlightRootX += (width - line.width) / 2;\r\n break;\r\n }\r\n\r\n const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0;\r\n const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length;\r\n\r\n const leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width;\r\n const selectedText = line.text.substring(begin, end);\r\n const hightlightWidth = context.measureText(selectedText).width;\r\n\r\n context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height);\r\n\r\n highlightRootY += this._fontOffset.height;\r\n }\r\n\r\n if (this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex) {\r\n this._resetBlinking();\r\n }\r\n }\r\n }\r\n\r\n context.restore();\r\n\r\n // Border\r\n if (this._thickness) {\r\n if (this._isFocused) {\r\n if (this.focusedColor) {\r\n context.strokeStyle = this.focusedColor;\r\n }\r\n } else {\r\n if (this.color) {\r\n context.strokeStyle = this.color;\r\n }\r\n }\r\n\r\n context.lineWidth = this._thickness;\r\n\r\n context.strokeRect(\r\n this._currentMeasure.left + this._thickness / 2,\r\n this._currentMeasure.top + this._thickness / 2,\r\n this._currentMeasure.width - this._thickness,\r\n this._currentMeasure.height - this._thickness\r\n );\r\n }\r\n }\r\n\r\n private _resetBlinking() {\r\n clearTimeout(this._blinkTimeout);\r\n this._blinkTimeout = <any>setTimeout(() => {\r\n this._blinkIsEven = !this._blinkIsEven;\r\n this._markAsDirty();\r\n }, 500);\r\n }\r\n\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n super._applyStates(context);\r\n if (this.outlineWidth) {\r\n context.lineWidth = this.outlineWidth;\r\n context.strokeStyle = this.outlineColor;\r\n }\r\n }\r\n\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._clickedCoordinateX = coordinates.x;\r\n this._clickedCoordinateY = coordinates.y;\r\n\r\n this._isTextHighlightOn = false;\r\n this._highlightedText = \"\";\r\n this._isPointerDown = true;\r\n this._host._capturingControl[pointerId] = this;\r\n if (this._host.focusedControl === this) {\r\n // Move cursor\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n return true;\r\n }\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._host.focusedControl = this;\r\n\r\n return true;\r\n }\r\n\r\n // for textselection\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Avoid Chromium-like beahavior when this event is fired right after onPointerDown\r\n if (pi.event.movementX === 0 && pi.event.movementY === 0) {\r\n return;\r\n }\r\n\r\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\r\n this._clickedCoordinateX = coordinates.x;\r\n this._clickedCoordinateY = coordinates.y;\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._isTextHighlightOn = true;\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n /**\r\n * Apply the correct position of cursor according to current modification\r\n */\r\n private _updateCursorPosition() {\r\n if (!this._isFocused) {\r\n return;\r\n }\r\n\r\n if (!this._textWrapper.text && this.placeholderText) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n this._cursorInfo.globalStartIndex = 0;\r\n this._cursorInfo.globalEndIndex = 0;\r\n this._cursorInfo.relativeStartIndex = 0;\r\n this._cursorInfo.relativeEndIndex = 0;\r\n } else {\r\n if (this._clickedCoordinateX && this._clickedCoordinateY) {\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: 0,\r\n relativeStartIndex: 0,\r\n relativeEndIndex: 0,\r\n currentLineIndex: 0,\r\n };\r\n }\r\n\r\n let globalIndex = 0;\r\n let relativeIndex = 0;\r\n\r\n const lastClickedCoordinateY = this._clickedCoordinateY - (this._scrollTop as number);\r\n\r\n const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height);\r\n this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1);\r\n\r\n let currentSize = 0;\r\n\r\n const relativeXPosition = this._clickedCoordinateX - (this._scrollLeft ?? 0);\r\n\r\n let previousDist = 0;\r\n\r\n for (let index = 0; index < this._cursorInfo.currentLineIndex; index++) {\r\n const line = this._lines[index];\r\n globalIndex += line.text.length + line.lineEnding.length;\r\n }\r\n\r\n while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) {\r\n relativeIndex++;\r\n previousDist = Math.abs(relativeXPosition - currentSize);\r\n currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(relativeXPosition - currentSize) > previousDist && relativeIndex > 0) {\r\n relativeIndex--;\r\n }\r\n\r\n globalIndex += relativeIndex;\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = globalIndex;\r\n this._cursorInfo.relativeStartIndex = relativeIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n if (globalIndex < this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalStartIndex = globalIndex;\r\n this._cursorInfo.relativeStartIndex = relativeIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n } else {\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n this._cursorInfo.globalEndIndex = globalIndex;\r\n this._cursorInfo.relativeEndIndex = relativeIndex;\r\n }\r\n }\r\n\r\n // Avoid the caret during highlighting\r\n this._blinkIsEven = this._isTextHighlightOn;\r\n this._clickedCoordinateX = null;\r\n this._clickedCoordinateY = null;\r\n } else {\r\n // Standard behavior same as Current line is at least above the initial highlight index\r\n this._cursorInfo.relativeStartIndex = 0;\r\n this._cursorInfo.currentLineIndex = 0;\r\n\r\n let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n let tmpLength = 0;\r\n\r\n while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n\r\n this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - tmpLength;\r\n\r\n if (this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) {\r\n // Current line is at least below the initial highlight index\r\n while (tmpLength + lineLength <= this._cursorInfo.globalEndIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - tmpLength;\r\n } else if (!this._isTextHighlightOn) {\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update all values of cursor information based on cursorIndex value\r\n *\r\n * @param offset The index to take care of\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _updateValueFromCursorIndex(offset: number) {\r\n // Override to avoid parent behavior during _onPointerMove\r\n }\r\n\r\n /**\r\n * Select the word immediatly under the cursor on double click\r\n *\r\n * @param _evt Pointer informations of double click\r\n * @internal\r\n */\r\n protected _processDblClick(_evt: PointerInfo) {\r\n //pre-find the start and end index of the word under cursor, speeds up the rendering\r\n let moveLeft, moveRight;\r\n do {\r\n moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0;\r\n moveRight =\r\n this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0;\r\n } while (moveLeft || moveRight);\r\n\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this.onTextHighlightObservable.notifyObservers(this);\r\n\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /** @internal */\r\n protected _selectAllText() {\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n\r\n this._highlightCursorInfo = {\r\n initialStartIndex: 0,\r\n initialRelativeStartIndex: 0,\r\n initialLineIndex: 0,\r\n };\r\n\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: this._textWrapper.length,\r\n relativeEndIndex: this._lines[this._lines.length - 1].text.length,\r\n relativeStartIndex: 0,\r\n currentLineIndex: this._lines.length - 1,\r\n };\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n public dispose() {\r\n super.dispose();\r\n\r\n this.onLinesReadyObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.InputTextArea\", InputTextArea);\r\n"]}
|
1
|
+
{"version":3,"file":"inputTextArea.js","sourceRoot":"","sources":["../../../../../dev/gui/src/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/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"./control\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport type { VirtualKeyboard } from \"./virtualKeyboard\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Measure } from \"../measure\";\r\nimport { InputText } from \"./inputText\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport type { IKeyboardEvent } from \"core/Events/deviceInputEvents\";\r\n\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to create input text control\r\n */\r\nexport class InputTextArea extends InputText {\r\n private _textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n private _textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n private _prevText: string = this.text;\r\n\r\n private _lines: any[];\r\n private _lineSpacing: ValueAndUnit = new ValueAndUnit(0);\r\n private _maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n\r\n private _clipTextTop: number;\r\n private _clipTextLeft: number;\r\n\r\n private _cursorInfo: { globalStartIndex: number; globalEndIndex: number; relativeStartIndex: number; relativeEndIndex: number; currentLineIndex: number };\r\n private _highlightCursorInfo: { initialStartIndex: number; initialRelativeStartIndex: number; initialLineIndex: number };\r\n\r\n /**\r\n * An event triggered after the text was broken up into lines\r\n */\r\n public onLinesReadyObservable = new Observable<InputTextArea>();\r\n\r\n /** @internal */\r\n public _connectedVirtualKeyboard: Nullable<VirtualKeyboard>;\r\n private _contextForBreakLines: ICanvasRenderingContext;\r\n private _clickedCoordinateX: Nullable<number>;\r\n private _clickedCoordinateY: Nullable<number>;\r\n\r\n private _availableWidth: number;\r\n private _availableHeight: number;\r\n\r\n private _scrollTop: Nullable<number>;\r\n\r\n private _autoStretchHeight: boolean;\r\n\r\n /** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */\r\n @serialize()\r\n public get autoStretchHeight(): boolean {\r\n return this._autoStretchHeight;\r\n }\r\n\r\n public set autoStretchHeight(value: boolean) {\r\n if (this._autoStretchHeight === value) {\r\n return;\r\n }\r\n\r\n this._autoStretchHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n public set height(value: string | number) {\r\n this.fixedRatioMasterIsWidth = false;\r\n\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n\r\n this._autoStretchHeight = false;\r\n }\r\n\r\n @serialize()\r\n public get maxHeight(): string | number {\r\n return this._maxHeight.toString(this._host);\r\n }\r\n\r\n /** Gets the maximum width allowed by the control in pixels */\r\n public get maxHeightInPixels(): number {\r\n return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set maxHeight(value: string | number) {\r\n if (this._maxHeight.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._maxHeight.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputTextArea\r\n * @param name defines the control name\r\n * @param text defines the text of the control\r\n */\r\n constructor(\r\n public name?: string,\r\n text: string = \"\"\r\n ) {\r\n super(name);\r\n\r\n this.text = text;\r\n\r\n this.isPointerBlocker = true;\r\n\r\n this.onLinesReadyObservable.add(() => this._updateCursorPosition());\r\n\r\n this._highlightCursorInfo = {\r\n initialStartIndex: -1,\r\n initialRelativeStartIndex: -1,\r\n initialLineIndex: -1,\r\n };\r\n\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: 0,\r\n relativeEndIndex: 0,\r\n relativeStartIndex: 0,\r\n currentLineIndex: 0,\r\n };\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"InputTextArea\";\r\n }\r\n\r\n /**\r\n * Handles the keyboard event\r\n * @param evt Defines the KeyboardEvent\r\n */\r\n public processKeyboard(evt: IKeyboardEvent): void {\r\n if (this.isReadOnly) {\r\n return;\r\n }\r\n\r\n // process pressed key\r\n this.alternativeProcessKey(evt.code, evt.key, evt);\r\n\r\n this.onKeyboardEventProcessedObservable.notifyObservers(evt);\r\n }\r\n\r\n /**\r\n * Process the last keyboard input\r\n *\r\n * @param code The ascii input number\r\n * @param key The key string representation\r\n * @param evt The keyboard event emits with input\r\n * @internal\r\n */\r\n public alternativeProcessKey(code: string, key?: string, evt?: IKeyboardEvent) {\r\n //return if clipboard event keys (i.e -ctr/cmd + c,v,x)\r\n if (evt && (evt.ctrlKey || evt.metaKey) && (code === \"KeyC\" || code === \"KeyV\" || code === \"KeyX\")) {\r\n return;\r\n }\r\n\r\n // Specific cases\r\n switch (code) {\r\n case \"KeyA\": // A - select all\r\n if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n this._selectAllText();\r\n evt.preventDefault();\r\n return;\r\n }\r\n break;\r\n case \"Period\": //SLASH\r\n if (evt && evt.shiftKey) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case \"Backspace\": // BACKSPACE\r\n if (!this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n break;\r\n case \"Delete\": // DELETE\r\n if (!this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1;\r\n }\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n if (evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n break;\r\n case \"Enter\": // RETURN\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, \"\\n\");\r\n this._cursorInfo.globalStartIndex++;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n\r\n this._textHasChanged();\r\n return;\r\n case \"End\": // END\r\n this._cursorInfo.globalStartIndex = this.text.length;\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case \"Home\": // HOME\r\n this._cursorInfo.globalStartIndex = 0;\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n this._markAsDirty();\r\n return;\r\n case \"ArrowLeft\": // LEFT\r\n this._markAsDirty();\r\n\r\n if (evt && evt.shiftKey) {\r\n // shift + ctrl/cmd + <-\r\n if (evt.ctrlKey || evt.metaKey) {\r\n // Go to line's start by substract the relativeStartIndex to the globalStartIndex\r\n this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n // store the starting point\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex--;\r\n this._isTextHighlightOn = true;\r\n } else {\r\n if (this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalEndIndex--;\r\n } else {\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n }\r\n this._blinkIsEven = true;\r\n evt.preventDefault();\r\n return;\r\n }\r\n\r\n if (this._isTextHighlightOn) {\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n } else if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n // ctr + <-\r\n this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex;\r\n evt.preventDefault();\r\n } else if (this._cursorInfo.globalStartIndex > 0) {\r\n this._cursorInfo.globalStartIndex--;\r\n }\r\n\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n return;\r\n case \"ArrowRight\": // RIGHT\r\n this._markAsDirty();\r\n\r\n if (evt && evt.shiftKey) {\r\n // shift + ctrl/cmd + ->\r\n if (evt.ctrlKey || evt.metaKey) {\r\n const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1;\r\n this._cursorInfo.globalEndIndex += rightDelta;\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n // store the starting point\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalEndIndex++;\r\n this._isTextHighlightOn = true;\r\n } else {\r\n if (this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalStartIndex++;\r\n } else {\r\n this._cursorInfo.globalEndIndex++;\r\n }\r\n }\r\n this._blinkIsEven = true;\r\n evt.preventDefault();\r\n return;\r\n }\r\n if (this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex;\r\n } else if (evt && (evt.ctrlKey || evt.metaKey)) {\r\n //ctr + ->\r\n const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex;\r\n this._cursorInfo.globalStartIndex += rightDelta;\r\n } else if (this._cursorInfo.globalStartIndex < this.text.length) {\r\n this._cursorInfo.globalStartIndex++;\r\n }\r\n\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n this._isTextHighlightOn = false;\r\n return;\r\n case \"ArrowUp\": // UP\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (evt) {\r\n if (evt.shiftKey) {\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n }\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n } else {\r\n this._isTextHighlightOn = false;\r\n }\r\n evt.preventDefault();\r\n }\r\n\r\n if (this._cursorInfo.currentLineIndex === 0) {\r\n // First line\r\n this._cursorInfo.globalStartIndex = 0;\r\n } else {\r\n const currentLine = this._lines[this._cursorInfo.currentLineIndex];\r\n const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1];\r\n\r\n let tmpIndex = 0;\r\n let relativeIndex = 0;\r\n if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n tmpIndex = this._cursorInfo.globalStartIndex;\r\n relativeIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n tmpIndex = this._cursorInfo.globalEndIndex;\r\n relativeIndex = this._cursorInfo.relativeEndIndex;\r\n }\r\n\r\n const currentText = currentLine.text.substr(0, relativeIndex);\r\n const currentWidth = this._contextForBreakLines.measureText(currentText).width;\r\n\r\n let upperWidth = 0;\r\n let previousWidth = 0;\r\n\r\n tmpIndex -= relativeIndex; // Start of current line\r\n tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; // Start of upper line\r\n let upperLineRelativeIndex = 0;\r\n\r\n while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) {\r\n tmpIndex++;\r\n upperLineRelativeIndex++;\r\n previousWidth = Math.abs(currentWidth - upperWidth);\r\n upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(currentWidth - upperWidth) > previousWidth && upperLineRelativeIndex > 0) {\r\n tmpIndex--;\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n } else if (this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n } else {\r\n this._cursorInfo.globalEndIndex = tmpIndex;\r\n }\r\n }\r\n\r\n this._markAsDirty();\r\n return;\r\n case \"ArrowDown\": // DOWN\r\n // update the cursor\r\n this._blinkIsEven = false;\r\n\r\n if (evt) {\r\n if (evt.shiftKey) {\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n }\r\n\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n } else {\r\n this._isTextHighlightOn = false;\r\n }\r\n evt.preventDefault();\r\n }\r\n\r\n if (this._cursorInfo.currentLineIndex === this._lines.length - 1) {\r\n // Last line\r\n this._cursorInfo.globalStartIndex = this.text.length;\r\n } else {\r\n const currentLine = this._lines[this._cursorInfo.currentLineIndex];\r\n const underLine = this._lines[this._cursorInfo.currentLineIndex + 1];\r\n\r\n let tmpIndex = 0;\r\n let relativeIndex = 0;\r\n if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n tmpIndex = this._cursorInfo.globalStartIndex;\r\n relativeIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n tmpIndex = this._cursorInfo.globalEndIndex;\r\n relativeIndex = this._cursorInfo.relativeEndIndex;\r\n }\r\n\r\n const currentText = currentLine.text.substr(0, relativeIndex);\r\n const currentWidth = this._contextForBreakLines.measureText(currentText).width;\r\n\r\n let underWidth = 0;\r\n let previousWidth = 0;\r\n\r\n tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; // Start of current line\r\n let underLineRelativeIndex = 0;\r\n\r\n while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) {\r\n tmpIndex++;\r\n underLineRelativeIndex++;\r\n previousWidth = Math.abs(currentWidth - underWidth);\r\n underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(currentWidth - underWidth) > previousWidth && underLineRelativeIndex > 0) {\r\n tmpIndex--;\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n } else if (this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {\r\n this._cursorInfo.globalStartIndex = tmpIndex;\r\n if (this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex) {\r\n this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex;\r\n }\r\n } else {\r\n this._cursorInfo.globalEndIndex = tmpIndex;\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n }\r\n }\r\n\r\n this._markAsDirty();\r\n return;\r\n }\r\n\r\n // Printable characters\r\n if (key?.length === 1) {\r\n evt?.preventDefault();\r\n this._currentKey = key;\r\n this.onBeforeKeyAddObservable.notifyObservers(this);\r\n key = this._currentKey;\r\n if (this._addKey) {\r\n this._isTextHighlightOn = false;\r\n this._blinkIsEven = false;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, key);\r\n this._cursorInfo.globalStartIndex += key.length;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._textHasChanged();\r\n }\r\n }\r\n }\r\n\r\n protected _parseLineWordWrap(line: string = \"\", width: number, context: ICanvasRenderingContext): { text: string; width: number; lineEnding: string }[] {\r\n const lines = [];\r\n const words = line.split(\" \");\r\n let lineWidth = 0;\r\n\r\n for (let n = 0; n < words.length; n++) {\r\n const testLine = n > 0 ? line + \" \" + words[n] : words[0];\r\n const metrics = context.measureText(testLine);\r\n const testWidth = metrics.width;\r\n if (testWidth > width) {\r\n if (n > 0) {\r\n // Avoid first word duplication if of too long\r\n lineWidth = context.measureText(line).width;\r\n lines.push({ text: line, width: lineWidth, lineEnding: \" \" });\r\n }\r\n\r\n line = words[n];\r\n\r\n let flushedLine = \"\";\r\n\r\n line.split(\"\").map((char) => {\r\n if (context.measureText(flushedLine + char).width > width) {\r\n lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: \"\" });\r\n flushedLine = \"\";\r\n }\r\n flushedLine += char;\r\n });\r\n\r\n line = flushedLine;\r\n // Measure remaining characters\r\n lineWidth = context.measureText(line).width;\r\n } else {\r\n lineWidth = testWidth;\r\n line = testLine;\r\n }\r\n }\r\n lines.push({ text: line, width: lineWidth, lineEnding: \" \" });\r\n\r\n return lines;\r\n }\r\n\r\n protected _breakLines(refWidth: number, context: ICanvasRenderingContext): object[] {\r\n const lines: { text: string; width: number; lineEnding: string }[] = [];\r\n const _lines = (this.text || this.placeholderText).split(\"\\n\");\r\n\r\n if (this.clipContent) {\r\n for (const _line of _lines) {\r\n lines.push(...this._parseLineWordWrap(_line, refWidth, context));\r\n }\r\n } else {\r\n for (const _line of _lines) {\r\n lines.push(this._parseLine(_line, context));\r\n }\r\n }\r\n\r\n lines[lines.length - 1].lineEnding = \"\\n\";\r\n\r\n return lines;\r\n }\r\n\r\n protected _parseLine(line: string = \"\", context: ICanvasRenderingContext): { text: string; width: number; lineEnding: string } {\r\n return { text: line, width: context.measureText(line).width, lineEnding: \" \" };\r\n }\r\n\r\n /**\r\n * Processing of child right before the parent measurement update\r\n *\r\n * @param parentMeasure The parent measure\r\n * @param context The rendering canvas\r\n * @internal\r\n */\r\n protected _preMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (!this._fontOffset || this._wasDirty) {\r\n this._fontOffset = Control._GetFontOffset(context.font);\r\n }\r\n\r\n let text = this._beforeRenderText(this._textWrapper).text;\r\n\r\n // placeholder conditions and color setting\r\n if (!this.text && this._placeholderText) {\r\n text = this._placeholderText;\r\n }\r\n\r\n // measures the textlength -> this.measure.width\r\n this._textWidth = context.measureText(text).width;\r\n // we double up the margin width\r\n const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2;\r\n\r\n if (this._autoStretchWidth) {\r\n const tmpLines = text.split(\"\\n\");\r\n const longerString = tmpLines.reduce((acc: string, val: string) => {\r\n const valueLength = context.measureText(val).width;\r\n const accLength = context.measureText(acc).width;\r\n return valueLength > accLength ? val : acc;\r\n }, \"\");\r\n\r\n const longerStringWidth = context.measureText(longerString).width;\r\n this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + \"px\";\r\n\r\n this.autoStretchWidth = true;\r\n }\r\n\r\n this._availableWidth = this._width.getValueInPixel(this._host, parentMeasure.width) - marginWidth;\r\n\r\n // Prepare lines\r\n this._lines = this._breakLines(this._availableWidth, context);\r\n // can we find a cleaner implementation here?\r\n this._contextForBreakLines = context;\r\n\r\n if (this._autoStretchHeight) {\r\n const textHeight = this._lines.length * this._fontOffset.height;\r\n const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2;\r\n this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + \"px\";\r\n\r\n this._autoStretchHeight = true;\r\n }\r\n\r\n this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth;\r\n\r\n if (this._isFocused) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n\r\n let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n let tmpLength = 0;\r\n\r\n while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n protected _textHasChanged() {\r\n if (!this._prevText && this._textWrapper.text && this.placeholderText) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n this._cursorInfo.globalStartIndex = 1;\r\n this._cursorInfo.globalEndIndex = 1;\r\n this._cursorInfo.relativeStartIndex = 1;\r\n this._cursorInfo.relativeEndIndex = 1;\r\n }\r\n super._textHasChanged();\r\n }\r\n\r\n private _computeScroll() {\r\n this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n\r\n if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {\r\n const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;\r\n\r\n if (!this._scrollLeft) {\r\n this._scrollLeft = textLeft;\r\n }\r\n } else {\r\n this._scrollLeft = this._clipTextLeft;\r\n }\r\n\r\n if (this._isFocused && !this._autoStretchHeight) {\r\n const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height;\r\n const textTop = this._clipTextTop - selectedHeight;\r\n\r\n if (!this._scrollTop) {\r\n this._scrollTop = textTop;\r\n }\r\n } else {\r\n this._scrollTop = this._clipTextTop;\r\n }\r\n }\r\n\r\n /**\r\n * Processing of child after the parent measurement update\r\n *\r\n * @internal\r\n */\r\n protected _additionalProcessing(): void {\r\n // Flush the highlighted text each frame\r\n this.highlightedText = \"\";\r\n\r\n this.onLinesReadyObservable.notifyObservers(this);\r\n }\r\n\r\n private _drawText(text: string, textWidth: number, y: number, context: ICanvasRenderingContext): void {\r\n const width = this._currentMeasure.width;\r\n let x = this._scrollLeft as number;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x += 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x += width - textWidth;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x += (width - textWidth) / 2;\r\n break;\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n if (this.outlineWidth) {\r\n context.strokeText(text, this._currentMeasure.left + x, y);\r\n }\r\n context.fillText(text, x, y);\r\n }\r\n\r\n /**\r\n * Copy the text in the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onCopyText(ev: ClipboardEvent): void {\r\n this._isTextHighlightOn = false;\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n this._host.clipboardData = this._highlightedText;\r\n }\r\n\r\n /**\r\n * Cut the text and copy it in the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onCutText(ev: ClipboardEvent): void {\r\n if (!this._highlightedText) {\r\n return;\r\n }\r\n //when write permission to clipbaord data is denied\r\n try {\r\n ev.clipboardData && ev.clipboardData.setData(\"text/plain\", this._highlightedText);\r\n } catch {} //pass\r\n\r\n this._host.clipboardData = this._highlightedText;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n this._textHasChanged();\r\n }\r\n\r\n /**\r\n * Paste the copied text from the clipboard\r\n *\r\n * @param ev The clipboard event\r\n * @internal\r\n */\r\n protected _onPasteText(ev: ClipboardEvent): void {\r\n let data: string = \"\";\r\n if (ev.clipboardData && ev.clipboardData.types.indexOf(\"text/plain\") !== -1) {\r\n data = ev.clipboardData.getData(\"text/plain\");\r\n } else {\r\n //get the cached data; returns blank string by default\r\n data = this._host.clipboardData;\r\n }\r\n\r\n this._isTextHighlightOn = false;\r\n this._prevText = this._textWrapper.text;\r\n this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data);\r\n\r\n const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex);\r\n\r\n this._cursorInfo.globalStartIndex += deltaIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this._textHasChanged();\r\n }\r\n\r\n public _draw(context: ICanvasRenderingContext): void {\r\n this._computeScroll();\r\n\r\n this._scrollLeft = this._scrollLeft ?? 0;\r\n this._scrollTop = this._scrollTop ?? 0;\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n // Background\r\n if (this._isFocused) {\r\n if (this._focusedBackground) {\r\n context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n } else if (this._background) {\r\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n // sets the color of the rectangle (border if background available)\r\n if (this.color) {\r\n context.fillStyle = this.color;\r\n }\r\n\r\n const height = this._currentMeasure.height;\r\n const width = this._currentMeasure.width;\r\n let rootY = 0;\r\n\r\n switch (this._textVerticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n rootY = this._fontOffset.ascent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;\r\n break;\r\n }\r\n\r\n context.save();\r\n context.beginPath();\r\n context.fillStyle = this.fontStyle;\r\n if (!this._textWrapper.text && this.placeholderText) {\r\n context.fillStyle = this._placeholderColor;\r\n }\r\n // here we define the visible reactangle to clip it in next line\r\n context.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2);\r\n context.clip();\r\n\r\n // Text\r\n rootY += this._scrollTop;\r\n\r\n for (let i = 0; i < this._lines.length; i++) {\r\n const line = this._lines[i];\r\n\r\n if (i !== 0 && this._lineSpacing.internalValue !== 0) {\r\n if (this._lineSpacing.isPixel) {\r\n rootY += this._lineSpacing.getValue(this._host);\r\n } else {\r\n rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n }\r\n\r\n this._drawText(line.text, line.width, rootY, context);\r\n rootY += this._fontOffset.height;\r\n }\r\n\r\n context.restore();\r\n\r\n // Cursor\r\n if (this._isFocused) {\r\n // Render cursor\r\n if (!this._blinkIsEven || this._isTextHighlightOn) {\r\n let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width;\r\n\r\n if (cursorLeft < this._clipTextLeft) {\r\n this._scrollLeft += this._clipTextLeft - cursorLeft;\r\n cursorLeft = this._clipTextLeft;\r\n this._markAsDirty();\r\n } else if (cursorLeft > this._clipTextLeft + this._availableWidth) {\r\n this._scrollLeft += this._clipTextLeft + this._availableWidth - cursorLeft;\r\n cursorLeft = this._clipTextLeft + this._availableWidth;\r\n this._markAsDirty();\r\n }\r\n\r\n let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; //cursorTop distance from top to cursor start\r\n\r\n if (cursorTop < this._clipTextTop) {\r\n this._scrollTop += this._clipTextTop - cursorTop;\r\n cursorTop = this._clipTextTop;\r\n this._markAsDirty();\r\n } else if (cursorTop + this._fontOffset.height > this._clipTextTop + this._availableHeight) {\r\n this._scrollTop += this._clipTextTop + this._availableHeight - cursorTop - this._fontOffset.height;\r\n cursorTop = this._clipTextTop + this._availableHeight - this._fontOffset.height;\r\n this._markAsDirty();\r\n }\r\n\r\n if (!this._isTextHighlightOn) {\r\n context.fillRect(cursorLeft, cursorTop, 2, this._fontOffset.height);\r\n }\r\n }\r\n\r\n this._resetBlinking();\r\n\r\n //show the highlighted text\r\n if (this._isTextHighlightOn) {\r\n clearTimeout(this._blinkTimeout);\r\n\r\n this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);\r\n\r\n context.globalAlpha = this._highligherOpacity;\r\n context.fillStyle = this._textHighlightColor;\r\n\r\n const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);\r\n const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);\r\n\r\n let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height;\r\n\r\n for (let i = startLineIndex; i <= endLineIndex; i++) {\r\n const line = this._lines[i];\r\n\r\n let highlightRootX = this._scrollLeft as number;\r\n switch (this._textHorizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n highlightRootX += 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n highlightRootX += width - line.width;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n highlightRootX += (width - line.width) / 2;\r\n break;\r\n }\r\n\r\n const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0;\r\n const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length;\r\n\r\n const leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width;\r\n const selectedText = line.text.substring(begin, end);\r\n const hightlightWidth = context.measureText(selectedText).width;\r\n\r\n context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height);\r\n\r\n highlightRootY += this._fontOffset.height;\r\n }\r\n\r\n if (this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex) {\r\n this._resetBlinking();\r\n }\r\n }\r\n }\r\n\r\n context.restore();\r\n\r\n // Border\r\n if (this._thickness) {\r\n if (this._isFocused) {\r\n if (this.focusedColor) {\r\n context.strokeStyle = this.focusedColor;\r\n }\r\n } else {\r\n if (this.color) {\r\n context.strokeStyle = this.color;\r\n }\r\n }\r\n\r\n context.lineWidth = this._thickness;\r\n\r\n context.strokeRect(\r\n this._currentMeasure.left + this._thickness / 2,\r\n this._currentMeasure.top + this._thickness / 2,\r\n this._currentMeasure.width - this._thickness,\r\n this._currentMeasure.height - this._thickness\r\n );\r\n }\r\n }\r\n\r\n private _resetBlinking() {\r\n clearTimeout(this._blinkTimeout);\r\n this._blinkTimeout = <any>setTimeout(() => {\r\n this._blinkIsEven = !this._blinkIsEven;\r\n this._markAsDirty();\r\n }, 500);\r\n }\r\n\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._clickedCoordinateX = coordinates.x;\r\n this._clickedCoordinateY = coordinates.y;\r\n\r\n this._isTextHighlightOn = false;\r\n this._highlightedText = \"\";\r\n this._isPointerDown = true;\r\n this._host._capturingControl[pointerId] = this;\r\n if (this._host.focusedControl === this) {\r\n // Move cursor\r\n clearTimeout(this._blinkTimeout);\r\n this._markAsDirty();\r\n return true;\r\n }\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._host.focusedControl = this;\r\n\r\n return true;\r\n }\r\n\r\n // for textselection\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Avoid Chromium-like beahavior when this event is fired right after onPointerDown\r\n if (pi.event.movementX === 0 && pi.event.movementY === 0) {\r\n return;\r\n }\r\n\r\n if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {\r\n this._clickedCoordinateX = coordinates.x;\r\n this._clickedCoordinateY = coordinates.y;\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex;\r\n\r\n this._isTextHighlightOn = true;\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n /**\r\n * Apply the correct position of cursor according to current modification\r\n */\r\n private _updateCursorPosition() {\r\n if (!this._isFocused) {\r\n return;\r\n }\r\n\r\n if (!this._textWrapper.text && this.placeholderText) {\r\n this._cursorInfo.currentLineIndex = 0;\r\n this._cursorInfo.globalStartIndex = 0;\r\n this._cursorInfo.globalEndIndex = 0;\r\n this._cursorInfo.relativeStartIndex = 0;\r\n this._cursorInfo.relativeEndIndex = 0;\r\n } else {\r\n if (this._clickedCoordinateX && this._clickedCoordinateY) {\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: 0,\r\n relativeStartIndex: 0,\r\n relativeEndIndex: 0,\r\n currentLineIndex: 0,\r\n };\r\n }\r\n\r\n let globalIndex = 0;\r\n let relativeIndex = 0;\r\n\r\n const lastClickedCoordinateY = this._clickedCoordinateY - (this._scrollTop as number);\r\n\r\n const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height);\r\n this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1);\r\n\r\n let currentSize = 0;\r\n\r\n const relativeXPosition = this._clickedCoordinateX - (this._scrollLeft ?? 0);\r\n\r\n let previousDist = 0;\r\n\r\n for (let index = 0; index < this._cursorInfo.currentLineIndex; index++) {\r\n const line = this._lines[index];\r\n globalIndex += line.text.length + line.lineEnding.length;\r\n }\r\n\r\n while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) {\r\n relativeIndex++;\r\n previousDist = Math.abs(relativeXPosition - currentSize);\r\n currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width;\r\n }\r\n\r\n // Find closest move\r\n if (Math.abs(relativeXPosition - currentSize) > previousDist && relativeIndex > 0) {\r\n relativeIndex--;\r\n }\r\n\r\n globalIndex += relativeIndex;\r\n\r\n if (!this._isTextHighlightOn) {\r\n this._cursorInfo.globalStartIndex = globalIndex;\r\n this._cursorInfo.relativeStartIndex = relativeIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex;\r\n } else {\r\n if (globalIndex < this._highlightCursorInfo.initialStartIndex) {\r\n this._cursorInfo.globalStartIndex = globalIndex;\r\n this._cursorInfo.relativeStartIndex = relativeIndex;\r\n this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n } else {\r\n this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;\r\n this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex;\r\n this._cursorInfo.globalEndIndex = globalIndex;\r\n this._cursorInfo.relativeEndIndex = relativeIndex;\r\n }\r\n }\r\n\r\n // Avoid the caret during highlighting\r\n this._blinkIsEven = this._isTextHighlightOn;\r\n this._clickedCoordinateX = null;\r\n this._clickedCoordinateY = null;\r\n } else {\r\n // Standard behavior same as Current line is at least above the initial highlight index\r\n this._cursorInfo.relativeStartIndex = 0;\r\n this._cursorInfo.currentLineIndex = 0;\r\n\r\n let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n let tmpLength = 0;\r\n\r\n while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n\r\n this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - tmpLength;\r\n\r\n if (this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) {\r\n // Current line is at least below the initial highlight index\r\n while (tmpLength + lineLength <= this._cursorInfo.globalEndIndex) {\r\n tmpLength += lineLength;\r\n\r\n if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {\r\n this._cursorInfo.currentLineIndex++;\r\n lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;\r\n }\r\n }\r\n\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - tmpLength;\r\n } else if (!this._isTextHighlightOn) {\r\n this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex;\r\n this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update all values of cursor information based on cursorIndex value\r\n *\r\n * @param offset The index to take care of\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _updateValueFromCursorIndex(offset: number) {\r\n // Override to avoid parent behavior during _onPointerMove\r\n }\r\n\r\n /**\r\n * Select the word immediatly under the cursor on double click\r\n *\r\n * @param _evt Pointer informations of double click\r\n * @internal\r\n */\r\n protected _processDblClick(_evt: PointerInfo) {\r\n //pre-find the start and end index of the word under cursor, speeds up the rendering\r\n let moveLeft, moveRight;\r\n do {\r\n moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0;\r\n moveRight =\r\n this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0;\r\n } while (moveLeft || moveRight);\r\n\r\n this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex;\r\n this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex;\r\n\r\n this.onTextHighlightObservable.notifyObservers(this);\r\n\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /** @internal */\r\n protected _selectAllText() {\r\n this._isTextHighlightOn = true;\r\n this._blinkIsEven = true;\r\n\r\n this._highlightCursorInfo = {\r\n initialStartIndex: 0,\r\n initialRelativeStartIndex: 0,\r\n initialLineIndex: 0,\r\n };\r\n\r\n this._cursorInfo = {\r\n globalStartIndex: 0,\r\n globalEndIndex: this._textWrapper.length,\r\n relativeEndIndex: this._lines[this._lines.length - 1].text.length,\r\n relativeStartIndex: 0,\r\n currentLineIndex: this._lines.length - 1,\r\n };\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n public dispose() {\r\n super.dispose();\r\n\r\n this.onLinesReadyObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.InputTextArea\", InputTextArea);\r\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babylonjs/gui",
|
3
|
-
"version": "6.45.
|
3
|
+
"version": "6.45.1",
|
4
4
|
"main": "index.js",
|
5
5
|
"module": "index.js",
|
6
6
|
"types": "index.d.ts",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"postcompile": "build-tools -c add-js-to-es6"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@babylonjs/core": "^6.45.
|
21
|
+
"@babylonjs/core": "^6.45.1",
|
22
22
|
"@dev/build-tools": "^1.0.0",
|
23
23
|
"@lts/gui": "1.0.0"
|
24
24
|
},
|