@react-aria/table 3.13.6-nightly.4552 → 3.13.6-nightly.4558
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.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +8 -779
- 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.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +15 -786
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -779
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useTable.main.js +111 -0
- package/dist/useTable.main.js.map +1 -0
- package/dist/useTable.mjs +106 -0
- package/dist/useTable.module.js +106 -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 +80 -0
- package/dist/useTableRow.main.js.map +1 -0
- package/dist/useTableRow.mjs +75 -0
- package/dist/useTableRow.module.js +75 -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.m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AAY,eAAe;QAE7B,OAAO,MAAM;IACf;IAEA,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAC1B,cAAc,CAAC;YACb,IAAI,EAAE,OAAO,IAAI,EAAE,MAAM,IAAI,EAAE,OAAO,IAAI,EAAE,QAAQ,IAAI,EAAE,WAAW,KAAK,YACxE;YAEF,IAAI,EAAE,WAAW,KAAK,aAAa,MAAM,cAAc,IAAI,MAAM;gBAC/D,UAAU;gBACV;YACF;YAEA,0GAA0G;YAC1G,iCAAiC;YACjC;YAEA,gIAAgI;YAChI,kDAAkD;YAClD,IAAI,EAAE,WAAW,KAAK,WACpB,YAAY;QAEhB;QACA,SAAS,CAAC;YACR,IAAI,AAAC,CAAA,AAAC,EAAE,WAAW,KAAK,WAAW,wBAAwB,OAAO,IAAK,EAAE,WAAW,KAAK,OAAM,KAAM,MAAM,cAAc,IAAI,MAC3H,UAAU;QAEd;IACF;IACA,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB;IAE5C,OAAO;QACL,cAAc,CAAA,GAAA,iBAAS,EACrB,eACA;YAAC,GAAG,SAAS;uBAAE;QAAS,GACxB,YACA;YAAC,OAAO;gBAAC,aAAa;YAAM;QAAC;QAE/B,YAAY,CAAA,GAAA,iBAAS,EACnB,qBACA;gBACE;YACA,QAAQ;gBACN,UAAU;YACZ;sBACA;YACA,UAAU;QACZ,GACA;oBAEF;IACF;AACF;;;;AV3PO,SAAS;IACd,OAAO,CAAA,GAAA,sBAAc;AACvB","sources":["packages/@react-aria/table/src/index.ts","packages/@react-aria/table/src/useTable.ts","packages/@react-aria/table/src/utils.ts","packages/@react-aria/table/src/*.js","packages/@react-aria/table/src/TableKeyboardDelegate.ts","packages/@react-aria/table/src/useTableColumnHeader.ts","packages/@react-aria/table/src/useTableRow.ts","packages/@react-aria/table/src/useTableHeaderRow.ts","packages/@react-aria/table/src/useTableCell.ts","packages/@react-aria/table/src/useTableSelectionCheckbox.ts","packages/@react-aria/table/src/useTableColumnResize.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 {useTable} from './useTable';\nexport {useTableColumnHeader} from './useTableColumnHeader';\nexport {useTableRow} from './useTableRow';\nexport {useTableHeaderRow} from './useTableHeaderRow';\nexport {useTableCell} from './useTableCell';\nexport {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';\nexport {useTableColumnResize} from './useTableColumnResize';\n\n// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...\n// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';\nimport {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';\nexport function useTableRowGroup(): GridRowGroupAria {\n return useGridRowGroup();\n}\n\nexport type {AriaTableProps} from './useTable';\nexport type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';\nexport type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';\nexport type {AriaTableCellProps, TableCellAria} from './useTableCell';\nexport type {TableHeaderRowAria} from './useTableHeaderRow';\nexport type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';\nexport type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';\n","/*\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 {announce} from '@react-aria/live-announcer';\nimport {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Layout} from '@react-stately/virtualizer';\nimport {mergeProps, useDescription, useId, useUpdateEffect} from '@react-aria/utils';\nimport {Node} from '@react-types/shared';\nimport {RefObject, useMemo} from 'react';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState, TreeGridState} from '@react-stately/table';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableProps<T> extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layout?: Layout<Node<T>>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,\n * and optionally supports row selection and sorting.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n * @param ref - The ref attached to the table element.\n */\nexport function useTable<T>(props: AriaTableProps<T>, state: TableState<T> | TreeGridState<T>, ref: RefObject<HTMLElement>): GridAria {\n let {\n keyboardDelegate,\n isVirtualized,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n layout\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, layout]);\n let id = useId(props.id);\n gridIds.set(state, id);\n\n let {gridProps} = useGrid({\n ...props,\n id,\n keyboardDelegate: delegate\n }, state, ref);\n\n // Override to include header rows\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;\n }\n\n if (tableNestedRows() && 'expandedKeys' in state) {\n gridProps.role = 'treegrid';\n }\n\n let {column, direction: sortDirection} = state.sortDescriptor || {};\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let sortDescription = useMemo(() => {\n let columnName = state.collection.columns.find(c => c.key === column)?.textValue;\n return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {columnName}) : undefined;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [sortDirection, column, state.collection.columns]);\n\n let descriptionProps = useDescription(sortDescription);\n\n // Only announce after initial render, tabbing to the table will tell you the initial sort info already\n useUpdateEffect(() => {\n announce(sortDescription, 'assertive', 500);\n }, [sortDescription]);\n\n return {\n gridProps: mergeProps(\n gridProps,\n descriptionProps,\n {\n // merge sort description with long press information\n 'aria-describedby': [descriptionProps['aria-describedby'], gridProps['aria-describedby']].filter(Boolean).join(' ')\n }\n )\n };\n}\n","/*\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","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","/*\n * Copyright 2022 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 {getChildNodes, getFirstItem, getNthItem} from '@react-stately/collections';\nimport {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key, Node} from '@react-types/shared';\nimport {TableCollection} from '@react-types/table';\n\nexport class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {\n\n protected isCell(node: Node<T>) {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\n }\n\n getKeyBelow(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a column, then focus the first child column if any,\n // or find the corresponding cell in the first row.\n if (startItem.type === 'column') {\n let child = getFirstItem(getChildNodes(startItem, this.collection));\n if (child) {\n return child.key;\n }\n\n let firstKey = this.getFirstKey();\n if (firstKey == null) {\n return;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n return getNthItem(getChildNodes(firstItem, this.collection), startItem.index).key;\n }\n\n return super.getKeyBelow(key);\n }\n\n getKeyAbove(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = this.collection.getItem(startItem.parentKey);\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') {\n return superKey;\n }\n\n // If no item was found, and focus was on a cell, then focus the\n // corresponding column header.\n if (this.isCell(startItem)) {\n return this.collection.columns[startItem.index].key;\n }\n\n // If focus was on a row, then focus the first column header.\n return this.collection.columns[0].key;\n }\n\n private findNextColumnKey(column: Node<T>) {\n // Search following columns\n let key = this.findNextKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the first column\n let row = this.collection.headerRows[column.level];\n for (let item of getChildNodes(row, this.collection)) {\n if (item.type === 'column') {\n return item.key;\n }\n }\n }\n\n private findPreviousColumnKey(column: Node<T>) {\n // Search previous columns\n let key = this.findPreviousKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the last column\n let row = this.collection.headerRows[column.level];\n let childNodes = [...getChildNodes(row, this.collection)];\n for (let i = childNodes.length - 1; i >= 0; i--) {\n let item = childNodes[i];\n if (item.type === 'column') {\n return item.key;\n }\n }\n }\n\n getKeyRightOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus was on a column, then focus the next column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findPreviousColumnKey(item)\n : this.findNextColumnKey(item);\n }\n\n return super.getKeyRightOf(key);\n }\n\n getKeyLeftOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus was on a column, then focus the previous column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findNextColumnKey(item)\n : this.findPreviousColumnKey(item);\n }\n\n return super.getKeyLeftOf(key);\n }\n\n getKeyForSearch(search: string, fromKey?: Key) {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey ?? this.getFirstKey();\n if (key == null) {\n return null;\n }\n\n // If the starting key is a cell, search from its parent row.\n let startItem = collection.getItem(key);\n if (startItem.type === 'cell') {\n key = startItem.parentKey;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n\n // Check each of the row header cells in this row for a match\n for (let cell of getChildNodes(item, this.collection)) {\n let column = collection.columns[cell.index];\n if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n let substring = cell.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n // If we started on a cell, end on the matching cell. Otherwise, end on the row.\n let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;\n return fromItem.type === 'cell'\n ? cell.key\n : item.key;\n }\n }\n }\n\n key = this.getKeyBelow(key);\n\n // Wrap around when reaching the end of the collection\n if (key == null && !hasWrapped) {\n key = this.getFirstKey();\n hasWrapped = true;\n }\n }\n\n return null;\n }\n}\n","/*\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 {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {getColumnHeaderId} from './utils';\nimport {GridNode} from '@react-types/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid, mergeProps, useDescription} from '@react-aria/utils';\nimport {RefObject, useEffect} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useFocusable} from '@react-aria/focus';\nimport {useGridCell} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaTableColumnHeaderProps<T> {\n /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */\n node: GridNode<T>,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is contained in a virtual scroller. */\n isVirtualized?: boolean\n}\n\nexport interface TableColumnHeaderAria {\n /** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */\n columnHeaderProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a column header in a table.\n * @param props - Props for the column header.\n * @param state - State of the table, as returned by `useTableState`.\n * @param ref - The ref attached to the column header element.\n */\nexport function useTableColumnHeader<T>(props: AriaTableColumnHeaderProps<T>, state: TableState<T>, ref: RefObject<FocusableElement>): TableColumnHeaderAria {\n let {node} = props;\n let allowsSorting = node.props.allowsSorting;\n // if there are no focusable children, the column header will focus the cell\n let {gridCellProps} = useGridCell({...props, focusMode: 'child'}, state, ref);\n\n let isSelectionCellDisabled = node.props.isSelectionCell && state.selectionManager.selectionMode === 'single';\n\n let {pressProps} = usePress({\n isDisabled: !allowsSorting || isSelectionCellDisabled,\n onPress() {\n state.sort(node.key);\n },\n ref\n });\n\n // Needed to pick up the focusable context, enabling things like Tooltips for example\n let {focusableProps} = useFocusable({}, ref);\n\n let ariaSort: DOMAttributes['aria-sort'] = null;\n let isSortedColumn = state.sortDescriptor?.column === node.key;\n let sortDirection = state.sortDescriptor?.direction;\n // aria-sort not supported in Android Talkback\n if (node.props.allowsSorting && !isAndroid()) {\n ariaSort = isSortedColumn ? sortDirection : 'none';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let sortDescription;\n if (allowsSorting) {\n sortDescription = `${stringFormatter.format('sortable')}`;\n // Android Talkback doesn't support aria-sort so we add sort order details to the aria-described by here\n if (isSortedColumn && sortDirection && isAndroid()) {\n sortDescription = `${sortDescription}, ${stringFormatter.format(sortDirection)}`;\n }\n }\n\n let descriptionProps = useDescription(sortDescription);\n\n let shouldDisableFocus = state.collection.size === 0;\n useEffect(() => {\n if (shouldDisableFocus && state.selectionManager.focusedKey === node.key) {\n state.selectionManager.setFocusedKey(null);\n }\n }, [shouldDisableFocus, state.selectionManager, node.key]);\n\n return {\n columnHeaderProps: {\n ...mergeProps(\n gridCellProps,\n pressProps,\n focusableProps,\n descriptionProps,\n // If the table is empty, make all column headers untabbable\n shouldDisableFocus && {tabIndex: -1}\n ),\n role: 'columnheader',\n id: getColumnHeaderId(state, node.key),\n 'aria-colspan': node.colspan && node.colspan > 1 ? node.colspan : null,\n 'aria-sort': ariaSort\n }\n };\n}\n","/*\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 {FocusableElement} from '@react-types/shared';\nimport {getLastItem} from '@react-stately/collections';\nimport {getRowLabelledBy} from './utils';\nimport {getSyntheticLinkProps, mergeProps} from '@react-aria/utils';\nimport type {GridNode} from '@react-types/grid';\nimport {GridRowAria, GridRowProps, useGridRow} from '@react-aria/grid';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {TableCollection} from '@react-types/table';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState, TreeGridState} from '@react-stately/table';\nimport {useLocale} from '@react-aria/i18n';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n 'collapse': {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(props: GridRowProps<T>, state: TableState<T> | TreeGridState<T>, ref: RefObject<FocusableElement>): GridRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, TableCollection<T>, TableState<T>>(props, state, ref);\n let {direction} = useLocale();\n\n if (isVirtualized && !(tableNestedRows() && 'expandedKeys' in state)) {\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n delete rowProps['aria-rowindex'];\n }\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n if (tableNestedRows() && 'expandedKeys' in state) {\n let treeNode = state.keyMap.get(node.key);\n if (treeNode != null) {\n let hasChildRows = treeNode.props?.UNSTABLE_childItems || treeNode.props?.children?.length > state.userColumnCount;\n treeGridRowProps = {\n onKeyDown: (e) => {\n if ((e.key === EXPANSION_KEYS['expand'][direction]) && state.selectionManager.focusedKey === treeNode.key && hasChildRows && state.expandedKeys !== 'all' && !state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if ((e.key === EXPANSION_KEYS['collapse'][direction]) && state.selectionManager.focusedKey === treeNode.key && hasChildRows && (state.expandedKeys === 'all' || state.expandedKeys.has(treeNode.key))) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n },\n 'aria-expanded': hasChildRows ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key) : undefined,\n 'aria-level': treeNode.level,\n 'aria-posinset': treeNode.indexOfType + 1,\n 'aria-setsize': treeNode.level > 1 ?\n (getLastItem(state.keyMap.get(treeNode?.parentKey).childNodes) as GridNode<T>).indexOfType + 1 :\n (getLastItem(state.keyMap.get(state.collection.body.key).childNodes) as GridNode<T>).indexOfType + 1\n };\n }\n }\n\n let linkProps = states.hasAction ? getSyntheticLinkProps(node.props) : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state, node.key)\n },\n ...states\n };\n}\n","/*\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 {DOMAttributes} from '@react-types/shared';\nimport {GridRowProps} from '@react-aria/grid';\nimport {RefObject} from 'react';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState} from '@react-stately/table';\n\nexport interface TableHeaderRowAria {\n /** Props for the grid row element. */\n rowProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a header row in a table.\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useTableHeaderRow<T>(props: GridRowProps<T>, state: TableState<T>, ref: RefObject<Element>): TableHeaderRowAria {\n let {node, isVirtualized} = props;\n let rowProps = {\n role: 'row'\n };\n\n if (isVirtualized && !(tableNestedRows() && 'expandedKeys' in state)) {\n rowProps['aria-rowindex'] = node.index + 1; // aria-rowindex is 1 based\n }\n\n return {\n rowProps\n };\n}\n","/*\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 {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {getCellId} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {RefObject} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useGridCell} from '@react-aria/grid';\n\nexport interface AriaTableCellProps {\n /** An object representing the table cell. Contains all the relevant information that makes up the row header. */\n node: GridNode<unknown>,\n /** Whether the cell is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface TableCellAria {\n /** Props for the table cell element. */\n gridCellProps: DOMAttributes,\n /** Whether the cell is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a cell in a table.\n * @param props - Props for the cell.\n * @param state - State of the table, as returned by `useTableState`.\n * @param ref - The ref attached to the cell element.\n */\nexport function useTableCell<T>(props: AriaTableCellProps, state: TableState<T>, ref: RefObject<FocusableElement>): TableCellAria {\n let {gridCellProps, isPressed} = useGridCell(props, state, ref);\n\n let columnKey = props.node.column.key;\n if (state.collection.rowHeaderColumnKeys.has(columnKey)) {\n gridCellProps.role = 'rowheader';\n gridCellProps.id = getCellId(state, props.node.parentKey, columnKey);\n }\n\n return {\n gridCellProps,\n isPressed\n };\n}\n","/*\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","/*\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 {ChangeEvent, RefObject, useCallback, useEffect, useRef} from 'react';\nimport {ColumnSize} from '@react-types/table';\nimport {DOMAttributes, FocusableElement, Key} from '@react-types/shared';\nimport {focusSafely} from '@react-aria/focus';\nimport {getColumnHeaderId} from './utils';\nimport {GridNode} from '@react-types/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useDescription, useEffectEvent, useId} from '@react-aria/utils';\nimport {TableColumnResizeState} from '@react-stately/table';\nimport {useInteractionModality, useKeyboard, useMove, usePress} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useVisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface TableColumnResizeAria {\n /** Props for the visually hidden input element. */\n inputProps: DOMAttributes,\n /** Props for the resizer element. */\n resizerProps: DOMAttributes,\n /** Whether this column is currently being resized. */\n isResizing: boolean\n}\n\nexport interface AriaTableColumnResizeProps<T> {\n /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */\n column: GridNode<T>,\n /** Aria label for the hidden input. Gets read when resizing. */\n 'aria-label': string,\n /**\n * Ref to the trigger if resizing was started from a column header menu. If it's provided,\n * focus will be returned there when resizing is done. If it isn't provided, it is assumed that the resizer is\n * visible at all time and keyboard resizing is started via pressing Enter on the resizer and not on focus.\n * */\n triggerRef?: RefObject<FocusableElement>,\n /** If resizing is disabled. */\n isDisabled?: boolean,\n /** Called when resizing starts. */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n /** Called for every resize event that results in new column sizes. */\n onResize?: (widths: Map<Key, ColumnSize>) => void,\n /** Called when resizing ends. */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table column resizer element.\n * @param props - Props for the resizer.\n * @param state - State for the table's resizable columns, as returned by `useTableColumnResizeState`.\n * @param ref - The ref attached to the resizer's visually hidden input element.\n */\nexport function useTableColumnResize<T>(props: AriaTableColumnResizeProps<T>, state: TableColumnResizeState<T>, ref: RefObject<HTMLInputElement>): TableColumnResizeAria {\n let {column: item, triggerRef, isDisabled, onResizeStart, onResize, onResizeEnd, 'aria-label': ariaLabel} = props;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let id = useId();\n let isResizing = state.resizingColumn === item.key;\n let isResizingRef = useRef(isResizing);\n let lastSize = useRef(null);\n let wasFocusedOnResizeStart = useRef(false);\n let editModeEnabled = state.tableState.isKeyboardNavigationDisabled;\n\n let {direction} = useLocale();\n let {keyboardProps} = useKeyboard({\n onKeyDown: (e) => {\n if (editModeEnabled) {\n if (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ' || e.key === 'Tab') {\n e.preventDefault();\n endResize(item);\n }\n } else {\n // Continue propagation on keydown events so they still bubbles to useSelectableCollection and are handled there\n e.continuePropagation();\n\n if (e.key === 'Enter') {\n startResize(item);\n }\n }\n }\n });\n\n let startResize = useEffectEvent((item) => {\n if (!isResizingRef.current) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n state.startResize(item.key);\n state.tableState.setKeyboardNavigationDisabled(true);\n onResizeStart?.(lastSize.current);\n }\n isResizingRef.current = true;\n });\n\n let resize = useEffectEvent((item, newWidth) => {\n let sizes = state.updateResizedColumns(item.key, newWidth);\n onResize?.(sizes);\n lastSize.current = sizes;\n });\n\n let endResize = useEffectEvent((item) => {\n if (isResizingRef.current) {\n if (lastSize.current == null) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n }\n\n state.endResize();\n state.tableState.setKeyboardNavigationDisabled(false);\n onResizeEnd?.(lastSize.current);\n isResizingRef.current = false;\n\n if (triggerRef?.current && !wasFocusedOnResizeStart.current) {\n // switch focus back to the column header unless the resizer was already focused when resizing started.\n focusSafely(triggerRef.current);\n }\n }\n lastSize.current = null;\n });\n\n const columnResizeWidthRef = useRef<number>(0);\n const {moveProps} = useMove({\n onMoveStart() {\n columnResizeWidthRef.current = state.getColumnWidth(item.key);\n startResize(item);\n },\n onMove(e) {\n let {deltaX, deltaY, pointerType} = e;\n if (direction === 'rtl') {\n deltaX *= -1;\n }\n if (pointerType === 'keyboard') {\n if (deltaY !== 0 && deltaX === 0) {\n deltaX = deltaY * -1;\n }\n deltaX *= 10;\n }\n // if moving up/down only, no need to resize\n if (deltaX !== 0) {\n columnResizeWidthRef.current += deltaX;\n resize(item, columnResizeWidthRef.current);\n }\n },\n onMoveEnd(e) {\n let {pointerType} = e;\n columnResizeWidthRef.current = 0;\n if (pointerType === 'mouse' || (pointerType === 'touch' && wasFocusedOnResizeStart.current)) {\n endResize(item);\n }\n }\n });\n\n let onKeyDown = useCallback((e) => {\n if (editModeEnabled) {\n moveProps.onKeyDown(e);\n }\n }, [editModeEnabled, moveProps]);\n\n\n let min = Math.floor(state.getColumnMinWidth(item.key));\n let max = Math.floor(state.getColumnMaxWidth(item.key));\n if (max === Infinity) {\n max = Number.MAX_SAFE_INTEGER;\n }\n let value = Math.floor(state.getColumnWidth(item.key));\n let modality: string = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'touch';\n }\n let description = triggerRef?.current == null && (modality === 'keyboard' || modality === 'virtual') && !isResizing ? stringFormatter.format('resizerDescription') : undefined;\n let descriptionProps = useDescription(description);\n let ariaProps = {\n 'aria-label': ariaLabel,\n 'aria-orientation': 'horizontal' as 'horizontal',\n 'aria-labelledby': `${id} ${getColumnHeaderId(state.tableState, item.key)}`,\n 'aria-valuetext': stringFormatter.format('columnSize', {value}),\n 'type': 'range',\n min,\n max,\n value,\n ...descriptionProps\n };\n\n const focusInput = useCallback(() => {\n if (ref.current) {\n focusSafely(ref.current);\n }\n }, [ref]);\n\n let resizingColumn = state.resizingColumn;\n let prevResizingColumn = useRef(null);\n useEffect(() => {\n if (prevResizingColumn.current !== resizingColumn && resizingColumn != null && resizingColumn === item.key) {\n wasFocusedOnResizeStart.current = document.activeElement === ref.current;\n startResize(item);\n // Delay focusing input until Android Chrome's delayed click after touchend happens: https://bugs.chromium.org/p/chromium/issues/detail?id=1150073\n let timeout = setTimeout(() => focusInput(), 0);\n // VoiceOver on iOS has problems focusing the input from a menu.\n let VOTimeout = setTimeout(focusInput, 400);\n return () => {\n clearTimeout(timeout);\n clearTimeout(VOTimeout);\n };\n }\n prevResizingColumn.current = resizingColumn;\n }, [resizingColumn, item, focusInput, ref, startResize]);\n\n let onChange = (e: ChangeEvent<HTMLInputElement>) => {\n let currentWidth = state.getColumnWidth(item.key);\n let nextValue = parseFloat(e.target.value);\n\n if (nextValue > currentWidth) {\n nextValue = currentWidth + 10;\n } else {\n nextValue = currentWidth - 10;\n }\n resize(item, nextValue);\n };\n\n let {pressProps} = usePress({\n onPressStart: (e) => {\n if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') {\n return;\n }\n if (e.pointerType === 'virtual' && state.resizingColumn != null) {\n endResize(item);\n return;\n }\n\n // Sometimes onPress won't trigger for quick taps on mobile so we want to focus the input so blurring away\n // can cancel resize mode for us.\n focusInput();\n\n // If resizer is always visible, mobile screenreader user can access the visually hidden resizer directly and thus we don't need\n // to handle a virtual click to start the resizer.\n if (e.pointerType !== 'virtual') {\n startResize(item);\n }\n },\n onPress: (e) => {\n if (((e.pointerType === 'touch' && wasFocusedOnResizeStart.current) || e.pointerType === 'mouse') && state.resizingColumn != null) {\n endResize(item);\n }\n }\n });\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n return {\n resizerProps: mergeProps(\n keyboardProps,\n {...moveProps, onKeyDown},\n pressProps,\n {style: {touchAction: 'none'}}\n ),\n inputProps: mergeProps(\n visuallyHiddenProps,\n {\n id,\n onBlur: () => {\n endResize(item);\n },\n onChange,\n disabled: isDisabled\n },\n ariaProps\n ),\n isResizing\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaM,SAAS;IACd,OAAO,CAAA,GAAA,sBAAc;AACvB","sources":["packages/@react-aria/table/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 {useTable} from './useTable';\nexport {useTableColumnHeader} from './useTableColumnHeader';\nexport {useTableRow} from './useTableRow';\nexport {useTableHeaderRow} from './useTableHeaderRow';\nexport {useTableCell} from './useTableCell';\nexport {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';\nexport {useTableColumnResize} from './useTableColumnResize';\n\n// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...\n// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';\nimport {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';\nexport function useTableRowGroup(): GridRowGroupAria {\n return useGridRowGroup();\n}\n\nexport type {AriaTableProps} from './useTable';\nexport type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';\nexport type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';\nexport type {AriaTableCellProps, TableCellAria} from './useTableCell';\nexport type {TableHeaderRowAria} from './useTableHeaderRow';\nexport type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';\nexport type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var $6acf696f746f932c$exports = require("./utils.main.js");
|
|
2
|
+
var $7ff3f66df3873a5e$exports = require("./intlStrings.main.js");
|
|
3
|
+
var $a911ff492b884835$exports = require("./TableKeyboardDelegate.main.js");
|
|
4
|
+
var $aZ1Oy$reactarialiveannouncer = require("@react-aria/live-announcer");
|
|
5
|
+
var $aZ1Oy$reactariagrid = require("@react-aria/grid");
|
|
6
|
+
var $aZ1Oy$reactariautils = require("@react-aria/utils");
|
|
7
|
+
var $aZ1Oy$react = require("react");
|
|
8
|
+
var $aZ1Oy$reactstatelyflags = require("@react-stately/flags");
|
|
9
|
+
var $aZ1Oy$reactariai18n = require("@react-aria/i18n");
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function $parcel$export(e, n, v, s) {
|
|
17
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
$parcel$export(module.exports, "useTable", () => $25d14c0f8fad722e$export$25bceaac3c7e4dc7);
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
function $25d14c0f8fad722e$export$25bceaac3c7e4dc7(props, state, ref) {
|
|
41
|
+
let { keyboardDelegate: keyboardDelegate, isVirtualized: isVirtualized, layout: layout } = props;
|
|
42
|
+
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
43
|
+
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
44
|
+
let collator = (0, $aZ1Oy$reactariai18n.useCollator)({
|
|
45
|
+
usage: "search",
|
|
46
|
+
sensitivity: "base"
|
|
47
|
+
});
|
|
48
|
+
let { direction: direction } = (0, $aZ1Oy$reactariai18n.useLocale)();
|
|
49
|
+
let disabledBehavior = state.selectionManager.disabledBehavior;
|
|
50
|
+
let delegate = (0, $aZ1Oy$react.useMemo)(()=>keyboardDelegate || new (0, $a911ff492b884835$exports.TableKeyboardDelegate)({
|
|
51
|
+
collection: state.collection,
|
|
52
|
+
disabledKeys: state.disabledKeys,
|
|
53
|
+
disabledBehavior: disabledBehavior,
|
|
54
|
+
ref: ref,
|
|
55
|
+
direction: direction,
|
|
56
|
+
collator: collator,
|
|
57
|
+
layout: layout
|
|
58
|
+
}), [
|
|
59
|
+
keyboardDelegate,
|
|
60
|
+
state.collection,
|
|
61
|
+
state.disabledKeys,
|
|
62
|
+
disabledBehavior,
|
|
63
|
+
ref,
|
|
64
|
+
direction,
|
|
65
|
+
collator,
|
|
66
|
+
layout
|
|
67
|
+
]);
|
|
68
|
+
let id = (0, $aZ1Oy$reactariautils.useId)(props.id);
|
|
69
|
+
(0, $6acf696f746f932c$exports.gridIds).set(state, id);
|
|
70
|
+
let { gridProps: gridProps } = (0, $aZ1Oy$reactariagrid.useGrid)({
|
|
71
|
+
...props,
|
|
72
|
+
id: id,
|
|
73
|
+
keyboardDelegate: delegate
|
|
74
|
+
}, state, ref);
|
|
75
|
+
// Override to include header rows
|
|
76
|
+
if (isVirtualized) gridProps["aria-rowcount"] = state.collection.size + state.collection.headerRows.length;
|
|
77
|
+
if ((0, $aZ1Oy$reactstatelyflags.tableNestedRows)() && "expandedKeys" in state) gridProps.role = "treegrid";
|
|
78
|
+
let { column: column, direction: sortDirection } = state.sortDescriptor || {};
|
|
79
|
+
let stringFormatter = (0, $aZ1Oy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7ff3f66df3873a5e$exports))), "@react-aria/table");
|
|
80
|
+
let sortDescription = (0, $aZ1Oy$react.useMemo)(()=>{
|
|
81
|
+
var _state_collection_columns_find;
|
|
82
|
+
let columnName = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue;
|
|
83
|
+
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {
|
|
84
|
+
columnName: columnName
|
|
85
|
+
}) : undefined;
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
}, [
|
|
88
|
+
sortDirection,
|
|
89
|
+
column,
|
|
90
|
+
state.collection.columns
|
|
91
|
+
]);
|
|
92
|
+
let descriptionProps = (0, $aZ1Oy$reactariautils.useDescription)(sortDescription);
|
|
93
|
+
// Only announce after initial render, tabbing to the table will tell you the initial sort info already
|
|
94
|
+
(0, $aZ1Oy$reactariautils.useUpdateEffect)(()=>{
|
|
95
|
+
(0, $aZ1Oy$reactarialiveannouncer.announce)(sortDescription, "assertive", 500);
|
|
96
|
+
}, [
|
|
97
|
+
sortDescription
|
|
98
|
+
]);
|
|
99
|
+
return {
|
|
100
|
+
gridProps: (0, $aZ1Oy$reactariautils.mergeProps)(gridProps, descriptionProps, {
|
|
101
|
+
// merge sort description with long press information
|
|
102
|
+
"aria-describedby": [
|
|
103
|
+
descriptionProps["aria-describedby"],
|
|
104
|
+
gridProps["aria-describedby"]
|
|
105
|
+
].filter(Boolean).join(" ")
|
|
106
|
+
})
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=useTable.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6BM,SAAS,0CAAY,KAAwB,EAAE,KAAuC,EAAE,GAA2B;IACxH,IAAI,oBACF,gBAAgB,iBAChB,aAAa,UACb,MAAM,EACP,GAAG;IAEJ,0HAA0H;IAC1H,qFAAqF;IACrF,IAAI,WAAW,CAAA,GAAA,gCAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,CAAC,gBAAgB;IAC9D,IAAI,WA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uG;IACvG,CAAA,GAAA,qCAAc,EAAE;QACd,CAAA,GAAA,sCAAO,EAAE,iBAAiB,aAAa;IACzC,GAAG;QAAC;KAAgB;IAEpB,OAAO;QACL,WAAW,CAAA,GAAA,gCAAS,EAClB,WACA,kBACA;YACE,qDAAqD;YACrD,oBAAoB;gBAAC,gBAAgB,CAAC,mBAAmB;gBAAE,SAAS,CAAC,mBAAmB;aAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QACjH;IAEJ;AACF","sources":["packages/@react-aria/table/src/useTable.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 {announce} from '@react-aria/live-announcer';\nimport {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Layout} from '@react-stately/virtualizer';\nimport {mergeProps, useDescription, useId, useUpdateEffect} from '@react-aria/utils';\nimport {Node} from '@react-types/shared';\nimport {RefObject, useMemo} from 'react';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState, TreeGridState} from '@react-stately/table';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableProps<T> extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layout?: Layout<Node<T>>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,\n * and optionally supports row selection and sorting.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n * @param ref - The ref attached to the table element.\n */\nexport function useTable<T>(props: AriaTableProps<T>, state: TableState<T> | TreeGridState<T>, ref: RefObject<HTMLElement>): GridAria {\n let {\n keyboardDelegate,\n isVirtualized,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n layout\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, layout]);\n let id = useId(props.id);\n gridIds.set(state, id);\n\n let {gridProps} = useGrid({\n ...props,\n id,\n keyboardDelegate: delegate\n }, state, ref);\n\n // Override to include header rows\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;\n }\n\n if (tableNestedRows() && 'expandedKeys' in state) {\n gridProps.role = 'treegrid';\n }\n\n let {column, direction: sortDirection} = state.sortDescriptor || {};\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let sortDescription = useMemo(() => {\n let columnName = state.collection.columns.find(c => c.key === column)?.textValue;\n return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {columnName}) : undefined;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [sortDirection, column, state.collection.columns]);\n\n let descriptionProps = useDescription(sortDescription);\n\n // Only announce after initial render, tabbing to the table will tell you the initial sort info already\n useUpdateEffect(() => {\n announce(sortDescription, 'assertive', 500);\n }, [sortDescription]);\n\n return {\n gridProps: mergeProps(\n gridProps,\n descriptionProps,\n {\n // merge sort description with long press information\n 'aria-describedby': [descriptionProps['aria-describedby'], gridProps['aria-describedby']].filter(Boolean).join(' ')\n }\n )\n };\n}\n"],"names":[],"version":3,"file":"useTable.main.js.map"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {gridIds as $2140fb2337097f2d$export$552312adfd451dab} from "./utils.mjs";
|
|
2
|
+
import $dDeJM$intlStringsmodulejs from "./intlStrings.mjs";
|
|
3
|
+
import {TableKeyboardDelegate as $0ba3c81c7f1caedd$export$da43f8f5cb04028d} from "./TableKeyboardDelegate.mjs";
|
|
4
|
+
import {announce as $dDeJM$announce} from "@react-aria/live-announcer";
|
|
5
|
+
import {useGrid as $dDeJM$useGrid} from "@react-aria/grid";
|
|
6
|
+
import {useId as $dDeJM$useId, useDescription as $dDeJM$useDescription, useUpdateEffect as $dDeJM$useUpdateEffect, mergeProps as $dDeJM$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import {useMemo as $dDeJM$useMemo} from "react";
|
|
8
|
+
import {tableNestedRows as $dDeJM$tableNestedRows} from "@react-stately/flags";
|
|
9
|
+
import {useCollator as $dDeJM$useCollator, useLocale as $dDeJM$useLocale, useLocalizedStringFormatter as $dDeJM$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $6e31608fbba75bab$export$25bceaac3c7e4dc7(props, state, ref) {
|
|
35
|
+
let { keyboardDelegate: keyboardDelegate, isVirtualized: isVirtualized, layout: layout } = props;
|
|
36
|
+
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
37
|
+
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
38
|
+
let collator = (0, $dDeJM$useCollator)({
|
|
39
|
+
usage: "search",
|
|
40
|
+
sensitivity: "base"
|
|
41
|
+
});
|
|
42
|
+
let { direction: direction } = (0, $dDeJM$useLocale)();
|
|
43
|
+
let disabledBehavior = state.selectionManager.disabledBehavior;
|
|
44
|
+
let delegate = (0, $dDeJM$useMemo)(()=>keyboardDelegate || new (0, $0ba3c81c7f1caedd$export$da43f8f5cb04028d)({
|
|
45
|
+
collection: state.collection,
|
|
46
|
+
disabledKeys: state.disabledKeys,
|
|
47
|
+
disabledBehavior: disabledBehavior,
|
|
48
|
+
ref: ref,
|
|
49
|
+
direction: direction,
|
|
50
|
+
collator: collator,
|
|
51
|
+
layout: layout
|
|
52
|
+
}), [
|
|
53
|
+
keyboardDelegate,
|
|
54
|
+
state.collection,
|
|
55
|
+
state.disabledKeys,
|
|
56
|
+
disabledBehavior,
|
|
57
|
+
ref,
|
|
58
|
+
direction,
|
|
59
|
+
collator,
|
|
60
|
+
layout
|
|
61
|
+
]);
|
|
62
|
+
let id = (0, $dDeJM$useId)(props.id);
|
|
63
|
+
(0, $2140fb2337097f2d$export$552312adfd451dab).set(state, id);
|
|
64
|
+
let { gridProps: gridProps } = (0, $dDeJM$useGrid)({
|
|
65
|
+
...props,
|
|
66
|
+
id: id,
|
|
67
|
+
keyboardDelegate: delegate
|
|
68
|
+
}, state, ref);
|
|
69
|
+
// Override to include header rows
|
|
70
|
+
if (isVirtualized) gridProps["aria-rowcount"] = state.collection.size + state.collection.headerRows.length;
|
|
71
|
+
if ((0, $dDeJM$tableNestedRows)() && "expandedKeys" in state) gridProps.role = "treegrid";
|
|
72
|
+
let { column: column, direction: sortDirection } = state.sortDescriptor || {};
|
|
73
|
+
let stringFormatter = (0, $dDeJM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dDeJM$intlStringsmodulejs))), "@react-aria/table");
|
|
74
|
+
let sortDescription = (0, $dDeJM$useMemo)(()=>{
|
|
75
|
+
var _state_collection_columns_find;
|
|
76
|
+
let columnName = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue;
|
|
77
|
+
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {
|
|
78
|
+
columnName: columnName
|
|
79
|
+
}) : undefined;
|
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
+
}, [
|
|
82
|
+
sortDirection,
|
|
83
|
+
column,
|
|
84
|
+
state.collection.columns
|
|
85
|
+
]);
|
|
86
|
+
let descriptionProps = (0, $dDeJM$useDescription)(sortDescription);
|
|
87
|
+
// Only announce after initial render, tabbing to the table will tell you the initial sort info already
|
|
88
|
+
(0, $dDeJM$useUpdateEffect)(()=>{
|
|
89
|
+
(0, $dDeJM$announce)(sortDescription, "assertive", 500);
|
|
90
|
+
}, [
|
|
91
|
+
sortDescription
|
|
92
|
+
]);
|
|
93
|
+
return {
|
|
94
|
+
gridProps: (0, $dDeJM$mergeProps)(gridProps, descriptionProps, {
|
|
95
|
+
// merge sort description with long press information
|
|
96
|
+
"aria-describedby": [
|
|
97
|
+
descriptionProps["aria-describedby"],
|
|
98
|
+
gridProps["aria-describedby"]
|
|
99
|
+
].filter(Boolean).join(" ")
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
export {$6e31608fbba75bab$export$25bceaac3c7e4dc7 as useTable};
|
|
106
|
+
//# sourceMappingURL=useTable.mjs.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {gridIds as $2140fb2337097f2d$export$552312adfd451dab} from "./utils.module.js";
|
|
2
|
+
import $dDeJM$intlStringsmodulejs from "./intlStrings.module.js";
|
|
3
|
+
import {TableKeyboardDelegate as $0ba3c81c7f1caedd$export$da43f8f5cb04028d} from "./TableKeyboardDelegate.module.js";
|
|
4
|
+
import {announce as $dDeJM$announce} from "@react-aria/live-announcer";
|
|
5
|
+
import {useGrid as $dDeJM$useGrid} from "@react-aria/grid";
|
|
6
|
+
import {useId as $dDeJM$useId, useDescription as $dDeJM$useDescription, useUpdateEffect as $dDeJM$useUpdateEffect, mergeProps as $dDeJM$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import {useMemo as $dDeJM$useMemo} from "react";
|
|
8
|
+
import {tableNestedRows as $dDeJM$tableNestedRows} from "@react-stately/flags";
|
|
9
|
+
import {useCollator as $dDeJM$useCollator, useLocale as $dDeJM$useLocale, useLocalizedStringFormatter as $dDeJM$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
function $6e31608fbba75bab$export$25bceaac3c7e4dc7(props, state, ref) {
|
|
35
|
+
let { keyboardDelegate: keyboardDelegate, isVirtualized: isVirtualized, layout: layout } = props;
|
|
36
|
+
// By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
|
|
37
|
+
// When virtualized, the layout object will be passed in as a prop and override this.
|
|
38
|
+
let collator = (0, $dDeJM$useCollator)({
|
|
39
|
+
usage: "search",
|
|
40
|
+
sensitivity: "base"
|
|
41
|
+
});
|
|
42
|
+
let { direction: direction } = (0, $dDeJM$useLocale)();
|
|
43
|
+
let disabledBehavior = state.selectionManager.disabledBehavior;
|
|
44
|
+
let delegate = (0, $dDeJM$useMemo)(()=>keyboardDelegate || new (0, $0ba3c81c7f1caedd$export$da43f8f5cb04028d)({
|
|
45
|
+
collection: state.collection,
|
|
46
|
+
disabledKeys: state.disabledKeys,
|
|
47
|
+
disabledBehavior: disabledBehavior,
|
|
48
|
+
ref: ref,
|
|
49
|
+
direction: direction,
|
|
50
|
+
collator: collator,
|
|
51
|
+
layout: layout
|
|
52
|
+
}), [
|
|
53
|
+
keyboardDelegate,
|
|
54
|
+
state.collection,
|
|
55
|
+
state.disabledKeys,
|
|
56
|
+
disabledBehavior,
|
|
57
|
+
ref,
|
|
58
|
+
direction,
|
|
59
|
+
collator,
|
|
60
|
+
layout
|
|
61
|
+
]);
|
|
62
|
+
let id = (0, $dDeJM$useId)(props.id);
|
|
63
|
+
(0, $2140fb2337097f2d$export$552312adfd451dab).set(state, id);
|
|
64
|
+
let { gridProps: gridProps } = (0, $dDeJM$useGrid)({
|
|
65
|
+
...props,
|
|
66
|
+
id: id,
|
|
67
|
+
keyboardDelegate: delegate
|
|
68
|
+
}, state, ref);
|
|
69
|
+
// Override to include header rows
|
|
70
|
+
if (isVirtualized) gridProps["aria-rowcount"] = state.collection.size + state.collection.headerRows.length;
|
|
71
|
+
if ((0, $dDeJM$tableNestedRows)() && "expandedKeys" in state) gridProps.role = "treegrid";
|
|
72
|
+
let { column: column, direction: sortDirection } = state.sortDescriptor || {};
|
|
73
|
+
let stringFormatter = (0, $dDeJM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dDeJM$intlStringsmodulejs))), "@react-aria/table");
|
|
74
|
+
let sortDescription = (0, $dDeJM$useMemo)(()=>{
|
|
75
|
+
var _state_collection_columns_find;
|
|
76
|
+
let columnName = (_state_collection_columns_find = state.collection.columns.find((c)=>c.key === column)) === null || _state_collection_columns_find === void 0 ? void 0 : _state_collection_columns_find.textValue;
|
|
77
|
+
return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {
|
|
78
|
+
columnName: columnName
|
|
79
|
+
}) : undefined;
|
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
+
}, [
|
|
82
|
+
sortDirection,
|
|
83
|
+
column,
|
|
84
|
+
state.collection.columns
|
|
85
|
+
]);
|
|
86
|
+
let descriptionProps = (0, $dDeJM$useDescription)(sortDescription);
|
|
87
|
+
// Only announce after initial render, tabbing to the table will tell you the initial sort info already
|
|
88
|
+
(0, $dDeJM$useUpdateEffect)(()=>{
|
|
89
|
+
(0, $dDeJM$announce)(sortDescription, "assertive", 500);
|
|
90
|
+
}, [
|
|
91
|
+
sortDescription
|
|
92
|
+
]);
|
|
93
|
+
return {
|
|
94
|
+
gridProps: (0, $dDeJM$mergeProps)(gridProps, descriptionProps, {
|
|
95
|
+
// merge sort description with long press information
|
|
96
|
+
"aria-describedby": [
|
|
97
|
+
descriptionProps["aria-describedby"],
|
|
98
|
+
gridProps["aria-describedby"]
|
|
99
|
+
].filter(Boolean).join(" ")
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
export {$6e31608fbba75bab$export$25bceaac3c7e4dc7 as useTable};
|
|
106
|
+
//# sourceMappingURL=useTable.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mapp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,GAAA,cAAM,EAAE;YACX;QAAjB,IAAI,cAAa,iCAAA,MAAM,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA,IAAK,EAAE,GAAG,KAAK,qBAA7C,qDAAA,+BAAsD,SAAS;QAChF,OAAO,iBAAiB,SAAS,gBAAgB,MAAM,CAAC,CAAC,EAAE,cAAc,IAAI,CAAC,EAAE;wBAAC;QAAU,KAAK;IAClG,uDAAuD;IACvD,GAAG;QAAC;QAAe;QAAQ,MAAM,UAAU,CAAC,OAAO;KAAC;IAEpD,IAAI,mBAAmB,CAAA,GAAA,qBAAa,EAAE;IAEtC,uGAAuG;IACvG,CAAA,GAAA,sBAAc,EAAE;QACd,CAAA,GAAA,eAAO,EAAE,iBAAiB,aAAa;IACzC,GAAG;QAAC;KAAgB;IAEpB,OAAO;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,WACA,kBACA;YACE,qDAAqD;YACrD,oBAAoB;gBAAC,gBAAgB,CAAC,mBAAmB;gBAAE,SAAS,CAAC,mBAAmB;aAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QACjH;IAEJ;AACF","sources":["packages/@react-aria/table/src/useTable.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 {announce} from '@react-aria/live-announcer';\nimport {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Layout} from '@react-stately/virtualizer';\nimport {mergeProps, useDescription, useId, useUpdateEffect} from '@react-aria/utils';\nimport {Node} from '@react-types/shared';\nimport {RefObject, useMemo} from 'react';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState, TreeGridState} from '@react-stately/table';\nimport {useCollator, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableProps<T> extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layout?: Layout<Node<T>>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,\n * and optionally supports row selection and sorting.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n * @param ref - The ref attached to the table element.\n */\nexport function useTable<T>(props: AriaTableProps<T>, state: TableState<T> | TreeGridState<T>, ref: RefObject<HTMLElement>): GridAria {\n let {\n keyboardDelegate,\n isVirtualized,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n layout\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, layout]);\n let id = useId(props.id);\n gridIds.set(state, id);\n\n let {gridProps} = useGrid({\n ...props,\n id,\n keyboardDelegate: delegate\n }, state, ref);\n\n // Override to include header rows\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;\n }\n\n if (tableNestedRows() && 'expandedKeys' in state) {\n gridProps.role = 'treegrid';\n }\n\n let {column, direction: sortDirection} = state.sortDescriptor || {};\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let sortDescription = useMemo(() => {\n let columnName = state.collection.columns.find(c => c.key === column)?.textValue;\n return sortDirection && column ? stringFormatter.format(`${sortDirection}Sort`, {columnName}) : undefined;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [sortDirection, column, state.collection.columns]);\n\n let descriptionProps = useDescription(sortDescription);\n\n // Only announce after initial render, tabbing to the table will tell you the initial sort info already\n useUpdateEffect(() => {\n announce(sortDescription, 'assertive', 500);\n }, [sortDescription]);\n\n return {\n gridProps: mergeProps(\n gridProps,\n descriptionProps,\n {\n // merge sort description with long press information\n 'aria-describedby': [descriptionProps['aria-describedby'], gridProps['aria-describedby']].filter(Boolean).join(' ')\n }\n )\n };\n}\n"],"names":[],"version":3,"file":"useTable.module.js.map"}
|