y-admin-ui 0.4.3 → 0.4.4
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/lib/index.3c57ada2.js +6 -0
- package/lib/{index.46448ad6.js → index.a71f42da.js} +176 -173
- package/lib/index.a71f42da.js.gz +0 -0
- package/lib/style.css +1 -1
- package/lib/style.css.gz +0 -0
- package/lib/y-admin-ui.js +1 -1
- package/lib/y-admin-ui.umd.cjs +1 -1
- package/lib/y-file-grid-item.3bec6068.js +99 -0
- package/lib/y-file-grid.5eb564d7.js +84 -0
- package/package.json +1 -1
- package/lib/index.46448ad6.js.gz +0 -0
- package/lib/index.7b316528.js +0 -6
- package/lib/y-file-grid-item.86903767.js +0 -95
- package/lib/y-file-grid.3dc64d1a.js +0 -81
@@ -0,0 +1,99 @@
|
|
1
|
+
import { defineComponent as h, useSlots as p, reactive as k, computed as n, resolveComponent as b, openBlock as r, createElementBlock as m, normalizeClass as a, createElementVNode as i, renderSlot as d, createVNode as v, withCtx as C, toDisplayString as g, withModifiers as w, createCommentVNode as x } from "vue";
|
2
|
+
const A = { class: "y-file-list-item-body" }, E = { class: "y-file-list-item-icon" }, B = ["src", "alt"], N = ["title"], S = { class: "item-txt-title line-clamp-1 w-full break-words" }, V = ["onClick"], q = /* @__PURE__ */ i("i", { class: "y-file-icon-check y-bg-primary" }, null, -1), D = [
|
3
|
+
q
|
4
|
+
], T = /* @__PURE__ */ i("div", { class: "y-file-list-item-bg y-bg-primary" }, null, -1), $ = /* @__PURE__ */ i("div", { class: "y-file-list-item-border y-border-primary" }, null, -1), j = { class: "y-file-list-item-leftTop" }, z = h({
|
5
|
+
name: "YFileGridItem"
|
6
|
+
}), G = /* @__PURE__ */ h({
|
7
|
+
...z,
|
8
|
+
props: {
|
9
|
+
item: {
|
10
|
+
type: Object,
|
11
|
+
required: !0,
|
12
|
+
default: () => ({})
|
13
|
+
},
|
14
|
+
checkbox: Boolean,
|
15
|
+
selection: Array,
|
16
|
+
icons: {
|
17
|
+
type: Array,
|
18
|
+
required: !0,
|
19
|
+
default: () => []
|
20
|
+
}
|
21
|
+
},
|
22
|
+
emits: ["item-click", "item-check-change"],
|
23
|
+
setup(s, { emit: l }) {
|
24
|
+
const e = s;
|
25
|
+
p(), k({});
|
26
|
+
const f = n(() => Array.isArray(e.selection) && e.selection.includes(e.item)), y = n(() => {
|
27
|
+
if (e.item.thumbnail)
|
28
|
+
return e.item.thumbnail;
|
29
|
+
if (e.item.isDirectory) {
|
30
|
+
const t = e.icons.find((o) => o.type === "dir");
|
31
|
+
return t == null ? void 0 : t.icon;
|
32
|
+
}
|
33
|
+
let c;
|
34
|
+
if (e.icons.forEach((t) => {
|
35
|
+
t.types && t.types.forEach((o) => {
|
36
|
+
e.item.name.endsWith(o) && (c = t.icon);
|
37
|
+
});
|
38
|
+
}), !c) {
|
39
|
+
const t = e.icons.find((o) => o.type === "file");
|
40
|
+
c = t == null ? void 0 : t.icon;
|
41
|
+
}
|
42
|
+
return c;
|
43
|
+
}), u = () => {
|
44
|
+
l("item-click", e.item);
|
45
|
+
}, _ = () => {
|
46
|
+
l("item-check-change", e.item);
|
47
|
+
};
|
48
|
+
return (c, t) => {
|
49
|
+
const o = b("el-tooltip");
|
50
|
+
return r(), m("div", {
|
51
|
+
class: a(["y-file-list-item", { checked: f.value }]),
|
52
|
+
onClick: u
|
53
|
+
}, [
|
54
|
+
i("div", A, [
|
55
|
+
i("div", E, [
|
56
|
+
d(c.$slots, "content", {
|
57
|
+
item: e.item
|
58
|
+
}, () => [
|
59
|
+
i("img", {
|
60
|
+
src: y.value,
|
61
|
+
alt: e.item.name,
|
62
|
+
class: a({ "y-file-list-item-icon-image": e.item.thumbnail })
|
63
|
+
}, null, 10, B)
|
64
|
+
])
|
65
|
+
]),
|
66
|
+
i("div", {
|
67
|
+
class: "y-file-list-item-title ele-text-primary",
|
68
|
+
title: e.item.name
|
69
|
+
}, [
|
70
|
+
v(o, {
|
71
|
+
content: e.item.name,
|
72
|
+
placement: "top"
|
73
|
+
}, {
|
74
|
+
default: C(() => [
|
75
|
+
i("div", S, g(e.item.name), 1)
|
76
|
+
]),
|
77
|
+
_: 1
|
78
|
+
}, 8, ["content"])
|
79
|
+
], 8, N)
|
80
|
+
]),
|
81
|
+
s.checkbox ? (r(), m("div", {
|
82
|
+
key: 0,
|
83
|
+
class: "y-file-list-item-check y-bg-white",
|
84
|
+
onClick: w(_, ["stop"])
|
85
|
+
}, D, 8, V)) : x("", !0),
|
86
|
+
T,
|
87
|
+
$,
|
88
|
+
i("div", j, [
|
89
|
+
d(c.$slots, "leftTop", {
|
90
|
+
item: e.item
|
91
|
+
})
|
92
|
+
])
|
93
|
+
], 2);
|
94
|
+
};
|
95
|
+
}
|
96
|
+
});
|
97
|
+
export {
|
98
|
+
G as default
|
99
|
+
};
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { defineComponent as h, defineAsyncComponent as C, computed as x, resolveComponent as b, openBlock as t, createElementBlock as o, createElementVNode as l, withModifiers as v, normalizeClass as A, toDisplayString as s, createCommentVNode as B, Fragment as T, renderList as S, createBlock as F, unref as N, withCtx as r, renderSlot as a, createVNode as q } from "vue";
|
2
|
+
const G = {
|
3
|
+
data: {
|
4
|
+
type: Array,
|
5
|
+
required: !0
|
6
|
+
},
|
7
|
+
icons: {
|
8
|
+
type: Array,
|
9
|
+
required: !0
|
10
|
+
},
|
11
|
+
selection: Array,
|
12
|
+
checkbox: Boolean,
|
13
|
+
checked: Boolean,
|
14
|
+
indeterminate: Boolean,
|
15
|
+
total: Number,
|
16
|
+
totalText: {
|
17
|
+
type: String,
|
18
|
+
required: !0,
|
19
|
+
default: () => ""
|
20
|
+
},
|
21
|
+
checkAllText: String
|
22
|
+
}, I = {
|
23
|
+
key: 0,
|
24
|
+
class: "y-file-list"
|
25
|
+
}, V = {
|
26
|
+
key: 0,
|
27
|
+
class: "y-file-list-header"
|
28
|
+
}, Y = ["onClick"], w = { key: 0 }, z = { key: 1 }, E = {
|
29
|
+
key: 1,
|
30
|
+
style: { height: "100%", display: "flex", "justify-content": "center", "align-items": "center" }
|
31
|
+
}, $ = h({
|
32
|
+
name: "YFileGrid"
|
33
|
+
}), L = /* @__PURE__ */ h({
|
34
|
+
...$,
|
35
|
+
props: G,
|
36
|
+
emits: ["check-all-change", "item-check-change", "item-click"],
|
37
|
+
setup(d, { emit: i }) {
|
38
|
+
const e = d, m = C(() => import("./y-file-grid-item.3bec6068.js")), k = x(() => [["y-file-list-check y-file-icon-check y-bg-primary", { checked: e.checked }]]), p = () => {
|
39
|
+
i("check-all-change");
|
40
|
+
}, y = (c) => {
|
41
|
+
i("item-click", c);
|
42
|
+
}, u = (c) => {
|
43
|
+
i("item-check-change", c);
|
44
|
+
};
|
45
|
+
return (c, j) => {
|
46
|
+
const _ = b("el-empty");
|
47
|
+
return e.data.length > 0 ? (t(), o("div", I, [
|
48
|
+
e.checkbox ? (t(), o("div", V, [
|
49
|
+
l("div", {
|
50
|
+
class: "y-file-list-check-group",
|
51
|
+
onClick: v(p, ["stop"])
|
52
|
+
}, [
|
53
|
+
l("i", {
|
54
|
+
class: A(k.value)
|
55
|
+
}, null, 2),
|
56
|
+
e.total ? (t(), o("div", w, s(e.totalText.replace(/{total}/g, String(e.total))), 1)) : (t(), o("div", z, s(e.checkAllText), 1))
|
57
|
+
], 8, Y)
|
58
|
+
])) : B("", !0),
|
59
|
+
(t(!0), o(T, null, S(e.data, (g, f) => (t(), F(N(m), {
|
60
|
+
key: f,
|
61
|
+
item: g,
|
62
|
+
icons: e.icons,
|
63
|
+
checkbox: e.checkbox,
|
64
|
+
selection: e.selection,
|
65
|
+
onItemClick: y,
|
66
|
+
onItemCheckChange: u
|
67
|
+
}, {
|
68
|
+
content: r(({ item: n }) => [
|
69
|
+
a(c.$slots, "content", { item: n })
|
70
|
+
]),
|
71
|
+
leftTop: r(({ item: n }) => [
|
72
|
+
a(c.$slots, "leftTop", { item: n })
|
73
|
+
]),
|
74
|
+
_: 2
|
75
|
+
}, 1032, ["item", "icons", "checkbox", "selection"]))), 128))
|
76
|
+
])) : (t(), o("div", E, [
|
77
|
+
q(_, { "image-size": 200 })
|
78
|
+
]));
|
79
|
+
};
|
80
|
+
}
|
81
|
+
});
|
82
|
+
export {
|
83
|
+
L as default
|
84
|
+
};
|
package/package.json
CHANGED
package/lib/index.46448ad6.js.gz
DELETED
Binary file
|
package/lib/index.7b316528.js
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
import { defineComponent as d, reactive as u, computed as n, resolveComponent as p, openBlock as r, createElementBlock as m, normalizeClass as a, createElementVNode as i, createVNode as k, withCtx as b, toDisplayString as v, withModifiers as C, createCommentVNode as g, renderSlot as x } from "vue";
|
2
|
-
const w = { class: "y-file-list-item-body" }, A = { class: "y-file-list-item-icon" }, E = ["src", "alt"], B = ["title"], N = { class: "item-txt-title line-clamp-1 w-full break-words" }, V = ["onClick"], q = /* @__PURE__ */ i("i", { class: "y-file-icon-check y-bg-primary" }, null, -1), D = [
|
3
|
-
q
|
4
|
-
], S = /* @__PURE__ */ i("div", { class: "y-file-list-item-bg y-bg-primary" }, null, -1), T = /* @__PURE__ */ i("div", { class: "y-file-list-item-border y-border-primary" }, null, -1), j = { class: "y-file-list-item-leftTop" }, z = d({
|
5
|
-
name: "YFileGridItem"
|
6
|
-
}), G = /* @__PURE__ */ d({
|
7
|
-
...z,
|
8
|
-
props: {
|
9
|
-
item: {
|
10
|
-
type: Object,
|
11
|
-
required: !0,
|
12
|
-
default: () => ({})
|
13
|
-
},
|
14
|
-
checkbox: Boolean,
|
15
|
-
selection: Array,
|
16
|
-
icons: {
|
17
|
-
type: Array,
|
18
|
-
required: !0,
|
19
|
-
default: () => []
|
20
|
-
}
|
21
|
-
},
|
22
|
-
emits: ["item-click", "item-check-change"],
|
23
|
-
setup(s, { emit: l }) {
|
24
|
-
const e = s;
|
25
|
-
u({});
|
26
|
-
const h = n(() => Array.isArray(e.selection) && e.selection.includes(e.item)), f = n(() => {
|
27
|
-
if (e.item.thumbnail)
|
28
|
-
return e.item.thumbnail;
|
29
|
-
if (e.item.isDirectory) {
|
30
|
-
const t = e.icons.find((c) => c.type === "dir");
|
31
|
-
return t == null ? void 0 : t.icon;
|
32
|
-
}
|
33
|
-
let o;
|
34
|
-
if (e.icons.forEach((t) => {
|
35
|
-
t.types && t.types.forEach((c) => {
|
36
|
-
e.item.name.endsWith(c) && (o = t.icon);
|
37
|
-
});
|
38
|
-
}), !o) {
|
39
|
-
const t = e.icons.find((c) => c.type === "file");
|
40
|
-
o = t == null ? void 0 : t.icon;
|
41
|
-
}
|
42
|
-
return o;
|
43
|
-
}), y = () => {
|
44
|
-
l("item-click", e.item);
|
45
|
-
}, _ = () => {
|
46
|
-
l("item-check-change", e.item);
|
47
|
-
};
|
48
|
-
return (o, t) => {
|
49
|
-
const c = p("el-tooltip");
|
50
|
-
return r(), m("div", {
|
51
|
-
class: a(["y-file-list-item", { checked: h.value }]),
|
52
|
-
onClick: y
|
53
|
-
}, [
|
54
|
-
i("div", w, [
|
55
|
-
i("div", A, [
|
56
|
-
i("img", {
|
57
|
-
src: f.value,
|
58
|
-
alt: e.item.name,
|
59
|
-
class: a({ "y-file-list-item-icon-image": e.item.thumbnail })
|
60
|
-
}, null, 10, E)
|
61
|
-
]),
|
62
|
-
i("div", {
|
63
|
-
class: "y-file-list-item-title ele-text-primary",
|
64
|
-
title: e.item.name
|
65
|
-
}, [
|
66
|
-
k(c, {
|
67
|
-
content: e.item.name,
|
68
|
-
placement: "top"
|
69
|
-
}, {
|
70
|
-
default: b(() => [
|
71
|
-
i("div", N, v(e.item.name), 1)
|
72
|
-
]),
|
73
|
-
_: 1
|
74
|
-
}, 8, ["content"])
|
75
|
-
], 8, B)
|
76
|
-
]),
|
77
|
-
s.checkbox ? (r(), m("div", {
|
78
|
-
key: 0,
|
79
|
-
class: "y-file-list-item-check y-bg-white",
|
80
|
-
onClick: C(_, ["stop"])
|
81
|
-
}, D, 8, V)) : g("", !0),
|
82
|
-
S,
|
83
|
-
T,
|
84
|
-
i("div", j, [
|
85
|
-
x(o.$slots, "leftTop", {
|
86
|
-
item: e.item
|
87
|
-
})
|
88
|
-
])
|
89
|
-
], 2);
|
90
|
-
};
|
91
|
-
}
|
92
|
-
});
|
93
|
-
export {
|
94
|
-
G as default
|
95
|
-
};
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import { defineComponent as s, defineAsyncComponent as g, computed as f, resolveComponent as C, openBlock as t, createElementBlock as c, createElementVNode as n, withModifiers as x, normalizeClass as b, toDisplayString as l, createCommentVNode as v, Fragment as A, renderList as B, createBlock as T, unref as S, withCtx as F, renderSlot as N, createVNode as q } from "vue";
|
2
|
-
const G = {
|
3
|
-
data: {
|
4
|
-
type: Array,
|
5
|
-
required: !0
|
6
|
-
},
|
7
|
-
icons: {
|
8
|
-
type: Array,
|
9
|
-
required: !0
|
10
|
-
},
|
11
|
-
selection: Array,
|
12
|
-
checkbox: Boolean,
|
13
|
-
checked: Boolean,
|
14
|
-
indeterminate: Boolean,
|
15
|
-
total: Number,
|
16
|
-
totalText: {
|
17
|
-
type: String,
|
18
|
-
required: !0,
|
19
|
-
default: () => ""
|
20
|
-
},
|
21
|
-
checkAllText: String
|
22
|
-
}, I = {
|
23
|
-
key: 0,
|
24
|
-
class: "y-file-list"
|
25
|
-
}, V = {
|
26
|
-
key: 0,
|
27
|
-
class: "y-file-list-header"
|
28
|
-
}, Y = ["onClick"], w = { key: 0 }, z = { key: 1 }, E = {
|
29
|
-
key: 1,
|
30
|
-
style: { height: "100%", display: "flex", "justify-content": "center", "align-items": "center" }
|
31
|
-
}, j = s({
|
32
|
-
name: "YFileGrid"
|
33
|
-
}), M = /* @__PURE__ */ s({
|
34
|
-
...j,
|
35
|
-
props: G,
|
36
|
-
emits: ["check-all-change", "item-check-change", "item-click"],
|
37
|
-
setup(r, { emit: i }) {
|
38
|
-
const e = r, a = g(() => import("./y-file-grid-item.86903767.js")), h = f(() => [["y-file-list-check y-file-icon-check y-bg-primary", { checked: e.checked }]]), d = () => {
|
39
|
-
i("check-all-change");
|
40
|
-
}, k = (o) => {
|
41
|
-
i("item-click", o);
|
42
|
-
}, m = (o) => {
|
43
|
-
i("item-check-change", o);
|
44
|
-
};
|
45
|
-
return (o, D) => {
|
46
|
-
const p = C("el-empty");
|
47
|
-
return e.data.length > 0 ? (t(), c("div", I, [
|
48
|
-
e.checkbox ? (t(), c("div", V, [
|
49
|
-
n("div", {
|
50
|
-
class: "y-file-list-check-group",
|
51
|
-
onClick: x(d, ["stop"])
|
52
|
-
}, [
|
53
|
-
n("i", {
|
54
|
-
class: b(h.value)
|
55
|
-
}, null, 2),
|
56
|
-
e.total ? (t(), c("div", w, l(e.totalText.replace(/{total}/g, String(e.total))), 1)) : (t(), c("div", z, l(e.checkAllText), 1))
|
57
|
-
], 8, Y)
|
58
|
-
])) : v("", !0),
|
59
|
-
(t(!0), c(A, null, B(e.data, (y, u) => (t(), T(S(a), {
|
60
|
-
key: u,
|
61
|
-
item: y,
|
62
|
-
icons: e.icons,
|
63
|
-
checkbox: e.checkbox,
|
64
|
-
selection: e.selection,
|
65
|
-
onItemClick: k,
|
66
|
-
onItemCheckChange: m
|
67
|
-
}, {
|
68
|
-
leftTop: F(({ item: _ }) => [
|
69
|
-
N(o.$slots, "leftTop", { item: _ })
|
70
|
-
]),
|
71
|
-
_: 2
|
72
|
-
}, 1032, ["item", "icons", "checkbox", "selection"]))), 128))
|
73
|
-
])) : (t(), c("div", E, [
|
74
|
-
q(p, { "image-size": 200 })
|
75
|
-
]));
|
76
|
-
};
|
77
|
-
}
|
78
|
-
});
|
79
|
-
export {
|
80
|
-
M as default
|
81
|
-
};
|