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.
- package/dist/elements/UI.d.ts +11 -10
- package/dist/elements/core/UIAutoComplete.d.ts +2 -0
- package/dist/elements/core/UIButton.d.ts +3 -0
- package/dist/elements/core/UIIcon.d.ts +2 -0
- package/dist/elements/core/UIInput.d.ts +3 -0
- package/dist/elements/core/UILink.d.ts +2 -0
- package/dist/elements/core/UIOption.d.ts +2 -0
- package/dist/elements/core/UIRadio.d.ts +2 -0
- package/dist/elements/core/UISelect.d.ts +2 -0
- package/dist/elements/core/UISwitch.d.ts +3 -0
- package/dist/react-crud-mobile.cjs.development.js +30 -25
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +32 -27
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UI.tsx +16 -14
- package/src/elements/UIComplete.tsx +1 -1
- package/src/elements/UIElement.tsx +27 -27
- package/src/elements/core/{AutoComplete.tsx → UIAutoComplete.tsx} +1 -1
- package/src/elements/core/{Button.tsx → UIButton.tsx} +1 -1
- package/src/elements/core/{Radio.tsx → UIIcon.tsx} +1 -1
- package/src/elements/core/{Input.tsx → UIInput.tsx} +1 -1
- package/src/elements/core/{Icon.tsx → UILink.tsx} +1 -1
- package/src/elements/core/{Option.tsx → UIOption.tsx} +1 -1
- package/src/elements/core/{Link.tsx → UIRadio.tsx} +1 -1
- package/src/elements/core/UISelect.tsx +17 -0
- package/src/elements/core/{Switch.tsx → UISwitch.tsx} +1 -1
- package/src/elements/grid/ElLabel.tsx +1 -1
- package/dist/elements/core/AutoComplete.d.ts +0 -2
- package/dist/elements/core/Button.d.ts +0 -3
- package/dist/elements/core/Icon.d.ts +0 -2
- package/dist/elements/core/Input.d.ts +0 -3
- package/dist/elements/core/Link.d.ts +0 -2
- package/dist/elements/core/Option.d.ts +0 -2
- package/dist/elements/core/Radio.d.ts +0 -2
- package/dist/elements/core/Select.d.ts +0 -2
- package/dist/elements/core/Switch.d.ts +0 -3
- 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
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
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 <
|
|
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
|
-
<
|
|
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
|
-
</
|
|
278
|
+
</UIButton>
|
|
279
279
|
)}
|
|
280
280
|
{scope.is('type', 'icon') && (
|
|
281
|
-
<
|
|
281
|
+
<UIIcon
|
|
282
282
|
{...defaultsUI}
|
|
283
283
|
onClick={onClick}
|
|
284
284
|
variant={scope.attr('variant', 'outlined')}
|
|
285
285
|
>
|
|
286
286
|
{scope.getDisplayValue()}
|
|
287
|
-
</
|
|
287
|
+
</UIIcon>
|
|
288
288
|
)}
|
|
289
289
|
{scope.is('type', 'link') && (
|
|
290
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
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
|
-
<
|
|
327
|
+
<UISwitch
|
|
328
328
|
checked={isChecked()}
|
|
329
329
|
{...defaultsInput}
|
|
330
330
|
onChange={onCheck}
|
|
331
331
|
/>
|
|
332
332
|
)}
|
|
333
333
|
{scope.is('type', 'select') && (
|
|
334
|
-
<
|
|
334
|
+
<UISelect
|
|
335
335
|
{...defaultsInput}
|
|
336
336
|
{...defaultsUI}
|
|
337
337
|
value={scope.getSelectedValue()}
|
|
338
338
|
>
|
|
339
|
-
<
|
|
339
|
+
<UIOption value={''}>Selecione</UIOption>
|
|
340
340
|
{options.map((row: any, i: number) => (
|
|
341
|
-
<
|
|
341
|
+
<UIOption key={'i' + i} value={row.value}>
|
|
342
342
|
{row.label}
|
|
343
|
-
</
|
|
343
|
+
</UIOption>
|
|
344
344
|
))}
|
|
345
|
-
</
|
|
345
|
+
</UISelect>
|
|
346
346
|
)}
|
|
347
347
|
{scope.is('type', 'radio') && (
|
|
348
|
-
<
|
|
348
|
+
<UIRadio {...defaultsInput} {...defaultsUI} row>
|
|
349
349
|
{options.map((row: any, i: number) => (
|
|
350
|
-
<
|
|
350
|
+
<UIOption
|
|
351
351
|
key={'i' + i}
|
|
352
|
-
control={<
|
|
352
|
+
control={<UIRadio {...defaultsUI} />}
|
|
353
353
|
label={row.label}
|
|
354
354
|
value={row.value}
|
|
355
355
|
/>
|
|
356
356
|
))}
|
|
357
|
-
</
|
|
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
|
-
<
|
|
366
|
+
<UIIcon className={scope.getDisplayValue()} />
|
|
367
367
|
)}
|
|
368
368
|
{!scope.is('format', 'icon', 'img') && (
|
|
369
369
|
<Text>{scope.getDisplayValue()}</Text>
|
|
@@ -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
|
|
5
|
+
export default function UIButton(props: ChildType) {
|
|
6
6
|
let scope = props.scope;
|
|
7
7
|
let element = scope.original;
|
|
8
8
|
|
|
@@ -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
|
|
5
|
+
export default function UIInput(props: ChildType) {
|
|
6
6
|
let scope = props.scope;
|
|
7
7
|
let initial = Utils.nvl(scope.getValue(), '');
|
|
8
8
|
|
|
@@ -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
|
|
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,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
|
-
};
|