* or another acceptable tag that is marked as a display: table-row.
*
* 2) The header function MUST only include direct child elements that are either
* 's or acceptable elements that are maked as display: table-cell. The
* renderer MUST return one element for each defined column even if there is
* no data to be rendered in the column.
*/
renderHeader?: (columns: ITreeColumn[]) => JSX.Element;
/**
* When a row's value is given as an ObservableValue with an undefined value,
* the list will render a Loading row for the content. The default will be
* a shimmer row that is semi random and matches the content.
*
* @param index This is the 0 based row index that should be rendered.
* @param details Additional details about this row.
*/
renderLoadingRow?: (rowIndex: number, details: ITreeRowDetails) => JSX.Element;
/**
* The requirements of this function are quite complicated and before writing
* a new row renderer you should ensure one doesnt already exist that solves
* your needs.
*
* Requirements:
*
* 1) The row function MUST return a singlely rooted component that resolves
* to single rooted element, or return a single element that is either a
* or another acceptable tag that is marked as a display: table-row.
*
* 2) The row function MUST only include direct child elements that are either
* 's or acceptable elements that are maked as display: table-cell. The
* renderer MUST return one element for each defined column even if there is
* no data to be rendered in the column.
*
* 3) The row function MUST call onFocusItem when a either the row element of
* any of the rows child elements receive the focus. This is needed to ensure
* navigation within the tree as well as in and out of the tree function
* correctly.
*
* 4) The row function MUST ensure the className for each of the columns is
* added the cell for the given colmn.
*
* 5) The row function MAY dispatch events for behaviors but is not required.
* If any events are dispatched they should be documented on the row renderer.
*
* 6) The row function is responsible for all accessibility and focus
* management within the row.
*
*/
renderRow?: TreeRowRenderer;
/**
* renderSpacer can be supplied to override the spacer columns before and
* after the actual columns in the table. This is used to apply custom
* semantics to these areas. The standard spacers should be used unless there
* is a specific need otherwise.
*/
renderSpacer?: (rowIndex: number, left: boolean) => React.ReactNode | null;
/**
* role defines the aria role of the tree and defaults to "tree"
*
* @default "tree"
*/
role?: string;
/**
* If the caller has variable height rows they can specify the rowHeight they
* want used to estimate the size of virtualized rows. This means that when rows
* are not rendered, the component will create virtual space for those rows to
* ensure the scrolling behavior acts appropriately.
*
* If the tree has fixed size rows there is no need to specify a rowHeight. The
* tree will determine the height of the rows after the initial render when
* the observer reports on page visibility.
*
* Question: How do I determine the rowHeight if their are variable height rows.
* This one is a tough question, and the general answer is come up with a fair
* average for the rows on a given page. If the select too large or too small
* scrolling behaviors can become a bit odd, generally select on the smaller
* side if you are unsure.
*/
rowHeight?: number;
/**
* Set to true to make the text in the tree rows selectable.
*/
selectableText?: boolean;
/**
* scrollable should be set to true if the tree is not contained in a
* scrolling element. This will ensure the tree scrolls vertically within
* the tree element itself.
*/
scrollable?: boolean;
/**
* A selection object can be supplied for managing the tree selection. This
* is not required since the tree offers onSelect as a delegate. If the caller
* wants multi-selction they must use an IListSelection that supports multi
* select.
*
* There is a basic ListSelection implementation available from the List
* component.
*/
selection?: IListSelection;
/**
* showHeader determines whether or not the column headers are shown at the top
* of the tree.
*
* @default true if columns are supplied.
*/
showHeader?: boolean;
/**
* showLines determines whether or not lines displayed between rows.
*
* @default true
*/
showLines?: boolean;
/**
* showScroll determines whether we allow overflow on the table
* if it is false (as in default), we will add scroll-hidden css class to the table
* @default false
*/
showScroll?: boolean;
/**
* Using singleClickActivation will activate the item when the row is clicked.
* Where setting singleClickActivation to false will require a doubleclick to
* activate a given row.
*
* @default true
*/
singleClickActivation?: boolean;
/**
* A tree can be defined with a set of breakpoints. These breakpoints will be
* used to control the column layout as the space available to the tree changes.
*/
tableBreakpoints?: ITableBreakpoint[];
/**
* If virtualize false is supplied the list will render all the items supplied
* to it. This shouldn't be used unless you know you have a limited number of
* rows. Virtualization is used to avoid performance problems.
*/
virtualize?: boolean;
/**
* Set true to set the tabIndex of the underlying table to -1 instead of 0.
*/
excludeTabStop?: boolean;
}
/**
* Props that can be used to represent that data available to a custom row
* rendering component.
*
* See ITreeProps.renderRow for parameter details.
*/
export interface ITreeRowProps {
/**
* css class names to add to the row element.
*/
className?: string;
/**
* Details about the row being rendered.
*/
details: ITreeRowDetails;
/**
* This is the 0 based row index.
*/
index: number;
/**
* If the tree row should be rendered as a link, the caller can supply the
* links properties. These are merged with the lists properties to build
* a list row that is a anchor instead of a table row.
* The only props which are forwarded are href, rel, and target.
*/
/** @deprecated Please include links within the content itself. Rows rendered as links are inaccessible and support for them will be removed in future versions. */
linkProps?: IAnchorProps;
}
| |