react-crud-mobile 1.3.97 → 1.3.99
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.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +76 -76
- package/src/elements/UI.tsx +74 -74
- package/src/elements/UIChildren.tsx +139 -139
- package/src/elements/UIComplete.tsx +14 -14
- package/src/elements/UIElement.tsx +788 -788
- package/src/elements/UITag.tsx +13 -13
- package/src/elements/charts/ElChart.tsx +10 -10
- package/src/elements/core/SafeView.tsx +63 -63
- package/src/elements/core/UIButton.tsx +139 -139
- package/src/elements/core/UIHeader.tsx +38 -38
- package/src/elements/core/UIIcon.tsx +25 -25
- package/src/elements/core/UIInclude.tsx +40 -40
- package/src/elements/core/UIInput.tsx +96 -96
- package/src/elements/core/UIList.tsx +168 -168
- package/src/elements/core/UIListRow.tsx +123 -123
- package/src/elements/core/UIModal.tsx +174 -174
- package/src/elements/core/UIOrder.tsx +123 -123
- package/src/elements/core/UIQuantity.tsx +98 -98
- package/src/elements/core/UISelect.tsx +171 -171
- package/src/elements/core/UIToast.tsx +44 -44
- package/src/elements/core/UIToggle.tsx +102 -102
- package/src/elements/core/UIView.tsx +69 -69
- package/src/elements/index.ts +1 -1
- package/src/elements/tabs/ElTabs.tsx +178 -178
- package/src/index.ts +1 -1
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import React, { useRef, useState } from 'react';
|
|
2
|
-
import { ChildType, ScopeUtils, Utils } from 'react-crud-utils';
|
|
3
|
-
import UIChildren from '../UIChildren';
|
|
4
|
-
import { StyleSheet, TouchableHighlight, View } from 'react-native';
|
|
5
|
-
import { useIsVisible } from '../../hooks/useIsVisible';
|
|
6
|
-
|
|
7
|
-
interface UIListRowType extends ChildType {
|
|
8
|
-
item: any;
|
|
9
|
-
index: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function UIListRow(props: UIListRowType) {
|
|
13
|
-
const scope = props.scope;
|
|
14
|
-
const index = props.index;
|
|
15
|
-
const original = scope.original;
|
|
16
|
-
const item = props.item;
|
|
17
|
-
const cols = scope.getPart('cols', undefined, -1);
|
|
18
|
-
const rowWidth = Math.floor(100 / cols) + '%';
|
|
19
|
-
const styles = { repeat: stylesRepeat, list: stylesList }?.[original.type];
|
|
20
|
-
const name = `${scope.key('row', index, '')}`;
|
|
21
|
-
const [row] = useState(
|
|
22
|
-
ScopeUtils.create({
|
|
23
|
-
...original,
|
|
24
|
-
parent: scope,
|
|
25
|
-
name,
|
|
26
|
-
crud: scope.crud,
|
|
27
|
-
index,
|
|
28
|
-
type: 'row',
|
|
29
|
-
data: item,
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const targetRef = useRef(null);
|
|
34
|
-
const isVisible = useIsVisible(targetRef, row);
|
|
35
|
-
|
|
36
|
-
const onClick = (item: any) => {
|
|
37
|
-
row.call('click', { value: item, item, edit: true, index });
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const Child = () => {
|
|
41
|
-
if (!isVisible && original.useIsInView && !row.visible && index > 20) {
|
|
42
|
-
return <></>;
|
|
43
|
-
}
|
|
44
|
-
return (
|
|
45
|
-
<>
|
|
46
|
-
<UIChildren scope={row} crud={row.crud}>
|
|
47
|
-
{props.children}
|
|
48
|
-
</UIChildren>
|
|
49
|
-
</>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const ListItem = () => {
|
|
54
|
-
let [updateIndex, setUpdateIndex] = useState(0);
|
|
55
|
-
let key = scope.key('item');
|
|
56
|
-
|
|
57
|
-
const getRowStyle = () => {
|
|
58
|
-
let css = row.getStyle('row', { ...styles.row, minHeight: 40 });
|
|
59
|
-
|
|
60
|
-
if (cols > 0) {
|
|
61
|
-
css.width = rowWidth;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return css;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
row.update = () => {
|
|
68
|
-
scope.updateIndex = scope.updateIndex + 1;
|
|
69
|
-
|
|
70
|
-
setUpdateIndex(++updateIndex);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
let renderedRow = row.getPart('renderedItem', undefined, true);
|
|
74
|
-
|
|
75
|
-
if (renderedRow === false) {
|
|
76
|
-
return <></>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (!original.click) {
|
|
80
|
-
return (
|
|
81
|
-
<View key={key} style={getRowStyle()} ref={targetRef}>
|
|
82
|
-
<Child />
|
|
83
|
-
</View>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
return (
|
|
87
|
-
<TouchableHighlight
|
|
88
|
-
key={key}
|
|
89
|
-
style={getRowStyle()}
|
|
90
|
-
underlayColor={'transparent'}
|
|
91
|
-
ref={targetRef}
|
|
92
|
-
onPress={e => {
|
|
93
|
-
e.stopPropagation();
|
|
94
|
-
onClick(item);
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
<Child />
|
|
98
|
-
</TouchableHighlight>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
return <ListItem />;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const stylesList = StyleSheet.create({
|
|
106
|
-
row: {
|
|
107
|
-
padding: 5,
|
|
108
|
-
margin: 0,
|
|
109
|
-
width: '100%',
|
|
110
|
-
backgroundColor: 'background',
|
|
111
|
-
gap: 10,
|
|
112
|
-
borderRadius: 8,
|
|
113
|
-
justifyContent: 'center',
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const stylesRepeat = StyleSheet.create({
|
|
118
|
-
row: {
|
|
119
|
-
padding: 0,
|
|
120
|
-
width: '100%',
|
|
121
|
-
justifyContent: 'center',
|
|
122
|
-
},
|
|
123
|
-
});
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { ChildType, ScopeUtils, Utils } from 'react-crud-utils';
|
|
3
|
+
import UIChildren from '../UIChildren';
|
|
4
|
+
import { StyleSheet, TouchableHighlight, View } from 'react-native';
|
|
5
|
+
import { useIsVisible } from '../../hooks/useIsVisible';
|
|
6
|
+
|
|
7
|
+
interface UIListRowType extends ChildType {
|
|
8
|
+
item: any;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function UIListRow(props: UIListRowType) {
|
|
13
|
+
const scope = props.scope;
|
|
14
|
+
const index = props.index;
|
|
15
|
+
const original = scope.original;
|
|
16
|
+
const item = props.item;
|
|
17
|
+
const cols = scope.getPart('cols', undefined, -1);
|
|
18
|
+
const rowWidth = Math.floor(100 / cols) + '%';
|
|
19
|
+
const styles = { repeat: stylesRepeat, list: stylesList }?.[original.type];
|
|
20
|
+
const name = `${scope.key('row', index, '')}`;
|
|
21
|
+
const [row] = useState(
|
|
22
|
+
ScopeUtils.create({
|
|
23
|
+
...original,
|
|
24
|
+
parent: scope,
|
|
25
|
+
name,
|
|
26
|
+
crud: scope.crud,
|
|
27
|
+
index,
|
|
28
|
+
type: 'row',
|
|
29
|
+
data: item,
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const targetRef = useRef(null);
|
|
34
|
+
const isVisible = useIsVisible(targetRef, row);
|
|
35
|
+
|
|
36
|
+
const onClick = (item: any) => {
|
|
37
|
+
row.call('click', { value: item, item, edit: true, index });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const Child = () => {
|
|
41
|
+
if (!isVisible && original.useIsInView && !row.visible && index > 20) {
|
|
42
|
+
return <></>;
|
|
43
|
+
}
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<UIChildren scope={row} crud={row.crud}>
|
|
47
|
+
{props.children}
|
|
48
|
+
</UIChildren>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const ListItem = () => {
|
|
54
|
+
let [updateIndex, setUpdateIndex] = useState(0);
|
|
55
|
+
let key = scope.key('item');
|
|
56
|
+
|
|
57
|
+
const getRowStyle = () => {
|
|
58
|
+
let css = row.getStyle('row', { ...styles.row, minHeight: 40 });
|
|
59
|
+
|
|
60
|
+
if (cols > 0) {
|
|
61
|
+
css.width = rowWidth;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return css;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
row.update = () => {
|
|
68
|
+
scope.updateIndex = scope.updateIndex + 1;
|
|
69
|
+
|
|
70
|
+
setUpdateIndex(++updateIndex);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
let renderedRow = row.getPart('renderedItem', undefined, true);
|
|
74
|
+
|
|
75
|
+
if (renderedRow === false) {
|
|
76
|
+
return <></>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!original.click) {
|
|
80
|
+
return (
|
|
81
|
+
<View key={key} style={getRowStyle()} ref={targetRef}>
|
|
82
|
+
<Child />
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return (
|
|
87
|
+
<TouchableHighlight
|
|
88
|
+
key={key}
|
|
89
|
+
style={getRowStyle()}
|
|
90
|
+
underlayColor={'transparent'}
|
|
91
|
+
ref={targetRef}
|
|
92
|
+
onPress={e => {
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
onClick(item);
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<Child />
|
|
98
|
+
</TouchableHighlight>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return <ListItem />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const stylesList = StyleSheet.create({
|
|
106
|
+
row: {
|
|
107
|
+
padding: 5,
|
|
108
|
+
margin: 0,
|
|
109
|
+
width: '100%',
|
|
110
|
+
backgroundColor: 'background',
|
|
111
|
+
gap: 10,
|
|
112
|
+
borderRadius: 8,
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const stylesRepeat = StyleSheet.create({
|
|
118
|
+
row: {
|
|
119
|
+
padding: 0,
|
|
120
|
+
width: '100%',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
},
|
|
123
|
+
});
|
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import { useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ChildType,
|
|
4
|
-
ComponentUtils,
|
|
5
|
-
CrudUtils,
|
|
6
|
-
MethodType,
|
|
7
|
-
Utils,
|
|
8
|
-
ViewUtils,
|
|
9
|
-
} from 'react-crud-utils';
|
|
10
|
-
import {
|
|
11
|
-
Text,
|
|
12
|
-
TouchableOpacity,
|
|
13
|
-
StyleSheet,
|
|
14
|
-
Modal,
|
|
15
|
-
View,
|
|
16
|
-
SafeAreaView,
|
|
17
|
-
ScrollView,
|
|
18
|
-
} from 'react-native';
|
|
19
|
-
import UIChildren from '../UIChildren';
|
|
20
|
-
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
21
|
-
import UIToast from './UIToast';
|
|
22
|
-
|
|
23
|
-
interface UIModalType extends ChildType {
|
|
24
|
-
open?: boolean;
|
|
25
|
-
dialog?: any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default function UIModal({
|
|
29
|
-
scope,
|
|
30
|
-
open,
|
|
31
|
-
dialog,
|
|
32
|
-
...props
|
|
33
|
-
}: UIModalType) {
|
|
34
|
-
let [modalVisible, setModalVisible] = useState(open === true);
|
|
35
|
-
let [index, setIndex] = useState(0);
|
|
36
|
-
//v6
|
|
37
|
-
|
|
38
|
-
const label = scope.getLabel();
|
|
39
|
-
const theme = scope.getTheme();
|
|
40
|
-
const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
|
|
41
|
-
const scrollRef = useRef(null);
|
|
42
|
-
|
|
43
|
-
const style = (part: string, extra?: any) => {
|
|
44
|
-
let st = { ...styles[part], ...extra };
|
|
45
|
-
|
|
46
|
-
return { ...scope.getStyle(part, st) };
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const onClose = () => {
|
|
50
|
-
scope.close({ scope, crud: scope.currentDialog?.crud, event: {} });
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
scope.toggleDialog = vis => {
|
|
54
|
-
modalVisible = vis;
|
|
55
|
-
setModalVisible(modalVisible);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
scope.update = () => {
|
|
59
|
-
setIndex(++index);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
let curr = scope.currentDialog?.crud;
|
|
63
|
-
let main = ViewUtils.getCrud('view');
|
|
64
|
-
|
|
65
|
-
if (!curr) {
|
|
66
|
-
return <></>;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (curr.uuid !== main.dialog?.crud?.uuid) {
|
|
70
|
-
return <></>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const headerRight = ComponentUtils.getDefine(props, 'header', 'right');
|
|
74
|
-
const bottom = ComponentUtils.getDefine(props, 'bottom');
|
|
75
|
-
|
|
76
|
-
scope.put('scrollRef', scrollRef);
|
|
77
|
-
|
|
78
|
-
ComponentUtils.setViewScope(scope);
|
|
79
|
-
|
|
80
|
-
let color = Utils.nvl(headerStyle.color, 'white');
|
|
81
|
-
let defaults = { color };
|
|
82
|
-
let key = `${curr.name}-${index}`;
|
|
83
|
-
|
|
84
|
-
let Content = () => {
|
|
85
|
-
if (dialog?.component) {
|
|
86
|
-
let Aux = dialog?.component;
|
|
87
|
-
|
|
88
|
-
return <Aux crud={curr} />;
|
|
89
|
-
}
|
|
90
|
-
return (
|
|
91
|
-
<UIChildren scope={scope} crud={curr}>
|
|
92
|
-
{props.children}
|
|
93
|
-
</UIChildren>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
<Modal
|
|
99
|
-
key={key}
|
|
100
|
-
animationType="slide"
|
|
101
|
-
transparent={true}
|
|
102
|
-
visible={modalVisible}
|
|
103
|
-
onRequestClose={onClose}
|
|
104
|
-
>
|
|
105
|
-
<SafeAreaView style={style('modalTop')} />
|
|
106
|
-
<SafeAreaView style={style('modalSafe')}>
|
|
107
|
-
<View style={scope.getStyle('header', headerStyle)}>
|
|
108
|
-
<TouchableOpacity onPress={onClose} style={style('modalCloseButton')}>
|
|
109
|
-
<Ionicons
|
|
110
|
-
name="chevron-back-outline"
|
|
111
|
-
size={24}
|
|
112
|
-
color={color}
|
|
113
|
-
style={style('modalCloseText', defaults)}
|
|
114
|
-
/>
|
|
115
|
-
</TouchableOpacity>
|
|
116
|
-
<Text style={style('modalTitle', defaults)}>{label}</Text>
|
|
117
|
-
{!Utils.isEmpty(headerRight) && (
|
|
118
|
-
<UIChildren scope={scope} crud={curr} transient>
|
|
119
|
-
{headerRight}
|
|
120
|
-
</UIChildren>
|
|
121
|
-
)}
|
|
122
|
-
</View>
|
|
123
|
-
<ScrollView
|
|
124
|
-
contentContainerStyle={{ flexGrow: 1, paddingBottom: 50 }}
|
|
125
|
-
style={style('modalContent')}
|
|
126
|
-
nestedScrollEnabled={true}
|
|
127
|
-
ref={scrollRef}
|
|
128
|
-
>
|
|
129
|
-
<View
|
|
130
|
-
style={{
|
|
131
|
-
flex: 1,
|
|
132
|
-
paddingLeft: 15,
|
|
133
|
-
paddingRight: 15,
|
|
134
|
-
paddingTop: 10,
|
|
135
|
-
paddingBottom: 10,
|
|
136
|
-
}}
|
|
137
|
-
>
|
|
138
|
-
<Content />
|
|
139
|
-
</View>
|
|
140
|
-
</ScrollView>
|
|
141
|
-
{bottom}
|
|
142
|
-
</SafeAreaView>
|
|
143
|
-
<UIToast />
|
|
144
|
-
</Modal>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const styles = StyleSheet.create({
|
|
149
|
-
modalTop: {
|
|
150
|
-
backgroundColor: 'primary',
|
|
151
|
-
width: '100%',
|
|
152
|
-
},
|
|
153
|
-
modalSafe: {
|
|
154
|
-
flex: 1,
|
|
155
|
-
width: '100%',
|
|
156
|
-
backgroundColor: 'background',
|
|
157
|
-
},
|
|
158
|
-
modalCloseButton: {
|
|
159
|
-
padding: 10,
|
|
160
|
-
},
|
|
161
|
-
modalCloseText: {
|
|
162
|
-
fontSize: 18,
|
|
163
|
-
color: 'white',
|
|
164
|
-
},
|
|
165
|
-
modalTitle: {
|
|
166
|
-
fontSize: 18,
|
|
167
|
-
fontWeight: 'bold',
|
|
168
|
-
marginLeft: 10,
|
|
169
|
-
},
|
|
170
|
-
modalContent: {
|
|
171
|
-
flex: 1,
|
|
172
|
-
backgroundColor: 'background',
|
|
173
|
-
},
|
|
174
|
-
});
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ChildType,
|
|
4
|
+
ComponentUtils,
|
|
5
|
+
CrudUtils,
|
|
6
|
+
MethodType,
|
|
7
|
+
Utils,
|
|
8
|
+
ViewUtils,
|
|
9
|
+
} from 'react-crud-utils';
|
|
10
|
+
import {
|
|
11
|
+
Text,
|
|
12
|
+
TouchableOpacity,
|
|
13
|
+
StyleSheet,
|
|
14
|
+
Modal,
|
|
15
|
+
View,
|
|
16
|
+
SafeAreaView,
|
|
17
|
+
ScrollView,
|
|
18
|
+
} from 'react-native';
|
|
19
|
+
import UIChildren from '../UIChildren';
|
|
20
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
21
|
+
import UIToast from './UIToast';
|
|
22
|
+
|
|
23
|
+
interface UIModalType extends ChildType {
|
|
24
|
+
open?: boolean;
|
|
25
|
+
dialog?: any;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function UIModal({
|
|
29
|
+
scope,
|
|
30
|
+
open,
|
|
31
|
+
dialog,
|
|
32
|
+
...props
|
|
33
|
+
}: UIModalType) {
|
|
34
|
+
let [modalVisible, setModalVisible] = useState(open === true);
|
|
35
|
+
let [index, setIndex] = useState(0);
|
|
36
|
+
//v6
|
|
37
|
+
|
|
38
|
+
const label = scope.getLabel();
|
|
39
|
+
const theme = scope.getTheme();
|
|
40
|
+
const headerStyle = Utils.nvl(theme.styles?.defaults?.header, {});
|
|
41
|
+
const scrollRef = useRef(null);
|
|
42
|
+
|
|
43
|
+
const style = (part: string, extra?: any) => {
|
|
44
|
+
let st = { ...styles[part], ...extra };
|
|
45
|
+
|
|
46
|
+
return { ...scope.getStyle(part, st) };
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const onClose = () => {
|
|
50
|
+
scope.close({ scope, crud: scope.currentDialog?.crud, event: {} });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
scope.toggleDialog = vis => {
|
|
54
|
+
modalVisible = vis;
|
|
55
|
+
setModalVisible(modalVisible);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
scope.update = () => {
|
|
59
|
+
setIndex(++index);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
let curr = scope.currentDialog?.crud;
|
|
63
|
+
let main = ViewUtils.getCrud('view');
|
|
64
|
+
|
|
65
|
+
if (!curr) {
|
|
66
|
+
return <></>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (curr.uuid !== main.dialog?.crud?.uuid) {
|
|
70
|
+
return <></>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const headerRight = ComponentUtils.getDefine(props, 'header', 'right');
|
|
74
|
+
const bottom = ComponentUtils.getDefine(props, 'bottom');
|
|
75
|
+
|
|
76
|
+
scope.put('scrollRef', scrollRef);
|
|
77
|
+
|
|
78
|
+
ComponentUtils.setViewScope(scope);
|
|
79
|
+
|
|
80
|
+
let color = Utils.nvl(headerStyle.color, 'white');
|
|
81
|
+
let defaults = { color };
|
|
82
|
+
let key = `${curr.name}-${index}`;
|
|
83
|
+
|
|
84
|
+
let Content = () => {
|
|
85
|
+
if (dialog?.component) {
|
|
86
|
+
let Aux = dialog?.component;
|
|
87
|
+
|
|
88
|
+
return <Aux crud={curr} />;
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
<UIChildren scope={scope} crud={curr}>
|
|
92
|
+
{props.children}
|
|
93
|
+
</UIChildren>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Modal
|
|
99
|
+
key={key}
|
|
100
|
+
animationType="slide"
|
|
101
|
+
transparent={true}
|
|
102
|
+
visible={modalVisible}
|
|
103
|
+
onRequestClose={onClose}
|
|
104
|
+
>
|
|
105
|
+
<SafeAreaView style={style('modalTop')} />
|
|
106
|
+
<SafeAreaView style={style('modalSafe')}>
|
|
107
|
+
<View style={scope.getStyle('header', headerStyle)}>
|
|
108
|
+
<TouchableOpacity onPress={onClose} style={style('modalCloseButton')}>
|
|
109
|
+
<Ionicons
|
|
110
|
+
name="chevron-back-outline"
|
|
111
|
+
size={24}
|
|
112
|
+
color={color}
|
|
113
|
+
style={style('modalCloseText', defaults)}
|
|
114
|
+
/>
|
|
115
|
+
</TouchableOpacity>
|
|
116
|
+
<Text style={style('modalTitle', defaults)}>{label}</Text>
|
|
117
|
+
{!Utils.isEmpty(headerRight) && (
|
|
118
|
+
<UIChildren scope={scope} crud={curr} transient>
|
|
119
|
+
{headerRight}
|
|
120
|
+
</UIChildren>
|
|
121
|
+
)}
|
|
122
|
+
</View>
|
|
123
|
+
<ScrollView
|
|
124
|
+
contentContainerStyle={{ flexGrow: 1, paddingBottom: 50 }}
|
|
125
|
+
style={style('modalContent')}
|
|
126
|
+
nestedScrollEnabled={true}
|
|
127
|
+
ref={scrollRef}
|
|
128
|
+
>
|
|
129
|
+
<View
|
|
130
|
+
style={{
|
|
131
|
+
flex: 1,
|
|
132
|
+
paddingLeft: 15,
|
|
133
|
+
paddingRight: 15,
|
|
134
|
+
paddingTop: 10,
|
|
135
|
+
paddingBottom: 10,
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
<Content />
|
|
139
|
+
</View>
|
|
140
|
+
</ScrollView>
|
|
141
|
+
{bottom}
|
|
142
|
+
</SafeAreaView>
|
|
143
|
+
<UIToast />
|
|
144
|
+
</Modal>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const styles = StyleSheet.create({
|
|
149
|
+
modalTop: {
|
|
150
|
+
backgroundColor: 'primary',
|
|
151
|
+
width: '100%',
|
|
152
|
+
},
|
|
153
|
+
modalSafe: {
|
|
154
|
+
flex: 1,
|
|
155
|
+
width: '100%',
|
|
156
|
+
backgroundColor: 'background',
|
|
157
|
+
},
|
|
158
|
+
modalCloseButton: {
|
|
159
|
+
padding: 10,
|
|
160
|
+
},
|
|
161
|
+
modalCloseText: {
|
|
162
|
+
fontSize: 18,
|
|
163
|
+
color: 'white',
|
|
164
|
+
},
|
|
165
|
+
modalTitle: {
|
|
166
|
+
fontSize: 18,
|
|
167
|
+
fontWeight: 'bold',
|
|
168
|
+
marginLeft: 10,
|
|
169
|
+
},
|
|
170
|
+
modalContent: {
|
|
171
|
+
flex: 1,
|
|
172
|
+
backgroundColor: 'background',
|
|
173
|
+
},
|
|
174
|
+
});
|