import '@oicl/openbridge-webcomponents/dist/components/menu-button/menu-button.js';
import type { ContextMenuOption, ContextMenuType, ColumnGroup } from '@oicl/openbridge-webcomponents/dist/components/context-menu-input/context-menu-input.js';
import type { Snippet } from 'svelte';
export interface Props {
class?: string;
style?: string;
/** The label displayed on the button.
If empty, the button can be rendered as icon-only. */
label?: string;
/** Array of menu options with value, label, and optional level, icon, and children.
Each option can include:
- `value`: Unique string identifier.
- `label`: Display text.
- `icon`: Optional icon (e.g., ``).
- `children`: Optional array of child options (for nested/flyout menus).
- `level`: Optional nesting level (for hierarchical menus). */
options?: ContextMenuOption[];
/** Array of currently selected option values.
Used to control which options are checked/selected in the menu. */
selectedValues?: string[];
/** Whether the button should fill the full width of its container.
If true, the button stretches to 100% width. */
fullWidth?: boolean;
/** Whether the button should show an icon slot.
If true, the `icon` slot is rendered at the start of the button. */
hasIcon?: boolean;
/** The variant type of context menu to display.
Determines menu layout and selection behavior.
- `Regular`: Standard single-select.
- `Checkboxes`: Multi-select with checkboxes.
- `NestedCheckboxes`: Hierarchical multi-select.
- `Flyout`: Multi-level flyout menu.
- `Multi`: Multi-column menu.
- `MultiWithSubtitles`: Multi-column with group subtitles. */
menuType?: ContextMenuType;
/** Whether multiple selections are allowed.
Overrides the default selection mode for the chosen variant.
If not explicitly set, defaults based on `menuType`. */
multiSelect?: boolean | undefined;
/** Allows single selection per group (flyout/multi-column only).
When true, only one item per group/column can be selected. */
selectPerGroup?: boolean | undefined;
/** Whether to show a title bar with close button at the top of the menu.
If true, the menu displays a title bar (use `menuTitle` for text). */
hasTitleBar?: boolean;
/** Title text displayed in the title bar (if `hasTitleBar` is true). */
menuTitle?: string;
/** Array of column groups for the `multi-with-subtitles` layout.
Used to define grouped columns with subtitles in multi-column menus. */
columnGroups?: ColumnGroup[];
/** Number of items per column in multi-column layouts.
Used for `Multi` and `MultiWithSubtitles` menu types. */
itemsPerColumn?: number;
/** Render the dropdown context menu above or below the button.
If true, the menu opens above the button; otherwise, it opens below. */
openTop?: boolean;
/** Whether both parts of the button are disabled.
Disables both the button and the menu. */
disabled?: boolean;
}
export interface Events {
onChange?: (event: CustomEvent<{
selectedValues: string[];
selectedOptions: Array;
}>) => void;
onItemClick?: (event: CustomEvent<{
value: string;
option: ContextMenuOption;
}>) => void;
onOpen?: (event: CustomEvent) => void;
onClose?: (event: CustomEvent) => void;
}
export interface Slots {
icon?: Snippet;
}
type $$ComponentProps = Props & Events & Slots;
declare const ObcMenuButton: import("svelte").Component<$$ComponentProps, {
ContextMenuOption: typeof ContextMenuOption;
ContextMenuType: typeof ContextMenuType;
ColumnGroup: typeof ColumnGroup;
}, "">;
type ObcMenuButton = ReturnType;
export default ObcMenuButton;