@fluentui/react-table 9.0.0-rc.4 → 9.0.0-rc.5
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 +53 -8
- package/CHANGELOG.md +23 -9
- package/dist/index.d.ts +88 -0
- package/lib/TableResizeHandle.js +2 -0
- package/lib/TableResizeHandle.js.map +1 -0
- package/lib/components/DataGrid/index.js +1 -0
- package/lib/components/DataGrid/index.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +5 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js +3 -1
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +3 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -4
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib/components/TableResizeHandle/TableResizeHandle.js +14 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js +2 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -0
- package/lib/components/TableResizeHandle/index.js +6 -0
- package/lib/components/TableResizeHandle/index.js.map +1 -0
- package/lib/components/TableResizeHandle/renderTableResizeHandle.js +15 -0
- package/lib/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/useTableResizeHandle.js +28 -0
- package/lib/components/TableResizeHandle/useTableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js +49 -0
- package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/types.js.map +1 -1
- package/lib/hooks/useMeasureElement.js +48 -0
- package/lib/hooks/useMeasureElement.js.map +1 -0
- package/lib/hooks/useTableColumnResizeMouseHandler.js +47 -0
- package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -0
- package/lib/hooks/useTableColumnResizeState.js +103 -0
- package/lib/hooks/useTableColumnResizeState.js.map +1 -0
- package/lib/hooks/useTableColumnSizing.js +74 -0
- package/lib/hooks/useTableColumnSizing.js.map +1 -0
- package/lib/hooks/useTableFeatures.js +10 -2
- package/lib/hooks/useTableFeatures.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/columnResizeUtils.js +158 -0
- package/lib/utils/columnResizeUtils.js.map +1 -0
- package/lib-commonjs/TableResizeHandle.js +8 -0
- package/lib-commonjs/TableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/DataGrid/index.js +1 -0
- package/lib-commonjs/components/DataGrid/index.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +5 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +3 -1
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +3 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -4
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js +20 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js +6 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/index.js +12 -0
- package/lib-commonjs/components/TableResizeHandle/index.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js +22 -0
- package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js +35 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js +56 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -0
- package/lib-commonjs/hooks/index.js +1 -0
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useMeasureElement.js +55 -0
- package/lib-commonjs/hooks/useMeasureElement.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js +54 -0
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnResizeState.js +110 -0
- package/lib-commonjs/hooks/useTableColumnResizeState.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnSizing.js +81 -0
- package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -0
- package/lib-commonjs/hooks/useTableFeatures.js +10 -2
- package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
- package/lib-commonjs/index.js +46 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/columnResizeUtils.js +172 -0
- package/lib-commonjs/utils/columnResizeUtils.js.map +1 -0
- package/package.json +6 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Tue,
|
|
5
|
+
"date": "Tue, 07 Feb 2023 14:10:44 GMT",
|
|
6
|
+
"tag": "@fluentui/react-table_v9.0.0-rc.5",
|
|
7
|
+
"version": "9.0.0-rc.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "lingfangao@hotmail.com",
|
|
12
|
+
"package": "@fluentui/react-table",
|
|
13
|
+
"commit": "0b35790d67cad33bd1d52d2418fcca6ef8b4a710",
|
|
14
|
+
"comment": "feat: exports `useDataGridContextValues_unstable`"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "jirivyhnalek@microsoft.com",
|
|
18
|
+
"package": "@fluentui/react-table",
|
|
19
|
+
"commit": "c625afa508c0dead93ea2d3cb698b41dc67ec187",
|
|
20
|
+
"comment": "Add support for column resizing"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-table",
|
|
25
|
+
"comment": "Bump @fluentui/react-avatar to v9.3.2",
|
|
26
|
+
"commit": "8a1405562b3328c408f15e3bf511d3eb6a0c0e66"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-table",
|
|
31
|
+
"comment": "Bump @fluentui/react-checkbox to v9.0.25",
|
|
32
|
+
"commit": "8a1405562b3328c408f15e3bf511d3eb6a0c0e66"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-table",
|
|
37
|
+
"comment": "Bump @fluentui/react-radio to v9.0.23",
|
|
38
|
+
"commit": "8a1405562b3328c408f15e3bf511d3eb6a0c0e66"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-table",
|
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v9.5.0",
|
|
44
|
+
"commit": "8a1405562b3328c408f15e3bf511d3eb6a0c0e66"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Tue, 31 Jan 2023 19:53:58 GMT",
|
|
6
51
|
"tag": "@fluentui/react-table_v9.0.0-rc.4",
|
|
7
52
|
"version": "9.0.0-rc.4",
|
|
8
53
|
"comments": {
|
|
@@ -11,43 +56,43 @@
|
|
|
11
56
|
"author": "beachball",
|
|
12
57
|
"package": "@fluentui/react-table",
|
|
13
58
|
"comment": "Bump @fluentui/react-aria to v9.3.7",
|
|
14
|
-
"commit": "
|
|
59
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
15
60
|
},
|
|
16
61
|
{
|
|
17
62
|
"author": "beachball",
|
|
18
63
|
"package": "@fluentui/react-table",
|
|
19
64
|
"comment": "Bump @fluentui/react-avatar to v9.3.1",
|
|
20
|
-
"commit": "
|
|
65
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
21
66
|
},
|
|
22
67
|
{
|
|
23
68
|
"author": "beachball",
|
|
24
69
|
"package": "@fluentui/react-table",
|
|
25
70
|
"comment": "Bump @fluentui/react-checkbox to v9.0.24",
|
|
26
|
-
"commit": "
|
|
71
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
27
72
|
},
|
|
28
73
|
{
|
|
29
74
|
"author": "beachball",
|
|
30
75
|
"package": "@fluentui/react-table",
|
|
31
76
|
"comment": "Bump @fluentui/react-context-selector to v9.1.7",
|
|
32
|
-
"commit": "
|
|
77
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
33
78
|
},
|
|
34
79
|
{
|
|
35
80
|
"author": "beachball",
|
|
36
81
|
"package": "@fluentui/react-table",
|
|
37
82
|
"comment": "Bump @fluentui/react-radio to v9.0.22",
|
|
38
|
-
"commit": "
|
|
83
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
39
84
|
},
|
|
40
85
|
{
|
|
41
86
|
"author": "beachball",
|
|
42
87
|
"package": "@fluentui/react-table",
|
|
43
88
|
"comment": "Bump @fluentui/react-tabster to v9.4.2",
|
|
44
|
-
"commit": "
|
|
89
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
45
90
|
},
|
|
46
91
|
{
|
|
47
92
|
"author": "beachball",
|
|
48
93
|
"package": "@fluentui/react-table",
|
|
49
94
|
"comment": "Bump @fluentui/react-utilities to v9.5.1",
|
|
50
|
-
"commit": "
|
|
95
|
+
"commit": "794d9e845cb952f597ba786e70cd8d248be62746"
|
|
51
96
|
}
|
|
52
97
|
]
|
|
53
98
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
This log was last generated on Tue, 07 Feb 2023 14:10:44 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-rc.5)
|
|
8
|
+
|
|
9
|
+
Tue, 07 Feb 2023 14:10:44 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-rc.4..@fluentui/react-table_v9.0.0-rc.5)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat: exports `useDataGridContextValues_unstable` ([PR #26627](https://github.com/microsoft/fluentui/pull/26627) by lingfangao@hotmail.com)
|
|
15
|
+
- Add support for column resizing ([PR #26477](https://github.com/microsoft/fluentui/pull/26477) by jirivyhnalek@microsoft.com)
|
|
16
|
+
- Bump @fluentui/react-avatar to v9.3.2 ([PR #26732](https://github.com/microsoft/fluentui/pull/26732) by beachball)
|
|
17
|
+
- Bump @fluentui/react-checkbox to v9.0.25 ([PR #26732](https://github.com/microsoft/fluentui/pull/26732) by beachball)
|
|
18
|
+
- Bump @fluentui/react-radio to v9.0.23 ([PR #26732](https://github.com/microsoft/fluentui/pull/26732) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.5.0 ([PR #26732](https://github.com/microsoft/fluentui/pull/26732) by beachball)
|
|
20
|
+
|
|
7
21
|
## [9.0.0-rc.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-rc.4)
|
|
8
22
|
|
|
9
|
-
Tue, 31 Jan 2023 19:
|
|
23
|
+
Tue, 31 Jan 2023 19:53:58 GMT
|
|
10
24
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-rc.3..@fluentui/react-table_v9.0.0-rc.4)
|
|
11
25
|
|
|
12
26
|
### Changes
|
|
13
27
|
|
|
14
|
-
- Bump @fluentui/react-aria to v9.3.7 ([PR #
|
|
15
|
-
- Bump @fluentui/react-avatar to v9.3.1 ([PR #
|
|
16
|
-
- Bump @fluentui/react-checkbox to v9.0.24 ([PR #
|
|
17
|
-
- Bump @fluentui/react-context-selector to v9.1.7 ([PR #
|
|
18
|
-
- Bump @fluentui/react-radio to v9.0.22 ([PR #
|
|
19
|
-
- Bump @fluentui/react-tabster to v9.4.2 ([PR #
|
|
20
|
-
- Bump @fluentui/react-utilities to v9.5.1 ([PR #
|
|
28
|
+
- Bump @fluentui/react-aria to v9.3.7 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
29
|
+
- Bump @fluentui/react-avatar to v9.3.1 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
30
|
+
- Bump @fluentui/react-checkbox to v9.0.24 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
31
|
+
- Bump @fluentui/react-context-selector to v9.1.7 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
32
|
+
- Bump @fluentui/react-radio to v9.0.22 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
33
|
+
- Bump @fluentui/react-tabster to v9.4.2 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
34
|
+
- Bump @fluentui/react-utilities to v9.5.1 ([PR #26557](https://github.com/microsoft/fluentui/pull/26557) by beachball)
|
|
21
35
|
|
|
22
36
|
## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-rc.3)
|
|
23
37
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,18 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
|
15
15
|
|
|
16
16
|
export declare type CellRenderFunction<TItem = unknown> = (column: TableColumnDefinition<TItem>) => React_2.ReactNode;
|
|
17
17
|
|
|
18
|
+
declare type ColumnSizingTableCellProps = Pick<TableHeaderCellProps, 'style'>;
|
|
19
|
+
|
|
20
|
+
declare type ColumnSizingTableHeaderCellProps = Pick<TableHeaderCellProps, 'style' | 'aside'>;
|
|
21
|
+
|
|
22
|
+
declare interface ColumnWidthState {
|
|
23
|
+
columnId: TableColumnId;
|
|
24
|
+
width: number;
|
|
25
|
+
minWidth: number;
|
|
26
|
+
idealWidth: number;
|
|
27
|
+
padding: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
/**
|
|
19
31
|
* Helper function to create column definition with defaults
|
|
20
32
|
* @param options - column definition options
|
|
@@ -296,6 +308,11 @@ export declare const renderTableHeader_unstable: (state: TableHeaderState) => JS
|
|
|
296
308
|
*/
|
|
297
309
|
export declare const renderTableHeaderCell_unstable: (state: TableHeaderCellState) => JSX.Element;
|
|
298
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Render the final JSX of TableResizeHandle
|
|
313
|
+
*/
|
|
314
|
+
export declare const renderTableResizeHandle_unstable: (state: TableResizeHandleState) => JSX.Element;
|
|
315
|
+
|
|
299
316
|
/**
|
|
300
317
|
* Render the final JSX of TableRow
|
|
301
318
|
*/
|
|
@@ -461,6 +478,18 @@ export declare interface TableColumnDefinition<TItem> {
|
|
|
461
478
|
|
|
462
479
|
export declare type TableColumnId = string | number;
|
|
463
480
|
|
|
481
|
+
export declare type TableColumnSizingOptions = Record<TableColumnId, Partial<Pick<ColumnWidthState, 'minWidth' | 'idealWidth' | 'padding'>> & {
|
|
482
|
+
defaultWidth?: number;
|
|
483
|
+
}>;
|
|
484
|
+
|
|
485
|
+
declare interface TableColumnSizingState {
|
|
486
|
+
getOnMouseDown: (columnId: TableColumnId) => (e: React_2.MouseEvent<HTMLElement>) => void;
|
|
487
|
+
setColumnWidth: (columnId: TableColumnId, newSize: number) => void;
|
|
488
|
+
getColumnWidths: () => ColumnWidthState[];
|
|
489
|
+
getTableHeaderCellProps: (columnId: TableColumnId) => ColumnSizingTableHeaderCellProps;
|
|
490
|
+
getTableCellProps: (columnId: TableColumnId) => ColumnSizingTableCellProps;
|
|
491
|
+
}
|
|
492
|
+
|
|
464
493
|
export declare const TableContextProvider: React_2.Provider<TableContextValue | undefined>;
|
|
465
494
|
|
|
466
495
|
export declare type TableContextValue = {
|
|
@@ -506,6 +535,15 @@ export declare interface TableFeaturesState<TItem> extends Pick<UseTableFeatures
|
|
|
506
535
|
* Table columns
|
|
507
536
|
*/
|
|
508
537
|
columns: TableColumnDefinition<TItem>[];
|
|
538
|
+
/**
|
|
539
|
+
* State and actions to manage column resizing
|
|
540
|
+
*/
|
|
541
|
+
columnSizing_unstable: TableColumnSizingState;
|
|
542
|
+
/**
|
|
543
|
+
* A React.Ref object to be set as a ref for the table.
|
|
544
|
+
* Used with column resizing.
|
|
545
|
+
*/
|
|
546
|
+
tableRef: React_2.Ref<HTMLDivElement>;
|
|
509
547
|
}
|
|
510
548
|
|
|
511
549
|
/**
|
|
@@ -539,6 +577,10 @@ export declare type TableHeaderCellSlots = {
|
|
|
539
577
|
* Button handles correct narration and interactions for sorting;
|
|
540
578
|
*/
|
|
541
579
|
button: NonNullable<Slot<ARIAButtonSlotProps>>;
|
|
580
|
+
/**
|
|
581
|
+
* aside content for anything that should be after main content of the table header cell
|
|
582
|
+
*/
|
|
583
|
+
aside: Slot<'span'>;
|
|
542
584
|
};
|
|
543
585
|
|
|
544
586
|
/**
|
|
@@ -569,6 +611,27 @@ export declare type TableHeaderState = ComponentState<TableHeaderSlots> & Pick<T
|
|
|
569
611
|
*/
|
|
570
612
|
export declare type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;
|
|
571
613
|
|
|
614
|
+
/**
|
|
615
|
+
* TableResizeHandle component - TODO: add more docs
|
|
616
|
+
*/
|
|
617
|
+
export declare const TableResizeHandle: ForwardRefComponent<TableResizeHandleProps>;
|
|
618
|
+
|
|
619
|
+
export declare const tableResizeHandleClassNames: SlotClassNames<TableResizeHandleSlots>;
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* TableResizeHandle Props
|
|
623
|
+
*/
|
|
624
|
+
export declare type TableResizeHandleProps = ComponentProps<TableResizeHandleSlots> & {};
|
|
625
|
+
|
|
626
|
+
export declare type TableResizeHandleSlots = {
|
|
627
|
+
root: Slot<'div'>;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* State used in rendering TableResizeHandle
|
|
632
|
+
*/
|
|
633
|
+
export declare type TableResizeHandleState = ComponentState<TableResizeHandleSlots>;
|
|
634
|
+
|
|
572
635
|
/**
|
|
573
636
|
* TableRow component
|
|
574
637
|
*/
|
|
@@ -784,6 +847,8 @@ export declare const useDataGridCell_unstable: (props: DataGridCellProps, ref: R
|
|
|
784
847
|
*/
|
|
785
848
|
export declare const useDataGridCellStyles_unstable: (state: DataGridCellState) => DataGridCellState;
|
|
786
849
|
|
|
850
|
+
export declare function useDataGridContextValues_unstable(state: DataGridState): DataGridContextValues;
|
|
851
|
+
|
|
787
852
|
/**
|
|
788
853
|
* Create the state required to render DataGridHeader.
|
|
789
854
|
*
|
|
@@ -928,6 +993,13 @@ export declare const useTableCellLayoutStyles_unstable: (state: TableCellLayoutS
|
|
|
928
993
|
*/
|
|
929
994
|
export declare const useTableCellStyles_unstable: (state: TableCellState) => TableCellState;
|
|
930
995
|
|
|
996
|
+
export declare function useTableColumnSizing_unstable<TItem>(params?: UseTableColumnSizingParams): (tableState: TableFeaturesState<TItem>) => TableFeaturesState<TItem>;
|
|
997
|
+
|
|
998
|
+
declare type UseTableColumnSizingParams = {
|
|
999
|
+
columnSizingOptions?: TableColumnSizingOptions;
|
|
1000
|
+
onColumnResize?: (columnId: TableColumnId, width: number) => void;
|
|
1001
|
+
};
|
|
1002
|
+
|
|
931
1003
|
export declare const useTableContext: () => TableContextValue;
|
|
932
1004
|
|
|
933
1005
|
export declare function useTableFeatures<TItem>(options: UseTableFeaturesOptions<TItem>, plugins?: TableFeaturePlugin[]): TableFeaturesState<TItem>;
|
|
@@ -970,6 +1042,22 @@ export declare const useTableHeaderCellStyles_unstable: (state: TableHeaderCellS
|
|
|
970
1042
|
*/
|
|
971
1043
|
export declare const useTableHeaderStyles_unstable: (state: TableHeaderState) => TableHeaderState;
|
|
972
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* Create the state required to render TableResizeHandle.
|
|
1047
|
+
*
|
|
1048
|
+
* The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,
|
|
1049
|
+
* before being passed to renderTableResizeHandle_unstable.
|
|
1050
|
+
*
|
|
1051
|
+
* @param props - props from this instance of TableResizeHandle
|
|
1052
|
+
* @param ref - reference to root HTMLElement of TableResizeHandle
|
|
1053
|
+
*/
|
|
1054
|
+
export declare const useTableResizeHandle_unstable: (props: TableResizeHandleProps, ref: React_2.Ref<HTMLElement>) => TableResizeHandleState;
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* Apply styling to the TableResizeHandle slots based on the state
|
|
1058
|
+
*/
|
|
1059
|
+
export declare const useTableResizeHandleStyles_unstable: (state: TableResizeHandleState) => TableResizeHandleState;
|
|
1060
|
+
|
|
973
1061
|
/**
|
|
974
1062
|
* Create the state required to render TableRow.
|
|
975
1063
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableResizeHandle.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/TableResizeHandle.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC","sourcesContent":["export * from './components/TableResizeHandle/index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './DataGrid';\nexport * from './DataGrid.types';\nexport * from './renderDataGrid';\nexport * from './useDataGrid';\nexport * from './useDataGridStyles';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './DataGrid';\nexport * from './DataGrid.types';\nexport * from './renderDataGrid';\nexport * from './useDataGrid';\nexport * from './useDataGridStyles';\nexport * from './useDataGridContextValues';\n"]}
|
|
@@ -3,7 +3,8 @@ import { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHe
|
|
|
3
3
|
export const dataGridHeaderCellClassNames = {
|
|
4
4
|
root: 'fui-DataGridHeaderCell',
|
|
5
5
|
button: 'fui-DataGridHeaderCell__button',
|
|
6
|
-
sortIcon: 'fui-DataGridHeaderCell__sortIcon'
|
|
6
|
+
sortIcon: 'fui-DataGridHeaderCell__sortIcon',
|
|
7
|
+
aside: 'fui-DataGridHeaderCell__aside'
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* Apply styling to the DataGridHeaderCell slots based on the state
|
|
@@ -17,6 +18,9 @@ export const useDataGridHeaderCellStyles_unstable = state => {
|
|
|
17
18
|
if (state.sortIcon) {
|
|
18
19
|
state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);
|
|
19
20
|
}
|
|
21
|
+
if (state.aside) {
|
|
22
|
+
state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);
|
|
23
|
+
}
|
|
20
24
|
return state;
|
|
21
25
|
};
|
|
22
26
|
//# sourceMappingURL=useDataGridHeaderCellStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,SAASC,iCAAiC,QAAQ,6CAA6C;AAE/F,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE,gCAAgC;EACxCC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,SAASC,iCAAiC,QAAQ,6CAA6C;AAE/F,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE,gCAAgC;EACxCC,QAAQ,EAAE,kCAAkC;EAC5CC,KAAK,EAAE;CACR;AAED;;;AAGA,OAAO,MAAMC,oCAAoC,GAAIC,KAA8B,IAA6B;EAC9GP,iCAAiC,CAACO,KAAK,CAAC;EACxCA,KAAK,CAACL,IAAI,CAACM,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACC,IAAI,EAAEK,KAAK,CAACL,IAAI,CAACM,SAAS,CAAC;EAE5F,IAAID,KAAK,CAACJ,MAAM,EAAE;IAChBI,KAAK,CAACJ,MAAM,CAACK,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACE,MAAM,EAAEI,KAAK,CAACJ,MAAM,CAACK,SAAS,CAAC;;EAGpG,IAAID,KAAK,CAACH,QAAQ,EAAE;IAClBG,KAAK,CAACH,QAAQ,CAACI,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACG,QAAQ,EAAEG,KAAK,CAACH,QAAQ,CAACI,SAAS,CAAC;;EAG1G,IAAID,KAAK,CAACF,KAAK,EAAE;IACfE,KAAK,CAACF,KAAK,CAACG,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACI,KAAK,EAAEE,KAAK,CAACF,KAAK,CAACG,SAAS,CAAC;;EAGjG,OAAOD,KAAK;AACd,CAAC","names":["mergeClasses","useTableHeaderCellStyles_unstable","dataGridHeaderCellClassNames","root","button","sortIcon","aside","useDataGridHeaderCellStyles_unstable","state","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridHeaderCell/useDataGridHeaderCellStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridHeaderCellSlots, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles';\n\nexport const dataGridHeaderCellClassNames: SlotClassNames<DataGridHeaderCellSlots> = {\n root: 'fui-DataGridHeaderCell',\n button: 'fui-DataGridHeaderCell__button',\n sortIcon: 'fui-DataGridHeaderCell__sortIcon',\n aside: 'fui-DataGridHeaderCell__aside',\n};\n\n/**\n * Apply styling to the DataGridHeaderCell slots based on the state\n */\nexport const useDataGridHeaderCellStyles_unstable = (state: DataGridHeaderCellState): DataGridHeaderCellState => {\n useTableHeaderCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);\n\n if (state.button) {\n state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);\n }\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);\n }\n\n if (state.aside) {\n state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);\n }\n\n return state;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderCell.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/TableHeaderCell.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { SortDirection, TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderCellSlots = {\n root: Slot<'th', 'div'>;\n\n sortIcon: Slot<'span'>;\n\n /**\n * Button handles correct narration and interactions for sorting;\n */\n button: NonNullable<Slot<ARIAButtonSlotProps>>;\n};\n\n/**\n * TableHeaderCell Props\n */\nexport type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {\n /**\n * @default undefined\n */\n sortDirection?: SortDirection;\n};\n\n/**\n * State used in rendering TableHeaderCell\n */\nexport type TableHeaderCellState = ComponentState<TableHeaderCellSlots> &\n Pick<TableContextValue, 'noNativeElements' | 'sortable'>;\n"]}
|
|
1
|
+
{"version":3,"file":"TableHeaderCell.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/TableHeaderCell.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { SortDirection, TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderCellSlots = {\n root: Slot<'th', 'div'>;\n\n sortIcon: Slot<'span'>;\n\n /**\n * Button handles correct narration and interactions for sorting;\n */\n button: NonNullable<Slot<ARIAButtonSlotProps>>;\n /**\n * aside content for anything that should be after main content of the table header cell\n */\n aside: Slot<'span'>;\n};\n\n/**\n * TableHeaderCell Props\n */\nexport type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {\n /**\n * @default undefined\n */\n sortDirection?: SortDirection;\n};\n\n/**\n * State used in rendering TableHeaderCell\n */\nexport type TableHeaderCellState = ComponentState<TableHeaderCellSlots> &\n Pick<TableContextValue, 'noNativeElements' | 'sortable'>;\n"]}
|
|
@@ -14,6 +14,8 @@ export const renderTableHeaderCell_unstable = state => {
|
|
|
14
14
|
...slotProps.button
|
|
15
15
|
}, slotProps.root.children, slots.sortIcon && /*#__PURE__*/React.createElement(slots.sortIcon, {
|
|
16
16
|
...slotProps.sortIcon
|
|
17
|
-
}))
|
|
17
|
+
})), slots.aside && /*#__PURE__*/React.createElement(slots.aside, {
|
|
18
|
+
...slotProps.aside
|
|
19
|
+
}));
|
|
18
20
|
};
|
|
19
21
|
//# sourceMappingURL=renderTableHeaderCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,8BAA8B,GAAIC,KAA2B,IAAI;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAuBE,KAAK,CAAC;EAElE,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,gBAC5BN,oBAACI,KAAK,CAACG,MAAM;IAAA,GAAKF,SAAS,CAACE;EAAM,GAC/BF,SAAS,CAACC,IAAI,CAACE,QAAQ,EACvBJ,KAAK,CAACK,QAAQ,iBAAIT,oBAACI,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,CAChD,
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,8BAA8B,GAAIC,KAA2B,IAAI;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAuBE,KAAK,CAAC;EAElE,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,gBAC5BN,oBAACI,KAAK,CAACG,MAAM;IAAA,GAAKF,SAAS,CAACE;EAAM,GAC/BF,SAAS,CAACC,IAAI,CAACE,QAAQ,EACvBJ,KAAK,CAACK,QAAQ,iBAAIT,oBAACI,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,CAChD,EACdL,KAAK,CAACM,KAAK,iBAAIV,oBAACI,KAAK,CAACM,KAAK;IAAA,GAAKL,SAAS,CAACK;EAAK,EAAI,CACzC;AAEjB,CAAC","names":["React","getSlots","renderTableHeaderCell_unstable","state","slots","slotProps","root","button","children","sortIcon","aside"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableHeaderCellState, TableHeaderCellSlots } from './TableHeaderCell.types';\n\n/**\n * Render the final JSX of TableHeaderCell\n */\nexport const renderTableHeaderCell_unstable = (state: TableHeaderCellState) => {\n const { slots, slotProps } = getSlots<TableHeaderCellSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button}>\n {slotProps.root.children}\n {slots.sortIcon && <slots.sortIcon {...slotProps.sortIcon} />}\n </slots.button>\n {slots.aside && <slots.aside {...slotProps.aside} />}\n </slots.root>\n );\n};\n"]}
|
|
@@ -32,7 +32,8 @@ export const useTableHeaderCell_unstable = (props, ref) => {
|
|
|
32
32
|
components: {
|
|
33
33
|
root: rootComponent,
|
|
34
34
|
button: 'button',
|
|
35
|
-
sortIcon: 'span'
|
|
35
|
+
sortIcon: 'span',
|
|
36
|
+
aside: 'span'
|
|
36
37
|
},
|
|
37
38
|
root: getNativeElementProps(rootComponent, {
|
|
38
39
|
ref: useMergedRefs(ref, useFocusWithin()),
|
|
@@ -40,6 +41,7 @@ export const useTableHeaderCell_unstable = (props, ref) => {
|
|
|
40
41
|
'aria-sort': sortable ? (_b = props.sortDirection) !== null && _b !== void 0 ? _b : 'none' : undefined,
|
|
41
42
|
...props
|
|
42
43
|
}),
|
|
44
|
+
aside: resolveShorthand(props.aside),
|
|
43
45
|
sortIcon: resolveShorthand(props.sortIcon, {
|
|
44
46
|
required: !!props.sortDirection,
|
|
45
47
|
defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,2BAA2B;AAClG,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,uBAAuB;AAExE,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,sBAAsB,QAAQ,sBAAsB;AAE7D,MAAMC,SAAS,GAAG;EAChBC,SAAS,eAAEV,oBAACK,cAAc;IAACM,QAAQ,EAAE;EAAE,EAAI;EAC3CC,UAAU,eAAEZ,oBAACM,gBAAgB;IAACK,QAAQ,EAAE;EAAE;CAC3C;AAED;;;;;;;;;AASA,OAAO,MAAME,2BAA2B,GAAG,CACzCC,KAA2B,EAC3BC,GAA2B,KACH;;EACxB,MAAM;IAAEC,gBAAgB;IAAEC;EAAQ,CAAE,GAAGV,eAAe,EAAE;EAExD,MAAMW,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIH,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,OAAO;IACLI,UAAU,EAAE;MACVC,IAAI,EAAEH,aAAa;MACnBI,MAAM,EAAE,QAAQ;MAChBC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,2BAA2B;AAClG,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,uBAAuB;AAExE,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,sBAAsB,QAAQ,sBAAsB;AAE7D,MAAMC,SAAS,GAAG;EAChBC,SAAS,eAAEV,oBAACK,cAAc;IAACM,QAAQ,EAAE;EAAE,EAAI;EAC3CC,UAAU,eAAEZ,oBAACM,gBAAgB;IAACK,QAAQ,EAAE;EAAE;CAC3C;AAED;;;;;;;;;AASA,OAAO,MAAME,2BAA2B,GAAG,CACzCC,KAA2B,EAC3BC,GAA2B,KACH;;EACxB,MAAM;IAAEC,gBAAgB;IAAEC;EAAQ,CAAE,GAAGV,eAAe,EAAE;EAExD,MAAMW,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIH,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,OAAO;IACLI,UAAU,EAAE;MACVC,IAAI,EAAEH,aAAa;MACnBI,MAAM,EAAE,QAAQ;MAChBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE;KACR;IACDH,IAAI,EAAEpB,qBAAqB,CAACiB,aAAa,EAAE;MACzCH,GAAG,EAAEZ,aAAa,CAACY,GAAG,EAAEX,cAAc,EAAE,CAAC;MACzCqB,IAAI,EAAEP,aAAa,KAAK,KAAK,GAAG,cAAc,GAAGQ,SAAS;MAC1D,WAAW,EAAET,QAAQ,GAAG,WAAK,CAACU,aAAa,mCAAI,MAAM,GAAGD,SAAS;MACjE,GAAGZ;KACJ,CAAC;IACFU,KAAK,EAAEtB,gBAAgB,CAACY,KAAK,CAACU,KAAK,CAAC;IACpCD,QAAQ,EAAErB,gBAAgB,CAACY,KAAK,CAACS,QAAQ,EAAE;MACzCK,QAAQ,EAAE,CAAC,CAACd,KAAK,CAACa,aAAa;MAC/BE,YAAY,EAAE;QAAEC,QAAQ,EAAEhB,KAAK,CAACa,aAAa,GAAGlB,SAAS,CAACK,KAAK,CAACa,aAAa,CAAC,GAAGD;MAAS;KAC3F,CAAC;IACFJ,MAAM,EAAEd,sBAAsB,CAACM,KAAK,CAACQ,MAAM,EAAE;MAC3CM,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZJ,IAAI,EAAE,cAAc;QACpBM,QAAQ,EAAE,CAAC,CAAC;QACZC,IAAI,EAAE,QAAQ;QACd,IAAIf,QAAQ,IAAI;UACdQ,IAAI,EAAEC,SAAS;UACfK,QAAQ,EAAEL;SACX;;KAEJ,CAAC;IACFT,QAAQ;IACRD;GACD;AACH,CAAC","names":["React","getNativeElementProps","resolveShorthand","useMergedRefs","useFocusWithin","ArrowUpRegular","ArrowDownRegular","useTableContext","useARIAButtonShorthand","sortIcons","ascending","fontSize","descending","useTableHeaderCell_unstable","props","ref","noNativeElements","sortable","rootComponent","as","components","root","button","sortIcon","aside","role","undefined","sortDirection","required","defaultProps","children","tabIndex","type"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { ArrowUpRegular, ArrowDownRegular } from '@fluentui/react-icons';\nimport type { TableHeaderCellProps, TableHeaderCellState } from './TableHeaderCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\n\nconst sortIcons = {\n ascending: <ArrowUpRegular fontSize={12} />,\n descending: <ArrowDownRegular fontSize={12} />,\n};\n\n/**\n * Create the state required to render TableHeaderCell.\n *\n * The returned state can be modified with hooks such as useTableHeaderCellStyles_unstable,\n * before being passed to renderTableHeaderCell_unstable.\n *\n * @param props - props from this instance of TableHeaderCell\n * @param ref - reference to root HTMLElement of TableHeaderCell\n */\nexport const useTableHeaderCell_unstable = (\n props: TableHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): TableHeaderCellState => {\n const { noNativeElements, sortable } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'th';\n return {\n components: {\n root: rootComponent,\n button: 'button',\n sortIcon: 'span',\n aside: 'span',\n },\n root: getNativeElementProps(rootComponent, {\n ref: useMergedRefs(ref, useFocusWithin()),\n role: rootComponent === 'div' ? 'columnheader' : undefined,\n 'aria-sort': sortable ? props.sortDirection ?? 'none' : undefined,\n ...props,\n }),\n aside: resolveShorthand(props.aside),\n sortIcon: resolveShorthand(props.sortIcon, {\n required: !!props.sortDirection,\n defaultProps: { children: props.sortDirection ? sortIcons[props.sortDirection] : undefined },\n }),\n button: useARIAButtonShorthand(props.button, {\n required: true,\n defaultProps: {\n role: 'presentation',\n tabIndex: -1,\n type: 'button',\n ...(sortable && {\n role: undefined,\n tabIndex: undefined,\n }),\n },\n }),\n sortable,\n noNativeElements,\n };\n};\n"]}
|
|
@@ -5,7 +5,8 @@ export const tableHeaderCellClassName = 'fui-TableHeaderCell';
|
|
|
5
5
|
export const tableHeaderCellClassNames = {
|
|
6
6
|
root: 'fui-TableHeaderCell',
|
|
7
7
|
button: 'fui-TableHeaderCell__button',
|
|
8
|
-
sortIcon: 'fui-TableHeaderCell__sortIcon'
|
|
8
|
+
sortIcon: 'fui-TableHeaderCell__sortIcon',
|
|
9
|
+
aside: 'fui-TableHeaderCell__aside'
|
|
9
10
|
};
|
|
10
11
|
const useTableLayoutStyles = /*#__PURE__*/__styles({
|
|
11
12
|
root: {
|
|
@@ -41,7 +42,8 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
41
42
|
pehzd3: ["fs9qmxf", "f187m4uq"],
|
|
42
43
|
B8osjzx: ["f187m4uq", "fs9qmxf"],
|
|
43
44
|
u7xebq: ["f145mzao", "f1uha7eq"],
|
|
44
|
-
Blsv9te: ["f1uha7eq", "f145mzao"]
|
|
45
|
+
Blsv9te: ["f1uha7eq", "f145mzao"],
|
|
46
|
+
qhf8xq: "f10pi13n"
|
|
45
47
|
},
|
|
46
48
|
rootInteractive: {
|
|
47
49
|
Jwef8y: "f1t94bn6",
|
|
@@ -89,9 +91,10 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
89
91
|
mc9l5x: "f22iagw",
|
|
90
92
|
Bt984gj: "f122n59",
|
|
91
93
|
z8tnut: "fclwglc"
|
|
92
|
-
}
|
|
94
|
+
},
|
|
95
|
+
resizeHandle: {}
|
|
93
96
|
}, {
|
|
94
|
-
d: [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fhix6mv[data-fui-focus-within]:focus-within{outline-width:2px;}", ".fha7anx[data-fui-focus-within]:focus-within{outline-style:solid;}", ".f1fmzww4[data-fui-focus-within]:focus-within{outline-color:var(--colorStrokeFocus2);}", ".fs9qmxf[data-fui-focus-within]:focus-within{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f187m4uq[data-fui-focus-within]:focus-within{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f145mzao[data-fui-focus-within]:focus-within{border-top-right-radius:var(--borderRadiusMedium);}", ".f1uha7eq[data-fui-focus-within]:focus-within{border-top-left-radius:var(--borderRadiusMedium);}", ".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;}", ".
|
|
97
|
+
d: [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fhix6mv[data-fui-focus-within]:focus-within{outline-width:2px;}", ".fha7anx[data-fui-focus-within]:focus-within{outline-style:solid;}", ".f1fmzww4[data-fui-focus-within]:focus-within{outline-color:var(--colorStrokeFocus2);}", ".fs9qmxf[data-fui-focus-within]:focus-within{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f187m4uq[data-fui-focus-within]:focus-within{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f145mzao[data-fui-focus-within]:focus-within{border-top-right-radius:var(--borderRadiusMedium);}", ".f1uha7eq[data-fui-focus-within]:focus-within{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".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;}", ".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;}", ".f1ufnopg{-webkit-column-gap:var(--spacingHorizontalXS);column-gap:var(--spacingHorizontalXS);}", ".f14sijuj{row-gap:var(--spacingHorizontalXS);}", ".f1nxs5xn{min-height:32px;}", ".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;}", ".f1s6fcnf{outline-style:none;}", ".f1k6fduh{cursor:pointer;}", ".fclwglc{padding-top:var(--spacingVerticalXXS);}"],
|
|
95
98
|
h: [".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
|
96
99
|
a: [".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
|
97
100
|
});
|
|
@@ -109,6 +112,9 @@ export const useTableHeaderCellStyles_unstable = state => {
|
|
|
109
112
|
if (state.sortIcon) {
|
|
110
113
|
state.sortIcon.className = mergeClasses(tableHeaderCellClassNames.sortIcon, styles.sortIcon, state.sortIcon.className);
|
|
111
114
|
}
|
|
115
|
+
if (state.aside) {
|
|
116
|
+
state.aside.className = mergeClasses(tableHeaderCellClassNames.aside, styles.resizeHandle, state.aside.className);
|
|
117
|
+
}
|
|
112
118
|
return state;
|
|
113
119
|
};
|
|
114
120
|
//# sourceMappingURL=useTableHeaderCellStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,SAASC,+BAA+B,QAAQ,yBAAyB;AAGzE,OAAO,MAAMC,wBAAwB,GAAG,qBAAqB;AAC7D,OAAO,MAAMC,yBAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,MAAM,EAAE,6BAA6B;EACrCC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,SAASC,+BAA+B,QAAQ,yBAAyB;AAGzE,OAAO,MAAMC,wBAAwB,GAAG,qBAAqB;AAC7D,OAAO,MAAMC,yBAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,MAAM,EAAE,6BAA6B;EACrCC,QAAQ,EAAE,+BAA+B;EACzCC,KAAK,EAAE;CACR;AAED,MAAMC,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAK3B;AAEF,MAAMC,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAM1B;AAEF;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;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;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EA6DhB;AAEF;;;AAGA,OAAO,MAAMC,iCAAiC,GAAIC,KAA2B,IAA0B;EACrG,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAEP,oBAAoB,EAAE;IAC7BQ,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACR,IAAI,CAACa,SAAS,GAAGnB,YAAY,CACjCK,yBAAyB,CAACC,IAAI,EAC9BS,MAAM,CAACT,IAAI,EACXQ,KAAK,CAACM,QAAQ,IAAIL,MAAM,CAACM,eAAe,EACxCP,KAAK,CAACQ,gBAAgB,GAAGN,YAAY,CAACE,IAAI,CAACZ,IAAI,GAAGU,YAAY,CAACC,KAAK,CAACX,IAAI,EACzEQ,KAAK,CAACR,IAAI,CAACa,SAAS,CACrB;EACDL,KAAK,CAACP,MAAM,CAACY,SAAS,GAAGnB,YAAY,CACnCK,yBAAyB,CAACE,MAAM,EAChCQ,MAAM,CAACQ,WAAW,EAClBR,MAAM,CAACR,MAAM,EACbO,KAAK,CAACM,QAAQ,IAAIL,MAAM,CAACK,QAAQ,EACjCN,KAAK,CAACP,MAAM,CAACY,SAAS,CACvB;EAED,IAAIL,KAAK,CAACN,QAAQ,EAAE;IAClBM,KAAK,CAACN,QAAQ,CAACW,SAAS,GAAGnB,YAAY,CACrCK,yBAAyB,CAACG,QAAQ,EAClCO,MAAM,CAACP,QAAQ,EACfM,KAAK,CAACN,QAAQ,CAACW,SAAS,CACzB;;EAGH,IAAIL,KAAK,CAACL,KAAK,EAAE;IACfK,KAAK,CAACL,KAAK,CAACU,SAAS,GAAGnB,YAAY,CAACK,yBAAyB,CAACI,KAAK,EAAEM,MAAM,CAACS,YAAY,EAAEV,KAAK,CAACL,KAAK,CAACU,SAAS,CAAC;;EAGnH,OAAOL,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","tokens","createCustomFocusIndicatorStyle","tableHeaderCellClassName","tableHeaderCellClassNames","root","button","sortIcon","aside","useTableLayoutStyles","useFlexLayoutStyles","useStyles","useTableHeaderCellStyles_unstable","state","styles","layoutStyles","table","flex","className","sortable","rootInteractive","noNativeElements","resetButton","resizeHandle"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCellStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\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 aside: 'fui-TableHeaderCell__aside',\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 ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus-within', enableOutline: true },\n ),\n position: 'relative',\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\n button: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexGrow: 1,\n height: '100%',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalXS),\n minHeight: '32px',\n ...shorthands.flex(1, 1, '0px'),\n outlineStyle: 'none',\n },\n\n sortable: {\n cursor: 'pointer',\n },\n\n sortIcon: {\n display: 'flex',\n alignItems: 'center',\n paddingTop: tokens.spacingVerticalXXS,\n },\n\n resizeHandle: {},\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 if (state.aside) {\n state.aside.className = mergeClasses(tableHeaderCellClassNames.aside, styles.resizeHandle, state.aside.className);\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTableResizeHandle_unstable } from './useTableResizeHandle';
|
|
3
|
+
import { renderTableResizeHandle_unstable } from './renderTableResizeHandle';
|
|
4
|
+
import { useTableResizeHandleStyles_unstable } from './useTableResizeHandleStyles';
|
|
5
|
+
/**
|
|
6
|
+
* TableResizeHandle component - TODO: add more docs
|
|
7
|
+
*/
|
|
8
|
+
export const TableResizeHandle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
|
+
const state = useTableResizeHandle_unstable(props, ref);
|
|
10
|
+
useTableResizeHandleStyles_unstable(state);
|
|
11
|
+
return renderTableResizeHandle_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
TableResizeHandle.displayName = 'TableResizeHandle';
|
|
14
|
+
//# sourceMappingURL=TableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,gCAAgC,QAAQ,2BAA2B;AAC5E,SAASC,mCAAmC,QAAQ,8BAA8B;AAIlF;;;AAGA,OAAO,MAAMC,iBAAiB,gBAAgDJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC5G,MAAMC,KAAK,GAAGP,6BAA6B,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEvDJ,mCAAmC,CAACK,KAAK,CAAC;EAC1C,OAAON,gCAAgC,CAACM,KAAK,CAAC;AAChD,CAAC,CAAC;AAEFJ,iBAAiB,CAACK,WAAW,GAAG,mBAAmB","names":["React","useTableResizeHandle_unstable","renderTableResizeHandle_unstable","useTableResizeHandleStyles_unstable","TableResizeHandle","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/TableResizeHandle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableResizeHandle_unstable } from './useTableResizeHandle';\nimport { renderTableResizeHandle_unstable } from './renderTableResizeHandle';\nimport { useTableResizeHandleStyles_unstable } from './useTableResizeHandleStyles';\nimport type { TableResizeHandleProps } from './TableResizeHandle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableResizeHandle component - TODO: add more docs\n */\nexport const TableResizeHandle: ForwardRefComponent<TableResizeHandleProps> = React.forwardRef((props, ref) => {\n const state = useTableResizeHandle_unstable(props, ref);\n\n useTableResizeHandleStyles_unstable(state);\n return renderTableResizeHandle_unstable(state);\n});\n\nTableResizeHandle.displayName = 'TableResizeHandle';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableResizeHandle.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/TableResizeHandle.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableResizeHandleSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * TableResizeHandle Props\n */\nexport type TableResizeHandleProps = ComponentProps<TableResizeHandleSlots> & {};\n\n/**\n * State used in rendering TableResizeHandle\n */\nexport type TableResizeHandleState = ComponentState<TableResizeHandleSlots>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './TableResizeHandle';\nexport * from './TableResizeHandle.types';\nexport * from './renderTableResizeHandle';\nexport * from './useTableResizeHandle';\nexport * from './useTableResizeHandleStyles';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of TableResizeHandle
|
|
5
|
+
*/
|
|
6
|
+
export const renderTableResizeHandle_unstable = state => {
|
|
7
|
+
const {
|
|
8
|
+
slots,
|
|
9
|
+
slotProps
|
|
10
|
+
} = getSlots(state);
|
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
|
12
|
+
...slotProps.root
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=renderTableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,gCAAgC,GAAIC,KAA6B,IAAI;EAChF,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAyBE,KAAK,CAAC;EACpE,oBAAOH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,EAAI;AAC3C,CAAC","names":["React","getSlots","renderTableResizeHandle_unstable","state","slots","slotProps","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableResizeHandleState, TableResizeHandleSlots } from './TableResizeHandle.types';\n\n/**\n * Render the final JSX of TableResizeHandle\n */\nexport const renderTableResizeHandle_unstable = (state: TableResizeHandleState) => {\n const { slots, slotProps } = getSlots<TableResizeHandleSlots>(state);\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getNativeElementProps, useEventCallback } from '@fluentui/react-utilities';
|
|
2
|
+
/**
|
|
3
|
+
* Create the state required to render TableResizeHandle.
|
|
4
|
+
*
|
|
5
|
+
* The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,
|
|
6
|
+
* before being passed to renderTableResizeHandle_unstable.
|
|
7
|
+
*
|
|
8
|
+
* @param props - props from this instance of TableResizeHandle
|
|
9
|
+
* @param ref - reference to root HTMLElement of TableResizeHandle
|
|
10
|
+
*/
|
|
11
|
+
export const useTableResizeHandle_unstable = (props, ref) => {
|
|
12
|
+
const onClick = useEventCallback(event => {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
components: {
|
|
19
|
+
root: 'div'
|
|
20
|
+
},
|
|
21
|
+
root: getNativeElementProps('div', {
|
|
22
|
+
ref,
|
|
23
|
+
...props,
|
|
24
|
+
onClick
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=useTableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGnF;;;;;;;;;AASA,OAAO,MAAMC,6BAA6B,GAAG,CAC3CC,KAA6B,EAC7BC,GAA2B,KACD;EAC1B,MAAMC,OAAO,GAAGJ,gBAAgB,CAAEK,KAAuC,IAAI;;IAC3E,WAAK,CAACD,OAAO,+CAAbF,KAAK,EAAWG,KAAK,CAAC;IACtBA,KAAK,CAACC,eAAe,EAAE;EACzB,CAAC,CAAC;EACF,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAET,qBAAqB,CAAC,KAAK,EAAE;MACjCI,GAAG;MACH,GAAGD,KAAK;MACRE;KACD;GACF;AACH,CAAC","names":["getNativeElementProps","useEventCallback","useTableResizeHandle_unstable","props","ref","onClick","event","stopPropagation","components","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback } from '@fluentui/react-utilities';\nimport type { TableResizeHandleProps, TableResizeHandleState } from './TableResizeHandle.types';\n\n/**\n * Create the state required to render TableResizeHandle.\n *\n * The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,\n * before being passed to renderTableResizeHandle_unstable.\n *\n * @param props - props from this instance of TableResizeHandle\n * @param ref - reference to root HTMLElement of TableResizeHandle\n */\nexport const useTableResizeHandle_unstable = (\n props: TableResizeHandleProps,\n ref: React.Ref<HTMLElement>,\n): TableResizeHandleState => {\n const onClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n props.onClick?.(event);\n event.stopPropagation();\n });\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n onClick,\n }),\n };\n};\n"]}
|