@react-aria/selection 3.27.1 → 3.28.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 +7 -7
- package/dist/main.js +12 -12
- package/dist/main.js.map +1 -1
- package/dist/module.js +7 -7
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +10 -0
- package/package.json +15 -17
- package/src/index.ts +10 -10
- package/dist/DOMLayoutDelegate.main.js +0 -59
- package/dist/DOMLayoutDelegate.main.js.map +0 -1
- package/dist/DOMLayoutDelegate.mjs +0 -54
- package/dist/DOMLayoutDelegate.module.js +0 -54
- package/dist/DOMLayoutDelegate.module.js.map +0 -1
- package/dist/ListKeyboardDelegate.main.js +0 -197
- package/dist/ListKeyboardDelegate.main.js.map +0 -1
- package/dist/ListKeyboardDelegate.mjs +0 -192
- package/dist/ListKeyboardDelegate.module.js +0 -192
- package/dist/ListKeyboardDelegate.module.js.map +0 -1
- package/dist/types.d.ts +0 -258
- package/dist/types.d.ts.map +0 -1
- package/dist/useSelectableCollection.main.js +0 -403
- package/dist/useSelectableCollection.main.js.map +0 -1
- package/dist/useSelectableCollection.mjs +0 -398
- package/dist/useSelectableCollection.module.js +0 -398
- package/dist/useSelectableCollection.module.js.map +0 -1
- package/dist/useSelectableItem.main.js +0 -263
- package/dist/useSelectableItem.main.js.map +0 -1
- package/dist/useSelectableItem.mjs +0 -258
- package/dist/useSelectableItem.module.js +0 -258
- package/dist/useSelectableItem.module.js.map +0 -1
- package/dist/useSelectableList.main.js +0 -63
- package/dist/useSelectableList.main.js.map +0 -1
- package/dist/useSelectableList.mjs +0 -58
- package/dist/useSelectableList.module.js +0 -58
- package/dist/useSelectableList.module.js.map +0 -1
- package/dist/useTypeSelect.main.js +0 -77
- package/dist/useTypeSelect.main.js.map +0 -1
- package/dist/useTypeSelect.mjs +0 -72
- package/dist/useTypeSelect.module.js +0 -72
- package/dist/useTypeSelect.module.js.map +0 -1
- package/dist/utils.main.js +0 -46
- package/dist/utils.main.js.map +0 -1
- package/dist/utils.mjs +0 -38
- package/dist/utils.module.js +0 -38
- package/dist/utils.module.js.map +0 -1
- package/src/DOMLayoutDelegate.ts +0 -61
- package/src/ListKeyboardDelegate.ts +0 -291
- package/src/useSelectableCollection.ts +0 -593
- package/src/useSelectableItem.ts +0 -422
- package/src/useSelectableList.ts +0 -85
- package/src/useTypeSelect.ts +0 -117
- package/src/utils.ts +0 -47
package/dist/import.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {useSelectableCollection as $
|
|
2
|
-
import {useSelectableItem as $
|
|
3
|
-
import {useSelectableList as $
|
|
4
|
-
import {ListKeyboardDelegate as $
|
|
5
|
-
import {DOMLayoutDelegate as $
|
|
6
|
-
import {useTypeSelect as $
|
|
1
|
+
import {useSelectableCollection as $8f488ee156d258d7$re_export$useSelectableCollection} from "react-aria/private/selection/useSelectableCollection";
|
|
2
|
+
import {useSelectableItem as $8f488ee156d258d7$re_export$useSelectableItem} from "react-aria/private/selection/useSelectableItem";
|
|
3
|
+
import {useSelectableList as $8f488ee156d258d7$re_export$useSelectableList} from "react-aria/private/selection/useSelectableList";
|
|
4
|
+
import {ListKeyboardDelegate as $8f488ee156d258d7$re_export$ListKeyboardDelegate} from "react-aria/ListKeyboardDelegate";
|
|
5
|
+
import {DOMLayoutDelegate as $8f488ee156d258d7$re_export$DOMLayoutDelegate} from "react-aria/private/selection/DOMLayoutDelegate";
|
|
6
|
+
import {useTypeSelect as $8f488ee156d258d7$re_export$useTypeSelect} from "react-aria/private/selection/useTypeSelect";
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -23,5 +23,5 @@ import {useTypeSelect as $fb3050f43d946246$export$e32c88dfddc6e1d8} from "./useT
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
export {$
|
|
26
|
+
export {$8f488ee156d258d7$re_export$useSelectableCollection as useSelectableCollection, $8f488ee156d258d7$re_export$useSelectableItem as useSelectableItem, $8f488ee156d258d7$re_export$useSelectableList as useSelectableList, $8f488ee156d258d7$re_export$ListKeyboardDelegate as ListKeyboardDelegate, $8f488ee156d258d7$re_export$DOMLayoutDelegate as DOMLayoutDelegate, $8f488ee156d258d7$re_export$useTypeSelect as useTypeSelect};
|
|
27
27
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
1
|
+
var $4HcRa$reactariaprivateselectionuseSelectableCollection = require("react-aria/private/selection/useSelectableCollection");
|
|
2
|
+
var $4HcRa$reactariaprivateselectionuseSelectableItem = require("react-aria/private/selection/useSelectableItem");
|
|
3
|
+
var $4HcRa$reactariaprivateselectionuseSelectableList = require("react-aria/private/selection/useSelectableList");
|
|
4
|
+
var $4HcRa$reactariaListKeyboardDelegate = require("react-aria/ListKeyboardDelegate");
|
|
5
|
+
var $4HcRa$reactariaprivateselectionDOMLayoutDelegate = require("react-aria/private/selection/DOMLayoutDelegate");
|
|
6
|
+
var $4HcRa$reactariaprivateselectionuseTypeSelect = require("react-aria/private/selection/useTypeSelect");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
function $parcel$export(e, n, v, s) {
|
|
10
10
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
$parcel$export(module.exports, "useSelectableCollection", ()
|
|
14
|
-
$parcel$export(module.exports, "useSelectableItem", ()
|
|
15
|
-
$parcel$export(module.exports, "useSelectableList", ()
|
|
16
|
-
$parcel$export(module.exports, "ListKeyboardDelegate", ()
|
|
17
|
-
$parcel$export(module.exports, "DOMLayoutDelegate", ()
|
|
18
|
-
$parcel$export(module.exports, "useTypeSelect", ()
|
|
13
|
+
$parcel$export(module.exports, "useSelectableCollection", function () { return $4HcRa$reactariaprivateselectionuseSelectableCollection.useSelectableCollection; });
|
|
14
|
+
$parcel$export(module.exports, "useSelectableItem", function () { return $4HcRa$reactariaprivateselectionuseSelectableItem.useSelectableItem; });
|
|
15
|
+
$parcel$export(module.exports, "useSelectableList", function () { return $4HcRa$reactariaprivateselectionuseSelectableList.useSelectableList; });
|
|
16
|
+
$parcel$export(module.exports, "ListKeyboardDelegate", function () { return $4HcRa$reactariaListKeyboardDelegate.ListKeyboardDelegate; });
|
|
17
|
+
$parcel$export(module.exports, "DOMLayoutDelegate", function () { return $4HcRa$reactariaprivateselectionDOMLayoutDelegate.DOMLayoutDelegate; });
|
|
18
|
+
$parcel$export(module.exports, "useTypeSelect", function () { return $4HcRa$reactariaprivateselectionuseTypeSelect.useTypeSelect; });
|
|
19
19
|
/*
|
|
20
20
|
* Copyright 2020 Adobe. All rights reserved.
|
|
21
21
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/selection/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 {useSelectableCollection} from '
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/selection/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 {useSelectableCollection} from 'react-aria/private/selection/useSelectableCollection';\n\nexport {useSelectableItem} from 'react-aria/private/selection/useSelectableItem';\nexport {useSelectableList} from 'react-aria/private/selection/useSelectableList';\nexport {ListKeyboardDelegate} from 'react-aria/ListKeyboardDelegate';\nexport {DOMLayoutDelegate} from 'react-aria/private/selection/DOMLayoutDelegate';\nexport {useTypeSelect} from 'react-aria/private/selection/useTypeSelect';\nexport type {AriaSelectableCollectionOptions, SelectableCollectionAria} from 'react-aria/private/selection/useSelectableCollection';\nexport type {AriaSelectableListOptions, SelectableListAria} from 'react-aria/private/selection/useSelectableList';\nexport type {SelectableItemOptions, SelectableItemStates, SelectableItemAria} from 'react-aria/private/selection/useSelectableItem';\nexport type {AriaTypeSelectOptions, TypeSelectAria} from 'react-aria/private/selection/useTypeSelect';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {useSelectableCollection as $
|
|
2
|
-
import {useSelectableItem as $
|
|
3
|
-
import {useSelectableList as $
|
|
4
|
-
import {ListKeyboardDelegate as $
|
|
5
|
-
import {DOMLayoutDelegate as $
|
|
6
|
-
import {useTypeSelect as $
|
|
1
|
+
import {useSelectableCollection as $8f488ee156d258d7$re_export$useSelectableCollection} from "react-aria/private/selection/useSelectableCollection";
|
|
2
|
+
import {useSelectableItem as $8f488ee156d258d7$re_export$useSelectableItem} from "react-aria/private/selection/useSelectableItem";
|
|
3
|
+
import {useSelectableList as $8f488ee156d258d7$re_export$useSelectableList} from "react-aria/private/selection/useSelectableList";
|
|
4
|
+
import {ListKeyboardDelegate as $8f488ee156d258d7$re_export$ListKeyboardDelegate} from "react-aria/ListKeyboardDelegate";
|
|
5
|
+
import {DOMLayoutDelegate as $8f488ee156d258d7$re_export$DOMLayoutDelegate} from "react-aria/private/selection/DOMLayoutDelegate";
|
|
6
|
+
import {useTypeSelect as $8f488ee156d258d7$re_export$useTypeSelect} from "react-aria/private/selection/useTypeSelect";
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -23,5 +23,5 @@ import {useTypeSelect as $fb3050f43d946246$export$e32c88dfddc6e1d8} from "./useT
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
export {$
|
|
26
|
+
export {$8f488ee156d258d7$re_export$useSelectableCollection as useSelectableCollection, $8f488ee156d258d7$re_export$useSelectableItem as useSelectableItem, $8f488ee156d258d7$re_export$useSelectableList as useSelectableList, $8f488ee156d258d7$re_export$ListKeyboardDelegate as ListKeyboardDelegate, $8f488ee156d258d7$re_export$DOMLayoutDelegate as DOMLayoutDelegate, $8f488ee156d258d7$re_export$useTypeSelect as useTypeSelect};
|
|
27
27
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/selection/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 {useSelectableCollection} from '
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/selection/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 {useSelectableCollection} from 'react-aria/private/selection/useSelectableCollection';\n\nexport {useSelectableItem} from 'react-aria/private/selection/useSelectableItem';\nexport {useSelectableList} from 'react-aria/private/selection/useSelectableList';\nexport {ListKeyboardDelegate} from 'react-aria/ListKeyboardDelegate';\nexport {DOMLayoutDelegate} from 'react-aria/private/selection/DOMLayoutDelegate';\nexport {useTypeSelect} from 'react-aria/private/selection/useTypeSelect';\nexport type {AriaSelectableCollectionOptions, SelectableCollectionAria} from 'react-aria/private/selection/useSelectableCollection';\nexport type {AriaSelectableListOptions, SelectableListAria} from 'react-aria/private/selection/useSelectableList';\nexport type {SelectableItemOptions, SelectableItemStates, SelectableItemAria} from 'react-aria/private/selection/useSelectableItem';\nexport type {AriaTypeSelectOptions, TypeSelectAria} from 'react-aria/private/selection/useTypeSelect';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { useSelectableCollection } from 'react-aria/private/selection/useSelectableCollection';
|
|
2
|
+
export { useSelectableItem } from 'react-aria/private/selection/useSelectableItem';
|
|
3
|
+
export { useSelectableList } from 'react-aria/private/selection/useSelectableList';
|
|
4
|
+
export { ListKeyboardDelegate } from 'react-aria/ListKeyboardDelegate';
|
|
5
|
+
export { DOMLayoutDelegate } from 'react-aria/private/selection/DOMLayoutDelegate';
|
|
6
|
+
export { useTypeSelect } from 'react-aria/private/selection/useTypeSelect';
|
|
7
|
+
export type { AriaSelectableCollectionOptions, SelectableCollectionAria } from 'react-aria/private/selection/useSelectableCollection';
|
|
8
|
+
export type { AriaSelectableListOptions, SelectableListAria } from 'react-aria/private/selection/useSelectableList';
|
|
9
|
+
export type { SelectableItemOptions, SelectableItemStates, SelectableItemAria } from 'react-aria/private/selection/useSelectableItem';
|
|
10
|
+
export type { AriaTypeSelectOptions, TypeSelectAria } from 'react-aria/private/selection/useTypeSelect';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/selection",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.28.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,13 +26,8 @@
|
|
|
26
26
|
"url": "https://github.com/adobe/react-spectrum"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"@react-aria/interactions": "^3.27.0",
|
|
32
|
-
"@react-aria/utils": "^3.33.0",
|
|
33
|
-
"@react-stately/selection": "^3.20.8",
|
|
34
|
-
"@react-types/shared": "^3.33.0",
|
|
35
|
-
"@swc/helpers": "^0.5.0"
|
|
29
|
+
"@swc/helpers": "^0.5.0",
|
|
30
|
+
"react-aria": "3.48.0"
|
|
36
31
|
},
|
|
37
32
|
"peerDependencies": {
|
|
38
33
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
@@ -41,5 +36,8 @@
|
|
|
41
36
|
"publishConfig": {
|
|
42
37
|
"access": "public"
|
|
43
38
|
},
|
|
44
|
-
"
|
|
39
|
+
"targets": {
|
|
40
|
+
"types": false
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
45
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export {useSelectableCollection} from '
|
|
14
|
-
export {useSelectableItem} from './useSelectableItem';
|
|
15
|
-
export {useSelectableList} from './useSelectableList';
|
|
16
|
-
export {ListKeyboardDelegate} from './ListKeyboardDelegate';
|
|
17
|
-
export {DOMLayoutDelegate} from './DOMLayoutDelegate';
|
|
18
|
-
export {useTypeSelect} from './useTypeSelect';
|
|
13
|
+
export {useSelectableCollection} from 'react-aria/private/selection/useSelectableCollection';
|
|
19
14
|
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
15
|
+
export {useSelectableItem} from 'react-aria/private/selection/useSelectableItem';
|
|
16
|
+
export {useSelectableList} from 'react-aria/private/selection/useSelectableList';
|
|
17
|
+
export {ListKeyboardDelegate} from 'react-aria/ListKeyboardDelegate';
|
|
18
|
+
export {DOMLayoutDelegate} from 'react-aria/private/selection/DOMLayoutDelegate';
|
|
19
|
+
export {useTypeSelect} from 'react-aria/private/selection/useTypeSelect';
|
|
20
|
+
export type {AriaSelectableCollectionOptions, SelectableCollectionAria} from 'react-aria/private/selection/useSelectableCollection';
|
|
21
|
+
export type {AriaSelectableListOptions, SelectableListAria} from 'react-aria/private/selection/useSelectableList';
|
|
22
|
+
export type {SelectableItemOptions, SelectableItemStates, SelectableItemAria} from 'react-aria/private/selection/useSelectableItem';
|
|
23
|
+
export type {AriaTypeSelectOptions, TypeSelectAria} from 'react-aria/private/selection/useTypeSelect';
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var $ee0bdf4faa47f2a8$exports = require("./utils.main.js");
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function $parcel$export(e, n, v, s) {
|
|
5
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
$parcel$export(module.exports, "DOMLayoutDelegate", () => $2ac4508142683dcb$export$8f5ed9ff9f511381);
|
|
9
|
-
/*
|
|
10
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
11
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
-
* governing permissions and limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
class $2ac4508142683dcb$export$8f5ed9ff9f511381 {
|
|
21
|
-
getItemRect(key) {
|
|
22
|
-
let container = this.ref.current;
|
|
23
|
-
if (!container) return null;
|
|
24
|
-
let item = key != null ? (0, $ee0bdf4faa47f2a8$exports.getItemElement)(this.ref, key) : null;
|
|
25
|
-
if (!item) return null;
|
|
26
|
-
let containerRect = container.getBoundingClientRect();
|
|
27
|
-
let itemRect = item.getBoundingClientRect();
|
|
28
|
-
return {
|
|
29
|
-
x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
|
|
30
|
-
y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
|
|
31
|
-
width: itemRect.width,
|
|
32
|
-
height: itemRect.height
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
getContentSize() {
|
|
36
|
-
let container = this.ref.current;
|
|
37
|
-
var _container_scrollWidth, _container_scrollHeight;
|
|
38
|
-
return {
|
|
39
|
-
width: (_container_scrollWidth = container === null || container === void 0 ? void 0 : container.scrollWidth) !== null && _container_scrollWidth !== void 0 ? _container_scrollWidth : 0,
|
|
40
|
-
height: (_container_scrollHeight = container === null || container === void 0 ? void 0 : container.scrollHeight) !== null && _container_scrollHeight !== void 0 ? _container_scrollHeight : 0
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
getVisibleRect() {
|
|
44
|
-
let container = this.ref.current;
|
|
45
|
-
var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
|
|
46
|
-
return {
|
|
47
|
-
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
48
|
-
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
49
|
-
width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
|
|
50
|
-
height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
constructor(ref){
|
|
54
|
-
this.ref = ref;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=DOMLayoutDelegate.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAKM,MAAM;IAOX,YAAY,GAAQ,EAAe;QACjC,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;QAChC,IAAI,CAAC,WACH,OAAO;QAET,IAAI,OAAO,OAAO,OAAO,CAAA,GAAA,wCAAa,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO;QACzD,IAAI,CAAC,MACH,OAAO;QAGT,IAAI,gBAAgB,UAAU,qBAAqB;QACnD,IAAI,WAAW,KAAK,qBAAqB;QAEzC,OAAO;YACL,GAAG,SAAS,IAAI,GAAG,cAAc,IAAI,GAAG,UAAU,UAAU,GAAG,UAAU,UAAU;YACnF,GAAG,SAAS,GAAG,GAAG,cAAc,GAAG,GAAG,UAAU,SAAS,GAAG,UAAU,SAAS;YAC/E,OAAO,SAAS,KAAK;YACrB,QAAQ,SAAS,MAAM;QACzB;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;YAEvB,wBACC;QAFV,OAAO;YACL,OAAO,CAAA,yBAAA,sBAAA,gCAAA,UAAW,WAAW,cAAtB,oCAAA,yBAA0B;YACjC,QAAQ,CAAA,0BAAA,sBAAA,gCAAA,UAAW,YAAY,cAAvB,qCAAA,0BAA2B;QACrC;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;YAE3B,uBACA,sBACI,wBACC;QAJV,OAAO;YACL,GAAG,CAAA,wBAAA,sBAAA,gCAAA,UAAW,UAAU,cAArB,mCAAA,wBAAyB;YAC5B,GAAG,CAAA,uBAAA,sBAAA,gCAAA,UAAW,SAAS,cAApB,kCAAA,uBAAwB;YAC3B,OAAO,CAAA,yBAAA,sBAAA,gCAAA,UAAW,WAAW,cAAtB,oCAAA,yBAA0B;YACjC,QAAQ,CAAA,0BAAA,sBAAA,gCAAA,UAAW,YAAY,cAAvB,qCAAA,0BAA2B;QACrC;IACF;IAzCA,YAAY,GAAkC,CAAE;QAC9C,IAAI,CAAC,GAAG,GAAG;IACb;AAwCF","sources":["packages/@react-aria/selection/src/DOMLayoutDelegate.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {getItemElement} from './utils';\nimport {Key, LayoutDelegate, Rect, RefObject, Size} from '@react-types/shared';\n\nexport class DOMLayoutDelegate implements LayoutDelegate {\n private ref: RefObject<HTMLElement | null>;\n\n constructor(ref: RefObject<HTMLElement | null>) {\n this.ref = ref;\n }\n\n getItemRect(key: Key): Rect | null {\n let container = this.ref.current;\n if (!container) {\n return null;\n }\n let item = key != null ? getItemElement(this.ref, key) : null;\n if (!item) {\n return null;\n }\n\n let containerRect = container.getBoundingClientRect();\n let itemRect = item.getBoundingClientRect();\n\n return {\n x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,\n y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,\n width: itemRect.width,\n height: itemRect.height\n };\n }\n\n getContentSize(): Size {\n let container = this.ref.current;\n return {\n width: container?.scrollWidth ?? 0,\n height: container?.scrollHeight ?? 0\n };\n }\n\n getVisibleRect(): Rect {\n let container = this.ref.current;\n return {\n x: container?.scrollLeft ?? 0,\n y: container?.scrollTop ?? 0,\n width: container?.clientWidth ?? 0,\n height: container?.clientHeight ?? 0\n };\n }\n}\n"],"names":[],"version":3,"file":"DOMLayoutDelegate.main.js.map"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {getItemElement as $feb5ffebff200149$export$c3d8340acf92597f} from "./utils.mjs";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
15
|
-
getItemRect(key) {
|
|
16
|
-
let container = this.ref.current;
|
|
17
|
-
if (!container) return null;
|
|
18
|
-
let item = key != null ? (0, $feb5ffebff200149$export$c3d8340acf92597f)(this.ref, key) : null;
|
|
19
|
-
if (!item) return null;
|
|
20
|
-
let containerRect = container.getBoundingClientRect();
|
|
21
|
-
let itemRect = item.getBoundingClientRect();
|
|
22
|
-
return {
|
|
23
|
-
x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
|
|
24
|
-
y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
|
|
25
|
-
width: itemRect.width,
|
|
26
|
-
height: itemRect.height
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
getContentSize() {
|
|
30
|
-
let container = this.ref.current;
|
|
31
|
-
var _container_scrollWidth, _container_scrollHeight;
|
|
32
|
-
return {
|
|
33
|
-
width: (_container_scrollWidth = container === null || container === void 0 ? void 0 : container.scrollWidth) !== null && _container_scrollWidth !== void 0 ? _container_scrollWidth : 0,
|
|
34
|
-
height: (_container_scrollHeight = container === null || container === void 0 ? void 0 : container.scrollHeight) !== null && _container_scrollHeight !== void 0 ? _container_scrollHeight : 0
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
getVisibleRect() {
|
|
38
|
-
let container = this.ref.current;
|
|
39
|
-
var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
|
|
40
|
-
return {
|
|
41
|
-
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
42
|
-
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
43
|
-
width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
|
|
44
|
-
height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
constructor(ref){
|
|
48
|
-
this.ref = ref;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export {$657e4dc4a6e88df0$export$8f5ed9ff9f511381 as DOMLayoutDelegate};
|
|
54
|
-
//# sourceMappingURL=DOMLayoutDelegate.module.js.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {getItemElement as $feb5ffebff200149$export$c3d8340acf92597f} from "./utils.module.js";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2024 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
|
|
15
|
-
getItemRect(key) {
|
|
16
|
-
let container = this.ref.current;
|
|
17
|
-
if (!container) return null;
|
|
18
|
-
let item = key != null ? (0, $feb5ffebff200149$export$c3d8340acf92597f)(this.ref, key) : null;
|
|
19
|
-
if (!item) return null;
|
|
20
|
-
let containerRect = container.getBoundingClientRect();
|
|
21
|
-
let itemRect = item.getBoundingClientRect();
|
|
22
|
-
return {
|
|
23
|
-
x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
|
|
24
|
-
y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
|
|
25
|
-
width: itemRect.width,
|
|
26
|
-
height: itemRect.height
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
getContentSize() {
|
|
30
|
-
let container = this.ref.current;
|
|
31
|
-
var _container_scrollWidth, _container_scrollHeight;
|
|
32
|
-
return {
|
|
33
|
-
width: (_container_scrollWidth = container === null || container === void 0 ? void 0 : container.scrollWidth) !== null && _container_scrollWidth !== void 0 ? _container_scrollWidth : 0,
|
|
34
|
-
height: (_container_scrollHeight = container === null || container === void 0 ? void 0 : container.scrollHeight) !== null && _container_scrollHeight !== void 0 ? _container_scrollHeight : 0
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
getVisibleRect() {
|
|
38
|
-
let container = this.ref.current;
|
|
39
|
-
var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
|
|
40
|
-
return {
|
|
41
|
-
x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
|
|
42
|
-
y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
|
|
43
|
-
width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
|
|
44
|
-
height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
constructor(ref){
|
|
48
|
-
this.ref = ref;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export {$657e4dc4a6e88df0$export$8f5ed9ff9f511381 as DOMLayoutDelegate};
|
|
54
|
-
//# sourceMappingURL=DOMLayoutDelegate.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKM,MAAM;IAOX,YAAY,GAAQ,EAAe;QACjC,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;QAChC,IAAI,CAAC,WACH,OAAO;QAET,IAAI,OAAO,OAAO,OAAO,CAAA,GAAA,yCAAa,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO;QACzD,IAAI,CAAC,MACH,OAAO;QAGT,IAAI,gBAAgB,UAAU,qBAAqB;QACnD,IAAI,WAAW,KAAK,qBAAqB;QAEzC,OAAO;YACL,GAAG,SAAS,IAAI,GAAG,cAAc,IAAI,GAAG,UAAU,UAAU,GAAG,UAAU,UAAU;YACnF,GAAG,SAAS,GAAG,GAAG,cAAc,GAAG,GAAG,UAAU,SAAS,GAAG,UAAU,SAAS;YAC/E,OAAO,SAAS,KAAK;YACrB,QAAQ,SAAS,MAAM;QACzB;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;YAEvB,wBACC;QAFV,OAAO;YACL,OAAO,CAAA,yBAAA,sBAAA,gCAAA,UAAW,WAAW,cAAtB,oCAAA,yBAA0B;YACjC,QAAQ,CAAA,0BAAA,sBAAA,gCAAA,UAAW,YAAY,cAAvB,qCAAA,0BAA2B;QACrC;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;YAE3B,uBACA,sBACI,wBACC;QAJV,OAAO;YACL,GAAG,CAAA,wBAAA,sBAAA,gCAAA,UAAW,UAAU,cAArB,mCAAA,wBAAyB;YAC5B,GAAG,CAAA,uBAAA,sBAAA,gCAAA,UAAW,SAAS,cAApB,kCAAA,uBAAwB;YAC3B,OAAO,CAAA,yBAAA,sBAAA,gCAAA,UAAW,WAAW,cAAtB,oCAAA,yBAA0B;YACjC,QAAQ,CAAA,0BAAA,sBAAA,gCAAA,UAAW,YAAY,cAAvB,qCAAA,0BAA2B;QACrC;IACF;IAzCA,YAAY,GAAkC,CAAE;QAC9C,IAAI,CAAC,GAAG,GAAG;IACb;AAwCF","sources":["packages/@react-aria/selection/src/DOMLayoutDelegate.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {getItemElement} from './utils';\nimport {Key, LayoutDelegate, Rect, RefObject, Size} from '@react-types/shared';\n\nexport class DOMLayoutDelegate implements LayoutDelegate {\n private ref: RefObject<HTMLElement | null>;\n\n constructor(ref: RefObject<HTMLElement | null>) {\n this.ref = ref;\n }\n\n getItemRect(key: Key): Rect | null {\n let container = this.ref.current;\n if (!container) {\n return null;\n }\n let item = key != null ? getItemElement(this.ref, key) : null;\n if (!item) {\n return null;\n }\n\n let containerRect = container.getBoundingClientRect();\n let itemRect = item.getBoundingClientRect();\n\n return {\n x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,\n y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,\n width: itemRect.width,\n height: itemRect.height\n };\n }\n\n getContentSize(): Size {\n let container = this.ref.current;\n return {\n width: container?.scrollWidth ?? 0,\n height: container?.scrollHeight ?? 0\n };\n }\n\n getVisibleRect(): Rect {\n let container = this.ref.current;\n return {\n x: container?.scrollLeft ?? 0,\n y: container?.scrollTop ?? 0,\n width: container?.clientWidth ?? 0,\n height: container?.clientHeight ?? 0\n };\n }\n}\n"],"names":[],"version":3,"file":"DOMLayoutDelegate.module.js.map"}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
var $2ac4508142683dcb$exports = require("./DOMLayoutDelegate.main.js");
|
|
2
|
-
var $doKEG$reactariautils = require("@react-aria/utils");
|
|
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, "ListKeyboardDelegate", () => $836f880b12dcae5c$export$a05409b8bb224a5a);
|
|
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 $836f880b12dcae5c$export$a05409b8bb224a5a {
|
|
23
|
-
isDisabled(item) {
|
|
24
|
-
var _item_props;
|
|
25
|
-
return this.disabledBehavior === 'all' && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
|
|
26
|
-
}
|
|
27
|
-
findNextNonDisabled(key, getNext) {
|
|
28
|
-
let nextKey = key;
|
|
29
|
-
while(nextKey != null){
|
|
30
|
-
let item = this.collection.getItem(nextKey);
|
|
31
|
-
if ((item === null || item === void 0 ? void 0 : item.type) === 'item' && !this.isDisabled(item)) return nextKey;
|
|
32
|
-
nextKey = getNext(nextKey);
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
getNextKey(key) {
|
|
37
|
-
let nextKey = key;
|
|
38
|
-
nextKey = this.collection.getKeyAfter(nextKey);
|
|
39
|
-
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyAfter(key));
|
|
40
|
-
}
|
|
41
|
-
getPreviousKey(key) {
|
|
42
|
-
let nextKey = key;
|
|
43
|
-
nextKey = this.collection.getKeyBefore(nextKey);
|
|
44
|
-
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyBefore(key));
|
|
45
|
-
}
|
|
46
|
-
findKey(key, nextKey, shouldSkip) {
|
|
47
|
-
let tempKey = key;
|
|
48
|
-
let itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
49
|
-
if (!itemRect || tempKey == null) return null;
|
|
50
|
-
// Find the item above or below in the same column.
|
|
51
|
-
let prevRect = itemRect;
|
|
52
|
-
do {
|
|
53
|
-
tempKey = nextKey(tempKey);
|
|
54
|
-
if (tempKey == null) break;
|
|
55
|
-
itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
56
|
-
}while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
|
|
57
|
-
return tempKey;
|
|
58
|
-
}
|
|
59
|
-
isSameRow(prevRect, itemRect) {
|
|
60
|
-
return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
|
|
61
|
-
}
|
|
62
|
-
isSameColumn(prevRect, itemRect) {
|
|
63
|
-
return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
|
|
64
|
-
}
|
|
65
|
-
getKeyBelow(key) {
|
|
66
|
-
if (this.layout === 'grid' && this.orientation === 'vertical') return this.findKey(key, (key)=>this.getNextKey(key), this.isSameRow);
|
|
67
|
-
else return this.getNextKey(key);
|
|
68
|
-
}
|
|
69
|
-
getKeyAbove(key) {
|
|
70
|
-
if (this.layout === 'grid' && this.orientation === 'vertical') return this.findKey(key, (key)=>this.getPreviousKey(key), this.isSameRow);
|
|
71
|
-
else return this.getPreviousKey(key);
|
|
72
|
-
}
|
|
73
|
-
getNextColumn(key, right) {
|
|
74
|
-
return right ? this.getPreviousKey(key) : this.getNextKey(key);
|
|
75
|
-
}
|
|
76
|
-
getKeyRightOf(key) {
|
|
77
|
-
// This is a temporary solution for CardView until we refactor useSelectableCollection.
|
|
78
|
-
// https://github.com/orgs/adobe/projects/19/views/32?pane=issue&itemId=77825042
|
|
79
|
-
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyRightOf' : 'getKeyLeftOf';
|
|
80
|
-
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
81
|
-
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
82
|
-
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
83
|
-
}
|
|
84
|
-
if (this.layout === 'grid') {
|
|
85
|
-
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'rtl');
|
|
86
|
-
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'rtl'), this.isSameColumn);
|
|
87
|
-
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'rtl');
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
getKeyLeftOf(key) {
|
|
91
|
-
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyLeftOf' : 'getKeyRightOf';
|
|
92
|
-
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
93
|
-
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
94
|
-
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
95
|
-
}
|
|
96
|
-
if (this.layout === 'grid') {
|
|
97
|
-
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'ltr');
|
|
98
|
-
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'ltr'), this.isSameColumn);
|
|
99
|
-
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'ltr');
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
getFirstKey() {
|
|
103
|
-
let key = this.collection.getFirstKey();
|
|
104
|
-
return this.findNextNonDisabled(key, (key)=>this.collection.getKeyAfter(key));
|
|
105
|
-
}
|
|
106
|
-
getLastKey() {
|
|
107
|
-
let key = this.collection.getLastKey();
|
|
108
|
-
return this.findNextNonDisabled(key, (key)=>this.collection.getKeyBefore(key));
|
|
109
|
-
}
|
|
110
|
-
getKeyPageAbove(key) {
|
|
111
|
-
let menu = this.ref.current;
|
|
112
|
-
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
113
|
-
if (!itemRect) return null;
|
|
114
|
-
if (menu && !(0, $doKEG$reactariautils.isScrollable)(menu)) return this.getFirstKey();
|
|
115
|
-
let nextKey = key;
|
|
116
|
-
if (this.orientation === 'horizontal') {
|
|
117
|
-
let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
|
|
118
|
-
while(itemRect && itemRect.x > pageX && nextKey != null){
|
|
119
|
-
nextKey = this.getKeyAbove(nextKey);
|
|
120
|
-
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
let pageY = Math.max(0, itemRect.y + itemRect.height - this.layoutDelegate.getVisibleRect().height);
|
|
124
|
-
while(itemRect && itemRect.y > pageY && nextKey != null){
|
|
125
|
-
nextKey = this.getKeyAbove(nextKey);
|
|
126
|
-
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getFirstKey();
|
|
130
|
-
}
|
|
131
|
-
getKeyPageBelow(key) {
|
|
132
|
-
let menu = this.ref.current;
|
|
133
|
-
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
134
|
-
if (!itemRect) return null;
|
|
135
|
-
if (menu && !(0, $doKEG$reactariautils.isScrollable)(menu)) return this.getLastKey();
|
|
136
|
-
let nextKey = key;
|
|
137
|
-
if (this.orientation === 'horizontal') {
|
|
138
|
-
let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.y - itemRect.width + this.layoutDelegate.getVisibleRect().width);
|
|
139
|
-
while(itemRect && itemRect.x < pageX && nextKey != null){
|
|
140
|
-
nextKey = this.getKeyBelow(nextKey);
|
|
141
|
-
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
|
|
145
|
-
while(itemRect && itemRect.y < pageY && nextKey != null){
|
|
146
|
-
nextKey = this.getKeyBelow(nextKey);
|
|
147
|
-
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return nextKey !== null && nextKey !== void 0 ? nextKey : this.getLastKey();
|
|
151
|
-
}
|
|
152
|
-
getKeyForSearch(search, fromKey) {
|
|
153
|
-
if (!this.collator) return null;
|
|
154
|
-
let collection = this.collection;
|
|
155
|
-
let key = fromKey || this.getFirstKey();
|
|
156
|
-
while(key != null){
|
|
157
|
-
let item = collection.getItem(key);
|
|
158
|
-
if (!item) return null;
|
|
159
|
-
let substring = item.textValue.slice(0, search.length);
|
|
160
|
-
if (item.textValue && this.collator.compare(substring, search) === 0) return key;
|
|
161
|
-
key = this.getNextKey(key);
|
|
162
|
-
}
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
constructor(...args){
|
|
166
|
-
if (args.length === 1) {
|
|
167
|
-
let opts = args[0];
|
|
168
|
-
this.collection = opts.collection;
|
|
169
|
-
this.ref = opts.ref;
|
|
170
|
-
this.collator = opts.collator;
|
|
171
|
-
this.disabledKeys = opts.disabledKeys || new Set();
|
|
172
|
-
this.disabledBehavior = opts.disabledBehavior || 'all';
|
|
173
|
-
this.orientation = opts.orientation || 'vertical';
|
|
174
|
-
this.direction = opts.direction;
|
|
175
|
-
this.layout = opts.layout || 'stack';
|
|
176
|
-
this.layoutDelegate = opts.layoutDelegate || new (0, $2ac4508142683dcb$exports.DOMLayoutDelegate)(opts.ref);
|
|
177
|
-
} else {
|
|
178
|
-
this.collection = args[0];
|
|
179
|
-
this.disabledKeys = args[1];
|
|
180
|
-
this.ref = args[2];
|
|
181
|
-
this.collator = args[3];
|
|
182
|
-
this.layout = 'stack';
|
|
183
|
-
this.orientation = 'vertical';
|
|
184
|
-
this.disabledBehavior = 'all';
|
|
185
|
-
this.layoutDelegate = new (0, $2ac4508142683dcb$exports.DOMLayoutDelegate)(this.ref);
|
|
186
|
-
}
|
|
187
|
-
// If this is a vertical stack, remove the left/right methods completely
|
|
188
|
-
// so they aren't called by useDroppableCollection.
|
|
189
|
-
if (this.layout === 'stack' && this.orientation === 'vertical') {
|
|
190
|
-
this.getKeyLeftOf = undefined;
|
|
191
|
-
this.getKeyRightOf = undefined;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
//# sourceMappingURL=ListKeyboardDelegate.main.js.map
|