@legendapp/list 3.0.0-beta.37 → 3.0.0-beta.39
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/animated.d.ts +7 -4
- package/index.d.ts +9 -11
- package/index.js +85 -48
- package/index.mjs +86 -49
- package/index.native.js +79 -50
- package/index.native.mjs +80 -51
- package/keyboard-test.d.ts +206 -0
- package/keyboard-test.js +34 -0
- package/keyboard-test.mjs +13 -0
- package/keyboard.d.ts +4 -2
- package/package.json +6 -6
- package/react-native.d.ts +10 -12
- package/react-native.js +82 -51
- package/react-native.mjs +83 -52
- package/react.d.ts +9 -11
- package/react.js +85 -48
- package/react.mjs +86 -49
- package/reanimated.d.ts +12 -9
- package/reanimated.js +34 -19
- package/reanimated.mjs +34 -19
- package/section-list.d.ts +18 -16
- package/keyboard-controller.d.ts +0 -622
- package/keyboard-controller.js +0 -69
- package/keyboard-controller.mjs +0 -48
package/keyboard-controller.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useState, forwardRef } from 'react';
|
|
3
|
-
import { StyleSheet } from 'react-native';
|
|
4
|
-
import { useKeyboardHandler } from 'react-native-keyboard-controller';
|
|
5
|
-
import { runOnJS } from 'react-native-reanimated';
|
|
6
|
-
import { LegendList as LegendList$1 } from '@legendapp/list/react-native';
|
|
7
|
-
|
|
8
|
-
// src/integrations/keyboard-controller.tsx
|
|
9
|
-
var typedForwardRef = forwardRef;
|
|
10
|
-
var LegendList = typedForwardRef(function LegendList2(props, forwardedRef) {
|
|
11
|
-
const {
|
|
12
|
-
LegendList: LegendListProp,
|
|
13
|
-
contentContainerStyle: contentContainerStyleProp,
|
|
14
|
-
scrollIndicatorInsets: scrollIndicatorInsetsProp,
|
|
15
|
-
...rest
|
|
16
|
-
} = props;
|
|
17
|
-
const [padding, setPadding] = useState(0);
|
|
18
|
-
const updatePadding = (height) => {
|
|
19
|
-
setPadding(height);
|
|
20
|
-
};
|
|
21
|
-
useKeyboardHandler({
|
|
22
|
-
onEnd: (e) => {
|
|
23
|
-
"worklet";
|
|
24
|
-
runOnJS(updatePadding)(e.height);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
const LegendListComponent = LegendListProp != null ? LegendListProp : LegendList$1;
|
|
28
|
-
const contentContainerStyleFlattened = StyleSheet.flatten(contentContainerStyleProp) || {};
|
|
29
|
-
const contentContainerStyle = { ...contentContainerStyleFlattened, paddingTop: padding };
|
|
30
|
-
const scrollIndicatorInsets = scrollIndicatorInsetsProp ? { ...scrollIndicatorInsetsProp } : {};
|
|
31
|
-
if (!props.horizontal) {
|
|
32
|
-
scrollIndicatorInsets.top = ((scrollIndicatorInsets == null ? void 0 : scrollIndicatorInsets.top) || 0) + padding;
|
|
33
|
-
}
|
|
34
|
-
return (
|
|
35
|
-
// @ts-expect-error TODO: Fix this type
|
|
36
|
-
/* @__PURE__ */ React.createElement(
|
|
37
|
-
LegendListComponent,
|
|
38
|
-
{
|
|
39
|
-
...rest,
|
|
40
|
-
contentContainerStyle,
|
|
41
|
-
ref: forwardedRef,
|
|
42
|
-
scrollIndicatorInsets
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export { LegendList };
|