react-crud-mobile 1.3.184 → 1.3.185

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,6 +1,6 @@
1
1
  {
2
2
  "name": "react-crud-mobile",
3
- "version": "1.3.184",
3
+ "version": "1.3.185",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -8,6 +8,7 @@ import DraggableFlatList, {
8
8
  } from 'react-native-draggable-flatlist';
9
9
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
10
10
  import UIHeader from './UIHeader';
11
+ import UIChildren from '../UIChildren';
11
12
 
12
13
  export default function UIOrder(props: ChildType) {
13
14
  const scope = props.scope;
@@ -86,6 +87,24 @@ export default function UIOrder(props: ChildType) {
86
87
  } else {
87
88
  css = { ...css, ...row.getStyle('rowUnSelected', {}) };
88
89
  }
90
+ const Child = () => {
91
+ if (Utils.isEmpty(props.children)) {
92
+ return (
93
+ <>
94
+ <MaterialCommunityIcons name="drag" size={24} color="black" />
95
+ <Text style={styles.text}>{scope.getItemLabel(item)}</Text>
96
+ </>
97
+ );
98
+ }
99
+
100
+ return (
101
+ <>
102
+ <UIChildren transient scope={row} crud={row.crud}>
103
+ {props.children}
104
+ </UIChildren>
105
+ </>
106
+ );
107
+ };
89
108
  return (
90
109
  <ScaleDecorator>
91
110
  <TouchableOpacity
@@ -97,8 +116,7 @@ export default function UIOrder(props: ChildType) {
97
116
  delayLongPress={100}
98
117
  onLongPress={drag} // Initiate drag on long press
99
118
  >
100
- <MaterialCommunityIcons name="drag" size={24} color="black" />
101
- <Text style={styles.text}>{scope.getItemLabel(item)}</Text>
119
+ <Child />
102
120
  </TouchableOpacity>
103
121
  </ScaleDecorator>
104
122
  );