@babylonjs/gui 5.19.0 → 5.22.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 (180) hide show
  1. package/2D/adtInstrumentation.js +70 -90
  2. package/2D/adtInstrumentation.js.map +1 -1
  3. package/2D/advancedDynamicTexture.d.ts +8 -0
  4. package/2D/advancedDynamicTexture.js +559 -620
  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 +1073 -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 +64 -76
  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.d.ts +4 -0
  51. package/2D/controls/sliders/imageScrollBar.js +149 -163
  52. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  53. package/2D/controls/sliders/scrollBar.d.ts +4 -0
  54. package/2D/controls/sliders/scrollBar.js +65 -65
  55. package/2D/controls/sliders/scrollBar.js.map +1 -1
  56. package/2D/controls/sliders/slider.js +91 -115
  57. package/2D/controls/sliders/slider.js.map +1 -1
  58. package/2D/controls/stackPanel.js +114 -135
  59. package/2D/controls/stackPanel.js.map +1 -1
  60. package/2D/controls/statics.js +5 -5
  61. package/2D/controls/statics.js.map +1 -1
  62. package/2D/controls/textBlock.js +322 -384
  63. package/2D/controls/textBlock.js.map +1 -1
  64. package/2D/controls/textWrapper.js +27 -41
  65. package/2D/controls/textWrapper.js.map +1 -1
  66. package/2D/controls/toggleButton.js +105 -121
  67. package/2D/controls/toggleButton.js.map +1 -1
  68. package/2D/controls/virtualKeyboard.js +101 -123
  69. package/2D/controls/virtualKeyboard.js.map +1 -1
  70. package/2D/math2D.js +62 -70
  71. package/2D/math2D.js.map +1 -1
  72. package/2D/measure.js +30 -32
  73. package/2D/measure.js.map +1 -1
  74. package/2D/multiLinePoint.js +71 -89
  75. package/2D/multiLinePoint.js.map +1 -1
  76. package/2D/style.js +55 -73
  77. package/2D/style.js.map +1 -1
  78. package/2D/valueAndUnit.js +71 -104
  79. package/2D/valueAndUnit.js.map +1 -1
  80. package/2D/xmlLoader.js +70 -84
  81. package/2D/xmlLoader.js.map +1 -1
  82. package/3D/behaviors/defaultBehavior.js +40 -59
  83. package/3D/behaviors/defaultBehavior.js.map +1 -1
  84. package/3D/controls/abstractButton3D.js +8 -12
  85. package/3D/controls/abstractButton3D.js.map +1 -1
  86. package/3D/controls/button3D.js +30 -35
  87. package/3D/controls/button3D.js.map +1 -1
  88. package/3D/controls/container3D.js +57 -71
  89. package/3D/controls/container3D.js.map +1 -1
  90. package/3D/controls/contentDisplay3D.js +47 -60
  91. package/3D/controls/contentDisplay3D.js.map +1 -1
  92. package/3D/controls/control3D.js +123 -158
  93. package/3D/controls/control3D.js.map +1 -1
  94. package/3D/controls/cylinderPanel.js +28 -38
  95. package/3D/controls/cylinderPanel.js.map +1 -1
  96. package/3D/controls/handMenu.js +20 -29
  97. package/3D/controls/handMenu.js.map +1 -1
  98. package/3D/controls/holographicBackplate.js +52 -72
  99. package/3D/controls/holographicBackplate.js.map +1 -1
  100. package/3D/controls/holographicButton.js +160 -200
  101. package/3D/controls/holographicButton.js.map +1 -1
  102. package/3D/controls/holographicSlate.js +176 -206
  103. package/3D/controls/holographicSlate.js.map +1 -1
  104. package/3D/controls/meshButton3D.js +24 -30
  105. package/3D/controls/meshButton3D.js.map +1 -1
  106. package/3D/controls/nearMenu.js +57 -71
  107. package/3D/controls/nearMenu.js.map +1 -1
  108. package/3D/controls/planePanel.js +6 -13
  109. package/3D/controls/planePanel.js.map +1 -1
  110. package/3D/controls/scatterPanel.js +43 -54
  111. package/3D/controls/scatterPanel.js.map +1 -1
  112. package/3D/controls/slider3D.js +168 -222
  113. package/3D/controls/slider3D.js.map +1 -1
  114. package/3D/controls/spherePanel.js +29 -39
  115. package/3D/controls/spherePanel.js.map +1 -1
  116. package/3D/controls/stackPanel3D.js +36 -49
  117. package/3D/controls/stackPanel3D.js.map +1 -1
  118. package/3D/controls/touchButton3D.js +126 -154
  119. package/3D/controls/touchButton3D.js.map +1 -1
  120. package/3D/controls/touchHolographicButton.js +223 -272
  121. package/3D/controls/touchHolographicButton.js.map +1 -1
  122. package/3D/controls/touchHolographicMenu.js +55 -66
  123. package/3D/controls/touchHolographicMenu.js.map +1 -1
  124. package/3D/controls/touchMeshButton3D.js +24 -30
  125. package/3D/controls/touchMeshButton3D.js.map +1 -1
  126. package/3D/controls/volumeBasedPanel.js +85 -107
  127. package/3D/controls/volumeBasedPanel.js.map +1 -1
  128. package/3D/gizmos/gizmoHandle.js +68 -103
  129. package/3D/gizmos/gizmoHandle.js.map +1 -1
  130. package/3D/gizmos/slateGizmo.js +165 -182
  131. package/3D/gizmos/slateGizmo.js.map +1 -1
  132. package/3D/gui3DManager.js +76 -101
  133. package/3D/gui3DManager.js.map +1 -1
  134. package/3D/materials/fluent/fluentMaterial.js +110 -119
  135. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  136. package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
  137. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  138. package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
  139. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  140. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
  141. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  142. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
  143. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  144. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
  145. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  146. package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
  147. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  148. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
  149. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  150. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
  151. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  152. package/3D/materials/handle/handleMaterial.js +56 -69
  153. package/3D/materials/handle/handleMaterial.js.map +1 -1
  154. package/3D/materials/handle/shaders/handle.fragment.js +3 -3
  155. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  156. package/3D/materials/handle/shaders/handle.vertex.js +3 -3
  157. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  158. package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
  159. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  160. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
  161. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  162. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
  163. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  164. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
  165. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  166. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
  167. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  168. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
  169. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  170. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
  171. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  172. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
  173. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  174. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
  175. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  176. package/3D/vector3WithInfo.js +6 -12
  177. package/3D/vector3WithInfo.js.map +1 -1
  178. package/legacy/legacy.js +1 -1
  179. package/legacy/legacy.js.map +1 -1
  180. package/package.json +2 -5
@@ -1,4 +1,4 @@
1
- import { __decorate, __extends } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { Rectangle } from "../rectangle.js";
3
3
  import { Grid } from "../grid.js";
4
4
  import { Control } from "../control.js";
@@ -10,165 +10,138 @@ import { serialize } from "@babylonjs/core/Misc/decorators.js";
10
10
  /**
11
11
  * Class used to hold a viewer window and sliders in a grid
12
12
  */
13
- var ScrollViewer = /** @class */ (function (_super) {
14
- __extends(ScrollViewer, _super);
13
+ export class ScrollViewer extends Rectangle {
15
14
  /**
16
15
  * Creates a new ScrollViewer
17
16
  * @param name of ScrollViewer
18
17
  * @param isImageBased
19
18
  */
20
- function ScrollViewer(name, isImageBased) {
21
- var _this = _super.call(this, name) || this;
22
- _this._barSize = 20;
23
- _this._pointerIsOver = false;
24
- _this._wheelPrecision = 0.05;
25
- _this._thumbLength = 0.5;
26
- _this._thumbHeight = 1;
27
- _this._barImageHeight = 1;
28
- _this._horizontalBarImageHeight = 1;
29
- _this._verticalBarImageHeight = 1;
30
- _this._oldWindowContentsWidth = 0;
31
- _this._oldWindowContentsHeight = 0;
32
- _this._forceHorizontalBar = false;
33
- _this._forceVerticalBar = false;
34
- _this._useImageBar = isImageBased ? isImageBased : false;
35
- _this.onDirtyObservable.add(function () {
36
- _this._horizontalBarSpace.color = _this.color;
37
- _this._verticalBarSpace.color = _this.color;
38
- _this._dragSpace.color = _this.color;
19
+ constructor(name, isImageBased) {
20
+ super(name);
21
+ this._barSize = 20;
22
+ this._pointerIsOver = false;
23
+ this._wheelPrecision = 0.05;
24
+ this._thumbLength = 0.5;
25
+ this._thumbHeight = 1;
26
+ this._barImageHeight = 1;
27
+ this._horizontalBarImageHeight = 1;
28
+ this._verticalBarImageHeight = 1;
29
+ this._oldWindowContentsWidth = 0;
30
+ this._oldWindowContentsHeight = 0;
31
+ this._forceHorizontalBar = false;
32
+ this._forceVerticalBar = false;
33
+ this._useImageBar = isImageBased ? isImageBased : false;
34
+ this.onDirtyObservable.add(() => {
35
+ this._horizontalBarSpace.color = this.color;
36
+ this._verticalBarSpace.color = this.color;
37
+ this._dragSpace.color = this.color;
39
38
  });
40
- _this.onPointerEnterObservable.add(function () {
41
- _this._pointerIsOver = true;
39
+ this.onPointerEnterObservable.add(() => {
40
+ this._pointerIsOver = true;
42
41
  });
43
- _this.onPointerOutObservable.add(function () {
44
- _this._pointerIsOver = false;
42
+ this.onPointerOutObservable.add(() => {
43
+ this._pointerIsOver = false;
45
44
  });
46
- _this._grid = new Grid();
47
- if (_this._useImageBar) {
48
- _this._horizontalBar = new ImageScrollBar();
49
- _this._verticalBar = new ImageScrollBar();
45
+ this._grid = new Grid();
46
+ if (this._useImageBar) {
47
+ this._horizontalBar = new ImageScrollBar();
48
+ this._verticalBar = new ImageScrollBar();
50
49
  }
51
50
  else {
52
- _this._horizontalBar = new ScrollBar();
53
- _this._verticalBar = new ScrollBar();
54
- }
55
- _this._window = new _ScrollViewerWindow("scrollViewer_window");
56
- _this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
57
- _this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
58
- _this._grid.addColumnDefinition(1);
59
- _this._grid.addColumnDefinition(0, true);
60
- _this._grid.addRowDefinition(1);
61
- _this._grid.addRowDefinition(0, true);
62
- _super.prototype.addControl.call(_this, _this._grid);
63
- _this._grid.addControl(_this._window, 0, 0);
64
- _this._verticalBarSpace = new Rectangle();
65
- _this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
66
- _this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
67
- _this._verticalBarSpace.thickness = 1;
68
- _this._grid.addControl(_this._verticalBarSpace, 0, 1);
69
- _this._addBar(_this._verticalBar, _this._verticalBarSpace, true, Math.PI);
70
- _this._horizontalBarSpace = new Rectangle();
71
- _this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
72
- _this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
73
- _this._horizontalBarSpace.thickness = 1;
74
- _this._grid.addControl(_this._horizontalBarSpace, 1, 0);
75
- _this._addBar(_this._horizontalBar, _this._horizontalBarSpace, false, 0);
76
- _this._dragSpace = new Rectangle();
77
- _this._dragSpace.thickness = 1;
78
- _this._grid.addControl(_this._dragSpace, 1, 1);
51
+ this._horizontalBar = new ScrollBar();
52
+ this._verticalBar = new ScrollBar();
53
+ }
54
+ this._window = new _ScrollViewerWindow("scrollViewer_window");
55
+ this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
56
+ this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
57
+ this._grid.addColumnDefinition(1);
58
+ this._grid.addColumnDefinition(0, true);
59
+ this._grid.addRowDefinition(1);
60
+ this._grid.addRowDefinition(0, true);
61
+ super.addControl(this._grid);
62
+ this._grid.addControl(this._window, 0, 0);
63
+ this._verticalBarSpace = new Rectangle();
64
+ this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
65
+ this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
66
+ this._verticalBarSpace.thickness = 1;
67
+ this._grid.addControl(this._verticalBarSpace, 0, 1);
68
+ this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI);
69
+ this._horizontalBarSpace = new Rectangle();
70
+ this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
71
+ this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
72
+ this._horizontalBarSpace.thickness = 1;
73
+ this._grid.addControl(this._horizontalBarSpace, 1, 0);
74
+ this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0);
75
+ this._dragSpace = new Rectangle();
76
+ this._dragSpace.thickness = 1;
77
+ this._grid.addControl(this._dragSpace, 1, 1);
79
78
  // Colors
80
- if (!_this._useImageBar) {
81
- _this.barColor = "grey";
82
- _this.barBackground = "transparent";
83
- }
84
- return _this;
85
- }
86
- Object.defineProperty(ScrollViewer.prototype, "horizontalBar", {
87
- /**
88
- * Gets the horizontal scrollbar
89
- */
90
- get: function () {
91
- return this._horizontalBar;
92
- },
93
- enumerable: false,
94
- configurable: true
95
- });
96
- Object.defineProperty(ScrollViewer.prototype, "verticalBar", {
97
- /**
98
- * Gets the vertical scrollbar
99
- */
100
- get: function () {
101
- return this._verticalBar;
102
- },
103
- enumerable: false,
104
- configurable: true
105
- });
79
+ if (!this._useImageBar) {
80
+ this.barColor = "grey";
81
+ this.barBackground = "transparent";
82
+ }
83
+ }
84
+ /**
85
+ * Gets the horizontal scrollbar
86
+ */
87
+ get horizontalBar() {
88
+ return this._horizontalBar;
89
+ }
90
+ /**
91
+ * Gets the vertical scrollbar
92
+ */
93
+ get verticalBar() {
94
+ return this._verticalBar;
95
+ }
106
96
  /**
107
97
  * Adds a new control to the current container
108
98
  * @param control defines the control to add
109
99
  * @returns the current container
110
100
  */
111
- ScrollViewer.prototype.addControl = function (control) {
101
+ addControl(control) {
112
102
  if (!control) {
113
103
  return this;
114
104
  }
115
105
  this._window.addControl(control);
116
106
  return this;
117
- };
107
+ }
118
108
  /**
119
109
  * Removes a control from the current container
120
110
  * @param control defines the control to remove
121
111
  * @returns the current container
122
112
  */
123
- ScrollViewer.prototype.removeControl = function (control) {
113
+ removeControl(control) {
124
114
  this._window.removeControl(control);
125
115
  return this;
126
- };
127
- Object.defineProperty(ScrollViewer.prototype, "children", {
128
- /** Gets the list of children */
129
- get: function () {
130
- return this._window.children;
131
- },
132
- enumerable: false,
133
- configurable: true
134
- });
135
- ScrollViewer.prototype._flagDescendantsAsMatrixDirty = function () {
136
- for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
137
- var child = _a[_i];
116
+ }
117
+ /** Gets the list of children */
118
+ get children() {
119
+ return this._window.children;
120
+ }
121
+ _flagDescendantsAsMatrixDirty() {
122
+ for (const child of this._children) {
138
123
  child._markMatrixAsDirty();
139
124
  }
140
- };
141
- Object.defineProperty(ScrollViewer.prototype, "freezeControls", {
142
- /**
143
- * Freezes or unfreezes the controls in the window.
144
- * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
145
- * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
146
- */
147
- get: function () {
148
- return this._window.freezeControls;
149
- },
150
- set: function (value) {
151
- this._window.freezeControls = value;
152
- },
153
- enumerable: false,
154
- configurable: true
155
- });
156
- Object.defineProperty(ScrollViewer.prototype, "bucketWidth", {
157
- /** Gets the bucket width */
158
- get: function () {
159
- return this._window.bucketWidth;
160
- },
161
- enumerable: false,
162
- configurable: true
163
- });
164
- Object.defineProperty(ScrollViewer.prototype, "bucketHeight", {
165
- /** Gets the bucket height */
166
- get: function () {
167
- return this._window.bucketHeight;
168
- },
169
- enumerable: false,
170
- configurable: true
171
- });
125
+ }
126
+ /**
127
+ * Freezes or unfreezes the controls in the window.
128
+ * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
129
+ * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
130
+ */
131
+ get freezeControls() {
132
+ return this._window.freezeControls;
133
+ }
134
+ set freezeControls(value) {
135
+ this._window.freezeControls = value;
136
+ }
137
+ /** Gets the bucket width */
138
+ get bucketWidth() {
139
+ return this._window.bucketWidth;
140
+ }
141
+ /** Gets the bucket height */
142
+ get bucketHeight() {
143
+ return this._window.bucketHeight;
144
+ }
172
145
  /**
173
146
  * Sets the bucket sizes.
174
147
  * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only
@@ -180,383 +153,310 @@ var ScrollViewer = /** @class */ (function (_super) {
180
153
  * @param width width of the bucket
181
154
  * @param height height of the bucket
182
155
  */
183
- ScrollViewer.prototype.setBucketSizes = function (width, height) {
156
+ setBucketSizes(width, height) {
184
157
  this._window.setBucketSizes(width, height);
185
- };
186
- Object.defineProperty(ScrollViewer.prototype, "forceHorizontalBar", {
187
- /**
188
- * Forces the horizontal scroll bar to be displayed
189
- */
190
- get: function () {
191
- return this._forceHorizontalBar;
192
- },
193
- set: function (value) {
194
- this._grid.setRowDefinition(1, value ? this._barSize : 0, true);
195
- this._horizontalBar.isVisible = value;
196
- this._forceHorizontalBar = value;
197
- },
198
- enumerable: false,
199
- configurable: true
200
- });
201
- Object.defineProperty(ScrollViewer.prototype, "forceVerticalBar", {
202
- /**
203
- * Forces the vertical scroll bar to be displayed
204
- */
205
- get: function () {
206
- return this._forceVerticalBar;
207
- },
208
- set: function (value) {
209
- this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
210
- this._verticalBar.isVisible = value;
211
- this._forceVerticalBar = value;
212
- },
213
- enumerable: false,
214
- configurable: true
215
- });
158
+ }
159
+ /**
160
+ * Forces the horizontal scroll bar to be displayed
161
+ */
162
+ get forceHorizontalBar() {
163
+ return this._forceHorizontalBar;
164
+ }
165
+ set forceHorizontalBar(value) {
166
+ this._grid.setRowDefinition(1, value ? this._barSize : 0, true);
167
+ this._horizontalBar.isVisible = value;
168
+ this._forceHorizontalBar = value;
169
+ }
170
+ /**
171
+ * Forces the vertical scroll bar to be displayed
172
+ */
173
+ get forceVerticalBar() {
174
+ return this._forceVerticalBar;
175
+ }
176
+ set forceVerticalBar(value) {
177
+ this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
178
+ this._verticalBar.isVisible = value;
179
+ this._forceVerticalBar = value;
180
+ }
216
181
  /** Reset the scroll viewer window to initial size */
217
- ScrollViewer.prototype.resetWindow = function () {
182
+ resetWindow() {
218
183
  this._window.width = "100%";
219
184
  this._window.height = "100%";
220
- };
221
- ScrollViewer.prototype._getTypeName = function () {
185
+ }
186
+ _getTypeName() {
222
187
  return "ScrollViewer";
223
- };
224
- ScrollViewer.prototype._buildClientSizes = function () {
225
- var ratio = this.host.idealRatio;
188
+ }
189
+ _buildClientSizes() {
190
+ const ratio = this.host.idealRatio;
226
191
  this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
227
192
  this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
228
193
  this._clientWidth = this._window.parentClientWidth;
229
194
  this._clientHeight = this._window.parentClientHeight;
230
- };
231
- ScrollViewer.prototype._additionalProcessing = function (parentMeasure, context) {
232
- _super.prototype._additionalProcessing.call(this, parentMeasure, context);
195
+ }
196
+ _additionalProcessing(parentMeasure, context) {
197
+ super._additionalProcessing(parentMeasure, context);
233
198
  this._buildClientSizes();
234
- };
235
- ScrollViewer.prototype._postMeasure = function () {
236
- _super.prototype._postMeasure.call(this);
199
+ }
200
+ _postMeasure() {
201
+ super._postMeasure();
237
202
  this._updateScroller();
238
203
  this._setWindowPosition(false);
239
- };
240
- Object.defineProperty(ScrollViewer.prototype, "wheelPrecision", {
241
- /**
242
- * Gets or sets the mouse wheel precision
243
- * from 0 to 1 with a default value of 0.05
244
- * */
245
- get: function () {
246
- return this._wheelPrecision;
247
- },
248
- set: function (value) {
249
- if (this._wheelPrecision === value) {
250
- return;
251
- }
252
- if (value < 0) {
253
- value = 0;
254
- }
255
- if (value > 1) {
256
- value = 1;
257
- }
258
- this._wheelPrecision = value;
259
- },
260
- enumerable: false,
261
- configurable: true
262
- });
263
- Object.defineProperty(ScrollViewer.prototype, "scrollBackground", {
264
- /** Gets or sets the scroll bar container background color */
265
- get: function () {
266
- return this._horizontalBarSpace.background;
267
- },
268
- set: function (color) {
269
- if (this._horizontalBarSpace.background === color) {
270
- return;
271
- }
272
- this._horizontalBarSpace.background = color;
273
- this._verticalBarSpace.background = color;
274
- },
275
- enumerable: false,
276
- configurable: true
277
- });
278
- Object.defineProperty(ScrollViewer.prototype, "barColor", {
279
- /** Gets or sets the bar color */
280
- get: function () {
281
- return this._barColor;
282
- },
283
- set: function (color) {
284
- if (this._barColor === color) {
285
- return;
286
- }
287
- this._barColor = color;
288
- this._horizontalBar.color = color;
289
- this._verticalBar.color = color;
290
- },
291
- enumerable: false,
292
- configurable: true
293
- });
294
- Object.defineProperty(ScrollViewer.prototype, "thumbImage", {
295
- /** Gets or sets the bar image */
296
- get: function () {
297
- return this._barImage;
298
- },
299
- set: function (value) {
300
- if (this._barImage === value) {
301
- return;
302
- }
303
- this._barImage = value;
304
- var hb = this._horizontalBar;
305
- var vb = this._verticalBar;
306
- hb.thumbImage = value;
307
- vb.thumbImage = value;
308
- },
309
- enumerable: false,
310
- configurable: true
311
- });
312
- Object.defineProperty(ScrollViewer.prototype, "horizontalThumbImage", {
313
- /** Gets or sets the horizontal bar image */
314
- get: function () {
315
- return this._horizontalBarImage;
316
- },
317
- set: function (value) {
318
- if (this._horizontalBarImage === value) {
319
- return;
320
- }
321
- this._horizontalBarImage = value;
322
- var hb = this._horizontalBar;
323
- hb.thumbImage = value;
324
- },
325
- enumerable: false,
326
- configurable: true
327
- });
328
- Object.defineProperty(ScrollViewer.prototype, "verticalThumbImage", {
329
- /** Gets or sets the vertical bar image */
330
- get: function () {
331
- return this._verticalBarImage;
332
- },
333
- set: function (value) {
334
- if (this._verticalBarImage === value) {
335
- return;
336
- }
337
- this._verticalBarImage = value;
338
- var vb = this._verticalBar;
339
- vb.thumbImage = value;
340
- },
341
- enumerable: false,
342
- configurable: true
343
- });
344
- Object.defineProperty(ScrollViewer.prototype, "barSize", {
345
- /** Gets or sets the size of the bar */
346
- get: function () {
347
- return this._barSize;
348
- },
349
- set: function (value) {
350
- if (this._barSize === value) {
351
- return;
352
- }
353
- this._barSize = value;
354
- this._markAsDirty();
355
- if (this._horizontalBar.isVisible) {
356
- this._grid.setRowDefinition(1, this._barSize, true);
357
- }
358
- if (this._verticalBar.isVisible) {
359
- this._grid.setColumnDefinition(1, this._barSize, true);
360
- }
361
- },
362
- enumerable: false,
363
- configurable: true
364
- });
365
- Object.defineProperty(ScrollViewer.prototype, "thumbLength", {
366
- /** Gets or sets the length of the thumb */
367
- get: function () {
368
- return this._thumbLength;
369
- },
370
- set: function (value) {
371
- if (this._thumbLength === value) {
372
- return;
373
- }
374
- if (value <= 0) {
375
- value = 0.1;
376
- }
377
- if (value > 1) {
378
- value = 1;
379
- }
380
- this._thumbLength = value;
381
- var hb = this._horizontalBar;
382
- var vb = this._verticalBar;
383
- hb.thumbLength = value;
384
- vb.thumbLength = value;
385
- this._markAsDirty();
386
- },
387
- enumerable: false,
388
- configurable: true
389
- });
390
- Object.defineProperty(ScrollViewer.prototype, "thumbHeight", {
391
- /** Gets or sets the height of the thumb */
392
- get: function () {
393
- return this._thumbHeight;
394
- },
395
- set: function (value) {
396
- if (this._thumbHeight === value) {
397
- return;
398
- }
399
- if (value <= 0) {
400
- value = 0.1;
401
- }
402
- if (value > 1) {
403
- value = 1;
404
- }
405
- this._thumbHeight = value;
406
- var hb = this._horizontalBar;
407
- var vb = this._verticalBar;
408
- hb.thumbHeight = value;
409
- vb.thumbHeight = value;
410
- this._markAsDirty();
411
- },
412
- enumerable: false,
413
- configurable: true
414
- });
415
- Object.defineProperty(ScrollViewer.prototype, "barImageHeight", {
416
- /** Gets or sets the height of the bar image */
417
- get: function () {
418
- return this._barImageHeight;
419
- },
420
- set: function (value) {
421
- if (this._barImageHeight === value) {
422
- return;
423
- }
424
- if (value <= 0) {
425
- value = 0.1;
426
- }
427
- if (value > 1) {
428
- value = 1;
429
- }
430
- this._barImageHeight = value;
431
- var hb = this._horizontalBar;
432
- var vb = this._verticalBar;
433
- hb.barImageHeight = value;
434
- vb.barImageHeight = value;
435
- this._markAsDirty();
436
- },
437
- enumerable: false,
438
- configurable: true
439
- });
440
- Object.defineProperty(ScrollViewer.prototype, "horizontalBarImageHeight", {
441
- /** Gets or sets the height of the horizontal bar image */
442
- get: function () {
443
- return this._horizontalBarImageHeight;
444
- },
445
- set: function (value) {
446
- if (this._horizontalBarImageHeight === value) {
447
- return;
448
- }
449
- if (value <= 0) {
450
- value = 0.1;
451
- }
452
- if (value > 1) {
453
- value = 1;
454
- }
455
- this._horizontalBarImageHeight = value;
456
- var hb = this._horizontalBar;
457
- hb.barImageHeight = value;
458
- this._markAsDirty();
459
- },
460
- enumerable: false,
461
- configurable: true
462
- });
463
- Object.defineProperty(ScrollViewer.prototype, "verticalBarImageHeight", {
464
- /** Gets or sets the height of the vertical bar image */
465
- get: function () {
466
- return this._verticalBarImageHeight;
467
- },
468
- set: function (value) {
469
- if (this._verticalBarImageHeight === value) {
470
- return;
471
- }
472
- if (value <= 0) {
473
- value = 0.1;
474
- }
475
- if (value > 1) {
476
- value = 1;
477
- }
478
- this._verticalBarImageHeight = value;
479
- var vb = this._verticalBar;
480
- vb.barImageHeight = value;
481
- this._markAsDirty();
482
- },
483
- enumerable: false,
484
- configurable: true
485
- });
486
- Object.defineProperty(ScrollViewer.prototype, "barBackground", {
487
- /** Gets or sets the bar background */
488
- get: function () {
489
- return this._barBackground;
490
- },
491
- set: function (color) {
492
- if (this._barBackground === color) {
493
- return;
494
- }
495
- this._barBackground = color;
496
- var hb = this._horizontalBar;
497
- var vb = this._verticalBar;
498
- hb.background = color;
499
- vb.background = color;
500
- this._dragSpace.background = color;
501
- },
502
- enumerable: false,
503
- configurable: true
504
- });
505
- Object.defineProperty(ScrollViewer.prototype, "barImage", {
506
- /** Gets or sets the bar background image */
507
- get: function () {
508
- return this._barBackgroundImage;
509
- },
510
- set: function (value) {
511
- this._barBackgroundImage = value;
512
- var hb = this._horizontalBar;
513
- var vb = this._verticalBar;
514
- hb.backgroundImage = value;
515
- vb.backgroundImage = value;
516
- },
517
- enumerable: false,
518
- configurable: true
519
- });
520
- Object.defineProperty(ScrollViewer.prototype, "horizontalBarImage", {
521
- /** Gets or sets the horizontal bar background image */
522
- get: function () {
523
- return this._horizontalBarBackgroundImage;
524
- },
525
- set: function (value) {
526
- this._horizontalBarBackgroundImage = value;
527
- var hb = this._horizontalBar;
528
- hb.backgroundImage = value;
529
- },
530
- enumerable: false,
531
- configurable: true
532
- });
533
- Object.defineProperty(ScrollViewer.prototype, "verticalBarImage", {
534
- /** Gets or sets the vertical bar background image */
535
- get: function () {
536
- return this._verticalBarBackgroundImage;
537
- },
538
- set: function (value) {
539
- this._verticalBarBackgroundImage = value;
540
- var vb = this._verticalBar;
541
- vb.backgroundImage = value;
542
- },
543
- enumerable: false,
544
- configurable: true
545
- });
546
- ScrollViewer.prototype._setWindowPosition = function (force) {
547
- if (force === void 0) { force = true; }
548
- var ratio = this.host.idealRatio;
549
- var windowContentsWidth = this._window._currentMeasure.width;
550
- var windowContentsHeight = this._window._currentMeasure.height;
204
+ }
205
+ /**
206
+ * Gets or sets the mouse wheel precision
207
+ * from 0 to 1 with a default value of 0.05
208
+ * */
209
+ get wheelPrecision() {
210
+ return this._wheelPrecision;
211
+ }
212
+ set wheelPrecision(value) {
213
+ if (this._wheelPrecision === value) {
214
+ return;
215
+ }
216
+ if (value < 0) {
217
+ value = 0;
218
+ }
219
+ if (value > 1) {
220
+ value = 1;
221
+ }
222
+ this._wheelPrecision = value;
223
+ }
224
+ /** Gets or sets the scroll bar container background color */
225
+ get scrollBackground() {
226
+ return this._horizontalBarSpace.background;
227
+ }
228
+ set scrollBackground(color) {
229
+ if (this._horizontalBarSpace.background === color) {
230
+ return;
231
+ }
232
+ this._horizontalBarSpace.background = color;
233
+ this._verticalBarSpace.background = color;
234
+ }
235
+ /** Gets or sets the bar color */
236
+ get barColor() {
237
+ return this._barColor;
238
+ }
239
+ set barColor(color) {
240
+ if (this._barColor === color) {
241
+ return;
242
+ }
243
+ this._barColor = color;
244
+ this._horizontalBar.color = color;
245
+ this._verticalBar.color = color;
246
+ }
247
+ /** Gets or sets the bar image */
248
+ get thumbImage() {
249
+ return this._barImage;
250
+ }
251
+ set thumbImage(value) {
252
+ if (this._barImage === value) {
253
+ return;
254
+ }
255
+ this._barImage = value;
256
+ const hb = this._horizontalBar;
257
+ const vb = this._verticalBar;
258
+ hb.thumbImage = value;
259
+ vb.thumbImage = value;
260
+ }
261
+ /** Gets or sets the horizontal bar image */
262
+ get horizontalThumbImage() {
263
+ return this._horizontalBarImage;
264
+ }
265
+ set horizontalThumbImage(value) {
266
+ if (this._horizontalBarImage === value) {
267
+ return;
268
+ }
269
+ this._horizontalBarImage = value;
270
+ const hb = this._horizontalBar;
271
+ hb.thumbImage = value;
272
+ }
273
+ /** Gets or sets the vertical bar image */
274
+ get verticalThumbImage() {
275
+ return this._verticalBarImage;
276
+ }
277
+ set verticalThumbImage(value) {
278
+ if (this._verticalBarImage === value) {
279
+ return;
280
+ }
281
+ this._verticalBarImage = value;
282
+ const vb = this._verticalBar;
283
+ vb.thumbImage = value;
284
+ }
285
+ /** Gets or sets the size of the bar */
286
+ get barSize() {
287
+ return this._barSize;
288
+ }
289
+ set barSize(value) {
290
+ if (this._barSize === value) {
291
+ return;
292
+ }
293
+ this._barSize = value;
294
+ this._markAsDirty();
295
+ if (this._horizontalBar.isVisible) {
296
+ this._grid.setRowDefinition(1, this._barSize, true);
297
+ }
298
+ if (this._verticalBar.isVisible) {
299
+ this._grid.setColumnDefinition(1, this._barSize, true);
300
+ }
301
+ }
302
+ /** Gets or sets the length of the thumb */
303
+ get thumbLength() {
304
+ return this._thumbLength;
305
+ }
306
+ set thumbLength(value) {
307
+ if (this._thumbLength === value) {
308
+ return;
309
+ }
310
+ if (value <= 0) {
311
+ value = 0.1;
312
+ }
313
+ if (value > 1) {
314
+ value = 1;
315
+ }
316
+ this._thumbLength = value;
317
+ const hb = this._horizontalBar;
318
+ const vb = this._verticalBar;
319
+ hb.thumbLength = value;
320
+ vb.thumbLength = value;
321
+ this._markAsDirty();
322
+ }
323
+ /** Gets or sets the height of the thumb */
324
+ get thumbHeight() {
325
+ return this._thumbHeight;
326
+ }
327
+ set thumbHeight(value) {
328
+ if (this._thumbHeight === value) {
329
+ return;
330
+ }
331
+ if (value <= 0) {
332
+ value = 0.1;
333
+ }
334
+ if (value > 1) {
335
+ value = 1;
336
+ }
337
+ this._thumbHeight = value;
338
+ const hb = this._horizontalBar;
339
+ const vb = this._verticalBar;
340
+ hb.thumbHeight = value;
341
+ vb.thumbHeight = value;
342
+ this._markAsDirty();
343
+ }
344
+ /** Gets or sets the height of the bar image */
345
+ get barImageHeight() {
346
+ return this._barImageHeight;
347
+ }
348
+ set barImageHeight(value) {
349
+ if (this._barImageHeight === value) {
350
+ return;
351
+ }
352
+ if (value <= 0) {
353
+ value = 0.1;
354
+ }
355
+ if (value > 1) {
356
+ value = 1;
357
+ }
358
+ this._barImageHeight = value;
359
+ const hb = this._horizontalBar;
360
+ const vb = this._verticalBar;
361
+ hb.barImageHeight = value;
362
+ vb.barImageHeight = value;
363
+ this._markAsDirty();
364
+ }
365
+ /** Gets or sets the height of the horizontal bar image */
366
+ get horizontalBarImageHeight() {
367
+ return this._horizontalBarImageHeight;
368
+ }
369
+ set horizontalBarImageHeight(value) {
370
+ if (this._horizontalBarImageHeight === value) {
371
+ return;
372
+ }
373
+ if (value <= 0) {
374
+ value = 0.1;
375
+ }
376
+ if (value > 1) {
377
+ value = 1;
378
+ }
379
+ this._horizontalBarImageHeight = value;
380
+ const hb = this._horizontalBar;
381
+ hb.barImageHeight = value;
382
+ this._markAsDirty();
383
+ }
384
+ /** Gets or sets the height of the vertical bar image */
385
+ get verticalBarImageHeight() {
386
+ return this._verticalBarImageHeight;
387
+ }
388
+ set verticalBarImageHeight(value) {
389
+ if (this._verticalBarImageHeight === value) {
390
+ return;
391
+ }
392
+ if (value <= 0) {
393
+ value = 0.1;
394
+ }
395
+ if (value > 1) {
396
+ value = 1;
397
+ }
398
+ this._verticalBarImageHeight = value;
399
+ const vb = this._verticalBar;
400
+ vb.barImageHeight = value;
401
+ this._markAsDirty();
402
+ }
403
+ /** Gets or sets the bar background */
404
+ get barBackground() {
405
+ return this._barBackground;
406
+ }
407
+ set barBackground(color) {
408
+ if (this._barBackground === color) {
409
+ return;
410
+ }
411
+ this._barBackground = color;
412
+ const hb = this._horizontalBar;
413
+ const vb = this._verticalBar;
414
+ hb.background = color;
415
+ vb.background = color;
416
+ this._dragSpace.background = color;
417
+ }
418
+ /** Gets or sets the bar background image */
419
+ get barImage() {
420
+ return this._barBackgroundImage;
421
+ }
422
+ set barImage(value) {
423
+ this._barBackgroundImage = value;
424
+ const hb = this._horizontalBar;
425
+ const vb = this._verticalBar;
426
+ hb.backgroundImage = value;
427
+ vb.backgroundImage = value;
428
+ }
429
+ /** Gets or sets the horizontal bar background image */
430
+ get horizontalBarImage() {
431
+ return this._horizontalBarBackgroundImage;
432
+ }
433
+ set horizontalBarImage(value) {
434
+ this._horizontalBarBackgroundImage = value;
435
+ const hb = this._horizontalBar;
436
+ hb.backgroundImage = value;
437
+ }
438
+ /** Gets or sets the vertical bar background image */
439
+ get verticalBarImage() {
440
+ return this._verticalBarBackgroundImage;
441
+ }
442
+ set verticalBarImage(value) {
443
+ this._verticalBarBackgroundImage = value;
444
+ const vb = this._verticalBar;
445
+ vb.backgroundImage = value;
446
+ }
447
+ _setWindowPosition(force = true) {
448
+ const ratio = this.host.idealRatio;
449
+ const windowContentsWidth = this._window._currentMeasure.width;
450
+ const windowContentsHeight = this._window._currentMeasure.height;
551
451
  if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {
552
452
  return;
553
453
  }
554
454
  this._oldWindowContentsWidth = windowContentsWidth;
555
455
  this._oldWindowContentsHeight = windowContentsHeight;
556
- var _endLeft = this._clientWidth - windowContentsWidth;
557
- var _endTop = this._clientHeight - windowContentsHeight;
558
- var newLeft = (this._horizontalBar.value / ratio) * _endLeft + "px";
559
- var newTop = (this._verticalBar.value / ratio) * _endTop + "px";
456
+ const _endLeft = this._clientWidth - windowContentsWidth;
457
+ const _endTop = this._clientHeight - windowContentsHeight;
458
+ const newLeft = (this._horizontalBar.value / ratio) * _endLeft + "px";
459
+ const newTop = (this._verticalBar.value / ratio) * _endTop + "px";
560
460
  if (newLeft !== this._window.left) {
561
461
  this._window.left = newLeft;
562
462
  if (!this.freezeControls) {
@@ -569,11 +469,11 @@ var ScrollViewer = /** @class */ (function (_super) {
569
469
  this._rebuildLayout = true;
570
470
  }
571
471
  }
572
- };
472
+ }
573
473
  /** @hidden */
574
- ScrollViewer.prototype._updateScroller = function () {
575
- var windowContentsWidth = this._window._currentMeasure.width;
576
- var windowContentsHeight = this._window._currentMeasure.height;
474
+ _updateScroller() {
475
+ const windowContentsWidth = this._window._currentMeasure.width;
476
+ const windowContentsHeight = this._window._currentMeasure.height;
577
477
  if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {
578
478
  this._grid.setRowDefinition(1, 0, true);
579
479
  this._horizontalBar.isVisible = false;
@@ -597,14 +497,14 @@ var ScrollViewer = /** @class */ (function (_super) {
597
497
  this._rebuildLayout = true;
598
498
  }
599
499
  this._buildClientSizes();
600
- var ratio = this.host.idealRatio;
500
+ const ratio = this.host.idealRatio;
601
501
  this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px";
602
502
  this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px";
603
- };
604
- ScrollViewer.prototype._link = function (host) {
605
- _super.prototype._link.call(this, host);
503
+ }
504
+ _link(host) {
505
+ super._link(host);
606
506
  this._attachWheel();
607
- };
507
+ }
608
508
  /**
609
509
  * @param barControl
610
510
  * @param barContainer
@@ -612,8 +512,7 @@ var ScrollViewer = /** @class */ (function (_super) {
612
512
  * @param rotation
613
513
  * @hidden
614
514
  */
615
- ScrollViewer.prototype._addBar = function (barControl, barContainer, isVertical, rotation) {
616
- var _this = this;
515
+ _addBar(barControl, barContainer, isVertical, rotation) {
617
516
  barControl.paddingLeft = 0;
618
517
  barControl.width = "100%";
619
518
  barControl.height = "100%";
@@ -626,69 +525,66 @@ var ScrollViewer = /** @class */ (function (_super) {
626
525
  barControl.rotation = rotation;
627
526
  barControl.isVisible = false;
628
527
  barContainer.addControl(barControl);
629
- barControl.onValueChangedObservable.add(function () {
630
- _this._setWindowPosition();
528
+ barControl.onValueChangedObservable.add(() => {
529
+ this._setWindowPosition();
631
530
  });
632
- };
531
+ }
633
532
  /** @hidden */
634
- ScrollViewer.prototype._attachWheel = function () {
635
- var _this = this;
533
+ _attachWheel() {
636
534
  if (!this._host || this._onWheelObserver) {
637
535
  return;
638
536
  }
639
- this._onWheelObserver = this.onWheelObservable.add(function (pi) {
640
- if (!_this._pointerIsOver || _this.isReadOnly) {
537
+ this._onWheelObserver = this.onWheelObservable.add((pi) => {
538
+ if (!this._pointerIsOver || this.isReadOnly) {
641
539
  return;
642
540
  }
643
- if (_this._verticalBar.isVisible == true) {
644
- if (pi.y < 0 && _this._verticalBar.value > 0) {
645
- _this._verticalBar.value -= _this._wheelPrecision;
541
+ if (this._verticalBar.isVisible == true) {
542
+ if (pi.y < 0 && this._verticalBar.value > 0) {
543
+ this._verticalBar.value -= this._wheelPrecision;
646
544
  }
647
- else if (pi.y > 0 && _this._verticalBar.value < _this._verticalBar.maximum) {
648
- _this._verticalBar.value += _this._wheelPrecision;
545
+ else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) {
546
+ this._verticalBar.value += this._wheelPrecision;
649
547
  }
650
548
  }
651
- if (_this._horizontalBar.isVisible == true) {
652
- if (pi.x < 0 && _this._horizontalBar.value < _this._horizontalBar.maximum) {
653
- _this._horizontalBar.value += _this._wheelPrecision;
549
+ if (this._horizontalBar.isVisible == true) {
550
+ if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) {
551
+ this._horizontalBar.value += this._wheelPrecision;
654
552
  }
655
- else if (pi.x > 0 && _this._horizontalBar.value > 0) {
656
- _this._horizontalBar.value -= _this._wheelPrecision;
553
+ else if (pi.x > 0 && this._horizontalBar.value > 0) {
554
+ this._horizontalBar.value -= this._wheelPrecision;
657
555
  }
658
556
  }
659
557
  });
660
- };
661
- ScrollViewer.prototype._renderHighlightSpecific = function (context) {
558
+ }
559
+ _renderHighlightSpecific(context) {
662
560
  if (!this.isHighlighted) {
663
561
  return;
664
562
  }
665
- _super.prototype._renderHighlightSpecific.call(this, context);
563
+ super._renderHighlightSpecific(context);
666
564
  this._grid._renderHighlightSpecific(context);
667
565
  context.restore();
668
- };
566
+ }
669
567
  /** Releases associated resources */
670
- ScrollViewer.prototype.dispose = function () {
568
+ dispose() {
671
569
  this.onWheelObservable.remove(this._onWheelObserver);
672
570
  this._onWheelObserver = null;
673
- _super.prototype.dispose.call(this);
674
- };
675
- __decorate([
676
- serialize()
677
- ], ScrollViewer.prototype, "wheelPrecision", null);
678
- __decorate([
679
- serialize()
680
- ], ScrollViewer.prototype, "scrollBackground", null);
681
- __decorate([
682
- serialize()
683
- ], ScrollViewer.prototype, "barColor", null);
684
- __decorate([
685
- serialize()
686
- ], ScrollViewer.prototype, "barSize", null);
687
- __decorate([
688
- serialize()
689
- ], ScrollViewer.prototype, "barBackground", null);
690
- return ScrollViewer;
691
- }(Rectangle));
692
- export { ScrollViewer };
571
+ super.dispose();
572
+ }
573
+ }
574
+ __decorate([
575
+ serialize()
576
+ ], ScrollViewer.prototype, "wheelPrecision", null);
577
+ __decorate([
578
+ serialize()
579
+ ], ScrollViewer.prototype, "scrollBackground", null);
580
+ __decorate([
581
+ serialize()
582
+ ], ScrollViewer.prototype, "barColor", null);
583
+ __decorate([
584
+ serialize()
585
+ ], ScrollViewer.prototype, "barSize", null);
586
+ __decorate([
587
+ serialize()
588
+ ], ScrollViewer.prototype, "barBackground", null);
693
589
  RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer);
694
590
  //# sourceMappingURL=scrollViewer.js.map