@fluentui/react-table 9.0.0-alpha.6 → 9.0.0-alpha.8
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 +124 -2
- package/CHANGELOG.md +34 -3
- package/dist/index.d.ts +19 -4
- package/lib/components/Table/useTableStyles.js +2 -2
- package/lib/components/Table/useTableStyles.js.map +1 -1
- package/lib/components/TableHeader/renderTableHeader.js +5 -2
- package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +8 -2
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib/components/TableRow/TableRow.types.js.map +1 -1
- package/lib/components/TableRow/useTableRow.js +7 -4
- package/lib/components/TableRow/useTableRow.js.map +1 -1
- package/lib/components/TableRow/useTableRowStyles.js +158 -6
- package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
- package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCell.js +13 -9
- package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +12 -3
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib/contexts/tableHeaderContext.js +6 -0
- package/lib/contexts/tableHeaderContext.js.map +1 -0
- package/lib-commonjs/components/Table/useTableStyles.js +2 -2
- package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeader/renderTableHeader.js +6 -2
- package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +8 -2
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRow.js +7 -3
- package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.js +161 -6
- package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +13 -10
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +13 -3
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib-commonjs/contexts/tableHeaderContext.js +17 -0
- package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -0
- package/package.json +14 -13
- package/lib/navigationModes/cell.js +0 -250
- package/lib/navigationModes/cell.js.map +0 -1
- package/lib/navigationModes/composite.js +0 -208
- package/lib/navigationModes/composite.js.map +0 -1
- package/lib/navigationModes/index.js +0 -3
- package/lib/navigationModes/index.js.map +0 -1
- package/lib/navigationModes/useNavigationMode.js +0 -42
- package/lib/navigationModes/useNavigationMode.js.map +0 -1
- package/lib-commonjs/navigationModes/cell.js +0 -259
- package/lib-commonjs/navigationModes/cell.js.map +0 -1
- package/lib-commonjs/navigationModes/composite.js +0 -217
- package/lib-commonjs/navigationModes/composite.js.map +0 -1
- package/lib-commonjs/navigationModes/index.js +0 -16
- package/lib-commonjs/navigationModes/index.js.map +0 -1
- package/lib-commonjs/navigationModes/useNavigationMode.js +0 -55
- package/lib-commonjs/navigationModes/useNavigationMode.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,129 @@
|
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 25 Oct 2022 00:34:18 GMT",
|
|
6
|
+
"tag": "@fluentui/react-table_v9.0.0-alpha.8",
|
|
7
|
+
"version": "9.0.0-alpha.8",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-table",
|
|
13
|
+
"comment": "Bump @fluentui/react-avatar to v9.2.4",
|
|
14
|
+
"commit": "eef12b9ae58b64ff68576dc2d865b601e46c85b9"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-table",
|
|
19
|
+
"comment": "Bump @fluentui/react-checkbox to v9.0.10",
|
|
20
|
+
"commit": "eef12b9ae58b64ff68576dc2d865b601e46c85b9"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Thu, 20 Oct 2022 08:39:49 GMT",
|
|
27
|
+
"tag": "@fluentui/react-table_v9.0.0-alpha.7",
|
|
28
|
+
"version": "9.0.0-alpha.7",
|
|
29
|
+
"comments": {
|
|
30
|
+
"prerelease": [
|
|
31
|
+
{
|
|
32
|
+
"author": "lingfangao@hotmail.com",
|
|
33
|
+
"package": "@fluentui/react-table",
|
|
34
|
+
"commit": "15b7b57ee484f8d500b3c7afb9aa46c17a9beaeb",
|
|
35
|
+
"comment": "fix: Row and header interactive styles are separate"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "lingfangao@hotmail.com",
|
|
39
|
+
"package": "@fluentui/react-table",
|
|
40
|
+
"commit": "bd212e73e6a6e3c92495b793c6e682c24f27b6db",
|
|
41
|
+
"comment": "feat(TableSelectionCell): Use Radio component, adds subtle and hidden"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "mgodbolt@microsoft.com",
|
|
45
|
+
"package": "@fluentui/react-table",
|
|
46
|
+
"commit": "17096b3137d9d3e7c7443ddc3ce0738b2910a334",
|
|
47
|
+
"comment": "chore: Bump peer deps to support React 18"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "olfedias@microsoft.com",
|
|
51
|
+
"package": "@fluentui/react-table",
|
|
52
|
+
"commit": "06865dada128321804646582f564ee86d835d174",
|
|
53
|
+
"comment": "chore: Update Griffel to latest version"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "lingfangao@hotmail.com",
|
|
57
|
+
"package": "@fluentui/react-table",
|
|
58
|
+
"commit": "66bf477e336a9248e138e31ee6e58d9672da8f8f",
|
|
59
|
+
"comment": "feat: Add `appearance` prop to `TableRow`"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-table",
|
|
64
|
+
"comment": "Bump @fluentui/react-aria to v9.2.3",
|
|
65
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-table",
|
|
70
|
+
"comment": "Bump @fluentui/react-avatar to v9.2.3",
|
|
71
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-table",
|
|
76
|
+
"comment": "Bump @fluentui/react-checkbox to v9.0.9",
|
|
77
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-table",
|
|
82
|
+
"comment": "Bump @fluentui/react-radio to v9.0.9",
|
|
83
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-table",
|
|
88
|
+
"comment": "Bump @fluentui/react-tabster to v9.2.0",
|
|
89
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-table",
|
|
94
|
+
"comment": "Bump @fluentui/react-theme to v9.1.1",
|
|
95
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-table",
|
|
100
|
+
"comment": "Bump @fluentui/react-utilities to v9.1.2",
|
|
101
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "@fluentui/react-table",
|
|
106
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16",
|
|
107
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"none": [
|
|
111
|
+
{
|
|
112
|
+
"author": "lingfangao@hotmail.com",
|
|
113
|
+
"package": "@fluentui/react-table",
|
|
114
|
+
"commit": "5280dfeda349453f42b51ae49c9d128bc322c609",
|
|
115
|
+
"comment": "docs: Remove row navigation"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"author": "lingfangao@hotmail.com",
|
|
119
|
+
"package": "@fluentui/react-table",
|
|
120
|
+
"commit": "433209a6b5e8adb7619d3658c1606ec8adb02745",
|
|
121
|
+
"comment": "docs: Update keyboard navigation examples to use `useArrowNavigationGroup`"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"date": "Thu, 13 Oct 2022 12:56:30 GMT",
|
|
6
128
|
"tag": "@fluentui/react-table_v9.0.0-alpha.6",
|
|
7
129
|
"version": "9.0.0-alpha.6",
|
|
8
130
|
"comments": {
|
|
@@ -11,7 +133,7 @@
|
|
|
11
133
|
"author": "beachball",
|
|
12
134
|
"package": "@fluentui/react-table",
|
|
13
135
|
"comment": "Bump @fluentui/react-avatar to v9.2.2",
|
|
14
|
-
"commit": "
|
|
136
|
+
"commit": "77301c97c0539b9ebf891642eb0a077d1aeae9a6"
|
|
15
137
|
}
|
|
16
138
|
]
|
|
17
139
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 25 Oct 2022 00:34:18 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-alpha.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.8)
|
|
8
|
+
|
|
9
|
+
Tue, 25 Oct 2022 00:34:18 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.7..@fluentui/react-table_v9.0.0-alpha.8)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-avatar to v9.2.4 ([PR #25363](https://github.com/microsoft/fluentui/pull/25363) by beachball)
|
|
15
|
+
- Bump @fluentui/react-checkbox to v9.0.10 ([PR #25363](https://github.com/microsoft/fluentui/pull/25363) by beachball)
|
|
16
|
+
|
|
17
|
+
## [9.0.0-alpha.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.7)
|
|
18
|
+
|
|
19
|
+
Thu, 20 Oct 2022 08:39:49 GMT
|
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.6..@fluentui/react-table_v9.0.0-alpha.7)
|
|
21
|
+
|
|
22
|
+
### Changes
|
|
23
|
+
|
|
24
|
+
- fix: Row and header interactive styles are separate ([PR #25201](https://github.com/microsoft/fluentui/pull/25201) by lingfangao@hotmail.com)
|
|
25
|
+
- feat(TableSelectionCell): Use Radio component, adds subtle and hidden ([PR #25202](https://github.com/microsoft/fluentui/pull/25202) by lingfangao@hotmail.com)
|
|
26
|
+
- chore: Bump peer deps to support React 18 ([PR #24972](https://github.com/microsoft/fluentui/pull/24972) by mgodbolt@microsoft.com)
|
|
27
|
+
- chore: Update Griffel to latest version ([PR #25212](https://github.com/microsoft/fluentui/pull/25212) by olfedias@microsoft.com)
|
|
28
|
+
- feat: Add `appearance` prop to `TableRow` ([PR #25192](https://github.com/microsoft/fluentui/pull/25192) by lingfangao@hotmail.com)
|
|
29
|
+
- Bump @fluentui/react-aria to v9.2.3 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
30
|
+
- Bump @fluentui/react-avatar to v9.2.3 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
31
|
+
- Bump @fluentui/react-checkbox to v9.0.9 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
32
|
+
- Bump @fluentui/react-radio to v9.0.9 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
33
|
+
- Bump @fluentui/react-tabster to v9.2.0 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
34
|
+
- Bump @fluentui/react-theme to v9.1.1 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
35
|
+
- Bump @fluentui/react-utilities to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
36
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
37
|
+
|
|
7
38
|
## [9.0.0-alpha.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.6)
|
|
8
39
|
|
|
9
|
-
Thu, 13 Oct 2022 12:
|
|
40
|
+
Thu, 13 Oct 2022 12:56:30 GMT
|
|
10
41
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.5..@fluentui/react-table_v9.0.0-alpha.6)
|
|
11
42
|
|
|
12
43
|
### Changes
|
|
13
44
|
|
|
14
|
-
- Bump @fluentui/react-avatar to v9.2.2 ([PR #
|
|
45
|
+
- Bump @fluentui/react-avatar to v9.2.2 ([PR #25119](https://github.com/microsoft/fluentui/pull/25119) by beachball)
|
|
15
46
|
|
|
16
47
|
## [9.0.0-alpha.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.5)
|
|
17
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { CheckboxProps } from '@fluentui/react-checkbox';
|
|
|
7
7
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
8
8
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
9
9
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
10
|
+
import type { Radio } from '@fluentui/react-radio';
|
|
10
11
|
import * as React_2 from 'react';
|
|
11
12
|
import type { Slot } from '@fluentui/react-utilities';
|
|
12
13
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
@@ -329,7 +330,13 @@ export declare const tableRowClassNames: SlotClassNames<TableRowSlots>;
|
|
|
329
330
|
/**
|
|
330
331
|
* TableRow Props
|
|
331
332
|
*/
|
|
332
|
-
export declare type TableRowProps = ComponentProps<TableRowSlots> & {
|
|
333
|
+
export declare type TableRowProps = ComponentProps<TableRowSlots> & {
|
|
334
|
+
/**
|
|
335
|
+
* A table row can have different variants
|
|
336
|
+
* @default none
|
|
337
|
+
*/
|
|
338
|
+
appearance?: 'brand' | 'neutral' | 'none';
|
|
339
|
+
};
|
|
333
340
|
|
|
334
341
|
export declare type TableRowSlots = {
|
|
335
342
|
root: Slot<'tr', 'div'>;
|
|
@@ -338,7 +345,7 @@ export declare type TableRowSlots = {
|
|
|
338
345
|
/**
|
|
339
346
|
* State used in rendering TableRow
|
|
340
347
|
*/
|
|
341
|
-
export declare type TableRowState = ComponentState<TableRowSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'>;
|
|
348
|
+
export declare type TableRowState = ComponentState<TableRowSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'> & Pick<Required<TableRowProps>, 'appearance'>;
|
|
342
349
|
|
|
343
350
|
/**
|
|
344
351
|
* TableSelectionCell component - TODO: add more docs
|
|
@@ -356,6 +363,14 @@ export declare type TableSelectionCellProps = ComponentProps<Partial<Omit<TableS
|
|
|
356
363
|
*/
|
|
357
364
|
type?: 'checkbox' | 'radio';
|
|
358
365
|
checked?: CheckboxProps['checked'];
|
|
366
|
+
/**
|
|
367
|
+
* Only visible when checked or the parent row is hovered
|
|
368
|
+
*/
|
|
369
|
+
subtle?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Completely hides the selection cell visually but takes up the same space
|
|
372
|
+
*/
|
|
373
|
+
hidden?: boolean;
|
|
359
374
|
};
|
|
360
375
|
|
|
361
376
|
export declare type TableSelectionCellSlots = {
|
|
@@ -366,13 +381,13 @@ export declare type TableSelectionCellSlots = {
|
|
|
366
381
|
/**
|
|
367
382
|
* Selection indicator if selection type is radio
|
|
368
383
|
*/
|
|
369
|
-
radioIndicator: Slot<
|
|
384
|
+
radioIndicator: Slot<typeof Radio>;
|
|
370
385
|
} & Pick<TableCellSlots, 'root'>;
|
|
371
386
|
|
|
372
387
|
/**
|
|
373
388
|
* State used in rendering TableSelectionCell
|
|
374
389
|
*/
|
|
375
|
-
export declare type TableSelectionCellState = ComponentState<TableSelectionCellSlots> & Pick<Required<TableSelectionCellProps>, 'type' | 'checked'> & Pick<TableContextValue, 'noNativeElements'>;
|
|
390
|
+
export declare type TableSelectionCellState = ComponentState<TableSelectionCellSlots> & Pick<Required<TableSelectionCellProps>, 'type' | 'checked' | 'subtle' | 'hidden'> & Pick<TableContextValue, 'noNativeElements'>;
|
|
376
391
|
|
|
377
392
|
export declare interface TableSelectionState {
|
|
378
393
|
/**
|
|
@@ -31,10 +31,10 @@ const useFlexLayoutStyles = /*#__PURE__*/__styles({
|
|
|
31
31
|
const useStyles = /*#__PURE__*/__styles({
|
|
32
32
|
"root": {
|
|
33
33
|
"po53p8": "fgkb47j",
|
|
34
|
-
"De3pzq": "
|
|
34
|
+
"De3pzq": "fhovq9v"
|
|
35
35
|
}
|
|
36
36
|
}, {
|
|
37
|
-
"d": [".fgkb47j{border-collapse:collapse;}", ".
|
|
37
|
+
"d": [".fgkb47j{border-collapse:collapse;}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"]
|
|
38
38
|
});
|
|
39
39
|
/**
|
|
40
40
|
* Apply styling to the Table slots based on the state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-table/src/components/Table/useTableStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,cAAc,GAAG,WAAvB;AACP,OAAO,MAAM,eAAe,GAA+B;EACzD,IAAI,EAAE;AADmD,CAApD;;AAIP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AASA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAMA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAOA;;AAEG;;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHpC,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;EAOA,OAAO,KAAP;AACD,CAdM","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\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table',\n verticalAlign: 'middle',\n width: '100%',\n tableLayout: 'fixed',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderCollapse: 'collapse',\n backgroundColor: tokens.
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-table/src/components/Table/useTableStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,cAAc,GAAG,WAAvB;AACP,OAAO,MAAM,eAAe,GAA+B;EACzD,IAAI,EAAE;AADmD,CAApD;;AAIP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AASA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAMA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAOA;;AAEG;;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHpC,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;EAOA,OAAO,KAAP;AACD,CAdM","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\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table',\n verticalAlign: 'middle',\n width: '100%',\n tableLayout: 'fixed',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderCollapse: 'collapse',\n backgroundColor: tokens.colorSubtleBackground,\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 const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableClassName,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { TableHeaderContextProvider } from '../../contexts/tableHeaderContext';
|
|
3
4
|
/**
|
|
4
5
|
* Render the final JSX of TableHeader
|
|
5
6
|
*/
|
|
@@ -9,7 +10,9 @@ export const renderTableHeader_unstable = state => {
|
|
|
9
10
|
slots,
|
|
10
11
|
slotProps
|
|
11
12
|
} = getSlots(state);
|
|
12
|
-
return /*#__PURE__*/React.createElement(
|
|
13
|
-
|
|
13
|
+
return /*#__PURE__*/React.createElement(TableHeaderContextProvider, {
|
|
14
|
+
value: ""
|
|
15
|
+
}, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
16
|
+
}));
|
|
14
17
|
};
|
|
15
18
|
//# sourceMappingURL=renderTableHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAmB,KAAnB,CAArC;EAEA,
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,0BAAT,QAA2C,mCAA3C;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAmB,KAAnB,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,0BAAD,EAA2B;IAAC,KAAK,EAAC;EAAP,CAA3B,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { TableHeaderContextProvider } from '../../contexts/tableHeaderContext';\nimport type { TableHeaderState, TableHeaderSlots } from './TableHeader.types';\n\n/**\n * Render the final JSX of TableHeader\n */\nexport const renderTableHeader_unstable = (state: TableHeaderState) => {\n const { slots, slotProps } = getSlots<TableHeaderSlots>(state);\n\n return (\n <TableHeaderContextProvider value=\"\">\n <slots.root {...slotProps.root} />\n </TableHeaderContextProvider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -39,6 +39,10 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
39
39
|
"Byoj8tv": "f1ov4xf1",
|
|
40
40
|
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"]
|
|
41
41
|
},
|
|
42
|
+
"rootInteractive": {
|
|
43
|
+
"Jwef8y": "f1t94bn6",
|
|
44
|
+
"ecr2s2": "f1wfn5kd"
|
|
45
|
+
},
|
|
42
46
|
"resetButton": {
|
|
43
47
|
"B3rzk8w": "fq6nmtn",
|
|
44
48
|
"B7ck84d": "f1e4lqlz",
|
|
@@ -81,7 +85,9 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
81
85
|
"Bt984gj": "f122n59"
|
|
82
86
|
}
|
|
83
87
|
}, {
|
|
84
|
-
"d": [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fq6nmtn{resize:horizontal;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f10pi13n{position:relative;}", ".fly5x3f{width:100%;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1l02sjl{height:100%;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".f5pgtk9{min-height:44px;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".f1k6fduh{cursor:pointer;}"]
|
|
88
|
+
"d": [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fq6nmtn{resize:horizontal;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f10pi13n{position:relative;}", ".fly5x3f{width:100%;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1l02sjl{height:100%;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".f5pgtk9{min-height:44px;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".f1k6fduh{cursor:pointer;}"],
|
|
89
|
+
"h": [".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
|
90
|
+
"a": [".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
|
85
91
|
});
|
|
86
92
|
/**
|
|
87
93
|
* Apply styling to the TableHeaderCell slots based on the state
|
|
@@ -94,7 +100,7 @@ export const useTableHeaderCellStyles_unstable = state => {
|
|
|
94
100
|
table: useTableLayoutStyles(),
|
|
95
101
|
flex: useFlexLayoutStyles()
|
|
96
102
|
};
|
|
97
|
-
state.root.className = mergeClasses(tableHeaderCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.root.className);
|
|
103
|
+
state.root.className = mergeClasses(tableHeaderCellClassNames.root, styles.root, state.sortable && styles.rootInteractive, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.root.className);
|
|
98
104
|
state.button.className = mergeClasses(tableHeaderCellClassNames.button, styles.resetButton, styles.button, state.sortable && styles.sortable, state.button.className);
|
|
99
105
|
|
|
100
106
|
if (state.sortIcon) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCellStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,wBAAwB,GAAG,qBAAjC;AACP,OAAO,MAAM,yBAAyB,GAAyC;EAC7E,IAAI,EAAE,qBADuE;EAE7E,MAAM,EAAE,6BAFqE;EAG7E,QAAQ,EAAE;AAHmE,CAAxE;;AAMP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AAOA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAQA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCellStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,wBAAwB,GAAG,qBAAjC;AACP,OAAO,MAAM,yBAAyB,GAAyC;EAC7E,IAAI,EAAE,qBADuE;EAE7E,MAAM,EAAE,6BAFqE;EAG7E,QAAQ,EAAE;AAHmE,CAAxE;;AAMP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AAOA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAQA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;AAiDA;;AAEG;;;AACH,OAAO,MAAM,iCAAiC,GAAI,KAAD,IAAsD;EACrG,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,yBAAyB,CAAC,IADO,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,eAHQ,EAIjC,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAJpC,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;EAOA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CACnC,yBAAyB,CAAC,MADS,EAEnC,MAAM,CAAC,WAF4B,EAGnC,MAAM,CAAC,MAH4B,EAInC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAJU,EAKnC,KAAK,CAAC,MAAN,CAAa,SALsB,CAArC;;EAQA,IAAI,KAAK,CAAC,QAAV,EAAoB;IAClB,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CACrC,yBAAyB,CAAC,QADW,EAErC,MAAM,CAAC,QAF8B,EAGrC,KAAK,CAAC,QAAN,CAAe,SAHsB,CAAvC;EAKD;;EAED,OAAO,KAAP;AACD,CA9BM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TableHeaderCellSlots, TableHeaderCellState } from './TableHeaderCell.types';\n\nexport const tableHeaderCellClassName = 'fui-TableHeaderCell';\nexport const tableHeaderCellClassNames: SlotClassNames<TableHeaderCellSlots> = {\n root: 'fui-TableHeaderCell',\n button: 'fui-TableHeaderCell__button',\n sortIcon: 'fui-TableHeaderCell__sortIcon',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: '0px',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...shorthands.padding('0px', tokens.spacingHorizontalS),\n },\n\n rootInteractive: {\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n\n resetButton: {\n resize: 'horizontal',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n },\n button: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexGrow: 1,\n height: '100%',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalS),\n minHeight: '44px',\n ...shorthands.flex(1, 1, '0px'),\n },\n sortable: {\n cursor: 'pointer',\n },\n\n sortIcon: {\n display: 'flex',\n alignItems: 'center',\n },\n});\n\n/**\n * Apply styling to the TableHeaderCell slots based on the state\n */\nexport const useTableHeaderCellStyles_unstable = (state: TableHeaderCellState): TableHeaderCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableHeaderCellClassNames.root,\n styles.root,\n state.sortable && styles.rootInteractive,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n state.button.className = mergeClasses(\n tableHeaderCellClassNames.button,\n styles.resetButton,\n styles.button,\n state.sortable && styles.sortable,\n state.button.className,\n );\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(\n tableHeaderCellClassNames.sortIcon,\n styles.sortIcon,\n state.sortIcon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/TableRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableRowSlots = {\n root: Slot<'tr', 'div'>;\n};\n\n/**\n * TableRow Props\n */\nexport type TableRowProps = ComponentProps<TableRowSlots> & {};\n\n/**\n * State used in rendering TableRow\n */\nexport type TableRowState = ComponentState<TableRowSlots>
|
|
1
|
+
{"version":3,"file":"TableRow.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/TableRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableRowSlots = {\n root: Slot<'tr', 'div'>;\n};\n\n/**\n * TableRow Props\n */\nexport type TableRowProps = ComponentProps<TableRowSlots> & {\n /**\n * A table row can have different variants\n * @default none\n */\n appearance?: 'brand' | 'neutral' | 'none';\n};\n\n/**\n * State used in rendering TableRow\n */\nexport type TableRowState = ComponentState<TableRowSlots> &\n Pick<TableContextValue, 'noNativeElements' | 'size'> &\n Pick<Required<TableRowProps>, 'appearance'>;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { getNativeElementProps } from '@fluentui/react-utilities';
|
|
1
|
+
import { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';
|
|
2
2
|
import { useTableContext } from '../../contexts/tableContext';
|
|
3
|
+
import { useFocusVisible } from '@fluentui/react-tabster';
|
|
3
4
|
/**
|
|
4
5
|
* Create the state required to render TableRow.
|
|
5
6
|
*
|
|
@@ -11,24 +12,26 @@ import { useTableContext } from '../../contexts/tableContext';
|
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
export const useTableRow_unstable = (props, ref) => {
|
|
14
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
15
16
|
|
|
16
17
|
const {
|
|
17
18
|
noNativeElements,
|
|
18
19
|
size
|
|
19
20
|
} = useTableContext();
|
|
20
21
|
const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'tr';
|
|
22
|
+
const focusVisibleRef = useFocusVisible();
|
|
21
23
|
return {
|
|
22
24
|
components: {
|
|
23
25
|
root: rootComponent
|
|
24
26
|
},
|
|
25
27
|
root: getNativeElementProps(rootComponent, {
|
|
26
|
-
ref,
|
|
28
|
+
ref: useMergedRefs(ref, focusVisibleRef),
|
|
27
29
|
role: rootComponent === 'div' ? 'row' : undefined,
|
|
28
30
|
...props
|
|
29
31
|
}),
|
|
30
32
|
size,
|
|
31
|
-
noNativeElements
|
|
33
|
+
noNativeElements,
|
|
34
|
+
appearance: (_b = props.appearance) !== null && _b !== void 0 ? _b : 'none'
|
|
32
35
|
};
|
|
33
36
|
};
|
|
34
37
|
//# sourceMappingURL=useTableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-table/src/components/TableRow/useTableRow.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-table/src/components/TableRow/useTableRow.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,aAAhC,QAAqD,2BAArD;AAEA,SAAS,eAAT,QAAgC,6BAAhC;AACA,SAAS,eAAT,QAAgC,yBAAhC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAAuB,GAAvB,KAAqE;;;EACvG,MAAM;IAAE,gBAAF;IAAoB;EAApB,IAA6B,eAAe,EAAlD;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,IAA7D;EACA,MAAM,eAAe,GAAG,eAAe,EAAvC;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,aAAD,EAAgB;MACzC,GAAG,EAAE,aAAa,CAAC,GAAD,EAAM,eAAN,CADuB;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,KAA1B,GAAkC,SAFC;MAGzC,GAAG;IAHsC,CAAhB,CAJtB;IASL,IATK;IAUL,gBAVK;IAWL,UAAU,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,MAAgB,IAAhB,IAAgB,EAAA,KAAA,KAAA,CAAhB,GAAgB,EAAhB,GAAoB;EAX3B,CAAP;AAaD,CAlBM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport type { TableRowProps, TableRowState } from './TableRow.types';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useFocusVisible } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TableRow.\n *\n * The returned state can be modified with hooks such as useTableRowStyles_unstable,\n * before being passed to renderTableRow_unstable.\n *\n * @param props - props from this instance of TableRow\n * @param ref - reference to root HTMLElement of TableRow\n */\nexport const useTableRow_unstable = (props: TableRowProps, ref: React.Ref<HTMLElement>): TableRowState => {\n const { noNativeElements, size } = useTableContext();\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'tr';\n const focusVisibleRef = useFocusVisible();\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref: useMergedRefs(ref, focusVisibleRef),\n role: rootComponent === 'div' ? 'row' : undefined,\n ...props,\n }),\n size,\n noNativeElements,\n appearance: props.appearance ?? 'none',\n };\n};\n"],"sourceRoot":"../src/"}
|