react-crud-mobile 1.0.913 → 1.0.915
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 +17 -10
- 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 +18 -11
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/dist/utils/MobileUtils.d.ts +3 -0
- package/package.json +1 -1
- package/src/elements/core/SafeView.tsx +2 -2
- package/src/elements/core/UIModal.tsx +3 -4
- package/src/elements/core/UIView.tsx +3 -5
- package/src/utils/MobileUtils.ts +12 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useContext, useLayoutEffect, createContext } from 'react';
|
|
2
|
-
import { Utils, ScopeUtils, CrudUtils, useTheme, ViewUtils, ComponentUtils,
|
|
2
|
+
import { Utils, ScopeUtils, CrudUtils, useTheme, ViewUtils, ComponentUtils, ThemeUtils, HtmlUtils } from 'react-crud-utils';
|
|
3
3
|
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, Platform, Dimensions, ScrollView, Alert, Image, KeyboardAvoidingView, TouchableWithoutFeedback, Keyboard } from 'react-native';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
@@ -1303,6 +1303,18 @@ function UIToast() {
|
|
|
1303
1303
|
});
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
1306
|
+
var MobileUtils = /*#__PURE__*/function () {
|
|
1307
|
+
function MobileUtils() {}
|
|
1308
|
+
MobileUtils.syncTheme = function syncTheme() {
|
|
1309
|
+
var _current$colors;
|
|
1310
|
+
var current = ThemeUtils.getCurrentTheme();
|
|
1311
|
+
var name = Utils.nvl(current.theme, 'light-content');
|
|
1312
|
+
StatusBar.setBarStyle == null || StatusBar.setBarStyle(name);
|
|
1313
|
+
StatusBar.setBackgroundColor == null || StatusBar.setBackgroundColor(current == null || (_current$colors = current.colors) == null ? void 0 : _current$colors.theme);
|
|
1314
|
+
};
|
|
1315
|
+
return MobileUtils;
|
|
1316
|
+
}();
|
|
1317
|
+
|
|
1306
1318
|
function UIModal(props) {
|
|
1307
1319
|
var _theme$styles, _main$dialog2;
|
|
1308
1320
|
var _useState = useState(false),
|
|
@@ -1376,8 +1388,7 @@ function UIModal(props) {
|
|
|
1376
1388
|
scope.update();
|
|
1377
1389
|
};
|
|
1378
1390
|
useEffect(function () {
|
|
1379
|
-
|
|
1380
|
-
StatusBar.setBackgroundColor == null || StatusBar.setBackgroundColor(theme.colors.primary);
|
|
1391
|
+
MobileUtils.syncTheme();
|
|
1381
1392
|
}, [modalVisible]);
|
|
1382
1393
|
var curr = scope.currentDialog;
|
|
1383
1394
|
if (!curr) {
|
|
@@ -1469,8 +1480,7 @@ var styles$8 = /*#__PURE__*/StyleSheet.create({
|
|
|
1469
1480
|
modalContent: {
|
|
1470
1481
|
flex: 1,
|
|
1471
1482
|
backgroundColor: 'background',
|
|
1472
|
-
|
|
1473
|
-
paddingVertical: 20
|
|
1483
|
+
padding: 10
|
|
1474
1484
|
}
|
|
1475
1485
|
});
|
|
1476
1486
|
|
|
@@ -1484,8 +1494,7 @@ function UIView(_ref) {
|
|
|
1484
1494
|
var headerTextStyle = Utils.nvl((_theme$styles2 = theme.styles) == null || (_theme$styles2 = _theme$styles2.defaults) == null ? void 0 : _theme$styles2.headerText, {});
|
|
1485
1495
|
var scrollRef = useRef(null);
|
|
1486
1496
|
useEffect(function () {
|
|
1487
|
-
|
|
1488
|
-
StatusBar.setBackgroundColor == null || StatusBar.setBackgroundColor(theme.colors.theme);
|
|
1497
|
+
MobileUtils.syncTheme();
|
|
1489
1498
|
}, []);
|
|
1490
1499
|
var onScroll = function onScroll() {
|
|
1491
1500
|
var crud = ViewUtils.getCrud();
|
|
@@ -1543,8 +1552,7 @@ function UIView(_ref) {
|
|
|
1543
1552
|
}
|
|
1544
1553
|
var styles$9 = /*#__PURE__*/StyleSheet.create({
|
|
1545
1554
|
scroll: {
|
|
1546
|
-
|
|
1547
|
-
paddingVertical: 20
|
|
1555
|
+
padding: 10
|
|
1548
1556
|
},
|
|
1549
1557
|
container: {},
|
|
1550
1558
|
view: {}
|
|
@@ -2105,8 +2113,7 @@ function SafeView(props) {
|
|
|
2105
2113
|
}
|
|
2106
2114
|
};
|
|
2107
2115
|
useEffect(function () {
|
|
2108
|
-
|
|
2109
|
-
StatusBar.setBackgroundColor == null || StatusBar.setBackgroundColor(theme.colors.primary);
|
|
2116
|
+
MobileUtils.syncTheme();
|
|
2110
2117
|
}, []);
|
|
2111
2118
|
return /*#__PURE__*/jsxs(SafeAreaProvider, {
|
|
2112
2119
|
children: [/*#__PURE__*/jsx(StatusBar, {
|