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,386 @@
1
+ import { defineComponent as ee, inject as te, ref as c, computed as g, watch as ne, onBeforeMount as oe, onMounted as le, onBeforeUnmount as se, createElementBlock as s, openBlock as a, createElementVNode as p, createCommentVNode as d, Fragment as T, renderList as ae, normalizeStyle as re, createTextVNode as ie, toDisplayString as B } from "vue";
2
+ import { usePopup as ue, POPUP_COMPONENT_INJECTS as ce } from "vue-popup-plus";
3
+ import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ function pe(n) {
5
+ const t = Object.prototype.toString.call(n).match(/\s+(\w+)/);
6
+ return t ? t[1] : "Null";
7
+ }
8
+ function ve(n, {
9
+ allowCrossOrigin: t = !1,
10
+ fileName: o = fe(n),
11
+ headers: u = {},
12
+ onSuccess: h = () => {
13
+ }
14
+ } = {}) {
15
+ try {
16
+ me(n) ? x() : t ? I() : window.open(n);
17
+ } catch (r) {
18
+ console.error(`free download error:
19
+ `, r);
20
+ }
21
+ function x() {
22
+ const r = document.createElement("a");
23
+ r.setAttribute("download", o), r.href = n, r.click(), h(o);
24
+ }
25
+ function I() {
26
+ let r;
27
+ try {
28
+ r = new XMLHttpRequest();
29
+ } catch {
30
+ throw new Error("当前浏览器不支持XMLHttpRequest,无法下载");
31
+ }
32
+ r.open("GET", n, !0), r.responseType = "blob";
33
+ for (const f in u)
34
+ Object.hasOwnProperty.call(u, f) && r.setRequestHeader(f, u[f]);
35
+ r.onload = function() {
36
+ if (r.status === 200) {
37
+ const f = window.URL.createObjectURL(r.response), m = document.createElement("a");
38
+ m.href = f, m.download = o, m.click(), h(o);
39
+ }
40
+ };
41
+ try {
42
+ r.send();
43
+ } catch {
44
+ return;
45
+ }
46
+ }
47
+ }
48
+ function me(n) {
49
+ const t = new URL(window.location.href);
50
+ try {
51
+ const o = new URL(n);
52
+ return t.origin === o.origin;
53
+ } catch {
54
+ throw new Error(`错误的下载地址:${n}`);
55
+ }
56
+ }
57
+ function fe(n) {
58
+ return n.split("/")[n.split("/").length - 1] || "";
59
+ }
60
+ function ye(n) {
61
+ return n.split(".")[n.split(".").length - 1] || "";
62
+ }
63
+ function ge(n, t = !0) {
64
+ try {
65
+ const o = document.createElement(t ? "textarea" : "input");
66
+ return o.style.opacity = "0", o.style.height = "0px", o.style.border = "none", o.style.color = "transparent", o.style.position = "fixed", o.style.top = "-1000px", o.style.left = "-1000px", document.body.appendChild(o), o.value = n, o.focus(), o.select(), document.execCommand("copy"), o.blur(), document.body.removeChild(o), !0;
67
+ } catch {
68
+ return !1;
69
+ }
70
+ }
71
+ const v = {
72
+ IMAGE: "image",
73
+ VIDEO: "video",
74
+ PDF: "pdf",
75
+ WORD: "word",
76
+ EXCEL: "excel",
77
+ PPT: "ppt",
78
+ ZIP: "zip",
79
+ TXT: "txt",
80
+ EXE: "exe",
81
+ UNKNOWN: "unknown"
82
+ /* UNKNOWN */
83
+ }, z = /* @__PURE__ */ new Map([
84
+ [v.IMAGE, ["jpg", "jpeg", "png", "gif"]],
85
+ [
86
+ v.VIDEO,
87
+ ["mp4", "flv", "rmvb", "wmv", "mov", "avi", "mpeg", "3gp"]
88
+ ],
89
+ [v.PDF, ["pdf"]],
90
+ [v.WORD, ["doc", "docx"]],
91
+ [v.EXCEL, ["xls", "xlsx"]],
92
+ [v.PPT, ["ppt", "pptx"]],
93
+ [
94
+ v.ZIP,
95
+ ["zip", "rar", "tar", "7z", "gz", "tgz", "bz", "bz2", "tbz"]
96
+ ],
97
+ [v.TXT, ["txt"]],
98
+ [v.EXE, ["exe"]]
99
+ ]);
100
+ class D {
101
+ // 文件类型
102
+ static FILE_TYPES = v;
103
+ // 文件类型后缀映射
104
+ static FILE_TYPE_SUFFIX_MAP = z;
105
+ // 文件id
106
+ id = "";
107
+ // 文件地址
108
+ url = "";
109
+ // 文件名
110
+ name = "";
111
+ // 文件大小
112
+ size = "";
113
+ // 视频封面,仅视频文件该属性有值
114
+ poster = "";
115
+ // 创建时间
116
+ createTime = "";
117
+ // 后缀
118
+ get suffix() {
119
+ return ye(this.url).toLowerCase();
120
+ }
121
+ // 类型
122
+ get type() {
123
+ for (const [t, o] of z)
124
+ if (o.some((u) => u === this.suffix))
125
+ return t;
126
+ return v.UNKNOWN;
127
+ }
128
+ constructor(t) {
129
+ if (t instanceof D) return t;
130
+ switch (pe(t)) {
131
+ case "String":
132
+ this.createdByUrl(t);
133
+ break;
134
+ case "Object":
135
+ this.createdByObject(t);
136
+ break;
137
+ default:
138
+ throw new Error(
139
+ "[File]类实例化参数错误,仅支持String和Object类型。"
140
+ );
141
+ }
142
+ }
143
+ toJSON() {
144
+ return {
145
+ id: this.id,
146
+ name: this.name,
147
+ url: this.url,
148
+ size: this.size,
149
+ poster: this.poster,
150
+ createTime: this.createTime
151
+ };
152
+ }
153
+ createdByUrl(t) {
154
+ this.url = t, this.name = this.getNameByUrl();
155
+ }
156
+ createdByObject(t) {
157
+ if (t.mediaFormat) {
158
+ this.createByPhoneEventMedia(t);
159
+ return;
160
+ }
161
+ this.id = t.id, this.url = t.url, this.name = t.name || this.getNameByUrl(), this.size = t.size, this.poster = t.poster, this.createTime = t.createTime;
162
+ }
163
+ createByPhoneEventMedia(t) {
164
+ switch (t.mediaFormat) {
165
+ case 1:
166
+ this.url = t.imgUrl, this.name = this.getNameByUrl();
167
+ break;
168
+ case 2:
169
+ this.url = t.videoUrl, this.name = this.getNameByUrl(), this.poster = t.imgUrl;
170
+ break;
171
+ }
172
+ }
173
+ getNameByUrl() {
174
+ return this.url.split("/")[this.url.split("/").length - 1] || "";
175
+ }
176
+ }
177
+ const be = ["src"], he = ["poster", "src"], we = {
178
+ key: 0,
179
+ class: "tools top"
180
+ }, Ee = {
181
+ key: 0,
182
+ class: "info count"
183
+ }, ke = { class: "current" }, De = {
184
+ key: 1,
185
+ class: "emyty"
186
+ }, xe = {
187
+ key: 1,
188
+ class: "tools left"
189
+ }, Ie = {
190
+ key: 2,
191
+ class: "tools right"
192
+ }, Oe = {
193
+ key: 3,
194
+ class: "tools bottom"
195
+ }, Pe = {
196
+ key: 1,
197
+ class: "emyty"
198
+ }, Se = { class: "center" }, Ue = {
199
+ key: 3,
200
+ class: "emyty"
201
+ }, Ce = /* @__PURE__ */ ee({
202
+ name: "PAlbum",
203
+ __name: "PAlbum",
204
+ props: {
205
+ sources: {},
206
+ defaultIndex: {},
207
+ countDisabled: { type: Boolean },
208
+ nameDisabled: { type: Boolean },
209
+ downloadDisabled: { type: Boolean },
210
+ pureDisabled: { type: Boolean },
211
+ scaleDisabled: { type: Boolean },
212
+ dragDisabled: { type: Boolean }
213
+ },
214
+ setup(n) {
215
+ const t = ue(), o = te(ce.INSTANCE_ID), u = c(n.defaultIndex), h = c(1), x = c(30), I = c(0.01), r = 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(() => D.FILE_TYPES), b = g(
216
+ () => n.sources.map((l) => new D(l)).filter(
217
+ (l) => [w.value.IMAGE, w.value.VIDEO].includes(l.type)
218
+ )
219
+ ), E = g(() => b.value[u.value]), A = g(() => ({
220
+ transform: `translate(${S.value}px, ${U.value}px) scale(${m.value})`,
221
+ transitionDuration: k.value ? "0s" : void 0
222
+ })), j = g(() => u.value !== 0), R = g(
223
+ () => u.value !== b.value.length - 1 && b.value.length
224
+ ), C = g(
225
+ () => E.value && E.value.type === w.value.IMAGE
226
+ );
227
+ ne(u, () => {
228
+ G();
229
+ }), oe(() => {
230
+ n.defaultIndex >= 0 && n.defaultIndex < b.value.length && (u.value = n.defaultIndex);
231
+ }), le(() => {
232
+ window.addEventListener("mousemove", F), window.addEventListener("mouseup", $);
233
+ }), se(() => {
234
+ window.removeEventListener("mousemove", F), window.removeEventListener("mouseup", $);
235
+ });
236
+ function Y() {
237
+ u.value--;
238
+ }
239
+ function V() {
240
+ u.value++;
241
+ }
242
+ function M(l, e = r.value) {
243
+ C.value && (l ? m.value = Math.min(
244
+ m.value * e,
245
+ x.value
246
+ ) : m.value = Math.max(
247
+ m.value / e,
248
+ I.value
249
+ ));
250
+ }
251
+ function G() {
252
+ m.value = h.value;
253
+ }
254
+ function W(l) {
255
+ if (n.scaleDisabled) return;
256
+ const e = l.wheelDelta > 0;
257
+ M(e, f.value);
258
+ }
259
+ function q(l) {
260
+ n.dragDisabled || (O.value = l.clientX, P.value = l.clientY, k.value = !0, l.stopPropagation(), l.preventDefault());
261
+ }
262
+ function F(l) {
263
+ k.value && (S.value = L.value + l.clientX - O.value, U.value = N.value + l.clientY - P.value);
264
+ }
265
+ function $() {
266
+ O.value = 0, P.value = 0, L.value = S.value, N.value = U.value, k.value = !1;
267
+ }
268
+ function H() {
269
+ ge(E.value.name), t.toast("复制成功");
270
+ }
271
+ function J() {
272
+ y.value = !0, t.toast("开启纯净模式,双击即可退出");
273
+ }
274
+ function K() {
275
+ y.value && (y.value = !1, t.toast("退出纯净模式"));
276
+ }
277
+ function Z() {
278
+ n.downloadDisabled || ve(E.value.url, {
279
+ allowCrossOrigin: !0
280
+ });
281
+ }
282
+ function Q() {
283
+ t.destroy(o);
284
+ }
285
+ return (l, e) => (a(), s("div", {
286
+ class: "p-media-album",
287
+ onDblclick: e[10] || (e[10] = (i) => K())
288
+ }, [
289
+ p("div", {
290
+ class: "media",
291
+ onWheel: e[1] || (e[1] = (i) => W(i))
292
+ }, [
293
+ (a(!0), s(T, null, ae(b.value, (i, X) => (a(), s(T, null, [
294
+ X === u.value ? (a(), s(T, { key: 0 }, [
295
+ i.type === w.value.IMAGE ? (a(), s("img", {
296
+ key: `media-${X}-${i.url}`,
297
+ src: i.url,
298
+ style: re(A.value),
299
+ onMousedown: e[0] || (e[0] = (_) => q(_)),
300
+ dragable: "false"
301
+ }, null, 44, be)) : d("", !0),
302
+ i.type === w.value.VIDEO ? (a(), s("video", {
303
+ key: 1,
304
+ poster: i.poster,
305
+ src: i.url,
306
+ controls: "",
307
+ controlslist: "nodownload noremoteplayback noplaybackrate",
308
+ disablePictureInPicture: "",
309
+ disableRemotePlayback: ""
310
+ }, null, 8, he)) : d("", !0)
311
+ ], 64)) : d("", !0)
312
+ ], 64))), 256))
313
+ ], 32),
314
+ y.value ? d("", !0) : (a(), s("div", we, [
315
+ l.countDisabled ? (a(), s("div", De)) : (a(), s("div", Ee, [
316
+ p("span", ke, B(`${u.value + 1} `), 1),
317
+ ie("/ " + B(b.value.length), 1)
318
+ ])),
319
+ l.nameDisabled ? d("", !0) : (a(), s("div", {
320
+ key: 2,
321
+ class: "control name",
322
+ onClick: e[2] || (e[2] = (i) => H())
323
+ }, B(E.value.name), 1)),
324
+ p("div", {
325
+ class: "control close",
326
+ onClick: e[3] || (e[3] = (i) => Q())
327
+ }, [...e[11] || (e[11] = [
328
+ p("i", { class: "iconfont-popup-plugin-preset album-close" }, null, -1)
329
+ ])])
330
+ ])),
331
+ y.value ? d("", !0) : (a(), s("div", xe, [
332
+ j.value ? (a(), s("div", {
333
+ key: 0,
334
+ class: "control back",
335
+ onClick: e[4] || (e[4] = (i) => Y())
336
+ }, [...e[12] || (e[12] = [
337
+ p("i", { class: "iconfont-popup-plugin-preset album-prev" }, null, -1)
338
+ ])])) : d("", !0)
339
+ ])),
340
+ y.value ? d("", !0) : (a(), s("div", Ie, [
341
+ R.value ? (a(), s("div", {
342
+ key: 0,
343
+ class: "control next",
344
+ onClick: e[5] || (e[5] = (i) => V())
345
+ }, [...e[13] || (e[13] = [
346
+ p("i", { class: "iconfont-popup-plugin-preset album-next" }, null, -1)
347
+ ])])) : d("", !0)
348
+ ])),
349
+ y.value ? d("", !0) : (a(), s("div", Oe, [
350
+ l.pureDisabled ? (a(), s("div", Pe)) : (a(), s("div", {
351
+ key: 0,
352
+ class: "control",
353
+ onClick: e[6] || (e[6] = (i) => J())
354
+ }, [...e[14] || (e[14] = [
355
+ p("i", { class: "iconfont-popup-plugin-preset album-pure" }, null, -1)
356
+ ])])),
357
+ p("div", Se, [
358
+ !l.scaleDisabled && C.value ? (a(), s("div", {
359
+ key: 0,
360
+ class: "control",
361
+ onClick: e[7] || (e[7] = (i) => M(!0, r.value))
362
+ }, [...e[15] || (e[15] = [
363
+ p("i", { class: "iconfont-popup-plugin-preset album-enlarge" }, null, -1)
364
+ ])])) : d("", !0),
365
+ !l.scaleDisabled && C.value ? (a(), s("div", {
366
+ key: 1,
367
+ class: "control",
368
+ onClick: e[8] || (e[8] = (i) => M(!1, r.value))
369
+ }, [...e[16] || (e[16] = [
370
+ p("i", { class: "iconfont-popup-plugin-preset album-narrow" }, null, -1)
371
+ ])])) : d("", !0)
372
+ ]),
373
+ l.downloadDisabled ? (a(), s("div", Ue)) : (a(), s("div", {
374
+ key: 2,
375
+ class: "control download",
376
+ onClick: e[9] || (e[9] = (i) => Z())
377
+ }, [...e[17] || (e[17] = [
378
+ p("i", { class: "iconfont-popup-plugin-preset download" }, null, -1)
379
+ ])]))
380
+ ]))
381
+ ], 32));
382
+ }
383
+ }), Le = /* @__PURE__ */ de(Ce, [["__scopeId", "data-v-bdd4da57"]]);
384
+ export {
385
+ Le as default
386
+ };
@@ -0,0 +1,67 @@
1
+ import { defineComponent as d, inject as p, createElementBlock as m, openBlock as f, createVNode as t, withCtx as e, createElementVNode as u, toDisplayString as a, createTextVNode as c } 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-B8SE3ACJ.js";
4
+ import { P as B } from "./PFooter-Dd8fzezl.js";
5
+ import { P as T, a as b } from "./PButtonGroup-CfAPVmCi.js";
6
+ import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const y = { class: "p-alert" }, E = { class: "content" }, I = /* @__PURE__ */ d({
8
+ name: "PAlert",
9
+ __name: "PAlert",
10
+ props: {
11
+ title: {},
12
+ content: {},
13
+ confirmText: {},
14
+ draggable: { type: Boolean }
15
+ },
16
+ setup(h) {
17
+ const l = P(), s = p(_.INSTANCE_ID);
18
+ function r() {
19
+ l.destroy(s);
20
+ }
21
+ return (o, n) => (f(), m("div", y, [
22
+ t(g, null, {
23
+ header: e(() => [
24
+ t(N, {
25
+ draggable: o.draggable,
26
+ title: o.title,
27
+ onClose: n[0] || (n[0] = (i) => r()),
28
+ iconClass: "alert"
29
+ }, null, 8, ["draggable", "title"])
30
+ ]),
31
+ footer: e(() => [
32
+ t(B, null, {
33
+ default: e(() => [
34
+ t(T, { align: "right" }, {
35
+ default: e(() => [
36
+ t(b, {
37
+ onClick: n[1] || (n[1] = (i) => r()),
38
+ theme: "primary"
39
+ }, {
40
+ default: e(() => [
41
+ c(a(o.confirmText), 1)
42
+ ]),
43
+ _: 1
44
+ })
45
+ ]),
46
+ _: 1
47
+ })
48
+ ]),
49
+ _: 1
50
+ })
51
+ ]),
52
+ default: e(() => [
53
+ t(C, null, {
54
+ default: e(() => [
55
+ u("div", E, a(o.content), 1)
56
+ ]),
57
+ _: 1
58
+ })
59
+ ]),
60
+ _: 1
61
+ })
62
+ ]));
63
+ }
64
+ }), D = /* @__PURE__ */ v(I, [["__scopeId", "data-v-1501446e"]]);
65
+ export {
66
+ D as default
67
+ };
@@ -0,0 +1,129 @@
1
+ import { defineComponent as m, createElementBlock as u, openBlock as l, renderSlot as c, createElementVNode as r, 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" }, j = { class: "body" }, U = /* @__PURE__ */ m({
5
+ name: "PScaffold",
6
+ __name: "PScaffold",
7
+ setup(t) {
8
+ return (a, i) => (l(), u("div", V, [
9
+ c(a.$slots, "header", {}, void 0, !0),
10
+ r("div", j, [
11
+ c(a.$slots, "default", {}, void 0, !0)
12
+ ]),
13
+ c(a.$slots, "footer", {}, void 0, !0)
14
+ ]));
15
+ }
16
+ }), x = /* @__PURE__ */ g(U, [["__scopeId", "data-v-04880725"]]), A = /* @__PURE__ */ m({
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(t, { emit: a }) {
28
+ I((n) => ({
29
+ "2f05293a": `${n.size}px`,
30
+ "45c9dc5a": `${v.value}px`
31
+ }));
32
+ const i = a, h = w(() => ({
33
+ [`is-theme-${t.theme}`]: !0,
34
+ "is-disabled": t.disabled,
35
+ "is-active": t.actived
36
+ })), v = w(() => t.size * 0.4);
37
+ function _() {
38
+ t.disabled || i("click");
39
+ }
40
+ return (n, d) => (l(), u("div", {
41
+ class: f(["p-header-button", h.value]),
42
+ onClick: d[0] || (d[0] = N((C) => _(), ["stop"]))
43
+ }, [
44
+ r("i", {
45
+ class: f(["iconfont-popup-plugin-preset", n.iconClass])
46
+ }, null, 2)
47
+ ], 2));
48
+ }
49
+ }), J = /* @__PURE__ */ g(A, [["__scopeId", "data-v-1eaab056"]]), W = {
50
+ key: 0,
51
+ class: "icon"
52
+ }, q = { class: "title" }, F = { class: "btn-ctn" }, G = /* @__PURE__ */ m({
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(t, { emit: a }) {
64
+ I((e) => ({
65
+ "3b2e1e40": `${e.height}px`
66
+ }));
67
+ const i = L(), h = E(k.INSTANCE_ID), v = E(k.COMPUTED_VIEW_STYLE), _ = a, n = s(0), d = s(0), C = s(0), $ = s(0), P = s(0), b = s(0), B = s(!1), Y = w(() => !!t.iconClass);
68
+ T([P, b], M);
69
+ function D() {
70
+ t.hasCloseButton && _("close");
71
+ }
72
+ function X(e) {
73
+ t.draggable && (n.value = e.clientX, d.value = e.clientY, C.value = v.value.translateX, $.value = v.value.translateY, B.value = !0, e.preventDefault(), window.addEventListener("mousemove", y), window.addEventListener("mouseup", O));
74
+ }
75
+ function y(e) {
76
+ if (!B.value) return;
77
+ const o = e.clientX - n.value, p = e.clientY - d.value;
78
+ P.value = C.value + o, b.value = $.value + p;
79
+ }
80
+ function O(e) {
81
+ B.value = !1, window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", O);
82
+ }
83
+ function M() {
84
+ i.update(h, {
85
+ viewTranslateX: P.value,
86
+ viewTranslateY: b.value
87
+ });
88
+ }
89
+ return (e, o) => (l(), u("div", {
90
+ class: f(["p-header", { "is-draggable": e.draggable }]),
91
+ onMousedown: o[1] || (o[1] = (p) => X(p))
92
+ }, [
93
+ Y.value ? (l(), u("div", W, [
94
+ r("i", {
95
+ class: f(["iconfont-popup-plugin-preset", e.iconClass])
96
+ }, null, 2)
97
+ ])) : S("", !0),
98
+ r("div", q, H(e.title), 1),
99
+ r("div", F, [
100
+ c(e.$slots, "buttons", {}, void 0, !0),
101
+ e.hasCloseButton ? (l(), z(J, {
102
+ key: 0,
103
+ onClick: o[0] || (o[0] = (p) => D()),
104
+ iconClass: "close",
105
+ theme: "danger"
106
+ })) : S("", !0)
107
+ ])
108
+ ], 34));
109
+ }
110
+ }), ee = /* @__PURE__ */ g(G, [["__scopeId", "data-v-fcc3fa94"]]), K = /* @__PURE__ */ m({
111
+ name: "PBody",
112
+ __name: "PBody",
113
+ props: {
114
+ withPadding: { type: Boolean, default: !0 }
115
+ },
116
+ setup(t) {
117
+ return (a, i) => (l(), u("div", {
118
+ class: f(["p-body", { "has-padding": a.withPadding }])
119
+ }, [
120
+ c(a.$slots, "default", {}, void 0, !0)
121
+ ], 2));
122
+ }
123
+ }), te = /* @__PURE__ */ g(K, [["__scopeId", "data-v-a8f5570e"]]);
124
+ export {
125
+ x as P,
126
+ te as a,
127
+ ee as b,
128
+ J as c
129
+ };
@@ -0,0 +1,80 @@
1
+ import { defineComponent as B, inject as c, useTemplateRef as G, computed as p, createElementBlock as n, openBlock as o, normalizeClass as v, renderSlot as S, useSlots as P, provide as d, onMounted as $, Fragment as b, renderList as C, unref as h, createBlock as j, createCommentVNode as w, resolveDynamicComponent as I } from "vue";
2
+ import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const M = ["disabled"], O = /* @__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
+ c(t.inButtonGroup, !1);
15
+ const l = c(t.groupType, "default"), f = c(t.groupTheme, "default"), m = c(t.groupSize, "default"), s = G("button"), a = u, g = p(() => window.innerWidth <= 600), i = p(() => ({
16
+ [`is-type-${e.type || l}`]: !0,
17
+ [`is-theme-${e.theme || f}`]: !0,
18
+ [`is-size-${e.size || m}`]: !0,
19
+ "is-mobile": g.value
20
+ }));
21
+ function z(r) {
22
+ a("click", r), s.value?.blur();
23
+ }
24
+ return (r, y) => (o(), n("button", {
25
+ class: v(["p-button", i.value]),
26
+ disabled: r.disabled,
27
+ onClick: y[0] || (y[0] = (T) => z(T)),
28
+ ref: "button"
29
+ }, [
30
+ S(r.$slots, "default", {}, void 0, !0)
31
+ ], 10, M));
32
+ }
33
+ }), R = /* @__PURE__ */ k(O, [["__scopeId", "data-v-8d9ceb49"]]), _ = {
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
+ }, D = /* @__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 = P(), l = p(() => e.cutline && !e.tight), f = p(() => ({
54
+ [`align-${e.align}`]: !0,
55
+ "is-tight": e.tight,
56
+ "has-cutline": l.value
57
+ }));
58
+ d(t.inButtonGroup, !0), d(t.groupType, e.type), d(t.groupTheme, e.theme), d(t.groupSize, e.size), $(() => {
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: v(["p-button-group", f.value]),
68
+ ref: "group"
69
+ }, [
70
+ l.value ? (o(!0), n(b, { key: 0 }, C(h(u).default?.(), (g, i) => (o(), n(b, { key: i }, [
71
+ (o(), j(I(g))),
72
+ i < (h(u).default?.() || []).length - 1 ? (o(), n("div", _)) : w("", !0)
73
+ ], 64))), 128)) : S(s.$slots, "default", { key: 1 }, void 0, !0)
74
+ ], 2));
75
+ }
76
+ }), L = /* @__PURE__ */ k(D, [["__scopeId", "data-v-7850ba6f"]]);
77
+ export {
78
+ L as P,
79
+ R as a
80
+ };