react-crud-mobile 1.0.520 → 1.0.522
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 +15 -8
- 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 +16 -9
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/SafeView.tsx +63 -63
- package/src/elements/core/UIAutoComplete.tsx +17 -17
- package/src/elements/core/UILink.tsx +17 -17
- package/src/elements/core/UIList.tsx +14 -6
- package/src/elements/core/UIListItem.tsx +32 -32
- package/src/elements/core/UIOption.tsx +17 -17
- package/src/elements/core/UIRadio.tsx +17 -17
- package/src/elements/core/UISwitch.tsx +26 -26
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useContext, useRef, useLayoutEffect, createContext } from 'react';
|
|
2
|
-
import { Utils, ScopeUtils, CrudUtils, useTheme,
|
|
2
|
+
import { Utils, ScopeUtils, CrudUtils, useTheme, ComponentUtils, HtmlUtils } from 'react-crud-utils';
|
|
3
3
|
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, ScrollView, Image, KeyboardAvoidingView, Platform, TouchableWithoutFeedback, Keyboard } from 'react-native';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
@@ -680,6 +680,8 @@ function UIList(props) {
|
|
|
680
680
|
repeat: stylesRepeat,
|
|
681
681
|
list: stylesList
|
|
682
682
|
}) == null ? void 0 : _repeat$list[original.type];
|
|
683
|
+
var add = ComponentUtils.getDefine(props, 'add');
|
|
684
|
+
var hideAddWhenEmpty = original.hideAddWhenEmpty;
|
|
683
685
|
var onClick = function onClick(item) {
|
|
684
686
|
scope.call('click', {
|
|
685
687
|
value: item,
|
|
@@ -707,6 +709,12 @@ function UIList(props) {
|
|
|
707
709
|
}
|
|
708
710
|
return row;
|
|
709
711
|
};
|
|
712
|
+
var isShowAdd = function isShowAdd() {
|
|
713
|
+
if (!Utils.isEmpty(items)) {
|
|
714
|
+
return true;
|
|
715
|
+
}
|
|
716
|
+
return hideAddWhenEmpty !== true;
|
|
717
|
+
};
|
|
710
718
|
var Empty = function Empty() {
|
|
711
719
|
if (!Utils.isEmpty(items)) {
|
|
712
720
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
@@ -752,16 +760,15 @@ function UIList(props) {
|
|
|
752
760
|
onPress: function onPress(e) {
|
|
753
761
|
onClick(item);
|
|
754
762
|
},
|
|
755
|
-
children: /*#__PURE__*/jsx(
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
index: i,
|
|
761
|
-
children: props.children
|
|
762
|
-
})
|
|
763
|
+
children: /*#__PURE__*/jsx(UIListRow, {
|
|
764
|
+
scope: scope,
|
|
765
|
+
item: item,
|
|
766
|
+
index: i,
|
|
767
|
+
children: props.children
|
|
763
768
|
})
|
|
764
769
|
}, "k-" + i);
|
|
770
|
+
}), isShowAdd() && /*#__PURE__*/jsx(Fragment, {
|
|
771
|
+
children: add
|
|
765
772
|
})]
|
|
766
773
|
})]
|
|
767
774
|
});
|