react-crud-mobile 1.3.18 → 1.3.20

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.
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef, useContext, useLayoutEffect, createContext } from 'react';
2
2
  import { Utils, ScopeUtils, CrudUtils, ViewUtils, ComponentUtils, HtmlUtils, ThemeUtils, useTheme } from 'react-crud-utils';
3
- import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, Platform, Dimensions, ScrollView, Alert, Image, KeyboardAvoidingView, TouchableWithoutFeedback, Keyboard } from 'react-native';
3
+ import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, SafeAreaView, StatusBar, 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';
6
6
  import { Ionicons as Ionicons$1, AntDesign, Entypo, EvilIcons, MaterialCommunityIcons } from '@expo/vector-icons';
@@ -481,6 +481,20 @@ function UIButton(props) {
481
481
  });
482
482
  }
483
483
 
484
+ //import { ThemeUtils, Utils } from 'react-crud-utils';
485
+ //import { StatusBar } from 'react-native';
486
+ var MobileUtils = /*#__PURE__*/function () {
487
+ function MobileUtils() {}
488
+ MobileUtils.syncTheme = function syncTheme() {
489
+ // let current = ThemeUtils.getCurrentTheme();
490
+ //let dec: any = { light: 'light-content', dark: 'dark-content' };
491
+ //let name = Utils.nvl(dec[current?.theme], dec.light);
492
+ //StatusBar.setBarStyle?.(name);
493
+ //StatusBar.setBackgroundColor?.(current?.colors?.theme);
494
+ };
495
+ return MobileUtils;
496
+ }();
497
+
484
498
  function UISelect(props) {
485
499
  var _theme$colors;
486
500
  var _useState = useState(false),
@@ -512,11 +526,16 @@ function UISelect(props) {
512
526
  handlePress();
513
527
  };
514
528
  var style = function style(part, extra) {
515
- return _extends({}, styles$3[part], scope.getStyle(part), extra);
529
+ var all = _extends({}, styles$3[part], extra);
530
+ return scope.getStyle(part, all);
516
531
  };
517
532
  var isModalVisible = function isModalVisible() {
518
533
  return modalVisible;
519
534
  };
535
+ //v1
536
+ useEffect(function () {
537
+ MobileUtils.syncTheme();
538
+ }, [modalVisible]);
520
539
  return /*#__PURE__*/jsxs(View, {
521
540
  style: style('selectRoot'),
522
541
  children: [/*#__PURE__*/jsxs(TouchableOpacity, {
@@ -531,17 +550,14 @@ function UISelect(props) {
531
550
  color: scope.getPart('iconColor', null, iconColor),
532
551
  style: style('iconStyle', {})
533
552
  })]
534
- }), /*#__PURE__*/jsxs(Modal, {
553
+ }), /*#__PURE__*/jsx(Modal, {
535
554
  animationType: "slide",
536
555
  transparent: true,
537
556
  visible: isModalVisible(),
538
557
  onRequestClose: function onRequestClose() {
539
558
  return setModalVisible(false);
540
559
  },
541
- children: [/*#__PURE__*/jsx(StatusBar, {
542
- barStyle: "dark-content",
543
- backgroundColor: theme.colors.primary
544
- }), /*#__PURE__*/jsxs(SafeAreaView, {
560
+ children: /*#__PURE__*/jsxs(SafeAreaView, {
545
561
  style: style('modalSafe'),
546
562
  children: [/*#__PURE__*/jsxs(View, {
547
563
  style: style('modalHeader'),
@@ -569,7 +585,7 @@ function UISelect(props) {
569
585
  })
570
586
  })
571
587
  })]
572
- })]
588
+ })
573
589
  })]
574
590
  });
575
591
  }
@@ -1306,20 +1322,6 @@ function UIToast() {
1306
1322
  });
1307
1323
  }
1308
1324
 
1309
- //import { ThemeUtils, Utils } from 'react-crud-utils';
1310
- //import { StatusBar } from 'react-native';
1311
- var MobileUtils = /*#__PURE__*/function () {
1312
- function MobileUtils() {}
1313
- MobileUtils.syncTheme = function syncTheme() {
1314
- // let current = ThemeUtils.getCurrentTheme();
1315
- //let dec: any = { light: 'light-content', dark: 'dark-content' };
1316
- //let name = Utils.nvl(dec[current?.theme], dec.light);
1317
- //StatusBar.setBarStyle?.(name);
1318
- //StatusBar.setBackgroundColor?.(current?.colors?.theme);
1319
- };
1320
- return MobileUtils;
1321
- }();
1322
-
1323
1325
  function UIModal(props) {
1324
1326
  var _theme$styles, _main$dialog2;
1325
1327
  var _useState = useState(false),