Skip to content

Commit

Permalink
[TreeView] Remove unused props from prop-types and typing (#11778)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle authored Jan 22, 2024
1 parent a381e66 commit b733c3c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 89 deletions.
18 changes: 0 additions & 18 deletions docs/pages/x/api/tree-view/simple-tree-view.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
18 changes: 0 additions & 18 deletions docs/pages/x/api/tree-view/tree-view.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
8 changes: 0 additions & 8 deletions docs/translations/api-docs/tree-view/tree-view/tree-view.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Multiple extends boolean | undefined>
extends Omit<DefaultTreeViewPluginParameters<any, Multiple>, 'items' | 'isItemDisabled'> {}
extends Omit<
DefaultTreeViewPluginParameters<any, Multiple>,
'items' | 'isItemDisabled' | 'getItemLabel' | 'getItemId'
> {}
18 changes: 0 additions & 18 deletions packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 0 additions & 18 deletions packages/x-tree-view/src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b733c3c

Please sign in to comment.