@react-stately/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.
- package/README.md +3 -0
- package/dist/Layout.main.js +43 -0
- package/dist/Layout.main.js.map +1 -0
- package/dist/Layout.mjs +38 -0
- package/dist/Layout.module.js +38 -0
- package/dist/Layout.module.js.map +1 -0
- package/dist/LayoutInfo.main.js +51 -0
- package/dist/LayoutInfo.main.js.map +1 -0
- package/dist/LayoutInfo.mjs +46 -0
- package/dist/LayoutInfo.module.js +46 -0
- package/dist/LayoutInfo.module.js.map +1 -0
- package/dist/OverscanManager.main.js +52 -0
- package/dist/OverscanManager.main.js.map +1 -0
- package/dist/OverscanManager.mjs +47 -0
- package/dist/OverscanManager.module.js +47 -0
- package/dist/OverscanManager.module.js.map +1 -0
- package/dist/Point.main.js +40 -0
- package/dist/Point.main.js.map +1 -0
- package/dist/Point.mjs +35 -0
- package/dist/Point.module.js +35 -0
- package/dist/Point.module.js.map +1 -0
- package/dist/Rect.main.js +130 -0
- package/dist/Rect.main.js.map +1 -0
- package/dist/Rect.mjs +125 -0
- package/dist/Rect.module.js +125 -0
- package/dist/Rect.module.js.map +1 -0
- package/dist/ReusableView.main.js +56 -0
- package/dist/ReusableView.main.js.map +1 -0
- package/dist/ReusableView.mjs +51 -0
- package/dist/ReusableView.module.js +51 -0
- package/dist/ReusableView.module.js.map +1 -0
- package/dist/Size.main.js +40 -0
- package/dist/Size.main.js.map +1 -0
- package/dist/Size.mjs +35 -0
- package/dist/Size.module.js +35 -0
- package/dist/Size.module.js.map +1 -0
- package/dist/Virtualizer.main.js +233 -0
- package/dist/Virtualizer.main.js.map +1 -0
- package/dist/Virtualizer.mjs +228 -0
- package/dist/Virtualizer.module.js +228 -0
- package/dist/Virtualizer.module.js.map +1 -0
- package/dist/import.mjs +29 -0
- package/dist/main.js +40 -0
- package/dist/main.js.map +1 -0
- package/dist/module.js +29 -0
- package/dist/module.js.map +1 -0
- package/dist/types.d.ts +347 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/useVirtualizerState.main.js +94 -0
- package/dist/useVirtualizerState.main.js.map +1 -0
- package/dist/useVirtualizerState.mjs +89 -0
- package/dist/useVirtualizerState.module.js +89 -0
- package/dist/useVirtualizerState.module.js.map +1 -0
- package/dist/utils.main.js +27 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +22 -0
- package/dist/utils.module.js +22 -0
- package/dist/utils.module.js.map +1 -0
- package/package.json +36 -0
- package/src/Layout.ts +93 -0
- package/src/LayoutInfo.ts +108 -0
- package/src/OverscanManager.ts +56 -0
- package/src/Point.ts +45 -0
- package/src/Rect.ts +191 -0
- package/src/ReusableView.ts +83 -0
- package/src/Size.ts +43 -0
- package/src/Virtualizer.ts +347 -0
- package/src/index.ts +23 -0
- package/src/types.ts +43 -0
- package/src/useVirtualizerState.ts +110 -0
- package/src/utils.ts +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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, "Layout", () => $ac14d65a0ec196dd$export$c84671f46d6a1ca);
|
|
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
|
+
*/ class $ac14d65a0ec196dd$export$c84671f46d6a1ca {
|
|
18
|
+
/**
|
|
19
|
+
* Returns whether the layout should invalidate in response to
|
|
20
|
+
* visible rectangle changes. By default, it only invalidates
|
|
21
|
+
* when the virtualizer's size changes. Return true always
|
|
22
|
+
* to make the layout invalidate while scrolling (e.g. sticky headers).
|
|
23
|
+
*/ shouldInvalidate(newRect, oldRect) {
|
|
24
|
+
// By default, invalidate when the size changes
|
|
25
|
+
return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This method allows the layout to perform any pre-computation
|
|
29
|
+
* it needs to in order to prepare {@link LayoutInfo}s for retrieval.
|
|
30
|
+
* Called by the virtualizer before {@link getVisibleLayoutInfos}
|
|
31
|
+
* or {@link getLayoutInfo} are called.
|
|
32
|
+
*/ update(invalidationContext) {}
|
|
33
|
+
getItemRect(key) {
|
|
34
|
+
var _this_getLayoutInfo;
|
|
35
|
+
return (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect;
|
|
36
|
+
}
|
|
37
|
+
getVisibleRect() {
|
|
38
|
+
return this.virtualizer.visibleRect;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=Layout.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAsBM,MAAe;IAIpB;;;;;GAKC,GACD,iBAAiB,OAAa,EAAE,OAAa,EAAW;QACtD,+CAA+C;QAC/C,OAAO,QAAQ,KAAK,KAAK,QAAQ,KAAK,IAC/B,QAAQ,MAAM,KAAK,QAAQ,MAAM;IAC1C;IAEA;;;;;GAKC,GACD,OAAO,mBAA2C,EAAE,CAAC;IA+BrD,YAAY,GAAQ,EAAQ;YACnB;QAAP,QAAO,sBAAA,IAAI,CAAC,aAAa,CAAC,kBAAnB,0CAAA,oBAAyB,IAAI;IACtC;IAEA,iBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW;IACrC;AACF","sources":["packages/@react-stately/virtualizer/src/Layout.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 {InvalidationContext} from './types';\nimport {ItemDropTarget, Key, LayoutDelegate} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Rect} from './Rect';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n\n/**\n * [Virtualizer]{@link Virtualizer} supports arbitrary layout objects, which compute what views are visible, and how\n * to position and style them. However, layouts do not create the views themselves directly. Instead,\n * layouts produce lightweight {@link LayoutInfo} objects which describe various properties of a view,\n * such as its position and size. The {@link Virtualizer} is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the {@link Layout} abstract base class. Layouts must implement a minimum of the\n * two methods listed below. All other methods can be optionally overridden to implement custom behavior.\n *\n * @see {@link getVisibleLayoutInfos}\n * @see {@link getLayoutInfo}\n */\nexport abstract class Layout<T extends object, O = any> implements LayoutDelegate {\n /** The Virtualizer the layout is currently attached to. */\n virtualizer: Virtualizer<T, any>;\n\n /**\n * Returns whether the layout should invalidate in response to\n * visible rectangle changes. By default, it only invalidates\n * when the virtualizer's size changes. Return true always\n * to make the layout invalidate while scrolling (e.g. sticky headers).\n */\n shouldInvalidate(newRect: Rect, oldRect: Rect): boolean {\n // By default, invalidate when the size changes\n return newRect.width !== oldRect.width\n || newRect.height !== oldRect.height;\n }\n\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare {@link LayoutInfo}s for retrieval.\n * Called by the virtualizer before {@link getVisibleLayoutInfos}\n * or {@link getLayoutInfo} are called.\n */\n update(invalidationContext: InvalidationContext<O>) {} // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * Returns an array of {@link LayoutInfo} objects which are inside the given rectangle.\n * Should be implemented by subclasses.\n * @param rect The rectangle that should contain the returned LayoutInfo objects.\n */\n abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];\n\n /**\n * Returns a {@link LayoutInfo} for the given key.\n * Should be implemented by subclasses.\n * @param key The key of the LayoutInfo to retrieve.\n */\n abstract getLayoutInfo(key: Key): LayoutInfo | null;\n\n /**\n * Returns size of the content. By default, it returns collectionView's size.\n */\n abstract getContentSize(): Size;\n\n /** \n * Updates the size of the given item.\n */\n updateItemSize?(key: Key, size: Size): boolean;\n\n /**\n * Returns a LayoutInfo for the given drop target.\n */\n getDropTargetLayoutInfo?(target: ItemDropTarget): LayoutInfo;\n\n getItemRect(key: Key): Rect {\n return this.getLayoutInfo(key)?.rect;\n }\n\n getVisibleRect(): Rect {\n return this.virtualizer.visibleRect;\n }\n}\n"],"names":[],"version":3,"file":"Layout.main.js.map"}
|
package/dist/Layout.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $c74cda7d31af1253$export$c84671f46d6a1ca {
|
|
12
|
+
/**
|
|
13
|
+
* Returns whether the layout should invalidate in response to
|
|
14
|
+
* visible rectangle changes. By default, it only invalidates
|
|
15
|
+
* when the virtualizer's size changes. Return true always
|
|
16
|
+
* to make the layout invalidate while scrolling (e.g. sticky headers).
|
|
17
|
+
*/ shouldInvalidate(newRect, oldRect) {
|
|
18
|
+
// By default, invalidate when the size changes
|
|
19
|
+
return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This method allows the layout to perform any pre-computation
|
|
23
|
+
* it needs to in order to prepare {@link LayoutInfo}s for retrieval.
|
|
24
|
+
* Called by the virtualizer before {@link getVisibleLayoutInfos}
|
|
25
|
+
* or {@link getLayoutInfo} are called.
|
|
26
|
+
*/ update(invalidationContext) {}
|
|
27
|
+
getItemRect(key) {
|
|
28
|
+
var _this_getLayoutInfo;
|
|
29
|
+
return (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect;
|
|
30
|
+
}
|
|
31
|
+
getVisibleRect() {
|
|
32
|
+
return this.virtualizer.visibleRect;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout};
|
|
38
|
+
//# sourceMappingURL=Layout.module.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $c74cda7d31af1253$export$c84671f46d6a1ca {
|
|
12
|
+
/**
|
|
13
|
+
* Returns whether the layout should invalidate in response to
|
|
14
|
+
* visible rectangle changes. By default, it only invalidates
|
|
15
|
+
* when the virtualizer's size changes. Return true always
|
|
16
|
+
* to make the layout invalidate while scrolling (e.g. sticky headers).
|
|
17
|
+
*/ shouldInvalidate(newRect, oldRect) {
|
|
18
|
+
// By default, invalidate when the size changes
|
|
19
|
+
return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This method allows the layout to perform any pre-computation
|
|
23
|
+
* it needs to in order to prepare {@link LayoutInfo}s for retrieval.
|
|
24
|
+
* Called by the virtualizer before {@link getVisibleLayoutInfos}
|
|
25
|
+
* or {@link getLayoutInfo} are called.
|
|
26
|
+
*/ update(invalidationContext) {}
|
|
27
|
+
getItemRect(key) {
|
|
28
|
+
var _this_getLayoutInfo;
|
|
29
|
+
return (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect;
|
|
30
|
+
}
|
|
31
|
+
getVisibleRect() {
|
|
32
|
+
return this.virtualizer.visibleRect;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout};
|
|
38
|
+
//# sourceMappingURL=Layout.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAsBM,MAAe;IAIpB;;;;;GAKC,GACD,iBAAiB,OAAa,EAAE,OAAa,EAAW;QACtD,+CAA+C;QAC/C,OAAO,QAAQ,KAAK,KAAK,QAAQ,KAAK,IAC/B,QAAQ,MAAM,KAAK,QAAQ,MAAM;IAC1C;IAEA;;;;;GAKC,GACD,OAAO,mBAA2C,EAAE,CAAC;IA+BrD,YAAY,GAAQ,EAAQ;YACnB;QAAP,QAAO,sBAAA,IAAI,CAAC,aAAa,CAAC,kBAAnB,0CAAA,oBAAyB,IAAI;IACtC;IAEA,iBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW;IACrC;AACF","sources":["packages/@react-stately/virtualizer/src/Layout.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 {InvalidationContext} from './types';\nimport {ItemDropTarget, Key, LayoutDelegate} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Rect} from './Rect';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n\n/**\n * [Virtualizer]{@link Virtualizer} supports arbitrary layout objects, which compute what views are visible, and how\n * to position and style them. However, layouts do not create the views themselves directly. Instead,\n * layouts produce lightweight {@link LayoutInfo} objects which describe various properties of a view,\n * such as its position and size. The {@link Virtualizer} is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the {@link Layout} abstract base class. Layouts must implement a minimum of the\n * two methods listed below. All other methods can be optionally overridden to implement custom behavior.\n *\n * @see {@link getVisibleLayoutInfos}\n * @see {@link getLayoutInfo}\n */\nexport abstract class Layout<T extends object, O = any> implements LayoutDelegate {\n /** The Virtualizer the layout is currently attached to. */\n virtualizer: Virtualizer<T, any>;\n\n /**\n * Returns whether the layout should invalidate in response to\n * visible rectangle changes. By default, it only invalidates\n * when the virtualizer's size changes. Return true always\n * to make the layout invalidate while scrolling (e.g. sticky headers).\n */\n shouldInvalidate(newRect: Rect, oldRect: Rect): boolean {\n // By default, invalidate when the size changes\n return newRect.width !== oldRect.width\n || newRect.height !== oldRect.height;\n }\n\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare {@link LayoutInfo}s for retrieval.\n * Called by the virtualizer before {@link getVisibleLayoutInfos}\n * or {@link getLayoutInfo} are called.\n */\n update(invalidationContext: InvalidationContext<O>) {} // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * Returns an array of {@link LayoutInfo} objects which are inside the given rectangle.\n * Should be implemented by subclasses.\n * @param rect The rectangle that should contain the returned LayoutInfo objects.\n */\n abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];\n\n /**\n * Returns a {@link LayoutInfo} for the given key.\n * Should be implemented by subclasses.\n * @param key The key of the LayoutInfo to retrieve.\n */\n abstract getLayoutInfo(key: Key): LayoutInfo | null;\n\n /**\n * Returns size of the content. By default, it returns collectionView's size.\n */\n abstract getContentSize(): Size;\n\n /** \n * Updates the size of the given item.\n */\n updateItemSize?(key: Key, size: Size): boolean;\n\n /**\n * Returns a LayoutInfo for the given drop target.\n */\n getDropTargetLayoutInfo?(target: ItemDropTarget): LayoutInfo;\n\n getItemRect(key: Key): Rect {\n return this.getLayoutInfo(key)?.rect;\n }\n\n getVisibleRect(): Rect {\n return this.virtualizer.visibleRect;\n }\n}\n"],"names":[],"version":3,"file":"Layout.module.js.map"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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, "LayoutInfo", () => $8a899922c0a55745$export$7e0eeb9da702a085);
|
|
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
|
+
*/ class $8a899922c0a55745$export$7e0eeb9da702a085 {
|
|
18
|
+
/**
|
|
19
|
+
* Returns a copy of the LayoutInfo.
|
|
20
|
+
*/ copy() {
|
|
21
|
+
let res = new $8a899922c0a55745$export$7e0eeb9da702a085(this.type, this.key, this.rect.copy());
|
|
22
|
+
res.estimatedSize = this.estimatedSize;
|
|
23
|
+
res.opacity = this.opacity;
|
|
24
|
+
res.transform = this.transform;
|
|
25
|
+
res.parentKey = this.parentKey;
|
|
26
|
+
res.isSticky = this.isSticky;
|
|
27
|
+
res.zIndex = this.zIndex;
|
|
28
|
+
res.allowOverflow = this.allowOverflow;
|
|
29
|
+
return res;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @param type A string representing the view type. Should be `'item'` for item views.
|
|
33
|
+
Other types are used by supplementary views.
|
|
34
|
+
* @param key The unique key for this view.
|
|
35
|
+
* @param rect The rectangle describing the size and position of this view.
|
|
36
|
+
*/ constructor(type, key, rect){
|
|
37
|
+
this.type = type;
|
|
38
|
+
this.key = key;
|
|
39
|
+
this.parentKey = null;
|
|
40
|
+
this.rect = rect;
|
|
41
|
+
this.estimatedSize = false;
|
|
42
|
+
this.isSticky = false;
|
|
43
|
+
this.opacity = 1;
|
|
44
|
+
this.transform = null;
|
|
45
|
+
this.zIndex = 0;
|
|
46
|
+
this.allowOverflow = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=LayoutInfo.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAWM,MAAM;IAwEX;;GAEC,GACD,OAAmB;QACjB,IAAI,MAAM,IAAI,0CAAW,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QAC5D,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO;QAC1B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS;QAC9B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS;QAC9B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ;QAC5B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM;QACxB,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,OAAO;IACT;IAhCA;;;;;GAKC,GACD,YAAY,IAAY,EAAE,GAAQ,EAAE,IAAU,CAAE;QAC9C,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,aAAa,GAAG;QACrB,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,aAAa,GAAG;IACvB;AAgBF","sources":["packages/@react-stately/virtualizer/src/LayoutInfo.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} from '@react-types/shared';\nimport {Rect} from './Rect';\n\n/**\n * Instances of this lightweight class are created by {@link Layout} subclasses\n * to represent each view in the {@link Virtualizer}. LayoutInfo objects describe\n * various properties of a view, such as its position and size, and style information.\n * The virtualizer uses this information when creating actual views to display.\n */\nexport class LayoutInfo {\n /**\n * A string representing the view type. Should be `'item'` for item views.\n * Other types are used by supplementary views.\n */\n type: string;\n\n /**\n * A unique key for this view. For item views, it should match the content key.\n */\n key: Key;\n\n /**\n * The key for a parent layout info, if any.\n */\n parentKey: Key | null;\n\n /**\n * The rectangle describing the size and position of this view.\n */\n rect: Rect;\n\n /**\n * Whether the size is estimated. `false` by default.\n */\n estimatedSize: boolean;\n\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n */\n isSticky: boolean;\n\n /**\n * The view's opacity. 1 by default.\n */\n opacity: number;\n\n /**\n * A CSS transform string to apply to the view. `null` by default.\n */\n transform: string | null;\n\n /**\n * The z-index of the view. 0 by default.\n */\n zIndex: number;\n\n /**\n * Whether the layout info allows its contents to overflow its container.\n * @default false\n */\n allowOverflow: boolean;\n\n /**\n * @param type A string representing the view type. Should be `'item'` for item views.\n Other types are used by supplementary views.\n * @param key The unique key for this view.\n * @param rect The rectangle describing the size and position of this view.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.rect = rect;\n this.estimatedSize = false;\n this.isSticky = false;\n this.opacity = 1;\n this.transform = null;\n this.zIndex = 0;\n this.allowOverflow = false;\n }\n\n /**\n * Returns a copy of the LayoutInfo.\n */\n copy(): LayoutInfo {\n let res = new LayoutInfo(this.type, this.key, this.rect.copy());\n res.estimatedSize = this.estimatedSize;\n res.opacity = this.opacity;\n res.transform = this.transform;\n res.parentKey = this.parentKey;\n res.isSticky = this.isSticky;\n res.zIndex = this.zIndex;\n res.allowOverflow = this.allowOverflow;\n return res;\n }\n}\n"],"names":[],"version":3,"file":"LayoutInfo.main.js.map"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $d7fd61009c21d0bb$export$7e0eeb9da702a085 {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a copy of the LayoutInfo.
|
|
14
|
+
*/ copy() {
|
|
15
|
+
let res = new $d7fd61009c21d0bb$export$7e0eeb9da702a085(this.type, this.key, this.rect.copy());
|
|
16
|
+
res.estimatedSize = this.estimatedSize;
|
|
17
|
+
res.opacity = this.opacity;
|
|
18
|
+
res.transform = this.transform;
|
|
19
|
+
res.parentKey = this.parentKey;
|
|
20
|
+
res.isSticky = this.isSticky;
|
|
21
|
+
res.zIndex = this.zIndex;
|
|
22
|
+
res.allowOverflow = this.allowOverflow;
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param type A string representing the view type. Should be `'item'` for item views.
|
|
27
|
+
Other types are used by supplementary views.
|
|
28
|
+
* @param key The unique key for this view.
|
|
29
|
+
* @param rect The rectangle describing the size and position of this view.
|
|
30
|
+
*/ constructor(type, key, rect){
|
|
31
|
+
this.type = type;
|
|
32
|
+
this.key = key;
|
|
33
|
+
this.parentKey = null;
|
|
34
|
+
this.rect = rect;
|
|
35
|
+
this.estimatedSize = false;
|
|
36
|
+
this.isSticky = false;
|
|
37
|
+
this.opacity = 1;
|
|
38
|
+
this.transform = null;
|
|
39
|
+
this.zIndex = 0;
|
|
40
|
+
this.allowOverflow = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {$d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo};
|
|
46
|
+
//# sourceMappingURL=LayoutInfo.module.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $d7fd61009c21d0bb$export$7e0eeb9da702a085 {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a copy of the LayoutInfo.
|
|
14
|
+
*/ copy() {
|
|
15
|
+
let res = new $d7fd61009c21d0bb$export$7e0eeb9da702a085(this.type, this.key, this.rect.copy());
|
|
16
|
+
res.estimatedSize = this.estimatedSize;
|
|
17
|
+
res.opacity = this.opacity;
|
|
18
|
+
res.transform = this.transform;
|
|
19
|
+
res.parentKey = this.parentKey;
|
|
20
|
+
res.isSticky = this.isSticky;
|
|
21
|
+
res.zIndex = this.zIndex;
|
|
22
|
+
res.allowOverflow = this.allowOverflow;
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param type A string representing the view type. Should be `'item'` for item views.
|
|
27
|
+
Other types are used by supplementary views.
|
|
28
|
+
* @param key The unique key for this view.
|
|
29
|
+
* @param rect The rectangle describing the size and position of this view.
|
|
30
|
+
*/ constructor(type, key, rect){
|
|
31
|
+
this.type = type;
|
|
32
|
+
this.key = key;
|
|
33
|
+
this.parentKey = null;
|
|
34
|
+
this.rect = rect;
|
|
35
|
+
this.estimatedSize = false;
|
|
36
|
+
this.isSticky = false;
|
|
37
|
+
this.opacity = 1;
|
|
38
|
+
this.transform = null;
|
|
39
|
+
this.zIndex = 0;
|
|
40
|
+
this.allowOverflow = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {$d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo};
|
|
46
|
+
//# sourceMappingURL=LayoutInfo.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAWM,MAAM;IAwEX;;GAEC,GACD,OAAmB;QACjB,IAAI,MAAM,IAAI,0CAAW,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QAC5D,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO;QAC1B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS;QAC9B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS;QAC9B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ;QAC5B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM;QACxB,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,OAAO;IACT;IAhCA;;;;;GAKC,GACD,YAAY,IAAY,EAAE,GAAQ,EAAE,IAAU,CAAE;QAC9C,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,aAAa,GAAG;QACrB,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,aAAa,GAAG;IACvB;AAgBF","sources":["packages/@react-stately/virtualizer/src/LayoutInfo.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} from '@react-types/shared';\nimport {Rect} from './Rect';\n\n/**\n * Instances of this lightweight class are created by {@link Layout} subclasses\n * to represent each view in the {@link Virtualizer}. LayoutInfo objects describe\n * various properties of a view, such as its position and size, and style information.\n * The virtualizer uses this information when creating actual views to display.\n */\nexport class LayoutInfo {\n /**\n * A string representing the view type. Should be `'item'` for item views.\n * Other types are used by supplementary views.\n */\n type: string;\n\n /**\n * A unique key for this view. For item views, it should match the content key.\n */\n key: Key;\n\n /**\n * The key for a parent layout info, if any.\n */\n parentKey: Key | null;\n\n /**\n * The rectangle describing the size and position of this view.\n */\n rect: Rect;\n\n /**\n * Whether the size is estimated. `false` by default.\n */\n estimatedSize: boolean;\n\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n */\n isSticky: boolean;\n\n /**\n * The view's opacity. 1 by default.\n */\n opacity: number;\n\n /**\n * A CSS transform string to apply to the view. `null` by default.\n */\n transform: string | null;\n\n /**\n * The z-index of the view. 0 by default.\n */\n zIndex: number;\n\n /**\n * Whether the layout info allows its contents to overflow its container.\n * @default false\n */\n allowOverflow: boolean;\n\n /**\n * @param type A string representing the view type. Should be `'item'` for item views.\n Other types are used by supplementary views.\n * @param key The unique key for this view.\n * @param rect The rectangle describing the size and position of this view.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.rect = rect;\n this.estimatedSize = false;\n this.isSticky = false;\n this.opacity = 1;\n this.transform = null;\n this.zIndex = 0;\n this.allowOverflow = false;\n }\n\n /**\n * Returns a copy of the LayoutInfo.\n */\n copy(): LayoutInfo {\n let res = new LayoutInfo(this.type, this.key, this.rect.copy());\n res.estimatedSize = this.estimatedSize;\n res.opacity = this.opacity;\n res.transform = this.transform;\n res.parentKey = this.parentKey;\n res.isSticky = this.isSticky;\n res.zIndex = this.zIndex;\n res.allowOverflow = this.allowOverflow;\n return res;\n }\n}\n"],"names":[],"version":3,"file":"LayoutInfo.module.js.map"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var $f89f15d7f52bce29$exports = require("./Point.main.js");
|
|
2
|
+
var $41b7691783731623$exports = require("./Rect.main.js");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "OverscanManager", () => $191a033606d4fda1$export$4455ee6afb38dcbb);
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
class $191a033606d4fda1$export$4455ee6afb38dcbb {
|
|
23
|
+
setVisibleRect(rect) {
|
|
24
|
+
let time = performance.now() - this.startTime;
|
|
25
|
+
if (time < 500) {
|
|
26
|
+
if (rect.x !== this.visibleRect.x && time > 0) this.velocity.x = (rect.x - this.visibleRect.x) / time;
|
|
27
|
+
if (rect.y !== this.visibleRect.y && time > 0) this.velocity.y = (rect.y - this.visibleRect.y) / time;
|
|
28
|
+
}
|
|
29
|
+
this.startTime = performance.now();
|
|
30
|
+
this.visibleRect = rect;
|
|
31
|
+
}
|
|
32
|
+
getOverscannedRect() {
|
|
33
|
+
let overscanned = this.visibleRect.copy();
|
|
34
|
+
let overscanY = this.visibleRect.height / 3;
|
|
35
|
+
overscanned.height += overscanY;
|
|
36
|
+
if (this.velocity.y < 0) overscanned.y -= overscanY;
|
|
37
|
+
if (this.velocity.x !== 0) {
|
|
38
|
+
let overscanX = this.visibleRect.width / 3;
|
|
39
|
+
overscanned.width += overscanX;
|
|
40
|
+
if (this.velocity.x < 0) overscanned.x -= overscanX;
|
|
41
|
+
}
|
|
42
|
+
return overscanned;
|
|
43
|
+
}
|
|
44
|
+
constructor(){
|
|
45
|
+
this.startTime = 0;
|
|
46
|
+
this.velocity = new (0, $f89f15d7f52bce29$exports.Point)(0, 0);
|
|
47
|
+
this.visibleRect = new (0, $41b7691783731623$exports.Rect)();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=OverscanManager.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM;IAKX,eAAe,IAAU,EAAE;QACzB,IAAI,OAAO,YAAY,GAAG,KAAK,IAAI,CAAC,SAAS;QAC7C,IAAI,OAAO,KAAK;YACd,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,OAAO,GAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,AAAC,CAAA,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,AAAD,IAAK;YAGpD,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,OAAO,GAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,AAAC,CAAA,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,AAAD,IAAK;QAEtD;QAEA,IAAI,CAAC,SAAS,GAAG,YAAY,GAAG;QAChC,IAAI,CAAC,WAAW,GAAG;IACrB;IAEA,qBAAqB;QACnB,IAAI,cAAc,IAAI,CAAC,WAAW,CAAC,IAAI;QAEvC,IAAI,YAAY,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG;QAC1C,YAAY,MAAM,IAAI;QACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GACpB,YAAY,CAAC,IAAI;QAGnB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG;YACzB,IAAI,YAAY,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG;YACzC,YAAY,KAAK,IAAI;YACrB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GACpB,YAAY,CAAC,IAAI;QAErB;QAEA,OAAO;IACT;;aAtCQ,YAAY;aACZ,WAAW,IAAI,CAAA,GAAA,+BAAI,EAAE,GAAG;aACxB,cAAc,IAAI,CAAA,GAAA,8BAAG;;AAqC/B","sources":["packages/@react-stately/virtualizer/src/OverscanManager.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 {Point} from './Point';\nimport {Rect} from './Rect';\n\nexport class OverscanManager {\n private startTime = 0;\n private velocity = new Point(0, 0);\n private visibleRect = new Rect();\n\n setVisibleRect(rect: Rect) {\n let time = performance.now() - this.startTime;\n if (time < 500) {\n if (rect.x !== this.visibleRect.x && time > 0) {\n this.velocity.x = (rect.x - this.visibleRect.x) / time;\n }\n\n if (rect.y !== this.visibleRect.y && time > 0) {\n this.velocity.y = (rect.y - this.visibleRect.y) / time;\n }\n }\n\n this.startTime = performance.now();\n this.visibleRect = rect;\n }\n\n getOverscannedRect() {\n let overscanned = this.visibleRect.copy();\n\n let overscanY = this.visibleRect.height / 3;\n overscanned.height += overscanY;\n if (this.velocity.y < 0) {\n overscanned.y -= overscanY;\n }\n\n if (this.velocity.x !== 0) {\n let overscanX = this.visibleRect.width / 3;\n overscanned.width += overscanX;\n if (this.velocity.x < 0) {\n overscanned.x -= overscanX;\n }\n }\n\n return overscanned;\n }\n}\n"],"names":[],"version":3,"file":"OverscanManager.main.js.map"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.mjs";
|
|
2
|
+
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.mjs";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class $364191b3decf3697$export$4455ee6afb38dcbb {
|
|
17
|
+
setVisibleRect(rect) {
|
|
18
|
+
let time = performance.now() - this.startTime;
|
|
19
|
+
if (time < 500) {
|
|
20
|
+
if (rect.x !== this.visibleRect.x && time > 0) this.velocity.x = (rect.x - this.visibleRect.x) / time;
|
|
21
|
+
if (rect.y !== this.visibleRect.y && time > 0) this.velocity.y = (rect.y - this.visibleRect.y) / time;
|
|
22
|
+
}
|
|
23
|
+
this.startTime = performance.now();
|
|
24
|
+
this.visibleRect = rect;
|
|
25
|
+
}
|
|
26
|
+
getOverscannedRect() {
|
|
27
|
+
let overscanned = this.visibleRect.copy();
|
|
28
|
+
let overscanY = this.visibleRect.height / 3;
|
|
29
|
+
overscanned.height += overscanY;
|
|
30
|
+
if (this.velocity.y < 0) overscanned.y -= overscanY;
|
|
31
|
+
if (this.velocity.x !== 0) {
|
|
32
|
+
let overscanX = this.visibleRect.width / 3;
|
|
33
|
+
overscanned.width += overscanX;
|
|
34
|
+
if (this.velocity.x < 0) overscanned.x -= overscanX;
|
|
35
|
+
}
|
|
36
|
+
return overscanned;
|
|
37
|
+
}
|
|
38
|
+
constructor(){
|
|
39
|
+
this.startTime = 0;
|
|
40
|
+
this.velocity = new (0, $3041db3296945e6e$export$baf26146a414f24a)(0, 0);
|
|
41
|
+
this.visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export {$364191b3decf3697$export$4455ee6afb38dcbb as OverscanManager};
|
|
47
|
+
//# sourceMappingURL=OverscanManager.module.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.module.js";
|
|
2
|
+
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.module.js";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class $364191b3decf3697$export$4455ee6afb38dcbb {
|
|
17
|
+
setVisibleRect(rect) {
|
|
18
|
+
let time = performance.now() - this.startTime;
|
|
19
|
+
if (time < 500) {
|
|
20
|
+
if (rect.x !== this.visibleRect.x && time > 0) this.velocity.x = (rect.x - this.visibleRect.x) / time;
|
|
21
|
+
if (rect.y !== this.visibleRect.y && time > 0) this.velocity.y = (rect.y - this.visibleRect.y) / time;
|
|
22
|
+
}
|
|
23
|
+
this.startTime = performance.now();
|
|
24
|
+
this.visibleRect = rect;
|
|
25
|
+
}
|
|
26
|
+
getOverscannedRect() {
|
|
27
|
+
let overscanned = this.visibleRect.copy();
|
|
28
|
+
let overscanY = this.visibleRect.height / 3;
|
|
29
|
+
overscanned.height += overscanY;
|
|
30
|
+
if (this.velocity.y < 0) overscanned.y -= overscanY;
|
|
31
|
+
if (this.velocity.x !== 0) {
|
|
32
|
+
let overscanX = this.visibleRect.width / 3;
|
|
33
|
+
overscanned.width += overscanX;
|
|
34
|
+
if (this.velocity.x < 0) overscanned.x -= overscanX;
|
|
35
|
+
}
|
|
36
|
+
return overscanned;
|
|
37
|
+
}
|
|
38
|
+
constructor(){
|
|
39
|
+
this.startTime = 0;
|
|
40
|
+
this.velocity = new (0, $3041db3296945e6e$export$baf26146a414f24a)(0, 0);
|
|
41
|
+
this.visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export {$364191b3decf3697$export$4455ee6afb38dcbb as OverscanManager};
|
|
47
|
+
//# sourceMappingURL=OverscanManager.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM;IAKX,eAAe,IAAU,EAAE;QACzB,IAAI,OAAO,YAAY,GAAG,KAAK,IAAI,CAAC,SAAS;QAC7C,IAAI,OAAO,KAAK;YACd,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,OAAO,GAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,AAAC,CAAA,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,AAAD,IAAK;YAGpD,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,OAAO,GAC1C,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,AAAC,CAAA,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,AAAD,IAAK;QAEtD;QAEA,IAAI,CAAC,SAAS,GAAG,YAAY,GAAG;QAChC,IAAI,CAAC,WAAW,GAAG;IACrB;IAEA,qBAAqB;QACnB,IAAI,cAAc,IAAI,CAAC,WAAW,CAAC,IAAI;QAEvC,IAAI,YAAY,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG;QAC1C,YAAY,MAAM,IAAI;QACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GACpB,YAAY,CAAC,IAAI;QAGnB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG;YACzB,IAAI,YAAY,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG;YACzC,YAAY,KAAK,IAAI;YACrB,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GACpB,YAAY,CAAC,IAAI;QAErB;QAEA,OAAO;IACT;;aAtCQ,YAAY;aACZ,WAAW,IAAI,CAAA,GAAA,yCAAI,EAAE,GAAG;aACxB,cAAc,IAAI,CAAA,GAAA,yCAAG;;AAqC/B","sources":["packages/@react-stately/virtualizer/src/OverscanManager.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 {Point} from './Point';\nimport {Rect} from './Rect';\n\nexport class OverscanManager {\n private startTime = 0;\n private velocity = new Point(0, 0);\n private visibleRect = new Rect();\n\n setVisibleRect(rect: Rect) {\n let time = performance.now() - this.startTime;\n if (time < 500) {\n if (rect.x !== this.visibleRect.x && time > 0) {\n this.velocity.x = (rect.x - this.visibleRect.x) / time;\n }\n\n if (rect.y !== this.visibleRect.y && time > 0) {\n this.velocity.y = (rect.y - this.visibleRect.y) / time;\n }\n }\n\n this.startTime = performance.now();\n this.visibleRect = rect;\n }\n\n getOverscannedRect() {\n let overscanned = this.visibleRect.copy();\n\n let overscanY = this.visibleRect.height / 3;\n overscanned.height += overscanY;\n if (this.velocity.y < 0) {\n overscanned.y -= overscanY;\n }\n\n if (this.velocity.x !== 0) {\n let overscanX = this.visibleRect.width / 3;\n overscanned.width += overscanX;\n if (this.velocity.x < 0) {\n overscanned.x -= overscanX;\n }\n }\n\n return overscanned;\n }\n}\n"],"names":[],"version":3,"file":"OverscanManager.module.js.map"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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, "Point", () => $f89f15d7f52bce29$export$baf26146a414f24a);
|
|
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
|
+
*/ class $f89f15d7f52bce29$export$baf26146a414f24a {
|
|
18
|
+
/**
|
|
19
|
+
* Returns a copy of this point.
|
|
20
|
+
*/ copy() {
|
|
21
|
+
return new $f89f15d7f52bce29$export$baf26146a414f24a(this.x, this.y);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks if two points are equal.
|
|
25
|
+
*/ equals(point) {
|
|
26
|
+
return this.x === point.x && this.y === point.y;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if this point is the origin.
|
|
30
|
+
*/ isOrigin() {
|
|
31
|
+
return this.x === 0 && this.y === 0;
|
|
32
|
+
}
|
|
33
|
+
constructor(x = 0, y = 0){
|
|
34
|
+
this.x = x;
|
|
35
|
+
this.y = y;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=Point.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAEM,MAAM;IAYX;;GAEC,GACD,OAAc;QACZ,OAAO,IAAI,0CAAM,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACjC;IAEA;;GAEC,GACD,OAAO,KAAY,EAAW;QAC5B,OAAO,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC;IACjD;IAEA;;GAEC,GACD,WAAoB;QAClB,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK;IACpC;IAxBA,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC,CAAE;QACxB,IAAI,CAAC,CAAC,GAAG;QACT,IAAI,CAAC,CAAC,GAAG;IACX;AAsBF","sources":["packages/@react-stately/virtualizer/src/Point.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 class Point {\n /** The x-coordinate of the point. */\n x: number;\n\n /** The y-coordinate of the point. */\n y: number;\n\n constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Returns a copy of this point.\n */\n copy(): Point {\n return new Point(this.x, this.y);\n }\n\n /**\n * Checks if two points are equal.\n */\n equals(point: Point): boolean {\n return this.x === point.x && this.y === point.y;\n }\n\n /**\n * Returns true if this point is the origin.\n */\n isOrigin(): boolean {\n return this.x === 0 && this.y === 0;\n }\n}\n"],"names":[],"version":3,"file":"Point.main.js.map"}
|
package/dist/Point.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $3041db3296945e6e$export$baf26146a414f24a {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a copy of this point.
|
|
14
|
+
*/ copy() {
|
|
15
|
+
return new $3041db3296945e6e$export$baf26146a414f24a(this.x, this.y);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Checks if two points are equal.
|
|
19
|
+
*/ equals(point) {
|
|
20
|
+
return this.x === point.x && this.y === point.y;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if this point is the origin.
|
|
24
|
+
*/ isOrigin() {
|
|
25
|
+
return this.x === 0 && this.y === 0;
|
|
26
|
+
}
|
|
27
|
+
constructor(x = 0, y = 0){
|
|
28
|
+
this.x = x;
|
|
29
|
+
this.y = y;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export {$3041db3296945e6e$export$baf26146a414f24a as Point};
|
|
35
|
+
//# sourceMappingURL=Point.module.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ class $3041db3296945e6e$export$baf26146a414f24a {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a copy of this point.
|
|
14
|
+
*/ copy() {
|
|
15
|
+
return new $3041db3296945e6e$export$baf26146a414f24a(this.x, this.y);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Checks if two points are equal.
|
|
19
|
+
*/ equals(point) {
|
|
20
|
+
return this.x === point.x && this.y === point.y;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if this point is the origin.
|
|
24
|
+
*/ isOrigin() {
|
|
25
|
+
return this.x === 0 && this.y === 0;
|
|
26
|
+
}
|
|
27
|
+
constructor(x = 0, y = 0){
|
|
28
|
+
this.x = x;
|
|
29
|
+
this.y = y;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export {$3041db3296945e6e$export$baf26146a414f24a as Point};
|
|
35
|
+
//# sourceMappingURL=Point.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,MAAM;IAYX;;GAEC,GACD,OAAc;QACZ,OAAO,IAAI,0CAAM,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACjC;IAEA;;GAEC,GACD,OAAO,KAAY,EAAW;QAC5B,OAAO,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC;IACjD;IAEA;;GAEC,GACD,WAAoB;QAClB,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK;IACpC;IAxBA,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC,CAAE;QACxB,IAAI,CAAC,CAAC,GAAG;QACT,IAAI,CAAC,CAAC,GAAG;IACX;AAsBF","sources":["packages/@react-stately/virtualizer/src/Point.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 class Point {\n /** The x-coordinate of the point. */\n x: number;\n\n /** The y-coordinate of the point. */\n y: number;\n\n constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Returns a copy of this point.\n */\n copy(): Point {\n return new Point(this.x, this.y);\n }\n\n /**\n * Checks if two points are equal.\n */\n equals(point: Point): boolean {\n return this.x === point.x && this.y === point.y;\n }\n\n /**\n * Returns true if this point is the origin.\n */\n isOrigin(): boolean {\n return this.x === 0 && this.y === 0;\n }\n}\n"],"names":[],"version":3,"file":"Point.module.js.map"}
|