import classNames from 'classnames'; import { JsxChildren } from 'dom-renderer'; import { observable } from 'mobx'; import { FC, WebCellProps, attribute, component, observer } from 'web-cell'; import { Button, ButtonProps } from '../Form/Button'; export const Dropdown: FC> = ({ className = '', children, ...props }) => (
{children}
); export const DropdownToggle: FC = ({ className = '', children, ...props }) => ( ); export const DropdownMenu: FC = ({ className = '', children, ...props }) => ( ); export const DropdownItem: FC> = ({ className = '', children, ...props }) => ( {children} ); export interface DropdownButtonProps extends WebCellProps, ButtonProps { boxClass?: string; buttonClass?: string; caption: JsxChildren; } @component({ tagName: 'dropdown-button', mode: 'open' }) @observer export class DropdownButton extends HTMLElement { declare props: DropdownButtonProps; @attribute @observable accessor boxClass: string; @attribute @observable accessor buttonClass: string; @attribute @observable accessor variant: ButtonProps['variant']; @attribute @observable accessor size: ButtonProps['size']; @observable accessor caption: JsxChildren; @attribute @observable accessor disabled = false; @attribute @observable accessor show = false; renderContent() { const { boxClass, buttonClass, variant, size, caption } = this, { disabled, show } = this; return ( (this.show = !show)} > {caption} ); } render() { return ( <> {this.renderContent()} ); } }