react-crud-mobile 1.3.183 → 1.3.184

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.183",
3
+ "version": "1.3.184",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -60,20 +60,39 @@ export default function UIOrder(props: ChildType) {
60
60
 
61
61
  //v2
62
62
 
63
- const renderItem = ({ item, drag, isActive }) => {
64
- let state = { ...scope.getStyle('row') };
63
+ const renderItem = ({ item, drag, isActive, getIndex }) => {
64
+ const index = getIndex();
65
+ const name = `${scope.key('row', index, '')}`;
66
+ const [row] = useState(
67
+ ScopeUtils.create({
68
+ ...original,
69
+ parent: scope,
70
+ name,
71
+ crud: scope.crud,
72
+ index,
73
+ type: 'row',
74
+ data: item,
75
+ })
76
+ );
77
+
78
+ let css = { ...scope.getStyle('row') };
65
79
 
66
80
  if (isActive) {
67
- state = { ...state, ...scope.getStyle('active') };
81
+ css = { ...css, ...scope.getStyle('active') };
68
82
  }
69
83
 
84
+ if (isActive) {
85
+ css = { ...css, ...row.getStyle('rowSelected', {}) };
86
+ } else {
87
+ css = { ...css, ...row.getStyle('rowUnSelected', {}) };
88
+ }
70
89
  return (
71
90
  <ScaleDecorator>
72
91
  <TouchableOpacity
73
92
  style={[
74
93
  styles.row,
75
94
  { backgroundColor: isActive ? 'lightblue' : 'white' },
76
- { ...state },
95
+ { ...css },
77
96
  ]}
78
97
  delayLongPress={100}
79
98
  onLongPress={drag} // Initiate drag on long press
@@ -103,7 +122,7 @@ export default function UIOrder(props: ChildType) {
103
122
  };
104
123
 
105
124
  const Header = ({ pos }) => {
106
- const hPos = Utils.nvl(original.headerPos, 'inner');
125
+ const hPos = Utils.nvl(original.headerPos, 'outer');
107
126
 
108
127
  if (hPos !== pos) return <></>;
109
128