@vunk/form 2.17.2 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/date-picker-range/index.cjs +10 -3
- package/components/date-picker-range/index.mjs +10 -3
- package/components/date-picker-range/src/ctx.d.ts +2 -2
- package/components/date-picker-range/src/index.vue.d.ts +8 -5
- package/components/dialog-input-collection/index.cjs +55 -33
- package/components/dialog-input-collection/index.mjs +48 -26
- package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -0
- package/components/dialog-input-collection/src/index.vue.d.ts +2 -0
- package/components/download-plus/index.cjs +24 -13
- package/components/download-plus/index.mjs +25 -14
- package/components/download-plus/src/index.vue.d.ts +1 -0
- package/components/esri-input-geojson/index.cjs +12 -7
- package/components/esri-input-geojson/index.mjs +12 -7
- package/components/esri-input-geojson/src/ctx.d.ts +1 -1
- package/components/esri-input-geojson/src/index.vue.d.ts +4 -3
- package/components/form-item/index.cjs +17 -14
- package/components/form-item/index.mjs +18 -15
- package/components/input-collection/index.cjs +11 -6
- package/components/input-collection/index.mjs +6 -1
- package/components/input-collection/src/core.vue.d.ts +1 -0
- package/components/input-link/index.cjs +19 -9
- package/components/input-link/index.mjs +16 -6
- package/components/input-link/src/ctx.d.ts +3 -3
- package/components/input-link/src/index.vue.d.ts +9 -6
- package/components/radio/src/index.vue.d.ts +2 -2
- package/components/radio/src/option.vue.d.ts +1 -1
- package/components/radio/src/wraper.vue.d.ts +1 -1
- package/components/tables-select/index.cjs +6 -3
- package/components/tables-select/index.mjs +6 -3
- package/components/tables-select/src/index.vue.d.ts +1 -0
- package/components/upload/index.cjs +39 -26
- package/components/upload/index.mjs +38 -25
- package/components/upload/src/ctx.d.ts +1 -1
- package/components/upload/src/file.vue.d.ts +4 -3
- package/components/upload/src/index.vue.d.ts +7 -5
- package/components/upload/src/wraper.vue.d.ts +2 -2
- package/components/upload-plus/index.cjs +56 -37
- package/components/upload-plus/index.mjs +57 -38
- package/components/upload-plus/src/index.vue.d.ts +1 -0
- package/components/var-datetime-picker/index.cjs +18 -15
- package/components/var-datetime-picker/index.mjs +18 -15
- package/components/var-datetime-picker/src/index.vue.d.ts +1 -0
- package/composables/element-plus/index.cjs +23 -0
- package/composables/element-plus/index.d.ts +1 -0
- package/composables/element-plus/index.mjs +21 -0
- package/composables/element-plus/useLocale.d.ts +8 -0
- package/index.d.ts +1 -0
- package/index.esm.js +1 -0
- package/locale/index.cjs +110 -0
- package/locale/index.d.ts +2 -0
- package/locale/index.mjs +107 -0
- package/locale/lang/en.d.ts +53 -0
- package/locale/lang/index.cjs +2 -0
- package/locale/lang/index.d.ts +0 -0
- package/locale/lang/index.mjs +1 -0
- package/locale/lang/zh-cn.d.ts +53 -0
- package/package.json +16 -1
|
@@ -10,11 +10,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
10
10
|
};
|
|
11
11
|
label: {
|
|
12
12
|
type: StringConstructor;
|
|
13
|
-
default:
|
|
13
|
+
default: any;
|
|
14
14
|
};
|
|
15
15
|
placeholder: {
|
|
16
16
|
type: StringConstructor;
|
|
17
|
-
default:
|
|
17
|
+
default: any;
|
|
18
18
|
};
|
|
19
19
|
readonly: {
|
|
20
20
|
type: BooleanConstructor;
|
|
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
34
34
|
};
|
|
35
35
|
referenceLabel: {
|
|
36
36
|
type: StringConstructor;
|
|
37
|
-
default:
|
|
37
|
+
default: any;
|
|
38
38
|
};
|
|
39
39
|
modelValue: {
|
|
40
40
|
type: StringConstructor;
|
|
@@ -262,7 +262,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
262
262
|
createAppendEl: (url?: string) => () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
263
263
|
[key: string]: any;
|
|
264
264
|
}>;
|
|
265
|
+
inputLabel: import("vue").ComputedRef<string>;
|
|
266
|
+
inputPlaceholder: import("vue").ComputedRef<string>;
|
|
265
267
|
rules: import("vue").ComputedRef<FormItemRule[]>;
|
|
268
|
+
theReferenceLabel: import("vue").ComputedRef<string>;
|
|
266
269
|
readonly: import("vue").ComputedRef<boolean>;
|
|
267
270
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
268
271
|
"update:modelValue": (value: string) => boolean;
|
|
@@ -288,11 +291,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
288
291
|
};
|
|
289
292
|
label: {
|
|
290
293
|
type: StringConstructor;
|
|
291
|
-
default:
|
|
294
|
+
default: any;
|
|
292
295
|
};
|
|
293
296
|
placeholder: {
|
|
294
297
|
type: StringConstructor;
|
|
295
|
-
default:
|
|
298
|
+
default: any;
|
|
296
299
|
};
|
|
297
300
|
readonly: {
|
|
298
301
|
type: BooleanConstructor;
|
|
@@ -312,7 +315,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
312
315
|
};
|
|
313
316
|
referenceLabel: {
|
|
314
317
|
type: StringConstructor;
|
|
315
|
-
default:
|
|
318
|
+
default: any;
|
|
316
319
|
};
|
|
317
320
|
modelValue: {
|
|
318
321
|
type: StringConstructor;
|
|
@@ -324,7 +324,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
324
324
|
"onUpdate:modelValue"?: (val: string | number | boolean) => any;
|
|
325
325
|
onChange?: (val: string | number | boolean) => any;
|
|
326
326
|
}>, {
|
|
327
|
-
type: "button" | "
|
|
327
|
+
type: "button" | "radio" | "card";
|
|
328
328
|
required: boolean;
|
|
329
329
|
fill: string;
|
|
330
330
|
formItemSize: "default" | "small" | "large";
|
|
@@ -1481,7 +1481,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1481
1481
|
}>> & Readonly<{
|
|
1482
1482
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
1483
1483
|
}>, {
|
|
1484
|
-
type: "button" | "
|
|
1484
|
+
type: "button" | "radio" | "card";
|
|
1485
1485
|
modelValue: any;
|
|
1486
1486
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1487
1487
|
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -895,7 +895,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
895
895
|
}>> & Readonly<{
|
|
896
896
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
897
897
|
}>, {
|
|
898
|
-
type: "button" | "
|
|
898
|
+
type: "button" | "radio" | "card";
|
|
899
899
|
modelValue: any;
|
|
900
900
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
901
901
|
export default _default;
|
|
@@ -309,7 +309,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
309
309
|
"onUpdate:modelValue"?: (val: string | number | boolean) => any;
|
|
310
310
|
onChange?: (val: string | number | boolean) => any;
|
|
311
311
|
}>, {
|
|
312
|
-
type: "button" | "
|
|
312
|
+
type: "button" | "radio" | "card";
|
|
313
313
|
required: boolean;
|
|
314
314
|
fill: string;
|
|
315
315
|
formItemSize: "default" | "small" | "large";
|
|
@@ -11,6 +11,7 @@ var elementPlus = require('element-plus');
|
|
|
11
11
|
var array = require('@vunk/shared/array');
|
|
12
12
|
var object = require('@vunk/shared/object');
|
|
13
13
|
var composables = require('@vunk/form/composables');
|
|
14
|
+
var elementPlus$1 = require('@vunk/form/composables/element-plus');
|
|
14
15
|
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
15
16
|
|
|
16
17
|
const props = {
|
|
@@ -97,12 +98,12 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
97
98
|
|
|
98
99
|
var _sfc_main = vue.defineComponent({
|
|
99
100
|
name: "VkfTablesSelect",
|
|
100
|
-
inheritAttrs: false,
|
|
101
101
|
components: {
|
|
102
102
|
VkfSelect: select.VkfSelect,
|
|
103
103
|
VkTablesV1Checkbox: tablesV1Checkbox.VkTablesV1Checkbox,
|
|
104
104
|
ElDialog: elementPlus.ElDialog
|
|
105
105
|
},
|
|
106
|
+
inheritAttrs: false,
|
|
106
107
|
props,
|
|
107
108
|
emits,
|
|
108
109
|
setup(props2, { emit }) {
|
|
@@ -110,6 +111,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
110
111
|
const tablesProps = tablesV1Checkbox._VkTablesV1CheckboxCtx.createBindProps(props2, ["modelValue"]);
|
|
111
112
|
const tablesEmits = tablesV1Checkbox._VkTablesV1CheckboxCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
112
113
|
const readonly = composables.useComputedReadonly(props2);
|
|
114
|
+
const { tr } = elementPlus$1.useLocale();
|
|
113
115
|
const dialogVisible = vue.ref(false);
|
|
114
116
|
const backupRowMap = vue.ref(/* @__PURE__ */ new Map());
|
|
115
117
|
const theModelValue = vue.computed({
|
|
@@ -193,7 +195,8 @@ var _sfc_main = vue.defineComponent({
|
|
|
193
195
|
dialogVisible,
|
|
194
196
|
selectValue,
|
|
195
197
|
theModelValue,
|
|
196
|
-
readonly
|
|
198
|
+
readonly,
|
|
199
|
+
tr
|
|
197
200
|
};
|
|
198
201
|
}
|
|
199
202
|
});
|
|
@@ -224,7 +227,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
224
227
|
vue.createVNode(_component_ElDialog, {
|
|
225
228
|
modelValue: _ctx.dialogVisible,
|
|
226
229
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.dialogVisible = $event),
|
|
227
|
-
title: _ctx.placeholder || _ctx.label || "\u8BF7\u9009\u62E9",
|
|
230
|
+
title: _ctx.placeholder || _ctx.label || _ctx.tr("el.select.placeholder", "\u8BF7\u9009\u62E9"),
|
|
228
231
|
"append-to-body": "",
|
|
229
232
|
"model-class": "vkf-tables-select__model",
|
|
230
233
|
class: vue.normalizeClass(["vkf-tables-select__dialog", _ctx.dialogClass])
|
|
@@ -7,6 +7,7 @@ import { ElDialog } from 'element-plus';
|
|
|
7
7
|
import { compareArray } from '@vunk/shared/array';
|
|
8
8
|
import { isNotEmptyObject } from '@vunk/shared/object';
|
|
9
9
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
10
|
+
import { useLocale } from '@vunk/form/composables/element-plus';
|
|
10
11
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
11
12
|
|
|
12
13
|
const props = {
|
|
@@ -93,12 +94,12 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
93
94
|
|
|
94
95
|
var _sfc_main = defineComponent({
|
|
95
96
|
name: "VkfTablesSelect",
|
|
96
|
-
inheritAttrs: false,
|
|
97
97
|
components: {
|
|
98
98
|
VkfSelect,
|
|
99
99
|
VkTablesV1Checkbox,
|
|
100
100
|
ElDialog
|
|
101
101
|
},
|
|
102
|
+
inheritAttrs: false,
|
|
102
103
|
props,
|
|
103
104
|
emits,
|
|
104
105
|
setup(props2, { emit }) {
|
|
@@ -106,6 +107,7 @@ var _sfc_main = defineComponent({
|
|
|
106
107
|
const tablesProps = _VkTablesV1CheckboxCtx.createBindProps(props2, ["modelValue"]);
|
|
107
108
|
const tablesEmits = _VkTablesV1CheckboxCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
108
109
|
const readonly = useComputedReadonly(props2);
|
|
110
|
+
const { tr } = useLocale();
|
|
109
111
|
const dialogVisible = ref(false);
|
|
110
112
|
const backupRowMap = ref(/* @__PURE__ */ new Map());
|
|
111
113
|
const theModelValue = computed({
|
|
@@ -189,7 +191,8 @@ var _sfc_main = defineComponent({
|
|
|
189
191
|
dialogVisible,
|
|
190
192
|
selectValue,
|
|
191
193
|
theModelValue,
|
|
192
|
-
readonly
|
|
194
|
+
readonly,
|
|
195
|
+
tr
|
|
193
196
|
};
|
|
194
197
|
}
|
|
195
198
|
});
|
|
@@ -220,7 +223,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
220
223
|
createVNode(_component_ElDialog, {
|
|
221
224
|
modelValue: _ctx.dialogVisible,
|
|
222
225
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.dialogVisible = $event),
|
|
223
|
-
title: _ctx.placeholder || _ctx.label || "\u8BF7\u9009\u62E9",
|
|
226
|
+
title: _ctx.placeholder || _ctx.label || _ctx.tr("el.select.placeholder", "\u8BF7\u9009\u62E9"),
|
|
224
227
|
"append-to-body": "",
|
|
225
228
|
"model-class": "vkf-tables-select__model",
|
|
226
229
|
class: normalizeClass(["vkf-tables-select__dialog", _ctx.dialogClass])
|
|
@@ -493,6 +493,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
493
493
|
selectValue: import("vue").ComputedRef<NormalObject | NormalObject[]>;
|
|
494
494
|
theModelValue: import("vue").WritableComputedRef<NormalObject[], NormalObject | NormalObject[]>;
|
|
495
495
|
readonly: import("vue").ComputedRef<boolean>;
|
|
496
|
+
tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
|
|
496
497
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
497
498
|
'update:modelValue': any;
|
|
498
499
|
'update:start': (val: number) => boolean;
|
|
@@ -7,11 +7,12 @@ var formItem = require('@vunk/form/components/form-item');
|
|
|
7
7
|
var utilsVue = require('@vunk/core/shared/utils-vue');
|
|
8
8
|
var elementPlus = require('element-plus');
|
|
9
9
|
var utilsObject = require('@vunk/core/shared/utils-object');
|
|
10
|
-
var elementPlus$
|
|
10
|
+
var elementPlus$2 = require('@vunk/form/shared/element-plus');
|
|
11
11
|
var index = require('../index.cjs');
|
|
12
12
|
var utilsFetch = require('@vunk/core/shared/utils-fetch');
|
|
13
13
|
var utilsFunction = require('@vunk/core/shared/utils-function');
|
|
14
14
|
var _function = require('@vunk/shared/function');
|
|
15
|
+
var elementPlus$1 = require('@vunk/form/composables/element-plus');
|
|
15
16
|
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
16
17
|
var composables = require('@vunk/form/composables');
|
|
17
18
|
var progress = require('@vunk/form/shared/progress-it');
|
|
@@ -26,7 +27,7 @@ const props = {
|
|
|
26
27
|
preview: null,
|
|
27
28
|
previewLabel: {
|
|
28
29
|
type: String,
|
|
29
|
-
default:
|
|
30
|
+
default: void 0
|
|
30
31
|
},
|
|
31
32
|
beforeUpload: {
|
|
32
33
|
type: Function,
|
|
@@ -117,7 +118,7 @@ var _sfc_main$2 = vue.defineComponent({
|
|
|
117
118
|
},
|
|
118
119
|
previewLabel: {
|
|
119
120
|
type: String,
|
|
120
|
-
default:
|
|
121
|
+
default: void 0
|
|
121
122
|
}
|
|
122
123
|
},
|
|
123
124
|
emits: {
|
|
@@ -126,7 +127,7 @@ var _sfc_main$2 = vue.defineComponent({
|
|
|
126
127
|
setup(props, { emit }) {
|
|
127
128
|
const nsUpload = elementPlus.useNamespace("upload");
|
|
128
129
|
const nsIcon = elementPlus.useNamespace("icon");
|
|
129
|
-
const {
|
|
130
|
+
const { tr } = elementPlus$1.useLocale();
|
|
130
131
|
const handleRemove = (file = props.file) => {
|
|
131
132
|
emit("remove", file);
|
|
132
133
|
};
|
|
@@ -154,17 +155,19 @@ var _sfc_main$2 = vue.defineComponent({
|
|
|
154
155
|
}
|
|
155
156
|
return props.preview;
|
|
156
157
|
});
|
|
158
|
+
const previewText = vue.computed(() => props.previewLabel || tr("el.upload.preview", "\u9884\u89C8"));
|
|
157
159
|
const handlePreview = (file = props.file) => {
|
|
158
160
|
previewable.value && props.onPreview(file);
|
|
159
161
|
};
|
|
160
162
|
return {
|
|
161
163
|
handleRemove,
|
|
162
|
-
t,
|
|
163
164
|
nsIcon,
|
|
164
165
|
nsUpload,
|
|
165
166
|
handleDownload,
|
|
166
167
|
handlePreview,
|
|
167
|
-
|
|
168
|
+
previewText,
|
|
169
|
+
previewable,
|
|
170
|
+
tr
|
|
168
171
|
};
|
|
169
172
|
}
|
|
170
173
|
});
|
|
@@ -273,7 +276,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
273
276
|
}, {
|
|
274
277
|
default: vue.withCtx(() => [
|
|
275
278
|
vue.createTextVNode(
|
|
276
|
-
vue.toDisplayString(_ctx.
|
|
279
|
+
vue.toDisplayString(_ctx.previewText),
|
|
277
280
|
1
|
|
278
281
|
/* TEXT */
|
|
279
282
|
)
|
|
@@ -289,11 +292,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
289
292
|
type: "primary",
|
|
290
293
|
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
291
294
|
}, {
|
|
292
|
-
default: vue.withCtx(() =>
|
|
293
|
-
vue.createTextVNode(
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
default: vue.withCtx(() => [
|
|
296
|
+
vue.createTextVNode(
|
|
297
|
+
vue.toDisplayString(_ctx.tr("vkf.upload.download", "\u4E0B\u8F7D")),
|
|
298
|
+
1
|
|
299
|
+
/* TEXT */
|
|
300
|
+
)
|
|
301
|
+
]),
|
|
302
|
+
_: 1
|
|
303
|
+
/* STABLE */
|
|
297
304
|
})
|
|
298
305
|
],
|
|
299
306
|
2
|
|
@@ -454,7 +461,8 @@ var _sfc_main$1 = vue.defineComponent({
|
|
|
454
461
|
emits,
|
|
455
462
|
setup(props2, { emit }) {
|
|
456
463
|
const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
|
|
457
|
-
const
|
|
464
|
+
const { tr } = elementPlus$1.useLocale();
|
|
465
|
+
const coreBindProps = elementPlus$2.createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
|
|
458
466
|
const uploadRef = vue.shallowRef();
|
|
459
467
|
const handleRemove = (file) => {
|
|
460
468
|
uploadRef.value?.handleRemove(file);
|
|
@@ -477,11 +485,11 @@ var _sfc_main$1 = vue.defineComponent({
|
|
|
477
485
|
};
|
|
478
486
|
if (props2.confirmExceed) {
|
|
479
487
|
elementPlus.ElMessageBox.confirm(
|
|
480
|
-
|
|
481
|
-
"\u63D0\u793A",
|
|
488
|
+
tr("vkf.upload.exceedConfirm", "\u5DF2\u8D85\u8FC7\u6700\u5927\u4E0A\u4F20\u6570\u91CF\u9650\u5236\uFF0C\u662F\u5426\u4F7F\u7528\u65B0\u6587\u4EF6\u91CD\u65B0\u4E0A\u4F20\uFF1F"),
|
|
489
|
+
tr("el.messagebox.title", "\u63D0\u793A"),
|
|
482
490
|
{
|
|
483
|
-
confirmButtonText: "\u7EE7\u7EED",
|
|
484
|
-
cancelButtonText: "\u53D6\u6D88",
|
|
491
|
+
confirmButtonText: tr("el.upload.continue", "\u7EE7\u7EED"),
|
|
492
|
+
cancelButtonText: tr("el.messagebox.cancel", "\u53D6\u6D88"),
|
|
485
493
|
type: "warning"
|
|
486
494
|
}
|
|
487
495
|
).then(doUpload);
|
|
@@ -525,7 +533,8 @@ var _sfc_main$1 = vue.defineComponent({
|
|
|
525
533
|
onSuccess,
|
|
526
534
|
// onProgress,
|
|
527
535
|
beforeUpload,
|
|
528
|
-
handleExceed
|
|
536
|
+
handleExceed,
|
|
537
|
+
tr
|
|
529
538
|
};
|
|
530
539
|
}
|
|
531
540
|
});
|
|
@@ -571,11 +580,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
571
580
|
default: vue.withCtx(() => [
|
|
572
581
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
573
582
|
vue.createVNode(_component_ElLink, { type: "primary" }, {
|
|
574
|
-
default: vue.withCtx(() =>
|
|
575
|
-
vue.createTextVNode(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
583
|
+
default: vue.withCtx(() => [
|
|
584
|
+
vue.createTextVNode(
|
|
585
|
+
" + " + vue.toDisplayString(_ctx.tr("vkf.upload.selectFile", "\u9009\u62E9\u6587\u4EF6")),
|
|
586
|
+
1
|
|
587
|
+
/* TEXT */
|
|
588
|
+
)
|
|
589
|
+
]),
|
|
590
|
+
_: 1
|
|
591
|
+
/* STABLE */
|
|
579
592
|
})
|
|
580
593
|
])
|
|
581
594
|
]),
|
|
@@ -604,9 +617,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
604
617
|
"is-empty": _ctx.fileList?.length === 0
|
|
605
618
|
}])
|
|
606
619
|
},
|
|
607
|
-
"\u6682\u65E0",
|
|
608
|
-
|
|
609
|
-
/* CLASS */
|
|
620
|
+
vue.toDisplayString(_ctx.tr("vkf.upload.empty", "\u6682\u65E0")),
|
|
621
|
+
3
|
|
622
|
+
/* TEXT, CLASS */
|
|
610
623
|
)
|
|
611
624
|
]),
|
|
612
625
|
_: 3
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, normalizeClass, createBlock, createElementVNode, withModifiers, createVNode, withCtx, toDisplayString, createTextVNode, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, h } from 'vue';
|
|
2
2
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
3
3
|
import { bindPropsFactory, onEmitsFactory, vOn } from '@vunk/core/shared/utils-vue';
|
|
4
|
-
import { uploadProps, ElProgress, ElIcon, ElButton, useNamespace,
|
|
4
|
+
import { uploadProps, ElProgress, ElIcon, ElButton, useNamespace, ElUpload, ElLink, ElMessageBox, genFileId } from 'element-plus';
|
|
5
5
|
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
6
6
|
import { createUploadBindProps } from '@vunk/form/shared/element-plus';
|
|
7
7
|
import { h as check_default, z as zoom_in_default, d as delete_default, i as close_default, j as circle_check_default, k as document_default, a as download_default } from '../index.mjs';
|
|
8
8
|
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
9
9
|
import { NOOP } from '@vunk/core/shared/utils-function';
|
|
10
10
|
import { isCallable } from '@vunk/shared/function';
|
|
11
|
+
import { useLocale } from '@vunk/form/composables/element-plus';
|
|
11
12
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
12
13
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
13
14
|
import progress from '@vunk/form/shared/progress-it';
|
|
@@ -22,7 +23,7 @@ const props = {
|
|
|
22
23
|
preview: null,
|
|
23
24
|
previewLabel: {
|
|
24
25
|
type: String,
|
|
25
|
-
default:
|
|
26
|
+
default: void 0
|
|
26
27
|
},
|
|
27
28
|
beforeUpload: {
|
|
28
29
|
type: Function,
|
|
@@ -113,7 +114,7 @@ var _sfc_main$2 = defineComponent({
|
|
|
113
114
|
},
|
|
114
115
|
previewLabel: {
|
|
115
116
|
type: String,
|
|
116
|
-
default:
|
|
117
|
+
default: void 0
|
|
117
118
|
}
|
|
118
119
|
},
|
|
119
120
|
emits: {
|
|
@@ -122,7 +123,7 @@ var _sfc_main$2 = defineComponent({
|
|
|
122
123
|
setup(props, { emit }) {
|
|
123
124
|
const nsUpload = useNamespace("upload");
|
|
124
125
|
const nsIcon = useNamespace("icon");
|
|
125
|
-
const {
|
|
126
|
+
const { tr } = useLocale();
|
|
126
127
|
const handleRemove = (file = props.file) => {
|
|
127
128
|
emit("remove", file);
|
|
128
129
|
};
|
|
@@ -150,17 +151,19 @@ var _sfc_main$2 = defineComponent({
|
|
|
150
151
|
}
|
|
151
152
|
return props.preview;
|
|
152
153
|
});
|
|
154
|
+
const previewText = computed(() => props.previewLabel || tr("el.upload.preview", "\u9884\u89C8"));
|
|
153
155
|
const handlePreview = (file = props.file) => {
|
|
154
156
|
previewable.value && props.onPreview(file);
|
|
155
157
|
};
|
|
156
158
|
return {
|
|
157
159
|
handleRemove,
|
|
158
|
-
t,
|
|
159
160
|
nsIcon,
|
|
160
161
|
nsUpload,
|
|
161
162
|
handleDownload,
|
|
162
163
|
handlePreview,
|
|
163
|
-
|
|
164
|
+
previewText,
|
|
165
|
+
previewable,
|
|
166
|
+
tr
|
|
164
167
|
};
|
|
165
168
|
}
|
|
166
169
|
});
|
|
@@ -269,7 +272,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
269
272
|
}, {
|
|
270
273
|
default: withCtx(() => [
|
|
271
274
|
createTextVNode(
|
|
272
|
-
toDisplayString(_ctx.
|
|
275
|
+
toDisplayString(_ctx.previewText),
|
|
273
276
|
1
|
|
274
277
|
/* TEXT */
|
|
275
278
|
)
|
|
@@ -285,11 +288,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
285
288
|
type: "primary",
|
|
286
289
|
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
287
290
|
}, {
|
|
288
|
-
default: withCtx(() =>
|
|
289
|
-
createTextVNode(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
default: withCtx(() => [
|
|
292
|
+
createTextVNode(
|
|
293
|
+
toDisplayString(_ctx.tr("vkf.upload.download", "\u4E0B\u8F7D")),
|
|
294
|
+
1
|
|
295
|
+
/* TEXT */
|
|
296
|
+
)
|
|
297
|
+
]),
|
|
298
|
+
_: 1
|
|
299
|
+
/* STABLE */
|
|
293
300
|
})
|
|
294
301
|
],
|
|
295
302
|
2
|
|
@@ -450,6 +457,7 @@ var _sfc_main$1 = defineComponent({
|
|
|
450
457
|
emits,
|
|
451
458
|
setup(props2, { emit }) {
|
|
452
459
|
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
460
|
+
const { tr } = useLocale();
|
|
453
461
|
const coreBindProps = createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
|
|
454
462
|
const uploadRef = shallowRef();
|
|
455
463
|
const handleRemove = (file) => {
|
|
@@ -473,11 +481,11 @@ var _sfc_main$1 = defineComponent({
|
|
|
473
481
|
};
|
|
474
482
|
if (props2.confirmExceed) {
|
|
475
483
|
ElMessageBox.confirm(
|
|
476
|
-
|
|
477
|
-
"\u63D0\u793A",
|
|
484
|
+
tr("vkf.upload.exceedConfirm", "\u5DF2\u8D85\u8FC7\u6700\u5927\u4E0A\u4F20\u6570\u91CF\u9650\u5236\uFF0C\u662F\u5426\u4F7F\u7528\u65B0\u6587\u4EF6\u91CD\u65B0\u4E0A\u4F20\uFF1F"),
|
|
485
|
+
tr("el.messagebox.title", "\u63D0\u793A"),
|
|
478
486
|
{
|
|
479
|
-
confirmButtonText: "\u7EE7\u7EED",
|
|
480
|
-
cancelButtonText: "\u53D6\u6D88",
|
|
487
|
+
confirmButtonText: tr("el.upload.continue", "\u7EE7\u7EED"),
|
|
488
|
+
cancelButtonText: tr("el.messagebox.cancel", "\u53D6\u6D88"),
|
|
481
489
|
type: "warning"
|
|
482
490
|
}
|
|
483
491
|
).then(doUpload);
|
|
@@ -521,7 +529,8 @@ var _sfc_main$1 = defineComponent({
|
|
|
521
529
|
onSuccess,
|
|
522
530
|
// onProgress,
|
|
523
531
|
beforeUpload,
|
|
524
|
-
handleExceed
|
|
532
|
+
handleExceed,
|
|
533
|
+
tr
|
|
525
534
|
};
|
|
526
535
|
}
|
|
527
536
|
});
|
|
@@ -567,11 +576,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
567
576
|
default: withCtx(() => [
|
|
568
577
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
569
578
|
createVNode(_component_ElLink, { type: "primary" }, {
|
|
570
|
-
default: withCtx(() =>
|
|
571
|
-
createTextVNode(
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
579
|
+
default: withCtx(() => [
|
|
580
|
+
createTextVNode(
|
|
581
|
+
" + " + toDisplayString(_ctx.tr("vkf.upload.selectFile", "\u9009\u62E9\u6587\u4EF6")),
|
|
582
|
+
1
|
|
583
|
+
/* TEXT */
|
|
584
|
+
)
|
|
585
|
+
]),
|
|
586
|
+
_: 1
|
|
587
|
+
/* STABLE */
|
|
575
588
|
})
|
|
576
589
|
])
|
|
577
590
|
]),
|
|
@@ -600,9 +613,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
600
613
|
"is-empty": _ctx.fileList?.length === 0
|
|
601
614
|
}])
|
|
602
615
|
},
|
|
603
|
-
"\u6682\u65E0",
|
|
604
|
-
|
|
605
|
-
/* CLASS */
|
|
616
|
+
toDisplayString(_ctx.tr("vkf.upload.empty", "\u6682\u65E0")),
|
|
617
|
+
3
|
|
618
|
+
/* TEXT, CLASS */
|
|
606
619
|
)
|
|
607
620
|
]),
|
|
608
621
|
_: 3
|
|
@@ -28,11 +28,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
28
28
|
};
|
|
29
29
|
previewLabel: {
|
|
30
30
|
type: StringConstructor;
|
|
31
|
-
default:
|
|
31
|
+
default: any;
|
|
32
32
|
};
|
|
33
33
|
}>, {
|
|
34
34
|
handleRemove: (file?: UploadFile) => void;
|
|
35
|
-
t: import("element-plus").Translator;
|
|
36
35
|
nsIcon: {
|
|
37
36
|
namespace: import("vue").ComputedRef<string>;
|
|
38
37
|
b: (blockSuffix?: string) => string;
|
|
@@ -71,7 +70,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
71
70
|
};
|
|
72
71
|
handleDownload: (file?: UploadFile) => void;
|
|
73
72
|
handlePreview: (file?: UploadFile) => void;
|
|
73
|
+
previewText: import("vue").ComputedRef<string>;
|
|
74
74
|
previewable: import("vue").ComputedRef<unknown>;
|
|
75
|
+
tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
|
|
75
76
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
77
|
remove: (e: UploadFile) => UploadFile;
|
|
77
78
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -101,7 +102,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
101
102
|
};
|
|
102
103
|
previewLabel: {
|
|
103
104
|
type: StringConstructor;
|
|
104
|
-
default:
|
|
105
|
+
default: any;
|
|
105
106
|
};
|
|
106
107
|
}>> & Readonly<{
|
|
107
108
|
onRemove?: (e: UploadFile) => any;
|
|
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
9
9
|
preview: any;
|
|
10
10
|
previewLabel: {
|
|
11
11
|
type: StringConstructor;
|
|
12
|
-
default:
|
|
12
|
+
default: any;
|
|
13
13
|
};
|
|
14
14
|
beforeUpload: {
|
|
15
15
|
type: FunctionConstructor;
|
|
@@ -321,6 +321,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
321
321
|
onSuccess: (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
|
|
322
322
|
beforeUpload: (rawFile: UploadRawFile) => Promise<any>;
|
|
323
323
|
handleExceed: (files: File[], uploadFiles: import("element-plus").UploadUserFile[]) => void;
|
|
324
|
+
tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
|
|
324
325
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
325
326
|
'update:fileList': any;
|
|
326
327
|
remove: (e: UploadFile) => UploadFile;
|
|
@@ -332,7 +333,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
332
333
|
preview: any;
|
|
333
334
|
previewLabel: {
|
|
334
335
|
type: StringConstructor;
|
|
335
|
-
default:
|
|
336
|
+
default: any;
|
|
336
337
|
};
|
|
337
338
|
beforeUpload: {
|
|
338
339
|
type: FunctionConstructor;
|
|
@@ -1304,11 +1305,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1304
1305
|
};
|
|
1305
1306
|
previewLabel: {
|
|
1306
1307
|
type: StringConstructor;
|
|
1307
|
-
default:
|
|
1308
|
+
default: any;
|
|
1308
1309
|
};
|
|
1309
1310
|
}>, {
|
|
1310
1311
|
handleRemove: (file?: UploadFile) => void;
|
|
1311
|
-
t: import("element-plus").Translator;
|
|
1312
1312
|
nsIcon: {
|
|
1313
1313
|
namespace: import("vue").ComputedRef<string>;
|
|
1314
1314
|
b: (blockSuffix?: string) => string;
|
|
@@ -1347,7 +1347,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1347
1347
|
};
|
|
1348
1348
|
handleDownload: (file?: UploadFile) => void;
|
|
1349
1349
|
handlePreview: (file?: UploadFile) => void;
|
|
1350
|
+
previewText: import("vue").ComputedRef<string>;
|
|
1350
1351
|
previewable: import("vue").ComputedRef<unknown>;
|
|
1352
|
+
tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
|
|
1351
1353
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1352
1354
|
remove: (e: UploadFile) => UploadFile;
|
|
1353
1355
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1377,7 +1379,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1377
1379
|
};
|
|
1378
1380
|
previewLabel: {
|
|
1379
1381
|
type: StringConstructor;
|
|
1380
|
-
default:
|
|
1382
|
+
default: any;
|
|
1381
1383
|
};
|
|
1382
1384
|
}>> & Readonly<{
|
|
1383
1385
|
onRemove?: (e: UploadFile) => any;
|
|
@@ -6,7 +6,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
6
6
|
preview: any;
|
|
7
7
|
previewLabel: {
|
|
8
8
|
type: StringConstructor;
|
|
9
|
-
default:
|
|
9
|
+
default: any;
|
|
10
10
|
};
|
|
11
11
|
beforeUpload: {
|
|
12
12
|
type: FunctionConstructor;
|
|
@@ -283,7 +283,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
283
283
|
preview: any;
|
|
284
284
|
previewLabel: {
|
|
285
285
|
type: StringConstructor;
|
|
286
|
-
default:
|
|
286
|
+
default: any;
|
|
287
287
|
};
|
|
288
288
|
beforeUpload: {
|
|
289
289
|
type: FunctionConstructor;
|