vft 0.0.317 → 0.0.319
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/index.css +1 -1
- package/es/component.js +157 -155
- package/es/components/avatar-stack/avatar-stack.vue.d.ts +12 -0
- package/es/components/avatar-stack/avatar-stack.vue.js +4 -0
- package/es/components/avatar-stack/avatar-stack.vue2.js +70 -0
- package/es/components/avatar-stack/index.d.ts +43 -0
- package/es/components/avatar-stack/index.js +12 -0
- package/es/components/avatar-stack/style/css.d.ts +4 -0
- package/es/components/avatar-stack/style/css.js +6 -0
- package/es/components/avatar-stack/style/index.d.ts +4 -0
- package/es/components/avatar-stack/style/index.js +6 -0
- package/es/components/avatar-stack/types.d.ts +19 -0
- package/es/components/avatar-stack/types.js +1 -0
- package/es/components/color-picker/color-picker.vue2.js +1 -1
- package/es/components/index.d.ts +13 -12
- package/es/components/index.js +421 -419
- package/es/components/list-cell/list-cell.vue2.js +36 -36
- package/es/components/super-form/component-map.d.ts +6 -0
- package/es/components/super-form/component-map.js +42 -30
- package/es/components/super-form/style/css.d.ts +6 -0
- package/es/components/super-form/style/css.js +15 -6
- package/es/components/super-form/style/index.d.ts +6 -0
- package/es/components/super-form/style/index.js +16 -7
- package/es/components/super-form/super-form-item.vue2.js +217 -199
- package/es/components/super-form/use/helper.js +137 -23
- package/es/components/table/style/css.js +15 -6
- package/es/components/table/style/index.js +16 -7
- package/es/components/tree/index.d.ts +5 -5
- package/es/components/tree/tree.vue.d.ts +2 -2
- package/es/components/upload/index.d.ts +15 -15
- package/es/components/upload/upload-content.vue.d.ts +1 -1
- package/es/components/upload/upload-content.vue2.js +51 -47
- package/es/components/upload/upload-list.vue2.js +70 -66
- package/es/components/upload/upload.vue.d.ts +1 -1
- package/es/components/upload/upload.vue2.js +30 -30
- package/es/index.js +562 -560
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/component.cjs +1 -1
- package/lib/components/avatar-stack/avatar-stack.vue.cjs +1 -0
- package/lib/components/avatar-stack/avatar-stack.vue.d.ts +12 -0
- package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -0
- package/lib/components/avatar-stack/index.cjs +1 -0
- package/lib/components/avatar-stack/index.d.ts +43 -0
- package/lib/components/avatar-stack/style/css.cjs +1 -0
- package/lib/components/avatar-stack/style/css.d.ts +4 -0
- package/lib/components/avatar-stack/style/index.cjs +1 -0
- package/lib/components/avatar-stack/style/index.d.ts +4 -0
- package/lib/components/avatar-stack/types.cjs +1 -0
- package/lib/components/avatar-stack/types.d.ts +19 -0
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/index.d.ts +13 -12
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/super-form/component-map.cjs +1 -1
- package/lib/components/super-form/component-map.d.ts +6 -0
- package/lib/components/super-form/style/css.cjs +1 -1
- package/lib/components/super-form/style/css.d.ts +6 -0
- package/lib/components/super-form/style/index.cjs +1 -1
- package/lib/components/super-form/style/index.d.ts +6 -0
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/table/style/css.cjs +1 -1
- package/lib/components/table/style/index.cjs +1 -1
- package/lib/components/tree/index.d.ts +5 -5
- package/lib/components/tree/tree.vue.d.ts +2 -2
- package/lib/components/upload/index.d.ts +15 -15
- package/lib/components/upload/upload-content.vue.d.ts +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue.d.ts +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/avatar-stack.scss +38 -0
- package/theme-style/src/common/var.scss +16 -2
- package/theme-style/src/index.scss +1 -0
- package/theme-style/src/super-form.scss +6 -1
- package/theme-style/vft-avatar-stack.css +1 -0
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { defineComponent as h, ref as
|
|
1
|
+
import { defineComponent as h, ref as V, createBlock as d, openBlock as o, TransitionGroup as B, unref as e, normalizeClass as s, withCtx as F, createElementBlock as m, renderSlot as g, Fragment as N, renderList as z, withKeys as I, createCommentVNode as c, createElementVNode as k, withModifiers as P, createVNode as v, toDisplayString as K, normalizeStyle as L, nextTick as S } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
|
-
import { VftIcon as
|
|
4
|
-
import { VftProgress as
|
|
3
|
+
import { VftIcon as u } from "../icon/index.js";
|
|
4
|
+
import { VftProgress as D } from "../progress/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "@vft/utils";
|
|
7
|
+
import { debugWarn as E } from "../../utils/error.js";
|
|
7
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
9
|
import "lodash-es";
|
|
9
10
|
import { useNamespace as f } from "../../hooks/use-namespace/index.js";
|
|
10
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
12
|
import "@popperjs/core";
|
|
12
13
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import { useFormDisabled as
|
|
14
|
-
|
|
14
|
+
import { useFormDisabled as U } from "../form/hooks/use-form-common-props.js";
|
|
15
|
+
import { useFormItem as G } from "../form/hooks/use-form-item.js";
|
|
16
|
+
const M = ["onKeydown"], R = ["src"], W = ["onClick"], j = ["onClick"], q = ["onClick"], A = h({
|
|
15
17
|
name: "VftUploadList"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
18
|
+
}), ae = /* @__PURE__ */ h({
|
|
19
|
+
...A,
|
|
18
20
|
props: {
|
|
19
21
|
files: { default: [] },
|
|
20
22
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -23,119 +25,121 @@ const E = ["onKeydown"], I = ["src"], U = ["onClick"], G = ["onClick"], M = ["on
|
|
|
23
25
|
listType: { default: "text" }
|
|
24
26
|
},
|
|
25
27
|
emits: ["remove"],
|
|
26
|
-
setup(
|
|
27
|
-
const T = C, i = f("upload"),
|
|
28
|
-
T("remove",
|
|
28
|
+
setup(H, { emit: C }) {
|
|
29
|
+
const T = C, i = f("upload"), n = f("icon"), w = f("list"), p = U(), { formItem: $ } = G(), y = V(!1), b = (t) => {
|
|
30
|
+
T("remove", t), S(() => {
|
|
31
|
+
$?.validate("change").catch((a) => E(a));
|
|
32
|
+
});
|
|
29
33
|
};
|
|
30
|
-
return (
|
|
34
|
+
return (t, a) => (o(), d(B, {
|
|
31
35
|
tag: "ul",
|
|
32
|
-
class:
|
|
36
|
+
class: s([
|
|
33
37
|
e(i).b("list"),
|
|
34
|
-
e(i).bm("list",
|
|
38
|
+
e(i).bm("list", t.listType),
|
|
35
39
|
e(i).is("disabled", e(p))
|
|
36
40
|
]),
|
|
37
41
|
name: e(w).b()
|
|
38
42
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
(
|
|
43
|
+
default: F(() => [
|
|
44
|
+
(o(!0), m(N, null, z(t.files, (l) => (o(), m("li", {
|
|
41
45
|
key: l.uid || l.name,
|
|
42
|
-
class:
|
|
46
|
+
class: s([
|
|
43
47
|
e(i).be("list", "item"),
|
|
44
48
|
e(i).is(l.status),
|
|
45
49
|
{ focusing: y.value }
|
|
46
50
|
]),
|
|
47
51
|
tabindex: "0",
|
|
48
|
-
onKeydown:
|
|
49
|
-
onFocus:
|
|
50
|
-
onBlur:
|
|
51
|
-
onClick:
|
|
52
|
+
onKeydown: I((r) => !e(p) && b(l), ["delete"]),
|
|
53
|
+
onFocus: a[0] || (a[0] = (r) => y.value = !0),
|
|
54
|
+
onBlur: a[1] || (a[1] = (r) => y.value = !1),
|
|
55
|
+
onClick: a[2] || (a[2] = (r) => y.value = !1)
|
|
52
56
|
}, [
|
|
53
|
-
g(
|
|
54
|
-
|
|
57
|
+
g(t.$slots, "default", { file: l }, () => [
|
|
58
|
+
t.listType === "picture" || l.status !== "uploading" && t.listType === "picture-card" ? (o(), m("img", {
|
|
55
59
|
key: 0,
|
|
56
|
-
class:
|
|
60
|
+
class: s(e(i).be("list", "item-thumbnail")),
|
|
57
61
|
src: l.url,
|
|
58
62
|
alt: ""
|
|
59
|
-
}, null, 10,
|
|
60
|
-
l.status === "uploading" ||
|
|
63
|
+
}, null, 10, R)) : c("", !0),
|
|
64
|
+
l.status === "uploading" || t.listType !== "picture-card" ? (o(), m("div", {
|
|
61
65
|
key: 1,
|
|
62
|
-
class:
|
|
66
|
+
class: s(e(i).be("list", "item-info"))
|
|
63
67
|
}, [
|
|
64
68
|
k("a", {
|
|
65
|
-
class:
|
|
66
|
-
onClick: P((
|
|
69
|
+
class: s(e(i).be("list", "item-name")),
|
|
70
|
+
onClick: P((r) => t.handlePreview(l), ["prevent"])
|
|
67
71
|
}, [
|
|
68
|
-
v(e(
|
|
69
|
-
class:
|
|
72
|
+
v(e(u), {
|
|
73
|
+
class: s(e(n).m("document")),
|
|
70
74
|
icon: "icon-document"
|
|
71
75
|
}, null, 8, ["class"]),
|
|
72
76
|
k("span", {
|
|
73
|
-
class:
|
|
77
|
+
class: s(e(i).be("list", "item-file-name"))
|
|
74
78
|
}, K(l.name), 3)
|
|
75
|
-
], 10,
|
|
76
|
-
l.status === "uploading" ? (
|
|
79
|
+
], 10, W),
|
|
80
|
+
l.status === "uploading" ? (o(), d(e(D), {
|
|
77
81
|
key: 0,
|
|
78
|
-
type:
|
|
79
|
-
"stroke-width":
|
|
82
|
+
type: t.listType === "picture-card" ? "circle" : "line",
|
|
83
|
+
"stroke-width": t.listType === "picture-card" ? 6 : 2,
|
|
80
84
|
percentage: Number(l.percentage),
|
|
81
|
-
style: L(
|
|
82
|
-
}, null, 8, ["type", "stroke-width", "percentage", "style"])) :
|
|
83
|
-
], 2)) :
|
|
85
|
+
style: L(t.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
86
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : c("", !0)
|
|
87
|
+
], 2)) : c("", !0),
|
|
84
88
|
k("label", {
|
|
85
|
-
class:
|
|
89
|
+
class: s(e(i).be("list", "item-status-label"))
|
|
86
90
|
}, [
|
|
87
|
-
|
|
91
|
+
t.listType === "text" ? (o(), d(e(u), {
|
|
88
92
|
key: 0,
|
|
89
93
|
icon: "icon-circle-check",
|
|
90
|
-
class:
|
|
91
|
-
}, null, 8, ["class"])) : ["picture-card", "picture"].includes(
|
|
94
|
+
class: s([e(n).m("upload-success"), e(n).m("circle-check")])
|
|
95
|
+
}, null, 8, ["class"])) : ["picture-card", "picture"].includes(t.listType) ? (o(), d(e(u), {
|
|
92
96
|
key: 1,
|
|
93
97
|
icon: "icon-check",
|
|
94
|
-
class:
|
|
95
|
-
}, null, 8, ["class"])) :
|
|
98
|
+
class: s([e(n).m("upload-success"), e(n).m("check")])
|
|
99
|
+
}, null, 8, ["class"])) : c("", !0)
|
|
96
100
|
], 2),
|
|
97
|
-
e(p) ?
|
|
101
|
+
e(p) ? c("", !0) : (o(), d(e(u), {
|
|
98
102
|
key: 2,
|
|
99
103
|
icon: "icon-close",
|
|
100
|
-
class:
|
|
101
|
-
onClick: (
|
|
104
|
+
class: s(e(n).m("close")),
|
|
105
|
+
onClick: (r) => b(l)
|
|
102
106
|
}, null, 8, ["class", "onClick"])),
|
|
103
|
-
e(p) ?
|
|
107
|
+
e(p) ? c("", !0) : (o(), m("i", {
|
|
104
108
|
key: 3,
|
|
105
|
-
class:
|
|
109
|
+
class: s(e(n).m("close-tip"))
|
|
106
110
|
}, " 按 delete 键可删除 ", 2)),
|
|
107
|
-
|
|
111
|
+
t.listType === "picture-card" ? (o(), m("span", {
|
|
108
112
|
key: 4,
|
|
109
|
-
class:
|
|
113
|
+
class: s(e(i).be("list", "item-actions"))
|
|
110
114
|
}, [
|
|
111
115
|
k("span", {
|
|
112
|
-
class:
|
|
113
|
-
onClick: (
|
|
116
|
+
class: s(e(i).be("list", "item-preview")),
|
|
117
|
+
onClick: (r) => t.handlePreview(l)
|
|
114
118
|
}, [
|
|
115
|
-
v(e(
|
|
119
|
+
v(e(u), {
|
|
116
120
|
icon: "icon-zoom-in",
|
|
117
|
-
class:
|
|
121
|
+
class: s(e(n).m("zoom-in"))
|
|
118
122
|
}, null, 8, ["class"])
|
|
119
|
-
], 10,
|
|
120
|
-
e(p) ?
|
|
123
|
+
], 10, j),
|
|
124
|
+
e(p) ? c("", !0) : (o(), m("span", {
|
|
121
125
|
key: 0,
|
|
122
|
-
class:
|
|
123
|
-
onClick: (
|
|
126
|
+
class: s(e(i).be("list", "item-delete")),
|
|
127
|
+
onClick: (r) => b(l)
|
|
124
128
|
}, [
|
|
125
|
-
v(e(
|
|
129
|
+
v(e(u), {
|
|
126
130
|
icon: "icon-delete",
|
|
127
|
-
class:
|
|
131
|
+
class: s(e(n).m("delete"))
|
|
128
132
|
}, null, 8, ["class"])
|
|
129
|
-
], 10,
|
|
130
|
-
], 2)) :
|
|
133
|
+
], 10, q))
|
|
134
|
+
], 2)) : c("", !0)
|
|
131
135
|
])
|
|
132
|
-
], 42,
|
|
133
|
-
g(
|
|
136
|
+
], 42, M))), 128)),
|
|
137
|
+
g(t.$slots, "append")
|
|
134
138
|
]),
|
|
135
139
|
_: 3
|
|
136
140
|
}, 8, ["class", "name"]));
|
|
137
141
|
}
|
|
138
142
|
});
|
|
139
143
|
export {
|
|
140
|
-
|
|
144
|
+
ae as default
|
|
141
145
|
};
|
|
@@ -89,8 +89,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
89
89
|
method: string;
|
|
90
90
|
multiple: boolean;
|
|
91
91
|
action: string;
|
|
92
|
-
accept: string;
|
|
93
92
|
showFileList: boolean;
|
|
93
|
+
accept: string;
|
|
94
94
|
fileList: import("./types").UploadUserFile[];
|
|
95
95
|
autoUpload: boolean;
|
|
96
96
|
listType: import("./types").ListType;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, useSlots as U, shallowRef as T, computed as h, onBeforeUnmount as j, provide as N, toRef as V, createElementBlock as _, openBlock as f, createBlock as m, createCommentVNode as t, renderSlot as l, unref as o, createSlots as g, withCtx as r, createVNode as q, mergeProps as k } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
|
-
import { ajaxUpload as
|
|
4
|
-
import { uploadContextKey as
|
|
3
|
+
import { ajaxUpload as D } from "./ajax.js";
|
|
4
|
+
import { uploadContextKey as H } from "./constants.js";
|
|
5
5
|
import R from "./upload-content.vue2.js";
|
|
6
|
-
import
|
|
7
|
-
import { useHandlers as
|
|
8
|
-
import { useFormDisabled as
|
|
9
|
-
const z =
|
|
6
|
+
import w from "./upload-list.vue2.js";
|
|
7
|
+
import { useHandlers as K } from "./use-handlers.js";
|
|
8
|
+
import { useFormDisabled as O } from "../form/hooks/use-form-common-props.js";
|
|
9
|
+
const W = { class: "vft-upload-wrapper" }, z = b({
|
|
10
10
|
name: "vft-upload"
|
|
11
|
-
}),
|
|
11
|
+
}), x = /* @__PURE__ */ b({
|
|
12
12
|
...z,
|
|
13
13
|
props: {
|
|
14
14
|
action: { default: "#" },
|
|
@@ -25,7 +25,7 @@ const z = w({
|
|
|
25
25
|
fileList: { default: [] },
|
|
26
26
|
autoUpload: { type: Boolean, default: !1 },
|
|
27
27
|
listType: { default: "text" },
|
|
28
|
-
httpRequest: { type: Function, default:
|
|
28
|
+
httpRequest: { type: Function, default: D },
|
|
29
29
|
disabled: { type: Boolean },
|
|
30
30
|
limit: {},
|
|
31
31
|
beforeUpload: {},
|
|
@@ -39,52 +39,52 @@ const z = w({
|
|
|
39
39
|
onExceed: {}
|
|
40
40
|
},
|
|
41
41
|
setup($, { expose: B }) {
|
|
42
|
-
const i = $, s = U(),
|
|
42
|
+
const i = $, s = U(), c = O(), u = T(), {
|
|
43
43
|
abort: L,
|
|
44
44
|
submit: P,
|
|
45
45
|
clearFiles: C,
|
|
46
46
|
uploadFiles: a,
|
|
47
|
-
handleStart:
|
|
47
|
+
handleStart: v,
|
|
48
48
|
handleError: F,
|
|
49
|
-
handleRemove:
|
|
49
|
+
handleRemove: d,
|
|
50
50
|
handleSuccess: S,
|
|
51
51
|
handleProgress: E
|
|
52
|
-
} =
|
|
52
|
+
} = K(i, u), n = h(() => i.listType === "picture-card"), y = h(() => ({
|
|
53
53
|
...i,
|
|
54
54
|
fileList: a.value,
|
|
55
|
-
onStart:
|
|
55
|
+
onStart: v,
|
|
56
56
|
onProgress: E,
|
|
57
57
|
onSuccess: S,
|
|
58
58
|
onError: F,
|
|
59
|
-
onRemove:
|
|
59
|
+
onRemove: d
|
|
60
60
|
}));
|
|
61
61
|
return j(() => {
|
|
62
62
|
a.value.forEach(({ url: e }) => {
|
|
63
63
|
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
64
64
|
});
|
|
65
|
-
}), N(
|
|
65
|
+
}), N(H, {
|
|
66
66
|
accept: V(i, "accept")
|
|
67
67
|
}), B({
|
|
68
68
|
abort: L,
|
|
69
69
|
submit: P,
|
|
70
70
|
clearFiles: C,
|
|
71
|
-
handleStart:
|
|
72
|
-
handleRemove:
|
|
71
|
+
handleStart: v,
|
|
72
|
+
handleRemove: d,
|
|
73
73
|
fileList: a
|
|
74
|
-
}), (e, A) => (f(),
|
|
75
|
-
|
|
74
|
+
}), (e, A) => (f(), _("div", W, [
|
|
75
|
+
n.value && e.showFileList ? (f(), m(w, {
|
|
76
76
|
key: 0,
|
|
77
|
-
disabled: o(
|
|
77
|
+
disabled: o(c),
|
|
78
78
|
"list-type": e.listType,
|
|
79
79
|
files: o(a),
|
|
80
80
|
"handle-preview": e.onPreview,
|
|
81
|
-
onRemove: o(
|
|
81
|
+
onRemove: o(d)
|
|
82
82
|
}, g({
|
|
83
83
|
append: r(() => [
|
|
84
|
-
|
|
84
|
+
q(R, k({
|
|
85
85
|
ref_key: "uploadRef",
|
|
86
86
|
ref: u
|
|
87
|
-
},
|
|
87
|
+
}, y.value), {
|
|
88
88
|
default: r(() => [
|
|
89
89
|
o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
|
|
90
90
|
!o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
|
|
@@ -102,11 +102,11 @@ const z = w({
|
|
|
102
102
|
key: "0"
|
|
103
103
|
} : void 0
|
|
104
104
|
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : t("", !0),
|
|
105
|
-
!
|
|
105
|
+
!n.value || n.value && !e.showFileList ? (f(), m(R, k({
|
|
106
106
|
key: 1,
|
|
107
107
|
ref_key: "uploadRef",
|
|
108
108
|
ref: u
|
|
109
|
-
},
|
|
109
|
+
}, y.value), {
|
|
110
110
|
default: r(() => [
|
|
111
111
|
o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
|
|
112
112
|
!o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
|
|
@@ -115,13 +115,13 @@ const z = w({
|
|
|
115
115
|
}, 16)) : t("", !0),
|
|
116
116
|
e.$slots.trigger ? l(e.$slots, "default", { key: 2 }) : t("", !0),
|
|
117
117
|
l(e.$slots, "tip"),
|
|
118
|
-
!
|
|
118
|
+
!n.value && e.showFileList ? (f(), m(w, {
|
|
119
119
|
key: 3,
|
|
120
|
-
disabled: o(
|
|
120
|
+
disabled: o(c),
|
|
121
121
|
"list-type": e.listType,
|
|
122
122
|
files: o(a),
|
|
123
123
|
"handle-preview": e.onPreview,
|
|
124
|
-
onRemove: o(
|
|
124
|
+
onRemove: o(d)
|
|
125
125
|
}, g({ _: 2 }, [
|
|
126
126
|
e.$slots.file ? {
|
|
127
127
|
name: "default",
|
|
@@ -135,5 +135,5 @@ const z = w({
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
export {
|
|
138
|
-
|
|
138
|
+
x as default
|
|
139
139
|
};
|