1 | import { GemElement, TemplateResult } from '@mantou/gem/lib/element';
|
2 | import './compartment';
|
3 | import './button';
|
4 | import './options';
|
5 | export declare type Menu = MenuItem[] | TemplateResult;
|
6 | export interface MenuItem {
|
7 |
|
8 | text: string | TemplateResult;
|
9 | description?: string | TemplateResult;
|
10 | tag?: string | TemplateResult;
|
11 | tagIcon?: string | DocumentFragment | Element;
|
12 | disabled?: boolean;
|
13 | danger?: boolean;
|
14 | selected?: boolean;
|
15 | handle?: () => void | Promise<void>;
|
16 | menu?: Menu;
|
17 | }
|
18 | declare type MenuStore = {
|
19 | width?: string;
|
20 | maxHeight?: string;
|
21 | activeElement?: HTMLElement | null;
|
22 | openLeft?: boolean;
|
23 | maskClosable?: boolean;
|
24 | menuStack: {
|
25 | searchable?: boolean;
|
26 | openTop?: boolean;
|
27 | menu: Menu;
|
28 | x: number;
|
29 | y: number;
|
30 | header?: TemplateResult;
|
31 | }[];
|
32 | };
|
33 | declare type OpenMenuOptions = {
|
34 |
|
35 | activeElement?: HTMLElement | null;
|
36 |
|
37 | openLeft?: boolean;
|
38 | maskClosable?: boolean;
|
39 |
|
40 | x?: number;
|
41 |
|
42 | y?: number;
|
43 |
|
44 | width?: string;
|
45 |
|
46 | maxHeight?: string;
|
47 |
|
48 | searchable?: boolean;
|
49 |
|
50 | header?: TemplateResult;
|
51 | };
|
52 | export declare const menuStore: import("@mantou/gem/lib/store").Store<MenuStore>;
|
53 |
|
54 |
|
55 |
|
56 | export declare class DuoyunMenuElement extends GemElement {
|
57 | #private;
|
58 | static instance?: DuoyunMenuElement;
|
59 | static open(menu: Menu, options?: OpenMenuOptions): Promise<void>;
|
60 | static confirm(text: string | TemplateResult, options: OpenMenuOptions & {
|
61 | danger?: boolean;
|
62 | okText?: string | TemplateResult;
|
63 | }): Promise<unknown>;
|
64 | static close(): void;
|
65 | constructor();
|
66 | mounted: () => () => void;
|
67 | render: () => TemplateResult;
|
68 | }
|
69 | export declare const ContextMenu: typeof DuoyunMenuElement;
|
70 | export {};
|
71 |
|
\ | No newline at end of file |