@fluentui/react-table 9.11.12 → 9.11.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -2
- package/lib/components/DataGridCell/DataGridCell.types.js +3 -1
- package/lib/components/DataGridCell/DataGridCell.types.js.map +1 -1
- package/lib/components/DataGridHeader/DataGridHeader.types.js +3 -1
- package/lib/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
- package/lib/components/DataGridHeaderCell/DataGridHeaderCell.types.js +3 -1
- package/lib/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
- package/lib/components/DataGridSelectionCell/DataGridSelectionCell.types.js +3 -1
- package/lib/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
- package/lib/components/Table/Table.types.js +3 -1
- package/lib/components/Table/Table.types.js.map +1 -1
- package/lib/components/TableBody/TableBody.types.js +3 -1
- package/lib/components/TableBody/TableBody.types.js.map +1 -1
- package/lib/components/TableCell/TableCell.types.js +3 -1
- package/lib/components/TableCell/TableCell.types.js.map +1 -1
- package/lib/components/TableCellActions/TableCellActions.types.js +3 -1
- package/lib/components/TableCellActions/TableCellActions.types.js.map +1 -1
- package/lib/components/TableCellLayout/TableCellLayout.types.js +3 -1
- package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
- package/lib/components/TableHeader/TableHeader.types.js +3 -1
- package/lib/components/TableHeader/TableHeader.types.js.map +1 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js +3 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js +3 -1
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -1
- package/lib/components/TableRow/TableRow.types.js +3 -1
- package/lib/components/TableRow/TableRow.types.js.map +1 -1
- package/lib/components/TableSelectionCell/TableSelectionCell.types.js +3 -1
- package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
- package/lib/hooks/useTableSelection.js +3 -0
- package/lib/hooks/useTableSelection.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/DataGridCell.types.js +3 -1
- package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js +3 -1
- package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js +3 -1
- package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js +3 -1
- package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
- package/lib-commonjs/components/Table/Table.types.js +3 -1
- package/lib-commonjs/components/Table/Table.types.js.map +1 -1
- package/lib-commonjs/components/TableBody/TableBody.types.js +3 -1
- package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
- package/lib-commonjs/components/TableCell/TableCell.types.js +3 -1
- package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/TableCellActions.types.js +3 -1
- package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js +3 -1
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
- package/lib-commonjs/components/TableHeader/TableHeader.types.js +3 -1
- package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js +3 -1
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js +3 -1
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -1
- package/lib-commonjs/components/TableRow/TableRow.types.js +3 -1
- package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js +3 -1
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
- package/lib-commonjs/contexts/columnIdContext.js +3 -3
- package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
- package/lib-commonjs/contexts/dataGridContext.js +3 -3
- package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
- package/lib-commonjs/contexts/rowIdContext.js +3 -3
- package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
- package/lib-commonjs/contexts/tableContext.js +3 -3
- package/lib-commonjs/contexts/tableContext.js.map +1 -1
- package/lib-commonjs/hooks/useMeasureElement.js +3 -3
- package/lib-commonjs/hooks/useMeasureElement.js.map +1 -1
- package/lib-commonjs/hooks/useTableSelection.js +3 -0
- package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
- package/lib-commonjs/index.js +213 -213
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/columnResizeUtils.js +7 -7
- package/lib-commonjs/utils/columnResizeUtils.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,49 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 15 Mar 2024 21:37:57 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.11.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.11.14)
|
|
8
|
+
|
|
9
|
+
Fri, 15 Mar 2024 21:37:57 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.11.13..@fluentui/react-table_v9.11.14)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-aria to v9.10.1 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
15
|
+
- Bump @fluentui/react-avatar to v9.6.18 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
16
|
+
- Bump @fluentui/react-checkbox to v9.2.16 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
17
|
+
- Bump @fluentui/react-context-selector to v9.1.55 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
18
|
+
- Bump @fluentui/react-radio to v9.2.11 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
19
|
+
- Bump @fluentui/react-shared-contexts to v9.15.1 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v9.19.4 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
21
|
+
- Bump @fluentui/react-theme to v9.1.18 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.18.4 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
23
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.33 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
24
|
+
|
|
25
|
+
## [9.11.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.11.13)
|
|
26
|
+
|
|
27
|
+
Thu, 07 Mar 2024 19:33:25 GMT
|
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.11.12..@fluentui/react-table_v9.11.13)
|
|
29
|
+
|
|
30
|
+
### Patches
|
|
31
|
+
|
|
32
|
+
- fix: allRowsSelected is false when there are no rows ([PR #30706](https://github.com/microsoft/fluentui/pull/30706) by lingfangao@hotmail.com)
|
|
33
|
+
- Bump @fluentui/react-aria to v9.10.0 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
34
|
+
- Bump @fluentui/react-avatar to v9.6.17 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
35
|
+
- Bump @fluentui/react-checkbox to v9.2.15 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
36
|
+
- Bump @fluentui/react-context-selector to v9.1.54 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
37
|
+
- Bump @fluentui/react-radio to v9.2.10 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
38
|
+
- Bump @fluentui/react-shared-contexts to v9.15.0 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
39
|
+
- Bump @fluentui/react-tabster to v9.19.3 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
40
|
+
- Bump @fluentui/react-theme to v9.1.17 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
41
|
+
- Bump @fluentui/react-utilities to v9.18.3 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
42
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.32 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
43
|
+
|
|
7
44
|
## [9.11.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.11.12)
|
|
8
45
|
|
|
9
|
-
Wed, 28 Feb 2024 02:
|
|
46
|
+
Wed, 28 Feb 2024 02:34:19 GMT
|
|
10
47
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.11.11..@fluentui/react-table_v9.11.12)
|
|
11
48
|
|
|
12
49
|
### Patches
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DataGridCell.types.ts"],"sourcesContent":["import { TableCellProps, TableCellSlots, TableCellState } from '../TableCell/TableCell.types';\n\nexport type DataGridCellSlots = TableCellSlots;\n\n/**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n */\nexport type DataGridCellFocusMode = 'group' | 'none' | 'cell';\n\n/**\n * DataGridCell Props\n */\nexport type DataGridCellProps = TableCellProps & {\n /**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n * @default cell\n */\n focusMode?: DataGridCellFocusMode;\n};\n\n/**\n * State used in rendering DataGridCell\n */\nexport type DataGridCellState = TableCellState;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["DataGridCell.types.ts"],"sourcesContent":["import { TableCellProps, TableCellSlots, TableCellState } from '../TableCell/TableCell.types';\n\nexport type DataGridCellSlots = TableCellSlots;\n\n/**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n */\nexport type DataGridCellFocusMode = 'group' | 'none' | 'cell';\n\n/**\n * DataGridCell Props\n */\nexport type DataGridCellProps = TableCellProps & {\n /**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n * @default cell\n */\n focusMode?: DataGridCellFocusMode;\n};\n\n/**\n * State used in rendering DataGridCell\n */\nexport type DataGridCellState = TableCellState;\n"],"names":[],"mappings":"AA0BA;;CAEC,GACD,WAA+C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DataGridHeader.types.ts"],"sourcesContent":["import { TableHeaderProps, TableHeaderSlots, TableHeaderState } from '../TableHeader/TableHeader.types';\n\nexport type DataGridHeaderSlots = TableHeaderSlots;\n\n/**\n * DataGridHeader Props\n */\nexport type DataGridHeaderProps = TableHeaderProps;\n\n/**\n * State used in rendering DataGridHeader\n */\nexport type DataGridHeaderState = TableHeaderState;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["DataGridHeader.types.ts"],"sourcesContent":["import { TableHeaderProps, TableHeaderSlots, TableHeaderState } from '../TableHeader/TableHeader.types';\n\nexport type DataGridHeaderSlots = TableHeaderSlots;\n\n/**\n * DataGridHeader Props\n */\nexport type DataGridHeaderProps = TableHeaderProps;\n\n/**\n * State used in rendering DataGridHeader\n */\nexport type DataGridHeaderState = TableHeaderState;\n"],"names":[],"mappings":"AASA;;CAEC,GACD,WAAmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DataGridHeaderCell.types.ts"],"sourcesContent":["import {\n TableHeaderCellProps,\n TableHeaderCellSlots,\n TableHeaderCellState,\n} from '../TableHeaderCell/TableHeaderCell.types';\n\nexport type DataGridHeaderCellSlots = TableHeaderCellSlots;\n\n/**\n * DataGridHeaderCell Props\n */\nexport type DataGridHeaderCellProps = Omit<TableHeaderCellProps, 'sortable'>;\n\n/**\n * State used in rendering DataGridHeaderCell\n */\nexport type DataGridHeaderCellState = TableHeaderCellState;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["DataGridHeaderCell.types.ts"],"sourcesContent":["import {\n TableHeaderCellProps,\n TableHeaderCellSlots,\n TableHeaderCellState,\n} from '../TableHeaderCell/TableHeaderCell.types';\n\nexport type DataGridHeaderCellSlots = TableHeaderCellSlots;\n\n/**\n * DataGridHeaderCell Props\n */\nexport type DataGridHeaderCellProps = Omit<TableHeaderCellProps, 'sortable'>;\n\n/**\n * State used in rendering DataGridHeaderCell\n */\nexport type DataGridHeaderCellState = TableHeaderCellState;\n"],"names":[],"mappings":"AAaA;;CAEC,GACD,WAA2D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DataGridSelectionCell.types.ts"],"sourcesContent":["import {\n TableSelectionCellProps,\n TableSelectionCellSlots,\n TableSelectionCellState,\n} from '../TableSelectionCell/TableSelectionCell.types';\n\nexport type DataGridSelectionCellSlots = TableSelectionCellSlots;\n\n/**\n * DataGridSelectionCell Props\n */\nexport type DataGridSelectionCellProps = TableSelectionCellProps;\n\n/**\n * State used in rendering DataGridSelectionCell\n */\nexport type DataGridSelectionCellState = TableSelectionCellState;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["DataGridSelectionCell.types.ts"],"sourcesContent":["import {\n TableSelectionCellProps,\n TableSelectionCellSlots,\n TableSelectionCellState,\n} from '../TableSelectionCell/TableSelectionCell.types';\n\nexport type DataGridSelectionCellSlots = TableSelectionCellSlots;\n\n/**\n * DataGridSelectionCell Props\n */\nexport type DataGridSelectionCellProps = TableSelectionCellProps;\n\n/**\n * State used in rendering DataGridSelectionCell\n */\nexport type DataGridSelectionCellState = TableSelectionCellState;\n"],"names":[],"mappings":"AAaA;;CAEC,GACD,WAAiE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Table.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableSlots = {\n root: Slot<'table', 'div'>;\n};\n\nexport type TableContextValue = {\n /**\n * Affects the sizes of all table subcomponents\n * @default medium\n */\n size: 'extra-small' | 'small' | 'medium';\n\n /**\n * Render all table elements as divs instead of semantic table elements\n * Using divs no longer uses `display: table` layout but `display: flex`\n * @default false\n */\n noNativeElements: boolean;\n\n /**\n * Whether the table is sortable\n * @default false\n */\n sortable: boolean;\n};\n\nexport type SortDirection = 'ascending' | 'descending';\n\nexport type TableContextValues = {\n table: TableContextValue;\n};\n\n/**\n * Table Props\n */\nexport type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;\n\n/**\n * State used in rendering Table\n */\nexport type TableState = ComponentState<TableSlots> &\n Pick<Required<TableProps>, 'size' | 'noNativeElements'> &\n TableContextValue;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["Table.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableSlots = {\n root: Slot<'table', 'div'>;\n};\n\nexport type TableContextValue = {\n /**\n * Affects the sizes of all table subcomponents\n * @default medium\n */\n size: 'extra-small' | 'small' | 'medium';\n\n /**\n * Render all table elements as divs instead of semantic table elements\n * Using divs no longer uses `display: table` layout but `display: flex`\n * @default false\n */\n noNativeElements: boolean;\n\n /**\n * Whether the table is sortable\n * @default false\n */\n sortable: boolean;\n};\n\nexport type SortDirection = 'ascending' | 'descending';\n\nexport type TableContextValues = {\n table: TableContextValue;\n};\n\n/**\n * Table Props\n */\nexport type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;\n\n/**\n * State used in rendering Table\n */\nexport type TableState = ComponentState<TableSlots> &\n Pick<Required<TableProps>, 'size' | 'noNativeElements'> &\n TableContextValue;\n"],"names":[],"mappings":"AAsCA;;CAEC,GACD,WAEoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableBodySlots = {\n root: Slot<'tbody', 'div'>;\n};\n\n/**\n * TableBody Props\n */\nexport type TableBodyProps = ComponentProps<TableBodySlots>;\n\n/**\n * State used in rendering TableBody\n */\nexport type TableBodyState = ComponentState<TableBodySlots> & Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableBodySlots = {\n root: Slot<'tbody', 'div'>;\n};\n\n/**\n * TableBody Props\n */\nexport type TableBodyProps = ComponentProps<TableBodySlots>;\n\n/**\n * State used in rendering TableBody\n */\nexport type TableBodyState = ComponentState<TableBodySlots> & Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"AAYA;;CAEC,GACD,WAA0G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableCellSlots = {\n root: Slot<'td', 'div'>;\n};\n\n/**\n * TableCell Props\n */\nexport type TableCellProps = ComponentProps<TableCellSlots> & {};\n\n/**\n * State used in rendering TableCell\n */\nexport type TableCellState = ComponentState<TableCellSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableCellSlots = {\n root: Slot<'td', 'div'>;\n};\n\n/**\n * TableCell Props\n */\nexport type TableCellProps = ComponentProps<TableCellSlots> & {};\n\n/**\n * State used in rendering TableCell\n */\nexport type TableCellState = ComponentState<TableCellSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'>;\n"],"names":[],"mappings":"AAYA;;CAEC,GACD,WAAmH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableCellActions.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableCellActionsSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * TableCellActions Props\n */\nexport type TableCellActionsProps = ComponentProps<TableCellActionsSlots> & {\n /**\n * When true, the actions are always visible regardless of row hover.\n * Can be useful keeping the actions visible when a popout surface is opened.\n */\n visible?: boolean;\n};\n\n/**\n * State used in rendering TableCellActions\n */\nexport type TableCellActionsState = ComponentState<TableCellActionsSlots> &\n Pick<Required<TableCellActionsProps>, 'visible'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableCellActions.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableCellActionsSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * TableCellActions Props\n */\nexport type TableCellActionsProps = ComponentProps<TableCellActionsSlots> & {\n /**\n * When true, the actions are always visible regardless of row hover.\n * Can be useful keeping the actions visible when a popout surface is opened.\n */\n visible?: boolean;\n};\n\n/**\n * State used in rendering TableCellActions\n */\nexport type TableCellActionsState = ComponentState<TableCellActionsSlots> &\n Pick<Required<TableCellActionsProps>, 'visible'>;\n"],"names":[],"mappings":"AAiBA;;CAEC,GACD,WACmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableCellLayout.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { AvatarSize } from '@fluentui/react-avatar';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableCellLayoutContextValues = {\n avatar: {\n size?: AvatarSize;\n };\n};\n\nexport type TableCellLayoutSlots = {\n root: Slot<'div'>;\n\n /**\n * Slot for an icon or other visual element\n */\n media: Slot<'span'>;\n\n /**\n * Main text for the table cell. Children of the root slot are automatically rendered here\n */\n main: Slot<'span'>;\n\n /**\n * Secondary text that describes or complements the main text\n */\n description: Slot<'span'>;\n\n /**\n * A layout wrapper for the main and description slots\n */\n content: Slot<'div'>;\n};\n\n/**\n * TableCellLayout Props\n */\nexport type TableCellLayoutProps = Omit<ComponentProps<Partial<TableCellLayoutSlots>>, 'content'> &\n Pick<Partial<TableCellLayoutSlots>, 'content'> & {\n /**\n * Renders design variants of the table cell\n * @default undefined\n */\n appearance?: 'primary';\n\n /**\n * Renders content with overflow: hidden and text-overflow: ellipsis\n */\n truncate?: boolean;\n };\n\n/**\n * State used in rendering TableCellLayout\n */\nexport type TableCellLayoutState = ComponentState<TableCellLayoutSlots> &\n Pick<TableCellLayoutProps, 'appearance' | 'truncate'> & { avatarSize: AvatarSize | undefined } & Pick<\n TableContextValue,\n 'size'\n >;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableCellLayout.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { AvatarSize } from '@fluentui/react-avatar';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableCellLayoutContextValues = {\n avatar: {\n size?: AvatarSize;\n };\n};\n\nexport type TableCellLayoutSlots = {\n root: Slot<'div'>;\n\n /**\n * Slot for an icon or other visual element\n */\n media: Slot<'span'>;\n\n /**\n * Main text for the table cell. Children of the root slot are automatically rendered here\n */\n main: Slot<'span'>;\n\n /**\n * Secondary text that describes or complements the main text\n */\n description: Slot<'span'>;\n\n /**\n * A layout wrapper for the main and description slots\n */\n content: Slot<'div'>;\n};\n\n/**\n * TableCellLayout Props\n */\nexport type TableCellLayoutProps = Omit<ComponentProps<Partial<TableCellLayoutSlots>>, 'content'> &\n Pick<Partial<TableCellLayoutSlots>, 'content'> & {\n /**\n * Renders design variants of the table cell\n * @default undefined\n */\n appearance?: 'primary';\n\n /**\n * Renders content with overflow: hidden and text-overflow: ellipsis\n */\n truncate?: boolean;\n };\n\n/**\n * State used in rendering TableCellLayout\n */\nexport type TableCellLayoutState = ComponentState<TableCellLayoutSlots> &\n Pick<TableCellLayoutProps, 'appearance' | 'truncate'> & { avatarSize: AvatarSize | undefined } & Pick<\n TableContextValue,\n 'size'\n >;\n"],"names":[],"mappings":"AAmDA;;CAEC,GACD,WAII"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderSlots = {\n root: Slot<'thead', 'div'>;\n};\n\n/**\n * TableHeader Props\n */\nexport type TableHeaderProps = ComponentProps<TableHeaderSlots> & {};\n\n/**\n * State used in rendering TableHeader\n */\nexport type TableHeaderState = ComponentState<TableHeaderSlots> & Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderSlots = {\n root: Slot<'thead', 'div'>;\n};\n\n/**\n * TableHeader Props\n */\nexport type TableHeaderProps = ComponentProps<TableHeaderSlots> & {};\n\n/**\n * State used in rendering TableHeader\n */\nexport type TableHeaderState = ComponentState<TableHeaderSlots> & Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"AAYA;;CAEC,GACD,WAA8G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableHeaderCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { SortDirection, TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderCellSlots = {\n root: Slot<'th', 'div'>;\n\n sortIcon: Slot<'span'>;\n\n /**\n * Button handles correct narration and interactions for sorting;\n */\n button: NonNullable<Slot<ARIAButtonSlotProps>>;\n /**\n * aside content for anything that should be after main content of the table header cell\n */\n aside: Slot<'span'>;\n};\n\n/**\n * TableHeaderCell Props\n */\nexport type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {\n /**\n * Whether the column is sortable\n * @default false\n */\n sortable?: boolean;\n /**\n * @default undefined\n */\n sortDirection?: SortDirection;\n};\n\n/**\n * State used in rendering TableHeaderCell\n */\nexport type TableHeaderCellState = ComponentState<TableHeaderCellSlots> &\n Pick<TableContextValue, 'noNativeElements'> &\n Pick<TableHeaderCellProps, 'sortable'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableHeaderCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { SortDirection, TableContextValue } from '../Table/Table.types';\n\nexport type TableHeaderCellSlots = {\n root: Slot<'th', 'div'>;\n\n sortIcon: Slot<'span'>;\n\n /**\n * Button handles correct narration and interactions for sorting;\n */\n button: NonNullable<Slot<ARIAButtonSlotProps>>;\n /**\n * aside content for anything that should be after main content of the table header cell\n */\n aside: Slot<'span'>;\n};\n\n/**\n * TableHeaderCell Props\n */\nexport type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {\n /**\n * Whether the column is sortable\n * @default false\n */\n sortable?: boolean;\n /**\n * @default undefined\n */\n sortDirection?: SortDirection;\n};\n\n/**\n * State used in rendering TableHeaderCell\n */\nexport type TableHeaderCellState = ComponentState<TableHeaderCellSlots> &\n Pick<TableContextValue, 'noNativeElements'> &\n Pick<TableHeaderCellProps, 'sortable'>;\n"],"names":[],"mappings":"AAkCA;;CAEC,GACD,WAEyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableResizeHandle.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableResizeHandleSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * TableResizeHandle Props\n */\nexport type TableResizeHandleProps = ComponentProps<TableResizeHandleSlots> & {};\n\n/**\n * State used in rendering TableResizeHandle\n */\nexport type TableResizeHandleState = ComponentState<TableResizeHandleSlots>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableResizeHandle.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableResizeHandleSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * TableResizeHandle Props\n */\nexport type TableResizeHandleProps = ComponentProps<TableResizeHandleSlots> & {};\n\n/**\n * State used in rendering TableResizeHandle\n */\nexport type TableResizeHandleState = ComponentState<TableResizeHandleSlots>;\n"],"names":[],"mappings":"AAWA;;CAEC,GACD,WAA4E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableRow.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableRowSlots = {\n root: Slot<'tr', 'div'>;\n};\n\n/**\n * TableRow Props\n */\nexport type TableRowProps = ComponentProps<TableRowSlots> & {\n /**\n * A table row can have different variants. These appearances are\n * intended to be used with selection.\n * @default none\n */\n appearance?: 'brand' | 'neutral' | 'none';\n};\n\n/**\n * State used in rendering TableRow\n */\nexport type TableRowState = ComponentState<TableRowSlots> &\n Pick<TableContextValue, 'noNativeElements' | 'size'> &\n Pick<Required<TableRowProps>, 'appearance'> & {\n isHeaderRow: boolean;\n };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableRow.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableRowSlots = {\n root: Slot<'tr', 'div'>;\n};\n\n/**\n * TableRow Props\n */\nexport type TableRowProps = ComponentProps<TableRowSlots> & {\n /**\n * A table row can have different variants. These appearances are\n * intended to be used with selection.\n * @default none\n */\n appearance?: 'brand' | 'neutral' | 'none';\n};\n\n/**\n * State used in rendering TableRow\n */\nexport type TableRowState = ComponentState<TableRowSlots> &\n Pick<TableContextValue, 'noNativeElements' | 'size'> &\n Pick<Required<TableRowProps>, 'appearance'> & {\n isHeaderRow: boolean;\n };\n"],"names":[],"mappings":"AAmBA;;CAEC,GACD,WAII"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TableSelectionCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { Checkbox, CheckboxProps } from '@fluentui/react-checkbox';\nimport type { Radio } from '@fluentui/react-radio';\nimport { TableCellSlots } from '../TableCell/TableCell.types';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableSelectionCellSlots = {\n /**\n * Selection indicator if selection type is checkbox\n */\n checkboxIndicator: Slot<typeof Checkbox>;\n /**\n * Selection indicator if selection type is radio\n */\n radioIndicator: Slot<typeof Radio>;\n} & Pick<TableCellSlots, 'root'>;\n\n/**\n * TableSelectionCell Props\n */\nexport type TableSelectionCellProps = ComponentProps<Partial<TableSelectionCellSlots>> & {\n /**\n * A table can have two kinds of selection modes.\n * @default checkbox\n */\n type?: 'checkbox' | 'radio';\n\n /**\n * @default false\n */\n checked?: CheckboxProps['checked'];\n\n /**\n * Only visible when checked or the parent row is hovered/focused\n * @default false\n */\n subtle?: boolean;\n\n /**\n * Completely hides the selection cell visually but takes up the same space\n * @default false\n */\n hidden?: boolean;\n};\n\n/**\n * State used in rendering TableSelectionCell\n */\nexport type TableSelectionCellState = ComponentState<TableSelectionCellSlots> &\n Pick<Required<TableSelectionCellProps>, 'type' | 'checked' | 'subtle' | 'hidden'> &\n Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["TableSelectionCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { Checkbox, CheckboxProps } from '@fluentui/react-checkbox';\nimport type { Radio } from '@fluentui/react-radio';\nimport { TableCellSlots } from '../TableCell/TableCell.types';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableSelectionCellSlots = {\n /**\n * Selection indicator if selection type is checkbox\n */\n checkboxIndicator: Slot<typeof Checkbox>;\n /**\n * Selection indicator if selection type is radio\n */\n radioIndicator: Slot<typeof Radio>;\n} & Pick<TableCellSlots, 'root'>;\n\n/**\n * TableSelectionCell Props\n */\nexport type TableSelectionCellProps = ComponentProps<Partial<TableSelectionCellSlots>> & {\n /**\n * A table can have two kinds of selection modes.\n * @default checkbox\n */\n type?: 'checkbox' | 'radio';\n\n /**\n * @default false\n */\n checked?: CheckboxProps['checked'];\n\n /**\n * Only visible when checked or the parent row is hovered/focused\n * @default false\n */\n subtle?: boolean;\n\n /**\n * Completely hides the selection cell visually but takes up the same space\n * @default false\n */\n hidden?: boolean;\n};\n\n/**\n * State used in rendering TableSelectionCell\n */\nexport type TableSelectionCellState = ComponentState<TableSelectionCellSlots> &\n Pick<Required<TableSelectionCellProps>, 'type' | 'checked' | 'subtle' | 'hidden'> &\n Pick<TableContextValue, 'noNativeElements'>;\n"],"names":[],"mappings":"AA6CA;;CAEC,GACD,WAE8C"}
|
|
@@ -48,6 +48,9 @@ export function useTableSelectionState(tableState, options) {
|
|
|
48
48
|
if (selected.size < selectableRowIds.size) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
|
+
if (selectableRowIds.size === 0) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
51
54
|
let res = true;
|
|
52
55
|
selectableRowIds.forEach((selectableRowId)=>{
|
|
53
56
|
if (!selected.has(selectableRowId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTableSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, useEventCallback, useSelection } from '@fluentui/react-utilities';\nimport type { TableRowId, TableSelectionState, TableFeaturesState } from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSelectionState: TableSelectionState = {\n allRowsSelected: false,\n clearRows: noop,\n deselectRow: noop,\n isRowSelected: () => false,\n selectRow: noop,\n selectedRows: new Set(),\n someRowsSelected: false,\n toggleAllRows: noop,\n toggleRow: noop,\n selectionMode: 'multiselect',\n};\n\nexport function useTableSelection<TItem>(options: SelectionHookParams) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableSelectionState(tableState, options);\n}\n\nexport function useTableSelectionState<TItem>(\n tableState: TableFeaturesState<TItem>,\n options: SelectionHookParams,\n): TableFeaturesState<TItem> {\n const { items, getRowId } = tableState;\n const { selectionMode: selectionMode, defaultSelectedItems, selectedItems, onSelectionChange } = options;\n\n const [selected, selectionMethods] = useSelection({\n selectionMode,\n defaultSelectedItems,\n selectedItems,\n onSelectionChange,\n });\n\n // Selection state can contain obselete items (i.e. rows that are removed)\n const selectableRowIds = React.useMemo(() => {\n const rowIds = new Set<TableRowId>();\n for (let i = 0; i < items.length; i++) {\n rowIds.add(getRowId?.(items[i]) ?? i);\n }\n\n return rowIds;\n }, [items, getRowId]);\n\n const allRowsSelected = React.useMemo(() => {\n if (selectionMode === 'single') {\n const selectedRow = Array.from(selected)[0];\n return selectableRowIds.has(selectedRow);\n }\n\n // multiselect case\n if (selected.size < selectableRowIds.size) {\n return false;\n }\n\n let res = true;\n selectableRowIds.forEach(selectableRowId => {\n if (!selected.has(selectableRowId)) {\n res = false;\n }\n });\n\n return res;\n }, [selectableRowIds, selected, selectionMode]);\n\n const someRowsSelected = React.useMemo(() => {\n if (selected.size <= 0) {\n return false;\n }\n\n let res = false;\n selectableRowIds.forEach(selectableRowId => {\n if (selected.has(selectableRowId)) {\n res = true;\n }\n });\n\n return res;\n }, [selectableRowIds, selected]);\n\n const toggleAllRows: TableSelectionState['toggleAllRows'] = useEventCallback(e => {\n selectionMethods.toggleAllItems(\n e,\n items.map((item, i) => getRowId?.(item) ?? i),\n );\n });\n\n const toggleRow: TableSelectionState['toggleRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.toggleItem(e, rowId),\n );\n\n const deselectRow: TableSelectionState['deselectRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.deselectItem(e, rowId),\n );\n\n const selectRow: TableSelectionState['selectRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.selectItem(e, rowId),\n );\n\n const isRowSelected: TableSelectionState['isRowSelected'] = (rowId: TableRowId) => selectionMethods.isSelected(rowId);\n\n const clearRows: TableSelectionState['clearRows'] = useEventCallback(e => selectionMethods.clearItems(e));\n\n return {\n ...tableState,\n selection: {\n selectionMode,\n someRowsSelected,\n allRowsSelected,\n selectedRows: selected,\n toggleRow,\n toggleAllRows,\n clearRows,\n deselectRow,\n selectRow,\n isRowSelected,\n },\n };\n}\n"],"names":["React","useEventCallback","useSelection","noop","undefined","defaultTableSelectionState","allRowsSelected","clearRows","deselectRow","isRowSelected","selectRow","selectedRows","Set","someRowsSelected","toggleAllRows","toggleRow","selectionMode","useTableSelection","options","tableState","useTableSelectionState","items","getRowId","defaultSelectedItems","selectedItems","onSelectionChange","selected","selectionMethods","selectableRowIds","useMemo","rowIds","i","length","add","selectedRow","Array","from","has","size","res","forEach","selectableRowId","e","toggleAllItems","map","item","rowId","toggleItem","deselectItem","selectItem","isSelected","clearItems","selection"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA8BC,gBAAgB,EAAEC,YAAY,QAAQ,4BAA4B;AAGhG,MAAMC,OAAO,IAAMC;AAEnB,OAAO,MAAMC,6BAAkD;IAC7DC,iBAAiB;IACjBC,WAAWJ;IACXK,aAAaL;IACbM,eAAe,IAAM;IACrBC,WAAWP;IACXQ,cAAc,IAAIC;IAClBC,kBAAkB;IAClBC,eAAeX;IACfY,WAAWZ;IACXa,eAAe;AACjB,EAAE;AAEF,OAAO,SAASC,kBAAyBC,OAA4B;IACnE,4EAA4E;IAC5E,sDAAsD;IACtD,OAAO,CAACC,aAA0CC,uBAAuBD,YAAYD;AACvF;AAEA,OAAO,SAASE,uBACdD,UAAqC,EACrCD,OAA4B;IAE5B,MAAM,EAAEG,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAC5B,MAAM,EAAEH,eAAeA,aAAa,EAAEO,oBAAoB,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGP;IAEjG,MAAM,CAACQ,UAAUC,iBAAiB,GAAGzB,aAAa;QAChDc;QACAO;QACAC;QACAC;IACF;IAEA,0EAA0E;IAC1E,MAAMG,mBAAmB5B,MAAM6B,OAAO,CAAC;QACrC,MAAMC,SAAS,IAAIlB;QACnB,IAAK,IAAImB,IAAI,GAAGA,IAAIV,MAAMW,MAAM,EAAED,IAAK;gBAC1BT;YAAXQ,OAAOG,GAAG,CAACX,CAAAA,YAAAA,qBAAAA,+BAAAA,SAAWD,KAAK,CAACU,EAAE,eAAnBT,uBAAAA,YAAwBS;QACrC;QAEA,OAAOD;IACT,GAAG;QAACT;QAAOC;KAAS;IAEpB,MAAMhB,kBAAkBN,MAAM6B,OAAO,CAAC;QACpC,IAAIb,kBAAkB,UAAU;YAC9B,MAAMkB,cAAcC,MAAMC,IAAI,CAACV,SAAS,CAAC,EAAE;YAC3C,OAAOE,iBAAiBS,GAAG,CAACH;QAC9B;QAEA,mBAAmB;QACnB,IAAIR,SAASY,IAAI,GAAGV,iBAAiBU,IAAI,EAAE;YACzC,OAAO;QACT;QAEA,IAAIC,MAAM;QACVX,iBAAiBY,OAAO,CAACC,CAAAA;YACvB,IAAI,CAACf,SAASW,GAAG,CAACI,kBAAkB;gBAClCF,MAAM;YACR;QACF;QAEA,OAAOA;IACT,GAAG;QAACX;QAAkBF;QAAUV;KAAc;IAE9C,MAAMH,mBAAmBb,MAAM6B,OAAO,CAAC;QACrC,IAAIH,SAASY,IAAI,IAAI,GAAG;YACtB,OAAO;QACT;QAEA,IAAIC,MAAM;QACVX,iBAAiBY,OAAO,CAACC,CAAAA;YACvB,IAAIf,SAASW,GAAG,CAACI,kBAAkB;gBACjCF,MAAM;YACR;QACF;QAEA,OAAOA;IACT,GAAG;QAACX;QAAkBF;KAAS;IAE/B,MAAMZ,gBAAsDb,iBAAiByC,CAAAA;QAC3Ef,iBAAiBgB,cAAc,CAC7BD,GACArB,MAAMuB,GAAG,CAAC,CAACC,MAAMd;gBAAMT;mBAAAA,CAAAA,YAAAA,qBAAAA,+BAAAA,SAAWuB,mBAAXvB,uBAAAA,YAAoBS;QAAAA;IAE/C;IAEA,MAAMhB,YAA8Cd,iBAAiB,CAACyC,GAAGI,QACvEnB,iBAAiBoB,UAAU,CAACL,GAAGI;IAGjC,MAAMtC,cAAkDP,iBAAiB,CAACyC,GAAGI,QAC3EnB,iBAAiBqB,YAAY,CAACN,GAAGI;IAGnC,MAAMpC,YAA8CT,iBAAiB,CAACyC,GAAGI,QACvEnB,iBAAiBsB,UAAU,CAACP,GAAGI;IAGjC,MAAMrC,gBAAsD,CAACqC,QAAsBnB,iBAAiBuB,UAAU,CAACJ;IAE/G,MAAMvC,YAA8CN,iBAAiByC,CAAAA,IAAKf,iBAAiBwB,UAAU,CAACT;IAEtG,OAAO;QACL,GAAGvB,UAAU;QACbiC,WAAW;YACTpC;YACAH;YACAP;YACAK,cAAce;YACdX;YACAD;YACAP;YACAC;YACAE;YACAD;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["useTableSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, useEventCallback, useSelection } from '@fluentui/react-utilities';\nimport type { TableRowId, TableSelectionState, TableFeaturesState } from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSelectionState: TableSelectionState = {\n allRowsSelected: false,\n clearRows: noop,\n deselectRow: noop,\n isRowSelected: () => false,\n selectRow: noop,\n selectedRows: new Set(),\n someRowsSelected: false,\n toggleAllRows: noop,\n toggleRow: noop,\n selectionMode: 'multiselect',\n};\n\nexport function useTableSelection<TItem>(options: SelectionHookParams) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableFeaturesState<TItem>) => useTableSelectionState(tableState, options);\n}\n\nexport function useTableSelectionState<TItem>(\n tableState: TableFeaturesState<TItem>,\n options: SelectionHookParams,\n): TableFeaturesState<TItem> {\n const { items, getRowId } = tableState;\n const { selectionMode: selectionMode, defaultSelectedItems, selectedItems, onSelectionChange } = options;\n\n const [selected, selectionMethods] = useSelection({\n selectionMode,\n defaultSelectedItems,\n selectedItems,\n onSelectionChange,\n });\n\n // Selection state can contain obselete items (i.e. rows that are removed)\n const selectableRowIds = React.useMemo(() => {\n const rowIds = new Set<TableRowId>();\n for (let i = 0; i < items.length; i++) {\n rowIds.add(getRowId?.(items[i]) ?? i);\n }\n\n return rowIds;\n }, [items, getRowId]);\n\n const allRowsSelected = React.useMemo(() => {\n if (selectionMode === 'single') {\n const selectedRow = Array.from(selected)[0];\n return selectableRowIds.has(selectedRow);\n }\n\n // multiselect case\n if (selected.size < selectableRowIds.size) {\n return false;\n }\n\n if (selectableRowIds.size === 0) {\n return false;\n }\n\n let res = true;\n selectableRowIds.forEach(selectableRowId => {\n if (!selected.has(selectableRowId)) {\n res = false;\n }\n });\n\n return res;\n }, [selectableRowIds, selected, selectionMode]);\n\n const someRowsSelected = React.useMemo(() => {\n if (selected.size <= 0) {\n return false;\n }\n\n let res = false;\n selectableRowIds.forEach(selectableRowId => {\n if (selected.has(selectableRowId)) {\n res = true;\n }\n });\n\n return res;\n }, [selectableRowIds, selected]);\n\n const toggleAllRows: TableSelectionState['toggleAllRows'] = useEventCallback(e => {\n selectionMethods.toggleAllItems(\n e,\n items.map((item, i) => getRowId?.(item) ?? i),\n );\n });\n\n const toggleRow: TableSelectionState['toggleRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.toggleItem(e, rowId),\n );\n\n const deselectRow: TableSelectionState['deselectRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.deselectItem(e, rowId),\n );\n\n const selectRow: TableSelectionState['selectRow'] = useEventCallback((e, rowId: TableRowId) =>\n selectionMethods.selectItem(e, rowId),\n );\n\n const isRowSelected: TableSelectionState['isRowSelected'] = (rowId: TableRowId) => selectionMethods.isSelected(rowId);\n\n const clearRows: TableSelectionState['clearRows'] = useEventCallback(e => selectionMethods.clearItems(e));\n\n return {\n ...tableState,\n selection: {\n selectionMode,\n someRowsSelected,\n allRowsSelected,\n selectedRows: selected,\n toggleRow,\n toggleAllRows,\n clearRows,\n deselectRow,\n selectRow,\n isRowSelected,\n },\n };\n}\n"],"names":["React","useEventCallback","useSelection","noop","undefined","defaultTableSelectionState","allRowsSelected","clearRows","deselectRow","isRowSelected","selectRow","selectedRows","Set","someRowsSelected","toggleAllRows","toggleRow","selectionMode","useTableSelection","options","tableState","useTableSelectionState","items","getRowId","defaultSelectedItems","selectedItems","onSelectionChange","selected","selectionMethods","selectableRowIds","useMemo","rowIds","i","length","add","selectedRow","Array","from","has","size","res","forEach","selectableRowId","e","toggleAllItems","map","item","rowId","toggleItem","deselectItem","selectItem","isSelected","clearItems","selection"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["DataGridCell.types.js"],"sourcesContent":["/**\n * State used in rendering DataGridCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["DataGridHeader.types.js"],"sourcesContent":["/**\n * State used in rendering DataGridHeader\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["DataGridHeaderCell.types.js"],"sourcesContent":["/**\n * State used in rendering DataGridHeaderCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["DataGridSelectionCell.types.js"],"sourcesContent":["/**\n * State used in rendering DataGridSelectionCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["Table.types.js"],"sourcesContent":["/**\n * State used in rendering Table\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableBody.types.js"],"sourcesContent":["/**\n * State used in rendering TableBody\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableCell.types.js"],"sourcesContent":["/**\n * State used in rendering TableCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableCellActions.types.js"],"sourcesContent":["/**\n * State used in rendering TableCellActions\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableCellLayout.types.js"],"sourcesContent":["/**\n * State used in rendering TableCellLayout\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableHeader.types.js"],"sourcesContent":["/**\n * State used in rendering TableHeader\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableHeaderCell.types.js"],"sourcesContent":["/**\n * State used in rendering TableHeaderCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableResizeHandle.types.js"],"sourcesContent":["/**\n * State used in rendering TableResizeHandle\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableRow.types.js"],"sourcesContent":["/**\n * State used in rendering TableRow\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["TableSelectionCell.types.js"],"sourcesContent":["/**\n * State used in rendering TableSelectionCell\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
ColumnIdContextProvider: function() {
|
|
13
|
+
return ColumnIdContextProvider;
|
|
14
|
+
},
|
|
12
15
|
columnIdContextDefaultValue: function() {
|
|
13
16
|
return columnIdContextDefaultValue;
|
|
14
17
|
},
|
|
15
18
|
useColumnIdContext: function() {
|
|
16
19
|
return useColumnIdContext;
|
|
17
|
-
},
|
|
18
|
-
ColumnIdContextProvider: function() {
|
|
19
|
-
return ColumnIdContextProvider;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["columnIdContext.js"],"sourcesContent":["import * as React from 'react';\nconst columnIdContext = React.createContext(undefined);\nexport const columnIdContextDefaultValue = '';\nexport const useColumnIdContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(columnIdContext)) !== null && _React_useContext !== void 0 ? _React_useContext : columnIdContextDefaultValue;\n};\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["columnIdContext.js"],"sourcesContent":["import * as React from 'react';\nconst columnIdContext = React.createContext(undefined);\nexport const columnIdContextDefaultValue = '';\nexport const useColumnIdContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(columnIdContext)) !== null && _React_useContext !== void 0 ? _React_useContext : columnIdContextDefaultValue;\n};\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"],"names":["ColumnIdContextProvider","columnIdContextDefaultValue","useColumnIdContext","columnIdContext","React","createContext","undefined","_React_useContext","useContext","Provider"],"mappings":";;;;;;;;;;;IAOaA,uBAAuB;eAAvBA;;IALAC,2BAA2B;eAA3BA;;IACAC,kBAAkB;eAAlBA;;;;iEAHU;AACvB,MAAMC,gCAAkBC,OAAMC,aAAa,CAACC;AACrC,MAAML,8BAA8B;AACpC,MAAMC,qBAAqB;IAC9B,IAAIK;IACJ,OAAO,AAACA,CAAAA,oBAAoBH,OAAMI,UAAU,CAACL,gBAAe,MAAO,QAAQI,sBAAsB,KAAK,IAAIA,oBAAoBN;AAClI;AACO,MAAMD,0BAA0BG,gBAAgBM,QAAQ"}
|
|
@@ -9,12 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
dataGridContextDefaultValue: function() {
|
|
13
|
-
return dataGridContextDefaultValue;
|
|
14
|
-
},
|
|
15
12
|
DataGridContextProvider: function() {
|
|
16
13
|
return DataGridContextProvider;
|
|
17
14
|
},
|
|
15
|
+
dataGridContextDefaultValue: function() {
|
|
16
|
+
return dataGridContextDefaultValue;
|
|
17
|
+
},
|
|
18
18
|
useDataGridContext_unstable: function() {
|
|
19
19
|
return useDataGridContext_unstable;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["dataGridContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport { defaultTableState } from '../hooks';\nconst dataGridContext = createContext(undefined);\nexport const dataGridContextDefaultValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n compositeRowTabsterAttribute: {}\n};\nexport const DataGridContextProvider = dataGridContext.Provider;\nexport const useDataGridContext_unstable = (selector)=>useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue)=>selector(ctx));\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["dataGridContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport { defaultTableState } from '../hooks';\nconst dataGridContext = createContext(undefined);\nexport const dataGridContextDefaultValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n compositeRowTabsterAttribute: {}\n};\nexport const DataGridContextProvider = dataGridContext.Provider;\nexport const useDataGridContext_unstable = (selector)=>useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue)=>selector(ctx));\n"],"names":["DataGridContextProvider","dataGridContextDefaultValue","useDataGridContext_unstable","dataGridContext","createContext","undefined","defaultTableState","subtleSelection","selectableRows","selectionAppearance","focusMode","compositeRowTabsterAttribute","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAWaA,uBAAuB;eAAvBA;;IARAC,2BAA2B;eAA3BA;;IASAC,2BAA2B;eAA3BA;;;sCAZqC;uBAChB;AAClC,MAAMC,kBAAkBC,IAAAA,mCAAa,EAACC;AAC/B,MAAMJ,8BAA8B;IACvC,GAAGK,wBAAiB;IACpBC,iBAAiB;IACjBC,gBAAgB;IAChBC,qBAAqB;IACrBC,WAAW;IACXC,8BAA8B,CAAC;AACnC;AACO,MAAMX,0BAA0BG,gBAAgBS,QAAQ;AACxD,MAAMV,8BAA8B,CAACW,WAAWC,IAAAA,wCAAkB,EAACX,iBAAiB,CAACY,MAAMd,2BAA2B,GAAGY,SAASE"}
|
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
TableRowIdContextProvider: function() {
|
|
13
|
+
return TableRowIdContextProvider;
|
|
14
|
+
},
|
|
12
15
|
tableRowIdContextDefaultValue: function() {
|
|
13
16
|
return tableRowIdContextDefaultValue;
|
|
14
17
|
},
|
|
15
18
|
useTableRowIdContext: function() {
|
|
16
19
|
return useTableRowIdContext;
|
|
17
|
-
},
|
|
18
|
-
TableRowIdContextProvider: function() {
|
|
19
|
-
return TableRowIdContextProvider;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["rowIdContext.js"],"sourcesContent":["import * as React from 'react';\nconst rowIdContext = React.createContext(undefined);\nexport const tableRowIdContextDefaultValue = '';\nexport const useTableRowIdContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(rowIdContext)) !== null && _React_useContext !== void 0 ? _React_useContext : tableRowIdContextDefaultValue;\n};\nexport const TableRowIdContextProvider = rowIdContext.Provider;\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["rowIdContext.js"],"sourcesContent":["import * as React from 'react';\nconst rowIdContext = React.createContext(undefined);\nexport const tableRowIdContextDefaultValue = '';\nexport const useTableRowIdContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(rowIdContext)) !== null && _React_useContext !== void 0 ? _React_useContext : tableRowIdContextDefaultValue;\n};\nexport const TableRowIdContextProvider = rowIdContext.Provider;\n"],"names":["TableRowIdContextProvider","tableRowIdContextDefaultValue","useTableRowIdContext","rowIdContext","React","createContext","undefined","_React_useContext","useContext","Provider"],"mappings":";;;;;;;;;;;IAOaA,yBAAyB;eAAzBA;;IALAC,6BAA6B;eAA7BA;;IACAC,oBAAoB;eAApBA;;;;iEAHU;AACvB,MAAMC,6BAAeC,OAAMC,aAAa,CAACC;AAClC,MAAML,gCAAgC;AACtC,MAAMC,uBAAuB;IAChC,IAAIK;IACJ,OAAO,AAACA,CAAAA,oBAAoBH,OAAMI,UAAU,CAACL,aAAY,MAAO,QAAQI,sBAAsB,KAAK,IAAIA,oBAAoBN;AAC/H;AACO,MAAMD,4BAA4BG,aAAaM,QAAQ"}
|