@wavemaker/app-rn-runtime 11.14.1-27.647700 → 11.14.1-29.647719
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/components/basic/bottomsheet/bottomsheet.component.js +33 -240
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/bottomsheet/bottomsheet.styles.js +3 -0
- package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
- package/components/basic/label/label.component.js +22 -11
- package/components/basic/label/label.component.js.map +1 -1
- package/components/basic/label/label.props.js +0 -1
- package/components/basic/label/label.props.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -3
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/chart/area-chart/area-chart.component.js +9 -26
- package/components/chart/area-chart/area-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js +6 -38
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.props.js +0 -1
- package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- package/components/chart/basechart.component.js +15 -8
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +0 -1
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js +5 -22
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js +5 -22
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.component.js +3 -14
- package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- package/components/container/container.component.js +13 -206
- package/components/container/container.component.js.map +1 -1
- package/components/container/container.props.js +0 -6
- package/components/container/container.props.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -25
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +0 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
- package/components/container/tabs/tabs.component.js +29 -62
- package/components/container/tabs/tabs.component.js.map +1 -1
- package/components/container/tabs/tabs.props.js +0 -1
- package/components/container/tabs/tabs.props.js.map +1 -1
- package/components/container/wizard/wizard.component.js +5 -3
- package/components/container/wizard/wizard.component.js.map +1 -1
- package/components/container/wizard/wizard.props.js +1 -0
- package/components/container/wizard/wizard.props.js.map +1 -1
- package/components/container/wizard/wizard.styles.js +1 -3
- package/components/container/wizard/wizard.styles.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +23 -4
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
- package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- package/components/data/form/form-field/form-field.component.js +0 -2
- package/components/data/form/form-field/form-field.component.js.map +1 -1
- package/components/data/form/form-field/form-field.props.js +0 -2
- package/components/data/form/form-field/form-field.props.js.map +1 -1
- package/components/data/form/form.component.js +1 -4
- package/components/data/form/form.component.js.map +1 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js +2 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- package/components/input/baseinput/baseinput.component.js +3 -28
- package/components/input/baseinput/baseinput.component.js.map +1 -1
- package/components/input/baseinput/baseinput.props.js +0 -1
- package/components/input/baseinput/baseinput.props.js.map +1 -1
- package/components/input/basenumber/basenumber.component.js +3 -18
- package/components/input/basenumber/basenumber.component.js.map +1 -1
- package/components/input/basenumber/basenumber.props.js +0 -1
- package/components/input/basenumber/basenumber.props.js.map +1 -1
- package/components/input/calendar/calendar.component.js +0 -4
- package/components/input/calendar/calendar.component.js.map +1 -1
- package/components/input/calendar/views/month-view.js +1 -8
- package/components/input/calendar/views/month-view.js.map +1 -1
- package/components/input/checkboxset/checkboxset.component.js +1 -1
- package/components/input/checkboxset/checkboxset.component.js.map +1 -1
- package/components/input/currency/currency.component.js +0 -2
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/currency/currency.styles.js +1 -10
- package/components/input/currency/currency.styles.js.map +1 -1
- package/components/input/number/number.component.js +0 -2
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/number/number.styles.js +0 -4
- package/components/input/number/number.styles.js.map +1 -1
- package/components/input/radioset/radioset.component.js +8 -3
- package/components/input/radioset/radioset.component.js.map +1 -1
- package/components/input/text/text.component.js +2 -12
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +1 -1
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +0 -17
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +2 -3
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/textarea/textarea.styles.js +0 -4
- package/components/input/textarea/textarea.styles.js.map +1 -1
- package/core/AppConfig.js.map +1 -1
- package/core/advanced-promise-rejection-tracker.js +207 -0
- package/core/advanced-promise-rejection-tracker.js.map +1 -0
- package/core/base.component.js +5 -0
- package/core/base.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.component.js +50 -18
- package/core/components/error-fallback/error-fallback.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.styles.js +4 -1
- package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
- package/core/components/textinput.component.js +7 -25
- package/core/components/textinput.component.js.map +1 -1
- package/core/error-boundary.component.js +46 -2
- package/core/error-boundary.component.js.map +1 -1
- package/core/fixed-view.component.js +2 -19
- package/core/fixed-view.component.js.map +1 -1
- package/core/global-error-handler.service.js +177 -0
- package/core/global-error-handler.service.js.map +1 -0
- package/core/tappable.component.js +16 -110
- package/core/tappable.component.js.map +1 -1
- package/core/viewport.js +8 -13
- package/core/viewport.js.map +1 -1
- package/gestures/carousel-swipe.animation.js +1 -0
- package/gestures/carousel-swipe.animation.js.map +1 -1
- package/npm-shrinkwrap.json +368 -368
- package/package-lock.json +368 -368
- package/package.json +2 -2
- package/runtime/App.js +174 -13
- package/runtime/App.js.map +1 -1
- package/runtime/base-fragment.component.js +0 -4
- package/runtime/base-fragment.component.js.map +1 -1
- package/runtime/base-page.component.js +11 -2
- package/runtime/base-page.component.js.map +1 -1
- package/runtime/navigator/drawer.navigator.js +0 -2
- package/runtime/navigator/drawer.navigator.js.map +1 -1
- package/runtime/navigator/stack.navigator.js +4 -13
- package/runtime/navigator/stack.navigator.js.map +1 -1
- package/runtime/services/device/scan-service.js +34 -12
- package/runtime/services/device/scan-service.js.map +1 -1
- package/styles/theme.js +0 -6
- package/styles/theme.js.map +1 -1
- package/styles/theme.variables.js +0 -2
- package/styles/theme.variables.js.map +1 -1
- package/core/environment.js +0 -25
- package/core/environment.js.map +0 -1
|
@@ -5,45 +5,14 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
5
5
|
import React, { createRef } from 'react';
|
|
6
6
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
7
7
|
import { View, PanResponder, Dimensions, TouchableWithoutFeedback, Platform, StatusBar, BackHandler, KeyboardAvoidingView, Keyboard, Modal, Pressable } from 'react-native';
|
|
8
|
-
import {
|
|
8
|
+
import { ScrollView } from 'react-native-gesture-handler';
|
|
9
9
|
import Animated, { useAnimatedStyle, withTiming, runOnJS, Easing, makeMutable, cancelAnimation } from 'react-native-reanimated';
|
|
10
|
-
import * as Animatable from 'react-native-animatable';
|
|
11
10
|
import WmBottomsheetProps from './bottomsheet.props';
|
|
12
11
|
import { DEFAULT_CLASS } from './bottomsheet.styles';
|
|
13
12
|
import { createSkeleton } from '../skeleton/skeleton.component';
|
|
14
13
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
|
15
14
|
import { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';
|
|
16
|
-
import { SafeAreaInsetsContext
|
|
17
|
-
|
|
18
|
-
// Web-only: Runs all bottom sheet animations on the JS thread (sets useNativeDriver to false)
|
|
19
|
-
// Prevents errors on web where native driver animations are not supported
|
|
20
|
-
// Web - Animated api is used from animation
|
|
21
|
-
if (Platform.OS === 'web') {
|
|
22
|
-
try {
|
|
23
|
-
const RN = require('react-native');
|
|
24
|
-
const RNAnimated = RN && RN.Animated;
|
|
25
|
-
if (RNAnimated && !RNAnimated.__wmPatchedNoNativeDriver) {
|
|
26
|
-
const wrap = name => {
|
|
27
|
-
const original = RNAnimated[name];
|
|
28
|
-
if (typeof original === 'function') {
|
|
29
|
-
RNAnimated[name] = (value, config) => {
|
|
30
|
-
const patched = {
|
|
31
|
-
...(config || {}),
|
|
32
|
-
useNativeDriver: false
|
|
33
|
-
};
|
|
34
|
-
return original(value, patched);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
wrap('timing');
|
|
39
|
-
wrap('spring');
|
|
40
|
-
wrap('decay');
|
|
41
|
-
RNAnimated.__wmPatchedNoNativeDriver = true;
|
|
42
|
-
}
|
|
43
|
-
} catch (_) {
|
|
44
|
-
// noop
|
|
45
|
-
}
|
|
46
|
-
}
|
|
15
|
+
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
47
16
|
const {
|
|
48
17
|
height: SCREEN_HEIGHT
|
|
49
18
|
} = Dimensions.get('screen');
|
|
@@ -58,8 +27,6 @@ export class WmBottomsheetState extends BaseComponentState {
|
|
|
58
27
|
_defineProperty(this, "keyboardHeight", 0);
|
|
59
28
|
_defineProperty(this, "localModalsOpened", []);
|
|
60
29
|
_defineProperty(this, "lastGestureDy", 0);
|
|
61
|
-
_defineProperty(this, "contentAnimationId", 0);
|
|
62
|
-
_defineProperty(this, "contentAnimatableProps", undefined);
|
|
63
30
|
}
|
|
64
31
|
}
|
|
65
32
|
|
|
@@ -77,32 +44,8 @@ const AnimatedBottomsheetContent = ({
|
|
|
77
44
|
onBackdropPress,
|
|
78
45
|
onDragHandlePress,
|
|
79
46
|
getTestProps,
|
|
80
|
-
enabledragsettle
|
|
81
|
-
scrollRef,
|
|
82
|
-
containerScrollRef,
|
|
83
|
-
configurePanGesture
|
|
47
|
+
enabledragsettle
|
|
84
48
|
}) => {
|
|
85
|
-
// Simple RNGH GestureDetector attached to the same view as the PanResponder (panHandlers).
|
|
86
|
-
// No thresholds/validation: logs translationY directly during pan.
|
|
87
|
-
const panGesture = React.useMemo(() => {
|
|
88
|
-
// Create base Pan gesture
|
|
89
|
-
const pan = Gesture.Pan().runOnJS(true);
|
|
90
|
-
|
|
91
|
-
// Add external gestures for ScrollViews (container widget scrollview)
|
|
92
|
-
if (scrollRef && containerScrollRef) {
|
|
93
|
-
pan.simultaneousWithExternalGesture(scrollRef, containerScrollRef);
|
|
94
|
-
} else if (scrollRef) {
|
|
95
|
-
pan.simultaneousWithExternalGesture(scrollRef);
|
|
96
|
-
} else if (containerScrollRef) {
|
|
97
|
-
pan.simultaneousWithExternalGesture(containerScrollRef);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Apply custom logic from parent BottomSheet class
|
|
101
|
-
if (configurePanGesture) {
|
|
102
|
-
configurePanGesture(pan);
|
|
103
|
-
}
|
|
104
|
-
return pan;
|
|
105
|
-
}, [scrollRef, containerScrollRef, configurePanGesture]);
|
|
106
49
|
const backdropAnimatedStyle = useAnimatedStyle(() => ({
|
|
107
50
|
opacity: backdropOpacity.value
|
|
108
51
|
}));
|
|
@@ -124,18 +67,15 @@ const AnimatedBottomsheetContent = ({
|
|
|
124
67
|
onPress: onBackdropPress
|
|
125
68
|
}, /*#__PURE__*/React.createElement(Animated.View, _extends({
|
|
126
69
|
style: [styles.backdrop, backdropAnimatedStyle]
|
|
127
|
-
}, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, {
|
|
70
|
+
}, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, _extends({
|
|
128
71
|
style: [styles.container, containerAnimatedStyle]
|
|
129
|
-
|
|
130
|
-
}, /*#__PURE__*/React.createElement(View, _extends({
|
|
72
|
+
}, panHandlers), /*#__PURE__*/React.createElement(View, _extends({
|
|
131
73
|
style: styles.dragHandleContainer
|
|
132
74
|
}, dragHandlePanHandlers), /*#__PURE__*/React.createElement(Pressable, {
|
|
133
75
|
onPress: onDragHandlePress
|
|
134
76
|
}, /*#__PURE__*/React.createElement(View, _extends({
|
|
135
77
|
style: styles.dragIconHandle
|
|
136
|
-
}, getTestProps('draghandle'))))),
|
|
137
|
-
gesture: panGesture
|
|
138
|
-
}, children(contentStyle))));
|
|
78
|
+
}, getTestProps('draghandle'))))), children(contentStyle)));
|
|
139
79
|
};
|
|
140
80
|
export default class WmBottomsheet extends BaseComponent {
|
|
141
81
|
// Helper method to calculate animation duration based on distance and velocity
|
|
@@ -176,12 +116,6 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
176
116
|
this.closeSheet();
|
|
177
117
|
}
|
|
178
118
|
}
|
|
179
|
-
animate(props) {
|
|
180
|
-
this.updateState({
|
|
181
|
-
contentAnimationId: Date.now(),
|
|
182
|
-
contentAnimatableProps: props
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
119
|
constructor(_props) {
|
|
186
120
|
super(_props, DEFAULT_CLASS, new WmBottomsheetProps(), new WmBottomsheetState());
|
|
187
121
|
_defineProperty(this, "calculatedHeight", void 0);
|
|
@@ -204,9 +138,6 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
204
138
|
_defineProperty(this, "isIosKeyboardHeightSet", false);
|
|
205
139
|
_defineProperty(this, "sheetModalService", void 0);
|
|
206
140
|
_defineProperty(this, "isDragHandleExpanding", false);
|
|
207
|
-
//container widget scrollview ref and y offset value
|
|
208
|
-
_defineProperty(this, "containerscrollViewRef", null);
|
|
209
|
-
_defineProperty(this, "containerscrollYoffset", 0);
|
|
210
141
|
// Reanimated shared values - created once and reused
|
|
211
142
|
_defineProperty(this, "translateY", void 0);
|
|
212
143
|
_defineProperty(this, "backdropOpacity", void 0);
|
|
@@ -361,20 +292,6 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
361
292
|
if (this.state.isExpanded || this.props.disableswipedownclose) {
|
|
362
293
|
if (gestureState.dy < this.expandedHeight / 4 || this.props.disableswipedownclose) {
|
|
363
294
|
var _this$sheetHeight;
|
|
364
|
-
//reseting bottom sheet scrollview offset value to fix scrollview automatic scroll issue while collpsing the bottom sheet
|
|
365
|
-
setTimeout(() => {
|
|
366
|
-
var _this$state$scrollVie;
|
|
367
|
-
if ((_this$state$scrollVie = this.state.scrollViewRef) !== null && _this$state$scrollVie !== void 0 && _this$state$scrollVie.current) {
|
|
368
|
-
this.state.scrollViewRef.current.scrollTo({
|
|
369
|
-
x: 0,
|
|
370
|
-
y: 0,
|
|
371
|
-
animated: false
|
|
372
|
-
});
|
|
373
|
-
this.updateState({
|
|
374
|
-
scrollOffset: 0
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
}, this.animationDuration);
|
|
378
295
|
let sheetMinimumHeight = this.props.bottomsheetminimumheight || 0.1;
|
|
379
296
|
const targetHeight = this.props.disableswipedownclose ? sheetMinimumHeight * SCREEN_HEIGHT : this.calculatedHeight;
|
|
380
297
|
const currentHeight = ((_this$sheetHeight = this.sheetHeight) === null || _this$sheetHeight === void 0 ? void 0 : _this$sheetHeight.value) || this.expandedHeight;
|
|
@@ -416,60 +333,13 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
416
333
|
}
|
|
417
334
|
}
|
|
418
335
|
});
|
|
419
|
-
_defineProperty(this, "configurePanGesture", pan => {
|
|
420
|
-
pan.enabled(true).onUpdate(event => {
|
|
421
|
-
// ← Add : any
|
|
422
|
-
const gestureState = {
|
|
423
|
-
dy: event.translationY,
|
|
424
|
-
vy: event.velocityY,
|
|
425
|
-
moveX: event.x,
|
|
426
|
-
moveY: event.y,
|
|
427
|
-
vx: event.velocityX
|
|
428
|
-
};
|
|
429
|
-
if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
|
|
430
|
-
const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
|
|
431
|
-
this.translateY.value = newTranslateY;
|
|
432
|
-
// Reset expand flag if dragging down
|
|
433
|
-
this.isDragHandleExpanding = false;
|
|
434
|
-
} else if (gestureState.dy < 0 && this.props.expand && this.props.bottomsheetheightratio !== 1 && !this.isDragHandleExpanding && !this.state.isExpanded && this.props.disablescrollonrest) {
|
|
435
|
-
// Only trigger expand once with threshold of -50px upward drag
|
|
436
|
-
this.isDragHandleExpanding = true;
|
|
437
|
-
this.expandBottomSheet();
|
|
438
|
-
}
|
|
439
|
-
// ... rest of logic
|
|
440
|
-
}).onEnd(event => {
|
|
441
|
-
// ← Add : any
|
|
442
|
-
const gestureState = {
|
|
443
|
-
dy: event.translationY,
|
|
444
|
-
vy: event.velocityY,
|
|
445
|
-
moveX: event.x,
|
|
446
|
-
moveY: event.y,
|
|
447
|
-
vx: event.velocityX
|
|
448
|
-
};
|
|
449
|
-
if (gestureState.dy > 0 && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
|
|
450
|
-
this.handleSwipeGesture(gestureState);
|
|
451
|
-
}
|
|
452
|
-
}).onFinalize((event, success) => {
|
|
453
|
-
// ← Add types
|
|
454
|
-
if (!success) {
|
|
455
|
-
this.openSheet();
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
return pan;
|
|
459
|
-
});
|
|
460
336
|
// panResponder for bottom sheet scroll view
|
|
461
337
|
_defineProperty(this, "panResponder", PanResponder.create({
|
|
462
338
|
onStartShouldSetPanResponder: (_, gestureState) => {
|
|
463
|
-
if (this.props.disablescrollonrest && !this.state.isExpanded) {
|
|
464
|
-
return true;
|
|
465
|
-
}
|
|
466
339
|
// Only handle the gesture if we're at the top and swiping down
|
|
467
340
|
return gestureState.dy > 0 && this.state.scrollOffset <= 0;
|
|
468
341
|
},
|
|
469
342
|
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
470
|
-
if (this.props.disablescrollonrest && !this.state.isExpanded) {
|
|
471
|
-
return Math.abs(gestureState.dy) > 2;
|
|
472
|
-
}
|
|
473
343
|
// Only handle the gesture if we're at the top and swiping down
|
|
474
344
|
return gestureState.dy > 0 && this.state.scrollOffset <= 0;
|
|
475
345
|
},
|
|
@@ -483,12 +353,6 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
483
353
|
if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared) {
|
|
484
354
|
const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
|
|
485
355
|
this.translateY.value = newTranslateY;
|
|
486
|
-
// Reset expand flag if dragging down
|
|
487
|
-
this.isDragHandleExpanding = false;
|
|
488
|
-
} else if (gestureState.dy < 0 && this.props.expand && this.props.bottomsheetheightratio !== 1 && !this.isDragHandleExpanding && !this.state.isExpanded) {
|
|
489
|
-
// Only trigger expand once with threshold of -50px upward drag
|
|
490
|
-
this.isDragHandleExpanding = true;
|
|
491
|
-
this.expandBottomSheet();
|
|
492
356
|
}
|
|
493
357
|
},
|
|
494
358
|
onPanResponderRelease: (_, gestureState) => {
|
|
@@ -577,12 +441,8 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
577
441
|
}
|
|
578
442
|
this.updateState({
|
|
579
443
|
isExpanded: false,
|
|
580
|
-
localModalsOpened: []
|
|
581
|
-
scrollOffset: 0,
|
|
582
|
-
contentAnimationId: 0,
|
|
583
|
-
contentAnimatableProps: undefined
|
|
444
|
+
localModalsOpened: []
|
|
584
445
|
});
|
|
585
|
-
this.containerscrollYoffset = 0;
|
|
586
446
|
this.handleClose();
|
|
587
447
|
};
|
|
588
448
|
if (this.translateY && this.backdropOpacity) {
|
|
@@ -611,9 +471,7 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
611
471
|
lastGestureDy: 0,
|
|
612
472
|
isExpanded: false,
|
|
613
473
|
isBottomsheetVisible: false,
|
|
614
|
-
localModalsOpened: []
|
|
615
|
-
contentAnimationId: 0,
|
|
616
|
-
contentAnimatableProps: undefined
|
|
474
|
+
localModalsOpened: []
|
|
617
475
|
});
|
|
618
476
|
requestAnimationFrame(() => {
|
|
619
477
|
if (this.sheetHeight) {
|
|
@@ -630,14 +488,6 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
630
488
|
_defineProperty(this, "handleDragHandlePress", () => {
|
|
631
489
|
this.invokeEventCallback('onDraghandleiconclick', [null, this]);
|
|
632
490
|
});
|
|
633
|
-
_defineProperty(this, "renderAnimatedSheetChildren", children => {
|
|
634
|
-
if (!this.state.contentAnimatableProps) {
|
|
635
|
-
return children;
|
|
636
|
-
}
|
|
637
|
-
return /*#__PURE__*/React.createElement(Animatable.View, _extends({
|
|
638
|
-
key: this.state.contentAnimationId
|
|
639
|
-
}, this.state.contentAnimatableProps), children);
|
|
640
|
-
});
|
|
641
491
|
_defineProperty(this, "renderContent", props => {
|
|
642
492
|
// Don't render if shared values aren't initialized yet
|
|
643
493
|
if (!this.translateY || !this.backdropOpacity || !this.sheetHeight || !this.lastGestureDyShared) {
|
|
@@ -651,21 +501,14 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
651
501
|
}) => {
|
|
652
502
|
// Store topInset for later use (avoid mutation during render)
|
|
653
503
|
const topInset = (insets === null || insets === void 0 ? void 0 : insets.top) || 0;
|
|
654
|
-
const bottomInset = (insets === null || insets === void 0 ? void 0 : insets.bottom) || 0;
|
|
655
504
|
// Update the instance variable outside of render cycle
|
|
656
505
|
if (this.topInset !== topInset) {
|
|
657
506
|
requestAnimationFrame(() => {
|
|
658
507
|
this.topInset = topInset;
|
|
659
508
|
});
|
|
660
509
|
}
|
|
661
|
-
const absoluteStyle = {
|
|
662
|
-
top: 0,
|
|
663
|
-
left: 0,
|
|
664
|
-
right: 0
|
|
665
|
-
};
|
|
666
|
-
const rootStyle = props.modal ? [this.styles.root, absoluteStyle] : this.styles.root;
|
|
667
510
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
668
|
-
style:
|
|
511
|
+
style: this.styles.root
|
|
669
512
|
}, this.getTestProps('keyboardview')), this._background, /*#__PURE__*/React.createElement(AnimatedBottomsheetContent, {
|
|
670
513
|
translateY: this.translateY,
|
|
671
514
|
backdropOpacity: this.backdropOpacity,
|
|
@@ -678,21 +521,8 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
678
521
|
onBackdropPress: this.handleBackdropPress,
|
|
679
522
|
onDragHandlePress: this.handleDragHandlePress,
|
|
680
523
|
getTestProps: this.getTestProps.bind(this),
|
|
681
|
-
enabledragsettle: props.enabledragsettle
|
|
682
|
-
|
|
683
|
-
containerScrollRef: this.containerscrollViewRef,
|
|
684
|
-
configurePanGesture: this.configurePanGesture
|
|
685
|
-
}, contentStyle => props.issticky ? props.enablemodalsupport ? /*#__PURE__*/React.createElement(ModalProvider, {
|
|
686
|
-
value: this.sheetModalService
|
|
687
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
688
|
-
style: [contentStyle, this.styles.sheetContentContainer, {
|
|
689
|
-
overflow: 'hidden'
|
|
690
|
-
}]
|
|
691
|
-
}, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
|
|
692
|
-
style: [contentStyle, this.styles.sheetContentContainer, {
|
|
693
|
-
overflow: 'hidden'
|
|
694
|
-
}]
|
|
695
|
-
}, props.children) : /*#__PURE__*/React.createElement(ScrollView, _extends({
|
|
524
|
+
enabledragsettle: props.enabledragsettle
|
|
525
|
+
}, contentStyle => /*#__PURE__*/React.createElement(ScrollView, _extends({
|
|
696
526
|
ref: this.state.scrollViewRef,
|
|
697
527
|
style: this.styles.sheetContentContainer,
|
|
698
528
|
contentContainerStyle: [this.styles.sheetScrollContent],
|
|
@@ -710,9 +540,7 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
710
540
|
style: contentStyle
|
|
711
541
|
}, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
|
|
712
542
|
style: contentStyle
|
|
713
|
-
}, props.children))),
|
|
714
|
-
edges: ['bottom']
|
|
715
|
-
}), props.enablemodalsupport && this.state.localModalsOpened && this.state.localModalsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
|
|
543
|
+
}, props.children))), props.enablemodalsupport && this.state.localModalsOpened && this.state.localModalsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
|
|
716
544
|
key: (o.name || '') + i,
|
|
717
545
|
onStartShouldSetResponder: () => true,
|
|
718
546
|
onResponderEnd: () => o.isModal && this.sheetModalService.hideModal(o),
|
|
@@ -728,18 +556,7 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
728
556
|
});
|
|
729
557
|
});
|
|
730
558
|
this.calculatedHeight = this.calculateSheetHeight(_props.bottomsheetheightratio);
|
|
731
|
-
|
|
732
|
-
this.subscribe('containerScrollViewReady', ref => {
|
|
733
|
-
if (ref && ref.current && this.containerscrollViewRef !== ref) {
|
|
734
|
-
this.containerscrollViewRef = ref;
|
|
735
|
-
this.forceUpdate();
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
//container scrollview y offset value
|
|
739
|
-
this.subscribe('scroll', e => {
|
|
740
|
-
const offsetY = e.nativeEvent.contentOffset.y;
|
|
741
|
-
this.containerscrollYoffset = offsetY;
|
|
742
|
-
});
|
|
559
|
+
|
|
743
560
|
// Use bottomsheetexpandedheightratio if provided, otherwise use expandedDefaultHeight
|
|
744
561
|
const expandedRatio = _props.bottomsheetexpandedheightratio || this.expandedDefaultHeight;
|
|
745
562
|
const effectiveExpandedRatio = Math.max(this.minimumExpandedHeight, Math.min(expandedRatio, this.maxHeight));
|
|
@@ -864,51 +681,27 @@ export default class WmBottomsheet extends BaseComponent {
|
|
|
864
681
|
}
|
|
865
682
|
renderWidget(props) {
|
|
866
683
|
if (!this.state.isBottomsheetVisible) return null;
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
const hasButtonNavigation = Platform.OS === 'android' && ((insets === null || insets === void 0 ? void 0 : insets.bottom) || 0) >= 40;
|
|
876
|
-
const wrapWithSafeArea = children => {
|
|
877
|
-
if (hasButtonNavigation) {
|
|
878
|
-
return /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
879
|
-
style: {
|
|
880
|
-
flex: 1
|
|
881
|
-
}
|
|
882
|
-
}, children);
|
|
883
|
-
}
|
|
884
|
-
return children;
|
|
885
|
-
};
|
|
886
|
-
if (props.modal) {
|
|
887
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
888
|
-
visible: this.state.isBottomsheetVisible,
|
|
889
|
-
transparent: true,
|
|
890
|
-
animationType: "none",
|
|
891
|
-
onRequestClose: () => {
|
|
892
|
-
if (!this.props.disableswipedownclose && this.props.autoclose !== 'disabled') {
|
|
893
|
-
this.closeSheet();
|
|
894
|
-
}
|
|
895
|
-
},
|
|
896
|
-
statusBarTranslucent: false
|
|
897
|
-
}, /*#__PURE__*/React.createElement(GestureHandlerRootView, {
|
|
898
|
-
style: {
|
|
899
|
-
flex: 1
|
|
684
|
+
if (props.modal) {
|
|
685
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
686
|
+
visible: this.state.isBottomsheetVisible,
|
|
687
|
+
transparent: true,
|
|
688
|
+
animationType: "none",
|
|
689
|
+
onRequestClose: () => {
|
|
690
|
+
if (!this.props.disableswipedownclose && this.props.autoclose !== 'disabled') {
|
|
691
|
+
this.closeSheet();
|
|
900
692
|
}
|
|
901
|
-
},
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
693
|
+
},
|
|
694
|
+
statusBarTranslucent: false
|
|
695
|
+
}, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
696
|
+
style: {
|
|
697
|
+
flex: 1
|
|
698
|
+
},
|
|
699
|
+
behavior: 'padding',
|
|
700
|
+
keyboardVerticalOffset: Platform.OS === 'ios' ? 0 : undefined
|
|
701
|
+
}, this.renderContent(props)));
|
|
702
|
+
} else {
|
|
703
|
+
return this.renderContent(props);
|
|
704
|
+
}
|
|
912
705
|
}
|
|
913
706
|
}
|
|
914
707
|
//# sourceMappingURL=bottomsheet.component.js.map
|