react-crud-mobile 1.0.398 → 1.0.401

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,2 +1,3 @@
1
1
  /// <reference types="react" />
2
- export default function UIIcon(props: any): import("react").JSX.Element;
2
+ import { ChildType } from 'react-crud-utils';
3
+ export default function UIIcon({ scope }: ChildType): import("react").JSX.Element;
@@ -335,21 +335,14 @@ var styles$2 = {
335
335
  link: {}
336
336
  };
337
337
 
338
- function UIIcon(props) {
339
- var handlePress = function handlePress() {
340
- reactNative.Linking.openURL('https://reactnative.dev/');
341
- };
342
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
343
- onPress: handlePress,
344
- children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
345
- style: styles$3.link,
346
- children: "Clique aqui para acessar o React Native"
347
- })
338
+ function UIIcon(_ref) {
339
+ var scope = _ref.scope;
340
+ var name = scope.getValue();
341
+ return /*#__PURE__*/jsxRuntime.jsx(vectorIcons.Ionicons, {
342
+ name: name,
343
+ style: scope.getStyle('icon')
348
344
  });
349
345
  }
350
- var styles$3 = {
351
- link: {}
352
- };
353
346
 
354
347
  function UIButton(props) {
355
348
  var scope = props.scope;
@@ -435,7 +428,7 @@ function UISelect(props) {
435
428
  handlePress();
436
429
  };
437
430
  var style = function style(part, extra) {
438
- return _extends({}, styles$4[part], scope.getStyle(part), extra);
431
+ return _extends({}, styles$3[part], scope.getStyle(part), extra);
439
432
  };
440
433
  return /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
441
434
  style: style('selectRoot'),
@@ -492,7 +485,7 @@ function UISelect(props) {
492
485
  })]
493
486
  });
494
487
  }
495
- var styles$4 = /*#__PURE__*/reactNative.StyleSheet.create({
488
+ var styles$3 = /*#__PURE__*/reactNative.StyleSheet.create({
496
489
  selectRoot: {
497
490
  justifyContent: 'flex-start',
498
491
  alignItems: 'flex-start'
@@ -566,12 +559,12 @@ function UIOption(props) {
566
559
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
567
560
  onPress: handlePress,
568
561
  children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
569
- style: styles$5.link,
562
+ style: styles$4.link,
570
563
  children: "Clique aqui para acessar o React Native"
571
564
  })
572
565
  });
573
566
  }
574
- var styles$5 = {
567
+ var styles$4 = {
575
568
  link: {}
576
569
  };
577
570
 
@@ -582,12 +575,12 @@ function UIRadio(props) {
582
575
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
583
576
  onPress: handlePress,
584
577
  children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
585
- style: styles$6.link,
578
+ style: styles$5.link,
586
579
  children: "Clique aqui para acessar o React Native"
587
580
  })
588
581
  });
589
582
  }
590
- var styles$6 = {
583
+ var styles$5 = {
591
584
  link: {}
592
585
  };
593
586
 
@@ -605,7 +598,7 @@ function UIInput(props) {
605
598
  setValue(v);
606
599
  };
607
600
  var style = function style(part, extra) {
608
- return _extends({}, scope.getStyle(part, styles$7[part]), extra);
601
+ return _extends({}, scope.getStyle(part, styles$6[part]), extra);
609
602
  };
610
603
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
611
604
  children: [scope.getPart('left'), /*#__PURE__*/jsxRuntime.jsx(reactNative.TextInput, {
@@ -620,7 +613,7 @@ function UIInput(props) {
620
613
  }), scope.getPart('right')]
621
614
  });
622
615
  }
623
- var styles$7 = /*#__PURE__*/reactNative.StyleSheet.create({
616
+ var styles$6 = /*#__PURE__*/reactNative.StyleSheet.create({
624
617
  base: {
625
618
  flexDirection: 'row',
626
619
  alignItems: 'center',
@@ -680,7 +673,7 @@ function UIList(props) {
680
673
  });
681
674
  };
682
675
  var getStyle = function getStyle(key, extra) {
683
- return scope.getStyle(key, _extends({}, extra, styles$8[key]));
676
+ return scope.getStyle(key, _extends({}, extra, styles$7[key]));
684
677
  };
685
678
  var getRowStyle = function getRowStyle(extra) {
686
679
  var row = getStyle('row', {});
@@ -710,7 +703,13 @@ function UIList(props) {
710
703
  if (typeof empty === 'string') {
711
704
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
712
705
  style: scope.getStyle('empty', {
713
- flex: 1
706
+ flex: 1,
707
+ fontWeight: 500,
708
+ fontSize: 20,
709
+ padding: 10,
710
+ textAlign: 'center',
711
+ justifyContent: 'center',
712
+ alignItems: 'center'
714
713
  }),
715
714
  children: empty
716
715
  });
@@ -752,7 +751,7 @@ function UIList(props) {
752
751
  })]
753
752
  });
754
753
  }
755
- var styles$8 = /*#__PURE__*/reactNative.StyleSheet.create({
754
+ var styles$7 = /*#__PURE__*/reactNative.StyleSheet.create({
756
755
  container: {
757
756
  flex: 1,
758
757
  width: '100%',
@@ -797,7 +796,7 @@ function UIToggle(props) {
797
796
  var item = _ref.item,
798
797
  index = _ref.index;
799
798
  var selected = isSelected(item);
800
- var style = _extends({}, styles$9.text);
799
+ var style = _extends({}, styles$8.text);
801
800
  if (selected) style.color = '#ffffff';
802
801
  if (reactCrudUtils.Utils.isEmpty(props.children)) {
803
802
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
@@ -813,7 +812,7 @@ function UIToggle(props) {
813
812
  });
814
813
  };
815
814
  var getItemStyle = function getItemStyle(item) {
816
- var style = _extends({}, styles$9.item, scope.getStyle('item'));
815
+ var style = _extends({}, styles$8.item, scope.getStyle('item'));
817
816
  var wPart = 100 / options.length;
818
817
  var width = Math.floor(wPart) + '%';
819
818
  if (isSelected(item)) {
@@ -845,7 +844,7 @@ function UIToggle(props) {
845
844
  })
846
845
  });
847
846
  }
848
- var styles$9 = /*#__PURE__*/reactNative.StyleSheet.create({
847
+ var styles$8 = /*#__PURE__*/reactNative.StyleSheet.create({
849
848
  container: {
850
849
  flex: 1,
851
850
  width: '100%',
@@ -961,7 +960,7 @@ function UIModal(props) {
961
960
  var label = scope.getLabel();
962
961
  var theme = reactCrudUtils.useTheme();
963
962
  var style = function style(part, extra) {
964
- var st = _extends({}, styles$a[part], extra);
963
+ var st = _extends({}, styles$9[part], extra);
965
964
  return _extends({}, scope.getStyle(part, st));
966
965
  };
967
966
  var toggle = function toggle(vis) {
@@ -1025,7 +1024,7 @@ function UIModal(props) {
1025
1024
  })
1026
1025
  });
1027
1026
  }
1028
- var styles$a = /*#__PURE__*/reactNative.StyleSheet.create({
1027
+ var styles$9 = /*#__PURE__*/reactNative.StyleSheet.create({
1029
1028
  modalSafe: {
1030
1029
  flex: 1,
1031
1030
  backgroundColor: 'primary',
@@ -1150,7 +1149,7 @@ function UIElement(props) {
1150
1149
  var _elementStyle$type;
1151
1150
  var type = reactCrudUtils.Utils.nvl(original.type, 'none');
1152
1151
  var key = reactCrudUtils.Utils.nvl(part, 'root');
1153
- var def = _extends({}, styles$b[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
1152
+ var def = _extends({}, styles$a[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
1154
1153
  var hasChild = hasChildren();
1155
1154
  if (!part && !hasChild) {
1156
1155
  def = _extends({}, def);
@@ -1184,8 +1183,9 @@ function UIElement(props) {
1184
1183
  });
1185
1184
  var CustomIcon = function CustomIcon() {
1186
1185
  if (typeof original.icon === 'string') {
1187
- return /*#__PURE__*/jsxRuntime.jsx(UIIcon, {
1188
- children: scope.getIcon()
1186
+ return /*#__PURE__*/jsxRuntime.jsx(vectorIcons.Ionicons, {
1187
+ name: original.icon,
1188
+ style: scope.getStyle('icon')
1189
1189
  });
1190
1190
  }
1191
1191
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
@@ -1289,7 +1289,8 @@ function UIElement(props) {
1289
1289
  children: [scope.is('format', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
1290
1290
  source: scope.getDisplayValue()
1291
1291
  }), scope.is('format', 'icon') && /*#__PURE__*/jsxRuntime.jsx(UIIcon, {
1292
- className: scope.getDisplayValue()
1292
+ scope: scope,
1293
+ crud: crud
1293
1294
  }), !scope.is('format', 'icon', 'img') && /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
1294
1295
  children: scope.getDisplayValue()
1295
1296
  })]
@@ -1389,7 +1390,7 @@ elementStyle.toggle = /*#__PURE__*/reactNative.StyleSheet.create({
1389
1390
  })
1390
1391
  });
1391
1392
  elementStyle.list = /*#__PURE__*/_extends({}, elementStyle.card);
1392
- var styles$b = /*#__PURE__*/reactNative.StyleSheet.create({
1393
+ var styles$a = /*#__PURE__*/reactNative.StyleSheet.create({
1393
1394
  root: {
1394
1395
  gap: 5,
1395
1396
  flexDirection: 'column',