@babylonjs/gui 9.13.0 → 9.15.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 (325) hide show
  1. package/2D/FrameGraph/pure.d.ts +2 -0
  2. package/2D/FrameGraph/pure.js +3 -0
  3. package/2D/FrameGraph/pure.js.map +1 -0
  4. package/2D/FrameGraph/renderGraphGUIBlock.d.ts +3 -41
  5. package/2D/FrameGraph/renderGraphGUIBlock.js +5 -64
  6. package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
  7. package/2D/FrameGraph/renderGraphGUIBlock.pure.d.ts +48 -0
  8. package/2D/FrameGraph/renderGraphGUIBlock.pure.js +78 -0
  9. package/2D/FrameGraph/renderGraphGUIBlock.pure.js.map +1 -0
  10. package/2D/advancedDynamicTexture.d.ts +2 -2
  11. package/2D/advancedDynamicTexture.js +2 -2
  12. package/2D/advancedDynamicTexture.js.map +1 -1
  13. package/2D/controls/button.d.ts +3 -107
  14. package/2D/controls/button.js +5 -243
  15. package/2D/controls/button.js.map +1 -1
  16. package/2D/controls/button.pure.d.ts +114 -0
  17. package/2D/controls/button.pure.js +257 -0
  18. package/2D/controls/button.pure.js.map +1 -0
  19. package/2D/controls/checkbox.d.ts +3 -51
  20. package/2D/controls/checkbox.js +5 -161
  21. package/2D/controls/checkbox.js.map +1 -1
  22. package/2D/controls/checkbox.pure.d.ts +58 -0
  23. package/2D/controls/checkbox.pure.js +175 -0
  24. package/2D/controls/checkbox.pure.js.map +1 -0
  25. package/2D/controls/colorpicker.d.ts +5 -101
  26. package/2D/controls/colorpicker.js +7 -1394
  27. package/2D/controls/colorpicker.js.map +1 -1
  28. package/2D/controls/colorpicker.pure.d.ts +106 -0
  29. package/2D/controls/colorpicker.pure.js +1406 -0
  30. package/2D/controls/colorpicker.pure.js.map +1 -0
  31. package/2D/controls/container.d.ts +3 -177
  32. package/2D/controls/container.js +5 -615
  33. package/2D/controls/container.js.map +1 -1
  34. package/2D/controls/container.pure.d.ts +184 -0
  35. package/2D/controls/container.pure.js +629 -0
  36. package/2D/controls/container.pure.js.map +1 -0
  37. package/2D/controls/control.d.ts +3 -944
  38. package/2D/controls/control.js +5 -2457
  39. package/2D/controls/control.js.map +1 -1
  40. package/2D/controls/control.pure.d.ts +951 -0
  41. package/2D/controls/control.pure.js +2471 -0
  42. package/2D/controls/control.pure.js.map +1 -0
  43. package/2D/controls/displayGrid.d.ts +5 -53
  44. package/2D/controls/displayGrid.js +7 -201
  45. package/2D/controls/displayGrid.js.map +1 -1
  46. package/2D/controls/displayGrid.pure.d.ts +58 -0
  47. package/2D/controls/displayGrid.pure.js +213 -0
  48. package/2D/controls/displayGrid.pure.js.map +1 -0
  49. package/2D/controls/ellipse.d.ts +5 -25
  50. package/2D/controls/ellipse.js +7 -92
  51. package/2D/controls/ellipse.js.map +1 -1
  52. package/2D/controls/ellipse.pure.d.ts +30 -0
  53. package/2D/controls/ellipse.pure.js +104 -0
  54. package/2D/controls/ellipse.pure.js.map +1 -0
  55. package/2D/controls/focusableButton.d.ts +3 -15
  56. package/2D/controls/focusableButton.js +5 -22
  57. package/2D/controls/focusableButton.js.map +1 -1
  58. package/2D/controls/focusableButton.pure.d.ts +22 -0
  59. package/2D/controls/focusableButton.pure.js +36 -0
  60. package/2D/controls/focusableButton.pure.js.map +1 -0
  61. package/2D/controls/gradient/LinearGradient.d.ts +3 -43
  62. package/2D/controls/gradient/LinearGradient.js +5 -70
  63. package/2D/controls/gradient/LinearGradient.js.map +1 -1
  64. package/2D/controls/gradient/LinearGradient.pure.d.ts +50 -0
  65. package/2D/controls/gradient/LinearGradient.pure.js +84 -0
  66. package/2D/controls/gradient/LinearGradient.pure.js.map +1 -0
  67. package/2D/controls/gradient/RadialGradient.d.ts +3 -51
  68. package/2D/controls/gradient/RadialGradient.js +5 -86
  69. package/2D/controls/gradient/RadialGradient.js.map +1 -1
  70. package/2D/controls/gradient/RadialGradient.pure.d.ts +58 -0
  71. package/2D/controls/gradient/RadialGradient.pure.js +100 -0
  72. package/2D/controls/gradient/RadialGradient.pure.js.map +1 -0
  73. package/2D/controls/gradient/pure.d.ts +3 -0
  74. package/2D/controls/gradient/pure.js +4 -0
  75. package/2D/controls/gradient/pure.js.map +1 -0
  76. package/2D/controls/grid.d.ts +3 -149
  77. package/2D/controls/grid.js +5 -525
  78. package/2D/controls/grid.js.map +1 -1
  79. package/2D/controls/grid.pure.d.ts +156 -0
  80. package/2D/controls/grid.pure.js +539 -0
  81. package/2D/controls/grid.pure.js.map +1 -0
  82. package/2D/controls/image.d.ts +3 -226
  83. package/2D/controls/image.js +5 -913
  84. package/2D/controls/image.js.map +1 -1
  85. package/2D/controls/image.pure.d.ts +233 -0
  86. package/2D/controls/image.pure.js +927 -0
  87. package/2D/controls/image.pure.js.map +1 -0
  88. package/2D/controls/inputPassword.d.ts +3 -7
  89. package/2D/controls/inputPassword.js +5 -19
  90. package/2D/controls/inputPassword.js.map +1 -1
  91. package/2D/controls/inputPassword.pure.d.ts +14 -0
  92. package/2D/controls/inputPassword.pure.js +33 -0
  93. package/2D/controls/inputPassword.pure.js.map +1 -0
  94. package/2D/controls/inputText.d.ts +3 -202
  95. package/2D/controls/inputText.js +5 -1050
  96. package/2D/controls/inputText.js.map +1 -1
  97. package/2D/controls/inputText.pure.d.ts +209 -0
  98. package/2D/controls/inputText.pure.js +1064 -0
  99. package/2D/controls/inputText.pure.js.map +1 -0
  100. package/2D/controls/inputTextArea.d.ts +3 -140
  101. package/2D/controls/inputTextArea.js +5 -1023
  102. package/2D/controls/inputTextArea.js.map +1 -1
  103. package/2D/controls/inputTextArea.pure.d.ts +147 -0
  104. package/2D/controls/inputTextArea.pure.js +1037 -0
  105. package/2D/controls/inputTextArea.pure.js.map +1 -0
  106. package/2D/controls/line.d.ts +5 -74
  107. package/2D/controls/line.js +7 -234
  108. package/2D/controls/line.js.map +1 -1
  109. package/2D/controls/line.pure.d.ts +79 -0
  110. package/2D/controls/line.pure.js +246 -0
  111. package/2D/controls/line.pure.js.map +1 -0
  112. package/2D/controls/multiLine.d.ts +3 -73
  113. package/2D/controls/multiLine.js +5 -234
  114. package/2D/controls/multiLine.js.map +1 -1
  115. package/2D/controls/multiLine.pure.d.ts +80 -0
  116. package/2D/controls/multiLine.pure.js +248 -0
  117. package/2D/controls/multiLine.pure.js.map +1 -0
  118. package/2D/controls/pure.d.ts +38 -0
  119. package/2D/controls/pure.js +39 -0
  120. package/2D/controls/pure.js.map +1 -0
  121. package/2D/controls/radioButton.d.ts +3 -47
  122. package/2D/controls/radioButton.js +5 -182
  123. package/2D/controls/radioButton.js.map +1 -1
  124. package/2D/controls/radioButton.pure.d.ts +54 -0
  125. package/2D/controls/radioButton.pure.js +196 -0
  126. package/2D/controls/radioButton.pure.js.map +1 -0
  127. package/2D/controls/rectangle.d.ts +5 -43
  128. package/2D/controls/rectangle.js +7 -205
  129. package/2D/controls/rectangle.js.map +1 -1
  130. package/2D/controls/rectangle.pure.d.ts +48 -0
  131. package/2D/controls/rectangle.pure.js +217 -0
  132. package/2D/controls/rectangle.pure.js.map +1 -0
  133. package/2D/controls/scrollViewers/pure.d.ts +2 -0
  134. package/2D/controls/scrollViewers/pure.js +3 -0
  135. package/2D/controls/scrollViewers/pure.js.map +1 -0
  136. package/2D/controls/scrollViewers/scrollViewer.d.ts +3 -176
  137. package/2D/controls/scrollViewers/scrollViewer.js +5 -584
  138. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  139. package/2D/controls/scrollViewers/scrollViewer.pure.d.ts +183 -0
  140. package/2D/controls/scrollViewers/scrollViewer.pure.js +598 -0
  141. package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -0
  142. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +1 -1
  143. package/2D/controls/scrollViewers/scrollViewerWindow.js +2 -2
  144. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  145. package/2D/controls/selector.d.ts +2 -2
  146. package/2D/controls/selector.js +8 -8
  147. package/2D/controls/selector.js.map +1 -1
  148. package/2D/controls/sliders/baseSlider.d.ts +1 -1
  149. package/2D/controls/sliders/baseSlider.js +1 -1
  150. package/2D/controls/sliders/baseSlider.js.map +1 -1
  151. package/2D/controls/sliders/imageBasedSlider.d.ts +3 -45
  152. package/2D/controls/sliders/imageBasedSlider.js +5 -165
  153. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  154. package/2D/controls/sliders/imageBasedSlider.pure.d.ts +52 -0
  155. package/2D/controls/sliders/imageBasedSlider.pure.js +179 -0
  156. package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -0
  157. package/2D/controls/sliders/pure.d.ts +4 -0
  158. package/2D/controls/sliders/pure.js +5 -0
  159. package/2D/controls/sliders/pure.js.map +1 -0
  160. package/2D/controls/sliders/scrollBar.d.ts +3 -48
  161. package/2D/controls/sliders/scrollBar.js +5 -170
  162. package/2D/controls/sliders/scrollBar.js.map +1 -1
  163. package/2D/controls/sliders/scrollBar.pure.d.ts +55 -0
  164. package/2D/controls/sliders/scrollBar.pure.js +184 -0
  165. package/2D/controls/sliders/scrollBar.pure.js.map +1 -0
  166. package/2D/controls/sliders/slider.d.ts +3 -44
  167. package/2D/controls/sliders/slider.js +5 -278
  168. package/2D/controls/sliders/slider.js.map +1 -1
  169. package/2D/controls/sliders/slider.pure.d.ts +51 -0
  170. package/2D/controls/sliders/slider.pure.js +292 -0
  171. package/2D/controls/sliders/slider.pure.js.map +1 -0
  172. package/2D/controls/stackPanel.d.ts +3 -62
  173. package/2D/controls/stackPanel.js +5 -243
  174. package/2D/controls/stackPanel.js.map +1 -1
  175. package/2D/controls/stackPanel.pure.d.ts +69 -0
  176. package/2D/controls/stackPanel.pure.js +257 -0
  177. package/2D/controls/stackPanel.pure.js.map +1 -0
  178. package/2D/controls/statics.d.ts +3 -4
  179. package/2D/controls/statics.js +5 -47
  180. package/2D/controls/statics.js.map +1 -1
  181. package/2D/controls/statics.pure.d.ts +11 -0
  182. package/2D/controls/statics.pure.js +61 -0
  183. package/2D/controls/statics.pure.js.map +1 -0
  184. package/2D/controls/textBlock.d.ts +3 -217
  185. package/2D/controls/textBlock.js +5 -676
  186. package/2D/controls/textBlock.js.map +1 -1
  187. package/2D/controls/textBlock.pure.d.ts +224 -0
  188. package/2D/controls/textBlock.pure.js +690 -0
  189. package/2D/controls/textBlock.pure.js.map +1 -0
  190. package/2D/controls/toggleButton.d.ts +3 -91
  191. package/2D/controls/toggleButton.js +5 -226
  192. package/2D/controls/toggleButton.js.map +1 -1
  193. package/2D/controls/toggleButton.pure.d.ts +98 -0
  194. package/2D/controls/toggleButton.pure.js +240 -0
  195. package/2D/controls/toggleButton.pure.js.map +1 -0
  196. package/2D/controls/virtualKeyboard.d.ts +3 -100
  197. package/2D/controls/virtualKeyboard.js +5 -272
  198. package/2D/controls/virtualKeyboard.js.map +1 -1
  199. package/2D/controls/virtualKeyboard.pure.d.ts +107 -0
  200. package/2D/controls/virtualKeyboard.pure.js +286 -0
  201. package/2D/controls/virtualKeyboard.pure.js.map +1 -0
  202. package/2D/math2D.d.ts +1 -1
  203. package/2D/math2D.js +1 -1
  204. package/2D/math2D.js.map +1 -1
  205. package/2D/measure.js +1 -1
  206. package/2D/measure.js.map +1 -1
  207. package/2D/pure.d.ts +13 -0
  208. package/2D/pure.js +15 -0
  209. package/2D/pure.js.map +1 -0
  210. package/3D/controls/MRTK3/touchHolographicButton.d.ts +4 -4
  211. package/3D/controls/MRTK3/touchHolographicButton.js +10 -10
  212. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  213. package/3D/controls/holographicBackplate.d.ts +1 -1
  214. package/3D/controls/holographicBackplate.js +1 -1
  215. package/3D/controls/holographicBackplate.js.map +1 -1
  216. package/3D/controls/holographicButton.d.ts +1 -1
  217. package/3D/controls/holographicButton.js +4 -4
  218. package/3D/controls/holographicButton.js.map +1 -1
  219. package/3D/controls/holographicSlate.js +4 -4
  220. package/3D/controls/holographicSlate.js.map +1 -1
  221. package/3D/controls/pure.d.ts +23 -0
  222. package/3D/controls/pure.js +24 -0
  223. package/3D/controls/pure.js.map +1 -0
  224. package/3D/controls/slider3D.d.ts +3 -3
  225. package/3D/controls/slider3D.js +3 -3
  226. package/3D/controls/slider3D.js.map +1 -1
  227. package/3D/controls/touchHolographicButton.d.ts +2 -2
  228. package/3D/controls/touchHolographicButton.js +5 -5
  229. package/3D/controls/touchHolographicButton.js.map +1 -1
  230. package/3D/controls/touchHolographicMenu.js +1 -1
  231. package/3D/controls/touchHolographicMenu.js.map +1 -1
  232. package/3D/gizmos/gizmoHandle.d.ts +1 -1
  233. package/3D/gizmos/gizmoHandle.js +1 -1
  234. package/3D/gizmos/gizmoHandle.js.map +1 -1
  235. package/3D/gizmos/pure.d.ts +3 -0
  236. package/3D/gizmos/pure.js +4 -0
  237. package/3D/gizmos/pure.js.map +1 -0
  238. package/3D/materials/fluent/fluentMaterial.d.ts +5 -100
  239. package/3D/materials/fluent/fluentMaterial.js +7 -305
  240. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  241. package/3D/materials/fluent/fluentMaterial.pure.d.ts +105 -0
  242. package/3D/materials/fluent/fluentMaterial.pure.js +320 -0
  243. package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -0
  244. package/3D/materials/fluent/pure.d.ts +2 -0
  245. package/3D/materials/fluent/pure.js +3 -0
  246. package/3D/materials/fluent/pure.js.map +1 -0
  247. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +5 -164
  248. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +7 -488
  249. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  250. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.d.ts +169 -0
  251. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +503 -0
  252. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -0
  253. package/3D/materials/fluentBackplate/pure.d.ts +2 -0
  254. package/3D/materials/fluentBackplate/pure.js +3 -0
  255. package/3D/materials/fluentBackplate/pure.js.map +1 -0
  256. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +5 -200
  257. package/3D/materials/fluentButton/fluentButtonMaterial.js +7 -563
  258. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  259. package/3D/materials/fluentButton/fluentButtonMaterial.pure.d.ts +205 -0
  260. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +578 -0
  261. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -0
  262. package/3D/materials/fluentButton/pure.d.ts +2 -0
  263. package/3D/materials/fluentButton/pure.js +3 -0
  264. package/3D/materials/fluentButton/pure.js.map +1 -0
  265. package/3D/materials/fluentMaterial.d.ts +1 -1
  266. package/3D/materials/fluentMaterial.js +1 -1
  267. package/3D/materials/fluentMaterial.js.map +1 -1
  268. package/3D/materials/handle/handleMaterial.d.ts +5 -66
  269. package/3D/materials/handle/handleMaterial.js +5 -118
  270. package/3D/materials/handle/handleMaterial.js.map +1 -1
  271. package/3D/materials/handle/handleMaterial.pure.d.ts +66 -0
  272. package/3D/materials/handle/handleMaterial.pure.js +121 -0
  273. package/3D/materials/handle/handleMaterial.pure.js.map +1 -0
  274. package/3D/materials/handle/pure.d.ts +2 -0
  275. package/3D/materials/handle/pure.js +3 -0
  276. package/3D/materials/handle/pure.js.map +1 -0
  277. package/3D/materials/mrdl/mrdlBackglowMaterial.d.ts +5 -85
  278. package/3D/materials/mrdl/mrdlBackglowMaterial.js +7 -299
  279. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
  280. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.d.ts +90 -0
  281. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +314 -0
  282. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -0
  283. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +5 -145
  284. package/3D/materials/mrdl/mrdlBackplateMaterial.js +7 -433
  285. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  286. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.d.ts +157 -0
  287. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +455 -0
  288. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -0
  289. package/3D/materials/mrdl/mrdlFrontplateMaterial.d.ts +5 -183
  290. package/3D/materials/mrdl/mrdlFrontplateMaterial.js +7 -532
  291. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
  292. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.d.ts +188 -0
  293. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +547 -0
  294. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -0
  295. package/3D/materials/mrdl/mrdlInnerquadMaterial.d.ts +5 -54
  296. package/3D/materials/mrdl/mrdlInnerquadMaterial.js +7 -227
  297. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
  298. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.d.ts +59 -0
  299. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +242 -0
  300. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -0
  301. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +5 -334
  302. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +7 -855
  303. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  304. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.d.ts +346 -0
  305. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +877 -0
  306. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -0
  307. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +5 -334
  308. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +7 -855
  309. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  310. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.d.ts +346 -0
  311. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +877 -0
  312. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -0
  313. package/3D/materials/mrdl/pure.d.ts +7 -0
  314. package/3D/materials/mrdl/pure.js +8 -0
  315. package/3D/materials/mrdl/pure.js.map +1 -0
  316. package/3D/materials/pure.d.ts +6 -0
  317. package/3D/materials/pure.js +8 -0
  318. package/3D/materials/pure.js.map +1 -0
  319. package/3D/pure.d.ts +6 -0
  320. package/3D/pure.js +8 -0
  321. package/3D/pure.js.map +1 -0
  322. package/package.json +50 -3
  323. package/pure.d.ts +3 -0
  324. package/pure.js +5 -0
  325. package/pure.js.map +1 -0
@@ -1,587 +1,8 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
- import { Rectangle } from "../rectangle.js";
3
- import { Grid } from "../grid.js";
4
- import { Control } from "../control.js";
5
- import { _ScrollViewerWindow } from "./scrollViewerWindow.js";
6
- import { ScrollBar } from "../sliders/scrollBar.js";
7
- import { ImageScrollBar } from "../sliders/imageScrollBar.js";
8
- import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
9
- import { serialize } from "@babylonjs/core/Misc/decorators.js";
10
1
  /**
11
- * Class used to hold a viewer window and sliders in a grid
2
+ * Re-exports the pure implementation and applies the runtime registration side effect.
3
+ * Import "./scrollViewer.pure" for tree-shakeable, side-effect-free usage.
12
4
  */
13
- export class ScrollViewer extends Rectangle {
14
- /**
15
- * Gets the horizontal scrollbar
16
- */
17
- get horizontalBar() {
18
- return this._horizontalBar;
19
- }
20
- /**
21
- * Gets the vertical scrollbar
22
- */
23
- get verticalBar() {
24
- return this._verticalBar;
25
- }
26
- /**
27
- * Adds a new control to the current container
28
- * @param control defines the control to add
29
- * @returns the current container
30
- */
31
- addControl(control) {
32
- if (!control) {
33
- return this;
34
- }
35
- this._window.addControl(control);
36
- return this;
37
- }
38
- /**
39
- * Removes a control from the current container
40
- * @param control defines the control to remove
41
- * @returns the current container
42
- */
43
- removeControl(control) {
44
- this._window.removeControl(control);
45
- return this;
46
- }
47
- /** Gets the list of children */
48
- get children() {
49
- return this._window.children;
50
- }
51
- _flagDescendantsAsMatrixDirty() {
52
- for (const child of this._children) {
53
- child._markMatrixAsDirty();
54
- }
55
- }
56
- /**
57
- * Freezes or unfreezes the controls in the window.
58
- * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
59
- * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
60
- */
61
- get freezeControls() {
62
- return this._window.freezeControls;
63
- }
64
- set freezeControls(value) {
65
- this._window.freezeControls = value;
66
- }
67
- /** Gets the bucket width */
68
- get bucketWidth() {
69
- return this._window.bucketWidth;
70
- }
71
- /** Gets the bucket height */
72
- get bucketHeight() {
73
- return this._window.bucketHeight;
74
- }
75
- /**
76
- * Sets the bucket sizes.
77
- * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only
78
- * controls that are visible. The bucket sizes is used to subdivide (internally) the window area to smaller areas into which
79
- * controls are dispatched. So, the size should be roughly equals to the mean size of all the controls of
80
- * the window. To disable the usage of buckets, sets either width or height (or both) to 0.
81
- * Please note that using this option will raise the memory usage (the higher the bucket sizes, the less memory
82
- * used), that's why it is not enabled by default.
83
- * @param width width of the bucket
84
- * @param height height of the bucket
85
- */
86
- setBucketSizes(width, height) {
87
- this._window.setBucketSizes(width, height);
88
- }
89
- /**
90
- * Forces the horizontal scroll bar to be displayed
91
- */
92
- get forceHorizontalBar() {
93
- return this._forceHorizontalBar;
94
- }
95
- set forceHorizontalBar(value) {
96
- this._grid.setRowDefinition(1, value ? this._barSize : 0, true);
97
- this._horizontalBar.isVisible = value;
98
- this._forceHorizontalBar = value;
99
- }
100
- /**
101
- * Forces the vertical scroll bar to be displayed
102
- */
103
- get forceVerticalBar() {
104
- return this._forceVerticalBar;
105
- }
106
- set forceVerticalBar(value) {
107
- this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
108
- this._verticalBar.isVisible = value;
109
- this._forceVerticalBar = value;
110
- }
111
- /**
112
- * Creates a new ScrollViewer
113
- * @param name of ScrollViewer
114
- * @param isImageBased
115
- */
116
- constructor(name, isImageBased) {
117
- super(name);
118
- this._barSize = 20;
119
- this._pointerIsOver = false;
120
- this._wheelPrecision = 0.05;
121
- this._thumbLength = 0.5;
122
- this._thumbHeight = 1;
123
- this._barImageHeight = 1;
124
- this._horizontalBarImageHeight = 1;
125
- this._verticalBarImageHeight = 1;
126
- this._oldWindowContentsWidth = 0;
127
- this._oldWindowContentsHeight = 0;
128
- this._forceHorizontalBar = false;
129
- this._forceVerticalBar = false;
130
- this._useImageBar = isImageBased ? isImageBased : false;
131
- this.onDirtyObservable.add(() => {
132
- this._horizontalBarSpace.color = this.color;
133
- this._verticalBarSpace.color = this.color;
134
- this._dragSpace.color = this.color;
135
- });
136
- this.onPointerEnterObservable.add(() => {
137
- this._pointerIsOver = true;
138
- });
139
- this.onPointerOutObservable.add(() => {
140
- this._pointerIsOver = false;
141
- });
142
- this._grid = new Grid();
143
- if (this._useImageBar) {
144
- this._horizontalBar = new ImageScrollBar();
145
- this._verticalBar = new ImageScrollBar();
146
- }
147
- else {
148
- this._horizontalBar = new ScrollBar();
149
- this._verticalBar = new ScrollBar();
150
- }
151
- this._window = new _ScrollViewerWindow("scrollViewer_window");
152
- this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
153
- this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
154
- this._grid.addColumnDefinition(1);
155
- this._grid.addColumnDefinition(0, true);
156
- this._grid.addRowDefinition(1);
157
- this._grid.addRowDefinition(0, true);
158
- super.addControl(this._grid);
159
- this._grid.addControl(this._window, 0, 0);
160
- this._verticalBarSpace = new Rectangle();
161
- this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
162
- this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
163
- this._verticalBarSpace.thickness = 1;
164
- this._grid.addControl(this._verticalBarSpace, 0, 1);
165
- this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI);
166
- this._horizontalBarSpace = new Rectangle();
167
- this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
168
- this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
169
- this._horizontalBarSpace.thickness = 1;
170
- this._grid.addControl(this._horizontalBarSpace, 1, 0);
171
- this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0);
172
- this._dragSpace = new Rectangle();
173
- this._dragSpace.thickness = 1;
174
- this._grid.addControl(this._dragSpace, 1, 1);
175
- this._grid.clipChildren = false;
176
- // Colors
177
- if (!this._useImageBar) {
178
- this.barColor = "grey";
179
- this.barBackground = "transparent";
180
- }
181
- }
182
- /** Reset the scroll viewer window to initial size */
183
- resetWindow() {
184
- this._window.width = "100%";
185
- this._window.height = "100%";
186
- }
187
- _getTypeName() {
188
- return "ScrollViewer";
189
- }
190
- _buildClientSizes() {
191
- const ratio = this.host.idealRatio;
192
- this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
193
- this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
194
- this._clientWidth = this._window.parentClientWidth;
195
- this._clientHeight = this._window.parentClientHeight;
196
- }
197
- _additionalProcessing(parentMeasure, context) {
198
- super._additionalProcessing(parentMeasure, context);
199
- this._buildClientSizes();
200
- }
201
- _postMeasure() {
202
- super._postMeasure();
203
- this._updateScroller();
204
- this._setWindowPosition(false);
205
- }
206
- /**
207
- * Gets or sets the mouse wheel precision
208
- * from 0 to 1 with a default value of 0.05
209
- * */
210
- get wheelPrecision() {
211
- return this._wheelPrecision;
212
- }
213
- set wheelPrecision(value) {
214
- if (this._wheelPrecision === value) {
215
- return;
216
- }
217
- if (value < 0) {
218
- value = 0;
219
- }
220
- if (value > 1) {
221
- value = 1;
222
- }
223
- this._wheelPrecision = value;
224
- }
225
- /** Gets or sets the scroll bar container background color */
226
- get scrollBackground() {
227
- return this._horizontalBarSpace.background;
228
- }
229
- set scrollBackground(color) {
230
- if (this._horizontalBarSpace.background === color) {
231
- return;
232
- }
233
- this._horizontalBarSpace.background = color;
234
- this._verticalBarSpace.background = color;
235
- }
236
- /** Gets or sets the bar color */
237
- get barColor() {
238
- return this._barColor;
239
- }
240
- set barColor(color) {
241
- if (this._barColor === color) {
242
- return;
243
- }
244
- this._barColor = color;
245
- this._horizontalBar.color = color;
246
- this._verticalBar.color = color;
247
- }
248
- /** Gets or sets the bar image */
249
- get thumbImage() {
250
- return this._barImage;
251
- }
252
- set thumbImage(value) {
253
- if (this._barImage === value) {
254
- return;
255
- }
256
- this._barImage = value;
257
- const hb = this._horizontalBar;
258
- const vb = this._verticalBar;
259
- hb.thumbImage = value;
260
- vb.thumbImage = value;
261
- }
262
- /** Gets or sets the horizontal bar image */
263
- get horizontalThumbImage() {
264
- return this._horizontalBarImage;
265
- }
266
- set horizontalThumbImage(value) {
267
- if (this._horizontalBarImage === value) {
268
- return;
269
- }
270
- this._horizontalBarImage = value;
271
- const hb = this._horizontalBar;
272
- hb.thumbImage = value;
273
- }
274
- /** Gets or sets the vertical bar image */
275
- get verticalThumbImage() {
276
- return this._verticalBarImage;
277
- }
278
- set verticalThumbImage(value) {
279
- if (this._verticalBarImage === value) {
280
- return;
281
- }
282
- this._verticalBarImage = value;
283
- const vb = this._verticalBar;
284
- vb.thumbImage = value;
285
- }
286
- /** Gets or sets the size of the bar */
287
- get barSize() {
288
- return this._barSize;
289
- }
290
- set barSize(value) {
291
- if (this._barSize === value) {
292
- return;
293
- }
294
- this._barSize = value;
295
- this._markAsDirty();
296
- if (this._horizontalBar.isVisible) {
297
- this._grid.setRowDefinition(1, this._barSize, true);
298
- }
299
- if (this._verticalBar.isVisible) {
300
- this._grid.setColumnDefinition(1, this._barSize, true);
301
- }
302
- }
303
- /** Gets or sets the length of the thumb */
304
- get thumbLength() {
305
- return this._thumbLength;
306
- }
307
- set thumbLength(value) {
308
- if (this._thumbLength === value) {
309
- return;
310
- }
311
- if (value <= 0) {
312
- value = 0.1;
313
- }
314
- if (value > 1) {
315
- value = 1;
316
- }
317
- this._thumbLength = value;
318
- const hb = this._horizontalBar;
319
- const vb = this._verticalBar;
320
- hb.thumbLength = value;
321
- vb.thumbLength = value;
322
- this._markAsDirty();
323
- }
324
- /** Gets or sets the height of the thumb */
325
- get thumbHeight() {
326
- return this._thumbHeight;
327
- }
328
- set thumbHeight(value) {
329
- if (this._thumbHeight === value) {
330
- return;
331
- }
332
- if (value <= 0) {
333
- value = 0.1;
334
- }
335
- if (value > 1) {
336
- value = 1;
337
- }
338
- this._thumbHeight = value;
339
- const hb = this._horizontalBar;
340
- const vb = this._verticalBar;
341
- hb.thumbHeight = value;
342
- vb.thumbHeight = value;
343
- this._markAsDirty();
344
- }
345
- /** Gets or sets the height of the bar image */
346
- get barImageHeight() {
347
- return this._barImageHeight;
348
- }
349
- set barImageHeight(value) {
350
- if (this._barImageHeight === value) {
351
- return;
352
- }
353
- if (value <= 0) {
354
- value = 0.1;
355
- }
356
- if (value > 1) {
357
- value = 1;
358
- }
359
- this._barImageHeight = value;
360
- const hb = this._horizontalBar;
361
- const vb = this._verticalBar;
362
- hb.barImageHeight = value;
363
- vb.barImageHeight = value;
364
- this._markAsDirty();
365
- }
366
- /** Gets or sets the height of the horizontal bar image */
367
- get horizontalBarImageHeight() {
368
- return this._horizontalBarImageHeight;
369
- }
370
- set horizontalBarImageHeight(value) {
371
- if (this._horizontalBarImageHeight === value) {
372
- return;
373
- }
374
- if (value <= 0) {
375
- value = 0.1;
376
- }
377
- if (value > 1) {
378
- value = 1;
379
- }
380
- this._horizontalBarImageHeight = value;
381
- const hb = this._horizontalBar;
382
- hb.barImageHeight = value;
383
- this._markAsDirty();
384
- }
385
- /** Gets or sets the height of the vertical bar image */
386
- get verticalBarImageHeight() {
387
- return this._verticalBarImageHeight;
388
- }
389
- set verticalBarImageHeight(value) {
390
- if (this._verticalBarImageHeight === value) {
391
- return;
392
- }
393
- if (value <= 0) {
394
- value = 0.1;
395
- }
396
- if (value > 1) {
397
- value = 1;
398
- }
399
- this._verticalBarImageHeight = value;
400
- const vb = this._verticalBar;
401
- vb.barImageHeight = value;
402
- this._markAsDirty();
403
- }
404
- /** Gets or sets the bar background */
405
- get barBackground() {
406
- return this._barBackground;
407
- }
408
- set barBackground(color) {
409
- if (this._barBackground === color) {
410
- return;
411
- }
412
- this._barBackground = color;
413
- const hb = this._horizontalBar;
414
- const vb = this._verticalBar;
415
- hb.background = color;
416
- vb.background = color;
417
- this._dragSpace.background = color;
418
- }
419
- /** Gets or sets the bar background image */
420
- get barImage() {
421
- return this._barBackgroundImage;
422
- }
423
- set barImage(value) {
424
- this._barBackgroundImage = value;
425
- const hb = this._horizontalBar;
426
- const vb = this._verticalBar;
427
- hb.backgroundImage = value;
428
- vb.backgroundImage = value;
429
- }
430
- /** Gets or sets the horizontal bar background image */
431
- get horizontalBarImage() {
432
- return this._horizontalBarBackgroundImage;
433
- }
434
- set horizontalBarImage(value) {
435
- this._horizontalBarBackgroundImage = value;
436
- const hb = this._horizontalBar;
437
- hb.backgroundImage = value;
438
- }
439
- /** Gets or sets the vertical bar background image */
440
- get verticalBarImage() {
441
- return this._verticalBarBackgroundImage;
442
- }
443
- set verticalBarImage(value) {
444
- this._verticalBarBackgroundImage = value;
445
- const vb = this._verticalBar;
446
- vb.backgroundImage = value;
447
- }
448
- _setWindowPosition(force = true) {
449
- const ratio = this.host.idealRatio;
450
- const windowContentsWidth = this._window._currentMeasure.width;
451
- const windowContentsHeight = this._window._currentMeasure.height;
452
- if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {
453
- return;
454
- }
455
- this._oldWindowContentsWidth = windowContentsWidth;
456
- this._oldWindowContentsHeight = windowContentsHeight;
457
- const _endLeft = this._clientWidth - windowContentsWidth;
458
- const _endTop = this._clientHeight - windowContentsHeight;
459
- const newLeft = (this._horizontalBar.value / ratio) * _endLeft + "px";
460
- const newTop = (this._verticalBar.value / ratio) * _endTop + "px";
461
- if (newLeft !== this._window.left) {
462
- this._window.left = newLeft;
463
- if (!this.freezeControls) {
464
- this._rebuildLayout = true;
465
- }
466
- }
467
- if (newTop !== this._window.top) {
468
- this._window.top = newTop;
469
- if (!this.freezeControls) {
470
- this._rebuildLayout = true;
471
- }
472
- }
473
- }
474
- /** @internal */
475
- _updateScroller() {
476
- const windowContentsWidth = this._window._currentMeasure.width;
477
- const windowContentsHeight = this._window._currentMeasure.height;
478
- if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {
479
- this._grid.setRowDefinition(1, 0, true);
480
- this._horizontalBar.isVisible = false;
481
- this._horizontalBar.value = 0;
482
- this._rebuildLayout = true;
483
- }
484
- else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) {
485
- this._grid.setRowDefinition(1, this._barSize, true);
486
- this._horizontalBar.isVisible = true;
487
- this._rebuildLayout = true;
488
- }
489
- if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) {
490
- this._grid.setColumnDefinition(1, 0, true);
491
- this._verticalBar.isVisible = false;
492
- this._verticalBar.value = 0;
493
- this._rebuildLayout = true;
494
- }
495
- else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) {
496
- this._grid.setColumnDefinition(1, this._barSize, true);
497
- this._verticalBar.isVisible = true;
498
- this._rebuildLayout = true;
499
- }
500
- this._buildClientSizes();
501
- const ratio = this.host.idealRatio;
502
- this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px";
503
- this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px";
504
- }
505
- _link(host) {
506
- super._link(host);
507
- this._attachWheel();
508
- }
509
- /**
510
- * @internal
511
- */
512
- _addBar(barControl, barContainer, isVertical, rotation) {
513
- barControl.paddingLeft = 0;
514
- barControl.width = "100%";
515
- barControl.height = "100%";
516
- barControl.barOffset = 0;
517
- barControl.value = 0;
518
- barControl.maximum = 1;
519
- barControl.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
520
- barControl.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
521
- barControl.isVertical = isVertical;
522
- barControl.rotation = rotation;
523
- barControl.isVisible = false;
524
- barContainer.addControl(barControl);
525
- barControl.onValueChangedObservable.add(() => {
526
- this._setWindowPosition();
527
- });
528
- }
529
- /** @internal */
530
- _attachWheel() {
531
- if (!this._host || this._onWheelObserver) {
532
- return;
533
- }
534
- this._onWheelObserver = this.onWheelObservable.add((pi) => {
535
- if (!this._pointerIsOver || this.isReadOnly) {
536
- return;
537
- }
538
- if (this._verticalBar.isVisible == true) {
539
- if (pi.y < 0 && this._verticalBar.value > 0) {
540
- this._verticalBar.value -= this._wheelPrecision;
541
- }
542
- else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) {
543
- this._verticalBar.value += this._wheelPrecision;
544
- }
545
- }
546
- if (this._horizontalBar.isVisible == true) {
547
- if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) {
548
- this._horizontalBar.value += this._wheelPrecision;
549
- }
550
- else if (pi.x > 0 && this._horizontalBar.value > 0) {
551
- this._horizontalBar.value -= this._wheelPrecision;
552
- }
553
- }
554
- });
555
- }
556
- _renderHighlightSpecific(context) {
557
- if (!this.isHighlighted) {
558
- return;
559
- }
560
- super._renderHighlightSpecific(context);
561
- this._grid._renderHighlightSpecific(context);
562
- context.restore();
563
- }
564
- /** Releases associated resources */
565
- dispose() {
566
- this.onWheelObservable.remove(this._onWheelObserver);
567
- this._onWheelObserver = null;
568
- super.dispose();
569
- }
570
- }
571
- __decorate([
572
- serialize()
573
- ], ScrollViewer.prototype, "wheelPrecision", null);
574
- __decorate([
575
- serialize()
576
- ], ScrollViewer.prototype, "scrollBackground", null);
577
- __decorate([
578
- serialize()
579
- ], ScrollViewer.prototype, "barColor", null);
580
- __decorate([
581
- serialize()
582
- ], ScrollViewer.prototype, "barSize", null);
583
- __decorate([
584
- serialize()
585
- ], ScrollViewer.prototype, "barBackground", null);
586
- RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer);
5
+ export * from "./scrollViewer.pure.js";
6
+ import { RegisterScrollViewer } from "./scrollViewer.pure.js";
7
+ RegisterScrollViewer();
587
8
  //# sourceMappingURL=scrollViewer.js.map