react-crud-mobile 1.3.232 → 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/dist/react-crud-mobile.cjs.development.js +12 -4
- 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 +12 -4
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIList.tsx +16 -6
@@ -1011,6 +1011,7 @@ function UIList(props) {
|
|
1011
1011
|
}) == null ? void 0 : _repeat$list[original.type];
|
1012
1012
|
var add = reactCrudUtils.ComponentUtils.getDefine(props, 'add');
|
1013
1013
|
var hideAddWhenEmpty = original.hideAddWhenEmpty;
|
1014
|
+
var hideEmpty = original.hideEmpty;
|
1014
1015
|
//v2
|
1015
1016
|
var getStyle = function getStyle(key, extra) {
|
1016
1017
|
return scope.getStyle(key, _extends({}, extra, styles[key]));
|
@@ -1029,11 +1030,11 @@ function UIList(props) {
|
|
1029
1030
|
var _useState = React.useState(scope.updateIndex),
|
1030
1031
|
index = _useState[0],
|
1031
1032
|
setIndex = _useState[1];
|
1033
|
+
var empty = scope.attr('empty', 'Sem registro');
|
1032
1034
|
scope.update = function () {
|
1033
1035
|
scope.updateIndex = ++index;
|
1034
1036
|
setIndex(index);
|
1035
1037
|
};
|
1036
|
-
var keyData = scope.key('data');
|
1037
1038
|
var items = reactCrudUtils.Utils.call(function () {
|
1038
1039
|
var _original$list;
|
1039
1040
|
var list = reactCrudUtils.Utils.nvl(scope.getItems(), []);
|
@@ -1055,17 +1056,17 @@ function UIList(props) {
|
|
1055
1056
|
}
|
1056
1057
|
return list;
|
1057
1058
|
});
|
1059
|
+
var isEmpty = reactCrudUtils.Utils.isEmpty(items);
|
1058
1060
|
var isShowAdd = function isShowAdd() {
|
1059
|
-
if (!
|
1061
|
+
if (!isEmpty) {
|
1060
1062
|
return true;
|
1061
1063
|
}
|
1062
1064
|
return hideAddWhenEmpty !== true;
|
1063
1065
|
};
|
1064
1066
|
var Empty = function Empty() {
|
1065
|
-
if (!
|
1067
|
+
if (!isEmpty) {
|
1066
1068
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
1067
1069
|
}
|
1068
|
-
var empty = scope.attr('empty', 'Sem registro');
|
1069
1070
|
if (!empty) {
|
1070
1071
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
1071
1072
|
}
|
@@ -1088,6 +1089,9 @@ function UIList(props) {
|
|
1088
1089
|
children: empty
|
1089
1090
|
});
|
1090
1091
|
};
|
1092
|
+
if (empty === false && isEmpty) {
|
1093
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
1094
|
+
}
|
1091
1095
|
return /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
|
1092
1096
|
style: getContainerStyle(),
|
1093
1097
|
children: [/*#__PURE__*/jsxRuntime.jsx(Empty, {}), items.map(function (item, i) {
|
@@ -1102,6 +1106,10 @@ function UIList(props) {
|
|
1102
1106
|
})]
|
1103
1107
|
});
|
1104
1108
|
};
|
1109
|
+
var items = reactCrudUtils.Utils.nvl(scope.getItems(), []);
|
1110
|
+
if (hideEmpty && reactCrudUtils.Utils.isEmpty(items)) {
|
1111
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
1112
|
+
}
|
1105
1113
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
1106
1114
|
children: [original.search !== false && /*#__PURE__*/jsxRuntime.jsx(UI.Text, {
|
1107
1115
|
placeholder: "Pesquisar...",
|