@wavemaker/app-rn-runtime 11.14.1-32.647748 → 11.14.1-33.647787

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/components/advanced/carousel/carousel.component.js +1 -1
  2. package/components/advanced/carousel/carousel.component.js.map +1 -1
  3. package/components/advanced/webview/webview.component.js +1 -1
  4. package/components/advanced/webview/webview.component.js.map +1 -1
  5. package/components/basic/bottomsheet/bottomsheet.component.js +240 -33
  6. package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
  7. package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
  8. package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
  9. package/components/basic/label/label.component.js +13 -24
  10. package/components/basic/label/label.component.js.map +1 -1
  11. package/components/basic/label/label.props.js +1 -0
  12. package/components/basic/label/label.props.js.map +1 -1
  13. package/components/basic/progress-circle/progress-circle.component.js +3 -3
  14. package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  15. package/components/chart/area-chart/area-chart.component.js +27 -10
  16. package/components/chart/area-chart/area-chart.component.js.map +1 -1
  17. package/components/chart/bar-chart/bar-chart.component.js +39 -7
  18. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  19. package/components/chart/bar-chart/bar-chart.props.js +1 -0
  20. package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  21. package/components/chart/basechart.component.js +8 -15
  22. package/components/chart/basechart.component.js.map +1 -1
  23. package/components/chart/basechart.props.js +1 -0
  24. package/components/chart/basechart.props.js.map +1 -1
  25. package/components/chart/bubble-chart/bubble-chart.component.js +23 -6
  26. package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  27. package/components/chart/line-chart/line-chart.component.js +22 -5
  28. package/components/chart/line-chart/line-chart.component.js.map +1 -1
  29. package/components/chart/pie-chart/pie-chart.component.js +15 -4
  30. package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  31. package/components/chart/stack-chart/stack-chart.component.js +1 -1
  32. package/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  33. package/components/container/accordion/accordionpane/accordionpane.component.js +6 -4
  34. package/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  35. package/components/container/container.component.js +207 -14
  36. package/components/container/container.component.js.map +1 -1
  37. package/components/container/container.props.js +6 -0
  38. package/components/container/container.props.js.map +1 -1
  39. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +32 -4
  40. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  41. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
  42. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
  43. package/components/container/panel/panel.component.js +1 -1
  44. package/components/container/panel/panel.component.js.map +1 -1
  45. package/components/container/tabs/tabpane/tabpane.component.js +1 -1
  46. package/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  47. package/components/container/tabs/tabs.component.js +62 -29
  48. package/components/container/tabs/tabs.component.js.map +1 -1
  49. package/components/container/tabs/tabs.props.js +1 -0
  50. package/components/container/tabs/tabs.props.js.map +1 -1
  51. package/components/container/wizard/wizard.component.js +3 -5
  52. package/components/container/wizard/wizard.component.js.map +1 -1
  53. package/components/container/wizard/wizard.props.js +0 -1
  54. package/components/container/wizard/wizard.props.js.map +1 -1
  55. package/components/container/wizard/wizard.styles.js +3 -1
  56. package/components/container/wizard/wizard.styles.js.map +1 -1
  57. package/components/container/wizard/wizardstep/wizardstep.component.js +4 -23
  58. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  59. package/components/container/wizard/wizardstep/wizardstep.props.js +0 -2
  60. package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  61. package/components/data/form/form-field/form-field.component.js +26 -1
  62. package/components/data/form/form-field/form-field.component.js.map +1 -1
  63. package/components/data/form/form-field/form-field.props.js +3 -0
  64. package/components/data/form/form-field/form-field.props.js.map +1 -1
  65. package/components/data/form/form.component.js +11 -3
  66. package/components/data/form/form.component.js.map +1 -1
  67. package/components/data/form/form.props.js +1 -0
  68. package/components/data/form/form.props.js.map +1 -1
  69. package/components/data/list/list.component.js +6 -3
  70. package/components/data/list/list.component.js.map +1 -1
  71. package/components/dialogs/dialog/dialog.component.js +1 -1
  72. package/components/dialogs/dialog/dialog.component.js.map +1 -1
  73. package/components/dialogs/dialogcontent/dialogcontent.component.js +1 -2
  74. package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  75. package/components/input/baseinput/baseinput.component.js +30 -3
  76. package/components/input/baseinput/baseinput.component.js.map +1 -1
  77. package/components/input/baseinput/baseinput.props.js +1 -0
  78. package/components/input/baseinput/baseinput.props.js.map +1 -1
  79. package/components/input/basenumber/basenumber.component.js +18 -3
  80. package/components/input/basenumber/basenumber.component.js.map +1 -1
  81. package/components/input/basenumber/basenumber.props.js +2 -0
  82. package/components/input/basenumber/basenumber.props.js.map +1 -1
  83. package/components/input/calendar/calendar.component.js +5 -1
  84. package/components/input/calendar/calendar.component.js.map +1 -1
  85. package/components/input/calendar/views/month-view.js +8 -1
  86. package/components/input/calendar/views/month-view.js.map +1 -1
  87. package/components/input/checkboxset/checkboxset.component.js +2 -2
  88. package/components/input/checkboxset/checkboxset.component.js.map +1 -1
  89. package/components/input/currency/currency.component.js +2 -0
  90. package/components/input/currency/currency.component.js.map +1 -1
  91. package/components/input/currency/currency.styles.js +10 -1
  92. package/components/input/currency/currency.styles.js.map +1 -1
  93. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +6 -1
  94. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  95. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +6 -1
  96. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  97. package/components/input/number/number.component.js +2 -0
  98. package/components/input/number/number.component.js.map +1 -1
  99. package/components/input/number/number.styles.js +4 -0
  100. package/components/input/number/number.styles.js.map +1 -1
  101. package/components/input/radioset/radioset.component.js +4 -6
  102. package/components/input/radioset/radioset.component.js.map +1 -1
  103. package/components/input/text/text.component.js +13 -2
  104. package/components/input/text/text.component.js.map +1 -1
  105. package/components/input/text/text.props.js +1 -1
  106. package/components/input/text/text.props.js.map +1 -1
  107. package/components/input/text/text.styles.js +17 -0
  108. package/components/input/text/text.styles.js.map +1 -1
  109. package/components/input/textarea/textarea.component.js +3 -2
  110. package/components/input/textarea/textarea.component.js.map +1 -1
  111. package/components/input/textarea/textarea.styles.js +4 -0
  112. package/components/input/textarea/textarea.styles.js.map +1 -1
  113. package/components/page/left-panel/left-panel.component.js +1 -1
  114. package/components/page/left-panel/left-panel.component.js.map +1 -1
  115. package/components/page/page-content/page-content.component.js +157 -17
  116. package/components/page/page-content/page-content.component.js.map +1 -1
  117. package/components/page/page-content/page-content.props.js +4 -0
  118. package/components/page/page-content/page-content.props.js.map +1 -1
  119. package/components/page/page-content/pull-to-refresh.component.js +288 -0
  120. package/components/page/page-content/pull-to-refresh.component.js.map +1 -0
  121. package/core/AppConfig.js.map +1 -1
  122. package/core/base.component.js +37 -5
  123. package/core/base.component.js.map +1 -1
  124. package/core/components/error-fallback/error-fallback.component.js +18 -50
  125. package/core/components/error-fallback/error-fallback.component.js.map +1 -1
  126. package/core/components/error-fallback/error-fallback.styles.js +1 -4
  127. package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
  128. package/core/components/textinput.component.js +27 -8
  129. package/core/components/textinput.component.js.map +1 -1
  130. package/core/environment.js +25 -0
  131. package/core/environment.js.map +1 -0
  132. package/core/error-boundary.component.js +2 -46
  133. package/core/error-boundary.component.js.map +1 -1
  134. package/core/fixed-view.component.js +19 -2
  135. package/core/fixed-view.component.js.map +1 -1
  136. package/core/sticky-wrapper.js +37 -34
  137. package/core/sticky-wrapper.js.map +1 -1
  138. package/core/tappable.component.js +110 -16
  139. package/core/tappable.component.js.map +1 -1
  140. package/core/viewport.js +13 -8
  141. package/core/viewport.js.map +1 -1
  142. package/gestures/carousel-swipe.animation.js +1 -1
  143. package/gestures/carousel-swipe.animation.js.map +1 -1
  144. package/npm-shrinkwrap.json +383 -219
  145. package/package-lock.json +383 -219
  146. package/package.json +5 -6
  147. package/runtime/App.js +31 -181
  148. package/runtime/App.js.map +1 -1
  149. package/runtime/App.navigator.js +1 -4
  150. package/runtime/App.navigator.js.map +1 -1
  151. package/runtime/base-fragment.component.js +29 -5
  152. package/runtime/base-fragment.component.js.map +1 -1
  153. package/runtime/base-page.component.js +4 -12
  154. package/runtime/base-page.component.js.map +1 -1
  155. package/runtime/navigator/drawer.navigator.js +2 -0
  156. package/runtime/navigator/drawer.navigator.js.map +1 -1
  157. package/runtime/navigator/stack.navigator.js +17 -2
  158. package/runtime/navigator/stack.navigator.js.map +1 -1
  159. package/runtime/services/app-security.service.js +19 -40
  160. package/runtime/services/app-security.service.js.map +1 -1
  161. package/runtime/services/device/scan-service.js +12 -34
  162. package/runtime/services/device/scan-service.js.map +1 -1
  163. package/runtime/services/webprocess.service.js +3 -8
  164. package/runtime/services/webprocess.service.js.map +1 -1
  165. package/styles/background.component.js +61 -2
  166. package/styles/background.component.js.map +1 -1
  167. package/styles/style-prop.validator.js +4 -0
  168. package/styles/style-prop.validator.js.map +1 -1
  169. package/styles/style-props.js +2 -0
  170. package/styles/style-props.js.map +1 -1
  171. package/styles/theme.js +27 -2
  172. package/styles/theme.js.map +1 -1
  173. package/styles/theme.variables.js +2 -0
  174. package/styles/theme.variables.js.map +1 -1
  175. package/core/advanced-promise-rejection-tracker.js +0 -207
  176. package/core/advanced-promise-rejection-tracker.js.map +0 -1
  177. package/core/global-error-handler.service.js +0 -177
  178. package/core/global-error-handler.service.js.map +0 -1
  179. package/runtime/services/browser.constants.js +0 -3
  180. package/runtime/services/browser.constants.js.map +0 -1
  181. package/runtime/services/browser.service.js +0 -321
  182. package/runtime/services/browser.service.js.map +0 -1
  183. package/runtime/services/external-auth-callback.service.js +0 -44
  184. package/runtime/services/external-auth-callback.service.js.map +0 -1
@@ -5,14 +5,45 @@ 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 { ScrollView } from 'react-native-gesture-handler';
8
+ import { Gesture, GestureDetector, GestureHandlerRootView, 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';
10
11
  import WmBottomsheetProps from './bottomsheet.props';
11
12
  import { DEFAULT_CLASS } from './bottomsheet.styles';
12
13
  import { createSkeleton } from '../skeleton/skeleton.component';
13
14
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
14
15
  import { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';
15
- import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
16
+ import { SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';
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
+ }
16
47
  const {
17
48
  height: SCREEN_HEIGHT
18
49
  } = Dimensions.get('screen');
@@ -27,6 +58,8 @@ export class WmBottomsheetState extends BaseComponentState {
27
58
  _defineProperty(this, "keyboardHeight", 0);
28
59
  _defineProperty(this, "localModalsOpened", []);
29
60
  _defineProperty(this, "lastGestureDy", 0);
61
+ _defineProperty(this, "contentAnimationId", 0);
62
+ _defineProperty(this, "contentAnimatableProps", undefined);
30
63
  }
31
64
  }
32
65
 
@@ -44,8 +77,32 @@ const AnimatedBottomsheetContent = ({
44
77
  onBackdropPress,
45
78
  onDragHandlePress,
46
79
  getTestProps,
47
- enabledragsettle
80
+ enabledragsettle,
81
+ scrollRef,
82
+ containerScrollRef,
83
+ configurePanGesture
48
84
  }) => {
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]);
49
106
  const backdropAnimatedStyle = useAnimatedStyle(() => ({
50
107
  opacity: backdropOpacity.value
51
108
  }));
@@ -67,15 +124,18 @@ const AnimatedBottomsheetContent = ({
67
124
  onPress: onBackdropPress
68
125
  }, /*#__PURE__*/React.createElement(Animated.View, _extends({
69
126
  style: [styles.backdrop, backdropAnimatedStyle]
70
- }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, _extends({
127
+ }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, {
71
128
  style: [styles.container, containerAnimatedStyle]
72
- }, panHandlers), /*#__PURE__*/React.createElement(View, _extends({
129
+ // {...panHandlers}
130
+ }, /*#__PURE__*/React.createElement(View, _extends({
73
131
  style: styles.dragHandleContainer
74
132
  }, dragHandlePanHandlers), /*#__PURE__*/React.createElement(Pressable, {
75
133
  onPress: onDragHandlePress
76
134
  }, /*#__PURE__*/React.createElement(View, _extends({
77
135
  style: styles.dragIconHandle
78
- }, getTestProps('draghandle'))))), children(contentStyle)));
136
+ }, getTestProps('draghandle'))))), /*#__PURE__*/React.createElement(GestureDetector, {
137
+ gesture: panGesture
138
+ }, children(contentStyle))));
79
139
  };
80
140
  export default class WmBottomsheet extends BaseComponent {
81
141
  // Helper method to calculate animation duration based on distance and velocity
@@ -116,6 +176,12 @@ export default class WmBottomsheet extends BaseComponent {
116
176
  this.closeSheet();
117
177
  }
118
178
  }
179
+ animate(props) {
180
+ this.updateState({
181
+ contentAnimationId: Date.now(),
182
+ contentAnimatableProps: props
183
+ });
184
+ }
119
185
  constructor(_props) {
120
186
  super(_props, DEFAULT_CLASS, new WmBottomsheetProps(), new WmBottomsheetState());
121
187
  _defineProperty(this, "calculatedHeight", void 0);
@@ -138,6 +204,9 @@ export default class WmBottomsheet extends BaseComponent {
138
204
  _defineProperty(this, "isIosKeyboardHeightSet", false);
139
205
  _defineProperty(this, "sheetModalService", void 0);
140
206
  _defineProperty(this, "isDragHandleExpanding", false);
207
+ //container widget scrollview ref and y offset value
208
+ _defineProperty(this, "containerscrollViewRef", null);
209
+ _defineProperty(this, "containerscrollYoffset", 0);
141
210
  // Reanimated shared values - created once and reused
142
211
  _defineProperty(this, "translateY", void 0);
143
212
  _defineProperty(this, "backdropOpacity", void 0);
@@ -292,6 +361,20 @@ export default class WmBottomsheet extends BaseComponent {
292
361
  if (this.state.isExpanded || this.props.disableswipedownclose) {
293
362
  if (gestureState.dy < this.expandedHeight / 4 || this.props.disableswipedownclose) {
294
363
  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);
295
378
  let sheetMinimumHeight = this.props.bottomsheetminimumheight || 0.1;
296
379
  const targetHeight = this.props.disableswipedownclose ? sheetMinimumHeight * SCREEN_HEIGHT : this.calculatedHeight;
297
380
  const currentHeight = ((_this$sheetHeight = this.sheetHeight) === null || _this$sheetHeight === void 0 ? void 0 : _this$sheetHeight.value) || this.expandedHeight;
@@ -333,13 +416,60 @@ export default class WmBottomsheet extends BaseComponent {
333
416
  }
334
417
  }
335
418
  });
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
+ });
336
460
  // panResponder for bottom sheet scroll view
337
461
  _defineProperty(this, "panResponder", PanResponder.create({
338
462
  onStartShouldSetPanResponder: (_, gestureState) => {
463
+ if (this.props.disablescrollonrest && !this.state.isExpanded) {
464
+ return true;
465
+ }
339
466
  // Only handle the gesture if we're at the top and swiping down
340
467
  return gestureState.dy > 0 && this.state.scrollOffset <= 0;
341
468
  },
342
469
  onMoveShouldSetPanResponder: (_, gestureState) => {
470
+ if (this.props.disablescrollonrest && !this.state.isExpanded) {
471
+ return Math.abs(gestureState.dy) > 2;
472
+ }
343
473
  // Only handle the gesture if we're at the top and swiping down
344
474
  return gestureState.dy > 0 && this.state.scrollOffset <= 0;
345
475
  },
@@ -353,6 +483,12 @@ export default class WmBottomsheet extends BaseComponent {
353
483
  if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared) {
354
484
  const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
355
485
  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();
356
492
  }
357
493
  },
358
494
  onPanResponderRelease: (_, gestureState) => {
@@ -441,8 +577,12 @@ export default class WmBottomsheet extends BaseComponent {
441
577
  }
442
578
  this.updateState({
443
579
  isExpanded: false,
444
- localModalsOpened: []
580
+ localModalsOpened: [],
581
+ scrollOffset: 0,
582
+ contentAnimationId: 0,
583
+ contentAnimatableProps: undefined
445
584
  });
585
+ this.containerscrollYoffset = 0;
446
586
  this.handleClose();
447
587
  };
448
588
  if (this.translateY && this.backdropOpacity) {
@@ -471,7 +611,9 @@ export default class WmBottomsheet extends BaseComponent {
471
611
  lastGestureDy: 0,
472
612
  isExpanded: false,
473
613
  isBottomsheetVisible: false,
474
- localModalsOpened: []
614
+ localModalsOpened: [],
615
+ contentAnimationId: 0,
616
+ contentAnimatableProps: undefined
475
617
  });
476
618
  requestAnimationFrame(() => {
477
619
  if (this.sheetHeight) {
@@ -488,6 +630,14 @@ export default class WmBottomsheet extends BaseComponent {
488
630
  _defineProperty(this, "handleDragHandlePress", () => {
489
631
  this.invokeEventCallback('onDraghandleiconclick', [null, this]);
490
632
  });
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
+ });
491
641
  _defineProperty(this, "renderContent", props => {
492
642
  // Don't render if shared values aren't initialized yet
493
643
  if (!this.translateY || !this.backdropOpacity || !this.sheetHeight || !this.lastGestureDyShared) {
@@ -501,14 +651,21 @@ export default class WmBottomsheet extends BaseComponent {
501
651
  }) => {
502
652
  // Store topInset for later use (avoid mutation during render)
503
653
  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;
504
655
  // Update the instance variable outside of render cycle
505
656
  if (this.topInset !== topInset) {
506
657
  requestAnimationFrame(() => {
507
658
  this.topInset = topInset;
508
659
  });
509
660
  }
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;
510
667
  return /*#__PURE__*/React.createElement(View, _extends({
511
- style: this.styles.root
668
+ style: rootStyle
512
669
  }, this.getTestProps('keyboardview')), this._background, /*#__PURE__*/React.createElement(AnimatedBottomsheetContent, {
513
670
  translateY: this.translateY,
514
671
  backdropOpacity: this.backdropOpacity,
@@ -521,8 +678,21 @@ export default class WmBottomsheet extends BaseComponent {
521
678
  onBackdropPress: this.handleBackdropPress,
522
679
  onDragHandlePress: this.handleDragHandlePress,
523
680
  getTestProps: this.getTestProps.bind(this),
524
- enabledragsettle: props.enabledragsettle
525
- }, contentStyle => /*#__PURE__*/React.createElement(ScrollView, _extends({
681
+ enabledragsettle: props.enabledragsettle,
682
+ scrollRef: this.state.scrollViewRef,
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({
526
696
  ref: this.state.scrollViewRef,
527
697
  style: this.styles.sheetContentContainer,
528
698
  contentContainerStyle: [this.styles.sheetScrollContent],
@@ -540,7 +710,9 @@ export default class WmBottomsheet extends BaseComponent {
540
710
  style: contentStyle
541
711
  }, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
542
712
  style: contentStyle
543
- }, props.children))), props.enablemodalsupport && this.state.localModalsOpened && this.state.localModalsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
713
+ }, props.children))), Platform.OS === 'android' && !this.props.modal && bottomInset > 40 && /*#__PURE__*/React.createElement(SafeAreaView, {
714
+ edges: ['bottom']
715
+ }), props.enablemodalsupport && this.state.localModalsOpened && this.state.localModalsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
544
716
  key: (o.name || '') + i,
545
717
  onStartShouldSetResponder: () => true,
546
718
  onResponderEnd: () => o.isModal && this.sheetModalService.hideModal(o),
@@ -556,7 +728,18 @@ export default class WmBottomsheet extends BaseComponent {
556
728
  });
557
729
  });
558
730
  this.calculatedHeight = this.calculateSheetHeight(_props.bottomsheetheightratio);
559
-
731
+ //container srollview ref
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
+ });
560
743
  // Use bottomsheetexpandedheightratio if provided, otherwise use expandedDefaultHeight
561
744
  const expandedRatio = _props.bottomsheetexpandedheightratio || this.expandedDefaultHeight;
562
745
  const effectiveExpandedRatio = Math.max(this.minimumExpandedHeight, Math.min(expandedRatio, this.maxHeight));
@@ -681,27 +864,51 @@ export default class WmBottomsheet extends BaseComponent {
681
864
  }
682
865
  renderWidget(props) {
683
866
  if (!this.state.isBottomsheetVisible) return null;
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();
867
+ return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
868
+ top: 0,
869
+ bottom: 0,
870
+ left: 0,
871
+ right: 0
872
+ }) => {
873
+ // Use SafeAreaView on Android with button navigation to render the bottom sheet above the nav bar (when modal props is true)
874
+ // Button navigation is identified when bottom inset >= 40
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
692
900
  }
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
- }
901
+ }, wrapWithSafeArea(/*#__PURE__*/React.createElement(KeyboardAvoidingView, {
902
+ style: {
903
+ flex: 1
904
+ },
905
+ behavior: Platform.OS === 'android' ? this.state.keyboardHeight > 0 ? 'padding' : undefined : 'padding',
906
+ keyboardVerticalOffset: Platform.OS === 'ios' ? 0 : undefined
907
+ }, this.renderContent(props)))));
908
+ } else {
909
+ return this.renderContent(props);
910
+ }
911
+ });
705
912
  }
706
913
  }
707
914
  //# sourceMappingURL=bottomsheet.component.js.map