vue-popup-plus-plugin-preset 1.1.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,79 @@
1
+ import { defineComponent as m, inject as p, createElementBlock as c, openBlock as u, createVNode as o, withCtx as e, createElementVNode as P, toDisplayString as a, createTextVNode as l } from "vue";
2
+ import { usePopup as _, POPUP_COMPONENT_INJECTS as C } from "vue-popup-plus";
3
+ import { P as g, a as N, b as T } from "./PBody-B8SE3ACJ.js";
4
+ import { P as B } from "./PFooter-Dd8fzezl.js";
5
+ import { P as y, a as i } from "./PButtonGroup-CfAPVmCi.js";
6
+ import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const h = { class: "p-confirm" }, v = { class: "content" }, E = /* @__PURE__ */ m({
8
+ name: "PConfirm",
9
+ __name: "PConfirm",
10
+ props: {
11
+ title: {},
12
+ content: {},
13
+ confirmText: {},
14
+ cancelText: {},
15
+ draggable: { type: Boolean }
16
+ },
17
+ setup(I) {
18
+ const s = _(), f = p(C.INSTANCE_ID);
19
+ function r(t) {
20
+ s.destroy(f, t);
21
+ }
22
+ return (t, n) => (u(), c("div", h, [
23
+ o(g, null, {
24
+ header: e(() => [
25
+ o(T, {
26
+ draggable: t.draggable,
27
+ hasCloseButton: !1,
28
+ title: t.title,
29
+ iconClass: "confirm"
30
+ }, null, 8, ["draggable", "title"])
31
+ ]),
32
+ footer: e(() => [
33
+ o(B, null, {
34
+ default: e(() => [
35
+ o(y, {
36
+ align: "right",
37
+ theme: "primary"
38
+ }, {
39
+ default: e(() => [
40
+ o(i, {
41
+ onClick: n[0] || (n[0] = (d) => r(!1)),
42
+ type: "plain"
43
+ }, {
44
+ default: e(() => [
45
+ l(a(t.cancelText), 1)
46
+ ]),
47
+ _: 1
48
+ }),
49
+ o(i, {
50
+ onClick: n[1] || (n[1] = (d) => r(!0))
51
+ }, {
52
+ default: e(() => [
53
+ l(a(t.confirmText), 1)
54
+ ]),
55
+ _: 1
56
+ })
57
+ ]),
58
+ _: 1
59
+ })
60
+ ]),
61
+ _: 1
62
+ })
63
+ ]),
64
+ default: e(() => [
65
+ o(N, null, {
66
+ default: e(() => [
67
+ P("div", v, a(t.content), 1)
68
+ ]),
69
+ _: 1
70
+ })
71
+ ]),
72
+ _: 1
73
+ })
74
+ ]));
75
+ }
76
+ }), $ = /* @__PURE__ */ b(E, [["__scopeId", "data-v-e79500d9"]]);
77
+ export {
78
+ $ as default
79
+ };
@@ -0,0 +1,72 @@
1
+ import { defineComponent as P, inject as g, ref as y, computed as d, defineAsyncComponent as B, onMounted as h, createElementBlock as v, openBlock as a, normalizeClass as b, createVNode as s, createSlots as k, withCtx as n, createBlock as r, resolveDynamicComponent as N, mergeProps as D, createCommentVNode as I } from "vue";
2
+ import { usePopup as S, POPUP_COMPONENT_INJECTS as E } from "vue-popup-plus";
3
+ import { P as M, a as $, b as O, c as T } from "./PBody-B8SE3ACJ.js";
4
+ import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const A = /* @__PURE__ */ P({
6
+ name: "PDialog",
7
+ __name: "PDialog",
8
+ props: {
9
+ id: {},
10
+ title: {},
11
+ customComponent: {},
12
+ customComponentProps: {},
13
+ header: { type: Boolean },
14
+ headerCloseButton: { type: Boolean },
15
+ draggable: { type: Boolean },
16
+ debugMode: { type: Boolean }
17
+ },
18
+ setup(o) {
19
+ const m = S(), u = g(E.INSTANCE_ID), l = y(1), i = d(
20
+ () => `${o.id}-${l.value}`
21
+ ), p = d(() => typeof o.customComponent == "function" ? B(o.customComponent) : o.customComponent);
22
+ h(() => {
23
+ });
24
+ function c() {
25
+ l.value++;
26
+ }
27
+ function C() {
28
+ m.destroy(u);
29
+ }
30
+ return (e, t) => (a(), v("div", {
31
+ class: b(["p-dialog", { "no-header": !e.header }])
32
+ }, [
33
+ s(M, null, k({
34
+ default: n(() => [
35
+ s($, { withPadding: !1 }, {
36
+ default: n(() => [
37
+ (a(), r(N(p.value), D({ key: i.value }, e.customComponentProps), null, 16))
38
+ ]),
39
+ _: 1
40
+ })
41
+ ]),
42
+ _: 2
43
+ }, [
44
+ e.header ? {
45
+ name: "header",
46
+ fn: n(() => [
47
+ s(O, {
48
+ draggable: e.draggable,
49
+ hasCloseButton: e.headerCloseButton,
50
+ title: e.title,
51
+ onClose: t[1] || (t[1] = (f) => C())
52
+ }, {
53
+ buttons: n(() => [
54
+ e.debugMode ? (a(), r(T, {
55
+ key: 0,
56
+ onClick: t[0] || (t[0] = (f) => c()),
57
+ iconClass: "reload",
58
+ theme: "success"
59
+ })) : I("", !0)
60
+ ]),
61
+ _: 1
62
+ }, 8, ["draggable", "hasCloseButton", "title"])
63
+ ]),
64
+ key: "0"
65
+ } : void 0
66
+ ]), 1024)
67
+ ], 2));
68
+ }
69
+ }), z = /* @__PURE__ */ w(A, [["__scopeId", "data-v-eaf6b748"]]);
70
+ export {
71
+ z as default
72
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as e, createElementBlock as t, openBlock as r, renderSlot as s } from "vue";
2
+ import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const _ = { class: "p-footer" }, c = /* @__PURE__ */ e({
4
+ name: "PFooter",
5
+ __name: "PFooter",
6
+ setup(a) {
7
+ return (o, p) => (r(), t("div", _, [
8
+ s(o.$slots, "default", {}, void 0, !0)
9
+ ]));
10
+ }
11
+ }), f = /* @__PURE__ */ n(c, [["__scopeId", "data-v-cad2ef65"]]);
12
+ export {
13
+ f as P
14
+ };
@@ -0,0 +1,61 @@
1
+ import { defineComponent as d, useCssVars as u, createElementBlock as c, openBlock as t, createElementVNode as a, inject as m, createVNode as i, createBlock as f, createCommentVNode as P, withCtx as r, createTextVNode as g } from "vue";
2
+ import { usePopup as C, POPUP_COMPONENT_INJECTS as N } from "vue-popup-plus";
3
+ import { _ as p } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import { P as k, a as x } from "./PButtonGroup-CfAPVmCi.js";
5
+ const B = { class: "p-loading" }, v = /* @__PURE__ */ d({
6
+ name: "PLoading",
7
+ __name: "PLoading",
8
+ props: {
9
+ size: { default: 60 }
10
+ },
11
+ setup(_) {
12
+ return u((e) => ({
13
+ "3d51c802": `${e.size}px`
14
+ })), (e, o) => (t(), c("div", B, [...o[0] || (o[0] = [
15
+ a("svg", { viewBox: "25 25 50 50" }, [
16
+ a("circle", {
17
+ cx: "50",
18
+ cy: "50",
19
+ fill: "none",
20
+ r: "20"
21
+ })
22
+ ], -1)
23
+ ])]));
24
+ }
25
+ }), z = /* @__PURE__ */ p(v, [["__scopeId", "data-v-279e128a"]]), I = { class: "p-loading-mask" }, L = /* @__PURE__ */ d({
26
+ name: "PLoading",
27
+ __name: "PLoadingMask",
28
+ props: {
29
+ debugMode: { type: Boolean },
30
+ iconSize: { default: 60 }
31
+ },
32
+ setup(_) {
33
+ const e = C(), o = m(N.INSTANCE_ID);
34
+ function l() {
35
+ e.destroy(o);
36
+ }
37
+ return (n, s) => (t(), c("div", I, [
38
+ i(z, { size: n.iconSize }, null, 8, ["size"]),
39
+ n.debugMode ? (t(), f(k, {
40
+ key: 0,
41
+ align: "center"
42
+ }, {
43
+ default: r(() => [
44
+ i(x, {
45
+ onClick: l,
46
+ theme: "primary"
47
+ }, {
48
+ default: r(() => [...s[0] || (s[0] = [
49
+ g("强制关闭遮罩(仅在调试模式下可用)", -1)
50
+ ])]),
51
+ _: 1
52
+ })
53
+ ]),
54
+ _: 1
55
+ })) : P("", !0)
56
+ ]));
57
+ }
58
+ }), b = /* @__PURE__ */ p(L, [["__scopeId", "data-v-19c7bbd7"]]);
59
+ export {
60
+ b as default
61
+ };
@@ -0,0 +1,109 @@
1
+ import { defineComponent as C, inject as x, ref as N, computed as T, createElementBlock as r, openBlock as s, createVNode as o, withCtx as a, createCommentVNode as d, createElementVNode as V, toDisplayString as p, withDirectives as f, vModelText as c, createTextVNode as g } from "vue";
2
+ import { usePopup as _, POPUP_COMPONENT_INJECTS as B } from "vue-popup-plus";
3
+ import "./vue-popup-plus-plugin-preset.js";
4
+ import { P as k, a as L, b } from "./PBody-B8SE3ACJ.js";
5
+ import { P as E } from "./PFooter-Dd8fzezl.js";
6
+ import { P as I, a as h } from "./PButtonGroup-CfAPVmCi.js";
7
+ import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const D = { class: "p-prompt" }, M = {
9
+ key: 0,
10
+ class: "message"
11
+ }, O = { class: "input" }, U = ["maxLength", "placeholder"], w = ["maxLength", "placeholder"], $ = /* @__PURE__ */ C({
12
+ name: "PPrompt",
13
+ __name: "PPrompt",
14
+ props: {
15
+ title: {},
16
+ message: { type: [String, Boolean] },
17
+ type: {},
18
+ defaultValue: {},
19
+ placeholder: {},
20
+ maxLength: {},
21
+ confirmText: {},
22
+ cancelText: {},
23
+ draggable: { type: Boolean }
24
+ },
25
+ setup(i) {
26
+ const u = _(), m = x(B.INSTANCE_ID), l = N(i.defaultValue), P = T(() => i.message !== !1);
27
+ function y() {
28
+ u.destroy(m, l.value);
29
+ }
30
+ function v() {
31
+ u.destroy(m, null);
32
+ }
33
+ return (e, t) => (s(), r("div", D, [
34
+ o(k, null, {
35
+ header: a(() => [
36
+ o(b, {
37
+ draggable: e.draggable,
38
+ hasCloseButton: !1,
39
+ title: e.title,
40
+ iconClass: "prompt"
41
+ }, null, 8, ["draggable", "title"])
42
+ ]),
43
+ footer: a(() => [
44
+ o(E, null, {
45
+ default: a(() => [
46
+ o(I, {
47
+ align: "right",
48
+ theme: "primary"
49
+ }, {
50
+ default: a(() => [
51
+ o(h, {
52
+ onClick: t[2] || (t[2] = (n) => v()),
53
+ type: "plain"
54
+ }, {
55
+ default: a(() => [
56
+ g(p(e.cancelText), 1)
57
+ ]),
58
+ _: 1
59
+ }),
60
+ o(h, {
61
+ onClick: t[3] || (t[3] = (n) => y())
62
+ }, {
63
+ default: a(() => [
64
+ g(p(e.confirmText), 1)
65
+ ]),
66
+ _: 1
67
+ })
68
+ ]),
69
+ _: 1
70
+ })
71
+ ]),
72
+ _: 1
73
+ })
74
+ ]),
75
+ default: a(() => [
76
+ o(L, null, {
77
+ default: a(() => [
78
+ P.value ? (s(), r("div", M, p(e.message), 1)) : d("", !0),
79
+ V("div", O, [
80
+ e.type === "input" ? f((s(), r("input", {
81
+ key: 0,
82
+ maxLength: e.maxLength,
83
+ placeholder: e.placeholder,
84
+ type: "text",
85
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => l.value = n)
86
+ }, null, 8, U)), [
87
+ [c, l.value]
88
+ ]) : d("", !0),
89
+ e.type === "textarea" ? f((s(), r("textarea", {
90
+ key: 1,
91
+ maxLength: e.maxLength,
92
+ placeholder: e.placeholder,
93
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => l.value = n)
94
+ }, null, 8, w)), [
95
+ [c, l.value]
96
+ ]) : d("", !0)
97
+ ])
98
+ ]),
99
+ _: 1
100
+ })
101
+ ]),
102
+ _: 1
103
+ })
104
+ ]));
105
+ }
106
+ }), q = /* @__PURE__ */ S($, [["__scopeId", "data-v-7962dc89"]]);
107
+ export {
108
+ q as default
109
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as s, inject as c, onMounted as a, createElementBlock as r, openBlock as p, createElementVNode as i, toDisplayString as _ } from "vue";
2
+ import { usePopup as d, POPUP_COMPONENT_INJECTS as m } from "vue-popup-plus";
3
+ import { _ as u } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const l = { class: "p-message" }, P = { class: "content" }, f = /* @__PURE__ */ s({
5
+ name: "PToast",
6
+ __name: "PToast",
7
+ props: {
8
+ content: {},
9
+ duration: {}
10
+ },
11
+ setup(t) {
12
+ const o = d(), e = c(m.INSTANCE_ID);
13
+ return a(() => {
14
+ window.setTimeout(() => {
15
+ o.destroy(e);
16
+ }, t.duration);
17
+ }), (n, T) => (p(), r("div", l, [
18
+ i("div", P, _(n.content), 1)
19
+ ]));
20
+ }
21
+ }), C = /* @__PURE__ */ u(f, [["__scopeId", "data-v-b7038c7b"]]);
22
+ export {
23
+ C as default
24
+ };
@@ -0,0 +1,9 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };