react-crud-mobile 1.3.65 → 1.3.67

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.65",
2
+ "version": "1.3.67",
3
3
  "license": "MIT",
4
4
  "description": "Uma biblioteca de componentes para React Native",
5
5
  "main": "dist/index.js",
@@ -333,16 +333,29 @@ export default function UIElement(props: ElementType) {
333
333
  return true;
334
334
  };
335
335
 
336
- let Tag: any = View;
336
+ let isTouch =
337
+ !scope.isType('input', 'grid', 'list', 'order', 'repeat') && original.click;
337
338
  let custom: any = {};
338
339
 
339
- if (!scope.isType('input', 'grid', 'list', 'repeat') && original.click) {
340
- Tag = TouchableHighlight;
341
-
340
+ if (isTouch) {
342
341
  custom.underlayColor = 'transparent';
343
342
  custom.onPress = onClick;
344
343
  }
345
344
 
345
+ let Tag = (props: any) => {
346
+ let Aux: any = View;
347
+
348
+ if (isTouch) {
349
+ Aux = TouchableHighlight;
350
+ }
351
+
352
+ if (scope.isType('dialog')) {
353
+ return <>{props.children}</>;
354
+ }
355
+
356
+ return <Aux {...props} />;
357
+ };
358
+
346
359
  let Inner = () => {
347
360
  return (
348
361
  <>
@@ -509,7 +522,13 @@ export default function UIElement(props: ElementType) {
509
522
  {scope.isType('list', 'repeat') && (
510
523
  <UIList {...props} scope={scope} crud={crud} />
511
524
  )}
525
+ {scope.isType('order') && (
526
+ <UIOrder {...props} scope={scope} crud={crud} />
527
+ )}
512
528
 
529
+ {scope.isType('dialog') && (
530
+ <UIModal {...props} scope={scope} crud={crud} />
531
+ )}
513
532
  {scope.isType('chart') && (
514
533
  <ElChart {...props} scope={scope} crud={crud} />
515
534
  )}
@@ -565,31 +584,13 @@ export default function UIElement(props: ElementType) {
565
584
  return <>{props.children}</>;
566
585
  };
567
586
 
568
- let Decorate = (props: any) => {
569
- if (scope.isType('order')) {
570
- return <UIOrder {...props} scope={scope} crud={crud} />;
571
- }
572
-
573
- if (scope.isType('dialog')) {
574
- return <UIModal {...props} scope={scope} crud={crud} />;
575
- }
576
-
577
- return (
578
- <Tag ref={ref} style={getStyle()} {...custom}>
579
- {props.children}
580
- </Tag>
581
- );
582
- };
583
-
584
587
  return (
585
588
  <CrudContext.Provider value={{ crud, theme }}>
586
- <Decorate>
587
- <Tag ref={ref} style={getStyle()} {...custom}>
588
- <Card>
589
- <Container />
590
- </Card>
591
- </Tag>
592
- </Decorate>
589
+ <Tag ref={ref} style={getStyle()} {...custom}>
590
+ <Card>
591
+ <Container />
592
+ </Card>
593
+ </Tag>
593
594
  </CrudContext.Provider>
594
595
  );
595
596
  }