react-native-ui-lib 7.43.0-snapshot.7149 → 7.43.0-snapshot.7157
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 +2 -2
- package/panningViews.d.ts +2 -0
- package/panningViews.js +1 -0
- package/src/commons/Constants.d.ts +1 -0
- package/src/commons/Constants.js +8 -4
- package/src/components/actionSheet/index.d.ts +12 -2
- package/src/components/actionSheet/index.js +42 -3
- package/src/components/chip/index.js +37 -14
- package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
- package/src/components/colorPicker/ColorPickerDialog.js +1 -1
- package/src/components/dateTimePicker/index.d.ts +5 -186
- package/src/components/dateTimePicker/index.js +2 -1
- package/src/components/dialog/DialogDismissibleView.d.ts +34 -0
- package/src/components/dialog/DialogDismissibleView.js +184 -0
- package/src/components/dialog/OverlayFadingBackground.d.ts +14 -0
- package/src/components/dialog/OverlayFadingBackground.js +45 -0
- package/src/components/dialog/dialog.api.json +37 -31
- package/src/components/dialog/index.d.ts +105 -13
- package/src/components/dialog/index.js +212 -204
- package/src/components/expandableSection/index.js +3 -2
- package/src/components/index.js +15 -0
- package/src/components/panningViews/asPanViewConsumer.d.ts +3 -0
- package/src/components/panningViews/asPanViewConsumer.js +16 -0
- package/src/components/panningViews/panDismissibleView.d.ts +51 -0
- package/src/components/panningViews/panDismissibleView.js +350 -0
- package/src/components/panningViews/panGestureView.d.ts +23 -0
- package/src/components/panningViews/panGestureView.js +156 -0
- package/src/components/panningViews/panListenerView.d.ts +66 -0
- package/src/components/panningViews/panListenerView.js +155 -0
- package/src/components/panningViews/panResponderView.d.ts +19 -0
- package/src/components/panningViews/panResponderView.js +79 -0
- package/src/components/panningViews/panningContext.d.ts +3 -0
- package/src/components/panningViews/panningContext.js +4 -0
- package/src/components/panningViews/panningProvider.d.ts +73 -0
- package/src/components/panningViews/panningProvider.js +101 -0
- package/src/components/picker/Picker.driver.new.js +1 -1
- package/src/components/picker/PickerItem.js +20 -6
- package/src/components/picker/PickerPresenter.d.ts +1 -0
- package/src/components/picker/PickerPresenter.js +23 -1
- package/src/components/picker/api/picker.api.json +1 -0
- package/src/components/picker/api/pickerItem.api.json +5 -0
- package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
- package/src/components/picker/helpers/usePickerLabel.js +3 -2
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
- package/src/components/picker/helpers/usePickerMigrationWarnings.js +12 -0
- package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSearch.js +8 -4
- package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSelection.js +10 -2
- package/src/components/picker/index.js +22 -4
- package/src/components/picker/types.d.ts +24 -1
- package/src/incubator/dialog/dialog.api.json +54 -0
- package/src/{components → incubator}/dialog/dialogHeader.api.json +2 -2
- package/src/incubator/dialog/index.d.ts +15 -0
- package/src/incubator/dialog/index.js +218 -0
- package/src/{components → incubator}/dialog/types.d.ts +19 -0
- package/src/{components → incubator}/dialog/types.js +3 -1
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
- package/src/incubator/expandableOverlay/index.d.ts +3 -42
- package/src/incubator/expandableOverlay/index.js +4 -1
- package/src/{hooks/useHiddenLocation/index.d.ts → incubator/hooks/useHiddenLocation.d.ts} +1 -1
- package/src/{hooks/useHiddenLocation/index.web.d.ts → incubator/hooks/useHiddenLocation.web.d.ts} +1 -1
- package/src/incubator/index.d.ts +2 -0
- package/src/incubator/index.js +2 -0
- package/src/{components → incubator}/panView/index.d.ts +3 -3
- package/src/{components → incubator}/panView/index.js +4 -4
- package/src/{components → incubator}/panView/usePanGesture.d.ts +1 -1
- package/src/incubator/toast/index.js +1 -1
- package/src/index.d.ts +9 -3
- package/src/index.js +146 -41
- package/src/testkit/index.d.ts +1 -1
- package/src/testkit/index.js +1 -1
- package/panView.d.ts +0 -2
- package/panView.js +0 -1
- /package/src/{components → incubator}/dialog/Dialog.driver.new.d.ts +0 -0
- /package/src/{components → incubator}/dialog/Dialog.driver.new.js +0 -0
- /package/src/{components → incubator}/dialog/DialogHeader.d.ts +0 -0
- /package/src/{components → incubator}/dialog/DialogHeader.js +0 -0
- /package/src/{components → incubator}/dialog/useDialogContent.d.ts +0 -0
- /package/src/{components → incubator}/dialog/useDialogContent.js +0 -0
- /package/src/{hooks/useHiddenLocation/index.js → incubator/hooks/useHiddenLocation.js} +0 -0
- /package/src/{hooks/useHiddenLocation/index.web.js → incubator/hooks/useHiddenLocation.web.js} +0 -0
- /package/src/{components → incubator}/panView/panningUtil.d.ts +0 -0
- /package/src/{components → incubator}/panView/panningUtil.js +0 -0
- /package/src/{components → incubator}/panView/usePanGesture.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ui-lib",
|
|
3
|
-
"version": "7.43.0-snapshot.
|
|
3
|
+
"version": "7.43.0-snapshot.7157",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
|
|
67
67
|
"@babel/preset-env": "^7.20.0",
|
|
68
68
|
"@babel/preset-react": "^7.10.1",
|
|
69
|
-
"@babel/runtime": "^7.
|
|
69
|
+
"@babel/runtime": "^7.26.10",
|
|
70
70
|
"@formatjs/intl-datetimeformat": "^6.0.3",
|
|
71
71
|
"@formatjs/intl-getcanonicallocales": "^2.0.2",
|
|
72
72
|
"@formatjs/intl-locale": "^3.0.3",
|
package/panningViews.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/components/panningViews').default;
|
|
@@ -43,6 +43,7 @@ declare const constants: {
|
|
|
43
43
|
addDimensionsEventListener: (callback: any) => import("react-native").EmitterSubscription;
|
|
44
44
|
removeDimensionsEventListener: (callback: any) => void;
|
|
45
45
|
readonly accessibility: {
|
|
46
|
+
isReduceMotionEnabled: boolean;
|
|
46
47
|
isScreenReaderEnabled: boolean;
|
|
47
48
|
};
|
|
48
49
|
backspaceKey: string;
|
package/src/commons/Constants.js
CHANGED
|
@@ -44,16 +44,20 @@ export function updateConstants(dimensions) {
|
|
|
44
44
|
setStatusBarHeight();
|
|
45
45
|
}
|
|
46
46
|
const accessibility = {
|
|
47
|
+
isReduceMotionEnabled: false,
|
|
47
48
|
isScreenReaderEnabled: false
|
|
48
49
|
};
|
|
50
|
+
function handleReduceMotionChanged(isReduceMotionEnabled) {
|
|
51
|
+
accessibility.isReduceMotionEnabled = isReduceMotionEnabled;
|
|
52
|
+
}
|
|
49
53
|
function handleScreenReaderChanged(isScreenReaderEnabled) {
|
|
50
54
|
accessibility.isScreenReaderEnabled = isScreenReaderEnabled;
|
|
51
55
|
}
|
|
56
|
+
AccessibilityInfo.addEventListener('reduceMotionChanged', handleReduceMotionChanged);
|
|
52
57
|
AccessibilityInfo.addEventListener('screenReaderChanged', handleScreenReaderChanged);
|
|
53
|
-
function setAccessibility() {
|
|
54
|
-
AccessibilityInfo.
|
|
55
|
-
|
|
56
|
-
});
|
|
58
|
+
async function setAccessibility() {
|
|
59
|
+
accessibility.isReduceMotionEnabled = await AccessibilityInfo.isReduceMotionEnabled();
|
|
60
|
+
accessibility.isScreenReaderEnabled = await AccessibilityInfo.isScreenReaderEnabled();
|
|
57
61
|
}
|
|
58
62
|
setAccessibility();
|
|
59
63
|
const constants = {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { DialogProps } from '../dialog';
|
|
3
4
|
import { ButtonProps } from '../button';
|
|
4
|
-
import {
|
|
5
|
+
import { DialogProps as IncubatorDialogProps } from '../../incubator';
|
|
5
6
|
type ActionSheetOnOptionPress = (index: number) => void;
|
|
6
7
|
type ActionSheetProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Migrate to the Incubator.Dialog component
|
|
10
|
+
*/
|
|
11
|
+
migrateDialog?: boolean;
|
|
7
12
|
/**
|
|
8
13
|
* Whether to show the action sheet or not
|
|
9
14
|
*/
|
|
@@ -63,6 +68,11 @@ type ActionSheetProps = {
|
|
|
63
68
|
* Note: you will need to call onOptionPress so the option's onPress will be called
|
|
64
69
|
*/
|
|
65
70
|
renderAction?: (option: ButtonProps, index: number, onOptionPress: ActionSheetOnOptionPress) => JSX.Element;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated
|
|
73
|
+
* Called once the modal has been dismissed completely
|
|
74
|
+
*/
|
|
75
|
+
onModalDismissed?: DialogProps['onDialogDismissed'];
|
|
66
76
|
/**
|
|
67
77
|
* Whether or not to handle SafeArea
|
|
68
78
|
*/
|
|
@@ -70,7 +80,7 @@ type ActionSheetProps = {
|
|
|
70
80
|
/**
|
|
71
81
|
* Additional props to send to the Dialog
|
|
72
82
|
*/
|
|
73
|
-
dialogProps?: Omit<DialogProps, 'useSafeArea' | 'testID' | 'containerStyle' | 'visible' | 'onDismiss' | 'onDialogDismissed'> |
|
|
83
|
+
dialogProps?: Omit<DialogProps, 'useSafeArea' | 'testID' | 'containerStyle' | 'visible' | 'onDismiss' | 'onDialogDismissed'> | IncubatorDialogProps;
|
|
74
84
|
/**
|
|
75
85
|
* testID for e2e tests
|
|
76
86
|
*/
|
|
@@ -6,12 +6,15 @@ import React, { Component } from 'react';
|
|
|
6
6
|
import { ActionSheetIOS, StyleSheet } from 'react-native';
|
|
7
7
|
import { Colors } from "../../style";
|
|
8
8
|
import { asBaseComponent, Constants } from "../../commons/new";
|
|
9
|
+
import Dialog from "../dialog";
|
|
9
10
|
import View from "../view";
|
|
10
11
|
import Text from "../text";
|
|
11
12
|
import Image from "../image";
|
|
12
13
|
//@ts-ignore
|
|
13
14
|
import ListItem from "../listItem";
|
|
14
|
-
import
|
|
15
|
+
import PanningProvider from "../panningViews/panningProvider";
|
|
16
|
+
import { Dialog as IncubatorDialog } from "../../incubator";
|
|
17
|
+
import { LogService } from "../../services";
|
|
15
18
|
const VERTICAL_PADDING = 8;
|
|
16
19
|
/**
|
|
17
20
|
* @description: Cross platform Action Sheet, with a support for native iOS solution
|
|
@@ -127,19 +130,55 @@ class ActionSheet extends Component {
|
|
|
127
130
|
{this.renderActions()}
|
|
128
131
|
</View>;
|
|
129
132
|
}
|
|
130
|
-
|
|
133
|
+
renderOldDialog() {
|
|
131
134
|
const {
|
|
135
|
+
useNativeIOS,
|
|
132
136
|
visible,
|
|
133
137
|
onDismiss,
|
|
134
138
|
dialogStyle,
|
|
139
|
+
onModalDismissed,
|
|
135
140
|
testID,
|
|
136
141
|
useSafeArea,
|
|
137
142
|
dialogProps
|
|
138
143
|
} = this.props;
|
|
139
|
-
|
|
144
|
+
if (Constants.isIOS && useNativeIOS) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return <Dialog bottom centerH width="100%" panDirection={PanningProvider.Directions.DOWN} {...dialogProps} useSafeArea={useSafeArea} testID={testID} containerStyle={[styles.dialog, dialogStyle]} visible={visible} onDismiss={onDismiss} onDialogDismissed={onModalDismissed}>
|
|
140
148
|
{this.renderSheet()}
|
|
141
149
|
</Dialog>;
|
|
142
150
|
}
|
|
151
|
+
renderNewDialog() {
|
|
152
|
+
const {
|
|
153
|
+
visible,
|
|
154
|
+
onDismiss,
|
|
155
|
+
dialogStyle,
|
|
156
|
+
onModalDismissed,
|
|
157
|
+
testID,
|
|
158
|
+
useSafeArea,
|
|
159
|
+
dialogProps
|
|
160
|
+
} = this.props;
|
|
161
|
+
if (onModalDismissed) {
|
|
162
|
+
LogService.deprecationWarn({
|
|
163
|
+
component: 'ActionSheet',
|
|
164
|
+
oldProp: 'onModalDismissed',
|
|
165
|
+
newProp: 'onDismiss'
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return <IncubatorDialog bottom centerH width="100%" direction={PanningProvider.Directions.DOWN} {...dialogProps} useSafeArea={useSafeArea} testID={testID} containerStyle={[styles.incubatorDialog, dialogStyle]} visible={visible} onDismiss={onDismiss}>
|
|
169
|
+
{this.renderSheet()}
|
|
170
|
+
</IncubatorDialog>;
|
|
171
|
+
}
|
|
172
|
+
render() {
|
|
173
|
+
const {
|
|
174
|
+
migrateDialog
|
|
175
|
+
} = this.props;
|
|
176
|
+
if (migrateDialog) {
|
|
177
|
+
return this.renderNewDialog();
|
|
178
|
+
} else {
|
|
179
|
+
return this.renderOldDialog();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
143
182
|
}
|
|
144
183
|
export default asBaseComponent(ActionSheet);
|
|
145
184
|
const styles = StyleSheet.create({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
2
|
import { StyleSheet } from 'react-native';
|
|
4
3
|
import Assets from "../../assets";
|
|
5
4
|
import { asBaseComponent } from "../../commons/new";
|
|
@@ -57,8 +56,8 @@ const Chip = ({
|
|
|
57
56
|
}, [badgeProps]);
|
|
58
57
|
const renderOnDismiss = useCallback(() => {
|
|
59
58
|
return <TouchableOpacity style={[getMargins('dismiss'), dismissContainerStyle]} onPress={onDismiss} hitSlop={{
|
|
60
|
-
top:
|
|
61
|
-
bottom:
|
|
59
|
+
top: 16,
|
|
60
|
+
bottom: 16,
|
|
62
61
|
left: 10,
|
|
63
62
|
right: 10
|
|
64
63
|
}} testID={`${testID}.dismiss`}>
|
|
@@ -138,23 +137,47 @@ const Chip = ({
|
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
}, [avatarProps, badgeProps, iconSource, rightIconSource, onDismiss]);
|
|
141
|
-
const
|
|
142
|
-
const width =
|
|
143
|
-
const height =
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
} : {
|
|
148
|
-
[width]: size,
|
|
149
|
-
[height]: size
|
|
140
|
+
const chipSize = useMemo(() => {
|
|
141
|
+
const width = typeof size === 'object' ? size.width : size;
|
|
142
|
+
const height = typeof size === 'object' ? size.height : size;
|
|
143
|
+
return {
|
|
144
|
+
width,
|
|
145
|
+
height
|
|
150
146
|
};
|
|
151
147
|
}, [size]);
|
|
148
|
+
const containerSizeStyle = useMemo(() => {
|
|
149
|
+
const {
|
|
150
|
+
width,
|
|
151
|
+
height
|
|
152
|
+
} = chipSize;
|
|
153
|
+
return useSizeAsMinimum ? {
|
|
154
|
+
minWidth: width,
|
|
155
|
+
minHeight: height
|
|
156
|
+
} : {
|
|
157
|
+
width,
|
|
158
|
+
height
|
|
159
|
+
};
|
|
160
|
+
}, [chipSize]);
|
|
152
161
|
const Container = onPress ? TouchableOpacity : View;
|
|
162
|
+
const hitSlop = useMemo(() => {
|
|
163
|
+
const {
|
|
164
|
+
width = 48,
|
|
165
|
+
height = 48
|
|
166
|
+
} = chipSize;
|
|
167
|
+
const verticalHitSlop = Math.max(0, (48 - height) / 2);
|
|
168
|
+
const horizontalHitSlop = Math.max(0, (48 - width) / 2);
|
|
169
|
+
return {
|
|
170
|
+
top: verticalHitSlop,
|
|
171
|
+
bottom: verticalHitSlop,
|
|
172
|
+
left: horizontalHitSlop,
|
|
173
|
+
right: horizontalHitSlop
|
|
174
|
+
};
|
|
175
|
+
}, [chipSize]);
|
|
153
176
|
return <Container activeOpacity={1} onPress={onPress} style={[styles.container, {
|
|
154
177
|
backgroundColor
|
|
155
178
|
}, {
|
|
156
179
|
borderRadius
|
|
157
|
-
}, containerStyle,
|
|
180
|
+
}, containerStyle, containerSizeStyle]} testID={testID} hitSlop={hitSlop} {...others}>
|
|
158
181
|
{avatarProps && renderAvatar()}
|
|
159
182
|
{iconSource && renderIcon('left')}
|
|
160
183
|
{leftElement}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { DialogProps } from '
|
|
3
|
+
import { DialogProps } from '../../incubator/dialog';
|
|
4
4
|
export interface ColorPickerDialogProps extends DialogProps {
|
|
5
5
|
/**
|
|
6
6
|
* The initial color to pass the picker dialog
|
|
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { LayoutAnimation, StyleSheet, Keyboard } from 'react-native';
|
|
4
4
|
import { Constants, asBaseComponent } from "../../commons/new";
|
|
5
5
|
import { Colors } from "../../style";
|
|
6
|
-
import Dialog from "
|
|
6
|
+
import Dialog from "../../incubator/dialog";
|
|
7
7
|
import { getColorValue, getValidColorString, getTextColor, BORDER_RADIUS } from "./ColorPickerPresenter";
|
|
8
8
|
import ColorPickerDialogHeader from "./ColorPickerDialogHeader";
|
|
9
9
|
import ColorPickerPreview from "./ColorPickerPreview";
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { BaseComponentInjectedProps } from '../../commons/new';
|
|
4
4
|
import { TextFieldProps } from '../textField';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DialogMigrationProps } from '../../incubator/dialog';
|
|
6
6
|
import { ButtonProps } from '../button';
|
|
7
7
|
import { OldApiProps } from './useOldApi';
|
|
8
8
|
export type DateTimePickerMode = 'date' | 'time';
|
|
9
|
-
export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & {
|
|
9
|
+
export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & DialogMigrationProps & {
|
|
10
10
|
/**
|
|
11
11
|
* The type of picker to display ('date' or 'time')
|
|
12
12
|
*/
|
|
@@ -15,10 +15,6 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
15
15
|
* The initial value to set the picker to. Defaults to device's date / time
|
|
16
16
|
*/
|
|
17
17
|
value?: Date;
|
|
18
|
-
/**
|
|
19
|
-
* The props to pass to the dialog expandable container
|
|
20
|
-
*/
|
|
21
|
-
dialogProps?: DialogProps;
|
|
22
18
|
/**
|
|
23
19
|
* The onChange callback
|
|
24
20
|
*/
|
|
@@ -96,6 +92,7 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
96
92
|
*/
|
|
97
93
|
cancelButtonProps?: ButtonProps;
|
|
98
94
|
};
|
|
95
|
+
type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedProps;
|
|
99
96
|
/**
|
|
100
97
|
* @description: Date and Time Picker Component that wraps RNDateTimePicker for date and time modes.
|
|
101
98
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DateTimePickerScreen.tsx
|
|
@@ -104,185 +101,7 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
104
101
|
* @extendsLink: https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker
|
|
105
102
|
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_iOS.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_Android.gif?raw=true
|
|
106
103
|
*/
|
|
107
|
-
declare const DateTimePicker: React.ForwardRefExoticComponent<
|
|
108
|
-
/**
|
|
109
|
-
* The type of picker to display ('date' or 'time')
|
|
110
|
-
*/
|
|
111
|
-
mode?: DateTimePickerMode | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* The initial value to set the picker to. Defaults to device's date / time
|
|
114
|
-
*/
|
|
115
|
-
value?: Date | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* The props to pass to the dialog expandable container
|
|
118
|
-
*/
|
|
119
|
-
dialogProps?: DialogProps | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* The onChange callback
|
|
122
|
-
*/
|
|
123
|
-
onChange?: ((date: Date) => void) | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* Should this input be editable or disabled
|
|
126
|
-
*/
|
|
127
|
-
editable?: boolean | undefined;
|
|
128
|
-
/**
|
|
129
|
-
* The minimum date or time value to use
|
|
130
|
-
*/
|
|
131
|
-
minimumDate?: Date | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* The maximum date or time value to use
|
|
134
|
-
*/
|
|
135
|
-
maximumDate?: Date | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* A callback function to format the time or date
|
|
138
|
-
* @param mode the type of the picker ('date' or 'time')
|
|
139
|
-
* @returns the formatted string to display
|
|
140
|
-
*/
|
|
141
|
-
dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
|
|
142
|
-
/**
|
|
143
|
-
* Allows changing of the locale of the component (iOS only)
|
|
144
|
-
*/
|
|
145
|
-
locale?: string | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* Allows changing of the time picker to a 24 hour format (Android only)
|
|
148
|
-
*/
|
|
149
|
-
is24Hour?: boolean | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
|
|
152
|
-
*/
|
|
153
|
-
minuteInterval?: number | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
|
|
156
|
-
*/
|
|
157
|
-
timeZoneOffsetInMinutes?: number | undefined;
|
|
158
|
-
/**
|
|
159
|
-
* style to apply to the iOS dialog header
|
|
160
|
-
*/
|
|
161
|
-
headerStyle?: StyleProp<ViewStyle>;
|
|
162
|
-
/**
|
|
163
|
-
* Render custom input
|
|
164
|
-
*/
|
|
165
|
-
renderInput?: ((props: Omit<DateTimePickerProps, 'value'> & {
|
|
166
|
-
value?: string;
|
|
167
|
-
}) => React.ReactElement) | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* Override system theme variant (dark or light mode) used by the date picker.
|
|
170
|
-
*/
|
|
171
|
-
themeVariant?: "light" | "dark" | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* The component testID
|
|
174
|
-
*/
|
|
175
|
-
testID?: string | undefined;
|
|
176
|
-
/**
|
|
177
|
-
* Allows changing the visual display of the picker
|
|
178
|
-
*/
|
|
179
|
-
display?: string | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Text color of the wheel picker items
|
|
182
|
-
*/
|
|
183
|
-
textColor?: string | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* Background color of the wheel picker
|
|
186
|
-
*/
|
|
187
|
-
backgroundColor?: string | undefined;
|
|
188
|
-
/**
|
|
189
|
-
* Confirm button props
|
|
190
|
-
*/
|
|
191
|
-
confirmButtonProps?: ButtonProps | undefined;
|
|
192
|
-
/**
|
|
193
|
-
* Cancel button props
|
|
194
|
-
*/
|
|
195
|
-
cancelButtonProps?: ButtonProps | undefined;
|
|
196
|
-
} & BaseComponentInjectedProps & React.RefAttributes<any>>;
|
|
104
|
+
declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerPropsInternal & React.RefAttributes<any>>;
|
|
197
105
|
export { DateTimePicker };
|
|
198
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
199
|
-
/**
|
|
200
|
-
* The type of picker to display ('date' or 'time')
|
|
201
|
-
*/
|
|
202
|
-
mode?: DateTimePickerMode | undefined;
|
|
203
|
-
/**
|
|
204
|
-
* The initial value to set the picker to. Defaults to device's date / time
|
|
205
|
-
*/
|
|
206
|
-
value?: Date | undefined;
|
|
207
|
-
/**
|
|
208
|
-
* The props to pass to the dialog expandable container
|
|
209
|
-
*/
|
|
210
|
-
dialogProps?: DialogProps | undefined;
|
|
211
|
-
/**
|
|
212
|
-
* The onChange callback
|
|
213
|
-
*/
|
|
214
|
-
onChange?: ((date: Date) => void) | undefined;
|
|
215
|
-
/**
|
|
216
|
-
* Should this input be editable or disabled
|
|
217
|
-
*/
|
|
218
|
-
editable?: boolean | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* The minimum date or time value to use
|
|
221
|
-
*/
|
|
222
|
-
minimumDate?: Date | undefined;
|
|
223
|
-
/**
|
|
224
|
-
* The maximum date or time value to use
|
|
225
|
-
*/
|
|
226
|
-
maximumDate?: Date | undefined;
|
|
227
|
-
/**
|
|
228
|
-
* A callback function to format the time or date
|
|
229
|
-
* @param mode the type of the picker ('date' or 'time')
|
|
230
|
-
* @returns the formatted string to display
|
|
231
|
-
*/
|
|
232
|
-
dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
|
|
233
|
-
/**
|
|
234
|
-
* Allows changing of the locale of the component (iOS only)
|
|
235
|
-
*/
|
|
236
|
-
locale?: string | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Allows changing of the time picker to a 24 hour format (Android only)
|
|
239
|
-
*/
|
|
240
|
-
is24Hour?: boolean | undefined;
|
|
241
|
-
/**
|
|
242
|
-
* The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
|
|
243
|
-
*/
|
|
244
|
-
minuteInterval?: number | undefined;
|
|
245
|
-
/**
|
|
246
|
-
* Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
|
|
247
|
-
*/
|
|
248
|
-
timeZoneOffsetInMinutes?: number | undefined;
|
|
249
|
-
/**
|
|
250
|
-
* style to apply to the iOS dialog header
|
|
251
|
-
*/
|
|
252
|
-
headerStyle?: StyleProp<ViewStyle>;
|
|
253
|
-
/**
|
|
254
|
-
* Render custom input
|
|
255
|
-
*/
|
|
256
|
-
renderInput?: ((props: Omit<DateTimePickerProps, "value"> & {
|
|
257
|
-
value?: string | undefined;
|
|
258
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
259
|
-
/**
|
|
260
|
-
* Override system theme variant (dark or light mode) used by the date picker.
|
|
261
|
-
*/
|
|
262
|
-
themeVariant?: "light" | "dark" | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* The component testID
|
|
265
|
-
*/
|
|
266
|
-
testID?: string | undefined;
|
|
267
|
-
/**
|
|
268
|
-
* Allows changing the visual display of the picker
|
|
269
|
-
*/
|
|
270
|
-
display?: string | undefined;
|
|
271
|
-
/**
|
|
272
|
-
* Text color of the wheel picker items
|
|
273
|
-
*/
|
|
274
|
-
textColor?: string | undefined;
|
|
275
|
-
/**
|
|
276
|
-
* Background color of the wheel picker
|
|
277
|
-
*/
|
|
278
|
-
backgroundColor?: string | undefined;
|
|
279
|
-
/**
|
|
280
|
-
* Confirm button props
|
|
281
|
-
*/
|
|
282
|
-
confirmButtonProps?: ButtonProps | undefined;
|
|
283
|
-
/**
|
|
284
|
-
* Cancel button props
|
|
285
|
-
*/
|
|
286
|
-
cancelButtonProps?: ButtonProps | undefined;
|
|
287
|
-
} & React.RefAttributes<any>>;
|
|
106
|
+
declare const _default: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<any>>;
|
|
288
107
|
export default _default;
|
|
@@ -42,6 +42,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
42
42
|
themeVariant = Colors.getScheme(),
|
|
43
43
|
onChange,
|
|
44
44
|
dialogProps,
|
|
45
|
+
migrateDialog,
|
|
45
46
|
textColor = Colors.$textDefault,
|
|
46
47
|
backgroundColor = Colors.$backgroundDefault,
|
|
47
48
|
headerStyle,
|
|
@@ -164,7 +165,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
164
165
|
return <>
|
|
165
166
|
<ExpandableOverlay
|
|
166
167
|
// @ts-expect-error
|
|
167
|
-
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} disabled={editable === false}
|
|
168
|
+
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} migrateDialog={migrateDialog} disabled={editable === false}
|
|
168
169
|
// NOTE: Android picker comes with its own overlay built-in therefor we're not using ExpandableOverlay for it
|
|
169
170
|
renderCustomOverlay={Constants.isAndroid ? renderAndroidDateTimePicker : undefined} testID={`${testID}.overlay`}>
|
|
170
171
|
{renderInput ? renderInput({
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { PanningDirections } from '../panningViews/panningProvider';
|
|
4
|
+
interface DialogDismissibleProps {
|
|
5
|
+
/**
|
|
6
|
+
* Additional styling
|
|
7
|
+
*/
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
/**
|
|
10
|
+
* The direction of the allowed pan (default is DOWN)
|
|
11
|
+
* Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###)
|
|
12
|
+
*/
|
|
13
|
+
direction?: PanningDirections;
|
|
14
|
+
/**
|
|
15
|
+
* onDismiss callback
|
|
16
|
+
*/
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* The dialog`s container style
|
|
20
|
+
*/
|
|
21
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show the dialog or not
|
|
24
|
+
*/
|
|
25
|
+
visible?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface Props extends DialogDismissibleProps {
|
|
28
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
29
|
+
}
|
|
30
|
+
declare const DialogDismissibleView: {
|
|
31
|
+
(props: Props): React.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export default DialogDismissibleView;
|