react-native-ui-lib 7.44.0-snapshot.7202 → 7.44.0-snapshot.7204
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/babel.config.js +12 -0
- package/index.js +1 -0
- package/lib/android/build.gradle +5 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -2
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +31 -23
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
- package/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.d.ts +61 -0
- package/lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.js +2 -0
- package/lib/components/{HighlighterOverlayView.web.d.ts → HighlighterOverlayView/index.d.ts} +1 -1
- package/lib/components/HighlighterOverlayView/index.js +49 -0
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.android.d.ts +5 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +51 -0
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.d.ts +3 -0
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput/utils → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager}/__tests__/EventEmitterManager.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/__tests__/KeyboardRegistry.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.d.ts → KeyboardAccessoryView/KeyboardRegistry/index.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.js → KeyboardAccessoryView/KeyboardRegistry/index.js} +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/keyboardRegistry.api.json +9 -9
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +26 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +91 -0
- package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.d.ts → KeyboardAccessoryView/index.d.ts} +11 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.js → KeyboardAccessoryView/index.js} +31 -5
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/keyboardAccessoryView.api.json +5 -5
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.d.ts → KeyboardAwareInsetsView/index.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.js → KeyboardAwareInsetsView/index.js} +1 -1
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +1 -4
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.js +5 -8
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.d.ts +58 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.js +2 -0
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.d.ts +2 -2
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/keyboardTrackingView.api.json +11 -20
- package/lib/components/Keyboard/index.d.ts +6 -6
- package/lib/components/Keyboard/index.js +6 -6
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +8 -3
- package/lib/components/SafeArea/SafeAreaInsetsManager.js +89 -23
- package/lib/components/SafeArea/SafeAreaSpacerView.js +60 -9
- package/lib/package.json +1 -1
- package/lib/react-native.config.js +1 -3
- package/metro.config.js +2 -2
- package/package.json +23 -23
- package/react-native.config.js +1 -3
- package/src/commons/Constants.js +7 -2
- package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +5 -1
- package/src/components/badge/index.d.ts +107 -47
- package/src/components/button/button.api.json +1 -1
- package/src/components/button/index.d.ts +53 -23
- package/src/components/button/types.d.ts +0 -1
- package/src/components/checkbox/index.d.ts +1 -0
- package/src/components/checkbox/index.js +4 -2
- package/src/components/drawer/Swipeable.js +1 -2
- package/src/components/drawer/index.js +31 -25
- package/src/components/fadedScrollView/index.js +7 -2
- package/src/components/pageControl/index.js +1 -6
- package/src/components/picker/helpers/useFieldType.d.ts +53 -23
- package/src/components/radioButton/index.js +8 -6
- package/src/components/slider/GradientSlider.d.ts +1 -1
- package/src/components/sortableGridList/SortableItem.js +13 -4
- package/src/components/sortableList/SortableListItem.js +13 -4
- package/src/components/stackAggregator/index.js +16 -11
- package/src/components/textField/Input.js +0 -1
- package/src/components/textField/presets/outline.d.ts +106 -46
- package/src/components/textField/presets/underline.d.ts +106 -46
- package/src/components/textField/usePreset.d.ts +72 -44
- package/src/incubator/dialog/useDialogContent.d.ts +1 -1
- package/src/style/colors.d.ts +5 -3
- package/src/style/designTokens.js +4 -7
- package/src/utils/styleUtils.d.ts +0 -1
- package/src/utils/styleUtils.js +0 -3
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +0 -30
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +0 -34
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +0 -53
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +0 -54
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +0 -36
- package/lib/components/HighlighterOverlayView.js +0 -40
- package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +0 -28
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +0 -11
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +0 -17
- /package/lib/components/{HighlighterOverlayView.d.ts → HighlighterOverlayView/index.web.d.ts} +0 -0
- /package/lib/components/{HighlighterOverlayView.web.js → HighlighterOverlayView/index.web.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.d.ts → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.js → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking → KeyboardAwareInsetsView}/keyboardAwareInsetsView.api.json +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.js +0 -0
|
@@ -39,7 +39,7 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
39
39
|
fontFamily?: string | undefined;
|
|
40
40
|
fontSize?: number | undefined;
|
|
41
41
|
fontStyle?: "normal" | "italic" | undefined;
|
|
42
|
-
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
|
|
42
|
+
fontWeight?: "black" | 900 | 600 | "light" | 100 | "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 200 | 300 | 400 | 500 | 700 | 800 | "ultralight" | "thin" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | undefined;
|
|
43
43
|
letterSpacing?: number | undefined;
|
|
44
44
|
lineHeight?: number | undefined;
|
|
45
45
|
textAlign?: "auto" | "left" | "right" | "center" | "justify" | undefined;
|
|
@@ -62,31 +62,41 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
62
62
|
borderBlockEndColor?: import("react-native").ColorValue | undefined;
|
|
63
63
|
borderBlockStartColor?: import("react-native").ColorValue | undefined;
|
|
64
64
|
borderBottomColor?: import("react-native").ColorValue | undefined;
|
|
65
|
-
borderBottomEndRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
66
|
-
borderBottomLeftRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
67
|
-
borderBottomRightRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
68
|
-
borderBottomStartRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
65
|
+
borderBottomEndRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
66
|
+
borderBottomLeftRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
67
|
+
borderBottomRightRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
68
|
+
borderBottomStartRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
69
69
|
borderColor?: import("react-native").ColorValue | undefined;
|
|
70
70
|
borderCurve?: "circular" | "continuous" | undefined;
|
|
71
71
|
borderEndColor?: import("react-native").ColorValue | undefined;
|
|
72
|
-
borderEndEndRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
73
|
-
borderEndStartRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
72
|
+
borderEndEndRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
73
|
+
borderEndStartRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
74
74
|
borderLeftColor?: import("react-native").ColorValue | undefined;
|
|
75
|
-
borderRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
75
|
+
borderRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
76
76
|
borderRightColor?: import("react-native").ColorValue | undefined;
|
|
77
77
|
borderStartColor?: import("react-native").ColorValue | undefined;
|
|
78
|
-
borderStartEndRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
79
|
-
borderStartStartRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
78
|
+
borderStartEndRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
79
|
+
borderStartStartRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
80
80
|
borderStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
81
81
|
borderTopColor?: import("react-native").ColorValue | undefined;
|
|
82
|
-
borderTopEndRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
83
|
-
borderTopLeftRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
84
|
-
borderTopRightRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
85
|
-
borderTopStartRadius?: import("react-native").AnimatableNumericValue | undefined;
|
|
82
|
+
borderTopEndRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
83
|
+
borderTopLeftRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
84
|
+
borderTopRightRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
85
|
+
borderTopStartRadius?: string | import("react-native").AnimatableNumericValue | undefined;
|
|
86
|
+
outlineColor?: import("react-native").ColorValue | undefined;
|
|
87
|
+
outlineOffset?: import("react-native").AnimatableNumericValue | undefined;
|
|
88
|
+
outlineStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
89
|
+
outlineWidth?: import("react-native").AnimatableNumericValue | undefined;
|
|
86
90
|
opacity?: import("react-native").AnimatableNumericValue | undefined;
|
|
87
91
|
elevation?: number | undefined;
|
|
88
92
|
pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
|
|
89
|
-
|
|
93
|
+
isolation?: "auto" | "isolate" | undefined;
|
|
94
|
+
cursor?: import("react-native").CursorValue | undefined;
|
|
95
|
+
boxShadow?: string | readonly import("react-native").BoxShadowValue[] | undefined;
|
|
96
|
+
filter?: string | readonly import("react-native").FilterFunction[] | undefined;
|
|
97
|
+
mixBlendMode?: import("react-native").BlendMode | undefined;
|
|
98
|
+
experimental_backgroundImage?: string | readonly import("react-native").GradientValue[] | undefined;
|
|
99
|
+
alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
90
100
|
alignItems?: import("react-native").FlexAlignType | undefined;
|
|
91
101
|
alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
|
|
92
102
|
aspectRatio?: string | number | undefined;
|
|
@@ -98,14 +108,15 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
98
108
|
borderTopWidth?: number | undefined;
|
|
99
109
|
borderWidth?: number | undefined;
|
|
100
110
|
bottom?: import("react-native").DimensionValue | undefined;
|
|
101
|
-
|
|
111
|
+
boxSizing?: "border-box" | "content-box" | undefined;
|
|
112
|
+
display?: "none" | "flex" | "contents" | undefined;
|
|
102
113
|
end?: import("react-native").DimensionValue | undefined;
|
|
103
114
|
flex?: number | undefined;
|
|
104
115
|
flexBasis?: import("react-native").DimensionValue | undefined;
|
|
105
116
|
flexDirection: "row" | "column" | "row-reverse" | "column-reverse";
|
|
106
|
-
rowGap?: number | undefined;
|
|
107
|
-
gap?: number | undefined;
|
|
108
|
-
columnGap?: number | undefined;
|
|
117
|
+
rowGap?: string | number | undefined;
|
|
118
|
+
gap?: string | number | undefined;
|
|
119
|
+
columnGap?: string | number | undefined;
|
|
109
120
|
flexGrow?: number | undefined;
|
|
110
121
|
flexShrink?: number | undefined;
|
|
111
122
|
flexWrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
@@ -135,13 +146,32 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
135
146
|
paddingStart?: import("react-native").DimensionValue | undefined;
|
|
136
147
|
paddingTop?: import("react-native").DimensionValue | undefined;
|
|
137
148
|
paddingVertical?: import("react-native").DimensionValue | undefined;
|
|
138
|
-
position?: "absolute" | "relative" | undefined;
|
|
149
|
+
position?: "absolute" | "relative" | "static" | undefined;
|
|
139
150
|
right?: import("react-native").DimensionValue | undefined;
|
|
140
151
|
start?: import("react-native").DimensionValue | undefined;
|
|
141
152
|
top?: import("react-native").DimensionValue | undefined;
|
|
142
153
|
width?: import("react-native").DimensionValue | undefined;
|
|
143
154
|
zIndex?: number | undefined;
|
|
144
155
|
direction?: "ltr" | "rtl" | "inherit" | undefined;
|
|
156
|
+
inset?: import("react-native").DimensionValue | undefined;
|
|
157
|
+
insetBlock?: import("react-native").DimensionValue | undefined;
|
|
158
|
+
insetBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
159
|
+
insetBlockStart?: import("react-native").DimensionValue | undefined;
|
|
160
|
+
insetInline?: import("react-native").DimensionValue | undefined;
|
|
161
|
+
insetInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
162
|
+
insetInlineStart?: import("react-native").DimensionValue | undefined;
|
|
163
|
+
marginBlock?: import("react-native").DimensionValue | undefined;
|
|
164
|
+
marginBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
165
|
+
marginBlockStart?: import("react-native").DimensionValue | undefined;
|
|
166
|
+
marginInline?: import("react-native").DimensionValue | undefined;
|
|
167
|
+
marginInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
168
|
+
marginInlineStart?: import("react-native").DimensionValue | undefined;
|
|
169
|
+
paddingBlock?: import("react-native").DimensionValue | undefined;
|
|
170
|
+
paddingBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
171
|
+
paddingBlockStart?: import("react-native").DimensionValue | undefined;
|
|
172
|
+
paddingInline?: import("react-native").DimensionValue | undefined;
|
|
173
|
+
paddingInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
174
|
+
paddingInlineStart?: import("react-native").DimensionValue | undefined;
|
|
145
175
|
shadowColor?: import("react-native").ColorValue | undefined;
|
|
146
176
|
shadowOffset?: Readonly<{
|
|
147
177
|
width: number;
|
|
@@ -149,7 +179,7 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
149
179
|
}> | undefined;
|
|
150
180
|
shadowOpacity?: import("react-native").AnimatableNumericValue | undefined;
|
|
151
181
|
shadowRadius?: number | undefined;
|
|
152
|
-
transform?: string | (({
|
|
182
|
+
transform?: string | readonly (({
|
|
153
183
|
perspective: import("react-native").AnimatableNumericValue;
|
|
154
184
|
} & {
|
|
155
185
|
rotate?: undefined;
|
|
@@ -270,7 +300,7 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
270
300
|
skewY?: undefined;
|
|
271
301
|
matrix?: undefined;
|
|
272
302
|
}) | ({
|
|
273
|
-
translateX: import("react-native").AnimatableNumericValue
|
|
303
|
+
translateX: import("react-native").AnimatableNumericValue | `${number}%`;
|
|
274
304
|
} & {
|
|
275
305
|
perspective?: undefined;
|
|
276
306
|
rotate?: undefined;
|
|
@@ -285,7 +315,7 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
285
315
|
skewY?: undefined;
|
|
286
316
|
matrix?: undefined;
|
|
287
317
|
}) | ({
|
|
288
|
-
translateY: import("react-native").AnimatableNumericValue
|
|
318
|
+
translateY: import("react-native").AnimatableNumericValue | `${number}%`;
|
|
289
319
|
} & {
|
|
290
320
|
perspective?: undefined;
|
|
291
321
|
rotate?: undefined;
|
|
@@ -131,7 +131,6 @@ export type ButtonProps = TouchableOpacityProps & TypographyModifiers & ColorsMo
|
|
|
131
131
|
getActiveBackgroundColor?: (backgroundColor: string, props: any) => string;
|
|
132
132
|
/**
|
|
133
133
|
* should animate layout change
|
|
134
|
-
* Note?: For Android you must set 'setLayoutAnimationEnabledExperimental(true)' via RN's 'UIManager'
|
|
135
134
|
*/
|
|
136
135
|
animateLayout?: boolean;
|
|
137
136
|
/**
|
|
@@ -120,6 +120,7 @@ declare class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
120
120
|
getLabelStyle: () => {
|
|
121
121
|
color: string;
|
|
122
122
|
};
|
|
123
|
+
getAccessibleHitSlop(size: number): number;
|
|
123
124
|
renderCheckbox(): React.JSX.Element;
|
|
124
125
|
render(): React.JSX.Element;
|
|
125
126
|
validate: () => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
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";
|
|
5
4
|
//@ts-ignore
|
|
6
5
|
import Assets from "../../assets";
|
|
7
6
|
import { asBaseComponent } from "../../commons/new";
|
|
@@ -147,6 +146,9 @@ class Checkbox extends Component {
|
|
|
147
146
|
color: this.props.disabled ? Colors.$textDisabled : this.state.showError ? Colors.$textDangerLight : Colors.$textDefault
|
|
148
147
|
};
|
|
149
148
|
};
|
|
149
|
+
getAccessibleHitSlop(size) {
|
|
150
|
+
return Math.max(0, (48 - size) / 2);
|
|
151
|
+
}
|
|
150
152
|
renderCheckbox() {
|
|
151
153
|
const {
|
|
152
154
|
selectedIcon,
|
|
@@ -159,7 +161,7 @@ class Checkbox extends Component {
|
|
|
159
161
|
} = this.props;
|
|
160
162
|
return (
|
|
161
163
|
//@ts-ignore
|
|
162
|
-
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress} hitSlop={
|
|
164
|
+
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress} hitSlop={this.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
|
|
163
165
|
{<Animated.View style={[this.styles.container, {
|
|
164
166
|
opacity: this.animationStyle.opacity
|
|
165
167
|
}, {
|
|
@@ -220,30 +220,33 @@ class Drawer extends PureComponent {
|
|
|
220
220
|
outputRange,
|
|
221
221
|
extrapolate: 'clamp'
|
|
222
222
|
});
|
|
223
|
-
return <RectButton key={index} testID={item.testID}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
223
|
+
return <RectButton key={index} testID={item.testID} onPress={() => this.onActionPress(item)}>
|
|
224
|
+
<View style={[styles.action, item.style, {
|
|
225
|
+
backgroundColor: item.background || DEFAULT_BG,
|
|
226
|
+
height: '100%',
|
|
227
|
+
width: item.width,
|
|
228
|
+
minWidth: itemsMinWidth
|
|
229
|
+
}]}>
|
|
230
|
+
{item.customElement}
|
|
231
|
+
{!item.customElement && item.icon && <Animated.Image source={item.icon} style={[styles.actionIcon, {
|
|
232
|
+
width: itemsIconSize,
|
|
233
|
+
height: itemsIconSize,
|
|
234
|
+
tintColor: item.iconColor || itemsTintColor,
|
|
235
|
+
opacity,
|
|
236
|
+
transform: [{
|
|
237
|
+
scale
|
|
238
|
+
}]
|
|
239
|
+
}]} />}
|
|
240
|
+
{!item.customElement && item.text && <Animated.Text style={[styles.actionText, {
|
|
241
|
+
color: item.textColor || itemsTintColor,
|
|
242
|
+
opacity,
|
|
243
|
+
transform: [{
|
|
244
|
+
scale
|
|
245
|
+
}]
|
|
246
|
+
}, itemsTextStyle]} accessibilityElementsHidden importantForAccessibility="no-hide-descendants" accessible={false}>
|
|
247
|
+
{item.text}
|
|
248
|
+
</Animated.Text>}
|
|
249
|
+
</View>
|
|
247
250
|
</RectButton>;
|
|
248
251
|
};
|
|
249
252
|
render() {
|
|
@@ -255,7 +258,7 @@ class Drawer extends PureComponent {
|
|
|
255
258
|
onToggleSwipeLeft,
|
|
256
259
|
...others
|
|
257
260
|
} = this.props;
|
|
258
|
-
return <GestureHandlerRootView>
|
|
261
|
+
return <GestureHandlerRootView style={styles.container}>
|
|
259
262
|
<Swipeable {...others} ref={this._swipeableRow} friction={1} containerStyle={style} animationOptions={this.animationOptions} renderLeftActions={this.leftRender} renderRightActions={this.rightRender} rightActionsContainerStyle={this.getRightActionsContainerStyle(rightItems, leftItem)} leftActionsContainerStyle={this.getLeftActionsContainerStyle(leftItem, rightItems)} onSwipeableWillOpen={this.onSwipeableWillOpen} onSwipeableWillClose={this.onSwipeableWillClose} onToggleSwipeLeft={onToggleSwipeLeft && this.onToggleSwipeLeft}>
|
|
260
263
|
<View accessible accessibilityActions={this.getAccessibilityActions()} onAccessibilityAction={this.onAccessibilityAction} {...extractAccessibilityProps(this.props)}>
|
|
261
264
|
{children}
|
|
@@ -266,6 +269,9 @@ class Drawer extends PureComponent {
|
|
|
266
269
|
}
|
|
267
270
|
export default asBaseComponent(Drawer);
|
|
268
271
|
const styles = StyleSheet.create({
|
|
272
|
+
container: {
|
|
273
|
+
flex: 0
|
|
274
|
+
},
|
|
269
275
|
leftAction: {
|
|
270
276
|
flex: 1,
|
|
271
277
|
justifyContent: 'center',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef, useImperativeHandle } from 'react';
|
|
2
|
-
import { ScrollView as RNScrollView } from 'react-native';
|
|
2
|
+
import { ScrollView as RNScrollView, StyleSheet } from 'react-native';
|
|
3
3
|
import { ScrollView as GestureScrollView, GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
4
4
|
import Fader from "../fader";
|
|
5
5
|
import useScrollEnabler from "../../hooks/useScrollEnabler";
|
|
@@ -60,7 +60,7 @@ const FadedScrollView = props => {
|
|
|
60
60
|
isScrollEnabled
|
|
61
61
|
}));
|
|
62
62
|
if (children) {
|
|
63
|
-
return <GestureHandlerRootView>
|
|
63
|
+
return <GestureHandlerRootView style={styles.container}>
|
|
64
64
|
<ScrollView scrollEventThrottle={16} decelerationRate={'fast'} {...others} horizontal={horizontal} scrollEnabled={scrollEnabled} onContentSizeChange={_onContentSizeChange} onLayout={_onLayout} onScroll={onScroll}
|
|
65
65
|
// @ts-expect-error
|
|
66
66
|
ref={scrollViewRef}>
|
|
@@ -72,5 +72,10 @@ const FadedScrollView = props => {
|
|
|
72
72
|
}
|
|
73
73
|
return null;
|
|
74
74
|
};
|
|
75
|
+
const styles = StyleSheet.create({
|
|
76
|
+
container: {
|
|
77
|
+
flex: 0
|
|
78
|
+
}
|
|
79
|
+
});
|
|
75
80
|
FadedScrollView.displayName = 'IGNORE';
|
|
76
81
|
export default forwardRef(FadedScrollView);
|
|
@@ -5,7 +5,6 @@ import React, { PureComponent } from 'react';
|
|
|
5
5
|
import { StyleSheet, LayoutAnimation } from 'react-native';
|
|
6
6
|
import { asBaseComponent } from "../../commons/new";
|
|
7
7
|
import { Colors } from "../../style";
|
|
8
|
-
import { StyleUtils } from "../../utils";
|
|
9
8
|
import TouchableOpacity from "../touchableOpacity";
|
|
10
9
|
import View from "../view";
|
|
11
10
|
const MAX_SHOWN_PAGES = 7;
|
|
@@ -136,13 +135,9 @@ class PageControl extends PureComponent {
|
|
|
136
135
|
onPagePress,
|
|
137
136
|
spacing = PageControl.DEFAULT_SPACING
|
|
138
137
|
} = this.props;
|
|
139
|
-
const hitSlopValue = StyleUtils.getAccessibleHitSlop(size);
|
|
140
138
|
return <TouchableOpacity customValue={index} onPress={onPagePress && this.onPagePress} key={index} style={[styles.pageIndicator, {
|
|
141
139
|
marginHorizontal: spacing / 2
|
|
142
|
-
}, getColorStyle(index === currentPage, color, inactiveColor), getSizeStyle(size, index, currentPage, enlargeActive)]}
|
|
143
|
-
top: hitSlopValue,
|
|
144
|
-
bottom: hitSlopValue
|
|
145
|
-
}} />;
|
|
140
|
+
}, getColorStyle(index === currentPage, color, inactiveColor), getSizeStyle(size, index, currentPage, enlargeActive)]} />;
|
|
146
141
|
}
|
|
147
142
|
renderDifferentSizeIndicators() {
|
|
148
143
|
const {
|
|
@@ -13,7 +13,7 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
13
13
|
fontFamily?: string | undefined;
|
|
14
14
|
fontSize?: number | undefined;
|
|
15
15
|
fontStyle?: "normal" | "italic" | undefined;
|
|
16
|
-
fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
|
|
16
|
+
fontWeight?: "black" | 900 | 600 | "light" | 100 | "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 200 | 300 | 400 | 500 | 700 | 800 | "ultralight" | "thin" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | undefined;
|
|
17
17
|
letterSpacing?: number | undefined;
|
|
18
18
|
lineHeight?: number | undefined;
|
|
19
19
|
textAlign?: "auto" | "left" | "right" | "center" | "justify" | undefined;
|
|
@@ -36,31 +36,41 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
36
36
|
borderBlockEndColor?: import("react-native/types").ColorValue | undefined;
|
|
37
37
|
borderBlockStartColor?: import("react-native/types").ColorValue | undefined;
|
|
38
38
|
borderBottomColor?: import("react-native/types").ColorValue | undefined;
|
|
39
|
-
borderBottomEndRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
40
|
-
borderBottomLeftRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
41
|
-
borderBottomRightRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
42
|
-
borderBottomStartRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
39
|
+
borderBottomEndRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
40
|
+
borderBottomLeftRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
41
|
+
borderBottomRightRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
42
|
+
borderBottomStartRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
43
43
|
borderColor?: import("react-native/types").ColorValue | undefined;
|
|
44
44
|
borderCurve?: "circular" | "continuous" | undefined;
|
|
45
45
|
borderEndColor?: import("react-native/types").ColorValue | undefined;
|
|
46
|
-
borderEndEndRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
47
|
-
borderEndStartRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
46
|
+
borderEndEndRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
47
|
+
borderEndStartRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
48
48
|
borderLeftColor?: import("react-native/types").ColorValue | undefined;
|
|
49
|
-
borderRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
49
|
+
borderRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
50
50
|
borderRightColor?: import("react-native/types").ColorValue | undefined;
|
|
51
51
|
borderStartColor?: import("react-native/types").ColorValue | undefined;
|
|
52
|
-
borderStartEndRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
53
|
-
borderStartStartRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
52
|
+
borderStartEndRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
53
|
+
borderStartStartRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
54
54
|
borderStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
55
55
|
borderTopColor?: import("react-native/types").ColorValue | undefined;
|
|
56
|
-
borderTopEndRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
57
|
-
borderTopLeftRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
58
|
-
borderTopRightRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
59
|
-
borderTopStartRadius?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
56
|
+
borderTopEndRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
57
|
+
borderTopLeftRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
58
|
+
borderTopRightRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
59
|
+
borderTopStartRadius?: string | import("react-native/types").AnimatableNumericValue | undefined;
|
|
60
|
+
outlineColor?: import("react-native/types").ColorValue | undefined;
|
|
61
|
+
outlineOffset?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
62
|
+
outlineStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
63
|
+
outlineWidth?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
60
64
|
opacity?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
61
65
|
elevation?: number | undefined;
|
|
62
66
|
pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
|
|
63
|
-
|
|
67
|
+
isolation?: "auto" | "isolate" | undefined;
|
|
68
|
+
cursor?: import("react-native/types").CursorValue | undefined;
|
|
69
|
+
boxShadow?: string | readonly import("react-native/types").BoxShadowValue[] | undefined;
|
|
70
|
+
filter?: string | readonly import("react-native/types").FilterFunction[] | undefined;
|
|
71
|
+
mixBlendMode?: import("react-native/types").BlendMode | undefined;
|
|
72
|
+
experimental_backgroundImage?: string | readonly import("react-native/types").GradientValue[] | undefined;
|
|
73
|
+
alignContent?: "center" | "flex-start" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
64
74
|
alignItems?: import("react-native/types").FlexAlignType | undefined;
|
|
65
75
|
alignSelf?: "auto" | import("react-native/types").FlexAlignType | undefined;
|
|
66
76
|
aspectRatio?: string | number | undefined;
|
|
@@ -72,14 +82,15 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
72
82
|
borderTopWidth?: number | undefined;
|
|
73
83
|
borderWidth?: number | undefined;
|
|
74
84
|
bottom?: import("react-native/types").DimensionValue | undefined;
|
|
75
|
-
|
|
85
|
+
boxSizing?: "border-box" | "content-box" | undefined;
|
|
86
|
+
display?: "none" | "flex" | "contents" | undefined;
|
|
76
87
|
end?: import("react-native/types").DimensionValue | undefined;
|
|
77
88
|
flex?: number | undefined;
|
|
78
89
|
flexBasis?: import("react-native/types").DimensionValue | undefined;
|
|
79
90
|
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
80
|
-
rowGap?: number | undefined;
|
|
81
|
-
gap?: number | undefined;
|
|
82
|
-
columnGap?: number | undefined;
|
|
91
|
+
rowGap?: string | number | undefined;
|
|
92
|
+
gap?: string | number | undefined;
|
|
93
|
+
columnGap?: string | number | undefined;
|
|
83
94
|
flexGrow?: number | undefined;
|
|
84
95
|
flexShrink?: number | undefined;
|
|
85
96
|
flexWrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
@@ -109,13 +120,32 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
109
120
|
paddingStart?: import("react-native/types").DimensionValue | undefined;
|
|
110
121
|
paddingTop?: import("react-native/types").DimensionValue | undefined;
|
|
111
122
|
paddingVertical?: import("react-native/types").DimensionValue | undefined;
|
|
112
|
-
position?: "absolute" | "relative" | undefined;
|
|
123
|
+
position?: "absolute" | "relative" | "static" | undefined;
|
|
113
124
|
right?: import("react-native/types").DimensionValue | undefined;
|
|
114
125
|
start?: import("react-native/types").DimensionValue | undefined;
|
|
115
126
|
top?: import("react-native/types").DimensionValue | undefined;
|
|
116
127
|
width?: import("react-native/types").DimensionValue | undefined;
|
|
117
128
|
zIndex?: number | undefined;
|
|
118
129
|
direction?: "ltr" | "rtl" | "inherit" | undefined;
|
|
130
|
+
inset?: import("react-native/types").DimensionValue | undefined;
|
|
131
|
+
insetBlock?: import("react-native/types").DimensionValue | undefined;
|
|
132
|
+
insetBlockEnd?: import("react-native/types").DimensionValue | undefined;
|
|
133
|
+
insetBlockStart?: import("react-native/types").DimensionValue | undefined;
|
|
134
|
+
insetInline?: import("react-native/types").DimensionValue | undefined;
|
|
135
|
+
insetInlineEnd?: import("react-native/types").DimensionValue | undefined;
|
|
136
|
+
insetInlineStart?: import("react-native/types").DimensionValue | undefined;
|
|
137
|
+
marginBlock?: import("react-native/types").DimensionValue | undefined;
|
|
138
|
+
marginBlockEnd?: import("react-native/types").DimensionValue | undefined;
|
|
139
|
+
marginBlockStart?: import("react-native/types").DimensionValue | undefined;
|
|
140
|
+
marginInline?: import("react-native/types").DimensionValue | undefined;
|
|
141
|
+
marginInlineEnd?: import("react-native/types").DimensionValue | undefined;
|
|
142
|
+
marginInlineStart?: import("react-native/types").DimensionValue | undefined;
|
|
143
|
+
paddingBlock?: import("react-native/types").DimensionValue | undefined;
|
|
144
|
+
paddingBlockEnd?: import("react-native/types").DimensionValue | undefined;
|
|
145
|
+
paddingBlockStart?: import("react-native/types").DimensionValue | undefined;
|
|
146
|
+
paddingInline?: import("react-native/types").DimensionValue | undefined;
|
|
147
|
+
paddingInlineEnd?: import("react-native/types").DimensionValue | undefined;
|
|
148
|
+
paddingInlineStart?: import("react-native/types").DimensionValue | undefined;
|
|
119
149
|
shadowColor?: import("react-native/types").ColorValue | undefined;
|
|
120
150
|
shadowOffset?: Readonly<{
|
|
121
151
|
width: number;
|
|
@@ -123,7 +153,7 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
123
153
|
}> | undefined;
|
|
124
154
|
shadowOpacity?: import("react-native/types").AnimatableNumericValue | undefined;
|
|
125
155
|
shadowRadius?: number | undefined;
|
|
126
|
-
transform?: string | (({
|
|
156
|
+
transform?: string | readonly (({
|
|
127
157
|
perspective: import("react-native/types").AnimatableNumericValue;
|
|
128
158
|
} & {
|
|
129
159
|
rotate?: undefined;
|
|
@@ -244,7 +274,7 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
244
274
|
skewY?: undefined;
|
|
245
275
|
matrix?: undefined;
|
|
246
276
|
}) | ({
|
|
247
|
-
translateX: import("react-native/types").AnimatableNumericValue
|
|
277
|
+
translateX: import("react-native/types").AnimatableNumericValue | `${number}%`;
|
|
248
278
|
} & {
|
|
249
279
|
perspective?: undefined;
|
|
250
280
|
rotate?: undefined;
|
|
@@ -259,7 +289,7 @@ declare const useFieldType: (props: UseFieldTypeProps) => {
|
|
|
259
289
|
skewY?: undefined;
|
|
260
290
|
matrix?: undefined;
|
|
261
291
|
}) | ({
|
|
262
|
-
translateY: import("react-native/types").AnimatableNumericValue
|
|
292
|
+
translateY: import("react-native/types").AnimatableNumericValue | `${number}%`;
|
|
263
293
|
} & {
|
|
264
294
|
perspective?: undefined;
|
|
265
295
|
rotate?: undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { StyleSheet, Animated, Easing } from 'react-native';
|
|
3
3
|
import { Colors } from "../../style";
|
|
4
|
-
import { StyleUtils } from "../../utils";
|
|
5
4
|
import { asBaseComponent, forwardRef } from "../../commons/new";
|
|
6
5
|
import TouchableOpacity from "../touchableOpacity";
|
|
7
6
|
import View from "../view";
|
|
@@ -180,6 +179,13 @@ class RadioButton extends PureComponent {
|
|
|
180
179
|
}]} />
|
|
181
180
|
</View>;
|
|
182
181
|
}
|
|
182
|
+
getAccessibleHitSlop(size) {
|
|
183
|
+
const verticalPadding = Math.max(0, (48 - size) / 2);
|
|
184
|
+
return {
|
|
185
|
+
top: verticalPadding,
|
|
186
|
+
bottom: verticalPadding
|
|
187
|
+
};
|
|
188
|
+
}
|
|
183
189
|
render() {
|
|
184
190
|
const {
|
|
185
191
|
onPress,
|
|
@@ -189,13 +195,9 @@ class RadioButton extends PureComponent {
|
|
|
189
195
|
...others
|
|
190
196
|
} = this.props;
|
|
191
197
|
const Container = onPress || onValueChange ? TouchableOpacity : View;
|
|
192
|
-
const hitSlopValue = StyleUtils.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE);
|
|
193
198
|
return (
|
|
194
199
|
// @ts-ignore
|
|
195
|
-
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()} hitSlop={
|
|
196
|
-
top: hitSlopValue,
|
|
197
|
-
bottom: hitSlopValue
|
|
198
|
-
}}>
|
|
200
|
+
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()} hitSlop={this.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
|
|
199
201
|
{!contentOnLeft && this.renderButton()}
|
|
200
202
|
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
|
|
201
203
|
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
|
|
@@ -6,7 +6,7 @@ import { GradientSliderProps, GradientSliderTypes } from './types';
|
|
|
6
6
|
type Props<T> = GradientSliderProps<T> & ForwardRefInjectedProps;
|
|
7
7
|
declare const _default: React.ForwardRefExoticComponent<Omit<import("./types").SliderProps, "onValueChange"> & {
|
|
8
8
|
color?: string | import("tinycolor2").ColorFormats.HSLA | undefined;
|
|
9
|
-
type?: "default" | "hue" | "
|
|
9
|
+
type?: "default" | "hue" | "saturation" | "lightness" | GradientSliderTypes | undefined;
|
|
10
10
|
gradientSteps?: number | undefined;
|
|
11
11
|
onValueChange?: ((value: string, alfa: number) => void) | undefined;
|
|
12
12
|
accessible?: boolean | undefined;
|
|
@@ -23,6 +23,8 @@ function SortableItem(props) {
|
|
|
23
23
|
const currIndex = useSharedValue(initialIndex.value);
|
|
24
24
|
const translateX = useSharedValue(0);
|
|
25
25
|
const translateY = useSharedValue(0);
|
|
26
|
+
const zIndex = useSharedValue(0);
|
|
27
|
+
const scale = useSharedValue(1);
|
|
26
28
|
const isDragging = useSharedValue(false);
|
|
27
29
|
const tempItemsOrder = useSharedValue(itemsOrder.value);
|
|
28
30
|
const tempTranslateX = useSharedValue(0);
|
|
@@ -85,6 +87,15 @@ function SortableItem(props) {
|
|
|
85
87
|
translateY.value = withTiming(translation.y, animationConfig);
|
|
86
88
|
}
|
|
87
89
|
}, []);
|
|
90
|
+
useAnimatedReaction(() => isDragging.value, (isDragging, wasDragging) => {
|
|
91
|
+
if (isDragging && !wasDragging) {
|
|
92
|
+
zIndex.value = withTiming(100, animationConfig);
|
|
93
|
+
scale.value = withSpring(1.1);
|
|
94
|
+
} else if (!isDragging && wasDragging) {
|
|
95
|
+
zIndex.value = withTiming(0, animationConfig);
|
|
96
|
+
scale.value = withSpring(1);
|
|
97
|
+
}
|
|
98
|
+
}, []);
|
|
88
99
|
const onLayout = useCallback(event => {
|
|
89
100
|
'worklet';
|
|
90
101
|
|
|
@@ -148,16 +159,14 @@ function SortableItem(props) {
|
|
|
148
159
|
}
|
|
149
160
|
});
|
|
150
161
|
const animatedStyle = useAnimatedStyle(() => {
|
|
151
|
-
const scale = withSpring(isDragging.value ? 1.1 : 1);
|
|
152
|
-
const zIndex = isDragging.value ? 100 : withTiming(0, animationConfig);
|
|
153
162
|
return {
|
|
154
|
-
zIndex,
|
|
163
|
+
zIndex: Math.round(zIndex.value),
|
|
155
164
|
transform: [{
|
|
156
165
|
translateX: translateX.value
|
|
157
166
|
}, {
|
|
158
167
|
translateY: translateY.value
|
|
159
168
|
}, {
|
|
160
|
-
scale
|
|
169
|
+
scale: scale.value
|
|
161
170
|
}]
|
|
162
171
|
};
|
|
163
172
|
});
|
|
@@ -51,6 +51,8 @@ const SortableListItem = props => {
|
|
|
51
51
|
});
|
|
52
52
|
const currIndex = useSharedValue(initialIndex.value);
|
|
53
53
|
const translation = useSharedValue(0);
|
|
54
|
+
const zIndex = useSharedValue(0);
|
|
55
|
+
const scale = useSharedValue(1);
|
|
54
56
|
const isDragging = useSharedValue(false);
|
|
55
57
|
const draggedItemShadow = useSharedValue(StyleUtils.unpackStyle({
|
|
56
58
|
...Shadows.sh30.bottom,
|
|
@@ -78,6 +80,15 @@ const SortableListItem = props => {
|
|
|
78
80
|
translation.value = withTiming(_translation, animationConfig);
|
|
79
81
|
}
|
|
80
82
|
}, []);
|
|
83
|
+
useAnimatedReaction(() => isDragging.value, (isDragging, wasDragging) => {
|
|
84
|
+
if (isDragging && !wasDragging) {
|
|
85
|
+
zIndex.value = withTiming(100, animationConfig);
|
|
86
|
+
scale.value = withSpring(propsScale);
|
|
87
|
+
} else if (!isDragging && wasDragging) {
|
|
88
|
+
zIndex.value = withTiming(0, animationConfig);
|
|
89
|
+
scale.value = withSpring(1);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
81
92
|
const dragOnLongPressGesture = Gesture.Pan().activateAfterLongPress(250).enabled(!locked).onStart(() => {
|
|
82
93
|
isDragging.value = true;
|
|
83
94
|
translation.value = getTranslationByIndexChange(currIndex.value, initialIndex.value, itemSize.value);
|
|
@@ -143,20 +154,18 @@ const SortableListItem = props => {
|
|
|
143
154
|
}
|
|
144
155
|
});
|
|
145
156
|
const draggedAnimatedStyle = useAnimatedStyle(() => {
|
|
146
|
-
const scale = withSpring(isDragging.value ? propsScale : 1);
|
|
147
|
-
const zIndex = isDragging.value ? 100 : withTiming(0, animationConfig);
|
|
148
157
|
const opacity = isDragging.value ? 0.95 : 1;
|
|
149
158
|
const shadow = isDragging.value ? draggedItemShadow.value : defaultItemShadow.value;
|
|
150
159
|
return {
|
|
151
160
|
backgroundColor: itemProps?.backgroundColor ?? LIST_ITEM_BACKGROUND,
|
|
152
161
|
// required for elevation to work in Android
|
|
153
|
-
zIndex,
|
|
162
|
+
zIndex: Math.round(zIndex.value),
|
|
154
163
|
transform: [horizontal ? {
|
|
155
164
|
translateX: translation.value
|
|
156
165
|
} : {
|
|
157
166
|
translateY: translation.value
|
|
158
167
|
}, {
|
|
159
|
-
scale
|
|
168
|
+
scale: scale.value
|
|
160
169
|
}],
|
|
161
170
|
opacity,
|
|
162
171
|
...itemProps?.margins,
|