vft 0.0.361 → 0.0.362
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/es/components/md-vue-playground/md-vue-playground.vue2.js +11 -14
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/super-form/use/helper.js +1 -1
- package/es/components/upload/upload.vue.d.ts +13 -13
- package/es/components/upload/upload.vue2.js +46 -152
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue.d.ts +13 -13
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/web-types.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as i, ref as s, shallowRef as
|
|
2
|
-
import { VftIcon as
|
|
1
|
+
import { defineComponent as i, ref as s, shallowRef as p, computed as d, onMounted as m, createVNode as e, h as v } from "vue";
|
|
2
|
+
import { VftIcon as f } from "../icon/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as g } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
+
import { Repl as w, ReplStore as h } from "@vue/repl";
|
|
11
12
|
import { getVuePlaygroundSettings as V } from "./playground.js";
|
|
12
13
|
const y = i({
|
|
13
14
|
name: "vft-md-vue-playground"
|
|
14
|
-
}),
|
|
15
|
+
}), P = /* @__PURE__ */ i({
|
|
15
16
|
...y,
|
|
16
17
|
props: {
|
|
17
18
|
title: {},
|
|
@@ -19,17 +20,13 @@ const y = i({
|
|
|
19
20
|
settings: {}
|
|
20
21
|
},
|
|
21
22
|
setup(t) {
|
|
22
|
-
const u =
|
|
23
|
-
|
|
24
|
-
ReplStore: p,
|
|
25
|
-
Repl: d
|
|
26
|
-
} = await import("@vue/repl");
|
|
27
|
-
n.value = d, a.value = new p({
|
|
23
|
+
const u = g("md-vue-playground"), r = s(!0), n = p(), a = s(), o = d(() => V(t.settings)), l = s(o.value.showCode || !1), c = async () => {
|
|
24
|
+
n.value = w, a.value = new h({
|
|
28
25
|
serializedState: decodeURIComponent(t.files),
|
|
29
26
|
showOutput: !0
|
|
30
27
|
}), o.value.vueVersion && await a.value.setVueVersion(o.value.vueVersion);
|
|
31
28
|
};
|
|
32
|
-
return
|
|
29
|
+
return m(async () => {
|
|
33
30
|
await c(), r.value = !1;
|
|
34
31
|
}), () => e("div", {
|
|
35
32
|
class: u.b()
|
|
@@ -37,7 +34,7 @@ const y = i({
|
|
|
37
34
|
class: "title-wrapper"
|
|
38
35
|
}, [t.title ? e("div", {
|
|
39
36
|
class: "title"
|
|
40
|
-
}, [decodeURIComponent(t.title)]) : null, e(
|
|
37
|
+
}, [decodeURIComponent(t.title)]) : null, e(f, {
|
|
41
38
|
cursor: !0,
|
|
42
39
|
icon: l.value ? "icon-collapse-alt" : "icon-expand-alt",
|
|
43
40
|
size: 20,
|
|
@@ -46,12 +43,12 @@ const y = i({
|
|
|
46
43
|
}
|
|
47
44
|
}, null)]), e("div", {
|
|
48
45
|
class: ["repl-container", l.value ? "show-code" : "hide-code"]
|
|
49
|
-
}, [n.value ?
|
|
46
|
+
}, [n.value ? v(n.value, {
|
|
50
47
|
store: a.value,
|
|
51
48
|
...o.value
|
|
52
49
|
}) : null])]);
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
export {
|
|
56
|
-
|
|
53
|
+
P as default
|
|
57
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as $, computed as v, ref as ee, unref as u, useSlots as te, createVNode as f, mergeProps as w, withDirectives as re, vShow as ne,
|
|
1
|
+
import { defineComponent as $, computed as v, ref as ee, unref as u, useSlots as te, createVNode as f, mergeProps as w, withDirectives as re, vShow as ne, isVNode as oe, createTextVNode as G, resolveComponent as q } from "vue";
|
|
2
2
|
import { VftCol as X } from "../col/index.js";
|
|
3
3
|
import { VftDivider as le } from "../divider/index.js";
|
|
4
4
|
import { VftFormItem as se } from "../form/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNumber as n } from "@vft/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { FormCompEnum as e, isInput as u } from "../component-map.js";
|
|
3
3
|
function T(r, E = "") {
|
|
4
4
|
return E = (E || "").replace(":", "") || "", [
|
|
5
5
|
e.INPUT,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UploadProps } from './types';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
file?(_: {
|
|
4
|
-
file: import("
|
|
4
|
+
file: import("./types").UploadFile;
|
|
5
5
|
}): any;
|
|
6
6
|
trigger?(_: {}): any;
|
|
7
7
|
default?(_: {}): any;
|
|
@@ -18,22 +18,22 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
18
18
|
type: string;
|
|
19
19
|
autoUpload: boolean;
|
|
20
20
|
listType: string;
|
|
21
|
-
httpRequest: import("
|
|
21
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
22
22
|
fileList: never[];
|
|
23
23
|
replaceOnLimit: boolean;
|
|
24
24
|
maxSize: undefined;
|
|
25
25
|
sizeExceedMessage: string;
|
|
26
26
|
onExceed: () => void;
|
|
27
27
|
}>>, {
|
|
28
|
-
abort: (file: import("
|
|
28
|
+
abort: (file: import("./types").UploadFile) => void;
|
|
29
29
|
submit: () => void;
|
|
30
|
-
clearFiles: (states?: import("
|
|
31
|
-
handleStart: (rawFile: import("
|
|
32
|
-
handleRemove: (file: import("
|
|
30
|
+
clearFiles: (states?: import("./types").UploadStatus[]) => void;
|
|
31
|
+
handleStart: (rawFile: import("./types").UploadRawFile) => void;
|
|
32
|
+
handleRemove: (file: import("./types").UploadFile | import("./types").UploadRawFile, rawFile?: import("./types").UploadRawFile) => void;
|
|
33
33
|
fileList: import("vue").Ref<{
|
|
34
34
|
name: string;
|
|
35
35
|
percentage?: number | undefined;
|
|
36
|
-
status: import("
|
|
36
|
+
status: import("./types").UploadStatus;
|
|
37
37
|
size?: number | undefined;
|
|
38
38
|
response?: unknown;
|
|
39
39
|
uid: number;
|
|
@@ -54,7 +54,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
54
54
|
}[], {
|
|
55
55
|
name: string;
|
|
56
56
|
percentage?: number | undefined;
|
|
57
|
-
status: import("
|
|
57
|
+
status: import("./types").UploadStatus;
|
|
58
58
|
size?: number | undefined;
|
|
59
59
|
response?: unknown;
|
|
60
60
|
uid: number;
|
|
@@ -84,7 +84,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
84
84
|
type: string;
|
|
85
85
|
autoUpload: boolean;
|
|
86
86
|
listType: string;
|
|
87
|
-
httpRequest: import("
|
|
87
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
88
88
|
fileList: never[];
|
|
89
89
|
replaceOnLimit: boolean;
|
|
90
90
|
maxSize: undefined;
|
|
@@ -97,16 +97,16 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
97
97
|
method: string;
|
|
98
98
|
multiple: boolean;
|
|
99
99
|
action: string;
|
|
100
|
-
fileList: import("
|
|
100
|
+
fileList: import("./types").UploadUserFile[];
|
|
101
101
|
showFileList: boolean;
|
|
102
102
|
accept: string;
|
|
103
103
|
autoUpload: boolean;
|
|
104
|
-
listType: import("
|
|
105
|
-
httpRequest: import("
|
|
104
|
+
listType: import("./types").ListType;
|
|
105
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
106
106
|
replaceOnLimit: boolean;
|
|
107
107
|
maxSize: number;
|
|
108
108
|
sizeExceedMessage: string;
|
|
109
|
-
onExceed: import("
|
|
109
|
+
onExceed: import("./types").UploadHooks["onExceed"];
|
|
110
110
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
111
111
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
112
112
|
export default _default;
|
|
@@ -1,112 +1,6 @@
|
|
|
1
|
-
import { defineComponent as E, useSlots as T, shallowRef as V, computed as b, onBeforeUnmount as j, provide as N, toRef as O, createElementBlock as q, openBlock as
|
|
2
|
-
import "../alert/index.js";
|
|
3
|
-
import "../avatar/index.js";
|
|
4
|
-
import "../avatar-stack/index.js";
|
|
5
|
-
import "../backtop/index.js";
|
|
6
|
-
import "../button/index.js";
|
|
7
|
-
import "../card/index.js";
|
|
8
|
-
import "../cascader/index.js";
|
|
9
|
-
import "../cascader-panel/index.js";
|
|
10
|
-
import "../check-tag/index.js";
|
|
11
|
-
import "../checkbox/index.js";
|
|
12
|
-
import "../clamp/index.js";
|
|
13
|
-
import "../clamp-toggle/index.js";
|
|
14
|
-
import "../clamp-tooltip/index.js";
|
|
15
|
-
import "../col/index.js";
|
|
16
|
-
import "../collapse-transition/index.js";
|
|
17
|
-
import "../color-picker/index.js";
|
|
18
|
-
import "../config-provider/index.js";
|
|
19
|
-
import "../container/index.js";
|
|
20
|
-
import "@vft/utils";
|
|
21
|
-
import "../context-menu/context-menu.vue2.js";
|
|
22
|
-
import "../icon/index.js";
|
|
23
|
-
import "../date-picker/index.js";
|
|
24
|
-
import "../date-time-select/index.js";
|
|
25
|
-
import "../descriptions/index.js";
|
|
26
|
-
import "../dialog/index.js";
|
|
27
|
-
import "../divider/index.js";
|
|
28
|
-
import "../drawer/index.js";
|
|
29
|
-
import "../dropdown/index.js";
|
|
30
|
-
import "../empty/index.js";
|
|
31
|
-
import "../footer-layout/index.js";
|
|
32
|
-
import "../form/index.js";
|
|
33
|
-
import "../full-screen/index.js";
|
|
34
|
-
import "../header-layout/index.js";
|
|
35
|
-
import "../horizontal-menu/index.js";
|
|
36
|
-
import "../icon-text/index.js";
|
|
37
|
-
import "../iframe-layout/index.js";
|
|
38
|
-
import "../image/index.js";
|
|
39
|
-
import "../image-viewer/index.js";
|
|
40
|
-
import "../input/index.js";
|
|
41
|
-
import "../input-number/index.js";
|
|
42
|
-
import "../link/index.js";
|
|
43
|
-
import "../list-cell/index.js";
|
|
44
|
-
import "../logo/index.js";
|
|
45
|
-
import "../menu/index.js";
|
|
46
|
-
import "../multiple-tabs/index.js";
|
|
47
|
-
import "../notification/index.js";
|
|
48
|
-
import "../overlay/index.js";
|
|
49
|
-
import "../page-wrapper/index.js";
|
|
50
|
-
import "../pagination/index.js";
|
|
51
|
-
import "../popconfirm/index.js";
|
|
52
|
-
import "../popover/index.js";
|
|
53
|
-
import "../popper/index.js";
|
|
54
|
-
import "../qrcode/index.js";
|
|
55
|
-
import "../radio/index.js";
|
|
56
|
-
import "../result/index.js";
|
|
57
|
-
import "../router-view-content/index.js";
|
|
58
|
-
import "../row/index.js";
|
|
59
|
-
import "../scrollbar/index.js";
|
|
60
|
-
import "../search/index.js";
|
|
61
|
-
import "../select/index.js";
|
|
62
|
-
import "../side-menu/index.js";
|
|
63
|
-
import "../skeleton/index.js";
|
|
64
|
-
import "../slider/index.js";
|
|
65
|
-
import "../space/index.js";
|
|
66
|
-
import "../steps/index.js";
|
|
67
|
-
import "../switch/index.js";
|
|
68
|
-
import "../table/index.js";
|
|
69
|
-
import "../tabs/index.js";
|
|
70
|
-
import "../tag/index.js";
|
|
71
|
-
import "../time-picker/index.js";
|
|
72
|
-
import "../tooltip/index.js";
|
|
73
|
-
import "../tree/index.js";
|
|
74
|
-
import "../verify-code/index.js";
|
|
75
|
-
import "../virtual-list/components/fixed-size-list.js";
|
|
76
|
-
import "../virtual-list/components/dynamic-size-list.js";
|
|
77
|
-
import "../virtual-list/components/fixed-size-grid.js";
|
|
78
|
-
import "../virtual-list/components/dynamic-size-grid.js";
|
|
79
|
-
import "../virtual-list/props.js";
|
|
80
|
-
import "../autocomplete/index.js";
|
|
81
|
-
import "../breadcrumb/index.js";
|
|
82
|
-
import "../carousel/index.js";
|
|
83
|
-
import "../collapse/index.js";
|
|
84
|
-
import "../countdown/index.js";
|
|
85
|
-
import "../input-tag/index.js";
|
|
86
|
-
import "../modal/index.js";
|
|
87
|
-
import "../progress/index.js";
|
|
88
|
-
import "../segmented/index.js";
|
|
89
|
-
import "../statistic/index.js";
|
|
90
|
-
import "../super-form/index.js";
|
|
91
|
-
import "../timeline/index.js";
|
|
92
|
-
import "../transfer/index.js";
|
|
93
|
-
import "./index.js";
|
|
94
|
-
import "../watermark/index.js";
|
|
95
|
-
import "../md-code-demo/index.js";
|
|
96
|
-
import "../md-code-tabs/index.js";
|
|
97
|
-
import "../md-comment/index.js";
|
|
98
|
-
import "../md-container/index.js";
|
|
99
|
-
import "../md-tabs/index.js";
|
|
100
|
-
import "../md-vue-playground/index.js";
|
|
101
|
-
import "../infinite-scroll/index.js";
|
|
102
|
-
import "@vueuse/core";
|
|
103
|
-
import "../config-provider/hooks/use-global-config.js";
|
|
104
|
-
import "lodash-es";
|
|
105
|
-
import "../../hooks/use-model-toggle/index.js";
|
|
106
|
-
import "@popperjs/core";
|
|
107
|
-
import "../../hooks/use-z-index/index.js";
|
|
1
|
+
import { defineComponent as E, useSlots as T, shallowRef as V, computed as b, onBeforeUnmount as j, provide as N, toRef as O, createElementBlock as q, openBlock as m, normalizeClass as D, unref as o, createBlock as v, createCommentVNode as t, renderSlot as l, createSlots as B, withCtx as n, createVNode as H, mergeProps as S } from "vue";
|
|
108
2
|
import { VftMessage as I } from "../message/index.js";
|
|
109
|
-
import "../
|
|
3
|
+
import "../form/index.js";
|
|
110
4
|
import { ajaxUpload as K } from "./ajax.js";
|
|
111
5
|
import { uploadContextKey as W } from "./constants.js";
|
|
112
6
|
import $ from "./upload-content.vue2.js";
|
|
@@ -115,7 +9,7 @@ import { useHandlers as A } from "./use-handlers.js";
|
|
|
115
9
|
import { useFormDisabled as G } from "../form/hooks/use-form-common-props.js";
|
|
116
10
|
const J = E({
|
|
117
11
|
name: "vft-upload"
|
|
118
|
-
}),
|
|
12
|
+
}), le = /* @__PURE__ */ E({
|
|
119
13
|
...J,
|
|
120
14
|
props: {
|
|
121
15
|
action: { default: "#" },
|
|
@@ -151,74 +45,74 @@ const J = E({
|
|
|
151
45
|
onSizeExceed: {}
|
|
152
46
|
},
|
|
153
47
|
setup(F, { expose: L }) {
|
|
154
|
-
const
|
|
48
|
+
const a = F, s = T(), c = G(), d = V(), {
|
|
155
49
|
abort: y,
|
|
156
50
|
submit: g,
|
|
157
51
|
clearFiles: h,
|
|
158
|
-
uploadFiles:
|
|
52
|
+
uploadFiles: r,
|
|
159
53
|
handleStart: w,
|
|
160
54
|
handleError: P,
|
|
161
|
-
handleRemove:
|
|
55
|
+
handleRemove: f,
|
|
162
56
|
handleSuccess: z,
|
|
163
57
|
handleProgress: M
|
|
164
|
-
} = A(
|
|
58
|
+
} = A(a, d), u = b(() => a.listType === "picture-card"), U = {
|
|
165
59
|
abort: y,
|
|
166
60
|
submit: g,
|
|
167
61
|
clearFiles: h,
|
|
168
|
-
uploadFiles:
|
|
169
|
-
uploadRef:
|
|
62
|
+
uploadFiles: r,
|
|
63
|
+
uploadRef: d
|
|
170
64
|
}, k = b(() => ({
|
|
171
|
-
...
|
|
172
|
-
fileList:
|
|
65
|
+
...a,
|
|
66
|
+
fileList: r.value,
|
|
173
67
|
onStart: w,
|
|
174
68
|
onProgress: M,
|
|
175
69
|
onSuccess: z,
|
|
176
70
|
onError: P,
|
|
177
|
-
onRemove:
|
|
178
|
-
onChange: (e,
|
|
179
|
-
|
|
71
|
+
onRemove: f,
|
|
72
|
+
onChange: (e, i) => {
|
|
73
|
+
a.onChange?.(e, i, U);
|
|
180
74
|
},
|
|
181
|
-
onSizeExceed: (e,
|
|
182
|
-
if (
|
|
183
|
-
|
|
75
|
+
onSizeExceed: (e, i) => {
|
|
76
|
+
if (a.onSizeExceed)
|
|
77
|
+
a.onSizeExceed?.(e, i);
|
|
184
78
|
else {
|
|
185
|
-
const R = `文件大小不能超过 ${(
|
|
79
|
+
const R = `文件大小不能超过 ${(i / 1048576).toFixed(2)}MB`;
|
|
186
80
|
console.warn("默认文件大小超出提示:", R), I.warning(R);
|
|
187
81
|
}
|
|
188
82
|
}
|
|
189
83
|
}));
|
|
190
84
|
return j(() => {
|
|
191
|
-
|
|
85
|
+
r.value.forEach(({ url: e }) => {
|
|
192
86
|
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
193
87
|
});
|
|
194
88
|
}), N(W, {
|
|
195
|
-
accept: O(
|
|
89
|
+
accept: O(a, "accept")
|
|
196
90
|
}), L({
|
|
197
91
|
abort: y,
|
|
198
92
|
submit: g,
|
|
199
93
|
clearFiles: h,
|
|
200
94
|
handleStart: w,
|
|
201
|
-
handleRemove:
|
|
202
|
-
fileList:
|
|
203
|
-
}), (e,
|
|
95
|
+
handleRemove: f,
|
|
96
|
+
fileList: r
|
|
97
|
+
}), (e, i) => (m(), q("div", {
|
|
204
98
|
class: D(["vft-upload-wrapper", { disabled: o(c) }])
|
|
205
99
|
}, [
|
|
206
|
-
|
|
100
|
+
u.value && e.showFileList ? (m(), v(C, {
|
|
207
101
|
key: 0,
|
|
208
102
|
disabled: o(c),
|
|
209
103
|
"list-type": e.listType,
|
|
210
|
-
files: o(
|
|
104
|
+
files: o(r),
|
|
211
105
|
"handle-preview": e.onPreview,
|
|
212
|
-
onRemove: o(
|
|
106
|
+
onRemove: o(f)
|
|
213
107
|
}, B({
|
|
214
|
-
append:
|
|
108
|
+
append: n(() => [
|
|
215
109
|
H($, S({
|
|
216
110
|
ref_key: "uploadRef",
|
|
217
|
-
ref:
|
|
111
|
+
ref: d
|
|
218
112
|
}, k.value), {
|
|
219
|
-
default:
|
|
220
|
-
o(
|
|
221
|
-
!o(
|
|
113
|
+
default: n(() => [
|
|
114
|
+
o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
|
|
115
|
+
!o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
|
|
222
116
|
]),
|
|
223
117
|
_: 3
|
|
224
118
|
}, 16)
|
|
@@ -227,37 +121,37 @@ const J = E({
|
|
|
227
121
|
}, [
|
|
228
122
|
e.$slots.file ? {
|
|
229
123
|
name: "default",
|
|
230
|
-
fn:
|
|
231
|
-
|
|
124
|
+
fn: n(({ file: p }) => [
|
|
125
|
+
l(e.$slots, "file", { file: p })
|
|
232
126
|
]),
|
|
233
127
|
key: "0"
|
|
234
128
|
} : void 0
|
|
235
129
|
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : t("", !0),
|
|
236
|
-
!
|
|
130
|
+
!u.value || u.value && !e.showFileList ? (m(), v($, S({
|
|
237
131
|
key: 1,
|
|
238
132
|
ref_key: "uploadRef",
|
|
239
|
-
ref:
|
|
133
|
+
ref: d
|
|
240
134
|
}, k.value), {
|
|
241
|
-
default:
|
|
242
|
-
o(
|
|
243
|
-
!o(
|
|
135
|
+
default: n(() => [
|
|
136
|
+
o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
|
|
137
|
+
!o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
|
|
244
138
|
]),
|
|
245
139
|
_: 3
|
|
246
140
|
}, 16)) : t("", !0),
|
|
247
|
-
e.$slots.trigger ?
|
|
248
|
-
|
|
249
|
-
!
|
|
141
|
+
e.$slots.trigger ? l(e.$slots, "default", { key: 2 }) : t("", !0),
|
|
142
|
+
l(e.$slots, "tip"),
|
|
143
|
+
!u.value && e.showFileList ? (m(), v(C, {
|
|
250
144
|
key: 3,
|
|
251
145
|
disabled: o(c),
|
|
252
146
|
"list-type": e.listType,
|
|
253
|
-
files: o(
|
|
147
|
+
files: o(r),
|
|
254
148
|
"handle-preview": e.onPreview,
|
|
255
|
-
onRemove: o(
|
|
149
|
+
onRemove: o(f)
|
|
256
150
|
}, B({ _: 2 }, [
|
|
257
151
|
e.$slots.file ? {
|
|
258
152
|
name: "default",
|
|
259
|
-
fn:
|
|
260
|
-
|
|
153
|
+
fn: n(({ file: p }) => [
|
|
154
|
+
l(e.$slots, "file", { file: p })
|
|
261
155
|
]),
|
|
262
156
|
key: "0"
|
|
263
157
|
} : void 0
|
|
@@ -266,5 +160,5 @@ const J = E({
|
|
|
266
160
|
}
|
|
267
161
|
});
|
|
268
162
|
export {
|
|
269
|
-
|
|
163
|
+
le as default
|
|
270
164
|
};
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../icon/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const d=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const l=require("@vue/repl"),v=require("./playground.cjs"),p=e.defineComponent({name:"vft-md-vue-playground"}),f=e.defineComponent({...p,props:{title:{},files:{},settings:{}},setup(t){const s=d.useNamespace("md-vue-playground"),a=e.ref(!0),u=e.shallowRef(),r=e.ref(),o=e.computed(()=>v.getVuePlaygroundSettings(t.settings)),n=e.ref(o.value.showCode||!1),i=async()=>{u.value=l.Repl,r.value=new l.ReplStore({serializedState:decodeURIComponent(t.files),showOutput:!0}),o.value.vueVersion&&await r.value.setVueVersion(o.value.vueVersion)};return e.onMounted(async()=>{await i(),a.value=!1}),()=>e.createVNode("div",{class:s.b()},[e.createVNode("div",{class:"title-wrapper"},[t.title?e.createVNode("div",{class:"title"},[decodeURIComponent(t.title)]):null,e.createVNode(c.VftIcon,{cursor:!0,icon:n.value?"icon-collapse-alt":"icon-expand-alt",size:20,onClick:()=>{n.value=!n.value}},null)]),e.createVNode("div",{class:["repl-container",n.value?"show-code":"hide-code"]},[u.value?e.h(u.value,{store:r.value,...o.value}):null])])}});exports.default=f;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UploadProps } from './types';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
file?(_: {
|
|
4
|
-
file: import("
|
|
4
|
+
file: import("./types").UploadFile;
|
|
5
5
|
}): any;
|
|
6
6
|
trigger?(_: {}): any;
|
|
7
7
|
default?(_: {}): any;
|
|
@@ -18,22 +18,22 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
18
18
|
type: string;
|
|
19
19
|
autoUpload: boolean;
|
|
20
20
|
listType: string;
|
|
21
|
-
httpRequest: import("
|
|
21
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
22
22
|
fileList: never[];
|
|
23
23
|
replaceOnLimit: boolean;
|
|
24
24
|
maxSize: undefined;
|
|
25
25
|
sizeExceedMessage: string;
|
|
26
26
|
onExceed: () => void;
|
|
27
27
|
}>>, {
|
|
28
|
-
abort: (file: import("
|
|
28
|
+
abort: (file: import("./types").UploadFile) => void;
|
|
29
29
|
submit: () => void;
|
|
30
|
-
clearFiles: (states?: import("
|
|
31
|
-
handleStart: (rawFile: import("
|
|
32
|
-
handleRemove: (file: import("
|
|
30
|
+
clearFiles: (states?: import("./types").UploadStatus[]) => void;
|
|
31
|
+
handleStart: (rawFile: import("./types").UploadRawFile) => void;
|
|
32
|
+
handleRemove: (file: import("./types").UploadFile | import("./types").UploadRawFile, rawFile?: import("./types").UploadRawFile) => void;
|
|
33
33
|
fileList: import("vue").Ref<{
|
|
34
34
|
name: string;
|
|
35
35
|
percentage?: number | undefined;
|
|
36
|
-
status: import("
|
|
36
|
+
status: import("./types").UploadStatus;
|
|
37
37
|
size?: number | undefined;
|
|
38
38
|
response?: unknown;
|
|
39
39
|
uid: number;
|
|
@@ -54,7 +54,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
54
54
|
}[], {
|
|
55
55
|
name: string;
|
|
56
56
|
percentage?: number | undefined;
|
|
57
|
-
status: import("
|
|
57
|
+
status: import("./types").UploadStatus;
|
|
58
58
|
size?: number | undefined;
|
|
59
59
|
response?: unknown;
|
|
60
60
|
uid: number;
|
|
@@ -84,7 +84,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
84
84
|
type: string;
|
|
85
85
|
autoUpload: boolean;
|
|
86
86
|
listType: string;
|
|
87
|
-
httpRequest: import("
|
|
87
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
88
88
|
fileList: never[];
|
|
89
89
|
replaceOnLimit: boolean;
|
|
90
90
|
maxSize: undefined;
|
|
@@ -97,16 +97,16 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
97
97
|
method: string;
|
|
98
98
|
multiple: boolean;
|
|
99
99
|
action: string;
|
|
100
|
-
fileList: import("
|
|
100
|
+
fileList: import("./types").UploadUserFile[];
|
|
101
101
|
showFileList: boolean;
|
|
102
102
|
accept: string;
|
|
103
103
|
autoUpload: boolean;
|
|
104
|
-
listType: import("
|
|
105
|
-
httpRequest: import("
|
|
104
|
+
listType: import("./types").ListType;
|
|
105
|
+
httpRequest: import("./types").UploadRequestHandler;
|
|
106
106
|
replaceOnLimit: boolean;
|
|
107
107
|
maxSize: number;
|
|
108
108
|
sizeExceedMessage: string;
|
|
109
|
-
onExceed: import("
|
|
109
|
+
onExceed: import("./types").UploadHooks["onExceed"];
|
|
110
110
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
111
111
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
112
112
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("../message/index.cjs");require("../form/index.cjs");const P=require("./ajax.cjs"),_=require("./constants.cjs"),g=require("./upload-content.vue2.cjs"),h=require("./upload-list.vue2.cjs"),$=require("./use-handlers.cjs"),E=require("../form/hooks/use-form-common-props.cjs"),F=e.defineComponent({name:"vft-upload"}),L=e.defineComponent({...F,props:{action:{default:"#"},headers:{},method:{default:"post"},data:{},multiple:{type:Boolean,default:!1},name:{default:"file"},drag:{type:Boolean,default:!1},withCredentials:{type:Boolean},showFileList:{type:Boolean,default:!0},accept:{default:""},type:{default:"select"},fileList:{default:[]},autoUpload:{type:Boolean,default:!1},listType:{default:"text"},httpRequest:{type:Function,default:P.ajaxUpload},disabled:{type:Boolean},limit:{},replaceOnLimit:{type:Boolean,default:!1},maxSize:{default:void 0},sizeExceedMessage:{default:"文件大小超出限制"},beforeUpload:{},beforeRemove:{},onRemove:{},onChange:{},onPreview:{},onSuccess:{},onProgress:{},onError:{},onExceed:{type:Function,default:()=>{}},onSizeExceed:{}},setup(C,{expose:S}){const o=C,l=e.useSlots(),i=E.useFormDisabled(),s=e.shallowRef(),{abort:f,submit:p,clearFiles:c,uploadFiles:r,handleStart:m,handleError:k,handleRemove:n,handleSuccess:w,handleProgress:B}=$.useHandlers(o,s),u=e.computed(()=>o.listType==="picture-card"),b={abort:f,submit:p,clearFiles:c,uploadFiles:r,uploadRef:s},v=e.computed(()=>({...o,fileList:r.value,onStart:m,onProgress:B,onSuccess:w,onError:k,onRemove:n,onChange:(t,a)=>{o.onChange?.(t,a,b)},onSizeExceed:(t,a)=>{if(o.onSizeExceed)o.onSizeExceed?.(t,a);else{const y=`文件大小不能超过 ${(a/1048576).toFixed(2)}MB`;console.warn("默认文件大小超出提示:",y),R.VftMessage.warning(y)}}}));return e.onBeforeUnmount(()=>{r.value.forEach(({url:t})=>{t?.startsWith("blob:")&&URL.revokeObjectURL(t)})}),e.provide(_.uploadContextKey,{accept:e.toRef(o,"accept")}),S({abort:f,submit:p,clearFiles:c,handleStart:m,handleRemove:n,fileList:r}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vft-upload-wrapper",{disabled:e.unref(i)}])},[u.value&&t.showFileList?(e.openBlock(),e.createBlock(h.default,{key:0,disabled:e.unref(i),"list-type":t.listType,files:e.unref(r),"handle-preview":t.onPreview,onRemove:e.unref(n)},e.createSlots({append:e.withCtx(()=>[e.createVNode(g.default,e.mergeProps({ref_key:"uploadRef",ref:s},v.value),{default:e.withCtx(()=>[e.unref(l).trigger?e.renderSlot(t.$slots,"trigger",{key:0}):e.createCommentVNode("",!0),!e.unref(l).trigger&&e.unref(l).default?e.renderSlot(t.$slots,"default",{key:1}):e.createCommentVNode("",!0)]),_:3},16)]),_:2},[t.$slots.file?{name:"default",fn:e.withCtx(({file:d})=>[e.renderSlot(t.$slots,"file",{file:d})]),key:"0"}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):e.createCommentVNode("",!0),!u.value||u.value&&!t.showFileList?(e.openBlock(),e.createBlock(g.default,e.mergeProps({key:1,ref_key:"uploadRef",ref:s},v.value),{default:e.withCtx(()=>[e.unref(l).trigger?e.renderSlot(t.$slots,"trigger",{key:0}):e.createCommentVNode("",!0),!e.unref(l).trigger&&e.unref(l).default?e.renderSlot(t.$slots,"default",{key:1}):e.createCommentVNode("",!0)]),_:3},16)):e.createCommentVNode("",!0),t.$slots.trigger?e.renderSlot(t.$slots,"default",{key:2}):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"tip"),!u.value&&t.showFileList?(e.openBlock(),e.createBlock(h.default,{key:3,disabled:e.unref(i),"list-type":t.listType,files:e.unref(r),"handle-preview":t.onPreview,onRemove:e.unref(n)},e.createSlots({_:2},[t.$slots.file?{name:"default",fn:e.withCtx(({file:d})=>[e.renderSlot(t.$slots,"file",{file:d})]),key:"0"}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):e.createCommentVNode("",!0)],2))}});exports.default=L;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.362";exports.version=e;
|
package/lib/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.362",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"resize-detector": "0.3.0",
|
|
56
56
|
"sortablejs": "1.15.0",
|
|
57
57
|
"photoswipe": "5.4.4",
|
|
58
|
-
"@vft/utils": "0.0.128",
|
|
59
58
|
"@vft/constants": "0.0.72",
|
|
60
|
-
"@vft/router": "0.0.65",
|
|
61
59
|
"@vft/store": "0.0.54",
|
|
62
|
-
"@vft/
|
|
63
|
-
"@vft/directives": "0.0.33"
|
|
60
|
+
"@vft/router": "0.0.65",
|
|
61
|
+
"@vft/directives": "0.0.33",
|
|
62
|
+
"@vft/use": "0.0.77",
|
|
63
|
+
"@vft/utils": "0.0.131"
|
|
64
64
|
},
|
|
65
65
|
"vetur": {
|
|
66
66
|
"tags": "tags.json",
|
package/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.
|
|
1
|
+
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.362","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
|