diff --git a/docs/pages/x/api/tree-view/simple-tree-view.json b/docs/pages/x/api/tree-view/simple-tree-view.json index b7a5c4202d3c..4fe57e6b52b8 100644 --- a/docs/pages/x/api/tree-view/simple-tree-view.json +++ b/docs/pages/x/api/tree-view/simple-tree-view.json @@ -10,24 +10,6 @@ "disabledItemsFocusable": { "type": { "name": "bool" }, "default": "false" }, "disableSelection": { "type": { "name": "bool" }, "default": "false" }, "expandedNodes": { "type": { "name": "arrayOf", "description": "Array<string>" } }, - "getItemId": { - "type": { "name": "func" }, - "default": "`(item) => item.id`", - "signature": { - "type": "function(item: R) => string", - "describedArgs": ["item"], - "returned": "string" - } - }, - "getItemLabel": { - "type": { "name": "func" }, - "default": "`(item) => item.label`", - "signature": { - "type": "function(item: R) => string", - "describedArgs": ["item"], - "returned": "string" - } - }, "id": { "type": { "name": "string" } }, "multiSelect": { "type": { "name": "bool" }, "default": "false" }, "onExpandedNodesChange": { diff --git a/docs/pages/x/api/tree-view/tree-view.json b/docs/pages/x/api/tree-view/tree-view.json index 97b4ccb45ee3..be96ddf48b34 100644 --- a/docs/pages/x/api/tree-view/tree-view.json +++ b/docs/pages/x/api/tree-view/tree-view.json @@ -10,24 +10,6 @@ "disabledItemsFocusable": { "type": { "name": "bool" }, "default": "false" }, "disableSelection": { "type": { "name": "bool" }, "default": "false" }, "expandedNodes": { "type": { "name": "arrayOf", "description": "Array<string>" } }, - "getItemId": { - "type": { "name": "func" }, - "default": "`(item) => item.id`", - "signature": { - "type": "function(item: R) => string", - "describedArgs": ["item"], - "returned": "string" - } - }, - "getItemLabel": { - "type": { "name": "func" }, - "default": "`(item) => item.label`", - "signature": { - "type": "function(item: R) => string", - "describedArgs": ["item"], - "returned": "string" - } - }, "id": { "type": { "name": "string" } }, "multiSelect": { "type": { "name": "bool" }, "default": "false" }, "onExpandedNodesChange": { diff --git a/docs/translations/api-docs/tree-view/simple-tree-view/simple-tree-view.json b/docs/translations/api-docs/tree-view/simple-tree-view/simple-tree-view.json index 12cfd103d61e..610e09fc25bd 100644 --- a/docs/translations/api-docs/tree-view/simple-tree-view/simple-tree-view.json +++ b/docs/translations/api-docs/tree-view/simple-tree-view/simple-tree-view.json @@ -16,14 +16,6 @@ "expandedNodes": { "description": "Expanded node ids. Used when the item's expansion is controlled." }, - "getItemId": { - "description": "Used to determine the string label for a given item.", - "typeDescriptions": { "item": "The item to check.", "string": "The id of the item." } - }, - "getItemLabel": { - "description": "Used to determine the string label for a given item.", - "typeDescriptions": { "item": "The item to check.", "string": "The label of the item." } - }, "id": { "description": "This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id." }, diff --git a/docs/translations/api-docs/tree-view/tree-view/tree-view.json b/docs/translations/api-docs/tree-view/tree-view/tree-view.json index 3cc1dead98c9..8150a922d37c 100644 --- a/docs/translations/api-docs/tree-view/tree-view/tree-view.json +++ b/docs/translations/api-docs/tree-view/tree-view/tree-view.json @@ -16,14 +16,6 @@ "expandedNodes": { "description": "Expanded node ids. Used when the item's expansion is controlled." }, - "getItemId": { - "description": "Used to determine the string label for a given item.", - "typeDescriptions": { "item": "The item to check.", "string": "The id of the item." } - }, - "getItemLabel": { - "description": "Used to determine the string label for a given item.", - "typeDescriptions": { "item": "The item to check.", "string": "The label of the item." } - }, "id": { "description": "This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id." }, diff --git a/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.plugins.ts b/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.plugins.ts index 0f631080295e..b239a326ff95 100644 --- a/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.plugins.ts +++ b/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.plugins.ts @@ -20,4 +20,7 @@ export type SimpleTreeViewPluginSlotProps = DefaultTreeViewPluginSlotProps; // We can't infer this type from the plugin, otherwise we would lose the generics. export interface SimpleTreeViewPluginParameters - extends Omit, 'items' | 'isItemDisabled'> {} + extends Omit< + DefaultTreeViewPluginParameters, + 'items' | 'isItemDisabled' | 'getItemLabel' | 'getItemId' + > {} diff --git a/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx b/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx index c31cb641df0e..7ccff7c09ec6 100644 --- a/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx +++ b/packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx @@ -145,24 +145,6 @@ SimpleTreeView.propTypes = { * Used when the item's expansion is controlled. */ expandedNodes: PropTypes.arrayOf(PropTypes.string), - /** - * Used to determine the string label for a given item. - * - * @template R - * @param {R} item The item to check. - * @returns {string} The id of the item. - * @default `(item) => item.id` - */ - getItemId: PropTypes.func, - /** - * Used to determine the string label for a given item. - * - * @template R - * @param {R} item The item to check. - * @returns {string} The label of the item. - * @default `(item) => item.label` - */ - getItemLabel: PropTypes.func, /** * This prop is used to help implement the accessibility logic. * If you don't provide this prop. It falls back to a randomly generated id. diff --git a/packages/x-tree-view/src/TreeView/TreeView.tsx b/packages/x-tree-view/src/TreeView/TreeView.tsx index d50a8db68413..a17d55405f3f 100644 --- a/packages/x-tree-view/src/TreeView/TreeView.tsx +++ b/packages/x-tree-view/src/TreeView/TreeView.tsx @@ -122,24 +122,6 @@ TreeView.propTypes = { * Used when the item's expansion is controlled. */ expandedNodes: PropTypes.arrayOf(PropTypes.string), - /** - * Used to determine the string label for a given item. - * - * @template R - * @param {R} item The item to check. - * @returns {string} The id of the item. - * @default `(item) => item.id` - */ - getItemId: PropTypes.func, - /** - * Used to determine the string label for a given item. - * - * @template R - * @param {R} item The item to check. - * @returns {string} The label of the item. - * @default `(item) => item.label` - */ - getItemLabel: PropTypes.func, /** * This prop is used to help implement the accessibility logic. * If you don't provide this prop. It falls back to a randomly generated id.