@tamagui/scroll-view 2.7.7 → 3.0.0-beta.643.1
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/dist/cjs/ScrollView.cjs +22 -31
- package/dist/cjs/ScrollView.native.cjs +35 -0
- package/dist/cjs/ScrollView.native.js +21 -30
- package/dist/cjs/ScrollView.native.js.map +1 -1
- package/dist/cjs/WebScrollView.cjs +270 -0
- package/dist/cjs/WebScrollView.native.cjs +346 -0
- package/dist/cjs/WebScrollView.native.js +348 -0
- package/dist/cjs/WebScrollView.native.js.map +1 -0
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/web.cjs +25 -0
- package/dist/esm/ScrollView.mjs +9 -13
- package/dist/esm/ScrollView.mjs.map +1 -1
- package/dist/esm/ScrollView.native.js +8 -13
- package/dist/esm/ScrollView.native.js.map +1 -1
- package/dist/esm/WebScrollView.mjs +244 -0
- package/dist/esm/WebScrollView.mjs.map +1 -0
- package/dist/esm/WebScrollView.native.js +318 -0
- package/dist/esm/WebScrollView.native.js.map +1 -0
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +1 -2
- package/dist/esm/web.mjs +3 -0
- package/dist/jsx/ScrollView.mjs +9 -13
- package/dist/jsx/ScrollView.mjs.map +1 -1
- package/dist/jsx/ScrollView.native.cjs +35 -0
- package/dist/jsx/ScrollView.native.js +21 -30
- package/dist/jsx/ScrollView.native.js.map +1 -1
- package/dist/jsx/WebScrollView.mjs +244 -0
- package/dist/jsx/WebScrollView.mjs.map +1 -0
- package/dist/jsx/WebScrollView.native.cjs +346 -0
- package/dist/jsx/WebScrollView.native.js +348 -0
- package/dist/jsx/WebScrollView.native.js.map +1 -0
- package/dist/jsx/index.js +1 -2
- package/dist/jsx/index.mjs +1 -2
- package/dist/jsx/index.native.cjs +21 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/web.mjs +3 -0
- package/package.json +13 -5
- package/src/ScrollView.native.tsx +21 -0
- package/src/ScrollView.tsx +5 -10
- package/src/WebScrollView.tsx +379 -0
- package/src/index.ts +1 -0
- package/src/web.ts +8 -0
- package/types/ScrollView.d.ts +50 -9
- package/types/ScrollView.d.ts.map +1 -1
- package/types/ScrollView.native.d.ts +53 -0
- package/types/ScrollView.native.d.ts.map +1 -0
- package/types/WebScrollView.d.ts +20 -0
- package/types/WebScrollView.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/web.d.ts +4 -0
- package/types/web.d.ts.map +1 -0
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { View as TamaguiView } from '@tamagui/web'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
// loosely typed to map the react-native ScrollView prop surface onto a
|
|
5
|
+
// tamagui View without fighting the strict styled-view prop types.
|
|
6
|
+
const View = TamaguiView as any
|
|
7
|
+
|
|
8
|
+
// clean-room web ScrollView: an overflow-scrolling tamagui View that maps the
|
|
9
|
+
// subset of the react-native ScrollView API that tamagui + its consumers use.
|
|
10
|
+
// this replaces the previous dependency on react-native (aliased to
|
|
11
|
+
// react-native-web-lite) so @tamagui/scroll-view no longer pulls react-native
|
|
12
|
+
// into web bundles. the native implementation lives in ScrollView.native.tsx.
|
|
13
|
+
|
|
14
|
+
export interface ScrollViewMethods {
|
|
15
|
+
getScrollResponder: () => any
|
|
16
|
+
getScrollableNode: () => HTMLElement
|
|
17
|
+
getInnerViewNode: () => HTMLElement
|
|
18
|
+
getInnerViewRef: () => HTMLElement
|
|
19
|
+
getNativeScrollRef: () => HTMLElement
|
|
20
|
+
scrollTo: (options?: { x?: number; y?: number; animated?: boolean }) => void
|
|
21
|
+
scrollToEnd: (options?: { animated?: boolean }) => void
|
|
22
|
+
flashScrollIndicators: () => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ScrollViewRef = HTMLElement & ScrollViewMethods
|
|
26
|
+
|
|
27
|
+
function mergeRefs(...refs: any[]) {
|
|
28
|
+
return (node: any) => {
|
|
29
|
+
for (const ref of refs) {
|
|
30
|
+
if (!ref) continue
|
|
31
|
+
if (typeof ref === 'function') ref(node)
|
|
32
|
+
else ref.current = node
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function normalizeScrollEvent(e: any) {
|
|
38
|
+
const target = e.target
|
|
39
|
+
return {
|
|
40
|
+
nativeEvent: {
|
|
41
|
+
contentOffset: {
|
|
42
|
+
get x() {
|
|
43
|
+
return target.scrollLeft
|
|
44
|
+
},
|
|
45
|
+
get y() {
|
|
46
|
+
return target.scrollTop
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
contentSize: {
|
|
50
|
+
get height() {
|
|
51
|
+
return target.scrollHeight
|
|
52
|
+
},
|
|
53
|
+
get width() {
|
|
54
|
+
return target.scrollWidth
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
layoutMeasurement: {
|
|
58
|
+
get height() {
|
|
59
|
+
return target.offsetHeight
|
|
60
|
+
},
|
|
61
|
+
get width() {
|
|
62
|
+
return target.offsetWidth
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
timeStamp: Date.now(),
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function shouldEmitScrollEvent(lastTick: number, eventThrottle: number) {
|
|
71
|
+
const timeSinceLastTick = Date.now() - lastTick
|
|
72
|
+
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// tamagui hands styled(non-tamagui) bases react-native-web style objects: real
|
|
76
|
+
// style values are plain keys, resolved atomic styles arrive as { $$css: true,
|
|
77
|
+
// className: className } maps. split those apart so classNames land on className
|
|
78
|
+
// and only real values land on style (merging them poisons the whole object as a
|
|
79
|
+
// className map). arrays are flattened recursively.
|
|
80
|
+
function resolveStyles(...inputs: any[]): { style: any; className: string } {
|
|
81
|
+
const style: any = {}
|
|
82
|
+
const classNames: string[] = []
|
|
83
|
+
const walk = (s: any) => {
|
|
84
|
+
if (!s) return
|
|
85
|
+
if (Array.isArray(s)) {
|
|
86
|
+
for (const item of s) walk(item)
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
if (s.$$css) {
|
|
90
|
+
for (const k in s) {
|
|
91
|
+
if (k !== '$$css') classNames.push(s[k])
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
Object.assign(style, s)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const input of inputs) walk(input)
|
|
98
|
+
return { style, className: classNames.join(' ') }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function joinClassNames(...parts: (string | undefined | false)[]): string | undefined {
|
|
102
|
+
const joined = parts.filter(Boolean).join(' ').trim()
|
|
103
|
+
return joined || undefined
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const commonStyle = {
|
|
107
|
+
flexGrow: 1,
|
|
108
|
+
flexShrink: 1,
|
|
109
|
+
} as const
|
|
110
|
+
|
|
111
|
+
const styles = {
|
|
112
|
+
baseVertical: {
|
|
113
|
+
...commonStyle,
|
|
114
|
+
flexDirection: 'column',
|
|
115
|
+
overflowX: 'hidden',
|
|
116
|
+
overflowY: 'auto',
|
|
117
|
+
},
|
|
118
|
+
baseHorizontal: {
|
|
119
|
+
...commonStyle,
|
|
120
|
+
flexDirection: 'row',
|
|
121
|
+
overflowX: 'auto',
|
|
122
|
+
overflowY: 'hidden',
|
|
123
|
+
},
|
|
124
|
+
contentContainerHorizontal: {
|
|
125
|
+
flexDirection: 'row',
|
|
126
|
+
},
|
|
127
|
+
contentContainerCenterContent: {
|
|
128
|
+
justifyContent: 'center',
|
|
129
|
+
flexGrow: 1,
|
|
130
|
+
},
|
|
131
|
+
stickyHeader: {
|
|
132
|
+
position: 'sticky',
|
|
133
|
+
top: 0,
|
|
134
|
+
zIndex: 10,
|
|
135
|
+
},
|
|
136
|
+
pagingEnabledHorizontal: {
|
|
137
|
+
scrollSnapType: 'x mandatory',
|
|
138
|
+
},
|
|
139
|
+
pagingEnabledVertical: {
|
|
140
|
+
scrollSnapType: 'y mandatory',
|
|
141
|
+
},
|
|
142
|
+
pagingEnabledChild: {
|
|
143
|
+
scrollSnapAlign: 'start',
|
|
144
|
+
},
|
|
145
|
+
scrollDisabled: {
|
|
146
|
+
overflowX: 'hidden',
|
|
147
|
+
overflowY: 'hidden',
|
|
148
|
+
touchAction: 'none',
|
|
149
|
+
},
|
|
150
|
+
} as const
|
|
151
|
+
|
|
152
|
+
export const WebScrollView = React.forwardRef<ScrollViewRef, any>(
|
|
153
|
+
(props, forwardedRef) => {
|
|
154
|
+
const {
|
|
155
|
+
children,
|
|
156
|
+
contentContainerStyle,
|
|
157
|
+
horizontal,
|
|
158
|
+
onContentSizeChange,
|
|
159
|
+
onScroll,
|
|
160
|
+
refreshControl,
|
|
161
|
+
stickyHeaderIndices,
|
|
162
|
+
pagingEnabled,
|
|
163
|
+
centerContent,
|
|
164
|
+
scrollEnabled = true,
|
|
165
|
+
scrollEventThrottle = 0,
|
|
166
|
+
showsHorizontalScrollIndicator,
|
|
167
|
+
showsVerticalScrollIndicator,
|
|
168
|
+
style,
|
|
169
|
+
// strip react-native-only props that shouldn't reach the DOM
|
|
170
|
+
keyboardShouldPersistTaps,
|
|
171
|
+
keyboardDismissMode,
|
|
172
|
+
contentOffset,
|
|
173
|
+
contentInset,
|
|
174
|
+
contentInsetAdjustmentBehavior,
|
|
175
|
+
decelerationRate,
|
|
176
|
+
directionalLockEnabled,
|
|
177
|
+
disableIntervalMomentum,
|
|
178
|
+
disableScrollViewPanResponder,
|
|
179
|
+
endFillColor,
|
|
180
|
+
fadingEdgeLength,
|
|
181
|
+
indicatorStyle,
|
|
182
|
+
invertStickyHeaders,
|
|
183
|
+
maintainVisibleContentPosition,
|
|
184
|
+
maximumZoomScale,
|
|
185
|
+
minimumZoomScale,
|
|
186
|
+
nestedScrollEnabled,
|
|
187
|
+
onScrollToTop,
|
|
188
|
+
overScrollMode,
|
|
189
|
+
pinchGestureEnabled,
|
|
190
|
+
removeClippedSubviews,
|
|
191
|
+
scrollIndicatorInsets,
|
|
192
|
+
scrollPerfTag,
|
|
193
|
+
scrollToOverflowEnabled,
|
|
194
|
+
snapToAlignment,
|
|
195
|
+
snapToEnd,
|
|
196
|
+
snapToInterval,
|
|
197
|
+
snapToOffsets,
|
|
198
|
+
snapToStart,
|
|
199
|
+
bounces,
|
|
200
|
+
...rest
|
|
201
|
+
} = props
|
|
202
|
+
|
|
203
|
+
// tamagui treats this styled base as a react-native component, so it hands
|
|
204
|
+
// data-* attributes down as a `dataSet` map (the react-native-web convention).
|
|
205
|
+
// @tamagui/web's View doesn't expand that back, so do it here to keep
|
|
206
|
+
// data-testid and friends on the DOM node.
|
|
207
|
+
const { dataSet, ...domRest } = rest as any
|
|
208
|
+
const dataAttrs: Record<string, any> = {}
|
|
209
|
+
if (dataSet) {
|
|
210
|
+
for (const key in dataSet) {
|
|
211
|
+
dataAttrs[`data-${key}`] = dataSet[key]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const scrollNodeRef = React.useRef<any>(null)
|
|
216
|
+
const innerViewRef = React.useRef<any>(null)
|
|
217
|
+
const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 })
|
|
218
|
+
const scrollTimeout = React.useRef<any>(null)
|
|
219
|
+
|
|
220
|
+
const scrollTo = (options?: { x?: number; y?: number; animated?: boolean }) => {
|
|
221
|
+
const node = scrollNodeRef.current
|
|
222
|
+
if (node == null) return
|
|
223
|
+
const { x = 0, y = 0, animated = true } = options || {}
|
|
224
|
+
if (typeof node.scroll === 'function') {
|
|
225
|
+
node.scroll({ top: y, left: x, behavior: animated ? 'smooth' : 'auto' })
|
|
226
|
+
} else {
|
|
227
|
+
node.scrollLeft = x
|
|
228
|
+
node.scrollTop = y
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const scrollToEnd = (options?: { animated?: boolean }) => {
|
|
233
|
+
const node = scrollNodeRef.current
|
|
234
|
+
if (node == null) return
|
|
235
|
+
const animated = (options && options.animated) !== false
|
|
236
|
+
const x = horizontal ? node.scrollWidth : 0
|
|
237
|
+
const y = horizontal ? 0 : node.scrollHeight
|
|
238
|
+
scrollTo({ x, y, animated })
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const setScrollNodeRef = React.useCallback(
|
|
242
|
+
(node: any) => {
|
|
243
|
+
scrollNodeRef.current = node
|
|
244
|
+
if (node != null) {
|
|
245
|
+
node.getScrollResponder = () => node
|
|
246
|
+
node.getScrollableNode = () => node
|
|
247
|
+
node.getInnerViewNode = () => innerViewRef.current
|
|
248
|
+
node.getInnerViewRef = () => innerViewRef.current
|
|
249
|
+
node.getNativeScrollRef = () => node
|
|
250
|
+
node.scrollTo = scrollTo
|
|
251
|
+
node.scrollToEnd = scrollToEnd
|
|
252
|
+
node.flashScrollIndicators = () => {}
|
|
253
|
+
}
|
|
254
|
+
mergeRefs(forwardedRef)(node)
|
|
255
|
+
},
|
|
256
|
+
[forwardedRef, horizontal]
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
function handleScroll(e: any) {
|
|
260
|
+
e.stopPropagation()
|
|
261
|
+
if (e.target !== scrollNodeRef.current) return
|
|
262
|
+
if (scrollTimeout.current != null) {
|
|
263
|
+
clearTimeout(scrollTimeout.current)
|
|
264
|
+
}
|
|
265
|
+
scrollTimeout.current = setTimeout(() => {
|
|
266
|
+
scrollState.current.isScrolling = false
|
|
267
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
268
|
+
}, 100)
|
|
269
|
+
if (scrollState.current.isScrolling) {
|
|
270
|
+
if (
|
|
271
|
+
shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)
|
|
272
|
+
) {
|
|
273
|
+
scrollState.current.scrollLastTick = Date.now()
|
|
274
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
scrollState.current.isScrolling = true
|
|
278
|
+
scrollState.current.scrollLastTick = Date.now()
|
|
279
|
+
onScroll?.(normalizeScrollEvent(e))
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const handleContentLayout = onContentSizeChange
|
|
284
|
+
? (e: any) => {
|
|
285
|
+
const { width, height } = e.nativeEvent.layout
|
|
286
|
+
onContentSizeChange(width, height)
|
|
287
|
+
}
|
|
288
|
+
: undefined
|
|
289
|
+
|
|
290
|
+
const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices)
|
|
291
|
+
const renderedChildren =
|
|
292
|
+
hasStickyHeaderIndices || pagingEnabled
|
|
293
|
+
? React.Children.map(children, (child, i) => {
|
|
294
|
+
const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1
|
|
295
|
+
if (child != null && (isSticky || pagingEnabled)) {
|
|
296
|
+
const resolved = resolveStyles(
|
|
297
|
+
isSticky && styles.stickyHeader,
|
|
298
|
+
pagingEnabled && styles.pagingEnabledChild
|
|
299
|
+
)
|
|
300
|
+
return (
|
|
301
|
+
<View
|
|
302
|
+
style={resolved.style}
|
|
303
|
+
className={joinClassNames(resolved.className)}
|
|
304
|
+
>
|
|
305
|
+
{child}
|
|
306
|
+
</View>
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
return child
|
|
310
|
+
})
|
|
311
|
+
: children
|
|
312
|
+
|
|
313
|
+
const contentResolved = resolveStyles(
|
|
314
|
+
horizontal && styles.contentContainerHorizontal,
|
|
315
|
+
centerContent && styles.contentContainerCenterContent,
|
|
316
|
+
contentContainerStyle
|
|
317
|
+
)
|
|
318
|
+
const contentContainer = (
|
|
319
|
+
<View
|
|
320
|
+
ref={innerViewRef}
|
|
321
|
+
onLayout={handleContentLayout}
|
|
322
|
+
style={contentResolved.style}
|
|
323
|
+
className={joinClassNames(contentResolved.className)}
|
|
324
|
+
>
|
|
325
|
+
{renderedChildren}
|
|
326
|
+
</View>
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical
|
|
330
|
+
const pagingEnabledStyle = horizontal
|
|
331
|
+
? styles.pagingEnabledHorizontal
|
|
332
|
+
: styles.pagingEnabledVertical
|
|
333
|
+
|
|
334
|
+
const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false
|
|
335
|
+
const hideVerticalScrollbar = showsVerticalScrollIndicator === false
|
|
336
|
+
const extraClassName =
|
|
337
|
+
(hideHorizontalScrollbar ? ' _hsb-x' : '') +
|
|
338
|
+
(hideVerticalScrollbar ? ' _hsb-y' : '')
|
|
339
|
+
|
|
340
|
+
const scrollResolved = resolveStyles(
|
|
341
|
+
baseStyle,
|
|
342
|
+
pagingEnabled && pagingEnabledStyle,
|
|
343
|
+
style,
|
|
344
|
+
!scrollEnabled && styles.scrollDisabled
|
|
345
|
+
)
|
|
346
|
+
const scrollView = (
|
|
347
|
+
<View
|
|
348
|
+
{...domRest}
|
|
349
|
+
{...dataAttrs}
|
|
350
|
+
className={joinClassNames(
|
|
351
|
+
domRest.className,
|
|
352
|
+
scrollResolved.className,
|
|
353
|
+
extraClassName
|
|
354
|
+
)}
|
|
355
|
+
ref={setScrollNodeRef}
|
|
356
|
+
onScroll={handleScroll}
|
|
357
|
+
style={scrollResolved.style}
|
|
358
|
+
>
|
|
359
|
+
{contentContainer}
|
|
360
|
+
</View>
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
if (refreshControl) {
|
|
364
|
+
const refreshResolved = resolveStyles(baseStyle, style)
|
|
365
|
+
return React.cloneElement(
|
|
366
|
+
refreshControl,
|
|
367
|
+
{
|
|
368
|
+
style: refreshResolved.style,
|
|
369
|
+
className: joinClassNames(refreshResolved.className),
|
|
370
|
+
},
|
|
371
|
+
scrollView
|
|
372
|
+
)
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return scrollView
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
WebScrollView.displayName = 'ScrollView'
|
package/src/index.ts
CHANGED
package/src/web.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// cycle-free entry for react-native-web-lite: always the web implementation,
|
|
2
|
+
// never the .native file (which imports 'react-native' — in bundling contexts
|
|
3
|
+
// where react-native aliases to lite, importing the package root from lite
|
|
4
|
+
// would resolve the react-native condition and create a require cycle that
|
|
5
|
+
// leaves ScrollView undefined)
|
|
6
|
+
export { ScrollView } from './ScrollView'
|
|
7
|
+
export type { ScrollViewProps } from './ScrollView'
|
|
8
|
+
export type { ScrollViewMethods, ScrollViewRef } from './WebScrollView'
|
package/types/ScrollView.d.ts
CHANGED
|
@@ -1,18 +1,59 @@
|
|
|
1
1
|
import type { GetProps, GetRef } from '@tamagui/web';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const ScrollView: import("react").FunctionComponent<Omit<import("@tamagui/web").TamaguiComponentPropsBaseBase & Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>, "contentContainerStyle" | keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase & {
|
|
3
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>>, {
|
|
4
|
+
acceptsClassName: true;
|
|
5
|
+
neverFlatten: true;
|
|
5
6
|
accept: {
|
|
6
|
-
readonly contentContainerStyle:
|
|
7
|
+
readonly contentContainerStyle: 'style';
|
|
7
8
|
};
|
|
8
9
|
}>> | undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase & {
|
|
11
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>>, {
|
|
12
|
+
acceptsClassName: true;
|
|
13
|
+
neverFlatten: true;
|
|
14
|
+
accept: {
|
|
15
|
+
readonly contentContainerStyle: 'style';
|
|
16
|
+
};
|
|
17
|
+
}>> | undefined;
|
|
18
|
+
}>> & {
|
|
19
|
+
ref?: import("react").Ref<import("./WebScrollView").ScrollViewRef> | undefined;
|
|
20
|
+
}> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("./WebScrollView").ScrollViewRef, import("@tamagui/web").TamaguiComponentPropsBaseBase & Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>, import("@tamagui/web").StackStyleBase & {
|
|
21
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>>, {
|
|
22
|
+
acceptsClassName: true;
|
|
23
|
+
neverFlatten: true;
|
|
24
|
+
accept: {
|
|
25
|
+
readonly contentContainerStyle: 'style';
|
|
26
|
+
};
|
|
27
|
+
}>> | undefined;
|
|
28
|
+
}, {}, {
|
|
29
|
+
acceptsClassName: true;
|
|
30
|
+
neverFlatten: true;
|
|
31
|
+
accept: {
|
|
32
|
+
readonly contentContainerStyle: 'style';
|
|
33
|
+
};
|
|
34
|
+
}> & Omit<{
|
|
35
|
+
acceptsClassName: true;
|
|
36
|
+
neverFlatten: true;
|
|
12
37
|
accept: {
|
|
13
|
-
readonly contentContainerStyle:
|
|
38
|
+
readonly contentContainerStyle: 'style';
|
|
14
39
|
};
|
|
15
|
-
}
|
|
40
|
+
}, "staticConfig"> & {
|
|
41
|
+
__tama: [import("@tamagui/web").TamaDefer, import("./WebScrollView").ScrollViewRef, import("@tamagui/web").TamaguiComponentPropsBaseBase & Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>, import("@tamagui/web").StackStyleBase & {
|
|
42
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<import("./WebScrollView").ScrollViewRef>>, {
|
|
43
|
+
acceptsClassName: true;
|
|
44
|
+
neverFlatten: true;
|
|
45
|
+
accept: {
|
|
46
|
+
readonly contentContainerStyle: 'style';
|
|
47
|
+
};
|
|
48
|
+
}>> | undefined;
|
|
49
|
+
}, {}, {
|
|
50
|
+
acceptsClassName: true;
|
|
51
|
+
neverFlatten: true;
|
|
52
|
+
accept: {
|
|
53
|
+
readonly contentContainerStyle: 'style';
|
|
54
|
+
};
|
|
55
|
+
}];
|
|
56
|
+
};
|
|
16
57
|
export type ScrollView = GetRef<typeof ScrollView>;
|
|
17
58
|
export type ScrollViewProps = GetProps<typeof ScrollView>;
|
|
18
59
|
//# sourceMappingURL=ScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../src/ScrollView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../src/ScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAIpD,eAAO,MAAM,UAAU;;;;;qBAUjB,qBAAqB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;iBAA9B,qBAAqB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAGnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AAElD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { GetProps, GetRef } from '@tamagui/web';
|
|
2
|
+
import { ScrollView as ScrollViewNative } from 'react-native';
|
|
3
|
+
export declare const ScrollView: import("react").FunctionComponent<Omit<import("@tamagui/web").TamaguiComponentPropsBaseBase & import("react-native").ScrollViewProps, "contentContainerStyle" | keyof import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase & {
|
|
4
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<typeof ScrollViewNative, {
|
|
5
|
+
neverFlatten: true;
|
|
6
|
+
accept: {
|
|
7
|
+
readonly contentContainerStyle: 'style';
|
|
8
|
+
};
|
|
9
|
+
}>> | undefined;
|
|
10
|
+
}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase & {
|
|
11
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<typeof ScrollViewNative, {
|
|
12
|
+
neverFlatten: true;
|
|
13
|
+
accept: {
|
|
14
|
+
readonly contentContainerStyle: 'style';
|
|
15
|
+
};
|
|
16
|
+
}>> | undefined;
|
|
17
|
+
}>> & {
|
|
18
|
+
ref?: import("react").Ref<ScrollViewNative> | undefined;
|
|
19
|
+
}> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, ScrollViewNative, import("@tamagui/web").TamaguiComponentPropsBaseBase & import("react-native").ScrollViewProps, import("@tamagui/web").StackStyleBase & {
|
|
20
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<typeof ScrollViewNative, {
|
|
21
|
+
neverFlatten: true;
|
|
22
|
+
accept: {
|
|
23
|
+
readonly contentContainerStyle: 'style';
|
|
24
|
+
};
|
|
25
|
+
}>> | undefined;
|
|
26
|
+
}, {}, {
|
|
27
|
+
neverFlatten: true;
|
|
28
|
+
accept: {
|
|
29
|
+
readonly contentContainerStyle: 'style';
|
|
30
|
+
};
|
|
31
|
+
}> & Omit<{
|
|
32
|
+
neverFlatten: true;
|
|
33
|
+
accept: {
|
|
34
|
+
readonly contentContainerStyle: 'style';
|
|
35
|
+
};
|
|
36
|
+
}, "staticConfig"> & {
|
|
37
|
+
__tama: [import("@tamagui/web").TamaDefer, ScrollViewNative, import("@tamagui/web").TamaguiComponentPropsBaseBase & import("react-native").ScrollViewProps, import("@tamagui/web").StackStyleBase & {
|
|
38
|
+
readonly contentContainerStyle?: Partial<import("@tamagui/web").InferStyleProps<typeof ScrollViewNative, {
|
|
39
|
+
neverFlatten: true;
|
|
40
|
+
accept: {
|
|
41
|
+
readonly contentContainerStyle: 'style';
|
|
42
|
+
};
|
|
43
|
+
}>> | undefined;
|
|
44
|
+
}, {}, {
|
|
45
|
+
neverFlatten: true;
|
|
46
|
+
accept: {
|
|
47
|
+
readonly contentContainerStyle: 'style';
|
|
48
|
+
};
|
|
49
|
+
}];
|
|
50
|
+
};
|
|
51
|
+
export type ScrollView = GetRef<typeof ScrollView>;
|
|
52
|
+
export type ScrollViewProps = GetProps<typeof ScrollView>;
|
|
53
|
+
//# sourceMappingURL=ScrollView.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollView.native.d.ts","sourceRoot":"","sources":["../src/ScrollView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE7D,eAAO,MAAM,UAAU;;;;qBASjB,qBAAqB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;iBAA9B,qBAAqB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;CAGnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AAElD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ScrollViewMethods {
|
|
3
|
+
getScrollResponder: () => any;
|
|
4
|
+
getScrollableNode: () => HTMLElement;
|
|
5
|
+
getInnerViewNode: () => HTMLElement;
|
|
6
|
+
getInnerViewRef: () => HTMLElement;
|
|
7
|
+
getNativeScrollRef: () => HTMLElement;
|
|
8
|
+
scrollTo: (options?: {
|
|
9
|
+
x?: number;
|
|
10
|
+
y?: number;
|
|
11
|
+
animated?: boolean;
|
|
12
|
+
}) => void;
|
|
13
|
+
scrollToEnd: (options?: {
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
flashScrollIndicators: () => void;
|
|
17
|
+
}
|
|
18
|
+
export type ScrollViewRef = HTMLElement & ScrollViewMethods;
|
|
19
|
+
export declare const WebScrollView: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<ScrollViewRef>>;
|
|
20
|
+
//# sourceMappingURL=WebScrollView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebScrollView.d.ts","sourceRoot":"","sources":["../src/WebScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,MAAM,GAAG,CAAA;IAC7B,iBAAiB,EAAE,MAAM,WAAW,CAAA;IACpC,gBAAgB,EAAE,MAAM,WAAW,CAAA;IACnC,eAAe,EAAE,MAAM,WAAW,CAAA;IAClC,kBAAkB,EAAE,MAAM,WAAW,CAAA;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IAC5E,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IACvD,qBAAqB,EAAE,MAAM,IAAI,CAAA;CAClC;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,iBAAiB,CAAA;AA+H3D,eAAO,MAAM,aAAa,wFAiOzB,CAAA"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
package/types/web.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/jsx/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/jsx/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|