vft 0.0.507 → 0.0.509
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/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader/cascader.vue2.js +203 -202
- package/es/components/cascader-panel/menu.vue2.js +50 -49
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
- package/es/components/color-picker/color-picker.vue2.js +134 -133
- package/es/components/config-provider/config-provider.vue.d.ts +2 -0
- package/es/components/config-provider/config-provider.vue2.js +5 -4
- package/es/components/config-provider/constants.d.ts +1 -0
- package/es/components/config-provider/constants.js +3 -2
- package/es/components/config-provider/hooks/use-global-config.js +33 -30
- package/es/components/config-provider/index.d.ts +9 -0
- package/es/components/config-provider/index.js +6 -5
- package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
- package/es/components/date-picker/composables/use-month-range-header.js +15 -14
- package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
- package/es/components/date-time-select/date-time-select.vue2.js +39 -36
- package/es/components/dropdown/dropdown.vue2.js +68 -67
- package/es/components/empty/empty.vue2.js +39 -38
- package/es/components/full-screen/full-screen.vue2.js +18 -17
- package/es/components/image/image.vue2.js +60 -59
- package/es/components/image-viewer/image-viewer.vue2.js +45 -44
- package/es/components/index.js +161 -160
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/md-container/md-container.vue2.js +75 -74
- package/es/components/md-container/toc.js +37 -36
- package/es/components/modal/modal-footer-action.vue2.js +25 -24
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
- package/es/components/pagination/components/jumper.vue2.js +29 -28
- package/es/components/pagination/components/sizes.vue2.js +21 -20
- package/es/components/pagination/components/total.vue2.js +11 -10
- package/es/components/popconfirm/popconfirm.vue2.js +40 -39
- package/es/components/search/search.vue2.js +79 -77
- package/es/components/select/useSelect.js +232 -231
- package/es/components/super-form/super-form-action.vue2.js +41 -40
- package/es/components/super-form/super-form-item.vue2.js +206 -203
- package/es/components/super-form/use/helper.d.ts +1 -1
- package/es/components/super-form/use/helper.js +62 -62
- package/es/components/table/field.js +130 -110
- package/es/components/table/table.vue2.js +152 -150
- package/es/components/table/use/use-columns.js +29 -26
- package/es/components/table/use/use-data-source.js +87 -86
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
- package/es/components/transfer/transfer-panel.vue2.js +57 -56
- package/es/components/transfer/transfer.vue2.js +70 -69
- package/es/components/tree/tree.vue2.js +60 -59
- package/es/components/upload/index.d.ts +3 -3
- package/es/components/upload/upload-content.vue.d.ts +2 -2
- package/es/components/upload/upload-content.vue2.js +78 -75
- package/es/components/upload/upload-list.vue2.js +46 -45
- package/es/components/upload/upload.vue.d.ts +2 -2
- package/es/components/upload/upload.vue2.js +87 -85
- package/es/components/upload/utils.js +29 -29
- package/es/constants/date.d.ts +1 -1
- package/es/constants/date.js +9 -1
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +1 -0
- package/es/index.js +5 -1
- package/es/locale/index.d.js +1 -0
- package/es/locale/index.d.ts +26 -0
- package/es/locale/index.js +10 -0
- package/es/locale/lang/en.d.ts +183 -0
- package/es/locale/lang/en.js +241 -0
- package/es/locale/lang/zh-cn.d.ts +183 -0
- package/es/locale/lang/zh-cn.js +241 -0
- package/es/locale/lang/zh-tw.d.ts +183 -0
- package/es/locale/lang/zh-tw.js +241 -0
- package/es/locale/use-locale.d.ts +17 -0
- package/es/locale/use-locale.js +56 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +1 -0
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +9 -0
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- 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/super-form/use/helper.d.ts +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/use/use-columns.cjs +1 -1
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/index.d.ts +3 -3
- package/lib/components/upload/upload-content.vue.d.ts +2 -2
- 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 +2 -2
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/upload/utils.cjs +1 -1
- package/lib/constants/date.cjs +1 -1
- package/lib/constants/date.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/locale/index.cjs +1 -0
- package/lib/locale/index.d.cjs +1 -0
- package/lib/locale/index.d.ts +26 -0
- package/lib/locale/lang/en.cjs +1 -0
- package/lib/locale/lang/en.d.ts +183 -0
- package/lib/locale/lang/zh-cn.cjs +1 -0
- package/lib/locale/lang/zh-cn.d.ts +183 -0
- package/lib/locale/lang/zh-tw.cjs +1 -0
- package/lib/locale/lang/zh-tw.d.ts +183 -0
- package/lib/locale/use-locale.cjs +1 -0
- package/lib/locale/use-locale.d.ts +17 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/theme-style/index.css +1 -1
- package/theme-style/src/super-form.scss +0 -1
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as I, useSlots as
|
|
1
|
+
import { defineComponent as I, useSlots as j, computed as h, shallowRef as O, onBeforeUnmount as q, provide as D, toRef as H, createElementBlock as K, openBlock as g, normalizeClass as W, unref as o, createBlock as w, createCommentVNode as n, renderSlot as d, createSlots as B, withCtx as u, createVNode as A, mergeProps as M } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
|
-
import { VftMessage as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import L from "./upload-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
3
|
+
import { VftMessage as S } from "../message/index.js";
|
|
4
|
+
import { useLocale as G } from "../../locale/use-locale.js";
|
|
5
|
+
import { ajaxUpload as J } from "./ajax.js";
|
|
6
|
+
import { uploadContextKey as Q } from "./constants.js";
|
|
7
|
+
import L from "./upload-content.vue2.js";
|
|
8
|
+
import F from "./upload-list.vue2.js";
|
|
9
|
+
import { useHandlers as X } from "./use-handlers.js";
|
|
10
|
+
import { useFormDisabled as Y } from "../form/hooks/use-form-common-props.js";
|
|
11
|
+
const Z = I({
|
|
11
12
|
name: "vft-upload"
|
|
12
|
-
}),
|
|
13
|
-
...
|
|
13
|
+
}), re = /* @__PURE__ */ I({
|
|
14
|
+
...Z,
|
|
14
15
|
props: {
|
|
15
16
|
action: { default: "#" },
|
|
16
17
|
headers: {},
|
|
@@ -26,12 +27,12 @@ const Q = I({
|
|
|
26
27
|
fileList: { default: [] },
|
|
27
28
|
autoUpload: { type: Boolean, default: !1 },
|
|
28
29
|
listType: { default: "text" },
|
|
29
|
-
httpRequest: { type: Function, default:
|
|
30
|
+
httpRequest: { type: Function, default: J },
|
|
30
31
|
disabled: { type: Boolean },
|
|
31
32
|
limit: {},
|
|
32
33
|
replaceOnLimit: { type: Boolean, default: !1 },
|
|
33
34
|
maxSize: { default: void 0 },
|
|
34
|
-
sizeExceedMessage: { default:
|
|
35
|
+
sizeExceedMessage: { default: void 0 },
|
|
35
36
|
sizeWidth: { default: void 0 },
|
|
36
37
|
sizeHeight: { default: void 0 },
|
|
37
38
|
onSizeInvalid: {},
|
|
@@ -48,91 +49,92 @@ const Q = I({
|
|
|
48
49
|
} },
|
|
49
50
|
onSizeExceed: {}
|
|
50
51
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const t =
|
|
53
|
-
abort:
|
|
54
|
-
submit:
|
|
55
|
-
clearFiles:
|
|
52
|
+
setup(i, { expose: P }) {
|
|
53
|
+
const { t: p } = G(), t = i, r = j(), y = Y(), T = h(() => t.sizeExceedMessage || p("vft.upload.sizeExceed")), c = O(), {
|
|
54
|
+
abort: z,
|
|
55
|
+
submit: k,
|
|
56
|
+
clearFiles: R,
|
|
56
57
|
uploadFiles: f,
|
|
57
|
-
handleStart:
|
|
58
|
-
handleError:
|
|
58
|
+
handleStart: b,
|
|
59
|
+
handleError: x,
|
|
59
60
|
handleRemove: m,
|
|
60
|
-
handleSuccess:
|
|
61
|
-
handleProgress:
|
|
62
|
-
} =
|
|
63
|
-
abort:
|
|
64
|
-
submit:
|
|
65
|
-
clearFiles:
|
|
61
|
+
handleSuccess: U,
|
|
62
|
+
handleProgress: N
|
|
63
|
+
} = X(t, c), v = h(() => t.listType === "picture-card"), V = {
|
|
64
|
+
abort: z,
|
|
65
|
+
submit: k,
|
|
66
|
+
clearFiles: R,
|
|
66
67
|
uploadFiles: f,
|
|
67
|
-
uploadRef:
|
|
68
|
-
},
|
|
68
|
+
uploadRef: c
|
|
69
|
+
}, E = h(() => ({
|
|
69
70
|
...t,
|
|
71
|
+
sizeExceedMessage: T.value,
|
|
70
72
|
fileList: f.value,
|
|
71
|
-
onStart:
|
|
72
|
-
onProgress:
|
|
73
|
-
onSuccess:
|
|
74
|
-
onError:
|
|
73
|
+
onStart: b,
|
|
74
|
+
onProgress: N,
|
|
75
|
+
onSuccess: U,
|
|
76
|
+
onError: x,
|
|
75
77
|
onRemove: m,
|
|
76
|
-
onChange: (e,
|
|
77
|
-
t.onChange?.(e,
|
|
78
|
+
onChange: (e, a) => {
|
|
79
|
+
t.onChange?.(e, a, V);
|
|
78
80
|
},
|
|
79
|
-
onSizeExceed: (e,
|
|
81
|
+
onSizeExceed: (e, a) => {
|
|
80
82
|
if (t.onSizeExceed)
|
|
81
|
-
t.onSizeExceed?.(e,
|
|
83
|
+
t.onSizeExceed?.(e, a);
|
|
82
84
|
else {
|
|
83
|
-
const
|
|
84
|
-
console.warn(
|
|
85
|
+
const l = (a / 1048576).toFixed(2), s = p("vft.upload.defaultSizeMessage", { maxSizeMB: l });
|
|
86
|
+
console.warn(s), S.warning(s);
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
|
-
onSizeInvalid: (e,
|
|
89
|
+
onSizeInvalid: (e, a, l, s, C) => {
|
|
88
90
|
if (t.onSizeInvalid)
|
|
89
|
-
t.onSizeInvalid(e,
|
|
91
|
+
t.onSizeInvalid(e, a, l, s, C);
|
|
90
92
|
else {
|
|
91
|
-
const
|
|
92
|
-
console.warn(
|
|
93
|
+
const $ = p("vft.upload.defaultSizeCheckMessage", { width: a, height: l, expectedWidth: s, expectedHeight: C });
|
|
94
|
+
console.warn($), S.warning($);
|
|
93
95
|
}
|
|
94
96
|
},
|
|
95
|
-
onTypeInvalid: (e,
|
|
97
|
+
onTypeInvalid: (e, a) => {
|
|
96
98
|
if (t.onTypeInvalid)
|
|
97
|
-
t.onTypeInvalid(e,
|
|
99
|
+
t.onTypeInvalid(e, a);
|
|
98
100
|
else {
|
|
99
|
-
const
|
|
100
|
-
console.warn(
|
|
101
|
+
const l = p("vft.upload.defaultTypeCheckMessage", { fileName: e.name, acceptedTypes: a });
|
|
102
|
+
console.warn(l), S.warning(l);
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
}));
|
|
104
|
-
return
|
|
106
|
+
return q(() => {
|
|
105
107
|
f.value.forEach(({ url: e }) => {
|
|
106
108
|
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
107
109
|
});
|
|
108
|
-
}),
|
|
109
|
-
accept:
|
|
110
|
+
}), D(Q, {
|
|
111
|
+
accept: H(t, "accept")
|
|
110
112
|
}), P({
|
|
111
|
-
abort:
|
|
112
|
-
submit:
|
|
113
|
-
clearFiles:
|
|
114
|
-
handleStart:
|
|
113
|
+
abort: z,
|
|
114
|
+
submit: k,
|
|
115
|
+
clearFiles: R,
|
|
116
|
+
handleStart: b,
|
|
115
117
|
handleRemove: m,
|
|
116
118
|
fileList: f
|
|
117
|
-
}), (e,
|
|
118
|
-
class:
|
|
119
|
+
}), (e, a) => (g(), K("div", {
|
|
120
|
+
class: W(["vft-upload-wrapper", [{ disabled: o(y) }]])
|
|
119
121
|
}, [
|
|
120
|
-
|
|
122
|
+
v.value && i.showFileList ? (g(), w(F, {
|
|
121
123
|
key: 0,
|
|
122
124
|
disabled: o(y),
|
|
123
|
-
"list-type":
|
|
125
|
+
"list-type": i.listType,
|
|
124
126
|
files: o(f),
|
|
125
|
-
"handle-preview":
|
|
127
|
+
"handle-preview": i.onPreview,
|
|
126
128
|
onRemove: o(m)
|
|
127
|
-
},
|
|
129
|
+
}, B({
|
|
128
130
|
append: u(() => [
|
|
129
|
-
|
|
131
|
+
A(L, M({
|
|
130
132
|
ref_key: "uploadRef",
|
|
131
|
-
ref:
|
|
132
|
-
},
|
|
133
|
+
ref: c
|
|
134
|
+
}, E.value), {
|
|
133
135
|
default: u(() => [
|
|
134
|
-
o(
|
|
135
|
-
!o(
|
|
136
|
+
o(r).trigger ? d(e.$slots, "trigger", { key: 0 }) : n("", !0),
|
|
137
|
+
!o(r).trigger && o(r).default ? d(e.$slots, "default", { key: 1 }) : n("", !0)
|
|
136
138
|
]),
|
|
137
139
|
_: 3
|
|
138
140
|
}, 16)
|
|
@@ -141,50 +143,50 @@ const Q = I({
|
|
|
141
143
|
}, [
|
|
142
144
|
e.$slots.file ? {
|
|
143
145
|
name: "default",
|
|
144
|
-
fn: u(({ file:
|
|
145
|
-
|
|
146
|
-
file:
|
|
146
|
+
fn: u(({ file: l, index: s }) => [
|
|
147
|
+
d(e.$slots, "file", {
|
|
148
|
+
file: l,
|
|
147
149
|
index: s
|
|
148
150
|
})
|
|
149
151
|
]),
|
|
150
152
|
key: "0"
|
|
151
153
|
} : void 0
|
|
152
|
-
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) :
|
|
153
|
-
!
|
|
154
|
+
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : n("", !0),
|
|
155
|
+
!v.value || v.value && !i.showFileList ? (g(), w(L, M({
|
|
154
156
|
key: 1,
|
|
155
157
|
ref_key: "uploadRef",
|
|
156
|
-
ref:
|
|
157
|
-
},
|
|
158
|
+
ref: c
|
|
159
|
+
}, E.value), {
|
|
158
160
|
default: u(() => [
|
|
159
|
-
o(
|
|
160
|
-
!o(
|
|
161
|
+
o(r).trigger ? d(e.$slots, "trigger", { key: 0 }) : n("", !0),
|
|
162
|
+
!o(r).trigger && o(r).default ? d(e.$slots, "default", { key: 1 }) : n("", !0)
|
|
161
163
|
]),
|
|
162
164
|
_: 3
|
|
163
|
-
}, 16)) :
|
|
164
|
-
e.$slots.trigger ?
|
|
165
|
-
|
|
166
|
-
!
|
|
165
|
+
}, 16)) : n("", !0),
|
|
166
|
+
e.$slots.trigger ? d(e.$slots, "default", { key: 2 }) : n("", !0),
|
|
167
|
+
d(e.$slots, "tip"),
|
|
168
|
+
!v.value && i.showFileList ? (g(), w(F, {
|
|
167
169
|
key: 3,
|
|
168
170
|
disabled: o(y),
|
|
169
|
-
"list-type":
|
|
171
|
+
"list-type": i.listType,
|
|
170
172
|
files: o(f),
|
|
171
|
-
"handle-preview":
|
|
173
|
+
"handle-preview": i.onPreview,
|
|
172
174
|
onRemove: o(m)
|
|
173
|
-
},
|
|
175
|
+
}, B({ _: 2 }, [
|
|
174
176
|
e.$slots.file ? {
|
|
175
177
|
name: "default",
|
|
176
|
-
fn: u(({ file:
|
|
177
|
-
|
|
178
|
-
file:
|
|
178
|
+
fn: u(({ file: l, index: s }) => [
|
|
179
|
+
d(e.$slots, "file", {
|
|
180
|
+
file: l,
|
|
179
181
|
index: s
|
|
180
182
|
})
|
|
181
183
|
]),
|
|
182
184
|
key: "0"
|
|
183
185
|
} : void 0
|
|
184
|
-
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) :
|
|
186
|
+
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : n("", !0)
|
|
185
187
|
], 2));
|
|
186
188
|
}
|
|
187
189
|
});
|
|
188
190
|
export {
|
|
189
|
-
|
|
191
|
+
re as default
|
|
190
192
|
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
function
|
|
2
|
-
return new Promise((
|
|
3
|
-
const e =
|
|
4
|
-
if (!e && !
|
|
5
|
-
|
|
1
|
+
function n(i) {
|
|
2
|
+
return new Promise((o, a) => {
|
|
3
|
+
const e = i.type.startsWith("image/"), r = i.type.startsWith("video/");
|
|
4
|
+
if (!e && !r) {
|
|
5
|
+
a(new Error("vft.upload.typeNotSupported"));
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
if (e) {
|
|
9
9
|
const t = new Image();
|
|
10
10
|
t.onload = () => {
|
|
11
|
-
|
|
11
|
+
o({ width: t.naturalWidth, height: t.naturalHeight });
|
|
12
12
|
}, t.onerror = () => {
|
|
13
|
-
|
|
14
|
-
}, t.src = URL.createObjectURL(
|
|
15
|
-
} else if (
|
|
13
|
+
a(new Error("vft.upload.imageLoadFailed"));
|
|
14
|
+
}, t.src = URL.createObjectURL(i);
|
|
15
|
+
} else if (r) {
|
|
16
16
|
const t = document.createElement("video");
|
|
17
17
|
t.onloadedmetadata = () => {
|
|
18
|
-
|
|
18
|
+
o({ width: t.videoWidth, height: t.videoHeight }), URL.revokeObjectURL(t.src);
|
|
19
19
|
}, t.onerror = () => {
|
|
20
|
-
|
|
21
|
-
}, t.src = URL.createObjectURL(
|
|
20
|
+
a(new Error("vft.upload.videoLoadFailed")), URL.revokeObjectURL(t.src);
|
|
21
|
+
}, t.src = URL.createObjectURL(i);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
25
|
+
async function s(i, o, a) {
|
|
26
26
|
try {
|
|
27
|
-
const { width: e, height:
|
|
28
|
-
return { isValid: e ===
|
|
27
|
+
const { width: e, height: r } = await n(i);
|
|
28
|
+
return { isValid: e === o && r === a, width: e, height: r };
|
|
29
29
|
} catch (e) {
|
|
30
|
-
return console.error("
|
|
30
|
+
return console.error("Size validation failed:", e), { isValid: !1, width: 0, height: 0 };
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function d(i) {
|
|
34
|
+
return i.type.startsWith("image/") || i.type.startsWith("video/");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function c(i, o) {
|
|
37
|
+
return o ? o.split(",").map((e) => e.trim()).some((e) => {
|
|
38
38
|
if (e.startsWith(".")) {
|
|
39
|
-
const
|
|
40
|
-
return
|
|
39
|
+
const r = e.toLowerCase();
|
|
40
|
+
return i.name.toLowerCase().endsWith(r);
|
|
41
41
|
} else if (e.includes("/*")) {
|
|
42
|
-
const
|
|
43
|
-
return
|
|
42
|
+
const r = e.replace("/*", "");
|
|
43
|
+
return i.type.startsWith(r + "/");
|
|
44
44
|
} else
|
|
45
|
-
return
|
|
45
|
+
return i.type === e;
|
|
46
46
|
}) : !0;
|
|
47
47
|
}
|
|
48
48
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
n as getFileDimensions,
|
|
50
|
+
d as isImageOrVideo,
|
|
51
|
+
s as validateFileSize,
|
|
52
|
+
c as validateFileType
|
|
53
53
|
};
|
package/es/constants/date.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const datePickTypes: readonly ["year", "month", "date", "dates", "week", "datetime", "datetimerange", "daterange", "monthrange"];
|
|
2
|
-
export declare const WEEK_DAYS: readonly ["
|
|
2
|
+
export declare const WEEK_DAYS: readonly ["vft.datePicker.weekSunday", "vft.datePicker.weekMonday", "vft.datePicker.weekTuesday", "vft.datePicker.weekWednesday", "vft.datePicker.weekThursday", "vft.datePicker.weekFriday", "vft.datePicker.weekSaturday"];
|
|
3
3
|
export type DatePickType = (typeof datePickTypes)[number];
|
package/es/constants/date.js
CHANGED
|
@@ -8,7 +8,15 @@ const e = [
|
|
|
8
8
|
"datetimerange",
|
|
9
9
|
"daterange",
|
|
10
10
|
"monthrange"
|
|
11
|
-
], t = [
|
|
11
|
+
], t = [
|
|
12
|
+
"vft.datePicker.weekSunday",
|
|
13
|
+
"vft.datePicker.weekMonday",
|
|
14
|
+
"vft.datePicker.weekTuesday",
|
|
15
|
+
"vft.datePicker.weekWednesday",
|
|
16
|
+
"vft.datePicker.weekThursday",
|
|
17
|
+
"vft.datePicker.weekFriday",
|
|
18
|
+
"vft.datePicker.weekSaturday"
|
|
19
|
+
];
|
|
12
20
|
export {
|
|
13
21
|
t as WEEK_DAYS,
|
|
14
22
|
e as datePickTypes
|
|
@@ -2,14 +2,14 @@ import "@vueuse/core";
|
|
|
2
2
|
import { isNumber as m, isClient as p } from "@vft/utils";
|
|
3
3
|
import { debugWarn as l } from "../../utils/error.js";
|
|
4
4
|
import "../../components/config-provider/hooks/use-global-config.js";
|
|
5
|
-
import { getCurrentInstance as i, inject as e, computed as c, unref as
|
|
5
|
+
import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../../components/form/index.js";
|
|
8
8
|
const s = {
|
|
9
9
|
current: 0
|
|
10
|
-
}, u =
|
|
10
|
+
}, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
|
|
11
11
|
const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
|
|
12
|
-
const r =
|
|
12
|
+
const r = Z(x);
|
|
13
13
|
return m(r) ? r : f;
|
|
14
14
|
}), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
|
|
15
15
|
return !p && !e(d) && l(
|
package/es/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './components';
|
|
|
3
3
|
export * from './constants';
|
|
4
4
|
export * from './hooks';
|
|
5
5
|
export * from './utils';
|
|
6
|
+
export * from './locale';
|
|
6
7
|
export * from './comp-resolver';
|
|
7
8
|
export * from './make-installer';
|
|
8
9
|
export declare const install: (app: import("vue").App, options?: import("./components").ConfigProviderContext) => void;
|
package/es/index.js
CHANGED
|
@@ -146,6 +146,10 @@ export { PatchFlags, ensureOnlyChild, flattedChildren, getFirstValidNode, getNor
|
|
|
146
146
|
export { useTable } from "./components/table/use/use-table.js";
|
|
147
147
|
export { ACTION_FIELD, CHECKED_FIELD, CREATE_TIME_FIELD, DATE_FIELD, DATE_TIME_FIELD, ID_FIELD, NAME_FIELD, SEQ_FIELD, STATUS_FIELD, UPDATE_TIME_FIELD } from "./components/table/field.js";
|
|
148
148
|
export { getDynamicProps, useForm } from "./components/super-form/use/use-form.js";
|
|
149
|
+
export { default as UnknownComponent } from "./locale/lang/en.js";
|
|
150
|
+
export { default as UnknownComponent } from "./locale/lang/zh-cn.js";
|
|
151
|
+
export { default as UnknownComponent } from "./locale/lang/zh-tw.js";
|
|
152
|
+
export { useLocale } from "./locale/use-locale.js";
|
|
149
153
|
export { CompResolver } from "./comp-resolver.js";
|
|
150
154
|
export { makeInstaller } from "./make-installer.js";
|
|
151
155
|
export { default as VftPopperArrow } from "./components/popper/arrow.vue2.js";
|
|
@@ -158,7 +162,7 @@ export { cascaderEmits, cascaderProps } from "./components/cascader/cascader.js"
|
|
|
158
162
|
export { CASCADER_PANEL_INJECTION_KEY } from "./components/cascader-panel/types.js";
|
|
159
163
|
export { CommonProps, DefaultProps, cascaderPanelEmits, cascaderPanelProps, useCascaderConfig } from "./components/cascader-panel/config.js";
|
|
160
164
|
export { checkboxGroupContextKey } from "./components/checkbox/constants.js";
|
|
161
|
-
export { configProviderContextKey, messageConfig } from "./components/config-provider/constants.js";
|
|
165
|
+
export { configProviderContextKey, localeContextKey, messageConfig } from "./components/config-provider/constants.js";
|
|
162
166
|
export { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from "./components/config-provider/hooks/use-global-config.js";
|
|
163
167
|
export { ROOT_PICKER_INJECTION_KEY, ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from "./components/date-picker/constants.js";
|
|
164
168
|
export { datePickerProps } from "./components/date-picker/props/date-picker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type TranslatePair = {
|
|
2
|
+
[key: string]: string | string[] | TranslatePair
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export type Language = {
|
|
6
|
+
name: string
|
|
7
|
+
vft: TranslatePair
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type LocaleType = 'zh-cn' | 'en' | 'zh-tw'
|
|
11
|
+
|
|
12
|
+
export declare const en: Language
|
|
13
|
+
export declare const zhCn: Language
|
|
14
|
+
export declare const zhTw: Language
|
|
15
|
+
|
|
16
|
+
export interface UseLocaleReturn {
|
|
17
|
+
locale: import('vue').Ref<Language>
|
|
18
|
+
currentLocale: import('vue').Ref<LocaleType>
|
|
19
|
+
setLocale: (lang: LocaleType) => void
|
|
20
|
+
getLocale: () => Language
|
|
21
|
+
getCurrentLocale: () => LocaleType
|
|
22
|
+
t: (key: string, defaultValue?: string) => string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare function useLocale(defaultLocale?: LocaleType): UseLocaleReturn
|
|
26
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as r } from "./lang/en.js";
|
|
2
|
+
import { default as f } from "./lang/zh-cn.js";
|
|
3
|
+
import { default as l } from "./lang/zh-tw.js";
|
|
4
|
+
import { useLocale as p } from "./use-locale.js";
|
|
5
|
+
export {
|
|
6
|
+
r as en,
|
|
7
|
+
p as useLocale,
|
|
8
|
+
f as zhCn,
|
|
9
|
+
l as zhTw
|
|
10
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
vft: {
|
|
4
|
+
ok: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
confirm: string;
|
|
7
|
+
close: string;
|
|
8
|
+
save: string;
|
|
9
|
+
delete: string;
|
|
10
|
+
edit: string;
|
|
11
|
+
add: string;
|
|
12
|
+
search: {
|
|
13
|
+
placeholder: string;
|
|
14
|
+
};
|
|
15
|
+
reset: string;
|
|
16
|
+
submit: string;
|
|
17
|
+
loading: string;
|
|
18
|
+
noData: string;
|
|
19
|
+
noMatch: string;
|
|
20
|
+
error: string;
|
|
21
|
+
success: string;
|
|
22
|
+
warning: string;
|
|
23
|
+
info: string;
|
|
24
|
+
pagination: {
|
|
25
|
+
itemsPerPage: string;
|
|
26
|
+
};
|
|
27
|
+
table: {
|
|
28
|
+
search: string;
|
|
29
|
+
};
|
|
30
|
+
form: {
|
|
31
|
+
required: string;
|
|
32
|
+
invalidFormat: string;
|
|
33
|
+
submitSuccess: string;
|
|
34
|
+
submitFailed: string;
|
|
35
|
+
};
|
|
36
|
+
dialog: {
|
|
37
|
+
confirm: string;
|
|
38
|
+
cancel: string;
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
notFound: string;
|
|
42
|
+
deleted: string;
|
|
43
|
+
networkDisconnect: string;
|
|
44
|
+
noData: string;
|
|
45
|
+
pageError: string;
|
|
46
|
+
noFilter: string;
|
|
47
|
+
noSearch: string;
|
|
48
|
+
};
|
|
49
|
+
popconfirm: {
|
|
50
|
+
confirm: string;
|
|
51
|
+
cancel: string;
|
|
52
|
+
};
|
|
53
|
+
superForm: {
|
|
54
|
+
reset: string;
|
|
55
|
+
submit: string;
|
|
56
|
+
cancel: string;
|
|
57
|
+
};
|
|
58
|
+
tree: {
|
|
59
|
+
emptyText: string;
|
|
60
|
+
};
|
|
61
|
+
timePicker: {
|
|
62
|
+
cancel: string;
|
|
63
|
+
confirm: string;
|
|
64
|
+
};
|
|
65
|
+
transfer: {
|
|
66
|
+
filterPlaceholder: string;
|
|
67
|
+
};
|
|
68
|
+
modal: {
|
|
69
|
+
confirm: string;
|
|
70
|
+
cancel: string;
|
|
71
|
+
};
|
|
72
|
+
multipleTabs: {
|
|
73
|
+
unpin: string;
|
|
74
|
+
refresh: string;
|
|
75
|
+
openInNewTab: string;
|
|
76
|
+
closeTab: string;
|
|
77
|
+
closeLeft: string;
|
|
78
|
+
closeRight: string;
|
|
79
|
+
closeOther: string;
|
|
80
|
+
closeAll: string;
|
|
81
|
+
fullScreen: string;
|
|
82
|
+
standalone: string;
|
|
83
|
+
pin: string;
|
|
84
|
+
};
|
|
85
|
+
cascader: {
|
|
86
|
+
placeholder: string;
|
|
87
|
+
noData: string;
|
|
88
|
+
};
|
|
89
|
+
clampToggle: {
|
|
90
|
+
expand: string;
|
|
91
|
+
collapse: string;
|
|
92
|
+
};
|
|
93
|
+
colorPicker: {
|
|
94
|
+
ariaDescription: string;
|
|
95
|
+
label: string;
|
|
96
|
+
};
|
|
97
|
+
datePicker: {
|
|
98
|
+
dateTableLabel: string;
|
|
99
|
+
monthTableLabel: string;
|
|
100
|
+
yearTableLabel: string;
|
|
101
|
+
selectDate: string;
|
|
102
|
+
selectTime: string;
|
|
103
|
+
year: string;
|
|
104
|
+
startDate: string;
|
|
105
|
+
startTime: string;
|
|
106
|
+
endDate: string;
|
|
107
|
+
endTime: string;
|
|
108
|
+
weekSunday: string;
|
|
109
|
+
weekMonday: string;
|
|
110
|
+
weekTuesday: string;
|
|
111
|
+
weekWednesday: string;
|
|
112
|
+
weekThursday: string;
|
|
113
|
+
weekFriday: string;
|
|
114
|
+
weekSaturday: string;
|
|
115
|
+
};
|
|
116
|
+
dateTimeSelect: {
|
|
117
|
+
placeholder: string;
|
|
118
|
+
};
|
|
119
|
+
dropdown: {
|
|
120
|
+
ariaLabel: string;
|
|
121
|
+
};
|
|
122
|
+
fullScreen: {
|
|
123
|
+
enter: string;
|
|
124
|
+
exit: string;
|
|
125
|
+
};
|
|
126
|
+
imageViewer: {
|
|
127
|
+
loadFailed: string;
|
|
128
|
+
};
|
|
129
|
+
mdContainer: {
|
|
130
|
+
publishTime: string;
|
|
131
|
+
readCount: string;
|
|
132
|
+
tableOfContents: string;
|
|
133
|
+
};
|
|
134
|
+
select: {
|
|
135
|
+
loading: string;
|
|
136
|
+
noMatch: string;
|
|
137
|
+
noData: string;
|
|
138
|
+
placeholder: string;
|
|
139
|
+
};
|
|
140
|
+
superFormPlaceholder: {
|
|
141
|
+
input: string;
|
|
142
|
+
password: string;
|
|
143
|
+
select: string;
|
|
144
|
+
checkbox: string;
|
|
145
|
+
search: string;
|
|
146
|
+
tag: string;
|
|
147
|
+
upload: string;
|
|
148
|
+
slider: string;
|
|
149
|
+
time: string;
|
|
150
|
+
startTime: string;
|
|
151
|
+
endTime: string;
|
|
152
|
+
startDate: string;
|
|
153
|
+
endDate: string;
|
|
154
|
+
startMonth: string;
|
|
155
|
+
endMonth: string;
|
|
156
|
+
};
|
|
157
|
+
superFormError: {
|
|
158
|
+
componentPropsError: string;
|
|
159
|
+
fetchRemoteDataError: string;
|
|
160
|
+
};
|
|
161
|
+
tableError: {
|
|
162
|
+
noDataToExpand: string;
|
|
163
|
+
};
|
|
164
|
+
transferExtend: {
|
|
165
|
+
noMatch: string;
|
|
166
|
+
noData: string;
|
|
167
|
+
list1: string;
|
|
168
|
+
list2: string;
|
|
169
|
+
};
|
|
170
|
+
upload: {
|
|
171
|
+
sizeExceed: string;
|
|
172
|
+
sizeCheckFailed: string;
|
|
173
|
+
typeNotSupported: string;
|
|
174
|
+
imageLoadFailed: string;
|
|
175
|
+
videoLoadFailed: string;
|
|
176
|
+
defaultSizeMessage: string;
|
|
177
|
+
defaultSizeCheckMessage: string;
|
|
178
|
+
defaultTypeCheckMessage: string;
|
|
179
|
+
deleteKeyTip: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
export default _default;
|