@swan-io/lake 8.7.0 → 8.7.2
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
CHANGED
|
@@ -526,15 +526,10 @@ export const FixedListView = ({ data: originalData, mode = "tile", keyExtractor,
|
|
|
526
526
|
]);
|
|
527
527
|
// Used to fix some scrollbar behavior. See `main.css`.
|
|
528
528
|
useLayoutEffect(() => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
centerColumnsRef.current.setAttribute("data-hide-scrollbar", String(true));
|
|
534
|
-
}
|
|
535
|
-
if (horizontalScrollbarRef.current instanceof Element) {
|
|
536
|
-
horizontalScrollbarRef.current.setAttribute("data-force-scrollbar", String(true));
|
|
537
|
-
}
|
|
529
|
+
var _a, _b, _c, _d, _e, _f;
|
|
530
|
+
(_b = (_a = centerHeadersRef.current) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.setAttribute("data-hide-scrollbar", String(true));
|
|
531
|
+
(_d = (_c = centerColumnsRef.current) === null || _c === void 0 ? void 0 : _c.element) === null || _d === void 0 ? void 0 : _d.setAttribute("data-hide-scrollbar", String(true));
|
|
532
|
+
(_f = (_e = horizontalScrollbarRef.current) === null || _e === void 0 ? void 0 : _e.element) === null || _f === void 0 ? void 0 : _f.setAttribute("data-force-scrollbar", String(true));
|
|
538
533
|
}, []);
|
|
539
534
|
// To synchronize scrolls, we keep track of the initiator in order to ignore the scroll events
|
|
540
535
|
// we provoke ourselves with the sync.
|
|
@@ -547,9 +542,9 @@ export const FixedListView = ({ data: originalData, mode = "tile", keyExtractor,
|
|
|
547
542
|
isNotNullish(centerColumnsRef.current) &&
|
|
548
543
|
isNotNullish(horizontalScrollbarRef.current)) {
|
|
549
544
|
const SCROLL_THRESHOLD_MS = 500;
|
|
550
|
-
const centerColumns = centerColumnsRef.current;
|
|
551
|
-
const centerHeaders = centerHeadersRef.current;
|
|
552
|
-
const horizontalScrollbar = horizontalScrollbarRef.current;
|
|
545
|
+
const centerColumns = centerColumnsRef.current.element;
|
|
546
|
+
const centerHeaders = centerHeadersRef.current.element;
|
|
547
|
+
const horizontalScrollbar = horizontalScrollbarRef.current.element;
|
|
553
548
|
const onColumnsScroll = () => {
|
|
554
549
|
const now = Date.now();
|
|
555
550
|
if (lastHorizontalScroll.current.initiator === "columns" ||
|
|
@@ -125,7 +125,7 @@ const LakeSelectWithRef = ({ title, items, valueStyle, size, color = "current",
|
|
|
125
125
|
const isSmall = size === "small";
|
|
126
126
|
const itemValue = items.find(i => i.value === value);
|
|
127
127
|
const onKeyDown = useCallback((event) => {
|
|
128
|
-
var _a, _b;
|
|
128
|
+
var _a, _b, _c;
|
|
129
129
|
// this made a search not visible for user as the native select component
|
|
130
130
|
if (event.nativeEvent.key.length === 1) {
|
|
131
131
|
event.nativeEvent.stopPropagation();
|
|
@@ -135,9 +135,8 @@ const LakeSelectWithRef = ({ title, items, valueStyle, size, color = "current",
|
|
|
135
135
|
const selected = items[selectedIndex];
|
|
136
136
|
if (selected != null) {
|
|
137
137
|
if (visible) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
(_b = listItemRefs.current[selectedIndex]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
138
|
+
if (((_b = listRef.current) === null || _b === void 0 ? void 0 : _b.element) != null) {
|
|
139
|
+
(_c = listItemRefs.current[selectedIndex]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
else {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useImperativeHandle, useRef, } from "react";
|
|
3
3
|
import { StyleSheet, View, } from "react-native";
|
|
4
|
-
import { useMergeRefs } from "../hooks/useMergeRefs";
|
|
5
4
|
const styles = StyleSheet.create({
|
|
6
5
|
base: {
|
|
7
6
|
WebkitOverflowScrolling: "touch",
|
|
@@ -60,7 +59,6 @@ export const ScrollView = forwardRef(({ children, contentContainerStyle, horizon
|
|
|
60
59
|
const innerRef = useRef(null);
|
|
61
60
|
const stateRef = useRef({ lastTick: 0, scrolling: false });
|
|
62
61
|
const timeoutRef = useRef(null);
|
|
63
|
-
const mergedRef = useMergeRefs(innerRef, forwardedRef);
|
|
64
62
|
const handleOnScroll = useCallback((event) => {
|
|
65
63
|
event.stopPropagation();
|
|
66
64
|
// A scroll happened, so the scroll resets the scrollend timeout.
|
|
@@ -89,8 +87,11 @@ export const ScrollView = forwardRef(({ children, contentContainerStyle, horizon
|
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
}, []);
|
|
92
|
-
useImperativeHandle(
|
|
93
|
-
|
|
90
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
91
|
+
element: innerRef.current,
|
|
92
|
+
scrollTo,
|
|
93
|
+
}));
|
|
94
|
+
return (_jsx(View, { ...viewProps, ref: innerRef, onScroll: handleOnScroll, style: [
|
|
94
95
|
styles.base,
|
|
95
96
|
style,
|
|
96
97
|
horizontal && styles.horizontal,
|