react-native-boxes 1.4.58 → 1.4.59
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/package.json +1 -1
- package/src/Modal.tsx +24 -19
package/package.json
CHANGED
package/src/Modal.tsx
CHANGED
|
@@ -132,7 +132,7 @@ export const BottomSheet = (props: BottomSheetProps) => {
|
|
|
132
132
|
<Subtitle style={{
|
|
133
133
|
fontFamily: theme.fonts.Bold
|
|
134
134
|
}}>{props.title.toString()}</Subtitle>
|
|
135
|
-
) :
|
|
135
|
+
) : (props.title as any)
|
|
136
136
|
}
|
|
137
137
|
{
|
|
138
138
|
cancellable ? (<TouchableOpacity
|
|
@@ -152,7 +152,7 @@ export const BottomSheet = (props: BottomSheetProps) => {
|
|
|
152
152
|
width: '100%'
|
|
153
153
|
}}>
|
|
154
154
|
{
|
|
155
|
-
props.swipeToCloseDisabled ? (
|
|
155
|
+
props.swipeToCloseDisabled && isWeb() ? (
|
|
156
156
|
<ScrollView
|
|
157
157
|
nestedScrollEnabled={true}
|
|
158
158
|
showsVerticalScrollIndicator={false}
|
|
@@ -383,6 +383,7 @@ export type DropDownViewProps = {
|
|
|
383
383
|
initialVisile?: Boolean,
|
|
384
384
|
title?: string,
|
|
385
385
|
displayType?: 'button' | 'input',
|
|
386
|
+
onRenderList?: (opt: DropDownViewOption[]) => any,
|
|
386
387
|
onRenderOption?: (opt: DropDownViewOption, setSelected: (selectedId: string, opt: DropDownViewOption) => void) => any,
|
|
387
388
|
onEmptyListPlaceholder?: (dismiss?: () => void) => React.ReactNode
|
|
388
389
|
forceDialogSelectOnWeb?: Boolean
|
|
@@ -552,24 +553,28 @@ export const DropDownView = (props: DropDownViewProps) => {
|
|
|
552
553
|
:
|
|
553
554
|
(
|
|
554
555
|
|
|
555
|
-
props.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
556
|
+
props.onRenderList ?
|
|
557
|
+
props.onRenderList(props.options) :
|
|
558
|
+
(
|
|
559
|
+
props.options.map((opt, idx) => {
|
|
560
|
+
if (props.onRenderOption) {
|
|
561
|
+
return props.onRenderOption(opt, onSelect)
|
|
562
|
+
}
|
|
563
|
+
return (
|
|
564
|
+
<TertiaryButtonView
|
|
565
|
+
onPress={() => {
|
|
566
|
+
setVisible(false)
|
|
567
|
+
props.onSelect(opt.id, opt)
|
|
568
|
+
}}
|
|
569
|
+
style={{
|
|
570
|
+
padding: 0,
|
|
571
|
+
paddingBottom: idx == props.options.length - 1 ? theme.dimens.space.md : 0,
|
|
572
|
+
paddingTop: idx == 0 ? theme.dimens.space.md : 0,
|
|
573
|
+
}}
|
|
574
|
+
key={opt.id} >{opt.title || opt.value}</TertiaryButtonView>
|
|
575
|
+
)
|
|
576
|
+
})
|
|
571
577
|
)
|
|
572
|
-
})
|
|
573
578
|
)
|
|
574
579
|
|
|
575
580
|
}
|