geekplus-digital-ui 0.1.16 → 0.1.17
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/components/copy/src/copy.css +1 -1
- package/components/copy/src/copy.vue.js +23 -21
- package/components/fold-text/src/fold-text.css +1 -1
- package/components/fold-text/src/fold-text.vue.js +29 -27
- package/components/icon/index.d.ts +18 -0
- package/components/icon/index.js +6 -0
- package/components/icon/src/icon.css +1 -0
- package/components/icon/src/icon.vue.d.ts +14 -0
- package/components/icon/src/icon.vue.js +16 -0
- package/components/icon-tip/src/icon-tip.css +1 -1
- package/components/icon-tip/src/icon-tip.vue.js +23 -21
- package/components/index.d.ts +1 -0
- package/components/index.js +2 -0
- package/components/upload/src/upload.css +1 -1
- package/components/upload/src/upload.vue.js +20 -18
- package/index.js +14 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-copy[data-v-
|
|
1
|
+
.d-copy[data-v-b0bd3813] .el-link__inner{gap:5px}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ref as m, toRef as C, computed as p, onMounted as L, onBeforeUnmount as x, openBlock as a, createBlock as d, unref as f, withModifiers as S, normalizeStyle as M, withCtx as y, createElementBlock as N, normalizeClass as _, createVNode as
|
|
2
|
-
import { useClipboard as
|
|
3
|
-
import { ElMessage as
|
|
1
|
+
import { ref as m, toRef as C, computed as p, onMounted as L, onBeforeUnmount as x, openBlock as a, createBlock as d, unref as f, withModifiers as S, normalizeStyle as M, withCtx as y, createElementBlock as N, normalizeClass as _, createVNode as b, renderSlot as B, createCommentVNode as w } from "vue";
|
|
2
|
+
import { useClipboard as R } from "@vueuse/core";
|
|
3
|
+
import { ElMessage as $, ElLink as z } from "element-plus";
|
|
4
|
+
import "../../index.js";
|
|
4
5
|
import "../../../hooks/index.js";
|
|
5
|
-
import
|
|
6
|
+
import D from "../../icons/copy-light.vue.js";
|
|
6
7
|
import './copy.css';/* empty css */
|
|
7
|
-
import
|
|
8
|
-
import { useLocale as
|
|
8
|
+
import I from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
9
|
+
import { useLocale as V } from "../../../hooks/use-locale/index.js";
|
|
10
|
+
import { DIcon as j } from "../../icon/index.js";
|
|
9
11
|
const H = /* @__PURE__ */ Object.assign({
|
|
10
12
|
name: "DCopy"
|
|
11
13
|
}, {
|
|
@@ -27,9 +29,9 @@ const H = /* @__PURE__ */ Object.assign({
|
|
|
27
29
|
// 触发元素显示的dom,不设置就一直显示
|
|
28
30
|
},
|
|
29
31
|
setup(n, { expose: v }) {
|
|
30
|
-
const r = n, l = m(null), s = m(!1), g = C(r, "text"), { copy: E } =
|
|
32
|
+
const r = n, l = m(null), s = m(!1), g = C(r, "text"), { copy: E } = R({
|
|
31
33
|
source: g
|
|
32
|
-
}), { t: h } =
|
|
34
|
+
}), { t: h } = V(), e = p(() => {
|
|
33
35
|
const o = l.value?.$el ?? l.value;
|
|
34
36
|
if (!r.triggerElement || !o)
|
|
35
37
|
return null;
|
|
@@ -42,22 +44,22 @@ const H = /* @__PURE__ */ Object.assign({
|
|
|
42
44
|
return null;
|
|
43
45
|
}), k = p(() => ({
|
|
44
46
|
display: r.triggerElement && !s.value ? "none" : ""
|
|
45
|
-
})),
|
|
47
|
+
})), i = () => {
|
|
46
48
|
E().then(() => {
|
|
47
|
-
|
|
49
|
+
$.success(h("d.copy.success"));
|
|
48
50
|
});
|
|
49
|
-
},
|
|
51
|
+
}, u = () => {
|
|
50
52
|
s.value = !0;
|
|
51
|
-
},
|
|
53
|
+
}, c = () => {
|
|
52
54
|
s.value = !1;
|
|
53
55
|
};
|
|
54
56
|
return L(() => {
|
|
55
|
-
e.value && (e.value.addEventListener("mouseenter",
|
|
57
|
+
e.value && (e.value.addEventListener("mouseenter", u), e.value.addEventListener("mouseleave", c));
|
|
56
58
|
}), x(() => {
|
|
57
|
-
e.value && (e.value.removeEventListener("mouseenter",
|
|
59
|
+
e.value && (e.value.removeEventListener("mouseenter", u), e.value.removeEventListener("mouseleave", c));
|
|
58
60
|
}), v({
|
|
59
61
|
rootRef: l,
|
|
60
|
-
handleCopy:
|
|
62
|
+
handleCopy: i
|
|
61
63
|
}), (o, t) => (a(), d(f(z), {
|
|
62
64
|
ref_key: "rootRef",
|
|
63
65
|
ref: l,
|
|
@@ -65,24 +67,24 @@ const H = /* @__PURE__ */ Object.assign({
|
|
|
65
67
|
type: n.type,
|
|
66
68
|
underline: "never",
|
|
67
69
|
style: M(k.value),
|
|
68
|
-
onClick: S(
|
|
70
|
+
onClick: S(i, ["stop"])
|
|
69
71
|
}, {
|
|
70
72
|
default: y(() => [
|
|
71
73
|
n.icon ? (a(), N("i", {
|
|
72
74
|
key: 0,
|
|
73
75
|
class: _(n.icon)
|
|
74
|
-
}, null, 2)) : (a(), d(f(
|
|
76
|
+
}, null, 2)) : (a(), d(f(j), { key: 1 }, {
|
|
75
77
|
default: y(() => [
|
|
76
|
-
|
|
78
|
+
b(D)
|
|
77
79
|
]),
|
|
78
80
|
_: 1
|
|
79
81
|
})),
|
|
80
|
-
o.$slots.default ?
|
|
82
|
+
o.$slots.default ? B(o.$slots, "default", { key: 2 }, void 0, !0) : w("", !0)
|
|
81
83
|
]),
|
|
82
84
|
_: 3
|
|
83
85
|
}, 8, ["type", "style"]));
|
|
84
86
|
}
|
|
85
|
-
}),
|
|
87
|
+
}), T = /* @__PURE__ */ I(H, [["__scopeId", "data-v-b0bd3813"]]);
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
T as default
|
|
88
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-fold-text[data-v-
|
|
1
|
+
.d-fold-text[data-v-24cf8de0]{display:flex;flex-direction:column;overflow-wrap:break-word}.d-fold-text .text-content[data-v-24cf8de0]{white-space:pre-wrap}.d-fold-text .text-content.line-clamp[data-v-24cf8de0]{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.d-fold-text .text-link[data-v-24cf8de0]{display:flex}.d-fold-text .text-link[data-v-24cf8de0] .el-link__inner{gap:5px}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useResizeObserver as
|
|
3
|
-
import { ElLink as v
|
|
1
|
+
import { ref as s, computed as C, onMounted as h, openBlock as n, createElementBlock as p, createElementVNode as d, normalizeStyle as w, normalizeClass as F, renderSlot as b, createBlock as f, unref as e, withCtx as r, toDisplayString as c, createVNode as a, createCommentVNode as B } from "vue";
|
|
2
|
+
import { useResizeObserver as D } from "@vueuse/core";
|
|
3
|
+
import { ElLink as v } from "element-plus";
|
|
4
|
+
import "../../index.js";
|
|
4
5
|
import "../../../hooks/index.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
6
|
+
import E from "../../icons/angle-up-light.vue.js";
|
|
7
|
+
import L from "../../icons/angle-down-light.vue.js";
|
|
7
8
|
import './fold-text.css';/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import { useLocale as
|
|
10
|
-
|
|
9
|
+
import N from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
10
|
+
import { useLocale as T } from "../../../hooks/use-locale/index.js";
|
|
11
|
+
import { DIcon as x } from "../../icon/index.js";
|
|
12
|
+
const z = { class: "d-fold-text" }, R = {
|
|
11
13
|
key: 0,
|
|
12
14
|
class: "text-link"
|
|
13
15
|
}, S = /* @__PURE__ */ Object.assign({
|
|
@@ -24,35 +26,35 @@ const D = { class: "d-fold-text" }, R = {
|
|
|
24
26
|
default: 3
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const y =
|
|
29
|
+
setup(i) {
|
|
30
|
+
const y = i, t = s(null), u = s(!1), l = s(!1), { t: m } = T(), k = C(() => ({
|
|
29
31
|
"line-clamp": !l.value && y.lineClamp
|
|
30
32
|
}));
|
|
31
33
|
return h(() => {
|
|
32
|
-
|
|
34
|
+
D(t, () => {
|
|
33
35
|
!l.value && t.value && (u.value = t.value.scrollHeight > t.value.clientHeight);
|
|
34
36
|
});
|
|
35
|
-
}), (_, o) => (n(), p("div",
|
|
37
|
+
}), (_, o) => (n(), p("div", z, [
|
|
36
38
|
d("div", {
|
|
37
39
|
ref_key: "textRef",
|
|
38
40
|
ref: t,
|
|
39
|
-
class:
|
|
40
|
-
style: w({ "-webkit-line-clamp":
|
|
41
|
+
class: F(["text-content", k.value]),
|
|
42
|
+
style: w({ "-webkit-line-clamp": i.lineClamp })
|
|
41
43
|
}, [
|
|
42
|
-
|
|
44
|
+
b(_.$slots, "default", {}, void 0, !0)
|
|
43
45
|
], 6),
|
|
44
|
-
|
|
46
|
+
i.showFold && u.value ? (n(), p("div", R, [
|
|
45
47
|
l.value ? (n(), f(e(v), {
|
|
46
48
|
key: 0,
|
|
47
49
|
type: "primary",
|
|
48
50
|
underline: "never",
|
|
49
51
|
onClick: o[0] || (o[0] = (g) => l.value = !1)
|
|
50
52
|
}, {
|
|
51
|
-
default:
|
|
53
|
+
default: r(() => [
|
|
52
54
|
d("span", null, c(e(m)("d.foldText.collapse")), 1),
|
|
53
|
-
|
|
54
|
-
default:
|
|
55
|
-
|
|
55
|
+
a(e(x), null, {
|
|
56
|
+
default: r(() => [
|
|
57
|
+
a(E)
|
|
56
58
|
]),
|
|
57
59
|
_: 1
|
|
58
60
|
})
|
|
@@ -64,21 +66,21 @@ const D = { class: "d-fold-text" }, R = {
|
|
|
64
66
|
underline: "never",
|
|
65
67
|
onClick: o[1] || (o[1] = (g) => l.value = !0)
|
|
66
68
|
}, {
|
|
67
|
-
default:
|
|
69
|
+
default: r(() => [
|
|
68
70
|
d("span", null, c(e(m)("d.foldText.expand")), 1),
|
|
69
|
-
|
|
70
|
-
default:
|
|
71
|
-
|
|
71
|
+
a(e(x), null, {
|
|
72
|
+
default: r(() => [
|
|
73
|
+
a(L)
|
|
72
74
|
]),
|
|
73
75
|
_: 1
|
|
74
76
|
})
|
|
75
77
|
]),
|
|
76
78
|
_: 1
|
|
77
79
|
}))
|
|
78
|
-
])) :
|
|
80
|
+
])) : B("", !0)
|
|
79
81
|
]));
|
|
80
82
|
}
|
|
81
|
-
}),
|
|
83
|
+
}), G = /* @__PURE__ */ N(S, [["__scopeId", "data-v-24cf8de0"]]);
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
G as default
|
|
84
86
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const DIcon: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLElement, import('vue').ComponentProvideOptions, {
|
|
3
|
+
P: {};
|
|
4
|
+
B: {};
|
|
5
|
+
D: {};
|
|
6
|
+
C: {};
|
|
7
|
+
M: {};
|
|
8
|
+
Defaults: {};
|
|
9
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
10
|
+
__isFragment?: never;
|
|
11
|
+
__isTeleport?: never;
|
|
12
|
+
__isSuspense?: never;
|
|
13
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
14
|
+
$slots: {
|
|
15
|
+
default?(_: {}): any;
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
export default DIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-icon[data-v-b523c56c]{display:inline-flex}.d-icon[data-v-b523c56c] svg{box-sizing:content-box;display:inline-block;height:1em;overflow:visible;vertical-align:-.125em;width:1.25em}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
2
|
+
export default _default;
|
|
3
|
+
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
4
|
+
$slots: S;
|
|
5
|
+
});
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
7
|
+
type __VLS_TemplateResult = {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLElement;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { openBlock as o, createElementBlock as t, renderSlot as c } from "vue";
|
|
2
|
+
import './icon.css';/* empty css */
|
|
3
|
+
import n from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = { class: "d-icon" }, s = /* @__PURE__ */ Object.assign({
|
|
5
|
+
name: "DIcon"
|
|
6
|
+
}, {
|
|
7
|
+
__name: "icon",
|
|
8
|
+
setup(_) {
|
|
9
|
+
return (e, a) => (o(), t("i", r, [
|
|
10
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
11
|
+
]));
|
|
12
|
+
}
|
|
13
|
+
}), m = /* @__PURE__ */ n(s, [["__scopeId", "data-v-b523c56c"]]);
|
|
14
|
+
export {
|
|
15
|
+
m as default
|
|
16
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-icon-tip .tip-content[data-v-
|
|
1
|
+
.d-icon-tip .tip-content[data-v-3271ffa0]{white-space:pre-wrap}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { openBlock as n, createBlock as i, unref as
|
|
2
|
-
import { ElTooltip as g, ElLink as S
|
|
1
|
+
import { openBlock as n, createBlock as i, unref as o, withCtx as e, createVNode as r, mergeProps as p, createElementBlock as s, normalizeClass as d, createElementVNode as f, renderSlot as u, createTextVNode as y, toDisplayString as k } from "vue";
|
|
2
|
+
import { ElTooltip as g, ElLink as S } from "element-plus";
|
|
3
|
+
import "../../index.js";
|
|
3
4
|
import C from "../../icons/circle-exclamation-solid.vue.js";
|
|
4
5
|
import './icon-tip.css';/* empty css */
|
|
5
|
-
import
|
|
6
|
+
import E from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
import { DIcon as _ } from "../../icon/index.js";
|
|
6
8
|
const h = { class: "tip-content" }, x = /* @__PURE__ */ Object.assign({
|
|
7
9
|
name: "DIconTip"
|
|
8
10
|
}, {
|
|
@@ -24,31 +26,31 @@ const h = { class: "tip-content" }, x = /* @__PURE__ */ Object.assign({
|
|
|
24
26
|
}
|
|
25
27
|
},
|
|
26
28
|
emits: ["click"],
|
|
27
|
-
setup(
|
|
28
|
-
const a =
|
|
29
|
+
setup(t, { emit: l }) {
|
|
30
|
+
const a = l, m = () => {
|
|
29
31
|
a("click");
|
|
30
32
|
};
|
|
31
|
-
return (
|
|
32
|
-
content:
|
|
33
|
+
return (c, I) => (n(), i(o(g), { placement: t.placement }, {
|
|
34
|
+
content: e(() => [
|
|
33
35
|
f("div", h, [
|
|
34
|
-
u(
|
|
35
|
-
y(k(
|
|
36
|
+
u(c.$slots, "content", {}, () => [
|
|
37
|
+
y(k(t.content), 1)
|
|
36
38
|
], !0)
|
|
37
39
|
])
|
|
38
40
|
]),
|
|
39
|
-
default:
|
|
40
|
-
|
|
41
|
-
type:
|
|
41
|
+
default: e(() => [
|
|
42
|
+
r(o(S), p(c.$attrs, {
|
|
43
|
+
type: t.type,
|
|
42
44
|
underline: "never",
|
|
43
|
-
onClick:
|
|
45
|
+
onClick: m
|
|
44
46
|
}), {
|
|
45
|
-
default:
|
|
46
|
-
|
|
47
|
+
default: e(() => [
|
|
48
|
+
t.icon ? (n(), s("i", {
|
|
47
49
|
key: 0,
|
|
48
|
-
class: d(["d-icon-tip",
|
|
49
|
-
}, null, 2)) : (n(), i(
|
|
50
|
-
default:
|
|
51
|
-
|
|
50
|
+
class: d(["d-icon-tip", t.icon])
|
|
51
|
+
}, null, 2)) : (n(), i(o(_), { key: 1 }, {
|
|
52
|
+
default: e(() => [
|
|
53
|
+
r(C)
|
|
52
54
|
]),
|
|
53
55
|
_: 1
|
|
54
56
|
}))
|
|
@@ -59,7 +61,7 @@ const h = { class: "tip-content" }, x = /* @__PURE__ */ Object.assign({
|
|
|
59
61
|
_: 3
|
|
60
62
|
}, 8, ["placement"]));
|
|
61
63
|
}
|
|
62
|
-
}),
|
|
64
|
+
}), b = /* @__PURE__ */ E(x, [["__scopeId", "data-v-3271ffa0"]]);
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
b as default
|
|
65
67
|
};
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -2,9 +2,11 @@ import { DCopy as p } from "./copy/index.js";
|
|
|
2
2
|
import { DFoldText as t } from "./fold-text/index.js";
|
|
3
3
|
import { DIconTip as f } from "./icon-tip/index.js";
|
|
4
4
|
import { DUpload as D } from "./upload/index.js";
|
|
5
|
+
import { DIcon as d } from "./icon/index.js";
|
|
5
6
|
export {
|
|
6
7
|
p as DCopy,
|
|
7
8
|
t as DFoldText,
|
|
9
|
+
d as DIcon,
|
|
8
10
|
f as DIconTip,
|
|
9
11
|
D as DUpload
|
|
10
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-upload[data-v-
|
|
1
|
+
.d-upload[data-v-666f4d72]{line-height:normal}.d-upload.is-list[data-v-666f4d72],.d-upload.is-list .list[data-v-666f4d72]{display:flex;flex-direction:column;gap:8px}.d-upload.is-list .list .list-item .file-row[data-v-666f4d72]{position:relative;display:flex;align-items:center;gap:10px}.d-upload.is-list .list .list-item .file-row[data-v-666f4d72] .el-link{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d-upload.is-list .list .list-item .file-row[data-v-666f4d72] .el-link .el-link__inner{display:inline}.d-upload.is-list .list .list-item .file-row .remove-icon[data-v-666f4d72]{cursor:pointer;display:none;color:var(--el-text-color-secondary)}.d-upload.is-list .list .list-item .file-row:hover .remove-icon[data-v-666f4d72]{display:block}.d-upload.is-card[data-v-666f4d72],.d-upload.is-card .card[data-v-666f4d72]{display:flex;flex-wrap:wrap;gap:8px}.d-upload.is-card .card .card-item[data-v-666f4d72]{display:flex;justify-content:center;align-items:center;font-size:16px;border:1px solid var(--el-border-color);border-radius:4px;overflow:hidden;position:relative;cursor:pointer}.d-upload.is-card .card .card-item .card-cover[data-v-666f4d72]{display:flex;justify-content:center;align-items:center;gap:10px;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--el-overlay-color);opacity:0}.d-upload.is-card .card .card-item .card-cover .d-icon[data-v-666f4d72]{color:var(--el-color-white)}.d-upload.is-card .card .card-item .card-cover[data-v-666f4d72]:hover{opacity:1}.d-upload.is-card .card .el-image[data-v-666f4d72]{width:100%;height:100%}.d-upload .expand-toggle[data-v-666f4d72] .el-link__inner{gap:5px}.d-upload .tip[data-v-666f4d72]{width:100%;font-size:12px;margin:0;color:var(--el-text-color-regular)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useModel as ve, ref as y, computed as v, watch as
|
|
1
|
+
import { useModel as ve, ref as y, computed as v, watch as Ee, onMounted as Ve, onBeforeUnmount as Ie, openBlock as o, createElementBlock as f, normalizeClass as Ne, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as i, createElementVNode as _, createTextVNode as C, toDisplayString as k, normalizeStyle as F, Fragment as q, renderList as ye, withModifiers as he, mergeModels as ge } from "vue";
|
|
2
2
|
import "../../../hooks/index.js";
|
|
3
|
-
import { useFormItem as Be, ElMessageBox as $e, ElMessage as O, ElUpload as Pe, ElImageViewer as je, ElDialog as Re, ElButton as M, ElImage as He,
|
|
3
|
+
import { useFormItem as Be, ElMessageBox as $e, ElMessage as O, ElUpload as Pe, ElImageViewer as je, ElDialog as Re, ElButton as M, ElImage as He, ElProgress as ke, ElLink as K } from "element-plus";
|
|
4
|
+
import "../../index.js";
|
|
4
5
|
import { cloneDeep as L, isFunction as we } from "lodash-es";
|
|
5
6
|
import { saveAs as qe } from "file-saver";
|
|
6
7
|
import Oe from "../../icons/angle-down-light.vue.js";
|
|
@@ -17,6 +18,7 @@ import './upload2.css';import './upload.css';/* empty css */
|
|
|
17
18
|
import et from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
18
19
|
import { useLocale as tt } from "../../../hooks/use-locale/index.js";
|
|
19
20
|
import { useActivated as lt } from "../../../hooks/use-activated/index.js";
|
|
21
|
+
import { DIcon as h } from "../../icon/index.js";
|
|
20
22
|
const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
21
23
|
key: 0,
|
|
22
24
|
style: { width: "100%" }
|
|
@@ -106,7 +108,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
106
108
|
}),
|
|
107
109
|
emits: /* @__PURE__ */ ge(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
|
|
108
110
|
setup(g, { emit: xe }) {
|
|
109
|
-
const l = g,
|
|
111
|
+
const l = g, z = xe, D = ve(g, "modelValue"), X = ve(g, "uploadingCount"), G = ["jpg", "jpeg", "png", "gif"], Se = ["mp4"], s = y([]), E = y(!1), w = y(!1), V = y(0), I = y([]), b = y(""), x = y(!1), J = y(null), Q = y(null), { t: r } = tt(), _e = lt(), { formItem: W } = Be(), N = v(() => x.value ? s.value : s.value.slice(0, l.maxShow)), B = v(() => s.value.length > 0), $ = v(() => !l.disabled && !Y.value), T = v(() => l.showType === "list"), Y = v(() => s.value.length >= l.maxNumber), Ce = v(() => T.value ? "is-list" : "is-card"), Z = v(() => l.format.length ? l.format.map((t) => t.toUpperCase()) : []), ee = v(() => ({
|
|
110
112
|
width: l.size,
|
|
111
113
|
height: l.size
|
|
112
114
|
})), Le = v(() => l.format.map((t) => `.${t}`).join(",")), te = v(() => ({
|
|
@@ -135,9 +137,9 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
135
137
|
}, S = (t) => G.includes(P(t.name)), U = (t) => Se.includes(P(t.name)), A = (t) => t?.uploadStatus === "finished", le = (t) => !l.disabled && A(t), ae = () => {
|
|
136
138
|
J.value?.$el.querySelector("input")?.click();
|
|
137
139
|
}, Ue = (t) => {
|
|
138
|
-
if (
|
|
140
|
+
if (V.value = 0, I.value = [], b.value = "", S(t)) {
|
|
139
141
|
const a = s.value.filter((e) => S(e));
|
|
140
|
-
|
|
142
|
+
V.value = a.findIndex((e) => e.url === t.url), I.value = a.map((e) => e.url), E.value = !0;
|
|
141
143
|
}
|
|
142
144
|
U(t) && (b.value = t.url, w.value = !0);
|
|
143
145
|
}, oe = () => {
|
|
@@ -145,7 +147,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
145
147
|
}, ne = (t) => {
|
|
146
148
|
const a = () => {
|
|
147
149
|
const u = s.value.indexOf(t);
|
|
148
|
-
u !== -1 && (s.value.splice(u, 1),
|
|
150
|
+
u !== -1 && (s.value.splice(u, 1), D.value = L(s.value), z("change", u, L(s.value)), W?.validate("change"));
|
|
149
151
|
}, e = async () => {
|
|
150
152
|
if (!A(t)) {
|
|
151
153
|
a();
|
|
@@ -162,7 +164,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
162
164
|
}, Ae = (t) => {
|
|
163
165
|
O.success(r("d.upload.fileSuccess", { file: t.name }));
|
|
164
166
|
const a = s.value.every((e) => e.uploadStatus === "finished");
|
|
165
|
-
|
|
167
|
+
z("success", t, a);
|
|
166
168
|
}, Fe = (t, a) => {
|
|
167
169
|
const e = P(t.name);
|
|
168
170
|
if (e) {
|
|
@@ -171,12 +173,12 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
171
173
|
return a || O.error(r("d.upload.fileFormat", { file: t.name, format: l.format.join("/") })), !1;
|
|
172
174
|
}
|
|
173
175
|
return !0;
|
|
174
|
-
}, Me = (t) => t.size > l.maxSize * 1024 * 1024 ? (O.error(r("d.upload.fileLessThan", { file: t.name, size: l.maxSize })), !1) : !0,
|
|
176
|
+
}, Me = (t) => t.size > l.maxSize * 1024 * 1024 ? (O.error(r("d.upload.fileLessThan", { file: t.name, size: l.maxSize })), !1) : !0, ze = (t, a) => {
|
|
175
177
|
if (!a)
|
|
176
178
|
return;
|
|
177
179
|
const { loaded: e = 0, total: u = 0 } = t || {};
|
|
178
180
|
u > 0 && (a.percentage = Math.floor(e / u * 100));
|
|
179
|
-
}, se = (t, a) => (Fe(t, a) && Me(t) &&
|
|
181
|
+
}, se = (t, a) => (Fe(t, a) && Me(t) && De(t), !1), De = async (t) => {
|
|
180
182
|
if (Y.value)
|
|
181
183
|
return !1;
|
|
182
184
|
x.value || j();
|
|
@@ -196,7 +198,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
196
198
|
url: l.url,
|
|
197
199
|
method: "post",
|
|
198
200
|
data: a,
|
|
199
|
-
onUploadProgress: (H) =>
|
|
201
|
+
onUploadProgress: (H) => ze(H, e)
|
|
200
202
|
}), R = ce?.data || ce;
|
|
201
203
|
if (R && m() !== -1) {
|
|
202
204
|
const {
|
|
@@ -219,7 +221,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
219
221
|
} catch {
|
|
220
222
|
m() !== -1 && s.value.splice(m(), 1);
|
|
221
223
|
} finally {
|
|
222
|
-
X.value--,
|
|
224
|
+
X.value--, D.value = L(s.value), z("change", u, L(s.value)), W?.validate("change");
|
|
223
225
|
}
|
|
224
226
|
}, ie = (t) => {
|
|
225
227
|
t?.url && qe(t.url, t.name);
|
|
@@ -240,13 +242,13 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
240
242
|
ie(t);
|
|
241
243
|
});
|
|
242
244
|
};
|
|
243
|
-
return
|
|
244
|
-
|
|
245
|
+
return Ee(
|
|
246
|
+
D,
|
|
245
247
|
(t) => {
|
|
246
248
|
Te(t);
|
|
247
249
|
},
|
|
248
250
|
{ immediate: !0 }
|
|
249
|
-
),
|
|
251
|
+
), Ve(() => {
|
|
250
252
|
document.addEventListener("paste", re);
|
|
251
253
|
}), Ie(() => {
|
|
252
254
|
document.removeEventListener("paste", re);
|
|
@@ -265,13 +267,13 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
265
267
|
multiple: "",
|
|
266
268
|
action: "/"
|
|
267
269
|
}, null, 8, ["file-list", "accept"]),
|
|
268
|
-
|
|
270
|
+
E.value ? (o(), c(n(je), {
|
|
269
271
|
key: 0,
|
|
270
272
|
"url-list": I.value,
|
|
271
|
-
"initial-index":
|
|
273
|
+
"initial-index": V.value,
|
|
272
274
|
"hide-on-click-modal": "",
|
|
273
275
|
teleported: "",
|
|
274
|
-
onClose: a[0] || (a[0] = (e) =>
|
|
276
|
+
onClose: a[0] || (a[0] = (e) => E.value = !1)
|
|
275
277
|
}, null, 8, ["url-list", "initial-index"])) : p("", !0),
|
|
276
278
|
w.value ? (o(), c(n(Re), {
|
|
277
279
|
key: 1,
|
|
@@ -490,7 +492,7 @@ const at = { class: "d-upload__preview" }, ot = ["src"], nt = { key: 2 }, st = {
|
|
|
490
492
|
])) : p("", !0)
|
|
491
493
|
], 2));
|
|
492
494
|
}
|
|
493
|
-
}), Et = /* @__PURE__ */ et(pt, [["__scopeId", "data-v-
|
|
495
|
+
}), Et = /* @__PURE__ */ et(pt, [["__scopeId", "data-v-666f4d72"]]);
|
|
494
496
|
export {
|
|
495
497
|
Et as default
|
|
496
498
|
};
|
package/index.js
CHANGED
|
@@ -2,22 +2,24 @@ import { install as o } from "./install.js";
|
|
|
2
2
|
import "./components/index.js";
|
|
3
3
|
import "./hooks/index.js";
|
|
4
4
|
import { setComponentRegistry as x, setGlobalConfig as i } from "./config/index.js";
|
|
5
|
-
import { DCopy as
|
|
6
|
-
import { DFoldText as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { DCopy as n } from "./components/copy/index.js";
|
|
6
|
+
import { DFoldText as a } from "./components/fold-text/index.js";
|
|
7
|
+
import { DIcon as d } from "./components/icon/index.js";
|
|
8
|
+
import { DIconTip as u } from "./components/icon-tip/index.js";
|
|
9
|
+
import { DUpload as g } from "./components/upload/index.js";
|
|
10
|
+
import { useActivated as I } from "./hooks/use-activated/index.js";
|
|
11
|
+
import { useLocale as b } from "./hooks/use-locale/index.js";
|
|
11
12
|
const p = { install: o };
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
u as
|
|
14
|
+
n as DCopy,
|
|
15
|
+
a as DFoldText,
|
|
16
|
+
d as DIcon,
|
|
17
|
+
u as DIconTip,
|
|
18
|
+
g as DUpload,
|
|
17
19
|
p as default,
|
|
18
20
|
o as install,
|
|
19
21
|
x as setComponentRegistry,
|
|
20
22
|
i as setGlobalConfig,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
I as useActivated,
|
|
24
|
+
b as useLocale
|
|
23
25
|
};
|