vpt-sebraeds 0.0.26 → 0.0.27
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.
|
@@ -263,6 +263,8 @@ const Dropdown = ({
|
|
|
263
263
|
)
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
+
const hasCheckboxes = options.some(item => item.isCheckbox);
|
|
267
|
+
|
|
266
268
|
return (
|
|
267
269
|
<View style={styles.wrapper}>
|
|
268
270
|
<Modal
|
|
@@ -271,46 +273,50 @@ const Dropdown = ({
|
|
|
271
273
|
animationType="fade"
|
|
272
274
|
onRequestClose={() => setIsOpen(false)}
|
|
273
275
|
>
|
|
274
|
-
<
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
<View style={styles.overlay}>
|
|
277
|
+
{/* Área clicável separada para fechar o modal */}
|
|
278
|
+
<TouchableOpacity
|
|
279
|
+
style={styles.overlayTouchable}
|
|
280
|
+
activeOpacity={1}
|
|
281
|
+
onPress={() => setIsOpen(false)}
|
|
282
|
+
/>
|
|
283
|
+
|
|
284
|
+
{/* Conteúdo do modal - não propaga toque para o overlay */}
|
|
279
285
|
<View style={styles.modalContainer}>
|
|
280
|
-
<View style={styles.
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
</View>
|
|
286
|
+
<View style={styles.modalHeader}>
|
|
287
|
+
<TouchableOpacity
|
|
288
|
+
onPress={() => setIsOpen(false)}
|
|
289
|
+
style={styles.closeButton}
|
|
290
|
+
>
|
|
291
|
+
<Icon name="subtract-line" size={26} color="#687499" />
|
|
292
|
+
</TouchableOpacity>
|
|
293
|
+
<Text style={styles.modalTitle}>{title || "Título"}</Text>
|
|
294
|
+
</View>
|
|
290
295
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
<ScrollView
|
|
297
|
+
style={styles.optionsList}
|
|
298
|
+
contentContainerStyle={{ paddingBottom: 8 }}
|
|
299
|
+
showsVerticalScrollIndicator={false}
|
|
300
|
+
bounces={false}
|
|
301
|
+
>
|
|
302
|
+
{options.map((item, index) => (
|
|
303
|
+
<RenderItem key={index.toString()} item={item} index={index} />
|
|
304
|
+
))}
|
|
305
|
+
</ScrollView>
|
|
299
306
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
</View>
|
|
307
|
+
{confirmButtonLabel && onConfirm && (
|
|
308
|
+
<View style={styles.buttonContainer}>
|
|
309
|
+
<Button
|
|
310
|
+
label={confirmButtonLabel}
|
|
311
|
+
onPress={onConfirm}
|
|
312
|
+
size="large"
|
|
313
|
+
variant="filled"
|
|
314
|
+
expand
|
|
315
|
+
/>
|
|
316
|
+
</View>
|
|
317
|
+
)}
|
|
312
318
|
</View>
|
|
313
|
-
</
|
|
319
|
+
</View>
|
|
314
320
|
</Modal>
|
|
315
321
|
</View>
|
|
316
322
|
);
|
|
@@ -338,20 +344,22 @@ const styles = StyleSheet.create({
|
|
|
338
344
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
339
345
|
justifyContent: 'flex-end',
|
|
340
346
|
},
|
|
347
|
+
overlayTouchable: {
|
|
348
|
+
flex: 1,
|
|
349
|
+
},
|
|
341
350
|
modalContainer: {
|
|
342
351
|
backgroundColor: 'white',
|
|
343
352
|
borderTopLeftRadius: 20,
|
|
344
353
|
borderTopRightRadius: 20,
|
|
345
|
-
maxHeight: screenHeight * 0.
|
|
354
|
+
maxHeight: screenHeight * 0.7,
|
|
346
355
|
paddingBottom: 34, // Safe area para iPhone
|
|
347
356
|
},
|
|
348
357
|
modalHeader: {
|
|
349
358
|
alignItems: 'center',
|
|
350
359
|
justifyContent: 'space-between',
|
|
351
360
|
paddingHorizontal: 20,
|
|
361
|
+
paddingTop: 8,
|
|
352
362
|
paddingBottom: 16,
|
|
353
|
-
// borderBottomWidth: 1,
|
|
354
|
-
// borderBottomColor: '#F0F0F0',
|
|
355
363
|
},
|
|
356
364
|
modalTitle: {
|
|
357
365
|
fontSize: 18,
|
|
@@ -362,13 +370,9 @@ const styles = StyleSheet.create({
|
|
|
362
370
|
closeButton: {
|
|
363
371
|
margin: -4,
|
|
364
372
|
},
|
|
365
|
-
dropdownList: {
|
|
366
|
-
backgroundColor: 'white',
|
|
367
|
-
borderTopLeftRadius: 20,
|
|
368
|
-
borderTopRightRadius: 20,
|
|
369
|
-
},
|
|
370
373
|
optionsList: {
|
|
371
374
|
paddingHorizontal: 20,
|
|
375
|
+
flexGrow: 0,
|
|
372
376
|
},
|
|
373
377
|
optionItem: {
|
|
374
378
|
paddingVertical: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/index.jsx"],"names":[],"mappings":"AA+FO,yDA6DN;;kBA3JkD,OAAO;AA+J1D;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/index.jsx"],"names":[],"mappings":"AA+FO,yDA6DN;;kBA3JkD,OAAO;AA+J1D;;;;;;;;;;sBAkKC"}
|
|
@@ -198,26 +198,31 @@ const Dropdown = ({ title, onSelect, options = [], withSeparator = false, isOpen
|
|
|
198
198
|
const [isChecked, setIsChecked] = useState(false);
|
|
199
199
|
return item.isCheckbox ? (<Checkbox checked={isChecked} onChange={() => setIsChecked(curr => !curr)} label={item.label || item} variant="check-line"/>) : (<RippleItem item={item} index={index} onPress={handleSelect}/>);
|
|
200
200
|
};
|
|
201
|
+
const hasCheckboxes = options.some(item => item.isCheckbox);
|
|
201
202
|
return (<View style={styles.wrapper}>
|
|
202
203
|
<Modal visible={isOpen} transparent={true} animationType="fade" onRequestClose={() => setIsOpen(false)}>
|
|
203
|
-
<
|
|
204
|
+
<View style={styles.overlay}>
|
|
205
|
+
{/* Área clicável separada para fechar o modal */}
|
|
206
|
+
<TouchableOpacity style={styles.overlayTouchable} activeOpacity={1} onPress={() => setIsOpen(false)}/>
|
|
207
|
+
|
|
208
|
+
{/* Conteúdo do modal - não propaga toque para o overlay */}
|
|
204
209
|
<View style={styles.modalContainer}>
|
|
205
|
-
<View style={styles.
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
</View>
|
|
210
|
+
<View style={styles.modalHeader}>
|
|
211
|
+
<TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton}>
|
|
212
|
+
<Icon name="subtract-line" size={26} color="#687499"/>
|
|
213
|
+
</TouchableOpacity>
|
|
214
|
+
<Text style={styles.modalTitle}>{title || "Título"}</Text>
|
|
215
|
+
</View>
|
|
212
216
|
|
|
213
|
-
|
|
217
|
+
<ScrollView style={styles.optionsList} contentContainerStyle={{ paddingBottom: 8 }} showsVerticalScrollIndicator={false} bounces={false}>
|
|
218
|
+
{options.map((item, index) => (<RenderItem key={index.toString()} item={item} index={index}/>))}
|
|
219
|
+
</ScrollView>
|
|
214
220
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</View>
|
|
221
|
+
{confirmButtonLabel && onConfirm && (<View style={styles.buttonContainer}>
|
|
222
|
+
<Button label={confirmButtonLabel} onPress={onConfirm} size="large" variant="filled" expand/>
|
|
223
|
+
</View>)}
|
|
219
224
|
</View>
|
|
220
|
-
</
|
|
225
|
+
</View>
|
|
221
226
|
</Modal>
|
|
222
227
|
</View>);
|
|
223
228
|
};
|
|
@@ -243,20 +248,22 @@ const styles = StyleSheet.create({
|
|
|
243
248
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
244
249
|
justifyContent: 'flex-end',
|
|
245
250
|
},
|
|
251
|
+
overlayTouchable: {
|
|
252
|
+
flex: 1,
|
|
253
|
+
},
|
|
246
254
|
modalContainer: {
|
|
247
255
|
backgroundColor: 'white',
|
|
248
256
|
borderTopLeftRadius: 20,
|
|
249
257
|
borderTopRightRadius: 20,
|
|
250
|
-
maxHeight: screenHeight * 0.
|
|
258
|
+
maxHeight: screenHeight * 0.7,
|
|
251
259
|
paddingBottom: 34, // Safe area para iPhone
|
|
252
260
|
},
|
|
253
261
|
modalHeader: {
|
|
254
262
|
alignItems: 'center',
|
|
255
263
|
justifyContent: 'space-between',
|
|
256
264
|
paddingHorizontal: 20,
|
|
265
|
+
paddingTop: 8,
|
|
257
266
|
paddingBottom: 16,
|
|
258
|
-
// borderBottomWidth: 1,
|
|
259
|
-
// borderBottomColor: '#F0F0F0',
|
|
260
267
|
},
|
|
261
268
|
modalTitle: {
|
|
262
269
|
fontSize: 18,
|
|
@@ -267,13 +274,9 @@ const styles = StyleSheet.create({
|
|
|
267
274
|
closeButton: {
|
|
268
275
|
margin: -4,
|
|
269
276
|
},
|
|
270
|
-
dropdownList: {
|
|
271
|
-
backgroundColor: 'white',
|
|
272
|
-
borderTopLeftRadius: 20,
|
|
273
|
-
borderTopRightRadius: 20,
|
|
274
|
-
},
|
|
275
277
|
optionsList: {
|
|
276
278
|
paddingHorizontal: 20,
|
|
279
|
+
flexGrow: 0,
|
|
277
280
|
},
|
|
278
281
|
optionItem: {
|
|
279
282
|
paddingVertical: 16,
|