@react-stately/virtualizer 4.4.6 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +2 -14
- package/dist/main.js +8 -20
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -14
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +15 -12
- package/src/index.ts +2 -11
- package/dist/Layout.main.js +0 -54
- package/dist/Layout.main.js.map +0 -1
- package/dist/Layout.mjs +0 -49
- package/dist/Layout.module.js +0 -49
- package/dist/Layout.module.js.map +0 -1
- package/dist/LayoutInfo.main.js +0 -52
- package/dist/LayoutInfo.main.js.map +0 -1
- package/dist/LayoutInfo.mjs +0 -47
- package/dist/LayoutInfo.module.js +0 -47
- package/dist/LayoutInfo.module.js.map +0 -1
- package/dist/OverscanManager.main.js +0 -52
- package/dist/OverscanManager.main.js.map +0 -1
- package/dist/OverscanManager.mjs +0 -47
- package/dist/OverscanManager.module.js +0 -47
- package/dist/OverscanManager.module.js.map +0 -1
- package/dist/Point.main.js +0 -40
- package/dist/Point.main.js.map +0 -1
- package/dist/Point.mjs +0 -35
- package/dist/Point.module.js +0 -35
- package/dist/Point.module.js.map +0 -1
- package/dist/Rect.main.js +0 -131
- package/dist/Rect.main.js.map +0 -1
- package/dist/Rect.mjs +0 -126
- package/dist/Rect.module.js +0 -126
- package/dist/Rect.module.js.map +0 -1
- package/dist/ReusableView.main.js +0 -69
- package/dist/ReusableView.main.js.map +0 -1
- package/dist/ReusableView.mjs +0 -63
- package/dist/ReusableView.module.js +0 -63
- package/dist/ReusableView.module.js.map +0 -1
- package/dist/Size.main.js +0 -40
- package/dist/Size.main.js.map +0 -1
- package/dist/Size.mjs +0 -35
- package/dist/Size.module.js +0 -35
- package/dist/Size.module.js.map +0 -1
- package/dist/Virtualizer.main.js +0 -239
- package/dist/Virtualizer.main.js.map +0 -1
- package/dist/Virtualizer.mjs +0 -234
- package/dist/Virtualizer.module.js +0 -234
- package/dist/Virtualizer.module.js.map +0 -1
- package/dist/types.d.ts +0 -368
- package/dist/types.d.ts.map +0 -1
- package/dist/useVirtualizerState.main.js +0 -101
- package/dist/useVirtualizerState.main.js.map +0 -1
- package/dist/useVirtualizerState.mjs +0 -92
- package/dist/useVirtualizerState.module.js +0 -92
- package/dist/useVirtualizerState.module.js.map +0 -1
- package/dist/utils.main.js +0 -27
- package/dist/utils.main.js.map +0 -1
- package/dist/utils.mjs +0 -22
- package/dist/utils.module.js +0 -22
- package/dist/utils.module.js.map +0 -1
- package/src/Layout.ts +0 -101
- package/src/LayoutInfo.ts +0 -118
- package/src/OverscanManager.ts +0 -56
- package/src/Point.ts +0 -45
- package/src/Rect.ts +0 -193
- package/src/ReusableView.ts +0 -98
- package/src/Size.ts +0 -43
- package/src/Virtualizer.ts +0 -363
- package/src/types.ts +0 -44
- package/src/useVirtualizerState.ts +0 -120
- package/src/utils.ts +0 -30
package/dist/import.mjs
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {Layout as $
|
|
2
|
-
import {LayoutInfo as $d7fd61009c21d0bb$export$7e0eeb9da702a085} from "./LayoutInfo.mjs";
|
|
3
|
-
import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.mjs";
|
|
4
|
-
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.mjs";
|
|
5
|
-
import {Size as $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec} from "./Size.mjs";
|
|
6
|
-
import {ReusableView as $ad1d98aa8f0c31b4$export$1a5223887c560441} from "./ReusableView.mjs";
|
|
7
|
-
import {useVirtualizerState as $fc0b13b484ac1194$export$1505db82fe357e65} from "./useVirtualizerState.mjs";
|
|
1
|
+
import {Layout as $186fcb943ee0d933$re_export$Layout, LayoutInfo as $186fcb943ee0d933$re_export$LayoutInfo, Point as $186fcb943ee0d933$re_export$Point, Rect as $186fcb943ee0d933$re_export$Rect, Size as $186fcb943ee0d933$re_export$Size, ReusableView as $186fcb943ee0d933$re_export$ReusableView, useVirtualizerState as $186fcb943ee0d933$re_export$useVirtualizerState} from "react-stately/useVirtualizerState";
|
|
8
2
|
|
|
9
3
|
/*
|
|
10
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -19,11 +13,5 @@ import {useVirtualizerState as $fc0b13b484ac1194$export$1505db82fe357e65} from "
|
|
|
19
13
|
*/
|
|
20
14
|
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout, $d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo, $3041db3296945e6e$export$baf26146a414f24a as Point, $60423f92c7f9ad87$export$c79fc6492f3af13d as Rect, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec as Size, $ad1d98aa8f0c31b4$export$1a5223887c560441 as ReusableView, $fc0b13b484ac1194$export$1505db82fe357e65 as useVirtualizerState};
|
|
16
|
+
export {$186fcb943ee0d933$re_export$Layout as Layout, $186fcb943ee0d933$re_export$LayoutInfo as LayoutInfo, $186fcb943ee0d933$re_export$Point as Point, $186fcb943ee0d933$re_export$Rect as Rect, $186fcb943ee0d933$re_export$Size as Size, $186fcb943ee0d933$re_export$ReusableView as ReusableView, $186fcb943ee0d933$re_export$useVirtualizerState as useVirtualizerState};
|
|
29
17
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $8a899922c0a55745$exports = require("./LayoutInfo.main.js");
|
|
3
|
-
var $f89f15d7f52bce29$exports = require("./Point.main.js");
|
|
4
|
-
var $41b7691783731623$exports = require("./Rect.main.js");
|
|
5
|
-
var $064492b79924894c$exports = require("./Size.main.js");
|
|
6
|
-
var $197a1781bd47f5b9$exports = require("./ReusableView.main.js");
|
|
7
|
-
var $f02ef43b5e8eee9b$exports = require("./useVirtualizerState.main.js");
|
|
1
|
+
var $5BFJC$reactstatelyuseVirtualizerState = require("react-stately/useVirtualizerState");
|
|
8
2
|
|
|
9
3
|
|
|
10
4
|
function $parcel$export(e, n, v, s) {
|
|
11
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
6
|
}
|
|
13
7
|
|
|
14
|
-
$parcel$export(module.exports, "Layout", ()
|
|
15
|
-
$parcel$export(module.exports, "LayoutInfo", ()
|
|
16
|
-
$parcel$export(module.exports, "Point", ()
|
|
17
|
-
$parcel$export(module.exports, "Rect", ()
|
|
18
|
-
$parcel$export(module.exports, "Size", ()
|
|
19
|
-
$parcel$export(module.exports, "ReusableView", ()
|
|
20
|
-
$parcel$export(module.exports, "useVirtualizerState", ()
|
|
8
|
+
$parcel$export(module.exports, "Layout", function () { return $5BFJC$reactstatelyuseVirtualizerState.Layout; });
|
|
9
|
+
$parcel$export(module.exports, "LayoutInfo", function () { return $5BFJC$reactstatelyuseVirtualizerState.LayoutInfo; });
|
|
10
|
+
$parcel$export(module.exports, "Point", function () { return $5BFJC$reactstatelyuseVirtualizerState.Point; });
|
|
11
|
+
$parcel$export(module.exports, "Rect", function () { return $5BFJC$reactstatelyuseVirtualizerState.Rect; });
|
|
12
|
+
$parcel$export(module.exports, "Size", function () { return $5BFJC$reactstatelyuseVirtualizerState.Size; });
|
|
13
|
+
$parcel$export(module.exports, "ReusableView", function () { return $5BFJC$reactstatelyuseVirtualizerState.ReusableView; });
|
|
14
|
+
$parcel$export(module.exports, "useVirtualizerState", function () { return $5BFJC$reactstatelyuseVirtualizerState.useVirtualizerState; });
|
|
21
15
|
/*
|
|
22
16
|
* Copyright 2020 Adobe. All rights reserved.
|
|
23
17
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -31,10 +25,4 @@ $parcel$export(module.exports, "useVirtualizerState", () => $f02ef43b5e8eee9b$ex
|
|
|
31
25
|
*/
|
|
32
26
|
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
28
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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 {Layout, LayoutInfo, Point, Rect, Size, ReusableView, useVirtualizerState} from 'react-stately/useVirtualizerState';\nexport type {InvalidationContext, VirtualizerState, RectCorner} from 'react-stately/useVirtualizerState';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {Layout as $
|
|
2
|
-
import {LayoutInfo as $d7fd61009c21d0bb$export$7e0eeb9da702a085} from "./LayoutInfo.module.js";
|
|
3
|
-
import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.module.js";
|
|
4
|
-
import {Rect as $60423f92c7f9ad87$export$c79fc6492f3af13d} from "./Rect.module.js";
|
|
5
|
-
import {Size as $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec} from "./Size.module.js";
|
|
6
|
-
import {ReusableView as $ad1d98aa8f0c31b4$export$1a5223887c560441} from "./ReusableView.module.js";
|
|
7
|
-
import {useVirtualizerState as $fc0b13b484ac1194$export$1505db82fe357e65} from "./useVirtualizerState.module.js";
|
|
1
|
+
import {Layout as $186fcb943ee0d933$re_export$Layout, LayoutInfo as $186fcb943ee0d933$re_export$LayoutInfo, Point as $186fcb943ee0d933$re_export$Point, Rect as $186fcb943ee0d933$re_export$Rect, Size as $186fcb943ee0d933$re_export$Size, ReusableView as $186fcb943ee0d933$re_export$ReusableView, useVirtualizerState as $186fcb943ee0d933$re_export$useVirtualizerState} from "react-stately/useVirtualizerState";
|
|
8
2
|
|
|
9
3
|
/*
|
|
10
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -19,11 +13,5 @@ import {useVirtualizerState as $fc0b13b484ac1194$export$1505db82fe357e65} from "
|
|
|
19
13
|
*/
|
|
20
14
|
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout, $d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo, $3041db3296945e6e$export$baf26146a414f24a as Point, $60423f92c7f9ad87$export$c79fc6492f3af13d as Rect, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec as Size, $ad1d98aa8f0c31b4$export$1a5223887c560441 as ReusableView, $fc0b13b484ac1194$export$1505db82fe357e65 as useVirtualizerState};
|
|
16
|
+
export {$186fcb943ee0d933$re_export$Layout as Layout, $186fcb943ee0d933$re_export$LayoutInfo as LayoutInfo, $186fcb943ee0d933$re_export$Point as Point, $186fcb943ee0d933$re_export$Rect as Rect, $186fcb943ee0d933$re_export$Size as Size, $186fcb943ee0d933$re_export$ReusableView as ReusableView, $186fcb943ee0d933$re_export$useVirtualizerState as useVirtualizerState};
|
|
29
17
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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 {Layout, LayoutInfo, Point, Rect, Size, ReusableView, useVirtualizerState} from 'react-stately/useVirtualizerState';\nexport type {InvalidationContext, VirtualizerState, RectCorner} from 'react-stately/useVirtualizerState';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/virtualizer",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"./dist/types.d.ts",
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"import": "./dist/import.mjs",
|
|
13
|
+
"require": "./dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/types.d.ts",
|
|
17
|
+
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"url": "https://github.com/adobe/react-spectrum"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
29
|
+
"@swc/helpers": "^0.5.0",
|
|
30
|
+
"react-stately": "3.46.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
@@ -36,5 +36,8 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"targets": {
|
|
40
|
+
"types": false
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
40
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,14 +10,5 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export
|
|
14
|
-
export type {VirtualizerState} from '
|
|
15
|
-
export type {RectCorner} from './Rect';
|
|
16
|
-
|
|
17
|
-
export {Layout} from './Layout';
|
|
18
|
-
export {LayoutInfo} from './LayoutInfo';
|
|
19
|
-
export {Point} from './Point';
|
|
20
|
-
export {Rect} from './Rect';
|
|
21
|
-
export {Size} from './Size';
|
|
22
|
-
export {ReusableView} from './ReusableView';
|
|
23
|
-
export {useVirtualizerState} from './useVirtualizerState';
|
|
13
|
+
export {Layout, LayoutInfo, Point, Rect, Size, ReusableView, useVirtualizerState} from 'react-stately/useVirtualizerState';
|
|
14
|
+
export type {InvalidationContext, VirtualizerState, RectCorner} from 'react-stately/useVirtualizerState';
|
package/dist/Layout.main.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
* Returns whether the layout should invalidate when the layout options change.
|
|
29
|
-
* By default it invalidates when the object identity changes. Override this
|
|
30
|
-
* method to optimize layout updates based on specific option changes.
|
|
31
|
-
*/ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
|
|
32
|
-
return newOptions !== oldOptions;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* This method allows the layout to perform any pre-computation
|
|
36
|
-
* it needs to in order to prepare LayoutInfos for retrieval.
|
|
37
|
-
* Called by the virtualizer before `getVisibleLayoutInfos`
|
|
38
|
-
* or `getLayoutInfo` are called.
|
|
39
|
-
*/ update(invalidationContext) {}
|
|
40
|
-
/** @private */ getItemRect(key) {
|
|
41
|
-
var _this_getLayoutInfo;
|
|
42
|
-
var _this_getLayoutInfo_rect;
|
|
43
|
-
return (_this_getLayoutInfo_rect = (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect) !== null && _this_getLayoutInfo_rect !== void 0 ? _this_getLayoutInfo_rect : null;
|
|
44
|
-
}
|
|
45
|
-
/** @private */ getVisibleRect() {
|
|
46
|
-
return this.virtualizer.visibleRect;
|
|
47
|
-
}
|
|
48
|
-
constructor(){
|
|
49
|
-
/** The Virtualizer the layout is currently attached to. */ this.virtualizer = null;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=Layout.main.js.map
|
package/dist/Layout.main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAmBM,MAAe;IAuBpB;;;;;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;;;;GAIC,GACD,8BAA8B,UAAa,EAAE,UAAa,EAAW;QACnE,OAAO,eAAe;IACxB;IAEA;;;;;GAKC,GACD,OAAO,mBAA2C,EAAQ,CAAC;IAY3D,aAAa,GACb,YAAY,GAAQ,EAAe;YAC1B;YAAA;QAAP,OAAO,CAAA,4BAAA,sBAAA,IAAI,CAAC,aAAa,CAAC,kBAAnB,0CAAA,oBAAyB,IAAI,cAA7B,sCAAA,2BAAiC;IAC1C;IAEA,aAAa,GACb,iBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAE,WAAW;IACtC;;QArEA,yDAAyD,QACzD,cAA0C;;AAqE5C","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, Node} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Rect} from './Rect';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n\n/**\n * Virtualizer supports arbitrary layout objects, which compute what items are visible, and how\n * to position and style them. However, layouts do not render items directly. Instead,\n * layouts produce lightweight LayoutInfo objects which describe various properties of an item,\n * such as its position and size. The Virtualizer is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the Layout abstract base class. Layouts must implement the `getVisibleLayoutInfos`,\n * `getLayoutInfo`, and `getContentSize` methods. All other methods can be optionally overridden to implement custom behavior.\n */\nexport abstract class Layout<T extends object = Node<any>, O = any> implements LayoutDelegate {\n /** The Virtualizer the layout is currently attached to. */\n virtualizer: Virtualizer<T, any> | null = null;\n\n /**\n * Returns an array of `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 `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 virtualizer's size.\n */\n abstract getContentSize(): Size; \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 * Returns whether the layout should invalidate when the layout options change.\n * By default it invalidates when the object identity changes. Override this\n * method to optimize layout updates based on specific option changes.\n */\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return newOptions !== oldOptions;\n }\n\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare LayoutInfos for retrieval.\n * Called by the virtualizer before `getVisibleLayoutInfos`\n * or `getLayoutInfo` are called.\n */\n update(invalidationContext: InvalidationContext<O>): void {} // eslint-disable-line @typescript-eslint/no-unused-vars\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 /** @private */\n getItemRect(key: Key): Rect | null {\n return this.getLayoutInfo(key)?.rect ?? null;\n }\n\n /** @private */\n getVisibleRect(): Rect {\n return this.virtualizer!.visibleRect;\n }\n}\n"],"names":[],"version":3,"file":"Layout.main.js.map"}
|
package/dist/Layout.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
* Returns whether the layout should invalidate when the layout options change.
|
|
23
|
-
* By default it invalidates when the object identity changes. Override this
|
|
24
|
-
* method to optimize layout updates based on specific option changes.
|
|
25
|
-
*/ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
|
|
26
|
-
return newOptions !== oldOptions;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This method allows the layout to perform any pre-computation
|
|
30
|
-
* it needs to in order to prepare LayoutInfos for retrieval.
|
|
31
|
-
* Called by the virtualizer before `getVisibleLayoutInfos`
|
|
32
|
-
* or `getLayoutInfo` are called.
|
|
33
|
-
*/ update(invalidationContext) {}
|
|
34
|
-
/** @private */ getItemRect(key) {
|
|
35
|
-
var _this_getLayoutInfo;
|
|
36
|
-
var _this_getLayoutInfo_rect;
|
|
37
|
-
return (_this_getLayoutInfo_rect = (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect) !== null && _this_getLayoutInfo_rect !== void 0 ? _this_getLayoutInfo_rect : null;
|
|
38
|
-
}
|
|
39
|
-
/** @private */ getVisibleRect() {
|
|
40
|
-
return this.virtualizer.visibleRect;
|
|
41
|
-
}
|
|
42
|
-
constructor(){
|
|
43
|
-
/** The Virtualizer the layout is currently attached to. */ this.virtualizer = null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout};
|
|
49
|
-
//# sourceMappingURL=Layout.module.js.map
|
package/dist/Layout.module.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
* Returns whether the layout should invalidate when the layout options change.
|
|
23
|
-
* By default it invalidates when the object identity changes. Override this
|
|
24
|
-
* method to optimize layout updates based on specific option changes.
|
|
25
|
-
*/ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
|
|
26
|
-
return newOptions !== oldOptions;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This method allows the layout to perform any pre-computation
|
|
30
|
-
* it needs to in order to prepare LayoutInfos for retrieval.
|
|
31
|
-
* Called by the virtualizer before `getVisibleLayoutInfos`
|
|
32
|
-
* or `getLayoutInfo` are called.
|
|
33
|
-
*/ update(invalidationContext) {}
|
|
34
|
-
/** @private */ getItemRect(key) {
|
|
35
|
-
var _this_getLayoutInfo;
|
|
36
|
-
var _this_getLayoutInfo_rect;
|
|
37
|
-
return (_this_getLayoutInfo_rect = (_this_getLayoutInfo = this.getLayoutInfo(key)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect) !== null && _this_getLayoutInfo_rect !== void 0 ? _this_getLayoutInfo_rect : null;
|
|
38
|
-
}
|
|
39
|
-
/** @private */ getVisibleRect() {
|
|
40
|
-
return this.virtualizer.visibleRect;
|
|
41
|
-
}
|
|
42
|
-
constructor(){
|
|
43
|
-
/** The Virtualizer the layout is currently attached to. */ this.virtualizer = null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export {$c74cda7d31af1253$export$c84671f46d6a1ca as Layout};
|
|
49
|
-
//# sourceMappingURL=Layout.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAmBM,MAAe;IAuBpB;;;;;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;;;;GAIC,GACD,8BAA8B,UAAa,EAAE,UAAa,EAAW;QACnE,OAAO,eAAe;IACxB;IAEA;;;;;GAKC,GACD,OAAO,mBAA2C,EAAQ,CAAC;IAY3D,aAAa,GACb,YAAY,GAAQ,EAAe;YAC1B;YAAA;QAAP,OAAO,CAAA,4BAAA,sBAAA,IAAI,CAAC,aAAa,CAAC,kBAAnB,0CAAA,oBAAyB,IAAI,cAA7B,sCAAA,2BAAiC;IAC1C;IAEA,aAAa,GACb,iBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAE,WAAW;IACtC;;QArEA,yDAAyD,QACzD,cAA0C;;AAqE5C","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, Node} from '@react-types/shared';\nimport {LayoutInfo} from './LayoutInfo';\nimport {Rect} from './Rect';\nimport {Size} from './Size';\nimport {Virtualizer} from './Virtualizer';\n\n/**\n * Virtualizer supports arbitrary layout objects, which compute what items are visible, and how\n * to position and style them. However, layouts do not render items directly. Instead,\n * layouts produce lightweight LayoutInfo objects which describe various properties of an item,\n * such as its position and size. The Virtualizer is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the Layout abstract base class. Layouts must implement the `getVisibleLayoutInfos`,\n * `getLayoutInfo`, and `getContentSize` methods. All other methods can be optionally overridden to implement custom behavior.\n */\nexport abstract class Layout<T extends object = Node<any>, O = any> implements LayoutDelegate {\n /** The Virtualizer the layout is currently attached to. */\n virtualizer: Virtualizer<T, any> | null = null;\n\n /**\n * Returns an array of `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 `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 virtualizer's size.\n */\n abstract getContentSize(): Size; \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 * Returns whether the layout should invalidate when the layout options change.\n * By default it invalidates when the object identity changes. Override this\n * method to optimize layout updates based on specific option changes.\n */\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return newOptions !== oldOptions;\n }\n\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare LayoutInfos for retrieval.\n * Called by the virtualizer before `getVisibleLayoutInfos`\n * or `getLayoutInfo` are called.\n */\n update(invalidationContext: InvalidationContext<O>): void {} // eslint-disable-line @typescript-eslint/no-unused-vars\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 /** @private */\n getItemRect(key: Key): Rect | null {\n return this.getLayoutInfo(key)?.rect ?? null;\n }\n\n /** @private */\n getVisibleRect(): Rect {\n return this.virtualizer!.visibleRect;\n }\n}\n"],"names":[],"version":3,"file":"Layout.module.js.map"}
|
package/dist/LayoutInfo.main.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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.content = this.content;
|
|
27
|
-
res.isSticky = this.isSticky;
|
|
28
|
-
res.zIndex = this.zIndex;
|
|
29
|
-
res.allowOverflow = this.allowOverflow;
|
|
30
|
-
return res;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.
|
|
34
|
-
* @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
|
|
35
|
-
* @param rect The rectangle describing the size and position of this element.
|
|
36
|
-
*/ constructor(type, key, rect){
|
|
37
|
-
this.type = type;
|
|
38
|
-
this.key = key;
|
|
39
|
-
this.parentKey = null;
|
|
40
|
-
this.content = null;
|
|
41
|
-
this.rect = rect;
|
|
42
|
-
this.estimatedSize = false;
|
|
43
|
-
this.isSticky = false;
|
|
44
|
-
this.opacity = 1;
|
|
45
|
-
this.transform = null;
|
|
46
|
-
this.zIndex = 0;
|
|
47
|
-
this.allowOverflow = false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=LayoutInfo.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAWM,MAAM;IAiFX;;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,OAAO,GAAG,IAAI,CAAC,OAAO;QAC1B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ;QAC5B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM;QACxB,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,OAAO;IACT;IAjCA;;;;GAIC,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,OAAO,GAAG;QACf,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;AAiBF","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 `Layout` subclasses\n * to represent each item in the `Virtualizer`. LayoutInfo objects describe\n * various properties of an item, such as its position and size, and style information.\n * The virtualizer uses this information when creating actual DOM elements to display.\n */\nexport class LayoutInfo {\n /**\n * The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.\n */\n type: string;\n\n /**\n * A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.\n */\n key: Key;\n\n /**\n * The key for a parent LayoutInfo, if any.\n */\n parentKey: Key | null;\n\n /** \n * Content for this item if it was generated by the layout rather than coming from the Collection.\n */\n content: any | null;\n\n /**\n * The rectangle describing the size and position of this element.\n */\n rect: Rect;\n\n /**\n * Whether the size is estimated. `false` by default.\n * Items with estimated sizes will be measured the first time they are added to the DOM.\n * The estimated size is used to calculate the size and position of the scrollbar.\n * @default false\n */\n estimatedSize: boolean;\n\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n * @default false\n */\n isSticky: boolean;\n\n /**\n * The element's opacity.\n * @default 1\n */\n opacity: number;\n\n /**\n * A CSS transform string to apply to the element. `null` by default.\n */\n transform: string | null;\n\n /**\n * The z-index of the element. 0 by default.\n */\n zIndex: number;\n\n /**\n * Whether the element allows its contents to overflow its container.\n * @default false\n */\n allowOverflow: boolean;\n\n /**\n * @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.\n * @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.\n * @param rect The rectangle describing the size and position of this element.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.content = 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.content = this.content;\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"}
|
package/dist/LayoutInfo.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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.content = this.content;
|
|
21
|
-
res.isSticky = this.isSticky;
|
|
22
|
-
res.zIndex = this.zIndex;
|
|
23
|
-
res.allowOverflow = this.allowOverflow;
|
|
24
|
-
return res;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.
|
|
28
|
-
* @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
|
|
29
|
-
* @param rect The rectangle describing the size and position of this element.
|
|
30
|
-
*/ constructor(type, key, rect){
|
|
31
|
-
this.type = type;
|
|
32
|
-
this.key = key;
|
|
33
|
-
this.parentKey = null;
|
|
34
|
-
this.content = null;
|
|
35
|
-
this.rect = rect;
|
|
36
|
-
this.estimatedSize = false;
|
|
37
|
-
this.isSticky = false;
|
|
38
|
-
this.opacity = 1;
|
|
39
|
-
this.transform = null;
|
|
40
|
-
this.zIndex = 0;
|
|
41
|
-
this.allowOverflow = false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export {$d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo};
|
|
47
|
-
//# sourceMappingURL=LayoutInfo.module.js.map
|
|
@@ -1,47 +0,0 @@
|
|
|
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.content = this.content;
|
|
21
|
-
res.isSticky = this.isSticky;
|
|
22
|
-
res.zIndex = this.zIndex;
|
|
23
|
-
res.allowOverflow = this.allowOverflow;
|
|
24
|
-
return res;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.
|
|
28
|
-
* @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
|
|
29
|
-
* @param rect The rectangle describing the size and position of this element.
|
|
30
|
-
*/ constructor(type, key, rect){
|
|
31
|
-
this.type = type;
|
|
32
|
-
this.key = key;
|
|
33
|
-
this.parentKey = null;
|
|
34
|
-
this.content = null;
|
|
35
|
-
this.rect = rect;
|
|
36
|
-
this.estimatedSize = false;
|
|
37
|
-
this.isSticky = false;
|
|
38
|
-
this.opacity = 1;
|
|
39
|
-
this.transform = null;
|
|
40
|
-
this.zIndex = 0;
|
|
41
|
-
this.allowOverflow = false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export {$d7fd61009c21d0bb$export$7e0eeb9da702a085 as LayoutInfo};
|
|
47
|
-
//# sourceMappingURL=LayoutInfo.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAWM,MAAM;IAiFX;;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,OAAO,GAAG,IAAI,CAAC,OAAO;QAC1B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ;QAC5B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM;QACxB,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa;QACtC,OAAO;IACT;IAjCA;;;;GAIC,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,OAAO,GAAG;QACf,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;AAiBF","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 `Layout` subclasses\n * to represent each item in the `Virtualizer`. LayoutInfo objects describe\n * various properties of an item, such as its position and size, and style information.\n * The virtualizer uses this information when creating actual DOM elements to display.\n */\nexport class LayoutInfo {\n /**\n * The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.\n */\n type: string;\n\n /**\n * A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.\n */\n key: Key;\n\n /**\n * The key for a parent LayoutInfo, if any.\n */\n parentKey: Key | null;\n\n /** \n * Content for this item if it was generated by the layout rather than coming from the Collection.\n */\n content: any | null;\n\n /**\n * The rectangle describing the size and position of this element.\n */\n rect: Rect;\n\n /**\n * Whether the size is estimated. `false` by default.\n * Items with estimated sizes will be measured the first time they are added to the DOM.\n * The estimated size is used to calculate the size and position of the scrollbar.\n * @default false\n */\n estimatedSize: boolean;\n\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n * @default false\n */\n isSticky: boolean;\n\n /**\n * The element's opacity.\n * @default 1\n */\n opacity: number;\n\n /**\n * A CSS transform string to apply to the element. `null` by default.\n */\n transform: string | null;\n\n /**\n * The z-index of the element. 0 by default.\n */\n zIndex: number;\n\n /**\n * Whether the element allows its contents to overflow its container.\n * @default false\n */\n allowOverflow: boolean;\n\n /**\n * @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.\n * @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.\n * @param rect The rectangle describing the size and position of this element.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.content = 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.content = this.content;\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"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,MAAM;IAKX,eAAe,IAAU,EAAQ;QAC/B,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,qBAA2B;QACzB,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): void {\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(): Rect {\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"}
|