@wavemaker/app-rn-runtime 11.6.1-rc.5513 → 11.6.1-rc.5518
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.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +7 -9
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +11 -27
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.props.js +1 -0
- app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -2
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.props.js +0 -1
- app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +15 -2
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +4 -9
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +29 -41
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js +4 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +2 -8
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +0 -1
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +8 -11
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +0 -6
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +2 -0
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +6 -19
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +2 -4
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +1 -7
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +3 -5
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +16 -44
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +0 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -10
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js +0 -1
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +12 -2
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +8 -13
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +2 -24
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +0 -6
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +1 -0
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.props.js +1 -0
- app-rn-runtime/components/data/form/form-action/form-action.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -5
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +64 -8
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +0 -3
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +2 -2
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +5 -5
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -5
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +9 -18
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +0 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.props.js +1 -1
- app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +17 -3
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.props.js +1 -0
- app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +19 -1
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +68 -6
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
- app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
- app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +1 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +49 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
- app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
- app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +11 -1
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.props.js +1 -0
- app-rn-runtime/components/input/number/number.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +17 -0
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +2 -6
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +3 -2
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +11 -0
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +1 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +17 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +11 -0
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +3 -2
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -6
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +0 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +0 -6
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +2 -0
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js +84 -0
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.component.js +43 -9
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js +54 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +17 -5
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/floatinglabel.component.js +45 -0
- app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
- app-rn-runtime/core/components/textinput.component.js +9 -1
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/formatters.js +1 -14
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +36 -49
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +34 -1
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +5 -3
- app-rn-runtime/runtime/App.js +13 -7
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +2 -1
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +11 -3
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +23 -8
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js +1 -0
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +12 -1
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/theme.js +32 -12
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +7 -3
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/device/device/network-info.operation.js +23 -3
- app-rn-runtime/variables/device/device/network-info.operation.js.map +1 -1
- app-rn-runtime/variables/device/operation.provider.js.map +1 -1
- app-rn-runtime/variables/device-variable.js +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/model-variable.js +1 -2
- app-rn-runtime/variables/model-variable.js.map +1 -1
|
@@ -7,10 +7,8 @@ import { Platform, View } from "react-native";
|
|
|
7
7
|
import { TouchableOpacity } from "react-native";
|
|
8
8
|
import { get } from "lodash";
|
|
9
9
|
import injector from "./injector";
|
|
10
|
-
export
|
|
11
|
-
export class SyntheticEvent {
|
|
10
|
+
export class TapEvent {
|
|
12
11
|
constructor() {
|
|
13
|
-
// as the event is being used in onPress, onPressOut and onLongTap the TapEvent is renamed to SyntheticEvent
|
|
14
12
|
_defineProperty(this, "propagationEnabled", true);
|
|
15
13
|
}
|
|
16
14
|
stopPropagation() {
|
|
@@ -24,96 +22,85 @@ export class Tappable extends React.Component {
|
|
|
24
22
|
_defineProperty(this, "lastTap", 0);
|
|
25
23
|
_defineProperty(this, "lastDoubleTap", 0);
|
|
26
24
|
_defineProperty(this, "isLongTap", false);
|
|
27
|
-
_defineProperty(this, "parent", null);
|
|
28
25
|
}
|
|
29
26
|
onPress(e) {
|
|
30
27
|
var _this$props$target;
|
|
31
28
|
this.lastPress = Date.now();
|
|
32
29
|
const target = this.props.target;
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (!Tappable.CURRENT_EVENT) {
|
|
31
|
+
Tappable.CURRENT_EVENT = new TapEvent();
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
Tappable.CURRENT_EVENT = null;
|
|
34
|
+
}, 10);
|
|
35
|
+
}
|
|
36
|
+
const syntheticEvent = Tappable.CURRENT_EVENT;
|
|
37
|
+
this.props.onTouchStart && this.props.onTouchStart(e || syntheticEvent);
|
|
38
|
+
(_this$props$target = this.props.target) === null || _this$props$target === void 0 ? void 0 : _this$props$target.invokeEventCallback('onTouchstart', [syntheticEvent, this.props.target]);
|
|
35
39
|
const currentTime = Date.now();
|
|
36
40
|
const tapDelta = currentTime - this.lastTap;
|
|
37
41
|
if (this.isLongTap) {
|
|
38
42
|
this.isLongTap = false;
|
|
39
43
|
return;
|
|
40
44
|
}
|
|
41
|
-
if (
|
|
45
|
+
if (syntheticEvent.propagationEnabled) {
|
|
42
46
|
var _injector$FOCUSED_ELE;
|
|
43
47
|
(_injector$FOCUSED_ELE = injector.FOCUSED_ELEMENT.get()) === null || _injector$FOCUSED_ELE === void 0 ? void 0 : _injector$FOCUSED_ELE.blur();
|
|
44
48
|
if (this.lastDoubleTap !== this.lastTap && tapDelta < 500) {
|
|
45
49
|
this.props.onDoubleTap && this.props.onDoubleTap(e);
|
|
46
50
|
setTimeout(() => {
|
|
47
|
-
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onDoubletap', [
|
|
51
|
+
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onDoubletap', [syntheticEvent, target]);
|
|
48
52
|
}, 200);
|
|
49
53
|
this.lastDoubleTap = currentTime;
|
|
50
54
|
}
|
|
51
55
|
setTimeout(() => {
|
|
52
|
-
var _this$parent;
|
|
53
56
|
if (this.props.onTap) {
|
|
54
|
-
this.props.onTap(e);
|
|
57
|
+
this.props.onTap(e || syntheticEvent);
|
|
55
58
|
} else {
|
|
56
|
-
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onTap', [
|
|
59
|
+
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onTap', [syntheticEvent, target]);
|
|
57
60
|
}
|
|
58
|
-
(_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.onPress(e);
|
|
59
61
|
}, 200);
|
|
60
62
|
this.lastTap = currentTime;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
onLongTap(e) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
this.props.onLongTap && this.props.onLongTap(e);
|
|
66
|
+
const syntheticEvent = Tappable.CURRENT_EVENT;
|
|
67
|
+
this.props.onLongTap && this.props.onLongTap(e || syntheticEvent);
|
|
68
68
|
setTimeout(() => {
|
|
69
|
-
var _this$props$target2
|
|
70
|
-
(_this$props$target2 = this.props.target) === null || _this$props$target2 === void 0 ? void 0 : _this$props$target2.invokeEventCallback('onLongtap', [
|
|
71
|
-
(_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.onPressOut(e);
|
|
69
|
+
var _this$props$target2;
|
|
70
|
+
(_this$props$target2 = this.props.target) === null || _this$props$target2 === void 0 ? void 0 : _this$props$target2.invokeEventCallback('onLongtap', [syntheticEvent, this.props.target]);
|
|
72
71
|
}, 200);
|
|
73
72
|
this.isLongTap = true;
|
|
74
73
|
}
|
|
75
74
|
onPressOut(e) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
this.props.onTouchEnd && this.props.onTouchEnd(e);
|
|
75
|
+
const syntheticEvent = Tappable.CURRENT_EVENT;
|
|
76
|
+
this.props.onTouchEnd && this.props.onTouchEnd(e || syntheticEvent);
|
|
80
77
|
setTimeout(() => {
|
|
81
|
-
var _this$props$target3
|
|
82
|
-
(_this$props$target3 = this.props.target) === null || _this$props$target3 === void 0 ? void 0 : _this$props$target3.invokeEventCallback('onTouchend', [
|
|
83
|
-
(_this$parent3 = this.parent) === null || _this$parent3 === void 0 ? void 0 : _this$parent3.onPressOut(e);
|
|
78
|
+
var _this$props$target3;
|
|
79
|
+
(_this$props$target3 = this.props.target) === null || _this$props$target3 === void 0 ? void 0 : _this$props$target3.invokeEventCallback('onTouchend', [syntheticEvent, this.props.target]);
|
|
84
80
|
}, 200);
|
|
85
81
|
this.isLongTap = false;
|
|
86
82
|
}
|
|
87
|
-
setParent(parent) {
|
|
88
|
-
if (parent && this.parent !== parent) {
|
|
89
|
-
this.parent = parent;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
83
|
render() {
|
|
93
84
|
const target = this.props.target;
|
|
94
85
|
if (target !== null && target !== void 0 && target.props.onTap || target !== null && target !== void 0 && target.props.onLongtap || target !== null && target !== void 0 && target.props.onDoubletap || this.props.onTap || this.props.onLongTap || this.props.onDoubleTap) {
|
|
95
|
-
return /*#__PURE__*/React.createElement(
|
|
96
|
-
this.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onPress: e => this.onPress(new SyntheticEvent()),
|
|
109
|
-
onLongPress: e => this.onLongTap(new SyntheticEvent()),
|
|
110
|
-
onPressOut: e => this.onPressOut(new SyntheticEvent())
|
|
111
|
-
}), /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children)));
|
|
112
|
-
});
|
|
86
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, Platform.OS === 'android' || Platform.OS === 'web' ? {
|
|
87
|
+
accessibilityLabel: this.props.testID,
|
|
88
|
+
testID: this.props.testID
|
|
89
|
+
} : {
|
|
90
|
+
accessible: false,
|
|
91
|
+
testID: this.props.testID
|
|
92
|
+
}, {
|
|
93
|
+
disabled: get(target === null || target === void 0 ? void 0 : target.proxy, 'disabled'),
|
|
94
|
+
style: this.props.styles,
|
|
95
|
+
onPress: () => this.onPress(),
|
|
96
|
+
onPressOut: () => this.onPressOut(),
|
|
97
|
+
onLongPress: () => this.onLongTap()
|
|
98
|
+
}), this.props.children);
|
|
113
99
|
}
|
|
114
100
|
return /*#__PURE__*/React.createElement(View, {
|
|
115
101
|
style: this.props.styles
|
|
116
102
|
}, this.props.children);
|
|
117
103
|
}
|
|
118
104
|
}
|
|
105
|
+
_defineProperty(Tappable, "CURRENT_EVENT", null);
|
|
119
106
|
//# sourceMappingURL=tappable.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","TouchableOpacity","get","injector","ParentTappableContext","createContext","SyntheticEvent","constructor","_defineProperty","stopPropagation","propagationEnabled","Tappable","Component","props","onPress","e","_this$props$target","lastPress","Date","now","target","onTouchStart","invokeEventCallback","currentTime","tapDelta","lastTap","isLongTap","_injector$FOCUSED_ELE","FOCUSED_ELEMENT","blur","lastDoubleTap","onDoubleTap","setTimeout","_this$parent","onTap","parent","onLongTap","_this$props$target2","_this$parent2","onPressOut","onTouchEnd","_this$props$target3","_this$parent3","setParent","render","onLongtap","onDoubletap","createElement","Consumer","Provider","value","_extends","OS","accessibilityLabel","testID","accessible","disabled","proxy","style","styles","onLongPress","Fragment","children"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, Platform, View } from \"react-native\";\nimport { TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\n\nexport const ParentTappableContext = React.createContext<Tappable>(null as any);\ninterface TappableProps {\n testID?: string;\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onLongTap?: (e: any) => void; \n onDoubleTap?: (e: any) => void;\n onTouchStart? : (e: any) => void;\n onTouchEnd? : (e: any) => void;\n rippleColor?: string;\n}\n\nexport class SyntheticEvent {\n // as the event is being used in onPress, onPressOut and onLongTap the TapEvent is renamed to SyntheticEvent\n propagationEnabled = true;\n \n constructor() {\n\n }\n\n stopPropagation() {\n this.propagationEnabled = false;\n }\n}\n\nexport class Tappable extends React.Component<TappableProps, any> {\n private lastPress = 0;\n private lastTap = 0;\n private lastDoubleTap = 0;\n private isLongTap = false;\n private parent:Tappable = null as any;\n \n constructor(props: any) {\n super(props);\n }\n\n onPress(e: SyntheticEvent): void { \n this.lastPress = Date.now();\n const target = this.props.target;\n this.props.onTouchStart && this.props.onTouchStart(e);\n this.props.target?.invokeEventCallback('onTouchstart', [e, this.props.target]);\n const currentTime = Date.now();\n const tapDelta = currentTime - this.lastTap;\n if (this.isLongTap) {\n this.isLongTap = false;\n return;\n }\n if (e.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(this.lastDoubleTap !== this.lastTap \n && tapDelta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [e, target]);\n }, 200);\n this.lastDoubleTap = currentTime;\n }\n setTimeout(() => {\n if (this.props.onTap) {\n this.props.onTap(e);\n } else {\n target?.invokeEventCallback('onTap', [e, target]);\n }\n this.parent?.onPress(e);\n }, 200);\n this.lastTap = currentTime;\n }\n }\n\n onLongTap(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n }\n this.props.onLongTap && this.props.onLongTap(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onLongtap', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = true;\n }\n \n onPressOut(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n } \n this.props.onTouchEnd && this.props.onTouchEnd(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onTouchend', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = false;\n }\n private setParent(parent: Tappable) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n }\n }\n\n render() {\n const target = this.props.target;\n if (target?.props.onTap \n || target?.props.onLongtap \n || target?.props.onDoubletap \n || this.props.onTap \n || this.props.onLongTap \n || this.props.onDoubleTap) {\n return (\n <ParentTappableContext.Consumer>{(parent) => {\n this.setParent(parent);\n return( <ParentTappableContext.Provider value={this}>\n <TouchableOpacity\n {...(Platform.OS === 'android' || Platform.OS === 'web') ? {\n accessibilityLabel: this.props.testID,\n testID: this.props.testID\n }: {\n accessible: false,\n testID: this.props.testID\n }} \n disabled={get(target?.proxy, 'disabled')}\n style={this.props.styles}\n onPress={(e?: GestureResponderEvent) => this.onPress(new SyntheticEvent())}\n onLongPress={(e?: GestureResponderEvent) => this.onLongTap(new SyntheticEvent())}\n onPressOut={(e?: GestureResponderEvent) => this.onPressOut(new SyntheticEvent())}>\n <>{this.props.children}</>\n </TouchableOpacity>\n </ParentTappableContext.Provider>)}}</ParentTappableContext.Consumer>\n \n );\n }\n return (<View style={this.props.styles}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AACpE,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AAEjC,OAAO,MAAMC,qB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AC7ER,KAAA,CAAAiD,aAAA,CAAAjD,KAAA,CAAA+D,QAAA,QAAG,IAAI,CAAChD,KAAK,CAACiD,QAAW,CACX,CACc,CAAC;MAAC,CAAkC,CAAC;IAG7E;IACA,oBAAQhE,KAAA,CAAAiD,aAAA,CAAC/C,IAAI;MAAC0D,KAAK,EAAE,IAAI,CAAC7C,KAAK,CAAC8C;IAAO,GAAE,IAAI,CAAC9C,KAAK,CAACiD,QAAe,CAAC;EACxE;AACJ"}
|
|
1
|
+
{"version":3,"names":["React","Platform","View","TouchableOpacity","get","injector","TapEvent","constructor","_defineProperty","stopPropagation","propagationEnabled","Tappable","Component","props","onPress","e","_this$props$target","lastPress","Date","now","target","CURRENT_EVENT","setTimeout","syntheticEvent","onTouchStart","invokeEventCallback","currentTime","tapDelta","lastTap","isLongTap","_injector$FOCUSED_ELE","FOCUSED_ELEMENT","blur","lastDoubleTap","onDoubleTap","onTap","onLongTap","_this$props$target2","onPressOut","onTouchEnd","_this$props$target3","render","onLongtap","onDoubletap","createElement","_extends","OS","accessibilityLabel","testID","accessible","disabled","proxy","style","styles","onLongPress","children"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, Platform, View } from \"react-native\";\nimport { TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\n\ninterface TappableProps {\n testID?: string;\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onLongTap?: (e: any) => void; \n onDoubleTap?: (e: any) => void;\n onTouchStart? : (e: any) => void;\n onTouchEnd? : (e: any) => void;\n}\n\nexport class TapEvent {\n propagationEnabled = true;\n\n constructor() {\n\n }\n\n stopPropagation() {\n this.propagationEnabled = false;\n }\n}\n\nexport class Tappable extends React.Component<TappableProps, any> {\n private lastPress = 0;\n private lastTap = 0;\n private lastDoubleTap = 0;\n private isLongTap = false;\n\n static CURRENT_EVENT: TapEvent = null as any;\n\n constructor(props: any) {\n super(props);\n }\n\n onPress(e?: GestureResponderEvent): void { \n this.lastPress = Date.now();\n const target = this.props.target;\n if (!Tappable.CURRENT_EVENT) {\n Tappable.CURRENT_EVENT = new TapEvent();\n setTimeout(() => {\n Tappable.CURRENT_EVENT = null as any;\n }, 10);\n }\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onTouchStart && this.props.onTouchStart(e || syntheticEvent);\n this.props.target?.invokeEventCallback('onTouchstart', [syntheticEvent, this.props.target]);\n const currentTime = Date.now();\n const tapDelta = currentTime - this.lastTap;\n if (this.isLongTap) {\n this.isLongTap = false;\n return;\n }\n if (syntheticEvent.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(this.lastDoubleTap !== this.lastTap \n && tapDelta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [syntheticEvent, target]);\n }, 200);\n this.lastDoubleTap = currentTime;\n }\n setTimeout(() => {\n if (this.props.onTap) {\n this.props.onTap(e || syntheticEvent);\n } else {\n target?.invokeEventCallback('onTap', [syntheticEvent, target]);\n }\n }, 200);\n this.lastTap = currentTime;\n }\n }\n\n onLongTap(e?: GestureResponderEvent): void {\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onLongTap && this.props.onLongTap(e || syntheticEvent);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onLongtap', [syntheticEvent, this.props.target]);\n }, 200);\n this.isLongTap = true;\n }\n \n onPressOut(e?: GestureResponderEvent): void {\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onTouchEnd && this.props.onTouchEnd(e || syntheticEvent);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onTouchend', [syntheticEvent, this.props.target]);\n }, 200);\n this.isLongTap = false;\n }\n\n render() {\n const target = this.props.target;\n if (target?.props.onTap \n || target?.props.onLongtap \n || target?.props.onDoubletap \n || this.props.onTap \n || this.props.onLongTap \n || this.props.onDoubleTap) {\n return (\n <TouchableOpacity \n {...(Platform.OS === 'android' || Platform.OS === 'web') ? {\n accessibilityLabel: this.props.testID,\n testID: this.props.testID\n }: {\n accessible: false,\n testID: this.props.testID\n }} \n disabled={get(target?.proxy, 'disabled')}\n style={this.props.styles}\n onPress={() => this.onPress()}\n onPressOut={() => this.onPressOut()}\n onLongPress={() => this.onLongTap()}>\n {this.props.children}\n </TouchableOpacity>\n );\n }\n return (<View style={this.props.styles}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AACpE,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AAcjC,OAAO,MAAMC,QAAQ,CAAC;EAGlBC,WAAWA,CAAA,EAAG;IAAAC,eAAA,6BAFO,IAAI;EAIzB;EAEAC,eAAeA,CAAA,EAAG;IACd,IAAI,CAACC,kBAAkB,GAAG,KAAK;EACnC;AACJ;AAEA,OAAO,MAAMC,QAAQ,SAASX,KAAK,CAACY,SAAS,CAAqB;EAQ9DL,WAAWA,CAACM,KAAU,EAAE;IACpB,KAAK,CAACA,KAAK,CAAC;IAACL,eAAA,oBARG,CAAC;IAAAA,eAAA,kBACH,CAAC;IAAAA,eAAA,wBACK,CAAC;IAAAA,eAAA,oBACL,KAAK;EAMzB;EAEAM,OAAOA,CAACC,CAAyB,EAAQ;IAAA,IAAAC,kBAAA;IACrC,IAAI,CAACC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IAC3B,MAAMC,MAAM,GAAG,IAAI,CAACP,KAAK,CAACO,MAAM;IAChC,IAAI,CAACT,QAAQ,CAACU,aAAa,EAAE;MACzBV,QAAQ,CAACU,aAAa,GAAG,IAAIf,QAAQ,CAAC,CAAC;MACvCgB,UAAU,CAAC,MAAM;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BAAQvD,KAAA,CAAA4C,aAAA,CAAC1C,IAAI;MAACkD,KAAK,EAAE,IAAI,CAACvC,KAAK,CAACwC;IAAO,GAAE,IAAI,CAACxC,KAAK,CAAC0C,QAAe,CAAC;EACxE;AACJ;AAAC/C,eAAA,CAjGYG,QAAQ,mBAMgB,IAAI"}
|
|
@@ -50,8 +50,33 @@ export class View extends React.Component {
|
|
|
50
50
|
threshold: props.threshold || 30,
|
|
51
51
|
bounds: {}
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
var touchStart = {
|
|
54
|
+
x: 0,
|
|
55
|
+
y: 0,
|
|
56
|
+
active: false
|
|
57
|
+
};
|
|
58
|
+
this.gesture.maxPointers(1).minDistance(this.state.threshold).enabled(this.props.enableGestures && !isWebPreviewMode()).onTouchesDown((e, s) => {
|
|
59
|
+
touchStart = {
|
|
60
|
+
x: e.changedTouches[0].x,
|
|
61
|
+
y: e.changedTouches[0].y,
|
|
62
|
+
active: false
|
|
63
|
+
};
|
|
64
|
+
}).onTouchesMove((e, s) => {
|
|
65
|
+
if (touchStart.active) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const translationX = e.allTouches[0].x - touchStart.x;
|
|
69
|
+
const translationY = e.allTouches[0].y - touchStart.y;
|
|
70
|
+
const d = this.state.isHorizontal ? translationX : translationY;
|
|
71
|
+
const od = this.state.isHorizontal ? translationY : translationX;
|
|
72
|
+
if (Math.abs(d) >= this.state.threshold && Math.abs(od) < Math.tan(15 * Math.PI / 180) * this.state.threshold) {
|
|
73
|
+
touchStart.active = true;
|
|
74
|
+
}
|
|
75
|
+
}).onChange(e => {
|
|
54
76
|
var _this$props$handlers, _this$props$handlers2;
|
|
77
|
+
if (!touchStart.active) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
55
80
|
const bounds = ((_this$props$handlers = this.props.handlers) === null || _this$props$handlers === void 0 ? void 0 : _this$props$handlers.bounds) && ((_this$props$handlers2 = this.props.handlers) === null || _this$props$handlers2 === void 0 ? void 0 : _this$props$handlers2.bounds(e)) || {};
|
|
56
81
|
const d = this.state.isHorizontal ? e.translationX : e.translationY;
|
|
57
82
|
let phase = this.computePhase((bounds === null || bounds === void 0 ? void 0 : bounds.center) || 0);
|
|
@@ -64,6 +89,14 @@ export class View extends React.Component {
|
|
|
64
89
|
this.position.setValue((this.isRTL() ? -(bounds === null || bounds === void 0 ? void 0 : bounds.center) : (bounds === null || bounds === void 0 ? void 0 : bounds.center) || 0) + d);
|
|
65
90
|
}).onEnd(e => {
|
|
66
91
|
var _this$props$handlers3, _this$props$handlers4;
|
|
92
|
+
if (!touchStart.active) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
touchStart = {
|
|
96
|
+
x: 0,
|
|
97
|
+
y: 0,
|
|
98
|
+
active: false
|
|
99
|
+
};
|
|
67
100
|
((_this$props$handlers3 = this.props.handlers) === null || _this$props$handlers3 === void 0 ? void 0 : _this$props$handlers3.onAnimation) && ((_this$props$handlers4 = this.props.handlers) === null || _this$props$handlers4 === void 0 ? void 0 : _this$props$handlers4.onAnimation(e));
|
|
68
101
|
if (e.translationX < 0) {
|
|
69
102
|
this.isRTL() ? this.goToLower(e) : this.goToUpper(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNil","React","Animated","Easing","View","RNView","Gesture","GestureDetector","isWebPreviewMode","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Pan","Value","I18nService","get","state","isHorizontal","direction","threshold","bounds","gesture","maxPointers","minDistance","enabled","enableGestures","onChange","e","_this$props$handlers","_this$props$handlers2","handlers","d","translationX","translationY","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","onEnd","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","s","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","setPosition","then","_this$props$handlers9","_this$props$handlers10","onLower","_this$props$handlers11","_this$props$handlers12","_this$props$handlers13","_this$props$handlers14","onUpper","Promise","reject","isNaN","Math","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","style","flexDirection","flexWrap","alignItems","transform","translateX","translateY","onLayout","bind","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth"],"sources":["swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => {};\n onLower?: (g: GestureUpdateEvent<any>) => any = () => {};\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => {};\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 30;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%'; \n slideMinWidth?: DimensionValue = undefined; \n}\n\nexport class State {\n threshold = 30;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n\n private gesture = Gesture.Pan();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 30,\n bounds: {} as any\n } as State;\n this.gesture\n .maxPointers(1)\n .minDistance(this.state.threshold)\n .enabled(this.props.enableGestures && !isWebPreviewMode())\n .onChange(e => {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.translationX : e.translationY);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL()?-bounds?.center! :bounds?.center || 0) + d);\n })\n .onEnd(e => {\n this.props.handlers?.onAnimation && \n this.props.handlers?.onAnimation(e);\n if (e.translationX < 0) {\n this.isRTL()?this.goToLower(e):this.goToUpper(e);\n } else if (e.translationX > 0) {\n this.isRTL()?this.goToUpper(e):this.goToLower(e);\n }\n })\n\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({maxPosition: -1 * max});\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase && \n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower && \n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper && \n this.props.handlers?.onUpper(e);\n }\n });\n }\n \n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1: 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <GestureDetector gesture={this.gesture}>\n <Animated.View style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style, \n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }]} onLayout={this.setViewLayout.bind(this)}>\n {this.props.children.map((c: any, i: number) => {\n return (<RNView onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key} \n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style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pBC,QAAQ,EAAE,QAAQ;UAClBC,UAAU,EAAE;QAChB,CAAC,GAAG,IAAI,EACR,IAAI,CAAC/F,KAAK,CAAC4F,KAAK,EAChB;UACII,SAAS,EAAE,IAAI,CAAC3F,KAAK,CAACC,YAAY,GAAG,CAAC;YAClC2F,UAAU,EAAE,IAAI,CAACnE;UACrB,CAAC,CAAC,GAAG,CAAC;YACFoE,UAAU,EAAE,IAAI,CAACpE;UACrB,CAAC;QACL,CAAC,CAAE;QAACqE,QAAQ,EAAE,IAAI,CAACzC,aAAa,CAAC0C,IAAI,CAAC,IAAI;MAAE,GAC3C,IAAI,CAACpG,KAAK,CAACqG,QAAQ,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,CAAS,KAAK;QAAA,IAAAC,iBAAA;QAC5C,oBAAQ3H,KAAA,CAAA6G,aAAA,CAACzG,MAAM;UAACiH,QAAQ,EAAGnF,CAAC,IAAK,IAAI,CAACqC,iBAAiB,CAACrC,CAAC,EAAEwF,CAAC,CAAE;UAACE,GAAG,EAAEH,CAAC,CAACG,GAAI;UACtEd,KAAK,EAAE,CAAC,IAAI,CAAC5F,KAAK,CAAC2G,aAAa,GAAG;YAC/BC,QAAQ,EAAE,IAAI,CAAC5G,KAAK,CAAC2G;UACzB,CAAC,GAAG;YACA7D,KAAK,EAAE,IAAI,CAAC9C,KAAK,CAAC6G;UACtB,CAAC,EACD,EAAAJ,iBAAA,OAAI,CAACzG,KAAK,CAAC4F,KAAK,cAAAa,iBAAA,uBAAhBA,iBAAA,CAAkBzD,MAAM,MAAK,MAAM,GAAG;YAClCA,MAAM,EAAE;UACZ,CAAC,GAAG,IAAI;QACV,GACGuD,CACG,CAAC;MACb,CAAC,CACU,CACF;IAAC;EAE1B;AAEJ;AAAC9G,eAAA,CArKYR,IAAI,kBAES,IAAIS,KAAK,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["isNil","React","Animated","Easing","View","RNView","Gesture","GestureDetector","isWebPreviewMode","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Pan","Value","I18nService","get","state","isHorizontal","direction","threshold","bounds","touchStart","x","y","active","gesture","maxPointers","minDistance","enabled","enableGestures","onTouchesDown","e","s","changedTouches","onTouchesMove","translationX","allTouches","translationY","d","od","Math","abs","tan","PI","onChange","_this$props$handlers","_this$props$handlers2","handlers","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","onEnd","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","setPosition","then","_this$props$handlers9","_this$props$handlers10","onLower","_this$props$handlers11","_this$props$handlers12","_this$props$handlers13","_this$props$handlers14","onUpper","Promise","reject","isNaN","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","style","flexDirection","flexWrap","alignItems","transform","translateX","translateY","onLayout","bind","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth"],"sources":["swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => {};\n onLower?: (g: GestureUpdateEvent<any>) => any = () => {};\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => {};\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 30;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%'; \n slideMinWidth?: DimensionValue = undefined; \n}\n\nexport class State {\n threshold = 30;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n\n private gesture = Gesture.Pan();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 30,\n bounds: {} as any\n } as State;\n var touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n this.gesture\n .maxPointers(1)\n .minDistance(this.state.threshold)\n .enabled(this.props.enableGestures && !isWebPreviewMode())\n .onTouchesDown((e, s) => {\n touchStart = {\n x: e.changedTouches[0].x,\n y: e.changedTouches[0].y,\n active: false\n };\n })\n .onTouchesMove((e, s) => {\n if (touchStart.active) {\n return;\n }\n const translationX = e.allTouches[0].x - touchStart.x;\n const translationY = e.allTouches[0].y - touchStart.y;\n const d = (this.state.isHorizontal ? translationX : translationY);\n const od = (this.state.isHorizontal ? translationY : translationX);\n if (Math.abs(d) >= this.state.threshold\n && Math.abs(od) < Math.tan((15 * Math.PI) / 180) * this.state.threshold) {\n touchStart.active = true;\n }\n })\n .onChange(e => {\n if (!touchStart.active) {\n return;\n }\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.translationX : e.translationY);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL()?-bounds?.center! :bounds?.center || 0) + d);\n })\n .onEnd(e => {\n if (!touchStart.active) {\n return;\n }\n touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n this.props.handlers?.onAnimation && \n this.props.handlers?.onAnimation(e);\n if (e.translationX < 0) {\n this.isRTL()?this.goToLower(e):this.goToUpper(e);\n } else if (e.translationX > 0) {\n this.isRTL()?this.goToUpper(e):this.goToLower(e);\n }\n })\n\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({maxPosition: -1 * max});\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase && \n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower && \n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper && \n this.props.handlers?.onUpper(e);\n }\n });\n }\n \n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1: 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <GestureDetector gesture={this.gesture}>\n <Animated.View style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style, \n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }]} onLayout={this.setViewLayout.bind(this)}>\n {this.props.children.map((c: any, i: number) => {\n return (<RNView onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key} \n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style?.height === '100%' ? {\n height: '100%'\n } : null\n ]}>\n {c}\n </RNView>);\n })}\n </Animated.View>\n </GestureDetector>\n );\n }\n\n}"],"mappings":";;;AAAA,SAASA,KAAK,QAAQ,WAAW;AACjC,OAAOC,KAAK,MAAO,OAAO;AAC1B,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,IAAIC,MAAM,QAAuE,cAAc;AAC9H,SAASC,OAAO,EAAEC,eAAe,QAA4B,8BAA8B;AAC3F,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,O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ACC,YAAY,GAAG,CAAC;YAClCuG,UAAU,EAAE,IAAI,CAACjE;UACrB,CAAC,CAAC,GAAG,CAAC;YACFkE,UAAU,EAAE,IAAI,CAAClE;UACrB,CAAC;QACL,CAAC,CAAE;QAACmE,QAAQ,EAAE,IAAI,CAACxC,aAAa,CAACyC,IAAI,CAAC,IAAI;MAAE,GAC3C,IAAI,CAAChH,KAAK,CAACiH,QAAQ,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,CAAS,KAAK;QAAA,IAAAC,iBAAA;QAC5C,oBAAQvI,KAAA,CAAAyH,aAAA,CAACrH,MAAM;UAAC6H,QAAQ,EAAG3F,CAAC,IAAK,IAAI,CAAC8C,iBAAiB,CAAC9C,CAAC,EAAEgG,CAAC,CAAE;UAACE,GAAG,EAAEH,CAAC,CAACG,GAAI;UACtEd,KAAK,EAAE,CAAC,IAAI,CAACxG,KAAK,CAACuH,aAAa,GAAG;YAC/BC,QAAQ,EAAE,IAAI,CAACxH,KAAK,CAACuH;UACzB,CAAC,GAAG;YACA5D,KAAK,EAAE,IAAI,CAAC3D,KAAK,CAACyH;UACtB,CAAC,EACD,EAAAJ,iBAAA,OAAI,CAACrH,KAAK,CAACwG,KAAK,cAAAa,iBAAA,uBAAhBA,iBAAA,CAAkBxD,MAAM,MAAK,MAAM,GAAG;YAClCA,MAAM,EAAE;UACZ,CAAC,GAAG,IAAI;QACV,GACGsD,CACG,CAAC;MACb,CAAC,CACU,CACF;IAAC;EAE1B;AAEJ;AAAC1H,eAAA,CAzMYR,IAAI,kBAES,IAAIS,KAAK,CAAC,CAAC"}
|
app-rn-runtime/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.6.1-rc.
|
|
3
|
+
"version": "11.6.1-rc.5518",
|
|
4
4
|
"description": "''",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"module": "index",
|
|
@@ -49,11 +49,12 @@
|
|
|
49
49
|
"@react-navigation/native": "6.1.7",
|
|
50
50
|
"@react-navigation/stack": "^6.3.7",
|
|
51
51
|
"@types/lodash-es": "^4.17.6",
|
|
52
|
-
"@wavemaker/variables": "11.6.1-rc.
|
|
52
|
+
"@wavemaker/variables": "11.6.1-rc.5518",
|
|
53
53
|
"axios": "^1.4.0",
|
|
54
54
|
"color": "4.2.3",
|
|
55
55
|
"cross-env": "^5.2.0",
|
|
56
56
|
"css-mediaquery": "^0.1.2",
|
|
57
|
+
"d3-shape": "^3.2.0",
|
|
57
58
|
"expo-application": "^5.4.0",
|
|
58
59
|
"expo-font": "11.4.0",
|
|
59
60
|
"expo-linear-gradient": "12.3.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"react-native-paper-dates": "^0.8.0",
|
|
72
73
|
"react-native-reanimated": "3.3.0",
|
|
73
74
|
"react-native-screens": "3.22.0",
|
|
75
|
+
"react-native-size-scaling": "^0.5.1",
|
|
74
76
|
"react-native-snap-carousel": "3.9.1",
|
|
75
77
|
"react-native-svg": "13.9.0",
|
|
76
78
|
"react-native-web": "0.18.12",
|
|
@@ -129,7 +131,7 @@
|
|
|
129
131
|
"typescript": "^5.1.3",
|
|
130
132
|
"victory-native": "36.6.11",
|
|
131
133
|
"yargs": "^16.2.0",
|
|
132
|
-
"@wavemaker/variables": "11.6.1-rc.
|
|
134
|
+
"@wavemaker/variables": "11.6.1-rc.5518"
|
|
133
135
|
},
|
|
134
136
|
"jest": {
|
|
135
137
|
"preset": "react-native",
|
app-rn-runtime/runtime/App.js
CHANGED
|
@@ -16,6 +16,7 @@ import EventNotifier from '@wavemaker/app-rn-runtime/core/event-notifier';
|
|
|
16
16
|
import { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';
|
|
17
17
|
import StorageService from '@wavemaker/app-rn-runtime/core/storage.service';
|
|
18
18
|
import ConstantService from '@wavemaker/app-rn-runtime/core/constant.service';
|
|
19
|
+
import NetworkService from '@wavemaker/app-rn-runtime/core/network.service';
|
|
19
20
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
|
20
21
|
import formatters from '@wavemaker/app-rn-runtime/core/formatters';
|
|
21
22
|
import { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
@@ -115,6 +116,7 @@ export default class BaseApp extends React.Component {
|
|
|
115
116
|
_defineProperty(this, "lib", preparePatch(() => {
|
|
116
117
|
this.refresh();
|
|
117
118
|
}));
|
|
119
|
+
_defineProperty(this, "networkStatus", {});
|
|
118
120
|
SplashScreen.preventAutoHideAsync();
|
|
119
121
|
setTimeout(() => SplashScreen.hideAsync(), 10000);
|
|
120
122
|
this.appConfig.app = this;
|
|
@@ -152,6 +154,12 @@ export default class BaseApp extends React.Component {
|
|
|
152
154
|
refreshAfterWait = true;
|
|
153
155
|
}
|
|
154
156
|
};
|
|
157
|
+
this.cleanup.push(NetworkService.notifier.subscribe('onNetworkStateChange', networkState => {
|
|
158
|
+
this.networkStatus = {
|
|
159
|
+
...networkState
|
|
160
|
+
};
|
|
161
|
+
this.refresh();
|
|
162
|
+
}));
|
|
155
163
|
}
|
|
156
164
|
subscribe(event, fn) {
|
|
157
165
|
return this.eventNotifier.subscribe(event, fn);
|
|
@@ -165,10 +173,6 @@ export default class BaseApp extends React.Component {
|
|
|
165
173
|
get activePage() {
|
|
166
174
|
return this.appConfig.currentPage;
|
|
167
175
|
}
|
|
168
|
-
get Widgets() {
|
|
169
|
-
var _this$commonPartial2;
|
|
170
|
-
return (_this$commonPartial2 = this.commonPartial) === null || _this$commonPartial2 === void 0 ? void 0 : _this$commonPartial2.Widgets;
|
|
171
|
-
}
|
|
172
176
|
goToPage(pageName, params) {
|
|
173
177
|
var _this$appConfig$curre2;
|
|
174
178
|
return (_this$appConfig$curre2 = this.appConfig.currentPage) === null || _this$appConfig$curre2 === void 0 ? void 0 : _this$appConfig$curre2.goToPage(pageName, params);
|
|
@@ -442,7 +446,9 @@ export default class BaseApp extends React.Component {
|
|
|
442
446
|
style: {
|
|
443
447
|
flex: 1
|
|
444
448
|
}
|
|
445
|
-
}, /*#__PURE__*/React.createElement(StatusBar, null), /*#__PURE__*/React.createElement(FixedViewContainer, null, /*#__PURE__*/React.createElement(
|
|
449
|
+
}, /*#__PURE__*/React.createElement(StatusBar, null), /*#__PURE__*/React.createElement(FixedViewContainer, null, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
450
|
+
value: _this2.appConfig.theme
|
|
451
|
+
}, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
446
452
|
behavior: Platform.OS === "ios" ? "padding" : undefined,
|
|
447
453
|
style: {
|
|
448
454
|
flex: 1
|
|
@@ -456,9 +462,9 @@ export default class BaseApp extends React.Component {
|
|
|
456
462
|
hideDrawer: ((_this2$appConfig$draw = _this2.appConfig.drawer) === null || _this2$appConfig$draw === void 0 ? void 0 : _this2$appConfig$draw.getContent()) === null,
|
|
457
463
|
drawerContent: () => _this2.appConfig.drawer ? _this2.getProviders(_this2.appConfig.drawer.getContent()) : null,
|
|
458
464
|
drawerAnimation: (_this2$appConfig$draw2 = _this2.appConfig.drawer) === null || _this2$appConfig$draw2 === void 0 ? void 0 : _this2$appConfig$draw2.getAnimation()
|
|
459
|
-
}), commonPartial, _this2.renderToasters(), _this2.renderDialogs(), _this2.renderDisplayManager())), /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
|
|
465
|
+
}), commonPartial, _this2.renderToasters(), _this2.renderDialogs(), _this2.renderDisplayManager())), _this2.appConfig.url ? /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
|
|
460
466
|
appLocale: _this2.appConfig.appLocale
|
|
461
|
-
}))));
|
|
467
|
+
}) : null))));
|
|
462
468
|
}))));
|
|
463
469
|
}
|
|
464
470
|
}
|