geekplus-digital-ui 0.1.21 → 0.1.23

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.
Files changed (62) hide show
  1. package/_virtual/_plugin-vue_export-helper.js +5 -8
  2. package/_virtual/_rolldown/runtime.js +9 -0
  3. package/components/copy/index.js +3 -6
  4. package/components/copy/src/copy.js +68 -0
  5. package/components/fold-text/index.js +3 -6
  6. package/components/fold-text/src/fold-text.js +63 -0
  7. package/components/fold-text/src/fold-text.vue_vue_type_style_index_0_scoped_53a3b28a_lang.css +1 -0
  8. package/components/icon/index.js +3 -6
  9. package/components/icon/src/icon.js +10 -0
  10. package/components/icon/src/icon.vue_vue_type_style_index_0_scoped_29c845ca_lang.css +1 -0
  11. package/components/icon-tip/index.js +3 -6
  12. package/components/icon-tip/src/icon-tip.js +50 -0
  13. package/components/icon-tip/src/icon-tip.vue_vue_type_style_index_0_scoped_fe982c8e_lang.css +1 -0
  14. package/components/icons/angle-down-light.js +14 -0
  15. package/components/icons/angle-up-light.js +14 -0
  16. package/components/icons/circle-exclamation-solid.js +14 -0
  17. package/components/icons/circle-play-light.js +14 -0
  18. package/components/icons/circle-xmark-light.js +14 -0
  19. package/components/icons/copy-light.js +14 -0
  20. package/components/icons/download-light.js +14 -0
  21. package/components/icons/eye-light.js +14 -0
  22. package/components/icons/file-light.js +14 -0
  23. package/components/icons/plus-light.js +14 -0
  24. package/components/icons/trash-light.js +14 -0
  25. package/components/index.js +14 -12
  26. package/components/upload/index.js +3 -6
  27. package/components/upload/src/upload.js +402 -0
  28. package/components/upload/src/upload.vue_vue_type_style_index_0_scoped_610b67ef_lang.css +1 -0
  29. package/components/upload/src/upload.vue_vue_type_style_index_1_lang.css +1 -0
  30. package/config/index.js +30 -40
  31. package/hooks/index.js +2 -6
  32. package/hooks/use-activated/index.js +9 -11
  33. package/hooks/use-locale/index.js +6 -8
  34. package/index.js +12 -24
  35. package/install.js +9 -11
  36. package/locale/i18n.js +20 -29
  37. package/locale/index.js +3 -11
  38. package/locale/lang/en.js +27 -31
  39. package/locale/lang/zh-cn.js +0 -32
  40. package/package.json +2 -2
  41. package/components/copy/src/copy.vue.js +0 -90
  42. package/components/fold-text/src/fold-text.css +0 -1
  43. package/components/fold-text/src/fold-text.vue.js +0 -86
  44. package/components/icon/src/icon.css +0 -1
  45. package/components/icon/src/icon.vue.js +0 -16
  46. package/components/icon-tip/src/icon-tip.css +0 -1
  47. package/components/icon-tip/src/icon-tip.vue.js +0 -67
  48. package/components/icons/angle-down-light.vue.js +0 -18
  49. package/components/icons/angle-up-light.vue.js +0 -18
  50. package/components/icons/circle-exclamation-solid.vue.js +0 -18
  51. package/components/icons/circle-play-light.vue.js +0 -18
  52. package/components/icons/circle-xmark-light.vue.js +0 -18
  53. package/components/icons/copy-light.vue.js +0 -18
  54. package/components/icons/download-light.vue.js +0 -18
  55. package/components/icons/eye-light.vue.js +0 -18
  56. package/components/icons/file-light.vue.js +0 -18
  57. package/components/icons/plus-light.vue.js +0 -18
  58. package/components/icons/trash-light.vue.js +0 -18
  59. package/components/upload/src/upload.css +0 -1
  60. package/components/upload/src/upload.vue.js +0 -483
  61. package/components/upload/src/upload2.css +0 -1
  62. /package/components/copy/src/{copy.css → copy.vue_vue_type_style_index_0_scoped_b4c0bee4_lang.css} +0 -0
@@ -1,483 +0,0 @@
1
- import { useModel as pe, ref as y, computed as m, reactive as De, watch as Ee, onMounted as Ie, onBeforeUnmount as Ne, openBlock as o, createElementBlock as f, normalizeClass as Be, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as u, createElementVNode as S, createTextVNode as A, toDisplayString as k, normalizeStyle as z, Fragment as j, renderList as fe, withModifiers as me, mergeModels as ve } from "vue";
2
- import "../../../hooks/index.js";
3
- import { useFormItem as $e, ElMessageBox as je, ElMessage as H, ElUpload as He, ElImageViewer as Pe, ElDialog as Re, ElButton as P, ElImage as qe, ElProgress as ye, ElLink as R } from "element-plus";
4
- import "../../index.js";
5
- import { isFunction as Oe } from "lodash-es";
6
- import { saveAs as Ke } from "file-saver";
7
- import Xe from "../../icons/angle-down-light.vue.js";
8
- import Ge from "../../icons/angle-up-light.vue.js";
9
- import Je from "../../icons/circle-play-light.vue.js";
10
- import Qe from "../../icons/circle-xmark-light.vue.js";
11
- import We from "../../icons/download-light.vue.js";
12
- import Ye from "../../icons/eye-light.vue.js";
13
- import Ze from "../../icons/file-light.vue.js";
14
- import et from "../../icons/plus-light.vue.js";
15
- import tt from "../../icons/trash-light.vue.js";
16
- import './upload2.css';import './upload.css';/* empty css */
17
- /* empty css */
18
- import lt from "../../../_virtual/_plugin-vue_export-helper.js";
19
- import { useLocale as at } from "../../../hooks/use-locale/index.js";
20
- import { useActivated as ot } from "../../../hooks/use-activated/index.js";
21
- import { DIcon as g } from "../../icon/index.js";
22
- const nt = { class: "d-upload__preview" }, st = ["src"], rt = {
23
- key: 2,
24
- class: "header"
25
- }, ut = ["onClick"], it = { class: "card-cover" }, dt = ["innerHTML"], ct = { class: "file-row" }, pt = {
26
- key: 6,
27
- class: "expand-toggle"
28
- }, ft = /* @__PURE__ */ Object.assign({
29
- name: "DUpload"
30
- }, {
31
- __name: "upload",
32
- props: /* @__PURE__ */ ve({
33
- domain: {
34
- type: String,
35
- required: !0
36
- },
37
- axios: {
38
- type: Function,
39
- required: !0
40
- },
41
- url: {
42
- type: String,
43
- required: !0
44
- },
45
- format: {
46
- type: Array,
47
- default: () => []
48
- },
49
- maxSize: {
50
- type: Number,
51
- default: 500
52
- },
53
- maxNumber: {
54
- type: Number,
55
- default: 99
56
- },
57
- maxShow: {
58
- type: Number,
59
- default: 3
60
- },
61
- disabled: {
62
- type: Boolean,
63
- default: !1
64
- },
65
- showType: {
66
- type: String,
67
- default: "card"
68
- },
69
- docType: {
70
- type: String
71
- },
72
- size: {
73
- type: String,
74
- default: "80px"
75
- },
76
- scrollHeight: {
77
- type: String
78
- },
79
- showTip: {
80
- type: Boolean,
81
- default: !0
82
- },
83
- pasteable: {
84
- type: Boolean,
85
- default: !1
86
- },
87
- showDownloadAll: {
88
- type: Boolean,
89
- default: !1
90
- },
91
- downloadAllMethod: {
92
- type: Function
93
- }
94
- }, {
95
- modelValue: {
96
- type: Array,
97
- default: () => []
98
- },
99
- modelModifiers: {},
100
- uploadingCount: {
101
- type: Number,
102
- default: 0
103
- },
104
- uploadingCountModifiers: {}
105
- }),
106
- emits: /* @__PURE__ */ ve(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
107
- setup(h, { emit: ge }) {
108
- const l = h, q = ge, O = pe(h, "modelValue"), he = pe(h, "uploadingCount"), K = ["jpg", "jpeg", "png", "gif"], ke = ["mp4"], s = y([]), F = y(!1), w = y(!1), V = y(0), D = y([]), L = y(""), x = y(!1), X = y(null), G = y(null), { t: i } = at(), we = ot(), { formItem: xe } = $e(), J = m(() => x.value ? s.value : s.value.slice(0, l.maxShow)), E = m(() => s.value.length > 0), b = m(() => !l.disabled && !Q.value), _ = m(() => l.showType === "list"), _e = m(() => b.value && _.value || l.showDownloadAll && E.value), Q = m(() => s.value.length >= l.maxNumber), Ce = m(() => _.value ? "is-list" : "is-card"), W = m(() => l.format.length ? l.format.map((t) => t.toUpperCase()) : []), Y = m(() => ({
109
- width: l.size,
110
- height: l.size
111
- })), Se = m(() => l.format.map((t) => `.${t}`).join(",")), Z = m(() => ({
112
- maxHeight: l.scrollHeight,
113
- overflow: l.scrollHeight ? "auto" : void 0
114
- })), Le = m(() => {
115
- const t = l.format.length && l.format.every((e) => K.includes(e)), a = [];
116
- return l.maxSize && !t && a.push(i("d.upload.lessThan", { size: l.maxSize })), l.format.length && a.push(i("d.upload.format", { format: l.format.join("/") })), l.pasteable && a.push(i("d.upload.pasteable")), a.join(i("d.upload.comma"));
117
- }), be = (t) => {
118
- s.value.some((e) => e.status === "uploading") || (s.value = t?.map((e) => ({
119
- id: e.id,
120
- name: e.name || e.docName,
121
- docName: e.name || e.docName,
122
- url: e.url || e.docUrl,
123
- docUrl: e.url || e.docUrl,
124
- type: l.docType || e.type || e.docType,
125
- docType: l.docType || e.type || e.docType,
126
- status: "success"
127
- })) || [], M());
128
- }, I = (t) => {
129
- if (t) {
130
- const a = t.split(".");
131
- return a[a.length - 1].toLowerCase();
132
- }
133
- return "";
134
- }, C = (t) => K.includes(I(t.name)), T = (t) => ke.includes(I(t.name)), U = (t) => t?.status === "success", ee = (t) => !l.disabled && U(t), te = () => {
135
- X.value?.$el.querySelector("input")?.click();
136
- }, Te = (t) => {
137
- if (V.value = 0, D.value = [], L.value = "", C(t)) {
138
- const a = s.value.filter((e) => C(e));
139
- V.value = a.findIndex((e) => e.url === t.url), D.value = a.map((e) => e.url), F.value = !0;
140
- }
141
- T(t) && (L.value = t.url, w.value = !0);
142
- }, le = () => {
143
- G.value?.pause(), w.value = !1;
144
- }, ae = (t) => {
145
- const a = () => {
146
- const r = s.value.indexOf(t);
147
- r !== -1 && (s.value.splice(r, 1), M(), oe(t));
148
- }, e = async () => {
149
- if (!U(t)) {
150
- a();
151
- return;
152
- }
153
- a();
154
- };
155
- je.confirm(i("d.upload.deleteConfirm"), i("d.upload.tip"), {
156
- type: "warning"
157
- }).then(async () => {
158
- await e();
159
- }).catch(() => {
160
- });
161
- }, Ue = (t, a) => {
162
- H.success(i("d.upload.fileSuccess", { file: t.name })), q("success", t, a, s.value);
163
- }, Me = (t, a) => {
164
- const e = I(t.name);
165
- if (e) {
166
- const r = e.toUpperCase();
167
- if (W.value.length && !W.value.includes(r))
168
- return a || H.error(i("d.upload.fileFormat", { file: t.name, format: l.format.join("/") })), !1;
169
- }
170
- return !0;
171
- }, Ae = (t) => t.size > l.maxSize * 1024 * 1024 ? (H.error(i("d.upload.fileLessThan", { file: t.name, size: l.maxSize })), !1) : !0, ze = (t, a) => {
172
- if (!a)
173
- return;
174
- const { loaded: e = 0, total: r = 0 } = t || {};
175
- r > 0 && (a.percentage = Math.floor(e / r * 100));
176
- }, oe = (t) => {
177
- O.value = s.value, q("change", t, s.value), xe?.validate("change");
178
- }, M = () => {
179
- he.value = s.value.filter((t) => t.status === "uploading").length;
180
- }, ne = (t, a) => (Me(t, a) && Ae(t) && Fe(t), !1), Fe = async (t) => {
181
- if (Q.value)
182
- return !1;
183
- x.value || N();
184
- const a = new FormData();
185
- a.append("file", t);
186
- const e = De({
187
- status: "uploading",
188
- percentage: 0,
189
- name: t.name
190
- });
191
- s.value.push(e), M();
192
- const r = () => s.value.indexOf(e);
193
- try {
194
- const { data: v } = await l.axios({
195
- url: l.url,
196
- method: "post",
197
- data: a,
198
- onUploadProgress: ($) => ze($, e)
199
- }), B = v?.data || v;
200
- if (B && r() !== -1) {
201
- const {
202
- id: $,
203
- name: ie,
204
- url: de,
205
- type: ce
206
- } = B;
207
- Object.assign(e, {
208
- id: $,
209
- name: ie,
210
- docName: ie,
211
- url: l.domain + de,
212
- docUrl: l.domain + de,
213
- type: l.docType || ce,
214
- docType: l.docType || ce,
215
- status: "success"
216
- }), Ue(B, e);
217
- } else r() !== -1 && s.value.splice(r(), 1);
218
- } catch {
219
- r() !== -1 && s.value.splice(r(), 1);
220
- } finally {
221
- M(), oe(e);
222
- }
223
- }, se = (t) => {
224
- t?.url && Ke(t.url, t.name);
225
- }, N = () => {
226
- x.value = !x.value;
227
- }, re = (t) => {
228
- if (!l.pasteable || l.disabled || !we.value)
229
- return;
230
- const a = t.clipboardData?.items || [];
231
- for (let e = 0; e < a.length; e++) {
232
- const v = a[e].getAsFile();
233
- v && ne(v, !0);
234
- }
235
- }, ue = (t) => {
236
- !E.value || !t?.url || (C(t) || T(t) ? Te(t) : se(t));
237
- }, Ve = () => {
238
- Oe(l.downloadAllMethod) ? l.downloadAllMethod(s.value) : s.value.forEach((t) => {
239
- se(t);
240
- });
241
- };
242
- return Ee(
243
- O,
244
- (t) => {
245
- be(t);
246
- },
247
- { immediate: !0 }
248
- ), Ie(() => {
249
- document.addEventListener("paste", re);
250
- }), Ne(() => {
251
- document.removeEventListener("paste", re);
252
- }), (t, a) => (o(), f("div", {
253
- class: Be(["d-upload", Ce.value])
254
- }, [
255
- d(n(He), {
256
- ref_key: "uploadRef",
257
- ref: X,
258
- style: { display: "none" },
259
- "show-file-list": !1,
260
- "file-list": s.value,
261
- accept: Se.value,
262
- "before-upload": ne,
263
- "with-credentials": "",
264
- multiple: "",
265
- action: "/"
266
- }, null, 8, ["file-list", "accept"]),
267
- F.value ? (o(), c(n(Pe), {
268
- key: 0,
269
- "url-list": D.value,
270
- "initial-index": V.value,
271
- "hide-on-click-modal": "",
272
- teleported: "",
273
- onClose: a[0] || (a[0] = (e) => F.value = !1)
274
- }, null, 8, ["url-list", "initial-index"])) : p("", !0),
275
- w.value ? (o(), c(n(Re), {
276
- key: 1,
277
- modelValue: w.value,
278
- "onUpdate:modelValue": a[1] || (a[1] = (e) => w.value = e),
279
- title: n(i)("d.upload.preview"),
280
- width: "1200px",
281
- "align-center": "",
282
- "before-close": le,
283
- "append-to-body": ""
284
- }, {
285
- footer: u(() => [
286
- d(n(P), { onClick: le }, {
287
- default: u(() => [
288
- A(k(n(i)("d.upload.close")), 1)
289
- ]),
290
- _: 1
291
- })
292
- ]),
293
- default: u(() => [
294
- S("div", nt, [
295
- L.value ? (o(), f("video", {
296
- key: 0,
297
- ref_key: "videoRef",
298
- ref: G,
299
- src: L.value,
300
- controls: "",
301
- class: "preview-video"
302
- }, null, 8, st)) : p("", !0)
303
- ])
304
- ]),
305
- _: 1
306
- }, 8, ["modelValue", "title"])) : p("", !0),
307
- _e.value ? (o(), f("div", rt, [
308
- b.value && _.value ? (o(), c(n(P), {
309
- key: 0,
310
- onClick: te
311
- }, {
312
- default: u(() => [
313
- A(k(n(i)("d.upload.upload")), 1)
314
- ]),
315
- _: 1
316
- })) : p("", !0),
317
- h.showDownloadAll && E.value ? (o(), c(n(P), {
318
- key: 1,
319
- type: "primary",
320
- link: "",
321
- onClick: Ve
322
- }, {
323
- default: u(() => [
324
- A(k(n(i)("d.upload.downloadAll")), 1)
325
- ]),
326
- _: 1
327
- })) : p("", !0)
328
- ])) : p("", !0),
329
- _.value ? p("", !0) : (o(), f("div", {
330
- key: 3,
331
- class: "card",
332
- style: z(Z.value)
333
- }, [
334
- (o(!0), f(j, null, fe(J.value, (e, r) => (o(), f("div", {
335
- key: e.id || `${e.name}-${r}`,
336
- class: "card-item",
337
- style: z(Y.value),
338
- onClick: (v) => ue(e)
339
- }, [
340
- U(e) ? (o(), f(j, { key: 0 }, [
341
- C(e) ? (o(), c(n(qe), {
342
- key: 0,
343
- src: e.url,
344
- fit: "cover"
345
- }, null, 8, ["src"])) : T(e) ? (o(), c(n(g), { key: 1 }, {
346
- default: u(() => [
347
- d(Je)
348
- ]),
349
- _: 1
350
- })) : (o(), c(n(g), { key: 2 }, {
351
- default: u(() => [
352
- d(Ze)
353
- ]),
354
- _: 1
355
- })),
356
- S("div", it, [
357
- C(e) || T(e) ? (o(), c(n(g), { key: 0 }, {
358
- default: u(() => [
359
- d(Ye)
360
- ]),
361
- _: 1
362
- })) : (o(), c(n(g), { key: 1 }, {
363
- default: u(() => [
364
- d(We)
365
- ]),
366
- _: 1
367
- })),
368
- ee(e) ? (o(), c(n(g), {
369
- key: 2,
370
- onClick: me((v) => ae(e), ["stop"])
371
- }, {
372
- default: u(() => [
373
- d(tt)
374
- ]),
375
- _: 1
376
- }, 8, ["onClick"])) : p("", !0)
377
- ])
378
- ], 64)) : (o(), c(n(ye), {
379
- key: 1,
380
- style: { width: "80%" },
381
- percentage: e.percentage,
382
- "stroke-width": 5,
383
- "show-text": !1
384
- }, null, 8, ["percentage"]))
385
- ], 12, ut))), 128)),
386
- b.value ? (o(), f("div", {
387
- key: 0,
388
- class: "card-item",
389
- style: z(Y.value),
390
- onClick: te
391
- }, [
392
- d(n(g), null, {
393
- default: u(() => [
394
- d(et)
395
- ]),
396
- _: 1
397
- })
398
- ], 4)) : p("", !0)
399
- ], 4)),
400
- b.value && h.showTip ? (o(), f("p", {
401
- key: 4,
402
- class: "tip",
403
- innerHTML: Le.value
404
- }, null, 8, dt)) : p("", !0),
405
- _.value ? (o(), f("div", {
406
- key: 5,
407
- style: z(Z.value),
408
- class: "list"
409
- }, [
410
- (o(!0), f(j, null, fe(J.value, (e, r) => (o(), f("div", {
411
- key: e.id || `${e.name}-${r}`,
412
- class: "list-item"
413
- }, [
414
- S("div", ct, [
415
- d(n(R), {
416
- type: "primary",
417
- underline: "never",
418
- onClick: (v) => ue(e)
419
- }, {
420
- default: u(() => [
421
- A(k(e.name), 1)
422
- ]),
423
- _: 2
424
- }, 1032, ["onClick"]),
425
- ee(e) ? (o(), c(n(g), {
426
- key: 0,
427
- class: "remove-icon",
428
- onClick: me((v) => ae(e), ["stop"])
429
- }, {
430
- default: u(() => [
431
- d(Qe)
432
- ]),
433
- _: 1
434
- }, 8, ["onClick"])) : p("", !0)
435
- ]),
436
- U(e) ? p("", !0) : (o(), c(n(ye), {
437
- key: 0,
438
- percentage: e.percentage,
439
- "stroke-width": 8
440
- }, null, 8, ["percentage"]))
441
- ]))), 128))
442
- ], 4)) : p("", !0),
443
- s.value.length > h.maxShow ? (o(), f("div", pt, [
444
- x.value ? (o(), c(n(R), {
445
- key: 0,
446
- type: "primary",
447
- underline: "never",
448
- onClick: N
449
- }, {
450
- default: u(() => [
451
- S("span", null, k(n(i)("d.upload.collapse")), 1),
452
- d(n(g), null, {
453
- default: u(() => [
454
- d(Ge)
455
- ]),
456
- _: 1
457
- })
458
- ]),
459
- _: 1
460
- })) : (o(), c(n(R), {
461
- key: 1,
462
- type: "primary",
463
- underline: "never",
464
- onClick: N
465
- }, {
466
- default: u(() => [
467
- S("span", null, k(n(i)("d.upload.expand")), 1),
468
- d(n(g), null, {
469
- default: u(() => [
470
- d(Xe)
471
- ]),
472
- _: 1
473
- })
474
- ]),
475
- _: 1
476
- }))
477
- ])) : p("", !0)
478
- ], 2));
479
- }
480
- }), Et = /* @__PURE__ */ lt(ft, [["__scopeId", "data-v-5e32dcf8"]]);
481
- export {
482
- Et as default
483
- };
@@ -1 +0,0 @@
1
- .d-upload__preview{height:calc(80vh - 120px);display:flex;justify-content:center}.d-upload__preview .preview-video{max-width:100%;height:100%}