react-crud-mobile 1.0.227 → 1.0.228

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.
@@ -1,435 +1,436 @@
1
- import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
- import UIChildren from './UIChildren';
3
- import ElTabs from './tabs/ElTabs';
4
- import ElChart from './charts/ElChart';
5
- import UIComplete from './UIComplete';
6
- import {
7
- Crud,
8
- HtmlUtils,
9
- ScopeUtils,
10
- Utils,
11
- ElementType,
12
- } from 'react-crud-utils';
13
- import UILink from './core/UILink';
14
- import UIIcon from './core/UIIcon';
15
- import UIButton from './core/UIButton';
16
- import UISelect from './core/UISelect';
17
- import UISwitch from './core/UISwitch';
18
- import UIOption from './core/UIOption';
19
- import UIRadio from './core/UIRadio';
20
- import UIInput from './core/UIInput';
21
- import { Image, Linking, StyleSheet, Text, View } from 'react-native';
22
- import UIList from './core/UIList';
23
-
24
- export default function UIElement(props: ElementType) {
25
- let [scope] = useState(ScopeUtils.create(props));
26
- let [index, setIndex] = useState(0);
27
- let [error, setError]: string | any = useState(null);
28
- let options: any = scope.getOptions();
29
- let crud: Crud = Utils.nvl(props.crud, scope.crud);
30
- let original = scope.original;
31
- let type = original.type;
32
- let ref = useRef(null);
33
-
34
- scope.update = () => {
35
- setIndex(++index);
36
- };
37
-
38
- let router: any = {
39
- list: UIList,
40
- tabs: ElTabs,
41
- chart: ElChart,
42
- };
43
-
44
- let CurrentRouter = () => {
45
- if (router[type]) {
46
- let Aux = router[type];
47
-
48
- return <Aux crud={crud} {...props} scope={scope} />;
49
- }
50
- return <></>;
51
- };
52
-
53
- const Custom = () => {
54
- let c: any = original.custom;
55
-
56
- if (c) {
57
- if (typeof c === 'string') {
58
- return (
59
- <UIElement
60
- element={{ value: c, type: 'dummy' }}
61
- crud={crud}
62
- ></UIElement>
63
- );
64
- }
65
-
66
- return (
67
- <UIElement
68
- type={c.type}
69
- tag={c.type}
70
- {...c.props}
71
- crud={crud}
72
- ></UIElement>
73
- );
74
- }
75
-
76
- return <></>;
77
- };
78
-
79
- if (scope.is('type', 'dummy')) {
80
- return <>{scope.getDisplayValue()}</>;
81
- }
82
-
83
- let onCheck = () => {
84
- let v = scope.getValue();
85
- let check = !(v === true);
86
-
87
- onChange({ target: { value: check } });
88
- };
89
-
90
- let onChange = (e: any) => {
91
- let val = e.target.value;
92
-
93
- if (scope.isType('integer', 'int', 'number')) {
94
- val = parseInt(val);
95
- } else if (scope.isType('decimal')) {
96
- val = parseFloat(val);
97
- }
98
-
99
- if (scope.isType('select', 'complete')) {
100
- val = scope.getSelectedItem(val);
101
- }
102
-
103
- scope.changeValue(val);
104
- scope.update();
105
- };
106
-
107
- let onClick = (e: any) => {
108
- scope.call('click');
109
- };
110
-
111
- let defaultsInput: any = {
112
- scope,
113
- crud,
114
- onChange: onChange,
115
- };
116
-
117
- if (scope.isType('password')) {
118
- defaultsInput.type = 'password';
119
- }
120
-
121
- let isChecked = () => {
122
- let v = scope.getValue();
123
-
124
- return v === true;
125
- };
126
-
127
- let hasChildren = () => {
128
- if (scope.isInput()) {
129
- return false;
130
- }
131
-
132
- return !Utils.isEmpty(props.children) || !Utils.isEmpty(props.elements);
133
- };
134
-
135
- const getStyle = (part?: string) => {
136
- let type = Utils.nvl(original.type, 'none');
137
- let key = Utils.nvl(part, 'root');
138
- let def = { ...styles[key], ...elementStyle?.[type]?.[key] };
139
- let hasChild = hasChildren();
140
-
141
- if (!part && !hasChild) {
142
- def = { ...def };
143
- }
144
-
145
- if (hasChild && part) {
146
- def = { ...def, ...withChildStyles[part] };
147
- }
148
-
149
- def = { ...def, ...elementStyle?.[type]?.[key] };
150
-
151
- return { ...def, ...scope.getStyle(part) };
152
- };
153
-
154
- let elStyle = getStyle('element');
155
-
156
- let defaultsUI: any = {
157
- required: scope.isRequired(),
158
- size: 'small',
159
- scope,
160
- crud,
161
- style: elStyle,
162
- placeholder: scope.attr('placeholder', 'Digite aqui'),
163
- };
164
-
165
- if (!scope.isRendered() || scope.is('type', 'define')) {
166
- return <></>;
167
- }
168
-
169
- scope.error = (msg: string) => {
170
- error = msg;
171
- setError(msg);
172
- };
173
-
174
- useEffect(() => {
175
- if (!scope.ready) {
176
- scope.ready = true;
177
-
178
- scope.call('load');
179
-
180
- if (scope.isType('list', 'repeat')) {
181
- scope.search();
182
- } else if (original.list) {
183
- scope.call('list');
184
- }
185
- scope.start();
186
- }
187
- });
188
-
189
- const CustomIcon = () => {
190
- if (typeof original.icon === 'string') {
191
- return <UIIcon>{scope.getIcon()}</UIIcon>;
192
- }
193
- return <>{original.icon}</>;
194
- };
195
-
196
- let hasCustomRoute = () => {
197
- if (router[type]) return true;
198
- return false;
199
- };
200
-
201
- scope.open = (args: any) => {
202
- Linking.openURL(args.url);
203
- };
204
-
205
- if (scope.isType('dialog')) {
206
- let name = original.name;
207
-
208
- if (!crud.dialogs[name]) {
209
- let dlg: any = { config: { ...original } };
210
-
211
- dlg.component = (args: any) => {
212
- return <UIChildren {...props} scope={scope} crud={crud} />;
213
- };
214
-
215
- crud.dialogs[name] = dlg;
216
- }
217
- return <></>;
218
- }
219
-
220
- useLayoutEffect(() => {
221
- if (ref?.current && scope.is('type', 'card', 'list', 'tabs', 'stepper')) {
222
- let el: any = ref?.current;
223
-
224
- if (el?.classList) {
225
- let bg = HtmlUtils.getBGColor(el);
226
-
227
- if (bg === 'rgb(255, 255, 255)') {
228
- el.classList.add('ui-dark');
229
- } else {
230
- el.classList.add('ui-light');
231
- }
232
- }
233
- }
234
- });
235
-
236
- const isShowLabel = () => {
237
- if (typeof original.label !== 'undefined' && !scope.isType('button')) {
238
- return true;
239
- }
240
-
241
- return false;
242
- };
243
-
244
- const isShowInner = () => {
245
- if (hasChildren() || hasCustomRoute()) {
246
- return false;
247
- }
248
- return true;
249
- };
250
-
251
- return (
252
- <>
253
- <View ref={ref} style={getStyle()}>
254
- <>
255
- {isShowLabel() && (
256
- <Text style={getStyle('label')}>{scope.getLabel()}</Text>
257
- )}
258
- {isShowInner() && (
259
- <>
260
- <View style={getStyle('inner')}>
261
- {scope.is('type', 'button') && (
262
- <UIButton
263
- {...defaultsUI}
264
- onClick={onClick}
265
- variant={scope.attr('variant', 'outlined')}
266
- >
267
- {original.icon && <CustomIcon />}
268
- {original.label && (
269
- <Text style={scope.getPart('label', 'button')}>
270
- {scope.getLabel()}
271
- </Text>
272
- )}
273
- </UIButton>
274
- )}
275
- {scope.is('type', 'icon') && (
276
- <UIIcon
277
- {...defaultsUI}
278
- onClick={onClick}
279
- variant={scope.attr('variant', 'outlined')}
280
- >
281
- {scope.getDisplayValue()}
282
- </UIIcon>
283
- )}
284
- {scope.is('type', 'link') && (
285
- <UILink
286
- {...defaultsUI}
287
- onClick={onClick}
288
- variant={scope.attr('variant', 'outlined')}
289
- >
290
- {original.icon && <CustomIcon />}
291
- {original.label && (
292
- <Text style={scope.getPart('label', 'link')}>
293
- {scope.getLabel()}
294
- </Text>
295
- )}
296
- </UILink>
297
- )}
298
- {scope.is(
299
- 'type',
300
- 'text',
301
- 'number',
302
- 'phone',
303
- 'postalCode',
304
- 'money',
305
- 'password',
306
- 'email'
307
- ) && (
308
- <UIInput
309
- {...defaultsInput}
310
- {...defaultsUI}
311
- InputProps={{ ...original.inputProps }}
312
- />
313
- )}
314
- {scope.is('type', 'complete', 'autocomplete') && (
315
- <UIComplete
316
- scope={scope}
317
- defaultsInput={defaultsInput}
318
- defaultsUI={defaultsUI}
319
- />
320
- )}
321
- {scope.is('type', 'checkbox', 'boolean', 'switch') && (
322
- <UISwitch
323
- checked={isChecked()}
324
- {...defaultsInput}
325
- onChange={onCheck}
326
- />
327
- )}
328
- {scope.is('type', 'select') && (
329
- <UISelect
330
- {...defaultsInput}
331
- {...defaultsUI}
332
- value={scope.getSelectedValue()}
333
- >
334
- <UIOption value={''}>Selecione</UIOption>
335
- {options.map((row: any, i: number) => (
336
- <UIOption key={'i' + i} value={row.value}>
337
- {row.label}
338
- </UIOption>
339
- ))}
340
- </UISelect>
341
- )}
342
- {scope.is('type', 'radio') && (
343
- <UIRadio {...defaultsInput} {...defaultsUI} row>
344
- {options.map((row: any, i: number) => (
345
- <UIOption
346
- key={'i' + i}
347
- control={<UIRadio {...defaultsUI} />}
348
- label={row.label}
349
- value={row.value}
350
- />
351
- ))}
352
- </UIRadio>
353
- )}
354
- {scope.is('type', 'custom') && <Custom />}
355
- {scope.is('type', 'column') && (
356
- <>
357
- {scope.is('format', 'img') && (
358
- <Image source={scope.getDisplayValue()} />
359
- )}
360
- {scope.is('format', 'icon') && (
361
- <UIIcon className={scope.getDisplayValue()} />
362
- )}
363
- {!scope.is('format', 'icon', 'img') && (
364
- <Text>{scope.getDisplayValue()}</Text>
365
- )}
366
- </>
367
- )}
368
- {scope.is('type', 'output', 'value') && (
369
- <Text>{scope.getDisplayValue()}</Text>
370
- )}
371
- </View>
372
- {error && <View style={getStyle('error')}>{error}</View>}
373
- </>
374
- )}
375
- <CurrentRouter />
376
- {!scope.is('type', 'tabs', 'grid', 'list', 'define', 'repeat') && (
377
- <UIChildren {...props} scope={scope} crud={crud} />
378
- )}
379
- </>
380
- </View>
381
- </>
382
- );
383
- }
384
-
385
- const elementStyle: any = {};
386
-
387
- elementStyle.card = StyleSheet.create({
388
- root: {
389
- backgroundColor: 'white',
390
- padding: 16,
391
- borderRadius: 10,
392
- width: '100%',
393
- shadowColor: '#888', // iOS
394
- shadowOffset: { width: 0, height: 1 }, // iOS
395
- shadowOpacity: 0.25, // iOS
396
- shadowRadius: 3.84, // iOS
397
- elevation: 3, // Android
398
- },
399
- inner: {
400
- flex: 1,
401
- width: '100%',
402
- paddingBottom: 10,
403
- paddingTop: 5,
404
- alignSelf: 'flex-start',
405
- flexDirection: 'row',
406
- flexWrap: 'wrap',
407
- },
408
- });
409
-
410
- elementStyle.list = {
411
- ...elementStyle.card,
412
- };
413
-
414
- const styles = StyleSheet.create({
415
- root: {
416
- gap: 5,
417
- flexDirection: 'column',
418
- flexWrap: 'wrap',
419
- width: '100%',
420
- alignItems: 'flex-start',
421
- },
422
- label: { width: '100%', fontWeight: 500, fontSize: 12 },
423
- inner: { width: '100%', paddingBottom: 5, paddingTop: 5 },
424
- });
425
-
426
- const withChildStyles = StyleSheet.create({
427
- root: {
428
- gap: 10,
429
- },
430
- label: {
431
- width: '100%',
432
- fontWeight: 500,
433
- fontSize: 24,
434
- },
435
- });
1
+ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
+ import UIChildren from './UIChildren';
3
+ import ElTabs from './tabs/ElTabs';
4
+ import ElChart from './charts/ElChart';
5
+ import UIComplete from './UIComplete';
6
+ import {
7
+ Crud,
8
+ HtmlUtils,
9
+ ScopeUtils,
10
+ Utils,
11
+ ElementType,
12
+ } from 'react-crud-utils';
13
+ import UILink from './core/UILink';
14
+ import UIIcon from './core/UIIcon';
15
+ import UIButton from './core/UIButton';
16
+ import UISelect from './core/UISelect';
17
+ import UISwitch from './core/UISwitch';
18
+ import UIOption from './core/UIOption';
19
+ import UIRadio from './core/UIRadio';
20
+ import UIInput from './core/UIInput';
21
+ import { Image, Linking, StyleSheet, Text, View } from 'react-native';
22
+ import UIList from './core/UIList';
23
+ import UIToggle from './core/UIToggle';
24
+
25
+ export default function UIElement(props: ElementType) {
26
+ let [scope] = useState(ScopeUtils.create(props));
27
+ let [index, setIndex] = useState(0);
28
+ let [error, setError]: string | any = useState(null);
29
+ let options: any = scope.getOptions();
30
+ let crud: Crud = Utils.nvl(props.crud, scope.crud);
31
+ let original = scope.original;
32
+ let type = original.type;
33
+ let ref = useRef(null);
34
+
35
+ scope.update = () => {
36
+ setIndex(++index);
37
+ };
38
+
39
+ let router: any = {
40
+ list: UIList,
41
+ tabs: ElTabs,
42
+ chart: ElChart,
43
+ };
44
+
45
+ let CurrentRouter = () => {
46
+ if (router[type]) {
47
+ let Aux = router[type];
48
+
49
+ return <Aux crud={crud} {...props} scope={scope} />;
50
+ }
51
+ return <></>;
52
+ };
53
+
54
+ const Custom = () => {
55
+ let c: any = original.custom;
56
+
57
+ if (c) {
58
+ if (typeof c === 'string') {
59
+ return (
60
+ <UIElement
61
+ element={{ value: c, type: 'dummy' }}
62
+ crud={crud}
63
+ ></UIElement>
64
+ );
65
+ }
66
+
67
+ return (
68
+ <UIElement
69
+ type={c.type}
70
+ tag={c.type}
71
+ {...c.props}
72
+ crud={crud}
73
+ ></UIElement>
74
+ );
75
+ }
76
+
77
+ return <></>;
78
+ };
79
+
80
+ if (scope.is('type', 'dummy')) {
81
+ return <>{scope.getDisplayValue()}</>;
82
+ }
83
+
84
+ let onCheck = () => {
85
+ let v = scope.getValue();
86
+ let check = !(v === true);
87
+
88
+ onChange({ target: { value: check } });
89
+ };
90
+
91
+ let onChange = (e: any) => {
92
+ let val = e.target.value;
93
+
94
+ if (scope.isType('integer', 'int', 'number')) {
95
+ val = parseInt(val);
96
+ } else if (scope.isType('decimal')) {
97
+ val = parseFloat(val);
98
+ }
99
+
100
+ if (scope.isType('select', 'complete')) {
101
+ val = scope.getSelectedItem(val);
102
+ }
103
+
104
+ scope.changeValue(val);
105
+ scope.update();
106
+ };
107
+
108
+ let onClick = (e: any) => {
109
+ scope.call('click');
110
+ };
111
+
112
+ let defaultsInput: any = {
113
+ scope,
114
+ crud,
115
+ onChange: onChange,
116
+ };
117
+
118
+ if (scope.isType('password')) {
119
+ defaultsInput.type = 'password';
120
+ }
121
+
122
+ let isChecked = () => {
123
+ let v = scope.getValue();
124
+
125
+ return v === true;
126
+ };
127
+
128
+ let hasChildren = () => {
129
+ if (scope.isInput()) {
130
+ return false;
131
+ }
132
+
133
+ return !Utils.isEmpty(props.children) || !Utils.isEmpty(props.elements);
134
+ };
135
+
136
+ const getStyle = (part?: string) => {
137
+ let type = Utils.nvl(original.type, 'none');
138
+ let key = Utils.nvl(part, 'root');
139
+ let def = { ...styles[key], ...elementStyle?.[type]?.[key] };
140
+ let hasChild = hasChildren();
141
+
142
+ if (!part && !hasChild) {
143
+ def = { ...def };
144
+ }
145
+
146
+ if (hasChild && part) {
147
+ def = { ...def, ...withChildStyles[part] };
148
+ }
149
+
150
+ def = { ...def, ...elementStyle?.[type]?.[key] };
151
+
152
+ return { ...def, ...scope.getStyle(part) };
153
+ };
154
+
155
+ let elStyle = getStyle('element');
156
+
157
+ let defaultsUI: any = {
158
+ required: scope.isRequired(),
159
+ size: 'small',
160
+ scope,
161
+ crud,
162
+ style: elStyle,
163
+ placeholder: scope.attr('placeholder', 'Digite aqui'),
164
+ };
165
+
166
+ if (!scope.isRendered() || scope.is('type', 'define')) {
167
+ return <></>;
168
+ }
169
+
170
+ scope.error = (msg: string) => {
171
+ error = msg;
172
+ setError(msg);
173
+ };
174
+
175
+ useEffect(() => {
176
+ if (!scope.ready) {
177
+ scope.ready = true;
178
+
179
+ scope.call('load');
180
+
181
+ if (scope.isType('list', 'repeat')) {
182
+ scope.search();
183
+ } else if (original.list) {
184
+ scope.call('list');
185
+ }
186
+ scope.start();
187
+ }
188
+ });
189
+
190
+ const CustomIcon = () => {
191
+ if (typeof original.icon === 'string') {
192
+ return <UIIcon>{scope.getIcon()}</UIIcon>;
193
+ }
194
+ return <>{original.icon}</>;
195
+ };
196
+
197
+ let hasCustomRoute = () => {
198
+ if (router[type]) return true;
199
+ return false;
200
+ };
201
+
202
+ scope.open = (args: any) => {
203
+ Linking.openURL(args.url);
204
+ };
205
+
206
+ if (scope.isType('dialog')) {
207
+ let name = original.name;
208
+
209
+ if (!crud.dialogs[name]) {
210
+ let dlg: any = { config: { ...original } };
211
+
212
+ dlg.component = (args: any) => {
213
+ return <UIChildren {...props} scope={scope} crud={crud} />;
214
+ };
215
+
216
+ crud.dialogs[name] = dlg;
217
+ }
218
+ return <></>;
219
+ }
220
+
221
+ useLayoutEffect(() => {
222
+ if (ref?.current && scope.is('type', 'card', 'list', 'tabs', 'stepper')) {
223
+ let el: any = ref?.current;
224
+
225
+ if (el?.classList) {
226
+ let bg = HtmlUtils.getBGColor(el);
227
+
228
+ if (bg === 'rgb(255, 255, 255)') {
229
+ el.classList.add('ui-dark');
230
+ } else {
231
+ el.classList.add('ui-light');
232
+ }
233
+ }
234
+ }
235
+ });
236
+
237
+ const isShowLabel = () => {
238
+ if (typeof original.label !== 'undefined' && !scope.isType('button')) {
239
+ return true;
240
+ }
241
+
242
+ return false;
243
+ };
244
+
245
+ const isShowInner = () => {
246
+ if (hasChildren() || hasCustomRoute()) {
247
+ return false;
248
+ }
249
+ return true;
250
+ };
251
+
252
+ return (
253
+ <>
254
+ <View ref={ref} style={getStyle()}>
255
+ <>
256
+ {isShowLabel() && (
257
+ <Text style={getStyle('label')}>{scope.getLabel()}</Text>
258
+ )}
259
+ {isShowInner() && (
260
+ <>
261
+ <View style={getStyle('inner')}>
262
+ {scope.is('type', 'button') && (
263
+ <UIButton
264
+ {...defaultsUI}
265
+ onClick={onClick}
266
+ variant={scope.attr('variant', 'outlined')}
267
+ >
268
+ {original.icon && <CustomIcon />}
269
+ {original.label && (
270
+ <Text style={scope.getPart('label', 'button')}>
271
+ {scope.getLabel()}
272
+ </Text>
273
+ )}
274
+ </UIButton>
275
+ )}
276
+ {scope.is('type', 'icon') && (
277
+ <UIIcon
278
+ {...defaultsUI}
279
+ onClick={onClick}
280
+ variant={scope.attr('variant', 'outlined')}
281
+ >
282
+ {scope.getDisplayValue()}
283
+ </UIIcon>
284
+ )}
285
+ {scope.is('type', 'link') && (
286
+ <UILink
287
+ {...defaultsUI}
288
+ onClick={onClick}
289
+ variant={scope.attr('variant', 'outlined')}
290
+ >
291
+ {original.icon && <CustomIcon />}
292
+ {original.label && (
293
+ <Text style={scope.getPart('label', 'link')}>
294
+ {scope.getLabel()}
295
+ </Text>
296
+ )}
297
+ </UILink>
298
+ )}
299
+ {scope.is(
300
+ 'type',
301
+ 'text',
302
+ 'number',
303
+ 'phone',
304
+ 'postalCode',
305
+ 'money',
306
+ 'password',
307
+ 'email'
308
+ ) && (
309
+ <UIInput
310
+ {...defaultsInput}
311
+ {...defaultsUI}
312
+ InputProps={{ ...original.inputProps }}
313
+ />
314
+ )}
315
+ {scope.is('type', 'complete', 'autocomplete') && (
316
+ <UIComplete
317
+ scope={scope}
318
+ defaultsInput={defaultsInput}
319
+ defaultsUI={defaultsUI}
320
+ />
321
+ )}
322
+ {scope.is('type', 'checkbox', 'boolean', 'switch') && (
323
+ <UISwitch
324
+ checked={isChecked()}
325
+ {...defaultsInput}
326
+ onChange={onCheck}
327
+ />
328
+ )}
329
+ {scope.is('type', 'select') && (
330
+ <UISelect
331
+ {...defaultsInput}
332
+ {...defaultsUI}
333
+ value={scope.getSelectedValue()}
334
+ />
335
+ )}
336
+ {scope.is('type', 'toggle') && (
337
+ <UIToggle
338
+ {...defaultsInput}
339
+ {...defaultsUI}
340
+ value={scope.getSelectedValue()}
341
+ />
342
+ )}
343
+ {scope.is('type', 'radio') && (
344
+ <UIRadio {...defaultsInput} {...defaultsUI} row>
345
+ {options.map((row: any, i: number) => (
346
+ <UIOption
347
+ key={'i' + i}
348
+ control={<UIRadio {...defaultsUI} />}
349
+ label={row.label}
350
+ value={row.value}
351
+ />
352
+ ))}
353
+ </UIRadio>
354
+ )}
355
+ {scope.is('type', 'custom') && <Custom />}
356
+ {scope.is('type', 'column') && (
357
+ <>
358
+ {scope.is('format', 'img') && (
359
+ <Image source={scope.getDisplayValue()} />
360
+ )}
361
+ {scope.is('format', 'icon') && (
362
+ <UIIcon className={scope.getDisplayValue()} />
363
+ )}
364
+ {!scope.is('format', 'icon', 'img') && (
365
+ <Text>{scope.getDisplayValue()}</Text>
366
+ )}
367
+ </>
368
+ )}
369
+ {scope.is('type', 'output', 'value') && (
370
+ <Text>{scope.getDisplayValue()}</Text>
371
+ )}
372
+ </View>
373
+ {error && <View style={getStyle('error')}>{error}</View>}
374
+ </>
375
+ )}
376
+ <CurrentRouter />
377
+ {!scope.is('type', 'tabs', 'grid', 'list', 'define', 'repeat') && (
378
+ <UIChildren {...props} scope={scope} crud={crud} />
379
+ )}
380
+ </>
381
+ </View>
382
+ </>
383
+ );
384
+ }
385
+
386
+ const elementStyle: any = {};
387
+
388
+ elementStyle.card = StyleSheet.create({
389
+ root: {
390
+ backgroundColor: 'white',
391
+ padding: 16,
392
+ borderRadius: 10,
393
+ width: '100%',
394
+ shadowColor: '#888', // iOS
395
+ shadowOffset: { width: 0, height: 1 }, // iOS
396
+ shadowOpacity: 0.25, // iOS
397
+ shadowRadius: 3.84, // iOS
398
+ elevation: 3, // Android
399
+ },
400
+ inner: {
401
+ flex: 1,
402
+ width: '100%',
403
+ paddingBottom: 10,
404
+ paddingTop: 5,
405
+ alignSelf: 'flex-start',
406
+ flexDirection: 'row',
407
+ flexWrap: 'wrap',
408
+ },
409
+ });
410
+
411
+ elementStyle.list = {
412
+ ...elementStyle.card,
413
+ };
414
+
415
+ const styles = StyleSheet.create({
416
+ root: {
417
+ gap: 5,
418
+ flexDirection: 'column',
419
+ flexWrap: 'wrap',
420
+ width: '100%',
421
+ alignItems: 'flex-start',
422
+ },
423
+ label: { width: '100%', fontWeight: 500, fontSize: 12 },
424
+ inner: { width: '100%', paddingBottom: 5, paddingTop: 5 },
425
+ });
426
+
427
+ const withChildStyles = StyleSheet.create({
428
+ root: {
429
+ gap: 10,
430
+ },
431
+ label: {
432
+ width: '100%',
433
+ fontWeight: 500,
434
+ fontSize: 24,
435
+ },
436
+ });