react-crud-mobile 1.3.45 → 1.3.47

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
- import React, { useState, useEffect, useRef, useContext, useLayoutEffect, createContext } from 'react';
1
+ import React, { useState, useRef, useEffect, useContext, useLayoutEffect, createContext } from 'react';
2
2
  import { Utils, ScopeUtils, CrudUtils, ComponentUtils, ViewUtils, HtmlUtils, ThemeUtils, useTheme } from 'react-crud-utils';
3
- import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, SafeAreaView, Switch, TextInput, Platform, Dimensions, ScrollView, Alert, Image, StatusBar, KeyboardAvoidingView, TouchableWithoutFeedback, Keyboard } from 'react-native';
3
+ import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, SafeAreaView, ScrollView, Switch, TextInput, Platform, Dimensions, Alert, Image, StatusBar, 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';
@@ -496,7 +496,7 @@ var MobileUtils = /*#__PURE__*/function () {
496
496
  }();
497
497
 
498
498
  function UISelect(props) {
499
- var _theme$styles, _theme$colors, _scope$original, _scope$original2;
499
+ var _theme$styles, _theme$colors, _scope$original, _scope$original2, _scope$original3, _scope$original4;
500
500
  var _useState = useState(false),
501
501
  modalVisible = _useState[0],
502
502
  setModalVisible = _useState[1];
@@ -510,6 +510,7 @@ function UISelect(props) {
510
510
  var handlePress = function handlePress() {
511
511
  setModalVisible(!modalVisible);
512
512
  };
513
+ var scrollRef = useRef(null);
513
514
  var iconColor = Utils.nvl((_theme$colors = theme.colors) == null ? void 0 : _theme$colors.text, '#100e0e');
514
515
  var modalColor = Utils.nvl(headerStyle.color, 'white');
515
516
  var defaults = {
@@ -561,6 +562,53 @@ function UISelect(props) {
561
562
  },
562
563
  children: [/*#__PURE__*/jsx(SafeAreaView, {
563
564
  style: style('modalTop')
565
+ }), /*#__PURE__*/jsxs(SafeAreaView, {
566
+ style: style('modalSafe'),
567
+ children: [/*#__PURE__*/jsxs(View, {
568
+ style: scope.getStyle('header', headerStyle),
569
+ children: [/*#__PURE__*/jsx(TouchableOpacity, {
570
+ onPress: handlePress,
571
+ style: style('modalCloseButton'),
572
+ children: /*#__PURE__*/jsx(Ionicons$1, {
573
+ name: "close",
574
+ size: 24,
575
+ color: modalColor,
576
+ style: style('modalCloseText', defaults)
577
+ })
578
+ }), /*#__PURE__*/jsx(Text, {
579
+ style: style('modalTitle', defaults),
580
+ children: placeholder
581
+ })]
582
+ }), /*#__PURE__*/jsx(ScrollView, {
583
+ contentContainerStyle: {
584
+ flexGrow: 1,
585
+ paddingBottom: 50
586
+ },
587
+ style: style('modalContent'),
588
+ nestedScrollEnabled: true,
589
+ ref: scrollRef,
590
+ children: /*#__PURE__*/jsx(View, {
591
+ style: {
592
+ flex: 1
593
+ },
594
+ children: /*#__PURE__*/jsx(UI.List, _extends({
595
+ data: items,
596
+ name: scope.getName('list'),
597
+ layout: "card",
598
+ click: onClick,
599
+ rowStyle: _extends({
600
+ paddingLeft: 15,
601
+ paddinRight: 15
602
+ }, (_scope$original = scope.original) == null ? void 0 : _scope$original.rowStyle)
603
+ }, (_scope$original2 = scope.original) == null ? void 0 : _scope$original2.listProps, {
604
+ children: /*#__PURE__*/jsx(UI.Value, {
605
+ value: "#{@this.label}"
606
+ })
607
+ }))
608
+ })
609
+ })]
610
+ }), /*#__PURE__*/jsx(SafeAreaView, {
611
+ style: style('modalTop')
564
612
  }), /*#__PURE__*/jsxs(SafeAreaView, {
565
613
  style: style('modalSafe'),
566
614
  children: [/*#__PURE__*/jsxs(View, {
@@ -590,8 +638,8 @@ function UISelect(props) {
590
638
  rowStyle: _extends({
591
639
  paddingLeft: 15,
592
640
  paddinRight: 15
593
- }, (_scope$original = scope.original) == null ? void 0 : _scope$original.rowStyle)
594
- }, (_scope$original2 = scope.original) == null ? void 0 : _scope$original2.listProps, {
641
+ }, (_scope$original3 = scope.original) == null ? void 0 : _scope$original3.rowStyle)
642
+ }, (_scope$original4 = scope.original) == null ? void 0 : _scope$original4.listProps, {
595
643
  children: /*#__PURE__*/jsx(UI.Value, {
596
644
  value: "#{@this.label}"
597
645
  })
@@ -1403,9 +1451,6 @@ function UIModal(props) {
1403
1451
  }
1404
1452
  scope.update();
1405
1453
  };
1406
- useEffect(function () {
1407
- MobileUtils.syncTheme();
1408
- }, [modalVisible]);
1409
1454
  var curr = scope.currentDialog;
1410
1455
  if (!curr) {
1411
1456
  return /*#__PURE__*/jsx(Fragment, {});