@babylonjs/gui 5.21.0 → 5.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/2D/adtInstrumentation.js +70 -90
  2. package/2D/adtInstrumentation.js.map +1 -1
  3. package/2D/advancedDynamicTexture.d.ts +12 -0
  4. package/2D/advancedDynamicTexture.js +569 -622
  5. package/2D/advancedDynamicTexture.js.map +1 -1
  6. package/2D/controls/button.js +76 -90
  7. package/2D/controls/button.js.map +1 -1
  8. package/2D/controls/checkbox.js +86 -106
  9. package/2D/controls/checkbox.js.map +1 -1
  10. package/2D/controls/colorpicker.js +395 -415
  11. package/2D/controls/colorpicker.js.map +1 -1
  12. package/2D/controls/container.js +187 -230
  13. package/2D/controls/container.js.map +1 -1
  14. package/2D/controls/control.js +1067 -1353
  15. package/2D/controls/control.js.map +1 -1
  16. package/2D/controls/displayGrid.js +152 -196
  17. package/2D/controls/displayGrid.js.map +1 -1
  18. package/2D/controls/ellipse.js +32 -40
  19. package/2D/controls/ellipse.js.map +1 -1
  20. package/2D/controls/focusableButton.js +30 -35
  21. package/2D/controls/focusableButton.js.map +1 -1
  22. package/2D/controls/grid.js +172 -212
  23. package/2D/controls/grid.js.map +1 -1
  24. package/2D/controls/image.js +489 -592
  25. package/2D/controls/image.js.map +1 -1
  26. package/2D/controls/inputPassword.js +9 -16
  27. package/2D/controls/inputPassword.js.map +1 -1
  28. package/2D/controls/inputText.js +380 -467
  29. package/2D/controls/inputText.js.map +1 -1
  30. package/2D/controls/inputTextArea.js +234 -273
  31. package/2D/controls/inputTextArea.js.map +1 -1
  32. package/2D/controls/line.js +147 -198
  33. package/2D/controls/line.js.map +1 -1
  34. package/2D/controls/multiLine.js +87 -113
  35. package/2D/controls/multiLine.js.map +1 -1
  36. package/2D/controls/radioButton.js +106 -127
  37. package/2D/controls/radioButton.js.map +1 -1
  38. package/2D/controls/rectangle.js +60 -72
  39. package/2D/controls/rectangle.js.map +1 -1
  40. package/2D/controls/scrollViewers/scrollViewer.js +439 -543
  41. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  42. package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
  43. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  44. package/2D/controls/selector.js +241 -329
  45. package/2D/controls/selector.js.map +1 -1
  46. package/2D/controls/sliders/baseSlider.js +182 -230
  47. package/2D/controls/sliders/baseSlider.js.map +1 -1
  48. package/2D/controls/sliders/imageBasedSlider.js +86 -109
  49. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  50. package/2D/controls/sliders/imageScrollBar.js +148 -178
  51. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  52. package/2D/controls/sliders/scrollBar.js +64 -80
  53. package/2D/controls/sliders/scrollBar.js.map +1 -1
  54. package/2D/controls/sliders/slider.js +91 -115
  55. package/2D/controls/sliders/slider.js.map +1 -1
  56. package/2D/controls/stackPanel.js +114 -135
  57. package/2D/controls/stackPanel.js.map +1 -1
  58. package/2D/controls/statics.js +5 -5
  59. package/2D/controls/statics.js.map +1 -1
  60. package/2D/controls/textBlock.js +322 -384
  61. package/2D/controls/textBlock.js.map +1 -1
  62. package/2D/controls/textWrapper.js +27 -41
  63. package/2D/controls/textWrapper.js.map +1 -1
  64. package/2D/controls/toggleButton.js +105 -121
  65. package/2D/controls/toggleButton.js.map +1 -1
  66. package/2D/controls/virtualKeyboard.js +101 -123
  67. package/2D/controls/virtualKeyboard.js.map +1 -1
  68. package/2D/math2D.js +62 -70
  69. package/2D/math2D.js.map +1 -1
  70. package/2D/measure.js +30 -32
  71. package/2D/measure.js.map +1 -1
  72. package/2D/multiLinePoint.js +71 -89
  73. package/2D/multiLinePoint.js.map +1 -1
  74. package/2D/style.js +55 -73
  75. package/2D/style.js.map +1 -1
  76. package/2D/valueAndUnit.js +71 -104
  77. package/2D/valueAndUnit.js.map +1 -1
  78. package/2D/xmlLoader.js +70 -84
  79. package/2D/xmlLoader.js.map +1 -1
  80. package/3D/behaviors/defaultBehavior.js +40 -59
  81. package/3D/behaviors/defaultBehavior.js.map +1 -1
  82. package/3D/controls/abstractButton3D.js +8 -12
  83. package/3D/controls/abstractButton3D.js.map +1 -1
  84. package/3D/controls/button3D.js +30 -35
  85. package/3D/controls/button3D.js.map +1 -1
  86. package/3D/controls/container3D.js +57 -71
  87. package/3D/controls/container3D.js.map +1 -1
  88. package/3D/controls/contentDisplay3D.js +47 -60
  89. package/3D/controls/contentDisplay3D.js.map +1 -1
  90. package/3D/controls/control3D.js +123 -158
  91. package/3D/controls/control3D.js.map +1 -1
  92. package/3D/controls/cylinderPanel.js +28 -38
  93. package/3D/controls/cylinderPanel.js.map +1 -1
  94. package/3D/controls/handMenu.js +20 -29
  95. package/3D/controls/handMenu.js.map +1 -1
  96. package/3D/controls/holographicBackplate.js +52 -72
  97. package/3D/controls/holographicBackplate.js.map +1 -1
  98. package/3D/controls/holographicButton.js +160 -200
  99. package/3D/controls/holographicButton.js.map +1 -1
  100. package/3D/controls/holographicSlate.js +176 -206
  101. package/3D/controls/holographicSlate.js.map +1 -1
  102. package/3D/controls/meshButton3D.js +24 -30
  103. package/3D/controls/meshButton3D.js.map +1 -1
  104. package/3D/controls/nearMenu.js +57 -71
  105. package/3D/controls/nearMenu.js.map +1 -1
  106. package/3D/controls/planePanel.js +6 -13
  107. package/3D/controls/planePanel.js.map +1 -1
  108. package/3D/controls/scatterPanel.js +43 -54
  109. package/3D/controls/scatterPanel.js.map +1 -1
  110. package/3D/controls/slider3D.js +168 -222
  111. package/3D/controls/slider3D.js.map +1 -1
  112. package/3D/controls/spherePanel.js +29 -39
  113. package/3D/controls/spherePanel.js.map +1 -1
  114. package/3D/controls/stackPanel3D.js +36 -49
  115. package/3D/controls/stackPanel3D.js.map +1 -1
  116. package/3D/controls/touchButton3D.js +126 -154
  117. package/3D/controls/touchButton3D.js.map +1 -1
  118. package/3D/controls/touchHolographicButton.js +223 -272
  119. package/3D/controls/touchHolographicButton.js.map +1 -1
  120. package/3D/controls/touchHolographicMenu.js +55 -66
  121. package/3D/controls/touchHolographicMenu.js.map +1 -1
  122. package/3D/controls/touchMeshButton3D.js +24 -30
  123. package/3D/controls/touchMeshButton3D.js.map +1 -1
  124. package/3D/controls/volumeBasedPanel.js +85 -107
  125. package/3D/controls/volumeBasedPanel.js.map +1 -1
  126. package/3D/gizmos/gizmoHandle.js +68 -103
  127. package/3D/gizmos/gizmoHandle.js.map +1 -1
  128. package/3D/gizmos/slateGizmo.js +165 -182
  129. package/3D/gizmos/slateGizmo.js.map +1 -1
  130. package/3D/gui3DManager.js +76 -101
  131. package/3D/gui3DManager.js.map +1 -1
  132. package/3D/materials/fluent/fluentMaterial.js +110 -119
  133. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  134. package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
  135. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  136. package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
  137. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  138. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
  139. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  140. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
  141. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  142. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
  143. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  144. package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
  145. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  146. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
  147. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  148. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
  149. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  150. package/3D/materials/handle/handleMaterial.js +56 -69
  151. package/3D/materials/handle/handleMaterial.js.map +1 -1
  152. package/3D/materials/handle/shaders/handle.fragment.js +3 -3
  153. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  154. package/3D/materials/handle/shaders/handle.vertex.js +3 -3
  155. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  156. package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
  157. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  158. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
  159. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  160. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
  161. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  162. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
  163. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  164. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
  165. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  166. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
  167. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  168. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
  169. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  170. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
  171. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  172. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
  173. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  174. package/3D/vector3WithInfo.js +6 -12
  175. package/3D/vector3WithInfo.js.map +1 -1
  176. package/legacy/legacy.js +1 -1
  177. package/legacy/legacy.js.map +1 -1
  178. package/package.json +3 -6
@@ -1,4 +1,4 @@
1
- import { __decorate, __extends } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  import { Control } from "./control.js";
4
4
  import { ValueAndUnit } from "../valueAndUnit.js";
@@ -8,148 +8,121 @@ import { serialize } from "@babylonjs/core/Misc/decorators.js";
8
8
  /**
9
9
  * Class used to create input text control
10
10
  */
11
- var InputTextArea = /** @class */ (function (_super) {
12
- __extends(InputTextArea, _super);
11
+ export class InputTextArea extends InputText {
13
12
  /**
14
13
  * Creates a new InputTextArea
15
14
  * @param name defines the control name
16
15
  * @param text defines the text of the control
17
16
  */
18
- function InputTextArea(name, text) {
19
- if (text === void 0) { text = ""; }
20
- var _this = _super.call(this, name) || this;
21
- _this.name = name;
22
- _this._textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
23
- _this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
24
- _this._lineSpacing = new ValueAndUnit(0);
25
- _this._outlineWidth = 0;
26
- _this._outlineColor = "white";
27
- _this._maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);
17
+ constructor(name, text = "") {
18
+ super(name);
19
+ this.name = name;
20
+ this._textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
21
+ this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
22
+ this._lineSpacing = new ValueAndUnit(0);
23
+ this._outlineWidth = 0;
24
+ this._outlineColor = "white";
25
+ this._maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);
28
26
  /**
29
27
  * An event triggered after the text was broken up into lines
30
28
  */
31
- _this.onLinesReadyObservable = new Observable();
32
- _this.text = text;
33
- _this.isPointerBlocker = true;
34
- _this.onLinesReadyObservable.add(function () { return _this._updateCursorPosition(); });
35
- _this._highlightCursorInfo = {
29
+ this.onLinesReadyObservable = new Observable();
30
+ this.text = text;
31
+ this.isPointerBlocker = true;
32
+ this.onLinesReadyObservable.add(() => this._updateCursorPosition());
33
+ this._highlightCursorInfo = {
36
34
  initialStartIndex: -1,
37
35
  initialRelativeStartIndex: -1,
38
36
  initialLineIndex: -1,
39
37
  };
40
- _this._cursorInfo = {
38
+ this._cursorInfo = {
41
39
  globalStartIndex: 0,
42
40
  globalEndIndex: 0,
43
41
  relativeEndIndex: 0,
44
42
  relativeStartIndex: 0,
45
43
  currentLineIndex: 0,
46
44
  };
47
- return _this;
48
45
  }
49
- Object.defineProperty(InputTextArea.prototype, "outlineWidth", {
50
- /**
51
- * Gets or sets outlineWidth of the text to display
52
- */
53
- get: function () {
54
- return this._outlineWidth;
55
- },
56
- /**
57
- * Gets or sets outlineWidth of the text to display
58
- */
59
- set: function (value) {
60
- if (this._outlineWidth === value) {
61
- return;
62
- }
63
- this._outlineWidth = value;
64
- this._markAsDirty();
65
- },
66
- enumerable: false,
67
- configurable: true
68
- });
69
- Object.defineProperty(InputTextArea.prototype, "outlineColor", {
70
- /**
71
- * Gets or sets outlineColor of the text to display
72
- */
73
- get: function () {
74
- return this._outlineColor;
75
- },
76
- /**
77
- * Gets or sets outlineColor of the text to display
78
- */
79
- set: function (value) {
80
- if (this._outlineColor === value) {
81
- return;
82
- }
83
- this._outlineColor = value;
46
+ /**
47
+ * Gets or sets outlineWidth of the text to display
48
+ */
49
+ get outlineWidth() {
50
+ return this._outlineWidth;
51
+ }
52
+ /**
53
+ * Gets or sets outlineWidth of the text to display
54
+ */
55
+ set outlineWidth(value) {
56
+ if (this._outlineWidth === value) {
57
+ return;
58
+ }
59
+ this._outlineWidth = value;
60
+ this._markAsDirty();
61
+ }
62
+ /**
63
+ * Gets or sets outlineColor of the text to display
64
+ */
65
+ get outlineColor() {
66
+ return this._outlineColor;
67
+ }
68
+ /**
69
+ * Gets or sets outlineColor of the text to display
70
+ */
71
+ set outlineColor(value) {
72
+ if (this._outlineColor === value) {
73
+ return;
74
+ }
75
+ this._outlineColor = value;
76
+ this._markAsDirty();
77
+ }
78
+ /** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
79
+ get autoStretchHeight() {
80
+ return this._autoStretchHeight;
81
+ }
82
+ set autoStretchHeight(value) {
83
+ if (this._autoStretchHeight === value) {
84
+ return;
85
+ }
86
+ this._autoStretchHeight = value;
87
+ this._markAsDirty();
88
+ }
89
+ set height(value) {
90
+ this._fixedRatioMasterIsWidth = false;
91
+ if (this._height.toString(this._host) === value) {
92
+ return;
93
+ }
94
+ if (this._height.fromString(value)) {
84
95
  this._markAsDirty();
85
- },
86
- enumerable: false,
87
- configurable: true
88
- });
89
- Object.defineProperty(InputTextArea.prototype, "autoStretchHeight", {
90
- /** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
91
- get: function () {
92
- return this._autoStretchHeight;
93
- },
94
- set: function (value) {
95
- if (this._autoStretchHeight === value) {
96
- return;
97
- }
98
- this._autoStretchHeight = value;
96
+ }
97
+ this._autoStretchHeight = false;
98
+ }
99
+ get maxHeight() {
100
+ return this._maxHeight.toString(this._host);
101
+ }
102
+ /** Gets the maximum width allowed by the control in pixels */
103
+ get maxHeightInPixels() {
104
+ return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height);
105
+ }
106
+ set maxHeight(value) {
107
+ if (this._maxHeight.toString(this._host) === value) {
108
+ return;
109
+ }
110
+ if (this._maxHeight.fromString(value)) {
99
111
  this._markAsDirty();
100
- },
101
- enumerable: false,
102
- configurable: true
103
- });
104
- Object.defineProperty(InputTextArea.prototype, "height", {
105
- set: function (value) {
106
- this._fixedRatioMasterIsWidth = false;
107
- if (this._height.toString(this._host) === value) {
108
- return;
109
- }
110
- if (this._height.fromString(value)) {
111
- this._markAsDirty();
112
- }
113
- this._autoStretchHeight = false;
114
- },
115
- enumerable: false,
116
- configurable: true
117
- });
118
- Object.defineProperty(InputTextArea.prototype, "maxHeight", {
119
- get: function () {
120
- return this._maxHeight.toString(this._host);
121
- },
122
- set: function (value) {
123
- if (this._maxHeight.toString(this._host) === value) {
124
- return;
125
- }
126
- if (this._maxHeight.fromString(value)) {
127
- this._markAsDirty();
128
- }
129
- },
130
- enumerable: false,
131
- configurable: true
132
- });
133
- Object.defineProperty(InputTextArea.prototype, "maxHeightInPixels", {
134
- /** Gets the maximum width allowed by the control in pixels */
135
- get: function () {
136
- return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height);
137
- },
138
- enumerable: false,
139
- configurable: true
140
- });
141
- InputTextArea.prototype._getTypeName = function () {
112
+ }
113
+ }
114
+ _getTypeName() {
142
115
  return "InputTextArea";
143
- };
116
+ }
144
117
  /**
145
118
  * Handles the keyboard event
146
119
  * @param evt Defines the KeyboardEvent
147
120
  */
148
- InputTextArea.prototype.processKeyboard = function (evt) {
121
+ processKeyboard(evt) {
149
122
  // process pressed key
150
123
  this.alternativeProcessKey(evt.code, evt.key, evt);
151
124
  this.onKeyboardEventProcessedObservable.notifyObservers(evt);
152
- };
125
+ }
153
126
  /**
154
127
  * Process the last keyboard input
155
128
  *
@@ -158,7 +131,7 @@ var InputTextArea = /** @class */ (function (_super) {
158
131
  * @param evt The keyboard event emits with input
159
132
  * @hidden
160
133
  */
161
- InputTextArea.prototype.alternativeProcessKey = function (code, key, evt) {
134
+ alternativeProcessKey(code, key, evt) {
162
135
  //return if clipboard event keys (i.e -ctr/cmd + c,v,x)
163
136
  if (evt && (evt.ctrlKey || evt.metaKey) && (code === "KeyC" || code === "KeyV" || code === "KeyX")) {
164
137
  return;
@@ -274,7 +247,7 @@ var InputTextArea = /** @class */ (function (_super) {
274
247
  if (evt && evt.shiftKey) {
275
248
  // shift + ctrl/cmd + ->
276
249
  if (evt.ctrlKey || evt.metaKey) {
277
- var rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1;
250
+ const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1;
278
251
  this._cursorInfo.globalEndIndex += rightDelta;
279
252
  this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex;
280
253
  }
@@ -304,7 +277,7 @@ var InputTextArea = /** @class */ (function (_super) {
304
277
  }
305
278
  else if (evt && (evt.ctrlKey || evt.metaKey)) {
306
279
  //ctr + ->
307
- var rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex;
280
+ const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex;
308
281
  this._cursorInfo.globalStartIndex += rightDelta;
309
282
  }
310
283
  else if (this._cursorInfo.globalStartIndex < this.text.length) {
@@ -337,10 +310,10 @@ var InputTextArea = /** @class */ (function (_super) {
337
310
  this._cursorInfo.globalStartIndex = 0;
338
311
  }
339
312
  else {
340
- var currentLine = this._lines[this._cursorInfo.currentLineIndex];
341
- var upperLine = this._lines[this._cursorInfo.currentLineIndex - 1];
342
- var tmpIndex = 0;
343
- var relativeIndex = 0;
313
+ const currentLine = this._lines[this._cursorInfo.currentLineIndex];
314
+ const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1];
315
+ let tmpIndex = 0;
316
+ let relativeIndex = 0;
344
317
  if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {
345
318
  tmpIndex = this._cursorInfo.globalStartIndex;
346
319
  relativeIndex = this._cursorInfo.relativeStartIndex;
@@ -349,13 +322,13 @@ var InputTextArea = /** @class */ (function (_super) {
349
322
  tmpIndex = this._cursorInfo.globalEndIndex;
350
323
  relativeIndex = this._cursorInfo.relativeEndIndex;
351
324
  }
352
- var currentText = currentLine.text.substr(0, relativeIndex);
353
- var currentWidth = this._contextForBreakLines.measureText(currentText).width;
354
- var upperWidth = 0;
355
- var previousWidth = 0;
325
+ const currentText = currentLine.text.substr(0, relativeIndex);
326
+ const currentWidth = this._contextForBreakLines.measureText(currentText).width;
327
+ let upperWidth = 0;
328
+ let previousWidth = 0;
356
329
  tmpIndex -= relativeIndex; // Start of current line
357
330
  tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; // Start of upper line
358
- var upperLineRelativeIndex = 0;
331
+ let upperLineRelativeIndex = 0;
359
332
  while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) {
360
333
  tmpIndex++;
361
334
  upperLineRelativeIndex++;
@@ -403,10 +376,10 @@ var InputTextArea = /** @class */ (function (_super) {
403
376
  this._cursorInfo.globalStartIndex = this.text.length;
404
377
  }
405
378
  else {
406
- var currentLine = this._lines[this._cursorInfo.currentLineIndex];
407
- var underLine = this._lines[this._cursorInfo.currentLineIndex + 1];
408
- var tmpIndex = 0;
409
- var relativeIndex = 0;
379
+ const currentLine = this._lines[this._cursorInfo.currentLineIndex];
380
+ const underLine = this._lines[this._cursorInfo.currentLineIndex + 1];
381
+ let tmpIndex = 0;
382
+ let relativeIndex = 0;
410
383
  if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) {
411
384
  tmpIndex = this._cursorInfo.globalStartIndex;
412
385
  relativeIndex = this._cursorInfo.relativeStartIndex;
@@ -415,12 +388,12 @@ var InputTextArea = /** @class */ (function (_super) {
415
388
  tmpIndex = this._cursorInfo.globalEndIndex;
416
389
  relativeIndex = this._cursorInfo.relativeEndIndex;
417
390
  }
418
- var currentText = currentLine.text.substr(0, relativeIndex);
419
- var currentWidth = this._contextForBreakLines.measureText(currentText).width;
420
- var underWidth = 0;
421
- var previousWidth = 0;
391
+ const currentText = currentLine.text.substr(0, relativeIndex);
392
+ const currentWidth = this._contextForBreakLines.measureText(currentText).width;
393
+ let underWidth = 0;
394
+ let previousWidth = 0;
422
395
  tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; // Start of current line
423
- var underLineRelativeIndex = 0;
396
+ let underLineRelativeIndex = 0;
424
397
  while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) {
425
398
  tmpIndex++;
426
399
  underLineRelativeIndex++;
@@ -451,8 +424,8 @@ var InputTextArea = /** @class */ (function (_super) {
451
424
  return;
452
425
  }
453
426
  // Printable characters
454
- if ((key === null || key === void 0 ? void 0 : key.length) === 1) {
455
- evt === null || evt === void 0 ? void 0 : evt.preventDefault();
427
+ if (key?.length === 1) {
428
+ evt?.preventDefault();
456
429
  this._currentKey = key;
457
430
  this.onBeforeKeyAddObservable.notifyObservers(this);
458
431
  key = this._currentKey;
@@ -465,16 +438,15 @@ var InputTextArea = /** @class */ (function (_super) {
465
438
  this._textHasChanged();
466
439
  }
467
440
  }
468
- };
469
- InputTextArea.prototype._parseLineWordWrap = function (line, width, context) {
470
- if (line === void 0) { line = ""; }
471
- var lines = [];
472
- var words = line.split(" ");
473
- var lineWidth = 0;
474
- var _loop_1 = function (n) {
475
- var testLine = n > 0 ? line + " " + words[n] : words[0];
476
- var metrics = context.measureText(testLine);
477
- var testWidth = metrics.width;
441
+ }
442
+ _parseLineWordWrap(line = "", width, context) {
443
+ const lines = [];
444
+ const words = line.split(" ");
445
+ let lineWidth = 0;
446
+ for (let n = 0; n < words.length; n++) {
447
+ const testLine = n > 0 ? line + " " + words[n] : words[0];
448
+ const metrics = context.measureText(testLine);
449
+ const testWidth = metrics.width;
478
450
  if (testWidth > width) {
479
451
  if (n > 0) {
480
452
  // Avoid first word duplication if of too long
@@ -482,15 +454,15 @@ var InputTextArea = /** @class */ (function (_super) {
482
454
  lines.push({ text: line, width: lineWidth, lineEnding: " " });
483
455
  }
484
456
  line = words[n];
485
- var flushedLine_1 = "";
486
- line.split("").map(function (char) {
487
- if (context.measureText(flushedLine_1 + char).width > width) {
488
- lines.push({ text: flushedLine_1, width: context.measureText(flushedLine_1).width, lineEnding: "\n" });
489
- flushedLine_1 = "";
457
+ let flushedLine = "";
458
+ line.split("").map((char) => {
459
+ if (context.measureText(flushedLine + char).width > width) {
460
+ lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: "\n" });
461
+ flushedLine = "";
490
462
  }
491
- flushedLine_1 += char;
463
+ flushedLine += char;
492
464
  });
493
- line = flushedLine_1;
465
+ line = flushedLine;
494
466
  // Measure remaining characters
495
467
  lineWidth = context.measureText(line).width;
496
468
  }
@@ -498,35 +470,29 @@ var InputTextArea = /** @class */ (function (_super) {
498
470
  lineWidth = testWidth;
499
471
  line = testLine;
500
472
  }
501
- };
502
- for (var n = 0; n < words.length; n++) {
503
- _loop_1(n);
504
473
  }
505
474
  lines.push({ text: line, width: lineWidth, lineEnding: " " });
506
475
  return lines;
507
- };
508
- InputTextArea.prototype._breakLines = function (refWidth, context) {
509
- var lines = [];
510
- var _lines = this.text.split("\n");
476
+ }
477
+ _breakLines(refWidth, context) {
478
+ const lines = [];
479
+ const _lines = this.text.split("\n");
511
480
  if (this.clipContent) {
512
- for (var _i = 0, _lines_1 = _lines; _i < _lines_1.length; _i++) {
513
- var _line = _lines_1[_i];
514
- lines.push.apply(lines, this._parseLineWordWrap(_line, refWidth, context));
481
+ for (const _line of _lines) {
482
+ lines.push(...this._parseLineWordWrap(_line, refWidth, context));
515
483
  }
516
484
  }
517
485
  else {
518
- for (var _a = 0, _lines_2 = _lines; _a < _lines_2.length; _a++) {
519
- var _line = _lines_2[_a];
486
+ for (const _line of _lines) {
520
487
  lines.push(this._parseLine(_line, context));
521
488
  }
522
489
  }
523
490
  lines[lines.length - 1].lineEnding = "\n";
524
491
  return lines;
525
- };
526
- InputTextArea.prototype._parseLine = function (line, context) {
527
- if (line === void 0) { line = ""; }
492
+ }
493
+ _parseLine(line = "", context) {
528
494
  return { text: line, width: context.measureText(line).width, lineEnding: " " };
529
- };
495
+ }
530
496
  /**
531
497
  * Processing of child right before the parent measurement update
532
498
  *
@@ -534,11 +500,11 @@ var InputTextArea = /** @class */ (function (_super) {
534
500
  * @param context The rendering canvas
535
501
  * @hidden
536
502
  */
537
- InputTextArea.prototype._preMeasure = function (parentMeasure, context) {
503
+ _preMeasure(parentMeasure, context) {
538
504
  if (!this._fontOffset || this._wasDirty) {
539
505
  this._fontOffset = Control._GetFontOffset(context.font);
540
506
  }
541
- var text = this._beforeRenderText(this._textWrapper).text;
507
+ let text = this._beforeRenderText(this._textWrapper).text;
542
508
  // placeholder conditions and color setting
543
509
  if (!this._isFocused && !this.text && this._placeholderText) {
544
510
  text = this._placeholderText;
@@ -549,15 +515,15 @@ var InputTextArea = /** @class */ (function (_super) {
549
515
  // measures the textlength -> this.measure.width
550
516
  this._textWidth = context.measureText(text).width;
551
517
  // we double up the margin width
552
- var marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2;
518
+ const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2;
553
519
  if (this._autoStretchWidth) {
554
- var tmpLines = text.split("\n");
555
- var longerString = tmpLines.reduce(function (acc, val) {
556
- var valueLength = context.measureText(val).width;
557
- var accLength = context.measureText(acc).width;
520
+ const tmpLines = text.split("\n");
521
+ const longerString = tmpLines.reduce((acc, val) => {
522
+ const valueLength = context.measureText(val).width;
523
+ const accLength = context.measureText(acc).width;
558
524
  return valueLength > accLength ? val : acc;
559
525
  }, "");
560
- var longerStringWidth = context.measureText(longerString).width;
526
+ const longerStringWidth = context.measureText(longerString).width;
561
527
  this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + "px";
562
528
  this.autoStretchWidth = true;
563
529
  }
@@ -567,16 +533,16 @@ var InputTextArea = /** @class */ (function (_super) {
567
533
  // can we find a cleaner implementation here?
568
534
  this._contextForBreakLines = context;
569
535
  if (this._autoStretchHeight) {
570
- var textHeight = this._lines.length * this._fontOffset.height;
571
- var totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2;
536
+ const textHeight = this._lines.length * this._fontOffset.height;
537
+ const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2;
572
538
  this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + "px";
573
539
  this._autoStretchHeight = true;
574
540
  }
575
541
  this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth;
576
542
  if (this._isFocused) {
577
543
  this._cursorInfo.currentLineIndex = 0;
578
- var lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;
579
- var tmpLength = 0;
544
+ let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;
545
+ let tmpLength = 0;
580
546
  while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {
581
547
  tmpLength += lineLength;
582
548
  if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {
@@ -585,7 +551,7 @@ var InputTextArea = /** @class */ (function (_super) {
585
551
  }
586
552
  }
587
553
  }
588
- };
554
+ }
589
555
  /**
590
556
  * Processing of child after the parent measurement update
591
557
  *
@@ -594,11 +560,11 @@ var InputTextArea = /** @class */ (function (_super) {
594
560
  * @hidden
595
561
  */
596
562
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
597
- InputTextArea.prototype._additionalProcessing = function (parentMeasure, context) {
563
+ _additionalProcessing(parentMeasure, context) {
598
564
  this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, parentMeasure.width);
599
565
  this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, parentMeasure.height);
600
566
  if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {
601
- var textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;
567
+ const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;
602
568
  if (!this._scrollLeft) {
603
569
  this._scrollLeft = textLeft;
604
570
  }
@@ -607,8 +573,8 @@ var InputTextArea = /** @class */ (function (_super) {
607
573
  this._scrollLeft = this._clipTextLeft;
608
574
  }
609
575
  if (this._isFocused && !this._autoStretchHeight) {
610
- var selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height;
611
- var textTop = this._clipTextTop - selectedHeight;
576
+ const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height;
577
+ const textTop = this._clipTextTop - selectedHeight;
612
578
  if (!this._scrollTop) {
613
579
  this._scrollTop = textTop;
614
580
  }
@@ -619,10 +585,10 @@ var InputTextArea = /** @class */ (function (_super) {
619
585
  // Flush the highlighted text each frame
620
586
  this.highlightedText = "";
621
587
  this.onLinesReadyObservable.notifyObservers(this);
622
- };
623
- InputTextArea.prototype._drawText = function (text, textWidth, y, context) {
624
- var width = this._currentMeasure.width;
625
- var x = this._scrollLeft;
588
+ }
589
+ _drawText(text, textWidth, y, context) {
590
+ const width = this._currentMeasure.width;
591
+ let x = this._scrollLeft;
626
592
  switch (this._textHorizontalAlignment) {
627
593
  case Control.HORIZONTAL_ALIGNMENT_LEFT:
628
594
  x += 0;
@@ -644,29 +610,29 @@ var InputTextArea = /** @class */ (function (_super) {
644
610
  context.strokeText(text, this._currentMeasure.left + x, y);
645
611
  }
646
612
  context.fillText(text, x, y);
647
- };
613
+ }
648
614
  /**
649
615
  * Copy the text in the clipboard
650
616
  *
651
617
  * @param ev The clipboard event
652
618
  * @hidden
653
619
  */
654
- InputTextArea.prototype._onCopyText = function (ev) {
620
+ _onCopyText(ev) {
655
621
  this._isTextHighlightOn = false;
656
622
  //when write permission to clipbaord data is denied
657
623
  try {
658
624
  ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText);
659
625
  }
660
- catch (_a) { } //pass
626
+ catch { } //pass
661
627
  this._host.clipboardData = this._highlightedText;
662
- };
628
+ }
663
629
  /**
664
630
  * Cut the text and copy it in the clipboard
665
631
  *
666
632
  * @param ev The clipboard event
667
633
  * @hidden
668
634
  */
669
- InputTextArea.prototype._onCutText = function (ev) {
635
+ _onCutText(ev) {
670
636
  if (!this._highlightedText) {
671
637
  return;
672
638
  }
@@ -674,19 +640,19 @@ var InputTextArea = /** @class */ (function (_super) {
674
640
  try {
675
641
  ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText);
676
642
  }
677
- catch (_a) { } //pass
643
+ catch { } //pass
678
644
  this._host.clipboardData = this._highlightedText;
679
645
  this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);
680
646
  this._textHasChanged();
681
- };
647
+ }
682
648
  /**
683
649
  * Paste the copied text from the clipboard
684
650
  *
685
651
  * @param ev The clipboard event
686
652
  * @hidden
687
653
  */
688
- InputTextArea.prototype._onPasteText = function (ev) {
689
- var data = "";
654
+ _onPasteText(ev) {
655
+ let data = "";
690
656
  if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) {
691
657
  data = ev.clipboardData.getData("text/plain");
692
658
  }
@@ -696,15 +662,14 @@ var InputTextArea = /** @class */ (function (_super) {
696
662
  }
697
663
  this._isTextHighlightOn = false;
698
664
  this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data);
699
- var deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex);
665
+ const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex);
700
666
  this._cursorInfo.globalStartIndex += deltaIndex;
701
667
  this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;
702
668
  this._textHasChanged();
703
- };
704
- InputTextArea.prototype._draw = function (context) {
705
- var _a, _b;
706
- this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== void 0 ? _a : 0;
707
- this._scrollTop = (_b = this._scrollTop) !== null && _b !== void 0 ? _b : 0;
669
+ }
670
+ _draw(context) {
671
+ this._scrollLeft = this._scrollLeft ?? 0;
672
+ this._scrollTop = this._scrollTop ?? 0;
708
673
  context.save();
709
674
  this._applyStates(context);
710
675
  if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
@@ -733,9 +698,9 @@ var InputTextArea = /** @class */ (function (_super) {
733
698
  if (this.color) {
734
699
  context.fillStyle = this.color;
735
700
  }
736
- var height = this._currentMeasure.height;
737
- var width = this._currentMeasure.width;
738
- var rootY = 0;
701
+ const height = this._currentMeasure.height;
702
+ const width = this._currentMeasure.width;
703
+ let rootY = 0;
739
704
  switch (this._textVerticalAlignment) {
740
705
  case Control.VERTICAL_ALIGNMENT_TOP:
741
706
  rootY = this._fontOffset.ascent;
@@ -755,8 +720,8 @@ var InputTextArea = /** @class */ (function (_super) {
755
720
  context.clip();
756
721
  // Text
757
722
  rootY += this._scrollTop;
758
- for (var i = 0; i < this._lines.length; i++) {
759
- var line = this._lines[i];
723
+ for (let i = 0; i < this._lines.length; i++) {
724
+ const line = this._lines[i];
760
725
  if (i !== 0 && this._lineSpacing.internalValue !== 0) {
761
726
  if (this._lineSpacing.isPixel) {
762
727
  rootY += this._lineSpacing.getValue(this._host);
@@ -773,7 +738,7 @@ var InputTextArea = /** @class */ (function (_super) {
773
738
  if (this._isFocused) {
774
739
  // Render cursor
775
740
  if (!this._blinkIsEven || this._isTextHighlightOn) {
776
- var cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width;
741
+ let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width;
777
742
  if (cursorLeft < this._clipTextLeft) {
778
743
  this._scrollLeft += this._clipTextLeft - cursorLeft;
779
744
  cursorLeft = this._clipTextLeft;
@@ -784,7 +749,7 @@ var InputTextArea = /** @class */ (function (_super) {
784
749
  cursorLeft = this._clipTextLeft + this._availableWidth;
785
750
  this._markAsDirty();
786
751
  }
787
- var cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; //cursorTop distance from top to cursor start
752
+ let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; //cursorTop distance from top to cursor start
788
753
  if (cursorTop < this._clipTextTop) {
789
754
  this._scrollTop += this._clipTextTop - cursorTop;
790
755
  cursorTop = this._clipTextTop;
@@ -806,12 +771,12 @@ var InputTextArea = /** @class */ (function (_super) {
806
771
  this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex);
807
772
  context.globalAlpha = this._highligherOpacity;
808
773
  context.fillStyle = this._textHighlightColor;
809
- var startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);
810
- var endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);
811
- var highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height;
812
- for (var i = startLineIndex; i <= endLineIndex; i++) {
813
- var line = this._lines[i];
814
- var highlightRootX = this._scrollLeft;
774
+ const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);
775
+ const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex);
776
+ let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height;
777
+ for (let i = startLineIndex; i <= endLineIndex; i++) {
778
+ const line = this._lines[i];
779
+ let highlightRootX = this._scrollLeft;
815
780
  switch (this._textHorizontalAlignment) {
816
781
  case Control.HORIZONTAL_ALIGNMENT_LEFT:
817
782
  highlightRootX += 0;
@@ -823,11 +788,11 @@ var InputTextArea = /** @class */ (function (_super) {
823
788
  highlightRootX += (width - line.width) / 2;
824
789
  break;
825
790
  }
826
- var begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0;
827
- var end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length;
828
- var leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width;
829
- var selectedText = line.text.substring(begin, end);
830
- var hightlightWidth = context.measureText(selectedText).width;
791
+ const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0;
792
+ const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length;
793
+ const leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width;
794
+ const selectedText = line.text.substring(begin, end);
795
+ const hightlightWidth = context.measureText(selectedText).width;
831
796
  context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height);
832
797
  highlightRootY += this._fontOffset.height;
833
798
  }
@@ -852,24 +817,23 @@ var InputTextArea = /** @class */ (function (_super) {
852
817
  context.lineWidth = this._thickness;
853
818
  context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness);
854
819
  }
855
- };
856
- InputTextArea.prototype._resetBlinking = function () {
857
- var _this = this;
820
+ }
821
+ _resetBlinking() {
858
822
  clearTimeout(this._blinkTimeout);
859
- this._blinkTimeout = setTimeout(function () {
860
- _this._blinkIsEven = !_this._blinkIsEven;
861
- _this._markAsDirty();
823
+ this._blinkTimeout = setTimeout(() => {
824
+ this._blinkIsEven = !this._blinkIsEven;
825
+ this._markAsDirty();
862
826
  }, 500);
863
- };
864
- InputTextArea.prototype._applyStates = function (context) {
865
- _super.prototype._applyStates.call(this, context);
827
+ }
828
+ _applyStates(context) {
829
+ super._applyStates(context);
866
830
  if (this.outlineWidth) {
867
831
  context.lineWidth = this.outlineWidth;
868
832
  context.strokeStyle = this.outlineColor;
869
833
  }
870
- };
871
- InputTextArea.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
872
- if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
834
+ }
835
+ _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
836
+ if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {
873
837
  return false;
874
838
  }
875
839
  this._clickedCoordinateX = coordinates.x;
@@ -889,9 +853,9 @@ var InputTextArea = /** @class */ (function (_super) {
889
853
  }
890
854
  this._host.focusedControl = this;
891
855
  return true;
892
- };
856
+ }
893
857
  // for textselection
894
- InputTextArea.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
858
+ _onPointerMove(target, coordinates, pointerId, pi) {
895
859
  // Avoid Chromium-like beahavior when this event is fired right after onPointerDown
896
860
  if (pi.event.movementX === 0 && pi.event.movementY === 0) {
897
861
  return;
@@ -907,13 +871,12 @@ var InputTextArea = /** @class */ (function (_super) {
907
871
  }
908
872
  this._markAsDirty();
909
873
  }
910
- _super.prototype._onPointerMove.call(this, target, coordinates, pointerId, pi);
911
- };
874
+ super._onPointerMove(target, coordinates, pointerId, pi);
875
+ }
912
876
  /**
913
877
  * Apply the correct position of cursor according to current modification
914
878
  */
915
- InputTextArea.prototype._updateCursorPosition = function () {
916
- var _a;
879
+ _updateCursorPosition() {
917
880
  if (!this._isFocused) {
918
881
  return;
919
882
  }
@@ -927,16 +890,16 @@ var InputTextArea = /** @class */ (function (_super) {
927
890
  currentLineIndex: 0,
928
891
  };
929
892
  }
930
- var globalIndex = 0;
931
- var relativeIndex = 0;
932
- var lastClickedCoordinateY = this._clickedCoordinateY - this._scrollTop;
933
- var relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height);
893
+ let globalIndex = 0;
894
+ let relativeIndex = 0;
895
+ const lastClickedCoordinateY = this._clickedCoordinateY - this._scrollTop;
896
+ const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height);
934
897
  this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1);
935
- var currentSize = 0;
936
- var relativeXPosition = this._clickedCoordinateX - ((_a = this._scrollLeft) !== null && _a !== void 0 ? _a : 0);
937
- var previousDist = 0;
938
- for (var index = 0; index < this._cursorInfo.currentLineIndex; index++) {
939
- var line = this._lines[index];
898
+ let currentSize = 0;
899
+ const relativeXPosition = this._clickedCoordinateX - (this._scrollLeft ?? 0);
900
+ let previousDist = 0;
901
+ for (let index = 0; index < this._cursorInfo.currentLineIndex; index++) {
902
+ const line = this._lines[index];
940
903
  globalIndex += line.text.length + line.lineEnding.length;
941
904
  }
942
905
  while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) {
@@ -978,8 +941,8 @@ var InputTextArea = /** @class */ (function (_super) {
978
941
  // Standard behavior same as Current line is at least above the initial highlight index
979
942
  this._cursorInfo.relativeStartIndex = 0;
980
943
  this._cursorInfo.currentLineIndex = 0;
981
- var lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;
982
- var tmpLength = 0;
944
+ let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length;
945
+ let tmpLength = 0;
983
946
  while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) {
984
947
  tmpLength += lineLength;
985
948
  if (this._cursorInfo.currentLineIndex < this._lines.length - 1) {
@@ -1004,7 +967,7 @@ var InputTextArea = /** @class */ (function (_super) {
1004
967
  this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex;
1005
968
  }
1006
969
  }
1007
- };
970
+ }
1008
971
  /**
1009
972
  * Update all values of cursor information based on cursorIndex value
1010
973
  *
@@ -1012,18 +975,18 @@ var InputTextArea = /** @class */ (function (_super) {
1012
975
  * @hidden
1013
976
  */
1014
977
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1015
- InputTextArea.prototype._updateValueFromCursorIndex = function (offset) {
978
+ _updateValueFromCursorIndex(offset) {
1016
979
  // Override to avoid parent behavior during _onPointerMove
1017
- };
980
+ }
1018
981
  /**
1019
982
  * Select the word immediatly under the cursor on double click
1020
983
  *
1021
984
  * @param _evt Pointer informations of double click
1022
985
  * @hidden
1023
986
  */
1024
- InputTextArea.prototype._processDblClick = function (_evt) {
987
+ _processDblClick(_evt) {
1025
988
  //pre-find the start and end index of the word under cursor, speeds up the rendering
1026
- var moveLeft, moveRight;
989
+ let moveLeft, moveRight;
1027
990
  do {
1028
991
  moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0;
1029
992
  moveRight =
@@ -1035,9 +998,9 @@ var InputTextArea = /** @class */ (function (_super) {
1035
998
  this._isTextHighlightOn = true;
1036
999
  this._blinkIsEven = true;
1037
1000
  this._markAsDirty();
1038
- };
1001
+ }
1039
1002
  /** @hidden */
1040
- InputTextArea.prototype._selectAllText = function () {
1003
+ _selectAllText() {
1041
1004
  this._isTextHighlightOn = true;
1042
1005
  this._blinkIsEven = true;
1043
1006
  this._highlightCursorInfo = {
@@ -1053,19 +1016,17 @@ var InputTextArea = /** @class */ (function (_super) {
1053
1016
  currentLineIndex: this._lines.length - 1,
1054
1017
  };
1055
1018
  this._markAsDirty();
1056
- };
1057
- InputTextArea.prototype.dipose = function () {
1058
- _super.prototype.dispose.call(this);
1019
+ }
1020
+ dipose() {
1021
+ super.dispose();
1059
1022
  this.onLinesReadyObservable.clear();
1060
- };
1061
- __decorate([
1062
- serialize()
1063
- ], InputTextArea.prototype, "autoStretchHeight", null);
1064
- __decorate([
1065
- serialize()
1066
- ], InputTextArea.prototype, "maxHeight", null);
1067
- return InputTextArea;
1068
- }(InputText));
1069
- export { InputTextArea };
1023
+ }
1024
+ }
1025
+ __decorate([
1026
+ serialize()
1027
+ ], InputTextArea.prototype, "autoStretchHeight", null);
1028
+ __decorate([
1029
+ serialize()
1030
+ ], InputTextArea.prototype, "maxHeight", null);
1070
1031
  RegisterClass("BABYLON.GUI.InputTextArea", InputTextArea);
1071
1032
  //# sourceMappingURL=inputTextArea.js.map