react-crud-mobile 1.3.233 → 1.3.235
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 +14 -3
- 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 +14 -3
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UIElement.tsx +9 -0
- package/src/elements/core/UIList.tsx +9 -4
package/package.json
CHANGED
@@ -581,6 +581,15 @@ export default function UIElement(props: ElementType) {
|
|
581
581
|
let Card = (props: any) => {
|
582
582
|
let isCard = scope.is('type|layout', 'card');
|
583
583
|
|
584
|
+
if (scope.isType('list')) {
|
585
|
+
let empty = scope.getPart('empty', null, undefined);
|
586
|
+
let items = scope.getItems();
|
587
|
+
|
588
|
+
if (empty === false && Utils.isEmpty(items)) {
|
589
|
+
isCard = false;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
584
593
|
if (isCard) {
|
585
594
|
let box = {
|
586
595
|
...getStyle('box', { ...boxStyle.box, alignSelf: 'stretch' }),
|
@@ -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 (!
|
75
|
+
if (!isEmpty) {
|
73
76
|
return true;
|
74
77
|
}
|
75
78
|
return hideAddWhenEmpty !== true;
|
76
79
|
};
|
77
80
|
|
78
81
|
let Empty = () => {
|
79
|
-
if (!
|
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 />
|