react-crud-mobile 1.0.586 → 1.0.588

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,18 @@ 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";
433
+ var crud = scope.crud;
436
434
  var handlePress = function handlePress() {
437
- setModalVisible(!modalVisible);
435
+ scope.show({
436
+ crud: crud,
437
+ scope: scope,
438
+ event: null
439
+ });
438
440
  };
439
441
  var onClick = function onClick(_ref) {
440
442
  var value = _ref.value;
@@ -444,6 +446,11 @@ function UISelect(props) {
444
446
  var style = function style(part, extra) {
445
447
  return _extends({}, styles$3[part], scope.getStyle(part), extra);
446
448
  };
449
+ var onStartModal = function onStartModal(_ref2) {
450
+ var crud = _ref2.crud,
451
+ scope = _ref2.scope;
452
+ console.log(crud, scope);
453
+ };
447
454
  return /*#__PURE__*/jsxRuntime.jsxs(reactNative.View, {
448
455
  style: style('selectRoot'),
449
456
  children: [/*#__PURE__*/jsxRuntime.jsxs(reactNative.TouchableOpacity, {
@@ -457,45 +464,17 @@ function UISelect(props) {
457
464
  size: 20,
458
465
  color: "#888"
459
466
  })]
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
- })]
467
+ }), /*#__PURE__*/jsxRuntime.jsx(UI.Dialog, {
468
+ name: modalName,
469
+ onStart: onStartModal,
470
+ children: /*#__PURE__*/jsxRuntime.jsx(UI.List, {
471
+ data: items,
472
+ name: scope.getName('list'),
473
+ click: onClick,
474
+ children: /*#__PURE__*/jsxRuntime.jsx(UI.Value, {
475
+ value: "#{@this.label}"
476
+ })
477
+ })
499
478
  })]
500
479
  });
501
480
  }
@@ -515,38 +494,6 @@ var styles$3 = /*#__PURE__*/reactNative.StyleSheet.create({
515
494
  },
516
495
  selectLabel: {
517
496
  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
497
  }
551
498
  });
552
499