@opentiny/vue-hooks 3.26.0 → 3.27.0
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/src/vue-popup.js +13 -13
- package/package.json +2 -2
- package/src/vue-popup.ts +1 -1
package/dist/src/vue-popup.js
CHANGED
|
@@ -6,21 +6,21 @@ const x = ({
|
|
|
6
6
|
watch: p,
|
|
7
7
|
vm: o,
|
|
8
8
|
api: r,
|
|
9
|
-
props:
|
|
9
|
+
props: t,
|
|
10
10
|
state: s,
|
|
11
|
-
nextTick:
|
|
11
|
+
nextTick: d
|
|
12
12
|
}) => {
|
|
13
13
|
l(() => {
|
|
14
14
|
o._popupId = `popup-${I++}`, n.register(o._popupId, o);
|
|
15
15
|
}), e(() => {
|
|
16
16
|
n.deregister(o._popupId), n.closeModal(o._popupId);
|
|
17
17
|
}), p(
|
|
18
|
-
() =>
|
|
18
|
+
() => t.visible,
|
|
19
19
|
(i) => {
|
|
20
20
|
if (i) {
|
|
21
21
|
if (o._opening)
|
|
22
22
|
return;
|
|
23
|
-
s.rendered ? r.open() : (s.rendered = !0,
|
|
23
|
+
s.rendered ? r.open() : (s.rendered = !0, d(() => {
|
|
24
24
|
r.open();
|
|
25
25
|
}));
|
|
26
26
|
} else
|
|
@@ -35,18 +35,18 @@ const x = ({
|
|
|
35
35
|
if (T || l.opened)
|
|
36
36
|
return;
|
|
37
37
|
e._opening = !0;
|
|
38
|
-
const s = e.$el,
|
|
39
|
-
i && (n.zIndex = i),
|
|
38
|
+
const s = e.$el, d = o.modal, i = o.zIndex;
|
|
39
|
+
i && (n.zIndex = i), d && (e._closing && (n.closeModal(e._popupId), e._closing = !1), n.openModal(
|
|
40
40
|
e._popupId,
|
|
41
41
|
n.nextZIndex(),
|
|
42
42
|
o.modalAppendToBody ? void 0 : s,
|
|
43
43
|
o.modalClass,
|
|
44
|
-
o.
|
|
44
|
+
!o.noAnimation
|
|
45
45
|
), o.lockScroll && (n.fixBodyBorder(), g(document.body, n.popLockClass))), getComputedStyle(s).position === "static" && (s.style.position = "absolute"), s.style.zIndex = n.nextZIndex().toString(), l.opened = !0, e._opening = !1;
|
|
46
|
-
},
|
|
47
|
-
|
|
46
|
+
}, t = Number(o.openDelay);
|
|
47
|
+
t > 0 ? e._openTimer = setTimeout(() => {
|
|
48
48
|
e._openTimer = null, r();
|
|
49
|
-
},
|
|
49
|
+
}, t) : r();
|
|
50
50
|
}, M = ({ state: l, vm: e }) => () => {
|
|
51
51
|
e._openTimer !== null && (clearTimeout(e._openTimer), e._openTimer = null), clearTimeout(e._closeTimer);
|
|
52
52
|
const p = () => {
|
|
@@ -56,13 +56,13 @@ const x = ({
|
|
|
56
56
|
e._closeTimer = null, p();
|
|
57
57
|
}, o) : p();
|
|
58
58
|
}, m = (l) => {
|
|
59
|
-
const { api: e, nextTick: p, onBeforeUnmount: o, onMounted: r, props:
|
|
59
|
+
const { api: e, nextTick: p, onBeforeUnmount: o, onMounted: r, props: t, reactive: s, toRefs: d, vm: i, watch: u } = l, c = s({
|
|
60
60
|
opened: !1,
|
|
61
61
|
rendered: !1
|
|
62
62
|
});
|
|
63
|
-
x({ onMounted: r, onBeforeUnmount: o, watch: u, vm: i, api: e, props:
|
|
63
|
+
x({ onMounted: r, onBeforeUnmount: o, watch: u, vm: i, api: e, props: t, state: c, nextTick: p });
|
|
64
64
|
const a = y({ state: c, vm: i }), _ = M({ state: c, vm: i });
|
|
65
|
-
return { open: a, close: _, PopupManager: n, ...
|
|
65
|
+
return { open: a, close: _, PopupManager: n, ...d(c) };
|
|
66
66
|
};
|
|
67
67
|
export {
|
|
68
68
|
m as usePopup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-hooks",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@floating-ui/dom": "^1.6.9",
|
|
14
|
-
"@opentiny/utils": "~3.
|
|
14
|
+
"@opentiny/utils": "~3.27.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"typescript": "~5.3.3",
|