@dazhicheng/ui 1.6.39 → 1.6.41
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.
- package/dist/components/tt-modal/src/RenderModal.vue.js +231 -258
- package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +0 -7
- package/dist/components/tt-modal/src/utils/modal-z-index.js +14 -16
- package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +0 -13
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +73 -106
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TtIcon as
|
|
1
|
+
import { defineComponent as Ue, ref as T, useAttrs as qe, useSlots as Ke, getCurrentInstance as Ye, computed as f, unref as o, watch as ie, reactive as Je, nextTick as L, provide as Qe, onMounted as Xe, onDeactivated as Ge, onActivated as We, onUnmounted as eo, withDirectives as oo, createElementBlock as to, openBlock as lo, createVNode as I, mergeProps as re, h as so, createSlots as E, withCtx as c, normalizeClass as io, renderSlot as g, renderList as V, normalizeProps as _, guardReactiveProps as z, createElementVNode as ro } from "vue";
|
|
2
|
+
import { TtIcon as no } from "../../tt-icon/index.js";
|
|
3
3
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
4
|
-
import { useDesign as
|
|
5
|
-
import { usePriorityValues as
|
|
4
|
+
import { useDesign as ao } from "../../../packages/hooks/src/useDesign.js";
|
|
5
|
+
import { usePriorityValues as uo, getPriorityValues as po } from "../../../packages/hooks/src/usePriorityValue.js";
|
|
6
6
|
import "axios";
|
|
7
|
-
import { dialogProps as
|
|
7
|
+
import { dialogProps as ne, useZIndex as co, ElDialog as fo } from "element-plus";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
|
-
import { generateTestId as
|
|
10
|
+
import { generateTestId as R, toKebabCase as mo } from "../../../packages/utils/src/testid-helper.js";
|
|
11
11
|
import "xe-utils";
|
|
12
12
|
import "dayjs/plugin/utc";
|
|
13
13
|
import "dayjs/plugin/timezone";
|
|
@@ -16,27 +16,27 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
|
|
|
16
16
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
17
17
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
18
18
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
19
|
-
import { omit as
|
|
19
|
+
import { omit as ae, pick as j } from "lodash-es";
|
|
20
20
|
import "vue-router";
|
|
21
|
-
import
|
|
22
|
-
import { useStore as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { basicProps as
|
|
27
|
-
import { ModalApi as
|
|
28
|
-
import { resolveModalTarget as
|
|
29
|
-
import { allocateModalZIndex as
|
|
30
|
-
import { getClientDocument as
|
|
31
|
-
import { pushModal as
|
|
32
|
-
import { emitModalCloseTransitionEnd as
|
|
33
|
-
import
|
|
34
|
-
const
|
|
21
|
+
import vo from "../../../directives/dialog-resize/index.js";
|
|
22
|
+
import { useStore as go } from "@tanstack/vue-store";
|
|
23
|
+
import bo from "./components/ModalFooter.vue.js";
|
|
24
|
+
import Co from "./components/ModalHeader.vue.js";
|
|
25
|
+
import To from "./components/ModalWrapper.vue.js";
|
|
26
|
+
import { basicProps as ho } from "./props.js";
|
|
27
|
+
import { ModalApi as ko } from "./utils/modal-api.js";
|
|
28
|
+
import { resolveModalTarget as de, MODAL_OVERLAY_CLASS as yo, MODAL_OVERLAY_CONTAINED_CLASS as H, findTopOpenModalOverlayHost as Oo, ensureContainedOverlayStyle as Bo, applyContainedOverlayInline as N, watchOverlayThenSuspend as ue, suspendOverlayByUid as Po, resumeOverlayByUid as So } from "./utils/resolve-modal-target.js";
|
|
29
|
+
import { allocateModalZIndex as Io } from "./utils/modal-z-index.js";
|
|
30
|
+
import { getClientDocument as Mo } from "./utils/modal-scope.js";
|
|
31
|
+
import { pushModal as pe, removeModal as Z } from "./utils/modal-stack.js";
|
|
32
|
+
import { emitModalCloseTransitionEnd as Ao } from "./utils/modal-close-transition.js";
|
|
33
|
+
import $o from "../../../assets/svg/close.svg.js";
|
|
34
|
+
const Do = ["aria-tt-id", "data-testid"], Fo = ["data-testid"], ft = /* @__PURE__ */ Ue({
|
|
35
35
|
name: "TtModal",
|
|
36
36
|
__name: "RenderModal",
|
|
37
37
|
props: {
|
|
38
|
-
...
|
|
39
|
-
...
|
|
38
|
+
...ne,
|
|
39
|
+
...ho,
|
|
40
40
|
/** modalApi */
|
|
41
41
|
modalApi: {
|
|
42
42
|
type: Object,
|
|
@@ -44,291 +44,264 @@ const _o = ["aria-tt-id", "data-testid"], Ro = ["data-testid"], yt = /* @__PURE_
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
emits: ["visible-change", "register", "update:visible"],
|
|
47
|
-
setup(
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
let
|
|
51
|
-
if (!
|
|
52
|
-
const e =
|
|
53
|
-
...
|
|
54
|
-
disabledTip: Array.isArray(
|
|
47
|
+
setup(ce, { expose: fe, emit: me }) {
|
|
48
|
+
var le;
|
|
49
|
+
const d = ce, M = me, h = T(), { prefixCls: ve } = ao("modal"), p = qe(), ge = Ke(), t = Ye(), U = T(!1), q = T(), A = T(), be = co();
|
|
50
|
+
let r = d.modalApi;
|
|
51
|
+
if (!r) {
|
|
52
|
+
const e = d.okButtonProps ? {
|
|
53
|
+
...d.okButtonProps,
|
|
54
|
+
disabledTip: Array.isArray(d.okButtonProps.disabledTip) ? d.okButtonProps.disabledTip : d.okButtonProps.disabledTip ? [d.okButtonProps.disabledTip] : void 0
|
|
55
55
|
} : void 0, l = {
|
|
56
|
-
...
|
|
56
|
+
...d,
|
|
57
57
|
okButtonProps: e
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
return
|
|
59
|
+
r = new ko(l), r.useStore = (i) => {
|
|
60
|
+
const s = i ?? ((n) => n);
|
|
61
|
+
return go(r.store, s);
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
const m = (
|
|
65
|
-
visible:
|
|
66
|
-
title:
|
|
67
|
-
width:
|
|
68
|
-
size:
|
|
69
|
-
fullscreen:
|
|
70
|
-
resizer:
|
|
71
|
-
top:
|
|
72
|
-
isBottom:
|
|
73
|
-
draggable:
|
|
74
|
-
showCancelBtn:
|
|
75
|
-
okText:
|
|
76
|
-
cancelText:
|
|
64
|
+
const m = (le = r.useStore) == null ? void 0 : le.call(r), {
|
|
65
|
+
visible: b,
|
|
66
|
+
title: K,
|
|
67
|
+
width: Y,
|
|
68
|
+
size: J,
|
|
69
|
+
fullscreen: Ce,
|
|
70
|
+
resizer: Te,
|
|
71
|
+
top: he,
|
|
72
|
+
isBottom: Q,
|
|
73
|
+
draggable: ke,
|
|
74
|
+
showCancelBtn: ye,
|
|
75
|
+
okText: Oe,
|
|
76
|
+
cancelText: Be,
|
|
77
77
|
okButtonProps: B,
|
|
78
|
-
cancelButtonProps:
|
|
79
|
-
confirmLoading:
|
|
80
|
-
cancelLoading:
|
|
81
|
-
showOkBtn:
|
|
82
|
-
loading:
|
|
83
|
-
height:
|
|
84
|
-
showFooter:
|
|
85
|
-
loadingTip:
|
|
86
|
-
...
|
|
87
|
-
} =
|
|
78
|
+
cancelButtonProps: Pe,
|
|
79
|
+
confirmLoading: Se,
|
|
80
|
+
cancelLoading: Ie,
|
|
81
|
+
showOkBtn: Me,
|
|
82
|
+
loading: X,
|
|
83
|
+
height: Ae,
|
|
84
|
+
showFooter: G,
|
|
85
|
+
loadingTip: $e,
|
|
86
|
+
...De
|
|
87
|
+
} = uo(d, m), Fe = f(() => {
|
|
88
88
|
const e = {
|
|
89
89
|
mini: "448px",
|
|
90
90
|
small: "592px",
|
|
91
91
|
medium: "876px"
|
|
92
92
|
};
|
|
93
|
-
return
|
|
94
|
-
}),
|
|
95
|
-
var
|
|
96
|
-
const e =
|
|
97
|
-
...
|
|
93
|
+
return o(Y) ? o(Y) : e[o(J)] ? e[o(J)] : "500px";
|
|
94
|
+
}), $ = f(() => {
|
|
95
|
+
var se;
|
|
96
|
+
const e = po(De), l = ae(p, ["onVisibleChange", "onClose", "onClosed", "onOk", "onReceiveSharedData"]), s = {
|
|
97
|
+
...j(e, Object.keys(ne)),
|
|
98
98
|
...l
|
|
99
|
-
},
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
const
|
|
99
|
+
}, n = s.appendToBody === !0 || s["append-to-body"] === !0 || s["append-to-body"] === "", u = s.appendTo && s.appendTo !== "body" ? s.appendTo : void 0, O = !n && !u, w = O ? A.value : void 0;
|
|
100
|
+
let C = null;
|
|
101
|
+
w ? C = w === ((se = Mo()) == null ? void 0 : se.body) ? null : w : O && (C = de());
|
|
102
|
+
const x = !!C, Ne = n || !u && !C, Ze = x || o(Q) ? "40px" : "15vh";
|
|
103
103
|
return {
|
|
104
|
-
...
|
|
105
|
-
modelValue:
|
|
106
|
-
width:
|
|
104
|
+
...s,
|
|
105
|
+
modelValue: o(b),
|
|
106
|
+
width: o(Fe),
|
|
107
107
|
destroyOnClose: !0,
|
|
108
108
|
// 默认 false;可通过 modalProps.closeOnClickModal 开启点击遮罩关闭
|
|
109
109
|
closeOnClickModal: e.closeOnClickModal ?? !1,
|
|
110
110
|
// 禁用 element-plus 原生 ESC 关闭,改由 modal-stack 统一管理:
|
|
111
111
|
// 1. 多弹窗时逐个关闭;2. 表单聚焦时 ESC 不关闭弹窗
|
|
112
112
|
closeOnPressEscape: !1,
|
|
113
|
-
top:
|
|
113
|
+
top: o(he) ?? Ze,
|
|
114
114
|
fullscreen: !1,
|
|
115
115
|
draggable: !1,
|
|
116
116
|
// 外部显式指定优先;否则用打开时申请到的层级,element-plus 自己的 nextZIndex 不参与决策
|
|
117
|
-
zIndex:
|
|
118
|
-
appendToBody:
|
|
119
|
-
...
|
|
117
|
+
zIndex: s.zIndex ?? q.value,
|
|
118
|
+
appendToBody: Ne,
|
|
119
|
+
...u ? { appendTo: u } : C ? { appendTo: C } : { appendTo: "body" },
|
|
120
120
|
// 区域遮罩不锁整页滚动,避免侧栏能点却滚不动
|
|
121
|
-
lockScroll:
|
|
121
|
+
lockScroll: x ? s.lockScroll ?? !1 : s.lockScroll ?? !0,
|
|
122
122
|
modalClass: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
`tt-id-${
|
|
126
|
-
|
|
123
|
+
s.modalClass || e.modalClass || "",
|
|
124
|
+
yo,
|
|
125
|
+
`tt-id-${t == null ? void 0 : t.uid}`,
|
|
126
|
+
x ? H : ""
|
|
127
127
|
].filter(Boolean).join(" ")
|
|
128
128
|
};
|
|
129
|
-
}),
|
|
129
|
+
}), we = f(() => {
|
|
130
130
|
var l;
|
|
131
|
-
return String(((l =
|
|
132
|
-
}),
|
|
133
|
-
showCancelBtn:
|
|
134
|
-
okText:
|
|
135
|
-
cancelText:
|
|
136
|
-
okButtonProps:
|
|
137
|
-
cancelButtonProps:
|
|
138
|
-
confirmLoading:
|
|
139
|
-
cancelLoading:
|
|
140
|
-
showOkBtn:
|
|
141
|
-
})),
|
|
142
|
-
var
|
|
143
|
-
const e = (
|
|
144
|
-
return e || l ? [!0,
|
|
131
|
+
return String(((l = $.value) == null ? void 0 : l.modalClass) || "").includes(H);
|
|
132
|
+
}), xe = f(() => ({
|
|
133
|
+
showCancelBtn: o(ye),
|
|
134
|
+
okText: o(Oe),
|
|
135
|
+
cancelText: o(Be),
|
|
136
|
+
okButtonProps: o(B),
|
|
137
|
+
cancelButtonProps: o(Pe),
|
|
138
|
+
confirmLoading: o(Se),
|
|
139
|
+
cancelLoading: o(Ie),
|
|
140
|
+
showOkBtn: o(Me)
|
|
141
|
+
})), W = f(() => {
|
|
142
|
+
var n, u;
|
|
143
|
+
const e = (n = o(B)) == null ? void 0 : n.disabled, l = o(X), i = (u = o(B)) == null ? void 0 : u.disabledTip, s = Array.isArray(i) ? i : i ? [i] : [];
|
|
144
|
+
return e || l ? [!0, s] : [!1, []];
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
ie(
|
|
147
147
|
() => {
|
|
148
148
|
var e;
|
|
149
149
|
return (e = m.value) == null ? void 0 : e.visible;
|
|
150
150
|
},
|
|
151
151
|
(e) => {
|
|
152
152
|
var l;
|
|
153
|
-
e && (
|
|
154
|
-
(
|
|
155
|
-
(
|
|
153
|
+
e && (A.value = Oo(t == null ? void 0 : t.uid, de()) ?? void 0, q.value = Io(be)), e !== b.value && (M("visible-change", !!e), M("update:visible", !!e)), t && ((l = k.emitVisible) == null || l.call(k, !!e, t == null ? void 0 : t.uid)), t != null && t.uid && (e ? (He(), v.value || pe({ uid: t.uid, close: () => r.onClosed() }), Bo(), L(() => {
|
|
154
|
+
(t == null ? void 0 : t.uid) != null && (N(t.uid), v.value && (a == null || a(), a = ue(t.uid)), requestAnimationFrame(() => {
|
|
155
|
+
(t == null ? void 0 : t.uid) != null && (N(t.uid), v.value && Po(t.uid));
|
|
156
156
|
}));
|
|
157
|
-
})) : (
|
|
157
|
+
})) : (ee(), Z(t.uid))), e || r.changeOkLoading(!1);
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
immediate: !1
|
|
161
161
|
}
|
|
162
|
-
),
|
|
163
|
-
() =>
|
|
164
|
-
(e, l) => {
|
|
165
|
-
var n;
|
|
166
|
-
l && !e && (o == null ? void 0 : o.uid) != null && (t(g) || (n = m.value) != null && n.visible) && $(() => {
|
|
167
|
-
const r = o == null ? void 0 : o.uid;
|
|
168
|
-
if (r == null) return;
|
|
169
|
-
const i = document.querySelector(`.el-overlay.tt-id-${r}`);
|
|
170
|
-
if (!i) return;
|
|
171
|
-
const d = me(i);
|
|
172
|
-
(f.value == null || d > f.value) && (f.value = d), ve(L, d);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
), j(
|
|
176
|
-
() => t(g),
|
|
162
|
+
), ie(
|
|
163
|
+
() => o(b),
|
|
177
164
|
(e) => {
|
|
178
165
|
var l;
|
|
179
|
-
e !== ((l = m.value) == null ? void 0 : l.visible) &&
|
|
166
|
+
e !== ((l = m.value) == null ? void 0 : l.visible) && r.setState({ visible: e }), e || r.changeOkLoading(!1);
|
|
180
167
|
},
|
|
181
168
|
{
|
|
182
169
|
immediate: !1
|
|
183
170
|
}
|
|
184
171
|
);
|
|
185
|
-
function
|
|
186
|
-
|
|
172
|
+
function Le(e) {
|
|
173
|
+
U.value = e;
|
|
187
174
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
175
|
+
function Ee() {
|
|
176
|
+
Ao(r);
|
|
190
177
|
}
|
|
191
|
-
function
|
|
178
|
+
function Ve() {
|
|
192
179
|
document.querySelectorAll(".el-select__popper").forEach((l) => {
|
|
193
180
|
l.style.display !== "none" && (l.style.display = "none");
|
|
194
181
|
});
|
|
195
182
|
}
|
|
196
|
-
function
|
|
183
|
+
function D(e) {
|
|
197
184
|
return e.toLowerCase().includes("modal") ? e : `modal-${e}`;
|
|
198
185
|
}
|
|
199
|
-
function
|
|
186
|
+
function _e() {
|
|
200
187
|
const e = p["data-testid"] || p.dataTestid || p.testId || p["test-id"];
|
|
201
188
|
return e && typeof e == "string" ? e : void 0;
|
|
202
189
|
}
|
|
203
|
-
const
|
|
204
|
-
var
|
|
205
|
-
const e = (
|
|
190
|
+
const P = f(() => {
|
|
191
|
+
var n;
|
|
192
|
+
const e = (n = m.value) == null ? void 0 : n.testId;
|
|
206
193
|
if (e)
|
|
207
|
-
return
|
|
208
|
-
const l =
|
|
194
|
+
return D(e);
|
|
195
|
+
const l = d.testId;
|
|
209
196
|
if (l)
|
|
210
|
-
return
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
}),
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
setModalProps:
|
|
197
|
+
return D(l);
|
|
198
|
+
const i = _e();
|
|
199
|
+
if (i)
|
|
200
|
+
return D(i);
|
|
201
|
+
const s = o(K);
|
|
202
|
+
return s && typeof s == "string" && s.trim() ? R("modal", mo(s)) : t != null && t.uid ? `modal-${t.uid}` : "modal";
|
|
203
|
+
}), ze = f(() => R(P.value, "footer")), Re = f(() => R(P.value, "body"));
|
|
204
|
+
Qe("modalIdContext", P);
|
|
205
|
+
const k = Je({
|
|
206
|
+
setModalProps: r.setState,
|
|
220
207
|
emitVisible: void 0,
|
|
221
208
|
redoModalHeight: () => {
|
|
222
|
-
|
|
223
|
-
|
|
209
|
+
L(() => {
|
|
210
|
+
o(h) && o(h).setModalHeight();
|
|
224
211
|
});
|
|
225
212
|
},
|
|
226
213
|
scrollToBottom: () => {
|
|
227
214
|
var e;
|
|
228
|
-
|
|
215
|
+
o(h) && ((e = o(h)) == null || e.onScrollBottom());
|
|
229
216
|
}
|
|
230
217
|
});
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
let a,
|
|
234
|
-
function
|
|
218
|
+
t && M("register", k, `${t == null ? void 0 : t.uid}`);
|
|
219
|
+
const v = T(!1), S = T(null);
|
|
220
|
+
let a, y;
|
|
221
|
+
function F() {
|
|
235
222
|
var l;
|
|
236
|
-
return String(((l =
|
|
223
|
+
return String(((l = $.value) == null ? void 0 : l.modalClass) || "").includes(H);
|
|
237
224
|
}
|
|
238
|
-
function
|
|
239
|
-
var l,
|
|
240
|
-
const e =
|
|
241
|
-
return ((
|
|
225
|
+
function je() {
|
|
226
|
+
var l, i;
|
|
227
|
+
const e = t == null ? void 0 : t.appContext.config.globalProperties.$router;
|
|
228
|
+
return ((i = (l = e == null ? void 0 : e.currentRoute) == null ? void 0 : l.value) == null ? void 0 : i.path) ?? null;
|
|
242
229
|
}
|
|
243
|
-
function
|
|
244
|
-
if (!
|
|
245
|
-
|
|
230
|
+
function He() {
|
|
231
|
+
if (!F()) {
|
|
232
|
+
S.value = null;
|
|
246
233
|
return;
|
|
247
234
|
}
|
|
248
|
-
|
|
235
|
+
S.value = je();
|
|
249
236
|
}
|
|
250
|
-
function
|
|
251
|
-
a == null || a(), a = void 0,
|
|
237
|
+
function ee() {
|
|
238
|
+
a == null || a(), a = void 0, v.value = !1, S.value = null;
|
|
252
239
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const r = me(l);
|
|
258
|
-
(f.value == null || r > f.value) && (f.value = r), ve(L, r);
|
|
259
|
-
}
|
|
260
|
-
if (!A()) return;
|
|
261
|
-
const n = l == null ? void 0 : l.parentElement;
|
|
262
|
-
!n || n === document.body || h.value || (Do(n), h.value = n);
|
|
263
|
-
}
|
|
264
|
-
function _() {
|
|
265
|
-
h.value && (Fo(h.value), h.value = null);
|
|
266
|
-
}
|
|
267
|
-
function ne() {
|
|
268
|
-
var n;
|
|
269
|
-
const e = o == null ? void 0 : o.uid;
|
|
270
|
-
e == null || !(t(g) || (n = m.value) != null && n.visible) || !A() || (b.value = !0, a == null || a(), a = fe(e), Q(e), _());
|
|
240
|
+
function oe() {
|
|
241
|
+
var i;
|
|
242
|
+
const e = t == null ? void 0 : t.uid;
|
|
243
|
+
e == null || !(o(b) || (i = m.value) != null && i.visible) || !F() || (v.value = !0, a == null || a(), a = ue(e), Z(e));
|
|
271
244
|
}
|
|
272
|
-
function
|
|
273
|
-
var
|
|
274
|
-
const e =
|
|
275
|
-
e == null || !
|
|
245
|
+
function te() {
|
|
246
|
+
var i;
|
|
247
|
+
const e = t == null ? void 0 : t.uid;
|
|
248
|
+
e == null || !v.value || (a == null || a(), a = void 0, v.value = !1, !!!(o(b) || (i = m.value) != null && i.visible)) || (So(e), pe({ uid: e, close: () => r.onClosed() }), L(() => N(e)));
|
|
276
249
|
}
|
|
277
|
-
return
|
|
278
|
-
const e =
|
|
279
|
-
|
|
250
|
+
return Xe(() => {
|
|
251
|
+
const e = j(p, ["onVisibleChange", "onClosed", "onOk"]);
|
|
252
|
+
r.mount(
|
|
280
253
|
{
|
|
281
254
|
...e,
|
|
282
255
|
onClosed: e.onClosed || p.onCancel || p.onClose
|
|
283
256
|
},
|
|
284
|
-
|
|
257
|
+
k
|
|
285
258
|
);
|
|
286
|
-
const l =
|
|
287
|
-
l != null && l.afterEach && (
|
|
288
|
-
var
|
|
289
|
-
if (!(
|
|
290
|
-
const
|
|
291
|
-
|
|
259
|
+
const l = t == null ? void 0 : t.appContext.config.globalProperties.$router;
|
|
260
|
+
l != null && l.afterEach && (y = l.afterEach((i, s) => {
|
|
261
|
+
var O;
|
|
262
|
+
if (!(i != null && i.path) || i.path === (s == null ? void 0 : s.path) || !F() || !!!(o(b) || (O = m.value) != null && O.visible)) return;
|
|
263
|
+
const u = S.value;
|
|
264
|
+
u && (i.path !== u ? oe() : te());
|
|
292
265
|
}));
|
|
293
|
-
}),
|
|
294
|
-
|
|
295
|
-
}),
|
|
296
|
-
|
|
297
|
-
}),
|
|
298
|
-
|
|
299
|
-
}),
|
|
300
|
-
modalApi:
|
|
266
|
+
}), Ge(() => {
|
|
267
|
+
oe();
|
|
268
|
+
}), We(() => {
|
|
269
|
+
te();
|
|
270
|
+
}), eo(() => {
|
|
271
|
+
ee(), y == null || y(), y = void 0, A.value = void 0, t != null && t.uid && Z(t.uid);
|
|
272
|
+
}), fe({
|
|
273
|
+
modalApi: r
|
|
301
274
|
}), (e, l) => {
|
|
302
|
-
var
|
|
303
|
-
return
|
|
304
|
-
"aria-tt-id": `tt-id-${(
|
|
305
|
-
"data-testid":
|
|
275
|
+
var i;
|
|
276
|
+
return oo((lo(), to("div", {
|
|
277
|
+
"aria-tt-id": `tt-id-${(i = o(t)) == null ? void 0 : i.uid}`,
|
|
278
|
+
"data-testid": P.value
|
|
306
279
|
}, [
|
|
307
|
-
|
|
308
|
-
class: ["tt-ui-modal",
|
|
309
|
-
"before-close":
|
|
310
|
-
onClosed:
|
|
311
|
-
"close-icon": () =>
|
|
280
|
+
I(o(fo), re($.value, {
|
|
281
|
+
class: ["tt-ui-modal", o(ve)],
|
|
282
|
+
"before-close": o(r).onClosed,
|
|
283
|
+
onClosed: Ee,
|
|
284
|
+
"close-icon": () => so(o(no), {
|
|
312
285
|
size: 16,
|
|
313
|
-
icon:
|
|
286
|
+
icon: o($o),
|
|
314
287
|
isCustomSvg: !0
|
|
315
288
|
})
|
|
316
|
-
}),
|
|
289
|
+
}), E({
|
|
317
290
|
default: c(() => [
|
|
318
|
-
|
|
291
|
+
I(To, {
|
|
319
292
|
ref_key: "modalWrapperRef",
|
|
320
|
-
ref:
|
|
321
|
-
"is-bottom":
|
|
322
|
-
height:
|
|
323
|
-
loading:
|
|
324
|
-
"loading-tip":
|
|
325
|
-
contained:
|
|
326
|
-
class:
|
|
327
|
-
"data-testid":
|
|
328
|
-
onIsScroll:
|
|
293
|
+
ref: h,
|
|
294
|
+
"is-bottom": o(Q),
|
|
295
|
+
height: o(Ae),
|
|
296
|
+
loading: o(X),
|
|
297
|
+
"loading-tip": o($e),
|
|
298
|
+
contained: we.value,
|
|
299
|
+
class: io({ "pb-2!": !o(G) }),
|
|
300
|
+
"data-testid": Re.value,
|
|
301
|
+
onIsScroll: Le
|
|
329
302
|
}, {
|
|
330
303
|
default: c(() => [
|
|
331
|
-
|
|
304
|
+
g(e.$slots, "default")
|
|
332
305
|
]),
|
|
333
306
|
_: 3
|
|
334
307
|
}, 8, ["is-bottom", "height", "loading", "loading-tip", "contained", "class", "data-testid"])
|
|
@@ -338,63 +311,63 @@ const _o = ["aria-tt-id", "data-testid"], Ro = ["data-testid"], yt = /* @__PURE_
|
|
|
338
311
|
e.$slots.header ? {
|
|
339
312
|
name: "header",
|
|
340
313
|
fn: c(() => [
|
|
341
|
-
|
|
314
|
+
g(e.$slots, "header")
|
|
342
315
|
]),
|
|
343
316
|
key: "1"
|
|
344
317
|
} : {
|
|
345
318
|
name: "header",
|
|
346
319
|
fn: c(() => [
|
|
347
|
-
|
|
348
|
-
title:
|
|
349
|
-
onMousedown:
|
|
350
|
-
},
|
|
320
|
+
I(Co, {
|
|
321
|
+
title: o(K),
|
|
322
|
+
onMousedown: Ve
|
|
323
|
+
}, E({
|
|
351
324
|
titleToolbar: c(() => [
|
|
352
|
-
|
|
325
|
+
g(e.$slots, "titleToolbar")
|
|
353
326
|
]),
|
|
354
327
|
_: 2
|
|
355
328
|
}, [
|
|
356
|
-
|
|
357
|
-
name:
|
|
358
|
-
fn: c((
|
|
359
|
-
|
|
329
|
+
V(Object.keys(e.$slots), (s) => ({
|
|
330
|
+
name: s,
|
|
331
|
+
fn: c((n) => [
|
|
332
|
+
g(e.$slots, s, _(z(n || {})))
|
|
360
333
|
])
|
|
361
334
|
}))
|
|
362
335
|
]), 1032, ["title"])
|
|
363
336
|
]),
|
|
364
337
|
key: "0"
|
|
365
338
|
},
|
|
366
|
-
|
|
339
|
+
o(ge).footer || o(G) ? {
|
|
367
340
|
name: "footer",
|
|
368
341
|
fn: c(() => [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
342
|
+
g(e.$slots, "footer", {}, () => [
|
|
343
|
+
ro("div", { "data-testid": ze.value }, [
|
|
344
|
+
I(bo, re(xe.value, {
|
|
372
345
|
class: "footer",
|
|
373
|
-
style: { borderTop:
|
|
346
|
+
style: { borderTop: U.value ? "1px solid var(--tt-modal-footer-border-color)" : "none" },
|
|
374
347
|
"ok-button-props": {
|
|
375
|
-
...
|
|
376
|
-
disabledTip:
|
|
377
|
-
disabled:
|
|
348
|
+
...o(B),
|
|
349
|
+
disabledTip: W.value[1],
|
|
350
|
+
disabled: W.value[0]
|
|
378
351
|
},
|
|
379
|
-
onFooterok:
|
|
380
|
-
onCancel:
|
|
381
|
-
}),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
), (
|
|
385
|
-
name:
|
|
386
|
-
fn: c((
|
|
387
|
-
|
|
352
|
+
onFooterok: o(r).onOk,
|
|
353
|
+
onCancel: o(r).onClosed
|
|
354
|
+
}), E({ _: 2 }, [
|
|
355
|
+
V(Object.keys(
|
|
356
|
+
o(j)(e.$slots, ["beforeFooter", "insertFooter", "centerFooter", "appendFooter"])
|
|
357
|
+
), (s) => ({
|
|
358
|
+
name: s,
|
|
359
|
+
fn: c((n) => [
|
|
360
|
+
g(e.$slots, s, _(z({ ...n || {} })))
|
|
388
361
|
])
|
|
389
362
|
}))
|
|
390
363
|
]), 1040, ["style", "ok-button-props", "onFooterok", "onCancel"])
|
|
391
|
-
], 8,
|
|
364
|
+
], 8, Fo)
|
|
392
365
|
])
|
|
393
366
|
]),
|
|
394
367
|
key: "2"
|
|
395
368
|
} : void 0,
|
|
396
|
-
|
|
397
|
-
|
|
369
|
+
V(Object.keys(
|
|
370
|
+
o(ae)(e.$slots, [
|
|
398
371
|
"default",
|
|
399
372
|
"titleToolbar",
|
|
400
373
|
"header",
|
|
@@ -404,24 +377,24 @@ const _o = ["aria-tt-id", "data-testid"], Ro = ["data-testid"], yt = /* @__PURE_
|
|
|
404
377
|
"centerFooter",
|
|
405
378
|
"appendFooter"
|
|
406
379
|
])
|
|
407
|
-
), (
|
|
408
|
-
name:
|
|
409
|
-
fn: c((
|
|
410
|
-
|
|
380
|
+
), (s) => ({
|
|
381
|
+
name: s,
|
|
382
|
+
fn: c((n) => [
|
|
383
|
+
g(e.$slots, s, _(z(n || {})))
|
|
411
384
|
])
|
|
412
385
|
}))
|
|
413
386
|
]), 1040, ["class", "before-close", "close-icon"])
|
|
414
|
-
], 8,
|
|
415
|
-
[
|
|
416
|
-
draggable:
|
|
417
|
-
fullscreen:
|
|
418
|
-
resizer:
|
|
419
|
-
resizeChange:
|
|
387
|
+
], 8, Do)), [
|
|
388
|
+
[o(vo), {
|
|
389
|
+
draggable: o(ke),
|
|
390
|
+
fullscreen: o(Ce),
|
|
391
|
+
resizer: o(Te),
|
|
392
|
+
resizeChange: o(p).resizeChange
|
|
420
393
|
}]
|
|
421
394
|
]);
|
|
422
395
|
};
|
|
423
396
|
}
|
|
424
397
|
});
|
|
425
398
|
export {
|
|
426
|
-
|
|
399
|
+
ft as default
|
|
427
400
|
};
|
|
@@ -3,13 +3,6 @@ import { useZIndex } from 'element-plus';
|
|
|
3
3
|
export type ElementPlusZIndex = ReturnType<typeof useZIndex>;
|
|
4
4
|
/** 当前已打开弹窗里的最高层级 */
|
|
5
5
|
export declare function getOpenModalMaxZIndex(): number;
|
|
6
|
-
/**
|
|
7
|
-
* 把 element-plus 计数器抬到 target 之上。弹窗内的下拉、气泡仍由它发号,
|
|
8
|
-
* 且默认 Teleport 到 body 与遮罩同级,不同步就会落到弹窗下面。
|
|
9
|
-
* @param elementPlusZIndex 计数器句柄
|
|
10
|
-
* @param target 需要被压住的层级
|
|
11
|
-
*/
|
|
12
|
-
export declare function syncElementPlusZIndexAbove(elementPlusZIndex: ElementPlusZIndex, target: number): void;
|
|
13
6
|
/**
|
|
14
7
|
* 申请一个高于当前所有已打开弹窗的层级。
|
|
15
8
|
*
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { getOpenModalOverlays as
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { getOpenModalOverlays as r, readOverlayZIndex as x } from "./resolve-modal-target.js";
|
|
2
|
+
const a = 1, c = 2e3;
|
|
3
|
+
let o = 0;
|
|
4
|
+
function s() {
|
|
5
|
+
return r().reduce((n, e) => Math.max(n, x(e)), 0);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
d(), a += 1;
|
|
7
|
+
function I(n, e) {
|
|
8
|
+
const { currentZIndex: d, nextZIndex: l } = n;
|
|
9
|
+
let t = 0;
|
|
10
|
+
for (; d.value <= e && t < c; )
|
|
11
|
+
l(), t += 1;
|
|
13
12
|
}
|
|
14
13
|
function u(n) {
|
|
15
14
|
const e = Math.max(
|
|
16
15
|
n.nextZIndex(),
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
s() + a,
|
|
17
|
+
o + a
|
|
19
18
|
);
|
|
20
|
-
return
|
|
19
|
+
return o = e, I(n, e), e;
|
|
21
20
|
}
|
|
22
21
|
export {
|
|
23
22
|
u as allocateModalZIndex,
|
|
24
|
-
|
|
25
|
-
s as syncElementPlusZIndexAbove
|
|
23
|
+
s as getOpenModalMaxZIndex
|
|
26
24
|
};
|
|
@@ -5,19 +5,6 @@ export declare const MODAL_OVERLAY_CLASS = "tt-modal-overlay";
|
|
|
5
5
|
export declare function ensureContainedOverlayStyle(doc?: Document): void;
|
|
6
6
|
/** 用内联样式强制区域遮罩,压过 EP 的 position:fixed(含内部 overlay-dialog) */
|
|
7
7
|
export declare function applyContainedOverlayInline(uid: string | number, doc?: Document): void;
|
|
8
|
-
/**
|
|
9
|
-
* 打开/resume:保证区域遮罩能吃到点击。
|
|
10
|
-
* 同容器内页面兄弟 z-index 更高时会点穿;仅调 DOM 顺序不够,需抬遮罩层级。
|
|
11
|
-
*
|
|
12
|
-
* 不把 axios / v-loading 的 `.el-loading-mask` 算进兄弟层级:
|
|
13
|
-
* 编辑弹窗拉详情时 loading 会挂到同一 `#app`,若据此抬遮罩却未同步 EP,
|
|
14
|
-
* 弹窗内 PanelSelect / Select 下拉会掉到遮罩下面。
|
|
15
|
-
*/
|
|
16
|
-
export declare function ensureOverlayHitTarget(uid: string | number, doc?: Document): void;
|
|
17
|
-
/** 区域弹窗锁挂载容器滚动(不锁 body,侧栏/顶栏仍可操作) */
|
|
18
|
-
export declare function lockModalMountScroll(target: HTMLElement | null): void;
|
|
19
|
-
/** 关闭/切走时恢复挂载容器滚动 */
|
|
20
|
-
export declare function unlockModalMountScroll(target: HTMLElement | null): void;
|
|
21
8
|
/** KeepAlive / 切页:隐藏已 Teleport 出去的遮罩,避免挡其它页。找到并隐藏则 true */
|
|
22
9
|
export declare function suspendOverlayByUid(uid: string | number, doc?: Document): boolean;
|
|
23
10
|
/**
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { getClientDocument as
|
|
2
|
-
import { getOpenModalUids as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { getClientDocument as S, isSameMicroAppScope as _, resolveScanDocument as C } from "./modal-scope.js";
|
|
2
|
+
import { getOpenModalUids as O } from "./modal-stack.js";
|
|
3
|
+
const A = 48, m = 8, a = "tt-modal-overlay--contained", E = "tt-modal-overlay", y = "tt-modal-overlay-contained-style-v2";
|
|
4
|
+
function M(t = document) {
|
|
5
5
|
var r;
|
|
6
6
|
if (typeof t > "u") return;
|
|
7
7
|
const o = `
|
|
8
|
-
.el-overlay.${
|
|
9
|
-
.el-overlay.${
|
|
8
|
+
.el-overlay.${a},
|
|
9
|
+
.el-overlay.${a} .el-overlay-dialog {
|
|
10
10
|
position: absolute !important;
|
|
11
11
|
inset: 0 !important;
|
|
12
12
|
height: 100% !important;
|
|
13
13
|
}
|
|
14
|
-
.el-overlay.${
|
|
14
|
+
.el-overlay.${a} .el-overlay-dialog {
|
|
15
15
|
overflow: auto !important;
|
|
16
16
|
}
|
|
17
|
-
.el-overlay.${
|
|
17
|
+
.el-overlay.${a} .tt-ui-modal.el-dialog {
|
|
18
18
|
--tt-modal-contained-top: 40px;
|
|
19
19
|
--tt-modal-contained-bottom: 24px;
|
|
20
20
|
margin-top: var(--tt-modal-contained-top) !important;
|
|
@@ -24,197 +24,164 @@ function I(t = document) {
|
|
|
24
24
|
flex-direction: column !important;
|
|
25
25
|
overflow: hidden !important;
|
|
26
26
|
}
|
|
27
|
-
.el-overlay.${
|
|
28
|
-
.el-overlay.${
|
|
27
|
+
.el-overlay.${a} .tt-ui-modal.el-dialog .el-dialog__header,
|
|
28
|
+
.el-overlay.${a} .tt-ui-modal.el-dialog .el-dialog__footer {
|
|
29
29
|
flex-shrink: 0;
|
|
30
30
|
}
|
|
31
|
-
.el-overlay.${
|
|
31
|
+
.el-overlay.${a} .tt-ui-modal.el-dialog .el-dialog__body {
|
|
32
32
|
display: flex !important;
|
|
33
33
|
flex: 1 1 auto !important;
|
|
34
34
|
flex-direction: column !important;
|
|
35
35
|
min-height: 0 !important;
|
|
36
36
|
overflow: hidden !important;
|
|
37
37
|
}
|
|
38
|
-
.el-overlay.${
|
|
38
|
+
.el-overlay.${a} .tt-ui-modal.el-dialog .tt-modal-wrapper {
|
|
39
39
|
flex: 1 1 auto !important;
|
|
40
40
|
min-height: 0 !important;
|
|
41
41
|
max-height: none !important;
|
|
42
42
|
overflow: auto !important;
|
|
43
43
|
}
|
|
44
44
|
`.trim();
|
|
45
|
-
let e = t.getElementById(
|
|
45
|
+
let e = t.getElementById(y);
|
|
46
46
|
if (e) {
|
|
47
47
|
e.textContent = o;
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
(r = t.getElementById("tt-modal-overlay-contained-style")) == null || r.remove(), e = t.createElement("style"), e.id =
|
|
50
|
+
(r = t.getElementById("tt-modal-overlay-contained-style")) == null || r.remove(), e = t.createElement("style"), e.id = y, e.textContent = o;
|
|
51
51
|
const n = t.head || t.documentElement;
|
|
52
52
|
n == null || n.appendChild(e);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function f(t) {
|
|
55
55
|
t.style.setProperty("position", "absolute", "important"), t.style.setProperty("top", "0", "important"), t.style.setProperty("right", "0", "important"), t.style.setProperty("bottom", "0", "important"), t.style.setProperty("left", "0", "important"), t.style.setProperty("height", "100%", "important");
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function v(t) {
|
|
58
58
|
["position", "top", "right", "bottom", "left", "height"].forEach((o) => t.style.removeProperty(o));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function w(t, o = document) {
|
|
61
61
|
const e = o.querySelector(`.el-overlay.tt-id-${t}`);
|
|
62
62
|
if (!e) return;
|
|
63
63
|
const n = e.querySelector(".el-overlay-dialog"), r = !!e.closest("micro-app-body");
|
|
64
|
-
if (!e.classList.contains(
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
g(e), n && g(n), O(t, o);
|
|
69
|
-
}
|
|
70
|
-
const d = "data-tt-modal-scroll-lock";
|
|
71
|
-
function O(t, o = document) {
|
|
72
|
-
var s;
|
|
73
|
-
const e = o.querySelector(`.el-overlay.tt-id-${t}`);
|
|
74
|
-
if (!(e != null && e.parentElement)) return;
|
|
75
|
-
e.style.setProperty("pointer-events", "auto"), (s = e.querySelector(".el-overlay-dialog")) == null || s.style.setProperty("pointer-events", "auto");
|
|
76
|
-
const n = e.parentElement;
|
|
77
|
-
let r = 0;
|
|
78
|
-
for (const l of Array.from(n.children)) {
|
|
79
|
-
if (l === e || !(l instanceof HTMLElement) || l.classList.contains(A) || l.classList.contains("el-loading-mask")) continue;
|
|
80
|
-
const a = Number.parseInt(l.style.zIndex || getComputedStyle(l).zIndex || "0", 10);
|
|
81
|
-
Number.isNaN(a) || (r = Math.max(r, a));
|
|
82
|
-
}
|
|
83
|
-
const i = m(e);
|
|
84
|
-
r >= i && (e.style.zIndex = String(r + 1)), n.lastElementChild !== e && n.appendChild(e);
|
|
85
|
-
}
|
|
86
|
-
function D(t) {
|
|
87
|
-
if (!t) return;
|
|
88
|
-
const o = Number(t.getAttribute(d) || "0");
|
|
89
|
-
o === 0 && (t.dataset.ttModalPrevOverflow = t.style.overflow || "", t.style.overflow = "hidden"), t.setAttribute(d, String(o + 1));
|
|
90
|
-
}
|
|
91
|
-
function k(t) {
|
|
92
|
-
if (!t) return;
|
|
93
|
-
const o = Number(t.getAttribute(d) || "0");
|
|
94
|
-
if (o <= 1) {
|
|
95
|
-
t.style.overflow = t.dataset.ttModalPrevOverflow || "", delete t.dataset.ttModalPrevOverflow, t.removeAttribute(d);
|
|
64
|
+
if (!e.classList.contains(a) && !r) {
|
|
65
|
+
v(e), n && v(n);
|
|
96
66
|
return;
|
|
97
67
|
}
|
|
98
|
-
|
|
68
|
+
f(e), n && f(n);
|
|
99
69
|
}
|
|
100
|
-
function
|
|
70
|
+
function g(t, o = document) {
|
|
101
71
|
const e = o.querySelector(`.el-overlay.tt-id-${t}`);
|
|
102
72
|
return e ? (e.dataset.ttModalSuspended = "1", e.style.setProperty("display", "none", "important"), !0) : !1;
|
|
103
73
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
74
|
+
function B(t, o = document, e = 3e3) {
|
|
75
|
+
if (g(t, o)) return () => {
|
|
106
76
|
};
|
|
107
77
|
const n = o.body || o.documentElement;
|
|
108
78
|
if (!n) return () => {
|
|
109
79
|
};
|
|
110
80
|
let r = !1;
|
|
111
81
|
const i = () => {
|
|
112
|
-
r || (r = !0, s.disconnect(), clearTimeout(
|
|
82
|
+
r || (r = !0, s.disconnect(), clearTimeout(c));
|
|
113
83
|
}, s = new MutationObserver(() => {
|
|
114
|
-
|
|
84
|
+
g(t, o) && i();
|
|
115
85
|
});
|
|
116
86
|
s.observe(n, { childList: !0, subtree: !0 });
|
|
117
|
-
const
|
|
87
|
+
const c = window.setTimeout(i, e);
|
|
118
88
|
return i;
|
|
119
89
|
}
|
|
120
|
-
function
|
|
90
|
+
function D(t, o = document) {
|
|
121
91
|
const e = o.querySelector(`.el-overlay.tt-id-${t}`);
|
|
122
|
-
!e || e.dataset.ttModalSuspended !== "1" || (delete e.dataset.ttModalSuspended, e.style.removeProperty("display"),
|
|
92
|
+
!e || e.dataset.ttModalSuspended !== "1" || (delete e.dataset.ttModalSuspended, e.style.removeProperty("display"), w(t, o));
|
|
123
93
|
}
|
|
124
|
-
function
|
|
94
|
+
function h(t) {
|
|
125
95
|
const o = t.style.zIndex || getComputedStyle(t).zIndex, e = Number.parseInt(o, 10);
|
|
126
96
|
return Number.isNaN(e) ? 0 : e;
|
|
127
97
|
}
|
|
128
|
-
function
|
|
129
|
-
const o = t ??
|
|
130
|
-
return o ? Array.from(
|
|
98
|
+
function I(t) {
|
|
99
|
+
const o = t ?? S();
|
|
100
|
+
return o ? Array.from(C(o).querySelectorAll(`.${E}`)).filter(
|
|
131
101
|
(e) => e.isConnected && e.dataset.ttModalSuspended !== "1" && e.style.display !== "none"
|
|
132
102
|
) : [];
|
|
133
103
|
}
|
|
134
|
-
function
|
|
135
|
-
const n =
|
|
104
|
+
function H(t, o, e) {
|
|
105
|
+
const n = S(), r = o ?? (n == null ? void 0 : n.body);
|
|
136
106
|
if (!n || !r) return null;
|
|
137
|
-
const i =
|
|
138
|
-
if (t != null &&
|
|
139
|
-
const u =
|
|
140
|
-
return !!u &&
|
|
107
|
+
const i = O().map((l) => `tt-id-${l}`), s = I(n).filter((l) => {
|
|
108
|
+
if (t != null && l.classList.contains(`tt-id-${t}`) || !i.some((b) => l.classList.contains(b))) return !1;
|
|
109
|
+
const u = l.parentElement;
|
|
110
|
+
return !!u && _(u, r);
|
|
141
111
|
});
|
|
142
|
-
return s.length === 0 ? null : s.reduce((
|
|
112
|
+
return s.length === 0 ? null : s.reduce((l, u) => h(u) >= h(l) ? u : l).parentElement;
|
|
143
113
|
}
|
|
144
|
-
function
|
|
114
|
+
function P(t) {
|
|
145
115
|
return t.isConnected ? t.getClientRects().length > 0 : !1;
|
|
146
116
|
}
|
|
147
117
|
function T(t) {
|
|
148
|
-
return t.isConnected ? (t.clientHeight || t.getBoundingClientRect().height) >=
|
|
118
|
+
return t.isConnected ? (t.clientHeight || t.getBoundingClientRect().height) >= A : !1;
|
|
149
119
|
}
|
|
150
|
-
function
|
|
120
|
+
function x(t) {
|
|
151
121
|
const o = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
152
122
|
if (o === 0) return !0;
|
|
153
123
|
const e = t.getBoundingClientRect();
|
|
154
|
-
return e.height > o +
|
|
124
|
+
return e.height > o + m ? !1 : e.top >= -m;
|
|
155
125
|
}
|
|
156
|
-
function
|
|
126
|
+
function p(t) {
|
|
157
127
|
return !!t.closest("micro-app-body");
|
|
158
128
|
}
|
|
159
|
-
function
|
|
160
|
-
return !t || !t.isConnected || o && !T(t) || o && !
|
|
129
|
+
function d(t, o = !0) {
|
|
130
|
+
return !t || !t.isConnected || o && !T(t) || o && !P(t) ? null : t;
|
|
161
131
|
}
|
|
162
|
-
function
|
|
132
|
+
function N(t) {
|
|
163
133
|
getComputedStyle(t).position === "static" && (t.style.position = "relative");
|
|
164
134
|
}
|
|
165
|
-
function
|
|
135
|
+
function R() {
|
|
166
136
|
const t = window.__MICRO_APP_NAME__;
|
|
167
137
|
if (t) {
|
|
168
|
-
const i = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t, s = document.querySelector(`micro-app[name="${i}"] micro-app-body #app`),
|
|
169
|
-
if (
|
|
138
|
+
const i = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t, s = document.querySelector(`micro-app[name="${i}"] micro-app-body #app`), c = d(s, !1);
|
|
139
|
+
if (c) return c;
|
|
170
140
|
}
|
|
171
141
|
const o = document.querySelector("#app");
|
|
172
142
|
if (o) {
|
|
173
|
-
const i =
|
|
143
|
+
const i = d(o, !1);
|
|
174
144
|
return i || o;
|
|
175
145
|
}
|
|
176
146
|
const e = document.querySelector("micro-app-body #app");
|
|
177
147
|
if (e) {
|
|
178
|
-
const i =
|
|
148
|
+
const i = d(e, !1);
|
|
179
149
|
if (i) return i;
|
|
180
150
|
}
|
|
181
151
|
const n = document.body;
|
|
182
|
-
return n && (n.tagName === "MICRO-APP-BODY" ||
|
|
152
|
+
return n && (n.tagName === "MICRO-APP-BODY" || p(n)) ? n : document.querySelector("micro-app-body");
|
|
183
153
|
}
|
|
184
|
-
function
|
|
154
|
+
function $() {
|
|
185
155
|
const t = document.querySelector("#app-content");
|
|
186
|
-
if (t && !
|
|
187
|
-
const e =
|
|
156
|
+
if (t && !p(t)) {
|
|
157
|
+
const e = d(t, !0);
|
|
188
158
|
if (e) return e;
|
|
189
159
|
}
|
|
190
160
|
const o = document.querySelectorAll("#app");
|
|
191
161
|
for (const e of Array.from(o)) {
|
|
192
162
|
const n = e;
|
|
193
|
-
if (
|
|
194
|
-
const r =
|
|
163
|
+
if (p(n)) continue;
|
|
164
|
+
const r = d(n, !0);
|
|
195
165
|
if (r) return r;
|
|
196
166
|
}
|
|
197
167
|
return null;
|
|
198
168
|
}
|
|
199
|
-
function
|
|
169
|
+
function V() {
|
|
200
170
|
if (typeof document > "u") return null;
|
|
201
|
-
|
|
202
|
-
const t = window.__MICRO_APP_ENVIRONMENT__ ?
|
|
203
|
-
return !t || !
|
|
171
|
+
M();
|
|
172
|
+
const t = window.__MICRO_APP_ENVIRONMENT__ ? R() : $();
|
|
173
|
+
return !t || !x(t) ? null : (N(t), t);
|
|
204
174
|
}
|
|
205
175
|
export {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
S as suspendOverlayByUid,
|
|
218
|
-
k as unlockModalMountScroll,
|
|
219
|
-
z as watchOverlayThenSuspend
|
|
176
|
+
E as MODAL_OVERLAY_CLASS,
|
|
177
|
+
a as MODAL_OVERLAY_CONTAINED_CLASS,
|
|
178
|
+
w as applyContainedOverlayInline,
|
|
179
|
+
M as ensureContainedOverlayStyle,
|
|
180
|
+
H as findTopOpenModalOverlayHost,
|
|
181
|
+
I as getOpenModalOverlays,
|
|
182
|
+
h as readOverlayZIndex,
|
|
183
|
+
V as resolveModalTarget,
|
|
184
|
+
D as resumeOverlayByUid,
|
|
185
|
+
g as suspendOverlayByUid,
|
|
186
|
+
B as watchOverlayThenSuspend
|
|
220
187
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"vue-router": "^5.0.2",
|
|
70
70
|
"vxe-pc-ui": "^4.14.15",
|
|
71
71
|
"vxe-table": "^4.18.13",
|
|
72
|
-
"@dazhicheng/hooks": "1.4.
|
|
73
|
-
"@dazhicheng/utils": "1.3.
|
|
72
|
+
"@dazhicheng/hooks": "1.4.59",
|
|
73
|
+
"@dazhicheng/utils": "1.3.56"
|
|
74
74
|
},
|
|
75
75
|
"files": [
|
|
76
76
|
"dist"
|