@wavemaker/app-rn-runtime 11.14.1-22.647589 → 11.14.1-23.647643

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 (56) hide show
  1. package/components/basic/bottomsheet/bottomsheet.component.js +32 -218
  2. package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
  3. package/components/basic/bottomsheet/bottomsheet.styles.js +3 -0
  4. package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
  5. package/components/container/container.component.js +13 -206
  6. package/components/container/container.component.js.map +1 -1
  7. package/components/container/container.props.js +0 -6
  8. package/components/container/container.props.js.map +1 -1
  9. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -25
  10. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  11. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +0 -1
  12. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
  13. package/components/container/wizard/wizard.component.js +4 -2
  14. package/components/container/wizard/wizard.component.js.map +1 -1
  15. package/components/container/wizard/wizard.styles.js +1 -3
  16. package/components/container/wizard/wizard.styles.js.map +1 -1
  17. package/components/container/wizard/wizardstep/wizardstep.component.js +22 -3
  18. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  19. package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
  20. package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  21. package/components/data/form/form-field/form-field.component.js +0 -2
  22. package/components/data/form/form-field/form-field.component.js.map +1 -1
  23. package/components/data/form/form-field/form-field.props.js +0 -2
  24. package/components/data/form/form-field/form-field.props.js.map +1 -1
  25. package/components/input/baseinput/baseinput.component.js +0 -7
  26. package/components/input/baseinput/baseinput.component.js.map +1 -1
  27. package/components/input/calendar/calendar.component.js +0 -4
  28. package/components/input/calendar/calendar.component.js.map +1 -1
  29. package/components/input/calendar/views/month-view.js +1 -8
  30. package/components/input/calendar/views/month-view.js.map +1 -1
  31. package/components/input/radioset/radioset.component.js +3 -1
  32. package/components/input/radioset/radioset.component.js.map +1 -1
  33. package/components/input/text/text.component.js +2 -10
  34. package/components/input/text/text.component.js.map +1 -1
  35. package/components/input/text/text.props.js +0 -1
  36. package/components/input/text/text.props.js.map +1 -1
  37. package/components/input/textarea/textarea.component.js +2 -2
  38. package/components/input/textarea/textarea.component.js.map +1 -1
  39. package/components/navigation/popover/popover.component.js +3 -3
  40. package/components/navigation/popover/popover.component.js.map +1 -1
  41. package/core/AppConfig.js.map +1 -1
  42. package/core/components/textinput.component.js +3 -0
  43. package/core/components/textinput.component.js.map +1 -1
  44. package/core/tappable.component.js +15 -109
  45. package/core/tappable.component.js.map +1 -1
  46. package/npm-shrinkwrap.json +238 -318
  47. package/package-lock.json +238 -318
  48. package/package.json +2 -2
  49. package/runtime/navigator/drawer.navigator.js +0 -2
  50. package/runtime/navigator/drawer.navigator.js.map +1 -1
  51. package/runtime/navigator/stack.navigator.js +1 -13
  52. package/runtime/navigator/stack.navigator.js.map +1 -1
  53. package/runtime/services/device/scan-service.js +34 -12
  54. package/runtime/services/device/scan-service.js.map +1 -1
  55. package/styles/theme.variables.js +0 -2
  56. package/styles/theme.variables.js.map +1 -1
@@ -5,44 +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 { Gesture, GestureDetector, GestureHandlerRootView, ScrollView } from 'react-native-gesture-handler';
8
+ import { ScrollView } from 'react-native-gesture-handler';
9
9
  import Animated, { useAnimatedStyle, withTiming, runOnJS, Easing, makeMutable, cancelAnimation } from 'react-native-reanimated';
10
10
  import WmBottomsheetProps from './bottomsheet.props';
11
11
  import { DEFAULT_CLASS } from './bottomsheet.styles';
12
12
  import { createSkeleton } from '../skeleton/skeleton.component';
13
13
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
14
14
  import { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';
15
- import { SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';
16
-
17
- // Web-only: Runs all bottom sheet animations on the JS thread (sets useNativeDriver to false)
18
- // Prevents errors on web where native driver animations are not supported
19
- // Web - Animated api is used from animation
20
- if (Platform.OS === 'web') {
21
- try {
22
- const RN = require('react-native');
23
- const RNAnimated = RN && RN.Animated;
24
- if (RNAnimated && !RNAnimated.__wmPatchedNoNativeDriver) {
25
- const wrap = name => {
26
- const original = RNAnimated[name];
27
- if (typeof original === 'function') {
28
- RNAnimated[name] = (value, config) => {
29
- const patched = {
30
- ...(config || {}),
31
- useNativeDriver: false
32
- };
33
- return original(value, patched);
34
- };
35
- }
36
- };
37
- wrap('timing');
38
- wrap('spring');
39
- wrap('decay');
40
- RNAnimated.__wmPatchedNoNativeDriver = true;
41
- }
42
- } catch (_) {
43
- // noop
44
- }
45
- }
15
+ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
46
16
  const {
47
17
  height: SCREEN_HEIGHT
48
18
  } = Dimensions.get('screen');
@@ -74,32 +44,8 @@ const AnimatedBottomsheetContent = ({
74
44
  onBackdropPress,
75
45
  onDragHandlePress,
76
46
  getTestProps,
77
- enabledragsettle,
78
- scrollRef,
79
- containerScrollRef,
80
- configurePanGesture
47
+ enabledragsettle
81
48
  }) => {
82
- // Simple RNGH GestureDetector attached to the same view as the PanResponder (panHandlers).
83
- // No thresholds/validation: logs translationY directly during pan.
84
- const panGesture = React.useMemo(() => {
85
- // Create base Pan gesture
86
- const pan = Gesture.Pan().runOnJS(true);
87
-
88
- // Add external gestures for ScrollViews (container widget scrollview)
89
- if (scrollRef && containerScrollRef) {
90
- pan.simultaneousWithExternalGesture(scrollRef, containerScrollRef);
91
- } else if (scrollRef) {
92
- pan.simultaneousWithExternalGesture(scrollRef);
93
- } else if (containerScrollRef) {
94
- pan.simultaneousWithExternalGesture(containerScrollRef);
95
- }
96
-
97
- // Apply custom logic from parent BottomSheet class
98
- if (configurePanGesture) {
99
- configurePanGesture(pan);
100
- }
101
- return pan;
102
- }, [scrollRef, containerScrollRef, configurePanGesture]);
103
49
  const backdropAnimatedStyle = useAnimatedStyle(() => ({
104
50
  opacity: backdropOpacity.value
105
51
  }));
@@ -121,18 +67,15 @@ const AnimatedBottomsheetContent = ({
121
67
  onPress: onBackdropPress
122
68
  }, /*#__PURE__*/React.createElement(Animated.View, _extends({
123
69
  style: [styles.backdrop, backdropAnimatedStyle]
124
- }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, {
70
+ }, getTestProps('backdrop'), getAccessibilityProps(AccessibilityWidgetType.BOTTOMSHEET, props)))), /*#__PURE__*/React.createElement(Animated.View, _extends({
125
71
  style: [styles.container, containerAnimatedStyle]
126
- // {...panHandlers}
127
- }, /*#__PURE__*/React.createElement(View, _extends({
72
+ }, panHandlers), /*#__PURE__*/React.createElement(View, _extends({
128
73
  style: styles.dragHandleContainer
129
74
  }, dragHandlePanHandlers), /*#__PURE__*/React.createElement(Pressable, {
130
75
  onPress: onDragHandlePress
131
76
  }, /*#__PURE__*/React.createElement(View, _extends({
132
77
  style: styles.dragIconHandle
133
- }, getTestProps('draghandle'))))), /*#__PURE__*/React.createElement(GestureDetector, {
134
- gesture: panGesture
135
- }, children(contentStyle))));
78
+ }, getTestProps('draghandle'))))), children(contentStyle)));
136
79
  };
137
80
  export default class WmBottomsheet extends BaseComponent {
138
81
  // Helper method to calculate animation duration based on distance and velocity
@@ -195,9 +138,6 @@ export default class WmBottomsheet extends BaseComponent {
195
138
  _defineProperty(this, "isIosKeyboardHeightSet", false);
196
139
  _defineProperty(this, "sheetModalService", void 0);
197
140
  _defineProperty(this, "isDragHandleExpanding", false);
198
- //container widget scrollview ref and y offset value
199
- _defineProperty(this, "containerscrollViewRef", null);
200
- _defineProperty(this, "containerscrollYoffset", 0);
201
141
  // Reanimated shared values - created once and reused
202
142
  _defineProperty(this, "translateY", void 0);
203
143
  _defineProperty(this, "backdropOpacity", void 0);
@@ -352,20 +292,6 @@ export default class WmBottomsheet extends BaseComponent {
352
292
  if (this.state.isExpanded || this.props.disableswipedownclose) {
353
293
  if (gestureState.dy < this.expandedHeight / 4 || this.props.disableswipedownclose) {
354
294
  var _this$sheetHeight;
355
- //reseting bottom sheet scrollview offset value to fix scrollview automatic scroll issue while collpsing the bottom sheet
356
- setTimeout(() => {
357
- var _this$state$scrollVie;
358
- if ((_this$state$scrollVie = this.state.scrollViewRef) !== null && _this$state$scrollVie !== void 0 && _this$state$scrollVie.current) {
359
- this.state.scrollViewRef.current.scrollTo({
360
- x: 0,
361
- y: 0,
362
- animated: false
363
- });
364
- this.updateState({
365
- scrollOffset: 0
366
- });
367
- }
368
- }, this.animationDuration);
369
295
  let sheetMinimumHeight = this.props.bottomsheetminimumheight || 0.1;
370
296
  const targetHeight = this.props.disableswipedownclose ? sheetMinimumHeight * SCREEN_HEIGHT : this.calculatedHeight;
371
297
  const currentHeight = ((_this$sheetHeight = this.sheetHeight) === null || _this$sheetHeight === void 0 ? void 0 : _this$sheetHeight.value) || this.expandedHeight;
@@ -407,60 +333,13 @@ export default class WmBottomsheet extends BaseComponent {
407
333
  }
408
334
  }
409
335
  });
410
- _defineProperty(this, "configurePanGesture", pan => {
411
- pan.enabled(true).onUpdate(event => {
412
- // ← Add : any
413
- const gestureState = {
414
- dy: event.translationY,
415
- vy: event.velocityY,
416
- moveX: event.x,
417
- moveY: event.y,
418
- vx: event.velocityX
419
- };
420
- if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
421
- const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
422
- this.translateY.value = newTranslateY;
423
- // Reset expand flag if dragging down
424
- this.isDragHandleExpanding = false;
425
- } else if (gestureState.dy < 0 && this.props.expand && this.props.bottomsheetheightratio !== 1 && !this.isDragHandleExpanding && !this.state.isExpanded && this.props.disablescrollonrest) {
426
- // Only trigger expand once with threshold of -50px upward drag
427
- this.isDragHandleExpanding = true;
428
- this.expandBottomSheet();
429
- }
430
- // ... rest of logic
431
- }).onEnd(event => {
432
- // ← Add : any
433
- const gestureState = {
434
- dy: event.translationY,
435
- vy: event.velocityY,
436
- moveX: event.x,
437
- moveY: event.y,
438
- vx: event.velocityX
439
- };
440
- if (gestureState.dy > 0 && this.state.scrollOffset <= 0 && this.containerscrollYoffset <= 0) {
441
- this.handleSwipeGesture(gestureState);
442
- }
443
- }).onFinalize((event, success) => {
444
- // ← Add types
445
- if (!success) {
446
- this.openSheet();
447
- }
448
- });
449
- return pan;
450
- });
451
336
  // panResponder for bottom sheet scroll view
452
337
  _defineProperty(this, "panResponder", PanResponder.create({
453
338
  onStartShouldSetPanResponder: (_, gestureState) => {
454
- if (this.props.disablescrollonrest && !this.state.isExpanded) {
455
- return true;
456
- }
457
339
  // Only handle the gesture if we're at the top and swiping down
458
340
  return gestureState.dy > 0 && this.state.scrollOffset <= 0;
459
341
  },
460
342
  onMoveShouldSetPanResponder: (_, gestureState) => {
461
- if (this.props.disablescrollonrest && !this.state.isExpanded) {
462
- return Math.abs(gestureState.dy) > 2;
463
- }
464
343
  // Only handle the gesture if we're at the top and swiping down
465
344
  return gestureState.dy > 0 && this.state.scrollOffset <= 0;
466
345
  },
@@ -474,12 +353,6 @@ export default class WmBottomsheet extends BaseComponent {
474
353
  if (gestureState.dy > 0 && this.translateY && this.lastGestureDyShared) {
475
354
  const newTranslateY = Math.max(0, this.lastGestureDyShared.value + gestureState.dy);
476
355
  this.translateY.value = newTranslateY;
477
- // Reset expand flag if dragging down
478
- this.isDragHandleExpanding = false;
479
- } else if (gestureState.dy < 0 && this.props.expand && this.props.bottomsheetheightratio !== 1 && !this.isDragHandleExpanding && !this.state.isExpanded) {
480
- // Only trigger expand once with threshold of -50px upward drag
481
- this.isDragHandleExpanding = true;
482
- this.expandBottomSheet();
483
356
  }
484
357
  },
485
358
  onPanResponderRelease: (_, gestureState) => {
@@ -568,10 +441,8 @@ export default class WmBottomsheet extends BaseComponent {
568
441
  }
569
442
  this.updateState({
570
443
  isExpanded: false,
571
- localModalsOpened: [],
572
- scrollOffset: 0
444
+ localModalsOpened: []
573
445
  });
574
- this.containerscrollYoffset = 0;
575
446
  this.handleClose();
576
447
  };
577
448
  if (this.translateY && this.backdropOpacity) {
@@ -630,21 +501,14 @@ export default class WmBottomsheet extends BaseComponent {
630
501
  }) => {
631
502
  // Store topInset for later use (avoid mutation during render)
632
503
  const topInset = (insets === null || insets === void 0 ? void 0 : insets.top) || 0;
633
- const bottomInset = (insets === null || insets === void 0 ? void 0 : insets.bottom) || 0;
634
504
  // Update the instance variable outside of render cycle
635
505
  if (this.topInset !== topInset) {
636
506
  requestAnimationFrame(() => {
637
507
  this.topInset = topInset;
638
508
  });
639
509
  }
640
- const absoluteStyle = {
641
- top: 0,
642
- left: 0,
643
- right: 0
644
- };
645
- const rootStyle = props.modal ? [this.styles.root, absoluteStyle] : this.styles.root;
646
510
  return /*#__PURE__*/React.createElement(View, _extends({
647
- style: rootStyle
511
+ style: this.styles.root
648
512
  }, this.getTestProps('keyboardview')), this._background, /*#__PURE__*/React.createElement(AnimatedBottomsheetContent, {
649
513
  translateY: this.translateY,
650
514
  backdropOpacity: this.backdropOpacity,
@@ -657,21 +521,8 @@ export default class WmBottomsheet extends BaseComponent {
657
521
  onBackdropPress: this.handleBackdropPress,
658
522
  onDragHandlePress: this.handleDragHandlePress,
659
523
  getTestProps: this.getTestProps.bind(this),
660
- enabledragsettle: props.enabledragsettle,
661
- scrollRef: this.state.scrollViewRef,
662
- containerScrollRef: this.containerscrollViewRef,
663
- configurePanGesture: this.configurePanGesture
664
- }, contentStyle => props.issticky ? props.enablemodalsupport ? /*#__PURE__*/React.createElement(ModalProvider, {
665
- value: this.sheetModalService
666
- }, /*#__PURE__*/React.createElement(Animated.View, {
667
- style: [contentStyle, this.styles.sheetContentContainer, {
668
- overflow: 'hidden'
669
- }]
670
- }, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
671
- style: [contentStyle, this.styles.sheetContentContainer, {
672
- overflow: 'hidden'
673
- }]
674
- }, props.children) : /*#__PURE__*/React.createElement(ScrollView, _extends({
524
+ enabledragsettle: props.enabledragsettle
525
+ }, contentStyle => /*#__PURE__*/React.createElement(ScrollView, _extends({
675
526
  ref: this.state.scrollViewRef,
676
527
  style: this.styles.sheetContentContainer,
677
528
  contentContainerStyle: [this.styles.sheetScrollContent],
@@ -689,9 +540,7 @@ export default class WmBottomsheet extends BaseComponent {
689
540
  style: contentStyle
690
541
  }, props.children)) : /*#__PURE__*/React.createElement(Animated.View, {
691
542
  style: contentStyle
692
- }, props.children))), Platform.OS === 'android' && !this.props.modal && bottomInset > 40 && /*#__PURE__*/React.createElement(SafeAreaView, {
693
- edges: ['bottom']
694
- }), 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, {
695
544
  key: (o.name || '') + i,
696
545
  onStartShouldSetResponder: () => true,
697
546
  onResponderEnd: () => o.isModal && this.sheetModalService.hideModal(o),
@@ -707,18 +556,7 @@ export default class WmBottomsheet extends BaseComponent {
707
556
  });
708
557
  });
709
558
  this.calculatedHeight = this.calculateSheetHeight(_props.bottomsheetheightratio);
710
- //container srollview ref
711
- this.subscribe('containerScrollViewReady', ref => {
712
- if (ref && ref.current && this.containerscrollViewRef !== ref) {
713
- this.containerscrollViewRef = ref;
714
- this.forceUpdate();
715
- }
716
- });
717
- //container scrollview y offset value
718
- this.subscribe('scroll', e => {
719
- const offsetY = e.nativeEvent.contentOffset.y;
720
- this.containerscrollYoffset = offsetY;
721
- });
559
+
722
560
  // Use bottomsheetexpandedheightratio if provided, otherwise use expandedDefaultHeight
723
561
  const expandedRatio = _props.bottomsheetexpandedheightratio || this.expandedDefaultHeight;
724
562
  const effectiveExpandedRatio = Math.max(this.minimumExpandedHeight, Math.min(expandedRatio, this.maxHeight));
@@ -843,51 +681,27 @@ export default class WmBottomsheet extends BaseComponent {
843
681
  }
844
682
  renderWidget(props) {
845
683
  if (!this.state.isBottomsheetVisible) return null;
846
- return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
847
- top: 0,
848
- bottom: 0,
849
- left: 0,
850
- right: 0
851
- }) => {
852
- // Use SafeAreaView on Android with button navigation to render the bottom sheet above the nav bar (when modal props is true)
853
- // Button navigation is identified when bottom inset >= 40
854
- const hasButtonNavigation = Platform.OS === 'android' && ((insets === null || insets === void 0 ? void 0 : insets.bottom) || 0) >= 40;
855
- const wrapWithSafeArea = children => {
856
- if (hasButtonNavigation) {
857
- return /*#__PURE__*/React.createElement(SafeAreaView, {
858
- style: {
859
- flex: 1
860
- }
861
- }, children);
862
- }
863
- return children;
864
- };
865
- if (props.modal) {
866
- return /*#__PURE__*/React.createElement(Modal, {
867
- visible: this.state.isBottomsheetVisible,
868
- transparent: true,
869
- animationType: "none",
870
- onRequestClose: () => {
871
- if (!this.props.disableswipedownclose && this.props.autoclose !== 'disabled') {
872
- this.closeSheet();
873
- }
874
- },
875
- statusBarTranslucent: false
876
- }, /*#__PURE__*/React.createElement(GestureHandlerRootView, {
877
- style: {
878
- 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();
879
692
  }
880
- }, wrapWithSafeArea(/*#__PURE__*/React.createElement(KeyboardAvoidingView, {
881
- style: {
882
- flex: 1
883
- },
884
- behavior: 'padding',
885
- keyboardVerticalOffset: Platform.OS === 'ios' ? 0 : undefined
886
- }, this.renderContent(props)))));
887
- } else {
888
- return this.renderContent(props);
889
- }
890
- });
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
+ }
891
705
  }
892
706
  }
893
707
  //# sourceMappingURL=bottomsheet.component.js.map