Skip to content

Add checkboxPartialIcon prop to Tree and TreeTable components #4037 #8045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dimmageiras
Copy link
Contributor

@dimmageiras dimmageiras commented May 27, 2025

This implements feature request #4037

Description

This PR adds the checkboxPartialIcon prop to both Tree and TreeTable components, allowing developers to customize the icon displayed when nodes are in a partial/indeterminate checkbox state.

Changes Made

Tree Component

  • TreeBase.js: Added checkboxPartialIcon to default props
  • Tree.js: Passed checkboxPartialIcon prop to UITreeNode
  • UITreeNode.js: Implemented logic to use custom partial icon or fallback to MinusIcon
  • tree.d.ts: Added TypeScript definition for checkboxPartialIcon prop

TreeTable Component

  • TreeTableBase.js: Added checkboxPartialIcon to default props
  • TreeTable.js: Passed checkboxPartialIcon prop to TreeTableBody
  • TreeTableBody.js: Passed checkboxPartialIcon prop to TreeTableRow
  • TreeTableRow.js: Implemented logic to use custom partial icon or fallback to MinusIcon
  • treetable.d.ts: Added TypeScript definition for checkboxPartialIcon prop

Technical Details

  • The prop follows the same pattern as the existing checkboxIcon prop
  • Uses IconType<TreeProps> and IconType<TreeTableProps> respectively for type safety
  • Maintains backward compatibility by defaulting to MinusIcon when not provided
  • Properly integrated with existing checkbox selection logic

Breaking Changes

None. This is a backward-compatible enhancement.

Documentation

Type definitions have been updated to include the new prop with appropriate JSDoc comments.

Testing

  • Tested with custom icons
  • Tested fallback to default MinusIcon
  • Verified backward compatibility
  • Confirmed TypeScript compilation

Related Issue

Resolves #[issue-number]

Type: Enhancement
Component: Tree, TreeTable
Labels: enhancement, tree-component, treetable-component, icons

Copy link

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@dimmageiras dimmageiras changed the title Add checkboxPartialIcon prop to Tree and TreeTable components Add checkboxPartialIcon prop to Tree and TreeTable components #4037 May 27, 2025
Copy link

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@melloware melloware requested a review from mertsincan May 27, 2025 12:38
@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label May 27, 2025
Allows customization of partial checkbox state icons in both Tree and TreeTable components.
Maintains backward compatibility with MinusIcon default.

Closes #[4037]
@melloware melloware force-pushed the feat/tree-treetable-checkbox-partial-icon branch from cf94a61 to 39fc6fc Compare May 27, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants