@fluentui/react-table 9.16.7 → 9.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -7
- package/lib/components/DataGridRow/useDataGridRow.js +6 -1
- package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib/components/DataGridRow/useDataGridRowStyles.styles.js +23 -2
- package/lib/components/DataGridRow/useDataGridRowStyles.styles.js.map +1 -1
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +1 -2
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib/components/TableRow/useTableRowStyles.styles.js +9 -9
- package/lib/components/TableRow/useTableRowStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js +6 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.styles.js +26 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +1 -2
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.styles.js +15 -14
- package/lib-commonjs/components/TableRow/useTableRowStyles.styles.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 06 Jun 2025 13:10:53 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.16.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.16.8)
|
|
8
|
+
|
|
9
|
+
Fri, 06 Jun 2025 13:10:53 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.16.7..@fluentui/react-table_v9.16.8)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix(DataGridSelectionCell): should not use `aria-checked` on gridcell ([PR #34503](https://github.com/microsoft/fluentui/pull/34503) by lingfangao@hotmail.com)
|
|
15
|
+
- fix: Single select should not render header selection indicator ([PR #33752](https://github.com/microsoft/fluentui/pull/33752) by lingfangao@hotmail.com)
|
|
16
|
+
- Bump @fluentui/react-aria to v9.14.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
17
|
+
- Bump @fluentui/react-avatar to v9.7.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
18
|
+
- Bump @fluentui/react-checkbox to v9.3.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
19
|
+
- Bump @fluentui/react-context-selector to v9.1.77 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
20
|
+
- Bump @fluentui/react-radio to v9.3.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.24.8 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.20.0 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
23
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.55 ([PR #34572](https://github.com/microsoft/fluentui/pull/34572) by beachball)
|
|
24
|
+
|
|
7
25
|
## [9.16.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.16.7)
|
|
8
26
|
|
|
9
|
-
Wed, 14 May 2025 18:
|
|
27
|
+
Wed, 14 May 2025 18:49:20 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.16.6..@fluentui/react-table_v9.16.7)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
13
31
|
|
|
14
|
-
- Bump @fluentui/react-aria to v9.14.7 ([PR #
|
|
15
|
-
- Bump @fluentui/react-avatar to v9.7.7 ([PR #
|
|
16
|
-
- Bump @fluentui/react-checkbox to v9.3.7 ([PR #
|
|
17
|
-
- Bump @fluentui/react-radio to v9.3.7 ([PR #
|
|
18
|
-
- Bump @fluentui/react-tabster to v9.24.7 ([PR #
|
|
32
|
+
- Bump @fluentui/react-aria to v9.14.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
|
|
33
|
+
- Bump @fluentui/react-avatar to v9.7.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
|
|
34
|
+
- Bump @fluentui/react-checkbox to v9.3.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
|
|
35
|
+
- Bump @fluentui/react-radio to v9.3.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
|
|
36
|
+
- Bump @fluentui/react-tabster to v9.24.7 ([PR #34438](https://github.com/microsoft/fluentui/pull/34438) by beachball)
|
|
19
37
|
|
|
20
38
|
## [9.16.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.16.6)
|
|
21
39
|
|
|
@@ -65,7 +65,12 @@ import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
|
|
|
65
65
|
},
|
|
66
66
|
selectionCell: slot.optional(props.selectionCell, {
|
|
67
67
|
renderByDefault: selectable,
|
|
68
|
-
elementType: DataGridSelectionCell
|
|
68
|
+
elementType: DataGridSelectionCell,
|
|
69
|
+
defaultProps: {
|
|
70
|
+
radioIndicator: {
|
|
71
|
+
disabled: isHeader
|
|
72
|
+
}
|
|
73
|
+
}
|
|
69
74
|
}),
|
|
70
75
|
renderCell: props.children,
|
|
71
76
|
columnDefs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridRow/useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\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/**\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 */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\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\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\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\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 },\n ref,\n );\n\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};\n\nfunction useStableDataGridContextValue() {\n const ref = React.useRef(dataGridContextDefaultValue);\n\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\n return ref.current!;\n}\n"],"names":["React","isInteractiveHTMLElement","useEventCallback","slot","Space","useTableRow_unstable","dataGridContextDefaultValue","useDataGridContext_unstable","DataGridSelectionCell","useTableRowIdContext","useIsInTableHeader","useDataGridRow_unstable","props","ref","rowId","isHeader","columnDefs","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","focusMode","compositeRowTabsterAttribute","tabbable","appearance","selectionAppearance","toggleRow","onClick","e","onKeyDown","key","target","preventDefault","baseState","undefined","tabIndex","children","as","components","selectionCell","optional","renderByDefault","elementType","renderCell","dataGridContextValue","useStableDataGridContextValue","useRef","current"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridRow/useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\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/**\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 */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\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\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\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\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 },\n ref,\n );\n\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 defaultProps: {\n radioIndicator: {\n disabled: isHeader,\n },\n },\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};\n\nfunction useStableDataGridContextValue() {\n const ref = React.useRef(dataGridContextDefaultValue);\n\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\n return ref.current!;\n}\n"],"names":["React","isInteractiveHTMLElement","useEventCallback","slot","Space","useTableRow_unstable","dataGridContextDefaultValue","useDataGridContext_unstable","DataGridSelectionCell","useTableRowIdContext","useIsInTableHeader","useDataGridRow_unstable","props","ref","rowId","isHeader","columnDefs","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","focusMode","compositeRowTabsterAttribute","tabbable","appearance","selectionAppearance","toggleRow","onClick","e","onKeyDown","key","target","preventDefault","baseState","undefined","tabIndex","children","as","components","selectionCell","optional","renderByDefault","elementType","defaultProps","radioIndicator","disabled","renderCell","dataGridContextValue","useStableDataGridContextValue","useRef","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ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IAAIO,cAAc,CAACJ,YAAYgB,EAAEE,GAAG,KAAK7B,SAAS,CAACH,yBAAyB8B,EAAEG,MAAM,GAAkB;YACpG,iBAAiB;YACjBH,EAAEI,cAAc;YAChBN,UAAUE,GAAGjB;QACf;SAEAF,mBAAAA,MAAMoB,SAAS,cAAfpB,uCAAAA,sBAAAA,OAAkBmB;IACpB;IAEA,MAAMK,YAAY/B,qBAChB;QACEsB;QACA,iBAAiBR,aAAaE,WAAWgB;QACzCC,UAAUZ,YAAY,CAACX,WAAW,IAAIsB;QACtC,GAAIb,cAAc,eAAe,CAACT,YAAYU,4BAA4B;QAC1E,GAAGb,KAAK;QACRkB;QACAE;QACAO,UAAU;QACVC,IAAI;IACN,GACA3B;IAGF,OAAO;QACL,GAAGuB,SAAS;QACZK,YAAY;YACV,GAAGL,UAAUK,UAAU;YACvBC,eAAelC;QACjB;QACAkC,eAAevC,KAAKwC,QAAQ,CAAC/B,MAAM8B,aAAa,EAAE;YAChDE,iBAAiBzB;YACjB0B,aAAarC;YACbsC,cAAc;gBACZC,gBAAgB;oBACdC,UAAUjC;gBACZ;YACF;QACF;QACAkC,YAAYrC,MAAM2B,QAAQ;QAC1BvB;QACA,mDAAmD;QACnD,oDAAoD;QACpDkC,sBAAsBC;IACxB;AACF,EAAE;AAEF,SAASA;IACP,MAAMtC,MAAMb,MAAMoD,MAAM,CAAC9C;IAEzB,YAAY;IACZ,oHAAoH;IACpH,4BAA4B;IAC5B,EAAE;IACF,wEAAwE;IACxE,yDAAyD;IACzD,6CAA6C;IAC7CC,4BAA4BU,CAAAA;QAC1BJ,IAAIwC,OAAO,GAAGpC;QACd,OAAO;IACT;IAEA,OAAOJ,IAAIwC,OAAO;AACpB"}
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
import { mergeClasses } from '@griffel/react';
|
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
|
+
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
|
2
3
|
import { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';
|
|
4
|
+
import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
|
|
5
|
+
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
|
|
6
|
+
import { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';
|
|
3
7
|
export const dataGridRowClassNames = {
|
|
4
8
|
root: 'fui-DataGridRow',
|
|
5
9
|
selectionCell: 'fui-DataGridRow__selectionCell'
|
|
6
10
|
};
|
|
11
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
12
|
+
singleSelectHeader: {
|
|
13
|
+
Bconypa: "f6fspww",
|
|
14
|
+
ff6mpl: "fqzoyx6"
|
|
15
|
+
},
|
|
16
|
+
subtleSelection: {
|
|
17
|
+
Bconypa: "f1jazu75",
|
|
18
|
+
ff6mpl: "fw60kww"
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
d: [".f6fspww[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:0;}", ".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}"],
|
|
22
|
+
h: [".fqzoyx6:hover .fui-TableSelectionCell{opacity:0;}", ".fw60kww:hover .fui-TableSelectionCell{opacity:1;}"]
|
|
23
|
+
});
|
|
7
24
|
/**
|
|
8
25
|
* Apply styling to the DataGridRow slots based on the state
|
|
9
26
|
*/
|
|
10
27
|
export const useDataGridRowStyles_unstable = state => {
|
|
11
28
|
'use no memo';
|
|
12
29
|
|
|
30
|
+
const isHeader = useIsInTableHeader();
|
|
31
|
+
const isSingleSelect = useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'single');
|
|
32
|
+
const isSubtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);
|
|
33
|
+
const styles = useStyles();
|
|
13
34
|
useTableRowStyles_unstable(state);
|
|
14
|
-
state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);
|
|
35
|
+
state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection, isHeader && isSingleSelect && styles.singleSelectHeader);
|
|
15
36
|
if (state.selectionCell) {
|
|
16
37
|
state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);
|
|
17
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mergeClasses","useTableRowStyles_unstable","dataGridRowClassNames","root","selectionCell","useDataGridRowStyles_unstable","state","className"],"sources":["useDataGridRowStyles.styles.js"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nexport const dataGridRowClassNames = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell'\n};\n/**\n * Apply styling to the DataGridRow slots based on the state\n */ export const useDataGridRowStyles_unstable = (state)=>{\n 'use no memo';\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n return state;\n};\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","createCustomFocusIndicatorStyle","useTableRowStyles_unstable","useIsInTableHeader","useDataGridContext_unstable","tableSelectionCellClassNames","dataGridRowClassNames","root","selectionCell","useStyles","singleSelectHeader","Bconypa","ff6mpl","subtleSelection","d","h","useDataGridRowStyles_unstable","state","isHeader","isSingleSelect","ctx","selection","selectionMode","isSubtle","styles","className"],"sources":["useDataGridRowStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nexport const dataGridRowClassNames = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell'\n};\nconst useStyles = makeStyles({\n singleSelectHeader: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 0\n }\n }, {\n selector: 'focus-within'\n }),\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 0\n }\n }\n },\n subtleSelection: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }\n }\n});\n/**\n * Apply styling to the DataGridRow slots based on the state\n */ export const useDataGridRowStyles_unstable = (state)=>{\n 'use no memo';\n const isHeader = useIsInTableHeader();\n const isSingleSelect = useDataGridContext_unstable((ctx)=>ctx.selection.selectionMode === 'single');\n const isSubtle = useDataGridContext_unstable((ctx)=>ctx.subtleSelection);\n const styles = useStyles();\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection, isHeader && isSingleSelect && styles.singleSelectHeader);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,0BAA0B,QAAQ,sCAAsC;AACjF,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,4BAA4B,QAAQ,0DAA0D;AACvG,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,SAAS,gBAAGV,QAAA;EAAAW,kBAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,eAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAE,CAAA;EAAAC,CAAA;AAAA,CA6BjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,aAAa;;EACb,MAAMC,QAAQ,GAAGf,kBAAkB,CAAC,CAAC;EACrC,MAAMgB,cAAc,GAAGf,2BAA2B,CAAEgB,GAAG,IAAGA,GAAG,CAACC,SAAS,CAACC,aAAa,KAAK,QAAQ,CAAC;EACnG,MAAMC,QAAQ,GAAGnB,2BAA2B,CAAEgB,GAAG,IAAGA,GAAG,CAACP,eAAe,CAAC;EACxE,MAAMW,MAAM,GAAGf,SAAS,CAAC,CAAC;EAC1BP,0BAA0B,CAACe,KAAK,CAAC;EACjCA,KAAK,CAACV,IAAI,CAACkB,SAAS,GAAGzB,YAAY,CAACM,qBAAqB,CAACC,IAAI,EAAEU,KAAK,CAACV,IAAI,CAACkB,SAAS,EAAEF,QAAQ,IAAIC,MAAM,CAACX,eAAe,EAAEK,QAAQ,IAAIC,cAAc,IAAIK,MAAM,CAACd,kBAAkB,CAAC;EAClL,IAAIO,KAAK,CAACT,aAAa,EAAE;IACrBS,KAAK,CAACT,aAAa,CAACiB,SAAS,GAAGzB,YAAY,CAACM,qBAAqB,CAACE,aAAa,EAAES,KAAK,CAACT,aAAa,CAACiB,SAAS,CAAC;EACpH;EACA,OAAOR,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -37,8 +37,7 @@ import { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSe
|
|
|
37
37
|
checked,
|
|
38
38
|
type,
|
|
39
39
|
invisible: isHeader && type === 'radio',
|
|
40
|
-
'aria-
|
|
41
|
-
'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,
|
|
40
|
+
'aria-selected': checked === 'mixed' ? undefined : checked,
|
|
42
41
|
subtle,
|
|
43
42
|
...props,
|
|
44
43
|
onClick
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n invisible: isHeader && type === 'radio',\n 'aria-
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n invisible: isHeader && type === 'radio',\n 'aria-selected': checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useDataGridContext_unstable","useTableRowIdContext","useIsInTableHeader","useTableSelectionCell_unstable","useDataGridSelectionCell_unstable","props","ref","isHeader","rowId","subtle","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","e","as","role","invisible","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,8BAA8B,QAAQ,8CAA8C;AAG7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC,OACAC;IAEA,MAAMC,WAAWL;IACjB,MAAMM,QAAQP;IACd,MAAMQ,SAAST,4BAA4BU,CAAAA,MAAOA,IAAIC,eAAe;IACrE,MAAMC,UAAUZ,4BAA4BU,CAAAA;QAC1C,IAAIH,YAAYG,IAAIG,SAAS,CAACC,aAAa,KAAK,eAAe;YAC7D,OAAOJ,IAAIG,SAAS,CAACE,eAAe,GAAG,OAAOL,IAAIG,SAAS,CAACG,gBAAgB,GAAG,UAAU;QAC3F;QAEA,OAAON,IAAIG,SAAS,CAACI,aAAa,CAACT;IACrC;IAEA,MAAMU,gBAAgBlB,4BAA4BU,CAAAA,MAAOA,IAAIG,SAAS,CAACK,aAAa;IACpF,MAAMC,OAAOnB,4BAA4BU,CAAAA,MACvCA,IAAIG,SAAS,CAACC,aAAa,KAAK,gBAAgB,aAAa;IAG/D,MAAMM,UAAUrB,iBAAiB,CAACsB;YAKhChB;QAJA,IAAIE,UAAU;YACZW,cAAcG;QAChB;SAEAhB,iBAAAA,MAAMe,OAAO,cAAbf,qCAAAA,oBAAAA,OAAgBgB;IAClB;IAEA,OAAOlB,+BACL;QACEmB,IAAI;QACJC,MAAM;QACNX;QACAO;QACAK,WAAWjB,YAAYY,SAAS;QAChC,iBAAiBP,YAAY,UAAUa,YAAYb;QACnDH;QACA,GAAGJ,KAAK;QACRe;IACF,GACAd;AAEJ,EAAE"}
|
|
@@ -29,6 +29,8 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
29
29
|
root: {
|
|
30
30
|
sj55zd: "f19n0e5",
|
|
31
31
|
B7ck84d: "f1ewtqcl",
|
|
32
|
+
Bconypa: "f1jazu75",
|
|
33
|
+
B6guboy: "f1xeqee6",
|
|
32
34
|
Bfpq7zp: 0,
|
|
33
35
|
g9k6zt: 0,
|
|
34
36
|
Bn4voq9: 0,
|
|
@@ -39,18 +41,16 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
39
41
|
B6xbmo0: 0,
|
|
40
42
|
B3whbx2: "f2krc9w"
|
|
41
43
|
},
|
|
42
|
-
rootSubtleSelection: {
|
|
43
|
-
Bconypa: "f1jazu75",
|
|
44
|
-
ff6mpl: "fw60kww"
|
|
45
|
-
},
|
|
46
44
|
rootInteractive: {
|
|
47
45
|
B6guboy: "f1xeqee6",
|
|
48
46
|
ecr2s2: "f1wfn5kd",
|
|
49
47
|
lj723h: "f1g4hkjv",
|
|
50
48
|
B43xm9u: "f15ngxrw",
|
|
49
|
+
i921ia: "fjbbrdp",
|
|
51
50
|
Jwef8y: "f1t94bn6",
|
|
52
51
|
Bi91k9c: "feu1g3u",
|
|
53
52
|
Bpt6rm4: "f1uorfem",
|
|
53
|
+
ff6mpl: "fw60kww",
|
|
54
54
|
ze5xyy: "f4xjyn1",
|
|
55
55
|
pgvf35: "ff1wgvm",
|
|
56
56
|
Bh7lczh: ["fiob0tu", "f1x4h75k"],
|
|
@@ -141,17 +141,17 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
141
141
|
},
|
|
142
142
|
none: {}
|
|
143
143
|
}, {
|
|
144
|
-
d: [".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1ewtqcl{box-sizing:border-box;}", [".f1dxfoyt[data-fui-focus-visible]{outline:2px solid var(--colorStrokeFocus2);}", {
|
|
144
|
+
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;}", [".f1dxfoyt[data-fui-focus-visible]{outline:2px solid var(--colorStrokeFocus2);}", {
|
|
145
145
|
p: -1
|
|
146
146
|
}], [".f2krc9w[data-fui-focus-visible]{border-radius:var(--borderRadiusMedium);}", {
|
|
147
147
|
p: -1
|
|
148
|
-
}],
|
|
148
|
+
}], [".f1facbz3{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}", {
|
|
149
149
|
p: -1
|
|
150
150
|
}], [".f1facbz3{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}", {
|
|
151
151
|
p: -1
|
|
152
152
|
}], ".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);}"],
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
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);}"],
|
|
154
|
+
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);}"],
|
|
155
155
|
m: [["@media (forced-colors: active){.f4xjyn1:hover{color:Highlight;}}", {
|
|
156
156
|
m: "(forced-colors: active)"
|
|
157
157
|
}], ["@media (forced-colors: active){.ff1wgvm:hover{border-top-color:Highlight;}}", {
|
|
@@ -183,6 +183,6 @@ export const useTableRowStyles_unstable = state => {
|
|
|
183
183
|
table: useTableLayoutStyles(),
|
|
184
184
|
flex: useFlexLayoutStyles()
|
|
185
185
|
};
|
|
186
|
-
state.root.className = mergeClasses(tableRowClassNames.root, styles.root,
|
|
186
|
+
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);
|
|
187
187
|
return state;
|
|
188
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","tableCellActionsClassNames","tableSelectionCellClassNames","createCustomFocusIndicatorStyle","tableRowClassName","tableRowClassNames","root","useTableLayoutStyles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bfpq7zp","g9k6zt","Bn4voq9","giviqs","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","tableCellActionsClassNames","tableSelectionCellClassNames","createCustomFocusIndicatorStyle","tableRowClassName","tableRowClassNames","root","useTableLayoutStyles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bconypa","B6guboy","Bfpq7zp","g9k6zt","Bn4voq9","giviqs","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","rootInteractive","ecr2s2","lj723h","B43xm9u","i921ia","Jwef8y","Bi91k9c","Bpt6rm4","ff6mpl","ze5xyy","pgvf35","Bh7lczh","dpv3f4","Bpnjhaq","medium","B9xav0g","oivjwe","Bn0qgzm","Bgfg5da","small","Be2twd7","brand","De3pzq","g2u3we","h3c5rm","zhjwy3","uu68id","Bxeuatn","felo30","Bc736ss","Bhz882k","n51gp8","Eshu5l","Bk6ri7n","v49c4f","Bn1d65q","c4eypz","v3aym","hft9gk","Bjwas2f","Bk5ld8o","gwxt9v","B6k8go","h6lo6r","Beo2b4z","w1pwid","Btyw6ap","Hkxhyr","Brwvgy3","yadkgm","neutral","none","p","a","h","m","useTableRowStyles_unstable","state","styles","layoutStyles","table","flex","className","isHeaderRow","size","noNativeElements","appearance"],"sources":["useTableRowStyles.styles.js"],"sourcesContent":["import { makeStyles, 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 = makeStyles({\n root: {\n display: 'table-row'\n }\n});\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center'\n }\n});\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ...createCustomFocusIndicatorStyle({\n outline: `2px solid ${tokens.colorStrokeFocus2}`,\n borderRadius: tokens.borderRadiusMedium\n }, {\n selector: 'focus'\n })\n },\n rootInteractive: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground1Pressed,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n },\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground1Hover,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n },\n // High contrast styles\n '@media (forced-colors: active)': {\n ':hover': {\n color: 'Highlight',\n ...shorthands.borderColor('Highlight')\n }\n }\n },\n medium: {\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`\n },\n small: {\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`\n },\n 'extra-small': {\n fontSize: tokens.fontSizeBase200\n },\n brand: {\n backgroundColor: tokens.colorBrandBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n ':active': {\n backgroundColor: tokens.colorBrandBackground2,\n color: tokens.colorNeutralForeground1\n },\n '@media(forced-colors: active)': {\n border: '2px solid transparent',\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px'\n }\n }\n },\n neutral: {\n '@media(forced-colors: active)': {\n border: '2px solid transparent',\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px'\n }\n },\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground1Hover,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundSelected\n },\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand)\n },\n none: {}\n});\n/**\n * Apply styling to the TableRow slots based on the state\n */ export const useTableRowStyles_unstable = (state)=>{\n 'use no memo';\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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,0BAA0B,QAAQ,sDAAsD;AACjG,SAASC,4BAA4B,QAAQ,0DAA0D;AACvG,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,OAAO,MAAMC,iBAAiB,GAAG,cAAc;AAC/C,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,IAAI,EAAEF;AACV,CAAC;AACD,MAAMG,oBAAoB,gBAAGV,QAAA;EAAAS,IAAA;IAAAE,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAI5B,CAAC;AACF,MAAMC,mBAAmB,gBAAGb,QAAA;EAAAS,IAAA;IAAAE,MAAA;IAAAG,OAAA;EAAA;AAAA;EAAAF,CAAA;AAAA,CAK3B,CAAC;AACF;AACA;AACA;AAAI,MAAMG,SAAS,gBAAGf,QAAA;EAAAS,IAAA;IAAAO,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC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
|
selectionCell: _reactutilities.slot.optional(props.selectionCell, {
|
|
70
70
|
renderByDefault: selectable,
|
|
71
|
-
elementType: _DataGridSelectionCell.DataGridSelectionCell
|
|
71
|
+
elementType: _DataGridSelectionCell.DataGridSelectionCell,
|
|
72
|
+
defaultProps: {
|
|
73
|
+
radioIndicator: {
|
|
74
|
+
disabled: isHeader
|
|
75
|
+
}
|
|
76
|
+
}
|
|
72
77
|
}),
|
|
73
78
|
renderCell: props.children,
|
|
74
79
|
columnDefs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridRow/useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\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/**\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 */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\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\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\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\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 },\n ref,\n );\n\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};\n\nfunction useStableDataGridContextValue() {\n const ref = React.useRef(dataGridContextDefaultValue);\n\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\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","onKeyDown","key","Space","isInteractiveHTMLElement","target","preventDefault","baseState","useTableRow_unstable","undefined","tabIndex","children","as","components","selectionCell","DataGridSelectionCell","slot","optional","renderByDefault","elementType","renderCell","dataGridContextValue","useStableDataGridContextValue","React","useRef","dataGridContextDefaultValue","current"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridRow/useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\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/**\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 */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\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\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\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\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 },\n ref,\n );\n\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 defaultProps: {\n radioIndicator: {\n disabled: isHeader,\n },\n },\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};\n\nfunction useStableDataGridContextValue() {\n const ref = React.useRef(dataGridContextDefaultValue);\n\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\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","onKeyDown","key","Space","isInteractiveHTMLElement","target","preventDefault","baseState","useTableRow_unstable","undefined","tabIndex","children","as","components","selectionCell","DataGridSelectionCell","slot","optional","renderByDefault","elementType","defaultProps","radioIndicator","disabled","renderCell","dataGridContextValue","useStableDataGridContextValue","React","useRef","dataGridContextDefaultValue","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBaA;;;eAAAA;;;;iEAnBU;gCAC0C;8BAC3C;6BAEe;iCACoC;uCACnC;8BACD;oCACF;AAW5B,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQC,IAAAA,kCAAAA;IACd,MAAMC,WAAWC,IAAAA,sCAAAA;IACjB,MAAMC,aAAaC,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIC,OAAO;IACjE,MAAMC,aAAaH,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIG,cAAc;IACxE,MAAMC,WAAWL,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIK,SAAS,CAACC,aAAa,CAACZ;IAChF,MAAMa,YAAYR,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIO,SAAS;IAClE,MAAMC,+BAA+BT,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIQ,4BAA4B;IAExG,MAAMC,WAAWF,cAAc,kBAAkBA,cAAc;IAC/D,MAAMG,aAAaX,IAAAA,4CAAAA,EAA4BC,CAAAA;QAC7C,IAAI,CAACJ,YAAYM,cAAcF,IAAIK,SAAS,CAACC,aAAa,CAACZ,QAAQ;YACjE,OAAOM,IAAIW,mBAAmB;QAChC;QAEA,OAAO;IACT;IACA,MAAMC,YAAYb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C1B5B;QACA,mDAAmD;QACnD,oDAAoD;QACpDyC,sBAAsBC;IACxB;AACF;AAEA,SAASA;IACP,MAAM/C,MAAMgD,OAAMC,MAAM,CAACC,4CAAAA;IAEzB,YAAY;IACZ,oHAAoH;IACpH,4BAA4B;IAC5B,EAAE;IACF,wEAAwE;IACxE,yDAAyD;IACzD,6CAA6C;IAC7C5C,IAAAA,4CAAAA,EAA4BC,CAAAA;QAC1BP,IAAImD,OAAO,GAAG5C;QACd,OAAO;IACT;IAEA,OAAOP,IAAImD,OAAO;AACpB"}
|
|
@@ -18,14 +18,39 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
const _react = require("@griffel/react");
|
|
20
20
|
const _useTableRowStylesstyles = require("../TableRow/useTableRowStyles.styles");
|
|
21
|
+
const _tableHeaderContext = require("../../contexts/tableHeaderContext");
|
|
22
|
+
const _dataGridContext = require("../../contexts/dataGridContext");
|
|
21
23
|
const dataGridRowClassNames = {
|
|
22
24
|
root: 'fui-DataGridRow',
|
|
23
25
|
selectionCell: 'fui-DataGridRow__selectionCell'
|
|
24
26
|
};
|
|
27
|
+
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
28
|
+
singleSelectHeader: {
|
|
29
|
+
Bconypa: "f6fspww",
|
|
30
|
+
ff6mpl: "fqzoyx6"
|
|
31
|
+
},
|
|
32
|
+
subtleSelection: {
|
|
33
|
+
Bconypa: "f1jazu75",
|
|
34
|
+
ff6mpl: "fw60kww"
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
d: [
|
|
38
|
+
".f6fspww[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:0;}",
|
|
39
|
+
".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}"
|
|
40
|
+
],
|
|
41
|
+
h: [
|
|
42
|
+
".fqzoyx6:hover .fui-TableSelectionCell{opacity:0;}",
|
|
43
|
+
".fw60kww:hover .fui-TableSelectionCell{opacity:1;}"
|
|
44
|
+
]
|
|
45
|
+
});
|
|
25
46
|
const useDataGridRowStyles_unstable = (state)=>{
|
|
26
47
|
'use no memo';
|
|
48
|
+
const isHeader = (0, _tableHeaderContext.useIsInTableHeader)();
|
|
49
|
+
const isSingleSelect = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx.selection.selectionMode === 'single');
|
|
50
|
+
const isSubtle = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>ctx.subtleSelection);
|
|
51
|
+
const styles = useStyles();
|
|
27
52
|
(0, _useTableRowStylesstyles.useTableRowStyles_unstable)(state);
|
|
28
|
-
state.root.className = (0, _react.mergeClasses)(dataGridRowClassNames.root, state.root.className);
|
|
53
|
+
state.root.className = (0, _react.mergeClasses)(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection, isHeader && isSingleSelect && styles.singleSelectHeader);
|
|
29
54
|
if (state.selectionCell) {
|
|
30
55
|
state.selectionCell.className = (0, _react.mergeClasses)(dataGridRowClassNames.selectionCell, state.selectionCell.className);
|
|
31
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridRowStyles.styles.js"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nexport const dataGridRowClassNames = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell'\n};\n/**\n * Apply styling to the DataGridRow slots based on the state\n */ export const useDataGridRowStyles_unstable = (state)=>{\n 'use no memo';\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n return state;\n};\n"],"names":["dataGridRowClassNames","useDataGridRowStyles_unstable","root","selectionCell","state","useTableRowStyles_unstable","className","mergeClasses"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["useDataGridRowStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nexport const dataGridRowClassNames = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell'\n};\nconst useStyles = makeStyles({\n singleSelectHeader: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 0\n }\n }, {\n selector: 'focus-within'\n }),\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 0\n }\n }\n },\n subtleSelection: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }\n }\n});\n/**\n * Apply styling to the DataGridRow slots based on the state\n */ export const useDataGridRowStyles_unstable = (state)=>{\n 'use no memo';\n const isHeader = useIsInTableHeader();\n const isSingleSelect = useDataGridContext_unstable((ctx)=>ctx.selection.selectionMode === 'single');\n const isSubtle = useDataGridContext_unstable((ctx)=>ctx.subtleSelection);\n const styles = useStyles();\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection, isHeader && isSingleSelect && styles.singleSelectHeader);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n return state;\n};\n"],"names":["dataGridRowClassNames","useDataGridRowStyles_unstable","root","selectionCell","useStyles","__styles","singleSelectHeader","Bconypa","ff6mpl","subtleSelection","d","h","state","isHeader","useIsInTableHeader","isSingleSelect","useDataGridContext_unstable","ctx","selection","selectionMode","isSubtle","styles","useTableRowStyles_unstable","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,qBAAqB;eAArBA;;IAoCIC,6BAA6B;eAA7BA;;;uBA1CwB;yCAEE;oCACR;iCACS;AAErC,MAAMD,wBAAwB;IACjCE,MAAM;IACNC,eAAe;AACnB;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,oBAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAC,iBAAA;QAAAF,SAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAE,GAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;KAAA;AAAA;AAgCP,MAAMV,gCAAiCW,CAAAA;IAC9C;IACA,MAAMC,WAAWC,IAAAA,sCAAkB;IACnC,MAAMC,iBAAiBC,IAAAA,4CAA2B,EAAEC,CAAAA,MAAMA,IAAIC,SAAS,CAACC,aAAa,KAAK;IAC1F,MAAMC,WAAWJ,IAAAA,4CAA2B,EAAEC,CAAAA,MAAMA,IAAIR,eAAe;IACvE,MAAMY,SAASjB;IACfkB,IAAAA,mDAA0B,EAACV;IAC3BA,MAAMV,IAAI,CAACqB,SAAS,GAAGC,IAAAA,mBAAY,EAACxB,sBAAsBE,IAAI,EAAEU,MAAMV,IAAI,CAACqB,SAAS,EAAEH,YAAYC,OAAOZ,eAAe,EAAEI,YAAYE,kBAAkBM,OAAOf,kBAAkB;IACjL,IAAIM,MAAMT,aAAa,EAAE;QACrBS,MAAMT,aAAa,CAACoB,SAAS,GAAGC,IAAAA,mBAAY,EAACxB,sBAAsBG,aAAa,EAAES,MAAMT,aAAa,CAACoB,SAAS;IACnH;IACA,OAAOX;AACX"}
|
|
@@ -40,8 +40,7 @@ const useDataGridSelectionCell_unstable = (props, ref)=>{
|
|
|
40
40
|
checked,
|
|
41
41
|
type,
|
|
42
42
|
invisible: isHeader && type === 'radio',
|
|
43
|
-
'aria-
|
|
44
|
-
'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,
|
|
43
|
+
'aria-selected': checked === 'mixed' ? undefined : checked,
|
|
45
44
|
subtle,
|
|
46
45
|
...props,
|
|
47
46
|
onClick
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n invisible: isHeader && type === 'radio',\n 'aria-
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n invisible: isHeader && type === 'radio',\n 'aria-selected': checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["useDataGridSelectionCell_unstable","props","ref","isHeader","useIsInTableHeader","rowId","useTableRowIdContext","subtle","useDataGridContext_unstable","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","useEventCallback","e","useTableSelectionCell_unstable","as","role","invisible","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBaA;;;eAAAA;;;;iEAjBU;gCACU;iCACW;8BACP;oCACF;uCACY;AAYxC,MAAMA,oCAAoC,CAC/CC,OACAC;IAEA,MAAMC,WAAWC,IAAAA,sCAAAA;IACjB,MAAMC,QAAQC,IAAAA,kCAAAA;IACd,MAAMC,SAASC,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIC,eAAe;IACrE,MAAMC,UAAUH,IAAAA,4CAAAA,EAA4BC,CAAAA;QAC1C,IAAIN,YAAYM,IAAIG,SAAS,CAACC,aAAa,KAAK,eAAe;YAC7D,OAAOJ,IAAIG,SAAS,CAACE,eAAe,GAAG,OAAOL,IAAIG,SAAS,CAACG,gBAAgB,GAAG,UAAU;QAC3F;QAEA,OAAON,IAAIG,SAAS,CAACI,aAAa,CAACX;IACrC;IAEA,MAAMY,gBAAgBT,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIG,SAAS,CAACK,aAAa;IACpF,MAAMC,OAAOV,IAAAA,4CAAAA,EAA4BC,CAAAA,MACvCA,IAAIG,SAAS,CAACC,aAAa,KAAK,gBAAgB,aAAa;IAG/D,MAAMM,UAAUC,IAAAA,gCAAAA,EAAiB,CAACC;YAKhCpB;QAJA,IAAIE,UAAU;YACZc,cAAcI;QAChB;QAEApB,CAAAA,iBAAAA,MAAMkB,OAAO,AAAPA,MAAO,QAAblB,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,IAAAA,CAAAA,OAAgBoB;IAClB;IAEA,OAAOC,IAAAA,qDAAAA,EACL;QACEC,IAAI;QACJC,MAAM;QACNb;QACAO;QACAO,WAAWtB,YAAYe,SAAS;QAChC,iBAAiBP,YAAY,UAAUe,YAAYf;QACnDJ;QACA,GAAGN,KAAK;QACRkB;IACF,GACAjB;AAEJ"}
|
|
@@ -50,6 +50,8 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
50
50
|
root: {
|
|
51
51
|
sj55zd: "f19n0e5",
|
|
52
52
|
B7ck84d: "f1ewtqcl",
|
|
53
|
+
Bconypa: "f1jazu75",
|
|
54
|
+
B6guboy: "f1xeqee6",
|
|
53
55
|
Bfpq7zp: 0,
|
|
54
56
|
g9k6zt: 0,
|
|
55
57
|
Bn4voq9: 0,
|
|
@@ -60,18 +62,16 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
60
62
|
B6xbmo0: 0,
|
|
61
63
|
B3whbx2: "f2krc9w"
|
|
62
64
|
},
|
|
63
|
-
rootSubtleSelection: {
|
|
64
|
-
Bconypa: "f1jazu75",
|
|
65
|
-
ff6mpl: "fw60kww"
|
|
66
|
-
},
|
|
67
65
|
rootInteractive: {
|
|
68
66
|
B6guboy: "f1xeqee6",
|
|
69
67
|
ecr2s2: "f1wfn5kd",
|
|
70
68
|
lj723h: "f1g4hkjv",
|
|
71
69
|
B43xm9u: "f15ngxrw",
|
|
70
|
+
i921ia: "fjbbrdp",
|
|
72
71
|
Jwef8y: "f1t94bn6",
|
|
73
72
|
Bi91k9c: "feu1g3u",
|
|
74
73
|
Bpt6rm4: "f1uorfem",
|
|
74
|
+
ff6mpl: "fw60kww",
|
|
75
75
|
ze5xyy: "f4xjyn1",
|
|
76
76
|
pgvf35: "ff1wgvm",
|
|
77
77
|
Bh7lczh: [
|
|
@@ -183,6 +183,8 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
183
183
|
d: [
|
|
184
184
|
".f19n0e5{color:var(--colorNeutralForeground1);}",
|
|
185
185
|
".f1ewtqcl{box-sizing:border-box;}",
|
|
186
|
+
".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}",
|
|
187
|
+
".f1xeqee6[data-fui-focus-within]:focus-within .fui-TableCellActions{opacity:1;}",
|
|
186
188
|
[
|
|
187
189
|
".f1dxfoyt[data-fui-focus-visible]{outline:2px solid var(--colorStrokeFocus2);}",
|
|
188
190
|
{
|
|
@@ -195,8 +197,6 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
195
197
|
p: -1
|
|
196
198
|
}
|
|
197
199
|
],
|
|
198
|
-
".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}",
|
|
199
|
-
".f1xeqee6[data-fui-focus-within]:focus-within .fui-TableCellActions{opacity:1;}",
|
|
200
200
|
[
|
|
201
201
|
".f1facbz3{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}",
|
|
202
202
|
{
|
|
@@ -222,21 +222,22 @@ const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
222
222
|
".f11o2r7f{border-left-color:var(--colorNeutralStrokeOnBrand);}",
|
|
223
223
|
".fem5et0{border-bottom-color:var(--colorNeutralStrokeOnBrand);}"
|
|
224
224
|
],
|
|
225
|
-
h: [
|
|
226
|
-
".fw60kww:hover .fui-TableSelectionCell{opacity:1;}",
|
|
227
|
-
".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}",
|
|
228
|
-
".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}",
|
|
229
|
-
".f1uorfem:hover .fui-TableCellActions{opacity:1;}",
|
|
230
|
-
".f1uqaxdt:hover{background-color:var(--colorSubtleBackgroundSelected);}"
|
|
231
|
-
],
|
|
232
225
|
a: [
|
|
233
226
|
".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}",
|
|
234
227
|
".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}",
|
|
235
228
|
".f15ngxrw:active .fui-TableCellActions{opacity:1;}",
|
|
229
|
+
".fjbbrdp:active .fui-TableSelectionCell{opacity:1;}",
|
|
236
230
|
".f7tkmfy:active{background-color:var(--colorBrandBackground2);}",
|
|
237
231
|
".f1r2dosr:active{color:var(--colorNeutralForeground1);}",
|
|
238
232
|
".fa9o754:active{background-color:var(--colorSubtleBackgroundSelected);}"
|
|
239
233
|
],
|
|
234
|
+
h: [
|
|
235
|
+
".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}",
|
|
236
|
+
".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}",
|
|
237
|
+
".f1uorfem:hover .fui-TableCellActions{opacity:1;}",
|
|
238
|
+
".fw60kww:hover .fui-TableSelectionCell{opacity:1;}",
|
|
239
|
+
".f1uqaxdt:hover{background-color:var(--colorSubtleBackgroundSelected);}"
|
|
240
|
+
],
|
|
240
241
|
m: [
|
|
241
242
|
[
|
|
242
243
|
"@media (forced-colors: active){.f4xjyn1:hover{color:Highlight;}}",
|
|
@@ -297,6 +298,6 @@ const useTableRowStyles_unstable = (state)=>{
|
|
|
297
298
|
table: useTableLayoutStyles(),
|
|
298
299
|
flex: useFlexLayoutStyles()
|
|
299
300
|
};
|
|
300
|
-
state.root.className = (0, _react.mergeClasses)(tableRowClassNames.root, styles.root,
|
|
301
|
+
state.root.className = (0, _react.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);
|
|
301
302
|
return state;
|
|
302
303
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableRowStyles.styles.js"],"sourcesContent":["import { makeStyles, 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 = makeStyles({\n root: {\n display: 'table-row'\n }\n});\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center'\n }\n});\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n ...createCustomFocusIndicatorStyle({\n
|
|
1
|
+
{"version":3,"sources":["useTableRowStyles.styles.js"],"sourcesContent":["import { makeStyles, 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 = makeStyles({\n root: {\n display: 'table-row'\n }\n});\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center'\n }\n});\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ...createCustomFocusIndicatorStyle({\n outline: `2px solid ${tokens.colorStrokeFocus2}`,\n borderRadius: tokens.borderRadiusMedium\n }, {\n selector: 'focus'\n })\n },\n rootInteractive: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground1Pressed,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n },\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground1Hover,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n },\n // High contrast styles\n '@media (forced-colors: active)': {\n ':hover': {\n color: 'Highlight',\n ...shorthands.borderColor('Highlight')\n }\n }\n },\n medium: {\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`\n },\n small: {\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`\n },\n 'extra-small': {\n fontSize: tokens.fontSizeBase200\n },\n brand: {\n backgroundColor: tokens.colorBrandBackground2,\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n ':active': {\n backgroundColor: tokens.colorBrandBackground2,\n color: tokens.colorNeutralForeground1\n },\n '@media(forced-colors: active)': {\n border: '2px solid transparent',\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px'\n }\n }\n },\n neutral: {\n '@media(forced-colors: active)': {\n border: '2px solid transparent',\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px'\n }\n },\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground1Hover,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundSelected\n },\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand)\n },\n none: {}\n});\n/**\n * Apply styling to the TableRow slots based on the state\n */ export const useTableRowStyles_unstable = (state)=>{\n 'use no memo';\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"],"names":["tableRowClassName","tableRowClassNames","useTableRowStyles_unstable","root","useTableLayoutStyles","__styles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bconypa","B6guboy","Bfpq7zp","g9k6zt","Bn4voq9","giviqs","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","rootInteractive","ecr2s2","lj723h","B43xm9u","i921ia","Jwef8y","Bi91k9c","Bpt6rm4","ff6mpl","ze5xyy","pgvf35","Bh7lczh","dpv3f4","Bpnjhaq","medium","B9xav0g","oivjwe","Bn0qgzm","Bgfg5da","small","Be2twd7","brand","De3pzq","g2u3we","h3c5rm","zhjwy3","uu68id","Bxeuatn","felo30","Bc736ss","Bhz882k","n51gp8","Eshu5l","Bk6ri7n","v49c4f","Bn1d65q","c4eypz","v3aym","hft9gk","Bjwas2f","Bk5ld8o","gwxt9v","B6k8go","h6lo6r","Beo2b4z","w1pwid","Btyw6ap","Hkxhyr","Brwvgy3","yadkgm","neutral","none","p","a","h","m","state","styles","layoutStyles","table","flex","className","mergeClasses","isHeaderRow","size","noNativeElements","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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table",
|
|
3
|
-
"version": "9.16.
|
|
3
|
+
"version": "9.16.8",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@fluentui/keyboard-keys": "^9.0.8",
|
|
24
|
-
"@fluentui/react-aria": "^9.14.
|
|
25
|
-
"@fluentui/react-avatar": "^9.7.
|
|
26
|
-
"@fluentui/react-checkbox": "^9.3.
|
|
27
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
24
|
+
"@fluentui/react-aria": "^9.14.8",
|
|
25
|
+
"@fluentui/react-avatar": "^9.7.8",
|
|
26
|
+
"@fluentui/react-checkbox": "^9.3.8",
|
|
27
|
+
"@fluentui/react-context-selector": "^9.1.77",
|
|
28
28
|
"@fluentui/react-icons": "^2.0.245",
|
|
29
|
-
"@fluentui/react-radio": "^9.3.
|
|
29
|
+
"@fluentui/react-radio": "^9.3.8",
|
|
30
30
|
"@fluentui/react-shared-contexts": "^9.23.1",
|
|
31
|
-
"@fluentui/react-tabster": "^9.24.
|
|
31
|
+
"@fluentui/react-tabster": "^9.24.8",
|
|
32
32
|
"@fluentui/react-theme": "^9.1.24",
|
|
33
|
-
"@fluentui/react-utilities": "^9.
|
|
34
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
33
|
+
"@fluentui/react-utilities": "^9.20.0",
|
|
34
|
+
"@fluentui/react-jsx-runtime": "^9.0.55",
|
|
35
35
|
"@griffel/react": "^1.5.22",
|
|
36
36
|
"@swc/helpers": "^0.5.1"
|
|
37
37
|
},
|