import {h} from 'preact';
import MaterialComponent from '../Base/MaterialComponent';
import Icon from '../Icon';
export interface IListItemProps {}
export interface IListItemState {}
export class ListItem<
PropTypes = {},
StateTypes = {}
> extends MaterialComponent<
IListItemProps & PropTypes,
IListItemState & StateTypes
> {
protected componentName = 'list-item';
protected mdcProps: string[] = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export class ListLinkItem<
PropTypes = {},
StateTypes = {}
> extends MaterialComponent {
protected componentName = 'list-item';
protected mdcProps = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export interface IListItemGraphicProps {}
export interface IListItemGraphicState {}
export class ListItemGraphic extends MaterialComponent<
IListItemGraphicProps,
IListItemGraphicState
> {
protected componentName = 'list-item__graphic';
protected mdcProps = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export class ListItemMeta extends ListItemGraphic {
protected componentName = 'list-item__meta';
}
export interface IListItemMetaTextProps {}
export interface IListItemMetaTextState {}
export class ListItemMetaText extends MaterialComponent<
IListItemMetaTextProps,
IListItemMetaTextState
> {
protected componentName = 'list-item__meta';
protected mdcProps = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export interface IListDividerProps {
inset?: boolean;
}
export interface IListDividerState {}
export class ListDivider extends MaterialComponent<
IListDividerProps,
IListDividerState
> {
protected componentName = 'list-divider';
protected mdcProps = ['inset'];
protected materialDom(props) {
return ;
}
}
export interface IListTextContainerProps {}
export interface IListTextContainerState {}
export class ListTextContainer extends MaterialComponent<
IListTextContainerProps,
IListTextContainerState
> {
protected componentName = 'list-item__text';
protected mdcProps = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export class ListPrimaryText extends ListTextContainer {
protected componentName = 'list-item__primary-text';
}
export class ListSecondaryText extends ListTextContainer {
protected componentName = 'list-item__secondary-text';
}
export interface IListGroupProps {}
export interface IListGroupState {}
export class ListGroup extends MaterialComponent<
IListGroupProps,
IListGroupState
> {
protected componentName = 'list-group';
protected mdcProps = [];
protected materialDom(props) {
return {this.props.children}
;
}
}
export interface IListGroupHeaderProps {}
export interface IListGroupHeaderState {}
export class ListGroupHeader extends MaterialComponent<
IListGroupHeaderProps,
IListGroupHeaderState
> {
protected componentName = 'list-group__subheader';
protected mdcProps = [];
protected materialDom(props) {
return (
{props.children}
);
}
}
export interface IListProps {
dense?: boolean;
'two-line'?: boolean;
'avatar-list'?: boolean; // TODO: Add to docs / remove from here
}
export interface IListState {}
export class List extends MaterialComponent {
protected componentName = 'list';
protected mdcProps = ['dense', 'two-line', 'avatar-list'];
protected materialDom(props) {
if (props.interactive) {
return (
);
}
return (
);
}
}
export default class extends List {
public static readonly Item = ListItem;
public static readonly LinkItem = ListLinkItem;
public static readonly ItemGraphic = ListItemGraphic;
public static readonly ItemMeta = ListItemMeta;
public static readonly ItemMetaText = ListItemMetaText;
public static readonly Divider = ListDivider;
public static readonly TextContainer = ListTextContainer;
public static readonly PrimaryText = ListPrimaryText;
public static readonly SecondaryText = ListSecondaryText;
public static readonly Group = ListGroup;
public static readonly GroupHeader = ListGroupHeader;
}