react-crud-mobile 1.0.71 → 1.0.72

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.
@@ -22,15 +22,7 @@ import Switch from './core/Switch';
22
22
  import Option from './core/Option';
23
23
  import Radio from './core/Radio';
24
24
  import Input from './core/Input';
25
- import {
26
- Image,
27
- Linking,
28
- StyleSheet,
29
- Text,
30
- Keyboard,
31
- TouchableWithoutFeedback,
32
- View,
33
- } from 'react-native';
25
+ import { Image, Linking, StyleSheet, Text, View } from 'react-native';
34
26
 
35
27
  export default function UIElement(props: ElementType) {
36
28
  let [scope] = useState(ScopeUtils.create(props));
@@ -264,142 +256,140 @@ export default function UIElement(props: ElementType) {
264
256
 
265
257
  return (
266
258
  <>
267
- <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
268
- <View ref={ref} style={getStyle()}>
269
- <>
270
- {isShowLabel() && (
271
- <Text style={getStyle('label')}>{scope.getLabel()}</Text>
272
- )}
273
- {isShowInner() && (
274
- <>
275
- <View style={getStyle('inner')}>
276
- {scope.is('type', 'button') && (
277
- <Button
278
- {...defaultsUI}
279
- onClick={onClick}
280
- variant={scope.attr('variant', 'outlined')}
281
- >
282
- {original.icon && <CustomIcon />}
283
- {original.label && (
284
- <Text style={scope.getPart('label', 'button')}>
285
- {scope.getLabel()}
286
- </Text>
287
- )}
288
- </Button>
289
- )}
290
- {scope.is('type', 'icon') && (
291
- <Icon
292
- {...defaultsUI}
293
- onClick={onClick}
294
- variant={scope.attr('variant', 'outlined')}
295
- >
296
- {scope.getDisplayValue()}
297
- </Icon>
298
- )}
299
- {scope.is('type', 'link') && (
300
- <Link
301
- {...defaultsUI}
302
- onClick={onClick}
303
- variant={scope.attr('variant', 'outlined')}
304
- >
305
- {original.icon && <CustomIcon />}
306
- {original.label && (
307
- <Text style={scope.getPart('label', 'link')}>
308
- {scope.getLabel()}
309
- </Text>
310
- )}
311
- </Link>
312
- )}
313
- {scope.is(
314
- 'type',
315
- 'text',
316
- 'number',
317
- 'phone',
318
- 'postalCode',
319
- 'money',
320
- 'password',
321
- 'email'
322
- ) && (
323
- <Input
324
- {...defaultsInput}
325
- {...defaultsUI}
326
- InputProps={{ ...original.inputProps }}
327
- />
328
- )}
329
- {scope.is('type', 'complete', 'autocomplete') && (
330
- <UIComplete
331
- scope={scope}
332
- defaultsInput={defaultsInput}
333
- defaultsUI={defaultsUI}
334
- />
335
- )}
336
- {scope.is('type', 'checkbox', 'boolean', 'switch') && (
337
- <Switch
338
- checked={isChecked()}
339
- {...defaultsInput}
340
- onChange={onCheck}
341
- />
342
- )}
343
- {scope.is('type', 'select') && (
344
- <Select
345
- {...defaultsInput}
346
- {...defaultsUI}
347
- value={scope.getSelectedValue()}
348
- >
349
- <Option value={''}>Selecione</Option>
350
- {options.map((row: any, i: number) => (
351
- <Option key={'i' + i} value={row.value}>
352
- {row.label}
353
- </Option>
354
- ))}
355
- </Select>
356
- )}
357
- {scope.is('type', 'radio') && (
358
- <Radio {...defaultsInput} {...defaultsUI} row>
359
- {options.map((row: any, i: number) => (
360
- <Option
361
- key={'i' + i}
362
- control={<Radio {...defaultsUI} />}
363
- label={row.label}
364
- value={row.value}
365
- />
366
- ))}
367
- </Radio>
368
- )}
369
- {scope.is('type', 'custom') && <Custom />}
370
- {scope.is('type', 'column') && (
371
- <>
372
- {scope.is('format', 'img') && (
373
- <Image source={scope.getDisplayValue()} />
374
- )}
375
- {scope.is('format', 'icon') && (
376
- <Icon className={scope.getDisplayValue()} />
377
- )}
378
- {!scope.is('format', 'icon', 'img') && (
379
- <Text>{scope.getDisplayValue()}</Text>
380
- )}
381
- </>
382
- )}
383
- {scope.is('type', 'output') && (
384
- <Text>{scope.getDisplayValue()}</Text>
385
- )}
386
- </View>
387
- {error && <View style={getStyle('error')}>{error}</View>}
388
- </>
389
- )}
390
- <CurrentRouter />
391
- {!scope.is(
392
- 'type',
393
- 'card',
394
- 'tabs',
395
- 'grid',
396
- 'list',
397
- 'define',
398
- 'repeat'
399
- ) && <UIChildren {...props} scope={scope} crud={crud} />}
400
- </>
401
- </View>
402
- </TouchableWithoutFeedback>
259
+ <View ref={ref} style={getStyle()}>
260
+ <>
261
+ {isShowLabel() && (
262
+ <Text style={getStyle('label')}>{scope.getLabel()}</Text>
263
+ )}
264
+ {isShowInner() && (
265
+ <>
266
+ <View style={getStyle('inner')}>
267
+ {scope.is('type', 'button') && (
268
+ <Button
269
+ {...defaultsUI}
270
+ onClick={onClick}
271
+ variant={scope.attr('variant', 'outlined')}
272
+ >
273
+ {original.icon && <CustomIcon />}
274
+ {original.label && (
275
+ <Text style={scope.getPart('label', 'button')}>
276
+ {scope.getLabel()}
277
+ </Text>
278
+ )}
279
+ </Button>
280
+ )}
281
+ {scope.is('type', 'icon') && (
282
+ <Icon
283
+ {...defaultsUI}
284
+ onClick={onClick}
285
+ variant={scope.attr('variant', 'outlined')}
286
+ >
287
+ {scope.getDisplayValue()}
288
+ </Icon>
289
+ )}
290
+ {scope.is('type', 'link') && (
291
+ <Link
292
+ {...defaultsUI}
293
+ onClick={onClick}
294
+ variant={scope.attr('variant', 'outlined')}
295
+ >
296
+ {original.icon && <CustomIcon />}
297
+ {original.label && (
298
+ <Text style={scope.getPart('label', 'link')}>
299
+ {scope.getLabel()}
300
+ </Text>
301
+ )}
302
+ </Link>
303
+ )}
304
+ {scope.is(
305
+ 'type',
306
+ 'text',
307
+ 'number',
308
+ 'phone',
309
+ 'postalCode',
310
+ 'money',
311
+ 'password',
312
+ 'email'
313
+ ) && (
314
+ <Input
315
+ {...defaultsInput}
316
+ {...defaultsUI}
317
+ InputProps={{ ...original.inputProps }}
318
+ />
319
+ )}
320
+ {scope.is('type', 'complete', 'autocomplete') && (
321
+ <UIComplete
322
+ scope={scope}
323
+ defaultsInput={defaultsInput}
324
+ defaultsUI={defaultsUI}
325
+ />
326
+ )}
327
+ {scope.is('type', 'checkbox', 'boolean', 'switch') && (
328
+ <Switch
329
+ checked={isChecked()}
330
+ {...defaultsInput}
331
+ onChange={onCheck}
332
+ />
333
+ )}
334
+ {scope.is('type', 'select') && (
335
+ <Select
336
+ {...defaultsInput}
337
+ {...defaultsUI}
338
+ value={scope.getSelectedValue()}
339
+ >
340
+ <Option value={''}>Selecione</Option>
341
+ {options.map((row: any, i: number) => (
342
+ <Option key={'i' + i} value={row.value}>
343
+ {row.label}
344
+ </Option>
345
+ ))}
346
+ </Select>
347
+ )}
348
+ {scope.is('type', 'radio') && (
349
+ <Radio {...defaultsInput} {...defaultsUI} row>
350
+ {options.map((row: any, i: number) => (
351
+ <Option
352
+ key={'i' + i}
353
+ control={<Radio {...defaultsUI} />}
354
+ label={row.label}
355
+ value={row.value}
356
+ />
357
+ ))}
358
+ </Radio>
359
+ )}
360
+ {scope.is('type', 'custom') && <Custom />}
361
+ {scope.is('type', 'column') && (
362
+ <>
363
+ {scope.is('format', 'img') && (
364
+ <Image source={scope.getDisplayValue()} />
365
+ )}
366
+ {scope.is('format', 'icon') && (
367
+ <Icon className={scope.getDisplayValue()} />
368
+ )}
369
+ {!scope.is('format', 'icon', 'img') && (
370
+ <Text>{scope.getDisplayValue()}</Text>
371
+ )}
372
+ </>
373
+ )}
374
+ {scope.is('type', 'output') && (
375
+ <Text>{scope.getDisplayValue()}</Text>
376
+ )}
377
+ </View>
378
+ {error && <View style={getStyle('error')}>{error}</View>}
379
+ </>
380
+ )}
381
+ <CurrentRouter />
382
+ {!scope.is(
383
+ 'type',
384
+ 'card',
385
+ 'tabs',
386
+ 'grid',
387
+ 'list',
388
+ 'define',
389
+ 'repeat'
390
+ ) && <UIChildren {...props} scope={scope} crud={crud} />}
391
+ </>
392
+ </View>
403
393
  </>
404
394
  );
405
395
  }