Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -52597,6 +52597,14 @@
"default": "",
"description": "Icon to display in the checkbox."
},
{
"name": "checkboxPartialIcon",
"optional": true,
"readonly": false,
"type": "IconType<TreeProps>",
"default": "",
"description": "Icon to display in the partially selected checkbox."
},
{
"name": "children",
"optional": true,
Expand Down Expand Up @@ -53335,6 +53343,13 @@
"type": "TreePassThroughType<HTMLAttributes<HTMLSpanElement> | SVGProps<SVGSVGElement>>",
"description": "Uses to pass attributes to the checkbox icon's DOM element."
},
{
"name": "checkboxPartialIcon",
"optional": true,
"readonly": false,
"type": "TreePassThroughType<HTMLAttributes<HTMLSpanElement> | SVGProps<SVGSVGElement>>",
"description": "Uses to pass attributes to the checkbox partial icon's DOM element."
},
{
"name": "nodeIcon",
"optional": true,
Expand Down Expand Up @@ -55109,6 +55124,14 @@
"default": "",
"description": "Icon of the checkbox when checked."
},
{
"name": "checkboxPartialIcon",
"optional": true,
"readonly": false,
"type": "IconType<TreeProps>",
"default": "",
"description": "Icon to display in the partially selected checkbox."
},
{
"name": "children",
"optional": true,
Expand Down Expand Up @@ -56357,6 +56380,13 @@
"type": "TreeTablePassThroughType<HTMLAttributes<HTMLSpanElement> | SVGProps<SVGSVGElement>>",
"description": "Uses to pass attributes to the checkbox icon's DOM element."
},
{
"name": "checkboxPartialIcon",
"optional": true,
"readonly": false,
"type": "TreeTablePassThroughType<HTMLAttributes<HTMLSpanElement> | SVGProps<SVGSVGElement>>",
"description": "Uses to pass attributes to the checkbox partial icon's DOM element."
},
{
"name": "filterInput",
"optional": true,
Expand Down
1 change: 1 addition & 0 deletions components/lib/tree/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ export const Tree = React.memo(
last={last}
path={String(index)}
checkboxIcon={props.checkboxIcon}
checkboxPartialIcon={props.checkboxPartialIcon}
collapseIcon={props.collapseIcon}
contextMenuSelectionKey={props.contextMenuSelectionKey}
cx={cx}
Expand Down
1 change: 1 addition & 0 deletions components/lib/tree/TreeBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const TreeBase = ComponentBase.extend({
ariaLabel: null,
ariaLabelledBy: null,
checkboxIcon: null,
checkboxPartialIcon: null,
className: null,
collapseIcon: null,
contentClassName: null,
Expand Down
3 changes: 2 additions & 1 deletion components/lib/tree/UITreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ export const UITreeNode = React.memo((props) => {
const checkboxIconProps = mergeProps({
className: cx('checkIcon')
});
const icon = checked ? props.checkboxIcon || <CheckIcon {...checkboxIconProps} /> : partialChecked ? props.checkboxIcon || <MinusIcon {...checkboxIconProps} /> : null;
const icon = checked ? props.checkboxIcon || <CheckIcon {...checkboxIconProps} /> : partialChecked ? props.checkboxPartialIcon || <MinusIcon {...checkboxIconProps} /> : null;
const checkboxIcon = IconUtils.getJSXIcon(icon, { ...checkboxIconProps }, props);
const checkboxProps = mergeProps(
{
Expand Down Expand Up @@ -902,6 +902,7 @@ export const UITreeNode = React.memo((props) => {
key={childNode.key || childNode.label}
node={childNode}
checkboxIcon={props.checkboxIcon}
checkboxPartialIcon={props.checkboxPartialIcon}
collapseIcon={props.collapseIcon}
contextMenuSelectionKey={props.contextMenuSelectionKey}
cx={cx}
Expand Down
8 changes: 8 additions & 0 deletions components/lib/tree/tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export interface TreePassThroughOptions {
* Uses to pass attributes to the checkbox icon's DOM element.
*/
checkboxIcon?: TreePassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the checkbox partial icon's DOM element.
*/
checkboxPartialIcon?: TreePassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the node icon's DOM element.
*/
Expand Down Expand Up @@ -512,6 +516,10 @@ export interface TreeProps {
* Icon to display in the checkbox.
*/
checkboxIcon?: IconType<TreeProps> | undefined;
/**
* Icon to display for partially selected checkbox.
*/
checkboxPartialIcon?: IconType<TreeProps> | undefined;
/**
* Icon of an expanded tab.
*/
Expand Down
1 change: 1 addition & 0 deletions components/lib/treetable/TreeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ export const TreeTable = React.forwardRef((inProps, ref) => {
<TreeTableBody
hostName="TreeTable"
checkboxIcon={props.checkboxIcon}
checkboxPartialIcon={props.checkboxPartialIcon}
columns={columns}
contextMenuSelectionKey={props.contextMenuSelectionKey}
emptyMessage={props.emptyMessage}
Expand Down
1 change: 1 addition & 0 deletions components/lib/treetable/TreeTableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const TreeTableBody = React.memo((props) => {
node={node}
originalOptions={props.originalOptions}
checkboxIcon={props.checkboxIcon}
checkboxPartialIcon={props.checkboxPartialIcon}
columns={props.columns}
expandedKeys={props.expandedKeys}
onToggle={props.onToggle}
Expand Down
3 changes: 2 additions & 1 deletion components/lib/treetable/TreeTableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export const TreeTableRow = React.memo((props) => {
},
getColumnPTOptions(column, 'rowCheckbox.icon')
);
const icon = checked ? props.checkboxIcon || <CheckIcon {...checkboxIconProps} /> : partialChecked ? props.checkboxIcon || <MinusIcon /> : null;
const icon = checked ? props.checkboxIcon || <CheckIcon {...checkboxIconProps} /> : partialChecked ? props.checkboxPartialIcon || <MinusIcon {...checkboxIconProps} /> : null;
const checkIcon = IconUtils.getJSXIcon(icon, {}, { props, checked, partialChecked });
const rowCheckboxProps = mergeProps(
{
Expand Down Expand Up @@ -596,6 +596,7 @@ export const TreeTableRow = React.memo((props) => {
node={childNode}
originalOptions={props.originalOptions}
checkboxIcon={props.checkboxIcon}
checkboxPartialIcon={props.checkboxPartialIcon}
columns={props.columns}
expandedKeys={props.expandedKeys}
selectOnEdit={props.selectOnEdit}
Expand Down
8 changes: 8 additions & 0 deletions components/lib/treetable/treetable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export interface TreeTablePassThroughOptions {
* Uses to pass attributes to the checkbox icon's DOM element.
*/
checkboxIcon?: TreeTablePassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the checkbox partial icon's DOM element.
*/
checkboxPartialIcon?: TreeTablePassThroughType<React.SVGProps<SVGSVGElement> | React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the resize helper's DOM element.
* @see {@link InputTextPassThroughOptions}
Expand Down Expand Up @@ -590,6 +594,10 @@ export interface TreeTableProps extends Omit<React.DetailedHTMLProps<React.Input
* Icon of the checkbox when checked.
*/
checkboxIcon?: IconType<TreeTableProps> | undefined;
/**
* Icon to display for partially selected checkbox.
*/
checkboxPartialIcon?: IconType<TreeTableProps> | undefined;
/**
* Used to get the child elements of the component.
* @readonly
Expand Down
Loading