1 | import { Emitter, RefObject } from '@mantou/gem/lib/decorators';
|
2 | import { GemElement, TemplateResult } from '@mantou/gem/lib/element';
|
3 | import { StyleObject } from '@mantou/gem/lib/utils';
|
4 | import './reflect';
|
5 | export declare type PopoverState = {
|
6 | open: boolean;
|
7 | left: number;
|
8 | right: number;
|
9 | top: number;
|
10 | bottom: number;
|
11 | style: StyleObject;
|
12 | position: Position;
|
13 | };
|
14 | declare type Position = 'top' | 'bottom' | 'right' | 'left' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
15 | declare type GhostStyle = {
|
16 | '--bg': string;
|
17 | '--color': string;
|
18 | };
|
19 | declare type Option = {
|
20 | delay?: number;
|
21 | unreachable?: boolean;
|
22 | content?: string | TemplateResult;
|
23 | position?: Position;
|
24 | ghostStyle?: GhostStyle;
|
25 | trigger?: 'click' | 'hover';
|
26 | };
|
27 | declare type CloseCallback = {
|
28 | (): void;
|
29 | instance: DuoyunPopoverElement;
|
30 | };
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare class DuoyunPopoverElement extends GemElement<PopoverState> {
|
38 | #private;
|
39 | debug: boolean;
|
40 | unreachable: boolean;
|
41 | trigger: 'click' | 'hover';
|
42 | position: Position | 'auto';
|
43 | content?: string | TemplateResult;
|
44 | popoverRef: RefObject<DuoyunPopoverGhostElement>;
|
45 | slotRef: RefObject<HTMLSlotElement>;
|
46 | open: Emitter<null>;
|
47 | close: Emitter<null>;
|
48 | static open(e: Element, option: Option): CloseCallback;
|
49 | static open(x: number, y: number, option: Option): CloseCallback;
|
50 | static open(xywh: number[], option: Option): CloseCallback;
|
51 | ghostStyle: GhostStyle;
|
52 | state: PopoverState;
|
53 | constructor({ delay, content, position, ghostStyle, trigger, unreachable }?: Option);
|
54 | get popoverElement(): DuoyunPopoverGhostElement | undefined;
|
55 | mounted: () => void;
|
56 | render: () => TemplateResult;
|
57 | }
|
58 | export declare const Popover: typeof DuoyunPopoverElement;
|
59 | /**
|
60 | * @customElement dy-popover-ghost
|
61 | */
|
62 | export declare class DuoyunPopoverGhostElement extends GemElement {
|
63 | #private;
|
64 | close: Emitter;
|
65 | mounted: () => () => void;
|
66 | }
|
67 | export {};
|
68 |
|
\ | No newline at end of file |