react-crud-mobile 1.0.433 → 1.0.435
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/elements/core/UIView.d.ts +3 -0
- package/dist/react-crud-mobile.cjs.development.js +59 -7
- 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 +60 -8
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +72 -71
- package/src/elements/UI.tsx +65 -65
- package/src/elements/UIChildren.tsx +127 -127
- package/src/elements/UIComplete.tsx +14 -14
- package/src/elements/UIElement.tsx +523 -518
- package/src/elements/UITag.tsx +13 -13
- package/src/elements/charts/ElChart.tsx +10 -10
- package/src/elements/core/UIAutoComplete.tsx +17 -17
- package/src/elements/core/UIButton.tsx +73 -73
- package/src/elements/core/UIIcon.tsx +8 -8
- package/src/elements/core/UIInclude.tsx +40 -40
- package/src/elements/core/UIInput.tsx +69 -69
- package/src/elements/core/UILink.tsx +17 -17
- package/src/elements/core/UIList.tsx +135 -135
- package/src/elements/core/UIListItem.tsx +32 -32
- package/src/elements/core/UIListRow.tsx +32 -32
- package/src/elements/core/UIModal.tsx +139 -139
- package/src/elements/core/UIOption.tsx +17 -17
- package/src/elements/core/UIQuantity.tsx +97 -97
- package/src/elements/core/UIRadio.tsx +17 -17
- package/src/elements/core/UISelect.tsx +122 -122
- package/src/elements/core/UISwitch.tsx +26 -26
- package/src/elements/core/UIToggle.tsx +102 -102
- package/src/elements/core/UIView.tsx +62 -0
- package/src/elements/index.ts +1 -1
- package/src/elements/tabs/ElTabs.tsx +178 -178
- package/src/index.ts +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect, useContext, useRef, useLayoutEffect, createContext } from 'react';
|
|
2
2
|
import { Utils, ScopeUtils, CrudUtils, useTheme, HtmlUtils, ComponentUtils } from 'react-crud-utils';
|
|
3
|
-
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, ScrollView, Image } from 'react-native';
|
|
3
|
+
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, ScrollView, KeyboardAvoidingView, Platform, TouchableWithoutFeedback, Keyboard, Image } from 'react-native';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
6
6
|
import { Ionicons as Ionicons$1 } from '@expo/vector-icons';
|
|
7
7
|
import Icon from 'react-native-vector-icons/FontAwesome';
|
|
8
|
+
import { StatusBar as StatusBar$1 } from 'expo-status-bar';
|
|
9
|
+
import { SafeAreaProvider, SafeAreaView as SafeAreaView$1 } from 'react-native-safe-area-context';
|
|
8
10
|
|
|
9
11
|
function _extends() {
|
|
10
12
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -1069,6 +1071,53 @@ var styles$9 = /*#__PURE__*/StyleSheet.create({
|
|
|
1069
1071
|
}
|
|
1070
1072
|
});
|
|
1071
1073
|
|
|
1074
|
+
function UIView(_ref) {
|
|
1075
|
+
var scope = _ref.scope,
|
|
1076
|
+
children = _ref.children;
|
|
1077
|
+
var header = scope.getPart('header', null, []);
|
|
1078
|
+
var dismissKeyboard = function dismissKeyboard() {
|
|
1079
|
+
if (Platform.OS !== 'web') {
|
|
1080
|
+
Keyboard.dismiss();
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
return /*#__PURE__*/jsxs(SafeAreaProvider, {
|
|
1084
|
+
children: [/*#__PURE__*/jsx(StatusBar$1, {
|
|
1085
|
+
style: "dark"
|
|
1086
|
+
}), /*#__PURE__*/jsx(SafeAreaView$1, {
|
|
1087
|
+
style: scope.getStyle('view', styles$a.view),
|
|
1088
|
+
children: /*#__PURE__*/jsxs(KeyboardAvoidingView, {
|
|
1089
|
+
behavior: Platform.OS === 'ios' ? 'padding' : 'height',
|
|
1090
|
+
style: {
|
|
1091
|
+
flex: 1,
|
|
1092
|
+
justifyContent: 'center'
|
|
1093
|
+
},
|
|
1094
|
+
children: [header, /*#__PURE__*/jsx(View, {
|
|
1095
|
+
style: scope.getStyle('container', styles$a.container),
|
|
1096
|
+
children: /*#__PURE__*/jsx(ScrollView, {
|
|
1097
|
+
keyboardShouldPersistTaps: "handled",
|
|
1098
|
+
children: /*#__PURE__*/jsx(TouchableWithoutFeedback, {
|
|
1099
|
+
onPress: dismissKeyboard,
|
|
1100
|
+
accessible: false,
|
|
1101
|
+
children: /*#__PURE__*/jsx(UIChildren, {
|
|
1102
|
+
scope: scope,
|
|
1103
|
+
children: children
|
|
1104
|
+
})
|
|
1105
|
+
})
|
|
1106
|
+
})
|
|
1107
|
+
})]
|
|
1108
|
+
})
|
|
1109
|
+
})]
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
var styles$a = /*#__PURE__*/StyleSheet.create({
|
|
1113
|
+
container: {
|
|
1114
|
+
backgroundColor: 'background'
|
|
1115
|
+
},
|
|
1116
|
+
view: {
|
|
1117
|
+
backgroundColor: 'primary'
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
|
|
1072
1121
|
var CrudContext = /*#__PURE__*/createContext({});
|
|
1073
1122
|
function UIElement(props) {
|
|
1074
1123
|
var _original$list, _original$load;
|
|
@@ -1171,7 +1220,7 @@ function UIElement(props) {
|
|
|
1171
1220
|
var _elementStyle$type;
|
|
1172
1221
|
var type = Utils.nvl(original.type, 'none');
|
|
1173
1222
|
var key = Utils.nvl(part, 'root');
|
|
1174
|
-
var def = _extends({}, styles$
|
|
1223
|
+
var def = _extends({}, styles$b[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
|
|
1175
1224
|
var hasChild = hasChildren();
|
|
1176
1225
|
if (!part && !hasChild) {
|
|
1177
1226
|
def = _extends({}, def);
|
|
@@ -1246,7 +1295,7 @@ function UIElement(props) {
|
|
|
1246
1295
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
1247
1296
|
}
|
|
1248
1297
|
var isShowChild = function isShowChild() {
|
|
1249
|
-
if (scope.
|
|
1298
|
+
if (scope.isType('tabs', 'view', 'grid', 'list', 'define', 'repeat', 'modal', 'dialog', 'chart')) {
|
|
1250
1299
|
return false;
|
|
1251
1300
|
}
|
|
1252
1301
|
return true;
|
|
@@ -1328,16 +1377,19 @@ function UIElement(props) {
|
|
|
1328
1377
|
style: getStyle('error'),
|
|
1329
1378
|
children: error
|
|
1330
1379
|
})]
|
|
1331
|
-
}), scope.isType('
|
|
1380
|
+
}), scope.isType('list', 'repeat') && /*#__PURE__*/jsx(UIList, _extends({}, props, {
|
|
1332
1381
|
scope: scope,
|
|
1333
1382
|
crud: crud
|
|
1334
|
-
})), scope.isType('
|
|
1383
|
+
})), scope.isType('dialog') && /*#__PURE__*/jsx(UIModal, _extends({}, props, {
|
|
1335
1384
|
scope: scope,
|
|
1336
1385
|
crud: crud
|
|
1337
|
-
})), scope.isType('
|
|
1386
|
+
})), scope.isType('chart') && /*#__PURE__*/jsx(ElChart, _extends({}, props, {
|
|
1338
1387
|
scope: scope,
|
|
1339
1388
|
crud: crud
|
|
1340
|
-
})), scope.isType('
|
|
1389
|
+
})), scope.isType('tabs') && /*#__PURE__*/jsx(ElTabs, _extends({}, props, {
|
|
1390
|
+
scope: scope,
|
|
1391
|
+
crud: crud
|
|
1392
|
+
})), scope.isType('view') && /*#__PURE__*/jsx(UIView, _extends({}, props, {
|
|
1341
1393
|
scope: scope,
|
|
1342
1394
|
crud: crud
|
|
1343
1395
|
})), isShowChild() && /*#__PURE__*/jsx(UIChildren, _extends({}, props, {
|
|
@@ -1417,7 +1469,7 @@ elementStyle.toggle = /*#__PURE__*/StyleSheet.create({
|
|
|
1417
1469
|
flexWrap: 'nowrap'
|
|
1418
1470
|
})
|
|
1419
1471
|
});
|
|
1420
|
-
var styles$
|
|
1472
|
+
var styles$b = /*#__PURE__*/StyleSheet.create({
|
|
1421
1473
|
root: {
|
|
1422
1474
|
gap: 5,
|
|
1423
1475
|
flexDirection: 'column',
|