react-crud-mobile 1.0.342 → 1.0.344
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 +101 -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 +101 -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 +2 -0
- package/src/elements/core/UIButton.tsx +1 -3
- package/src/elements/core/UIModal.tsx +13 -8
|
@@ -384,9 +384,7 @@ function UIButton(props) {
|
|
|
384
384
|
}
|
|
385
385
|
};
|
|
386
386
|
var onClick = function onClick(e) {
|
|
387
|
-
|
|
388
|
-
element.click(e);
|
|
389
|
-
}
|
|
387
|
+
scope.call('click', {});
|
|
390
388
|
};
|
|
391
389
|
var style = function style(part, extra) {
|
|
392
390
|
var s = _extends({}, styles[part], extra);
|
|
@@ -929,6 +927,98 @@ function UIQuantity(props) {
|
|
|
929
927
|
});
|
|
930
928
|
}
|
|
931
929
|
|
|
930
|
+
function UIModal(props) {
|
|
931
|
+
var _useState = useState(false),
|
|
932
|
+
modalVisible = _useState[0],
|
|
933
|
+
setModalVisible = _useState[1];
|
|
934
|
+
var scope = props.scope;
|
|
935
|
+
var label = scope.getLabel();
|
|
936
|
+
var theme = useTheme();
|
|
937
|
+
var style = function style(part, extra) {
|
|
938
|
+
return _extends({}, styles$a[part], scope.getStyle(part), extra);
|
|
939
|
+
};
|
|
940
|
+
var toggle = function toggle(vis) {
|
|
941
|
+
modalVisible = vis;
|
|
942
|
+
setModalVisible(modalVisible);
|
|
943
|
+
};
|
|
944
|
+
scope.show = function () {
|
|
945
|
+
toggle(true);
|
|
946
|
+
};
|
|
947
|
+
scope.hide = function () {
|
|
948
|
+
toggle(true);
|
|
949
|
+
};
|
|
950
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
951
|
+
animationType: "slide",
|
|
952
|
+
transparent: true,
|
|
953
|
+
visible: modalVisible,
|
|
954
|
+
onRequestClose: function onRequestClose() {
|
|
955
|
+
return setModalVisible(false);
|
|
956
|
+
},
|
|
957
|
+
children: [/*#__PURE__*/jsx(StatusBar, {
|
|
958
|
+
barStyle: "dark-content",
|
|
959
|
+
backgroundColor: theme.colors.primary
|
|
960
|
+
}), /*#__PURE__*/jsxs(SafeAreaView, {
|
|
961
|
+
style: style('modalSafe'),
|
|
962
|
+
children: [/*#__PURE__*/jsxs(View, {
|
|
963
|
+
style: style('modalHeader'),
|
|
964
|
+
children: [/*#__PURE__*/jsx(TouchableOpacity, {
|
|
965
|
+
onPress: function onPress() {
|
|
966
|
+
return setModalVisible(false);
|
|
967
|
+
},
|
|
968
|
+
style: style('modalCloseButton'),
|
|
969
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
970
|
+
style: style('modalCloseText'),
|
|
971
|
+
children: "X"
|
|
972
|
+
})
|
|
973
|
+
}), /*#__PURE__*/jsx(Text, {
|
|
974
|
+
style: style('modalTitle'),
|
|
975
|
+
children: label
|
|
976
|
+
})]
|
|
977
|
+
}), /*#__PURE__*/jsx(View, {
|
|
978
|
+
style: style('modalContent'),
|
|
979
|
+
children: /*#__PURE__*/jsx(UIChildren, {
|
|
980
|
+
scope: scope,
|
|
981
|
+
children: props.children
|
|
982
|
+
})
|
|
983
|
+
})]
|
|
984
|
+
})]
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var styles$a = /*#__PURE__*/StyleSheet.create({
|
|
988
|
+
modalSafe: {
|
|
989
|
+
flex: 1,
|
|
990
|
+
backgroundColor: '#f5f5f5',
|
|
991
|
+
paddingTop: StatusBar.currentHeight || 0
|
|
992
|
+
},
|
|
993
|
+
modalHeader: {
|
|
994
|
+
flexDirection: 'row',
|
|
995
|
+
alignItems: 'center',
|
|
996
|
+
padding: 15,
|
|
997
|
+
backgroundColor: '#6200ea'
|
|
998
|
+
},
|
|
999
|
+
modalCloseButton: {
|
|
1000
|
+
padding: 10
|
|
1001
|
+
},
|
|
1002
|
+
modalCloseText: {
|
|
1003
|
+
fontSize: 18,
|
|
1004
|
+
color: 'white'
|
|
1005
|
+
},
|
|
1006
|
+
modalTitle: {
|
|
1007
|
+
fontSize: 18,
|
|
1008
|
+
color: 'white',
|
|
1009
|
+
fontWeight: 'bold',
|
|
1010
|
+
marginLeft: 10
|
|
1011
|
+
},
|
|
1012
|
+
modalContent: {
|
|
1013
|
+
flex: 1,
|
|
1014
|
+
width: '100%',
|
|
1015
|
+
alignSelf: 'flex-start',
|
|
1016
|
+
flexDirection: 'row',
|
|
1017
|
+
flexWrap: 'wrap',
|
|
1018
|
+
padding: 20
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
|
|
932
1022
|
function UIElement(props) {
|
|
933
1023
|
var _original$list, _original$load;
|
|
934
1024
|
var _useState = useState(ScopeUtils.create(props)),
|
|
@@ -949,6 +1039,7 @@ function UIElement(props) {
|
|
|
949
1039
|
};
|
|
950
1040
|
var router = {
|
|
951
1041
|
list: UIList,
|
|
1042
|
+
dialog: UIModal,
|
|
952
1043
|
repeat: UIList,
|
|
953
1044
|
tabs: ElTabs,
|
|
954
1045
|
chart: ElChart
|
|
@@ -1038,7 +1129,7 @@ function UIElement(props) {
|
|
|
1038
1129
|
var _elementStyle$type;
|
|
1039
1130
|
var type = Utils.nvl(original.type, 'none');
|
|
1040
1131
|
var key = Utils.nvl(part, 'root');
|
|
1041
|
-
var def = _extends({}, styles$
|
|
1132
|
+
var def = _extends({}, styles$b[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
|
|
1042
1133
|
var hasChild = hasChildren();
|
|
1043
1134
|
if (!part && !hasChild) {
|
|
1044
1135
|
def = _extends({}, def);
|
|
@@ -1279,7 +1370,7 @@ elementStyle.toggle = /*#__PURE__*/StyleSheet.create({
|
|
|
1279
1370
|
})
|
|
1280
1371
|
});
|
|
1281
1372
|
elementStyle.list = /*#__PURE__*/_extends({}, elementStyle.card);
|
|
1282
|
-
var styles$
|
|
1373
|
+
var styles$b = /*#__PURE__*/StyleSheet.create({
|
|
1283
1374
|
root: {
|
|
1284
1375
|
gap: 5,
|
|
1285
1376
|
flexDirection: 'column',
|
|
@@ -1351,6 +1442,11 @@ var UI = {
|
|
|
1351
1442
|
type: "list"
|
|
1352
1443
|
}));
|
|
1353
1444
|
},
|
|
1445
|
+
Row: function Row(props) {
|
|
1446
|
+
return /*#__PURE__*/jsx(UIElement, _extends({}, props, {
|
|
1447
|
+
type: "row"
|
|
1448
|
+
}));
|
|
1449
|
+
},
|
|
1354
1450
|
Value: function Value(props) {
|
|
1355
1451
|
return /*#__PURE__*/jsx(UIElement, _extends({}, props, {
|
|
1356
1452
|
type: "value"
|