react-crud-mobile 1.3.45 → 1.3.47

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.45",
2
+ "version": "1.3.47",
3
3
  "license": "MIT",
4
4
  "description": "Uma biblioteca de componentes para React Native",
5
5
  "main": "dist/index.js",
@@ -1,10 +1,9 @@
1
- import { useEffect, useRef, useState } from 'react';
1
+ import { useRef, useState } from 'react';
2
2
  import {
3
3
  ChildType,
4
4
  ComponentUtils,
5
5
  CrudUtils,
6
6
  MethodType,
7
- useTheme,
8
7
  Utils,
9
8
  ViewUtils,
10
9
  } from 'react-crud-utils';
@@ -14,14 +13,12 @@ import {
14
13
  StyleSheet,
15
14
  Modal,
16
15
  View,
17
- StatusBar,
18
16
  SafeAreaView,
19
17
  ScrollView,
20
18
  } from 'react-native';
21
19
  import UIChildren from '../UIChildren';
22
20
  import Ionicons from '@expo/vector-icons/Ionicons';
23
21
  import UIToast from './UIToast';
24
- import MobileUtils from '../../utils/MobileUtils';
25
22
 
26
23
  export default function UIModal(props: ChildType) {
27
24
  let [modalVisible, setModalVisible] = useState(false);
@@ -105,10 +102,6 @@ export default function UIModal(props: ChildType) {
105
102
  scope.update();
106
103
  };
107
104
 
108
- useEffect(() => {
109
- MobileUtils.syncTheme();
110
- }, [modalVisible]);
111
-
112
105
  let curr = scope.currentDialog;
113
106
 
114
107
  if (!curr) {
@@ -8,6 +8,7 @@ import {
8
8
  View,
9
9
  StatusBar,
10
10
  SafeAreaView,
11
+ ScrollView,
11
12
  } from 'react-native';
12
13
  import { Ionicons } from '@expo/vector-icons';
13
14
  import UI from '../UI';
@@ -26,6 +27,7 @@ export default function UISelect(props: ChildType) {
26
27
  setModalVisible(!modalVisible);
27
28
  };
28
29
 
30
+ const scrollRef = useRef(null);
29
31
  const iconColor = Utils.nvl(theme.colors?.text, '#100e0e');
30
32
  const modalColor = Utils.nvl(headerStyle.color, 'white');
31
33
  const defaults = { color: modalColor };
@@ -80,6 +82,47 @@ export default function UISelect(props: ChildType) {
80
82
  visible={isModalVisible()}
81
83
  onRequestClose={() => setModalVisible(false)}
82
84
  >
85
+ <SafeAreaView style={style('modalTop')} />
86
+ <SafeAreaView style={style('modalSafe')}>
87
+ <View style={scope.getStyle('header', headerStyle)}>
88
+ <TouchableOpacity
89
+ onPress={handlePress}
90
+ style={style('modalCloseButton')}
91
+ >
92
+ <Ionicons
93
+ name="close"
94
+ size={24}
95
+ color={modalColor}
96
+ style={style('modalCloseText', defaults)}
97
+ />
98
+ </TouchableOpacity>
99
+ <Text style={style('modalTitle', defaults)}>{placeholder}</Text>
100
+ </View>
101
+ <ScrollView
102
+ contentContainerStyle={{ flexGrow: 1, paddingBottom: 50 }}
103
+ style={style('modalContent')}
104
+ nestedScrollEnabled={true}
105
+ ref={scrollRef}
106
+ >
107
+ <View style={{ flex: 1 }}>
108
+ <UI.List
109
+ data={items}
110
+ name={scope.getName('list')}
111
+ layout="card"
112
+ click={onClick}
113
+ rowStyle={{
114
+ paddingLeft: 15,
115
+ paddinRight: 15,
116
+ ...scope.original?.rowStyle,
117
+ }}
118
+ {...scope.original?.listProps}
119
+ >
120
+ <UI.Value value="#{@this.label}" />
121
+ </UI.List>
122
+ </View>
123
+ </ScrollView>
124
+ </SafeAreaView>
125
+
83
126
  <SafeAreaView style={style('modalTop')} />
84
127
  <SafeAreaView style={style('modalSafe')}>
85
128
  <View style={scope.getStyle('header', headerStyle)}>