@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.
- package/2D/controls/checkbox.pure.js +164 -153
- package/2D/controls/checkbox.pure.js.map +1 -1
- package/2D/controls/colorpicker.pure.js +1300 -1289
- package/2D/controls/colorpicker.pure.js.map +1 -1
- package/2D/controls/container.pure.js +597 -582
- package/2D/controls/container.pure.js.map +1 -1
- package/2D/controls/control.pure.js +2474 -2434
- package/2D/controls/control.pure.js.map +1 -1
- package/2D/controls/displayGrid.pure.js +201 -190
- package/2D/controls/displayGrid.pure.js.map +1 -1
- package/2D/controls/ellipse.pure.js +96 -85
- package/2D/controls/ellipse.pure.js.map +1 -1
- package/2D/controls/grid.pure.js +511 -500
- package/2D/controls/grid.pure.js.map +1 -1
- package/2D/controls/image.pure.js +888 -877
- package/2D/controls/image.pure.js.map +1 -1
- package/2D/controls/inputText.pure.js +988 -973
- package/2D/controls/inputText.pure.js.map +1 -1
- package/2D/controls/inputTextArea.pure.js +955 -944
- package/2D/controls/inputTextArea.pure.js.map +1 -1
- package/2D/controls/line.pure.js +237 -226
- package/2D/controls/line.pure.js.map +1 -1
- package/2D/controls/multiLine.pure.js +233 -222
- package/2D/controls/multiLine.pure.js.map +1 -1
- package/2D/controls/radioButton.pure.js +182 -169
- package/2D/controls/radioButton.pure.js.map +1 -1
- package/2D/controls/rectangle.pure.js +211 -200
- package/2D/controls/rectangle.pure.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.pure.js +579 -567
- package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +291 -280
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.pure.js +158 -147
- package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +237 -223
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.pure.js +169 -158
- package/2D/controls/sliders/scrollBar.pure.js.map +1 -1
- package/2D/controls/sliders/slider.pure.js +251 -240
- package/2D/controls/sliders/slider.pure.js.map +1 -1
- package/2D/controls/stackPanel.pure.js +236 -221
- package/2D/controls/stackPanel.pure.js.map +1 -1
- package/2D/controls/textBlock.pure.js +637 -626
- package/2D/controls/textBlock.pure.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.pure.d.ts +4 -4
- package/3D/materials/fluent/fluentMaterial.pure.js +322 -273
- package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +510 -454
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +612 -529
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +313 -274
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +462 -405
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +583 -501
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +226 -203
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +961 -825
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +961 -825
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
|
|
2
2
|
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
|
3
3
|
import { Control } from "../control.pure.js";
|
|
4
4
|
import { ValueAndUnit } from "../../valueAndUnit.js";
|
|
@@ -7,291 +7,302 @@ import { Logger } from "@babylonjs/core/Misc/logger.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Class used to create slider controls
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
10
|
+
let BaseSlider = (() => {
|
|
11
|
+
var _a;
|
|
12
|
+
let _classSuper = Control;
|
|
13
|
+
let _instanceExtraInitializers = [];
|
|
14
|
+
let _get_displayThumb_decorators;
|
|
15
|
+
let _get_step_decorators;
|
|
16
|
+
let _get_barOffset_decorators;
|
|
17
|
+
let _get_thumbWidth_decorators;
|
|
18
|
+
let _get_minimum_decorators;
|
|
19
|
+
let _get_maximum_decorators;
|
|
20
|
+
let _get_value_decorators;
|
|
21
|
+
let _get_isVertical_decorators;
|
|
22
|
+
let _get_isThumbClamped_decorators;
|
|
23
|
+
return _a = class BaseSlider extends _classSuper {
|
|
24
|
+
/** Gets or sets a boolean indicating if the thumb must be rendered */
|
|
25
|
+
get displayThumb() {
|
|
26
|
+
return this._displayThumb;
|
|
27
|
+
}
|
|
28
|
+
set displayThumb(value) {
|
|
29
|
+
if (this._displayThumb === value) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this._displayThumb = value;
|
|
33
|
+
this._markAsDirty();
|
|
34
|
+
}
|
|
35
|
+
/** Gets or sets a step to apply to values (0 by default) */
|
|
36
|
+
get step() {
|
|
37
|
+
return this._step;
|
|
38
|
+
}
|
|
39
|
+
set step(value) {
|
|
40
|
+
if (this._step === value) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._step = value;
|
|
44
|
+
this._markAsDirty();
|
|
45
|
+
}
|
|
46
|
+
/** Gets or sets main bar offset (ie. the margin applied to the value bar) */
|
|
47
|
+
get barOffset() {
|
|
48
|
+
return this._barOffset.toString(this._host);
|
|
49
|
+
}
|
|
50
|
+
/** Gets main bar offset in pixels*/
|
|
51
|
+
get barOffsetInPixels() {
|
|
52
|
+
return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
53
|
+
}
|
|
54
|
+
set barOffset(value) {
|
|
55
|
+
if (this._barOffset.toString(this._host) === value) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (this._barOffset.fromString(value)) {
|
|
59
|
+
this._markAsDirty();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Gets or sets thumb width */
|
|
63
|
+
get thumbWidth() {
|
|
64
|
+
return this._thumbWidth.toString(this._host);
|
|
65
|
+
}
|
|
66
|
+
/** Gets thumb width in pixels */
|
|
67
|
+
get thumbWidthInPixels() {
|
|
68
|
+
return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
69
|
+
}
|
|
70
|
+
set thumbWidth(value) {
|
|
71
|
+
if (this._thumbWidth.toString(this._host) === value) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (this._thumbWidth.fromString(value)) {
|
|
75
|
+
this._markAsDirty();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Gets or sets minimum value */
|
|
79
|
+
get minimum() {
|
|
80
|
+
return this._minimum;
|
|
81
|
+
}
|
|
82
|
+
set minimum(value) {
|
|
83
|
+
if (this._minimum === value) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this._minimum = value;
|
|
87
|
+
this._markAsDirty();
|
|
88
|
+
this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
|
|
89
|
+
}
|
|
90
|
+
/** Gets or sets maximum value */
|
|
91
|
+
get maximum() {
|
|
92
|
+
return this._maximum;
|
|
93
|
+
}
|
|
94
|
+
set maximum(value) {
|
|
95
|
+
if (this._maximum === value) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this._maximum = value;
|
|
99
|
+
this._markAsDirty();
|
|
100
|
+
this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
|
|
101
|
+
}
|
|
102
|
+
/** Gets or sets current value */
|
|
103
|
+
get value() {
|
|
104
|
+
return this._value;
|
|
105
|
+
}
|
|
106
|
+
set value(value) {
|
|
107
|
+
value = Math.max(Math.min(value, this._maximum), this._minimum);
|
|
108
|
+
if (this._value === value) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this._value = value;
|
|
112
|
+
this._markAsDirty();
|
|
113
|
+
this.onValueChangedObservable.notifyObservers(this._value, undefined, this, this);
|
|
114
|
+
}
|
|
115
|
+
/**Gets or sets a boolean indicating if the slider should be vertical or horizontal */
|
|
116
|
+
get isVertical() {
|
|
117
|
+
return this._isVertical;
|
|
118
|
+
}
|
|
119
|
+
set isVertical(value) {
|
|
120
|
+
if (this._isVertical === value) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this._isVertical = value;
|
|
124
|
+
this._markAsDirty();
|
|
125
|
+
}
|
|
126
|
+
/** Gets or sets a value indicating if the thumb can go over main bar extends */
|
|
127
|
+
get isThumbClamped() {
|
|
128
|
+
return this._isThumbClamped;
|
|
129
|
+
}
|
|
130
|
+
set isThumbClamped(value) {
|
|
131
|
+
if (this._isThumbClamped === value) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this._isThumbClamped = value;
|
|
135
|
+
this._markAsDirty();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Creates a new BaseSlider
|
|
139
|
+
* @param name defines the control name
|
|
140
|
+
*/
|
|
141
|
+
constructor(name) {
|
|
142
|
+
super(name);
|
|
143
|
+
this.name = (__runInitializers(this, _instanceExtraInitializers), name);
|
|
144
|
+
this._thumbWidth = new ValueAndUnit(20, ValueAndUnit.UNITMODE_PIXEL, false);
|
|
145
|
+
this._minimum = 0;
|
|
146
|
+
this._maximum = 100;
|
|
147
|
+
this._value = 50;
|
|
148
|
+
this._isVertical = false;
|
|
149
|
+
this._barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);
|
|
150
|
+
this._isThumbClamped = false;
|
|
151
|
+
this._displayThumb = true;
|
|
152
|
+
this._step = 0;
|
|
153
|
+
this._lastPointerDownId = -1;
|
|
154
|
+
// Shared rendering info
|
|
155
|
+
this._effectiveBarOffset = 0;
|
|
156
|
+
/** Observable raised when the slider value changes */
|
|
157
|
+
this.onValueChangedObservable = new Observable();
|
|
158
|
+
// Events
|
|
159
|
+
this._pointerIsDown = false;
|
|
160
|
+
this.isPointerBlocker = true;
|
|
161
|
+
}
|
|
162
|
+
_getTypeName() {
|
|
163
|
+
return "BaseSlider";
|
|
164
|
+
}
|
|
165
|
+
_getThumbPosition() {
|
|
166
|
+
if (this.isVertical) {
|
|
167
|
+
return ((this.maximum - this.value) / (this.maximum - this.minimum)) * this._backgroundBoxLength;
|
|
168
|
+
}
|
|
169
|
+
return ((this.value - this.minimum) / (this.maximum - this.minimum)) * this._backgroundBoxLength;
|
|
170
|
+
}
|
|
171
|
+
_getThumbThickness(type) {
|
|
172
|
+
let thumbThickness = 0;
|
|
173
|
+
switch (type) {
|
|
174
|
+
case "circle":
|
|
175
|
+
if (this._thumbWidth.isPixel) {
|
|
176
|
+
thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "rectangle":
|
|
183
|
+
if (this._thumbWidth.isPixel) {
|
|
184
|
+
thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return thumbThickness;
|
|
191
|
+
}
|
|
192
|
+
_prepareRenderingData(type) {
|
|
193
|
+
// Main bar
|
|
194
|
+
this._effectiveBarOffset = 0;
|
|
195
|
+
this._renderLeft = this._currentMeasure.left;
|
|
196
|
+
this._renderTop = this._currentMeasure.top;
|
|
197
|
+
this._renderWidth = this._currentMeasure.width;
|
|
198
|
+
this._renderHeight = this._currentMeasure.height;
|
|
199
|
+
this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height);
|
|
200
|
+
this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height);
|
|
201
|
+
this._effectiveThumbThickness = this._getThumbThickness(type);
|
|
202
|
+
if (this.displayThumb) {
|
|
203
|
+
this._backgroundBoxLength -= this._effectiveThumbThickness;
|
|
204
|
+
}
|
|
205
|
+
//throw error when height is less than width for vertical slider
|
|
206
|
+
if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {
|
|
207
|
+
Logger.Error("Height should be greater than width");
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (this._barOffset.isPixel) {
|
|
211
|
+
this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host);
|
|
215
|
+
}
|
|
216
|
+
this._backgroundBoxThickness -= this._effectiveBarOffset * 2;
|
|
217
|
+
if (this.isVertical) {
|
|
218
|
+
this._renderLeft += this._effectiveBarOffset;
|
|
219
|
+
if (!this.isThumbClamped && this.displayThumb) {
|
|
220
|
+
this._renderTop += this._effectiveThumbThickness / 2;
|
|
221
|
+
}
|
|
222
|
+
this._renderHeight = this._backgroundBoxLength;
|
|
223
|
+
this._renderWidth = this._backgroundBoxThickness;
|
|
164
224
|
}
|
|
165
225
|
else {
|
|
166
|
-
|
|
226
|
+
this._renderTop += this._effectiveBarOffset;
|
|
227
|
+
if (!this.isThumbClamped && this.displayThumb) {
|
|
228
|
+
this._renderLeft += this._effectiveThumbThickness / 2;
|
|
229
|
+
}
|
|
230
|
+
this._renderHeight = this._backgroundBoxThickness;
|
|
231
|
+
this._renderWidth = this._backgroundBoxLength;
|
|
167
232
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
_updateValueFromPointer(x, y) {
|
|
238
|
+
this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
|
|
239
|
+
x = this._transformedPosition.x;
|
|
240
|
+
y = this._transformedPosition.y;
|
|
241
|
+
let value;
|
|
242
|
+
if (this._isVertical) {
|
|
243
|
+
value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum);
|
|
172
244
|
}
|
|
173
245
|
else {
|
|
174
|
-
|
|
246
|
+
value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum);
|
|
247
|
+
}
|
|
248
|
+
this.value = this._step ? Math.round(value / this._step) * this._step : value;
|
|
249
|
+
}
|
|
250
|
+
_onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
|
|
251
|
+
if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
if (this.isReadOnly) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
this._pointerIsDown = true;
|
|
258
|
+
this._updateValueFromPointer(coordinates.x, coordinates.y);
|
|
259
|
+
this._host._capturingControl[pointerId] = this;
|
|
260
|
+
this._lastPointerDownId = pointerId;
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
_onPointerMove(target, coordinates, pointerId, pi) {
|
|
264
|
+
// Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
|
|
265
|
+
if (pointerId != this._lastPointerDownId) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (this._pointerIsDown && !this.isReadOnly) {
|
|
269
|
+
this._updateValueFromPointer(coordinates.x, coordinates.y);
|
|
175
270
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this._renderLeft = this._currentMeasure.left;
|
|
183
|
-
this._renderTop = this._currentMeasure.top;
|
|
184
|
-
this._renderWidth = this._currentMeasure.width;
|
|
185
|
-
this._renderHeight = this._currentMeasure.height;
|
|
186
|
-
this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height);
|
|
187
|
-
this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height);
|
|
188
|
-
this._effectiveThumbThickness = this._getThumbThickness(type);
|
|
189
|
-
if (this.displayThumb) {
|
|
190
|
-
this._backgroundBoxLength -= this._effectiveThumbThickness;
|
|
191
|
-
}
|
|
192
|
-
//throw error when height is less than width for vertical slider
|
|
193
|
-
if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {
|
|
194
|
-
Logger.Error("Height should be greater than width");
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (this._barOffset.isPixel) {
|
|
198
|
-
this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host);
|
|
202
|
-
}
|
|
203
|
-
this._backgroundBoxThickness -= this._effectiveBarOffset * 2;
|
|
204
|
-
if (this.isVertical) {
|
|
205
|
-
this._renderLeft += this._effectiveBarOffset;
|
|
206
|
-
if (!this.isThumbClamped && this.displayThumb) {
|
|
207
|
-
this._renderTop += this._effectiveThumbThickness / 2;
|
|
271
|
+
super._onPointerMove(target, coordinates, pointerId, pi);
|
|
272
|
+
}
|
|
273
|
+
_onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) {
|
|
274
|
+
this._pointerIsDown = false;
|
|
275
|
+
delete this._host._capturingControl[pointerId];
|
|
276
|
+
super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
|
|
208
277
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
else {
|
|
213
|
-
this._renderTop += this._effectiveBarOffset;
|
|
214
|
-
if (!this.isThumbClamped && this.displayThumb) {
|
|
215
|
-
this._renderLeft += this._effectiveThumbThickness / 2;
|
|
278
|
+
_onCanvasBlur() {
|
|
279
|
+
this._forcePointerUp();
|
|
280
|
+
super._onCanvasBlur();
|
|
216
281
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
this._pointerIsDown = true;
|
|
245
|
-
this._updateValueFromPointer(coordinates.x, coordinates.y);
|
|
246
|
-
this._host._capturingControl[pointerId] = this;
|
|
247
|
-
this._lastPointerDownId = pointerId;
|
|
248
|
-
return true;
|
|
249
|
-
}
|
|
250
|
-
_onPointerMove(target, coordinates, pointerId, pi) {
|
|
251
|
-
// Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
|
|
252
|
-
if (pointerId != this._lastPointerDownId) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
if (this._pointerIsDown && !this.isReadOnly) {
|
|
256
|
-
this._updateValueFromPointer(coordinates.x, coordinates.y);
|
|
257
|
-
}
|
|
258
|
-
super._onPointerMove(target, coordinates, pointerId, pi);
|
|
259
|
-
}
|
|
260
|
-
_onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) {
|
|
261
|
-
this._pointerIsDown = false;
|
|
262
|
-
delete this._host._capturingControl[pointerId];
|
|
263
|
-
super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
|
|
264
|
-
}
|
|
265
|
-
_onCanvasBlur() {
|
|
266
|
-
this._forcePointerUp();
|
|
267
|
-
super._onCanvasBlur();
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
__decorate([
|
|
271
|
-
serialize()
|
|
272
|
-
], BaseSlider.prototype, "displayThumb", null);
|
|
273
|
-
__decorate([
|
|
274
|
-
serialize()
|
|
275
|
-
], BaseSlider.prototype, "step", null);
|
|
276
|
-
__decorate([
|
|
277
|
-
serialize()
|
|
278
|
-
], BaseSlider.prototype, "barOffset", null);
|
|
279
|
-
__decorate([
|
|
280
|
-
serialize()
|
|
281
|
-
], BaseSlider.prototype, "thumbWidth", null);
|
|
282
|
-
__decorate([
|
|
283
|
-
serialize()
|
|
284
|
-
], BaseSlider.prototype, "minimum", null);
|
|
285
|
-
__decorate([
|
|
286
|
-
serialize()
|
|
287
|
-
], BaseSlider.prototype, "maximum", null);
|
|
288
|
-
__decorate([
|
|
289
|
-
serialize()
|
|
290
|
-
], BaseSlider.prototype, "value", null);
|
|
291
|
-
__decorate([
|
|
292
|
-
serialize()
|
|
293
|
-
], BaseSlider.prototype, "isVertical", null);
|
|
294
|
-
__decorate([
|
|
295
|
-
serialize()
|
|
296
|
-
], BaseSlider.prototype, "isThumbClamped", null);
|
|
282
|
+
},
|
|
283
|
+
(() => {
|
|
284
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
285
|
+
_get_displayThumb_decorators = [serialize()];
|
|
286
|
+
_get_step_decorators = [serialize()];
|
|
287
|
+
_get_barOffset_decorators = [serialize()];
|
|
288
|
+
_get_thumbWidth_decorators = [serialize()];
|
|
289
|
+
_get_minimum_decorators = [serialize()];
|
|
290
|
+
_get_maximum_decorators = [serialize()];
|
|
291
|
+
_get_value_decorators = [serialize()];
|
|
292
|
+
_get_isVertical_decorators = [serialize()];
|
|
293
|
+
_get_isThumbClamped_decorators = [serialize()];
|
|
294
|
+
__esDecorate(_a, null, _get_displayThumb_decorators, { kind: "getter", name: "displayThumb", static: false, private: false, access: { has: obj => "displayThumb" in obj, get: obj => obj.displayThumb }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
295
|
+
__esDecorate(_a, null, _get_step_decorators, { kind: "getter", name: "step", static: false, private: false, access: { has: obj => "step" in obj, get: obj => obj.step }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
296
|
+
__esDecorate(_a, null, _get_barOffset_decorators, { kind: "getter", name: "barOffset", static: false, private: false, access: { has: obj => "barOffset" in obj, get: obj => obj.barOffset }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
297
|
+
__esDecorate(_a, null, _get_thumbWidth_decorators, { kind: "getter", name: "thumbWidth", static: false, private: false, access: { has: obj => "thumbWidth" in obj, get: obj => obj.thumbWidth }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
298
|
+
__esDecorate(_a, null, _get_minimum_decorators, { kind: "getter", name: "minimum", static: false, private: false, access: { has: obj => "minimum" in obj, get: obj => obj.minimum }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
299
|
+
__esDecorate(_a, null, _get_maximum_decorators, { kind: "getter", name: "maximum", static: false, private: false, access: { has: obj => "maximum" in obj, get: obj => obj.maximum }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
300
|
+
__esDecorate(_a, null, _get_value_decorators, { kind: "getter", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
301
|
+
__esDecorate(_a, null, _get_isVertical_decorators, { kind: "getter", name: "isVertical", static: false, private: false, access: { has: obj => "isVertical" in obj, get: obj => obj.isVertical }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
302
|
+
__esDecorate(_a, null, _get_isThumbClamped_decorators, { kind: "getter", name: "isThumbClamped", static: false, private: false, access: { has: obj => "isThumbClamped" in obj, get: obj => obj.isThumbClamped }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
303
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
304
|
+
})(),
|
|
305
|
+
_a;
|
|
306
|
+
})();
|
|
307
|
+
export { BaseSlider };
|
|
297
308
|
//# sourceMappingURL=baseSlider.js.map
|