movable.ts, and fix popup issue.

This commit is contained in:
lchen committed 2026-11-24 10:57:36 +08:00
1 parent 5c2c682baf
commit 9028805363
7 files changed
+167 -40

No files matched your search

+10 -2
View File
@@ -33,6 +33,7 @@ export interface MovableOptions<T = void> {
movable: boolean;
resizable: boolean;
minSize?: number;
bringToFront?: boolean;
snapThreshold?: number;
snapToContainer?: boolean;
snapToSiblings?: boolean;
@@ -45,7 +46,8 @@ export interface MovableOptions<T = void> {
onMoved?(this: T | undefined, rect: BoxRect): void;
onResizeStart?(this: T | undefined): void;
onResized?(this: T | undefined, rect: BoxRect): void;
onSnap?(this: T | undefined, guides: SnapLine[]): void;
onSnapped?(this: T | undefined, guides: SnapLine[]): void;
onZIndexChanged?(this: T | undefined, zIndex: number, box: HTMLElement): void;
}
export type MarkRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
@@ -90,7 +92,13 @@ export interface PopupButton {
key?: string;
text: string;
isPrimary?: boolean;
trigger?: (popup: Popup, button?: PopupButton) => boolean | Promise<boolean> | string | number;
/**
* 按钮触发函数
* @param popup 操作的弹出框实例
* @param button 触发的按钮
* @returns 返回 false 则阻止窗口关闭
*/
trigger?: (this: PopupButton, popup: Popup) => boolean | string | number | Promise<boolean | string | number> | undefined;
}
export interface PopupOptions {