react-crud-mobile 1.3.45 → 1.3.46
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/dist/react-crud-mobile.cjs.development.js +39 -79
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +40 -80
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIModal.tsx +1 -8
- package/src/elements/core/UISelect.tsx +20 -55
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
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) {
|
|
@@ -14,7 +14,6 @@ import UI from '../UI';
|
|
|
14
14
|
import MobileUtils from '../../utils/MobileUtils';
|
|
15
15
|
|
|
16
16
|
export default function UISelect(props: ChildType) {
|
|
17
|
-
const [modalVisible, setModalVisible] = useState(false);
|
|
18
17
|
const scope = props.scope;
|
|
19
18
|
const element = scope.original;
|
|
20
19
|
const items = Utils.nvl(scope.getOptions(), []);
|
|
@@ -22,8 +21,10 @@ export default function UISelect(props: ChildType) {
|
|
|
22
21
|
const value = scope.getDisplayValue();
|
|
23
22
|
const theme = scope.getTheme();
|
|
24
23
|
const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
|
|
24
|
+
const dlgName = scope.getName('dialog');
|
|
25
|
+
|
|
25
26
|
const handlePress = () => {
|
|
26
|
-
|
|
27
|
+
scope.call('click', { click: { action: 'dialog', dialog: dlgName } });
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
const iconColor = Utils.nvl(theme.colors?.text, '#100e0e');
|
|
@@ -39,8 +40,6 @@ export default function UISelect(props: ChildType) {
|
|
|
39
40
|
} else {
|
|
40
41
|
scope.changeValue(value);
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
setModalVisible(false);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
const style = (part: string, extra?: any) => {
|
|
@@ -48,19 +47,9 @@ export default function UISelect(props: ChildType) {
|
|
|
48
47
|
|
|
49
48
|
return scope.getStyle(part, all);
|
|
50
49
|
};
|
|
51
|
-
|
|
52
|
-
const isModalVisible = () => {
|
|
53
|
-
return modalVisible;
|
|
54
|
-
};
|
|
55
|
-
//v4
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
MobileUtils.syncTheme();
|
|
59
|
-
}, [modalVisible]);
|
|
60
|
-
|
|
61
50
|
return (
|
|
62
51
|
<View
|
|
63
|
-
key={scope.getName(`${scope.getPart('modal')}
|
|
52
|
+
key={scope.getName(`${scope.getPart('modal')}`)}
|
|
64
53
|
style={style('selectRoot')}
|
|
65
54
|
>
|
|
66
55
|
<TouchableOpacity onPress={handlePress} style={style('selectInput')}>
|
|
@@ -74,46 +63,22 @@ export default function UISelect(props: ChildType) {
|
|
|
74
63
|
style={style('iconStyle', {})}
|
|
75
64
|
/>
|
|
76
65
|
</TouchableOpacity>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
color={modalColor}
|
|
94
|
-
style={style('modalCloseText', defaults)}
|
|
95
|
-
/>
|
|
96
|
-
</TouchableOpacity>
|
|
97
|
-
<Text style={style('modalTitle')}>{placeholder}</Text>
|
|
98
|
-
</View>
|
|
99
|
-
<View style={style('modalContent')}>
|
|
100
|
-
<UI.List
|
|
101
|
-
data={items}
|
|
102
|
-
name={scope.getName('list')}
|
|
103
|
-
layout="card"
|
|
104
|
-
click={onClick}
|
|
105
|
-
rowStyle={{
|
|
106
|
-
paddingLeft: 15,
|
|
107
|
-
paddinRight: 15,
|
|
108
|
-
...scope.original?.rowStyle,
|
|
109
|
-
}}
|
|
110
|
-
{...scope.original?.listProps}
|
|
111
|
-
>
|
|
112
|
-
<UI.Value value="#{@this.label}" />
|
|
113
|
-
</UI.List>
|
|
114
|
-
</View>
|
|
115
|
-
</SafeAreaView>
|
|
116
|
-
</Modal>
|
|
66
|
+
<UI.Dialog name={dlgName} label="Selecione">
|
|
67
|
+
<UI.List
|
|
68
|
+
data={items}
|
|
69
|
+
name={scope.getName('list')}
|
|
70
|
+
layout="card"
|
|
71
|
+
click={onClick}
|
|
72
|
+
rowStyle={{
|
|
73
|
+
paddingLeft: 15,
|
|
74
|
+
paddinRight: 15,
|
|
75
|
+
...scope.original?.rowStyle,
|
|
76
|
+
}}
|
|
77
|
+
{...scope.original?.listProps}
|
|
78
|
+
>
|
|
79
|
+
<UI.Value value="#{@this.label}" />
|
|
80
|
+
</UI.List>
|
|
81
|
+
</UI.Dialog>
|
|
117
82
|
</View>
|
|
118
83
|
);
|
|
119
84
|
}
|