@react-aria/table 3.0.0-beta.1 → 3.0.0-nightly-641446f65-240905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TableKeyboardDelegate.main.js +132 -0
- package/dist/TableKeyboardDelegate.main.js.map +1 -0
- package/dist/TableKeyboardDelegate.mjs +127 -0
- package/dist/TableKeyboardDelegate.module.js +127 -0
- package/dist/TableKeyboardDelegate.module.js.map +1 -0
- package/dist/ar-AE.main.js +14 -0
- package/dist/ar-AE.main.js.map +1 -0
- package/dist/ar-AE.mjs +16 -0
- package/dist/ar-AE.module.js +16 -0
- package/dist/ar-AE.module.js.map +1 -0
- package/dist/bg-BG.main.js +14 -0
- package/dist/bg-BG.main.js.map +1 -0
- package/dist/bg-BG.mjs +16 -0
- package/dist/bg-BG.module.js +16 -0
- package/dist/bg-BG.module.js.map +1 -0
- package/dist/cs-CZ.main.js +14 -0
- package/dist/cs-CZ.main.js.map +1 -0
- package/dist/cs-CZ.mjs +16 -0
- package/dist/cs-CZ.module.js +16 -0
- package/dist/cs-CZ.module.js.map +1 -0
- package/dist/da-DK.main.js +14 -0
- package/dist/da-DK.main.js.map +1 -0
- package/dist/da-DK.mjs +16 -0
- package/dist/da-DK.module.js +16 -0
- package/dist/da-DK.module.js.map +1 -0
- package/dist/de-DE.main.js +14 -0
- package/dist/de-DE.main.js.map +1 -0
- package/dist/de-DE.mjs +16 -0
- package/dist/de-DE.module.js +16 -0
- package/dist/de-DE.module.js.map +1 -0
- package/dist/el-GR.main.js +14 -0
- package/dist/el-GR.main.js.map +1 -0
- package/dist/el-GR.mjs +16 -0
- package/dist/el-GR.module.js +16 -0
- package/dist/el-GR.module.js.map +1 -0
- package/dist/en-US.main.js +14 -0
- package/dist/en-US.main.js.map +1 -0
- package/dist/en-US.mjs +16 -0
- package/dist/en-US.module.js +16 -0
- package/dist/en-US.module.js.map +1 -0
- package/dist/es-ES.main.js +14 -0
- package/dist/es-ES.main.js.map +1 -0
- package/dist/es-ES.mjs +16 -0
- package/dist/es-ES.module.js +16 -0
- package/dist/es-ES.module.js.map +1 -0
- package/dist/et-EE.main.js +14 -0
- package/dist/et-EE.main.js.map +1 -0
- package/dist/et-EE.mjs +16 -0
- package/dist/et-EE.module.js +16 -0
- package/dist/et-EE.module.js.map +1 -0
- package/dist/fi-FI.main.js +14 -0
- package/dist/fi-FI.main.js.map +1 -0
- package/dist/fi-FI.mjs +16 -0
- package/dist/fi-FI.module.js +16 -0
- package/dist/fi-FI.module.js.map +1 -0
- package/dist/fr-FR.main.js +14 -0
- package/dist/fr-FR.main.js.map +1 -0
- package/dist/fr-FR.mjs +16 -0
- package/dist/fr-FR.module.js +16 -0
- package/dist/fr-FR.module.js.map +1 -0
- package/dist/he-IL.main.js +14 -0
- package/dist/he-IL.main.js.map +1 -0
- package/dist/he-IL.mjs +16 -0
- package/dist/he-IL.module.js +16 -0
- package/dist/he-IL.module.js.map +1 -0
- package/dist/hr-HR.main.js +14 -0
- package/dist/hr-HR.main.js.map +1 -0
- package/dist/hr-HR.mjs +16 -0
- package/dist/hr-HR.module.js +16 -0
- package/dist/hr-HR.module.js.map +1 -0
- package/dist/hu-HU.main.js +14 -0
- package/dist/hu-HU.main.js.map +1 -0
- package/dist/hu-HU.mjs +16 -0
- package/dist/hu-HU.module.js +16 -0
- package/dist/hu-HU.module.js.map +1 -0
- package/dist/import.mjs +34 -0
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.main.js +14 -0
- package/dist/it-IT.main.js.map +1 -0
- package/dist/it-IT.mjs +16 -0
- package/dist/it-IT.module.js +16 -0
- package/dist/it-IT.module.js.map +1 -0
- package/dist/ja-JP.main.js +14 -0
- package/dist/ja-JP.main.js.map +1 -0
- package/dist/ja-JP.mjs +16 -0
- package/dist/ja-JP.module.js +16 -0
- package/dist/ja-JP.module.js.map +1 -0
- package/dist/ko-KR.main.js +14 -0
- package/dist/ko-KR.main.js.map +1 -0
- package/dist/ko-KR.mjs +16 -0
- package/dist/ko-KR.module.js +16 -0
- package/dist/ko-KR.module.js.map +1 -0
- package/dist/lt-LT.main.js +14 -0
- package/dist/lt-LT.main.js.map +1 -0
- package/dist/lt-LT.mjs +16 -0
- package/dist/lt-LT.module.js +16 -0
- package/dist/lt-LT.module.js.map +1 -0
- package/dist/lv-LV.main.js +14 -0
- package/dist/lv-LV.main.js.map +1 -0
- package/dist/lv-LV.mjs +16 -0
- package/dist/lv-LV.module.js +16 -0
- package/dist/lv-LV.module.js.map +1 -0
- package/dist/main.js +26 -499
- package/dist/main.js.map +1 -1
- package/dist/module.js +12 -454
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.main.js +14 -0
- package/dist/nb-NO.main.js.map +1 -0
- package/dist/nb-NO.mjs +16 -0
- package/dist/nb-NO.module.js +16 -0
- package/dist/nb-NO.module.js.map +1 -0
- package/dist/nl-NL.main.js +14 -0
- package/dist/nl-NL.main.js.map +1 -0
- package/dist/nl-NL.mjs +16 -0
- package/dist/nl-NL.module.js +16 -0
- package/dist/nl-NL.module.js.map +1 -0
- package/dist/pl-PL.main.js +14 -0
- package/dist/pl-PL.main.js.map +1 -0
- package/dist/pl-PL.mjs +16 -0
- package/dist/pl-PL.module.js +16 -0
- package/dist/pl-PL.module.js.map +1 -0
- package/dist/pt-BR.main.js +14 -0
- package/dist/pt-BR.main.js.map +1 -0
- package/dist/pt-BR.mjs +16 -0
- package/dist/pt-BR.module.js +16 -0
- package/dist/pt-BR.module.js.map +1 -0
- package/dist/pt-PT.main.js +14 -0
- package/dist/pt-PT.main.js.map +1 -0
- package/dist/pt-PT.mjs +16 -0
- package/dist/pt-PT.module.js +16 -0
- package/dist/pt-PT.module.js.map +1 -0
- package/dist/ro-RO.main.js +14 -0
- package/dist/ro-RO.main.js.map +1 -0
- package/dist/ro-RO.mjs +16 -0
- package/dist/ro-RO.module.js +16 -0
- package/dist/ro-RO.module.js.map +1 -0
- package/dist/ru-RU.main.js +14 -0
- package/dist/ru-RU.main.js.map +1 -0
- package/dist/ru-RU.mjs +16 -0
- package/dist/ru-RU.module.js +16 -0
- package/dist/ru-RU.module.js.map +1 -0
- package/dist/sk-SK.main.js +14 -0
- package/dist/sk-SK.main.js.map +1 -0
- package/dist/sk-SK.mjs +16 -0
- package/dist/sk-SK.module.js +16 -0
- package/dist/sk-SK.module.js.map +1 -0
- package/dist/sl-SI.main.js +14 -0
- package/dist/sl-SI.main.js.map +1 -0
- package/dist/sl-SI.mjs +16 -0
- package/dist/sl-SI.module.js +16 -0
- package/dist/sl-SI.module.js.map +1 -0
- package/dist/sr-SP.main.js +14 -0
- package/dist/sr-SP.main.js.map +1 -0
- package/dist/sr-SP.mjs +16 -0
- package/dist/sr-SP.module.js +16 -0
- package/dist/sr-SP.module.js.map +1 -0
- package/dist/sv-SE.main.js +14 -0
- package/dist/sv-SE.main.js.map +1 -0
- package/dist/sv-SE.mjs +16 -0
- package/dist/sv-SE.module.js +16 -0
- package/dist/sv-SE.module.js.map +1 -0
- package/dist/tr-TR.main.js +14 -0
- package/dist/tr-TR.main.js.map +1 -0
- package/dist/tr-TR.mjs +16 -0
- package/dist/tr-TR.module.js +16 -0
- package/dist/tr-TR.module.js.map +1 -0
- package/dist/types.d.ts +87 -25
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.main.js +14 -0
- package/dist/uk-UA.main.js.map +1 -0
- package/dist/uk-UA.mjs +16 -0
- package/dist/uk-UA.module.js +16 -0
- package/dist/uk-UA.module.js.map +1 -0
- package/dist/useTable.main.js +113 -0
- package/dist/useTable.main.js.map +1 -0
- package/dist/useTable.mjs +108 -0
- package/dist/useTable.module.js +108 -0
- package/dist/useTable.module.js.map +1 -0
- package/dist/useTableCell.main.js +36 -0
- package/dist/useTableCell.main.js.map +1 -0
- package/dist/useTableCell.mjs +31 -0
- package/dist/useTableCell.module.js +31 -0
- package/dist/useTableCell.module.js.map +1 -0
- package/dist/useTableColumnHeader.main.js +93 -0
- package/dist/useTableColumnHeader.main.js.map +1 -0
- package/dist/useTableColumnHeader.mjs +88 -0
- package/dist/useTableColumnHeader.module.js +88 -0
- package/dist/useTableColumnHeader.module.js.map +1 -0
- package/dist/useTableColumnResize.main.js +216 -0
- package/dist/useTableColumnResize.main.js.map +1 -0
- package/dist/useTableColumnResize.mjs +211 -0
- package/dist/useTableColumnResize.module.js +211 -0
- package/dist/useTableColumnResize.module.js.map +1 -0
- package/dist/useTableHeaderRow.main.js +32 -0
- package/dist/useTableHeaderRow.main.js.map +1 -0
- package/dist/useTableHeaderRow.mjs +27 -0
- package/dist/useTableHeaderRow.module.js +27 -0
- package/dist/useTableHeaderRow.module.js.map +1 -0
- package/dist/useTableRow.main.js +81 -0
- package/dist/useTableRow.main.js.map +1 -0
- package/dist/useTableRow.mjs +76 -0
- package/dist/useTableRow.module.js +76 -0
- package/dist/useTableRow.module.js.map +1 -0
- package/dist/useTableSelectionCheckbox.main.js +56 -0
- package/dist/useTableSelectionCheckbox.main.js.map +1 -0
- package/dist/useTableSelectionCheckbox.mjs +50 -0
- package/dist/useTableSelectionCheckbox.module.js +50 -0
- package/dist/useTableSelectionCheckbox.module.js.map +1 -0
- package/dist/utils.main.js +43 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +35 -0
- package/dist/utils.module.js +35 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/zh-CN.main.js +14 -0
- package/dist/zh-CN.main.js.map +1 -0
- package/dist/zh-CN.mjs +16 -0
- package/dist/zh-CN.module.js +16 -0
- package/dist/zh-CN.module.js.map +1 -0
- package/dist/zh-TW.main.js +14 -0
- package/dist/zh-TW.main.js.map +1 -0
- package/dist/zh-TW.mjs +16 -0
- package/dist/zh-TW.module.js +16 -0
- package/dist/zh-TW.module.js.map +1 -0
- package/package.json +25 -17
- package/src/TableKeyboardDelegate.ts +18 -10
- package/src/index.ts +21 -7
- package/src/useTable.ts +62 -42
- package/src/useTableCell.ts +19 -9
- package/src/useTableColumnHeader.ts +53 -17
- package/src/useTableColumnResize.ts +275 -0
- package/src/useTableHeaderRow.ts +10 -4
- package/src/useTableRow.ts +60 -7
- package/src/useTableSelectionCheckbox.ts +17 -22
- package/src/utils.ts +1 -1
- package/LICENSE +0 -201
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var $6acf696f746f932c$exports = require("./utils.main.js");
|
|
2
|
+
var $7ff3f66df3873a5e$exports = require("./intlStrings.main.js");
|
|
3
|
+
var $jX14I$reactariagrid = require("@react-aria/grid");
|
|
4
|
+
var $jX14I$reactariai18n = require("@react-aria/i18n");
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$parcel$export(module.exports, "useTableSelectionCheckbox", () => $0b394e4562ac57c9$export$16ea7f650bd7c1bb);
|
|
16
|
+
$parcel$export(module.exports, "useTableSelectAllCheckbox", () => $0b394e4562ac57c9$export$1003db6a7e384b99);
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
+
* governing permissions and limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function $0b394e4562ac57c9$export$16ea7f650bd7c1bb(props, state) {
|
|
32
|
+
let { key: key } = props;
|
|
33
|
+
const { checkboxProps: checkboxProps } = (0, $jX14I$reactariagrid.useGridSelectionCheckbox)(props, state);
|
|
34
|
+
return {
|
|
35
|
+
checkboxProps: {
|
|
36
|
+
...checkboxProps,
|
|
37
|
+
'aria-labelledby': `${checkboxProps.id} ${(0, $6acf696f746f932c$exports.getRowLabelledBy)(state, key)}`
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function $0b394e4562ac57c9$export$1003db6a7e384b99(state) {
|
|
42
|
+
let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
|
|
43
|
+
const stringFormatter = (0, $jX14I$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7ff3f66df3873a5e$exports))), '@react-aria/table');
|
|
44
|
+
return {
|
|
45
|
+
checkboxProps: {
|
|
46
|
+
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
47
|
+
isSelected: isSelectAll,
|
|
48
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
49
|
+
isIndeterminate: !isEmpty && !isSelectAll,
|
|
50
|
+
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=useTableSelectionCheckbox.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,6CAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,0CAAe,EAAE,OAAO,KAAK,CAAC;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,cAAc,MAAM,UAAU,CAAC,IAAI,KAAK;YACtE,iBAAiB,CAAC,WAAW,CAAC;YAC9B,UAAU,IAAM,MAAM,gBAAgB,CAAC,eAAe;QACxD;IACF;AACF","sources":["packages/@react-aria/table/src/useTableSelectionCheckbox.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 {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useGridSelectionCheckbox} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface TableSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\nexport interface TableSelectAllCheckboxAria {\n /** Props for the select all checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a table.\n * @param props - Props for the selection checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectionCheckbox<T>(props: AriaTableSelectionCheckboxProps, state: TableState<T>): TableSelectionCheckboxAria {\n let {key} = props;\n const {checkboxProps} = useGridSelectionCheckbox(props, state);\n\n return {\n checkboxProps: {\n ...checkboxProps,\n 'aria-labelledby': `${checkboxProps.id} ${getRowLabelledBy(state, key)}`\n }\n };\n}\n\n/**\n * Provides the behavior and accessibility implementation for the select all checkbox in a table.\n * @param props - Props for the select all checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectAllCheckbox<T>(state: TableState<T>): TableSelectAllCheckboxAria {\n let {isEmpty, isSelectAll, selectionMode} = state.selectionManager;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n\n return {\n checkboxProps: {\n 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),\n isSelected: isSelectAll,\n isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":[],"version":3,"file":"useTableSelectionCheckbox.main.js.map"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.mjs";
|
|
2
|
+
import $iIuaM$intlStringsmodulejs from "./intlStrings.mjs";
|
|
3
|
+
import {useGridSelectionCheckbox as $iIuaM$useGridSelectionCheckbox} from "@react-aria/grid";
|
|
4
|
+
import {useLocalizedStringFormatter as $iIuaM$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
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
|
+
|
|
23
|
+
|
|
24
|
+
function $2a795c53a101c542$export$16ea7f650bd7c1bb(props, state) {
|
|
25
|
+
let { key: key } = props;
|
|
26
|
+
const { checkboxProps: checkboxProps } = (0, $iIuaM$useGridSelectionCheckbox)(props, state);
|
|
27
|
+
return {
|
|
28
|
+
checkboxProps: {
|
|
29
|
+
...checkboxProps,
|
|
30
|
+
'aria-labelledby': `${checkboxProps.id} ${(0, $2140fb2337097f2d$export$85069b70317f543)(state, key)}`
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function $2a795c53a101c542$export$1003db6a7e384b99(state) {
|
|
35
|
+
let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
|
|
36
|
+
const stringFormatter = (0, $iIuaM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iIuaM$intlStringsmodulejs))), '@react-aria/table');
|
|
37
|
+
return {
|
|
38
|
+
checkboxProps: {
|
|
39
|
+
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
40
|
+
isSelected: isSelectAll,
|
|
41
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
42
|
+
isIndeterminate: !isEmpty && !isSelectAll,
|
|
43
|
+
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export {$2a795c53a101c542$export$16ea7f650bd7c1bb as useTableSelectionCheckbox, $2a795c53a101c542$export$1003db6a7e384b99 as useTableSelectAllCheckbox};
|
|
50
|
+
//# sourceMappingURL=useTableSelectionCheckbox.module.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.module.js";
|
|
2
|
+
import $iIuaM$intlStringsmodulejs from "./intlStrings.module.js";
|
|
3
|
+
import {useGridSelectionCheckbox as $iIuaM$useGridSelectionCheckbox} from "@react-aria/grid";
|
|
4
|
+
import {useLocalizedStringFormatter as $iIuaM$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
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
|
+
|
|
23
|
+
|
|
24
|
+
function $2a795c53a101c542$export$16ea7f650bd7c1bb(props, state) {
|
|
25
|
+
let { key: key } = props;
|
|
26
|
+
const { checkboxProps: checkboxProps } = (0, $iIuaM$useGridSelectionCheckbox)(props, state);
|
|
27
|
+
return {
|
|
28
|
+
checkboxProps: {
|
|
29
|
+
...checkboxProps,
|
|
30
|
+
'aria-labelledby': `${checkboxProps.id} ${(0, $2140fb2337097f2d$export$85069b70317f543)(state, key)}`
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function $2a795c53a101c542$export$1003db6a7e384b99(state) {
|
|
35
|
+
let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
|
|
36
|
+
const stringFormatter = (0, $iIuaM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iIuaM$intlStringsmodulejs))), '@react-aria/table');
|
|
37
|
+
return {
|
|
38
|
+
checkboxProps: {
|
|
39
|
+
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
40
|
+
isSelected: isSelectAll,
|
|
41
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
42
|
+
isIndeterminate: !isEmpty && !isSelectAll,
|
|
43
|
+
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export {$2a795c53a101c542$export$16ea7f650bd7c1bb as useTableSelectionCheckbox, $2a795c53a101c542$export$1003db6a7e384b99 as useTableSelectAllCheckbox};
|
|
50
|
+
//# sourceMappingURL=useTableSelectionCheckbox.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,+BAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,wCAAe,EAAE,OAAO,KAAK,CAAC;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,cAAc,MAAM,UAAU,CAAC,IAAI,KAAK;YACtE,iBAAiB,CAAC,WAAW,CAAC;YAC9B,UAAU,IAAM,MAAM,gBAAgB,CAAC,eAAe;QACxD;IACF;AACF","sources":["packages/@react-aria/table/src/useTableSelectionCheckbox.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 {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useGridSelectionCheckbox} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface TableSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\nexport interface TableSelectAllCheckboxAria {\n /** Props for the select all checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a table.\n * @param props - Props for the selection checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectionCheckbox<T>(props: AriaTableSelectionCheckboxProps, state: TableState<T>): TableSelectionCheckboxAria {\n let {key} = props;\n const {checkboxProps} = useGridSelectionCheckbox(props, state);\n\n return {\n checkboxProps: {\n ...checkboxProps,\n 'aria-labelledby': `${checkboxProps.id} ${getRowLabelledBy(state, key)}`\n }\n };\n}\n\n/**\n * Provides the behavior and accessibility implementation for the select all checkbox in a table.\n * @param props - Props for the select all checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectAllCheckbox<T>(state: TableState<T>): TableSelectAllCheckboxAria {\n let {isEmpty, isSelectAll, selectionMode} = state.selectionManager;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n\n return {\n checkboxProps: {\n 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),\n isSelected: isSelectAll,\n isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":[],"version":3,"file":"useTableSelectionCheckbox.module.js.map"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
$parcel$export(module.exports, "gridIds", () => $6acf696f746f932c$export$552312adfd451dab);
|
|
7
|
+
$parcel$export(module.exports, "getColumnHeaderId", () => $6acf696f746f932c$export$37cd4213f2ad742e);
|
|
8
|
+
$parcel$export(module.exports, "getCellId", () => $6acf696f746f932c$export$19baff3266315d44);
|
|
9
|
+
$parcel$export(module.exports, "getRowLabelledBy", () => $6acf696f746f932c$export$85069b70317f543);
|
|
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
|
+
*/ const $6acf696f746f932c$export$552312adfd451dab = new WeakMap();
|
|
21
|
+
function $6acf696f746f932c$var$normalizeKey(key) {
|
|
22
|
+
if (typeof key === 'string') return key.replace(/\s*/g, '');
|
|
23
|
+
return '' + key;
|
|
24
|
+
}
|
|
25
|
+
function $6acf696f746f932c$export$37cd4213f2ad742e(state, columnKey) {
|
|
26
|
+
let gridId = $6acf696f746f932c$export$552312adfd451dab.get(state);
|
|
27
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
28
|
+
return `${gridId}-${$6acf696f746f932c$var$normalizeKey(columnKey)}`;
|
|
29
|
+
}
|
|
30
|
+
function $6acf696f746f932c$export$19baff3266315d44(state, rowKey, columnKey) {
|
|
31
|
+
let gridId = $6acf696f746f932c$export$552312adfd451dab.get(state);
|
|
32
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
33
|
+
return `${gridId}-${$6acf696f746f932c$var$normalizeKey(rowKey)}-${$6acf696f746f932c$var$normalizeKey(columnKey)}`;
|
|
34
|
+
}
|
|
35
|
+
function $6acf696f746f932c$export$85069b70317f543(state, rowKey) {
|
|
36
|
+
// A row is labelled by it's row headers.
|
|
37
|
+
return [
|
|
38
|
+
...state.collection.rowHeaderColumnKeys
|
|
39
|
+
].map((columnKey)=>$6acf696f746f932c$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=utils.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,mCAAa,WAAW,CAAC;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,WAAW,CAAC;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key) {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ const $2140fb2337097f2d$export$552312adfd451dab = new WeakMap();
|
|
12
|
+
function $2140fb2337097f2d$var$normalizeKey(key) {
|
|
13
|
+
if (typeof key === 'string') return key.replace(/\s*/g, '');
|
|
14
|
+
return '' + key;
|
|
15
|
+
}
|
|
16
|
+
function $2140fb2337097f2d$export$37cd4213f2ad742e(state, columnKey) {
|
|
17
|
+
let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
|
|
18
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
19
|
+
return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
|
|
20
|
+
}
|
|
21
|
+
function $2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey) {
|
|
22
|
+
let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
|
|
23
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
24
|
+
return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(rowKey)}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
|
|
25
|
+
}
|
|
26
|
+
function $2140fb2337097f2d$export$85069b70317f543(state, rowKey) {
|
|
27
|
+
// A row is labelled by it's row headers.
|
|
28
|
+
return [
|
|
29
|
+
...state.collection.rowHeaderColumnKeys
|
|
30
|
+
].map((columnKey)=>$2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export {$2140fb2337097f2d$export$552312adfd451dab as gridIds, $2140fb2337097f2d$export$37cd4213f2ad742e as getColumnHeaderId, $2140fb2337097f2d$export$19baff3266315d44 as getCellId, $2140fb2337097f2d$export$85069b70317f543 as getRowLabelledBy};
|
|
35
|
+
//# sourceMappingURL=utils.module.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/ const $2140fb2337097f2d$export$552312adfd451dab = new WeakMap();
|
|
12
|
+
function $2140fb2337097f2d$var$normalizeKey(key) {
|
|
13
|
+
if (typeof key === 'string') return key.replace(/\s*/g, '');
|
|
14
|
+
return '' + key;
|
|
15
|
+
}
|
|
16
|
+
function $2140fb2337097f2d$export$37cd4213f2ad742e(state, columnKey) {
|
|
17
|
+
let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
|
|
18
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
19
|
+
return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
|
|
20
|
+
}
|
|
21
|
+
function $2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey) {
|
|
22
|
+
let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
|
|
23
|
+
if (!gridId) throw new Error('Unknown grid');
|
|
24
|
+
return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(rowKey)}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
|
|
25
|
+
}
|
|
26
|
+
function $2140fb2337097f2d$export$85069b70317f543(state, rowKey) {
|
|
27
|
+
// A row is labelled by it's row headers.
|
|
28
|
+
return [
|
|
29
|
+
...state.collection.rowHeaderColumnKeys
|
|
30
|
+
].map((columnKey)=>$2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export {$2140fb2337097f2d$export$552312adfd451dab as gridIds, $2140fb2337097f2d$export$37cd4213f2ad742e as getColumnHeaderId, $2140fb2337097f2d$export$19baff3266315d44 as getCellId, $2140fb2337097f2d$export$85069b70317f543 as getRowLabelledBy};
|
|
35
|
+
//# sourceMappingURL=utils.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,mCAAa,WAAW,CAAC;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,WAAW,CAAC;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key) {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"ascending": `\u{5347}\u{5E8F}`,
|
|
3
|
+
"ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
4
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
5
|
+
"descending": `\u{964D}\u{5E8F}`,
|
|
6
|
+
"descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
7
|
+
"resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
|
|
8
|
+
"select": `\u{9009}\u{62E9}`,
|
|
9
|
+
"selectAll": `\u{5168}\u{9009}`,
|
|
10
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=zh-CN.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACvD,cAAc,CAAC,OAAS,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACxD,sBAAsB,CAAC,wGAAa,CAAC;IACrC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-CN.json"],"sourcesContent":["{\n \"ascending\": \"升序\",\n \"ascendingSort\": \"按列 {columnName} 升序排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"降序\",\n \"descendingSort\": \"按列 {columnName} 降序排序\",\n \"resizerDescription\": \"按“输入”键开始调整大小。\",\n \"select\": \"选择\",\n \"selectAll\": \"全选\",\n \"sortable\": \"可排序的列\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
|
package/dist/zh-CN.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var $1648ec00941567f3$exports = {};
|
|
2
|
+
$1648ec00941567f3$exports = {
|
|
3
|
+
"ascending": `\u{5347}\u{5E8F}`,
|
|
4
|
+
"ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
5
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
6
|
+
"descending": `\u{964D}\u{5E8F}`,
|
|
7
|
+
"descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
8
|
+
"resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
|
|
9
|
+
"select": `\u{9009}\u{62E9}`,
|
|
10
|
+
"selectAll": `\u{5168}\u{9009}`,
|
|
11
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export {$1648ec00941567f3$exports as default};
|
|
16
|
+
//# sourceMappingURL=zh-CN.module.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var $1648ec00941567f3$exports = {};
|
|
2
|
+
$1648ec00941567f3$exports = {
|
|
3
|
+
"ascending": `\u{5347}\u{5E8F}`,
|
|
4
|
+
"ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
5
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
6
|
+
"descending": `\u{964D}\u{5E8F}`,
|
|
7
|
+
"descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
|
|
8
|
+
"resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
|
|
9
|
+
"select": `\u{9009}\u{62E9}`,
|
|
10
|
+
"selectAll": `\u{5168}\u{9009}`,
|
|
11
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export {$1648ec00941567f3$exports as default};
|
|
16
|
+
//# sourceMappingURL=zh-CN.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACvD,cAAc,CAAC,OAAS,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACxD,sBAAsB,CAAC,wGAAa,CAAC;IACrC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-CN.json"],"sourcesContent":["{\n \"ascending\": \"升序\",\n \"ascendingSort\": \"按列 {columnName} 升序排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"降序\",\n \"descendingSort\": \"按列 {columnName} 降序排序\",\n \"resizerDescription\": \"按“输入”键开始调整大小。\",\n \"select\": \"选择\",\n \"selectAll\": \"全选\",\n \"sortable\": \"可排序的列\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"ascending": `\u{905E}\u{589E}`,
|
|
3
|
+
"ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
|
|
4
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
5
|
+
"descending": `\u{905E}\u{6E1B}`,
|
|
6
|
+
"descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
|
|
7
|
+
"resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
|
|
8
|
+
"select": `\u{9078}\u{53D6}`,
|
|
9
|
+
"selectAll": `\u{5168}\u{9078}`,
|
|
10
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=zh-TW.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IACzD,cAAc,CAAC,OAAS,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IAC1D,sBAAsB,CAAC,+EAAgB,CAAC;IACxC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-TW.json"],"sourcesContent":["{\n \"ascending\": \"遞增\",\n \"ascendingSort\": \"已依據「{columnName}」欄遞增排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"遞減\",\n \"descendingSort\": \"已依據「{columnName}」欄遞減排序\",\n \"resizerDescription\": \"按 Enter 鍵以開始調整大小\",\n \"select\": \"選取\",\n \"selectAll\": \"全選\",\n \"sortable\": \"可排序的欄\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
|
package/dist/zh-TW.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var $b26f22384b3c1526$exports = {};
|
|
2
|
+
$b26f22384b3c1526$exports = {
|
|
3
|
+
"ascending": `\u{905E}\u{589E}`,
|
|
4
|
+
"ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
|
|
5
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
6
|
+
"descending": `\u{905E}\u{6E1B}`,
|
|
7
|
+
"descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
|
|
8
|
+
"resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
|
|
9
|
+
"select": `\u{9078}\u{53D6}`,
|
|
10
|
+
"selectAll": `\u{5168}\u{9078}`,
|
|
11
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export {$b26f22384b3c1526$exports as default};
|
|
16
|
+
//# sourceMappingURL=zh-TW.module.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var $b26f22384b3c1526$exports = {};
|
|
2
|
+
$b26f22384b3c1526$exports = {
|
|
3
|
+
"ascending": `\u{905E}\u{589E}`,
|
|
4
|
+
"ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
|
|
5
|
+
"columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
|
|
6
|
+
"descending": `\u{905E}\u{6E1B}`,
|
|
7
|
+
"descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
|
|
8
|
+
"resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
|
|
9
|
+
"select": `\u{9078}\u{53D6}`,
|
|
10
|
+
"selectAll": `\u{5168}\u{9078}`,
|
|
11
|
+
"sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export {$b26f22384b3c1526$exports as default};
|
|
16
|
+
//# sourceMappingURL=zh-TW.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IACzD,cAAc,CAAC,OAAS,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IAC1D,sBAAsB,CAAC,+EAAgB,CAAC;IACxC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-TW.json"],"sourcesContent":["{\n \"ascending\": \"遞增\",\n \"ascendingSort\": \"已依據「{columnName}」欄遞增排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"遞減\",\n \"descendingSort\": \"已依據「{columnName}」欄遞減排序\",\n \"resizerDescription\": \"按 Enter 鍵以開始調整大小\",\n \"select\": \"選取\",\n \"selectAll\": \"全選\",\n \"sortable\": \"可排序的欄\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/table",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-nightly-641446f65-240905",
|
|
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
|
+
"exports": {
|
|
9
|
+
"types": "./dist/types.d.ts",
|
|
10
|
+
"import": "./dist/import.mjs",
|
|
11
|
+
"require": "./dist/main.js"
|
|
12
|
+
},
|
|
8
13
|
"types": "dist/types.d.ts",
|
|
9
14
|
"source": "src/index.ts",
|
|
10
15
|
"files": [
|
|
@@ -17,25 +22,28 @@
|
|
|
17
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@react-aria/
|
|
22
|
-
"@react-aria/
|
|
23
|
-
"@react-aria/
|
|
24
|
-
"@react-aria/
|
|
25
|
-
"@react-aria/
|
|
26
|
-
"@react-aria/
|
|
27
|
-
"@react-stately/
|
|
28
|
-
"@react-stately/
|
|
29
|
-
"@react-
|
|
30
|
-
"@react-types/
|
|
31
|
-
"@react-types/
|
|
32
|
-
"@react-types/
|
|
25
|
+
"@react-aria/focus": "^3.0.0-nightly-641446f65-240905",
|
|
26
|
+
"@react-aria/grid": "^3.0.0-nightly-641446f65-240905",
|
|
27
|
+
"@react-aria/i18n": "^3.0.0-nightly-641446f65-240905",
|
|
28
|
+
"@react-aria/interactions": "^3.0.0-nightly-641446f65-240905",
|
|
29
|
+
"@react-aria/live-announcer": "^3.0.0-nightly-641446f65-240905",
|
|
30
|
+
"@react-aria/utils": "^3.0.0-nightly-641446f65-240905",
|
|
31
|
+
"@react-aria/visually-hidden": "^3.0.0-nightly-641446f65-240905",
|
|
32
|
+
"@react-stately/collections": "^3.0.0-nightly-641446f65-240905",
|
|
33
|
+
"@react-stately/flags": "^3.0.0-nightly-641446f65-240905",
|
|
34
|
+
"@react-stately/table": "^3.0.0-nightly-641446f65-240905",
|
|
35
|
+
"@react-types/checkbox": "^3.0.0-nightly-641446f65-240905",
|
|
36
|
+
"@react-types/grid": "^3.0.0-nightly-641446f65-240905",
|
|
37
|
+
"@react-types/shared": "^3.0.0-nightly-641446f65-240905",
|
|
38
|
+
"@react-types/table": "^3.0.0-nightly-641446f65-240905",
|
|
39
|
+
"@swc/helpers": "^0.5.0"
|
|
33
40
|
},
|
|
34
41
|
"peerDependencies": {
|
|
35
|
-
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
42
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
43
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
36
44
|
},
|
|
37
45
|
"publishConfig": {
|
|
38
46
|
"access": "public"
|
|
39
47
|
},
|
|
40
|
-
"
|
|
41
|
-
}
|
|
48
|
+
"stableVersion": "3.15.3"
|
|
49
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {getChildNodes, getFirstItem, getNthItem} from '@react-stately/collections';
|
|
13
14
|
import {GridKeyboardDelegate} from '@react-aria/grid';
|
|
14
|
-
import {Key} from 'react';
|
|
15
|
-
import {Node} from '@react-types/shared';
|
|
15
|
+
import {Key, Node} from '@react-types/shared';
|
|
16
16
|
import {TableCollection} from '@react-types/table';
|
|
17
17
|
|
|
18
18
|
export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {
|
|
@@ -30,13 +30,18 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
30
30
|
// If focus was on a column, then focus the first child column if any,
|
|
31
31
|
// or find the corresponding cell in the first row.
|
|
32
32
|
if (startItem.type === 'column') {
|
|
33
|
-
let child =
|
|
33
|
+
let child = getFirstItem(getChildNodes(startItem, this.collection));
|
|
34
34
|
if (child) {
|
|
35
35
|
return child.key;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
let
|
|
39
|
-
|
|
38
|
+
let firstKey = this.getFirstKey();
|
|
39
|
+
if (firstKey == null) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let firstItem = this.collection.getItem(firstKey);
|
|
44
|
+
return getNthItem(getChildNodes(firstItem, this.collection), startItem.index).key;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
return super.getKeyBelow(key);
|
|
@@ -60,7 +65,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
60
65
|
|
|
61
66
|
// only return above row key if not header row
|
|
62
67
|
let superKey = super.getKeyAbove(key);
|
|
63
|
-
if (superKey && this.collection.getItem(superKey).type !== 'headerrow') {
|
|
68
|
+
if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') {
|
|
64
69
|
return superKey;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -83,7 +88,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
83
88
|
|
|
84
89
|
// Wrap around to the first column
|
|
85
90
|
let row = this.collection.headerRows[column.level];
|
|
86
|
-
for (let item of row.
|
|
91
|
+
for (let item of getChildNodes(row, this.collection)) {
|
|
87
92
|
if (item.type === 'column') {
|
|
88
93
|
return item.key;
|
|
89
94
|
}
|
|
@@ -99,7 +104,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
99
104
|
|
|
100
105
|
// Wrap around to the last column
|
|
101
106
|
let row = this.collection.headerRows[column.level];
|
|
102
|
-
let childNodes = [...row.
|
|
107
|
+
let childNodes = [...getChildNodes(row, this.collection)];
|
|
103
108
|
for (let i = childNodes.length - 1; i >= 0; i--) {
|
|
104
109
|
let item = childNodes[i];
|
|
105
110
|
if (item.type === 'column') {
|
|
@@ -147,6 +152,9 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
147
152
|
|
|
148
153
|
let collection = this.collection;
|
|
149
154
|
let key = fromKey ?? this.getFirstKey();
|
|
155
|
+
if (key == null) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
150
158
|
|
|
151
159
|
// If the starting key is a cell, search from its parent row.
|
|
152
160
|
let startItem = collection.getItem(key);
|
|
@@ -159,7 +167,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
159
167
|
let item = collection.getItem(key);
|
|
160
168
|
|
|
161
169
|
// Check each of the row header cells in this row for a match
|
|
162
|
-
for (let cell of item.
|
|
170
|
+
for (let cell of getChildNodes(item, this.collection)) {
|
|
163
171
|
let column = collection.columns[cell.index];
|
|
164
172
|
if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
|
|
165
173
|
let substring = cell.textValue.slice(0, search.length);
|
package/src/index.ts
CHANGED
|
@@ -10,11 +10,25 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
13
|
+
export {useTable} from './useTable';
|
|
14
|
+
export {useTableColumnHeader} from './useTableColumnHeader';
|
|
15
|
+
export {useTableRow} from './useTableRow';
|
|
16
|
+
export {useTableHeaderRow} from './useTableHeaderRow';
|
|
17
|
+
export {useTableCell} from './useTableCell';
|
|
18
|
+
export {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';
|
|
19
|
+
export {useTableColumnResize} from './useTableColumnResize';
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...
|
|
22
|
+
// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';
|
|
23
|
+
import {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';
|
|
24
|
+
export function useTableRowGroup(): GridRowGroupAria {
|
|
25
|
+
return useGridRowGroup();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type {AriaTableProps} from './useTable';
|
|
29
|
+
export type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';
|
|
30
|
+
export type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';
|
|
31
|
+
export type {AriaTableCellProps, TableCellAria} from './useTableCell';
|
|
32
|
+
export type {TableHeaderRowAria} from './useTableHeaderRow';
|
|
33
|
+
export type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';
|
|
34
|
+
export type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';
|