react-crud-mobile 1.0.520 → 1.0.522

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,5 +1,5 @@
1
1
  import React, { useState, useEffect, useContext, useRef, useLayoutEffect, createContext } from 'react';
2
- import { Utils, ScopeUtils, CrudUtils, useTheme, HtmlUtils, ComponentUtils } from 'react-crud-utils';
2
+ import { Utils, ScopeUtils, CrudUtils, useTheme, ComponentUtils, HtmlUtils } from 'react-crud-utils';
3
3
  import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Modal, StatusBar, SafeAreaView, Switch, TextInput, ScrollView, Image, KeyboardAvoidingView, Platform, TouchableWithoutFeedback, Keyboard } from 'react-native';
4
4
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
5
  import Ionicons from '@expo/vector-icons/Ionicons';
@@ -680,6 +680,8 @@ function UIList(props) {
680
680
  repeat: stylesRepeat,
681
681
  list: stylesList
682
682
  }) == null ? void 0 : _repeat$list[original.type];
683
+ var add = ComponentUtils.getDefine(props, 'add');
684
+ var hideAddWhenEmpty = original.hideAddWhenEmpty;
683
685
  var onClick = function onClick(item) {
684
686
  scope.call('click', {
685
687
  value: item,
@@ -707,6 +709,12 @@ function UIList(props) {
707
709
  }
708
710
  return row;
709
711
  };
712
+ var isShowAdd = function isShowAdd() {
713
+ if (!Utils.isEmpty(items)) {
714
+ return true;
715
+ }
716
+ return hideAddWhenEmpty !== true;
717
+ };
710
718
  var Empty = function Empty() {
711
719
  if (!Utils.isEmpty(items)) {
712
720
  return /*#__PURE__*/jsx(Fragment, {});
@@ -752,16 +760,15 @@ function UIList(props) {
752
760
  onPress: function onPress(e) {
753
761
  onClick(item);
754
762
  },
755
- children: /*#__PURE__*/jsx(View, {
756
- style: getStyle('rowInner'),
757
- children: /*#__PURE__*/jsx(UIListRow, {
758
- scope: scope,
759
- item: item,
760
- index: i,
761
- children: props.children
762
- })
763
+ children: /*#__PURE__*/jsx(UIListRow, {
764
+ scope: scope,
765
+ item: item,
766
+ index: i,
767
+ children: props.children
763
768
  })
764
769
  }, "k-" + i);
770
+ }), isShowAdd() && /*#__PURE__*/jsx(Fragment, {
771
+ children: add
765
772
  })]
766
773
  })]
767
774
  });