antd/lib/table#ExpandIconProps TypeScript Examples

The following examples show how to use antd/lib/table#ExpandIconProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: customexpandicon.tsx    From gant-design with MIT License 6 votes vote down vote up
function CustomExpandIcon(props: ExpandIconProps<object>, isTree?: boolean) {
  if (!isTree) {
    return null;
  }
  let type;
  let prefix;
  if (!props.expandable) {
    type = 'file';
    prefix = null;
  } else if (props.expanded) {
    type = 'folder-open';
    prefix = 'expanded';
  } else {
    type = 'folder';
    prefix = 'collapsed';
  }
  
  
  return (
    <span onClick={(e: any) => props.onExpand(props.record, e)} style={{ paddingLeft: prefix ? 0 : 17 }}>
      {
        prefix && <span className={"ant-table-row-expand-icon ant-table-row-" + prefix} />
      }
      <Icon
        className=""
        type={type}
        theme="filled"
      />
    </span>
  );
}