carbon-components-svelte/types/ContextMenu/ContextMenuOption.d.ts
Eric Liu fa9b90cd79
Alignment with Carbon version 10.32 (#588)
* feat(code-snippet): add copy functionality

- docs: add custom feedback copy text example

* feat(tile): support disabled state for SelectableTile, RadioTile

Closes #539

* build(rollup): add clipboard-copy to globals

* feat(copy-button): add copy functionality

* feat(content-switcher): deprecate the light prop

- docs: remove the light variant example

* fix(toolbar-search): remove outer div

* feat(search): add searchClass prop

* fix(composed-modal): set hasScrollingContent class on ModalBody

* docs(data-table): add expandable size examples

* feat(tooltip): add TooltipFooter component

* fix(time-picker): correctly display invalidText

* feat(breadcrumb): support overflow menu

* feat(multi-select): export inputRef prop

* chore(deps-dev): upgrade carbon-components to v10.32.0

* feat(form): add noMargin prop to FormGroup

* docs(tooltip): document TooltipFooter

* feat(context-menu): support danger kind for ContextMenuOption

* feat(data-table): support rendering empty table header in skeleton

* refactor(types): use shorter import path in DataTableSkeleton

* feat(data-table): allow sorting to be disabled for a specific header

* docs(data-table): update example to desort the Protocol header

As an example, it makes more sense because all the values ("http") are the same.

* fix(context-menu): set initial y offset of context menu based on window height #577

* fix(context-menu): render submenu based on viewport constraints #577
2021-04-02 13:31:53 -07:00

80 lines
1.9 KiB
TypeScript

/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface ContextMenuOptionProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
/**
* Specify the kind of option
* @default "default"
*/
kind?: "default" | "danger";
/**
* Set to `true` to enable the disabled state
* @default false
*/
disabled?: boolean;
/**
* Set to `true` to indent the label
* @default false
*/
indented?: boolean;
/**
* Specify the icon from `carbon-icons-svelte` to render
* Icon is rendered to the left of the label text
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
/**
* Specify the label text
* Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>)
* @default ""
*/
labelText?: string;
/**
* Set to `true` to use the selected variant
* @default false
*/
selected?: boolean;
/**
* Set to `true` to enable the selectable variant
* Automatically set to `true` if `selected` is `true`
* @default false
*/
selectable?: boolean;
/**
* Specify the shortcut text
* Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>)
* @default ""
*/
shortcutText?: string;
/**
* Specify the id
* It's recommended to provide an id as a value to bind to within a selectable/radio menu group
* @default "ccs-" + Math.random().toString(36)
*/
id?: string;
/**
* Obtain a reference to the list item HTML element
* @default null
*/
ref?: null | HTMLLIElement;
}
export default class ContextMenuOption extends SvelteComponentTyped<
ContextMenuOptionProps,
{
keydown: WindowEventMap["keydown"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
click: CustomEvent<any>;
},
{ default: {}; labelText: {}; shortcutText: {} }
> {}