@fluentui/react-table 9.0.0-alpha.1 → 9.0.0-alpha.2

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.
Files changed (195) hide show
  1. package/CHANGELOG.json +135 -4
  2. package/CHANGELOG.md +31 -5
  3. package/dist/index.d.ts +312 -21
  4. package/lib/TableCellActions.js +2 -0
  5. package/lib/TableCellActions.js.map +1 -0
  6. package/lib/TableCellLayout.js +2 -0
  7. package/lib/TableCellLayout.js.map +1 -0
  8. package/lib/TableCellPrimaryLayout.js +2 -0
  9. package/lib/TableCellPrimaryLayout.js.map +1 -0
  10. package/lib/TableSelectionCell.js +2 -0
  11. package/lib/TableSelectionCell.js.map +1 -0
  12. package/lib/components/Table/Table.types.js.map +1 -1
  13. package/lib/components/Table/useTableContextValues.js +7 -5
  14. package/lib/components/Table/useTableContextValues.js.map +1 -1
  15. package/lib/components/Table/useTableStyles.js +7 -2
  16. package/lib/components/Table/useTableStyles.js.map +1 -1
  17. package/lib/components/TableBody/useTableBody.js +3 -1
  18. package/lib/components/TableBody/useTableBody.js.map +1 -1
  19. package/lib/components/TableBody/useTableBodyStyles.js +12 -2
  20. package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
  21. package/lib/components/TableCell/TableCell.types.js.map +1 -1
  22. package/lib/components/TableCell/renderTableCell.js +2 -4
  23. package/lib/components/TableCell/renderTableCell.js.map +1 -1
  24. package/lib/components/TableCell/useTableCell.js +5 -5
  25. package/lib/components/TableCell/useTableCell.js.map +1 -1
  26. package/lib/components/TableCell/useTableCellStyles.js +6 -20
  27. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  28. package/lib/components/TableCellActions/TableCellActions.js +15 -0
  29. package/lib/components/TableCellActions/TableCellActions.js.map +1 -0
  30. package/lib/components/TableCellActions/TableCellActions.types.js +2 -0
  31. package/lib/components/TableCellActions/TableCellActions.types.js.map +1 -0
  32. package/lib/components/TableCellActions/index.js +6 -0
  33. package/lib/components/TableCellActions/index.js.map +1 -0
  34. package/lib/components/TableCellActions/renderTableCellActions.js +16 -0
  35. package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -0
  36. package/lib/components/TableCellActions/useTableCellActions.js +24 -0
  37. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -0
  38. package/lib/components/TableCellActions/useTableCellActionsStyles.js +39 -0
  39. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
  40. package/lib/components/TableCellLayout/TableCellLayout.js +15 -0
  41. package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -0
  42. package/lib/components/TableCellLayout/TableCellLayout.types.js +2 -0
  43. package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -0
  44. package/lib/components/TableCellLayout/index.js +6 -0
  45. package/lib/components/TableCellLayout/index.js.map +1 -0
  46. package/lib/components/TableCellLayout/renderTableCellLayout.js +19 -0
  47. package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
  48. package/lib/components/TableCellLayout/useTableCellLayout.js +36 -0
  49. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -0
  50. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +74 -0
  51. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -0
  52. package/lib/components/TableHeader/useTableHeader.js +4 -2
  53. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  54. package/lib/components/TableHeader/useTableHeaderStyles.js +12 -2
  55. package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  56. package/lib/components/TableHeaderCell/useTableHeaderCell.js +4 -2
  57. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  58. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -9
  59. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  60. package/lib/components/TableRow/useTableRow.js +4 -2
  61. package/lib/components/TableRow/useTableRow.js.map +1 -1
  62. package/lib/components/TableRow/useTableRowStyles.js +9 -7
  63. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  64. package/lib/components/TableSelectionCell/TableSelectionCell.js +15 -0
  65. package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -0
  66. package/lib/components/TableSelectionCell/TableSelectionCell.types.js +2 -0
  67. package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -0
  68. package/lib/components/TableSelectionCell/index.js +6 -0
  69. package/lib/components/TableSelectionCell/index.js.map +1 -0
  70. package/lib/components/TableSelectionCell/renderTableSelectionCell.js +17 -0
  71. package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -0
  72. package/lib/components/TableSelectionCell/useTableSelectionCell.js +42 -0
  73. package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
  74. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +55 -0
  75. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
  76. package/lib/contexts/tableContext.js +7 -3
  77. package/lib/contexts/tableContext.js.map +1 -1
  78. package/lib/hooks/index.js +3 -0
  79. package/lib/hooks/index.js.map +1 -0
  80. package/lib/hooks/selectionManager.js +89 -0
  81. package/lib/hooks/selectionManager.js.map +1 -0
  82. package/lib/hooks/types.js +2 -0
  83. package/lib/hooks/types.js.map +1 -0
  84. package/lib/hooks/useSelection.js +47 -0
  85. package/lib/hooks/useSelection.js.map +1 -0
  86. package/lib/hooks/useSort.js +72 -0
  87. package/lib/hooks/useSort.js.map +1 -0
  88. package/lib/hooks/useTable.js +87 -0
  89. package/lib/hooks/useTable.js.map +1 -0
  90. package/lib/index.js +4 -0
  91. package/lib/index.js.map +1 -1
  92. package/lib/navigationModes/cell.js +250 -0
  93. package/lib/navigationModes/cell.js.map +1 -0
  94. package/lib/navigationModes/composite.js +208 -0
  95. package/lib/navigationModes/composite.js.map +1 -0
  96. package/lib/navigationModes/index.js +3 -0
  97. package/lib/navigationModes/index.js.map +1 -0
  98. package/lib/navigationModes/useNavigationMode.js +42 -0
  99. package/lib/navigationModes/useNavigationMode.js.map +1 -0
  100. package/lib-commonjs/TableCellActions.js +10 -0
  101. package/lib-commonjs/TableCellActions.js.map +1 -0
  102. package/lib-commonjs/TableCellLayout.js +10 -0
  103. package/lib-commonjs/TableCellLayout.js.map +1 -0
  104. package/lib-commonjs/TableCellPrimaryLayout.js +10 -0
  105. package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -0
  106. package/lib-commonjs/TableSelectionCell.js +10 -0
  107. package/lib-commonjs/TableSelectionCell.js.map +1 -0
  108. package/lib-commonjs/components/Table/useTableContextValues.js +8 -5
  109. package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
  110. package/lib-commonjs/components/Table/useTableStyles.js +8 -2
  111. package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
  112. package/lib-commonjs/components/TableBody/useTableBody.js +3 -1
  113. package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
  114. package/lib-commonjs/components/TableBody/useTableBodyStyles.js +10 -1
  115. package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
  116. package/lib-commonjs/components/TableCell/renderTableCell.js +2 -4
  117. package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
  118. package/lib-commonjs/components/TableCell/useTableCell.js +4 -4
  119. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  120. package/lib-commonjs/components/TableCell/useTableCellStyles.js +6 -20
  121. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  122. package/lib-commonjs/components/TableCellActions/TableCellActions.js +26 -0
  123. package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -0
  124. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js +6 -0
  125. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -0
  126. package/lib-commonjs/components/TableCellActions/index.js +18 -0
  127. package/lib-commonjs/components/TableCellActions/index.js.map +1 -0
  128. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js +27 -0
  129. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -0
  130. package/lib-commonjs/components/TableCellActions/useTableCellActions.js +35 -0
  131. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -0
  132. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +51 -0
  133. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
  134. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +26 -0
  135. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -0
  136. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js +6 -0
  137. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -0
  138. package/lib-commonjs/components/TableCellLayout/index.js +18 -0
  139. package/lib-commonjs/components/TableCellLayout/index.js.map +1 -0
  140. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js +30 -0
  141. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
  142. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +46 -0
  143. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -0
  144. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +85 -0
  145. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -0
  146. package/lib-commonjs/components/TableHeader/useTableHeader.js +4 -2
  147. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  148. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +11 -1
  149. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  150. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +4 -2
  151. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  152. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -9
  153. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  154. package/lib-commonjs/components/TableRow/useTableRow.js +4 -2
  155. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  156. package/lib-commonjs/components/TableRow/useTableRowStyles.js +10 -7
  157. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  158. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +26 -0
  159. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -0
  160. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js +6 -0
  161. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -0
  162. package/lib-commonjs/components/TableSelectionCell/index.js +18 -0
  163. package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -0
  164. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js +28 -0
  165. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -0
  166. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +56 -0
  167. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
  168. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +65 -0
  169. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
  170. package/lib-commonjs/contexts/tableContext.js +7 -3
  171. package/lib-commonjs/contexts/tableContext.js.map +1 -1
  172. package/lib-commonjs/hooks/index.js +12 -0
  173. package/lib-commonjs/hooks/index.js.map +1 -0
  174. package/lib-commonjs/hooks/selectionManager.js +98 -0
  175. package/lib-commonjs/hooks/selectionManager.js.map +1 -0
  176. package/lib-commonjs/hooks/types.js +6 -0
  177. package/lib-commonjs/hooks/types.js.map +1 -0
  178. package/lib-commonjs/hooks/useSelection.js +59 -0
  179. package/lib-commonjs/hooks/useSelection.js.map +1 -0
  180. package/lib-commonjs/hooks/useSort.js +82 -0
  181. package/lib-commonjs/hooks/useSort.js.map +1 -0
  182. package/lib-commonjs/hooks/useTable.js +99 -0
  183. package/lib-commonjs/hooks/useTable.js.map +1 -0
  184. package/lib-commonjs/index.js +110 -1
  185. package/lib-commonjs/index.js.map +1 -1
  186. package/lib-commonjs/navigationModes/cell.js +259 -0
  187. package/lib-commonjs/navigationModes/cell.js.map +1 -0
  188. package/lib-commonjs/navigationModes/composite.js +217 -0
  189. package/lib-commonjs/navigationModes/composite.js.map +1 -0
  190. package/lib-commonjs/navigationModes/index.js +16 -0
  191. package/lib-commonjs/navigationModes/index.js.map +1 -0
  192. package/lib-commonjs/navigationModes/useNavigationMode.js +55 -0
  193. package/lib-commonjs/navigationModes/useNavigationMode.js.map +1 -0
  194. package/package.json +9 -9
  195. package/dist/tsdoc-metadata.json +0 -11
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["hooks/useSort.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAUA,SAAgB,OAAhB,CAA+B,OAA/B,EAA6D;EAC3D,MAAM;IAAE,OAAF;IAAW,SAAX;IAAsB,gBAAtB;IAAwC;EAAxC,IAAyD,OAA/D;EAEA,MAAM,CAAC,MAAD,EAAS,SAAT,IAAsB,iBAAA,CAAA,oBAAA,CAAgC;IAC1D,YAAY,EAAE;MACZ,aAAa,EAAE,WADH;MAEZ,UAAU,EAAE;IAFA,CAD4C;IAK1D,YAAY,EAAE,gBAL4C;IAM1D,KAAK,EAAE;EANmD,CAAhC,CAA5B;EASA,MAAM;IAAE,UAAF;IAAc;EAAd,IAAgC,MAAtC;;EAEA,MAAM,gBAAgB,GAAI,QAAD,IAAmC;IAC1D,SAAS,CAAC,CAAC,IAAG;MACZ,MAAM,QAAQ,GAAG,EAAE,GAAG,CAAL;QAAQ,UAAU,EAAE;MAApB,CAAjB;;MACA,IAAI,CAAC,CAAC,UAAF,KAAiB,QAArB,EAA+B;QAC7B,QAAQ,CAAC,aAAT,GAAyB,CAAC,CAAC,aAAF,KAAoB,WAApB,GAAkC,YAAlC,GAAiD,WAA1E;MACD,CAFD,MAEO;QACL,QAAQ,CAAC,aAAT,GAAyB,WAAzB;M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fluentui/react-utilities';\nimport type { ColumnDefinition, ColumnId, OnSortChangeCallback, SortState, TableSortStateInternal } from './types';\n\ninterface UseSortOptions<TItem> {\n columns: ColumnDefinition<TItem>[];\n sortState?: SortState;\n defaultSortState?: SortState;\n onSortChange?: OnSortChangeCallback;\n}\n\nexport function useSort<TItem>(options: UseSortOptions<TItem>): TableSortStateInternal<TItem> {\n const { columns, sortState, defaultSortState, onSortChange } = options;\n\n const [sorted, setSorted] = useControllableState<SortState>({\n initialState: {\n sortDirection: 'ascending' as const,\n sortColumn: undefined,\n },\n defaultState: defaultSortState,\n state: sortState,\n });\n\n const { sortColumn, sortDirection } = sorted;\n\n const toggleColumnSort = (columnId: ColumnId | undefined) => {\n setSorted(s => {\n const newState = { ...s, sortColumn: columnId };\n if (s.sortColumn === columnId) {\n newState.sortDirection = s.sortDirection === 'ascending' ? 'descending' : 'ascending';\n } else {\n newState.sortDirection = 'ascending';\n }\n\n onSortChange?.(newState);\n return newState;\n });\n };\n\n const setColumnSort: TableSortStateInternal<TItem>['setColumnSort'] = (nextSortColumn, nextSortDirection) => {\n const newState = { sortColumn: nextSortColumn, sortDirection: nextSortDirection };\n onSortChange?.(newState);\n setSorted(newState);\n };\n\n const sort = (items: TItem[]) =>\n items.slice().sort((a, b) => {\n const sortColumnDef = columns.find(column => column.columnId === sortColumn);\n if (!sortColumnDef?.compare) {\n return 0;\n }\n\n const mod = sortDirection === 'ascending' ? 1 : -1;\n return sortColumnDef.compare(a, b) * mod;\n });\n\n const getSortDirection: TableSortStateInternal<TItem>['getSortDirection'] = (columnId: ColumnId) => {\n return sortColumn === columnId ? sortDirection : undefined;\n };\n\n return {\n sortColumn,\n sortDirection,\n sort,\n setColumnSort,\n toggleColumnSort,\n getSortDirection,\n };\n}\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const useSelection_1 = /*#__PURE__*/require("./useSelection");
11
+
12
+ const useSort_1 = /*#__PURE__*/require("./useSort");
13
+
14
+ function useTable(options) {
15
+ const {
16
+ items: baseItems,
17
+ columns,
18
+ getRowId: getUserRowId = () => undefined,
19
+ selectionMode = 'multiselect',
20
+ rowEnhancer = row => row,
21
+ defaultSelectedRows,
22
+ selectedRows: userSelectedRows,
23
+ onSelectionChange,
24
+ sortState: userSortState,
25
+ defaultSortState,
26
+ onSortChange
27
+ } = options;
28
+ const getRowId = React.useCallback((item, index) => {
29
+ var _a;
30
+
31
+ return (_a = getUserRowId(item)) !== null && _a !== void 0 ? _a : index;
32
+ }, [getUserRowId]);
33
+ const {
34
+ sortColumn,
35
+ sortDirection,
36
+ toggleColumnSort,
37
+ setColumnSort,
38
+ getSortDirection,
39
+ sort
40
+ } = useSort_1.useSort({
41
+ columns,
42
+ sortState: userSortState,
43
+ defaultSortState,
44
+ onSortChange
45
+ });
46
+ const sortState = React.useMemo(() => ({
47
+ sortColumn,
48
+ sortDirection,
49
+ setColumnSort,
50
+ toggleColumnSort,
51
+ getSortDirection
52
+ }), [sortColumn, sortDirection, setColumnSort, toggleColumnSort, getSortDirection]);
53
+ const {
54
+ isRowSelected,
55
+ toggleRow,
56
+ toggleAllRows,
57
+ clearRows,
58
+ selectedRows,
59
+ allRowsSelected,
60
+ someRowsSelected,
61
+ selectRow,
62
+ deselectRow
63
+ } = useSelection_1.useSelection({
64
+ selectionMode,
65
+ items: baseItems,
66
+ getRowId,
67
+ defaultSelectedItems: defaultSelectedRows,
68
+ selectedItems: userSelectedRows,
69
+ onSelectionChange
70
+ });
71
+ const selectionState = React.useMemo(() => ({
72
+ isRowSelected,
73
+ clearRows,
74
+ deselectRow,
75
+ selectRow,
76
+ toggleAllRows,
77
+ toggleRow,
78
+ selectedRows: Array.from(selectedRows),
79
+ allRowsSelected,
80
+ someRowsSelected
81
+ }), [isRowSelected, clearRows, deselectRow, selectRow, toggleAllRows, toggleRow, selectedRows, allRowsSelected, someRowsSelected]);
82
+ const rows = React.useMemo(() => sort(baseItems).map((item, i) => {
83
+ return rowEnhancer({
84
+ item,
85
+ rowId: getRowId(item, i)
86
+ }, {
87
+ selection: selectionState,
88
+ sort: sortState
89
+ });
90
+ }), [baseItems, getRowId, sort, rowEnhancer, selectionState, sortState]);
91
+ return {
92
+ rows,
93
+ selection: selectionState,
94
+ sort: sortState
95
+ };
96
+ }
97
+
98
+ exports.useTable = useTable;
99
+ //# sourceMappingURL=useTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["hooks/useTable.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AASA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAEA,SAAgB,QAAhB,CACE,OADF,EAC4C;EAE1C,MAAM;IACJ,KAAK,EAAE,SADH;IAEJ,OAFI;IAGJ,QAAQ,EAAE,YAAY,GAAG,MAAM,SAH3B;IAIJ,aAAa,GAAG,aAJZ;IAKJ,WAAW,GAAI,GAAD,IAA0B,GALpC;IAMJ,mBANI;IAOJ,YAAY,EAAE,gBAPV;IAQJ,iBARI;IASJ,SAAS,EAAE,aATP;IAUJ,gBAVI;IAWJ;EAXI,IAYF,OAZJ;EAcA,MAAM,QAAQ,GAA4B,KAAK,CAAC,WAAN,CACxC,CAAC,IAAD,EAAc,KAAd,KAA+B;IAAA,IAAA,EAAA;;IAAC,OAAA,CAAA,EAAA,GAAA,YAAY,CAAC,IAAD,CAAZ,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,EAAlB,GAAsB,KAAtB;EAA2B,CADnB,EAExC,CAAC,YAAD,CAFwC,CAA1C;EAIA,MAAM;IAAE,UAAF;IAAc,aAAd;IAA6B,gBAA7B;IAA+C,aAA/C;IAA8D,gBAA9D;I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AAnC,CALgB,CAAlB;EAOD,CARD,CAFS,EAWX,CAAC,SAAD,EAAY,QAAZ,EAAsB,IAAtB,EAA4B,WAA5B,EAAyC,cAAzC,EAAyD,SAAzD,CAXW,CAAb;EAcA,OAAO;IACL,IADK;IAEL,SAAS,EAAE,cAFN;IAGL,IAAI,EAAE;EAHD,CAAP;AAKD;;AArGD,OAAA,CAAA,QAAA,GAAA,QAAA","sourcesContent":["import * as React from 'react';\nimport type {\n UseTableOptions,\n TableState,\n RowState,\n TableSelectionState,\n TableSortState,\n GetRowIdInternal,\n} from './types';\nimport { useSelection } from './useSelection';\nimport { useSort } from './useSort';\n\nexport function useTable<TItem, TRowState extends RowState<TItem> = RowState<TItem>>(\n options: UseTableOptions<TItem, TRowState>,\n): TableState<TItem, TRowState> {\n const {\n items: baseItems,\n columns,\n getRowId: getUserRowId = () => undefined,\n selectionMode = 'multiselect',\n rowEnhancer = (row: RowState<TItem>) => row as TRowState,\n defaultSelectedRows,\n selectedRows: userSelectedRows,\n onSelectionChange,\n sortState: userSortState,\n defaultSortState,\n onSortChange,\n } = options;\n\n const getRowId: GetRowIdInternal<TItem> = React.useCallback(\n (item: TItem, index: number) => getUserRowId(item) ?? index,\n [getUserRowId],\n );\n const { sortColumn, sortDirection, toggleColumnSort, setColumnSort, getSortDirection, sort } = useSort({\n columns,\n sortState: userSortState,\n defaultSortState,\n onSortChange,\n });\n const sortState: TableSortState = React.useMemo(\n () => ({\n sortColumn,\n sortDirection,\n setColumnSort,\n toggleColumnSort,\n getSortDirection,\n }),\n [sortColumn, sortDirection, setColumnSort, toggleColumnSort, getSortDirection],\n );\n\n const {\n isRowSelected,\n toggleRow,\n toggleAllRows,\n clearRows,\n selectedRows,\n allRowsSelected,\n someRowsSelected,\n selectRow,\n deselectRow,\n } = useSelection({\n selectionMode,\n items: baseItems,\n getRowId,\n defaultSelectedItems: defaultSelectedRows,\n selectedItems: userSelectedRows,\n onSelectionChange,\n });\n\n const selectionState: TableSelectionState = React.useMemo(\n () => ({\n isRowSelected,\n clearRows,\n deselectRow,\n selectRow,\n toggleAllRows,\n toggleRow,\n selectedRows: Array.from(selectedRows),\n allRowsSelected,\n someRowsSelected,\n }),\n [\n isRowSelected,\n clearRows,\n deselectRow,\n selectRow,\n toggleAllRows,\n toggleRow,\n selectedRows,\n allRowsSelected,\n someRowsSelected,\n ],\n );\n\n const rows = React.useMemo(\n () =>\n sort(baseItems).map((item, i) => {\n return rowEnhancer(\n {\n item,\n rowId: getRowId(item, i),\n },\n { selection: selectionState, sort: sortState },\n );\n }),\n [baseItems, getRowId, sort, rowEnhancer, selectionState, sortState],\n );\n\n return {\n rows,\n selection: selectionState,\n sort: sortState,\n };\n}\n"],"sourceRoot":"../src/"}
@@ -3,7 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useTableContext = exports.TableContextProvider = exports.renderTableHeaderCell_unstable = exports.useTableHeaderCell_unstable = exports.useTableHeaderCellStyles_unstable = exports.tableHeaderCellClassNames = exports.tableHeaderCellClassName = exports.TableHeaderCell = exports.renderTableHeader_unstable = exports.useTableHeader_unstable = exports.useTableHeaderStyles_unstable = exports.tableHeaderClassName = exports.tableHeaderClassNames = exports.TableHeader = exports.renderTable_unstable = exports.useTable_unstable = exports.useTableStyles_unstable = exports.tableClassNames = exports.tableClassName = exports.Table = exports.renderTableBody_unstable = exports.useTableBody_unstable = exports.useTableBodyStyles_unstable = exports.tableBodyClassNames = exports.tableBodyClassName = exports.TableBody = exports.renderTableRow_unstable = exports.useTableRow_unstable = exports.useTableRowStyles_unstable = exports.tableRowClassName = exports.tableRowClassNames = exports.TableRow = exports.renderTableCell_unstable = exports.useTableCell_unstable = exports.useTableCellStyles_unstable = exports.tableCellClassName = exports.tableCellClassNames = exports.TableCell = void 0;
6
+ exports.TableCellLayout = exports.renderTableCellActions_unstable = exports.useTableCellActions_unstable = exports.useTableCellActionsStyles_unstable = exports.tableCellActionsClassNames = exports.TableCellActions = exports.tableSelectionCellClassNames = exports.renderTableSelectionCell_unstable = exports.useTableSelectionCell_unstable = exports.useTableSelectionCellStyles_unstable = exports.TableSelectionCell = exports.useTableContext = exports.TableContextProvider = exports.renderTableHeaderCell_unstable = exports.useTableHeaderCell_unstable = exports.useTableHeaderCellStyles_unstable = exports.tableHeaderCellClassNames = exports.tableHeaderCellClassName = exports.TableHeaderCell = exports.renderTableHeader_unstable = exports.useTableHeader_unstable = exports.useTableHeaderStyles_unstable = exports.tableHeaderClassName = exports.tableHeaderClassNames = exports.TableHeader = exports.renderTable_unstable = exports.useTable_unstable = exports.useTableStyles_unstable = exports.tableClassNames = exports.tableClassName = exports.Table = exports.renderTableBody_unstable = exports.useTableBody_unstable = exports.useTableBodyStyles_unstable = exports.tableBodyClassNames = exports.tableBodyClassName = exports.TableBody = exports.renderTableRow_unstable = exports.useTableRow_unstable = exports.useTableRowStyles_unstable = exports.tableRowClassName = exports.tableRowClassNames = exports.TableRow = exports.renderTableCell_unstable = exports.useTableCell_unstable = exports.useTableCellStyles_unstable = exports.tableCellClassName = exports.tableCellClassNames = exports.TableCell = exports.useTable = void 0;
7
+ exports.renderTableCellLayout_unstable = exports.useTableCellLayout_unstable = exports.useTableCellLayoutStyles_unstable = exports.tableCellLayoutClassNames = void 0;
8
+
9
+ var hooks_1 = /*#__PURE__*/require("./hooks");
10
+
11
+ Object.defineProperty(exports, "useTable", {
12
+ enumerable: true,
13
+ get: function () {
14
+ return hooks_1.useTable;
15
+ }
16
+ });
7
17
 
8
18
  var TableCell_1 = /*#__PURE__*/require("./TableCell");
9
19
 
@@ -253,4 +263,103 @@ Object.defineProperty(exports, "useTableContext", {
253
263
  return tableContext_1.useTableContext;
254
264
  }
255
265
  });
266
+
267
+ var TableSelectionCell_1 = /*#__PURE__*/require("./TableSelectionCell");
268
+
269
+ Object.defineProperty(exports, "TableSelectionCell", {
270
+ enumerable: true,
271
+ get: function () {
272
+ return TableSelectionCell_1.TableSelectionCell;
273
+ }
274
+ });
275
+ Object.defineProperty(exports, "useTableSelectionCellStyles_unstable", {
276
+ enumerable: true,
277
+ get: function () {
278
+ return TableSelectionCell_1.useTableSelectionCellStyles_unstable;
279
+ }
280
+ });
281
+ Object.defineProperty(exports, "useTableSelectionCell_unstable", {
282
+ enumerable: true,
283
+ get: function () {
284
+ return TableSelectionCell_1.useTableSelectionCell_unstable;
285
+ }
286
+ });
287
+ Object.defineProperty(exports, "renderTableSelectionCell_unstable", {
288
+ enumerable: true,
289
+ get: function () {
290
+ return TableSelectionCell_1.renderTableSelectionCell_unstable;
291
+ }
292
+ });
293
+ Object.defineProperty(exports, "tableSelectionCellClassNames", {
294
+ enumerable: true,
295
+ get: function () {
296
+ return TableSelectionCell_1.tableSelectionCellClassNames;
297
+ }
298
+ });
299
+
300
+ var TableCellActions_1 = /*#__PURE__*/require("./TableCellActions");
301
+
302
+ Object.defineProperty(exports, "TableCellActions", {
303
+ enumerable: true,
304
+ get: function () {
305
+ return TableCellActions_1.TableCellActions;
306
+ }
307
+ });
308
+ Object.defineProperty(exports, "tableCellActionsClassNames", {
309
+ enumerable: true,
310
+ get: function () {
311
+ return TableCellActions_1.tableCellActionsClassNames;
312
+ }
313
+ });
314
+ Object.defineProperty(exports, "useTableCellActionsStyles_unstable", {
315
+ enumerable: true,
316
+ get: function () {
317
+ return TableCellActions_1.useTableCellActionsStyles_unstable;
318
+ }
319
+ });
320
+ Object.defineProperty(exports, "useTableCellActions_unstable", {
321
+ enumerable: true,
322
+ get: function () {
323
+ return TableCellActions_1.useTableCellActions_unstable;
324
+ }
325
+ });
326
+ Object.defineProperty(exports, "renderTableCellActions_unstable", {
327
+ enumerable: true,
328
+ get: function () {
329
+ return TableCellActions_1.renderTableCellActions_unstable;
330
+ }
331
+ });
332
+
333
+ var TableCellLayout_1 = /*#__PURE__*/require("./TableCellLayout");
334
+
335
+ Object.defineProperty(exports, "TableCellLayout", {
336
+ enumerable: true,
337
+ get: function () {
338
+ return TableCellLayout_1.TableCellLayout;
339
+ }
340
+ });
341
+ Object.defineProperty(exports, "tableCellLayoutClassNames", {
342
+ enumerable: true,
343
+ get: function () {
344
+ return TableCellLayout_1.tableCellLayoutClassNames;
345
+ }
346
+ });
347
+ Object.defineProperty(exports, "useTableCellLayoutStyles_unstable", {
348
+ enumerable: true,
349
+ get: function () {
350
+ return TableCellLayout_1.useTableCellLayoutStyles_unstable;
351
+ }
352
+ });
353
+ Object.defineProperty(exports, "useTableCellLayout_unstable", {
354
+ enumerable: true,
355
+ get: function () {
356
+ return TableCellLayout_1.useTableCellLayout_unstable;
357
+ }
358
+ });
359
+ Object.defineProperty(exports, "renderTableCellLayout_unstable", {
360
+ enumerable: true,
361
+ get: function () {
362
+ return TableCellLayout_1.renderTableCellLayout_unstable;
363
+ }
364
+ });
256
365
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,WAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,SAAA;EAAS;AAAT,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,2BAAA;EAA2B;AAA3B,CAAA;AACA,MAAA,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,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,2BAAA;EAA2B;AAA3B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA;;AAIF,IAAA,cAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,cAAA,CAAA,oBAAA;EAAoB;AAApB,CAAA;AAAsB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,cAAA,CAAA,eAAA;EAAe;AAAf,CAAA","sourcesContent":["export {\n TableCell,\n tableCellClassNames,\n tableCellClassName,\n useTableCellStyles_unstable,\n useTableCell_unstable,\n renderTableCell_unstable,\n} from './TableCell';\nexport type { TableCellProps, TableCellState, TableCellSlots } from './TableCell';\n\nexport {\n TableRow,\n tableRowClassNames,\n tableRowClassName,\n useTableRowStyles_unstable,\n useTableRow_unstable,\n renderTableRow_unstable,\n} from './TableRow';\nexport type { TableRowProps, TableRowState, TableRowSlots } from './TableRow';\n\nexport {\n TableBody,\n tableBodyClassName,\n tableBodyClassNames,\n useTableBodyStyles_unstable,\n useTableBody_unstable,\n renderTableBody_unstable,\n} from './TableBody';\nexport type { TableBodyProps, TableBodyState, TableBodySlots } from './TableBody';\n\nexport {\n Table,\n tableClassName,\n tableClassNames,\n useTableStyles_unstable,\n useTable_unstable,\n renderTable_unstable,\n} from './Table';\nexport type { TableProps, TableSlots, TableState, TableContextValue, TableContextValues, SortDirection } from './Table';\n\nexport {\n TableHeader,\n tableHeaderClassNames,\n tableHeaderClassName,\n useTableHeaderStyles_unstable,\n useTableHeader_unstable,\n renderTableHeader_unstable,\n} from './TableHeader';\nexport type { TableHeaderProps, TableHeaderSlots, TableHeaderState } from './TableHeader';\n\nexport {\n TableHeaderCell,\n tableHeaderCellClassName,\n tableHeaderCellClassNames,\n useTableHeaderCellStyles_unstable,\n useTableHeaderCell_unstable,\n renderTableHeaderCell_unstable,\n} from './TableHeaderCell';\nexport type { TableHeaderCellProps, TableHeaderCellSlots, TableHeaderCellState } from './TableHeaderCell';\n\nexport { TableContextProvider, useTableContext } from './contexts/tableContext';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,UAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,QAAA;EAAQ;AAAR,CAAA;;AAWT,IAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,WAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,SAAA;EAAS;AAAT,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,WAAA,CAA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eAAA;EAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,iCAAA;EAAiC;AAAjC,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,2BAAA;EAA2B;AAA3B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,iBAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA","sourcesContent":["export { useTable } from './hooks';\nexport type {\n UseTableOptions,\n TableSelectionState,\n TableSortState,\n ColumnDefinition,\n RowState,\n RowId,\n ColumnId,\n} from './hooks';\n\nexport {\n TableCell,\n tableCellClassNames,\n tableCellClassName,\n useTableCellStyles_unstable,\n useTableCell_unstable,\n renderTableCell_unstable,\n} from './TableCell';\nexport type { TableCellProps, TableCellState, TableCellSlots } from './TableCell';\n\nexport {\n TableRow,\n tableRowClassNames,\n tableRowClassName,\n useTableRowStyles_unstable,\n useTableRow_unstable,\n renderTableRow_unstable,\n} from './TableRow';\nexport type { TableRowProps, TableRowState, TableRowSlots } from './TableRow';\n\nexport {\n TableBody,\n tableBodyClassName,\n tableBodyClassNames,\n useTableBodyStyles_unstable,\n useTableBody_unstable,\n renderTableBody_unstable,\n} from './TableBody';\nexport type { TableBodyProps, TableBodyState, TableBodySlots } from './TableBody';\n\nexport {\n Table,\n tableClassName,\n tableClassNames,\n useTableStyles_unstable,\n useTable_unstable,\n renderTable_unstable,\n} from './Table';\nexport type { TableProps, TableSlots, TableState, TableContextValue, TableContextValues, SortDirection } from './Table';\n\nexport {\n TableHeader,\n tableHeaderClassNames,\n tableHeaderClassName,\n useTableHeaderStyles_unstable,\n useTableHeader_unstable,\n renderTableHeader_unstable,\n} from './TableHeader';\nexport type { TableHeaderProps, TableHeaderSlots, TableHeaderState } from './TableHeader';\n\nexport {\n TableHeaderCell,\n tableHeaderCellClassName,\n tableHeaderCellClassNames,\n useTableHeaderCellStyles_unstable,\n useTableHeaderCell_unstable,\n renderTableHeaderCell_unstable,\n} from './TableHeaderCell';\nexport type { TableHeaderCellProps, TableHeaderCellSlots, TableHeaderCellState } from './TableHeaderCell';\n\nexport { TableContextProvider, useTableContext } from './contexts/tableContext';\nexport {\n TableSelectionCell,\n useTableSelectionCellStyles_unstable,\n useTableSelectionCell_unstable,\n renderTableSelectionCell_unstable,\n tableSelectionCellClassNames,\n} from './TableSelectionCell';\n\nexport type { TableSelectionCellProps, TableSelectionCellState, TableSelectionCellSlots } from './TableSelectionCell';\nexport {\n TableCellActions,\n tableCellActionsClassNames,\n useTableCellActionsStyles_unstable,\n useTableCellActions_unstable,\n renderTableCellActions_unstable,\n} from './TableCellActions';\n\nexport type { TableCellActionsProps, TableCellActionsSlots, TableCellActionsState } from './TableCellActions';\nexport {\n TableCellLayout,\n tableCellLayoutClassNames,\n useTableCellLayoutStyles_unstable,\n useTableCellLayout_unstable,\n renderTableCellLayout_unstable,\n} from './TableCellLayout';\nexport type { TableCellLayoutProps, TableCellLayoutSlots, TableCellLayoutState } from './TableCellLayout';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.applyCellNavigation = void 0;
7
+
8
+ function applyCellNavigation(element) {
9
+ const container = element;
10
+ let column = 0;
11
+ let mode = undefined;
12
+ let movingOut = false;
13
+ const pre = document.createElement('div');
14
+ const post = document.createElement('div');
15
+
16
+ if (!pre || !post) {
17
+ return;
18
+ }
19
+
20
+ pre.tabIndex = 0;
21
+ post.tabIndex = 0;
22
+ pre.addEventListener('focus', () => {
23
+ if (movingOut) {
24
+ movingOut = false;
25
+ return;
26
+ } else {
27
+ treeWalker.currentNode = container;
28
+ const candidate = treeWalker.nextNode();
29
+
30
+ if (isHTMLElement(candidate)) {
31
+ column = 0;
32
+ candidate.focus();
33
+ }
34
+ }
35
+ });
36
+ post.addEventListener('focus', () => {
37
+ if (movingOut) {
38
+ movingOut = false;
39
+ return;
40
+ } else {
41
+ treeWalker.currentNode = post;
42
+ const candidate = treeWalker.previousNode();
43
+
44
+ if (isHTMLElement(candidate)) {
45
+ column = findColumnCount(candidate);
46
+ candidate.focus();
47
+ }
48
+ }
49
+ });
50
+ container.before(pre);
51
+ container.after(post);
52
+
53
+ const acceptNode = node => {
54
+ if (!isHTMLElement(node)) {
55
+ return NodeFilter.FILTER_SKIP;
56
+ }
57
+
58
+ if (mode === 'column') {
59
+ return acceptCell(node);
60
+ }
61
+
62
+ if (mode === 'row') {
63
+ return acceptRow(node);
64
+ }
65
+
66
+ if (node.tabIndex >= 0) {
67
+ return NodeFilter.FILTER_ACCEPT;
68
+ }
69
+
70
+ return NodeFilter.FILTER_SKIP;
71
+ };
72
+
73
+ const acceptCell = node => {
74
+ if (isRow(node)) {
75
+ return NodeFilter.FILTER_REJECT;
76
+ }
77
+
78
+ if (node.tabIndex < 0) {
79
+ return NodeFilter.FILTER_SKIP;
80
+ }
81
+
82
+ return NodeFilter.FILTER_ACCEPT;
83
+ };
84
+
85
+ const acceptRow = node => {
86
+ if (isRow(node)) {
87
+ return NodeFilter.FILTER_ACCEPT;
88
+ }
89
+
90
+ return NodeFilter.FILTER_SKIP;
91
+ };
92
+
93
+ const treeWalker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
94
+ acceptNode
95
+ });
96
+
97
+ const up = current => {
98
+ mode = 'row';
99
+ treeWalker.currentNode = current;
100
+ treeWalker.previousNode(); // current row
101
+
102
+ const row = treeWalker.previousNode();
103
+
104
+ if (!row) {
105
+ return null;
106
+ }
107
+
108
+ mode = 'column';
109
+ treeWalker.currentNode = row;
110
+ let curCol = 0;
111
+ let node = null;
112
+
113
+ while (curCol <= column) {
114
+ node = treeWalker.nextNode();
115
+ curCol++;
116
+ }
117
+
118
+ if (isHTMLElement(node)) {
119
+ return node;
120
+ }
121
+
122
+ return null;
123
+ };
124
+
125
+ const down = current => {
126
+ mode = 'row';
127
+ treeWalker.currentNode = current;
128
+ const row = treeWalker.nextNode();
129
+
130
+ if (!row) {
131
+ return null;
132
+ }
133
+
134
+ mode = 'column';
135
+ treeWalker.currentNode = row;
136
+ let curCol = 0;
137
+ let node = null;
138
+
139
+ while (curCol <= column) {
140
+ node = treeWalker.nextNode();
141
+ curCol++;
142
+ }
143
+
144
+ if (isHTMLElement(node)) {
145
+ return node;
146
+ }
147
+
148
+ return null;
149
+ };
150
+
151
+ const left = current => {
152
+ treeWalker.currentNode = current;
153
+ mode = 'column';
154
+ const node = treeWalker.previousNode();
155
+
156
+ if (isHTMLElement(node)) {
157
+ column--;
158
+ return node;
159
+ }
160
+
161
+ return null;
162
+ };
163
+
164
+ const right = current => {
165
+ mode = 'column';
166
+ treeWalker.currentNode = current;
167
+ const node = treeWalker.nextNode();
168
+
169
+ if (isHTMLElement(node)) {
170
+ column++;
171
+ return node;
172
+ }
173
+
174
+ return null;
175
+ };
176
+
177
+ const onKeyDown = e => {
178
+ const target = e.target;
179
+
180
+ if (!target || !isHTMLElement(target)) {
181
+ return;
182
+ }
183
+
184
+ let next = null;
185
+
186
+ switch (e.key) {
187
+ case 'ArrowDown':
188
+ next = down(target);
189
+ break;
190
+
191
+ case 'ArrowUp':
192
+ next = up(target);
193
+ break;
194
+
195
+ case 'ArrowLeft':
196
+ next = left(target);
197
+ break;
198
+
199
+ case 'ArrowRight':
200
+ next = right(target);
201
+ break;
202
+
203
+ case 'Tab':
204
+ movingOut = true;
205
+
206
+ if (e.shiftKey) {
207
+ pre.focus();
208
+ } else {
209
+ post.focus();
210
+ }
211
+
212
+ break;
213
+
214
+ default:
215
+ return;
216
+ }
217
+
218
+ if (next) {
219
+ e.preventDefault();
220
+ next.focus();
221
+ }
222
+ };
223
+
224
+ const onFocusOut = () => {
225
+ mode = undefined;
226
+ };
227
+
228
+ container.addEventListener('keydown', onKeyDown);
229
+ container.addEventListener('focusout', onFocusOut);
230
+ return () => {
231
+ container.removeEventListener('focusout', onFocusOut);
232
+ container.removeEventListener('keydown', onKeyDown);
233
+ };
234
+ }
235
+
236
+ exports.applyCellNavigation = applyCellNavigation;
237
+
238
+ function isHTMLElement(node) {
239
+ return node instanceof HTMLElement;
240
+ }
241
+
242
+ function isRow(element) {
243
+ if (element.getAttribute('role') === 'row' || element.tagName === 'TR') {
244
+ return true;
245
+ }
246
+
247
+ return false;
248
+ }
249
+
250
+ function findColumnCount(node) {
251
+ let cur = node;
252
+
253
+ while (cur.parentElement && !isRow(cur)) {
254
+ cur = cur.parentElement;
255
+ }
256
+
257
+ return cur.querySelectorAll('[role="cell"], [role="gridcell"], td').length - 1;
258
+ }
259
+ //# sourceMappingURL=cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["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,I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["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":"../src/"}