@fluentui/react-table 9.11.2 → 9.11.4
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.md +39 -4
- package/dist/index.d.ts +1 -1
- package/lib/components/DataGridCell/useDataGridCell.js +4 -2
- package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +4 -2
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridRow/useDataGridRow.js +19 -3
- package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
- package/lib/components/TableRow/useTableRowStyles.styles.js +15 -2
- package/lib/components/TableRow/useTableRowStyles.styles.js.map +1 -1
- package/lib/contexts/dataGridContext.js +1 -1
- package/lib/contexts/dataGridContext.js.map +1 -1
- package/lib/hooks/useKeyboardResizing.js +8 -2
- package/lib/hooks/useKeyboardResizing.js.map +1 -1
- package/lib/hooks/useTableColumnResizeMouseHandler.js +12 -6
- package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
- package/lib/hooks/useTableColumnResizeState.js +9 -3
- package/lib/hooks/useTableColumnResizeState.js.map +1 -1
- package/lib/hooks/useTableColumnSizing.js +20 -11
- package/lib/hooks/useTableColumnSizing.js.map +1 -1
- package/lib/hooks/useTableFeatures.js +6 -1
- package/lib/hooks/useTableFeatures.js.map +1 -1
- package/lib/hooks/useTableSort.js +14 -6
- package/lib/hooks/useTableSort.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js +4 -2
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +4 -2
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js +18 -2
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.styles.js +36 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/dataGridContext.js +3 -0
- package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
- package/lib-commonjs/hooks/useKeyboardResizing.js +8 -2
- package/lib-commonjs/hooks/useKeyboardResizing.js.map +1 -1
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js +12 -6
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
- package/lib-commonjs/hooks/useTableColumnResizeState.js +9 -3
- package/lib-commonjs/hooks/useTableColumnResizeState.js.map +1 -1
- package/lib-commonjs/hooks/useTableColumnSizing.js +20 -11
- package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -1
- package/lib-commonjs/hooks/useTableFeatures.js +6 -1
- package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
- package/lib-commonjs/hooks/useTableSort.js +13 -5
- package/lib-commonjs/hooks/useTableSort.js.map +1 -1
- package/package.json +10 -10
|
@@ -51,17 +51,19 @@ function useTableColumnSizingState(tableState, params) {
|
|
|
51
51
|
}, [
|
|
52
52
|
toggleInteractiveMode
|
|
53
53
|
]);
|
|
54
|
+
const { getColumnById, setColumnWidth, getColumns } = columnResizeState;
|
|
55
|
+
const { getOnMouseDown } = mouseHandler;
|
|
54
56
|
return {
|
|
55
57
|
...tableState,
|
|
56
58
|
tableRef: measureElementRef,
|
|
57
59
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
58
60
|
columnSizing_unstable: {
|
|
59
|
-
getOnMouseDown
|
|
60
|
-
setColumnWidth: (columnId, w)=>
|
|
61
|
+
getOnMouseDown,
|
|
62
|
+
setColumnWidth: (columnId, w)=>setColumnWidth(undefined, {
|
|
61
63
|
columnId,
|
|
62
64
|
width: w
|
|
63
65
|
}),
|
|
64
|
-
getColumnWidths:
|
|
66
|
+
getColumnWidths: getColumns,
|
|
65
67
|
getTableProps: (props = {})=>{
|
|
66
68
|
return {
|
|
67
69
|
...props,
|
|
@@ -71,26 +73,33 @@ function useTableColumnSizingState(tableState, params) {
|
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
75
|
},
|
|
74
|
-
getTableHeaderCellProps: (columnId)=>{
|
|
76
|
+
getTableHeaderCellProps: React.useCallback((columnId)=>{
|
|
75
77
|
var _columns_;
|
|
76
|
-
const col =
|
|
78
|
+
const col = getColumnById(columnId);
|
|
77
79
|
const isLastColumn = ((_columns_ = columns[columns.length - 1]) === null || _columns_ === void 0 ? void 0 : _columns_.columnId) === columnId;
|
|
78
80
|
const aside = isLastColumn ? null : /*#__PURE__*/ React.createElement(TableResizeHandle, {
|
|
79
|
-
onMouseDown:
|
|
80
|
-
onTouchStart:
|
|
81
|
+
onMouseDown: getOnMouseDown(columnId),
|
|
82
|
+
onTouchStart: getOnMouseDown(columnId),
|
|
81
83
|
...getKeyboardResizingProps(columnId, (col === null || col === void 0 ? void 0 : col.width) || 0)
|
|
82
84
|
});
|
|
83
85
|
return col ? {
|
|
84
86
|
style: getColumnStyles(col),
|
|
85
87
|
aside
|
|
86
88
|
} : {};
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
}, [
|
|
90
|
+
getColumnById,
|
|
91
|
+
columns,
|
|
92
|
+
getKeyboardResizingProps,
|
|
93
|
+
getOnMouseDown
|
|
94
|
+
]),
|
|
95
|
+
getTableCellProps: React.useCallback((columnId)=>{
|
|
96
|
+
const col = getColumnById(columnId);
|
|
90
97
|
return col ? {
|
|
91
98
|
style: getColumnStyles(col)
|
|
92
99
|
} : {};
|
|
93
|
-
},
|
|
100
|
+
}, [
|
|
101
|
+
getColumnById
|
|
102
|
+
]),
|
|
94
103
|
enableKeyboardMode
|
|
95
104
|
}
|
|
96
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableColumnSizing.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TableResizeHandle } from '../TableResizeHandle';\nimport {\n ColumnWidthState,\n EnableKeyboardModeOnChangeCallback,\n TableColumnId,\n TableColumnSizingState,\n TableFeaturesState,\n UseTableColumnSizingParams,\n} from './types';\n\nimport { useMeasureElement } from './useMeasureElement';\nimport { useTableColumnResizeMouseHandler } from './useTableColumnResizeMouseHandler';\nimport { useTableColumnResizeState } from './useTableColumnResizeState';\nimport { useKeyboardResizing } from './useKeyboardResizing';\n\nexport const defaultColumnSizingState: TableColumnSizingState = {\n getColumnWidths: () => [],\n getOnMouseDown: () => () => null,\n setColumnWidth: () => null,\n getTableProps: () => ({}),\n getTableHeaderCellProps: () => ({ style: {}, columnId: '' }),\n getTableCellProps: () => ({ style: {}, columnId: '' }),\n enableKeyboardMode: () => () => null,\n};\n\nexport function useTableColumnSizing_unstable<TItem>(params?: UseTableColumnSizingParams) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableColumnSizingState(tableState, params);\n}\n\nfunction getColumnStyles(column: ColumnWidthState): React.CSSProperties {\n const width = column.width;\n\n return {\n // native styles\n width,\n // non-native element styles (flex layout)\n minWidth: width,\n maxWidth: width,\n };\n}\n\nfunction useTableColumnSizingState<TItem>(\n tableState: TableFeaturesState<TItem>,\n params?: UseTableColumnSizingParams,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n\n // Gets the container width\n const { width, measureElementRef } = useMeasureElement();\n // Creates the state based on columns and available containerWidth\n const columnResizeState = useTableColumnResizeState(columns, width + (params?.containerWidthOffset || 0), params);\n // Creates the mouse handler and attaches the state to it\n const mouseHandler = useTableColumnResizeMouseHandler(columnResizeState);\n // Creates the keyboard handler for resizing columns\n const { toggleInteractiveMode, getKeyboardResizingProps } = useKeyboardResizing(columnResizeState);\n\n const enableKeyboardMode = React.useCallback(\n (columnId: TableColumnId, onChange?: EnableKeyboardModeOnChangeCallback) =>\n (e: React.MouseEvent | React.TouchEvent) => {\n e.preventDefault();\n e.nativeEvent.stopPropagation();\n toggleInteractiveMode(columnId, onChange);\n },\n [toggleInteractiveMode],\n );\n\n return {\n ...tableState,\n tableRef: measureElementRef,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: {\n getOnMouseDown
|
|
1
|
+
{"version":3,"sources":["useTableColumnSizing.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TableResizeHandle } from '../TableResizeHandle';\nimport {\n ColumnWidthState,\n EnableKeyboardModeOnChangeCallback,\n TableColumnId,\n TableColumnSizingState,\n TableFeaturesState,\n UseTableColumnSizingParams,\n} from './types';\n\nimport { useMeasureElement } from './useMeasureElement';\nimport { useTableColumnResizeMouseHandler } from './useTableColumnResizeMouseHandler';\nimport { useTableColumnResizeState } from './useTableColumnResizeState';\nimport { useKeyboardResizing } from './useKeyboardResizing';\n\nexport const defaultColumnSizingState: TableColumnSizingState = {\n getColumnWidths: () => [],\n getOnMouseDown: () => () => null,\n setColumnWidth: () => null,\n getTableProps: () => ({}),\n getTableHeaderCellProps: () => ({ style: {}, columnId: '' }),\n getTableCellProps: () => ({ style: {}, columnId: '' }),\n enableKeyboardMode: () => () => null,\n};\n\nexport function useTableColumnSizing_unstable<TItem>(params?: UseTableColumnSizingParams) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableColumnSizingState(tableState, params);\n}\n\nfunction getColumnStyles(column: ColumnWidthState): React.CSSProperties {\n const width = column.width;\n\n return {\n // native styles\n width,\n // non-native element styles (flex layout)\n minWidth: width,\n maxWidth: width,\n };\n}\n\nfunction useTableColumnSizingState<TItem>(\n tableState: TableFeaturesState<TItem>,\n params?: UseTableColumnSizingParams,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n\n // Gets the container width\n const { width, measureElementRef } = useMeasureElement();\n // Creates the state based on columns and available containerWidth\n const columnResizeState = useTableColumnResizeState(columns, width + (params?.containerWidthOffset || 0), params);\n // Creates the mouse handler and attaches the state to it\n const mouseHandler = useTableColumnResizeMouseHandler(columnResizeState);\n // Creates the keyboard handler for resizing columns\n const { toggleInteractiveMode, getKeyboardResizingProps } = useKeyboardResizing(columnResizeState);\n\n const enableKeyboardMode = React.useCallback(\n (columnId: TableColumnId, onChange?: EnableKeyboardModeOnChangeCallback) =>\n (e: React.MouseEvent | React.TouchEvent) => {\n e.preventDefault();\n e.nativeEvent.stopPropagation();\n toggleInteractiveMode(columnId, onChange);\n },\n [toggleInteractiveMode],\n );\n\n const { getColumnById, setColumnWidth, getColumns } = columnResizeState;\n const { getOnMouseDown } = mouseHandler;\n return {\n ...tableState,\n tableRef: measureElementRef,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: {\n getOnMouseDown,\n setColumnWidth: (columnId: TableColumnId, w: number) => setColumnWidth(undefined, { columnId, width: w }),\n getColumnWidths: getColumns,\n getTableProps: (props = {}) => {\n return {\n ...props,\n style: {\n minWidth: 'fit-content',\n ...(props.style || {}),\n },\n };\n },\n getTableHeaderCellProps: React.useCallback(\n (columnId: TableColumnId) => {\n const col = getColumnById(columnId);\n const isLastColumn = columns[columns.length - 1]?.columnId === columnId;\n\n const aside = isLastColumn ? null : (\n <TableResizeHandle\n onMouseDown={getOnMouseDown(columnId)}\n onTouchStart={getOnMouseDown(columnId)}\n {...getKeyboardResizingProps(columnId, col?.width || 0)}\n />\n );\n\n return col\n ? {\n style: getColumnStyles(col),\n aside,\n }\n : {};\n },\n [getColumnById, columns, getKeyboardResizingProps, getOnMouseDown],\n ),\n getTableCellProps: React.useCallback(\n (columnId: TableColumnId) => {\n const col = getColumnById(columnId);\n return col ? { style: getColumnStyles(col) } : {};\n },\n [getColumnById],\n ),\n enableKeyboardMode,\n },\n };\n}\n"],"names":["React","TableResizeHandle","useMeasureElement","useTableColumnResizeMouseHandler","useTableColumnResizeState","useKeyboardResizing","defaultColumnSizingState","getColumnWidths","getOnMouseDown","setColumnWidth","getTableProps","getTableHeaderCellProps","style","columnId","getTableCellProps","enableKeyboardMode","useTableColumnSizing_unstable","params","tableState","useTableColumnSizingState","getColumnStyles","column","width","minWidth","maxWidth","columns","measureElementRef","columnResizeState","containerWidthOffset","mouseHandler","toggleInteractiveMode","getKeyboardResizingProps","useCallback","onChange","e","preventDefault","nativeEvent","stopPropagation","getColumnById","getColumns","tableRef","columnSizing_unstable","w","undefined","props","col","isLastColumn","length","aside","onMouseDown","onTouchStart"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,uBAAuB;AAUzD,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,gCAAgC,QAAQ,qCAAqC;AACtF,SAASC,yBAAyB,QAAQ,8BAA8B;AACxE,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,OAAO,MAAMC,2BAAmD;IAC9DC,iBAAiB,IAAM,EAAE;IACzBC,gBAAgB,IAAM,IAAM;IAC5BC,gBAAgB,IAAM;IACtBC,eAAe,IAAO,CAAA,CAAC,CAAA;IACvBC,yBAAyB,IAAO,CAAA;YAAEC,OAAO,CAAC;YAAGC,UAAU;QAAG,CAAA;IAC1DC,mBAAmB,IAAO,CAAA;YAAEF,OAAO,CAAC;YAAGC,UAAU;QAAG,CAAA;IACpDE,oBAAoB,IAAM,IAAM;AAClC,EAAE;AAEF,OAAO,SAASC,8BAAqCC,MAAmC;IACtF,4EAA4E;IAC5E,sDAAsD;IACtD,OAAO,CAACC,aAA0CC,0BAA0BD,YAAYD;AAC1F;AAEA,SAASG,gBAAgBC,MAAwB;IAC/C,MAAMC,QAAQD,OAAOC,KAAK;IAE1B,OAAO;QACL,gBAAgB;QAChBA;QACA,0CAA0C;QAC1CC,UAAUD;QACVE,UAAUF;IACZ;AACF;AAEA,SAASH,0BACPD,UAAqC,EACrCD,MAAmC;IAEnC,MAAM,EAAEQ,OAAO,EAAE,GAAGP;IAEpB,2BAA2B;IAC3B,M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BqC,cAAc1C,eAAeK;oBAC5B,GAAGkB,yBAAyBlB,UAAUgC,CAAAA,gBAAAA,0BAAAA,IAAKvB,KAAK,KAAI,EAAE;;gBAI3D,OAAOuB,MACH;oBACEjC,OAAOQ,gBAAgByB;oBACvBG;gBACF,IACA,CAAC;YACP,GACA;gBAACV;gBAAeb;gBAASM;gBAA0BvB;aAAe;YAEpEM,mBAAmBd,MAAMgC,WAAW,CAClC,CAACnB;gBACC,MAAMgC,MAAMP,cAAczB;gBAC1B,OAAOgC,MAAM;oBAAEjC,OAAOQ,gBAAgByB;gBAAK,IAAI,CAAC;YAClD,GACA;gBAACP;aAAc;YAEjBvB;QACF;IACF;AACF"}
|
|
@@ -16,13 +16,18 @@ export const defaultTableState = {
|
|
|
16
16
|
};
|
|
17
17
|
export function useTableFeatures(options, plugins = []) {
|
|
18
18
|
const { items, getRowId, columns } = options;
|
|
19
|
-
const getRows = (rowEnhancer = defaultRowEnhancer)=>
|
|
19
|
+
const getRows = React.useCallback((rowEnhancer = defaultRowEnhancer)=>{
|
|
20
|
+
return items.map((item, i)=>{
|
|
20
21
|
var _getRowId;
|
|
21
22
|
return rowEnhancer({
|
|
22
23
|
item,
|
|
23
24
|
rowId: (_getRowId = getRowId === null || getRowId === void 0 ? void 0 : getRowId(item)) !== null && _getRowId !== void 0 ? _getRowId : i
|
|
24
25
|
});
|
|
25
26
|
});
|
|
27
|
+
}, [
|
|
28
|
+
items,
|
|
29
|
+
getRowId
|
|
30
|
+
]);
|
|
26
31
|
const initialState = {
|
|
27
32
|
getRowId,
|
|
28
33
|
items,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableFeatures.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n UseTableFeaturesOptions,\n TableFeaturesState,\n TableRowData,\n RowEnhancer,\n TableFeaturePlugin,\n TableSortState,\n} from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\nimport { defaultColumnSizingState } from './useTableColumnSizing';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, TableRowData<unknown>> = row => row;\n\nexport const defaultTableState: TableFeaturesState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef<HTMLDivElement>(),\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableFeaturesOptions<TItem>,\n plugins: TableFeaturePlugin[] = [],\n): TableFeaturesState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends TableRowData<TItem>>(
|
|
1
|
+
{"version":3,"sources":["useTableFeatures.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n UseTableFeaturesOptions,\n TableFeaturesState,\n TableRowData,\n RowEnhancer,\n TableFeaturePlugin,\n TableSortState,\n} from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\nimport { defaultColumnSizingState } from './useTableColumnSizing';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, TableRowData<unknown>> = row => row;\n\nexport const defaultTableState: TableFeaturesState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef<HTMLDivElement>(),\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableFeaturesOptions<TItem>,\n plugins: TableFeaturePlugin[] = [],\n): TableFeaturesState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = React.useCallback(\n <TRowState extends TableRowData<TItem>>(rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>) => {\n return items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n },\n [items, getRowId],\n );\n\n const initialState: TableFeaturesState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef(),\n };\n\n return plugins.reduce((state, plugin) => plugin(state), initialState);\n}\n"],"names":["React","defaultTableSelectionState","defaultTableSortState","defaultColumnSizingState","defaultRowEnhancer","row","defaultTableState","selection","sort","getRows","getRowId","items","columns","columnSizing_unstable","tableRef","createRef","useTableFeatures","options","plugins","useCallback","rowEnhancer","map","item","i","rowId","initialState","reduce","state","plugin"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAS/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,yBAAyB;AAElE,MAAMC,qBAAkEC,CAAAA,MAAOA;AAE/E,OAAO,MAAMC,oBAAiD;IAC5DC,WAAWN;IACXO,MAAMN;IACNO,SAAS,IAAM,EAAE;IACjBC,UAAU,IAAM;IAChBC,OAAO,EAAE;IACTC,SAAS,EAAE;IACX,gEAAgE;IAChEC,uBAAuBV;IACvBW,UAAUd,MAAMe,SAAS;AAC3B,EAAE;AAEF,OAAO,SAASC,iBACdC,OAAuC,EACvCC,UAAgC,EAAE;IAElC,MAAM,EAAEP,KAAK,EAAED,QAAQ,EAAEE,OAAO,EAAE,GAAGK;IAErC,MAAMR,UAAUT,MAAMmB,WAAW,CAC/B,CAAwCC,cAAchB,kBAAmD;QACvG,OAAOO,MAAMU,GAAG,CAAC,CAACC,MAAMC;gBAAiCb;mBAA3BU,YAAY;gBAAEE;gBAAME,OAAOd,CAAAA,YAAAA,qBAAAA,+BAAAA,SAAWY,mBAAXZ,uBAAAA,YAAoBa;YAAE;QAAC;IAClF,GACA;QAACZ;QAAOD;KAAS;IAGnB,MAAMe,eAA0C;QAC9Cf;QACAC;QACAC;QACAH;QACAF,WAAWN;QACXO,MAAMN;QACN,gEAAgE;QAChEW,uBAAuBV;QACvBW,UAAUd,MAAMe,SAAS;IAC3B;IAEA,OAAOG,QAAQQ,MAAM,CAAC,CAACC,OAAOC,SAAWA,OAAOD,QAAQF;AAC1D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useControllableState } from '@fluentui/react-utilities';
|
|
2
|
+
import { useControllableState, useEventCallback } from '@fluentui/react-utilities';
|
|
3
3
|
const noop = ()=>undefined;
|
|
4
4
|
export const defaultTableSortState = {
|
|
5
5
|
getSortDirection: ()=>'ascending',
|
|
@@ -18,7 +18,7 @@ export function useTableSort(options) {
|
|
|
18
18
|
}
|
|
19
19
|
export function useTableSortState(tableState, options) {
|
|
20
20
|
const { columns } = tableState;
|
|
21
|
-
const { sortState, defaultSortState, onSortChange } = options;
|
|
21
|
+
const { sortState, defaultSortState, onSortChange: onSortChangeProp = noop } = options;
|
|
22
22
|
const [sorted, setSorted] = useControllableState({
|
|
23
23
|
initialState: {
|
|
24
24
|
sortDirection: 'ascending',
|
|
@@ -28,7 +28,8 @@ export function useTableSortState(tableState, options) {
|
|
|
28
28
|
state: sortState
|
|
29
29
|
});
|
|
30
30
|
const { sortColumn, sortDirection } = sorted;
|
|
31
|
-
const
|
|
31
|
+
const onSortChange = useEventCallback(onSortChangeProp);
|
|
32
|
+
const toggleColumnSort = React.useCallback((e, columnId)=>{
|
|
32
33
|
setSorted((s)=>{
|
|
33
34
|
const newState = {
|
|
34
35
|
...s,
|
|
@@ -42,7 +43,10 @@ export function useTableSortState(tableState, options) {
|
|
|
42
43
|
onSortChange === null || onSortChange === void 0 ? void 0 : onSortChange(e, newState);
|
|
43
44
|
return newState;
|
|
44
45
|
});
|
|
45
|
-
}
|
|
46
|
+
}, [
|
|
47
|
+
onSortChange,
|
|
48
|
+
setSorted
|
|
49
|
+
]);
|
|
46
50
|
const setColumnSort = (e, nextSortColumn, nextSortDirection)=>{
|
|
47
51
|
const newState = {
|
|
48
52
|
sortColumn: nextSortColumn,
|
|
@@ -51,7 +55,7 @@ export function useTableSortState(tableState, options) {
|
|
|
51
55
|
onSortChange === null || onSortChange === void 0 ? void 0 : onSortChange(e, newState);
|
|
52
56
|
setSorted(newState);
|
|
53
57
|
};
|
|
54
|
-
const sort = (rows)=>{
|
|
58
|
+
const sort = React.useCallback((rows)=>{
|
|
55
59
|
return rows.slice().sort((a, b)=>{
|
|
56
60
|
const sortColumnDef = columns.find((column)=>column.columnId === sortColumn);
|
|
57
61
|
if (!(sortColumnDef === null || sortColumnDef === void 0 ? void 0 : sortColumnDef.compare)) {
|
|
@@ -60,7 +64,11 @@ export function useTableSortState(tableState, options) {
|
|
|
60
64
|
const mod = sortDirection === 'ascending' ? 1 : -1;
|
|
61
65
|
return sortColumnDef.compare(a.item, b.item) * mod;
|
|
62
66
|
});
|
|
63
|
-
}
|
|
67
|
+
}, [
|
|
68
|
+
columns,
|
|
69
|
+
sortColumn,
|
|
70
|
+
sortDirection
|
|
71
|
+
]);
|
|
64
72
|
const getSortDirection = (columnId)=>{
|
|
65
73
|
return sortColumn === columnId ? sortDirection : undefined;
|
|
66
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableSort.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type {\n TableColumnId,\n TableRowData,\n SortState,\n TableSortState,\n TableFeaturesState,\n UseTableSortOptions,\n} from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSortState: TableSortState<unknown> = {\n getSortDirection: () => 'ascending',\n setColumnSort: noop,\n sort: <TRowState extends TableRowData<unknown>>(rows: TRowState[]) => [...rows],\n sortColumn: undefined,\n sortDirection: 'ascending',\n toggleColumnSort: noop,\n};\n\nexport function useTableSort<TItem>(options: UseTableSortOptions) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableSortState(tableState, options);\n}\n\nexport function useTableSortState<TItem>(\n tableState: TableFeaturesState<TItem>,\n options: UseTableSortOptions,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n const { sortState, defaultSortState, onSortChange } = options;\n\n const [sorted, setSorted] = useControllableState<SortState>({\n initialState: {\n sortDirection: 'ascending' as const,\n sortColumn: undefined,\n },\n defaultState: defaultSortState,\n state: sortState,\n });\n\n const { sortColumn, sortDirection } = sorted;\n\n const toggleColumnSort = (e: React.SyntheticEvent, columnId: TableColumnId | undefined) => {\n
|
|
1
|
+
{"version":3,"sources":["useTableSort.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type {\n TableColumnId,\n TableRowData,\n SortState,\n TableSortState,\n TableFeaturesState,\n UseTableSortOptions,\n} from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSortState: TableSortState<unknown> = {\n getSortDirection: () => 'ascending',\n setColumnSort: noop,\n sort: <TRowState extends TableRowData<unknown>>(rows: TRowState[]) => [...rows],\n sortColumn: undefined,\n sortDirection: 'ascending',\n toggleColumnSort: noop,\n};\n\nexport function useTableSort<TItem>(options: UseTableSortOptions) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableSortState(tableState, options);\n}\n\nexport function useTableSortState<TItem>(\n tableState: TableFeaturesState<TItem>,\n options: UseTableSortOptions,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n const { sortState, defaultSortState, onSortChange: onSortChangeProp = noop } = options;\n\n const [sorted, setSorted] = useControllableState<SortState>({\n initialState: {\n sortDirection: 'ascending' as const,\n sortColumn: undefined,\n },\n defaultState: defaultSortState,\n state: sortState,\n });\n\n const { sortColumn, sortDirection } = sorted;\n\n const onSortChange = useEventCallback(onSortChangeProp);\n\n const toggleColumnSort = React.useCallback(\n (e: React.SyntheticEvent, columnId: TableColumnId | undefined) => {\n setSorted(s => {\n const newState = { ...s, sortColumn: columnId };\n if (s.sortColumn === columnId) {\n newState.sortDirection = s.sortDirection === 'ascending' ? 'descending' : 'ascending';\n } else {\n newState.sortDirection = 'ascending';\n }\n\n onSortChange?.(e, newState);\n return newState;\n });\n },\n [onSortChange, setSorted],\n );\n\n const setColumnSort: TableSortState<TItem>['setColumnSort'] = (e, nextSortColumn, nextSortDirection) => {\n const newState = { sortColumn: nextSortColumn, sortDirection: nextSortDirection };\n onSortChange?.(e, newState);\n setSorted(newState);\n };\n\n const sort = React.useCallback(\n <TRowState extends TableRowData<TItem>>(rows: TRowState[]) => {\n return rows.slice().sort((a, b) => {\n const sortColumnDef = columns.find(column => column.columnId === sortColumn);\n if (!sortColumnDef?.compare) {\n return 0;\n }\n\n const mod = sortDirection === 'ascending' ? 1 : -1;\n return sortColumnDef.compare(a.item, b.item) * mod;\n });\n },\n [columns, sortColumn, sortDirection],\n );\n\n const getSortDirection: TableSortState<TItem>['getSortDirection'] = (columnId: TableColumnId) => {\n return sortColumn === columnId ? sortDirection : undefined;\n };\n\n return {\n ...tableState,\n sort: {\n sort,\n sortColumn,\n sortDirection,\n setColumnSort,\n toggleColumnSort,\n getSortDirection,\n },\n };\n}\n"],"names":["React","useControllableState","useEventCallback","noop","undefined","defaultTableSortState","getSortDirection","setColumnSort","sort","rows","sortColumn","sortDirection","toggleColumnSort","useTableSort","options","tableState","useTableSortState","columns","sortState","defaultSortState","onSortChange","onSortChangeProp","sorted","setSorted","initialState","defaultState","state","useCallback","e","columnId","s","newState","nextSortColumn","nextSortDirection","slice","a","b","sortColumnDef","find","column","compare","mod","item"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAUnF,MAAMC,OAAO,IAAMC;AAEnB,OAAO,MAAMC,wBAAiD;IAC5DC,kBAAkB,IAAM;IACxBC,eAAeJ;IACfK,MAAM,CAA0CC,OAAsB;eAAIA;SAAK;IAC/EC,YAAYN;IAC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AAQqB,IAAI,CAACC,CAAAA,SAAUA,OAAOV,QAAQ,KAAKnB;YACjE,IAAI,EAAC2B,0BAAAA,oCAAAA,cAAeG,OAAO,GAAE;gBAC3B,OAAO;YACT;YAEA,MAAMC,MAAM9B,kBAAkB,cAAc,IAAI,CAAC;YACjD,OAAO0B,cAAcG,OAAO,CAACL,EAAEO,IAAI,EAAEN,EAAEM,IAAI,IAAID;QACjD;IACF,GACA;QAACxB;QAASP;QAAYC;KAAc;IAGtC,MAAML,mBAA8D,CAACuB;QACnE,OAAOnB,eAAemB,WAAWlB,gBAAgBP;IACnD;IAEA,OAAO;QACL,GAAGW,UAAU;QACbP,MAAM;YACJA;YACAE;YACAC;YACAJ;YACAK;YACAN;QACF;IACF;AACF"}
|
|
@@ -19,7 +19,9 @@ const useDataGridCell_unstable = (props, ref)=>{
|
|
|
19
19
|
const columnId = (0, _columnIdContext.useColumnIdContext)();
|
|
20
20
|
const tabbable = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>(ctx.focusMode === 'cell' || ctx.focusMode === 'composite') && focusMode !== 'none');
|
|
21
21
|
const resizableColumns = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx.resizableColumns);
|
|
22
|
-
const
|
|
22
|
+
const getTableCellProps = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>{
|
|
23
|
+
return ctx.columnSizing_unstable.getTableCellProps;
|
|
24
|
+
});
|
|
23
25
|
const focusableGroupAttr = (0, _reacttabster.useFocusableGroup)({
|
|
24
26
|
tabBehavior: 'limited-trap-focus'
|
|
25
27
|
});
|
|
@@ -28,7 +30,7 @@ const useDataGridCell_unstable = (props, ref)=>{
|
|
|
28
30
|
role: 'gridcell',
|
|
29
31
|
...focusMode === 'group' && focusableGroupAttr,
|
|
30
32
|
tabIndex: tabbable ? 0 : undefined,
|
|
31
|
-
...resizableColumns ?
|
|
33
|
+
...resizableColumns ? getTableCellProps(columnId) : {},
|
|
32
34
|
...props
|
|
33
35
|
}, ref);
|
|
34
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridCell.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\n/**\n * Create the state required to render DataGridCell.\n *\n * The returned state can be modified with hooks such as useDataGridCellStyles_unstable,\n * before being passed to renderDataGridCell_unstable.\n *\n * @param props - props from this instance of DataGridCell\n * @param ref - reference to root HTMLElement of DataGridCell\n */ export const useDataGridCell_unstable = (props, ref)=>{\n const { focusMode = 'cell' } = props;\n const columnId = useColumnIdContext();\n const tabbable = useDataGridContext_unstable((ctx)=>(ctx.focusMode === 'cell' || ctx.focusMode === 'composite') && focusMode !== 'none');\n const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);\n const
|
|
1
|
+
{"version":3,"sources":["useDataGridCell.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\n/**\n * Create the state required to render DataGridCell.\n *\n * The returned state can be modified with hooks such as useDataGridCellStyles_unstable,\n * before being passed to renderDataGridCell_unstable.\n *\n * @param props - props from this instance of DataGridCell\n * @param ref - reference to root HTMLElement of DataGridCell\n */ export const useDataGridCell_unstable = (props, ref)=>{\n const { focusMode = 'cell' } = props;\n const columnId = useColumnIdContext();\n const tabbable = useDataGridContext_unstable((ctx)=>(ctx.focusMode === 'cell' || ctx.focusMode === 'composite') && focusMode !== 'none');\n const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);\n const getTableCellProps = useDataGridContext_unstable((ctx)=>{\n return ctx.columnSizing_unstable.getTableCellProps;\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus'\n });\n return useTableCell_unstable({\n as: 'div',\n role: 'gridcell',\n ...focusMode === 'group' && focusableGroupAttr,\n tabIndex: tabbable ? 0 : undefined,\n ...resizableColumns ? getTableCellProps(columnId) : {},\n ...props\n }, ref);\n};\n"],"names":["useDataGridCell_unstable","props","ref","focusMode","columnId","useColumnIdContext","tabbable","useDataGridContext_unstable","ctx","resizableColumns","getTableCellProps","columnSizing_unstable","focusableGroupAttr","useFocusableGroup","tabBehavior","useTableCell_unstable","as","role","tabIndex","undefined"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;8BACW;8BACI;iCACM;iCACT;AASxB,MAAMA,2BAA2B,CAACC,OAAOC;IAChD,MAAM,EAAEC,YAAY,MAAM,EAAE,GAAGF;IAC/B,MAAMG,WAAWC,IAAAA,mCAAkB;IACnC,MAAMC,WAAWC,IAAAA,4CAA2B,EAAC,CAACC,MAAM,AAACA,CAAAA,IAAIL,SAAS,KAAK,UAAUK,IAAIL,SAAS,KAAK,WAAU,KAAMA,cAAc;IACjI,MAAMM,mBAAmBF,IAAAA,4CAA2B,EAAC,CAACC,MAAMA,IAAIC,gBAAgB;IAChF,MAAMC,oBAAoBH,IAAAA,4CAA2B,EAAC,CAACC;QACnD,OAAOA,IAAIG,qBAAqB,CAACD,iBAAiB;IACtD;IACA,MAAME,qBAAqBC,IAAAA,+BAAiB,EAAC;QACzCC,aAAa;IACjB;IACA,OAAOC,IAAAA,mCAAqB,EAAC;QACzBC,IAAI;QACJC,MAAM;QACN,GAAGd,cAAc,WAAWS,kBAAkB;QAC9CM,UAAUZ,WAAW,IAAIa;QACzB,GAAGV,mBAAmBC,kBAAkBN,YAAY,CAAC,CAAC;QACtD,GAAGH,KAAK;IACZ,GAAGC;AACP"}
|
|
@@ -30,7 +30,9 @@ const useDataGridHeaderCell_unstable = (props, ref)=>{
|
|
|
30
30
|
});
|
|
31
31
|
const sortDirection = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>sortable ? ctx.sort.getSortDirection(columnId) : undefined);
|
|
32
32
|
const resizableColumns = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx.resizableColumns);
|
|
33
|
-
const
|
|
33
|
+
const getTableHeaderCellProps = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>{
|
|
34
|
+
return ctx.columnSizing_unstable.getTableHeaderCellProps;
|
|
35
|
+
});
|
|
34
36
|
// eslint-disable-next-line deprecation/deprecation -- prefer HTMLTableCellElement
|
|
35
37
|
const onClick = (0, _reactutilities.useEventCallback)((e)=>{
|
|
36
38
|
var _props_onClick;
|
|
@@ -44,7 +46,7 @@ const useDataGridHeaderCell_unstable = (props, ref)=>{
|
|
|
44
46
|
sortDirection,
|
|
45
47
|
as: 'div',
|
|
46
48
|
tabIndex: sortable ? undefined : 0,
|
|
47
|
-
...resizableColumns ?
|
|
49
|
+
...resizableColumns ? getTableHeaderCellProps(columnId) : {},
|
|
48
50
|
...props,
|
|
49
51
|
onClick
|
|
50
52
|
}, ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridHeaderCell.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { isColumnSortable } from '../../utils/isColumnSortable';\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */ export const useDataGridHeaderCell_unstable = (props, ref)=>{\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable((ctx)=>ctx.sort.toggleColumnSort);\n const sortable = useDataGridContext_unstable((ctx)=>{\n const columnSortable = !!ctx.columns.find((c)=>c.columnId === columnId && isColumnSortable(c));\n if (!gridSortable) {\n // if the grid is not sortable - disable sorting on all columns\n return false;\n }\n return columnSortable;\n });\n const sortDirection = useDataGridContext_unstable((ctx)=>sortable ? ctx.sort.getSortDirection(columnId) : undefined);\n const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);\n const
|
|
1
|
+
{"version":3,"sources":["useDataGridHeaderCell.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { isColumnSortable } from '../../utils/isColumnSortable';\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */ export const useDataGridHeaderCell_unstable = (props, ref)=>{\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable((ctx)=>ctx.sort.toggleColumnSort);\n const sortable = useDataGridContext_unstable((ctx)=>{\n const columnSortable = !!ctx.columns.find((c)=>c.columnId === columnId && isColumnSortable(c));\n if (!gridSortable) {\n // if the grid is not sortable - disable sorting on all columns\n return false;\n }\n return columnSortable;\n });\n const sortDirection = useDataGridContext_unstable((ctx)=>sortable ? ctx.sort.getSortDirection(columnId) : undefined);\n const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable((ctx)=>{\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n // eslint-disable-next-line deprecation/deprecation -- prefer HTMLTableCellElement\n const onClick = useEventCallback((e)=>{\n var _props_onClick;\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);\n });\n return useTableHeaderCell_unstable({\n sortable,\n sortDirection,\n as: 'div',\n tabIndex: sortable ? undefined : 0,\n ...resizableColumns ? getTableHeaderCellProps(columnId) : {},\n ...props,\n onClick\n }, ref);\n};\n"],"names":["useDataGridHeaderCell_unstable","props","ref","columnId","useColumnIdContext","sortable","gridSortable","useTableContext","toggleColumnSort","useDataGridContext_unstable","ctx","sort","columnSortable","columns","find","c","isColumnSortable","sortDirection","getSortDirection","undefined","resizableColumns","getTableHeaderCellProps","columnSizing_unstable","onClick","useEventCallback","e","_props_onClick","call","useTableHeaderCell_unstable","as","tabIndex"],"mappings":";;;;+BAeiBA;;;eAAAA;;;;iEAfM;gCACU;oCACW;iCACA;iCACT;8BACH;kCACC;AAStB,MAAMA,iCAAiC,CAACC,OAAOC;IACtD,MAAMC,WAAWC,IAAAA,mCAAkB;IACnC,MAAM,EAAEC,UAAUC,YAAY,EAAE,GAAGC,IAAAA,6BAAe;IAClD,MAAMC,mBAAmBC,IAAAA,4CAA2B,EAAC,CAACC,MAAMA,IAAIC,IAAI,CAACH,gBAAgB;IACrF,MAAMH,WAAWI,IAAAA,4CAA2B,EAAC,CAACC;QAC1C,MAAME,iBAAiB,CAAC,CAACF,IAAIG,OAAO,CAACC,IAAI,CAAC,CAACC,IAAIA,EAAEZ,QAAQ,KAAKA,YAAYa,IAAAA,kCAAgB,EAACD;QAC3F,IAAI,CAACT,cAAc;YACf,+DAA+D;YAC/D,OAAO;QACX;QACA,OAAOM;IACX;IACA,MAAMK,gBAAgBR,IAAAA,4CAA2B,EAAC,CAACC,MAAML,WAAWK,IAAIC,IAAI,CAACO,gBAAgB,CAACf,YAAYgB;IAC1G,MAAMC,mBAAmBX,IAAAA,4CAA2B,EAAC,CAACC,MAAMA,IAAIU,gBAAgB;IAChF,MAAMC,0BAA0BZ,IAAAA,4CAA2B,EAAC,CAACC;QACzD,OAAOA,IAAIY,qBAAqB,CAACD,uBAAuB;IAC5D;IACA,kFAAkF;IAClF,MAAME,UAAUC,IAAAA,gCAAgB,EAAC,CAACC;QAC9B,IAAIC;QACJ,IAAIrB,UAAU;YACVG,iBAAiBiB,GAAGtB;QACxB;QACCuB,CAAAA,iBAAiBzB,MAAMsB,OAAO,AAAD,MAAO,QAAQG,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeC,IAAI,CAAC1B,OAAOwB;IACjH;IACA,OAAOG,IAAAA,+CAA2B,EAAC;QAC/BvB;QACAY;QACAY,IAAI;QACJC,UAAUzB,WAAWc,YAAY;QACjC,GAAGC,mBAAmBC,wBAAwBlB,YAAY,CAAC,CAAC;QAC5D,GAAGF,KAAK;QACRsB;IACJ,GAAGrB;AACP"}
|
|
@@ -33,7 +33,6 @@ const useDataGridRow_unstable = (props, ref)=>{
|
|
|
33
33
|
return 'none';
|
|
34
34
|
});
|
|
35
35
|
const toggleRow = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx.selection.toggleRow);
|
|
36
|
-
const dataGridContextValue = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx);
|
|
37
36
|
const onClick = (0, _reactutilities.useEventCallback)((e)=>{
|
|
38
37
|
var _props_onClick;
|
|
39
38
|
if (selectable && !isHeader) {
|
|
@@ -73,6 +72,23 @@ const useDataGridRow_unstable = (props, ref)=>{
|
|
|
73
72
|
}),
|
|
74
73
|
renderCell: props.children,
|
|
75
74
|
columnDefs,
|
|
76
|
-
|
|
75
|
+
// This context value should not be used internally
|
|
76
|
+
// It's intended to help power user render functions
|
|
77
|
+
dataGridContextValue: useStableDataGridContextValue()
|
|
77
78
|
};
|
|
78
79
|
};
|
|
80
|
+
function useStableDataGridContextValue() {
|
|
81
|
+
const ref = _react.useRef(_dataGridContext.dataGridContextDefaultValue);
|
|
82
|
+
// Heads up!
|
|
83
|
+
// We will not re-render when the context value changes, but we will have the latest value of the context when we do
|
|
84
|
+
// render for other reasons.
|
|
85
|
+
//
|
|
86
|
+
// This relies on a context selector that always returns the same value:
|
|
87
|
+
// - we will not re-render when the context value changes
|
|
88
|
+
// - we will store the context value in a ref
|
|
89
|
+
(0, _dataGridContext.useDataGridContext_unstable)((ctx)=>{
|
|
90
|
+
ref.current = ctx;
|
|
91
|
+
return null;
|
|
92
|
+
});
|
|
93
|
+
return ref.current;
|
|
94
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridRow.js"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */ export const useDataGridRow_unstable = (props, ref)=>{\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable((ctx)=>ctx.columns);\n const selectable = useDataGridContext_unstable((ctx)=>ctx.selectableRows);\n const selected = useDataGridContext_unstable((ctx)=>ctx.selection.isRowSelected(rowId));\n const focusMode = useDataGridContext_unstable((ctx)=>ctx.focusMode);\n const compositeRowTabsterAttribute = useDataGridContext_unstable((ctx)=>ctx.compositeRowTabsterAttribute);\n const tabbable = focusMode === 'row_unstable' || focusMode === 'composite';\n const appearance = useDataGridContext_unstable((ctx)=>{\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable((ctx)=>ctx.selection.toggleRow);\n const
|
|
1
|
+
{"version":3,"sources":["useDataGridRow.js"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { dataGridContextDefaultValue, useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */ export const useDataGridRow_unstable = (props, ref)=>{\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable((ctx)=>ctx.columns);\n const selectable = useDataGridContext_unstable((ctx)=>ctx.selectableRows);\n const selected = useDataGridContext_unstable((ctx)=>ctx.selection.isRowSelected(rowId));\n const focusMode = useDataGridContext_unstable((ctx)=>ctx.focusMode);\n const compositeRowTabsterAttribute = useDataGridContext_unstable((ctx)=>ctx.compositeRowTabsterAttribute);\n const tabbable = focusMode === 'row_unstable' || focusMode === 'composite';\n const appearance = useDataGridContext_unstable((ctx)=>{\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable((ctx)=>ctx.selection.toggleRow);\n const onClick = useEventCallback((e)=>{\n var _props_onClick;\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown;\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);\n });\n const baseState = useTableRow_unstable({\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n tabIndex: tabbable && !isHeader ? 0 : undefined,\n ...focusMode === 'composite' && !isHeader && compositeRowTabsterAttribute,\n ...props,\n onClick,\n onKeyDown,\n children: null,\n as: 'div'\n }, ref);\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell\n },\n selectionCell: slot.optional(props.selectionCell, {\n renderByDefault: selectable,\n elementType: DataGridSelectionCell\n }),\n renderCell: props.children,\n columnDefs,\n // This context value should not be used internally\n // It's intended to help power user render functions\n dataGridContextValue: useStableDataGridContextValue()\n };\n};\nfunction useStableDataGridContextValue() {\n const ref = React.useRef(dataGridContextDefaultValue);\n // Heads up!\n // We will not re-render when the context value changes, but we will have the latest value of the context when we do\n // render for other reasons.\n //\n // This relies on a context selector that always returns the same value:\n // - we will not re-render when the context value changes\n // - we will store the context value in a ref\n useDataGridContext_unstable((ctx)=>{\n ref.current = ctx;\n return null;\n });\n return ref.current;\n}\n"],"names":["useDataGridRow_unstable","props","ref","rowId","useTableRowIdContext","isHeader","useIsInTableHeader","columnDefs","useDataGridContext_unstable","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","focusMode","compositeRowTabsterAttribute","tabbable","appearance","selectionAppearance","toggleRow","onClick","useEventCallback","e","_props_onClick","call","onKeyDown","_props_onKeyDown","key","Space","isInteractiveHTMLElement","target","preventDefault","baseState","useTableRow_unstable","undefined","tabIndex","children","as","components","selectionCell","DataGridSelectionCell","slot","optional","renderByDefault","elementType","renderCell","dataGridContextValue","useStableDataG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: "feu1g3u",
|
|
82
82
|
Bpt6rm4: "f1uorfem",
|
|
83
|
-
ff6mpl: "fw60kww"
|
|
83
|
+
ff6mpl: "fw60kww",
|
|
84
|
+
ze5xyy: "f4xjyn1",
|
|
85
|
+
pgvf35: "ff1wgvm",
|
|
86
|
+
Bh7lczh: [
|
|
87
|
+
"fiob0tu",
|
|
88
|
+
"f1x4h75k"
|
|
89
|
+
],
|
|
90
|
+
dpv3f4: "f1j6scgf",
|
|
91
|
+
Bpnjhaq: [
|
|
92
|
+
"f1x4h75k",
|
|
93
|
+
"fiob0tu"
|
|
94
|
+
]
|
|
84
95
|
},
|
|
85
96
|
medium: {
|
|
86
97
|
Bn0qgzm: "f1vxd6vx",
|
|
@@ -269,6 +280,30 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
269
280
|
".f1uqaxdt:hover{background-color:var(--colorSubtleBackgroundSelected);}"
|
|
270
281
|
],
|
|
271
282
|
m: [
|
|
283
|
+
[
|
|
284
|
+
"@media (forced-colors: active){.f4xjyn1:hover{color:Highlight;}}",
|
|
285
|
+
{
|
|
286
|
+
m: "(forced-colors: active)"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
[
|
|
290
|
+
"@media (forced-colors: active){.ff1wgvm:hover{border-top-color:Highlight;}}",
|
|
291
|
+
{
|
|
292
|
+
m: "(forced-colors: active)"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
[
|
|
296
|
+
"@media (forced-colors: active){.f1x4h75k:hover{border-left-color:Highlight;}.fiob0tu:hover{border-right-color:Highlight;}}",
|
|
297
|
+
{
|
|
298
|
+
m: "(forced-colors: active)"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
[
|
|
302
|
+
"@media (forced-colors: active){.f1j6scgf:hover{border-bottom-color:Highlight;}}",
|
|
303
|
+
{
|
|
304
|
+
m: "(forced-colors: active)"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
272
307
|
[
|
|
273
308
|
"@media (forced-colors: active){.fqlf3fd{border-top-width:2px;}}",
|
|
274
309
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableRowStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { tableCellActionsClassNames } from '../TableCellActions/useTableCellActionsStyles.styles';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const tableRowClassName = 'fui-TableRow';\nexport const tableRowClassNames = {\n root: tableRowClassName\n};\nconst useTableLayoutStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f1u0rzck\"\n }\n}, {\n d: [\".f1u0rzck{display:table-row;}\"]\n});\nconst useFlexLayoutStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f122n59\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f122n59{align-items:center;}\"]\n});\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n B7ck84d: \"f1ewtqcl\",\n Bconypa: \"f1jazu75\",\n B6guboy: \"f1xeqee6\",\n Bn4voq9: \"fz36nt7\",\n g9k6zt: \"f9znhxp\",\n Bfpq7zp: \"fqrak0z\",\n kdpuga: [\"f1o2ludy\", \"f1kjnpwc\"],\n Bw81rd7: [\"f1kjnpwc\", \"f1o2ludy\"],\n B6xbmo0: [\"fxmnebo\", \"f1witrsb\"],\n dm238s: [\"f1witrsb\", \"fxmnebo\"]\n },\n rootInteractive: {\n ecr2s2: \"f1wfn5kd\",\n lj723h: \"f1g4hkjv\",\n B43xm9u: \"f15ngxrw\",\n i921ia: \"fjbbrdp\",\n Jwef8y: \"f1t94bn6\",\n Bi91k9c: \"feu1g3u\",\n Bpt6rm4: \"f1uorfem\",\n ff6mpl: \"fw60kww\"\n },\n medium: {\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n },\n small: {\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n },\n \"extra-small\": {\n Be2twd7: \"fy9rknc\"\n },\n brand: {\n De3pzq: \"f16xkysk\",\n g2u3we: \"f1bh3yvw\",\n h3c5rm: [\"fmi79ni\", \"f11fozsx\"],\n B9xav0g: \"fnzw4c6\",\n zhjwy3: [\"f11fozsx\", \"fmi79ni\"],\n ecr2s2: \"f7tkmfy\",\n lj723h: \"f1r2dosr\",\n gwxt9v: \"fqlf3fd\",\n v3aym: [\"f9dpb3h\", \"fw2muls\"],\n Bc736ss: \"f1yat0gj\",\n Bk6ri7n: [\"fw2muls\", \"f9dpb3h\"],\n Bk5ld8o: \"f7nae3y\",\n c4eypz: [\"fkbere7\", \"fa97sf3\"],\n felo30: \"fmtyzcc\",\n Eshu5l: [\"fa97sf3\", \"fkbere7\"],\n Bjwas2f: \"fb6zhgp\",\n Bn1d65q: [\"fyowp6c\", \"fz08sq8\"],\n Bxeuatn: \"f9dii88\",\n n51gp8: [\"fz08sq8\", \"fyowp6c\"],\n Beo2b4z: [\"f1afxoft\", \"flqq2yx\"],\n h6lo6r: [\"flqq2yx\", \"f1afxoft\"],\n Btyw6ap: [\"f1b5xrmd\", \"f1831rx6\"],\n w1pwid: [\"f1831rx6\", \"f1b5xrmd\"],\n Brwvgy3: \"fd94n53\",\n yadkgm: \"f1e0wld5\"\n },\n neutral: {\n gwxt9v: \"fqlf3fd\",\n v3aym: [\"f9dpb3h\", \"fw2muls\"],\n Bc736ss: \"f1yat0gj\",\n Bk6ri7n: [\"fw2muls\", \"f9dpb3h\"],\n Bk5ld8o: \"f7nae3y\",\n c4eypz: [\"fkbere7\", \"fa97sf3\"],\n felo30: \"fmtyzcc\",\n Eshu5l: [\"fa97sf3\", \"fkbere7\"],\n Bjwas2f: \"fb6zhgp\",\n Bn1d65q: [\"fyowp6c\", \"fz08sq8\"],\n Bxeuatn: \"f9dii88\",\n n51gp8: [\"fz08sq8\", \"fyowp6c\"],\n Beo2b4z: [\"f1afxoft\", \"flqq2yx\"],\n h6lo6r: [\"flqq2yx\", \"f1afxoft\"],\n Btyw6ap: [\"f1b5xrmd\", \"f1831rx6\"],\n w1pwid: [\"f1831rx6\", \"f1b5xrmd\"],\n Brwvgy3: \"fd94n53\",\n yadkgm: \"f1e0wld5\",\n De3pzq: \"fq5gl1p\",\n sj55zd: \"f1cgsbmv\",\n Jwef8y: \"f1uqaxdt\",\n ecr2s2: \"fa9o754\",\n g2u3we: \"frmsihh\",\n h3c5rm: [\"frttxa5\", \"f11o2r7f\"],\n B9xav0g: \"fem5et0\",\n zhjwy3: [\"f11o2r7f\", \"frttxa5\"]\n },\n none: {}\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1ewtqcl{box-sizing:border-box;}\", \".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}\", \".f1xeqee6[data-fui-focus-within]:focus-within .fui-TableCellActions{opacity:1;}\", \".fz36nt7[data-fui-focus-visible]{outline-width:2px;}\", \".f9znhxp[data-fui-focus-visible]{outline-style:solid;}\", \".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}\", \".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}\", \".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}\", \".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}\", \".fg706s2{border-bottom-style:solid;}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".f16xkysk{background-color:var(--colorBrandBackground2);}\", \".f1bh3yvw{border-top-color:var(--colorTransparentStrokeInteractive);}\", \".fmi79ni{border-right-color:var(--colorTransparentStrokeInteractive);}\", \".f11fozsx{border-left-color:var(--colorTransparentStrokeInteractive);}\", \".fnzw4c6{border-bottom-color:var(--colorTransparentStrokeInteractive);}\", \".fq5gl1p{background-color:var(--colorSubtleBackgroundSelected);}\", \".f1cgsbmv{color:var(--colorNeutralForeground1Hover);}\", \".frmsihh{border-top-color:var(--colorNeutralStrokeOnBrand);}\", \".frttxa5{border-right-color:var(--colorNeutralStrokeOnBrand);}\", \".f11o2r7f{border-left-color:var(--colorNeutralStrokeOnBrand);}\", \".fem5et0{border-bottom-color:var(--colorNeutralStrokeOnBrand);}\"],\n a: [\".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}\", \".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}\", \".f15ngxrw:active .fui-TableCellActions{opacity:1;}\", \".fjbbrdp:active .fui-TableSelectionCell{opacity:1;}\", \".f7tkmfy:active{background-color:var(--colorBrandBackground2);}\", \".f1r2dosr:active{color:var(--colorNeutralForeground1);}\", \".fa9o754:active{background-color:var(--colorSubtleBackgroundSelected);}\"],\n h: [\".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}\", \".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}\", \".f1uorfem:hover .fui-TableCellActions{opacity:1;}\", \".fw60kww:hover .fui-TableSelectionCell{opacity:1;}\", \".f1uqaxdt:hover{background-color:var(--colorSubtleBackgroundSelected);}\"],\n m: [[\"@media (forced-colors: active){.fqlf3fd{border-top-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f9dpb3h{border-right-width:2px;}.fw2muls{border-left-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1yat0gj{border-bottom-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f7nae3y{border-top-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fa97sf3{border-left-style:solid;}.fkbere7{border-right-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fmtyzcc{border-bottom-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fb6zhgp{border-top-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fyowp6c{border-right-color:transparent;}.fz08sq8{border-left-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f9dii88{border-bottom-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1afxoft{border-bottom-right-radius:var(--borderRadiusMedium);}.flqq2yx{border-bottom-left-radius:var(--borderRadiusMedium);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1831rx6{border-top-left-radius:var(--borderRadiusMedium);}.f1b5xrmd{border-top-right-radius:var(--borderRadiusMedium);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fd94n53{box-sizing:border-box;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1e0wld5:focus-visible{outline-offset:-4px;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\n/**\n * Apply styling to the TableRow slots based on the state\n */\nexport const useTableRowStyles_unstable = state => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles()\n };\n state.root.className = mergeClasses(tableRowClassNames.root, styles.root, !state.isHeaderRow && styles.rootInteractive, styles[state.size], state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, styles[state.appearance], state.root.className);\n return state;\n};\n//# sourceMappingURL=useTableRowStyles.styles.js.map"],"names":["tableRowClassName","tableRowClassNames","useTableRowStyles_unstable","root","useTableLayoutStyles","__styles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bconypa","B6guboy","Bn4voq9","g9k6zt","Bfpq7zp","kdpuga","Bw81rd7","B6xbmo0","dm238s","rootInteractive","ecr2s2","lj723h","B43xm9u","i921ia","Jwef8y","Bi91k9c","Bpt6rm4","ff6mpl","medium","Bn0qgzm","oivjwe","B9xav0g","small","Be2twd7","brand","De3pzq","g2u3we","h3c5rm","zhjwy3","gwxt9v","v3aym","Bc736ss","Bk6ri7n","Bk5ld8o","c4eypz","felo30","Eshu5l","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Beo2b4z","h6lo6r","Btyw6ap","w1pwid","Brwvgy3","yadkgm","neutral","none","a","h","m","state","styles","layoutStyles","table","flex","className","mergeClasses","isHeaderRow","size","noNativeElements","appearance"],"mappings":";;;;;;;;;;;IAKaA,iBAAiB;eAAjBA;;IACAC,kBAAkB;eAAlBA;;IAqJAC,0BAA0B;eAA1BA;;;uBA3JsC;AAK5C,MAAMF,oBAAoB;AAC1B,MAAMC,qBAAqB;IAChCE,MAAMH;AACR;AACA,MAAMI,uBAAuB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACjDF,MAAM;QACJG,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;KAAgC;AACtC;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,eAAQ,EAAC;IAChDF,MAAM;QACJG,QAAQ;QACRG,SAAS;IACX;AACF,GAAG;IACDF,GAAG;QAAC;QAA2B;KAAgC;AACjE;AACA;;CAEC,GACD,MAAMG,YAAY,WAAW,GAAEL,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJQ,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;YAAC;YAAY;SAAW;QACjCC,SAAS;YAAC;YAAW;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAU;IACjC;IACAC,iBAAiB;QACfC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C,OAAOhE;QACPiE,MAAM7D;IACR;IACAyD,MAAM9D,IAAI,CAACmE,SAAS,GAAGC,IAAAA,mBAAY,EAACtE,mBAAmBE,IAAI,EAAE+D,OAAO/D,IAAI,EAAE,CAAC8D,MAAMO,WAAW,IAAIN,OAAO5C,eAAe,EAAE4C,MAAM,CAACD,MAAMQ,IAAI,CAAC,EAAER,MAAMS,gBAAgB,GAAGP,aAAaE,IAAI,CAAClE,IAAI,GAAGgE,aAAaC,KAAK,CAACjE,IAAI,EAAE+D,MAAM,CAACD,MAAMU,UAAU,CAAC,EAAEV,MAAM9D,IAAI,CAACmE,SAAS;IACrQ,OAAOL;AACT,GACA,oDAAoD"}
|
|
1
|
+
{"version":3,"sources":["useTableRowStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { tableCellActionsClassNames } from '../TableCellActions/useTableCellActionsStyles.styles';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const tableRowClassName = 'fui-TableRow';\nexport const tableRowClassNames = {\n root: tableRowClassName\n};\nconst useTableLayoutStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f1u0rzck\"\n }\n}, {\n d: [\".f1u0rzck{display:table-row;}\"]\n});\nconst useFlexLayoutStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f122n59\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f122n59{align-items:center;}\"]\n});\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n sj55zd: \"f19n0e5\",\n B7ck84d: \"f1ewtqcl\",\n Bconypa: \"f1jazu75\",\n B6guboy: \"f1xeqee6\",\n Bn4voq9: \"fz36nt7\",\n g9k6zt: \"f9znhxp\",\n Bfpq7zp: \"fqrak0z\",\n kdpuga: [\"f1o2ludy\", \"f1kjnpwc\"],\n Bw81rd7: [\"f1kjnpwc\", \"f1o2ludy\"],\n B6xbmo0: [\"fxmnebo\", \"f1witrsb\"],\n dm238s: [\"f1witrsb\", \"fxmnebo\"]\n },\n rootInteractive: {\n ecr2s2: \"f1wfn5kd\",\n lj723h: \"f1g4hkjv\",\n B43xm9u: \"f15ngxrw\",\n i921ia: \"fjbbrdp\",\n Jwef8y: \"f1t94bn6\",\n Bi91k9c: \"feu1g3u\",\n Bpt6rm4: \"f1uorfem\",\n ff6mpl: \"fw60kww\",\n ze5xyy: \"f4xjyn1\",\n pgvf35: \"ff1wgvm\",\n Bh7lczh: [\"fiob0tu\", \"f1x4h75k\"],\n dpv3f4: \"f1j6scgf\",\n Bpnjhaq: [\"f1x4h75k\", \"fiob0tu\"]\n },\n medium: {\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n },\n small: {\n Bn0qgzm: \"f1vxd6vx\",\n oivjwe: \"fg706s2\",\n B9xav0g: \"frpde29\"\n },\n \"extra-small\": {\n Be2twd7: \"fy9rknc\"\n },\n brand: {\n De3pzq: \"f16xkysk\",\n g2u3we: \"f1bh3yvw\",\n h3c5rm: [\"fmi79ni\", \"f11fozsx\"],\n B9xav0g: \"fnzw4c6\",\n zhjwy3: [\"f11fozsx\", \"fmi79ni\"],\n ecr2s2: \"f7tkmfy\",\n lj723h: \"f1r2dosr\",\n gwxt9v: \"fqlf3fd\",\n v3aym: [\"f9dpb3h\", \"fw2muls\"],\n Bc736ss: \"f1yat0gj\",\n Bk6ri7n: [\"fw2muls\", \"f9dpb3h\"],\n Bk5ld8o: \"f7nae3y\",\n c4eypz: [\"fkbere7\", \"fa97sf3\"],\n felo30: \"fmtyzcc\",\n Eshu5l: [\"fa97sf3\", \"fkbere7\"],\n Bjwas2f: \"fb6zhgp\",\n Bn1d65q: [\"fyowp6c\", \"fz08sq8\"],\n Bxeuatn: \"f9dii88\",\n n51gp8: [\"fz08sq8\", \"fyowp6c\"],\n Beo2b4z: [\"f1afxoft\", \"flqq2yx\"],\n h6lo6r: [\"flqq2yx\", \"f1afxoft\"],\n Btyw6ap: [\"f1b5xrmd\", \"f1831rx6\"],\n w1pwid: [\"f1831rx6\", \"f1b5xrmd\"],\n Brwvgy3: \"fd94n53\",\n yadkgm: \"f1e0wld5\"\n },\n neutral: {\n gwxt9v: \"fqlf3fd\",\n v3aym: [\"f9dpb3h\", \"fw2muls\"],\n Bc736ss: \"f1yat0gj\",\n Bk6ri7n: [\"fw2muls\", \"f9dpb3h\"],\n Bk5ld8o: \"f7nae3y\",\n c4eypz: [\"fkbere7\", \"fa97sf3\"],\n felo30: \"fmtyzcc\",\n Eshu5l: [\"fa97sf3\", \"fkbere7\"],\n Bjwas2f: \"fb6zhgp\",\n Bn1d65q: [\"fyowp6c\", \"fz08sq8\"],\n Bxeuatn: \"f9dii88\",\n n51gp8: [\"fz08sq8\", \"fyowp6c\"],\n Beo2b4z: [\"f1afxoft\", \"flqq2yx\"],\n h6lo6r: [\"flqq2yx\", \"f1afxoft\"],\n Btyw6ap: [\"f1b5xrmd\", \"f1831rx6\"],\n w1pwid: [\"f1831rx6\", \"f1b5xrmd\"],\n Brwvgy3: \"fd94n53\",\n yadkgm: \"f1e0wld5\",\n De3pzq: \"fq5gl1p\",\n sj55zd: \"f1cgsbmv\",\n Jwef8y: \"f1uqaxdt\",\n ecr2s2: \"fa9o754\",\n g2u3we: \"frmsihh\",\n h3c5rm: [\"frttxa5\", \"f11o2r7f\"],\n B9xav0g: \"fem5et0\",\n zhjwy3: [\"f11o2r7f\", \"frttxa5\"]\n },\n none: {}\n}, {\n d: [\".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1ewtqcl{box-sizing:border-box;}\", \".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}\", \".f1xeqee6[data-fui-focus-within]:focus-within .fui-TableCellActions{opacity:1;}\", \".fz36nt7[data-fui-focus-visible]{outline-width:2px;}\", \".f9znhxp[data-fui-focus-visible]{outline-style:solid;}\", \".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}\", \".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}\", \".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}\", \".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}\", \".fg706s2{border-bottom-style:solid;}\", \".frpde29{border-bottom-color:var(--colorNeutralStroke2);}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".f16xkysk{background-color:var(--colorBrandBackground2);}\", \".f1bh3yvw{border-top-color:var(--colorTransparentStrokeInteractive);}\", \".fmi79ni{border-right-color:var(--colorTransparentStrokeInteractive);}\", \".f11fozsx{border-left-color:var(--colorTransparentStrokeInteractive);}\", \".fnzw4c6{border-bottom-color:var(--colorTransparentStrokeInteractive);}\", \".fq5gl1p{background-color:var(--colorSubtleBackgroundSelected);}\", \".f1cgsbmv{color:var(--colorNeutralForeground1Hover);}\", \".frmsihh{border-top-color:var(--colorNeutralStrokeOnBrand);}\", \".frttxa5{border-right-color:var(--colorNeutralStrokeOnBrand);}\", \".f11o2r7f{border-left-color:var(--colorNeutralStrokeOnBrand);}\", \".fem5et0{border-bottom-color:var(--colorNeutralStrokeOnBrand);}\"],\n a: [\".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}\", \".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}\", \".f15ngxrw:active .fui-TableCellActions{opacity:1;}\", \".fjbbrdp:active .fui-TableSelectionCell{opacity:1;}\", \".f7tkmfy:active{background-color:var(--colorBrandBackground2);}\", \".f1r2dosr:active{color:var(--colorNeutralForeground1);}\", \".fa9o754:active{background-color:var(--colorSubtleBackgroundSelected);}\"],\n h: [\".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}\", \".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}\", \".f1uorfem:hover .fui-TableCellActions{opacity:1;}\", \".fw60kww:hover .fui-TableSelectionCell{opacity:1;}\", \".f1uqaxdt:hover{background-color:var(--colorSubtleBackgroundSelected);}\"],\n m: [[\"@media (forced-colors: active){.f4xjyn1:hover{color:Highlight;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.ff1wgvm:hover{border-top-color:Highlight;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1x4h75k:hover{border-left-color:Highlight;}.fiob0tu:hover{border-right-color:Highlight;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1j6scgf:hover{border-bottom-color:Highlight;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fqlf3fd{border-top-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f9dpb3h{border-right-width:2px;}.fw2muls{border-left-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1yat0gj{border-bottom-width:2px;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f7nae3y{border-top-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fa97sf3{border-left-style:solid;}.fkbere7{border-right-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fmtyzcc{border-bottom-style:solid;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fb6zhgp{border-top-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fyowp6c{border-right-color:transparent;}.fz08sq8{border-left-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f9dii88{border-bottom-color:transparent;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1afxoft{border-bottom-right-radius:var(--borderRadiusMedium);}.flqq2yx{border-bottom-left-radius:var(--borderRadiusMedium);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1831rx6{border-top-left-radius:var(--borderRadiusMedium);}.f1b5xrmd{border-top-right-radius:var(--borderRadiusMedium);}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fd94n53{box-sizing:border-box;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1e0wld5:focus-visible{outline-offset:-4px;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\n/**\n * Apply styling to the TableRow slots based on the state\n */\nexport const useTableRowStyles_unstable = state => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles()\n };\n state.root.className = mergeClasses(tableRowClassNames.root, styles.root, !state.isHeaderRow && styles.rootInteractive, styles[state.size], state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, styles[state.appearance], state.root.className);\n return state;\n};\n//# sourceMappingURL=useTableRowStyles.styles.js.map"],"names":["tableRowClassName","tableRowClassNames","useTableRowStyles_unstable","root","useTableLayoutStyles","__styles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bconypa","B6guboy","Bn4voq9","g9k6zt","Bfpq7zp","kdpuga","Bw81rd7","B6xbmo0","dm238s","rootInteractive","ecr2s2","lj723h","B43xm9u","i921ia","Jwef8y","Bi91k9c","Bpt6rm4","ff6mpl","ze5xyy","pgvf35","Bh7lczh","dpv3f4","Bpnjhaq","medium","Bn0qgzm","oivjwe","B9xav0g","small","Be2twd7","brand","De3pzq","g2u3we","h3c5rm","zhjwy3","gwxt9v","v3aym","Bc736ss","Bk6ri7n","Bk5ld8o","c4eypz","felo30","Eshu5l","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Beo2b4z","h6lo6r","Btyw6ap","w1pwid","Brwvgy3","yadkgm","neutral","none","a","h","m","state","styles","layoutStyles","table","flex","className","mergeClasses","isHeaderRow","size","noNativeElements","appearance"],"mappings":";;;;;;;;;;;IAKaA,iBAAiB;eAAjBA;;IACAC,kBAAkB;eAAlBA;;IAkKAC,0BAA0B;eAA1BA;;;uBAxKsC;AAK5C,MAAMF,oBAAoB;AAC1B,MAAMC,qBAAqB;IAChCE,MAAMH;AACR;AACA,MAAMI,uBAAuB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACjDF,MAAM;QACJG,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;KAAgC;AACtC;AACA,MAAMC,sBAAsB,WAAW,GAAEH,IAAAA,eAAQ,EAAC;IAChDF,MAAM;QACJG,QAAQ;QACRG,SAAS;IACX;AACF,GAAG;IACDF,GAAG;QAAC;QAA2B;KAAgC;AACjE;AACA;;CAEC,GACD,MAAMG,YAAY,WAAW,GAAEL,IAAAA,eAAQ,EAAC;IACtCF,MAAM;QACJQ,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;YAAC;YAAY;SAAW;QACjCC,SAAS;YAAC;YAAW;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAU;IACjC;IACAC,iBAAiB;QACfC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,SAAS;YAAC;YAAW;SAAW;QAChCC,QAAQ;QACRC,SAAS;YAAC;YAAY;SAAU;IAClC;IACAC,QAAQ;QACNC,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;IACAC,OAAO;QACLH,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;IACA,eAAe;QACbE,SAAS;IACX;IACAC,OAAO;QACLC,QAAQ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AAY,EAAC3E,mBAAmBE,IAAI,EAAEoE,OAAOpE,IAAI,EAAE,CAACmE,MAAMO,WAAW,IAAIN,OAAOjD,eAAe,EAAEiD,MAAM,CAACD,MAAMQ,IAAI,CAAC,EAAER,MAAMS,gBAAgB,GAAGP,aAAaE,IAAI,CAACvE,IAAI,GAAGqE,aAAaC,KAAK,CAACtE,IAAI,EAAEoE,MAAM,CAACD,MAAMU,UAAU,CAAC,EAAEV,MAAMnE,IAAI,CAACwE,SAAS;IACrQ,OAAOL;AACT,GACA,oDAAoD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["dataGridContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport { defaultTableState } from '../hooks';\nconst dataGridContext = createContext(undefined);\
|
|
1
|
+
{"version":3,"sources":["dataGridContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport { defaultTableState } from '../hooks';\nconst dataGridContext = createContext(undefined);\nexport const dataGridContextDefaultValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n compositeRowTabsterAttribute: {}\n};\nexport const DataGridContextProvider = dataGridContext.Provider;\nexport const useDataGridContext_unstable = (selector)=>useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue)=>selector(ctx));\n"],"names":["dataGridContextDefaultValue","DataGridContextProvider","useDataGridContext_unstable","dataGridContext","createContext","undefined","defaultTableState","subtleSelection","selectableRows","selectionAppearance","focusMode","compositeRowTabsterAttribute","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAGaA,2BAA2B;eAA3BA;;IAQAC,uBAAuB;eAAvBA;;IACAC,2BAA2B;eAA3BA;;;sCAZqC;uBAChB;AAClC,MAAMC,kBAAkBC,IAAAA,mCAAa,EAACC;AAC/B,MAAML,8BAA8B;IACvC,GAAGM,wBAAiB;IACpBC,iBAAiB;IACjBC,gBAAgB;IAChBC,qBAAqB;IACrBC,WAAW;IACXC,8BAA8B,CAAC;AACnC;AACO,MAAMV,0BAA0BE,gBAAgBS,QAAQ;AACxD,MAAMV,8BAA8B,CAACW,WAAWC,IAAAA,wCAAkB,EAACX,iBAAiB,CAACY,MAAMf,2BAA2B,GAAGa,SAASE"}
|
|
@@ -124,7 +124,7 @@ function useKeyboardResizing(columnResizeState) {
|
|
|
124
124
|
return {
|
|
125
125
|
toggleInteractiveMode,
|
|
126
126
|
columnId,
|
|
127
|
-
getKeyboardResizingProps: (colId, currentWidth)=>({
|
|
127
|
+
getKeyboardResizingProps: _react.useCallback((colId, currentWidth)=>({
|
|
128
128
|
onKeyDown: keyboardHandler,
|
|
129
129
|
onBlur: disableInteractiveMode,
|
|
130
130
|
ref: getKeyboardResizingRef(colId),
|
|
@@ -134,6 +134,12 @@ function useKeyboardResizing(columnResizeState) {
|
|
|
134
134
|
'aria-hidden': colId === columnId ? false : true,
|
|
135
135
|
tabIndex: colId === columnId ? 0 : undefined,
|
|
136
136
|
...tabsterAttrs
|
|
137
|
-
})
|
|
137
|
+
}), [
|
|
138
|
+
columnId,
|
|
139
|
+
disableInteractiveMode,
|
|
140
|
+
getKeyboardResizingRef,
|
|
141
|
+
keyboardHandler,
|
|
142
|
+
tabsterAttrs
|
|
143
|
+
])
|
|
138
144
|
};
|
|
139
145
|
}
|