@react-aria/virtualizer 3.0.0-nightly-641446f65-240905

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.
Files changed (40) hide show
  1. package/README.md +3 -0
  2. package/dist/ScrollView.main.js +214 -0
  3. package/dist/ScrollView.main.js.map +1 -0
  4. package/dist/ScrollView.mjs +204 -0
  5. package/dist/ScrollView.module.js +204 -0
  6. package/dist/ScrollView.module.js.map +1 -0
  7. package/dist/Virtualizer.main.js +88 -0
  8. package/dist/Virtualizer.main.js.map +1 -0
  9. package/dist/Virtualizer.mjs +79 -0
  10. package/dist/Virtualizer.module.js +79 -0
  11. package/dist/Virtualizer.module.js.map +1 -0
  12. package/dist/VirtualizerItem.main.js +82 -0
  13. package/dist/VirtualizerItem.main.js.map +1 -0
  14. package/dist/VirtualizerItem.mjs +72 -0
  15. package/dist/VirtualizerItem.module.js +72 -0
  16. package/dist/VirtualizerItem.module.js.map +1 -0
  17. package/dist/import.mjs +25 -0
  18. package/dist/main.js +38 -0
  19. package/dist/main.js.map +1 -0
  20. package/dist/module.js +25 -0
  21. package/dist/module.js.map +1 -0
  22. package/dist/types.d.ts +337 -0
  23. package/dist/types.d.ts.map +1 -0
  24. package/dist/useVirtualizerItem.main.js +53 -0
  25. package/dist/useVirtualizerItem.main.js.map +1 -0
  26. package/dist/useVirtualizerItem.mjs +48 -0
  27. package/dist/useVirtualizerItem.module.js +48 -0
  28. package/dist/useVirtualizerItem.module.js.map +1 -0
  29. package/dist/utils.main.js +80 -0
  30. package/dist/utils.main.js.map +1 -0
  31. package/dist/utils.mjs +73 -0
  32. package/dist/utils.module.js +73 -0
  33. package/dist/utils.module.js.map +1 -0
  34. package/package.json +40 -0
  35. package/src/ScrollView.tsx +246 -0
  36. package/src/Virtualizer.tsx +117 -0
  37. package/src/VirtualizerItem.tsx +87 -0
  38. package/src/index.ts +19 -0
  39. package/src/useVirtualizerItem.ts +54 -0
  40. package/src/utils.ts +107 -0
package/dist/module.js ADDED
@@ -0,0 +1,25 @@
1
+ import {Virtualizer as $6d0a5c394373ae64$export$89be5a243e59c4b2} from "./Virtualizer.module.js";
2
+ import {useVirtualizerItem as $47736c1e63ba1c6d$export$1da781778207e0a2} from "./useVirtualizerItem.module.js";
3
+ import {layoutInfoToStyle as $ccf8a0a04e4175ae$export$1481e64fbe01b8b3, VirtualizerItem as $ccf8a0a04e4175ae$export$6796df8ba7398521} from "./VirtualizerItem.module.js";
4
+ import {ScrollView as $44a6ee657928b002$export$5665e3d6be6adea, useScrollView as $44a6ee657928b002$export$2ea0c4974da4731b} from "./ScrollView.module.js";
5
+ import {getRTLOffsetType as $ce415dc67314b753$export$faf7630257ad4304, getScrollLeft as $ce415dc67314b753$export$1389d168952b34b5, setScrollLeft as $ce415dc67314b753$export$ed5fd5ffe5ab0ac} from "./utils.module.js";
6
+
7
+ /*
8
+ * Copyright 2020 Adobe. All rights reserved.
9
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License. You may obtain a copy
11
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software distributed under
14
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
+ * OF ANY KIND, either express or implied. See the License for the specific language
16
+ * governing permissions and limitations under the License.
17
+ */
18
+
19
+
20
+
21
+
22
+
23
+
24
+ export {$6d0a5c394373ae64$export$89be5a243e59c4b2 as Virtualizer, $47736c1e63ba1c6d$export$1da781778207e0a2 as useVirtualizerItem, $ccf8a0a04e4175ae$export$6796df8ba7398521 as VirtualizerItem, $ccf8a0a04e4175ae$export$1481e64fbe01b8b3 as layoutInfoToStyle, $44a6ee657928b002$export$5665e3d6be6adea as ScrollView, $44a6ee657928b002$export$2ea0c4974da4731b as useScrollView, $ce415dc67314b753$export$faf7630257ad4304 as getRTLOffsetType, $ce415dc67314b753$export$1389d168952b34b5 as getScrollLeft, $ce415dc67314b753$export$ed5fd5ffe5ab0ac as setScrollLeft};
25
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/virtualizer/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {RTLOffsetType} from './utils';\nexport type {VirtualizerItemOptions} from './useVirtualizerItem';\nexport {Virtualizer} from './Virtualizer';\nexport {useVirtualizerItem} from './useVirtualizerItem';\nexport {VirtualizerItem, layoutInfoToStyle} from './VirtualizerItem';\nexport {ScrollView, useScrollView} from './ScrollView';\nexport {getRTLOffsetType, getScrollLeft, setScrollLeft} from './utils';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,337 @@
1
+ import { Direction, Key, RefObject, Collection } from "@react-types/shared";
2
+ import { LayoutInfo, Size, Rect, Layout, ReusableView } from "@react-stately/virtualizer";
3
+ import React, { CSSProperties, HTMLAttributes, ReactNode, RefObject as _RefObject1, ReactElement } from "react";
4
+ export type RTLOffsetType = 'negative' | 'positive-descending' | 'positive-ascending';
5
+ export function getRTLOffsetType(recalculate?: boolean): RTLOffsetType;
6
+ export function getScrollLeft(node: Element, direction: Direction): number;
7
+ export function setScrollLeft(node: Element, direction: Direction, scrollLeft: number): void;
8
+ interface IVirtualizer {
9
+ updateItemSize(key: Key, size: Size): void;
10
+ }
11
+ export interface VirtualizerItemOptions {
12
+ layoutInfo: LayoutInfo;
13
+ virtualizer: IVirtualizer;
14
+ ref: RefObject<HTMLElement | null>;
15
+ }
16
+ export function useVirtualizerItem(options: VirtualizerItemOptions): {
17
+ updateSize: () => void;
18
+ };
19
+ interface ScrollViewProps extends HTMLAttributes<HTMLElement> {
20
+ contentSize: Size;
21
+ onVisibleRectChange: (rect: Rect) => void;
22
+ children?: ReactNode;
23
+ innerStyle?: CSSProperties;
24
+ onScrollStart?: () => void;
25
+ onScrollEnd?: () => void;
26
+ scrollDirection?: 'horizontal' | 'vertical' | 'both';
27
+ }
28
+ export const ScrollView: React.ForwardRefExoticComponent<ScrollViewProps & React.RefAttributes<HTMLDivElement>>;
29
+ export function useScrollView(props: ScrollViewProps, ref: _RefObject1<HTMLElement | null>): {
30
+ scrollViewProps: {
31
+ style: React.CSSProperties;
32
+ children?: ReactNode;
33
+ defaultChecked?: boolean | undefined;
34
+ defaultValue?: string | number | readonly string[] | undefined;
35
+ suppressContentEditableWarning?: boolean | undefined;
36
+ suppressHydrationWarning?: boolean | undefined;
37
+ accessKey?: string | undefined;
38
+ autoFocus?: boolean | undefined;
39
+ className?: string | undefined;
40
+ contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
41
+ contextMenu?: string | undefined;
42
+ dir?: string | undefined;
43
+ draggable?: (boolean | "false" | "true") | undefined;
44
+ hidden?: boolean | undefined;
45
+ id?: string | undefined;
46
+ lang?: string | undefined;
47
+ nonce?: string | undefined;
48
+ slot?: string | undefined;
49
+ spellCheck?: (boolean | "false" | "true") | undefined;
50
+ tabIndex?: number | undefined;
51
+ title?: string | undefined;
52
+ translate?: "yes" | "no" | undefined;
53
+ radioGroup?: string | undefined;
54
+ role?: React.AriaRole | undefined;
55
+ about?: string | undefined;
56
+ content?: string | undefined;
57
+ datatype?: string | undefined;
58
+ inlist?: any;
59
+ prefix?: string | undefined;
60
+ property?: string | undefined;
61
+ rel?: string | undefined;
62
+ resource?: string | undefined;
63
+ rev?: string | undefined;
64
+ typeof?: string | undefined;
65
+ vocab?: string | undefined;
66
+ autoCapitalize?: string | undefined;
67
+ autoCorrect?: string | undefined;
68
+ autoSave?: string | undefined;
69
+ color?: string | undefined;
70
+ itemProp?: string | undefined;
71
+ itemScope?: boolean | undefined;
72
+ itemType?: string | undefined;
73
+ itemID?: string | undefined;
74
+ itemRef?: string | undefined;
75
+ results?: number | undefined;
76
+ security?: string | undefined;
77
+ unselectable?: "on" | "off" | undefined;
78
+ popover?: "" | "auto" | "manual" | undefined;
79
+ popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
80
+ popoverTarget?: string | undefined;
81
+ inert?: boolean | undefined;
82
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
83
+ is?: string | undefined;
84
+ "aria-activedescendant"?: string | undefined;
85
+ "aria-atomic"?: (boolean | "false" | "true") | undefined;
86
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
87
+ "aria-braillelabel"?: string | undefined;
88
+ "aria-brailleroledescription"?: string | undefined;
89
+ "aria-busy"?: (boolean | "false" | "true") | undefined;
90
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
91
+ "aria-colcount"?: number | undefined;
92
+ "aria-colindex"?: number | undefined;
93
+ "aria-colindextext"?: string | undefined;
94
+ "aria-colspan"?: number | undefined;
95
+ "aria-controls"?: string | undefined;
96
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
97
+ "aria-describedby"?: string | undefined;
98
+ "aria-description"?: string | undefined;
99
+ "aria-details"?: string | undefined;
100
+ "aria-disabled"?: (boolean | "false" | "true") | undefined;
101
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
102
+ "aria-errormessage"?: string | undefined;
103
+ "aria-expanded"?: (boolean | "false" | "true") | undefined;
104
+ "aria-flowto"?: string | undefined;
105
+ "aria-grabbed"?: (boolean | "false" | "true") | undefined;
106
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
107
+ "aria-hidden"?: (boolean | "false" | "true") | undefined;
108
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
109
+ "aria-keyshortcuts"?: string | undefined;
110
+ "aria-label"?: string | undefined;
111
+ "aria-labelledby"?: string | undefined;
112
+ "aria-level"?: number | undefined;
113
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
114
+ "aria-modal"?: (boolean | "false" | "true") | undefined;
115
+ "aria-multiline"?: (boolean | "false" | "true") | undefined;
116
+ "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
117
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
118
+ "aria-owns"?: string | undefined;
119
+ "aria-placeholder"?: string | undefined;
120
+ "aria-posinset"?: number | undefined;
121
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
122
+ "aria-readonly"?: (boolean | "false" | "true") | undefined;
123
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
124
+ "aria-required"?: (boolean | "false" | "true") | undefined;
125
+ "aria-roledescription"?: string | undefined;
126
+ "aria-rowcount"?: number | undefined;
127
+ "aria-rowindex"?: number | undefined;
128
+ "aria-rowindextext"?: string | undefined;
129
+ "aria-rowspan"?: number | undefined;
130
+ "aria-selected"?: (boolean | "false" | "true") | undefined;
131
+ "aria-setsize"?: number | undefined;
132
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
133
+ "aria-valuemax"?: number | undefined;
134
+ "aria-valuemin"?: number | undefined;
135
+ "aria-valuenow"?: number | undefined;
136
+ "aria-valuetext"?: string | undefined;
137
+ dangerouslySetInnerHTML?: {
138
+ __html: string | TrustedHTML;
139
+ } | undefined;
140
+ onCopy?: React.ClipboardEventHandler<HTMLElement>;
141
+ onCopyCapture?: React.ClipboardEventHandler<HTMLElement>;
142
+ onCut?: React.ClipboardEventHandler<HTMLElement>;
143
+ onCutCapture?: React.ClipboardEventHandler<HTMLElement>;
144
+ onPaste?: React.ClipboardEventHandler<HTMLElement>;
145
+ onPasteCapture?: React.ClipboardEventHandler<HTMLElement>;
146
+ onCompositionEnd?: React.CompositionEventHandler<HTMLElement>;
147
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLElement>;
148
+ onCompositionStart?: React.CompositionEventHandler<HTMLElement>;
149
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLElement>;
150
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLElement>;
151
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLElement>;
152
+ onFocus?: React.FocusEventHandler<HTMLElement>;
153
+ onFocusCapture?: React.FocusEventHandler<HTMLElement>;
154
+ onBlur?: React.FocusEventHandler<HTMLElement>;
155
+ onBlurCapture?: React.FocusEventHandler<HTMLElement>;
156
+ onChange?: React.FormEventHandler<HTMLElement>;
157
+ onChangeCapture?: React.FormEventHandler<HTMLElement>;
158
+ onBeforeInput?: React.FormEventHandler<HTMLElement>;
159
+ onBeforeInputCapture?: React.FormEventHandler<HTMLElement>;
160
+ onInput?: React.FormEventHandler<HTMLElement>;
161
+ onInputCapture?: React.FormEventHandler<HTMLElement>;
162
+ onReset?: React.FormEventHandler<HTMLElement>;
163
+ onResetCapture?: React.FormEventHandler<HTMLElement>;
164
+ onSubmit?: React.FormEventHandler<HTMLElement>;
165
+ onSubmitCapture?: React.FormEventHandler<HTMLElement>;
166
+ onInvalid?: React.FormEventHandler<HTMLElement>;
167
+ onInvalidCapture?: React.FormEventHandler<HTMLElement>;
168
+ onLoad?: React.ReactEventHandler<HTMLElement>;
169
+ onLoadCapture?: React.ReactEventHandler<HTMLElement>;
170
+ onError?: React.ReactEventHandler<HTMLElement>;
171
+ onErrorCapture?: React.ReactEventHandler<HTMLElement>;
172
+ onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
173
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement>;
174
+ onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
175
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLElement>;
176
+ onKeyUp?: React.KeyboardEventHandler<HTMLElement>;
177
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLElement>;
178
+ onAbort?: React.ReactEventHandler<HTMLElement>;
179
+ onAbortCapture?: React.ReactEventHandler<HTMLElement>;
180
+ onCanPlay?: React.ReactEventHandler<HTMLElement>;
181
+ onCanPlayCapture?: React.ReactEventHandler<HTMLElement>;
182
+ onCanPlayThrough?: React.ReactEventHandler<HTMLElement>;
183
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLElement>;
184
+ onDurationChange?: React.ReactEventHandler<HTMLElement>;
185
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLElement>;
186
+ onEmptied?: React.ReactEventHandler<HTMLElement>;
187
+ onEmptiedCapture?: React.ReactEventHandler<HTMLElement>;
188
+ onEncrypted?: React.ReactEventHandler<HTMLElement>;
189
+ onEncryptedCapture?: React.ReactEventHandler<HTMLElement>;
190
+ onEnded?: React.ReactEventHandler<HTMLElement>;
191
+ onEndedCapture?: React.ReactEventHandler<HTMLElement>;
192
+ onLoadedData?: React.ReactEventHandler<HTMLElement>;
193
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLElement>;
194
+ onLoadedMetadata?: React.ReactEventHandler<HTMLElement>;
195
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLElement>;
196
+ onLoadStart?: React.ReactEventHandler<HTMLElement>;
197
+ onLoadStartCapture?: React.ReactEventHandler<HTMLElement>;
198
+ onPause?: React.ReactEventHandler<HTMLElement>;
199
+ onPauseCapture?: React.ReactEventHandler<HTMLElement>;
200
+ onPlay?: React.ReactEventHandler<HTMLElement>;
201
+ onPlayCapture?: React.ReactEventHandler<HTMLElement>;
202
+ onPlaying?: React.ReactEventHandler<HTMLElement>;
203
+ onPlayingCapture?: React.ReactEventHandler<HTMLElement>;
204
+ onProgress?: React.ReactEventHandler<HTMLElement>;
205
+ onProgressCapture?: React.ReactEventHandler<HTMLElement>;
206
+ onRateChange?: React.ReactEventHandler<HTMLElement>;
207
+ onRateChangeCapture?: React.ReactEventHandler<HTMLElement>;
208
+ onResize?: React.ReactEventHandler<HTMLElement>;
209
+ onResizeCapture?: React.ReactEventHandler<HTMLElement>;
210
+ onSeeked?: React.ReactEventHandler<HTMLElement>;
211
+ onSeekedCapture?: React.ReactEventHandler<HTMLElement>;
212
+ onSeeking?: React.ReactEventHandler<HTMLElement>;
213
+ onSeekingCapture?: React.ReactEventHandler<HTMLElement>;
214
+ onStalled?: React.ReactEventHandler<HTMLElement>;
215
+ onStalledCapture?: React.ReactEventHandler<HTMLElement>;
216
+ onSuspend?: React.ReactEventHandler<HTMLElement>;
217
+ onSuspendCapture?: React.ReactEventHandler<HTMLElement>;
218
+ onTimeUpdate?: React.ReactEventHandler<HTMLElement>;
219
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLElement>;
220
+ onVolumeChange?: React.ReactEventHandler<HTMLElement>;
221
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLElement>;
222
+ onWaiting?: React.ReactEventHandler<HTMLElement>;
223
+ onWaitingCapture?: React.ReactEventHandler<HTMLElement>;
224
+ onAuxClick?: React.MouseEventHandler<HTMLElement>;
225
+ onAuxClickCapture?: React.MouseEventHandler<HTMLElement>;
226
+ onClick?: React.MouseEventHandler<HTMLElement>;
227
+ onClickCapture?: React.MouseEventHandler<HTMLElement>;
228
+ onContextMenu?: React.MouseEventHandler<HTMLElement>;
229
+ onContextMenuCapture?: React.MouseEventHandler<HTMLElement>;
230
+ onDoubleClick?: React.MouseEventHandler<HTMLElement>;
231
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLElement>;
232
+ onDrag?: React.DragEventHandler<HTMLElement>;
233
+ onDragCapture?: React.DragEventHandler<HTMLElement>;
234
+ onDragEnd?: React.DragEventHandler<HTMLElement>;
235
+ onDragEndCapture?: React.DragEventHandler<HTMLElement>;
236
+ onDragEnter?: React.DragEventHandler<HTMLElement>;
237
+ onDragEnterCapture?: React.DragEventHandler<HTMLElement>;
238
+ onDragExit?: React.DragEventHandler<HTMLElement>;
239
+ onDragExitCapture?: React.DragEventHandler<HTMLElement>;
240
+ onDragLeave?: React.DragEventHandler<HTMLElement>;
241
+ onDragLeaveCapture?: React.DragEventHandler<HTMLElement>;
242
+ onDragOver?: React.DragEventHandler<HTMLElement>;
243
+ onDragOverCapture?: React.DragEventHandler<HTMLElement>;
244
+ onDragStart?: React.DragEventHandler<HTMLElement>;
245
+ onDragStartCapture?: React.DragEventHandler<HTMLElement>;
246
+ onDrop?: React.DragEventHandler<HTMLElement>;
247
+ onDropCapture?: React.DragEventHandler<HTMLElement>;
248
+ onMouseDown?: React.MouseEventHandler<HTMLElement>;
249
+ onMouseDownCapture?: React.MouseEventHandler<HTMLElement>;
250
+ onMouseEnter?: React.MouseEventHandler<HTMLElement>;
251
+ onMouseLeave?: React.MouseEventHandler<HTMLElement>;
252
+ onMouseMove?: React.MouseEventHandler<HTMLElement>;
253
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLElement>;
254
+ onMouseOut?: React.MouseEventHandler<HTMLElement>;
255
+ onMouseOutCapture?: React.MouseEventHandler<HTMLElement>;
256
+ onMouseOver?: React.MouseEventHandler<HTMLElement>;
257
+ onMouseOverCapture?: React.MouseEventHandler<HTMLElement>;
258
+ onMouseUp?: React.MouseEventHandler<HTMLElement>;
259
+ onMouseUpCapture?: React.MouseEventHandler<HTMLElement>;
260
+ onSelect?: React.ReactEventHandler<HTMLElement>;
261
+ onSelectCapture?: React.ReactEventHandler<HTMLElement>;
262
+ onTouchCancel?: React.TouchEventHandler<HTMLElement>;
263
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLElement>;
264
+ onTouchEnd?: React.TouchEventHandler<HTMLElement>;
265
+ onTouchEndCapture?: React.TouchEventHandler<HTMLElement>;
266
+ onTouchMove?: React.TouchEventHandler<HTMLElement>;
267
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLElement>;
268
+ onTouchStart?: React.TouchEventHandler<HTMLElement>;
269
+ onTouchStartCapture?: React.TouchEventHandler<HTMLElement>;
270
+ onPointerDown?: React.PointerEventHandler<HTMLElement>;
271
+ onPointerDownCapture?: React.PointerEventHandler<HTMLElement>;
272
+ onPointerMove?: React.PointerEventHandler<HTMLElement>;
273
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLElement>;
274
+ onPointerUp?: React.PointerEventHandler<HTMLElement>;
275
+ onPointerUpCapture?: React.PointerEventHandler<HTMLElement>;
276
+ onPointerCancel?: React.PointerEventHandler<HTMLElement>;
277
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLElement>;
278
+ onPointerEnter?: React.PointerEventHandler<HTMLElement>;
279
+ onPointerLeave?: React.PointerEventHandler<HTMLElement>;
280
+ onPointerOver?: React.PointerEventHandler<HTMLElement>;
281
+ onPointerOverCapture?: React.PointerEventHandler<HTMLElement>;
282
+ onPointerOut?: React.PointerEventHandler<HTMLElement>;
283
+ onPointerOutCapture?: React.PointerEventHandler<HTMLElement>;
284
+ onGotPointerCapture?: React.PointerEventHandler<HTMLElement>;
285
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLElement>;
286
+ onLostPointerCapture?: React.PointerEventHandler<HTMLElement>;
287
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLElement>;
288
+ onScroll?: React.UIEventHandler<HTMLElement>;
289
+ onScrollCapture?: React.UIEventHandler<HTMLElement>;
290
+ onWheel?: React.WheelEventHandler<HTMLElement>;
291
+ onWheelCapture?: React.WheelEventHandler<HTMLElement>;
292
+ onAnimationStart?: React.AnimationEventHandler<HTMLElement>;
293
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLElement>;
294
+ onAnimationEnd?: React.AnimationEventHandler<HTMLElement>;
295
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement>;
296
+ onAnimationIteration?: React.AnimationEventHandler<HTMLElement>;
297
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement>;
298
+ onToggle?: React.ToggleEventHandler<HTMLElement>;
299
+ onBeforeToggle?: React.ToggleEventHandler<HTMLElement>;
300
+ onTransitionCancel?: React.TransitionEventHandler<HTMLElement>;
301
+ onTransitionCancelCapture?: React.TransitionEventHandler<HTMLElement>;
302
+ onTransitionEnd?: React.TransitionEventHandler<HTMLElement>;
303
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement>;
304
+ onTransitionRun?: React.TransitionEventHandler<HTMLElement>;
305
+ onTransitionRunCapture?: React.TransitionEventHandler<HTMLElement>;
306
+ onTransitionStart?: React.TransitionEventHandler<HTMLElement>;
307
+ onTransitionStartCapture?: React.TransitionEventHandler<HTMLElement>;
308
+ };
309
+ contentProps: {
310
+ role: string;
311
+ style: React.CSSProperties;
312
+ };
313
+ };
314
+ interface VirtualizerItemProps extends Omit<VirtualizerItemOptions, 'ref'> {
315
+ parent?: LayoutInfo | null;
316
+ className?: string;
317
+ children: ReactNode;
318
+ }
319
+ export function VirtualizerItem(props: VirtualizerItemProps): React.JSX.Element;
320
+ export function layoutInfoToStyle(layoutInfo: LayoutInfo, dir: Direction, parent?: LayoutInfo | null): CSSProperties;
321
+ type RenderWrapper<T extends object, V> = (parent: ReusableView<T, V> | null, reusableView: ReusableView<T, V>, children: ReusableView<T, V>[], renderChildren: (views: ReusableView<T, V>[]) => ReactElement[]) => ReactElement;
322
+ interface VirtualizerProps<T extends object, V, O> extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
323
+ children: (type: string, content: T) => V;
324
+ renderWrapper?: RenderWrapper<T, V>;
325
+ layout: Layout<T, O>;
326
+ collection: Collection<T>;
327
+ persistedKeys?: Set<Key> | null;
328
+ scrollDirection?: 'horizontal' | 'vertical' | 'both';
329
+ isLoading?: boolean;
330
+ onLoadMore?: () => void;
331
+ layoutOptions?: O;
332
+ }
333
+ export const Virtualizer: <T extends object, V, O>(props: VirtualizerProps<T, V, O> & {
334
+ ref?: RefObject<HTMLDivElement | null>;
335
+ }) => ReactElement;
336
+
337
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"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","sources":["packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/utils.ts","packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/useVirtualizerItem.ts","packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/ScrollView.tsx","packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/VirtualizerItem.tsx","packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/Virtualizer.tsx","packages/@react-aria/virtualizer/src/packages/@react-aria/virtualizer/src/index.ts","packages/@react-aria/virtualizer/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {RTLOffsetType} from './utils';\nexport type {VirtualizerItemOptions} from './useVirtualizerItem';\nexport {Virtualizer} from './Virtualizer';\nexport {useVirtualizerItem} from './useVirtualizerItem';\nexport {VirtualizerItem, layoutInfoToStyle} from './VirtualizerItem';\nexport {ScrollView, useScrollView} from './ScrollView';\nexport {getRTLOffsetType, getScrollLeft, setScrollLeft} from './utils';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,53 @@
1
+ var $64doO$reactstatelyvirtualizer = require("@react-stately/virtualizer");
2
+ var $64doO$react = require("react");
3
+ var $64doO$reactariautils = require("@react-aria/utils");
4
+
5
+
6
+ function $parcel$export(e, n, v, s) {
7
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
+ }
9
+
10
+ $parcel$export(module.exports, "useVirtualizerItem", () => $7d70e069fceb2deb$export$1da781778207e0a2);
11
+ /*
12
+ * Copyright 2020 Adobe. All rights reserved.
13
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this file except in compliance with the License. You may obtain a copy
15
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software distributed under
18
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
+ * OF ANY KIND, either express or implied. See the License for the specific language
20
+ * governing permissions and limitations under the License.
21
+ */
22
+
23
+
24
+ function $7d70e069fceb2deb$export$1da781778207e0a2(options) {
25
+ let { layoutInfo: layoutInfo, virtualizer: virtualizer, ref: ref } = options;
26
+ let updateSize = (0, $64doO$react.useCallback)(()=>{
27
+ if (layoutInfo) {
28
+ let size = $7d70e069fceb2deb$var$getSize(ref.current);
29
+ virtualizer.updateItemSize(layoutInfo.key, size);
30
+ }
31
+ }, [
32
+ virtualizer,
33
+ layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.key,
34
+ ref
35
+ ]);
36
+ (0, $64doO$reactariautils.useLayoutEffect)(()=>{
37
+ if (layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.estimatedSize) updateSize();
38
+ });
39
+ return {
40
+ updateSize: updateSize
41
+ };
42
+ }
43
+ function $7d70e069fceb2deb$var$getSize(node) {
44
+ // Reset height before measuring so we get the intrinsic size
45
+ let height = node.style.height;
46
+ node.style.height = '';
47
+ let size = new (0, $64doO$reactstatelyvirtualizer.Size)(node.scrollWidth, node.scrollHeight);
48
+ node.style.height = height;
49
+ return size;
50
+ }
51
+
52
+
53
+ //# sourceMappingURL=useVirtualizerItem.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAiBM,SAAS,0CAAmB,OAA+B;IAChE,IAAI,cAAC,UAAU,eAAE,WAAW,OAAE,GAAG,EAAC,GAAG;IAErC,IAAI,aAAa,CAAA,GAAA,wBAAU,EAAE;QAC3B,IAAI,YAAY;YACd,IAAI,OAAO,8BAAQ,IAAI,OAAO;YAC9B,YAAY,cAAc,CAAC,WAAW,GAAG,EAAE;QAC7C;IACF,GAAG;QAAC;QAAa,uBAAA,iCAAA,WAAY,GAAG;QAAE;KAAI;IAEtC,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,uBAAA,iCAAA,WAAY,aAAa,EAC3B;IAEJ;IAEA,OAAO;oBAAC;IAAU;AACpB;AAEA,SAAS,8BAAQ,IAAiB;IAChC,6DAA6D;IAC7D,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;IAC9B,KAAK,KAAK,CAAC,MAAM,GAAG;IACpB,IAAI,OAAO,IAAI,CAAA,GAAA,mCAAG,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY;IACvD,KAAK,KAAK,CAAC,MAAM,GAAG;IACpB,OAAO;AACT","sources":["packages/@react-aria/virtualizer/src/useVirtualizerItem.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key, RefObject} from '@react-types/shared';\nimport {LayoutInfo, Size} from '@react-stately/virtualizer';\nimport {useCallback} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface IVirtualizer {\n updateItemSize(key: Key, size: Size): void\n}\n\nexport interface VirtualizerItemOptions {\n layoutInfo: LayoutInfo,\n virtualizer: IVirtualizer,\n ref: RefObject<HTMLElement | null>\n}\n\nexport function useVirtualizerItem(options: VirtualizerItemOptions) {\n let {layoutInfo, virtualizer, ref} = options;\n\n let updateSize = useCallback(() => {\n if (layoutInfo) {\n let size = getSize(ref.current);\n virtualizer.updateItemSize(layoutInfo.key, size);\n }\n }, [virtualizer, layoutInfo?.key, ref]);\n\n useLayoutEffect(() => {\n if (layoutInfo?.estimatedSize) {\n updateSize();\n }\n });\n\n return {updateSize};\n}\n\nfunction getSize(node: HTMLElement) {\n // Reset height before measuring so we get the intrinsic size\n let height = node.style.height;\n node.style.height = '';\n let size = new Size(node.scrollWidth, node.scrollHeight);\n node.style.height = height;\n return size;\n}\n"],"names":[],"version":3,"file":"useVirtualizerItem.main.js.map"}
@@ -0,0 +1,48 @@
1
+ import {Size as $uBoVA$Size} from "@react-stately/virtualizer";
2
+ import {useCallback as $uBoVA$useCallback} from "react";
3
+ import {useLayoutEffect as $uBoVA$useLayoutEffect} from "@react-aria/utils";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ function $47736c1e63ba1c6d$export$1da781778207e0a2(options) {
19
+ let { layoutInfo: layoutInfo, virtualizer: virtualizer, ref: ref } = options;
20
+ let updateSize = (0, $uBoVA$useCallback)(()=>{
21
+ if (layoutInfo) {
22
+ let size = $47736c1e63ba1c6d$var$getSize(ref.current);
23
+ virtualizer.updateItemSize(layoutInfo.key, size);
24
+ }
25
+ }, [
26
+ virtualizer,
27
+ layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.key,
28
+ ref
29
+ ]);
30
+ (0, $uBoVA$useLayoutEffect)(()=>{
31
+ if (layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.estimatedSize) updateSize();
32
+ });
33
+ return {
34
+ updateSize: updateSize
35
+ };
36
+ }
37
+ function $47736c1e63ba1c6d$var$getSize(node) {
38
+ // Reset height before measuring so we get the intrinsic size
39
+ let height = node.style.height;
40
+ node.style.height = '';
41
+ let size = new (0, $uBoVA$Size)(node.scrollWidth, node.scrollHeight);
42
+ node.style.height = height;
43
+ return size;
44
+ }
45
+
46
+
47
+ export {$47736c1e63ba1c6d$export$1da781778207e0a2 as useVirtualizerItem};
48
+ //# sourceMappingURL=useVirtualizerItem.module.js.map
@@ -0,0 +1,48 @@
1
+ import {Size as $uBoVA$Size} from "@react-stately/virtualizer";
2
+ import {useCallback as $uBoVA$useCallback} from "react";
3
+ import {useLayoutEffect as $uBoVA$useLayoutEffect} from "@react-aria/utils";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ function $47736c1e63ba1c6d$export$1da781778207e0a2(options) {
19
+ let { layoutInfo: layoutInfo, virtualizer: virtualizer, ref: ref } = options;
20
+ let updateSize = (0, $uBoVA$useCallback)(()=>{
21
+ if (layoutInfo) {
22
+ let size = $47736c1e63ba1c6d$var$getSize(ref.current);
23
+ virtualizer.updateItemSize(layoutInfo.key, size);
24
+ }
25
+ }, [
26
+ virtualizer,
27
+ layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.key,
28
+ ref
29
+ ]);
30
+ (0, $uBoVA$useLayoutEffect)(()=>{
31
+ if (layoutInfo === null || layoutInfo === void 0 ? void 0 : layoutInfo.estimatedSize) updateSize();
32
+ });
33
+ return {
34
+ updateSize: updateSize
35
+ };
36
+ }
37
+ function $47736c1e63ba1c6d$var$getSize(node) {
38
+ // Reset height before measuring so we get the intrinsic size
39
+ let height = node.style.height;
40
+ node.style.height = '';
41
+ let size = new (0, $uBoVA$Size)(node.scrollWidth, node.scrollHeight);
42
+ node.style.height = height;
43
+ return size;
44
+ }
45
+
46
+
47
+ export {$47736c1e63ba1c6d$export$1da781778207e0a2 as useVirtualizerItem};
48
+ //# sourceMappingURL=useVirtualizerItem.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAiBM,SAAS,0CAAmB,OAA+B;IAChE,IAAI,cAAC,UAAU,eAAE,WAAW,OAAE,GAAG,EAAC,GAAG;IAErC,IAAI,aAAa,CAAA,GAAA,kBAAU,EAAE;QAC3B,IAAI,YAAY;YACd,IAAI,OAAO,8BAAQ,IAAI,OAAO;YAC9B,YAAY,cAAc,CAAC,WAAW,GAAG,EAAE;QAC7C;IACF,GAAG;QAAC;QAAa,uBAAA,iCAAA,WAAY,GAAG;QAAE;KAAI;IAEtC,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,uBAAA,iCAAA,WAAY,aAAa,EAC3B;IAEJ;IAEA,OAAO;oBAAC;IAAU;AACpB;AAEA,SAAS,8BAAQ,IAAiB;IAChC,6DAA6D;IAC7D,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;IAC9B,KAAK,KAAK,CAAC,MAAM,GAAG;IACpB,IAAI,OAAO,IAAI,CAAA,GAAA,WAAG,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY;IACvD,KAAK,KAAK,CAAC,MAAM,GAAG;IACpB,OAAO;AACT","sources":["packages/@react-aria/virtualizer/src/useVirtualizerItem.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key, RefObject} from '@react-types/shared';\nimport {LayoutInfo, Size} from '@react-stately/virtualizer';\nimport {useCallback} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface IVirtualizer {\n updateItemSize(key: Key, size: Size): void\n}\n\nexport interface VirtualizerItemOptions {\n layoutInfo: LayoutInfo,\n virtualizer: IVirtualizer,\n ref: RefObject<HTMLElement | null>\n}\n\nexport function useVirtualizerItem(options: VirtualizerItemOptions) {\n let {layoutInfo, virtualizer, ref} = options;\n\n let updateSize = useCallback(() => {\n if (layoutInfo) {\n let size = getSize(ref.current);\n virtualizer.updateItemSize(layoutInfo.key, size);\n }\n }, [virtualizer, layoutInfo?.key, ref]);\n\n useLayoutEffect(() => {\n if (layoutInfo?.estimatedSize) {\n updateSize();\n }\n });\n\n return {updateSize};\n}\n\nfunction getSize(node: HTMLElement) {\n // Reset height before measuring so we get the intrinsic size\n let height = node.style.height;\n node.style.height = '';\n let size = new Size(node.scrollWidth, node.scrollHeight);\n node.style.height = height;\n return size;\n}\n"],"names":[],"version":3,"file":"useVirtualizerItem.module.js.map"}
@@ -0,0 +1,80 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+
6
+ $parcel$export(module.exports, "getRTLOffsetType", () => $efdd61e59e023a1d$export$faf7630257ad4304);
7
+ $parcel$export(module.exports, "getScrollLeft", () => $efdd61e59e023a1d$export$1389d168952b34b5);
8
+ $parcel$export(module.exports, "setScrollLeft", () => $efdd61e59e023a1d$export$ed5fd5ffe5ab0ac);
9
+ /*
10
+ * Copyright 2020 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */ let $efdd61e59e023a1d$var$cachedRTLResult = null;
20
+ function $efdd61e59e023a1d$export$faf7630257ad4304(recalculate = false) {
21
+ if ($efdd61e59e023a1d$var$cachedRTLResult === null || recalculate) {
22
+ const outerDiv = document.createElement('div');
23
+ const outerStyle = outerDiv.style;
24
+ outerStyle.width = '50px';
25
+ outerStyle.height = '50px';
26
+ outerStyle.overflow = 'scroll';
27
+ outerStyle.direction = 'rtl';
28
+ const innerDiv = document.createElement('div');
29
+ const innerStyle = innerDiv.style;
30
+ innerStyle.width = '100px';
31
+ innerStyle.height = '100px';
32
+ outerDiv.appendChild(innerDiv);
33
+ document.body.appendChild(outerDiv);
34
+ if (outerDiv.scrollLeft > 0) $efdd61e59e023a1d$var$cachedRTLResult = 'positive-descending';
35
+ else {
36
+ outerDiv.scrollLeft = 1;
37
+ if (outerDiv.scrollLeft === 0) $efdd61e59e023a1d$var$cachedRTLResult = 'negative';
38
+ else $efdd61e59e023a1d$var$cachedRTLResult = 'positive-ascending';
39
+ }
40
+ document.body.removeChild(outerDiv);
41
+ return $efdd61e59e023a1d$var$cachedRTLResult;
42
+ }
43
+ return $efdd61e59e023a1d$var$cachedRTLResult;
44
+ }
45
+ function $efdd61e59e023a1d$export$1389d168952b34b5(node, direction) {
46
+ let { scrollLeft: scrollLeft } = node;
47
+ // scrollLeft in rtl locales differs across browsers, so normalize.
48
+ // See comment by getRTLOffsetType below for details.
49
+ if (direction === 'rtl') {
50
+ let { scrollWidth: scrollWidth, clientWidth: clientWidth } = node;
51
+ switch($efdd61e59e023a1d$export$faf7630257ad4304()){
52
+ case 'negative':
53
+ scrollLeft = -scrollLeft;
54
+ break;
55
+ case 'positive-descending':
56
+ scrollLeft = scrollWidth - clientWidth - scrollLeft;
57
+ break;
58
+ }
59
+ }
60
+ return scrollLeft;
61
+ }
62
+ function $efdd61e59e023a1d$export$ed5fd5ffe5ab0ac(node, direction, scrollLeft) {
63
+ if (direction === 'rtl') switch($efdd61e59e023a1d$export$faf7630257ad4304()){
64
+ case 'negative':
65
+ scrollLeft = -scrollLeft;
66
+ break;
67
+ case 'positive-ascending':
68
+ break;
69
+ default:
70
+ {
71
+ const { clientWidth: clientWidth, scrollWidth: scrollWidth } = node;
72
+ scrollLeft = scrollWidth - clientWidth - scrollLeft;
73
+ break;
74
+ }
75
+ }
76
+ node.scrollLeft = scrollLeft;
77
+ }
78
+
79
+
80
+ //# sourceMappingURL=utils.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GASD,IAAI,wCAAwC;AAarC,SAAS,0CAAiB,cAAuB,KAAK;IAC3D,IAAI,0CAAoB,QAAQ,aAAa;QAC3C,MAAM,WAAW,SAAS,aAAa,CAAC;QACxC,MAAM,aAAa,SAAS,KAAK;QACjC,WAAW,KAAK,GAAG;QACnB,WAAW,MAAM,GAAG;QACpB,WAAW,QAAQ,GAAG;QACtB,WAAW,SAAS,GAAG;QAEvB,MAAM,WAAW,SAAS,aAAa,CAAC;QACxC,MAAM,aAAa,SAAS,KAAK;QACjC,WAAW,KAAK,GAAG;QACnB,WAAW,MAAM,GAAG;QAEpB,SAAS,WAAW,CAAC;QAErB,SAAS,IAAI,CAAC,WAAW,CAAC;QAE1B,IAAI,SAAS,UAAU,GAAG,GACxB,wCAAkB;aACb;YACL,SAAS,UAAU,GAAG;YACtB,IAAI,SAAS,UAAU,KAAK,GAC1B,wCAAkB;iBAElB,wCAAkB;QAEtB;QAEA,SAAS,IAAI,CAAC,WAAW,CAAC;QAE1B,OAAO;IACT;IAEA,OAAO;AACT;AAEO,SAAS,0CAAc,IAAa,EAAE,SAAoB;IAC/D,IAAI,cAAC,UAAU,EAAC,GAAG;IAEnB,mEAAmE;IACnE,qDAAqD;IACrD,IAAI,cAAc,OAAO;QACvB,IAAI,eAAC,WAAW,eAAE,WAAW,EAAC,GAAG;QACjC,OAAQ;YACN,KAAK;gBACH,aAAa,CAAC;gBACd;YACF,KAAK;gBACH,aAAa,cAAc,cAAc;gBACzC;QACJ;IACF;IAEA,OAAO;AACT;AAEO,SAAS,yCAAc,IAAa,EAAE,SAAoB,EAAE,UAAkB;IACnF,IAAI,cAAc,OAChB,OAAQ;QACN,KAAK;YACH,aAAa,CAAC;YACd;QACF,KAAK;YACH;QACF;YAAS;gBACP,MAAM,eAAC,WAAW,eAAE,WAAW,EAAC,GAAG;gBACnC,aAAa,cAAc,cAAc;gBACzC;YACF;IACF;IAGF,KAAK,UAAU,GAAG;AACpB","sources":["packages/@react-aria/virtualizer/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction} from '@react-types/shared';\n\nexport type RTLOffsetType =\n | 'negative'\n | 'positive-descending'\n | 'positive-ascending';\n\nlet cachedRTLResult: RTLOffsetType | null = null;\n\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/bvaughn/react-window/blob/master/src/createGridComponent.js\n\n// According to the spec, scrollLeft should be negative for RTL aligned elements.\n// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).\n// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.\n// The safest way to check this is to intentionally set a negative offset,\n// and then verify that the subsequent \"scroll\" event matches the negative offset.\n// If it does not match, then we can assume a non-standard RTL scroll implementation.\nexport function getRTLOffsetType(recalculate: boolean = false): RTLOffsetType {\n if (cachedRTLResult === null || recalculate) {\n const outerDiv = document.createElement('div');\n const outerStyle = outerDiv.style;\n outerStyle.width = '50px';\n outerStyle.height = '50px';\n outerStyle.overflow = 'scroll';\n outerStyle.direction = 'rtl';\n\n const innerDiv = document.createElement('div');\n const innerStyle = innerDiv.style;\n innerStyle.width = '100px';\n innerStyle.height = '100px';\n\n outerDiv.appendChild(innerDiv);\n\n document.body.appendChild(outerDiv);\n\n if (outerDiv.scrollLeft > 0) {\n cachedRTLResult = 'positive-descending';\n } else {\n outerDiv.scrollLeft = 1;\n if (outerDiv.scrollLeft === 0) {\n cachedRTLResult = 'negative';\n } else {\n cachedRTLResult = 'positive-ascending';\n }\n }\n\n document.body.removeChild(outerDiv);\n\n return cachedRTLResult;\n }\n\n return cachedRTLResult;\n}\n\nexport function getScrollLeft(node: Element, direction: Direction): number {\n let {scrollLeft} = node;\n\n // scrollLeft in rtl locales differs across browsers, so normalize.\n // See comment by getRTLOffsetType below for details.\n if (direction === 'rtl') {\n let {scrollWidth, clientWidth} = node;\n switch (getRTLOffsetType()) {\n case 'negative':\n scrollLeft = -scrollLeft;\n break;\n case 'positive-descending':\n scrollLeft = scrollWidth - clientWidth - scrollLeft;\n break;\n }\n }\n\n return scrollLeft;\n}\n\nexport function setScrollLeft(node: Element, direction: Direction, scrollLeft: number) {\n if (direction === 'rtl') {\n switch (getRTLOffsetType()) {\n case 'negative':\n scrollLeft = -scrollLeft;\n break;\n case 'positive-ascending':\n break;\n default: {\n const {clientWidth, scrollWidth} = node;\n scrollLeft = scrollWidth - clientWidth - scrollLeft;\n break;\n }\n }\n }\n\n node.scrollLeft = scrollLeft;\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}