persagy-vant 0.0.36 → 0.0.37
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/cell/Cell.d.ts +9 -0
- package/es/cell/Cell.mjs +15 -3
- package/es/cell/index.css +1 -1
- package/es/cell/index.d.ts +5 -0
- package/es/cell/index.less +24 -2
- package/es/cell/var.less +6 -0
- package/es/cell-group/CellGroup.d.ts +4 -0
- package/es/cell-group/CellGroup.mjs +4 -2
- package/es/cell-group/index.css +1 -1
- package/es/cell-group/index.d.ts +3 -0
- package/es/cell-group/index.less +27 -0
- package/es/cell-group/var.less +3 -0
- package/es/collapse-item/CollapseItem.d.ts +7 -0
- package/es/collapse-item/index.d.ts +5 -0
- package/es/field/Field.d.ts +7 -0
- package/es/field/index.d.ts +5 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/loading/index.css +1 -1
- package/es/loading/index.less +1 -1
- package/es/object-select/ObjectSelect.mjs +13 -1
- package/es/style/base.css +1 -1
- package/es/style/base.less +5 -0
- package/es/style/css-variables.css +1 -1
- package/es/style/css-variables.less +1 -0
- package/es/style/var.less +1 -0
- package/es/title-bar/TitleBar.d.ts +5 -1
- package/es/title-bar/TitleBar.mjs +5 -3
- package/es/title-bar/index.css +1 -1
- package/es/title-bar/index.d.ts +4 -1
- package/es/title-bar/index.less +6 -1
- package/es/title-bar/var.less +2 -0
- package/es/uploader/Uploader.d.ts +7 -0
- package/es/uploader/Uploader.mjs +55 -30
- package/es/uploader/UploaderPreviewItem.d.ts +2 -1
- package/es/uploader/UploaderPreviewItem.mjs +13 -6
- package/es/uploader/index.css +1 -1
- package/es/uploader/index.d.ts +5 -0
- package/es/uploader/index.less +30 -0
- package/es/uploader/types.d.ts +1 -0
- package/es/uploader/utils.d.ts +2 -0
- package/es/uploader/utils.mjs +74 -0
- package/es/uploader/var.less +5 -0
- package/lib/cell/Cell.d.ts +9 -0
- package/lib/cell/Cell.js +15 -3
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.d.ts +5 -0
- package/lib/cell/index.less +24 -2
- package/lib/cell/var.less +6 -0
- package/lib/cell-group/CellGroup.d.ts +4 -0
- package/lib/cell-group/CellGroup.js +4 -2
- package/lib/cell-group/index.css +1 -1
- package/lib/cell-group/index.d.ts +3 -0
- package/lib/cell-group/index.less +27 -0
- package/lib/cell-group/var.less +3 -0
- package/lib/collapse-item/CollapseItem.d.ts +7 -0
- package/lib/collapse-item/index.d.ts +5 -0
- package/lib/field/Field.d.ts +7 -0
- package/lib/field/index.d.ts +5 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/loading/index.css +1 -1
- package/lib/loading/index.less +1 -1
- package/lib/object-select/ObjectSelect.js +13 -1
- package/lib/style/base.css +1 -1
- package/lib/style/base.less +5 -0
- package/lib/style/css-variables.css +1 -1
- package/lib/style/css-variables.less +1 -0
- package/lib/style/var.less +1 -0
- package/lib/title-bar/TitleBar.d.ts +5 -1
- package/lib/title-bar/TitleBar.js +5 -3
- package/lib/title-bar/index.css +1 -1
- package/lib/title-bar/index.d.ts +4 -1
- package/lib/title-bar/index.less +6 -1
- package/lib/title-bar/var.less +2 -0
- package/lib/uploader/Uploader.d.ts +7 -0
- package/lib/uploader/Uploader.js +53 -28
- package/lib/uploader/UploaderPreviewItem.d.ts +2 -1
- package/lib/uploader/UploaderPreviewItem.js +12 -5
- package/lib/uploader/index.css +1 -1
- package/lib/uploader/index.d.ts +5 -0
- package/lib/uploader/index.less +30 -0
- package/lib/uploader/types.d.ts +1 -0
- package/lib/uploader/utils.d.ts +2 -0
- package/lib/uploader/utils.js +74 -0
- package/lib/uploader/var.less +5 -0
- package/lib/vant.cjs.js +175 -43
- package/lib/vant.es.js +175 -43
- package/lib/vant.js +175 -43
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
- package/skills/use-persagy-vant/SKILL.md +4 -3
- package/skills/use-persagy-vant/references/component-documentation.md +4 -4
- package/skills/use-persagy-vant/references/component-variant-selection.md +53 -0
- package/skills/use-persagy-vant/references/reuse-policy.md +7 -4
package/lib/vant.js
CHANGED
|
@@ -3069,6 +3069,8 @@
|
|
|
3069
3069
|
title: numericProp,
|
|
3070
3070
|
value: numericProp,
|
|
3071
3071
|
label: numericProp,
|
|
3072
|
+
description: numericProp,
|
|
3073
|
+
threeLine: Boolean,
|
|
3072
3074
|
labelSize: numericProp,
|
|
3073
3075
|
avatar: String,
|
|
3074
3076
|
rightAvatar: String,
|
|
@@ -3168,6 +3170,14 @@
|
|
|
3168
3170
|
}, [slots.label ? slots.label() : props2.label]);
|
|
3169
3171
|
}
|
|
3170
3172
|
};
|
|
3173
|
+
const renderDescription = () => {
|
|
3174
|
+
const showDescription = slots.description || isDef(props2.description);
|
|
3175
|
+
if (showDescription) {
|
|
3176
|
+
return vue.createVNode("div", {
|
|
3177
|
+
"class": bem$1B("description")
|
|
3178
|
+
}, [slots.description ? slots.description() : props2.description]);
|
|
3179
|
+
}
|
|
3180
|
+
};
|
|
3171
3181
|
const renderTitle = () => {
|
|
3172
3182
|
if (slots.title || isDef(props2.title)) {
|
|
3173
3183
|
return vue.createVNode("div", {
|
|
@@ -3175,7 +3185,7 @@
|
|
|
3175
3185
|
"style": props2.titleStyle
|
|
3176
3186
|
}, [vue.createVNode("div", {
|
|
3177
3187
|
"class": bem$1B("title-row")
|
|
3178
|
-
}, [slots.title ? slots.title() : vue.createVNode("span", null, [props2.title]), renderTags(), renderTitleIcon()]), renderLabel()]);
|
|
3188
|
+
}, [slots.title ? slots.title() : vue.createVNode("span", null, [props2.title]), renderTags(), renderTitleIcon()]), renderLabel(), props2.threeLine && renderDescription()]);
|
|
3179
3189
|
}
|
|
3180
3190
|
};
|
|
3181
3191
|
const renderValue = () => {
|
|
@@ -3363,7 +3373,8 @@
|
|
|
3363
3373
|
isLink,
|
|
3364
3374
|
required,
|
|
3365
3375
|
rightIcon,
|
|
3366
|
-
titleBold
|
|
3376
|
+
titleBold,
|
|
3377
|
+
threeLine
|
|
3367
3378
|
} = props2;
|
|
3368
3379
|
const clickable = (_a2 = props2.clickable) != null ? _a2 : isLink || rightIcon === "arrow" || hasSelect("left") || hasSelect("right");
|
|
3369
3380
|
const hasBadge = !!slots.badge || isDef(props2.badge);
|
|
@@ -3373,7 +3384,8 @@
|
|
|
3373
3384
|
required,
|
|
3374
3385
|
"title-bold": titleBold,
|
|
3375
3386
|
clickable,
|
|
3376
|
-
borderless: !border
|
|
3387
|
+
borderless: !border,
|
|
3388
|
+
"three-line": threeLine
|
|
3377
3389
|
};
|
|
3378
3390
|
if (cellSize) {
|
|
3379
3391
|
classes[cellSize] = !!cellSize;
|
|
@@ -9226,6 +9238,7 @@
|
|
|
9226
9238
|
const cellGroupProps = {
|
|
9227
9239
|
title: String,
|
|
9228
9240
|
inset: Boolean,
|
|
9241
|
+
grayCard: Boolean,
|
|
9229
9242
|
border: truthProp
|
|
9230
9243
|
};
|
|
9231
9244
|
var stdin_default$1j = vue.defineComponent({
|
|
@@ -9240,9 +9253,10 @@
|
|
|
9240
9253
|
var _a;
|
|
9241
9254
|
return vue.createVNode("div", vue.mergeProps({
|
|
9242
9255
|
"class": [bem$19({
|
|
9243
|
-
inset: props2.inset
|
|
9256
|
+
inset: props2.inset,
|
|
9257
|
+
"gray-card": props2.grayCard
|
|
9244
9258
|
}), {
|
|
9245
|
-
[BORDER_TOP_BOTTOM]: props2.border && !props2.inset
|
|
9259
|
+
[BORDER_TOP_BOTTOM]: props2.border && !props2.inset && !props2.grayCard
|
|
9246
9260
|
}]
|
|
9247
9261
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
9248
9262
|
};
|
|
@@ -16769,6 +16783,15 @@
|
|
|
16769
16783
|
const expandedSelected = vue.ref(false);
|
|
16770
16784
|
const searching = vue.ref(false);
|
|
16771
16785
|
const keyword = vue.ref("");
|
|
16786
|
+
const currentSpecialtyItems = (specialty) => specialtyType.value === 0 ? specialty.deviceItems : specialty.systemItems;
|
|
16787
|
+
const expandOnlySpecialty = () => {
|
|
16788
|
+
if (props2.specialties.length === 1) {
|
|
16789
|
+
const [specialty] = props2.specialties;
|
|
16790
|
+
expandedSpecialties.value = extend$1({}, expandedSpecialties.value, {
|
|
16791
|
+
[specialty.id]: true
|
|
16792
|
+
});
|
|
16793
|
+
}
|
|
16794
|
+
};
|
|
16772
16795
|
const reset = () => {
|
|
16773
16796
|
view.value = 0;
|
|
16774
16797
|
specialtyType.value = 0;
|
|
@@ -16778,6 +16801,7 @@
|
|
|
16778
16801
|
expandedSpecialties.value = {
|
|
16779
16802
|
"strong-electricity": true
|
|
16780
16803
|
};
|
|
16804
|
+
expandOnlySpecialty();
|
|
16781
16805
|
};
|
|
16782
16806
|
vue.watch(() => props2.show, (show) => show && reset(), {
|
|
16783
16807
|
immediate: true
|
|
@@ -16845,7 +16869,7 @@
|
|
|
16845
16869
|
const renderSpecialty = (specialty) => {
|
|
16846
16870
|
var _a;
|
|
16847
16871
|
const expanded = (_a = expandedSpecialties.value[specialty.id]) != null ? _a : false;
|
|
16848
|
-
const items =
|
|
16872
|
+
const items = currentSpecialtyItems(specialty);
|
|
16849
16873
|
return vue.createVNode("section", {
|
|
16850
16874
|
"class": bem$n("specialty"),
|
|
16851
16875
|
"key": specialty.id
|
|
@@ -16933,6 +16957,7 @@
|
|
|
16933
16957
|
"selected": specialtyType.value === 0,
|
|
16934
16958
|
"onClick": () => {
|
|
16935
16959
|
specialtyType.value = 0;
|
|
16960
|
+
expandOnlySpecialty();
|
|
16936
16961
|
}
|
|
16937
16962
|
}, {
|
|
16938
16963
|
default: () => [vue.createTextVNode("设备")]
|
|
@@ -16940,6 +16965,7 @@
|
|
|
16940
16965
|
"selected": specialtyType.value === 1,
|
|
16941
16966
|
"onClick": () => {
|
|
16942
16967
|
specialtyType.value = 1;
|
|
16968
|
+
expandOnlySpecialty();
|
|
16943
16969
|
}
|
|
16944
16970
|
}, {
|
|
16945
16971
|
default: () => [vue.createTextVNode("系统")]
|
|
@@ -19214,7 +19240,8 @@
|
|
|
19214
19240
|
showAction: Boolean,
|
|
19215
19241
|
size: makeStringProp("default"),
|
|
19216
19242
|
expandable: Boolean,
|
|
19217
|
-
modelValue: truthProp
|
|
19243
|
+
modelValue: truthProp,
|
|
19244
|
+
required: Boolean
|
|
19218
19245
|
};
|
|
19219
19246
|
var stdin_default$9 = vue.defineComponent({
|
|
19220
19247
|
name: name$4,
|
|
@@ -19251,7 +19278,8 @@
|
|
|
19251
19278
|
return vue.createVNode("section", {
|
|
19252
19279
|
"class": bem$4({
|
|
19253
19280
|
mini: props2.size === "mini",
|
|
19254
|
-
expandable: props2.expandable
|
|
19281
|
+
expandable: props2.expandable,
|
|
19282
|
+
required: props2.required
|
|
19255
19283
|
})
|
|
19256
19284
|
}, [vue.createVNode("div", {
|
|
19257
19285
|
"class": bem$4("header"),
|
|
@@ -19273,7 +19301,7 @@
|
|
|
19273
19301
|
"class": bem$4("action-divider")
|
|
19274
19302
|
}, null), vue.createVNode(Button, {
|
|
19275
19303
|
"type": "text",
|
|
19276
|
-
"size": "
|
|
19304
|
+
"size": "normal",
|
|
19277
19305
|
"text": props2.actionText,
|
|
19278
19306
|
"onClick": onActionClick
|
|
19279
19307
|
}, null)])]), props2.size !== "mini" && props2.showDescription && props2.description && vue.createVNode("span", {
|
|
@@ -19330,6 +19358,7 @@
|
|
|
19330
19358
|
return { valid, invalid };
|
|
19331
19359
|
}
|
|
19332
19360
|
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
|
19361
|
+
const VIDEO_REGEXP = /\.(mp4|webm|ogg|mov)(?:$|\?)/i;
|
|
19333
19362
|
const isImageUrl = (url) => IMAGE_REGEXP.test(url);
|
|
19334
19363
|
function isImageFile(item) {
|
|
19335
19364
|
if (item.isImage) {
|
|
@@ -19346,6 +19375,77 @@
|
|
|
19346
19375
|
}
|
|
19347
19376
|
return false;
|
|
19348
19377
|
}
|
|
19378
|
+
function isVideoFile(item) {
|
|
19379
|
+
var _a;
|
|
19380
|
+
if ((_a = item.file) == null ? void 0 : _a.type) {
|
|
19381
|
+
return item.file.type.indexOf("video/") === 0;
|
|
19382
|
+
}
|
|
19383
|
+
if (item.url) {
|
|
19384
|
+
return VIDEO_REGEXP.test(item.url);
|
|
19385
|
+
}
|
|
19386
|
+
return typeof item.content === "string" && item.content.indexOf("data:video") === 0;
|
|
19387
|
+
}
|
|
19388
|
+
function createVideoThumbnail(file) {
|
|
19389
|
+
if (typeof document === "undefined" || typeof URL === "undefined" || typeof URL.createObjectURL !== "function") {
|
|
19390
|
+
return Promise.resolve(void 0);
|
|
19391
|
+
}
|
|
19392
|
+
return new Promise((resolve) => {
|
|
19393
|
+
const video = document.createElement("video");
|
|
19394
|
+
const objectUrl = URL.createObjectURL(file);
|
|
19395
|
+
let settled = false;
|
|
19396
|
+
let timeout;
|
|
19397
|
+
const cleanup = () => {
|
|
19398
|
+
if (timeout !== void 0) {
|
|
19399
|
+
window.clearTimeout(timeout);
|
|
19400
|
+
}
|
|
19401
|
+
URL.revokeObjectURL(objectUrl);
|
|
19402
|
+
video.removeAttribute("src");
|
|
19403
|
+
try {
|
|
19404
|
+
video.load();
|
|
19405
|
+
} catch (e) {
|
|
19406
|
+
}
|
|
19407
|
+
};
|
|
19408
|
+
const done = (thumbnail) => {
|
|
19409
|
+
if (settled)
|
|
19410
|
+
return;
|
|
19411
|
+
settled = true;
|
|
19412
|
+
cleanup();
|
|
19413
|
+
resolve(thumbnail);
|
|
19414
|
+
};
|
|
19415
|
+
const captureFrame = () => {
|
|
19416
|
+
if (!video.videoWidth || !video.videoHeight) {
|
|
19417
|
+
done();
|
|
19418
|
+
return;
|
|
19419
|
+
}
|
|
19420
|
+
const canvas = document.createElement("canvas");
|
|
19421
|
+
canvas.width = video.videoWidth;
|
|
19422
|
+
canvas.height = video.videoHeight;
|
|
19423
|
+
const context = canvas.getContext("2d");
|
|
19424
|
+
if (!context) {
|
|
19425
|
+
done();
|
|
19426
|
+
return;
|
|
19427
|
+
}
|
|
19428
|
+
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
19429
|
+
done(canvas.toDataURL("image/jpeg", 0.8));
|
|
19430
|
+
};
|
|
19431
|
+
video.muted = true;
|
|
19432
|
+
video.playsInline = true;
|
|
19433
|
+
video.preload = "auto";
|
|
19434
|
+
video.onloadedmetadata = () => {
|
|
19435
|
+
const duration = Number.isFinite(video.duration) ? video.duration : 0.1;
|
|
19436
|
+
const frameTime = Math.min(0.1, Math.max(duration - 0.01, 0));
|
|
19437
|
+
if (frameTime) {
|
|
19438
|
+
video.currentTime = frameTime;
|
|
19439
|
+
} else {
|
|
19440
|
+
captureFrame();
|
|
19441
|
+
}
|
|
19442
|
+
};
|
|
19443
|
+
video.onseeked = captureFrame;
|
|
19444
|
+
video.onerror = () => done();
|
|
19445
|
+
video.src = objectUrl;
|
|
19446
|
+
timeout = window.setTimeout(() => done(), 3e3);
|
|
19447
|
+
});
|
|
19448
|
+
}
|
|
19349
19449
|
var stdin_default$8 = vue.defineComponent({
|
|
19350
19450
|
props: {
|
|
19351
19451
|
name: numericProp,
|
|
@@ -19357,7 +19457,7 @@
|
|
|
19357
19457
|
previewSize: [Number, String, Array],
|
|
19358
19458
|
beforeDelete: Function
|
|
19359
19459
|
},
|
|
19360
|
-
emits: ["delete", "preview"],
|
|
19460
|
+
emits: ["delete", "preview", "click"],
|
|
19361
19461
|
setup(props2, {
|
|
19362
19462
|
emit,
|
|
19363
19463
|
slots
|
|
@@ -19398,7 +19498,11 @@
|
|
|
19398
19498
|
done: () => emit("delete")
|
|
19399
19499
|
});
|
|
19400
19500
|
};
|
|
19401
|
-
const onPreview = () =>
|
|
19501
|
+
const onPreview = () => {
|
|
19502
|
+
emit("preview");
|
|
19503
|
+
emit("click");
|
|
19504
|
+
};
|
|
19505
|
+
const onFilePreview = () => emit("click");
|
|
19402
19506
|
const renderDeleteIcon = () => {
|
|
19403
19507
|
if (props2.deletable && props2.item.status !== "uploading") {
|
|
19404
19508
|
const slot = slots["preview-delete"];
|
|
@@ -19436,10 +19540,12 @@
|
|
|
19436
19540
|
imageFit,
|
|
19437
19541
|
previewSize
|
|
19438
19542
|
} = props2;
|
|
19439
|
-
|
|
19543
|
+
const isImage2 = isImageFile(item);
|
|
19544
|
+
const isVideo = isVideoFile(item);
|
|
19545
|
+
if (isImage2 || isVideo && item.videoThumbnail) {
|
|
19440
19546
|
return vue.createVNode(Image$1, {
|
|
19441
19547
|
"fit": imageFit,
|
|
19442
|
-
"src": item.content || item.url,
|
|
19548
|
+
"src": isVideo ? item.videoThumbnail : item.content || item.url,
|
|
19443
19549
|
"class": bem$3("preview-image"),
|
|
19444
19550
|
"width": Array.isArray(previewSize) ? previewSize[0] : previewSize,
|
|
19445
19551
|
"height": Array.isArray(previewSize) ? previewSize[1] : previewSize,
|
|
@@ -19451,7 +19557,8 @@
|
|
|
19451
19557
|
}
|
|
19452
19558
|
return vue.createVNode("div", {
|
|
19453
19559
|
"class": bem$3("file"),
|
|
19454
|
-
"style": getSizeStyle(props2.previewSize)
|
|
19560
|
+
"style": getSizeStyle(props2.previewSize),
|
|
19561
|
+
"onClick": onFilePreview
|
|
19455
19562
|
}, [vue.createVNode(Icon, {
|
|
19456
19563
|
"class": bem$3("file-icon"),
|
|
19457
19564
|
"name": "description"
|
|
@@ -19464,11 +19571,33 @@
|
|
|
19464
19571
|
}, [renderPreview(), renderMask(), renderDeleteIcon()]);
|
|
19465
19572
|
}
|
|
19466
19573
|
});
|
|
19574
|
+
var __async$1 = (__this, __arguments, generator) => {
|
|
19575
|
+
return new Promise((resolve, reject) => {
|
|
19576
|
+
var fulfilled = (value) => {
|
|
19577
|
+
try {
|
|
19578
|
+
step(generator.next(value));
|
|
19579
|
+
} catch (e) {
|
|
19580
|
+
reject(e);
|
|
19581
|
+
}
|
|
19582
|
+
};
|
|
19583
|
+
var rejected = (value) => {
|
|
19584
|
+
try {
|
|
19585
|
+
step(generator.throw(value));
|
|
19586
|
+
} catch (e) {
|
|
19587
|
+
reject(e);
|
|
19588
|
+
}
|
|
19589
|
+
};
|
|
19590
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19591
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19592
|
+
});
|
|
19593
|
+
};
|
|
19467
19594
|
const uploaderProps = {
|
|
19468
19595
|
name: makeNumericProp(""),
|
|
19469
19596
|
accept: makeStringProp("image/*"),
|
|
19470
19597
|
capture: String,
|
|
19471
19598
|
multiple: Boolean,
|
|
19599
|
+
label: String,
|
|
19600
|
+
required: Boolean,
|
|
19472
19601
|
disabled: Boolean,
|
|
19473
19602
|
readonly: Boolean,
|
|
19474
19603
|
lazyLoad: Boolean,
|
|
@@ -19538,37 +19667,29 @@
|
|
|
19538
19667
|
modelValue,
|
|
19539
19668
|
resultType
|
|
19540
19669
|
} = props2;
|
|
19670
|
+
const createFileItem = (file) => __async$1(this, null, function* () {
|
|
19671
|
+
const content = yield readFileContent(file, resultType);
|
|
19672
|
+
const result = {
|
|
19673
|
+
file,
|
|
19674
|
+
status: "",
|
|
19675
|
+
message: ""
|
|
19676
|
+
};
|
|
19677
|
+
if (content) {
|
|
19678
|
+
result.content = content;
|
|
19679
|
+
}
|
|
19680
|
+
if (isVideoFile(result)) {
|
|
19681
|
+
result.videoThumbnail = yield createVideoThumbnail(file);
|
|
19682
|
+
}
|
|
19683
|
+
return result;
|
|
19684
|
+
});
|
|
19541
19685
|
if (Array.isArray(files)) {
|
|
19542
19686
|
const remainCount = +maxCount - modelValue.length;
|
|
19543
19687
|
if (files.length > remainCount) {
|
|
19544
19688
|
files = files.slice(0, remainCount);
|
|
19545
19689
|
}
|
|
19546
|
-
Promise.all(files.map(
|
|
19547
|
-
const fileList = files.map((file, index) => {
|
|
19548
|
-
const result = {
|
|
19549
|
-
file,
|
|
19550
|
-
status: "",
|
|
19551
|
-
message: ""
|
|
19552
|
-
};
|
|
19553
|
-
if (contents[index]) {
|
|
19554
|
-
result.content = contents[index];
|
|
19555
|
-
}
|
|
19556
|
-
return result;
|
|
19557
|
-
});
|
|
19558
|
-
onAfterRead(fileList);
|
|
19559
|
-
});
|
|
19690
|
+
Promise.all(files.map(createFileItem)).then(onAfterRead);
|
|
19560
19691
|
} else {
|
|
19561
|
-
|
|
19562
|
-
const result = {
|
|
19563
|
-
file: files,
|
|
19564
|
-
status: "",
|
|
19565
|
-
message: ""
|
|
19566
|
-
};
|
|
19567
|
-
if (content) {
|
|
19568
|
-
result.content = content;
|
|
19569
|
-
}
|
|
19570
|
-
onAfterRead(result);
|
|
19571
|
-
});
|
|
19692
|
+
createFileItem(files).then(onAfterRead);
|
|
19572
19693
|
}
|
|
19573
19694
|
};
|
|
19574
19695
|
const onChange = (event) => {
|
|
@@ -19601,7 +19722,7 @@
|
|
|
19601
19722
|
let imagePreview;
|
|
19602
19723
|
const onClosePreview = () => emit("close-preview");
|
|
19603
19724
|
const previewImage = (item) => {
|
|
19604
|
-
if (props2.previewFullImage) {
|
|
19725
|
+
if (props2.previewFullImage && isImageFile(item)) {
|
|
19605
19726
|
const imageFiles = props2.modelValue.filter(isImageFile);
|
|
19606
19727
|
const images = imageFiles.map((item2) => {
|
|
19607
19728
|
if (item2.file && !item2.url && item2.status !== "failed") {
|
|
@@ -19644,6 +19765,15 @@
|
|
|
19644
19765
|
return props2.modelValue.map(renderPreviewItem);
|
|
19645
19766
|
}
|
|
19646
19767
|
};
|
|
19768
|
+
const renderLabel = () => {
|
|
19769
|
+
if (!props2.label)
|
|
19770
|
+
return;
|
|
19771
|
+
return vue.createVNode("div", {
|
|
19772
|
+
"class": bem$3("label")
|
|
19773
|
+
}, [props2.required && vue.createVNode("span", {
|
|
19774
|
+
"class": bem$3("required")
|
|
19775
|
+
}, [vue.createTextVNode("*")]), props2.label]);
|
|
19776
|
+
};
|
|
19647
19777
|
const onClickUpload = (event) => emit("click-upload", event);
|
|
19648
19778
|
const renderUpload = () => {
|
|
19649
19779
|
if (props2.modelValue.length >= props2.maxCount || !props2.showUpload) {
|
|
@@ -19692,8 +19822,10 @@
|
|
|
19692
19822
|
});
|
|
19693
19823
|
useCustomFieldValue(() => props2.modelValue);
|
|
19694
19824
|
return () => vue.createVNode("div", {
|
|
19695
|
-
"class": bem$3(
|
|
19696
|
-
|
|
19825
|
+
"class": bem$3({
|
|
19826
|
+
required: props2.required && !props2.label
|
|
19827
|
+
})
|
|
19828
|
+
}, [renderLabel(), vue.createVNode("div", {
|
|
19697
19829
|
"class": bem$3("wrapper", {
|
|
19698
19830
|
disabled: props2.disabled
|
|
19699
19831
|
})
|
|
@@ -23937,7 +24069,7 @@
|
|
|
23937
24069
|
});
|
|
23938
24070
|
}
|
|
23939
24071
|
};
|
|
23940
|
-
const version = "0.0.
|
|
24072
|
+
const version = "0.0.37";
|
|
23941
24073
|
function install(app) {
|
|
23942
24074
|
const components = [
|
|
23943
24075
|
ActionBar,
|