@eva/plugin-ui 2.1.0-beta.2 → 2.1.0-beta.4
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/dist/EVA.plugin.ui.js +409 -245
- package/dist/EVA.plugin.ui.min.js +1 -1
- package/dist/plugin-ui.cjs.js +120 -10
- package/dist/plugin-ui.cjs.prod.js +1 -1
- package/dist/plugin-ui.d.ts +2 -0
- package/dist/plugin-ui.esm.js +120 -10
- package/package.json +4 -4
package/dist/EVA.plugin.ui.js
CHANGED
|
@@ -950,7 +950,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
950
950
|
const exID = this.active;
|
|
951
951
|
this.forceSwitch(id);
|
|
952
952
|
if (exID !== this.active) {
|
|
953
|
-
|
|
953
|
+
var _this$active;
|
|
954
|
+
const res = this.views.length > 2 ? (_this$active = this.active) != null ? _this$active : 0 : this.active === 1;
|
|
954
955
|
this.onChange.emit(res);
|
|
955
956
|
}
|
|
956
957
|
}
|
|
@@ -997,15 +998,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
997
998
|
var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
998
999
|
class CheckBox$1 extends Switcher$1 {
|
|
999
1000
|
constructor(options) {
|
|
1001
|
+
var _options$TextClass, _options$text, _options$checked;
|
|
1000
1002
|
super();
|
|
1001
1003
|
__publicField$h(this, "labelText");
|
|
1002
1004
|
__publicField$h(this, "onCheck");
|
|
1003
1005
|
__publicField$h(this, "_style");
|
|
1004
1006
|
__publicField$h(this, "_textClass");
|
|
1005
|
-
this._textClass = options.TextClass
|
|
1006
|
-
this.text = options.text
|
|
1007
|
+
this._textClass = (_options$TextClass = options.TextClass) != null ? _options$TextClass : pixi_js.Text;
|
|
1008
|
+
this.text = (_options$text = options.text) != null ? _options$text : "";
|
|
1007
1009
|
this.style = options.style;
|
|
1008
|
-
this.checked = options.checked
|
|
1010
|
+
this.checked = (_options$checked = options.checked) != null ? _options$checked : false;
|
|
1009
1011
|
this.triggerEvents = ["onPress"];
|
|
1010
1012
|
this.innerView.cursor = "pointer";
|
|
1011
1013
|
this.onCheck = new dist.Signal();
|
|
@@ -1015,8 +1017,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
1015
1017
|
var _this$_style;
|
|
1016
1018
|
if (!text) return;
|
|
1017
1019
|
this.labelText = new this._textClass({
|
|
1018
|
-
text: text
|
|
1019
|
-
style: style
|
|
1020
|
+
text: text != null ? text : "",
|
|
1021
|
+
style: style != null ? style : (_this$_style = this._style) === null || _this$_style === void 0 ? void 0 : _this$_style.text
|
|
1020
1022
|
});
|
|
1021
1023
|
this.addChild(this.labelText);
|
|
1022
1024
|
this.labelText.cursor = "pointer";
|
|
@@ -1040,8 +1042,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
1040
1042
|
this.alignText();
|
|
1041
1043
|
}
|
|
1042
1044
|
get text() {
|
|
1043
|
-
var _this$labelText;
|
|
1044
|
-
return ((_this$labelText = this.labelText) === null || _this$labelText === void 0 ? void 0 : _this$labelText.text)
|
|
1045
|
+
var _this$labelText$text, _this$labelText;
|
|
1046
|
+
return (_this$labelText$text = (_this$labelText = this.labelText) === null || _this$labelText === void 0 ? void 0 : _this$labelText.text) != null ? _this$labelText$text : "";
|
|
1045
1047
|
}
|
|
1046
1048
|
set style(style) {
|
|
1047
1049
|
const wasChecked = this.checked;
|
|
@@ -1076,9 +1078,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
1076
1078
|
if (!this.views) return;
|
|
1077
1079
|
const uncheckedView = this.views[0];
|
|
1078
1080
|
if (uncheckedView) {
|
|
1079
|
-
var _this$_style2, _this$_style2$textOff, _this$_style3, _this$_style3$textOff;
|
|
1080
|
-
this.labelText.x = uncheckedView.width + 10 + (((_this$_style2 = this._style) === null || _this$_style2 === void 0 ? void 0 : (_this$_style2$textOff = _this$_style2.textOffset) === null || _this$_style2$textOff === void 0 ? void 0 : _this$_style2$textOff.x)
|
|
1081
|
-
this.labelText.y = (uncheckedView.height - this.labelText.height) / 2 + (((_this$_style3 = this._style) === null || _this$_style3 === void 0 ? void 0 : (_this$_style3$textOff = _this$_style3.textOffset) === null || _this$_style3$textOff === void 0 ? void 0 : _this$_style3$textOff.y)
|
|
1081
|
+
var _this$_style$textOffs, _this$_style2, _this$_style2$textOff, _this$_style$textOffs2, _this$_style3, _this$_style3$textOff;
|
|
1082
|
+
this.labelText.x = uncheckedView.width + 10 + ((_this$_style$textOffs = (_this$_style2 = this._style) === null || _this$_style2 === void 0 ? void 0 : (_this$_style2$textOff = _this$_style2.textOffset) === null || _this$_style2$textOff === void 0 ? void 0 : _this$_style2$textOff.x) != null ? _this$_style$textOffs : 0);
|
|
1083
|
+
this.labelText.y = (uncheckedView.height - this.labelText.height) / 2 + ((_this$_style$textOffs2 = (_this$_style3 = this._style) === null || _this$_style3 === void 0 ? void 0 : (_this$_style3$textOff = _this$_style3.textOffset) === null || _this$_style3$textOff === void 0 ? void 0 : _this$_style3$textOff.y) != null ? _this$_style$textOffs2 : 0);
|
|
1082
1084
|
}
|
|
1083
1085
|
}
|
|
1084
1086
|
get checked() {
|
|
@@ -1107,7 +1109,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
1107
1109
|
__publicField$g(this, "bgCircle", new pixi_js.Graphics());
|
|
1108
1110
|
__publicField$g(this, "fillCircle", new pixi_js.Graphics());
|
|
1109
1111
|
__publicField$g(this, "innerView", new pixi_js.Container());
|
|
1110
|
-
this.options = options
|
|
1112
|
+
this.options = options != null ? options : {};
|
|
1111
1113
|
this.addChild(this.innerView);
|
|
1112
1114
|
this.innerView.addChild(this.bgCircle, this.fillCircle);
|
|
1113
1115
|
this.addBackground();
|
|
@@ -2469,6 +2471,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2469
2471
|
var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2470
2472
|
class FancyButton$1 extends ButtonContainer {
|
|
2471
2473
|
constructor(options) {
|
|
2474
|
+
var _ref, _ref2;
|
|
2472
2475
|
super();
|
|
2473
2476
|
__publicField$f(this, "animations");
|
|
2474
2477
|
__publicField$f(this, "originalInnerViewState");
|
|
@@ -2498,7 +2501,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2498
2501
|
x: 0.5,
|
|
2499
2502
|
y: 0.5
|
|
2500
2503
|
});
|
|
2501
|
-
this.options = options
|
|
2504
|
+
this.options = options != null ? options : {};
|
|
2502
2505
|
const {
|
|
2503
2506
|
defaultView,
|
|
2504
2507
|
hoverView,
|
|
@@ -2519,33 +2522,33 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2519
2522
|
anchorY,
|
|
2520
2523
|
icon,
|
|
2521
2524
|
animations
|
|
2522
|
-
} = options
|
|
2525
|
+
} = options != null ? options : {};
|
|
2523
2526
|
this.addChild(this.innerView);
|
|
2524
2527
|
this.anchor = new pixi_js.ObservablePoint({
|
|
2525
2528
|
_onUpdate: () => this.updateAnchor()
|
|
2526
2529
|
});
|
|
2527
|
-
this.anchor.set(anchorX
|
|
2528
|
-
this.padding = padding
|
|
2529
|
-
this.offset = offset
|
|
2530
|
-
this.textOffset = textOffset
|
|
2531
|
-
this.iconOffset = iconOffset
|
|
2532
|
-
this.defaultTextScale = textScale
|
|
2530
|
+
this.anchor.set((_ref = anchorX != null ? anchorX : anchor) != null ? _ref : 0, (_ref2 = anchorY != null ? anchorY : anchor) != null ? _ref2 : 0);
|
|
2531
|
+
this.padding = padding != null ? padding : 0;
|
|
2532
|
+
this.offset = offset != null ? offset : {};
|
|
2533
|
+
this.textOffset = textOffset != null ? textOffset : {};
|
|
2534
|
+
this.iconOffset = iconOffset != null ? iconOffset : {};
|
|
2535
|
+
this.defaultTextScale = textScale != null ? textScale : {
|
|
2533
2536
|
x: 1,
|
|
2534
2537
|
y: 1
|
|
2535
2538
|
};
|
|
2536
|
-
this.defaultIconScale = iconScale
|
|
2539
|
+
this.defaultIconScale = iconScale != null ? iconScale : {
|
|
2537
2540
|
x: 1,
|
|
2538
2541
|
y: 1
|
|
2539
2542
|
};
|
|
2540
|
-
this.defaultTextAnchor = textAnchor
|
|
2543
|
+
this.defaultTextAnchor = textAnchor != null ? textAnchor : {
|
|
2541
2544
|
x: 0.5,
|
|
2542
2545
|
y: 0.5
|
|
2543
2546
|
};
|
|
2544
|
-
this.defaultIconAnchor = iconAnchor
|
|
2547
|
+
this.defaultIconAnchor = iconAnchor != null ? iconAnchor : {
|
|
2545
2548
|
x: 0.5,
|
|
2546
2549
|
y: 0.5
|
|
2547
2550
|
};
|
|
2548
|
-
this.scale.set(scale
|
|
2551
|
+
this.scale.set(scale != null ? scale : 1);
|
|
2549
2552
|
if (animations) {
|
|
2550
2553
|
this.animations = animations;
|
|
2551
2554
|
this.setOriginalInnerViewState();
|
|
@@ -2556,7 +2559,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2556
2559
|
this.hoverView = hoverView;
|
|
2557
2560
|
this.pressedView = pressedView;
|
|
2558
2561
|
this.disabledView = disabledView;
|
|
2559
|
-
this.text = text
|
|
2562
|
+
this.text = text != null ? text : "";
|
|
2560
2563
|
if (icon !== void 0) {
|
|
2561
2564
|
this.iconView = icon;
|
|
2562
2565
|
}
|
|
@@ -2622,37 +2625,42 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2622
2625
|
};
|
|
2623
2626
|
const defaultStateOffset = offset === null || offset === void 0 ? void 0 : offset.default;
|
|
2624
2627
|
if (stateOffset) {
|
|
2625
|
-
|
|
2626
|
-
view.
|
|
2628
|
+
var _stateOffset$x, _stateOffset$y;
|
|
2629
|
+
view.x += (_stateOffset$x = stateOffset.x) != null ? _stateOffset$x : 0;
|
|
2630
|
+
view.y += (_stateOffset$y = stateOffset.y) != null ? _stateOffset$y : 0;
|
|
2627
2631
|
} else if (defaultStateOffset) {
|
|
2628
|
-
|
|
2629
|
-
view.
|
|
2632
|
+
var _defaultStateOffset$x, _defaultStateOffset$y;
|
|
2633
|
+
view.x += (_defaultStateOffset$x = defaultStateOffset.x) != null ? _defaultStateOffset$x : 0;
|
|
2634
|
+
view.y += (_defaultStateOffset$y = defaultStateOffset.y) != null ? _defaultStateOffset$y : 0;
|
|
2630
2635
|
} else if (offset.x || offset.y) {
|
|
2631
|
-
|
|
2632
|
-
view.
|
|
2636
|
+
var _offset$x, _offset$y;
|
|
2637
|
+
view.x += (_offset$x = offset.x) != null ? _offset$x : 0;
|
|
2638
|
+
view.y += (_offset$y = offset.y) != null ? _offset$y : 0;
|
|
2633
2639
|
}
|
|
2634
2640
|
}
|
|
2635
2641
|
getStateView(state) {
|
|
2642
|
+
var _ref3, _this$_views$hoverVie, _ref4, _ref5, _this$_views$pressedV, _ref6, _this$_views$disabled, _this$_views$defaultV;
|
|
2636
2643
|
if (!this._views) return void 0;
|
|
2637
2644
|
switch (state) {
|
|
2638
2645
|
case "hover":
|
|
2639
|
-
return this._views.hoverView
|
|
2646
|
+
return (_ref3 = (_this$_views$hoverVie = this._views.hoverView) != null ? _this$_views$hoverVie : this._views.defaultView) != null ? _ref3 : void 0;
|
|
2640
2647
|
case "pressed":
|
|
2641
|
-
return this._views.pressedView
|
|
2648
|
+
return (_ref4 = (_ref5 = (_this$_views$pressedV = this._views.pressedView) != null ? _this$_views$pressedV : this._views.hoverView) != null ? _ref5 : this._views.defaultView) != null ? _ref4 : void 0;
|
|
2642
2649
|
case "disabled":
|
|
2643
|
-
return this._views.disabledView
|
|
2650
|
+
return (_ref6 = (_this$_views$disabled = this._views.disabledView) != null ? _this$_views$disabled : this._views.defaultView) != null ? _ref6 : void 0;
|
|
2644
2651
|
case "default":
|
|
2645
|
-
return this._views.defaultView
|
|
2652
|
+
return (_this$_views$defaultV = this._views.defaultView) != null ? _this$_views$defaultV : void 0;
|
|
2646
2653
|
default:
|
|
2647
2654
|
return void 0;
|
|
2648
2655
|
}
|
|
2649
2656
|
}
|
|
2650
2657
|
adjustTextView(state) {
|
|
2658
|
+
var _this$_defaultTextAnc, _this$_defaultTextAnc2;
|
|
2651
2659
|
if (!this.text) return;
|
|
2652
2660
|
if (!this._views.textView) return;
|
|
2653
2661
|
const activeView = this.getStateView(this.state);
|
|
2654
|
-
const anchorX = this._defaultTextAnchor.x
|
|
2655
|
-
const anchorY = this._defaultTextAnchor.y
|
|
2662
|
+
const anchorX = (_this$_defaultTextAnc = this._defaultTextAnchor.x) != null ? _this$_defaultTextAnc : 0.5;
|
|
2663
|
+
const anchorY = (_this$_defaultTextAnc2 = this._defaultTextAnchor.y) != null ? _this$_defaultTextAnc2 : 0.5;
|
|
2656
2664
|
if (activeView) {
|
|
2657
2665
|
var _this$options2;
|
|
2658
2666
|
if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.ignoreRefitting)) {
|
|
@@ -2662,13 +2670,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2662
2670
|
fitToView(activeView, this._views.textView, this.padding, false);
|
|
2663
2671
|
}
|
|
2664
2672
|
if (this.contentFittingMode === "fill") {
|
|
2673
|
+
var _this$_defaultTextSca, _this$_defaultTextSca2;
|
|
2665
2674
|
this._views.textView.scale.set(1);
|
|
2666
2675
|
const availableWidth = activeView.width - this.padding * 2;
|
|
2667
2676
|
const availableHeight = activeView.height - this.padding * 2;
|
|
2668
2677
|
const targetScaleX = availableWidth / this._views.textView.width;
|
|
2669
2678
|
const targetScaleY = availableHeight / this._views.textView.height;
|
|
2670
2679
|
const scale = Math.min(targetScaleX, targetScaleY);
|
|
2671
|
-
this._views.textView.scale.set(scale * (this._defaultTextScale.x
|
|
2680
|
+
this._views.textView.scale.set(scale * ((_this$_defaultTextSca = this._defaultTextScale.x) != null ? _this$_defaultTextSca : 1), scale * ((_this$_defaultTextSca2 = this._defaultTextScale.y) != null ? _this$_defaultTextSca2 : 1));
|
|
2672
2681
|
}
|
|
2673
2682
|
this._views.textView.x = activeView.x + activeView.width / 2;
|
|
2674
2683
|
this._views.textView.y = activeView.y + activeView.height / 2;
|
|
@@ -2677,7 +2686,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2677
2686
|
this.setOffset(this._views.textView, state, this.textOffset);
|
|
2678
2687
|
}
|
|
2679
2688
|
adjustIconView(state) {
|
|
2680
|
-
var _this$options3;
|
|
2689
|
+
var _this$options3, _this$_defaultIconAnc, _this$_defaultIconAnc2;
|
|
2681
2690
|
if (!this._views.iconView) {
|
|
2682
2691
|
return;
|
|
2683
2692
|
}
|
|
@@ -2692,16 +2701,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2692
2701
|
fitToView(activeView, this._views.iconView, this.padding, false);
|
|
2693
2702
|
}
|
|
2694
2703
|
if (this.contentFittingMode === "fill") {
|
|
2704
|
+
var _this$_defaultIconSca, _this$_defaultIconSca2;
|
|
2695
2705
|
this._views.iconView.scale.set(1);
|
|
2696
2706
|
const availableWidth = activeView.width - this.padding * 2;
|
|
2697
2707
|
const availableHeight = activeView.height - this.padding * 2;
|
|
2698
2708
|
const targetScaleX = availableWidth / this._views.iconView.width;
|
|
2699
2709
|
const targetScaleY = availableHeight / this._views.iconView.height;
|
|
2700
2710
|
const scale = Math.min(targetScaleX, targetScaleY);
|
|
2701
|
-
this._views.iconView.scale.set(scale * (this._defaultIconScale.x
|
|
2711
|
+
this._views.iconView.scale.set(scale * ((_this$_defaultIconSca = this._defaultIconScale.x) != null ? _this$_defaultIconSca : 1), scale * ((_this$_defaultIconSca2 = this._defaultIconScale.y) != null ? _this$_defaultIconSca2 : 1));
|
|
2702
2712
|
}
|
|
2703
|
-
const anchorX = this._defaultIconAnchor.x
|
|
2704
|
-
const anchorY = this._defaultIconAnchor.y
|
|
2713
|
+
const anchorX = (_this$_defaultIconAnc = this._defaultIconAnchor.x) != null ? _this$_defaultIconAnc : 0.5;
|
|
2714
|
+
const anchorY = (_this$_defaultIconAnc2 = this._defaultIconAnchor.y) != null ? _this$_defaultIconAnc2 : 0.5;
|
|
2705
2715
|
if ("anchor" in this._views.iconView) {
|
|
2706
2716
|
this._views.iconView.anchor.set(anchorX, anchorY);
|
|
2707
2717
|
} else {
|
|
@@ -2712,9 +2722,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2712
2722
|
this.setOffset(this._views.iconView, state, this.iconOffset);
|
|
2713
2723
|
}
|
|
2714
2724
|
updateAnchor() {
|
|
2725
|
+
var _this$anchor$x, _this$anchor$y;
|
|
2715
2726
|
if (!this._views) return;
|
|
2716
|
-
const anchorX = this.anchor.x
|
|
2717
|
-
const anchorY = this.anchor.y
|
|
2727
|
+
const anchorX = (_this$anchor$x = this.anchor.x) != null ? _this$anchor$x : 0;
|
|
2728
|
+
const anchorY = (_this$anchor$y = this.anchor.y) != null ? _this$anchor$y : 0;
|
|
2718
2729
|
const views = [this._views.defaultView, this._views.hoverView, this._views.pressedView, this._views.disabledView];
|
|
2719
2730
|
views.forEach(view => {
|
|
2720
2731
|
var _view$anchor;
|
|
@@ -2739,7 +2750,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2739
2750
|
this.options.contentFittingMode = mode;
|
|
2740
2751
|
}
|
|
2741
2752
|
get contentFittingMode() {
|
|
2742
|
-
|
|
2753
|
+
var _this$options$content;
|
|
2754
|
+
return (_this$options$content = this.options.contentFittingMode) != null ? _this$options$content : "default";
|
|
2743
2755
|
}
|
|
2744
2756
|
set defaultView(view) {
|
|
2745
2757
|
this.updateView("defaultView", view);
|
|
@@ -2862,11 +2874,13 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2862
2874
|
return this._views.iconView;
|
|
2863
2875
|
}
|
|
2864
2876
|
playAnimations(state) {
|
|
2877
|
+
var _this$animations$stat;
|
|
2865
2878
|
if (!this.animations) return;
|
|
2866
|
-
const stateAnimation = this.animations[state]
|
|
2879
|
+
const stateAnimation = (_this$animations$stat = this.animations[state]) != null ? _this$animations$stat : this.animations.default;
|
|
2867
2880
|
if (stateAnimation) {
|
|
2881
|
+
var _data$duration;
|
|
2868
2882
|
const data = stateAnimation;
|
|
2869
|
-
this.defaultDuration = data.duration
|
|
2883
|
+
this.defaultDuration = (_data$duration = data.duration) != null ? _data$duration : this.defaultDuration;
|
|
2870
2884
|
new Tween(this.innerView).to(data.props, data.duration).start();
|
|
2871
2885
|
return;
|
|
2872
2886
|
}
|
|
@@ -2886,13 +2900,13 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2886
2900
|
};
|
|
2887
2901
|
const defaultStateAnimation = (_this$animations = this.animations) === null || _this$animations === void 0 ? void 0 : _this$animations.default;
|
|
2888
2902
|
if (defaultStateAnimation) {
|
|
2889
|
-
var _defaultStateAnimatio, _this$originalInnerVi,
|
|
2890
|
-
this.innerView.x = defaultStateAnimation.props.x
|
|
2891
|
-
this.innerView.y = defaultStateAnimation.props.y
|
|
2892
|
-
this.innerView.width = defaultStateAnimation.props.width
|
|
2893
|
-
this.innerView.height = defaultStateAnimation.props.height
|
|
2894
|
-
this.innerView.scale.x = ((
|
|
2895
|
-
this.innerView.scale.y = ((
|
|
2903
|
+
var _ref7, _defaultStateAnimatio, _ref8, _defaultStateAnimatio2, _ref9, _defaultStateAnimatio3, _ref0, _defaultStateAnimatio4, _ref1, _defaultStateAnimatio5, _defaultStateAnimatio6, _this$originalInnerVi, _ref10, _defaultStateAnimatio7, _defaultStateAnimatio8, _this$originalInnerVi2;
|
|
2904
|
+
this.innerView.x = (_ref7 = (_defaultStateAnimatio = defaultStateAnimation.props.x) != null ? _defaultStateAnimatio : this.originalInnerViewState.x) != null ? _ref7 : 0;
|
|
2905
|
+
this.innerView.y = (_ref8 = (_defaultStateAnimatio2 = defaultStateAnimation.props.y) != null ? _defaultStateAnimatio2 : this.originalInnerViewState.y) != null ? _ref8 : 0;
|
|
2906
|
+
this.innerView.width = (_ref9 = (_defaultStateAnimatio3 = defaultStateAnimation.props.width) != null ? _defaultStateAnimatio3 : this.originalInnerViewState.width) != null ? _ref9 : 0;
|
|
2907
|
+
this.innerView.height = (_ref0 = (_defaultStateAnimatio4 = defaultStateAnimation.props.height) != null ? _defaultStateAnimatio4 : this.originalInnerViewState.height) != null ? _ref0 : 0;
|
|
2908
|
+
this.innerView.scale.x = (_ref1 = (_defaultStateAnimatio5 = (_defaultStateAnimatio6 = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio6 === void 0 ? void 0 : _defaultStateAnimatio6.x) != null ? _defaultStateAnimatio5 : (_this$originalInnerVi = this.originalInnerViewState.scale) === null || _this$originalInnerVi === void 0 ? void 0 : _this$originalInnerVi.x) != null ? _ref1 : 1;
|
|
2909
|
+
this.innerView.scale.y = (_ref10 = (_defaultStateAnimatio7 = (_defaultStateAnimatio8 = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio8 === void 0 ? void 0 : _defaultStateAnimatio8.y) != null ? _defaultStateAnimatio7 : (_this$originalInnerVi2 = this.originalInnerViewState.scale) === null || _this$originalInnerVi2 === void 0 ? void 0 : _this$originalInnerVi2.y) != null ? _ref10 : 1;
|
|
2896
2910
|
}
|
|
2897
2911
|
}
|
|
2898
2912
|
initStateControl() {
|
|
@@ -2942,44 +2956,48 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
2942
2956
|
return this._textOffset;
|
|
2943
2957
|
}
|
|
2944
2958
|
set defaultTextScale(scale) {
|
|
2959
|
+
var _scale$x, _scale$y;
|
|
2945
2960
|
if (scale === void 0) return;
|
|
2946
2961
|
this.options.defaultTextScale = scale;
|
|
2947
2962
|
const isNumber = typeof scale === "number";
|
|
2948
|
-
this._defaultTextScale.x = isNumber ? scale : scale.x
|
|
2949
|
-
this._defaultTextScale.y = isNumber ? scale : scale.y
|
|
2963
|
+
this._defaultTextScale.x = isNumber ? scale : (_scale$x = scale.x) != null ? _scale$x : 1;
|
|
2964
|
+
this._defaultTextScale.y = isNumber ? scale : (_scale$y = scale.y) != null ? _scale$y : 1;
|
|
2950
2965
|
this.adjustTextView(this.state);
|
|
2951
2966
|
}
|
|
2952
2967
|
get defaultTextScale() {
|
|
2953
2968
|
return this.defaultTextScale;
|
|
2954
2969
|
}
|
|
2955
2970
|
set defaultIconScale(scale) {
|
|
2971
|
+
var _scale$x2, _scale$y2;
|
|
2956
2972
|
if (scale === void 0) return;
|
|
2957
2973
|
this.options.defaultIconScale = scale;
|
|
2958
2974
|
const isNumber = typeof scale === "number";
|
|
2959
|
-
this._defaultIconScale.x = isNumber ? scale : scale.x
|
|
2960
|
-
this._defaultIconScale.y = isNumber ? scale : scale.y
|
|
2975
|
+
this._defaultIconScale.x = isNumber ? scale : (_scale$x2 = scale.x) != null ? _scale$x2 : 1;
|
|
2976
|
+
this._defaultIconScale.y = isNumber ? scale : (_scale$y2 = scale.y) != null ? _scale$y2 : 1;
|
|
2961
2977
|
this.adjustIconView(this.state);
|
|
2962
2978
|
}
|
|
2963
2979
|
get defaultIconScale() {
|
|
2964
2980
|
return this.defaultIconScale;
|
|
2965
2981
|
}
|
|
2966
2982
|
set defaultTextAnchor(anchor) {
|
|
2983
|
+
var _anchor$x, _anchor$y;
|
|
2967
2984
|
if (anchor === void 0) return;
|
|
2968
2985
|
this.options.defaultTextAnchor = anchor;
|
|
2969
2986
|
const isNumber = typeof anchor === "number";
|
|
2970
|
-
this._defaultTextAnchor.x = isNumber ? anchor : anchor.x
|
|
2971
|
-
this._defaultTextAnchor.y = isNumber ? anchor : anchor.y
|
|
2987
|
+
this._defaultTextAnchor.x = isNumber ? anchor : (_anchor$x = anchor.x) != null ? _anchor$x : 1;
|
|
2988
|
+
this._defaultTextAnchor.y = isNumber ? anchor : (_anchor$y = anchor.y) != null ? _anchor$y : 1;
|
|
2972
2989
|
this.adjustTextView(this.state);
|
|
2973
2990
|
}
|
|
2974
2991
|
get defaultTextAnchor() {
|
|
2975
2992
|
return this.defaultTextAnchor;
|
|
2976
2993
|
}
|
|
2977
2994
|
set defaultIconAnchor(anchor) {
|
|
2995
|
+
var _anchor$x2, _anchor$y2;
|
|
2978
2996
|
if (anchor === void 0) return;
|
|
2979
2997
|
this.options.defaultIconAnchor = anchor;
|
|
2980
2998
|
const isNumber = typeof anchor === "number";
|
|
2981
|
-
this._defaultIconAnchor.x = isNumber ? anchor : anchor.x
|
|
2982
|
-
this._defaultIconAnchor.y = isNumber ? anchor : anchor.y
|
|
2999
|
+
this._defaultIconAnchor.x = isNumber ? anchor : (_anchor$x2 = anchor.x) != null ? _anchor$x2 : 1;
|
|
3000
|
+
this._defaultIconAnchor.y = isNumber ? anchor : (_anchor$y2 = anchor.y) != null ? _anchor$y2 : 1;
|
|
2983
3001
|
this.adjustIconView(this.state);
|
|
2984
3002
|
}
|
|
2985
3003
|
get defaultIconAnchor() {
|
|
@@ -3106,8 +3124,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3106
3124
|
this.arrangeChildren();
|
|
3107
3125
|
}
|
|
3108
3126
|
get elementsMargin() {
|
|
3109
|
-
var _this$options9;
|
|
3110
|
-
return ((_this$options9 = this.options) === null || _this$options9 === void 0 ? void 0 : _this$options9.elementsMargin)
|
|
3127
|
+
var _this$options$element, _this$options9;
|
|
3128
|
+
return (_this$options$element = (_this$options9 = this.options) === null || _this$options9 === void 0 ? void 0 : _this$options9.elementsMargin) != null ? _this$options$element : 0;
|
|
3111
3129
|
}
|
|
3112
3130
|
set padding(padding) {
|
|
3113
3131
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3121,8 +3139,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3121
3139
|
this.arrangeChildren();
|
|
3122
3140
|
}
|
|
3123
3141
|
get padding() {
|
|
3124
|
-
var _this$options0;
|
|
3125
|
-
return ((_this$options0 = this.options) === null || _this$options0 === void 0 ? void 0 : _this$options0.padding)
|
|
3142
|
+
var _this$options$padding, _this$options0;
|
|
3143
|
+
return (_this$options$padding = (_this$options0 = this.options) === null || _this$options0 === void 0 ? void 0 : _this$options0.padding) != null ? _this$options$padding : 0;
|
|
3126
3144
|
}
|
|
3127
3145
|
set vertPadding(padding) {
|
|
3128
3146
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3132,8 +3150,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3132
3150
|
this.arrangeChildren();
|
|
3133
3151
|
}
|
|
3134
3152
|
get vertPadding() {
|
|
3135
|
-
var _this$options1;
|
|
3136
|
-
return ((_this$options1 = this.options) === null || _this$options1 === void 0 ? void 0 : _this$options1.vertPadding)
|
|
3153
|
+
var _ref11, _this$options$vertPad, _this$options1;
|
|
3154
|
+
return (_ref11 = (_this$options$vertPad = (_this$options1 = this.options) === null || _this$options1 === void 0 ? void 0 : _this$options1.vertPadding) != null ? _this$options$vertPad : this.padding) != null ? _ref11 : 0;
|
|
3137
3155
|
}
|
|
3138
3156
|
set horPadding(padding) {
|
|
3139
3157
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3143,8 +3161,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3143
3161
|
this.arrangeChildren();
|
|
3144
3162
|
}
|
|
3145
3163
|
get horPadding() {
|
|
3146
|
-
var _this$options10;
|
|
3147
|
-
return ((_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.horPadding)
|
|
3164
|
+
var _ref12, _this$options$horPadd, _this$options10;
|
|
3165
|
+
return (_ref12 = (_this$options$horPadd = (_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.horPadding) != null ? _this$options$horPadd : this.padding) != null ? _ref12 : 0;
|
|
3148
3166
|
}
|
|
3149
3167
|
set leftPadding(padding) {
|
|
3150
3168
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3152,8 +3170,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3152
3170
|
this.arrangeChildren();
|
|
3153
3171
|
}
|
|
3154
3172
|
get leftPadding() {
|
|
3155
|
-
var _this$options11;
|
|
3156
|
-
return ((_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.leftPadding)
|
|
3173
|
+
var _this$options$leftPad, _this$options11;
|
|
3174
|
+
return (_this$options$leftPad = (_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.leftPadding) != null ? _this$options$leftPad : this.horPadding;
|
|
3157
3175
|
}
|
|
3158
3176
|
set rightPadding(padding) {
|
|
3159
3177
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3161,8 +3179,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3161
3179
|
this.arrangeChildren();
|
|
3162
3180
|
}
|
|
3163
3181
|
get rightPadding() {
|
|
3164
|
-
var _this$options12;
|
|
3165
|
-
return ((_this$options12 = this.options) === null || _this$options12 === void 0 ? void 0 : _this$options12.rightPadding)
|
|
3182
|
+
var _this$options$rightPa, _this$options12;
|
|
3183
|
+
return (_this$options$rightPa = (_this$options12 = this.options) === null || _this$options12 === void 0 ? void 0 : _this$options12.rightPadding) != null ? _this$options$rightPa : this.horPadding;
|
|
3166
3184
|
}
|
|
3167
3185
|
set topPadding(padding) {
|
|
3168
3186
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3170,8 +3188,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3170
3188
|
this.arrangeChildren();
|
|
3171
3189
|
}
|
|
3172
3190
|
get topPadding() {
|
|
3173
|
-
var _this$options13;
|
|
3174
|
-
return ((_this$options13 = this.options) === null || _this$options13 === void 0 ? void 0 : _this$options13.topPadding)
|
|
3191
|
+
var _this$options$topPadd, _this$options13;
|
|
3192
|
+
return (_this$options$topPadd = (_this$options13 = this.options) === null || _this$options13 === void 0 ? void 0 : _this$options13.topPadding) != null ? _this$options$topPadd : this.vertPadding;
|
|
3175
3193
|
}
|
|
3176
3194
|
set bottomPadding(padding) {
|
|
3177
3195
|
if (!this.options) throw new Error("List has not been initiated!");
|
|
@@ -3179,15 +3197,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3179
3197
|
this.arrangeChildren();
|
|
3180
3198
|
}
|
|
3181
3199
|
get bottomPadding() {
|
|
3182
|
-
var _this$options14;
|
|
3183
|
-
return ((_this$options14 = this.options) === null || _this$options14 === void 0 ? void 0 : _this$options14.bottomPadding)
|
|
3200
|
+
var _this$options$bottomP, _this$options14;
|
|
3201
|
+
return (_this$options$bottomP = (_this$options14 = this.options) === null || _this$options14 === void 0 ? void 0 : _this$options14.bottomPadding) != null ? _this$options$bottomP : this.vertPadding;
|
|
3184
3202
|
}
|
|
3185
3203
|
arrangeChildren() {
|
|
3186
|
-
var _this$options15, _this$parent;
|
|
3204
|
+
var _this$options$element2, _this$options15, _this$parent;
|
|
3187
3205
|
let maxHeight = 0;
|
|
3188
3206
|
let x = this.leftPadding;
|
|
3189
3207
|
let y = this.topPadding;
|
|
3190
|
-
const elementsMargin = ((_this$options15 = this.options) === null || _this$options15 === void 0 ? void 0 : _this$options15.elementsMargin)
|
|
3208
|
+
const elementsMargin = (_this$options$element2 = (_this$options15 = this.options) === null || _this$options15 === void 0 ? void 0 : _this$options15.elementsMargin) != null ? _this$options$element2 : 0;
|
|
3191
3209
|
let maxWidth = this.maxWidth || ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.width);
|
|
3192
3210
|
if (this.rightPadding) {
|
|
3193
3211
|
maxWidth -= this.rightPadding;
|
|
@@ -3247,6 +3265,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3247
3265
|
var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3248
3266
|
class Spring {
|
|
3249
3267
|
constructor(options = {}) {
|
|
3268
|
+
var _options$max, _options$damp, _options$springiness;
|
|
3250
3269
|
__publicField$d(this, "x");
|
|
3251
3270
|
__publicField$d(this, "ax");
|
|
3252
3271
|
__publicField$d(this, "dx");
|
|
@@ -3257,9 +3276,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3257
3276
|
this.dx = 0;
|
|
3258
3277
|
this.tx = 0;
|
|
3259
3278
|
this._options = {
|
|
3260
|
-
max: options.max
|
|
3261
|
-
damp: options.damp
|
|
3262
|
-
springiness: options.springiness
|
|
3279
|
+
max: (_options$max = options.max) != null ? _options$max : 160,
|
|
3280
|
+
damp: (_options$damp = options.damp) != null ? _options$damp : 0.8,
|
|
3281
|
+
springiness: (_options$springiness = options.springiness) != null ? _options$springiness : 0.1
|
|
3263
3282
|
};
|
|
3264
3283
|
}
|
|
3265
3284
|
update() {
|
|
@@ -3363,6 +3382,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3363
3382
|
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3364
3383
|
class SlidingNumber {
|
|
3365
3384
|
constructor(options = {}) {
|
|
3385
|
+
var _options$constrain, _options$maxSpeed, _options$ease;
|
|
3366
3386
|
__publicField$b(this, "position", 0);
|
|
3367
3387
|
__publicField$b(this, "constrain", true);
|
|
3368
3388
|
__publicField$b(this, "min", 0);
|
|
@@ -3377,9 +3397,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3377
3397
|
__publicField$b(this, "_speedChecker", 0);
|
|
3378
3398
|
__publicField$b(this, "_grab", 0);
|
|
3379
3399
|
__publicField$b(this, "_activeEase");
|
|
3380
|
-
this.constrain = options.constrain
|
|
3381
|
-
this.maxSpeed = options.maxSpeed
|
|
3382
|
-
this._ease = options.ease
|
|
3400
|
+
this.constrain = (_options$constrain = options.constrain) != null ? _options$constrain : true;
|
|
3401
|
+
this.maxSpeed = (_options$maxSpeed = options.maxSpeed) != null ? _options$maxSpeed : 400;
|
|
3402
|
+
this._ease = (_options$ease = options.ease) != null ? _options$ease : new ScrollSpring();
|
|
3383
3403
|
}
|
|
3384
3404
|
set value(n) {
|
|
3385
3405
|
this._speed = 0;
|
|
@@ -3476,6 +3496,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3476
3496
|
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3477
3497
|
class Trackpad {
|
|
3478
3498
|
constructor(options) {
|
|
3499
|
+
var _options$disableEasin;
|
|
3479
3500
|
__publicField$a(this, "xAxis");
|
|
3480
3501
|
__publicField$a(this, "yAxis");
|
|
3481
3502
|
__publicField$a(this, "_isDown", false);
|
|
@@ -3494,7 +3515,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3494
3515
|
maxSpeed: options.maxSpeed,
|
|
3495
3516
|
constrain: options.constrain
|
|
3496
3517
|
});
|
|
3497
|
-
this.disableEasing = options.disableEasing
|
|
3518
|
+
this.disableEasing = (_options$disableEasin = options.disableEasing) != null ? _options$disableEasin : false;
|
|
3498
3519
|
this._frame = new pixi_js.Rectangle();
|
|
3499
3520
|
this._bounds = new pixi_js.Rectangle();
|
|
3500
3521
|
this._globalPosition = new pixi_js.Point();
|
|
@@ -3593,12 +3614,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3593
3614
|
this.ticker.add(this.update, this);
|
|
3594
3615
|
}
|
|
3595
3616
|
init(options) {
|
|
3596
|
-
var _this$background, _this$background2, _this$list;
|
|
3617
|
+
var _ref13, _options$width, _this$background, _ref14, _options$height, _this$background2, _options$proximityRan, _this$list, _options$globalScroll, _options$shiftScroll;
|
|
3597
3618
|
this.options = options;
|
|
3598
3619
|
this.setBackground(options.background);
|
|
3599
|
-
this._width = options.width
|
|
3600
|
-
this._height = options.height
|
|
3601
|
-
this.proximityRange = options.proximityRange
|
|
3620
|
+
this._width = (_ref13 = (_options$width = options.width) != null ? _options$width : (_this$background = this.background) === null || _this$background === void 0 ? void 0 : _this$background.width) != null ? _ref13 : 100;
|
|
3621
|
+
this._height = (_ref14 = (_options$height = options.height) != null ? _options$height : (_this$background2 = this.background) === null || _this$background2 === void 0 ? void 0 : _this$background2.height) != null ? _ref14 : 100;
|
|
3622
|
+
this.proximityRange = (_options$proximityRan = options.proximityRange) != null ? _options$proximityRan : 0;
|
|
3602
3623
|
if (!this.list) {
|
|
3603
3624
|
this.list = new List$1();
|
|
3604
3625
|
super.addChild(this.list);
|
|
@@ -3626,8 +3647,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3626
3647
|
this._trackpad.xAxis.value = 0;
|
|
3627
3648
|
this._trackpad.yAxis.value = 0;
|
|
3628
3649
|
}
|
|
3629
|
-
this.options.globalScroll = options.globalScroll
|
|
3630
|
-
this.options.shiftScroll = options.shiftScroll
|
|
3650
|
+
this.options.globalScroll = (_options$globalScroll = options.globalScroll) != null ? _options$globalScroll : true;
|
|
3651
|
+
this.options.shiftScroll = (_options$shiftScroll = options.shiftScroll) != null ? _options$shiftScroll : false;
|
|
3631
3652
|
this.resize();
|
|
3632
3653
|
}
|
|
3633
3654
|
get hasBounds() {
|
|
@@ -3672,22 +3693,24 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3672
3693
|
const list = this.list;
|
|
3673
3694
|
if (!list) return false;
|
|
3674
3695
|
if (this.isVertical || this.isBidirectional) {
|
|
3696
|
+
var _this$options$height;
|
|
3675
3697
|
const posY = item.y + list.y;
|
|
3676
|
-
if (posY + item.height >= -padding && posY <= (this.options.height
|
|
3698
|
+
if (posY + item.height >= -padding && posY <= ((_this$options$height = this.options.height) != null ? _this$options$height : this._height) + padding) {
|
|
3677
3699
|
isVisible = true;
|
|
3678
3700
|
}
|
|
3679
3701
|
}
|
|
3680
3702
|
if (this.isHorizontal || this.isBidirectional) {
|
|
3703
|
+
var _this$options$width;
|
|
3681
3704
|
const posX = item.x + list.x;
|
|
3682
|
-
if (posX + item.width >= -padding && posX <= (this.options.width
|
|
3705
|
+
if (posX + item.width >= -padding && posX <= ((_this$options$width = this.options.width) != null ? _this$options$width : this._width) + padding) {
|
|
3683
3706
|
isVisible = true;
|
|
3684
3707
|
}
|
|
3685
3708
|
}
|
|
3686
3709
|
return isVisible;
|
|
3687
3710
|
}
|
|
3688
3711
|
get items() {
|
|
3689
|
-
var _this$list5;
|
|
3690
|
-
return ((_this$list5 = this.list) === null || _this$list5 === void 0 ? void 0 : _this$list5.children)
|
|
3712
|
+
var _this$list$children, _this$list5;
|
|
3713
|
+
return (_this$list$children = (_this$list5 = this.list) === null || _this$list5 === void 0 ? void 0 : _this$list5.children) != null ? _this$list$children : [];
|
|
3691
3714
|
}
|
|
3692
3715
|
setBackground(background) {
|
|
3693
3716
|
if (this.background) {
|
|
@@ -3756,7 +3779,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3756
3779
|
if (!this.isDragging) return;
|
|
3757
3780
|
const touchPoint = this.worldTransform.applyInverse(e.global);
|
|
3758
3781
|
if (this.dragStarTouchPoint) {
|
|
3759
|
-
|
|
3782
|
+
var _this$options$dragTra;
|
|
3783
|
+
const dragTrashHold = (_this$options$dragTra = this.options.dragTrashHold) != null ? _this$options$dragTra : 10;
|
|
3760
3784
|
if (this.isHorizontal || this.isBidirectional) {
|
|
3761
3785
|
const xDist = touchPoint.x - this.dragStarTouchPoint.x;
|
|
3762
3786
|
if (Math.abs(xDist) > dragTrashHold) {
|
|
@@ -3793,29 +3817,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3793
3817
|
this.eventMode = interactive ? "static" : "auto";
|
|
3794
3818
|
}
|
|
3795
3819
|
get listHeight() {
|
|
3796
|
-
var _this$list7, _this$list8, _this$list9;
|
|
3797
|
-
return (((_this$list7 = this.list) === null || _this$list7 === void 0 ? void 0 : _this$list7.height)
|
|
3820
|
+
var _this$list$height, _this$list7, _this$list$topPadding, _this$list8, _this$list$bottomPadd, _this$list9;
|
|
3821
|
+
return ((_this$list$height = (_this$list7 = this.list) === null || _this$list7 === void 0 ? void 0 : _this$list7.height) != null ? _this$list$height : 0) + ((_this$list$topPadding = (_this$list8 = this.list) === null || _this$list8 === void 0 ? void 0 : _this$list8.topPadding) != null ? _this$list$topPadding : 0) + ((_this$list$bottomPadd = (_this$list9 = this.list) === null || _this$list9 === void 0 ? void 0 : _this$list9.bottomPadding) != null ? _this$list$bottomPadd : 0);
|
|
3798
3822
|
}
|
|
3799
3823
|
get listWidth() {
|
|
3800
|
-
var _this$list0, _this$list1, _this$list10;
|
|
3801
|
-
return (((_this$list0 = this.list) === null || _this$list0 === void 0 ? void 0 : _this$list0.width)
|
|
3824
|
+
var _this$list$width, _this$list0, _this$list$leftPaddin, _this$list1, _this$list$rightPaddi, _this$list10;
|
|
3825
|
+
return ((_this$list$width = (_this$list0 = this.list) === null || _this$list0 === void 0 ? void 0 : _this$list0.width) != null ? _this$list$width : 0) + ((_this$list$leftPaddin = (_this$list1 = this.list) === null || _this$list1 === void 0 ? void 0 : _this$list1.leftPadding) != null ? _this$list$leftPaddin : 0) + ((_this$list$rightPaddi = (_this$list10 = this.list) === null || _this$list10 === void 0 ? void 0 : _this$list10.rightPadding) != null ? _this$list$rightPaddi : 0);
|
|
3802
3826
|
}
|
|
3803
3827
|
resize(force = false) {
|
|
3804
3828
|
if (!this.hasBounds) return;
|
|
3805
3829
|
this.renderAllItems();
|
|
3806
3830
|
if (this.borderMask && (force || this._dimensionChanged || this.lastWidth !== this.listWidth || this.lastHeight !== this.listHeight)) {
|
|
3807
|
-
var _this$borderMask, _this$background3;
|
|
3831
|
+
var _this$borderMask, _this$options$radius, _this$background3, _this$options$radius2;
|
|
3808
3832
|
if (!this.options.width) {
|
|
3809
3833
|
this._width += this.listWidth;
|
|
3810
3834
|
}
|
|
3811
3835
|
if (!this.options.height) {
|
|
3812
3836
|
this._height += this.listHeight;
|
|
3813
3837
|
}
|
|
3814
|
-
(_this$borderMask = this.borderMask) === null || _this$borderMask === void 0 ? void 0 : _this$borderMask.clear().roundRect(0, 0, this._width, this._height, (this.options.radius
|
|
3838
|
+
(_this$borderMask = this.borderMask) === null || _this$borderMask === void 0 ? void 0 : _this$borderMask.clear().roundRect(0, 0, this._width, this._height, ((_this$options$radius = this.options.radius) != null ? _this$options$radius : 0) | 0).fill(16711935).stroke(0);
|
|
3815
3839
|
if (this.borderMask) this.borderMask.eventMode = "none";
|
|
3816
3840
|
const color = this.options.background;
|
|
3817
|
-
(_this$background3 = this.background) === null || _this$background3 === void 0 ? void 0 : _this$background3.clear().roundRect(0, 0, this._width, this._height, (this.options.radius
|
|
3818
|
-
color: color
|
|
3841
|
+
(_this$background3 = this.background) === null || _this$background3 === void 0 ? void 0 : _this$background3.clear().roundRect(0, 0, this._width, this._height, ((_this$options$radius2 = this.options.radius) != null ? _this$options$radius2 : 0) | 0).fill({
|
|
3842
|
+
color: color != null ? color : 0,
|
|
3819
3843
|
alpha: color ? 1 : 1e-7
|
|
3820
3844
|
});
|
|
3821
3845
|
if (this.isBidirectional) {
|
|
@@ -3829,9 +3853,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3829
3853
|
this.lastHeight = this.listHeight;
|
|
3830
3854
|
}
|
|
3831
3855
|
if (this._trackpad && this.borderMask) {
|
|
3832
|
-
var _this$list11, _this$list12, _this$list13, _this$list14, _this$list15, _this$list16;
|
|
3833
|
-
const maxWidth = this.borderMask.width - (((_this$list11 = this.list) === null || _this$list11 === void 0 ? void 0 : _this$list11.width)
|
|
3834
|
-
const maxHeight = this.borderMask.height - (((_this$list14 = this.list) === null || _this$list14 === void 0 ? void 0 : _this$list14.height)
|
|
3856
|
+
var _this$list$width2, _this$list11, _this$list$leftPaddin2, _this$list12, _this$list$rightPaddi2, _this$list13, _this$list$height2, _this$list14, _this$list$topPadding2, _this$list15, _this$list$bottomPadd2, _this$list16;
|
|
3857
|
+
const maxWidth = this.borderMask.width - ((_this$list$width2 = (_this$list11 = this.list) === null || _this$list11 === void 0 ? void 0 : _this$list11.width) != null ? _this$list$width2 : 0) - ((_this$list$leftPaddin2 = (_this$list12 = this.list) === null || _this$list12 === void 0 ? void 0 : _this$list12.leftPadding) != null ? _this$list$leftPaddin2 : 0) - ((_this$list$rightPaddi2 = (_this$list13 = this.list) === null || _this$list13 === void 0 ? void 0 : _this$list13.rightPadding) != null ? _this$list$rightPaddi2 : 0);
|
|
3858
|
+
const maxHeight = this.borderMask.height - ((_this$list$height2 = (_this$list14 = this.list) === null || _this$list14 === void 0 ? void 0 : _this$list14.height) != null ? _this$list$height2 : 0) - ((_this$list$topPadding2 = (_this$list15 = this.list) === null || _this$list15 === void 0 ? void 0 : _this$list15.topPadding) != null ? _this$list$topPadding2 : 0) - ((_this$list$bottomPadd2 = (_this$list16 = this.list) === null || _this$list16 === void 0 ? void 0 : _this$list16.bottomPadding) != null ? _this$list$bottomPadd2 : 0);
|
|
3835
3859
|
if (this.isBidirectional) {
|
|
3836
3860
|
this._trackpad.yAxis.max = -Math.abs(maxHeight);
|
|
3837
3861
|
this._trackpad.xAxis.max = -Math.abs(maxWidth);
|
|
@@ -3861,9 +3885,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3861
3885
|
const scrollOnX = shiftScroll ? typeof event.deltaX !== "undefined" || typeof event.deltaY !== "undefined" : typeof event.deltaX !== "undefined";
|
|
3862
3886
|
const scrollOnY = typeof event.deltaY !== "undefined";
|
|
3863
3887
|
if ((this.isHorizontal || this.isBidirectional) && scrollOnX) {
|
|
3864
|
-
var _this$list19;
|
|
3888
|
+
var _this$list$x, _this$list19;
|
|
3865
3889
|
const delta = shiftScroll || this.isBidirectional ? event.deltaX : event.deltaY;
|
|
3866
|
-
const targetPos = (((_this$list19 = this.list) === null || _this$list19 === void 0 ? void 0 : _this$list19.x)
|
|
3890
|
+
const targetPos = ((_this$list$x = (_this$list19 = this.list) === null || _this$list19 === void 0 ? void 0 : _this$list19.x) != null ? _this$list$x : 0) - delta;
|
|
3867
3891
|
if (this.listWidth < this._width) {
|
|
3868
3892
|
this._trackpad && (this._trackpad.xAxis.value = 0);
|
|
3869
3893
|
} else {
|
|
@@ -3873,8 +3897,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3873
3897
|
}
|
|
3874
3898
|
}
|
|
3875
3899
|
if ((this.isVertical || this.isBidirectional) && scrollOnY) {
|
|
3876
|
-
var _this$list20;
|
|
3877
|
-
const targetPos = (((_this$list20 = this.list) === null || _this$list20 === void 0 ? void 0 : _this$list20.y)
|
|
3900
|
+
var _this$list$y, _this$list20;
|
|
3901
|
+
const targetPos = ((_this$list$y = (_this$list20 = this.list) === null || _this$list20 === void 0 ? void 0 : _this$list20.y) != null ? _this$list$y : 0) - event.deltaY;
|
|
3878
3902
|
if (this.listHeight < this._height) {
|
|
3879
3903
|
this._trackpad && (this._trackpad.yAxis.value = 0);
|
|
3880
3904
|
} else {
|
|
@@ -3884,17 +3908,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3884
3908
|
}
|
|
3885
3909
|
}
|
|
3886
3910
|
if (this.isBidirectional && (scrollOnX || scrollOnY)) {
|
|
3887
|
-
var _this$onScroll3, _this$_trackpad4, _this$_trackpad5;
|
|
3911
|
+
var _this$onScroll3, _this$_trackpad$xAxis, _this$_trackpad4, _this$_trackpad$yAxis, _this$_trackpad5;
|
|
3888
3912
|
(_this$onScroll3 = this.onScroll) === null || _this$onScroll3 === void 0 ? void 0 : _this$onScroll3.emit({
|
|
3889
|
-
x: ((_this$_trackpad4 = this._trackpad) === null || _this$_trackpad4 === void 0 ? void 0 : _this$_trackpad4.xAxis.value)
|
|
3890
|
-
y: ((_this$_trackpad5 = this._trackpad) === null || _this$_trackpad5 === void 0 ? void 0 : _this$_trackpad5.yAxis.value)
|
|
3913
|
+
x: (_this$_trackpad$xAxis = (_this$_trackpad4 = this._trackpad) === null || _this$_trackpad4 === void 0 ? void 0 : _this$_trackpad4.xAxis.value) != null ? _this$_trackpad$xAxis : 0,
|
|
3914
|
+
y: (_this$_trackpad$yAxis = (_this$_trackpad5 = this._trackpad) === null || _this$_trackpad5 === void 0 ? void 0 : _this$_trackpad5.yAxis.value) != null ? _this$_trackpad$yAxis : 0
|
|
3891
3915
|
});
|
|
3892
3916
|
} else if (this.isHorizontal && scrollOnX) {
|
|
3893
|
-
var _this$onScroll4, _this$_trackpad6;
|
|
3894
|
-
(_this$onScroll4 = this.onScroll) === null || _this$onScroll4 === void 0 ? void 0 : _this$onScroll4.emit(((_this$_trackpad6 = this._trackpad) === null || _this$_trackpad6 === void 0 ? void 0 : _this$_trackpad6.xAxis.value)
|
|
3917
|
+
var _this$onScroll4, _this$_trackpad$xAxis2, _this$_trackpad6;
|
|
3918
|
+
(_this$onScroll4 = this.onScroll) === null || _this$onScroll4 === void 0 ? void 0 : _this$onScroll4.emit((_this$_trackpad$xAxis2 = (_this$_trackpad6 = this._trackpad) === null || _this$_trackpad6 === void 0 ? void 0 : _this$_trackpad6.xAxis.value) != null ? _this$_trackpad$xAxis2 : 0);
|
|
3895
3919
|
} else if (this.isVertical && scrollOnY) {
|
|
3896
|
-
var _this$onScroll5, _this$_trackpad7;
|
|
3897
|
-
(_this$onScroll5 = this.onScroll) === null || _this$onScroll5 === void 0 ? void 0 : _this$onScroll5.emit(((_this$_trackpad7 = this._trackpad) === null || _this$_trackpad7 === void 0 ? void 0 : _this$_trackpad7.yAxis.value)
|
|
3920
|
+
var _this$onScroll5, _this$_trackpad$yAxis2, _this$_trackpad7;
|
|
3921
|
+
(_this$onScroll5 = this.onScroll) === null || _this$onScroll5 === void 0 ? void 0 : _this$onScroll5.emit((_this$_trackpad$yAxis2 = (_this$_trackpad7 = this._trackpad) === null || _this$_trackpad7 === void 0 ? void 0 : _this$_trackpad7.yAxis.value) != null ? _this$_trackpad$yAxis2 : 0);
|
|
3898
3922
|
}
|
|
3899
3923
|
this.stopRenderHiddenItems();
|
|
3900
3924
|
}
|
|
@@ -3902,8 +3926,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3902
3926
|
if (!this.interactive) {
|
|
3903
3927
|
this.scrollTop();
|
|
3904
3928
|
} else {
|
|
3905
|
-
var _this$list21;
|
|
3906
|
-
this.scrollTo((((_this$list21 = this.list) === null || _this$list21 === void 0 ? void 0 : _this$list21.children.length)
|
|
3929
|
+
var _this$list$children$l, _this$list21;
|
|
3930
|
+
this.scrollTo(((_this$list$children$l = (_this$list21 = this.list) === null || _this$list21 === void 0 ? void 0 : _this$list21.children.length) != null ? _this$list$children$l : 1) - 1);
|
|
3907
3931
|
}
|
|
3908
3932
|
}
|
|
3909
3933
|
scrollTop() {
|
|
@@ -3984,10 +4008,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
3984
4008
|
}
|
|
3985
4009
|
setSize(value, height) {
|
|
3986
4010
|
if (typeof value === "object") {
|
|
3987
|
-
|
|
4011
|
+
var _value$height;
|
|
4012
|
+
height = (_value$height = value.height) != null ? _value$height : value.width;
|
|
3988
4013
|
value = value.width;
|
|
3989
4014
|
} else {
|
|
3990
|
-
height = height
|
|
4015
|
+
height = height != null ? height : value;
|
|
3991
4016
|
}
|
|
3992
4017
|
this._width = value;
|
|
3993
4018
|
this._height = height;
|
|
@@ -4005,15 +4030,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4005
4030
|
return out;
|
|
4006
4031
|
}
|
|
4007
4032
|
get scrollX() {
|
|
4008
|
-
var _this$_trackpad8;
|
|
4009
|
-
return ((_this$_trackpad8 = this._trackpad) === null || _this$_trackpad8 === void 0 ? void 0 : _this$_trackpad8.xAxis.value)
|
|
4033
|
+
var _this$_trackpad$xAxis3, _this$_trackpad8;
|
|
4034
|
+
return (_this$_trackpad$xAxis3 = (_this$_trackpad8 = this._trackpad) === null || _this$_trackpad8 === void 0 ? void 0 : _this$_trackpad8.xAxis.value) != null ? _this$_trackpad$xAxis3 : 0;
|
|
4010
4035
|
}
|
|
4011
4036
|
set scrollX(value) {
|
|
4012
4037
|
if (this._trackpad) this._trackpad.xAxis.value = value;
|
|
4013
4038
|
}
|
|
4014
4039
|
get scrollY() {
|
|
4015
|
-
var _this$_trackpad9;
|
|
4016
|
-
return ((_this$_trackpad9 = this._trackpad) === null || _this$_trackpad9 === void 0 ? void 0 : _this$_trackpad9.yAxis.value)
|
|
4040
|
+
var _this$_trackpad$yAxis3, _this$_trackpad9;
|
|
4041
|
+
return (_this$_trackpad$yAxis3 = (_this$_trackpad9 = this._trackpad) === null || _this$_trackpad9 === void 0 ? void 0 : _this$_trackpad9.yAxis.value) != null ? _this$_trackpad$yAxis3 : 0;
|
|
4017
4042
|
}
|
|
4018
4043
|
set scrollY(value) {
|
|
4019
4044
|
if (this._trackpad) this._trackpad.yAxis.value = value;
|
|
@@ -4032,8 +4057,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4032
4057
|
}
|
|
4033
4058
|
}
|
|
4034
4059
|
if (!this.options.disableProximityCheck && (this._trackpad.x !== this.lastScrollX || this._trackpad.y !== this.lastScrollY)) {
|
|
4060
|
+
var _this$options$proximi;
|
|
4035
4061
|
this.proximityCheckFrameCounter++;
|
|
4036
|
-
if (this.proximityCheckFrameCounter >= (this.options.proximityDebounce
|
|
4062
|
+
if (this.proximityCheckFrameCounter >= ((_this$options$proximi = this.options.proximityDebounce) != null ? _this$options$proximi : 10)) {
|
|
4037
4063
|
this.items.forEach((item, index) => {
|
|
4038
4064
|
const inRange = this.isItemVisible(item, this.proximityRange);
|
|
4039
4065
|
const wasInRange = this.proximityStatusCache[index];
|
|
@@ -4068,6 +4094,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4068
4094
|
}
|
|
4069
4095
|
revertClick(item) {
|
|
4070
4096
|
if (item.eventMode !== "auto") {
|
|
4097
|
+
var _item$eventMode;
|
|
4071
4098
|
if (pixi_js.isMobile.any) {
|
|
4072
4099
|
item.emit("pointerupoutside", {
|
|
4073
4100
|
target: item
|
|
@@ -4079,7 +4106,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4079
4106
|
}
|
|
4080
4107
|
this.interactiveStorage.push({
|
|
4081
4108
|
item,
|
|
4082
|
-
eventMode: item.eventMode
|
|
4109
|
+
eventMode: (_item$eventMode = item.eventMode) != null ? _item$eventMode : "auto"
|
|
4083
4110
|
});
|
|
4084
4111
|
item.eventMode = "auto";
|
|
4085
4112
|
}
|
|
@@ -4088,15 +4115,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4088
4115
|
}
|
|
4089
4116
|
}
|
|
4090
4117
|
get scrollHeight() {
|
|
4091
|
-
var _this$list23;
|
|
4092
|
-
return ((_this$list23 = this.list) === null || _this$list23 === void 0 ? void 0 : _this$list23.height)
|
|
4118
|
+
var _this$list$height3, _this$list23;
|
|
4119
|
+
return (_this$list$height3 = (_this$list23 = this.list) === null || _this$list23 === void 0 ? void 0 : _this$list23.height) != null ? _this$list$height3 : 0;
|
|
4093
4120
|
}
|
|
4094
4121
|
get scrollWidth() {
|
|
4095
|
-
var _this$list24;
|
|
4096
|
-
return ((_this$list24 = this.list) === null || _this$list24 === void 0 ? void 0 : _this$list24.width)
|
|
4122
|
+
var _this$list$width3, _this$list24;
|
|
4123
|
+
return (_this$list$width3 = (_this$list24 = this.list) === null || _this$list24 === void 0 ? void 0 : _this$list24.width) != null ? _this$list$width3 : 0;
|
|
4097
4124
|
}
|
|
4098
4125
|
get isVertical() {
|
|
4099
|
-
|
|
4126
|
+
var _this$options$type;
|
|
4127
|
+
const type = (_this$options$type = this.options.type) != null ? _this$options$type : "vertical";
|
|
4100
4128
|
return type === "vertical";
|
|
4101
4129
|
}
|
|
4102
4130
|
get isHorizontal() {
|
|
@@ -4172,15 +4200,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4172
4200
|
pixi_js.Ticker.shared.add(() => Group.shared.update());
|
|
4173
4201
|
}
|
|
4174
4202
|
get dialogWidth() {
|
|
4175
|
-
var _this$innerView2;
|
|
4176
|
-
return this.options.width
|
|
4203
|
+
var _ref15, _this$options$width2, _this$innerView2;
|
|
4204
|
+
return (_ref15 = (_this$options$width2 = this.options.width) != null ? _this$options$width2 : (_this$innerView2 = this.innerView) === null || _this$innerView2 === void 0 ? void 0 : _this$innerView2.width) != null ? _ref15 : 0;
|
|
4177
4205
|
}
|
|
4178
4206
|
get dialogHeight() {
|
|
4179
|
-
var _this$innerView3;
|
|
4180
|
-
return this.options.height
|
|
4207
|
+
var _ref16, _this$options$height2, _this$innerView3;
|
|
4208
|
+
return (_ref16 = (_this$options$height2 = this.options.height) != null ? _this$options$height2 : (_this$innerView3 = this.innerView) === null || _this$innerView3 === void 0 ? void 0 : _this$innerView3.height) != null ? _ref16 : 0;
|
|
4181
4209
|
}
|
|
4182
4210
|
get dialogPadding() {
|
|
4183
|
-
|
|
4211
|
+
var _this$options$padding2;
|
|
4212
|
+
return (_this$options$padding2 = this.options.padding) != null ? _this$options$padding2 : 20;
|
|
4184
4213
|
}
|
|
4185
4214
|
get isOpen() {
|
|
4186
4215
|
return this._isOpen;
|
|
@@ -4189,9 +4218,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4189
4218
|
if (this.options.backdrop) {
|
|
4190
4219
|
this.backdrop = getView(this.options.backdrop);
|
|
4191
4220
|
} else {
|
|
4221
|
+
var _this$options$backdro, _this$options$backdro2;
|
|
4192
4222
|
const backdropSprite = new pixi_js.Sprite(pixi_js.Texture.WHITE);
|
|
4193
|
-
backdropSprite.tint = this.options.backdropColor
|
|
4194
|
-
backdropSprite.alpha = this.options.backdropAlpha
|
|
4223
|
+
backdropSprite.tint = (_this$options$backdro = this.options.backdropColor) != null ? _this$options$backdro : 0;
|
|
4224
|
+
backdropSprite.alpha = (_this$options$backdro2 = this.options.backdropAlpha) != null ? _this$options$backdro2 : 0.5;
|
|
4195
4225
|
backdropSprite.width = 1e4;
|
|
4196
4226
|
backdropSprite.height = 1e4;
|
|
4197
4227
|
this.backdrop = backdropSprite;
|
|
@@ -4297,14 +4327,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4297
4327
|
break;
|
|
4298
4328
|
case btn instanceof FancyButton$1:
|
|
4299
4329
|
btn.onPress.connect(() => {
|
|
4300
|
-
|
|
4330
|
+
var _btn$text;
|
|
4331
|
+
this.onSelect.emit(index, (_btn$text = btn.text) != null ? _btn$text : "");
|
|
4301
4332
|
});
|
|
4302
4333
|
this.buttonContainer.addChild(btn);
|
|
4303
4334
|
break;
|
|
4304
4335
|
default:
|
|
4305
4336
|
button = new FancyButton$1(btn);
|
|
4306
4337
|
button.onPress.connect(() => {
|
|
4307
|
-
|
|
4338
|
+
var _button$text;
|
|
4339
|
+
this.onSelect.emit(index, (_button$text = button.text) != null ? _button$text : "");
|
|
4308
4340
|
});
|
|
4309
4341
|
this.buttonContainer.addChild(button);
|
|
4310
4342
|
break;
|
|
@@ -4315,21 +4347,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4315
4347
|
this.contentView.addChild(this.buttonContainer);
|
|
4316
4348
|
}
|
|
4317
4349
|
open() {
|
|
4318
|
-
var _this$options$animati;
|
|
4350
|
+
var _this$options$animati, _openAnimation$durati, _this$options$backdro4;
|
|
4319
4351
|
if (!this.innerView) return;
|
|
4320
4352
|
this.visible = true;
|
|
4321
4353
|
this._isOpen = true;
|
|
4322
4354
|
const openAnimation = (_this$options$animati = this.options.animations) === null || _this$options$animati === void 0 ? void 0 : _this$options$animati.open;
|
|
4323
4355
|
if (!openAnimation) {
|
|
4324
|
-
|
|
4356
|
+
var _this$options$backdro3;
|
|
4357
|
+
this.backdrop.alpha = (_this$options$backdro3 = this.options.backdropAlpha) != null ? _this$options$backdro3 : 0.5;
|
|
4325
4358
|
this.innerView.scale.set(1);
|
|
4326
4359
|
return;
|
|
4327
4360
|
}
|
|
4328
4361
|
this.backdrop.alpha = 0;
|
|
4329
4362
|
this.innerView.scale.set(0.8);
|
|
4330
|
-
const duration = openAnimation.duration
|
|
4363
|
+
const duration = (_openAnimation$durati = openAnimation.duration) != null ? _openAnimation$durati : 300;
|
|
4331
4364
|
new Tween(this.backdrop).to({
|
|
4332
|
-
alpha: this.options.backdropAlpha
|
|
4365
|
+
alpha: (_this$options$backdro4 = this.options.backdropAlpha) != null ? _this$options$backdro4 : 0.5
|
|
4333
4366
|
}, duration).start();
|
|
4334
4367
|
new Tween(this.innerView.scale).to({
|
|
4335
4368
|
x: 1,
|
|
@@ -4337,7 +4370,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4337
4370
|
}, duration).start();
|
|
4338
4371
|
}
|
|
4339
4372
|
close() {
|
|
4340
|
-
var _this$options$animati2;
|
|
4373
|
+
var _this$options$animati2, _closeAnimation$durat;
|
|
4341
4374
|
if (!this.innerView) return;
|
|
4342
4375
|
const closeAnimation = (_this$options$animati2 = this.options.animations) === null || _this$options$animati2 === void 0 ? void 0 : _this$options$animati2.close;
|
|
4343
4376
|
if (!closeAnimation) {
|
|
@@ -4346,7 +4379,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4346
4379
|
this.onClose.emit();
|
|
4347
4380
|
return;
|
|
4348
4381
|
}
|
|
4349
|
-
const duration = closeAnimation.duration
|
|
4382
|
+
const duration = (_closeAnimation$durat = closeAnimation.duration) != null ? _closeAnimation$durat : 300;
|
|
4350
4383
|
new Tween(this.backdrop).to({
|
|
4351
4384
|
alpha: 0
|
|
4352
4385
|
}, duration).start();
|
|
@@ -4408,7 +4441,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4408
4441
|
}) {
|
|
4409
4442
|
this.setBackground(bg);
|
|
4410
4443
|
this.setFill(fill, fillPaddings);
|
|
4411
|
-
this.progress = progress
|
|
4444
|
+
this.progress = progress != null ? progress : 0;
|
|
4412
4445
|
}
|
|
4413
4446
|
setBackground(bg) {
|
|
4414
4447
|
var _this$options16;
|
|
@@ -4443,7 +4476,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4443
4476
|
this.innerView.addChildAt(this.bg, 0);
|
|
4444
4477
|
}
|
|
4445
4478
|
setFill(fill, fillPadding) {
|
|
4446
|
-
var _this$options17;
|
|
4479
|
+
var _this$options17, _fillPadding$left, _fillPadding$top;
|
|
4447
4480
|
if (this.fill) {
|
|
4448
4481
|
this.fill.destroy();
|
|
4449
4482
|
}
|
|
@@ -4469,8 +4502,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4469
4502
|
this.fill = getView(fill);
|
|
4470
4503
|
}
|
|
4471
4504
|
this.innerView.addChildAt(this.fill, 1);
|
|
4472
|
-
const offsetX = (fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.left)
|
|
4473
|
-
const offsetY = (fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.top)
|
|
4505
|
+
const offsetX = (_fillPadding$left = fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.left) != null ? _fillPadding$left : 0;
|
|
4506
|
+
const offsetY = (_fillPadding$top = fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.top) != null ? _fillPadding$top : 0;
|
|
4474
4507
|
this.fill.x = offsetX;
|
|
4475
4508
|
this.fill.y = offsetY;
|
|
4476
4509
|
if (this.fillMask) {
|
|
@@ -4527,9 +4560,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4527
4560
|
this.bg.width = width;
|
|
4528
4561
|
}
|
|
4529
4562
|
if (this.fill) {
|
|
4530
|
-
var _this$options$fillPad, _this$options$fillPad2;
|
|
4531
|
-
const leftPadding = (
|
|
4532
|
-
const rightPadding = ((_this$options$
|
|
4563
|
+
var _this$options$fillPad, _this$options$fillPad2, _this$options$fillPad3, _this$options$fillPad4;
|
|
4564
|
+
const leftPadding = (_this$options$fillPad = (_this$options$fillPad2 = this.options.fillPaddings) === null || _this$options$fillPad2 === void 0 ? void 0 : _this$options$fillPad2.left) != null ? _this$options$fillPad : 0;
|
|
4565
|
+
const rightPadding = (_this$options$fillPad3 = (_this$options$fillPad4 = this.options.fillPaddings) === null || _this$options$fillPad4 === void 0 ? void 0 : _this$options$fillPad4.right) != null ? _this$options$fillPad3 : 0;
|
|
4533
4566
|
this.fill.width = width - leftPadding - rightPadding;
|
|
4534
4567
|
this.fillMask.width = width - leftPadding - rightPadding;
|
|
4535
4568
|
}
|
|
@@ -4548,9 +4581,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4548
4581
|
this.bg.height = height;
|
|
4549
4582
|
}
|
|
4550
4583
|
if (this.fill) {
|
|
4551
|
-
var _this$options$
|
|
4552
|
-
const topPadding = ((_this$options$
|
|
4553
|
-
const bottomPadding = ((_this$options$
|
|
4584
|
+
var _this$options$fillPad5, _this$options$fillPad6, _this$options$fillPad7, _this$options$fillPad8;
|
|
4585
|
+
const topPadding = (_this$options$fillPad5 = (_this$options$fillPad6 = this.options.fillPaddings) === null || _this$options$fillPad6 === void 0 ? void 0 : _this$options$fillPad6.top) != null ? _this$options$fillPad5 : 0;
|
|
4586
|
+
const bottomPadding = (_this$options$fillPad7 = (_this$options$fillPad8 = this.options.fillPaddings) === null || _this$options$fillPad8 === void 0 ? void 0 : _this$options$fillPad8.bottom) != null ? _this$options$fillPad7 : 0;
|
|
4554
4587
|
this.fill.height = height - topPadding - bottomPadding;
|
|
4555
4588
|
this.fillMask.height = height - topPadding - bottomPadding;
|
|
4556
4589
|
}
|
|
@@ -4569,17 +4602,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4569
4602
|
this.bg.setSize(value, height);
|
|
4570
4603
|
}
|
|
4571
4604
|
if (this.fill) {
|
|
4572
|
-
var _this$options$
|
|
4605
|
+
var _this$options$fillPad9, _this$options$fillPad0, _this$options$fillPad1, _this$options$fillPad10, _this$options$fillPad11, _this$options$fillPad12, _this$options$fillPad13, _this$options$fillPad14;
|
|
4573
4606
|
if (typeof value === "object") {
|
|
4574
|
-
|
|
4607
|
+
var _value$height2;
|
|
4608
|
+
height = (_value$height2 = value.height) != null ? _value$height2 : value.width;
|
|
4575
4609
|
value = value.width;
|
|
4576
4610
|
} else {
|
|
4577
|
-
height = height
|
|
4611
|
+
height = height != null ? height : value;
|
|
4578
4612
|
}
|
|
4579
|
-
const topPadding = ((_this$options$
|
|
4580
|
-
const bottomPadding = ((_this$options$
|
|
4581
|
-
const leftPadding = ((_this$options$
|
|
4582
|
-
const rightPadding = ((_this$options$
|
|
4613
|
+
const topPadding = (_this$options$fillPad9 = (_this$options$fillPad0 = this.options.fillPaddings) === null || _this$options$fillPad0 === void 0 ? void 0 : _this$options$fillPad0.top) != null ? _this$options$fillPad9 : 0;
|
|
4614
|
+
const bottomPadding = (_this$options$fillPad1 = (_this$options$fillPad10 = this.options.fillPaddings) === null || _this$options$fillPad10 === void 0 ? void 0 : _this$options$fillPad10.bottom) != null ? _this$options$fillPad1 : 0;
|
|
4615
|
+
const leftPadding = (_this$options$fillPad11 = (_this$options$fillPad12 = this.options.fillPaddings) === null || _this$options$fillPad12 === void 0 ? void 0 : _this$options$fillPad12.left) != null ? _this$options$fillPad11 : 0;
|
|
4616
|
+
const rightPadding = (_this$options$fillPad13 = (_this$options$fillPad14 = this.options.fillPaddings) === null || _this$options$fillPad14 === void 0 ? void 0 : _this$options$fillPad14.right) != null ? _this$options$fillPad13 : 0;
|
|
4583
4617
|
this.fill.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);
|
|
4584
4618
|
this.fillMask.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);
|
|
4585
4619
|
}
|
|
@@ -4599,6 +4633,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4599
4633
|
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4600
4634
|
class SliderBase extends ProgressBar$1 {
|
|
4601
4635
|
constructor(options) {
|
|
4636
|
+
var _options$min, _options$max2;
|
|
4602
4637
|
super(options);
|
|
4603
4638
|
__publicField$6(this, "_slider1");
|
|
4604
4639
|
__publicField$6(this, "_slider2");
|
|
@@ -4621,8 +4656,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4621
4656
|
if (options.slider2) {
|
|
4622
4657
|
this.slider2 = options.slider2;
|
|
4623
4658
|
}
|
|
4624
|
-
this.min = options.min
|
|
4625
|
-
this.max = options.max
|
|
4659
|
+
this.min = (_options$min = options.min) != null ? _options$min : 0;
|
|
4660
|
+
this.max = (_options$max2 = options.max) != null ? _options$max2 : 100;
|
|
4626
4661
|
}
|
|
4627
4662
|
init(progressBarOptions) {
|
|
4628
4663
|
super.init(progressBarOptions);
|
|
@@ -4638,7 +4673,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4638
4673
|
}
|
|
4639
4674
|
this._slider1 = this.createSlider(value);
|
|
4640
4675
|
if (this.settings.showValue && !this.value1Text) {
|
|
4641
|
-
|
|
4676
|
+
var _this$settings$valueT;
|
|
4677
|
+
const TextClass = (_this$settings$valueT = this.settings.valueTextClass) != null ? _this$settings$valueT : pixi_js.Text;
|
|
4642
4678
|
this.value1Text = new TextClass({
|
|
4643
4679
|
text: "",
|
|
4644
4680
|
style: this.settings.valueTextStyle || {
|
|
@@ -4660,7 +4696,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4660
4696
|
}
|
|
4661
4697
|
this._slider2 = this.createSlider(value);
|
|
4662
4698
|
if (this.settings.showValue && !this.value2Text) {
|
|
4663
|
-
|
|
4699
|
+
var _this$settings$valueT2;
|
|
4700
|
+
const TextClass = (_this$settings$valueT2 = this.settings.valueTextClass) != null ? _this$settings$valueT2 : pixi_js.Text;
|
|
4664
4701
|
this.value2Text = new TextClass({
|
|
4665
4702
|
text: "",
|
|
4666
4703
|
style: this.settings.valueTextStyle || {
|
|
@@ -4780,24 +4817,25 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4780
4817
|
value2
|
|
4781
4818
|
} = this.sliderOptions;
|
|
4782
4819
|
this.updateProgress(value1, value2);
|
|
4783
|
-
this.value2 = value2
|
|
4784
|
-
this.value1 = value1
|
|
4820
|
+
this.value2 = value2 != null ? value2 : 0;
|
|
4821
|
+
this.value1 = value1 != null ? value1 : 0;
|
|
4785
4822
|
}
|
|
4786
4823
|
updateProgress(value1 = this.value1, value2 = this.value2) {
|
|
4787
4824
|
this.progressStart = (value1 - this.min) / (this.max - this.min) * 100;
|
|
4788
4825
|
this.progress = (value2 - this.min) / (this.max - this.min) * 100;
|
|
4789
4826
|
}
|
|
4790
4827
|
validateValues() {
|
|
4791
|
-
|
|
4792
|
-
const
|
|
4828
|
+
var _this$sliderOptions$m, _this$sliderOptions$m2, _this$sliderOptions$v, _this$sliderOptions$v2;
|
|
4829
|
+
const min = (_this$sliderOptions$m = this.sliderOptions.min) != null ? _this$sliderOptions$m : this.min;
|
|
4830
|
+
const max = (_this$sliderOptions$m2 = this.sliderOptions.max) != null ? _this$sliderOptions$m2 : this.max;
|
|
4793
4831
|
if (!this.sliderOptions.value1) {
|
|
4794
4832
|
this.sliderOptions.value1 = min;
|
|
4795
4833
|
}
|
|
4796
4834
|
if (!this.sliderOptions.value2) {
|
|
4797
4835
|
this.sliderOptions.value2 = max;
|
|
4798
4836
|
}
|
|
4799
|
-
let value1 = this.sliderOptions.value1
|
|
4800
|
-
let value2 = this.sliderOptions.value2
|
|
4837
|
+
let value1 = (_this$sliderOptions$v = this.sliderOptions.value1) != null ? _this$sliderOptions$v : min;
|
|
4838
|
+
let value2 = (_this$sliderOptions$v2 = this.sliderOptions.value2) != null ? _this$sliderOptions$v2 : max;
|
|
4801
4839
|
if (value2 < value1) {
|
|
4802
4840
|
value2 = value1;
|
|
4803
4841
|
}
|
|
@@ -4890,39 +4928,39 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
4890
4928
|
return this._slider2;
|
|
4891
4929
|
}
|
|
4892
4930
|
updateSlider1() {
|
|
4893
|
-
var _this$bg4, _this$bg5, _this$sliderOptions;
|
|
4931
|
+
var _this$bg$width, _this$bg4, _this$bg$height, _this$bg5, _this$sliderOptions;
|
|
4894
4932
|
if (!this._slider1) return;
|
|
4895
4933
|
this.updateProgress(this.value1, this.value2);
|
|
4896
|
-
this._slider1.x = (((_this$bg4 = this.bg) === null || _this$bg4 === void 0 ? void 0 : _this$bg4.width)
|
|
4897
|
-
this._slider1.y = (((_this$bg5 = this.bg) === null || _this$bg5 === void 0 ? void 0 : _this$bg5.height)
|
|
4934
|
+
this._slider1.x = ((_this$bg$width = (_this$bg4 = this.bg) === null || _this$bg4 === void 0 ? void 0 : _this$bg4.width) != null ? _this$bg$width : 0) / 100 * this.progressStart - this._slider1.width / 2;
|
|
4935
|
+
this._slider1.y = ((_this$bg$height = (_this$bg5 = this.bg) === null || _this$bg5 === void 0 ? void 0 : _this$bg5.height) != null ? _this$bg$height : 0) / 2;
|
|
4898
4936
|
if (this._slider2 && this._slider1.x > this._slider2.x) {
|
|
4899
4937
|
this._slider1.x = this._slider2.x;
|
|
4900
4938
|
}
|
|
4901
4939
|
if ((_this$sliderOptions = this.sliderOptions) !== null && _this$sliderOptions !== void 0 && _this$sliderOptions.showValue && this.value1Text && this._slider1) {
|
|
4902
|
-
var _this$sliderOptions$
|
|
4940
|
+
var _this$sliderOptions$v3, _this$sliderOptions$v4, _this$sliderOptions$v5, _this$sliderOptions$v6;
|
|
4903
4941
|
this.value1Text.text = `${Math.round(this.value1)}`;
|
|
4904
4942
|
const sliderPosX = this._slider1.x + this._slider1.width / 2;
|
|
4905
4943
|
const sliderPosY = this._slider1.y;
|
|
4906
|
-
this.value1Text.x = sliderPosX + (((_this$sliderOptions$
|
|
4907
|
-
this.value1Text.y = sliderPosY + (((_this$sliderOptions$
|
|
4944
|
+
this.value1Text.x = sliderPosX + ((_this$sliderOptions$v3 = (_this$sliderOptions$v4 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v4 === void 0 ? void 0 : _this$sliderOptions$v4.x) != null ? _this$sliderOptions$v3 : 0);
|
|
4945
|
+
this.value1Text.y = sliderPosY + ((_this$sliderOptions$v5 = (_this$sliderOptions$v6 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v6 === void 0 ? void 0 : _this$sliderOptions$v6.y) != null ? _this$sliderOptions$v5 : 0);
|
|
4908
4946
|
}
|
|
4909
4947
|
}
|
|
4910
4948
|
updateSlider2() {
|
|
4911
|
-
var _this$bg6, _this$bg7, _this$sliderOptions2;
|
|
4949
|
+
var _this$bg$width2, _this$bg6, _this$bg$height2, _this$bg7, _this$sliderOptions2;
|
|
4912
4950
|
if (!this._slider2) return;
|
|
4913
4951
|
this.updateProgress(this.value1, this.value2);
|
|
4914
|
-
this._slider2.x = (((_this$bg6 = this.bg) === null || _this$bg6 === void 0 ? void 0 : _this$bg6.width)
|
|
4915
|
-
this._slider2.y = (((_this$bg7 = this.bg) === null || _this$bg7 === void 0 ? void 0 : _this$bg7.height)
|
|
4952
|
+
this._slider2.x = ((_this$bg$width2 = (_this$bg6 = this.bg) === null || _this$bg6 === void 0 ? void 0 : _this$bg6.width) != null ? _this$bg$width2 : 0) / 100 * this.progress - this._slider2.width / 2;
|
|
4953
|
+
this._slider2.y = ((_this$bg$height2 = (_this$bg7 = this.bg) === null || _this$bg7 === void 0 ? void 0 : _this$bg7.height) != null ? _this$bg$height2 : 0) / 2;
|
|
4916
4954
|
if (this._slider1 && this._slider2.x < this._slider1.x) {
|
|
4917
4955
|
this._slider2.x = this._slider1.x;
|
|
4918
4956
|
}
|
|
4919
4957
|
if ((_this$sliderOptions2 = this.sliderOptions) !== null && _this$sliderOptions2 !== void 0 && _this$sliderOptions2.showValue && this.value2Text && this._slider2) {
|
|
4920
|
-
var _this$sliderOptions$
|
|
4958
|
+
var _this$sliderOptions$v7, _this$sliderOptions$v8, _this$sliderOptions$v9, _this$sliderOptions$v0;
|
|
4921
4959
|
this.value2Text.text = `${Math.round(this.value2)}`;
|
|
4922
4960
|
const sliderPosX = this._slider2.x + this._slider2.width / 2;
|
|
4923
4961
|
const sliderPosY = this._slider2.y;
|
|
4924
|
-
this.value2Text.x = sliderPosX + (((_this$sliderOptions$
|
|
4925
|
-
this.value2Text.y = sliderPosY + (((_this$sliderOptions$
|
|
4962
|
+
this.value2Text.x = sliderPosX + ((_this$sliderOptions$v7 = (_this$sliderOptions$v8 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v8 === void 0 ? void 0 : _this$sliderOptions$v8.x) != null ? _this$sliderOptions$v7 : 0);
|
|
4963
|
+
this.value2Text.y = sliderPosY + ((_this$sliderOptions$v9 = (_this$sliderOptions$v0 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v0 === void 0 ? void 0 : _this$sliderOptions$v0.y) != null ? _this$sliderOptions$v9 : 0);
|
|
4926
4964
|
}
|
|
4927
4965
|
}
|
|
4928
4966
|
set width(value) {
|
|
@@ -5023,7 +5061,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5023
5061
|
}
|
|
5024
5062
|
}
|
|
5025
5063
|
onInput(e) {
|
|
5026
|
-
|
|
5064
|
+
var _e$data;
|
|
5065
|
+
this.lastInputData = (_e$data = e.data) != null ? _e$data : "";
|
|
5027
5066
|
}
|
|
5028
5067
|
onKeyUp(e) {
|
|
5029
5068
|
const key = e.key;
|
|
@@ -5045,6 +5084,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5045
5084
|
}
|
|
5046
5085
|
}
|
|
5047
5086
|
init() {
|
|
5087
|
+
var _this$options$value;
|
|
5048
5088
|
const {
|
|
5049
5089
|
textStyle = {
|
|
5050
5090
|
fill: 0,
|
|
@@ -5070,7 +5110,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5070
5110
|
});
|
|
5071
5111
|
this.placeholder.visible = !!placeholder;
|
|
5072
5112
|
this.addChild(this.inputField, this.placeholder, this._cursor);
|
|
5073
|
-
this.value = this.options.value
|
|
5113
|
+
this.value = (_this$options$value = this.options.value) != null ? _this$options$value : "";
|
|
5074
5114
|
this.align();
|
|
5075
5115
|
}
|
|
5076
5116
|
set bg(bg) {
|
|
@@ -5078,7 +5118,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5078
5118
|
if (this._bg) {
|
|
5079
5119
|
this._bg.destroy();
|
|
5080
5120
|
}
|
|
5081
|
-
const bgValue = bg
|
|
5121
|
+
const bgValue = bg != null ? bg : pixi_js.Texture.WHITE;
|
|
5082
5122
|
if ((_this$options21 = this.options) !== null && _this$options21 !== void 0 && _this$options21.nineSliceSprite) {
|
|
5083
5123
|
if (typeof bgValue === "string") {
|
|
5084
5124
|
this._bg = new pixi_js.NineSliceSprite({
|
|
@@ -5149,7 +5189,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5149
5189
|
this.align();
|
|
5150
5190
|
}
|
|
5151
5191
|
createInputField() {
|
|
5152
|
-
var _this$_bg, _this$_bg2;
|
|
5192
|
+
var _this$_bg$width, _this$_bg, _this$_bg$height, _this$_bg2;
|
|
5153
5193
|
if (this.input) {
|
|
5154
5194
|
var _this$input, _this$input2;
|
|
5155
5195
|
this.input.removeEventListener("blur", this.stopEditingBinding);
|
|
@@ -5166,8 +5206,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5166
5206
|
input.style.left = `${this.getGlobalPosition().x}px`;
|
|
5167
5207
|
input.style.top = `${this.getGlobalPosition().y}px`;
|
|
5168
5208
|
input.style.opacity = "0.0000001";
|
|
5169
|
-
input.style.width = `${((_this$_bg = this._bg) === null || _this$_bg === void 0 ? void 0 : _this$_bg.width)
|
|
5170
|
-
input.style.height = `${((_this$_bg2 = this._bg) === null || _this$_bg2 === void 0 ? void 0 : _this$_bg2.height)
|
|
5209
|
+
input.style.width = `${(_this$_bg$width = (_this$_bg = this._bg) === null || _this$_bg === void 0 ? void 0 : _this$_bg.width) != null ? _this$_bg$width : 100}px`;
|
|
5210
|
+
input.style.height = `${(_this$_bg$height = (_this$_bg2 = this._bg) === null || _this$_bg2 === void 0 ? void 0 : _this$_bg2.height) != null ? _this$_bg$height : 30}px`;
|
|
5171
5211
|
input.style.border = "none";
|
|
5172
5212
|
input.style.outline = "none";
|
|
5173
5213
|
input.style.background = "white";
|
|
@@ -5298,15 +5338,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5298
5338
|
this.paddingLeft = value;
|
|
5299
5339
|
}
|
|
5300
5340
|
if (Array.isArray(value)) {
|
|
5301
|
-
|
|
5302
|
-
this.
|
|
5303
|
-
this.
|
|
5304
|
-
this.
|
|
5341
|
+
var _value$, _ref17, _value$2, _ref18, _value$3, _ref19, _ref20, _value$4;
|
|
5342
|
+
this.paddingTop = (_value$ = value[0]) != null ? _value$ : 0;
|
|
5343
|
+
this.paddingRight = (_ref17 = (_value$2 = value[1]) != null ? _value$2 : value[0]) != null ? _ref17 : 0;
|
|
5344
|
+
this.paddingBottom = (_ref18 = (_value$3 = value[2]) != null ? _value$3 : value[0]) != null ? _ref18 : 0;
|
|
5345
|
+
this.paddingLeft = (_ref19 = (_ref20 = (_value$4 = value[3]) != null ? _value$4 : value[1]) != null ? _ref20 : value[0]) != null ? _ref19 : 0;
|
|
5305
5346
|
} else if (typeof value === "object") {
|
|
5306
|
-
|
|
5307
|
-
this.
|
|
5308
|
-
this.
|
|
5309
|
-
this.
|
|
5347
|
+
var _value$top, _value$right, _value$bottom, _value$left;
|
|
5348
|
+
this.paddingTop = (_value$top = value.top) != null ? _value$top : 0;
|
|
5349
|
+
this.paddingRight = (_value$right = value.right) != null ? _value$right : 0;
|
|
5350
|
+
this.paddingBottom = (_value$bottom = value.bottom) != null ? _value$bottom : 0;
|
|
5351
|
+
this.paddingLeft = (_value$left = value.left) != null ? _value$left : 0;
|
|
5310
5352
|
}
|
|
5311
5353
|
}
|
|
5312
5354
|
get padding() {
|
|
@@ -5444,7 +5486,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5444
5486
|
this.addChild(this.target);
|
|
5445
5487
|
}
|
|
5446
5488
|
if (mask) this.applyMask(mask);
|
|
5447
|
-
if (borderWidth) this.setBorder(borderWidth, borderColor
|
|
5489
|
+
if (borderWidth) this.setBorder(borderWidth, borderColor != null ? borderColor : 0);
|
|
5448
5490
|
}
|
|
5449
5491
|
applyMask(mask) {
|
|
5450
5492
|
this.maskData = mask;
|
|
@@ -5506,10 +5548,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5506
5548
|
this.init(this.options);
|
|
5507
5549
|
}
|
|
5508
5550
|
init(options) {
|
|
5509
|
-
var _options$items$this$s, _options$items$this$s2;
|
|
5551
|
+
var _options$selectedItem, _options$items$this$s, _options$items$this$s2, _options$items$this$s3;
|
|
5510
5552
|
this.options = options;
|
|
5511
|
-
this.selected = options.selectedItem
|
|
5512
|
-
this.value = (
|
|
5553
|
+
this.selected = (_options$selectedItem = options.selectedItem) != null ? _options$selectedItem : 0;
|
|
5554
|
+
this.value = (_options$items$this$s = (_options$items$this$s2 = options.items[this.selected]) === null || _options$items$this$s2 === void 0 ? void 0 : (_options$items$this$s3 = _options$items$this$s2.labelText) === null || _options$items$this$s3 === void 0 ? void 0 : _options$items$this$s3.text) != null ? _options$items$this$s : "";
|
|
5513
5555
|
if (this.innerView) {
|
|
5514
5556
|
this.innerView.type = options.type;
|
|
5515
5557
|
this.innerView.elementsMargin = options.elementsMargin;
|
|
@@ -5542,15 +5584,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5542
5584
|
});
|
|
5543
5585
|
}
|
|
5544
5586
|
selectItem(id) {
|
|
5545
|
-
var _this$options$items$i;
|
|
5587
|
+
var _this$options$items$i, _this$options$items$i2;
|
|
5546
5588
|
this.items.forEach((item, key) => {
|
|
5547
5589
|
item.forceCheck(key === id);
|
|
5548
5590
|
});
|
|
5549
5591
|
if (this.selected !== id) {
|
|
5550
|
-
var _this$items$id$labelT;
|
|
5551
|
-
this.onChange.emit(id, (
|
|
5592
|
+
var _this$items$id$labelT, _this$items$id$labelT2;
|
|
5593
|
+
this.onChange.emit(id, (_this$items$id$labelT = (_this$items$id$labelT2 = this.items[id].labelText) === null || _this$items$id$labelT2 === void 0 ? void 0 : _this$items$id$labelT2.text) != null ? _this$items$id$labelT : "");
|
|
5552
5594
|
}
|
|
5553
|
-
this.value = (
|
|
5595
|
+
this.value = (_this$options$items$i = (_this$options$items$i2 = this.options.items[id].labelText) === null || _this$options$items$i2 === void 0 ? void 0 : _this$options$items$i2.text) != null ? _this$options$items$i : "";
|
|
5554
5596
|
this.selected = id;
|
|
5555
5597
|
}
|
|
5556
5598
|
}
|
|
@@ -5590,7 +5632,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5590
5632
|
scrollBox,
|
|
5591
5633
|
visibleItems
|
|
5592
5634
|
}) {
|
|
5593
|
-
TextClass = TextClass
|
|
5635
|
+
TextClass = TextClass != null ? TextClass : pixi_js.Text;
|
|
5594
5636
|
if (this.openView && this.openView !== openBG) {
|
|
5595
5637
|
this.view.removeChild(this.openView);
|
|
5596
5638
|
}
|
|
@@ -5611,7 +5653,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5611
5653
|
text: items !== null && items !== void 0 && items.items ? items.items[0] : "",
|
|
5612
5654
|
style: textStyle
|
|
5613
5655
|
});
|
|
5614
|
-
this.openButton.textOffset = selectedTextOffset
|
|
5656
|
+
this.openButton.textOffset = selectedTextOffset != null ? selectedTextOffset : {};
|
|
5615
5657
|
}
|
|
5616
5658
|
if (this.openView !== openBG) {
|
|
5617
5659
|
this.openView = getView(openBG);
|
|
@@ -5641,7 +5683,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5641
5683
|
text: items !== null && items !== void 0 && items.items ? items.items[0] : "",
|
|
5642
5684
|
style: textStyle
|
|
5643
5685
|
});
|
|
5644
|
-
this.openButton.textOffset = selectedTextOffset
|
|
5686
|
+
this.openButton.textOffset = selectedTextOffset != null ? selectedTextOffset : {};
|
|
5645
5687
|
}
|
|
5646
5688
|
if (!this.scrollBox) {
|
|
5647
5689
|
this.scrollBox = new ScrollBox$1();
|
|
@@ -5653,14 +5695,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5653
5695
|
type: "vertical",
|
|
5654
5696
|
elementsMargin: 0,
|
|
5655
5697
|
width: this.openButton.width,
|
|
5656
|
-
height: this.openButton.height * (visibleItems
|
|
5698
|
+
height: this.openButton.height * (visibleItems != null ? visibleItems : defaultVisibleItems),
|
|
5657
5699
|
radius: 0,
|
|
5658
5700
|
padding: 0
|
|
5659
5701
|
}, scrollBox));
|
|
5660
5702
|
this.scrollBox.y = this.openButton.height;
|
|
5661
5703
|
if (scrollBox !== null && scrollBox !== void 0 && scrollBox.offset) {
|
|
5662
|
-
|
|
5663
|
-
this.scrollBox.
|
|
5704
|
+
var _scrollBox$offset$x, _scrollBox$offset$y;
|
|
5705
|
+
this.scrollBox.x = (_scrollBox$offset$x = scrollBox.offset.x) != null ? _scrollBox$offset$x : 0;
|
|
5706
|
+
this.scrollBox.y += (_scrollBox$offset$y = scrollBox.offset.y) != null ? _scrollBox$offset$y : 0;
|
|
5664
5707
|
}
|
|
5665
5708
|
this.addItems(items, selected);
|
|
5666
5709
|
}
|
|
@@ -5669,14 +5712,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5669
5712
|
var _this$scrollBox;
|
|
5670
5713
|
const text = button.text;
|
|
5671
5714
|
if (id === selected) {
|
|
5672
|
-
this.openButton.text = text
|
|
5673
|
-
this.closeButton.text = text
|
|
5715
|
+
this.openButton.text = text != null ? text : "";
|
|
5716
|
+
this.closeButton.text = text != null ? text : "";
|
|
5674
5717
|
}
|
|
5675
5718
|
button.onPress.connect(() => {
|
|
5676
5719
|
this.value = id;
|
|
5677
|
-
this.onSelect.emit(id, text
|
|
5678
|
-
this.openButton.text = text
|
|
5679
|
-
this.closeButton.text = text
|
|
5720
|
+
this.onSelect.emit(id, text != null ? text : "");
|
|
5721
|
+
this.openButton.text = text != null ? text : "";
|
|
5722
|
+
this.closeButton.text = text != null ? text : "";
|
|
5680
5723
|
this.close();
|
|
5681
5724
|
});
|
|
5682
5725
|
(_this$scrollBox = this.scrollBox) === null || _this$scrollBox === void 0 ? void 0 : _this$scrollBox.addItem(button);
|
|
@@ -5708,11 +5751,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5708
5751
|
TextClass,
|
|
5709
5752
|
radius
|
|
5710
5753
|
}) {
|
|
5711
|
-
TextClass = TextClass
|
|
5754
|
+
TextClass = TextClass != null ? TextClass : pixi_js.Text;
|
|
5712
5755
|
const buttons = [];
|
|
5713
5756
|
items.forEach(item => {
|
|
5714
5757
|
const defaultView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(backgroundColor);
|
|
5715
|
-
const color = hoverColor
|
|
5758
|
+
const color = hoverColor != null ? hoverColor : backgroundColor;
|
|
5716
5759
|
const hoverView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(color);
|
|
5717
5760
|
const text = new TextClass({
|
|
5718
5761
|
text: item,
|
|
@@ -5738,6 +5781,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5738
5781
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5739
5782
|
class Slider$1 extends SliderBase {
|
|
5740
5783
|
constructor(options) {
|
|
5784
|
+
var _options$value;
|
|
5741
5785
|
super(_objectSpread({
|
|
5742
5786
|
slider1: options.slider,
|
|
5743
5787
|
value1: options.value
|
|
@@ -5747,7 +5791,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5747
5791
|
__publicField(this, "onChange", new dist.Signal());
|
|
5748
5792
|
this.sliderOptions = options;
|
|
5749
5793
|
this.step = options.step || 1;
|
|
5750
|
-
this.value = options.value
|
|
5794
|
+
this.value = (_options$value = options.value) != null ? _options$value : this.min;
|
|
5751
5795
|
this.updateSlider();
|
|
5752
5796
|
}
|
|
5753
5797
|
get value() {
|
|
@@ -5804,18 +5848,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5804
5848
|
(_this$onChange2 = this.onChange) === null || _this$onChange2 === void 0 ? void 0 : _this$onChange2.emit(this.value);
|
|
5805
5849
|
}
|
|
5806
5850
|
updateSlider() {
|
|
5807
|
-
var _this$bg9, _this$bg0, _this$sliderOptions3;
|
|
5851
|
+
var _this$value, _this$bg$width3, _this$bg9, _this$bg$height3, _this$bg0, _this$sliderOptions3;
|
|
5808
5852
|
if (!this._slider1) return;
|
|
5809
|
-
this.progress = ((this.value
|
|
5810
|
-
this._slider1.x = (((_this$bg9 = this.bg) === null || _this$bg9 === void 0 ? void 0 : _this$bg9.width)
|
|
5811
|
-
this._slider1.y = (((_this$bg0 = this.bg) === null || _this$bg0 === void 0 ? void 0 : _this$bg0.height)
|
|
5853
|
+
this.progress = (((_this$value = this.value) != null ? _this$value : this.min) - this.min) / (this.max - this.min) * 100;
|
|
5854
|
+
this._slider1.x = ((_this$bg$width3 = (_this$bg9 = this.bg) === null || _this$bg9 === void 0 ? void 0 : _this$bg9.width) != null ? _this$bg$width3 : 0) / 100 * this.progress - this._slider1.width / 2;
|
|
5855
|
+
this._slider1.y = ((_this$bg$height3 = (_this$bg0 = this.bg) === null || _this$bg0 === void 0 ? void 0 : _this$bg0.height) != null ? _this$bg$height3 : 0) / 2;
|
|
5812
5856
|
if ((_this$sliderOptions3 = this.sliderOptions) !== null && _this$sliderOptions3 !== void 0 && _this$sliderOptions3.showValue && this.value1Text) {
|
|
5813
|
-
var _this$sliderOptions$
|
|
5857
|
+
var _this$sliderOptions$v1, _this$sliderOptions$v10, _this$sliderOptions$v11, _this$sliderOptions$v12;
|
|
5814
5858
|
this.value1Text.text = `${Math.round(this.value)}`;
|
|
5815
5859
|
const sliderPosX = this._slider1.x + this._slider1.width / 2;
|
|
5816
5860
|
const sliderPosY = this._slider1.y;
|
|
5817
|
-
this.value1Text.x = sliderPosX + (((_this$sliderOptions$
|
|
5818
|
-
this.value1Text.y = sliderPosY + (((_this$sliderOptions$
|
|
5861
|
+
this.value1Text.x = sliderPosX + ((_this$sliderOptions$v1 = (_this$sliderOptions$v10 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v10 === void 0 ? void 0 : _this$sliderOptions$v10.x) != null ? _this$sliderOptions$v1 : 0);
|
|
5862
|
+
this.value1Text.y = sliderPosY + ((_this$sliderOptions$v11 = (_this$sliderOptions$v12 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v12 === void 0 ? void 0 : _this$sliderOptions$v12.y) != null ? _this$sliderOptions$v11 : 0);
|
|
5819
5863
|
}
|
|
5820
5864
|
}
|
|
5821
5865
|
set width(value) {
|
|
@@ -5946,6 +5990,43 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5946
5990
|
}
|
|
5947
5991
|
return null;
|
|
5948
5992
|
}
|
|
5993
|
+
function normalizeProgressFillViewRef(ref, fillPaddings, fallbackSize) {
|
|
5994
|
+
if (!ref) return ref;
|
|
5995
|
+
const paddings = normalizePaddings(fillPaddings);
|
|
5996
|
+
if (paddings.top === 0 && paddings.right === 0 && paddings.bottom === 0 && paddings.left === 0) {
|
|
5997
|
+
return ref;
|
|
5998
|
+
}
|
|
5999
|
+
const fallback = ref.fallback ? normalizeProgressFillViewRef(ref.fallback, paddings, fallbackSize) : undefined;
|
|
6000
|
+
if ('color' in ref) {
|
|
6001
|
+
const width = shrinkSize(ref.width, paddings.left + paddings.right);
|
|
6002
|
+
const height = shrinkSize(ref.height, paddings.top + paddings.bottom);
|
|
6003
|
+
return _extends(_extends(_extends({}, ref), {
|
|
6004
|
+
width,
|
|
6005
|
+
height,
|
|
6006
|
+
radius: shrinkRadius(ref.radius, width, height)
|
|
6007
|
+
}), fallback ? {
|
|
6008
|
+
fallback
|
|
6009
|
+
} : {});
|
|
6010
|
+
}
|
|
6011
|
+
if ('shape' in ref) {
|
|
6012
|
+
return _extends(_extends(_extends({}, ref), {
|
|
6013
|
+
shape: shrinkInlineShape(ref.shape, paddings, fallbackSize)
|
|
6014
|
+
}), fallback ? {
|
|
6015
|
+
fallback
|
|
6016
|
+
} : {});
|
|
6017
|
+
}
|
|
6018
|
+
if ('ui' in ref) {
|
|
6019
|
+
return _extends(_extends(_extends({}, ref), {
|
|
6020
|
+
ui: shrinkInlineShape(ref.ui, paddings, fallbackSize)
|
|
6021
|
+
}), fallback ? {
|
|
6022
|
+
fallback
|
|
6023
|
+
} : {});
|
|
6024
|
+
}
|
|
6025
|
+
if (fallback) return _extends(_extends({}, ref), {
|
|
6026
|
+
fallback
|
|
6027
|
+
});
|
|
6028
|
+
return ref;
|
|
6029
|
+
}
|
|
5949
6030
|
function wrapBorrowedEntityView(childContainer, childName) {
|
|
5950
6031
|
const wrapper = new pixi_js.Container();
|
|
5951
6032
|
wrapper.label = childName ? `${childName}:view-ref` : 'plugin-ui-view-ref';
|
|
@@ -5967,27 +6048,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
5967
6048
|
}
|
|
5968
6049
|
}
|
|
5969
6050
|
function drawInlineShape(shape) {
|
|
5970
|
-
var _a, _b, _c;
|
|
6051
|
+
var _a, _b, _c, _d, _e;
|
|
5971
6052
|
if (!shape || !shape.type) return null;
|
|
5972
6053
|
const g = new pixi_js.Graphics();
|
|
5973
6054
|
const {
|
|
5974
6055
|
style
|
|
5975
6056
|
} = shape;
|
|
5976
|
-
const
|
|
5977
|
-
const
|
|
5978
|
-
const
|
|
6057
|
+
const x = (_a = style.x) !== null && _a !== void 0 ? _a : 0;
|
|
6058
|
+
const y = (_b = style.y) !== null && _b !== void 0 ? _b : 0;
|
|
6059
|
+
const w = (_c = style.width) !== null && _c !== void 0 ? _c : 0;
|
|
6060
|
+
const h = (_d = style.height) !== null && _d !== void 0 ? _d : 0;
|
|
6061
|
+
const r = (_e = style.radius) !== null && _e !== void 0 ? _e : 0;
|
|
5979
6062
|
switch (shape.type) {
|
|
5980
6063
|
case 'rect':
|
|
5981
|
-
g
|
|
6064
|
+
drawRect(g, x, y, w, h);
|
|
5982
6065
|
break;
|
|
5983
6066
|
case 'roundedRect':
|
|
5984
|
-
g
|
|
6067
|
+
drawRoundedRect(g, x, y, w, h, r);
|
|
5985
6068
|
break;
|
|
5986
6069
|
case 'circle':
|
|
5987
|
-
g
|
|
6070
|
+
drawCircle(g, x + r, y + r, r);
|
|
5988
6071
|
break;
|
|
5989
6072
|
case 'ellipse':
|
|
5990
|
-
g
|
|
6073
|
+
drawEllipse(g, x + w / 2, y + h / 2, w / 2, h / 2);
|
|
5991
6074
|
break;
|
|
5992
6075
|
}
|
|
5993
6076
|
if (style.fill !== undefined) g.fill(style.fill);
|
|
@@ -6014,6 +6097,81 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
6014
6097
|
} catch (_) {}
|
|
6015
6098
|
return g;
|
|
6016
6099
|
}
|
|
6100
|
+
function drawRect(g, x, y, width, height) {
|
|
6101
|
+
const anyGraphics = g;
|
|
6102
|
+
if (typeof anyGraphics.rect === 'function') {
|
|
6103
|
+
anyGraphics.rect(x, y, width, height);
|
|
6104
|
+
return;
|
|
6105
|
+
}
|
|
6106
|
+
anyGraphics.drawRect(x, y, width, height);
|
|
6107
|
+
}
|
|
6108
|
+
function drawRoundedRect(g, x, y, width, height, radius) {
|
|
6109
|
+
const anyGraphics = g;
|
|
6110
|
+
if (typeof anyGraphics.roundRect === 'function') {
|
|
6111
|
+
anyGraphics.roundRect(x, y, width, height, radius);
|
|
6112
|
+
return;
|
|
6113
|
+
}
|
|
6114
|
+
anyGraphics.drawRoundedRect(x, y, width, height, radius);
|
|
6115
|
+
}
|
|
6116
|
+
function drawCircle(g, x, y, radius) {
|
|
6117
|
+
const anyGraphics = g;
|
|
6118
|
+
if (typeof anyGraphics.circle === 'function') {
|
|
6119
|
+
anyGraphics.circle(x, y, radius);
|
|
6120
|
+
return;
|
|
6121
|
+
}
|
|
6122
|
+
anyGraphics.drawCircle(x, y, radius);
|
|
6123
|
+
}
|
|
6124
|
+
function drawEllipse(g, x, y, halfWidth, halfHeight) {
|
|
6125
|
+
const anyGraphics = g;
|
|
6126
|
+
if (typeof anyGraphics.ellipse === 'function') {
|
|
6127
|
+
anyGraphics.ellipse(x, y, halfWidth, halfHeight);
|
|
6128
|
+
return;
|
|
6129
|
+
}
|
|
6130
|
+
anyGraphics.drawEllipse(x, y, halfWidth, halfHeight);
|
|
6131
|
+
}
|
|
6132
|
+
function normalizePaddings(fillPaddings) {
|
|
6133
|
+
return {
|
|
6134
|
+
top: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.top),
|
|
6135
|
+
right: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.right),
|
|
6136
|
+
bottom: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.bottom),
|
|
6137
|
+
left: readPadding(fillPaddings === null || fillPaddings === void 0 ? void 0 : fillPaddings.left)
|
|
6138
|
+
};
|
|
6139
|
+
}
|
|
6140
|
+
function readPadding(value) {
|
|
6141
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) return 0;
|
|
6142
|
+
return Math.max(0, value);
|
|
6143
|
+
}
|
|
6144
|
+
function shrinkSize(value, inset) {
|
|
6145
|
+
return Math.max(0, value - inset);
|
|
6146
|
+
}
|
|
6147
|
+
function shrinkOptionalSize(value, fallback, inset) {
|
|
6148
|
+
if (typeof value === 'number') return shrinkSize(value, inset);
|
|
6149
|
+
if (typeof fallback === 'number') return shrinkSize(fallback, inset);
|
|
6150
|
+
return value;
|
|
6151
|
+
}
|
|
6152
|
+
function shrinkRadius(radius, width, height) {
|
|
6153
|
+
if (typeof radius !== 'number' || !Number.isFinite(radius)) return radius;
|
|
6154
|
+
const limits = [radius];
|
|
6155
|
+
if (typeof width === 'number') limits.push(width / 2);
|
|
6156
|
+
if (typeof height === 'number') limits.push(height / 2);
|
|
6157
|
+
return Math.max(0, Math.min(...limits));
|
|
6158
|
+
}
|
|
6159
|
+
function shrinkInlineShape(shape, paddings, fallbackSize) {
|
|
6160
|
+
var _a;
|
|
6161
|
+
const style = (_a = shape.style) !== null && _a !== void 0 ? _a : {};
|
|
6162
|
+
const width = shrinkOptionalSize(style.width, fallbackSize === null || fallbackSize === void 0 ? void 0 : fallbackSize.width, paddings.left + paddings.right);
|
|
6163
|
+
const height = shrinkOptionalSize(style.height, fallbackSize === null || fallbackSize === void 0 ? void 0 : fallbackSize.height, paddings.top + paddings.bottom);
|
|
6164
|
+
const radius = shrinkRadius(style.radius, width, height);
|
|
6165
|
+
return _extends(_extends({}, shape), {
|
|
6166
|
+
style: _extends(_extends(_extends(_extends({}, style), width !== undefined ? {
|
|
6167
|
+
width
|
|
6168
|
+
} : {}), height !== undefined ? {
|
|
6169
|
+
height
|
|
6170
|
+
} : {}), radius !== undefined ? {
|
|
6171
|
+
radius
|
|
6172
|
+
} : {})
|
|
6173
|
+
});
|
|
6174
|
+
}
|
|
6017
6175
|
function findChildEntity$1(go, name) {
|
|
6018
6176
|
var _a, _b, _c;
|
|
6019
6177
|
if (typeof go.findChildByName === 'function') {
|
|
@@ -8874,11 +9032,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
|
|
|
8874
9032
|
function inlineResolveSpecialViews(name, c, game, go) {
|
|
8875
9033
|
switch (name) {
|
|
8876
9034
|
case 'ProgressBar':
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
9035
|
+
{
|
|
9036
|
+
const fillView = c.nineSliceSprite ? c.fillView : normalizeProgressFillViewRef(c.fillView, c.fillPaddings, {
|
|
9037
|
+
width: c.width,
|
|
9038
|
+
height: c.height
|
|
9039
|
+
});
|
|
9040
|
+
c.__resolved_bg = resolveViewRef(game, go, c.bgView);
|
|
9041
|
+
c.__resolved_fill = resolveViewRef(game, go, fillView);
|
|
9042
|
+
c.__resolved_bg_view = c.nineSliceSprite && c.bgView && 'texture' in c.bgView ? c.bgView.texture : c.__resolved_bg;
|
|
9043
|
+
c.__resolved_fill_view = c.nineSliceSprite && c.fillView && 'texture' in c.fillView ? c.fillView.texture : c.__resolved_fill;
|
|
9044
|
+
break;
|
|
9045
|
+
}
|
|
8882
9046
|
case 'Select':
|
|
8883
9047
|
c.__resolved_closedView = resolveViewRef(game, go, c.closedView);
|
|
8884
9048
|
c.__resolved_openView = resolveViewRef(game, go, c.openView);
|