react-crud-mobile 1.0.586 → 1.0.587

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.
@@ -425,16 +425,13 @@ function UIButton(props) {
425
425
  }
426
426
 
427
427
  function UISelect(props) {
428
- var _useState = React.useState(false),
429
- modalVisible = _useState[0],
430
- setModalVisible = _useState[1];
431
428
  var scope = props.scope;
432
429
  var items = reactCrudUtils.Utils.nvl(scope.getOptions(), []);
433
430
  var placeholder = scope.attr('placeholder', 'Selecione...');
434
431
  var value = scope.getDisplayValue();
435
- var theme = reactCrudUtils.useTheme();
432
+ var modalName = scope.getName() + "_Modal";
436
433
  var handlePress = function handlePress() {
437
- setModalVisible(!modalVisible);
434
+ scope.hide();
438
435
  };
439
436
  var onClick = function onClick(_ref) {
440
437
  var value = _ref.value;
@@ -444,6 +441,11 @@ function UISelect(props) {
444
441
  var style = function style(part, extra) {
445
442
  return _extends({}, styles$3[part], scope.getStyle(part), extra);
446
443
  };
444
+ var onStartModal = function onStartModal(_ref2) {
445
+ var crud = _ref2.crud,
446
+ scope = _ref2.scope;
447
+ console.log(crud, scope);
448
+ };
447
449
  return /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
448
450
  style: style('selectRoot'),
449
451
  children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.TouchableOpacity, {
@@ -457,45 +459,17 @@ function UISelect(props) {
457
459
  size: 20,
458
460
  color: "#888"
459
461
  })]
460
- }), /*#__PURE__*/jsxRuntime.jsxs(reactNative.Modal, {
461
- animationType: "slide",
462
- transparent: true,
463
- visible: modalVisible,
464
- onRequestClose: function onRequestClose() {
465
- return setModalVisible(false);
466
- },
467
- children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.StatusBar, {
468
- barStyle: "dark-content",
469
- backgroundColor: theme.colors.primary
470
- }), /*#__PURE__*/jsxRuntime.jsxs(reactNative.SafeAreaView, {
471
- style: style('modalSafe'),
472
- children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
473
- style: style('modalHeader'),
474
- children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
475
- onPress: function onPress() {
476
- return setModalVisible(false);
477
- },
478
- style: style('modalCloseButton'),
479
- children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
480
- style: style('modalCloseText'),
481
- children: "X"
482
- })
483
- }), /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
484
- style: style('modalTitle'),
485
- children: placeholder
486
- })]
487
- }), /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
488
- style: style('modalContent'),
489
- children: /*#__PURE__*/jsxRuntime.jsx(UI.List, {
490
- data: items,
491
- name: scope.getName('list'),
492
- click: onClick,
493
- children: /*#__PURE__*/jsxRuntime.jsx(UI.Value, {
494
- value: "#{@this.label}"
495
- })
496
- })
497
- })]
498
- })]
462
+ }), /*#__PURE__*/jsxRuntime.jsx(UI.Dialog, {
463
+ name: modalName,
464
+ onStart: onStartModal,
465
+ children: /*#__PURE__*/jsxRuntime.jsx(UI.List, {
466
+ data: items,
467
+ name: scope.getName('list'),
468
+ click: onClick,
469
+ children: /*#__PURE__*/jsxRuntime.jsx(UI.Value, {
470
+ value: "#{@this.label}"
471
+ })
472
+ })
499
473
  })]
500
474
  });
501
475
  }
@@ -515,38 +489,6 @@ var styles$3 = /*#__PURE__*/reactNative.StyleSheet.create({
515
489
  },
516
490
  selectLabel: {
517
491
  flex: 1
518
- },
519
- modalSafe: {
520
- flex: 1,
521
- backgroundColor: '#f5f5f5',
522
- paddingTop: reactNative.StatusBar.currentHeight || 0
523
- },
524
- modalHeader: {
525
- flexDirection: 'row',
526
- alignItems: 'center',
527
- padding: 15,
528
- backgroundColor: '#6200ea'
529
- },
530
- modalCloseButton: {
531
- padding: 10
532
- },
533
- modalCloseText: {
534
- fontSize: 18,
535
- color: 'white'
536
- },
537
- modalTitle: {
538
- fontSize: 18,
539
- color: 'white',
540
- fontWeight: 'bold',
541
- marginLeft: 10
542
- },
543
- modalContent: {
544
- flex: 1,
545
- width: '100%',
546
- alignSelf: 'flex-start',
547
- flexDirection: 'row',
548
- flexWrap: 'wrap',
549
- padding: 20
550
492
  }
551
493
  });
552
494