react-crud-mobile 1.0.341 → 1.0.343
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/UI.d.ts +1 -0
- package/dist/react-crud-mobile.cjs.development.js +103 -5
- 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 +103 -5
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/elements/UI.tsx +1 -0
- package/src/elements/UIElement.tsx +4 -1
- package/src/elements/core/UIModal.tsx +13 -8
|
@@ -929,6 +929,98 @@ function UIQuantity(props) {
|
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
931
|
|
|
932
|
+
function UIModal(props) {
|
|
933
|
+
var _useState = useState(false),
|
|
934
|
+
modalVisible = _useState[0],
|
|
935
|
+
setModalVisible = _useState[1];
|
|
936
|
+
var scope = props.scope;
|
|
937
|
+
var label = scope.getLabel();
|
|
938
|
+
var theme = useTheme();
|
|
939
|
+
var style = function style(part, extra) {
|
|
940
|
+
return _extends({}, styles$a[part], scope.getStyle(part), extra);
|
|
941
|
+
};
|
|
942
|
+
var toggle = function toggle(vis) {
|
|
943
|
+
modalVisible = vis;
|
|
944
|
+
setModalVisible(modalVisible);
|
|
945
|
+
};
|
|
946
|
+
scope.show = function () {
|
|
947
|
+
toggle(true);
|
|
948
|
+
};
|
|
949
|
+
scope.hide = function () {
|
|
950
|
+
toggle(true);
|
|
951
|
+
};
|
|
952
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
953
|
+
animationType: "slide",
|
|
954
|
+
transparent: true,
|
|
955
|
+
visible: modalVisible,
|
|
956
|
+
onRequestClose: function onRequestClose() {
|
|
957
|
+
return setModalVisible(false);
|
|
958
|
+
},
|
|
959
|
+
children: [/*#__PURE__*/jsx(StatusBar, {
|
|
960
|
+
barStyle: "dark-content",
|
|
961
|
+
backgroundColor: theme.colors.primary
|
|
962
|
+
}), /*#__PURE__*/jsxs(SafeAreaView, {
|
|
963
|
+
style: style('modalSafe'),
|
|
964
|
+
children: [/*#__PURE__*/jsxs(View, {
|
|
965
|
+
style: style('modalHeader'),
|
|
966
|
+
children: [/*#__PURE__*/jsx(TouchableOpacity, {
|
|
967
|
+
onPress: function onPress() {
|
|
968
|
+
return setModalVisible(false);
|
|
969
|
+
},
|
|
970
|
+
style: style('modalCloseButton'),
|
|
971
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
972
|
+
style: style('modalCloseText'),
|
|
973
|
+
children: "X"
|
|
974
|
+
})
|
|
975
|
+
}), /*#__PURE__*/jsx(Text, {
|
|
976
|
+
style: style('modalTitle'),
|
|
977
|
+
children: label
|
|
978
|
+
})]
|
|
979
|
+
}), /*#__PURE__*/jsx(View, {
|
|
980
|
+
style: style('modalContent'),
|
|
981
|
+
children: /*#__PURE__*/jsx(UIChildren, {
|
|
982
|
+
scope: scope,
|
|
983
|
+
children: props.children
|
|
984
|
+
})
|
|
985
|
+
})]
|
|
986
|
+
})]
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
var styles$a = /*#__PURE__*/StyleSheet.create({
|
|
990
|
+
modalSafe: {
|
|
991
|
+
flex: 1,
|
|
992
|
+
backgroundColor: '#f5f5f5',
|
|
993
|
+
paddingTop: StatusBar.currentHeight || 0
|
|
994
|
+
},
|
|
995
|
+
modalHeader: {
|
|
996
|
+
flexDirection: 'row',
|
|
997
|
+
alignItems: 'center',
|
|
998
|
+
padding: 15,
|
|
999
|
+
backgroundColor: '#6200ea'
|
|
1000
|
+
},
|
|
1001
|
+
modalCloseButton: {
|
|
1002
|
+
padding: 10
|
|
1003
|
+
},
|
|
1004
|
+
modalCloseText: {
|
|
1005
|
+
fontSize: 18,
|
|
1006
|
+
color: 'white'
|
|
1007
|
+
},
|
|
1008
|
+
modalTitle: {
|
|
1009
|
+
fontSize: 18,
|
|
1010
|
+
color: 'white',
|
|
1011
|
+
fontWeight: 'bold',
|
|
1012
|
+
marginLeft: 10
|
|
1013
|
+
},
|
|
1014
|
+
modalContent: {
|
|
1015
|
+
flex: 1,
|
|
1016
|
+
width: '100%',
|
|
1017
|
+
alignSelf: 'flex-start',
|
|
1018
|
+
flexDirection: 'row',
|
|
1019
|
+
flexWrap: 'wrap',
|
|
1020
|
+
padding: 20
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
|
|
932
1024
|
function UIElement(props) {
|
|
933
1025
|
var _original$list, _original$load;
|
|
934
1026
|
var _useState = useState(ScopeUtils.create(props)),
|
|
@@ -949,6 +1041,7 @@ function UIElement(props) {
|
|
|
949
1041
|
};
|
|
950
1042
|
var router = {
|
|
951
1043
|
list: UIList,
|
|
1044
|
+
dialog: UIModal,
|
|
952
1045
|
repeat: UIList,
|
|
953
1046
|
tabs: ElTabs,
|
|
954
1047
|
chart: ElChart
|
|
@@ -1038,7 +1131,7 @@ function UIElement(props) {
|
|
|
1038
1131
|
var _elementStyle$type;
|
|
1039
1132
|
var type = Utils.nvl(original.type, 'none');
|
|
1040
1133
|
var key = Utils.nvl(part, 'root');
|
|
1041
|
-
var def = _extends({}, styles$
|
|
1134
|
+
var def = _extends({}, styles$b[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
|
|
1042
1135
|
var hasChild = hasChildren();
|
|
1043
1136
|
if (!part && !hasChild) {
|
|
1044
1137
|
def = _extends({}, def);
|
|
@@ -1234,7 +1327,8 @@ elementStyle.card = /*#__PURE__*/StyleSheet.create({
|
|
|
1234
1327
|
paddingTop: 5,
|
|
1235
1328
|
alignSelf: 'flex-start',
|
|
1236
1329
|
flexDirection: 'row',
|
|
1237
|
-
flexWrap: 'wrap'
|
|
1330
|
+
flexWrap: 'wrap',
|
|
1331
|
+
gap: 10
|
|
1238
1332
|
}
|
|
1239
1333
|
});
|
|
1240
1334
|
elementStyle.input = /*#__PURE__*/StyleSheet.create({
|
|
@@ -1278,7 +1372,7 @@ elementStyle.toggle = /*#__PURE__*/StyleSheet.create({
|
|
|
1278
1372
|
})
|
|
1279
1373
|
});
|
|
1280
1374
|
elementStyle.list = /*#__PURE__*/_extends({}, elementStyle.card);
|
|
1281
|
-
var styles$
|
|
1375
|
+
var styles$b = /*#__PURE__*/StyleSheet.create({
|
|
1282
1376
|
root: {
|
|
1283
1377
|
gap: 5,
|
|
1284
1378
|
flexDirection: 'column',
|
|
@@ -1293,8 +1387,7 @@ var styles$a = /*#__PURE__*/StyleSheet.create({
|
|
|
1293
1387
|
paddingBottom: 5
|
|
1294
1388
|
},
|
|
1295
1389
|
inner: {
|
|
1296
|
-
width: '100%'
|
|
1297
|
-
marginBottom: 10
|
|
1390
|
+
width: '100%'
|
|
1298
1391
|
}
|
|
1299
1392
|
});
|
|
1300
1393
|
var withChildStyles = /*#__PURE__*/StyleSheet.create({
|
|
@@ -1351,6 +1444,11 @@ var UI = {
|
|
|
1351
1444
|
type: "list"
|
|
1352
1445
|
}));
|
|
1353
1446
|
},
|
|
1447
|
+
Row: function Row(props) {
|
|
1448
|
+
return /*#__PURE__*/jsx(UIElement, _extends({}, props, {
|
|
1449
|
+
type: "row"
|
|
1450
|
+
}));
|
|
1451
|
+
},
|
|
1354
1452
|
Value: function Value(props) {
|
|
1355
1453
|
return /*#__PURE__*/jsx(UIElement, _extends({}, props, {
|
|
1356
1454
|
type: "value"
|