react-crud-mobile 1.0.612 → 1.0.613
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 +29 -28
- 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 +29 -28
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIList.tsx +12 -9
|
@@ -4,7 +4,6 @@ import { StyleSheet, Text, TouchableHighlight, View } from 'react-native';
|
|
|
4
4
|
import UIListRow from './UIListRow';
|
|
5
5
|
import UI from '../UI';
|
|
6
6
|
import { Ionicons } from '@expo/vector-icons';
|
|
7
|
-
import UIChildren from '../UIChildren';
|
|
8
7
|
|
|
9
8
|
export default function UIList(props: ChildType) {
|
|
10
9
|
const scope = props.scope;
|
|
@@ -17,10 +16,6 @@ export default function UIList(props: ChildType) {
|
|
|
17
16
|
const add = ComponentUtils.getDefine(props, 'add');
|
|
18
17
|
const hideAddWhenEmpty = original.hideAddWhenEmpty;
|
|
19
18
|
|
|
20
|
-
const onClick = (item: any) => {
|
|
21
|
-
scope.call('click', { value: item, item, edit: true });
|
|
22
|
-
};
|
|
23
|
-
|
|
24
19
|
const getStyle = (key: string, extra?: any) => {
|
|
25
20
|
return scope.getStyle(key, { ...extra, ...styles[key] });
|
|
26
21
|
};
|
|
@@ -74,7 +69,7 @@ export default function UIList(props: ChildType) {
|
|
|
74
69
|
return <>{empty}</>;
|
|
75
70
|
};
|
|
76
71
|
|
|
77
|
-
let RowItem = ({ item, index }) => {
|
|
72
|
+
let RowItem = ({ item, index, children }) => {
|
|
78
73
|
const name = `${scope.key('row', index, '')}`;
|
|
79
74
|
const row = ScopeUtils.create({
|
|
80
75
|
...original,
|
|
@@ -95,10 +90,14 @@ export default function UIList(props: ChildType) {
|
|
|
95
90
|
return css;
|
|
96
91
|
};
|
|
97
92
|
|
|
93
|
+
const onClick = (item: any) => {
|
|
94
|
+
row.call('click', { value: item, item, edit: true });
|
|
95
|
+
};
|
|
96
|
+
|
|
98
97
|
if (!original.click) {
|
|
99
98
|
return (
|
|
100
99
|
<View key={`k-${index}`} style={getRowStyle()}>
|
|
101
|
-
|
|
100
|
+
{children}
|
|
102
101
|
</View>
|
|
103
102
|
);
|
|
104
103
|
}
|
|
@@ -112,7 +111,7 @@ export default function UIList(props: ChildType) {
|
|
|
112
111
|
onClick(item);
|
|
113
112
|
}}
|
|
114
113
|
>
|
|
115
|
-
|
|
114
|
+
{children}
|
|
116
115
|
</TouchableHighlight>
|
|
117
116
|
);
|
|
118
117
|
};
|
|
@@ -130,7 +129,11 @@ export default function UIList(props: ChildType) {
|
|
|
130
129
|
<View style={getContainerStyle()}>
|
|
131
130
|
<Empty />
|
|
132
131
|
{items.map((item: any, i: number) => (
|
|
133
|
-
<RowItem index={i} item={item}
|
|
132
|
+
<RowItem index={i} item={item}>
|
|
133
|
+
<UIListRow scope={scope} item={item} index={i}>
|
|
134
|
+
{props.children}
|
|
135
|
+
</UIListRow>
|
|
136
|
+
</RowItem>
|
|
134
137
|
))}
|
|
135
138
|
{isShowAdd() && <>{add}</>}
|
|
136
139
|
</View>
|