react-crud-mobile 1.3.233 → 1.3.234

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.233",
3
+ "version": "1.3.234",
4
4
  "license": "MIT",
5
5
  "description": "Uma biblioteca de componentes para React Native",
6
6
  "main": "dist/index.js",
@@ -32,6 +32,7 @@ export default function UIList(props: ChildType) {
32
32
 
33
33
  const LocalData = () => {
34
34
  let [index, setIndex] = useState(scope.updateIndex);
35
+ let empty = scope.attr('empty', 'Sem registro');
35
36
 
36
37
  scope.update = () => {
37
38
  scope.updateIndex = ++index;
@@ -68,20 +69,20 @@ export default function UIList(props: ChildType) {
68
69
  return list;
69
70
  });
70
71
 
72
+ let isEmpty = Utils.isEmpty(items);
73
+
71
74
  const isShowAdd = () => {
72
- if (!Utils.isEmpty(items)) {
75
+ if (!isEmpty) {
73
76
  return true;
74
77
  }
75
78
  return hideAddWhenEmpty !== true;
76
79
  };
77
80
 
78
81
  let Empty = () => {
79
- if (!Utils.isEmpty(items)) {
82
+ if (!isEmpty) {
80
83
  return <></>;
81
84
  }
82
85
 
83
- let empty = scope.attr('empty', 'Sem registro');
84
-
85
86
  if (!empty) {
86
87
  return <></>;
87
88
  }
@@ -108,6 +109,10 @@ export default function UIList(props: ChildType) {
108
109
  return <>{empty}</>;
109
110
  };
110
111
 
112
+ if (empty === false && isEmpty) {
113
+ return <></>;
114
+ }
115
+
111
116
  return (
112
117
  <View style={getContainerStyle()}>
113
118
  <Empty />