react-native-ui-lib 7.44.0-snapshot.7216 → 7.44.0-snapshot.7228
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/lib/package.json +1 -1
- package/package.json +2 -2
- package/panView.d.ts +2 -0
- package/panView.js +1 -0
- package/src/components/actionSheet/index.d.ts +2 -12
- package/src/components/actionSheet/index.js +3 -42
- package/src/components/checkbox/index.d.ts +0 -1
- package/src/components/checkbox/index.js +2 -4
- package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
- package/src/components/colorPicker/ColorPickerDialog.js +1 -1
- package/src/components/dateTimePicker/index.d.ts +186 -5
- package/src/components/dateTimePicker/index.js +1 -2
- package/src/components/dialog/dialog.api.json +31 -37
- package/src/{incubator → components}/dialog/dialogHeader.api.json +2 -2
- package/src/components/dialog/index.d.ts +13 -105
- package/src/components/dialog/index.js +204 -212
- package/src/{incubator → components}/dialog/types.d.ts +0 -19
- package/src/{incubator → components}/dialog/types.js +1 -3
- package/src/components/index.js +0 -19
- package/src/components/pageControl/index.js +6 -1
- package/src/{incubator → components}/panView/index.d.ts +3 -3
- package/src/{incubator → components}/panView/index.js +4 -4
- package/src/{incubator → components}/panView/usePanGesture.d.ts +1 -1
- package/src/components/picker/Picker.driver.new.js +1 -1
- package/src/components/picker/PickerItem.js +6 -20
- package/src/components/picker/PickerPresenter.d.ts +0 -1
- package/src/components/picker/PickerPresenter.js +1 -23
- package/src/components/picker/api/picker.api.json +0 -1
- package/src/components/picker/api/pickerItem.api.json +0 -5
- package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
- package/src/components/picker/helpers/usePickerLabel.js +2 -3
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
- package/src/components/picker/helpers/usePickerMigrationWarnings.js +0 -12
- package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSearch.js +4 -8
- package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSelection.js +2 -10
- package/src/components/picker/index.js +4 -22
- package/src/components/picker/types.d.ts +1 -24
- package/src/components/radioButton/index.js +6 -8
- package/src/components/stackAggregator/index.js +1 -1
- package/src/{incubator/hooks/useHiddenLocation.web.d.ts → hooks/useHiddenLocation/index.d.ts} +1 -1
- package/src/{incubator/hooks/useHiddenLocation.d.ts → hooks/useHiddenLocation/index.web.d.ts} +1 -1
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
- package/src/incubator/expandableOverlay/index.d.ts +42 -3
- package/src/incubator/expandableOverlay/index.js +1 -4
- package/src/incubator/index.d.ts +0 -2
- package/src/incubator/index.js +0 -2
- package/src/incubator/toast/index.js +1 -1
- package/src/index.d.ts +3 -10
- package/src/index.js +41 -160
- package/src/style/colors.d.ts +3 -5
- package/src/style/designTokens.js +7 -4
- package/src/testkit/index.d.ts +1 -1
- package/src/testkit/index.js +1 -1
- package/src/utils/styleUtils.d.ts +1 -0
- package/src/utils/styleUtils.js +3 -0
- package/panningViews.d.ts +0 -2
- package/panningViews.js +0 -1
- package/sharedTransition.d.ts +0 -2
- package/sharedTransition.js +0 -1
- package/src/components/dialog/DialogDismissibleView.d.ts +0 -34
- package/src/components/dialog/DialogDismissibleView.js +0 -184
- package/src/components/dialog/OverlayFadingBackground.d.ts +0 -14
- package/src/components/dialog/OverlayFadingBackground.js +0 -45
- package/src/components/panningViews/asPanViewConsumer.d.ts +0 -3
- package/src/components/panningViews/asPanViewConsumer.js +0 -16
- package/src/components/panningViews/panDismissibleView.d.ts +0 -51
- package/src/components/panningViews/panDismissibleView.js +0 -350
- package/src/components/panningViews/panGestureView.d.ts +0 -23
- package/src/components/panningViews/panGestureView.js +0 -156
- package/src/components/panningViews/panListenerView.d.ts +0 -66
- package/src/components/panningViews/panListenerView.js +0 -155
- package/src/components/panningViews/panResponderView.d.ts +0 -19
- package/src/components/panningViews/panResponderView.js +0 -79
- package/src/components/panningViews/panningContext.d.ts +0 -3
- package/src/components/panningViews/panningContext.js +0 -4
- package/src/components/panningViews/panningProvider.d.ts +0 -73
- package/src/components/panningViews/panningProvider.js +0 -101
- package/src/components/sharedTransition/ShareTransitionContext.js +0 -3
- package/src/components/sharedTransition/SharedArea.js +0 -153
- package/src/components/sharedTransition/SourceElement.js +0 -44
- package/src/components/sharedTransition/TargetElement.js +0 -38
- package/src/components/sharedTransition/index.js +0 -9
- package/src/incubator/dialog/dialog.api.json +0 -54
- package/src/incubator/dialog/index.d.ts +0 -15
- package/src/incubator/dialog/index.js +0 -218
- /package/src/{incubator → components}/dialog/Dialog.driver.new.d.ts +0 -0
- /package/src/{incubator → components}/dialog/Dialog.driver.new.js +0 -0
- /package/src/{incubator → components}/dialog/DialogHeader.d.ts +0 -0
- /package/src/{incubator → components}/dialog/DialogHeader.js +0 -0
- /package/src/{incubator → components}/dialog/useDialogContent.d.ts +0 -0
- /package/src/{incubator → components}/dialog/useDialogContent.js +0 -0
- /package/src/{incubator → components}/panView/panningUtil.d.ts +0 -0
- /package/src/{incubator → components}/panView/panningUtil.js +0 -0
- /package/src/{incubator → components}/panView/usePanGesture.js +0 -0
- /package/src/{incubator/hooks/useHiddenLocation.js → hooks/useHiddenLocation/index.js} +0 -0
- /package/src/{incubator/hooks/useHiddenLocation.web.js → hooks/useHiddenLocation/index.web.js} +0 -0
package/lib/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ui-lib",
|
|
3
|
-
"version": "7.44.0-snapshot.
|
|
3
|
+
"version": "7.44.0-snapshot.7228",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-native-redash": "^12.0.3",
|
|
57
57
|
"semver": "^5.5.0",
|
|
58
58
|
"tinycolor2": "^1.4.2",
|
|
59
|
-
"uilib-native": "5.0.0-snapshot.
|
|
59
|
+
"uilib-native": "5.0.0-snapshot.7216",
|
|
60
60
|
"url-parse": "^1.2.0",
|
|
61
61
|
"wix-react-native-text-size": "1.0.9"
|
|
62
62
|
},
|
package/panView.d.ts
ADDED
package/panView.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/components/panView').default;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { DialogProps } from '../dialog';
|
|
4
3
|
import { ButtonProps } from '../button';
|
|
5
|
-
import { DialogProps
|
|
4
|
+
import { type DialogProps } from '../dialog';
|
|
6
5
|
type ActionSheetOnOptionPress = (index: number) => void;
|
|
7
6
|
type ActionSheetProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Migrate to the Incubator.Dialog component
|
|
10
|
-
*/
|
|
11
|
-
migrateDialog?: boolean;
|
|
12
7
|
/**
|
|
13
8
|
* Whether to show the action sheet or not
|
|
14
9
|
*/
|
|
@@ -68,11 +63,6 @@ type ActionSheetProps = {
|
|
|
68
63
|
* Note: you will need to call onOptionPress so the option's onPress will be called
|
|
69
64
|
*/
|
|
70
65
|
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'];
|
|
76
66
|
/**
|
|
77
67
|
* Whether or not to handle SafeArea
|
|
78
68
|
*/
|
|
@@ -80,7 +70,7 @@ type ActionSheetProps = {
|
|
|
80
70
|
/**
|
|
81
71
|
* Additional props to send to the Dialog
|
|
82
72
|
*/
|
|
83
|
-
dialogProps?: Omit<DialogProps, 'useSafeArea' | 'testID' | 'containerStyle' | 'visible' | 'onDismiss' | 'onDialogDismissed'> |
|
|
73
|
+
dialogProps?: Omit<DialogProps, 'useSafeArea' | 'testID' | 'containerStyle' | 'visible' | 'onDismiss' | 'onDialogDismissed'> | DialogProps;
|
|
84
74
|
/**
|
|
85
75
|
* testID for e2e tests
|
|
86
76
|
*/
|
|
@@ -6,15 +6,12 @@ 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";
|
|
10
9
|
import View from "../view";
|
|
11
10
|
import Text from "../text";
|
|
12
11
|
import Image from "../image";
|
|
13
12
|
//@ts-ignore
|
|
14
13
|
import ListItem from "../listItem";
|
|
15
|
-
import
|
|
16
|
-
import { Dialog as IncubatorDialog } from "../../incubator";
|
|
17
|
-
import { LogService } from "../../services";
|
|
14
|
+
import Dialog from "../dialog";
|
|
18
15
|
const VERTICAL_PADDING = 8;
|
|
19
16
|
/**
|
|
20
17
|
* @description: Cross platform Action Sheet, with a support for native iOS solution
|
|
@@ -130,55 +127,19 @@ class ActionSheet extends Component {
|
|
|
130
127
|
{this.renderActions()}
|
|
131
128
|
</View>;
|
|
132
129
|
}
|
|
133
|
-
|
|
130
|
+
render() {
|
|
134
131
|
const {
|
|
135
|
-
useNativeIOS,
|
|
136
132
|
visible,
|
|
137
133
|
onDismiss,
|
|
138
134
|
dialogStyle,
|
|
139
|
-
onModalDismissed,
|
|
140
135
|
testID,
|
|
141
136
|
useSafeArea,
|
|
142
137
|
dialogProps
|
|
143
138
|
} = this.props;
|
|
144
|
-
|
|
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}>
|
|
139
|
+
return <Dialog bottom centerH width="100%" direction={Dialog.directions.DOWN} {...dialogProps} useSafeArea={useSafeArea} testID={testID} containerStyle={[styles.incubatorDialog, dialogStyle]} visible={visible} onDismiss={onDismiss}>
|
|
148
140
|
{this.renderSheet()}
|
|
149
141
|
</Dialog>;
|
|
150
142
|
}
|
|
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
|
-
}
|
|
182
143
|
}
|
|
183
144
|
export default asBaseComponent(ActionSheet);
|
|
184
145
|
const styles = StyleSheet.create({
|
|
@@ -120,7 +120,6 @@ declare class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
120
120
|
getLabelStyle: () => {
|
|
121
121
|
color: string;
|
|
122
122
|
};
|
|
123
|
-
getAccessibleHitSlop(size: number): number;
|
|
124
123
|
renderCheckbox(): React.JSX.Element;
|
|
125
124
|
render(): React.JSX.Element;
|
|
126
125
|
validate: () => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { Animated, Easing, StyleSheet } from 'react-native';
|
|
3
3
|
import { Colors, Spacings } from "../../style";
|
|
4
|
+
import { StyleUtils } from "../../utils";
|
|
4
5
|
//@ts-ignore
|
|
5
6
|
import Assets from "../../assets";
|
|
6
7
|
import { asBaseComponent } from "../../commons/new";
|
|
@@ -146,9 +147,6 @@ class Checkbox extends Component {
|
|
|
146
147
|
color: this.props.disabled ? Colors.$textDisabled : this.state.showError ? Colors.$textDangerLight : Colors.$textDefault
|
|
147
148
|
};
|
|
148
149
|
};
|
|
149
|
-
getAccessibleHitSlop(size) {
|
|
150
|
-
return Math.max(0, (48 - size) / 2);
|
|
151
|
-
}
|
|
152
150
|
renderCheckbox() {
|
|
153
151
|
const {
|
|
154
152
|
selectedIcon,
|
|
@@ -161,7 +159,7 @@ class Checkbox extends Component {
|
|
|
161
159
|
} = this.props;
|
|
162
160
|
return (
|
|
163
161
|
//@ts-ignore
|
|
164
|
-
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress} hitSlop={
|
|
162
|
+
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress} hitSlop={StyleUtils.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
|
|
165
163
|
{<Animated.View style={[this.styles.container, {
|
|
166
164
|
opacity: this.animationStyle.opacity
|
|
167
165
|
}, {
|
|
@@ -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 '../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 "../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 { DialogProps } from '../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'> & {
|
|
10
10
|
/**
|
|
11
11
|
* The type of picker to display ('date' or 'time')
|
|
12
12
|
*/
|
|
@@ -15,6 +15,10 @@ 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;
|
|
18
22
|
/**
|
|
19
23
|
* The onChange callback
|
|
20
24
|
*/
|
|
@@ -92,7 +96,6 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
92
96
|
*/
|
|
93
97
|
cancelButtonProps?: ButtonProps;
|
|
94
98
|
};
|
|
95
|
-
type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedProps;
|
|
96
99
|
/**
|
|
97
100
|
* @description: Date and Time Picker Component that wraps RNDateTimePicker for date and time modes.
|
|
98
101
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DateTimePickerScreen.tsx
|
|
@@ -101,7 +104,185 @@ type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedPr
|
|
|
101
104
|
* @extendsLink: https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker
|
|
102
105
|
* @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
|
|
103
106
|
*/
|
|
104
|
-
declare const DateTimePicker: React.ForwardRefExoticComponent<
|
|
107
|
+
declare const DateTimePicker: React.ForwardRefExoticComponent<OldApiProps & Omit<TextFieldProps, "value" | "onChange"> & {
|
|
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>>;
|
|
105
197
|
export { DateTimePicker };
|
|
106
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
198
|
+
declare const _default: React.ForwardRefExoticComponent<OldApiProps & Omit<TextFieldProps, "value" | "onChange"> & {
|
|
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>>;
|
|
107
288
|
export default _default;
|
|
@@ -42,7 +42,6 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
42
42
|
themeVariant = Colors.getScheme(),
|
|
43
43
|
onChange,
|
|
44
44
|
dialogProps,
|
|
45
|
-
migrateDialog,
|
|
46
45
|
textColor = Colors.$textDefault,
|
|
47
46
|
backgroundColor = Colors.$backgroundDefault,
|
|
48
47
|
headerStyle,
|
|
@@ -165,7 +164,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
165
164
|
return <>
|
|
166
165
|
<ExpandableOverlay
|
|
167
166
|
// @ts-expect-error
|
|
168
|
-
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps}
|
|
167
|
+
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} disabled={editable === false}
|
|
169
168
|
// NOTE: Android picker comes with its own overlay built-in therefor we're not using ExpandableOverlay for it
|
|
170
169
|
renderCustomOverlay={Constants.isAndroid ? renderAndroidDateTimePicker : undefined} testID={`${testID}.overlay`}>
|
|
171
170
|
{renderInput ? renderInput({
|
|
@@ -2,59 +2,53 @@
|
|
|
2
2
|
"name": "Dialog",
|
|
3
3
|
"category": "overlays",
|
|
4
4
|
"description": "Component for displaying custom content inside a popup dialog",
|
|
5
|
-
"note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)",
|
|
5
|
+
"note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center). \nWhen adding a `FlatList` \\ `ScrollView` to the content be sure to use one from `react-native-gesture-handler` (see [this link](https://github.com/software-mansion/react-native-gesture-handler/issues/1380) for `SectionList`).",
|
|
6
6
|
"modifiers": ["alignment"],
|
|
7
|
-
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.
|
|
8
|
-
"images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Dialog/Dialog.gif?raw=true"],
|
|
7
|
+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.tsx",
|
|
9
8
|
"props": [
|
|
10
|
-
{"name": "visible", "type": "boolean", "description": "
|
|
11
|
-
{"name": "
|
|
9
|
+
{"name": "visible", "type": "boolean", "description": "The visibility of the dialog"},
|
|
10
|
+
{"name": "headerProps", "type": "DialogHeaderProps", "description": "The Dialog's header (title, subtitle etc)"},
|
|
12
11
|
{
|
|
13
|
-
"name": "
|
|
14
|
-
"type": "
|
|
15
|
-
"description": "The
|
|
16
|
-
"default": "Colors.rgba(Colors.grey10, 0.6)"
|
|
17
|
-
},
|
|
18
|
-
{"name": "width", "type": "string | number", "description": "Width", "default": "90%"},
|
|
19
|
-
{"name": "height", "type": "string | number", "description": "Height", "default": "undefined"},
|
|
20
|
-
{
|
|
21
|
-
"name": "panDirection",
|
|
22
|
-
"type": "UP | DOWN | LEFT | RIGHT",
|
|
23
|
-
"description": "The direction of the allowed pan",
|
|
24
|
-
"default": "PanningProvider.Directions.DOWN"
|
|
12
|
+
"name": "containerStyle",
|
|
13
|
+
"type": "ViewStyle",
|
|
14
|
+
"description": "The Dialog`s container style (it is set to {position: 'absolute'})"
|
|
25
15
|
},
|
|
26
|
-
{"name": "onDismiss", "type": "(props?: any) => void", "description": "Called when clicking on the background"},
|
|
27
16
|
{
|
|
28
|
-
"name": "
|
|
29
|
-
"type": "
|
|
30
|
-
"description": "
|
|
17
|
+
"name": "containerProps",
|
|
18
|
+
"type": "ViewProps",
|
|
19
|
+
"description": "Extra props for the container"
|
|
31
20
|
},
|
|
32
21
|
{
|
|
33
|
-
"name": "
|
|
34
|
-
"type": "(props
|
|
35
|
-
"description": "
|
|
36
|
-
"note": "If this is added only the header will be pannable. Props are transferred to the 'renderPannableHeader'"
|
|
22
|
+
"name": "onDismiss",
|
|
23
|
+
"type": "(props?: DialogProps) => void",
|
|
24
|
+
"description": "Callback that is called after the dialog's dismiss (after the animation has ended)."
|
|
37
25
|
},
|
|
38
26
|
{
|
|
39
|
-
"name": "
|
|
40
|
-
"type": "
|
|
41
|
-
"description": "The
|
|
27
|
+
"name": "direction",
|
|
28
|
+
"type": "up | down | left | right",
|
|
29
|
+
"description": "The direction from which and to which the dialog is animating \\ panning (default down).",
|
|
30
|
+
"default": "down"
|
|
42
31
|
},
|
|
43
32
|
{
|
|
44
|
-
"name": "
|
|
33
|
+
"name": "showClose",
|
|
45
34
|
"type": "boolean",
|
|
46
|
-
"description": "
|
|
35
|
+
"description": "Show the close button"
|
|
47
36
|
},
|
|
48
|
-
{"name": "
|
|
49
|
-
{"name": "
|
|
37
|
+
{"name": "ignoreBackgroundPress", "type": "boolean", "description": "Whether or not to ignore background press."},
|
|
38
|
+
{"name": "modalProps", "type": "ModalProps", "description": "Pass props to the dialog modal"},
|
|
39
|
+
{
|
|
40
|
+
"name": "testID",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Used to locate this view in end-to-end tests. \nThe container has the original id. \nSupported inner elements IDs: \n`${TestID}.modal` - the Modal's id. \n`${TestID}.overlayFadingBackground` - the fading background id."
|
|
43
|
+
}
|
|
50
44
|
],
|
|
51
45
|
"snippet": [
|
|
52
|
-
"<Dialog",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
46
|
+
"<Dialog",
|
|
47
|
+
" visible={isVisible$1}",
|
|
48
|
+
" onDismiss={() => console.log('dismissed')$2}",
|
|
49
|
+
" direction={Dialog.directions.DOWN$3}",
|
|
56
50
|
">",
|
|
57
|
-
"
|
|
51
|
+
" <Text text60>Content</Text>$4",
|
|
58
52
|
"</Dialog>"
|
|
59
53
|
]
|
|
60
54
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Dialog.Header",
|
|
3
|
-
"category": "
|
|
3
|
+
"category": "overlays",
|
|
4
4
|
"description": "Component for displaying the header of a popup dialog",
|
|
5
|
-
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/
|
|
5
|
+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.tsx",
|
|
6
6
|
"props": [
|
|
7
7
|
{"name": "title", "type": "string", "description": "Title"},
|
|
8
8
|
{"name": "titleStyle", "type": "StyleProp<TextStyle>", "description": "Title text style"},
|