@babylonjs/gui 9.15.0 → 9.16.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 (64) hide show
  1. package/2D/controls/checkbox.pure.js +164 -153
  2. package/2D/controls/checkbox.pure.js.map +1 -1
  3. package/2D/controls/colorpicker.pure.js +1300 -1289
  4. package/2D/controls/colorpicker.pure.js.map +1 -1
  5. package/2D/controls/container.pure.js +597 -582
  6. package/2D/controls/container.pure.js.map +1 -1
  7. package/2D/controls/control.pure.js +2474 -2434
  8. package/2D/controls/control.pure.js.map +1 -1
  9. package/2D/controls/displayGrid.pure.js +201 -190
  10. package/2D/controls/displayGrid.pure.js.map +1 -1
  11. package/2D/controls/ellipse.pure.js +96 -85
  12. package/2D/controls/ellipse.pure.js.map +1 -1
  13. package/2D/controls/grid.pure.js +511 -500
  14. package/2D/controls/grid.pure.js.map +1 -1
  15. package/2D/controls/image.pure.js +888 -877
  16. package/2D/controls/image.pure.js.map +1 -1
  17. package/2D/controls/inputText.pure.js +988 -973
  18. package/2D/controls/inputText.pure.js.map +1 -1
  19. package/2D/controls/inputTextArea.pure.js +955 -944
  20. package/2D/controls/inputTextArea.pure.js.map +1 -1
  21. package/2D/controls/line.pure.js +237 -226
  22. package/2D/controls/line.pure.js.map +1 -1
  23. package/2D/controls/multiLine.pure.js +233 -222
  24. package/2D/controls/multiLine.pure.js.map +1 -1
  25. package/2D/controls/radioButton.pure.js +182 -169
  26. package/2D/controls/radioButton.pure.js.map +1 -1
  27. package/2D/controls/rectangle.pure.js +211 -200
  28. package/2D/controls/rectangle.pure.js.map +1 -1
  29. package/2D/controls/scrollViewers/scrollViewer.pure.js +579 -567
  30. package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -1
  31. package/2D/controls/sliders/baseSlider.js +291 -280
  32. package/2D/controls/sliders/baseSlider.js.map +1 -1
  33. package/2D/controls/sliders/imageBasedSlider.pure.js +158 -147
  34. package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -1
  35. package/2D/controls/sliders/imageScrollBar.js +237 -223
  36. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  37. package/2D/controls/sliders/scrollBar.pure.js +169 -158
  38. package/2D/controls/sliders/scrollBar.pure.js.map +1 -1
  39. package/2D/controls/sliders/slider.pure.js +251 -240
  40. package/2D/controls/sliders/slider.pure.js.map +1 -1
  41. package/2D/controls/stackPanel.pure.js +236 -221
  42. package/2D/controls/stackPanel.pure.js.map +1 -1
  43. package/2D/controls/textBlock.pure.js +637 -626
  44. package/2D/controls/textBlock.pure.js.map +1 -1
  45. package/3D/materials/fluent/fluentMaterial.pure.d.ts +4 -4
  46. package/3D/materials/fluent/fluentMaterial.pure.js +322 -273
  47. package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -1
  48. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +510 -454
  49. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -1
  50. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +612 -529
  51. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -1
  52. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +313 -274
  53. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -1
  54. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +462 -405
  55. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -1
  56. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +583 -501
  57. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -1
  58. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +226 -203
  59. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -1
  60. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +961 -825
  61. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -1
  62. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +961 -825
  63. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -1
  64. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
1
+ import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { Logger } from "@babylonjs/core/Misc/logger.js";
3
3
  import { Control } from "./control.pure.js";
4
4
  import { Measure } from "../measure.js";
@@ -14,606 +14,621 @@ import { Matrix2D } from "../math2D.js";
14
14
  * Root class for 2D containers
15
15
  * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#containers
16
16
  */
17
- export class Container extends Control {
18
- /** Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending */
19
- get renderToIntermediateTexture() {
20
- return this._renderToIntermediateTexture;
21
- }
22
- set renderToIntermediateTexture(value) {
23
- if (this._renderToIntermediateTexture === value) {
24
- return;
25
- }
26
- this._renderToIntermediateTexture = value;
27
- this._markAsDirty();
28
- }
29
- /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
30
- get adaptHeightToChildren() {
31
- return this._adaptHeightToChildren;
32
- }
33
- set adaptHeightToChildren(value) {
34
- if (this._adaptHeightToChildren === value) {
35
- return;
36
- }
37
- this._adaptHeightToChildren = value;
38
- if (value) {
39
- this.height = "100%";
40
- }
41
- this._rebuildLayout = true;
42
- this._markAsDirty();
43
- }
44
- /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
45
- get adaptWidthToChildren() {
46
- return this._adaptWidthToChildren;
47
- }
48
- set adaptWidthToChildren(value) {
49
- if (this._adaptWidthToChildren === value) {
50
- return;
51
- }
52
- this._adaptWidthToChildren = value;
53
- if (value) {
54
- this.width = "100%";
55
- }
56
- this._rebuildLayout = true;
57
- this._markAsDirty();
58
- }
59
- /** Gets or sets background color */
60
- get background() {
61
- return this._background;
62
- }
63
- set background(value) {
64
- if (this._background === value) {
65
- return;
66
- }
67
- this._background = value;
68
- this._markAsDirty();
69
- }
70
- /** Gets or sets background gradient color. Takes precedence over background */
71
- get backgroundGradient() {
72
- return this._backgroundGradient;
73
- }
74
- set backgroundGradient(value) {
75
- if (this._backgroundGradient === value) {
76
- return;
77
- }
78
- this._backgroundGradient = value;
79
- this._markAsDirty();
80
- }
81
- /** Gets the list of children */
82
- get children() {
83
- return this._children;
84
- }
85
- get isReadOnly() {
86
- return this._isReadOnly;
87
- }
88
- set isReadOnly(value) {
89
- this._isReadOnly = value;
90
- for (const child of this._children) {
91
- child.isReadOnly = value;
92
- }
93
- }
94
- /**
95
- * Creates a new Container
96
- * @param name defines the name of the container
97
- */
98
- constructor(name) {
99
- super(name);
100
- this.name = name;
101
- /** @internal */
102
- this._children = new Array();
103
- /** @internal */
104
- this._measureForChildren = Measure.Empty();
105
- /** @internal */
106
- this._background = "";
107
- /** @internal */
108
- this._backgroundGradient = null;
109
- /** @internal */
110
- this._adaptWidthToChildren = false;
111
- /** @internal */
112
- this._adaptHeightToChildren = false;
113
- /** @internal */
114
- this._renderToIntermediateTexture = false;
115
- /** @internal */
116
- this._intermediateTexture = null;
117
- /**
118
- * Gets or sets a boolean indicating that the container will let internal controls handle picking instead of doing it directly using its bounding info
119
- */
120
- this.delegatePickingToChildren = false;
121
- /**
122
- * Gets or sets a boolean indicating that layout cycle errors should be displayed on the console
123
- */
124
- this.logLayoutCycleErrors = false;
125
- /**
126
- * Gets or sets the number of layout cycles (a change involved by a control while evaluating the layout) allowed
127
- */
128
- this.maxLayoutCycle = 3;
129
- /**
130
- * An event triggered when any control is added to this container.
131
- */
132
- this.onControlAddedObservable = new Observable();
133
- /**
134
- * An event triggered when any control is removed from this container.
135
- */
136
- this.onControlRemovedObservable = new Observable();
137
- this._inverseTransformMatrix = Matrix2D.Identity();
138
- this._inverseMeasure = new Measure(0, 0, 0, 0);
139
- }
140
- _getTypeName() {
141
- return "Container";
142
- }
143
- _flagDescendantsAsMatrixDirty() {
144
- for (const child of this.children) {
145
- child._isClipped = false;
146
- child._markMatrixAsDirty();
147
- }
148
- }
149
- /**
150
- * Gets a child using its name
151
- * @param name defines the child name to look for
152
- * @returns the child control if found
153
- */
154
- getChildByName(name) {
155
- for (const child of this.children) {
156
- if (child.name === name) {
157
- return child;
158
- }
159
- }
160
- return null;
161
- }
162
- /**
163
- * Gets a child using its type and its name
164
- * @param name defines the child name to look for
165
- * @param type defines the child type to look for
166
- * @returns the child control if found
167
- */
168
- getChildByType(name, type) {
169
- for (const child of this.children) {
170
- if (child.name === name && child.typeName === type) {
171
- return child;
172
- }
173
- }
174
- return null;
175
- }
176
- /**
177
- * Search for a specific control in children
178
- * @param control defines the control to look for
179
- * @returns true if the control is in child list
180
- */
181
- containsControl(control) {
182
- return this.children.indexOf(control) !== -1;
183
- }
184
- /**
185
- * Adds a new control to the current container
186
- * @param control defines the control to add
187
- * @returns the current container
188
- */
189
- addControl(control) {
190
- if (!control) {
191
- return this;
192
- }
193
- const index = this._children.indexOf(control);
194
- if (index !== -1) {
195
- return this;
196
- }
197
- control._link(this._host);
198
- control._markAllAsDirty();
199
- this._reOrderControl(control);
200
- this._markAsDirty();
201
- this.onControlAddedObservable.notifyObservers(control);
202
- return this;
203
- }
204
- /**
205
- * Removes all controls from the current container
206
- * @returns the current container
207
- */
208
- clearControls() {
209
- const children = this.children.slice();
210
- for (const child of children) {
211
- this.removeControl(child);
212
- }
213
- return this;
214
- }
215
- /**
216
- * Removes a control from the current container
217
- * @param control defines the control to remove
218
- * @returns the current container
219
- */
220
- removeControl(control) {
221
- const index = this._children.indexOf(control);
222
- if (index !== -1) {
223
- this._children.splice(index, 1);
224
- control.parent = null;
225
- }
226
- control.linkWithMesh(null);
227
- if (this._host) {
228
- this._host._cleanControlAfterRemoval(control);
229
- }
230
- this._markAsDirty();
231
- this.onControlRemovedObservable.notifyObservers(control);
232
- return this;
233
- }
234
- /**
235
- * @internal
236
- */
237
- _reOrderControl(control) {
238
- const linkedMesh = control.linkedMesh;
239
- this.removeControl(control);
240
- let wasAdded = false;
241
- for (let index = 0; index < this._children.length; index++) {
242
- if (this._children[index].zIndex > control.zIndex) {
243
- this._children.splice(index, 0, control);
244
- wasAdded = true;
245
- break;
246
- }
247
- }
248
- if (!wasAdded) {
249
- this._children.push(control);
250
- }
251
- control.parent = this;
252
- if (linkedMesh) {
253
- control.linkWithMesh(linkedMesh);
254
- }
255
- this._markAsDirty();
256
- }
257
- /**
258
- * @internal
259
- */
260
- _offsetLeft(offset) {
261
- super._offsetLeft(offset);
262
- for (const child of this._children) {
263
- child._offsetLeft(offset);
264
- }
265
- }
266
- /**
267
- * @internal
268
- */
269
- _offsetTop(offset) {
270
- super._offsetTop(offset);
271
- for (const child of this._children) {
272
- child._offsetTop(offset);
273
- }
274
- }
275
- /** @internal */
276
- _markAllAsDirty() {
277
- super._markAllAsDirty();
278
- for (let index = 0; index < this._children.length; index++) {
279
- this._children[index]._markAllAsDirty();
280
- }
281
- }
282
- _getBackgroundColor(context) {
283
- return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background;
284
- }
285
- /**
286
- * @internal
287
- */
288
- _localDraw(context) {
289
- if (this._background || this._backgroundGradient) {
290
- context.save();
291
- if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
292
- context.shadowColor = this.shadowColor;
293
- context.shadowBlur = this.shadowBlur;
294
- context.shadowOffsetX = this.shadowOffsetX * this._host.idealRatio;
295
- context.shadowOffsetY = this.shadowOffsetY * this._host.idealRatio;
296
- }
297
- context.fillStyle = this._getBackgroundColor(context);
298
- context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
299
- context.restore();
300
- }
301
- }
302
- /**
303
- * @internal
304
- */
305
- _link(host) {
306
- super._link(host);
307
- for (const child of this._children) {
308
- child._link(host);
309
- }
310
- }
311
- /** @internal */
312
- _beforeLayout() {
313
- // Do nothing
314
- }
315
- /**
316
- * @internal
317
- */
318
- _processMeasures(parentMeasure, context) {
319
- if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {
320
- super._processMeasures(parentMeasure, context);
321
- this._evaluateClippingState(parentMeasure);
322
- if (this._renderToIntermediateTexture) {
323
- if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) {
324
- this._intermediateTexture.dispose();
325
- this._intermediateTexture = null;
326
- }
327
- if (!this._intermediateTexture) {
328
- this._intermediateTexture = new DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, Texture.NEAREST_SAMPLINGMODE, Constants.TEXTUREFORMAT_RGBA, false);
329
- this._intermediateTexture.hasAlpha = true;
17
+ let Container = (() => {
18
+ var _a;
19
+ let _classSuper = Control;
20
+ let _instanceExtraInitializers = [];
21
+ let _delegatePickingToChildren_decorators;
22
+ let _delegatePickingToChildren_initializers = [];
23
+ let _delegatePickingToChildren_extraInitializers = [];
24
+ let _get_renderToIntermediateTexture_decorators;
25
+ let _maxLayoutCycle_decorators;
26
+ let _maxLayoutCycle_initializers = [];
27
+ let _maxLayoutCycle_extraInitializers = [];
28
+ let _get_adaptHeightToChildren_decorators;
29
+ let _get_adaptWidthToChildren_decorators;
30
+ let _get_background_decorators;
31
+ let _get_backgroundGradient_decorators;
32
+ return _a = class Container extends _classSuper {
33
+ /** Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending */
34
+ get renderToIntermediateTexture() {
35
+ return this._renderToIntermediateTexture;
36
+ }
37
+ set renderToIntermediateTexture(value) {
38
+ if (this._renderToIntermediateTexture === value) {
39
+ return;
330
40
  }
331
- else {
332
- this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height);
41
+ this._renderToIntermediateTexture = value;
42
+ this._markAsDirty();
43
+ }
44
+ /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
45
+ get adaptHeightToChildren() {
46
+ return this._adaptHeightToChildren;
47
+ }
48
+ set adaptHeightToChildren(value) {
49
+ if (this._adaptHeightToChildren === value) {
50
+ return;
51
+ }
52
+ this._adaptHeightToChildren = value;
53
+ if (value) {
54
+ this.height = "100%";
333
55
  }
56
+ this._rebuildLayout = true;
57
+ this._markAsDirty();
334
58
  }
335
- }
336
- }
337
- /**
338
- * @internal
339
- */
340
- _layout(parentMeasure, context) {
341
- if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
342
- return false;
343
- }
344
- this.host._numLayoutCalls++;
345
- if (this._isDirty) {
346
- this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace);
347
- }
348
- let rebuildCount = 0;
349
- context.save();
350
- this._applyStates(context);
351
- this._beforeLayout();
352
- do {
353
- let computedWidth = -1;
354
- let computedHeight = -1;
355
- this._rebuildLayout = false;
356
- this._processMeasures(parentMeasure, context);
357
- if (!this._isClipped) {
59
+ /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
60
+ get adaptWidthToChildren() {
61
+ return this._adaptWidthToChildren;
62
+ }
63
+ set adaptWidthToChildren(value) {
64
+ if (this._adaptWidthToChildren === value) {
65
+ return;
66
+ }
67
+ this._adaptWidthToChildren = value;
68
+ if (value) {
69
+ this.width = "100%";
70
+ }
71
+ this._rebuildLayout = true;
72
+ this._markAsDirty();
73
+ }
74
+ /** Gets or sets background color */
75
+ get background() {
76
+ return this._background;
77
+ }
78
+ set background(value) {
79
+ if (this._background === value) {
80
+ return;
81
+ }
82
+ this._background = value;
83
+ this._markAsDirty();
84
+ }
85
+ /** Gets or sets background gradient color. Takes precedence over background */
86
+ get backgroundGradient() {
87
+ return this._backgroundGradient;
88
+ }
89
+ set backgroundGradient(value) {
90
+ if (this._backgroundGradient === value) {
91
+ return;
92
+ }
93
+ this._backgroundGradient = value;
94
+ this._markAsDirty();
95
+ }
96
+ /** Gets the list of children */
97
+ get children() {
98
+ return this._children;
99
+ }
100
+ get isReadOnly() {
101
+ return this._isReadOnly;
102
+ }
103
+ set isReadOnly(value) {
104
+ this._isReadOnly = value;
105
+ for (const child of this._children) {
106
+ child.isReadOnly = value;
107
+ }
108
+ }
109
+ /**
110
+ * Creates a new Container
111
+ * @param name defines the name of the container
112
+ */
113
+ constructor(name) {
114
+ super(name);
115
+ this.name = (__runInitializers(this, _instanceExtraInitializers), name);
116
+ /** @internal */
117
+ this._children = new Array();
118
+ /** @internal */
119
+ this._measureForChildren = Measure.Empty();
120
+ /** @internal */
121
+ this._background = "";
122
+ /** @internal */
123
+ this._backgroundGradient = null;
124
+ /** @internal */
125
+ this._adaptWidthToChildren = false;
126
+ /** @internal */
127
+ this._adaptHeightToChildren = false;
128
+ /** @internal */
129
+ this._renderToIntermediateTexture = false;
130
+ /** @internal */
131
+ this._intermediateTexture = null;
132
+ /**
133
+ * Gets or sets a boolean indicating that the container will let internal controls handle picking instead of doing it directly using its bounding info
134
+ */
135
+ this.delegatePickingToChildren = __runInitializers(this, _delegatePickingToChildren_initializers, false);
136
+ /**
137
+ * Gets or sets a boolean indicating that layout cycle errors should be displayed on the console
138
+ */
139
+ this.logLayoutCycleErrors = (__runInitializers(this, _delegatePickingToChildren_extraInitializers), false);
140
+ /**
141
+ * Gets or sets the number of layout cycles (a change involved by a control while evaluating the layout) allowed
142
+ */
143
+ this.maxLayoutCycle = __runInitializers(this, _maxLayoutCycle_initializers, 3);
144
+ /**
145
+ * An event triggered when any control is added to this container.
146
+ */
147
+ this.onControlAddedObservable = (__runInitializers(this, _maxLayoutCycle_extraInitializers), new Observable());
148
+ /**
149
+ * An event triggered when any control is removed from this container.
150
+ */
151
+ this.onControlRemovedObservable = new Observable();
152
+ this._inverseTransformMatrix = Matrix2D.Identity();
153
+ this._inverseMeasure = new Measure(0, 0, 0, 0);
154
+ }
155
+ _getTypeName() {
156
+ return "Container";
157
+ }
158
+ _flagDescendantsAsMatrixDirty() {
159
+ for (const child of this.children) {
160
+ child._isClipped = false;
161
+ child._markMatrixAsDirty();
162
+ }
163
+ }
164
+ /**
165
+ * Gets a child using its name
166
+ * @param name defines the child name to look for
167
+ * @returns the child control if found
168
+ */
169
+ getChildByName(name) {
170
+ for (const child of this.children) {
171
+ if (child.name === name) {
172
+ return child;
173
+ }
174
+ }
175
+ return null;
176
+ }
177
+ /**
178
+ * Gets a child using its type and its name
179
+ * @param name defines the child name to look for
180
+ * @param type defines the child type to look for
181
+ * @returns the child control if found
182
+ */
183
+ getChildByType(name, type) {
184
+ for (const child of this.children) {
185
+ if (child.name === name && child.typeName === type) {
186
+ return child;
187
+ }
188
+ }
189
+ return null;
190
+ }
191
+ /**
192
+ * Search for a specific control in children
193
+ * @param control defines the control to look for
194
+ * @returns true if the control is in child list
195
+ */
196
+ containsControl(control) {
197
+ return this.children.indexOf(control) !== -1;
198
+ }
199
+ /**
200
+ * Adds a new control to the current container
201
+ * @param control defines the control to add
202
+ * @returns the current container
203
+ */
204
+ addControl(control) {
205
+ if (!control) {
206
+ return this;
207
+ }
208
+ const index = this._children.indexOf(control);
209
+ if (index !== -1) {
210
+ return this;
211
+ }
212
+ control._link(this._host);
213
+ control._markAllAsDirty();
214
+ this._reOrderControl(control);
215
+ this._markAsDirty();
216
+ this.onControlAddedObservable.notifyObservers(control);
217
+ return this;
218
+ }
219
+ /**
220
+ * Removes all controls from the current container
221
+ * @returns the current container
222
+ */
223
+ clearControls() {
224
+ const children = this.children.slice();
225
+ for (const child of children) {
226
+ this.removeControl(child);
227
+ }
228
+ return this;
229
+ }
230
+ /**
231
+ * Removes a control from the current container
232
+ * @param control defines the control to remove
233
+ * @returns the current container
234
+ */
235
+ removeControl(control) {
236
+ const index = this._children.indexOf(control);
237
+ if (index !== -1) {
238
+ this._children.splice(index, 1);
239
+ control.parent = null;
240
+ }
241
+ control.linkWithMesh(null);
242
+ if (this._host) {
243
+ this._host._cleanControlAfterRemoval(control);
244
+ }
245
+ this._markAsDirty();
246
+ this.onControlRemovedObservable.notifyObservers(control);
247
+ return this;
248
+ }
249
+ /**
250
+ * @internal
251
+ */
252
+ _reOrderControl(control) {
253
+ const linkedMesh = control.linkedMesh;
254
+ this.removeControl(control);
255
+ let wasAdded = false;
256
+ for (let index = 0; index < this._children.length; index++) {
257
+ if (this._children[index].zIndex > control.zIndex) {
258
+ this._children.splice(index, 0, control);
259
+ wasAdded = true;
260
+ break;
261
+ }
262
+ }
263
+ if (!wasAdded) {
264
+ this._children.push(control);
265
+ }
266
+ control.parent = this;
267
+ if (linkedMesh) {
268
+ control.linkWithMesh(linkedMesh);
269
+ }
270
+ this._markAsDirty();
271
+ }
272
+ /**
273
+ * @internal
274
+ */
275
+ _offsetLeft(offset) {
276
+ super._offsetLeft(offset);
277
+ for (const child of this._children) {
278
+ child._offsetLeft(offset);
279
+ }
280
+ }
281
+ /**
282
+ * @internal
283
+ */
284
+ _offsetTop(offset) {
285
+ super._offsetTop(offset);
286
+ for (const child of this._children) {
287
+ child._offsetTop(offset);
288
+ }
289
+ }
290
+ /** @internal */
291
+ _markAllAsDirty() {
292
+ super._markAllAsDirty();
293
+ for (let index = 0; index < this._children.length; index++) {
294
+ this._children[index]._markAllAsDirty();
295
+ }
296
+ }
297
+ _getBackgroundColor(context) {
298
+ return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background;
299
+ }
300
+ /**
301
+ * @internal
302
+ */
303
+ _localDraw(context) {
304
+ if (this._background || this._backgroundGradient) {
305
+ context.save();
306
+ if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
307
+ context.shadowColor = this.shadowColor;
308
+ context.shadowBlur = this.shadowBlur;
309
+ context.shadowOffsetX = this.shadowOffsetX * this._host.idealRatio;
310
+ context.shadowOffsetY = this.shadowOffsetY * this._host.idealRatio;
311
+ }
312
+ context.fillStyle = this._getBackgroundColor(context);
313
+ context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
314
+ context.restore();
315
+ }
316
+ }
317
+ /**
318
+ * @internal
319
+ */
320
+ _link(host) {
321
+ super._link(host);
358
322
  for (const child of this._children) {
359
- child._tempParentMeasure.copyFrom(this._measureForChildren);
360
- if (child._layout(this._measureForChildren, context)) {
361
- if (child.isVisible && !child.notRenderable) {
362
- if (this.adaptWidthToChildren && child._width.isPixel) {
363
- computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels);
323
+ child._link(host);
324
+ }
325
+ }
326
+ /** @internal */
327
+ _beforeLayout() {
328
+ // Do nothing
329
+ }
330
+ /**
331
+ * @internal
332
+ */
333
+ _processMeasures(parentMeasure, context) {
334
+ if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {
335
+ super._processMeasures(parentMeasure, context);
336
+ this._evaluateClippingState(parentMeasure);
337
+ if (this._renderToIntermediateTexture) {
338
+ if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) {
339
+ this._intermediateTexture.dispose();
340
+ this._intermediateTexture = null;
341
+ }
342
+ if (!this._intermediateTexture) {
343
+ this._intermediateTexture = new DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, Texture.NEAREST_SAMPLINGMODE, Constants.TEXTUREFORMAT_RGBA, false);
344
+ this._intermediateTexture.hasAlpha = true;
345
+ }
346
+ else {
347
+ this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height);
348
+ }
349
+ }
350
+ }
351
+ }
352
+ /**
353
+ * @internal
354
+ */
355
+ _layout(parentMeasure, context) {
356
+ if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
357
+ return false;
358
+ }
359
+ this.host._numLayoutCalls++;
360
+ if (this._isDirty) {
361
+ this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace);
362
+ }
363
+ let rebuildCount = 0;
364
+ context.save();
365
+ this._applyStates(context);
366
+ this._beforeLayout();
367
+ do {
368
+ let computedWidth = -1;
369
+ let computedHeight = -1;
370
+ this._rebuildLayout = false;
371
+ this._processMeasures(parentMeasure, context);
372
+ if (!this._isClipped) {
373
+ for (const child of this._children) {
374
+ child._tempParentMeasure.copyFrom(this._measureForChildren);
375
+ if (child._layout(this._measureForChildren, context)) {
376
+ if (child.isVisible && !child.notRenderable) {
377
+ if (this.adaptWidthToChildren && child._width.isPixel) {
378
+ computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels);
379
+ }
380
+ if (this.adaptHeightToChildren && child._height.isPixel) {
381
+ computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels);
382
+ }
383
+ }
364
384
  }
365
- if (this.adaptHeightToChildren && child._height.isPixel) {
366
- computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels);
385
+ }
386
+ if (this.adaptWidthToChildren && computedWidth >= 0) {
387
+ computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels;
388
+ const width = computedWidth + "px";
389
+ if (this.width !== width) {
390
+ this.parent?._markAsDirty();
391
+ this.width = width;
392
+ this._width.ignoreAdaptiveScaling = true;
393
+ this._rebuildLayout = true;
394
+ }
395
+ }
396
+ if (this.adaptHeightToChildren && computedHeight >= 0) {
397
+ computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels;
398
+ const height = computedHeight + "px";
399
+ if (this.height !== height) {
400
+ this.parent?._markAsDirty();
401
+ this.height = height;
402
+ this._height.ignoreAdaptiveScaling = true;
403
+ this._rebuildLayout = true;
367
404
  }
368
405
  }
406
+ this._postMeasure();
369
407
  }
408
+ rebuildCount++;
409
+ } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle);
410
+ if (this._rebuildLayout && rebuildCount >= this.maxLayoutCycle && this.logLayoutCycleErrors) {
411
+ Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`);
370
412
  }
371
- if (this.adaptWidthToChildren && computedWidth >= 0) {
372
- computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels;
373
- const width = computedWidth + "px";
374
- if (this.width !== width) {
375
- this.parent?._markAsDirty();
376
- this.width = width;
377
- this._width.ignoreAdaptiveScaling = true;
378
- this._rebuildLayout = true;
413
+ context.restore();
414
+ if (this._isDirty) {
415
+ this.invalidateRect();
416
+ this._isDirty = false;
417
+ }
418
+ return true;
419
+ }
420
+ _postMeasure() {
421
+ // Do nothing by default
422
+ }
423
+ /**
424
+ * @internal
425
+ */
426
+ _draw(context, invalidatedRectangle) {
427
+ const renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture;
428
+ const contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context;
429
+ if (renderToIntermediateTextureThisDraw) {
430
+ contextToDrawTo.save();
431
+ contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top);
432
+ if (invalidatedRectangle) {
433
+ this._transformMatrix.invertToRef(this._inverseTransformMatrix);
434
+ invalidatedRectangle.transformToRef(this._inverseTransformMatrix, this._inverseMeasure);
435
+ contextToDrawTo.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height);
436
+ }
437
+ else {
438
+ contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
379
439
  }
380
440
  }
381
- if (this.adaptHeightToChildren && computedHeight >= 0) {
382
- computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels;
383
- const height = computedHeight + "px";
384
- if (this.height !== height) {
385
- this.parent?._markAsDirty();
386
- this.height = height;
387
- this._height.ignoreAdaptiveScaling = true;
388
- this._rebuildLayout = true;
441
+ this._localDraw(contextToDrawTo);
442
+ context.save();
443
+ if (this.clipChildren) {
444
+ this._clipForChildren(contextToDrawTo);
445
+ }
446
+ for (const child of this._children) {
447
+ // Only redraw parts of the screen that are invalidated
448
+ if (invalidatedRectangle) {
449
+ if (!child._intersectsRect(invalidatedRectangle)) {
450
+ continue;
451
+ }
389
452
  }
453
+ child._render(contextToDrawTo, invalidatedRectangle);
390
454
  }
391
- this._postMeasure();
392
- }
393
- rebuildCount++;
394
- } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle);
395
- if (this._rebuildLayout && rebuildCount >= this.maxLayoutCycle && this.logLayoutCycleErrors) {
396
- Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`);
397
- }
398
- context.restore();
399
- if (this._isDirty) {
400
- this.invalidateRect();
401
- this._isDirty = false;
402
- }
403
- return true;
404
- }
405
- _postMeasure() {
406
- // Do nothing by default
407
- }
408
- /**
409
- * @internal
410
- */
411
- _draw(context, invalidatedRectangle) {
412
- const renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture;
413
- const contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context;
414
- if (renderToIntermediateTextureThisDraw) {
415
- contextToDrawTo.save();
416
- contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top);
417
- if (invalidatedRectangle) {
418
- this._transformMatrix.invertToRef(this._inverseTransformMatrix);
419
- invalidatedRectangle.transformToRef(this._inverseTransformMatrix, this._inverseMeasure);
420
- contextToDrawTo.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height);
421
- }
422
- else {
423
- contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
424
- }
425
- }
426
- this._localDraw(contextToDrawTo);
427
- context.save();
428
- if (this.clipChildren) {
429
- this._clipForChildren(contextToDrawTo);
430
- }
431
- for (const child of this._children) {
432
- // Only redraw parts of the screen that are invalidated
433
- if (invalidatedRectangle) {
434
- if (!child._intersectsRect(invalidatedRectangle)) {
435
- continue;
436
- }
437
- }
438
- child._render(contextToDrawTo, invalidatedRectangle);
439
- }
440
- if (renderToIntermediateTextureThisDraw) {
441
- contextToDrawTo.restore();
442
- context.save();
443
- context.globalAlpha = this.alpha;
444
- context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top);
445
- context.restore();
446
- }
447
- context.restore();
448
- }
449
- getDescendantsToRef(results, directDescendantsOnly = false, predicate) {
450
- if (!this.children) {
451
- return;
452
- }
453
- for (let index = 0; index < this.children.length; index++) {
454
- const item = this.children[index];
455
- if (!predicate || predicate(item)) {
456
- results.push(item);
457
- }
458
- if (!directDescendantsOnly) {
459
- item.getDescendantsToRef(results, false, predicate);
460
- }
461
- }
462
- }
463
- /**
464
- * @internal
465
- */
466
- _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
467
- if (!this._isEnabled || !this.isVisible || this.notRenderable) {
468
- return false;
469
- }
470
- // checks if the picking position is within the container
471
- const contains = super.contains(x, y);
472
- // if clipChildren is off, we should still pass picking events to children even if we don't contain the pointer
473
- if (!contains && this.clipChildren) {
474
- return false;
475
- }
476
- if (this.delegatePickingToChildren) {
477
- let contains = false;
478
- for (let index = this._children.length - 1; index >= 0; index--) {
479
- const child = this._children[index];
480
- if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
481
- contains = true;
482
- break;
483
- }
484
- }
485
- if (!contains) {
486
- return false;
487
- }
488
- }
489
- // Checking backwards to pick closest first
490
- for (let index = this._children.length - 1; index >= 0; index--) {
491
- const child = this._children[index];
492
- if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {
493
- if (child.hoverCursor) {
494
- this._host._changeCursor(child.hoverCursor);
455
+ if (renderToIntermediateTextureThisDraw) {
456
+ contextToDrawTo.restore();
457
+ context.save();
458
+ context.globalAlpha = this.alpha;
459
+ context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top);
460
+ context.restore();
495
461
  }
496
- return true;
462
+ context.restore();
497
463
  }
498
- }
499
- if (!contains) {
500
- return false;
501
- }
502
- if (!this.isHitTestVisible) {
503
- return false;
504
- }
505
- return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
506
- }
507
- /**
508
- * @internal
509
- */
510
- _additionalProcessing(parentMeasure, context) {
511
- super._additionalProcessing(parentMeasure, context);
512
- this._measureForChildren.copyFrom(this._currentMeasure);
513
- }
514
- _getAdaptDimTo(dim) {
515
- if (dim === "width") {
516
- return this.adaptWidthToChildren;
517
- }
518
- else {
519
- return this.adaptHeightToChildren;
520
- }
521
- }
522
- isDimensionFullyDefined(dim) {
523
- if (this._getAdaptDimTo(dim)) {
524
- for (const child of this.children) {
525
- if (!child.isDimensionFullyDefined(dim)) {
464
+ getDescendantsToRef(results, directDescendantsOnly = false, predicate) {
465
+ if (!this.children) {
466
+ return;
467
+ }
468
+ for (let index = 0; index < this.children.length; index++) {
469
+ const item = this.children[index];
470
+ if (!predicate || predicate(item)) {
471
+ results.push(item);
472
+ }
473
+ if (!directDescendantsOnly) {
474
+ item.getDescendantsToRef(results, false, predicate);
475
+ }
476
+ }
477
+ }
478
+ /**
479
+ * @internal
480
+ */
481
+ _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
482
+ if (!this._isEnabled || !this.isVisible || this.notRenderable) {
483
+ return false;
484
+ }
485
+ // checks if the picking position is within the container
486
+ const contains = super.contains(x, y);
487
+ // if clipChildren is off, we should still pass picking events to children even if we don't contain the pointer
488
+ if (!contains && this.clipChildren) {
526
489
  return false;
527
490
  }
491
+ if (this.delegatePickingToChildren) {
492
+ let contains = false;
493
+ for (let index = this._children.length - 1; index >= 0; index--) {
494
+ const child = this._children[index];
495
+ if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
496
+ contains = true;
497
+ break;
498
+ }
499
+ }
500
+ if (!contains) {
501
+ return false;
502
+ }
503
+ }
504
+ // Checking backwards to pick closest first
505
+ for (let index = this._children.length - 1; index >= 0; index--) {
506
+ const child = this._children[index];
507
+ if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {
508
+ if (child.hoverCursor) {
509
+ this._host._changeCursor(child.hoverCursor);
510
+ }
511
+ return true;
512
+ }
513
+ }
514
+ if (!contains) {
515
+ return false;
516
+ }
517
+ if (!this.isHitTestVisible) {
518
+ return false;
519
+ }
520
+ return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
528
521
  }
529
- return true;
530
- }
531
- return super.isDimensionFullyDefined(dim);
532
- }
533
- /**
534
- * Serializes the current control
535
- * @param serializationObject defined the JSON serialized object
536
- * @param force force serialization even if isSerializable === false
537
- * @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize (true by default)
538
- */
539
- serialize(serializationObject, force = false, allowCanvas = true) {
540
- super.serialize(serializationObject, force, allowCanvas);
541
- if (!this.isSerializable && !force) {
542
- return;
543
- }
544
- if (this.backgroundGradient) {
545
- serializationObject.backgroundGradient = {};
546
- this.backgroundGradient.serialize(serializationObject.backgroundGradient);
547
- }
548
- if (!this.children.length) {
549
- return;
550
- }
551
- serializationObject.children = [];
552
- for (const child of this.children) {
553
- if (child.isSerializable || force) {
554
- const childSerializationObject = {};
555
- child.serialize(childSerializationObject, force, allowCanvas);
556
- serializationObject.children.push(childSerializationObject);
557
- }
558
- }
559
- }
560
- /** Releases associated resources */
561
- dispose() {
562
- super.dispose();
563
- for (let index = this.children.length - 1; index >= 0; index--) {
564
- this.children[index].dispose();
565
- }
566
- this._intermediateTexture?.dispose();
567
- }
568
- /**
569
- * @internal
570
- */
571
- _parseFromContent(serializedObject, host, urlRewriter) {
572
- super._parseFromContent(serializedObject, host, urlRewriter);
573
- this._link(host);
574
- // Gradient
575
- if (serializedObject.backgroundGradient) {
576
- const className = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className);
577
- this._backgroundGradient = new className();
578
- this._backgroundGradient?.parse(serializedObject.backgroundGradient);
579
- }
580
- if (!serializedObject.children) {
581
- return;
582
- }
583
- for (const childData of serializedObject.children) {
584
- this.addControl(Control.Parse(childData, host, urlRewriter));
585
- }
586
- }
587
- isReady() {
588
- for (const child of this.children) {
589
- if (!child.isReady()) {
590
- return false;
522
+ /**
523
+ * @internal
524
+ */
525
+ _additionalProcessing(parentMeasure, context) {
526
+ super._additionalProcessing(parentMeasure, context);
527
+ this._measureForChildren.copyFrom(this._currentMeasure);
591
528
  }
592
- }
593
- return true;
594
- }
595
- }
596
- __decorate([
597
- serialize()
598
- ], Container.prototype, "delegatePickingToChildren", void 0);
599
- __decorate([
600
- serialize()
601
- ], Container.prototype, "renderToIntermediateTexture", null);
602
- __decorate([
603
- serialize()
604
- ], Container.prototype, "maxLayoutCycle", void 0);
605
- __decorate([
606
- serialize()
607
- ], Container.prototype, "adaptHeightToChildren", null);
608
- __decorate([
609
- serialize()
610
- ], Container.prototype, "adaptWidthToChildren", null);
611
- __decorate([
612
- serialize()
613
- ], Container.prototype, "background", null);
614
- __decorate([
615
- serialize()
616
- ], Container.prototype, "backgroundGradient", null);
529
+ _getAdaptDimTo(dim) {
530
+ if (dim === "width") {
531
+ return this.adaptWidthToChildren;
532
+ }
533
+ else {
534
+ return this.adaptHeightToChildren;
535
+ }
536
+ }
537
+ isDimensionFullyDefined(dim) {
538
+ if (this._getAdaptDimTo(dim)) {
539
+ for (const child of this.children) {
540
+ if (!child.isDimensionFullyDefined(dim)) {
541
+ return false;
542
+ }
543
+ }
544
+ return true;
545
+ }
546
+ return super.isDimensionFullyDefined(dim);
547
+ }
548
+ /**
549
+ * Serializes the current control
550
+ * @param serializationObject defined the JSON serialized object
551
+ * @param force force serialization even if isSerializable === false
552
+ * @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize (true by default)
553
+ */
554
+ serialize(serializationObject, force = false, allowCanvas = true) {
555
+ super.serialize(serializationObject, force, allowCanvas);
556
+ if (!this.isSerializable && !force) {
557
+ return;
558
+ }
559
+ if (this.backgroundGradient) {
560
+ serializationObject.backgroundGradient = {};
561
+ this.backgroundGradient.serialize(serializationObject.backgroundGradient);
562
+ }
563
+ if (!this.children.length) {
564
+ return;
565
+ }
566
+ serializationObject.children = [];
567
+ for (const child of this.children) {
568
+ if (child.isSerializable || force) {
569
+ const childSerializationObject = {};
570
+ child.serialize(childSerializationObject, force, allowCanvas);
571
+ serializationObject.children.push(childSerializationObject);
572
+ }
573
+ }
574
+ }
575
+ /** Releases associated resources */
576
+ dispose() {
577
+ super.dispose();
578
+ for (let index = this.children.length - 1; index >= 0; index--) {
579
+ this.children[index].dispose();
580
+ }
581
+ this._intermediateTexture?.dispose();
582
+ }
583
+ /**
584
+ * @internal
585
+ */
586
+ _parseFromContent(serializedObject, host, urlRewriter) {
587
+ super._parseFromContent(serializedObject, host, urlRewriter);
588
+ this._link(host);
589
+ // Gradient
590
+ if (serializedObject.backgroundGradient) {
591
+ const className = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className);
592
+ this._backgroundGradient = new className();
593
+ this._backgroundGradient?.parse(serializedObject.backgroundGradient);
594
+ }
595
+ if (!serializedObject.children) {
596
+ return;
597
+ }
598
+ for (const childData of serializedObject.children) {
599
+ this.addControl(Control.Parse(childData, host, urlRewriter));
600
+ }
601
+ }
602
+ isReady() {
603
+ for (const child of this.children) {
604
+ if (!child.isReady()) {
605
+ return false;
606
+ }
607
+ }
608
+ return true;
609
+ }
610
+ },
611
+ (() => {
612
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
613
+ _delegatePickingToChildren_decorators = [serialize()];
614
+ _get_renderToIntermediateTexture_decorators = [serialize()];
615
+ _maxLayoutCycle_decorators = [serialize()];
616
+ _get_adaptHeightToChildren_decorators = [serialize()];
617
+ _get_adaptWidthToChildren_decorators = [serialize()];
618
+ _get_background_decorators = [serialize()];
619
+ _get_backgroundGradient_decorators = [serialize()];
620
+ __esDecorate(_a, null, _get_renderToIntermediateTexture_decorators, { kind: "getter", name: "renderToIntermediateTexture", static: false, private: false, access: { has: obj => "renderToIntermediateTexture" in obj, get: obj => obj.renderToIntermediateTexture }, metadata: _metadata }, null, _instanceExtraInitializers);
621
+ __esDecorate(_a, null, _get_adaptHeightToChildren_decorators, { kind: "getter", name: "adaptHeightToChildren", static: false, private: false, access: { has: obj => "adaptHeightToChildren" in obj, get: obj => obj.adaptHeightToChildren }, metadata: _metadata }, null, _instanceExtraInitializers);
622
+ __esDecorate(_a, null, _get_adaptWidthToChildren_decorators, { kind: "getter", name: "adaptWidthToChildren", static: false, private: false, access: { has: obj => "adaptWidthToChildren" in obj, get: obj => obj.adaptWidthToChildren }, metadata: _metadata }, null, _instanceExtraInitializers);
623
+ __esDecorate(_a, null, _get_background_decorators, { kind: "getter", name: "background", static: false, private: false, access: { has: obj => "background" in obj, get: obj => obj.background }, metadata: _metadata }, null, _instanceExtraInitializers);
624
+ __esDecorate(_a, null, _get_backgroundGradient_decorators, { kind: "getter", name: "backgroundGradient", static: false, private: false, access: { has: obj => "backgroundGradient" in obj, get: obj => obj.backgroundGradient }, metadata: _metadata }, null, _instanceExtraInitializers);
625
+ __esDecorate(null, null, _delegatePickingToChildren_decorators, { kind: "field", name: "delegatePickingToChildren", static: false, private: false, access: { has: obj => "delegatePickingToChildren" in obj, get: obj => obj.delegatePickingToChildren, set: (obj, value) => { obj.delegatePickingToChildren = value; } }, metadata: _metadata }, _delegatePickingToChildren_initializers, _delegatePickingToChildren_extraInitializers);
626
+ __esDecorate(null, null, _maxLayoutCycle_decorators, { kind: "field", name: "maxLayoutCycle", static: false, private: false, access: { has: obj => "maxLayoutCycle" in obj, get: obj => obj.maxLayoutCycle, set: (obj, value) => { obj.maxLayoutCycle = value; } }, metadata: _metadata }, _maxLayoutCycle_initializers, _maxLayoutCycle_extraInitializers);
627
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
628
+ })(),
629
+ _a;
630
+ })();
631
+ export { Container };
617
632
  let _Registered = false;
618
633
  /**
619
634
  * Registers the Container class with the type store for serialization support.