@fluentui/react-table 9.15.26 → 9.15.28
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 +31 -2
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCell.js +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 22 Jan 2025 13:55:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.15.28](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.15.28)
|
|
8
|
+
|
|
9
|
+
Wed, 22 Jan 2025 13:55:19 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.15.27..@fluentui/react-table_v9.15.28)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-aria to v9.13.14 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
15
|
+
- Bump @fluentui/react-avatar to v9.6.49 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
16
|
+
- Bump @fluentui/react-checkbox to v9.2.46 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
17
|
+
- Bump @fluentui/react-context-selector to v9.1.72 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
18
|
+
- Bump @fluentui/react-radio to v9.2.41 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.23.3 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.18.20 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
21
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.50 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
22
|
+
|
|
23
|
+
## [9.15.27](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.15.27)
|
|
24
|
+
|
|
25
|
+
Wed, 08 Jan 2025 18:33:36 GMT
|
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.15.26..@fluentui/react-table_v9.15.27)
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- Bump @fluentui/react-aria to v9.13.13 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
31
|
+
- Bump @fluentui/react-avatar to v9.6.48 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
32
|
+
- Bump @fluentui/react-checkbox to v9.2.45 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
33
|
+
- Bump @fluentui/react-radio to v9.2.40 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
34
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.49 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
35
|
+
|
|
7
36
|
## [9.15.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.15.26)
|
|
8
37
|
|
|
9
|
-
Wed, 18 Dec 2024 10:
|
|
38
|
+
Wed, 18 Dec 2024 10:59:37 GMT
|
|
10
39
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.15.25..@fluentui/react-table_v9.15.26)
|
|
11
40
|
|
|
12
41
|
### Patches
|
|
@@ -30,7 +30,7 @@ import { isColumnSortable } from '../../utils/isColumnSortable';
|
|
|
30
30
|
const getTableHeaderCellProps = useDataGridContext_unstable((ctx)=>{
|
|
31
31
|
return ctx.columnSizing_unstable.getTableHeaderCellProps;
|
|
32
32
|
});
|
|
33
|
-
// eslint-disable-next-line
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement
|
|
34
34
|
const onClick = useEventCallback((e)=>{
|
|
35
35
|
var _props_onClick;
|
|
36
36
|
if (sortable) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\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/**\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 */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\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\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n\n // eslint-disable-next-line
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\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/**\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 */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\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\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableHeaderCellElement>) => {\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n props.onClick?.(e);\n });\n\n return useTableHeaderCell_unstable(\n {\n sortable,\n sortDirection,\n as: 'div',\n tabIndex: sortable ? undefined : 0,\n ...(resizableColumns ? getTableHeaderCellProps(columnId) : {}),\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useTableHeaderCell_unstable","useDataGridContext_unstable","useColumnIdContext","useTableContext","isColumnSortable","useDataGridHeaderCell_unstable","props","ref","columnId","sortable","gridSortable","toggleColumnSort","ctx","sort","columnSortable","columns","find","c","sortDirection","getSortDirection","undefined","resizableColumns","getTableHeaderCellProps","columnSizing_unstable","onClick","e","as","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,gBAAgB,QAAQ,+BAA+B;AAEhE;;;;;;;;CAQC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,WAAWN;IACjB,MAAM,EAAEO,UAAUC,YAAY,EAAE,GAAGP;IACnC,MAAMQ,mBAAmBV,4BAA4BW,CAAAA,MAAOA,IAAIC,IAAI,CAACF,gBAAgB;IAErF,MAAMF,WAAWR,4BAA4BW,CAAAA;QAC3C,MAAME,iBAAiB,CAAC,CAACF,IAAIG,OAAO,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAET,QAAQ,KAAKA,YAAYJ,iBAAiBa;QAC3F,IAAI,CAACP,cAAc;YACjB,+DAA+D;YAC/D,OAAO;QACT;QAEA,OAAOI;IACT;IAEA,MAAMI,gBAAgBjB,4BAA4BW,CAAAA,MAChDH,WAAWG,IAAIC,IAAI,CAACM,gBAAgB,CAACX,YAAYY;IAEnD,MAAMC,mBAAmBpB,4BAA4BW,CAAAA,MAAOA,IAAIS,gBAAgB;IAChF,MAAMC,0BAA0BrB,4BAA4BW,CAAAA;QAC1D,OAAOA,IAAIW,qBAAqB,CAACD,uBAAuB;IAC1D;IAEA,2FAA2F;IAC3F,MAAME,UAAUzB,iBAAiB,CAAC0B;YAIhCnB;QAHA,IAAIG,UAAU;YACZE,iBAAiBc,GAAGjB;QACtB;SACAF,iBAAAA,MAAMkB,OAAO,cAAblB,qCAAAA,oBAAAA,OAAgBmB;IAClB;IAEA,OAAOzB,4BACL;QACES;QACAS;QACAQ,IAAI;QACJC,UAAUlB,WAAWW,YAAY;QACjC,GAAIC,mBAAmBC,wBAAwBd,YAAY,CAAC,CAAC;QAC7D,GAAGF,KAAK;QACRkB;IACF,GACAjB;AAEJ,EAAE"}
|
|
@@ -16,7 +16,7 @@ import { useFocusWithin } from '@fluentui/react-tabster';
|
|
|
16
16
|
*/ export const useTableSelectionCell_unstable = (props, ref)=>{
|
|
17
17
|
const tableCellState = useTableCell_unstable(props, useMergedRefs(ref, useFocusWithin()));
|
|
18
18
|
const { noNativeElements } = useTableContext();
|
|
19
|
-
const { type = 'checkbox', checked = false, subtle = false, // eslint-disable-next-line
|
|
19
|
+
const { type = 'checkbox', checked = false, subtle = false, // eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
20
20
|
hidden = false, invisible = false } = props;
|
|
21
21
|
return {
|
|
22
22
|
...tableCellState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, useMergedRefs(ref, useFocusWithin()));\n const { noNativeElements } = useTableContext();\n const {\n type = 'checkbox',\n checked = false,\n subtle = false,\n // eslint-disable-next-line
|
|
1
|
+
{"version":3,"sources":["../src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, useMergedRefs(ref, useFocusWithin()));\n const { noNativeElements } = useTableContext();\n const {\n type = 'checkbox',\n checked = false,\n subtle = false,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n hidden = false,\n invisible = false,\n } = props;\n\n return {\n ...tableCellState,\n components: {\n ...tableCellState.components,\n checkboxIndicator: Checkbox,\n radioIndicator: Radio,\n },\n checkboxIndicator: slot.optional(props.checkboxIndicator, {\n renderByDefault: type === 'checkbox',\n defaultProps: { checked: props.checked },\n elementType: Checkbox,\n }),\n radioIndicator: slot.optional(props.radioIndicator, {\n renderByDefault: type === 'radio',\n defaultProps: { checked: !!checked, input: { name: useId('table-selection-radio') } },\n elementType: Radio,\n }),\n type,\n checked,\n noNativeElements,\n subtle,\n hidden: invisible || hidden,\n };\n};\n"],"names":["React","useId","slot","useMergedRefs","Checkbox","Radio","useTableCell_unstable","useTableContext","useFocusWithin","useTableSelectionCell_unstable","props","ref","tableCellState","noNativeElements","type","checked","subtle","hidden","invisible","components","checkboxIndicator","radioIndicator","optional","renderByDefault","defaultProps","elementType","input","name"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AACvE,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,KAAK,QAAQ,wBAAwB;AAE9C,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,cAAc,QAAQ,0BAA0B;AAEzD;;;;;;;;CAQC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,iBAAiBN,sBAAsBI,OAAOP,cAAcQ,KAAKH;IACvE,MAAM,EAAEK,gBAAgB,EAAE,GAAGN;IAC7B,MAAM,EACJO,OAAO,UAAU,EACjBC,UAAU,KAAK,EACfC,SAAS,KAAK,EACd,4DAA4D;IAC5DC,SAAS,KAAK,EACdC,YAAY,KAAK,EAClB,GAAGR;IAEJ,OAAO;QACL,GAAGE,cAAc;QACjBO,YAAY;YACV,GAAGP,eAAeO,UAAU;YAC5BC,mBAAmBhB;YACnBiB,gBAAgBhB;QAClB;QACAe,mBAAmBlB,KAAKoB,QAAQ,CAACZ,MAAMU,iBAAiB,EAAE;YACxDG,iBAAiBT,SAAS;YAC1BU,cAAc;gBAAET,SAASL,MAAMK,OAAO;YAAC;YACvCU,aAAarB;QACf;QACAiB,gBAAgBnB,KAAKoB,QAAQ,CAACZ,MAAMW,cAAc,EAAE;YAClDE,iBAAiBT,SAAS;YAC1BU,cAAc;gBAAET,SAAS,CAAC,CAACA;gBAASW,OAAO;oBAAEC,MAAM1B,MAAM;gBAAyB;YAAE;YACpFwB,aAAapB;QACf;QACAS;QACAC;QACAF;QACAG;QACAC,QAAQC,aAAaD;IACvB;AACF,EAAE"}
|
|
@@ -33,7 +33,7 @@ const useDataGridHeaderCell_unstable = (props, ref)=>{
|
|
|
33
33
|
const getTableHeaderCellProps = (0, _dataGridContext.useDataGridContext_unstable)((ctx)=>{
|
|
34
34
|
return ctx.columnSizing_unstable.getTableHeaderCellProps;
|
|
35
35
|
});
|
|
36
|
-
// eslint-disable-next-line
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement
|
|
37
37
|
const onClick = (0, _reactutilities.useEventCallback)((e)=>{
|
|
38
38
|
var _props_onClick;
|
|
39
39
|
if (sortable) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\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/**\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 */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\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\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n\n // eslint-disable-next-line
|
|
1
|
+
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\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/**\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 */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\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\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableHeaderCellElement>) => {\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n props.onClick?.(e);\n });\n\n return useTableHeaderCell_unstable(\n {\n sortable,\n sortDirection,\n as: 'div',\n tabIndex: sortable ? undefined : 0,\n ...(resizableColumns ? getTableHeaderCellProps(columnId) : {}),\n ...props,\n onClick,\n },\n ref,\n );\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","useTableHeaderCell_unstable","as","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBaA;;;eAAAA;;;;iEAlBU;gCACU;oCAEW;iCACA;iCACT;8BACH;kCACC;AAW1B,MAAMA,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,WAAWC,IAAAA,mCAAAA;IACjB,MAAM,EAAEC,UAAUC,YAAY,EAAE,GAAGC,IAAAA,6BAAAA;IACnC,MAAMC,mBAAmBC,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIC,IAAI,CAACH,gBAAgB;IAErF,MAAMH,WAAWI,IAAAA,4CAAAA,EAA4BC,CAAAA;QAC3C,MAAME,iBAAiB,CAAC,CAACF,IAAIG,OAAO,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAEZ,QAAQ,KAAKA,YAAYa,IAAAA,kCAAAA,EAAiBD;QAC3F,IAAI,CAACT,cAAc;YACjB,+DAA+D;YAC/D,OAAO;QACT;QAEA,OAAOM;IACT;IAEA,MAAMK,gBAAgBR,IAAAA,4CAAAA,EAA4BC,CAAAA,MAChDL,WAAWK,IAAIC,IAAI,CAACO,gBAAgB,CAACf,YAAYgB;IAEnD,MAAMC,mBAAmBX,IAAAA,4CAAAA,EAA4BC,CAAAA,MAAOA,IAAIU,gBAAgB;IAChF,MAAMC,0BAA0BZ,IAAAA,4CAAAA,EAA4BC,CAAAA;QAC1D,OAAOA,IAAIY,qBAAqB,CAACD,uBAAuB;IAC1D;IAEA,2FAA2F;IAC3F,MAAME,UAAUC,IAAAA,gCAAAA,EAAiB,CAACC;YAIhCxB;QAHA,IAAII,UAAU;YACZG,iBAAiBiB,GAAGtB;QACtB;QACAF,CAAAA,iBAAAA,MAAMsB,OAAO,AAAPA,MAAO,QAAbtB,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,IAAAA,CAAAA,OAAgBwB;IAClB;IAEA,OAAOC,IAAAA,+CAAAA,EACL;QACErB;QACAY;QACAU,IAAI;QACJC,UAAUvB,WAAWc,YAAY;QACjC,GAAIC,mBAAmBC,wBAAwBlB,YAAY,CAAC,CAAC;QAC7D,GAAGF,KAAK;QACRsB;IACF,GACArB;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, useMergedRefs(ref, useFocusWithin()));\n const { noNativeElements } = useTableContext();\n const {\n type = 'checkbox',\n checked = false,\n subtle = false,\n // eslint-disable-next-line
|
|
1
|
+
{"version":3,"sources":["../src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, useMergedRefs(ref, useFocusWithin()));\n const { noNativeElements } = useTableContext();\n const {\n type = 'checkbox',\n checked = false,\n subtle = false,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n hidden = false,\n invisible = false,\n } = props;\n\n return {\n ...tableCellState,\n components: {\n ...tableCellState.components,\n checkboxIndicator: Checkbox,\n radioIndicator: Radio,\n },\n checkboxIndicator: slot.optional(props.checkboxIndicator, {\n renderByDefault: type === 'checkbox',\n defaultProps: { checked: props.checked },\n elementType: Checkbox,\n }),\n radioIndicator: slot.optional(props.radioIndicator, {\n renderByDefault: type === 'radio',\n defaultProps: { checked: !!checked, input: { name: useId('table-selection-radio') } },\n elementType: Radio,\n }),\n type,\n checked,\n noNativeElements,\n subtle,\n hidden: invisible || hidden,\n };\n};\n"],"names":["useTableSelectionCell_unstable","props","ref","tableCellState","useTableCell_unstable","useMergedRefs","useFocusWithin","noNativeElements","useTableContext","type","checked","subtle","hidden","invisible","components","checkboxIndicator","Checkbox","radioIndicator","Radio","slot","optional","renderByDefault","defaultProps","elementType","input","name","useId"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBaA;;;eAAAA;;;;iEAlBU;gCACoB;+BAClB;4BACH;8BAEgB;8BACN;8BACD;AAWxB,MAAMA,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,iBAAiBC,IAAAA,mCAAAA,EAAsBH,OAAOI,IAAAA,6BAAAA,EAAcH,KAAKI,IAAAA,4BAAAA;IACvE,MAAM,EAAEC,gBAAgB,EAAE,GAAGC,IAAAA,6BAAAA;IAC7B,MAAM,EACJC,OAAO,UAAU,EACjBC,UAAU,KAAK,EACfC,SAAS,KAAK,EAEdC,SAAS,KAAK,EACdC,YAAY,KAAK,EAClB,GAAGZ;IAEJ,OAAO;QACL,GAAGE,cAAc;QACjBW,YAAY;YACV,GAAGX,eAAeW,UAAU;YAC5BC,mBAAmBC,uBAAAA;YACnBC,gBAAgBC,iBAAAA;QAClB;QACAH,mBAAmBI,oBAAAA,CAAKC,QAAQ,CAACnB,MAAMc,iBAAiB,EAAE;YACxDM,iBAAiBZ,SAAS;YAC1Ba,cAAc;gBAAEZ,SAAST,MAAMS,OAAO;YAAC;YACvCa,aAAaP,uBAAAA;QACf;QACAC,gBAAgBE,oBAAAA,CAAKC,QAAQ,CAACnB,MAAMgB,cAAc,EAAE;YAClDI,iBAAiBZ,SAAS;YAC1Ba,cAAc;gBAAEZ,SAAS,CAAC,CAACA;gBAASc,OAAO;oBAAEC,MAAMC,IAAAA,qBAAAA,EAAM;gBAAyB;YAAE;YACpFH,aAAaL,iBAAAA;QACf;QACAT;QACAC;QACAH;QACAI;QACAC,QAAQC,aAAaD;IACvB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
|
-
"version": "9.15.
|
|
3
|
+
"version": "9.15.28",
|
|
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.13.
|
|
25
|
-
"@fluentui/react-avatar": "^9.6.
|
|
26
|
-
"@fluentui/react-checkbox": "^9.2.
|
|
27
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
24
|
+
"@fluentui/react-aria": "^9.13.14",
|
|
25
|
+
"@fluentui/react-avatar": "^9.6.49",
|
|
26
|
+
"@fluentui/react-checkbox": "^9.2.46",
|
|
27
|
+
"@fluentui/react-context-selector": "^9.1.72",
|
|
28
28
|
"@fluentui/react-icons": "^2.0.245",
|
|
29
|
-
"@fluentui/react-radio": "^9.2.
|
|
29
|
+
"@fluentui/react-radio": "^9.2.41",
|
|
30
30
|
"@fluentui/react-shared-contexts": "^9.21.2",
|
|
31
|
-
"@fluentui/react-tabster": "^9.23.
|
|
31
|
+
"@fluentui/react-tabster": "^9.23.3",
|
|
32
32
|
"@fluentui/react-theme": "^9.1.24",
|
|
33
|
-
"@fluentui/react-utilities": "^9.18.
|
|
34
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
33
|
+
"@fluentui/react-utilities": "^9.18.20",
|
|
34
|
+
"@fluentui/react-jsx-runtime": "^9.0.50",
|
|
35
35
|
"@griffel/react": "^1.5.22",
|
|
36
36
|
"@swc/helpers": "^0.5.1"
|
|
37
37
|
},
|