vue-popup-plus-plugin-preset 1.1.0 → 1.2.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/{PAlbum-BKExygsA.js → PAlbum-b5jZRPv8.js} +101 -101
- package/dist/PAlert-DUSrfEz4.js +67 -0
- package/dist/PBody-Ch7KaMyj.js +129 -0
- package/dist/PButtonGroup-DOwvv6ZF.js +80 -0
- package/dist/PConfirm-CoxIDGcj.js +79 -0
- package/dist/PDialog-Cmtvq1_n.js +72 -0
- package/dist/PLoadingMask-DNDEFOXq.js +61 -0
- package/dist/{PPrompt-D0wfhr75.js → PPrompt-DkI219wu.js} +35 -35
- package/dist/PToast-CTys_Qhv.js +24 -0
- package/dist/vue-popup-plus-plugin-preset.d.ts +10 -3
- package/dist/vue-popup-plus-plugin-preset.js +8 -8
- package/dist/vue-popup-plus-plugin-preset.umd.cjs +3 -3
- package/package.json +66 -67
- package/dist/PAlert-U35iHW1d.js +0 -67
- package/dist/PBody-B8SE3ACJ.js +0 -129
- package/dist/PButtonGroup-CfAPVmCi.js +0 -80
- package/dist/PConfirm-C7fPAwiu.js +0 -79
- package/dist/PDialog-Ch6TTWxG.js +0 -72
- package/dist/PLoadingMask-D37Mt0Yw.js +0 -61
- package/dist/PToast-WfcchnMz.js +0 -24
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { defineComponent as ee, inject as te, ref as c, computed as g, watch as ne, onBeforeMount as
|
|
1
|
+
import { defineComponent as ee, inject as te, ref as c, computed as g, watch as ne, onBeforeMount as le, onMounted as oe, onBeforeUnmount as ae, createElementBlock as o, openBlock as a, createElementVNode as v, createCommentVNode as d, Fragment as T, renderList as se, normalizeStyle as re, createTextVNode as ie, toDisplayString as B } from "vue";
|
|
2
2
|
import { usePopup as ue, POPUP_COMPONENT_INJECTS as ce } from "vue-popup-plus";
|
|
3
3
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
function
|
|
4
|
+
function ve(n) {
|
|
5
5
|
const t = Object.prototype.toString.call(n).match(/\s+(\w+)/);
|
|
6
6
|
return t ? t[1] : "Null";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function pe(n, {
|
|
9
9
|
allowCrossOrigin: t = !1,
|
|
10
|
-
fileName:
|
|
10
|
+
fileName: l = fe(n),
|
|
11
11
|
headers: u = {},
|
|
12
12
|
onSuccess: h = () => {
|
|
13
13
|
}
|
|
14
14
|
} = {}) {
|
|
15
15
|
try {
|
|
16
|
-
me(n) ?
|
|
17
|
-
} catch (
|
|
16
|
+
me(n) ? D() : t ? I() : window.open(n);
|
|
17
|
+
} catch (s) {
|
|
18
18
|
console.error(`free download error:
|
|
19
|
-
`,
|
|
19
|
+
`, s);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
function D() {
|
|
22
|
+
const s = document.createElement("a");
|
|
23
|
+
s.setAttribute("download", l), s.href = n, s.click(), h(l);
|
|
24
24
|
}
|
|
25
25
|
function I() {
|
|
26
|
-
let
|
|
26
|
+
let s;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
s = new XMLHttpRequest();
|
|
29
29
|
} catch {
|
|
30
30
|
throw new Error("当前浏览器不支持XMLHttpRequest,无法下载");
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
s.open("GET", n, !0), s.responseType = "blob";
|
|
33
33
|
for (const f in u)
|
|
34
|
-
Object.hasOwnProperty.call(u, f) &&
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
const f = window.URL.createObjectURL(
|
|
38
|
-
m.href = f, m.download =
|
|
34
|
+
Object.hasOwnProperty.call(u, f) && s.setRequestHeader(f, u[f]);
|
|
35
|
+
s.onload = function() {
|
|
36
|
+
if (s.status === 200) {
|
|
37
|
+
const f = window.URL.createObjectURL(s.response), m = document.createElement("a");
|
|
38
|
+
m.href = f, m.download = l, m.click(), h(l);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
try {
|
|
42
|
-
|
|
42
|
+
s.send();
|
|
43
43
|
} catch {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -48,8 +48,8 @@ function ve(n, {
|
|
|
48
48
|
function me(n) {
|
|
49
49
|
const t = new URL(window.location.href);
|
|
50
50
|
try {
|
|
51
|
-
const
|
|
52
|
-
return t.origin ===
|
|
51
|
+
const l = new URL(n);
|
|
52
|
+
return t.origin === l.origin;
|
|
53
53
|
} catch {
|
|
54
54
|
throw new Error(`错误的下载地址:${n}`);
|
|
55
55
|
}
|
|
@@ -62,13 +62,13 @@ function ye(n) {
|
|
|
62
62
|
}
|
|
63
63
|
function ge(n, t = !0) {
|
|
64
64
|
try {
|
|
65
|
-
const
|
|
66
|
-
return
|
|
65
|
+
const l = document.createElement(t ? "textarea" : "input");
|
|
66
|
+
return l.style.opacity = "0", l.style.height = "0px", l.style.border = "none", l.style.color = "transparent", l.style.position = "fixed", l.style.top = "-1000px", l.style.left = "-1000px", document.body.appendChild(l), l.value = n, l.focus(), l.select(), document.execCommand("copy"), l.blur(), document.body.removeChild(l), !0;
|
|
67
67
|
} catch {
|
|
68
68
|
return !1;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const p = {
|
|
72
72
|
IMAGE: "image",
|
|
73
73
|
VIDEO: "video",
|
|
74
74
|
PDF: "pdf",
|
|
@@ -81,25 +81,25 @@ const v = {
|
|
|
81
81
|
UNKNOWN: "unknown"
|
|
82
82
|
/* UNKNOWN */
|
|
83
83
|
}, z = /* @__PURE__ */ new Map([
|
|
84
|
-
[
|
|
84
|
+
[p.IMAGE, ["jpg", "jpeg", "png", "gif"]],
|
|
85
85
|
[
|
|
86
|
-
|
|
86
|
+
p.VIDEO,
|
|
87
87
|
["mp4", "flv", "rmvb", "wmv", "mov", "avi", "mpeg", "3gp"]
|
|
88
88
|
],
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
89
|
+
[p.PDF, ["pdf"]],
|
|
90
|
+
[p.WORD, ["doc", "docx"]],
|
|
91
|
+
[p.EXCEL, ["xls", "xlsx"]],
|
|
92
|
+
[p.PPT, ["ppt", "pptx"]],
|
|
93
93
|
[
|
|
94
|
-
|
|
94
|
+
p.ZIP,
|
|
95
95
|
["zip", "rar", "tar", "7z", "gz", "tgz", "bz", "bz2", "tbz"]
|
|
96
96
|
],
|
|
97
|
-
[
|
|
98
|
-
[
|
|
97
|
+
[p.TXT, ["txt"]],
|
|
98
|
+
[p.EXE, ["exe"]]
|
|
99
99
|
]);
|
|
100
|
-
class
|
|
100
|
+
class x {
|
|
101
101
|
// 文件类型
|
|
102
|
-
static FILE_TYPES =
|
|
102
|
+
static FILE_TYPES = p;
|
|
103
103
|
// 文件类型后缀映射
|
|
104
104
|
static FILE_TYPE_SUFFIX_MAP = z;
|
|
105
105
|
// 文件id
|
|
@@ -120,14 +120,14 @@ class D {
|
|
|
120
120
|
}
|
|
121
121
|
// 类型
|
|
122
122
|
get type() {
|
|
123
|
-
for (const [t,
|
|
124
|
-
if (
|
|
123
|
+
for (const [t, l] of z)
|
|
124
|
+
if (l.some((u) => u === this.suffix))
|
|
125
125
|
return t;
|
|
126
|
-
return
|
|
126
|
+
return p.UNKNOWN;
|
|
127
127
|
}
|
|
128
128
|
constructor(t) {
|
|
129
|
-
if (t instanceof
|
|
130
|
-
switch (
|
|
129
|
+
if (t instanceof x) return t;
|
|
130
|
+
switch (ve(t)) {
|
|
131
131
|
case "String":
|
|
132
132
|
this.createdByUrl(t);
|
|
133
133
|
break;
|
|
@@ -180,10 +180,10 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
180
180
|
}, Ee = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "info count"
|
|
183
|
-
}, ke = { class: "current" },
|
|
183
|
+
}, ke = { class: "current" }, xe = {
|
|
184
184
|
key: 1,
|
|
185
185
|
class: "emyty"
|
|
186
|
-
},
|
|
186
|
+
}, De = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "tools left"
|
|
189
189
|
}, Ie = {
|
|
@@ -212,9 +212,9 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
212
212
|
dragDisabled: { type: Boolean }
|
|
213
213
|
},
|
|
214
214
|
setup(n) {
|
|
215
|
-
const t = ue(),
|
|
216
|
-
() => n.sources.map((
|
|
217
|
-
(
|
|
215
|
+
const t = ue(), l = te(ce.INSTANCE_ID), u = c(n.defaultIndex), h = c(1), D = c(30), I = c(0.01), s = c(3), f = c(1.5), m = c(h.value), k = c(!1), O = c(0), P = c(0), L = c(0), N = c(0), S = c(0), U = c(0), y = c(!1), w = g(() => x.FILE_TYPES), b = g(
|
|
216
|
+
() => n.sources.map((i) => new x(i)).filter(
|
|
217
|
+
(i) => [w.value.IMAGE, w.value.VIDEO].includes(i.type)
|
|
218
218
|
)
|
|
219
219
|
), E = g(() => b.value[u.value]), A = g(() => ({
|
|
220
220
|
transform: `translate(${S.value}px, ${U.value}px) scale(${m.value})`,
|
|
@@ -226,11 +226,11 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
226
226
|
);
|
|
227
227
|
ne(u, () => {
|
|
228
228
|
G();
|
|
229
|
-
}), oe(() => {
|
|
230
|
-
n.defaultIndex >= 0 && n.defaultIndex < b.value.length && (u.value = n.defaultIndex);
|
|
231
229
|
}), le(() => {
|
|
230
|
+
n.defaultIndex >= 0 && n.defaultIndex < b.value.length && (u.value = n.defaultIndex);
|
|
231
|
+
}), oe(() => {
|
|
232
232
|
window.addEventListener("mousemove", F), window.addEventListener("mouseup", $);
|
|
233
|
-
}),
|
|
233
|
+
}), ae(() => {
|
|
234
234
|
window.removeEventListener("mousemove", F), window.removeEventListener("mouseup", $);
|
|
235
235
|
});
|
|
236
236
|
function Y() {
|
|
@@ -239,10 +239,10 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
239
239
|
function V() {
|
|
240
240
|
u.value++;
|
|
241
241
|
}
|
|
242
|
-
function M(
|
|
243
|
-
C.value && (
|
|
242
|
+
function M(i, e = s.value) {
|
|
243
|
+
C.value && (i ? m.value = Math.min(
|
|
244
244
|
m.value * e,
|
|
245
|
-
|
|
245
|
+
D.value
|
|
246
246
|
) : m.value = Math.max(
|
|
247
247
|
m.value / e,
|
|
248
248
|
I.value
|
|
@@ -251,16 +251,16 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
251
251
|
function G() {
|
|
252
252
|
m.value = h.value;
|
|
253
253
|
}
|
|
254
|
-
function W(
|
|
254
|
+
function W(i) {
|
|
255
255
|
if (n.scaleDisabled) return;
|
|
256
|
-
const e =
|
|
256
|
+
const e = i.wheelDelta > 0;
|
|
257
257
|
M(e, f.value);
|
|
258
258
|
}
|
|
259
|
-
function q(
|
|
260
|
-
n.dragDisabled || (O.value =
|
|
259
|
+
function q(i) {
|
|
260
|
+
n.dragDisabled || (O.value = i.clientX, P.value = i.clientY, k.value = !0, i.stopPropagation(), i.preventDefault());
|
|
261
261
|
}
|
|
262
|
-
function F(
|
|
263
|
-
k.value && (S.value = L.value +
|
|
262
|
+
function F(i) {
|
|
263
|
+
k.value && (S.value = L.value + i.clientX - O.value, U.value = N.value + i.clientY - P.value);
|
|
264
264
|
}
|
|
265
265
|
function $() {
|
|
266
266
|
O.value = 0, P.value = 0, L.value = S.value, N.value = U.value, k.value = !1;
|
|
@@ -275,34 +275,34 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
275
275
|
y.value && (y.value = !1, t.toast("退出纯净模式"));
|
|
276
276
|
}
|
|
277
277
|
function Z() {
|
|
278
|
-
n.downloadDisabled ||
|
|
278
|
+
n.downloadDisabled || pe(E.value.url, {
|
|
279
279
|
allowCrossOrigin: !0
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
function Q() {
|
|
283
|
-
t.destroy(
|
|
283
|
+
t.destroy(l);
|
|
284
284
|
}
|
|
285
|
-
return (
|
|
285
|
+
return (i, e) => (a(), o("div", {
|
|
286
286
|
class: "p-media-album",
|
|
287
|
-
onDblclick: e[10] || (e[10] = (
|
|
287
|
+
onDblclick: e[10] || (e[10] = (r) => K())
|
|
288
288
|
}, [
|
|
289
|
-
|
|
289
|
+
v("div", {
|
|
290
290
|
class: "media",
|
|
291
|
-
onWheel: e[1] || (e[1] = (
|
|
291
|
+
onWheel: e[1] || (e[1] = (r) => W(r))
|
|
292
292
|
}, [
|
|
293
|
-
(a(!0),
|
|
294
|
-
X === u.value ? (a(),
|
|
295
|
-
|
|
296
|
-
key: `media-${X}-${
|
|
297
|
-
src:
|
|
293
|
+
(a(!0), o(T, null, se(b.value, (r, X) => (a(), o(T, null, [
|
|
294
|
+
X === u.value ? (a(), o(T, { key: 0 }, [
|
|
295
|
+
r.type === w.value.IMAGE ? (a(), o("img", {
|
|
296
|
+
key: `media-${X}-${r.url}`,
|
|
297
|
+
src: r.url,
|
|
298
298
|
style: re(A.value),
|
|
299
299
|
onMousedown: e[0] || (e[0] = (_) => q(_)),
|
|
300
300
|
dragable: "false"
|
|
301
301
|
}, null, 44, be)) : d("", !0),
|
|
302
|
-
|
|
302
|
+
r.type === w.value.VIDEO ? (a(), o("video", {
|
|
303
303
|
key: 1,
|
|
304
|
-
poster:
|
|
305
|
-
src:
|
|
304
|
+
poster: r.poster,
|
|
305
|
+
src: r.url,
|
|
306
306
|
controls: "",
|
|
307
307
|
controlslist: "nodownload noremoteplayback noplaybackrate",
|
|
308
308
|
disablePictureInPicture: "",
|
|
@@ -311,71 +311,71 @@ const be = ["src"], he = ["poster", "src"], we = {
|
|
|
311
311
|
], 64)) : d("", !0)
|
|
312
312
|
], 64))), 256))
|
|
313
313
|
], 32),
|
|
314
|
-
y.value ? d("", !0) : (a(),
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
y.value ? d("", !0) : (a(), o("div", we, [
|
|
315
|
+
n.countDisabled ? (a(), o("div", xe)) : (a(), o("div", Ee, [
|
|
316
|
+
v("span", ke, B(`${u.value + 1} `), 1),
|
|
317
317
|
ie("/ " + B(b.value.length), 1)
|
|
318
318
|
])),
|
|
319
|
-
|
|
319
|
+
n.nameDisabled ? d("", !0) : (a(), o("div", {
|
|
320
320
|
key: 2,
|
|
321
321
|
class: "control name",
|
|
322
|
-
onClick: e[2] || (e[2] = (
|
|
322
|
+
onClick: e[2] || (e[2] = (r) => H())
|
|
323
323
|
}, B(E.value.name), 1)),
|
|
324
|
-
|
|
324
|
+
v("div", {
|
|
325
325
|
class: "control close",
|
|
326
|
-
onClick: e[3] || (e[3] = (
|
|
326
|
+
onClick: e[3] || (e[3] = (r) => Q())
|
|
327
327
|
}, [...e[11] || (e[11] = [
|
|
328
|
-
|
|
328
|
+
v("i", { class: "iconfont-popup-plugin-preset album-close" }, null, -1)
|
|
329
329
|
])])
|
|
330
330
|
])),
|
|
331
|
-
y.value ? d("", !0) : (a(),
|
|
332
|
-
j.value ? (a(),
|
|
331
|
+
y.value ? d("", !0) : (a(), o("div", De, [
|
|
332
|
+
j.value ? (a(), o("div", {
|
|
333
333
|
key: 0,
|
|
334
334
|
class: "control back",
|
|
335
|
-
onClick: e[4] || (e[4] = (
|
|
335
|
+
onClick: e[4] || (e[4] = (r) => Y())
|
|
336
336
|
}, [...e[12] || (e[12] = [
|
|
337
|
-
|
|
337
|
+
v("i", { class: "iconfont-popup-plugin-preset album-prev" }, null, -1)
|
|
338
338
|
])])) : d("", !0)
|
|
339
339
|
])),
|
|
340
|
-
y.value ? d("", !0) : (a(),
|
|
341
|
-
R.value ? (a(),
|
|
340
|
+
y.value ? d("", !0) : (a(), o("div", Ie, [
|
|
341
|
+
R.value ? (a(), o("div", {
|
|
342
342
|
key: 0,
|
|
343
343
|
class: "control next",
|
|
344
|
-
onClick: e[5] || (e[5] = (
|
|
344
|
+
onClick: e[5] || (e[5] = (r) => V())
|
|
345
345
|
}, [...e[13] || (e[13] = [
|
|
346
|
-
|
|
346
|
+
v("i", { class: "iconfont-popup-plugin-preset album-next" }, null, -1)
|
|
347
347
|
])])) : d("", !0)
|
|
348
348
|
])),
|
|
349
|
-
y.value ? d("", !0) : (a(),
|
|
350
|
-
|
|
349
|
+
y.value ? d("", !0) : (a(), o("div", Oe, [
|
|
350
|
+
n.pureDisabled ? (a(), o("div", Pe)) : (a(), o("div", {
|
|
351
351
|
key: 0,
|
|
352
352
|
class: "control",
|
|
353
|
-
onClick: e[6] || (e[6] = (
|
|
353
|
+
onClick: e[6] || (e[6] = (r) => J())
|
|
354
354
|
}, [...e[14] || (e[14] = [
|
|
355
|
-
|
|
355
|
+
v("i", { class: "iconfont-popup-plugin-preset album-pure" }, null, -1)
|
|
356
356
|
])])),
|
|
357
|
-
|
|
358
|
-
!
|
|
357
|
+
v("div", Se, [
|
|
358
|
+
!n.scaleDisabled && C.value ? (a(), o("div", {
|
|
359
359
|
key: 0,
|
|
360
360
|
class: "control",
|
|
361
|
-
onClick: e[7] || (e[7] = (
|
|
361
|
+
onClick: e[7] || (e[7] = (r) => M(!0, s.value))
|
|
362
362
|
}, [...e[15] || (e[15] = [
|
|
363
|
-
|
|
363
|
+
v("i", { class: "iconfont-popup-plugin-preset album-enlarge" }, null, -1)
|
|
364
364
|
])])) : d("", !0),
|
|
365
|
-
!
|
|
365
|
+
!n.scaleDisabled && C.value ? (a(), o("div", {
|
|
366
366
|
key: 1,
|
|
367
367
|
class: "control",
|
|
368
|
-
onClick: e[8] || (e[8] = (
|
|
368
|
+
onClick: e[8] || (e[8] = (r) => M(!1, s.value))
|
|
369
369
|
}, [...e[16] || (e[16] = [
|
|
370
|
-
|
|
370
|
+
v("i", { class: "iconfont-popup-plugin-preset album-narrow" }, null, -1)
|
|
371
371
|
])])) : d("", !0)
|
|
372
372
|
]),
|
|
373
|
-
|
|
373
|
+
n.downloadDisabled ? (a(), o("div", Ue)) : (a(), o("div", {
|
|
374
374
|
key: 2,
|
|
375
375
|
class: "control download",
|
|
376
|
-
onClick: e[9] || (e[9] = (
|
|
376
|
+
onClick: e[9] || (e[9] = (r) => Z())
|
|
377
377
|
}, [...e[17] || (e[17] = [
|
|
378
|
-
|
|
378
|
+
v("i", { class: "iconfont-popup-plugin-preset download" }, null, -1)
|
|
379
379
|
])]))
|
|
380
380
|
]))
|
|
381
381
|
], 32));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as d, inject as c, createElementBlock as m, openBlock as f, createVNode as e, withCtx as t, createElementVNode as u, toDisplayString as r, createTextVNode as p } from "vue";
|
|
2
|
+
import { usePopup as P, POPUP_COMPONENT_INJECTS as _ } from "vue-popup-plus";
|
|
3
|
+
import { P as g, a as C, b as N } from "./PBody-Ch7KaMyj.js";
|
|
4
|
+
import { P as x } from "./PFooter-Dd8fzezl.js";
|
|
5
|
+
import { P as B, a as T } from "./PButtonGroup-DOwvv6ZF.js";
|
|
6
|
+
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const v = { class: "p-alert" }, y = { class: "content" }, E = /* @__PURE__ */ d({
|
|
8
|
+
name: "PAlert",
|
|
9
|
+
__name: "PAlert",
|
|
10
|
+
props: {
|
|
11
|
+
title: {},
|
|
12
|
+
content: {},
|
|
13
|
+
confirmText: {},
|
|
14
|
+
draggable: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
setup(o) {
|
|
17
|
+
const l = P(), i = c(_.INSTANCE_ID);
|
|
18
|
+
function a() {
|
|
19
|
+
l.destroy(i);
|
|
20
|
+
}
|
|
21
|
+
return (I, n) => (f(), m("div", v, [
|
|
22
|
+
e(g, null, {
|
|
23
|
+
header: t(() => [
|
|
24
|
+
e(N, {
|
|
25
|
+
draggable: o.draggable,
|
|
26
|
+
title: o.title,
|
|
27
|
+
onClose: n[0] || (n[0] = (s) => a()),
|
|
28
|
+
iconClass: "alert"
|
|
29
|
+
}, null, 8, ["draggable", "title"])
|
|
30
|
+
]),
|
|
31
|
+
footer: t(() => [
|
|
32
|
+
e(x, null, {
|
|
33
|
+
default: t(() => [
|
|
34
|
+
e(B, { align: "right" }, {
|
|
35
|
+
default: t(() => [
|
|
36
|
+
e(T, {
|
|
37
|
+
onClick: n[1] || (n[1] = (s) => a()),
|
|
38
|
+
theme: "primary"
|
|
39
|
+
}, {
|
|
40
|
+
default: t(() => [
|
|
41
|
+
p(r(o.confirmText), 1)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
})
|
|
45
|
+
]),
|
|
46
|
+
_: 1
|
|
47
|
+
})
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
})
|
|
51
|
+
]),
|
|
52
|
+
default: t(() => [
|
|
53
|
+
e(C, null, {
|
|
54
|
+
default: t(() => [
|
|
55
|
+
u("div", y, r(o.content), 1)
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
})
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
}), D = /* @__PURE__ */ b(E, [["__scopeId", "data-v-1501446e"]]);
|
|
65
|
+
export {
|
|
66
|
+
D as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineComponent as p, createElementBlock as r, openBlock as o, renderSlot as c, createElementVNode as u, useCssVars as I, computed as w, withModifiers as N, normalizeClass as f, inject as E, ref as s, watch as T, createCommentVNode as S, toDisplayString as H, createBlock as z } from "vue";
|
|
2
|
+
import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
import { usePopup as L, POPUP_COMPONENT_INJECTS as k } from "vue-popup-plus";
|
|
4
|
+
const V = { class: "p-scaffold" }, x = { class: "body" }, j = /* @__PURE__ */ p({
|
|
5
|
+
name: "PScaffold",
|
|
6
|
+
__name: "PScaffold",
|
|
7
|
+
setup(e) {
|
|
8
|
+
return (a, l) => (o(), r("div", V, [
|
|
9
|
+
c(a.$slots, "header", {}, void 0, !0),
|
|
10
|
+
u("div", x, [
|
|
11
|
+
c(a.$slots, "default", {}, void 0, !0)
|
|
12
|
+
]),
|
|
13
|
+
c(a.$slots, "footer", {}, void 0, !0)
|
|
14
|
+
]));
|
|
15
|
+
}
|
|
16
|
+
}), Z = /* @__PURE__ */ g(j, [["__scopeId", "data-v-04880725"]]), U = /* @__PURE__ */ p({
|
|
17
|
+
name: "PHeaderButton",
|
|
18
|
+
__name: "PHeaderButton",
|
|
19
|
+
props: {
|
|
20
|
+
iconClass: { default: "" },
|
|
21
|
+
theme: { default: "primary" },
|
|
22
|
+
size: { default: 40 },
|
|
23
|
+
disabled: { type: Boolean, default: !1 },
|
|
24
|
+
actived: { type: Boolean, default: !1 }
|
|
25
|
+
},
|
|
26
|
+
emits: ["click"],
|
|
27
|
+
setup(e, { emit: a }) {
|
|
28
|
+
I((i) => ({
|
|
29
|
+
v2f05293a: `${i.size}px`,
|
|
30
|
+
v45c9dc5a: `${v.value}px`
|
|
31
|
+
}));
|
|
32
|
+
const l = a, h = w(() => ({
|
|
33
|
+
[`is-theme-${e.theme}`]: !0,
|
|
34
|
+
"is-disabled": e.disabled,
|
|
35
|
+
"is-active": e.actived
|
|
36
|
+
})), v = w(() => e.size * 0.4);
|
|
37
|
+
function C() {
|
|
38
|
+
e.disabled || l("click");
|
|
39
|
+
}
|
|
40
|
+
return (i, d) => (o(), r("div", {
|
|
41
|
+
class: f(["p-header-button", h.value]),
|
|
42
|
+
onClick: d[0] || (d[0] = N((P) => C(), ["stop"]))
|
|
43
|
+
}, [
|
|
44
|
+
u("i", {
|
|
45
|
+
class: f(["iconfont-popup-plugin-preset", e.iconClass])
|
|
46
|
+
}, null, 2)
|
|
47
|
+
], 2));
|
|
48
|
+
}
|
|
49
|
+
}), A = /* @__PURE__ */ g(U, [["__scopeId", "data-v-1eaab056"]]), J = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "icon"
|
|
52
|
+
}, W = { class: "title" }, q = { class: "btn-ctn" }, F = /* @__PURE__ */ p({
|
|
53
|
+
name: "PHeader",
|
|
54
|
+
__name: "PHeader",
|
|
55
|
+
props: {
|
|
56
|
+
title: { default: "" },
|
|
57
|
+
height: { default: 40 },
|
|
58
|
+
iconClass: { default: "" },
|
|
59
|
+
hasCloseButton: { type: Boolean, default: !0 },
|
|
60
|
+
draggable: { type: Boolean, default: !1 }
|
|
61
|
+
},
|
|
62
|
+
emits: ["close"],
|
|
63
|
+
setup(e, { emit: a }) {
|
|
64
|
+
I((t) => ({
|
|
65
|
+
v3b2e1e40: `${t.height}px`
|
|
66
|
+
}));
|
|
67
|
+
const l = L(), h = E(k.INSTANCE_ID), v = E(k.COMPUTED_VIEW_STYLE), C = a, i = s(0), d = s(0), P = s(0), $ = s(0), _ = s(0), b = s(0), B = s(!1), Y = w(() => !!e.iconClass);
|
|
68
|
+
T([_, b], M);
|
|
69
|
+
function D() {
|
|
70
|
+
e.hasCloseButton && C("close");
|
|
71
|
+
}
|
|
72
|
+
function X(t) {
|
|
73
|
+
e.draggable && (i.value = t.clientX, d.value = t.clientY, P.value = v.value.translateX, $.value = v.value.translateY, B.value = !0, t.preventDefault(), window.addEventListener("mousemove", y), window.addEventListener("mouseup", O));
|
|
74
|
+
}
|
|
75
|
+
function y(t) {
|
|
76
|
+
if (!B.value) return;
|
|
77
|
+
const n = t.clientX - i.value, m = t.clientY - d.value;
|
|
78
|
+
_.value = P.value + n, b.value = $.value + m;
|
|
79
|
+
}
|
|
80
|
+
function O(t) {
|
|
81
|
+
B.value = !1, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", O);
|
|
82
|
+
}
|
|
83
|
+
function M() {
|
|
84
|
+
l.update(h, {
|
|
85
|
+
viewTranslateX: _.value,
|
|
86
|
+
viewTranslateY: b.value
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return (t, n) => (o(), r("div", {
|
|
90
|
+
class: f(["p-header", { "is-draggable": e.draggable }]),
|
|
91
|
+
onMousedown: n[1] || (n[1] = (m) => X(m))
|
|
92
|
+
}, [
|
|
93
|
+
Y.value ? (o(), r("div", J, [
|
|
94
|
+
u("i", {
|
|
95
|
+
class: f(["iconfont-popup-plugin-preset", e.iconClass])
|
|
96
|
+
}, null, 2)
|
|
97
|
+
])) : S("", !0),
|
|
98
|
+
u("div", W, H(e.title), 1),
|
|
99
|
+
u("div", q, [
|
|
100
|
+
c(t.$slots, "buttons", {}, void 0, !0),
|
|
101
|
+
e.hasCloseButton ? (o(), z(A, {
|
|
102
|
+
key: 0,
|
|
103
|
+
onClick: n[0] || (n[0] = (m) => D()),
|
|
104
|
+
iconClass: "close",
|
|
105
|
+
theme: "danger"
|
|
106
|
+
})) : S("", !0)
|
|
107
|
+
])
|
|
108
|
+
], 34));
|
|
109
|
+
}
|
|
110
|
+
}), ee = /* @__PURE__ */ g(F, [["__scopeId", "data-v-fcc3fa94"]]), G = /* @__PURE__ */ p({
|
|
111
|
+
name: "PBody",
|
|
112
|
+
__name: "PBody",
|
|
113
|
+
props: {
|
|
114
|
+
withPadding: { type: Boolean, default: !0 }
|
|
115
|
+
},
|
|
116
|
+
setup(e) {
|
|
117
|
+
return (a, l) => (o(), r("div", {
|
|
118
|
+
class: f(["p-body", { "has-padding": e.withPadding }])
|
|
119
|
+
}, [
|
|
120
|
+
c(a.$slots, "default", {}, void 0, !0)
|
|
121
|
+
], 2));
|
|
122
|
+
}
|
|
123
|
+
}), te = /* @__PURE__ */ g(G, [["__scopeId", "data-v-a8f5570e"]]);
|
|
124
|
+
export {
|
|
125
|
+
Z as P,
|
|
126
|
+
te as a,
|
|
127
|
+
ee as b,
|
|
128
|
+
A as c
|
|
129
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as b, inject as r, useTemplateRef as T, computed as d, createElementBlock as n, openBlock as o, normalizeClass as B, renderSlot as v, useSlots as G, provide as c, onMounted as P, Fragment as h, renderList as $, createBlock as C, createCommentVNode as j, resolveDynamicComponent as w } from "vue";
|
|
2
|
+
import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const I = ["disabled"], M = /* @__PURE__ */ b({
|
|
4
|
+
name: "PButton",
|
|
5
|
+
__name: "PButton",
|
|
6
|
+
props: {
|
|
7
|
+
type: {},
|
|
8
|
+
theme: {},
|
|
9
|
+
size: {},
|
|
10
|
+
disabled: { type: Boolean, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["click"],
|
|
13
|
+
setup(e, { emit: u }) {
|
|
14
|
+
r(t.inButtonGroup, !1);
|
|
15
|
+
const l = r(t.groupType, "default"), p = r(t.groupTheme, "default"), m = r(t.groupSize, "default"), s = T("button"), a = u, f = d(() => window.innerWidth <= 600), i = d(() => ({
|
|
16
|
+
[`is-type-${e.type || l}`]: !0,
|
|
17
|
+
[`is-theme-${e.theme || p}`]: !0,
|
|
18
|
+
[`is-size-${e.size || m}`]: !0,
|
|
19
|
+
"is-mobile": f.value
|
|
20
|
+
}));
|
|
21
|
+
function k(g) {
|
|
22
|
+
a("click", g), s.value?.blur();
|
|
23
|
+
}
|
|
24
|
+
return (g, y) => (o(), n("button", {
|
|
25
|
+
class: B(["p-button", i.value]),
|
|
26
|
+
disabled: e.disabled,
|
|
27
|
+
onClick: y[0] || (y[0] = (z) => k(z)),
|
|
28
|
+
ref: "button"
|
|
29
|
+
}, [
|
|
30
|
+
v(g.$slots, "default", {}, void 0, !0)
|
|
31
|
+
], 10, I));
|
|
32
|
+
}
|
|
33
|
+
}), O = /* @__PURE__ */ S(M, [["__scopeId", "data-v-cc483dcd"]]), R = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "cutline"
|
|
36
|
+
}, t = {
|
|
37
|
+
inButtonGroup: Symbol("inButtonGroup"),
|
|
38
|
+
groupType: Symbol("groupType"),
|
|
39
|
+
groupTheme: Symbol("groupTheme"),
|
|
40
|
+
groupSize: Symbol("groupSize")
|
|
41
|
+
}, x = /* @__PURE__ */ b({
|
|
42
|
+
name: "PButtonGroup",
|
|
43
|
+
__name: "PButtonGroup",
|
|
44
|
+
props: {
|
|
45
|
+
type: { default: "default" },
|
|
46
|
+
theme: { default: "default" },
|
|
47
|
+
size: { default: "default" },
|
|
48
|
+
align: { default: "left" },
|
|
49
|
+
tight: { type: Boolean, default: !1 },
|
|
50
|
+
cutline: { type: Boolean, default: !1 }
|
|
51
|
+
},
|
|
52
|
+
setup(e) {
|
|
53
|
+
const u = G(), l = d(() => e.cutline && !e.tight), p = d(() => ({
|
|
54
|
+
[`align-${e.align}`]: !0,
|
|
55
|
+
"is-tight": e.tight,
|
|
56
|
+
"has-cutline": l.value
|
|
57
|
+
}));
|
|
58
|
+
c(t.inButtonGroup, !0), c(t.groupType, e.type), c(t.groupTheme, e.theme), c(t.groupSize, e.size), P(() => {
|
|
59
|
+
m();
|
|
60
|
+
});
|
|
61
|
+
function m() {
|
|
62
|
+
u.default().some((a) => {
|
|
63
|
+
a.type;
|
|
64
|
+
}) && console.warn("PButtonGroup 只能包含 PButton 组件");
|
|
65
|
+
}
|
|
66
|
+
return (s, a) => (o(), n("div", {
|
|
67
|
+
class: B(["p-button-group", p.value]),
|
|
68
|
+
ref: "group"
|
|
69
|
+
}, [
|
|
70
|
+
l.value ? (o(!0), n(h, { key: 0 }, $(u.default?.(), (f, i) => (o(), n(h, { key: i }, [
|
|
71
|
+
(o(), C(w(f))),
|
|
72
|
+
i < (u.default?.() || []).length - 1 ? (o(), n("div", R)) : j("", !0)
|
|
73
|
+
], 64))), 128)) : v(s.$slots, "default", { key: 1 }, void 0, !0)
|
|
74
|
+
], 2));
|
|
75
|
+
}
|
|
76
|
+
}), F = /* @__PURE__ */ S(x, [["__scopeId", "data-v-8d80b617"]]);
|
|
77
|
+
export {
|
|
78
|
+
F as P,
|
|
79
|
+
O as a
|
|
80
|
+
};
|