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
@@ -1021,6 +1021,7 @@ function UIList(props) {
|
|
1021
1021
|
var _useState = useState(scope.updateIndex),
|
1022
1022
|
index = _useState[0],
|
1023
1023
|
setIndex = _useState[1];
|
1024
|
+
var empty = scope.attr('empty', 'Sem registro');
|
1024
1025
|
scope.update = function () {
|
1025
1026
|
scope.updateIndex = ++index;
|
1026
1027
|
setIndex(index);
|
@@ -1046,17 +1047,17 @@ function UIList(props) {
|
|
1046
1047
|
}
|
1047
1048
|
return list;
|
1048
1049
|
});
|
1050
|
+
var isEmpty = Utils.isEmpty(items);
|
1049
1051
|
var isShowAdd = function isShowAdd() {
|
1050
|
-
if (!
|
1052
|
+
if (!isEmpty) {
|
1051
1053
|
return true;
|
1052
1054
|
}
|
1053
1055
|
return hideAddWhenEmpty !== true;
|
1054
1056
|
};
|
1055
1057
|
var Empty = function Empty() {
|
1056
|
-
if (!
|
1058
|
+
if (!isEmpty) {
|
1057
1059
|
return /*#__PURE__*/jsx(Fragment, {});
|
1058
1060
|
}
|
1059
|
-
var empty = scope.attr('empty', 'Sem registro');
|
1060
1061
|
if (!empty) {
|
1061
1062
|
return /*#__PURE__*/jsx(Fragment, {});
|
1062
1063
|
}
|
@@ -1079,6 +1080,9 @@ function UIList(props) {
|
|
1079
1080
|
children: empty
|
1080
1081
|
});
|
1081
1082
|
};
|
1083
|
+
if (empty === false && isEmpty) {
|
1084
|
+
return /*#__PURE__*/jsx(Fragment, {});
|
1085
|
+
}
|
1082
1086
|
return /*#__PURE__*/jsxs(View, {
|
1083
1087
|
style: getContainerStyle(),
|
1084
1088
|
children: [/*#__PURE__*/jsx(Empty, {}), items.map(function (item, i) {
|
@@ -2189,6 +2193,13 @@ function UIElement(props) {
|
|
2189
2193
|
};
|
2190
2194
|
var Card = function Card(props) {
|
2191
2195
|
var isCard = scope.is('type|layout', 'card');
|
2196
|
+
if (scope.isType('list')) {
|
2197
|
+
var empty = scope.getPart('empty', null, undefined);
|
2198
|
+
var items = scope.getItems();
|
2199
|
+
if (empty === false && Utils.isEmpty(items)) {
|
2200
|
+
isCard = false;
|
2201
|
+
}
|
2202
|
+
}
|
2192
2203
|
if (isCard) {
|
2193
2204
|
var _box = _extends({}, getStyle('box', _extends({}, boxStyle.box, {
|
2194
2205
|
alignSelf: 'stretch'
|