react-crud-mobile 1.0.69 → 1.0.71

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