@fluentui/react-table 0.0.0-nightly-20221007-1237.1
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/CHANGELOG.json +354 -0
- package/CHANGELOG.md +104 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/Spec.md +63 -0
- package/dist/index.d.ts +647 -0
- package/lib/Table.js +2 -0
- package/lib/Table.js.map +1 -0
- package/lib/TableBody.js +2 -0
- package/lib/TableBody.js.map +1 -0
- package/lib/TableCell.js +2 -0
- package/lib/TableCell.js.map +1 -0
- package/lib/TableCellActions.js +2 -0
- package/lib/TableCellActions.js.map +1 -0
- package/lib/TableCellLayout.js +2 -0
- package/lib/TableCellLayout.js.map +1 -0
- package/lib/TableCellPrimaryLayout.js +2 -0
- package/lib/TableCellPrimaryLayout.js.map +1 -0
- package/lib/TableHeader.js +2 -0
- package/lib/TableHeader.js.map +1 -0
- package/lib/TableHeaderCell.js +2 -0
- package/lib/TableHeaderCell.js.map +1 -0
- package/lib/TableRow.js +2 -0
- package/lib/TableRow.js.map +1 -0
- package/lib/TableSelectionCell.js +2 -0
- package/lib/TableSelectionCell.js.map +1 -0
- package/lib/components/Table/Table.js +16 -0
- package/lib/components/Table/Table.js.map +1 -0
- package/lib/components/Table/Table.types.js +2 -0
- package/lib/components/Table/Table.types.js.map +1 -0
- package/lib/components/Table/index.js +6 -0
- package/lib/components/Table/index.js.map +1 -0
- package/lib/components/Table/renderTable.js +18 -0
- package/lib/components/Table/renderTable.js.map +1 -0
- package/lib/components/Table/useTable.js +30 -0
- package/lib/components/Table/useTable.js.map +1 -0
- package/lib/components/Table/useTableContextValues.js +17 -0
- package/lib/components/Table/useTableContextValues.js.map +1 -0
- package/lib/components/Table/useTableStyles.js +53 -0
- package/lib/components/Table/useTableStyles.js.map +1 -0
- package/lib/components/TableBody/TableBody.js +15 -0
- package/lib/components/TableBody/TableBody.js.map +1 -0
- package/lib/components/TableBody/TableBody.types.js +2 -0
- package/lib/components/TableBody/TableBody.types.js.map +1 -0
- package/lib/components/TableBody/index.js +6 -0
- package/lib/components/TableBody/index.js.map +1 -0
- package/lib/components/TableBody/renderTableBody.js +16 -0
- package/lib/components/TableBody/renderTableBody.js.map +1 -0
- package/lib/components/TableBody/useTableBody.js +32 -0
- package/lib/components/TableBody/useTableBody.js.map +1 -0
- package/lib/components/TableBody/useTableBodyStyles.js +35 -0
- package/lib/components/TableBody/useTableBodyStyles.js.map +1 -0
- package/lib/components/TableCell/TableCell.js +15 -0
- package/lib/components/TableCell/TableCell.js.map +1 -0
- package/lib/components/TableCell/TableCell.types.js +2 -0
- package/lib/components/TableCell/TableCell.types.js.map +1 -0
- package/lib/components/TableCell/index.js +6 -0
- package/lib/components/TableCell/index.js.map +1 -0
- package/lib/components/TableCell/renderTableCell.js +15 -0
- package/lib/components/TableCell/renderTableCell.js.map +1 -0
- package/lib/components/TableCell/useTableCell.js +32 -0
- package/lib/components/TableCell/useTableCell.js.map +1 -0
- package/lib/components/TableCell/useTableCellStyles.js +59 -0
- package/lib/components/TableCell/useTableCellStyles.js.map +1 -0
- package/lib/components/TableCellActions/TableCellActions.js +15 -0
- package/lib/components/TableCellActions/TableCellActions.js.map +1 -0
- package/lib/components/TableCellActions/TableCellActions.types.js +2 -0
- package/lib/components/TableCellActions/TableCellActions.types.js.map +1 -0
- package/lib/components/TableCellActions/index.js +6 -0
- package/lib/components/TableCellActions/index.js.map +1 -0
- package/lib/components/TableCellActions/renderTableCellActions.js +16 -0
- package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -0
- package/lib/components/TableCellActions/useTableCellActions.js +27 -0
- package/lib/components/TableCellActions/useTableCellActions.js.map +1 -0
- package/lib/components/TableCellActions/useTableCellActionsStyles.js +40 -0
- package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
- package/lib/components/TableCellLayout/TableCellLayout.js +16 -0
- package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -0
- package/lib/components/TableCellLayout/TableCellLayout.types.js +2 -0
- package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -0
- package/lib/components/TableCellLayout/index.js +6 -0
- package/lib/components/TableCellLayout/index.js.map +1 -0
- package/lib/components/TableCellLayout/renderTableCellLayout.js +22 -0
- package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
- package/lib/components/TableCellLayout/useTableCellLayout.js +46 -0
- package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -0
- package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js +13 -0
- package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -0
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +74 -0
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -0
- package/lib/components/TableHeader/TableHeader.js +15 -0
- package/lib/components/TableHeader/TableHeader.js.map +1 -0
- package/lib/components/TableHeader/TableHeader.types.js +2 -0
- package/lib/components/TableHeader/TableHeader.types.js.map +1 -0
- package/lib/components/TableHeader/index.js +6 -0
- package/lib/components/TableHeader/index.js.map +1 -0
- package/lib/components/TableHeader/renderTableHeader.js +15 -0
- package/lib/components/TableHeader/renderTableHeader.js.map +1 -0
- package/lib/components/TableHeader/useTableHeader.js +39 -0
- package/lib/components/TableHeader/useTableHeader.js.map +1 -0
- package/lib/components/TableHeader/useTableHeaderStyles.js +41 -0
- package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -0
- package/lib/components/TableHeaderCell/TableHeaderCell.js +15 -0
- package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -0
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js +2 -0
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -0
- package/lib/components/TableHeaderCell/index.js +6 -0
- package/lib/components/TableHeaderCell/index.js.map +1 -0
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js +17 -0
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -0
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +62 -0
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -0
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +106 -0
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -0
- package/lib/components/TableRow/TableRow.js +15 -0
- package/lib/components/TableRow/TableRow.js.map +1 -0
- package/lib/components/TableRow/TableRow.types.js +2 -0
- package/lib/components/TableRow/TableRow.types.js.map +1 -0
- package/lib/components/TableRow/index.js +6 -0
- package/lib/components/TableRow/index.js.map +1 -0
- package/lib/components/TableRow/renderTableRow.js +16 -0
- package/lib/components/TableRow/renderTableRow.js.map +1 -0
- package/lib/components/TableRow/useTableRow.js +34 -0
- package/lib/components/TableRow/useTableRow.js.map +1 -0
- package/lib/components/TableRow/useTableRowStyles.js +88 -0
- package/lib/components/TableRow/useTableRowStyles.js.map +1 -0
- package/lib/components/TableSelectionCell/TableSelectionCell.js +15 -0
- package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -0
- package/lib/components/TableSelectionCell/TableSelectionCell.types.js +2 -0
- package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -0
- package/lib/components/TableSelectionCell/index.js +6 -0
- package/lib/components/TableSelectionCell/index.js.map +1 -0
- package/lib/components/TableSelectionCell/renderTableSelectionCell.js +17 -0
- package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -0
- package/lib/components/TableSelectionCell/useTableSelectionCell.js +47 -0
- package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +81 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
- package/lib/contexts/tableContext.js +14 -0
- package/lib/contexts/tableContext.js.map +1 -0
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/selectionManager.js +89 -0
- package/lib/hooks/selectionManager.js.map +1 -0
- package/lib/hooks/types.js +2 -0
- package/lib/hooks/types.js.map +1 -0
- package/lib/hooks/useSelection.js +74 -0
- package/lib/hooks/useSelection.js.map +1 -0
- package/lib/hooks/useSort.js +94 -0
- package/lib/hooks/useSort.js.map +1 -0
- package/lib/hooks/useTable.js +32 -0
- package/lib/hooks/useTable.js.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/lib/navigationModes/cell.js +250 -0
- package/lib/navigationModes/cell.js.map +1 -0
- package/lib/navigationModes/composite.js +208 -0
- package/lib/navigationModes/composite.js.map +1 -0
- package/lib/navigationModes/index.js +3 -0
- package/lib/navigationModes/index.js.map +1 -0
- package/lib/navigationModes/useNavigationMode.js +42 -0
- package/lib/navigationModes/useNavigationMode.js.map +1 -0
- package/lib-commonjs/Table.js +10 -0
- package/lib-commonjs/Table.js.map +1 -0
- package/lib-commonjs/TableBody.js +10 -0
- package/lib-commonjs/TableBody.js.map +1 -0
- package/lib-commonjs/TableCell.js +10 -0
- package/lib-commonjs/TableCell.js.map +1 -0
- package/lib-commonjs/TableCellActions.js +10 -0
- package/lib-commonjs/TableCellActions.js.map +1 -0
- package/lib-commonjs/TableCellLayout.js +10 -0
- package/lib-commonjs/TableCellLayout.js.map +1 -0
- package/lib-commonjs/TableCellPrimaryLayout.js +10 -0
- package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -0
- package/lib-commonjs/TableHeader.js +10 -0
- package/lib-commonjs/TableHeader.js.map +1 -0
- package/lib-commonjs/TableHeaderCell.js +10 -0
- package/lib-commonjs/TableHeaderCell.js.map +1 -0
- package/lib-commonjs/TableRow.js +10 -0
- package/lib-commonjs/TableRow.js.map +1 -0
- package/lib-commonjs/TableSelectionCell.js +10 -0
- package/lib-commonjs/TableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/Table/Table.js +28 -0
- package/lib-commonjs/components/Table/Table.js.map +1 -0
- package/lib-commonjs/components/Table/Table.types.js +6 -0
- package/lib-commonjs/components/Table/Table.types.js.map +1 -0
- package/lib-commonjs/components/Table/index.js +18 -0
- package/lib-commonjs/components/Table/index.js.map +1 -0
- package/lib-commonjs/components/Table/renderTable.js +30 -0
- package/lib-commonjs/components/Table/renderTable.js.map +1 -0
- package/lib-commonjs/components/Table/useTable.js +40 -0
- package/lib-commonjs/components/Table/useTable.js.map +1 -0
- package/lib-commonjs/components/Table/useTableContextValues.js +27 -0
- package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -0
- package/lib-commonjs/components/Table/useTableStyles.js +64 -0
- package/lib-commonjs/components/Table/useTableStyles.js.map +1 -0
- package/lib-commonjs/components/TableBody/TableBody.js +26 -0
- package/lib-commonjs/components/TableBody/TableBody.js.map +1 -0
- package/lib-commonjs/components/TableBody/TableBody.types.js +6 -0
- package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -0
- package/lib-commonjs/components/TableBody/index.js +18 -0
- package/lib-commonjs/components/TableBody/index.js.map +1 -0
- package/lib-commonjs/components/TableBody/renderTableBody.js +27 -0
- package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -0
- package/lib-commonjs/components/TableBody/useTableBody.js +43 -0
- package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -0
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js +44 -0
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -0
- package/lib-commonjs/components/TableCell/TableCell.js +26 -0
- package/lib-commonjs/components/TableCell/TableCell.js.map +1 -0
- package/lib-commonjs/components/TableCell/TableCell.types.js +6 -0
- package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -0
- package/lib-commonjs/components/TableCell/index.js +18 -0
- package/lib-commonjs/components/TableCell/index.js.map +1 -0
- package/lib-commonjs/components/TableCell/renderTableCell.js +26 -0
- package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -0
- package/lib-commonjs/components/TableCell/useTableCell.js +43 -0
- package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -0
- package/lib-commonjs/components/TableCell/useTableCellStyles.js +70 -0
- package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/TableCellActions.js +26 -0
- package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/TableCellActions.types.js +6 -0
- package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/index.js +18 -0
- package/lib-commonjs/components/TableCellActions/index.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/renderTableCellActions.js +27 -0
- package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/useTableCellActions.js +38 -0
- package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -0
- package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +51 -0
- package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +28 -0
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js +6 -0
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/index.js +18 -0
- package/lib-commonjs/components/TableCellLayout/index.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js +34 -0
- package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +57 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js +23 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +85 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -0
- package/lib-commonjs/components/TableHeader/TableHeader.js +26 -0
- package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -0
- package/lib-commonjs/components/TableHeader/TableHeader.types.js +6 -0
- package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -0
- package/lib-commonjs/components/TableHeader/index.js +18 -0
- package/lib-commonjs/components/TableHeader/index.js.map +1 -0
- package/lib-commonjs/components/TableHeader/renderTableHeader.js +26 -0
- package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -0
- package/lib-commonjs/components/TableHeader/useTableHeader.js +51 -0
- package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -0
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +51 -0
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +26 -0
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js +6 -0
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/index.js +18 -0
- package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +28 -0
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +76 -0
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -0
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +117 -0
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -0
- package/lib-commonjs/components/TableRow/TableRow.js +26 -0
- package/lib-commonjs/components/TableRow/TableRow.js.map +1 -0
- package/lib-commonjs/components/TableRow/TableRow.types.js +6 -0
- package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -0
- package/lib-commonjs/components/TableRow/index.js +18 -0
- package/lib-commonjs/components/TableRow/index.js.map +1 -0
- package/lib-commonjs/components/TableRow/renderTableRow.js +27 -0
- package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -0
- package/lib-commonjs/components/TableRow/useTableRow.js +45 -0
- package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -0
- package/lib-commonjs/components/TableRow/useTableRowStyles.js +100 -0
- package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +26 -0
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js +6 -0
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/index.js +18 -0
- package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js +28 -0
- package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +62 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +91 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
- package/lib-commonjs/contexts/tableContext.js +25 -0
- package/lib-commonjs/contexts/tableContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js +16 -0
- package/lib-commonjs/hooks/index.js.map +1 -0
- package/lib-commonjs/hooks/selectionManager.js +98 -0
- package/lib-commonjs/hooks/selectionManager.js.map +1 -0
- package/lib-commonjs/hooks/types.js +6 -0
- package/lib-commonjs/hooks/types.js.map +1 -0
- package/lib-commonjs/hooks/useSelection.js +89 -0
- package/lib-commonjs/hooks/useSelection.js.map +1 -0
- package/lib-commonjs/hooks/useSort.js +107 -0
- package/lib-commonjs/hooks/useSort.js.map +1 -0
- package/lib-commonjs/hooks/useTable.js +42 -0
- package/lib-commonjs/hooks/useTable.js.map +1 -0
- package/lib-commonjs/index.js +377 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/navigationModes/cell.js +259 -0
- package/lib-commonjs/navigationModes/cell.js.map +1 -0
- package/lib-commonjs/navigationModes/composite.js +217 -0
- package/lib-commonjs/navigationModes/composite.js.map +1 -0
- package/lib-commonjs/navigationModes/index.js +16 -0
- package/lib-commonjs/navigationModes/index.js.map +1 -0
- package/lib-commonjs/navigationModes/useNavigationMode.js +55 -0
- package/lib-commonjs/navigationModes/useNavigationMode.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../packages/react-components/react-table/src/navigationModes/cell.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAgB,mBAAhB,CAAoC,OAApC,EAAwD;EACtD,MAAM,SAAS,GAAG,OAAlB;EACA,IAAI,MAAM,GAAG,CAAb;EACA,IAAI,IAAI,GAAiC,SAAzC;EACA,IAAI,SAAS,GAAG,KAAhB;EAEA,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAT,CAAuB,KAAvB,CAAZ;EACA,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAT,CAAuB,KAAvB,CAAb;;EAEA,IAAI,CAAC,GAAD,IAAQ,CAAC,IAAb,EAAmB;IACjB;EACD;;EAED,GAAG,CAAC,QAAJ,GAAe,CAAf;EACA,IAAI,CAAC,QAAL,GAAgB,CAAhB;EAEA,GAAG,CAAC,gBAAJ,CAAqB,OAArB,EAA8B,MAAK;IACjC,IAAI,SAAJ,EAAe;MACb,SAAS,GAAG,KAAZ;MACA;IACD,CAHD,MAGO;MACL,UAAU,CAAC,WAAX,GAAyB,SAAzB;MACA,MAAM,SAAS,GAAG,UAAU,CAAC,QAAX,EAAlB;;MACA,IAAI,aAAa,CAAC,SAAD,CAAjB,EAA8B;QAC5B,MAAM,GAAG,CAAT;QACA,SAAS,CAAC,KAAV;MACD;IACF;EACF,CAZD;EA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AAG,MAAK;IACtB,IAAI,GAAG,SAAP;EACD,CAFD;;EAIA,SAAS,CAAC,gBAAV,CAA2B,SAA3B,EAAsC,SAAtC;EACA,SAAS,CAAC,gBAAV,CAA2B,UAA3B,EAAuC,UAAvC;EACA,OAAO,MAAK;IACV,SAAS,CAAC,mBAAV,CAA8B,UAA9B,EAA0C,UAA1C;IACA,SAAS,CAAC,mBAAV,CAA8B,SAA9B,EAAyC,SAAzC;EACD,CAHD;AAID;;AA/MD,OAAA,CAAA,mBAAA,GAAA,mBAAA;;AAiNA,SAAS,aAAT,CAAuB,IAAvB,EAAoC;EAClC,OAAO,IAAI,YAAY,WAAvB;AACD;;AAED,SAAS,KAAT,CAAe,OAAf,EAAmC;EACjC,IAAI,OAAO,CAAC,YAAR,CAAqB,MAArB,MAAiC,KAAjC,IAA0C,OAAO,CAAC,OAAR,KAAoB,IAAlE,EAAwE;IACtE,OAAO,IAAP;EACD;;EAED,OAAO,KAAP;AACD;;AAED,SAAS,eAAT,CAAyB,IAAzB,EAA0C;EACxC,IAAI,GAAG,GAAG,IAAV;;EACA,OAAO,GAAG,CAAC,aAAJ,IAAqB,CAAC,KAAK,CAAC,GAAD,CAAlC,EAAyC;IACvC,GAAG,GAAG,GAAG,CAAC,aAAV;EACD;;EAED,OAAO,GAAG,CAAC,gBAAJ,CAAqB,sCAArB,EAA6D,MAA7D,GAAsE,CAA7E;AACD","sourcesContent":["export function applyCellNavigation(element: HTMLElement) {\n const container = element;\n let column = 0;\n let mode: 'row' | 'column' | undefined = undefined;\n let movingOut = false;\n\n const pre = document.createElement('div');\n const post = document.createElement('div');\n\n if (!pre || !post) {\n return;\n }\n\n pre.tabIndex = 0;\n post.tabIndex = 0;\n\n pre.addEventListener('focus', () => {\n if (movingOut) {\n movingOut = false;\n return;\n } else {\n treeWalker.currentNode = container;\n const candidate = treeWalker.nextNode();\n if (isHTMLElement(candidate)) {\n column = 0;\n candidate.focus();\n }\n }\n });\n\n post.addEventListener('focus', () => {\n if (movingOut) {\n movingOut = false;\n return;\n } else {\n treeWalker.currentNode = post;\n const candidate = treeWalker.previousNode();\n if (isHTMLElement(candidate)) {\n column = findColumnCount(candidate);\n candidate.focus();\n }\n }\n });\n\n container.before(pre);\n container.after(post);\n\n const acceptNode = (node: Node) => {\n if (!isHTMLElement(node)) {\n return NodeFilter.FILTER_SKIP;\n }\n\n if (mode === 'column') {\n return acceptCell(node);\n }\n\n if (mode === 'row') {\n return acceptRow(node);\n }\n\n if (node.tabIndex >= 0) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n\n const acceptCell = (node: HTMLElement) => {\n if (isRow(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if (node.tabIndex < 0) {\n return NodeFilter.FILTER_SKIP;\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n const acceptRow = (node: HTMLElement) => {\n if (isRow(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n\n const treeWalker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode });\n\n const up = (current: HTMLElement) => {\n mode = 'row';\n treeWalker.currentNode = current;\n treeWalker.previousNode(); // current row\n const row = treeWalker.previousNode();\n if (!row) {\n return null;\n }\n\n mode = 'column';\n treeWalker.currentNode = row;\n let curCol = 0;\n let node: Node | null = null;\n while (curCol <= column) {\n node = treeWalker.nextNode();\n curCol++;\n }\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const down = (current: HTMLElement) => {\n mode = 'row';\n treeWalker.currentNode = current;\n const row = treeWalker.nextNode();\n if (!row) {\n return null;\n }\n\n mode = 'column';\n treeWalker.currentNode = row;\n let curCol = 0;\n let node: Node | null = null;\n while (curCol <= column) {\n node = treeWalker.nextNode();\n curCol++;\n }\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const left = (current: HTMLElement) => {\n treeWalker.currentNode = current;\n mode = 'column';\n const node = treeWalker.previousNode();\n\n if (isHTMLElement(node)) {\n column--;\n return node;\n }\n return null;\n };\n\n const right = (current: HTMLElement) => {\n mode = 'column';\n treeWalker.currentNode = current;\n const node = treeWalker.nextNode();\n if (isHTMLElement(node)) {\n column++;\n return node;\n }\n return null;\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n const target = e.target;\n if (!target || !isHTMLElement(target)) {\n return;\n }\n\n let next: HTMLElement | null = null;\n\n switch (e.key) {\n case 'ArrowDown':\n next = down(target);\n break;\n case 'ArrowUp':\n next = up(target);\n break;\n case 'ArrowLeft':\n next = left(target);\n break;\n case 'ArrowRight':\n next = right(target);\n break;\n case 'Tab':\n movingOut = true;\n if (e.shiftKey) {\n pre.focus();\n } else {\n post.focus();\n }\n\n break;\n default:\n return;\n }\n\n if (next) {\n e.preventDefault();\n next.focus();\n }\n };\n\n const onFocusOut = () => {\n mode = undefined;\n };\n\n container.addEventListener('keydown', onKeyDown);\n container.addEventListener('focusout', onFocusOut);\n return () => {\n container.removeEventListener('focusout', onFocusOut);\n container.removeEventListener('keydown', onKeyDown);\n };\n}\n\nfunction isHTMLElement(node: unknown): node is HTMLElement {\n return node instanceof HTMLElement;\n}\n\nfunction isRow(element: HTMLElement) {\n if (element.getAttribute('role') === 'row' || element.tagName === 'TR') {\n return true;\n }\n\n return false;\n}\n\nfunction findColumnCount(node: HTMLElement) {\n let cur = node;\n while (cur.parentElement && !isRow(cur)) {\n cur = cur.parentElement;\n }\n\n return cur.querySelectorAll('[role=\"cell\"], [role=\"gridcell\"], td').length - 1;\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.applyCompositeNavigation = void 0;
|
|
7
|
+
|
|
8
|
+
function applyCompositeNavigation(element) {
|
|
9
|
+
const container = element;
|
|
10
|
+
let mode = 'row';
|
|
11
|
+
let movingOut = false;
|
|
12
|
+
const pre = document.createElement('div');
|
|
13
|
+
const post = document.createElement('div');
|
|
14
|
+
|
|
15
|
+
if (!pre || !post) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pre.tabIndex = 0;
|
|
20
|
+
post.tabIndex = 0;
|
|
21
|
+
pre.addEventListener('focus', () => {
|
|
22
|
+
if (movingOut) {
|
|
23
|
+
movingOut = false;
|
|
24
|
+
return;
|
|
25
|
+
} else {
|
|
26
|
+
treeWalker.currentNode = container;
|
|
27
|
+
mode = 'row';
|
|
28
|
+
const candidate = treeWalker.nextNode();
|
|
29
|
+
|
|
30
|
+
if (isHTMLElement(candidate)) {
|
|
31
|
+
candidate.focus();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
post.addEventListener('focus', () => {
|
|
36
|
+
if (movingOut) {
|
|
37
|
+
movingOut = false;
|
|
38
|
+
return;
|
|
39
|
+
} else {
|
|
40
|
+
treeWalker.currentNode = post;
|
|
41
|
+
mode = 'row';
|
|
42
|
+
const candidate = treeWalker.previousNode();
|
|
43
|
+
|
|
44
|
+
if (isHTMLElement(candidate)) {
|
|
45
|
+
candidate.focus();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
container.before(pre);
|
|
50
|
+
container.after(post);
|
|
51
|
+
|
|
52
|
+
const acceptNode = node => {
|
|
53
|
+
if (!isHTMLElement(node)) {
|
|
54
|
+
return NodeFilter.FILTER_SKIP;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!isCell(node) && !isRow(node)) {
|
|
58
|
+
return NodeFilter.FILTER_SKIP;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (mode === 'column' && isRow(node)) {
|
|
62
|
+
return NodeFilter.FILTER_REJECT;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (mode === 'row' && isCell(node)) {
|
|
66
|
+
return NodeFilter.FILTER_REJECT;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (node.tabIndex < 0) {
|
|
70
|
+
return NodeFilter.FILTER_SKIP;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const treeWalker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
77
|
+
acceptNode
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const up = current => {
|
|
81
|
+
const prevMode = mode;
|
|
82
|
+
mode = 'row';
|
|
83
|
+
treeWalker.currentNode = current;
|
|
84
|
+
|
|
85
|
+
if (prevMode === 'column') {
|
|
86
|
+
treeWalker.previousNode();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const node = treeWalker.previousNode();
|
|
90
|
+
|
|
91
|
+
if (isHTMLElement(node)) {
|
|
92
|
+
return node;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return null;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const down = current => {
|
|
99
|
+
mode = 'row';
|
|
100
|
+
treeWalker.currentNode = current;
|
|
101
|
+
const node = treeWalker.nextNode();
|
|
102
|
+
|
|
103
|
+
if (isHTMLElement(node)) {
|
|
104
|
+
return node;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return null;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const left = current => {
|
|
111
|
+
treeWalker.currentNode = current;
|
|
112
|
+
const prevMode = mode;
|
|
113
|
+
mode = 'column';
|
|
114
|
+
let node = null;
|
|
115
|
+
|
|
116
|
+
if (prevMode === 'row') {
|
|
117
|
+
let tmp = null;
|
|
118
|
+
|
|
119
|
+
while (tmp = treeWalker.nextNode()) {
|
|
120
|
+
node = tmp;
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
node = treeWalker.previousNode();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (isHTMLElement(node)) {
|
|
127
|
+
return node;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const right = current => {
|
|
134
|
+
mode = 'column';
|
|
135
|
+
treeWalker.currentNode = current;
|
|
136
|
+
const node = treeWalker.nextNode();
|
|
137
|
+
|
|
138
|
+
if (isHTMLElement(node)) {
|
|
139
|
+
return node;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return null;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const onKeyDown = e => {
|
|
146
|
+
const target = e.target;
|
|
147
|
+
|
|
148
|
+
if (!target || !isHTMLElement(target)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let next = null;
|
|
153
|
+
|
|
154
|
+
switch (e.key) {
|
|
155
|
+
case 'ArrowDown':
|
|
156
|
+
next = down(target);
|
|
157
|
+
break;
|
|
158
|
+
|
|
159
|
+
case 'ArrowUp':
|
|
160
|
+
next = up(target);
|
|
161
|
+
break;
|
|
162
|
+
|
|
163
|
+
case 'ArrowLeft':
|
|
164
|
+
next = left(target);
|
|
165
|
+
break;
|
|
166
|
+
|
|
167
|
+
case 'ArrowRight':
|
|
168
|
+
next = right(target);
|
|
169
|
+
break;
|
|
170
|
+
|
|
171
|
+
case 'Tab':
|
|
172
|
+
movingOut = true;
|
|
173
|
+
|
|
174
|
+
if (e.shiftKey) {
|
|
175
|
+
pre.focus();
|
|
176
|
+
} else {
|
|
177
|
+
post.focus();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
break;
|
|
181
|
+
|
|
182
|
+
default:
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (next) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
next.focus();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
container.addEventListener('keydown', onKeyDown);
|
|
193
|
+
return () => container.removeEventListener('keydown', onKeyDown);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
exports.applyCompositeNavigation = applyCompositeNavigation;
|
|
197
|
+
|
|
198
|
+
function isHTMLElement(node) {
|
|
199
|
+
return node instanceof HTMLElement;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function isRow(element) {
|
|
203
|
+
if (element.getAttribute('role') === 'row' || element.tagName === 'TR') {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function isCell(element) {
|
|
211
|
+
if (element.getAttribute('role') === 'cell' || element.getAttribute('role') === 'gridcell' || element.tagName === 'TD') {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=composite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../packages/react-components/react-table/src/navigationModes/composite.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAgB,wBAAhB,CAAyC,OAAzC,EAA6D;EAC3D,MAAM,SAAS,GAAG,OAAlB;EACA,IAAI,IAAI,GAAqB,KAA7B;EACA,IAAI,SAAS,GAAG,KAAhB;EAEA,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAT,CAAuB,KAAvB,CAAZ;EACA,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAT,CAAuB,KAAvB,CAAb;;EAEA,IAAI,CAAC,GAAD,IAAQ,CAAC,IAAb,EAAmB;IACjB;EACD;;EAED,GAAG,CAAC,QAAJ,GAAe,CAAf;EACA,IAAI,CAAC,QAAL,GAAgB,CAAhB;EAEA,GAAG,CAAC,gBAAJ,CAAqB,OAArB,EAA8B,MAAK;IACjC,IAAI,SAAJ,EAAe;MACb,SAAS,GAAG,KAAZ;MACA;IACD,CAHD,MAGO;MACL,UAAU,CAAC,WAAX,GAAyB,SAAzB;MACA,IAAI,GAAG,KAAP;MACA,MAAM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AO,IAAP;EACD;;EAED,OAAO,KAAP;AACD;;AAED,SAAS,MAAT,CAAgB,OAAhB,EAAoC;EAClC,IACE,OAAO,CAAC,YAAR,CAAqB,MAArB,MAAiC,MAAjC,IACA,OAAO,CAAC,YAAR,CAAqB,MAArB,MAAiC,UADjC,IAEA,OAAO,CAAC,OAAR,KAAoB,IAHtB,EAIE;IACA,OAAO,IAAP;EACD;;EAED,OAAO,KAAP;AACD","sourcesContent":["export function applyCompositeNavigation(element: HTMLElement) {\n const container = element;\n let mode: 'row' | 'column' = 'row';\n let movingOut = false;\n\n const pre = document.createElement('div');\n const post = document.createElement('div');\n\n if (!pre || !post) {\n return;\n }\n\n pre.tabIndex = 0;\n post.tabIndex = 0;\n\n pre.addEventListener('focus', () => {\n if (movingOut) {\n movingOut = false;\n return;\n } else {\n treeWalker.currentNode = container;\n mode = 'row';\n const candidate = treeWalker.nextNode();\n if (isHTMLElement(candidate)) {\n candidate.focus();\n }\n }\n });\n\n post.addEventListener('focus', () => {\n if (movingOut) {\n movingOut = false;\n return;\n } else {\n treeWalker.currentNode = post;\n mode = 'row';\n const candidate = treeWalker.previousNode();\n if (isHTMLElement(candidate)) {\n candidate.focus();\n }\n }\n });\n\n container.before(pre);\n container.after(post);\n\n const acceptNode = (node: Node) => {\n if (!isHTMLElement(node)) {\n return NodeFilter.FILTER_SKIP;\n }\n\n if (!isCell(node) && !isRow(node)) {\n return NodeFilter.FILTER_SKIP;\n }\n\n if (mode === 'column' && isRow(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if (mode === 'row' && isCell(node)) {\n return NodeFilter.FILTER_REJECT;\n }\n\n if (node.tabIndex < 0) {\n return NodeFilter.FILTER_SKIP;\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n const treeWalker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode });\n\n const up = (current: HTMLElement) => {\n const prevMode = mode;\n mode = 'row';\n treeWalker.currentNode = current;\n\n if (prevMode === 'column') {\n treeWalker.previousNode();\n }\n\n const node = treeWalker.previousNode();\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const down = (current: HTMLElement) => {\n mode = 'row';\n treeWalker.currentNode = current;\n const node = treeWalker.nextNode();\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const left = (current: HTMLElement) => {\n treeWalker.currentNode = current;\n const prevMode = mode;\n mode = 'column';\n let node: Node | null = null;\n\n if (prevMode === 'row') {\n let tmp: Node | null = null;\n while ((tmp = treeWalker.nextNode())) {\n node = tmp;\n }\n } else {\n node = treeWalker.previousNode();\n }\n\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const right = (current: HTMLElement) => {\n mode = 'column';\n treeWalker.currentNode = current;\n const node = treeWalker.nextNode();\n if (isHTMLElement(node)) {\n return node;\n }\n return null;\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n const target = e.target;\n if (!target || !isHTMLElement(target)) {\n return;\n }\n\n let next: HTMLElement | null = null;\n\n switch (e.key) {\n case 'ArrowDown':\n next = down(target);\n break;\n case 'ArrowUp':\n next = up(target);\n break;\n case 'ArrowLeft':\n next = left(target);\n break;\n case 'ArrowRight':\n next = right(target);\n break;\n case 'Tab':\n movingOut = true;\n if (e.shiftKey) {\n pre.focus();\n } else {\n post.focus();\n }\n\n break;\n default:\n break;\n }\n\n if (next) {\n e.preventDefault();\n next.focus();\n }\n };\n\n container.addEventListener('keydown', onKeyDown);\n return () => container.removeEventListener('keydown', onKeyDown);\n}\n\nfunction isHTMLElement(node: unknown): node is HTMLElement {\n return node instanceof HTMLElement;\n}\n\nfunction isRow(element: HTMLElement) {\n if (element.getAttribute('role') === 'row' || element.tagName === 'TR') {\n return true;\n }\n\n return false;\n}\n\nfunction isCell(element: HTMLElement) {\n if (\n element.getAttribute('role') === 'cell' ||\n element.getAttribute('role') === 'gridcell' ||\n element.tagName === 'TD'\n ) {\n return true;\n }\n\n return false;\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useNavigationMode = void 0; // eslint-disable-next-line deprecation/deprecation
|
|
7
|
+
|
|
8
|
+
var useNavigationMode_1 = /*#__PURE__*/require("./useNavigationMode");
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "useNavigationMode", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return useNavigationMode_1.useNavigationMode;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../packages/react-components/react-table/src/navigationModes/index.ts"],"names":[],"mappings":";;;;;oCAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,mBAAA,CAAA,iBAAA;EAAiB;AAAjB,CAAA","sourcesContent":["// eslint-disable-next-line deprecation/deprecation\nexport { useNavigationMode } from './useNavigationMode';\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useNavigationMode = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
|
+
|
|
12
|
+
const composite_1 = /*#__PURE__*/require("./composite");
|
|
13
|
+
|
|
14
|
+
const cell_1 = /*#__PURE__*/require("./cell");
|
|
15
|
+
/**
|
|
16
|
+
* THIS HOOK WILL NOT EXIST IN STABLE RELEASE
|
|
17
|
+
* Just a quick workaround before tabster fully supports these navigation modes with grid mode
|
|
18
|
+
* https://github.com/microsoft/fluentui/issues/24382
|
|
19
|
+
* @internal
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function useNavigationMode(mode) {
|
|
25
|
+
const rowNavigationAttr = react_tabster_1.useArrowNavigationGroup({
|
|
26
|
+
axis: 'vertical'
|
|
27
|
+
});
|
|
28
|
+
const ref = React.useRef(null);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
if (!ref.current) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
switch (mode) {
|
|
35
|
+
case 'cell':
|
|
36
|
+
cell_1.applyCellNavigation(ref.current);
|
|
37
|
+
break;
|
|
38
|
+
|
|
39
|
+
case 'composite':
|
|
40
|
+
composite_1.applyCompositeNavigation(ref.current);
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case 'row':
|
|
44
|
+
if (rowNavigationAttr['data-tabster']) {
|
|
45
|
+
ref.current.setAttribute('data-tabster', rowNavigationAttr['data-tabster']);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}, [rowNavigationAttr, mode]);
|
|
51
|
+
return ref;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.useNavigationMode = useNavigationMode;
|
|
55
|
+
//# sourceMappingURL=useNavigationMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../packages/react-components/react-table/src/navigationModes/useNavigationMode.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,MAAA,MAAA,gBAAA,OAAA,CAAA,QAAA,CAAA;AAIA;;;;;;AAMG;;;AACH,SAAgB,iBAAhB,CAAgE,IAAhE,EAAoF;EAClF,MAAM,iBAAiB,GAAG,eAAA,CAAA,uBAAA,CAAwB;IAAE,IAAI,EAAE;EAAR,CAAxB,CAA1B;EACA,MAAM,GAAG,GAAG,KAAK,CAAC,MAAN,CAAuB,IAAvB,CAAZ;EAEA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB,IAAI,CAAC,GAAG,CAAC,OAAT,EAAkB;MAChB;IACD;;IAED,QAAQ,IAAR;MACE,KAAK,MAAL;QACE,MAAA,CAAA,mBAAA,CAAoB,GAAG,CAAC,OAAxB;QACA;;MACF,KAAK,WAAL;QACE,WAAA,CAAA,wBAAA,CAAyB,GAAG,CAAC,OAA7B;QACA;;MACF,KAAK,KAAL;QACE,IAAI,iBAAiB,CAAC,cAAD,CAArB,EAAuC;UACrC,GAAG,CAAC,OAAJ,CAAY,YAAZ,CAAyB,cAAzB,EAAyC,iBAAiB,CAAC,cAAD,CAA1D;QACD;;QACD;IAXJ;EAaD,CAlBD,EAkBG,CAAC,iBAAD,EAAoB,IAApB,CAlBH;EAoBA,OAAO,GAAP;AACD;;AAzBD,OAAA,CAAA,iBAAA,GAAA,iBAAA","sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { applyCompositeNavigation } from './composite';\nimport { applyCellNavigation } from './cell';\n\nexport type NavigationMode = 'row' | 'cell' | 'composite';\n\n/**\n * THIS HOOK WILL NOT EXIST IN STABLE RELEASE\n * Just a quick workaround before tabster fully supports these navigation modes with grid mode\n * https://github.com/microsoft/fluentui/issues/24382\n * @internal\n * @deprecated\n */\nexport function useNavigationMode<TElement extends HTMLElement>(mode: NavigationMode) {\n const rowNavigationAttr = useArrowNavigationGroup({ axis: 'vertical' });\n const ref = React.useRef<TElement>(null);\n\n React.useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n switch (mode) {\n case 'cell':\n applyCellNavigation(ref.current);\n break;\n case 'composite':\n applyCompositeNavigation(ref.current);\n break;\n case 'row':\n if (rowNavigationAttr['data-tabster']) {\n ref.current.setAttribute('data-tabster', rowNavigationAttr['data-tabster']);\n }\n break;\n }\n }, [rowNavigationAttr, mode]);\n\n return ref;\n}\n"],"sourceRoot":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluentui/react-table",
|
|
3
|
+
"version": "0.0.0-nightly-20221007-1237.1",
|
|
4
|
+
"description": "React components for building web experiences",
|
|
5
|
+
"main": "lib-commonjs/index.js",
|
|
6
|
+
"module": "lib/index.js",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/microsoft/fluentui"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "just-scripts build",
|
|
16
|
+
"clean": "just-scripts clean",
|
|
17
|
+
"code-style": "just-scripts code-style",
|
|
18
|
+
"just": "just-scripts",
|
|
19
|
+
"lint": "just-scripts lint",
|
|
20
|
+
"test": "jest --passWithNoTests",
|
|
21
|
+
"type-check": "tsc -b tsconfig.json",
|
|
22
|
+
"storybook": "start-storybook",
|
|
23
|
+
"start": "yarn storybook",
|
|
24
|
+
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@fluentui/eslint-plugin": "*",
|
|
28
|
+
"@fluentui/react-conformance": "*",
|
|
29
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20221007-1237.1",
|
|
30
|
+
"@fluentui/scripts": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@fluentui/react-aria": "^0.0.0-nightly-20221007-1237.1",
|
|
34
|
+
"@fluentui/react-avatar": "^0.0.0-nightly-20221007-1237.1",
|
|
35
|
+
"@fluentui/react-checkbox": "^0.0.0-nightly-20221007-1237.1",
|
|
36
|
+
"@fluentui/react-icons": "^2.0.175",
|
|
37
|
+
"@fluentui/react-tabster": "^0.0.0-nightly-20221007-1237.1",
|
|
38
|
+
"@fluentui/react-theme": "^0.0.0-nightly-20221007-1237.1",
|
|
39
|
+
"@fluentui/react-utilities": "^0.0.0-nightly-20221007-1237.1",
|
|
40
|
+
"@griffel/react": "^1.3.0",
|
|
41
|
+
"tslib": "^2.1.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@types/react": ">=16.8.0 <18.0.0",
|
|
45
|
+
"@types/react-dom": ">=16.8.0 <18.0.0",
|
|
46
|
+
"react": ">=16.8.0 <18.0.0",
|
|
47
|
+
"react-dom": ">=16.8.0 <18.0.0"
|
|
48
|
+
},
|
|
49
|
+
"beachball": {}
|
|
50
|
+
}
|