@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.
- package/CHANGELOG.json +135 -4
- package/CHANGELOG.md +31 -5
- package/dist/index.d.ts +312 -21
- 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/TableSelectionCell.js +2 -0
- package/lib/TableSelectionCell.js.map +1 -0
- package/lib/components/Table/Table.types.js.map +1 -1
- package/lib/components/Table/useTableContextValues.js +7 -5
- package/lib/components/Table/useTableContextValues.js.map +1 -1
- package/lib/components/Table/useTableStyles.js +7 -2
- package/lib/components/Table/useTableStyles.js.map +1 -1
- package/lib/components/TableBody/useTableBody.js +3 -1
- package/lib/components/TableBody/useTableBody.js.map +1 -1
- package/lib/components/TableBody/useTableBodyStyles.js +12 -2
- package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
- package/lib/components/TableCell/TableCell.types.js.map +1 -1
- package/lib/components/TableCell/renderTableCell.js +2 -4
- package/lib/components/TableCell/renderTableCell.js.map +1 -1
- package/lib/components/TableCell/useTableCell.js +5 -5
- package/lib/components/TableCell/useTableCell.js.map +1 -1
- package/lib/components/TableCell/useTableCellStyles.js +6 -20
- package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
- 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 +24 -0
- package/lib/components/TableCellActions/useTableCellActions.js.map +1 -0
- package/lib/components/TableCellActions/useTableCellActionsStyles.js +39 -0
- package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
- package/lib/components/TableCellLayout/TableCellLayout.js +15 -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 +19 -0
- package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
- package/lib/components/TableCellLayout/useTableCellLayout.js +36 -0
- package/lib/components/TableCellLayout/useTableCellLayout.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/useTableHeader.js +4 -2
- package/lib/components/TableHeader/useTableHeader.js.map +1 -1
- package/lib/components/TableHeader/useTableHeaderStyles.js +12 -2
- package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +4 -2
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -9
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib/components/TableRow/useTableRow.js +4 -2
- package/lib/components/TableRow/useTableRow.js.map +1 -1
- package/lib/components/TableRow/useTableRowStyles.js +9 -7
- package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
- 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 +42 -0
- package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +55 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
- package/lib/contexts/tableContext.js +7 -3
- package/lib/contexts/tableContext.js.map +1 -1
- package/lib/hooks/index.js +3 -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 +47 -0
- package/lib/hooks/useSelection.js.map +1 -0
- package/lib/hooks/useSort.js +72 -0
- package/lib/hooks/useSort.js.map +1 -0
- package/lib/hooks/useTable.js +87 -0
- package/lib/hooks/useTable.js.map +1 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- 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/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/TableSelectionCell.js +10 -0
- package/lib-commonjs/TableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/Table/useTableContextValues.js +8 -5
- package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
- package/lib-commonjs/components/Table/useTableStyles.js +8 -2
- package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
- package/lib-commonjs/components/TableBody/useTableBody.js +3 -1
- package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js +10 -1
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
- package/lib-commonjs/components/TableCell/renderTableCell.js +2 -4
- package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
- package/lib-commonjs/components/TableCell/useTableCell.js +4 -4
- package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
- package/lib-commonjs/components/TableCell/useTableCellStyles.js +6 -20
- package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
- 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 +35 -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 +26 -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 +30 -0
- package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +46 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.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/useTableHeader.js +4 -2
- package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +11 -1
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +4 -2
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -9
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRow.js +4 -2
- package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.js +10 -7
- package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
- 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 +56 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +65 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
- package/lib-commonjs/contexts/tableContext.js +7 -3
- package/lib-commonjs/contexts/tableContext.js.map +1 -1
- package/lib-commonjs/hooks/index.js +12 -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 +59 -0
- package/lib-commonjs/hooks/useSelection.js.map +1 -0
- package/lib-commonjs/hooks/useSort.js +82 -0
- package/lib-commonjs/hooks/useSort.js.map +1 -0
- package/lib-commonjs/hooks/useTable.js +99 -0
- package/lib-commonjs/hooks/useTable.js.map +1 -0
- package/lib-commonjs/index.js +110 -1
- package/lib-commonjs/index.js.map +1 -1
- 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 +9 -9
- package/dist/tsdoc-metadata.json +0 -11
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export function applyCompositeNavigation(element) {
|
|
2
|
+
const container = element;
|
|
3
|
+
let mode = 'row';
|
|
4
|
+
let movingOut = false;
|
|
5
|
+
const pre = document.createElement('div');
|
|
6
|
+
const post = document.createElement('div');
|
|
7
|
+
|
|
8
|
+
if (!pre || !post) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
pre.tabIndex = 0;
|
|
13
|
+
post.tabIndex = 0;
|
|
14
|
+
pre.addEventListener('focus', () => {
|
|
15
|
+
if (movingOut) {
|
|
16
|
+
movingOut = false;
|
|
17
|
+
return;
|
|
18
|
+
} else {
|
|
19
|
+
treeWalker.currentNode = container;
|
|
20
|
+
mode = 'row';
|
|
21
|
+
const candidate = treeWalker.nextNode();
|
|
22
|
+
|
|
23
|
+
if (isHTMLElement(candidate)) {
|
|
24
|
+
candidate.focus();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
post.addEventListener('focus', () => {
|
|
29
|
+
if (movingOut) {
|
|
30
|
+
movingOut = false;
|
|
31
|
+
return;
|
|
32
|
+
} else {
|
|
33
|
+
treeWalker.currentNode = post;
|
|
34
|
+
mode = 'row';
|
|
35
|
+
const candidate = treeWalker.previousNode();
|
|
36
|
+
|
|
37
|
+
if (isHTMLElement(candidate)) {
|
|
38
|
+
candidate.focus();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
container.before(pre);
|
|
43
|
+
container.after(post);
|
|
44
|
+
|
|
45
|
+
const acceptNode = node => {
|
|
46
|
+
if (!isHTMLElement(node)) {
|
|
47
|
+
return NodeFilter.FILTER_SKIP;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!isCell(node) && !isRow(node)) {
|
|
51
|
+
return NodeFilter.FILTER_SKIP;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (mode === 'column' && isRow(node)) {
|
|
55
|
+
return NodeFilter.FILTER_REJECT;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (mode === 'row' && isCell(node)) {
|
|
59
|
+
return NodeFilter.FILTER_REJECT;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (node.tabIndex < 0) {
|
|
63
|
+
return NodeFilter.FILTER_SKIP;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const treeWalker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
70
|
+
acceptNode
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const up = current => {
|
|
74
|
+
const prevMode = mode;
|
|
75
|
+
mode = 'row';
|
|
76
|
+
treeWalker.currentNode = current;
|
|
77
|
+
|
|
78
|
+
if (prevMode === 'column') {
|
|
79
|
+
treeWalker.previousNode();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const node = treeWalker.previousNode();
|
|
83
|
+
|
|
84
|
+
if (isHTMLElement(node)) {
|
|
85
|
+
return node;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const down = current => {
|
|
92
|
+
mode = 'row';
|
|
93
|
+
treeWalker.currentNode = current;
|
|
94
|
+
const node = treeWalker.nextNode();
|
|
95
|
+
|
|
96
|
+
if (isHTMLElement(node)) {
|
|
97
|
+
return node;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return null;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const left = current => {
|
|
104
|
+
treeWalker.currentNode = current;
|
|
105
|
+
const prevMode = mode;
|
|
106
|
+
mode = 'column';
|
|
107
|
+
let node = null;
|
|
108
|
+
|
|
109
|
+
if (prevMode === 'row') {
|
|
110
|
+
let tmp = null;
|
|
111
|
+
|
|
112
|
+
while (tmp = treeWalker.nextNode()) {
|
|
113
|
+
node = tmp;
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
node = treeWalker.previousNode();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (isHTMLElement(node)) {
|
|
120
|
+
return node;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return null;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const right = current => {
|
|
127
|
+
mode = 'column';
|
|
128
|
+
treeWalker.currentNode = current;
|
|
129
|
+
const node = treeWalker.nextNode();
|
|
130
|
+
|
|
131
|
+
if (isHTMLElement(node)) {
|
|
132
|
+
return node;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return null;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const onKeyDown = e => {
|
|
139
|
+
const target = e.target;
|
|
140
|
+
|
|
141
|
+
if (!target || !isHTMLElement(target)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let next = null;
|
|
146
|
+
|
|
147
|
+
switch (e.key) {
|
|
148
|
+
case 'ArrowDown':
|
|
149
|
+
next = down(target);
|
|
150
|
+
break;
|
|
151
|
+
|
|
152
|
+
case 'ArrowUp':
|
|
153
|
+
next = up(target);
|
|
154
|
+
break;
|
|
155
|
+
|
|
156
|
+
case 'ArrowLeft':
|
|
157
|
+
next = left(target);
|
|
158
|
+
break;
|
|
159
|
+
|
|
160
|
+
case 'ArrowRight':
|
|
161
|
+
next = right(target);
|
|
162
|
+
break;
|
|
163
|
+
|
|
164
|
+
case 'Tab':
|
|
165
|
+
movingOut = true;
|
|
166
|
+
|
|
167
|
+
if (e.shiftKey) {
|
|
168
|
+
pre.focus();
|
|
169
|
+
} else {
|
|
170
|
+
post.focus();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
break;
|
|
174
|
+
|
|
175
|
+
default:
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (next) {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
next.focus();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
container.addEventListener('keydown', onKeyDown);
|
|
186
|
+
return () => container.removeEventListener('keydown', onKeyDown);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function isHTMLElement(node) {
|
|
190
|
+
return node instanceof HTMLElement;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function isRow(element) {
|
|
194
|
+
if (element.getAttribute('role') === 'row' || element.tagName === 'TR') {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function isCell(element) {
|
|
202
|
+
if (element.getAttribute('role') === 'cell' || element.getAttribute('role') === 'gridcell' || element.tagName === 'TD') {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=composite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["navigationModes/composite.ts"],"names":[],"mappings":"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","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":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["navigationModes/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["// eslint-disable-next-line deprecation/deprecation\nexport { useNavigationMode } from './useNavigationMode';\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
3
|
+
import { applyCompositeNavigation } from './composite';
|
|
4
|
+
import { applyCellNavigation } from './cell';
|
|
5
|
+
/**
|
|
6
|
+
* THIS HOOK WILL NOT EXIST IN STABLE RELEASE
|
|
7
|
+
* Just a quick workaround before tabster fully supports these navigation modes with grid mode
|
|
8
|
+
* https://github.com/microsoft/fluentui/issues/24382
|
|
9
|
+
* @internal
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export function useNavigationMode(mode) {
|
|
14
|
+
const rowNavigationAttr = useArrowNavigationGroup({
|
|
15
|
+
axis: 'vertical'
|
|
16
|
+
});
|
|
17
|
+
const ref = React.useRef(null);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
if (!ref.current) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
switch (mode) {
|
|
24
|
+
case 'cell':
|
|
25
|
+
applyCellNavigation(ref.current);
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
case 'composite':
|
|
29
|
+
applyCompositeNavigation(ref.current);
|
|
30
|
+
break;
|
|
31
|
+
|
|
32
|
+
case 'row':
|
|
33
|
+
if (rowNavigationAttr['data-tabster']) {
|
|
34
|
+
ref.current.setAttribute('data-tabster', rowNavigationAttr['data-tabster']);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}, [rowNavigationAttr, mode]);
|
|
40
|
+
return ref;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=useNavigationMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["navigationModes/useNavigationMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAT,QAAwC,yBAAxC;AACA,SAAS,wBAAT,QAAyC,aAAzC;AACA,SAAS,mBAAT,QAAoC,QAApC;AAIA;;;;;;AAMG;;AACH,OAAM,SAAU,iBAAV,CAA0D,IAA1D,EAA8E;EAClF,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;IAAE,IAAI,EAAE;EAAR,CAAD,CAAjD;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,mBAAmB,CAAC,GAAG,CAAC,OAAL,CAAnB;QACA;;MACF,KAAK,WAAL;QACE,wBAAwB,CAAC,GAAG,CAAC,OAAL,CAAxB;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","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":"../src/"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./components/TableCellActions/index"), exports);
|
|
10
|
+
//# sourceMappingURL=TableCellActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TableCellActions.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/TableCellActions/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./components/TableCellLayout/index"), exports);
|
|
10
|
+
//# sourceMappingURL=TableCellLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TableCellLayout.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/TableCellLayout/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./components/TableCellLayout/index"), exports);
|
|
10
|
+
//# sourceMappingURL=TableCellPrimaryLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TableCellPrimaryLayout.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/TableCellLayout/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./components/TableSelectionCell/index"), exports);
|
|
10
|
+
//# sourceMappingURL=TableSelectionCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TableSelectionCell.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/TableSelectionCell/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -5,18 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useTableContextValues_unstable = void 0;
|
|
7
7
|
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
8
10
|
function useTableContextValues_unstable(state) {
|
|
9
11
|
const {
|
|
10
12
|
size,
|
|
11
13
|
noNativeElements,
|
|
12
14
|
sortable
|
|
13
15
|
} = state;
|
|
16
|
+
const tableContext = React.useMemo(() => ({
|
|
17
|
+
noNativeElements,
|
|
18
|
+
size,
|
|
19
|
+
sortable
|
|
20
|
+
}), [noNativeElements, size, sortable]);
|
|
14
21
|
return {
|
|
15
|
-
table:
|
|
16
|
-
noNativeElements,
|
|
17
|
-
size,
|
|
18
|
-
sortable
|
|
19
|
-
}
|
|
22
|
+
table: tableContext
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Table/useTableContextValues.ts"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["components/Table/useTableContextValues.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAGA,SAAgB,8BAAhB,CAA+C,KAA/C,EAAgE;EAC9D,MAAM;IAAE,IAAF;IAAQ,gBAAR;IAA0B;EAA1B,IAAuC,KAA7C;EAEA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAN,CACnB,OAAO;IACL,gBADK;IAEL,IAFK;IAGL;EAHK,CAAP,CADmB,EAMnB,CAAC,gBAAD,EAAmB,IAAnB,EAAyB,QAAzB,CANmB,CAArB;EASA,OAAO;IACL,KAAK,EAAE;EADF,CAAP;AAGD;;AAfD,OAAA,CAAA,8BAAA,GAAA,8BAAA","sourcesContent":["import * as React from 'react';\nimport { TableContextValues, TableState } from './Table.types';\n\nexport function useTableContextValues_unstable(state: TableState): TableContextValues {\n const { size, noNativeElements, sortable } = state;\n\n const tableContext = React.useMemo(\n () => ({\n noNativeElements,\n size,\n sortable,\n }),\n [noNativeElements, size, sortable],\n );\n\n return {\n table: tableContext,\n };\n}\n"],"sourceRoot":"../src/"}
|
|
@@ -7,6 +7,8 @@ exports.useTableStyles_unstable = exports.tableClassNames = exports.tableClassNa
|
|
|
7
7
|
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
+
|
|
10
12
|
exports.tableClassName = 'fui-Table';
|
|
11
13
|
exports.tableClassNames = {
|
|
12
14
|
root: 'fui-Table'
|
|
@@ -17,10 +19,14 @@ exports.tableClassNames = {
|
|
|
17
19
|
|
|
18
20
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
19
21
|
"root": {
|
|
20
|
-
"
|
|
22
|
+
"ha4doy": "fmrv4ls",
|
|
23
|
+
"po53p8": "fgkb47j",
|
|
24
|
+
"a9b677": "fly5x3f",
|
|
25
|
+
"mc9l5x": "f1w4nmp0",
|
|
26
|
+
"De3pzq": "fxugw4r"
|
|
21
27
|
}
|
|
22
28
|
}, {
|
|
23
|
-
"d": [".fly5x3f{width:100%;}"]
|
|
29
|
+
"d": [".fmrv4ls{vertical-align:middle;}", ".fgkb47j{border-collapse:collapse;}", ".fly5x3f{width:100%;}", ".f1w4nmp0{display:table;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}"]
|
|
24
30
|
});
|
|
25
31
|
/**
|
|
26
32
|
* Apply styling to the Table slots based on the state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Table/useTableStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,GAAiB,WAAjB;AACA,OAAA,CAAA,eAAA,GAA8C;EACzD,IAAI,EAAE;AADmD,CAA9C;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;
|
|
1
|
+
{"version":3,"sources":["components/Table/useTableStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,GAAiB,WAAjB;AACA,OAAA,CAAA,eAAA,GAA8C;EACzD,IAAI,EAAE;AADmD,CAA9C;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAUA;;AAEG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,cAAb,EAA6B,MAAM,CAAC,IAApC,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAvB;EAEA,OAAO,KAAP;AACD,CALM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableSlots, TableState } from './Table.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableClassName = 'fui-Table';\nexport const tableClassNames: SlotClassNames<TableSlots> = {\n root: 'fui-Table',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n verticalAlign: 'middle',\n borderCollapse: 'collapse',\n width: '100%',\n display: 'table',\n backgroundColor: tokens.colorNeutralBackground1,\n },\n});\n\n/**\n * Apply styling to the Table slots based on the state\n */\nexport const useTableStyles_unstable = (state: TableState): TableState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableClassName, styles.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -22,7 +22,9 @@ const tableContext_1 = /*#__PURE__*/require("../../contexts/tableContext");
|
|
|
22
22
|
const useTableBody_unstable = (props, ref) => {
|
|
23
23
|
var _a;
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
noNativeElements
|
|
27
|
+
} = tableContext_1.useTableContext();
|
|
26
28
|
const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'tbody';
|
|
27
29
|
return {
|
|
28
30
|
components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TableBody/useTableBody.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM,
|
|
1
|
+
{"version":3,"sources":["components/TableBody/useTableBody.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM;IAAE;EAAF,IAAuB,cAAA,CAAA,eAAA,EAA7B;EACA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,OAA7D;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,UAA1B,GAAuC,SAFJ;MAGzC,GAAG;IAHsC,CAArC;EAJD,CAAP;AAUD,CAdM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableBodyProps, TableBodyState } from './TableBody.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableBody.\n *\n * The returned state can be modified with hooks such as useTableBodyStyles_unstable,\n * before being passed to renderTableBody_unstable.\n *\n * @param props - props from this instance of TableBody\n * @param ref - reference to root HTMLElement of TableBody\n */\nexport const useTableBody_unstable = (props: TableBodyProps, ref: React.Ref<HTMLElement>): TableBodyState => {\n const { noNativeElements } = useTableContext();\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'tbody';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'rowgroup' : undefined,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -7,6 +7,14 @@ exports.useTableBodyStyles_unstable = exports.tableBodyClassNames = exports.tabl
|
|
|
7
7
|
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
11
|
+
"root": {
|
|
12
|
+
"mc9l5x": "f1tp1avn"
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
"d": [".f1tp1avn{display:table-row-group;}"]
|
|
16
|
+
});
|
|
17
|
+
|
|
10
18
|
exports.tableBodyClassName = 'fui-TableBody';
|
|
11
19
|
exports.tableBodyClassNames = {
|
|
12
20
|
root: 'fui-TableBody'
|
|
@@ -16,7 +24,8 @@ exports.tableBodyClassNames = {
|
|
|
16
24
|
*/
|
|
17
25
|
|
|
18
26
|
const useTableBodyStyles_unstable = state => {
|
|
19
|
-
|
|
27
|
+
const styles = useStyles();
|
|
28
|
+
state.root.className = react_1.mergeClasses(exports.tableBodyClassName, styles.root, state.root.className);
|
|
20
29
|
return state;
|
|
21
30
|
};
|
|
22
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TableBody/useTableBodyStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;
|
|
1
|
+
{"version":3,"sources":["components/TableBody/useTableBodyStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAIA,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;;AAMa,OAAA,CAAA,kBAAA,GAAqB,eAArB;AACA,OAAA,CAAA,mBAAA,GAAsD;EACjE,IAAI,EAAE;AAD2D,CAAtD;AAIb;;AAEG;;AACI,MAAM,2BAA2B,GAAI,KAAD,IAA0C;EACnF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,kBAAb,EAAiC,MAAM,CAAC,IAAxC,EAA8C,KAAK,CAAC,IAAN,CAAW,SAAzD,CAAvB;EAEA,OAAO,KAAP;AACD,CALM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport type { TableBodySlots, TableBodyState } from './TableBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nconst useStyles = makeStyles({\n root: {\n display: 'table-row-group',\n },\n});\n\nexport const tableBodyClassName = 'fui-TableBody';\nexport const tableBodyClassNames: SlotClassNames<TableBodySlots> = {\n root: 'fui-TableBody',\n};\n\n/**\n * Apply styling to the TableBody slots based on the state\n */\nexport const useTableBodyStyles_unstable = (state: TableBodyState): TableBodyState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableBodyClassName, styles.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -17,11 +17,9 @@ const renderTableCell_unstable = state => {
|
|
|
17
17
|
const {
|
|
18
18
|
slots,
|
|
19
19
|
slotProps
|
|
20
|
-
} = react_utilities_1.getSlots(state);
|
|
21
|
-
|
|
20
|
+
} = react_utilities_1.getSlots(state);
|
|
22
21
|
return React.createElement(slots.root, { ...slotProps.root
|
|
23
|
-
}
|
|
24
|
-
}), " ", slotProps.root.children);
|
|
22
|
+
});
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
exports.renderTableCell_unstable = renderTableCell_unstable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TableCell/renderTableCell.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,wBAAwB,GAAI,KAAD,IAA0B;EAChE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAyB,KAAzB,CAA7B,
|
|
1
|
+
{"version":3,"sources":["components/TableCell/renderTableCell.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,wBAAwB,GAAI,KAAD,IAA0B;EAChE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAyB,KAAzB,CAA7B;EAEA,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableCellState, TableCellSlots } from './TableCell.types';\n\n/**\n * Render the final JSX of TableCell\n */\nexport const renderTableCell_unstable = (state: TableCellState) => {\n const { slots, slotProps } = getSlots<TableCellSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -22,14 +22,14 @@ const tableContext_1 = /*#__PURE__*/require("../../contexts/tableContext");
|
|
|
22
22
|
const useTableCell_unstable = (props, ref) => {
|
|
23
23
|
var _a;
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
noNativeElements
|
|
27
|
+
} = tableContext_1.useTableContext();
|
|
26
28
|
const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'td';
|
|
27
29
|
return {
|
|
28
30
|
components: {
|
|
29
|
-
root: rootComponent
|
|
30
|
-
media: 'span'
|
|
31
|
+
root: rootComponent
|
|
31
32
|
},
|
|
32
|
-
media: react_utilities_1.resolveShorthand(props.media),
|
|
33
33
|
root: react_utilities_1.getNativeElementProps(rootComponent, {
|
|
34
34
|
ref,
|
|
35
35
|
role: rootComponent === 'div' ? 'cell' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TableCell/useTableCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM,
|
|
1
|
+
{"version":3,"sources":["components/TableCell/useTableCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM;IAAE;EAAF,IAAuB,cAAA,CAAA,eAAA,EAA7B;EAEA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,IAA7D;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,MAA1B,GAAmC,SAFA;MAGzC,GAAG;IAHsC,CAArC;EAJD,CAAP;AAUD,CAfM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableCellProps, TableCellState } from './TableCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableCell.\n *\n * The returned state can be modified with hooks such as useTableCellStyles_unstable,\n * before being passed to renderTableCell_unstable.\n *\n * @param props - props from this instance of TableCell\n * @param ref - reference to root HTMLElement of TableCell\n */\nexport const useTableCell_unstable = (props: TableCellProps, ref: React.Ref<HTMLElement>): TableCellState => {\n const { noNativeElements } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'td';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'cell' : undefined,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -11,8 +11,7 @@ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
|
11
11
|
|
|
12
12
|
exports.tableCellClassName = 'fui-TableCell';
|
|
13
13
|
exports.tableCellClassNames = {
|
|
14
|
-
root: exports.tableCellClassName
|
|
15
|
-
media: 'fui-TableCell__media'
|
|
14
|
+
root: exports.tableCellClassName
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* Styles for the root slot
|
|
@@ -20,24 +19,16 @@ exports.tableCellClassNames = {
|
|
|
20
19
|
|
|
21
20
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
22
21
|
"root": {
|
|
22
|
+
"qhf8xq": "f10pi13n",
|
|
23
|
+
"ha4doy": "fmrv4ls",
|
|
24
|
+
"mc9l5x": "f15pt5es",
|
|
23
25
|
"z8tnut": "f1nbblvp",
|
|
24
26
|
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
|
25
27
|
"Byoj8tv": "f1ov4xf1",
|
|
26
|
-
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"]
|
|
27
|
-
"mc9l5x": "f22iagw",
|
|
28
|
-
"Bt984gj": "f122n59",
|
|
29
|
-
"i8kkvl": "fsnqrgy",
|
|
30
|
-
"Belr9w4": "fylz90v",
|
|
31
|
-
"Bh6795r": "fqerorx",
|
|
32
|
-
"Bnnss6s": "f1neuvcm",
|
|
33
|
-
"xawz": "fkjuxzh"
|
|
34
|
-
},
|
|
35
|
-
"media": {
|
|
36
|
-
"mc9l5x": "f22iagw",
|
|
37
|
-
"Bt984gj": "f122n59"
|
|
28
|
+
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"]
|
|
38
29
|
}
|
|
39
30
|
}, {
|
|
40
|
-
"d": [".
|
|
31
|
+
"d": [".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f15pt5es{display:table-cell;}", ".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}"]
|
|
41
32
|
});
|
|
42
33
|
/**
|
|
43
34
|
* Apply styling to the TableCell slots based on the state
|
|
@@ -47,11 +38,6 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
47
38
|
const useTableCellStyles_unstable = state => {
|
|
48
39
|
const styles = useStyles();
|
|
49
40
|
state.root.className = react_1.mergeClasses(exports.tableCellClassNames.root, styles.root, state.root.className);
|
|
50
|
-
|
|
51
|
-
if (state.media) {
|
|
52
|
-
state.media.className = react_1.mergeClasses(exports.tableCellClassNames.media, styles.media);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
41
|
return state;
|
|
56
42
|
};
|
|
57
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/TableCell/useTableCellStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,kBAAA,GAAqB,eAArB;AACA,OAAA,CAAA,mBAAA,GAAsD;EACjE,IAAI,EAAE,OAAA,CAAA
|
|
1
|
+
{"version":3,"sources":["components/TableCell/useTableCellStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,kBAAA,GAAqB,eAArB;AACA,OAAA,CAAA,mBAAA,GAAsD;EACjE,IAAI,EAAE,OAAA,CAAA;AAD2D,CAAtD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AASA;;AAEG;;;AACI,MAAM,2BAA2B,GAAI,KAAD,IAA0C;EACnF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,mBAAA,CAAoB,IAAjC,EAAuC,MAAM,CAAC,IAA9C,EAAoD,KAAK,CAAC,IAAN,CAAW,SAA/D,CAAvB;EACA,OAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableCellSlots, TableCellState } from './TableCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellClassName = 'fui-TableCell';\nexport const tableCellClassNames: SlotClassNames<TableCellSlots> = {\n root: tableCellClassName,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n verticalAlign: 'middle',\n display: 'table-cell',\n ...shorthands.padding('0px', tokens.spacingHorizontalS),\n },\n});\n\n/**\n * Apply styling to the TableCell slots based on the state\n */\nexport const useTableCellStyles_unstable = (state: TableCellState): TableCellState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableCellClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableCellActions = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const useTableCellActions_1 = /*#__PURE__*/require("./useTableCellActions");
|
|
11
|
+
|
|
12
|
+
const renderTableCellActions_1 = /*#__PURE__*/require("./renderTableCellActions");
|
|
13
|
+
|
|
14
|
+
const useTableCellActionsStyles_1 = /*#__PURE__*/require("./useTableCellActionsStyles");
|
|
15
|
+
/**
|
|
16
|
+
* TableCellActions component - TODO: add more docs
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.TableCellActions = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
|
+
const state = useTableCellActions_1.useTableCellActions_unstable(props, ref);
|
|
22
|
+
useTableCellActionsStyles_1.useTableCellActionsStyles_unstable(state);
|
|
23
|
+
return renderTableCellActions_1.renderTableCellActions_unstable(state);
|
|
24
|
+
});
|
|
25
|
+
exports.TableCellActions.displayName = 'TableCellActions';
|
|
26
|
+
//# sourceMappingURL=TableCellActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/TableCellActions/TableCellActions.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,2BAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,gBAAA,gBAA+D,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC1G,MAAM,KAAK,GAAG,qBAAA,CAAA,4BAAA,CAA6B,KAA7B,EAAoC,GAApC,CAAd;EAEA,2BAAA,CAAA,kCAAA,CAAmC,KAAnC;EACA,OAAO,wBAAA,CAAA,+BAAA,CAAgC,KAAhC,CAAP;AACD,CAL2E,CAA/D;AAOb,OAAA,CAAA,gBAAA,CAAiB,WAAjB,GAA+B,kBAA/B","sourcesContent":["import * as React from 'react';\nimport { useTableCellActions_unstable } from './useTableCellActions';\nimport { renderTableCellActions_unstable } from './renderTableCellActions';\nimport { useTableCellActionsStyles_unstable } from './useTableCellActionsStyles';\nimport type { TableCellActionsProps } from './TableCellActions.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableCellActions component - TODO: add more docs\n */\nexport const TableCellActions: ForwardRefComponent<TableCellActionsProps> = React.forwardRef((props, ref) => {\n const state = useTableCellActions_unstable(props, ref);\n\n useTableCellActionsStyles_unstable(state);\n return renderTableCellActions_unstable(state);\n});\n\nTableCellActions.displayName = 'TableCellActions';\n"],"sourceRoot":"../src/"}
|