@ebay/ebayui-core
Version:
Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.
58 lines (57 loc) • 2.11 kB
TypeScript
import { DropdownUtil } from "../../common/dropdown";
import type { MenuEvent } from "../ebay-fake-menu/component";
import type { Input as FakeMenuInput, Item as FakeMenuItem } from "../ebay-fake-menu/component";
import type { WithNormalizedProps } from "../../global";
interface FakeMenuButtonInput extends Omit<Marko.HTML.Span, `on${string}`> {
text?: string;
size?: "none" | "small" | "large";
"prefix-id"?: string;
variant?: "overflow" | "form" | "button" | "icon";
priority?: "primary" | "secondary" | "delete" | "tertiary" | "none";
borderless?: boolean;
transparent?: boolean;
icon?: Marko.Renderable | Marko.AttrTag<{
renderBody: Marko.Body;
}>;
"a11y-text"?: Marko.HTMLAttributes["aria-label"];
disabled?: boolean;
"no-toggle-icon"?: boolean;
label?: Marko.AttrTag<{
renderBody?: Marko.Body;
}>;
"text-align"?: "center";
type?: FakeMenuInput["type"];
reverse?: boolean;
strategy?: "absolute" | "fixed";
flip?: boolean;
"fix-width"?: boolean;
item?: Marko.AttrTag<FakeMenuItem>;
"collapse-on-select"?: boolean;
"on-expand"?: (event: MenuEvent) => void;
"on-collapse"?: (event: MenuEvent) => void;
"on-select"?: (event: MenuEvent) => void;
"on-mousedown"?: (event: MenuEvent) => void;
}
export interface Input extends WithNormalizedProps<FakeMenuButtonInput> {
}
declare class FakeMenuButton extends Marko.Component<Input> {
expander: any;
dropdownUtil: DropdownUtil;
handleMenuKeydown({ el, originalEvent, index }: MenuEvent): void;
focus(): void;
handleButtonEscape(): void;
handleExpand(): void;
handleCollapse(): void;
handleMenuSelect({ el, originalEvent, index }: MenuEvent): void;
handleMousedown(originalEvent: MouseEvent, el: HTMLElement): void;
emitComponentEvent({ eventType, el, originalEvent, index, }: MenuEvent & {
eventType: string;
}): void;
onRender(): void;
onMount(): void;
onUpdate(): void;
onDestroy(): void;
_setupMakeup(): void;
_cleanupMakeup(): void;
}
export default FakeMenuButton;