react-crud-mobile 1.0.91 → 1.0.92

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.
Files changed (40) hide show
  1. package/dist/elements/UI.d.ts +11 -10
  2. package/dist/elements/core/UIAutoComplete.d.ts +2 -0
  3. package/dist/elements/core/UIButton.d.ts +3 -0
  4. package/dist/elements/core/UIIcon.d.ts +2 -0
  5. package/dist/elements/core/UIInput.d.ts +3 -0
  6. package/dist/elements/core/UILink.d.ts +2 -0
  7. package/dist/elements/core/UIOption.d.ts +2 -0
  8. package/dist/elements/core/UIRadio.d.ts +2 -0
  9. package/dist/elements/core/UISelect.d.ts +2 -0
  10. package/dist/elements/core/UISwitch.d.ts +3 -0
  11. package/dist/react-crud-mobile.cjs.development.js +30 -25
  12. package/dist/react-crud-mobile.cjs.development.js.map +1 -1
  13. package/dist/react-crud-mobile.cjs.production.min.js +1 -1
  14. package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
  15. package/dist/react-crud-mobile.esm.js +32 -27
  16. package/dist/react-crud-mobile.esm.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/elements/UI.tsx +16 -14
  19. package/src/elements/UIComplete.tsx +1 -1
  20. package/src/elements/UIElement.tsx +27 -27
  21. package/src/elements/core/{AutoComplete.tsx → UIAutoComplete.tsx} +1 -1
  22. package/src/elements/core/{Button.tsx → UIButton.tsx} +1 -1
  23. package/src/elements/core/{Radio.tsx → UIIcon.tsx} +1 -1
  24. package/src/elements/core/{Input.tsx → UIInput.tsx} +1 -1
  25. package/src/elements/core/{Icon.tsx → UILink.tsx} +1 -1
  26. package/src/elements/core/{Option.tsx → UIOption.tsx} +1 -1
  27. package/src/elements/core/{Link.tsx → UIRadio.tsx} +1 -1
  28. package/src/elements/core/UISelect.tsx +17 -0
  29. package/src/elements/core/{Switch.tsx → UISwitch.tsx} +1 -1
  30. package/src/elements/grid/ElLabel.tsx +1 -1
  31. package/dist/elements/core/AutoComplete.d.ts +0 -2
  32. package/dist/elements/core/Button.d.ts +0 -3
  33. package/dist/elements/core/Icon.d.ts +0 -2
  34. package/dist/elements/core/Input.d.ts +0 -3
  35. package/dist/elements/core/Link.d.ts +0 -2
  36. package/dist/elements/core/Option.d.ts +0 -2
  37. package/dist/elements/core/Radio.d.ts +0 -2
  38. package/dist/elements/core/Select.d.ts +0 -2
  39. package/dist/elements/core/Switch.d.ts +0 -3
  40. package/src/elements/core/Select.tsx +0 -17
@@ -13,14 +13,14 @@ import {
13
13
  Utils,
14
14
  ElementType,
15
15
  } from 'react-crud-utils';
16
- import Link from './core/Link';
17
- import Icon from './core/Icon';
18
- import Button from './core/Button';
19
- import Select from './core/Select';
20
- import Switch from './core/Switch';
21
- import Option from './core/Option';
22
- import Radio from './core/Radio';
23
- import Input from './core/Input';
16
+ import UILink from './core/UILink';
17
+ import UIIcon from './core/UIIcon';
18
+ import UIButton from './core/UIButton';
19
+ import UISelect from './core/UISelect';
20
+ import UISwitch from './core/UISwitch';
21
+ import UIOption from './core/UIOption';
22
+ import UIRadio from './core/UIRadio';
23
+ import UIInput from './core/UIInput';
24
24
  import { Image, Linking, StyleSheet, Text, View } from 'react-native';
25
25
 
26
26
  export default function UIElement(props: ElementType) {
@@ -193,7 +193,7 @@ export default function UIElement(props: ElementType) {
193
193
 
194
194
  const CustomIcon = () => {
195
195
  if (typeof original.icon === 'string') {
196
- return <Icon>{scope.getIcon()}</Icon>;
196
+ return <UIIcon>{scope.getIcon()}</UIIcon>;
197
197
  }
198
198
  return <>{original.icon}</>;
199
199
  };
@@ -264,7 +264,7 @@ export default function UIElement(props: ElementType) {
264
264
  <>
265
265
  <View style={getStyle('inner')}>
266
266
  {scope.is('type', 'button') && (
267
- <Button
267
+ <UIButton
268
268
  {...defaultsUI}
269
269
  onClick={onClick}
270
270
  variant={scope.attr('variant', 'outlined')}
@@ -275,19 +275,19 @@ export default function UIElement(props: ElementType) {
275
275
  {scope.getLabel()}
276
276
  </Text>
277
277
  )}
278
- </Button>
278
+ </UIButton>
279
279
  )}
280
280
  {scope.is('type', 'icon') && (
281
- <Icon
281
+ <UIIcon
282
282
  {...defaultsUI}
283
283
  onClick={onClick}
284
284
  variant={scope.attr('variant', 'outlined')}
285
285
  >
286
286
  {scope.getDisplayValue()}
287
- </Icon>
287
+ </UIIcon>
288
288
  )}
289
289
  {scope.is('type', 'link') && (
290
- <Link
290
+ <UILink
291
291
  {...defaultsUI}
292
292
  onClick={onClick}
293
293
  variant={scope.attr('variant', 'outlined')}
@@ -298,7 +298,7 @@ export default function UIElement(props: ElementType) {
298
298
  {scope.getLabel()}
299
299
  </Text>
300
300
  )}
301
- </Link>
301
+ </UILink>
302
302
  )}
303
303
  {scope.is(
304
304
  'type',
@@ -310,7 +310,7 @@ export default function UIElement(props: ElementType) {
310
310
  'password',
311
311
  'email'
312
312
  ) && (
313
- <Input
313
+ <UIInput
314
314
  {...defaultsInput}
315
315
  {...defaultsUI}
316
316
  InputProps={{ ...original.inputProps }}
@@ -324,37 +324,37 @@ export default function UIElement(props: ElementType) {
324
324
  />
325
325
  )}
326
326
  {scope.is('type', 'checkbox', 'boolean', 'switch') && (
327
- <Switch
327
+ <UISwitch
328
328
  checked={isChecked()}
329
329
  {...defaultsInput}
330
330
  onChange={onCheck}
331
331
  />
332
332
  )}
333
333
  {scope.is('type', 'select') && (
334
- <Select
334
+ <UISelect
335
335
  {...defaultsInput}
336
336
  {...defaultsUI}
337
337
  value={scope.getSelectedValue()}
338
338
  >
339
- <Option value={''}>Selecione</Option>
339
+ <UIOption value={''}>Selecione</UIOption>
340
340
  {options.map((row: any, i: number) => (
341
- <Option key={'i' + i} value={row.value}>
341
+ <UIOption key={'i' + i} value={row.value}>
342
342
  {row.label}
343
- </Option>
343
+ </UIOption>
344
344
  ))}
345
- </Select>
345
+ </UISelect>
346
346
  )}
347
347
  {scope.is('type', 'radio') && (
348
- <Radio {...defaultsInput} {...defaultsUI} row>
348
+ <UIRadio {...defaultsInput} {...defaultsUI} row>
349
349
  {options.map((row: any, i: number) => (
350
- <Option
350
+ <UIOption
351
351
  key={'i' + i}
352
- control={<Radio {...defaultsUI} />}
352
+ control={<UIRadio {...defaultsUI} />}
353
353
  label={row.label}
354
354
  value={row.value}
355
355
  />
356
356
  ))}
357
- </Radio>
357
+ </UIRadio>
358
358
  )}
359
359
  {scope.is('type', 'custom') && <Custom />}
360
360
  {scope.is('type', 'column') && (
@@ -363,7 +363,7 @@ export default function UIElement(props: ElementType) {
363
363
  <Image source={scope.getDisplayValue()} />
364
364
  )}
365
365
  {scope.is('format', 'icon') && (
366
- <Icon className={scope.getDisplayValue()} />
366
+ <UIIcon className={scope.getDisplayValue()} />
367
367
  )}
368
368
  {!scope.is('format', 'icon', 'img') && (
369
369
  <Text>{scope.getDisplayValue()}</Text>
@@ -1,6 +1,6 @@
1
1
  import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
2
 
3
- export default function AutoComplete(props: any) {
3
+ export default function UIAutoComplete(props: any) {
4
4
  const handlePress = () => {
5
5
  Linking.openURL('https://reactnative.dev/');
6
6
  };
@@ -2,7 +2,7 @@ import { Ionicons } from '@expo/vector-icons';
2
2
  import { ChildType } from 'react-crud-utils';
3
3
  import { Text, TouchableHighlight, View } from 'react-native';
4
4
 
5
- export default function Button(props: ChildType) {
5
+ export default function UIButton(props: ChildType) {
6
6
  let scope = props.scope;
7
7
  let element = scope.original;
8
8
 
@@ -1,6 +1,6 @@
1
1
  import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
2
 
3
- export default function Radio(props: any) {
3
+ export default function UIIcon(props: any) {
4
4
  const handlePress = () => {
5
5
  Linking.openURL('https://reactnative.dev/');
6
6
  };
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
2
  import { ChildType, Utils } from 'react-crud-utils';
3
3
  import { StyleSheet, TextInput } from 'react-native';
4
4
 
5
- export default function Input(props: ChildType) {
5
+ export default function UIInput(props: ChildType) {
6
6
  let scope = props.scope;
7
7
  let initial = Utils.nvl(scope.getValue(), '');
8
8
 
@@ -1,6 +1,6 @@
1
1
  import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
2
 
3
- export default function Icon(props: any) {
3
+ export default function UILink(props: any) {
4
4
  const handlePress = () => {
5
5
  Linking.openURL('https://reactnative.dev/');
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
2
 
3
- export default function Option(props: any) {
3
+ export default function UIOption(props: any) {
4
4
  const handlePress = () => {
5
5
  Linking.openURL('https://reactnative.dev/');
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
2
 
3
- export default function Link(props: any) {
3
+ export default function UIRadio(props: any) {
4
4
  const handlePress = () => {
5
5
  Linking.openURL('https://reactnative.dev/');
6
6
  };
@@ -0,0 +1,17 @@
1
+ import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
+
3
+ export default function UISelect(props: any) {
4
+ const handlePress = () => {
5
+ Linking.openURL('https://reactnative.dev/');
6
+ };
7
+
8
+ return (
9
+ <TouchableOpacity onPress={handlePress}>
10
+ <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ const styles = {
16
+ link: {},
17
+ };
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
2
  import { ChildType, Utils } from 'react-crud-utils';
3
3
  import { Switch as ReactSwitch } from 'react-native';
4
4
 
5
- export default function Switch(props: ChildType) {
5
+ export default function UISwitch(props: ChildType) {
6
6
  const scope = props.scope;
7
7
  const initial = Utils.nvl(scope.getValue(), false) as boolean;
8
8
  const [value, setValue] = useState(initial);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import UI from '../UI';
3
3
  import { ChildType, Utils } from 'react-crud-utils';
4
- import Icon from '../core/Icon';
4
+ import Icon from '../core/UIIcon';
5
5
 
6
6
  interface ElLabelType extends ChildType {
7
7
  position?: string;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function AutoComplete(props: any): import("react").JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChildType } from 'react-crud-utils';
3
- export default function Button(props: ChildType): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Icon(props: any): import("react").JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChildType } from 'react-crud-utils';
3
- export default function Input(props: ChildType): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Link(props: any): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Option(props: any): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Radio(props: any): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Select(props: any): import("react").JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChildType } from 'react-crud-utils';
3
- export default function Switch(props: ChildType): import("react").JSX.Element;
@@ -1,17 +0,0 @@
1
- import { Text, TouchableOpacity, Linking, StyleSheet } from 'react-native';
2
-
3
- export default function Select(props: any) {
4
- const handlePress = () => {
5
- Linking.openURL('https://reactnative.dev/');
6
- };
7
-
8
- return (
9
- <TouchableOpacity onPress={handlePress}>
10
- <Text style={styles.link}>Clique aqui para acessar o React Native</Text>
11
- </TouchableOpacity>
12
- );
13
- }
14
-
15
- const styles = {
16
- link: {},
17
- };