@dazhicheng/ui 1.5.192 → 1.5.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 弹窗 ESC 栈管理器
3
+ *
4
+ * 解决 element-plus ElDialog 两个问题:
5
+ * 1. 多个弹窗同时打开时,按 ESC 会一次性关闭所有弹窗。
6
+ * 期望:按一次 ESC 只关闭最顶层(最后打开)的弹窗,逐个关闭。
7
+ * 2. 弹窗内表单元素(input / select 等)聚焦时按 ESC 也会关闭弹窗。
8
+ * vue2 的 element-ui 不存在该问题。
9
+ * 期望:焦点位于表单交互元素上时,ESC 交给该元素处理(如关闭下拉),不关闭弹窗。
10
+ *
11
+ * 实现方式:在 ElDialog 上禁用原生 close-on-press-escape,由本管理器统一处理。
12
+ */
13
+ export interface ModalStackItem {
14
+ /** 弹窗实例 uid */
15
+ uid: number;
16
+ /** 关闭弹窗的回调 */
17
+ close: () => void;
18
+ }
19
+ /**
20
+ * 弹窗打开时入栈,并确保全局监听已绑定。
21
+ */
22
+ export declare function pushModal(item: ModalStackItem): void;
23
+ /**
24
+ * 弹窗关闭时出栈,栈为空时解绑全局监听。
25
+ */
26
+ export declare function removeModal(uid: number): void;