-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TreeView] Refactor the tree view internals to prepare for headless A…
…PI (#13311)
- Loading branch information
1 parent
220d83d
commit b38bef8
Showing
29 changed files
with
369 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
packages/x-tree-view/src/RichTreeView/RichTreeView.plugins.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { useTreeViewId, UseTreeViewIdParameters } from '../internals/plugins/useTreeViewId'; | ||
import { | ||
useTreeViewItems, | ||
UseTreeViewItemsParameters, | ||
} from '../internals/plugins/useTreeViewItems'; | ||
import { | ||
useTreeViewExpansion, | ||
UseTreeViewExpansionParameters, | ||
} from '../internals/plugins/useTreeViewExpansion'; | ||
import { | ||
useTreeViewSelection, | ||
UseTreeViewSelectionParameters, | ||
} from '../internals/plugins/useTreeViewSelection'; | ||
import { | ||
useTreeViewFocus, | ||
UseTreeViewFocusParameters, | ||
} from '../internals/plugins/useTreeViewFocus'; | ||
import { useTreeViewKeyboardNavigation } from '../internals/plugins/useTreeViewKeyboardNavigation'; | ||
import { | ||
useTreeViewIcons, | ||
UseTreeViewIconsParameters, | ||
} from '../internals/plugins/useTreeViewIcons'; | ||
import { ConvertPluginsIntoSignatures, MergeSignaturesProperty } from '../internals/models'; | ||
|
||
export const RICH_TREE_VIEW_PLUGINS = [ | ||
useTreeViewId, | ||
useTreeViewItems, | ||
useTreeViewExpansion, | ||
useTreeViewSelection, | ||
useTreeViewFocus, | ||
useTreeViewKeyboardNavigation, | ||
useTreeViewIcons, | ||
] as const; | ||
|
||
export type RichTreeViewPluginSignatures = ConvertPluginsIntoSignatures< | ||
typeof RICH_TREE_VIEW_PLUGINS | ||
>; | ||
|
||
export type RichTreeViewPluginSlots = MergeSignaturesProperty< | ||
RichTreeViewPluginSignatures, | ||
'slots' | ||
>; | ||
|
||
export type RichTreeViewPluginSlotProps = MergeSignaturesProperty< | ||
RichTreeViewPluginSignatures, | ||
'slotProps' | ||
>; | ||
|
||
// We can't infer this type from the plugin, otherwise we would lose the generics. | ||
export interface RichTreeViewPluginParameters<R extends {}, Multiple extends boolean | undefined> | ||
extends UseTreeViewIdParameters, | ||
UseTreeViewItemsParameters<R>, | ||
UseTreeViewExpansionParameters, | ||
UseTreeViewFocusParameters, | ||
UseTreeViewSelectionParameters<Multiple>, | ||
UseTreeViewIconsParameters {} |
Oops, something went wrong.