@dazhicheng/ui 1.6.45 → 1.6.46
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-keep-alive/index.js +54 -54
- package/dist/components/tt-modal/src/RenderModal.vue.js +211 -204
- package/dist/components/tt-modal/src/hooks/useModalRender.js +85 -84
- package/dist/components/tt-modal/src/index.js +26 -13
- package/dist/components/tt-modal/src/utils/modal-scope.d.ts +5 -4
- package/dist/components/tt-modal/src/utils/modal-scope.js +13 -10
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isArray as z, isString as L, invokeArrayFns as I } from "../../node_modules/.pnpm/@vue_shared@3.5.34/node_modules/@vue/shared/dist/shared.esm-bundler.js";
|
|
2
|
-
import { getCurrentInstance as P, watch as
|
|
2
|
+
import { getCurrentInstance as P, watch as b, onMounted as W, onUpdated as j, onBeforeUnmount as G, isVNode as J, cloneVNode as O, setTransitionHooks as Q } from "vue";
|
|
3
3
|
import { isAsyncWrapper as X } from "./core/apiAsyncComponent.js";
|
|
4
4
|
import { getComponentName as w } from "./core/component.js";
|
|
5
|
-
import { MoveType as H, queuePostRenderEffect as
|
|
5
|
+
import { MoveType as H, queuePostRenderEffect as A } from "./core/renderer.js";
|
|
6
6
|
import { isSuspense as Y } from "./core/Suspense.js";
|
|
7
7
|
import { invokeVNodeHook as M } from "./core/vnode.js";
|
|
8
8
|
const Z = {
|
|
@@ -18,20 +18,20 @@ const Z = {
|
|
|
18
18
|
includeKey: [String, RegExp, Array],
|
|
19
19
|
excludeKey: [String, RegExp, Array]
|
|
20
20
|
},
|
|
21
|
-
setup(o, { slots: r, expose:
|
|
22
|
-
const d = P(),
|
|
23
|
-
let
|
|
21
|
+
setup(o, { slots: r, expose: h }) {
|
|
22
|
+
const d = P(), x = d.ctx, c = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Set();
|
|
23
|
+
let a = null;
|
|
24
24
|
const f = d.suspense, {
|
|
25
25
|
renderer: {
|
|
26
26
|
p: U,
|
|
27
|
-
m:
|
|
27
|
+
m: C,
|
|
28
28
|
um: B,
|
|
29
29
|
o: { createElement: D }
|
|
30
30
|
}
|
|
31
|
-
} =
|
|
32
|
-
|
|
31
|
+
} = x, q = D("div");
|
|
32
|
+
x.activate = (e, n, t, i, u) => {
|
|
33
33
|
const s = e.component;
|
|
34
|
-
|
|
34
|
+
C(e, n, t, H.ENTER, f), U(
|
|
35
35
|
s.vnode,
|
|
36
36
|
e,
|
|
37
37
|
n,
|
|
@@ -40,100 +40,100 @@ const Z = {
|
|
|
40
40
|
f,
|
|
41
41
|
i,
|
|
42
42
|
e.slotScopeIds,
|
|
43
|
-
|
|
44
|
-
),
|
|
43
|
+
u
|
|
44
|
+
), A(() => {
|
|
45
45
|
s.isDeactivated = !1, s.a && I(s.a);
|
|
46
46
|
const g = e.props && e.props.onVnodeMounted;
|
|
47
47
|
g && M(g, s.parent, e);
|
|
48
48
|
}, f);
|
|
49
|
-
},
|
|
49
|
+
}, x.deactivate = (e) => {
|
|
50
50
|
const n = e.component;
|
|
51
|
-
|
|
51
|
+
C(e, q, null, H.LEAVE, f), A(() => {
|
|
52
52
|
n.da && I(n.da);
|
|
53
53
|
const t = e.props && e.props.onVnodeUnmounted;
|
|
54
54
|
t && M(t, n.parent, e), n.isDeactivated = !0;
|
|
55
55
|
}, f);
|
|
56
56
|
};
|
|
57
|
-
function
|
|
58
|
-
|
|
57
|
+
function F(e) {
|
|
58
|
+
S(e), B(e, d, f, !0);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
60
|
+
function K(e) {
|
|
61
|
+
c.forEach((n, t) => {
|
|
62
62
|
const i = w(n.type);
|
|
63
63
|
i && (!e || !e(i)) && m(t);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function N(e) {
|
|
67
|
+
c.forEach((n, t) => {
|
|
68
68
|
(!e || !e(t)) && m(t);
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
function m(e) {
|
|
72
|
-
const n =
|
|
73
|
-
!
|
|
72
|
+
const n = c.get(e);
|
|
73
|
+
n && (!a || n.type !== a.type || n.key !== a.key) ? F(n) : a && S(a), c.delete(e), p.delete(e);
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
h({ remove: (e) => {
|
|
76
|
+
c.has(e) && m(e);
|
|
77
77
|
}, clear: () => {
|
|
78
|
-
|
|
79
|
-
} }),
|
|
78
|
+
c.forEach((e, n) => m(n));
|
|
79
|
+
} }), b(
|
|
80
80
|
() => [o.include, o.exclude],
|
|
81
81
|
([e, n]) => {
|
|
82
|
-
e &&
|
|
82
|
+
e && K((t) => l(e, t)), n && K((t) => !l(n, t));
|
|
83
83
|
},
|
|
84
84
|
// prune post-render after `current` has been updated
|
|
85
85
|
{ flush: "post", deep: !0 }
|
|
86
|
-
),
|
|
86
|
+
), b(
|
|
87
87
|
() => [o.includeKey, o.excludeKey],
|
|
88
88
|
([e, n]) => {
|
|
89
|
-
e &&
|
|
89
|
+
e && N((t) => typeof t == "string" && l(e, t)), n && N((t) => typeof t != "string" || !l(n, t));
|
|
90
90
|
},
|
|
91
91
|
// prune post-render after `current` has been updated
|
|
92
92
|
{ flush: "post", deep: !0 }
|
|
93
93
|
);
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
-
|
|
94
|
+
let y = null;
|
|
95
|
+
const k = () => {
|
|
96
|
+
y != null && c.set(y, v(d.subTree));
|
|
97
97
|
};
|
|
98
|
-
return W(
|
|
99
|
-
|
|
100
|
-
const { subTree: n, suspense: t } = d, i =
|
|
101
|
-
if (e.type === i.type) {
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
98
|
+
return W(k), j(k), G(() => {
|
|
99
|
+
c.forEach((e) => {
|
|
100
|
+
const { subTree: n, suspense: t } = d, i = v(n);
|
|
101
|
+
if (e.type === i.type && e.key === i.key) {
|
|
102
|
+
S(i);
|
|
103
|
+
const u = i.component.da;
|
|
104
|
+
u && A(u, t);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
F(e);
|
|
108
108
|
});
|
|
109
109
|
}), () => {
|
|
110
|
-
if (
|
|
110
|
+
if (y = null, !r.default) return null;
|
|
111
111
|
const e = r.default(), n = e[0];
|
|
112
112
|
if (e.length > 1)
|
|
113
|
-
return
|
|
113
|
+
return a = null, e;
|
|
114
114
|
if (!J(n) || !(n.shapeFlag & 4) && !(n.shapeFlag & 128))
|
|
115
|
-
return
|
|
116
|
-
let t =
|
|
117
|
-
const i = t.type,
|
|
115
|
+
return a = null, n;
|
|
116
|
+
let t = v(n);
|
|
117
|
+
const i = t.type, u = w(
|
|
118
118
|
X(t) ? t.type.__asyncResolved || {} : i
|
|
119
|
-
), s = t.key == null ? i : t.key, { include: g, exclude:
|
|
120
|
-
if (g && (!
|
|
121
|
-
return
|
|
122
|
-
const
|
|
123
|
-
return t.el && (t = O(t), n.shapeFlag & 128 && (n.ssContent = t)),
|
|
119
|
+
), s = t.key == null ? i : t.key, { include: g, exclude: V, includeKey: R, excludeKey: T, max: _ } = o;
|
|
120
|
+
if (g && (!u || !l(g, u)) || V && u && l(V, u) || R && (typeof s != "string" || !l(R, s)) || T && typeof s == "string" && l(T, s))
|
|
121
|
+
return a = t, n;
|
|
122
|
+
const E = c.get(s);
|
|
123
|
+
return t.el && (t = O(t), n.shapeFlag & 128 && (n.ssContent = t)), y = s, E ? (t.el = E.el, t.component = E.component, t.transition && Q(t, t.transition), t.shapeFlag |= 512, p.delete(s), p.add(s)) : (p.add(s), _ && p.size > Number.parseInt(_, 10) && m(p.values().next().value)), t.shapeFlag |= 256, a = t, Y(n.type) ? n : t;
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, ae = Z;
|
|
127
127
|
function l(o, r) {
|
|
128
|
-
return z(o) ? o.some((
|
|
128
|
+
return z(o) ? o.some((h) => l(h, r)) : L(o) ? o.split(",").includes(r) : o.test ? (o.lastIndex = 0, o.test(r)) : !1;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function S(o) {
|
|
131
131
|
let r = o.shapeFlag;
|
|
132
132
|
r & 256 && (r -= 256), r & 512 && (r -= 512), o.shapeFlag = r;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function v(o) {
|
|
135
135
|
return o.shapeFlag & 128 ? o.ssContent : o;
|
|
136
136
|
}
|
|
137
137
|
export {
|
|
138
|
-
|
|
138
|
+
ae as TtKeepAlive
|
|
139
139
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TtIcon as
|
|
1
|
+
import { defineComponent as Ye, inject as Ge, ref as k, useAttrs as Je, useSlots as Qe, getCurrentInstance as Xe, computed as m, unref as o, watch as j, reactive as We, nextTick as F, provide as eo, onMounted as oo, onDeactivated as to, onActivated as io, onUnmounted as lo, withDirectives as so, createElementBlock as no, openBlock as ro, createVNode as $, mergeProps as ue, h as ao, createSlots as H, withCtx as f, normalizeClass as uo, renderSlot as C, renderList as N, normalizeProps as Z, guardReactiveProps as q, createElementVNode as po } from "vue";
|
|
2
|
+
import { TtIcon as co } from "../../tt-icon/index.js";
|
|
3
3
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.34_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
4
|
-
import { useDesign as
|
|
5
|
-
import { usePriorityValues as
|
|
4
|
+
import { useDesign as fo } from "../../../packages/hooks/src/useDesign.js";
|
|
5
|
+
import { usePriorityValues as mo, getPriorityValues as vo } from "../../../packages/hooks/src/usePriorityValue.js";
|
|
6
6
|
import "axios";
|
|
7
|
-
import { dialogProps as
|
|
7
|
+
import { dialogProps as pe, useZIndex as go, ElDialog as bo } from "element-plus";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
|
-
import { generateTestId as
|
|
10
|
+
import { generateTestId as K, toKebabCase as Co } 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 ce, pick as U } 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 To from "../../../directives/dialog-resize/index.js";
|
|
22
|
+
import { useStore as ho } from "@tanstack/vue-store";
|
|
23
|
+
import ko from "./components/ModalFooter.vue.js";
|
|
24
|
+
import yo from "./components/ModalHeader.vue.js";
|
|
25
|
+
import Oo from "./components/ModalWrapper.vue.js";
|
|
26
|
+
import { basicProps as Bo } from "./props.js";
|
|
27
|
+
import { ModalApi as Po } from "./utils/modal-api.js";
|
|
28
|
+
import { resolveModalTarget as fe, MODAL_OVERLAY_CLASS as Io, MODAL_OVERLAY_CONTAINED_CLASS as Y, findTopOpenModalOverlayHost as So, ensureContainedOverlayStyle as Ao, applyContainedOverlayInline as G, watchOverlayThenSuspend as me, suspendOverlayByUid as Mo, resumeOverlayByUid as wo } from "./utils/resolve-modal-target.js";
|
|
29
|
+
import { allocateModalZIndex as Fo } from "./utils/modal-z-index.js";
|
|
30
|
+
import { MODAL_OWNER_ACTIVE_KEY as $o, getClientDocument as Do } from "./utils/modal-scope.js";
|
|
31
|
+
import { pushModal as ve, removeModal as J } from "./utils/modal-stack.js";
|
|
32
|
+
import { emitModalCloseTransitionEnd as Lo } from "./utils/modal-close-transition.js";
|
|
33
|
+
import xo from "../../../assets/svg/close.svg.js";
|
|
34
|
+
const Eo = ["aria-tt-id", "data-testid"], _o = ["data-testid"], Ct = /* @__PURE__ */ Ye({
|
|
35
35
|
name: "TtModal",
|
|
36
36
|
__name: "RenderModal",
|
|
37
37
|
props: {
|
|
38
|
-
...
|
|
39
|
-
...
|
|
38
|
+
...pe,
|
|
39
|
+
...Bo,
|
|
40
40
|
/** modalApi */
|
|
41
41
|
modalApi: {
|
|
42
42
|
type: Object,
|
|
@@ -44,9 +44,9 @@ const Do = ["aria-tt-id", "data-testid"], xo = ["data-testid"], vt = /* @__PURE_
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
emits: ["visible-change", "register", "update:visible"],
|
|
47
|
-
setup(
|
|
48
|
-
var
|
|
49
|
-
const d =
|
|
47
|
+
setup(ge, { expose: be, emit: Ce }) {
|
|
48
|
+
var ae;
|
|
49
|
+
const d = ge, v = Ge($o, void 0), D = Ce, y = k(), { prefixCls: Te } = fo("modal"), p = Je(), he = Qe(), t = Xe(), Q = k(!1), X = k(), L = k(), ke = go();
|
|
50
50
|
let r = d.modalApi;
|
|
51
51
|
if (!r) {
|
|
52
52
|
const e = d.okButtonProps ? {
|
|
@@ -56,260 +56,267 @@ const Do = ["aria-tt-id", "data-testid"], xo = ["data-testid"], vt = /* @__PURE_
|
|
|
56
56
|
...d,
|
|
57
57
|
okButtonProps: e
|
|
58
58
|
};
|
|
59
|
-
r = new
|
|
60
|
-
const l =
|
|
61
|
-
return
|
|
59
|
+
r = new Po(i), r.useStore = (s) => {
|
|
60
|
+
const l = s ?? ((n) => n);
|
|
61
|
+
return ho(r.store, l);
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
visible:
|
|
66
|
-
title:
|
|
67
|
-
width:
|
|
68
|
-
size:
|
|
69
|
-
fullscreen:
|
|
70
|
-
resizer:
|
|
71
|
-
top:
|
|
72
|
-
isBottom:
|
|
73
|
-
draggable:
|
|
74
|
-
showCancelBtn:
|
|
64
|
+
const g = (ae = r.useStore) == null ? void 0 : ae.call(r), {
|
|
65
|
+
visible: T,
|
|
66
|
+
title: W,
|
|
67
|
+
width: ee,
|
|
68
|
+
size: oe,
|
|
69
|
+
fullscreen: ye,
|
|
70
|
+
resizer: Oe,
|
|
71
|
+
top: Be,
|
|
72
|
+
isBottom: te,
|
|
73
|
+
draggable: Pe,
|
|
74
|
+
showCancelBtn: Ie,
|
|
75
75
|
okText: Se,
|
|
76
|
-
cancelText:
|
|
77
|
-
okButtonProps:
|
|
78
|
-
cancelButtonProps:
|
|
79
|
-
confirmLoading:
|
|
80
|
-
cancelLoading:
|
|
81
|
-
showOkBtn:
|
|
82
|
-
loading:
|
|
83
|
-
height:
|
|
84
|
-
showFooter:
|
|
85
|
-
loadingTip:
|
|
76
|
+
cancelText: Ae,
|
|
77
|
+
okButtonProps: A,
|
|
78
|
+
cancelButtonProps: Me,
|
|
79
|
+
confirmLoading: we,
|
|
80
|
+
cancelLoading: Fe,
|
|
81
|
+
showOkBtn: $e,
|
|
82
|
+
loading: ie,
|
|
83
|
+
height: De,
|
|
84
|
+
showFooter: le,
|
|
85
|
+
loadingTip: Le,
|
|
86
86
|
...xe
|
|
87
|
-
} =
|
|
87
|
+
} = mo(d, g), Ee = m(() => {
|
|
88
88
|
const e = {
|
|
89
89
|
mini: "448px",
|
|
90
90
|
small: "592px",
|
|
91
91
|
medium: "876px"
|
|
92
92
|
};
|
|
93
|
-
return o(
|
|
94
|
-
}),
|
|
95
|
-
var
|
|
96
|
-
const e =
|
|
97
|
-
...
|
|
93
|
+
return o(ee) ? o(ee) : e[o(oe)] ? e[o(oe)] : "500px";
|
|
94
|
+
}), x = m(() => {
|
|
95
|
+
var de;
|
|
96
|
+
const e = vo(xe), i = ce(p, ["onVisibleChange", "onClose", "onClosed", "onOk", "onReceiveSharedData"]), l = {
|
|
97
|
+
...U(e, Object.keys(pe)),
|
|
98
98
|
...i
|
|
99
|
-
},
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
const
|
|
99
|
+
}, n = l.appendToBody === !0 || l["append-to-body"] === !0 || l["append-to-body"] === "", u = l.appendTo && l.appendTo !== "body" ? l.appendTo : void 0, S = !n && !u, V = S ? L.value : void 0;
|
|
100
|
+
let h = null;
|
|
101
|
+
V ? h = V === ((de = Do()) == null ? void 0 : de.body) ? null : V : S && (h = fe());
|
|
102
|
+
const z = !!h, Ke = n || !u && !h, Ue = z || o(te) ? "40px" : "15vh";
|
|
103
103
|
return {
|
|
104
104
|
...l,
|
|
105
|
-
modelValue: o(
|
|
106
|
-
width: o(
|
|
105
|
+
modelValue: o(T),
|
|
106
|
+
width: o(Ee),
|
|
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: o(
|
|
113
|
+
top: o(Be) ?? Ue,
|
|
114
114
|
fullscreen: !1,
|
|
115
115
|
draggable: !1,
|
|
116
116
|
// 外部显式指定优先;否则用打开时申请到的层级,element-plus 自己的 nextZIndex 不参与决策
|
|
117
|
-
zIndex: l.zIndex ??
|
|
118
|
-
appendToBody:
|
|
119
|
-
...u ? { appendTo: u } :
|
|
117
|
+
zIndex: l.zIndex ?? X.value,
|
|
118
|
+
appendToBody: Ke,
|
|
119
|
+
...u ? { appendTo: u } : h ? { appendTo: h } : { appendTo: "body" },
|
|
120
120
|
// 区域遮罩不锁整页滚动,避免侧栏能点却滚不动
|
|
121
|
-
lockScroll:
|
|
121
|
+
lockScroll: z ? l.lockScroll ?? !1 : l.lockScroll ?? !0,
|
|
122
122
|
modalClass: [
|
|
123
123
|
l.modalClass || e.modalClass || "",
|
|
124
|
-
|
|
124
|
+
Io,
|
|
125
125
|
`tt-id-${t == null ? void 0 : t.uid}`,
|
|
126
|
-
|
|
126
|
+
z ? Y : ""
|
|
127
127
|
].filter(Boolean).join(" ")
|
|
128
128
|
};
|
|
129
|
-
}),
|
|
129
|
+
}), _e = m(() => {
|
|
130
130
|
var i;
|
|
131
|
-
return String(((i =
|
|
131
|
+
return String(((i = x.value) == null ? void 0 : i.modalClass) || "").includes(Y);
|
|
132
132
|
}), Re = m(() => ({
|
|
133
|
-
showCancelBtn: o(
|
|
133
|
+
showCancelBtn: o(Ie),
|
|
134
134
|
okText: o(Se),
|
|
135
|
-
cancelText: o(
|
|
136
|
-
okButtonProps: o(
|
|
137
|
-
cancelButtonProps: o(
|
|
138
|
-
confirmLoading: o(
|
|
139
|
-
cancelLoading: o(
|
|
140
|
-
showOkBtn: o(
|
|
141
|
-
})),
|
|
142
|
-
var
|
|
143
|
-
const e = (
|
|
135
|
+
cancelText: o(Ae),
|
|
136
|
+
okButtonProps: o(A),
|
|
137
|
+
cancelButtonProps: o(Me),
|
|
138
|
+
confirmLoading: o(we),
|
|
139
|
+
cancelLoading: o(Fe),
|
|
140
|
+
showOkBtn: o($e)
|
|
141
|
+
})), se = m(() => {
|
|
142
|
+
var n, u;
|
|
143
|
+
const e = (n = o(A)) == null ? void 0 : n.disabled, i = o(ie), s = (u = o(A)) == null ? void 0 : u.disabledTip, l = Array.isArray(s) ? s : s ? [s] : [];
|
|
144
144
|
return e || i ? [!0, l] : [!1, []];
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
j(
|
|
147
147
|
() => {
|
|
148
148
|
var e;
|
|
149
|
-
return (e =
|
|
149
|
+
return (e = g.value) == null ? void 0 : e.visible;
|
|
150
150
|
},
|
|
151
151
|
(e) => {
|
|
152
152
|
var i;
|
|
153
|
-
e && (
|
|
154
|
-
(t == null ? void 0 : t.uid) != null && (
|
|
155
|
-
(t == null ? void 0 : t.uid) != null && (
|
|
153
|
+
e && (L.value = So(t == null ? void 0 : t.uid, fe()) ?? void 0, X.value = Fo(ke)), e !== T.value && (D("visible-change", !!e), D("update:visible", !!e)), t && ((i = O.emitVisible) == null || i.call(O, !!e, t == null ? void 0 : t.uid)), t != null && t.uid && (e ? (qe(), (v == null ? void 0 : v.value) === !1 && w(), b.value || ve({ uid: t.uid, close: () => r.onClosed() }), Ao(), F(() => {
|
|
154
|
+
(t == null ? void 0 : t.uid) != null && (G(t.uid), b.value && (a == null || a(), a = me(t.uid)), requestAnimationFrame(() => {
|
|
155
|
+
(t == null ? void 0 : t.uid) != null && (G(t.uid), b.value && Mo(t.uid));
|
|
156
156
|
}));
|
|
157
|
-
})) : (
|
|
157
|
+
})) : (re(), J(t.uid))), e || r.changeOkLoading(!1);
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
immediate: !1
|
|
161
161
|
}
|
|
162
|
-
),
|
|
163
|
-
() => o(
|
|
162
|
+
), j(
|
|
163
|
+
() => o(T),
|
|
164
164
|
(e) => {
|
|
165
165
|
var i;
|
|
166
|
-
e !== ((i =
|
|
166
|
+
e !== ((i = g.value) == null ? void 0 : i.visible) && r.setState({ visible: e }), e || r.changeOkLoading(!1);
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
immediate: !1
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
function Ve(e) {
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
function _e() {
|
|
176
|
-
Fo(r);
|
|
173
|
+
Q.value = e;
|
|
177
174
|
}
|
|
178
175
|
function ze() {
|
|
176
|
+
Lo(r);
|
|
177
|
+
}
|
|
178
|
+
function je() {
|
|
179
179
|
document.querySelectorAll(".el-select__popper").forEach((i) => {
|
|
180
180
|
i.style.display !== "none" && (i.style.display = "none");
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function E(e) {
|
|
184
184
|
return e.toLowerCase().includes("modal") ? e : `modal-${e}`;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function He() {
|
|
187
187
|
const e = p["data-testid"] || p.dataTestid || p.testId || p["test-id"];
|
|
188
188
|
return e && typeof e == "string" ? e : void 0;
|
|
189
189
|
}
|
|
190
|
-
const
|
|
191
|
-
var
|
|
192
|
-
const e = (
|
|
190
|
+
const M = m(() => {
|
|
191
|
+
var n;
|
|
192
|
+
const e = (n = g.value) == null ? void 0 : n.testId;
|
|
193
193
|
if (e)
|
|
194
|
-
return
|
|
194
|
+
return E(e);
|
|
195
195
|
const i = d.testId;
|
|
196
196
|
if (i)
|
|
197
|
-
return
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
return
|
|
201
|
-
const l = o(
|
|
202
|
-
return l && typeof l == "string" && l.trim() ?
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
const
|
|
197
|
+
return E(i);
|
|
198
|
+
const s = He();
|
|
199
|
+
if (s)
|
|
200
|
+
return E(s);
|
|
201
|
+
const l = o(W);
|
|
202
|
+
return l && typeof l == "string" && l.trim() ? K("modal", Co(l)) : t != null && t.uid ? `modal-${t.uid}` : "modal";
|
|
203
|
+
}), Ne = m(() => K(M.value, "footer")), Ze = m(() => K(M.value, "body"));
|
|
204
|
+
eo("modalIdContext", M);
|
|
205
|
+
const O = We({
|
|
206
206
|
setModalProps: r.setState,
|
|
207
207
|
emitVisible: void 0,
|
|
208
208
|
redoModalHeight: () => {
|
|
209
|
-
|
|
210
|
-
o(
|
|
209
|
+
F(() => {
|
|
210
|
+
o(y) && o(y).setModalHeight();
|
|
211
211
|
});
|
|
212
212
|
},
|
|
213
213
|
scrollToBottom: () => {
|
|
214
214
|
var e;
|
|
215
|
-
o(
|
|
215
|
+
o(y) && ((e = o(y)) == null || e.onScrollBottom());
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
|
-
t &&
|
|
219
|
-
const
|
|
220
|
-
let a,
|
|
221
|
-
function
|
|
218
|
+
t && D("register", O, `${t == null ? void 0 : t.uid}`);
|
|
219
|
+
const b = k(!1), B = k(null);
|
|
220
|
+
let a, P, c, I = 0;
|
|
221
|
+
function _() {
|
|
222
222
|
var i;
|
|
223
|
-
return String(((i =
|
|
223
|
+
return String(((i = x.value) == null ? void 0 : i.modalClass) || "").includes(Y);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
var i,
|
|
225
|
+
function ne() {
|
|
226
|
+
var i, s;
|
|
227
227
|
const e = t == null ? void 0 : t.appContext.config.globalProperties.$router;
|
|
228
|
-
return ((
|
|
228
|
+
return ((s = (i = e == null ? void 0 : e.currentRoute) == null ? void 0 : i.value) == null ? void 0 : s.path) ?? null;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
if (!
|
|
232
|
-
|
|
230
|
+
function qe() {
|
|
231
|
+
if (!_()) {
|
|
232
|
+
B.value = null;
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
B.value = ne();
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
c !== void 0 && (window.cancelAnimationFrame(c), c = void 0),
|
|
237
|
+
function re() {
|
|
238
|
+
c !== void 0 && (window.cancelAnimationFrame(c), c = void 0), I += 1, a == null || a(), a = void 0, b.value = !1, B.value = null;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
var
|
|
240
|
+
function w() {
|
|
241
|
+
var s;
|
|
242
242
|
const e = t == null ? void 0 : t.uid;
|
|
243
|
-
e == null || !(o(
|
|
243
|
+
e == null || !(o(T) || (s = g.value) != null && s.visible) || !_() || (c !== void 0 && (window.cancelAnimationFrame(c), c = void 0), I += 1, b.value = !0, a == null || a(), a = me(e), J(e));
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function R() {
|
|
246
246
|
const e = t == null ? void 0 : t.uid;
|
|
247
|
-
if (e == null || !
|
|
248
|
-
const i = ++
|
|
249
|
-
|
|
250
|
-
i ===
|
|
251
|
-
var
|
|
252
|
-
if (c = void 0, i !==
|
|
253
|
-
const
|
|
254
|
-
!
|
|
247
|
+
if (e == null || !b.value || c !== void 0) return;
|
|
248
|
+
const i = ++I;
|
|
249
|
+
F(() => {
|
|
250
|
+
i === I && (c = window.requestAnimationFrame(() => {
|
|
251
|
+
var n;
|
|
252
|
+
if (c = void 0, i !== I) return;
|
|
253
|
+
const s = !!(o(T) || (n = g.value) != null && n.visible), l = B.value;
|
|
254
|
+
s && ((v ? !v.value : !l || ne() !== l) || (a == null || a(), a = void 0, b.value = !1, wo(e), ve({ uid: e, close: () => r.onClosed() }), F(() => G(e))));
|
|
255
255
|
}));
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
return
|
|
259
|
-
const e =
|
|
258
|
+
return oo(() => {
|
|
259
|
+
const e = U(p, ["onVisibleChange", "onClosed", "onOk"]);
|
|
260
260
|
r.mount(
|
|
261
261
|
{
|
|
262
262
|
...e,
|
|
263
263
|
onClosed: e.onClosed || p.onCancel || p.onClose
|
|
264
264
|
},
|
|
265
|
-
|
|
265
|
+
O
|
|
266
266
|
);
|
|
267
267
|
const i = t == null ? void 0 : t.appContext.config.globalProperties.$router;
|
|
268
|
-
i != null && i.afterEach
|
|
268
|
+
v || !(i != null && i.afterEach) || (P = i.afterEach((s, l) => {
|
|
269
269
|
var S;
|
|
270
|
-
if (!(
|
|
271
|
-
const u =
|
|
272
|
-
u && (
|
|
270
|
+
if (!(s != null && s.path) || s.path === (l == null ? void 0 : l.path) || !_() || !!!(o(T) || (S = g.value) != null && S.visible)) return;
|
|
271
|
+
const u = B.value;
|
|
272
|
+
u && (s.path !== u ? w() : R());
|
|
273
273
|
}));
|
|
274
|
-
}), eo(() => {
|
|
275
|
-
le();
|
|
276
|
-
}), oo(() => {
|
|
277
|
-
ne();
|
|
278
274
|
}), to(() => {
|
|
279
|
-
|
|
280
|
-
}),
|
|
275
|
+
w();
|
|
276
|
+
}), io(() => {
|
|
277
|
+
R();
|
|
278
|
+
}), j(
|
|
279
|
+
v ?? (() => {
|
|
280
|
+
}),
|
|
281
|
+
(e) => {
|
|
282
|
+
e === !1 ? w() : e && R();
|
|
283
|
+
},
|
|
284
|
+
{ flush: "post" }
|
|
285
|
+
), lo(() => {
|
|
286
|
+
re(), P == null || P(), P = void 0, L.value = void 0, t != null && t.uid && J(t.uid);
|
|
287
|
+
}), be({
|
|
281
288
|
modalApi: r
|
|
282
289
|
}), (e, i) => {
|
|
283
|
-
var
|
|
284
|
-
return
|
|
285
|
-
"aria-tt-id": `tt-id-${(
|
|
286
|
-
"data-testid":
|
|
290
|
+
var s;
|
|
291
|
+
return so((ro(), no("div", {
|
|
292
|
+
"aria-tt-id": `tt-id-${(s = o(t)) == null ? void 0 : s.uid}`,
|
|
293
|
+
"data-testid": M.value
|
|
287
294
|
}, [
|
|
288
|
-
|
|
289
|
-
class: ["tt-ui-modal", o(
|
|
295
|
+
$(o(bo), ue(x.value, {
|
|
296
|
+
class: ["tt-ui-modal", o(Te)],
|
|
290
297
|
"before-close": o(r).onClosed,
|
|
291
|
-
onClosed:
|
|
292
|
-
"close-icon": () =>
|
|
298
|
+
onClosed: ze,
|
|
299
|
+
"close-icon": () => ao(o(co), {
|
|
293
300
|
size: 16,
|
|
294
|
-
icon: o(
|
|
301
|
+
icon: o(xo),
|
|
295
302
|
isCustomSvg: !0
|
|
296
303
|
})
|
|
297
|
-
}),
|
|
304
|
+
}), H({
|
|
298
305
|
default: f(() => [
|
|
299
|
-
|
|
306
|
+
$(Oo, {
|
|
300
307
|
ref_key: "modalWrapperRef",
|
|
301
|
-
ref:
|
|
302
|
-
"is-bottom": o(
|
|
303
|
-
height: o(
|
|
304
|
-
loading: o(
|
|
305
|
-
"loading-tip": o(
|
|
306
|
-
contained:
|
|
307
|
-
class:
|
|
308
|
-
"data-testid":
|
|
308
|
+
ref: y,
|
|
309
|
+
"is-bottom": o(te),
|
|
310
|
+
height: o(De),
|
|
311
|
+
loading: o(ie),
|
|
312
|
+
"loading-tip": o(Le),
|
|
313
|
+
contained: _e.value,
|
|
314
|
+
class: uo({ "pb-2!": !o(le) }),
|
|
315
|
+
"data-testid": Ze.value,
|
|
309
316
|
onIsScroll: Ve
|
|
310
317
|
}, {
|
|
311
318
|
default: f(() => [
|
|
312
|
-
|
|
319
|
+
C(e.$slots, "default")
|
|
313
320
|
]),
|
|
314
321
|
_: 3
|
|
315
322
|
}, 8, ["is-bottom", "height", "loading", "loading-tip", "contained", "class", "data-testid"])
|
|
@@ -319,63 +326,63 @@ const Do = ["aria-tt-id", "data-testid"], xo = ["data-testid"], vt = /* @__PURE_
|
|
|
319
326
|
e.$slots.header ? {
|
|
320
327
|
name: "header",
|
|
321
328
|
fn: f(() => [
|
|
322
|
-
|
|
329
|
+
C(e.$slots, "header")
|
|
323
330
|
]),
|
|
324
331
|
key: "1"
|
|
325
332
|
} : {
|
|
326
333
|
name: "header",
|
|
327
334
|
fn: f(() => [
|
|
328
|
-
|
|
329
|
-
title: o(
|
|
330
|
-
onMousedown:
|
|
331
|
-
},
|
|
335
|
+
$(yo, {
|
|
336
|
+
title: o(W),
|
|
337
|
+
onMousedown: je
|
|
338
|
+
}, H({
|
|
332
339
|
titleToolbar: f(() => [
|
|
333
|
-
|
|
340
|
+
C(e.$slots, "titleToolbar")
|
|
334
341
|
]),
|
|
335
342
|
_: 2
|
|
336
343
|
}, [
|
|
337
|
-
|
|
344
|
+
N(Object.keys(e.$slots), (l) => ({
|
|
338
345
|
name: l,
|
|
339
|
-
fn: f((
|
|
340
|
-
|
|
346
|
+
fn: f((n) => [
|
|
347
|
+
C(e.$slots, l, Z(q(n || {})))
|
|
341
348
|
])
|
|
342
349
|
}))
|
|
343
350
|
]), 1032, ["title"])
|
|
344
351
|
]),
|
|
345
352
|
key: "0"
|
|
346
353
|
},
|
|
347
|
-
o(
|
|
354
|
+
o(he).footer || o(le) ? {
|
|
348
355
|
name: "footer",
|
|
349
356
|
fn: f(() => [
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
357
|
+
C(e.$slots, "footer", {}, () => [
|
|
358
|
+
po("div", { "data-testid": Ne.value }, [
|
|
359
|
+
$(ko, ue(Re.value, {
|
|
353
360
|
class: "footer",
|
|
354
|
-
style: { borderTop:
|
|
361
|
+
style: { borderTop: Q.value ? "1px solid var(--tt-modal-footer-border-color)" : "none" },
|
|
355
362
|
"ok-button-props": {
|
|
356
|
-
...o(
|
|
357
|
-
disabledTip:
|
|
358
|
-
disabled:
|
|
363
|
+
...o(A),
|
|
364
|
+
disabledTip: se.value[1],
|
|
365
|
+
disabled: se.value[0]
|
|
359
366
|
},
|
|
360
367
|
onFooterok: o(r).onOk,
|
|
361
368
|
onCancel: o(r).onClosed
|
|
362
|
-
}),
|
|
363
|
-
|
|
364
|
-
o(
|
|
369
|
+
}), H({ _: 2 }, [
|
|
370
|
+
N(Object.keys(
|
|
371
|
+
o(U)(e.$slots, ["beforeFooter", "insertFooter", "centerFooter", "appendFooter"])
|
|
365
372
|
), (l) => ({
|
|
366
373
|
name: l,
|
|
367
|
-
fn: f((
|
|
368
|
-
|
|
374
|
+
fn: f((n) => [
|
|
375
|
+
C(e.$slots, l, Z(q({ ...n || {} })))
|
|
369
376
|
])
|
|
370
377
|
}))
|
|
371
378
|
]), 1040, ["style", "ok-button-props", "onFooterok", "onCancel"])
|
|
372
|
-
], 8,
|
|
379
|
+
], 8, _o)
|
|
373
380
|
])
|
|
374
381
|
]),
|
|
375
382
|
key: "2"
|
|
376
383
|
} : void 0,
|
|
377
|
-
|
|
378
|
-
o(
|
|
384
|
+
N(Object.keys(
|
|
385
|
+
o(ce)(e.$slots, [
|
|
379
386
|
"default",
|
|
380
387
|
"titleToolbar",
|
|
381
388
|
"header",
|
|
@@ -387,16 +394,16 @@ const Do = ["aria-tt-id", "data-testid"], xo = ["data-testid"], vt = /* @__PURE_
|
|
|
387
394
|
])
|
|
388
395
|
), (l) => ({
|
|
389
396
|
name: l,
|
|
390
|
-
fn: f((
|
|
391
|
-
|
|
397
|
+
fn: f((n) => [
|
|
398
|
+
C(e.$slots, l, Z(q(n || {})))
|
|
392
399
|
])
|
|
393
400
|
}))
|
|
394
401
|
]), 1040, ["class", "before-close", "close-icon"])
|
|
395
|
-
], 8,
|
|
396
|
-
[o(
|
|
397
|
-
draggable: o(
|
|
398
|
-
fullscreen: o(
|
|
399
|
-
resizer: o(
|
|
402
|
+
], 8, Eo)), [
|
|
403
|
+
[o(To), {
|
|
404
|
+
draggable: o(Pe),
|
|
405
|
+
fullscreen: o(ye),
|
|
406
|
+
resizer: o(Oe),
|
|
400
407
|
resizeChange: o(p).resizeChange
|
|
401
408
|
}]
|
|
402
409
|
]);
|
|
@@ -404,5 +411,5 @@ const Do = ["aria-tt-id", "data-testid"], xo = ["data-testid"], vt = /* @__PURE_
|
|
|
404
411
|
}
|
|
405
412
|
});
|
|
406
413
|
export {
|
|
407
|
-
|
|
414
|
+
Ct as default
|
|
408
415
|
};
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import { reactive as
|
|
3
|
-
import { RouterView as
|
|
4
|
-
import
|
|
1
|
+
import { useStore as y } from "@tanstack/vue-store";
|
|
2
|
+
import { reactive as w, ref as E, defineComponent as A, provide as O, nextTick as T, h as f, inject as b, getCurrentScope as x, effectScope as g, onScopeDispose as R, render as v, onMounted as k } from "vue";
|
|
3
|
+
import { RouterView as L } from "vue-router";
|
|
4
|
+
import h from "../RenderModal.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { ModalApi as
|
|
7
|
-
import { onModalCloseTransitionEnd as
|
|
8
|
-
import { resolveModalTarget as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { ModalApi as S } from "../utils/modal-api.js";
|
|
7
|
+
import { onModalCloseTransitionEnd as P } from "../utils/modal-close-transition.js";
|
|
8
|
+
import { resolveModalTarget as V } from "../utils/resolve-modal-target.js";
|
|
9
|
+
import { modalOwnerActive as N, MODAL_OWNER_ACTIVE_KEY as D } from "../utils/modal-scope.js";
|
|
10
|
+
const I = Symbol("Tt_MODAL_INJECT"), j = {};
|
|
11
|
+
function H(t = {}, l = I) {
|
|
12
|
+
var p;
|
|
13
|
+
const { connectedComponent: n } = t;
|
|
14
|
+
if (n) {
|
|
15
|
+
const e = w({}), s = E(!0);
|
|
16
|
+
return [A(
|
|
17
|
+
(m, { attrs: u, slots: M }) => (O(l, {
|
|
18
|
+
extendApi(_) {
|
|
19
|
+
Object.setPrototypeOf(e, _);
|
|
19
20
|
},
|
|
20
|
-
options:
|
|
21
|
+
options: t,
|
|
21
22
|
async reCreateModal() {
|
|
22
|
-
|
|
23
|
+
s.value = !1, await T(), s.value = !0;
|
|
23
24
|
}
|
|
24
|
-
}),
|
|
25
|
+
}), J(e, {
|
|
26
|
+
...m,
|
|
25
27
|
...u,
|
|
26
|
-
...
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
d.value ? r : "div",
|
|
28
|
+
...M
|
|
29
|
+
}), () => f(
|
|
30
|
+
s.value ? n : "div",
|
|
30
31
|
{
|
|
31
|
-
...
|
|
32
|
-
...
|
|
32
|
+
...m,
|
|
33
|
+
...u
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
M
|
|
35
36
|
)),
|
|
36
37
|
{
|
|
37
38
|
name: "TtModal",
|
|
@@ -39,93 +40,93 @@ function K(n = {}, c = R) {
|
|
|
39
40
|
}
|
|
40
41
|
), e];
|
|
41
42
|
}
|
|
42
|
-
const o =
|
|
43
|
-
...
|
|
43
|
+
const o = b(l, {}), r = {
|
|
44
|
+
...j,
|
|
44
45
|
...o.options,
|
|
45
|
-
...
|
|
46
|
+
...t
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
(
|
|
48
|
+
r.onVisibleChange = (e) => {
|
|
49
|
+
var s, i, m;
|
|
50
|
+
(s = t.onVisibleChange) == null || s.call(t, e), (m = (i = o.options) == null ? void 0 : i.onVisibleChange) == null || m.call(i, e);
|
|
50
51
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const c = r.onClosed;
|
|
53
|
+
r.onClosed = () => {
|
|
53
54
|
var e;
|
|
54
|
-
|
|
55
|
+
c == null || c(), r.destroyOnClose && ((e = o.reCreateDrawer) == null || e.call(o));
|
|
55
56
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
(e, { attrs:
|
|
60
|
-
|
|
57
|
+
const d = new S(r), a = d;
|
|
58
|
+
a.useStore = (e) => y(d.store, e);
|
|
59
|
+
const C = A(
|
|
60
|
+
(e, { attrs: s, slots: i }) => () => f(
|
|
61
|
+
h,
|
|
61
62
|
{
|
|
62
63
|
...e,
|
|
63
|
-
...
|
|
64
|
-
modalApi:
|
|
64
|
+
...s,
|
|
65
|
+
modalApi: a
|
|
65
66
|
},
|
|
66
|
-
|
|
67
|
+
i
|
|
67
68
|
),
|
|
68
69
|
{
|
|
69
70
|
name: "TtModal",
|
|
70
71
|
inheritAttrs: !1
|
|
71
72
|
}
|
|
72
73
|
);
|
|
73
|
-
return (
|
|
74
|
+
return (p = o.extendApi) == null || p.call(o, a), [C, a];
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
const o = new
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
(
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
function Q(t, l, n) {
|
|
77
|
+
const o = x(), r = o ? N.get(o) : void 0, c = new S(n), d = c;
|
|
78
|
+
d.useStore = (u) => y(c.store, u);
|
|
79
|
+
const a = document.createElement("div");
|
|
80
|
+
(n.appendToBody ? document.body : V() ?? document.body).appendChild(a);
|
|
81
|
+
const p = g(), e = P(d, () => p.stop());
|
|
82
|
+
p.run(() => {
|
|
83
|
+
R(() => {
|
|
84
|
+
e(), v(null, a), a.remove();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
const s = A(
|
|
88
|
+
(u, { slots: M }) => (r && O(D, r), k(() => {
|
|
89
|
+
n && d.setModalProps(n), d.openModal();
|
|
90
|
+
}), () => f(
|
|
91
|
+
h,
|
|
92
|
+
{
|
|
93
|
+
...u,
|
|
94
|
+
modalApi: d
|
|
95
|
+
},
|
|
96
|
+
M
|
|
97
|
+
)),
|
|
97
98
|
{
|
|
98
99
|
name: "TtModal",
|
|
99
100
|
inheritAttrs: !1
|
|
100
101
|
}
|
|
101
|
-
),
|
|
102
|
-
|
|
102
|
+
), i = f(l, {}), m = f(
|
|
103
|
+
L,
|
|
103
104
|
{},
|
|
104
|
-
() =>
|
|
105
|
-
|
|
105
|
+
() => f(
|
|
106
|
+
s,
|
|
106
107
|
{
|
|
107
|
-
...
|
|
108
|
+
...n
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
|
-
default: () =>
|
|
111
|
+
default: () => i
|
|
111
112
|
}
|
|
112
113
|
)
|
|
113
114
|
);
|
|
114
|
-
return m.appContext =
|
|
115
|
+
return m.appContext = t._context, v(m, a), d;
|
|
115
116
|
}
|
|
116
|
-
async function
|
|
117
|
-
var
|
|
118
|
-
if (!
|
|
117
|
+
async function J(t, l) {
|
|
118
|
+
var r;
|
|
119
|
+
if (!l || Object.keys(l).length === 0)
|
|
119
120
|
return;
|
|
120
121
|
await T();
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
122
|
+
const n = (r = t == null ? void 0 : t.store) == null ? void 0 : r.state;
|
|
123
|
+
if (!n)
|
|
123
124
|
return;
|
|
124
|
-
const o = new Set(Object.keys(
|
|
125
|
-
for (const
|
|
126
|
-
o.has(
|
|
125
|
+
const o = new Set(Object.keys(n));
|
|
126
|
+
for (const c of Object.keys(l))
|
|
127
|
+
o.has(c) && ["class"].includes(c);
|
|
127
128
|
}
|
|
128
129
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
Q as showTtModal,
|
|
131
|
+
H as useModalRender
|
|
131
132
|
};
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as n, getCurrentScope as u, shallowRef as c, computed as d, onActivated as i, onDeactivated as f } from "vue";
|
|
2
2
|
import { showTtModal as M } from "./hooks/useModalRender.js";
|
|
3
|
-
import { setModalHostApp as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
o
|
|
3
|
+
import { setModalHostApp as w } from "./utils/modal-host-app.js";
|
|
4
|
+
import { MODAL_OWNER_ACTIVE_KEY as m, modalOwnerActive as v } from "./utils/modal-scope.js";
|
|
5
|
+
const s = Symbol("SHOW_MODAL");
|
|
6
|
+
function A(t) {
|
|
7
|
+
w(t);
|
|
8
|
+
const o = (e, r) => M(t, e, r);
|
|
9
|
+
t.provide(s, o);
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
11
|
+
function E() {
|
|
12
|
+
const t = n(s);
|
|
13
|
+
if (!t)
|
|
13
14
|
throw new Error("[TtModal]: useShowModal() 需要先调用 setupModal(app) 进行注册");
|
|
14
|
-
|
|
15
|
+
const o = u(), e = c(!0), r = n(m, void 0);
|
|
16
|
+
return o && v.set(
|
|
17
|
+
o,
|
|
18
|
+
d(() => e.value && (r == null ? void 0 : r.value) !== !1)
|
|
19
|
+
), i(() => {
|
|
20
|
+
e.value = !0;
|
|
21
|
+
}), f(() => {
|
|
22
|
+
e.value = !1;
|
|
23
|
+
}), (a, l) => {
|
|
24
|
+
if (o && !o.active)
|
|
25
|
+
throw new Error("[TtModal]: 页面已销毁,不能再打开弹窗");
|
|
26
|
+
return o ? o.run(() => t(a, l)) : t(a, l);
|
|
27
|
+
};
|
|
15
28
|
}
|
|
16
29
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
A as setupModal,
|
|
31
|
+
E as useShowModal
|
|
19
32
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
1
|
+
import { EffectScope, InjectionKey, Ref } from 'vue';
|
|
2
|
+
/** 命令式弹窗从调用方作用域继承激活状态,WeakMap 不延长页面寿命。 */
|
|
3
|
+
export declare const modalOwnerActive: WeakMap<EffectScope, Readonly<Ref<boolean, boolean>>>;
|
|
4
|
+
/** 独立挂载的弹窗向内容组件传递所属页面状态,支持嵌套弹窗。 */
|
|
5
|
+
export declare const MODAL_OWNER_ACTIVE_KEY: InjectionKey<Readonly<Ref<boolean>>>;
|
|
5
6
|
/** 当前作用域标识:子应用用 micro-app name,宿主页面用 host */
|
|
6
7
|
export declare function getModalScopeKey(): string;
|
|
7
8
|
/**
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
const c = /* @__PURE__ */ new WeakMap(), i = Symbol("TtModalOwnerActive");
|
|
2
|
+
function r() {
|
|
2
3
|
return typeof window > "u" ? "host" : window.__MICRO_APP_NAME__ || "host";
|
|
3
4
|
}
|
|
4
|
-
function u(
|
|
5
|
+
function u(e) {
|
|
5
6
|
var n;
|
|
6
|
-
const o =
|
|
7
|
-
return
|
|
7
|
+
const o = e.body ?? e.documentElement, t = (n = o == null ? void 0 : o.getRootNode) == null ? void 0 : n.call(o);
|
|
8
|
+
return t instanceof Document ? t : e;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function s() {
|
|
10
11
|
return typeof document > "u" ? void 0 : document;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
13
|
+
function d(e, o) {
|
|
14
|
+
return e.closest("micro-app-body") === o.closest("micro-app-body");
|
|
14
15
|
}
|
|
15
16
|
export {
|
|
16
|
-
i as
|
|
17
|
-
|
|
18
|
-
r as
|
|
17
|
+
i as MODAL_OWNER_ACTIVE_KEY,
|
|
18
|
+
s as getClientDocument,
|
|
19
|
+
r as getModalScopeKey,
|
|
20
|
+
d as isSameMicroAppScope,
|
|
21
|
+
c as modalOwnerActive,
|
|
19
22
|
u as resolveScanDocument
|
|
20
23
|
};
|