vue-popup-plus-plugin-preset 1.3.4 → 1.5.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.
@@ -0,0 +1,129 @@
1
+ import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
2
+ import { defineComponent as h, provide as H, createElementBlock as f, openBlock as l, normalizeClass as s, renderSlot as c, createElementVNode as r, inject as u, computed as T, withModifiers as L, ref as a, watch as V, unref as Y, createCommentVNode as S, toDisplayString as j, createBlock as U } from "vue";
3
+ import { usePopup as x, POPUP_COMPONENT_INJECTS as M } from "vue-popup-plus";
4
+ const z = { class: "body" }, k = Symbol("skin"), A = /* @__PURE__ */ h({
5
+ name: "PScaffold",
6
+ __name: "PScaffold",
7
+ props: {
8
+ skin: {}
9
+ },
10
+ setup(e) {
11
+ return H(k, e.skin), (t, o) => (l(), f("div", {
12
+ class: s(["p-scaffold", `is-skin-${e.skin}`])
13
+ }, [
14
+ c(t.$slots, "header", {}, void 0, !0),
15
+ r("div", z, [
16
+ c(t.$slots, "default", {}, void 0, !0)
17
+ ]),
18
+ c(t.$slots, "footer", {}, void 0, !0)
19
+ ], 2));
20
+ }
21
+ }), ee = /* @__PURE__ */ g(A, [["__scopeId", "data-v-bc605f70"]]), J = /* @__PURE__ */ h({
22
+ name: "PHeaderButton",
23
+ __name: "PHeaderButton",
24
+ props: {
25
+ iconClass: { default: "" },
26
+ theme: { default: "primary" },
27
+ disabled: { type: Boolean, default: !1 },
28
+ actived: { type: Boolean, default: !1 }
29
+ },
30
+ emits: ["click"],
31
+ setup(e, { emit: t }) {
32
+ const o = u(k, "modern"), m = t, v = T(() => ({
33
+ [`is-skin-${o}`]: !0,
34
+ [`is-theme-${e.theme}`]: !0,
35
+ "is-disabled": e.disabled,
36
+ "is-active": e.actived
37
+ }));
38
+ function C() {
39
+ e.disabled || m("click");
40
+ }
41
+ return ($, d) => (l(), f("div", {
42
+ class: s(["p-header-button", v.value]),
43
+ onClick: d[0] || (d[0] = L((P) => C(), ["stop"]))
44
+ }, [
45
+ r("i", {
46
+ class: s(["iconfont-popup-plugin-preset", e.iconClass])
47
+ }, null, 2)
48
+ ], 2));
49
+ }
50
+ }), W = /* @__PURE__ */ g(J, [["__scopeId", "data-v-41a6ff2b"]]), q = { class: "title" }, F = { class: "btn-ctn" }, G = /* @__PURE__ */ h({
51
+ name: "PHeader",
52
+ __name: "PHeader",
53
+ props: {
54
+ title: { default: "" },
55
+ iconClass: { default: "" },
56
+ iconTheme: { default: "primary" },
57
+ hasCloseButton: { type: Boolean, default: !0 },
58
+ draggable: { type: Boolean, default: !1 }
59
+ },
60
+ emits: ["close"],
61
+ setup(e, { emit: t }) {
62
+ const o = x(), m = u(M.INSTANCE_ID), v = u(M.COMPUTED_VIEW_STYLE), C = u(k, "modern"), $ = t, d = a(0), P = a(0), w = a(0), O = a(0), b = a(0), y = a(0), B = a(!1), _ = T(() => !!e.iconClass);
63
+ V([b, y], N);
64
+ function D() {
65
+ e.hasCloseButton && $("close");
66
+ }
67
+ function X(n) {
68
+ e.draggable && (d.value = n.clientX, P.value = n.clientY, w.value = v.value.translateX, O.value = v.value.translateY, B.value = !0, n.preventDefault(), window.addEventListener("mousemove", E), window.addEventListener("mouseup", I));
69
+ }
70
+ function E(n) {
71
+ if (!B.value) return;
72
+ const i = Math.ceil(n.clientX - d.value), p = Math.ceil(n.clientY - P.value);
73
+ b.value = w.value + i, y.value = O.value + p;
74
+ }
75
+ function I(n) {
76
+ B.value = !1, window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", I);
77
+ }
78
+ function N() {
79
+ o.update(m, {
80
+ viewTranslateX: b.value,
81
+ viewTranslateY: y.value
82
+ });
83
+ }
84
+ return (n, i) => (l(), f("div", {
85
+ class: s(["p-header", [`is-skin-${Y(C)}`, { "is-draggable": e.draggable }]]),
86
+ onMousedown: i[1] || (i[1] = (p) => X(p))
87
+ }, [
88
+ _.value ? (l(), f("div", {
89
+ key: 0,
90
+ class: s(["icon", `is-theme-${e.iconTheme}`])
91
+ }, [
92
+ r("i", {
93
+ class: s(["iconfont-popup-plugin-preset", e.iconClass])
94
+ }, null, 2)
95
+ ], 2)) : S("", !0),
96
+ r("div", q, j(e.title), 1),
97
+ r("div", F, [
98
+ c(n.$slots, "buttons", {}, void 0, !0),
99
+ e.hasCloseButton ? (l(), U(W, {
100
+ key: 0,
101
+ onClick: i[0] || (i[0] = (p) => D()),
102
+ iconClass: "close",
103
+ theme: "danger"
104
+ })) : S("", !0)
105
+ ])
106
+ ], 34));
107
+ }
108
+ }), te = /* @__PURE__ */ g(G, [["__scopeId", "data-v-f8f28375"]]), K = /* @__PURE__ */ h({
109
+ name: "PBody",
110
+ __name: "PBody",
111
+ props: {
112
+ withPadding: { type: Boolean, default: !0 },
113
+ fitIcon: { type: Boolean }
114
+ },
115
+ setup(e) {
116
+ const t = u(k, "modern");
117
+ return (o, m) => (l(), f("div", {
118
+ class: s(["p-body", [`is-skin-${Y(t)}`, { "has-padding": e.withPadding, "is-fit-icon": e.fitIcon }]])
119
+ }, [
120
+ c(o.$slots, "default", {}, void 0, !0)
121
+ ], 2));
122
+ }
123
+ }), ne = /* @__PURE__ */ g(K, [["__scopeId", "data-v-ae7d6884"]]);
124
+ export {
125
+ ee as P,
126
+ ne as a,
127
+ te as b,
128
+ W as c
129
+ };
@@ -0,0 +1,93 @@
1
+ import { defineComponent as h, createElementBlock as n, openBlock as u, renderSlot as y, inject as c, useTemplateRef as P, computed as p, normalizeClass as S, createElementVNode as $, useSlots as T, provide as d, onMounted as G, Fragment as B, renderList as _, createBlock as C, createCommentVNode as j, resolveDynamicComponent as F } from "vue";
2
+ import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ /* empty css */
4
+ const I = { class: "p-footer" }, w = /* @__PURE__ */ h({
5
+ name: "PFooter",
6
+ __name: "PFooter",
7
+ setup(e) {
8
+ return (o, s) => (u(), n("div", I, [
9
+ y(o.$slots, "default", {}, void 0, !0)
10
+ ]));
11
+ }
12
+ }), L = /* @__PURE__ */ v(w, [["__scopeId", "data-v-a6296b40"]]), E = ["disabled"], M = /* @__PURE__ */ h({
13
+ name: "PButton",
14
+ __name: "PButton",
15
+ props: {
16
+ type: {},
17
+ theme: {},
18
+ size: {},
19
+ disabled: { type: Boolean, default: !1 }
20
+ },
21
+ emits: ["click"],
22
+ setup(e, { emit: o }) {
23
+ c(t.inButtonGroup, !1);
24
+ const s = c(t.groupType, "default"), f = c(t.groupTheme, "default"), m = c(t.groupSize, "default"), l = P("button"), a = o, g = p(() => window.innerWidth <= 600), i = p(() => ({
25
+ [`is-type-${e.type || s}`]: !0,
26
+ [`is-theme-${e.theme || f}`]: !0,
27
+ [`is-size-${e.size || m}`]: !0,
28
+ "is-mobile": g.value
29
+ }));
30
+ function k(b) {
31
+ a("click", b), l.value?.blur();
32
+ }
33
+ return (b, r) => (u(), n("button", {
34
+ class: S(["p-button", i.value]),
35
+ disabled: e.disabled,
36
+ onClick: r[0] || (r[0] = (z) => k(z)),
37
+ ref: "button"
38
+ }, [
39
+ r[1] || (r[1] = $("div", { class: "background" }, null, -1)),
40
+ y(b.$slots, "default", {}, void 0, !0)
41
+ ], 10, E));
42
+ }
43
+ }), N = /* @__PURE__ */ v(M, [["__scopeId", "data-v-3dd46a8f"]]), O = {
44
+ key: 0,
45
+ class: "cutline"
46
+ }, t = {
47
+ inButtonGroup: Symbol("inButtonGroup"),
48
+ groupType: Symbol("groupType"),
49
+ groupTheme: Symbol("groupTheme"),
50
+ groupSize: Symbol("groupSize")
51
+ }, R = /* @__PURE__ */ h({
52
+ name: "PButtonGroup",
53
+ __name: "PButtonGroup",
54
+ props: {
55
+ type: { default: "default" },
56
+ theme: { default: "default" },
57
+ size: { default: "default" },
58
+ direction: { default: "horizontal" },
59
+ align: { default: "start" },
60
+ tight: { type: Boolean, default: !1 },
61
+ cutline: { type: Boolean, default: !1 }
62
+ },
63
+ setup(e) {
64
+ const o = T(), s = p(() => e.cutline && !e.tight), f = p(() => ({
65
+ [`is-align-${e.align}`]: !0,
66
+ [`is-direction-${e.direction}`]: !0,
67
+ "is-tight": e.tight,
68
+ "has-cutline": s.value
69
+ }));
70
+ d(t.inButtonGroup, !0), d(t.groupType, e.type), d(t.groupTheme, e.theme), d(t.groupSize, e.size), G(() => {
71
+ m();
72
+ });
73
+ function m() {
74
+ o.default().some((a) => {
75
+ a.type;
76
+ }) && console.warn("PButtonGroup 只能包含 PButton 组件");
77
+ }
78
+ return (l, a) => (u(), n("div", {
79
+ class: S(["p-button-group", f.value]),
80
+ ref: "group"
81
+ }, [
82
+ s.value ? (u(!0), n(B, { key: 0 }, _(o.default?.(), (g, i) => (u(), n(B, { key: i }, [
83
+ (u(), C(F(g))),
84
+ i < (o.default?.() || []).length - 1 ? (u(), n("div", O)) : j("", !0)
85
+ ], 64))), 128)) : y(l.$slots, "default", { key: 1 }, void 0, !0)
86
+ ], 2));
87
+ }
88
+ }), W = /* @__PURE__ */ v(R, [["__scopeId", "data-v-cf19f04b"]]);
89
+ export {
90
+ L as P,
91
+ W as a,
92
+ N as b
93
+ };
@@ -0,0 +1,85 @@
1
+ import { defineComponent as m, inject as u, createElementBlock as C, openBlock as P, normalizeClass as p, createVNode as n, withCtx as t, createElementVNode as g, toDisplayString as a, createTextVNode as d } from "vue";
2
+ import { usePopup as k, POPUP_COMPONENT_INJECTS as x } from "vue-popup-plus";
3
+ import { P as B, a as T, b as y } from "./PBody-Cotuzlbw.js";
4
+ import { P as N, a as b, b as f } from "./PButtonGroup-8zbI-6Gv.js";
5
+ import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const v = { class: "content" }, I = /* @__PURE__ */ m({
7
+ name: "PConfirm",
8
+ __name: "PConfirm",
9
+ props: {
10
+ skin: {},
11
+ title: {},
12
+ headerClose: { type: Boolean },
13
+ content: {},
14
+ confirmText: {},
15
+ cancelText: {},
16
+ draggable: { type: Boolean }
17
+ },
18
+ setup(e) {
19
+ const l = k(), i = u(x.INSTANCE_ID);
20
+ function c() {
21
+ l.destroy(i, !0);
22
+ }
23
+ function r() {
24
+ l.destroy(i, !1);
25
+ }
26
+ return (E, o) => (P(), C("div", {
27
+ class: p(["p-confirm", `is-skin-${e.skin}`])
28
+ }, [
29
+ n(B, { skin: e.skin }, {
30
+ header: t(() => [
31
+ n(y, {
32
+ draggable: e.draggable,
33
+ hasCloseButton: e.headerClose,
34
+ title: e.title,
35
+ onClose: o[0] || (o[0] = (s) => r()),
36
+ iconClass: "confirm",
37
+ iconTheme: "warning"
38
+ }, null, 8, ["draggable", "hasCloseButton", "title"])
39
+ ]),
40
+ footer: t(() => [
41
+ n(N, null, {
42
+ default: t(() => [
43
+ n(b, { align: "end" }, {
44
+ default: t(() => [
45
+ n(f, {
46
+ onClick: o[1] || (o[1] = (s) => r()),
47
+ type: "plain"
48
+ }, {
49
+ default: t(() => [
50
+ d(a(e.cancelText), 1)
51
+ ]),
52
+ _: 1
53
+ }),
54
+ n(f, {
55
+ onClick: o[2] || (o[2] = (s) => c()),
56
+ theme: "primary"
57
+ }, {
58
+ default: t(() => [
59
+ d(a(e.confirmText), 1)
60
+ ]),
61
+ _: 1
62
+ })
63
+ ]),
64
+ _: 1
65
+ })
66
+ ]),
67
+ _: 1
68
+ })
69
+ ]),
70
+ default: t(() => [
71
+ n(T, { fitIcon: "" }, {
72
+ default: t(() => [
73
+ g("div", v, a(e.content), 1)
74
+ ]),
75
+ _: 1
76
+ })
77
+ ]),
78
+ _: 1
79
+ }, 8, ["skin"])
80
+ ], 2));
81
+ }
82
+ }), D = /* @__PURE__ */ h(I, [["__scopeId", "data-v-27f864c0"]]);
83
+ export {
84
+ D as default
85
+ };
@@ -0,0 +1,71 @@
1
+ import { defineComponent as f, ref as g, computed as d, defineAsyncComponent as p, createElementBlock as y, openBlock as n, normalizeClass as P, createVNode as a, createSlots as h, withCtx as t, createBlock as s, resolveDynamicComponent as k, mergeProps as v, createCommentVNode as B } from "vue";
2
+ import { usePopup as b } from "vue-popup-plus";
3
+ import { P as x, a as D, b as $, c as S } from "./PBody-Cotuzlbw.js";
4
+ import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const H = /* @__PURE__ */ f({
6
+ name: "PDialog",
7
+ __name: "PDialog",
8
+ props: {
9
+ id: {},
10
+ skin: {},
11
+ title: {},
12
+ customComponent: {},
13
+ customComponentProps: {},
14
+ header: { type: Boolean },
15
+ headerClose: { type: Boolean },
16
+ draggable: { type: Boolean },
17
+ debugMode: { type: Boolean }
18
+ },
19
+ setup(e) {
20
+ const m = b(), l = g(1), i = d(
21
+ () => `${e.id}-${l.value}`
22
+ ), u = d(() => typeof e.customComponent == "function" ? p(e.customComponent) : e.customComponent);
23
+ function c() {
24
+ l.value++;
25
+ }
26
+ function r() {
27
+ m.dialog.close(e.id);
28
+ }
29
+ return (K, o) => (n(), y("div", {
30
+ class: P(["p-dialog", { "no-header": !e.header }])
31
+ }, [
32
+ a(x, { skin: e.skin }, h({
33
+ default: t(() => [
34
+ a(D, { withPadding: !1 }, {
35
+ default: t(() => [
36
+ (n(), s(k(u.value), v({ key: i.value }, e.customComponentProps), null, 16))
37
+ ]),
38
+ _: 1
39
+ })
40
+ ]),
41
+ _: 2
42
+ }, [
43
+ e.header ? {
44
+ name: "header",
45
+ fn: t(() => [
46
+ a($, {
47
+ draggable: e.draggable,
48
+ hasCloseButton: e.headerClose,
49
+ title: e.title,
50
+ onClose: o[1] || (o[1] = (C) => r())
51
+ }, {
52
+ buttons: t(() => [
53
+ e.debugMode ? (n(), s(S, {
54
+ key: 0,
55
+ onClick: o[0] || (o[0] = (C) => c()),
56
+ iconClass: "reload",
57
+ theme: "success"
58
+ })) : B("", !0)
59
+ ]),
60
+ _: 1
61
+ }, 8, ["draggable", "hasCloseButton", "title"])
62
+ ]),
63
+ key: "0"
64
+ } : void 0
65
+ ]), 1032, ["skin"])
66
+ ], 2));
67
+ }
68
+ }), A = /* @__PURE__ */ w(H, [["__scopeId", "data-v-4b198edc"]]);
69
+ export {
70
+ A as default
71
+ };
@@ -0,0 +1,60 @@
1
+ import { defineComponent as s, useCssVars as c, createElementBlock as i, openBlock as n, normalizeClass as m, createElementVNode as a, inject as r, createVNode as l, createCommentVNode as p, toDisplayString as u } from "vue";
2
+ import { usePopup as f, POPUP_COMPONENT_INJECTS as _ } from "vue-popup-plus";
3
+ import { _ as d } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ /* empty css */
5
+ const g = /* @__PURE__ */ s({
6
+ name: "PLoadingIcon",
7
+ __name: "PLoadingIcon",
8
+ props: {
9
+ theme: { default: "primary" },
10
+ size: { default: 60 }
11
+ },
12
+ setup(e) {
13
+ return c((t) => ({
14
+ db319f58: `${t.size}px`
15
+ })), (t, o) => (n(), i("div", {
16
+ class: m(["p-loading-icon", `is-theme-${e.theme}`])
17
+ }, [...o[0] || (o[0] = [
18
+ a("svg", { viewBox: "25 25 50 50" }, [
19
+ a("circle", {
20
+ cx: "50",
21
+ cy: "50",
22
+ fill: "none",
23
+ r: "20"
24
+ })
25
+ ], -1)
26
+ ])], 2));
27
+ }
28
+ }), P = /* @__PURE__ */ d(g, [["__scopeId", "data-v-a22f9b94"]]), h = { class: "wrapper" }, k = {
29
+ key: 0,
30
+ class: "title"
31
+ }, v = /* @__PURE__ */ s({
32
+ name: "PLoading",
33
+ __name: "PLoading",
34
+ props: {
35
+ skin: {},
36
+ theme: {},
37
+ title: {},
38
+ iconSize: {},
39
+ mask: { type: Boolean },
40
+ debugMode: { type: Boolean }
41
+ },
42
+ setup(e) {
43
+ return c((t) => ({
44
+ v45a04100: `${t.iconSize * 4}px`
45
+ })), f(), r(_.INSTANCE_ID), (t, o) => (n(), i("div", {
46
+ class: m(["p-loading", [`is-skin-${e.skin}`, { "has-mask": e.mask }]])
47
+ }, [
48
+ a("div", h, [
49
+ l(P, {
50
+ size: e.iconSize,
51
+ theme: e.theme
52
+ }, null, 8, ["size", "theme"]),
53
+ e.title ? (n(), i("div", k, u(e.title), 1)) : p("", !0)
54
+ ])
55
+ ], 2));
56
+ }
57
+ }), C = /* @__PURE__ */ d(v, [["__scopeId", "data-v-55443cbf"]]);
58
+ export {
59
+ C as default
60
+ };
@@ -0,0 +1,111 @@
1
+ import { defineComponent as C, inject as y, ref as v, computed as k, createElementBlock as s, openBlock as d, normalizeClass as B, createVNode as l, withCtx as a, createCommentVNode as i, createElementVNode as N, toDisplayString as r, withDirectives as f, vModelText as g, createTextVNode as p } from "vue";
2
+ import { usePopup as T, POPUP_COMPONENT_INJECTS as V } from "vue-popup-plus";
3
+ import "./vue-popup-plus-plugin-preset.js";
4
+ import { P as b, a as L, b as I } from "./PBody-Cotuzlbw.js";
5
+ import { P as E, a as S, b as x } from "./PButtonGroup-8zbI-6Gv.js";
6
+ import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const D = {
8
+ key: 0,
9
+ class: "message"
10
+ }, M = { class: "input" }, O = ["maxLength", "placeholder"], U = ["maxLength", "placeholder"], w = /* @__PURE__ */ C({
11
+ name: "PPrompt",
12
+ __name: "PPrompt",
13
+ props: {
14
+ skin: {},
15
+ title: {},
16
+ headerClose: { type: Boolean },
17
+ message: { type: [String, Boolean] },
18
+ type: {},
19
+ defaultValue: {},
20
+ placeholder: {},
21
+ maxLength: {},
22
+ confirmText: {},
23
+ cancelText: {},
24
+ draggable: { type: Boolean }
25
+ },
26
+ setup(e) {
27
+ const u = T(), m = y(V.INSTANCE_ID), o = v(e.defaultValue), h = k(() => e.message !== !1);
28
+ function P() {
29
+ u.destroy(m, o.value);
30
+ }
31
+ function c() {
32
+ u.destroy(m);
33
+ }
34
+ return (j, t) => (d(), s("div", {
35
+ class: B(["p-prompt", `is-skin-${e.skin}`])
36
+ }, [
37
+ l(b, { skin: e.skin }, {
38
+ header: a(() => [
39
+ l(I, {
40
+ draggable: e.draggable,
41
+ hasCloseButton: e.headerClose,
42
+ title: e.title,
43
+ onClose: t[0] || (t[0] = (n) => c()),
44
+ iconClass: "prompt"
45
+ }, null, 8, ["draggable", "hasCloseButton", "title"])
46
+ ]),
47
+ footer: a(() => [
48
+ l(E, null, {
49
+ default: a(() => [
50
+ l(S, { align: "end" }, {
51
+ default: a(() => [
52
+ l(x, {
53
+ onClick: t[3] || (t[3] = (n) => c()),
54
+ type: "plain"
55
+ }, {
56
+ default: a(() => [
57
+ p(r(e.cancelText), 1)
58
+ ]),
59
+ _: 1
60
+ }),
61
+ l(x, {
62
+ onClick: t[4] || (t[4] = (n) => P()),
63
+ theme: "primary"
64
+ }, {
65
+ default: a(() => [
66
+ p(r(e.confirmText), 1)
67
+ ]),
68
+ _: 1
69
+ })
70
+ ]),
71
+ _: 1
72
+ })
73
+ ]),
74
+ _: 1
75
+ })
76
+ ]),
77
+ default: a(() => [
78
+ l(L, { fitIcon: "" }, {
79
+ default: a(() => [
80
+ h.value ? (d(), s("div", D, r(e.message), 1)) : i("", !0),
81
+ N("div", M, [
82
+ e.type === "input" ? f((d(), s("input", {
83
+ key: 0,
84
+ maxLength: e.maxLength,
85
+ placeholder: e.placeholder,
86
+ type: "text",
87
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => o.value = n)
88
+ }, null, 8, O)), [
89
+ [g, o.value]
90
+ ]) : i("", !0),
91
+ e.type === "textarea" ? f((d(), s("textarea", {
92
+ key: 1,
93
+ maxLength: e.maxLength,
94
+ placeholder: e.placeholder,
95
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => o.value = n)
96
+ }, null, 8, U)), [
97
+ [g, o.value]
98
+ ]) : i("", !0)
99
+ ])
100
+ ]),
101
+ _: 1
102
+ })
103
+ ]),
104
+ _: 1
105
+ }, 8, ["skin"])
106
+ ], 2));
107
+ }
108
+ }), R = /* @__PURE__ */ $(w, [["__scopeId", "data-v-927e24b0"]]);
109
+ export {
110
+ R as default
111
+ };
@@ -0,0 +1,67 @@
1
+ import { defineComponent as p, inject as C, computed as T, ref as h, onMounted as y, onBeforeUnmount as k, createElementBlock as r, openBlock as c, normalizeClass as d, createElementVNode as t, createCommentVNode as P, toDisplayString as b } from "vue";
2
+ import { usePopup as g, POPUP_COMPONENT_INJECTS as w } from "vue-popup-plus";
3
+ import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const E = { class: "wrapper" }, M = { class: "icon" }, B = { class: "content" }, I = /* @__PURE__ */ p({
5
+ name: "PToast",
6
+ __name: "PToast",
7
+ props: {
8
+ skin: {},
9
+ content: {},
10
+ theme: {},
11
+ duration: {},
12
+ showClose: { type: Boolean },
13
+ hoverWait: { type: Boolean }
14
+ },
15
+ setup(e) {
16
+ const i = g(), l = C(w.INSTANCE_ID), n = T(() => e.duration > 0), s = h();
17
+ y(() => {
18
+ a();
19
+ }), k(() => {
20
+ u();
21
+ });
22
+ function a() {
23
+ n.value && (s.value = window.setTimeout(() => {
24
+ i.destroy(l);
25
+ }, e.duration));
26
+ }
27
+ function u() {
28
+ s.value && window.clearTimeout(s.value);
29
+ }
30
+ function m() {
31
+ !e.hoverWait || !n.value || u();
32
+ }
33
+ function f() {
34
+ !e.hoverWait || !n.value || a();
35
+ }
36
+ function v() {
37
+ i.destroy(l);
38
+ }
39
+ return (D, o) => (c(), r("div", {
40
+ class: d(["p-message", `is-theme-${e.theme}`]),
41
+ onMouseenter: m,
42
+ onMouseleave: f
43
+ }, [
44
+ o[1] || (o[1] = t("div", { class: "background" }, null, -1)),
45
+ o[2] || (o[2] = t("div", { class: "background-theme" }, null, -1)),
46
+ o[3] || (o[3] = t("div", { class: "background-border" }, null, -1)),
47
+ t("div", E, [
48
+ t("div", M, [
49
+ t("i", {
50
+ class: d(["iconfont-popup-plugin-preset", `toast-${e.theme}`])
51
+ }, null, 2)
52
+ ]),
53
+ t("div", B, b(e.content), 1),
54
+ e.showClose || !n.value ? (c(), r("div", {
55
+ key: 0,
56
+ class: "close-btn",
57
+ onClick: v
58
+ }, [...o[0] || (o[0] = [
59
+ t("i", { class: "iconfont-popup-plugin-preset close" }, null, -1)
60
+ ])])) : P("", !0)
61
+ ])
62
+ ], 34));
63
+ }
64
+ }), W = /* @__PURE__ */ N(I, [["__scopeId", "data-v-279febb6"]]);
65
+ export {
66
+ W as default
67
+ };