persagy-vant 0.0.35 → 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/label/Label.d.ts +11 -1
- package/es/label/Label.mjs +34 -3
- package/es/label/index.css +1 -1
- package/es/label/index.d.ts +6 -2
- package/es/label/index.less +22 -0
- package/es/label/var.less +1 -0
- package/es/loading/index.css +1 -1
- package/es/loading/index.less +1 -1
- package/es/material-action-bar/MaterialActionBar.d.ts +15 -0
- package/es/material-action-bar/MaterialActionBar.mjs +107 -58
- package/es/material-action-bar/index.css +1 -1
- package/es/material-action-bar/index.d.ts +76 -2
- package/es/material-action-bar/index.less +6 -2
- package/es/material-action-bar/index.mjs +4 -2
- package/es/material-action-bar/style/index.mjs +1 -0
- package/es/material-action-bar/style/less.mjs +1 -0
- package/es/material-add/index.css +1 -1
- package/es/material-add/style/index.mjs +1 -0
- package/es/material-add/style/less.mjs +1 -0
- package/es/material-display-bar/MaterialDisplayBar.d.ts +2 -1
- package/es/material-display-bar/MaterialDisplayBar.mjs +4 -3
- package/es/material-display-bar/index.css +1 -1
- package/es/material-display-bar/index.d.ts +105 -4
- package/es/material-display-bar/index.mjs +5 -3
- package/es/material-display-bar/var.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/tag/Tag.d.ts +15 -2
- package/es/tag/Tag.mjs +20 -3
- package/es/tag/index.css +1 -1
- package/es/tag/index.d.ts +9 -0
- package/es/tag/index.less +45 -1
- package/es/tag/var.less +13 -0
- package/es/title-bar/TitleBar.d.ts +34 -12
- package/es/title-bar/TitleBar.mjs +42 -10
- package/es/title-bar/index.css +1 -1
- package/es/title-bar/index.d.ts +18 -2
- package/es/title-bar/index.less +15 -2
- package/es/title-bar/style/index.mjs +2 -0
- package/es/title-bar/style/less.mjs +2 -0
- package/es/title-bar/var.less +6 -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/index.less +1 -1
- package/lib/label/Label.d.ts +11 -1
- package/lib/label/Label.js +34 -3
- package/lib/label/index.css +1 -1
- package/lib/label/index.d.ts +6 -2
- package/lib/label/index.less +22 -0
- package/lib/label/var.less +1 -0
- package/lib/loading/index.css +1 -1
- package/lib/loading/index.less +1 -1
- package/lib/material-action-bar/MaterialActionBar.d.ts +15 -0
- package/lib/material-action-bar/MaterialActionBar.js +106 -57
- package/lib/material-action-bar/index.css +1 -1
- package/lib/material-action-bar/index.d.ts +76 -2
- package/lib/material-action-bar/index.js +4 -2
- package/lib/material-action-bar/index.less +6 -2
- package/lib/material-action-bar/style/index.js +1 -0
- package/lib/material-action-bar/style/less.js +1 -0
- package/lib/material-add/index.css +1 -1
- package/lib/material-add/style/index.js +1 -0
- package/lib/material-add/style/less.js +1 -0
- package/lib/material-display-bar/MaterialDisplayBar.d.ts +2 -1
- package/lib/material-display-bar/MaterialDisplayBar.js +4 -3
- package/lib/material-display-bar/index.css +1 -1
- package/lib/material-display-bar/index.d.ts +105 -4
- package/lib/material-display-bar/index.js +5 -3
- package/lib/material-display-bar/var.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/tag/Tag.d.ts +15 -2
- package/lib/tag/Tag.js +20 -3
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.d.ts +9 -0
- package/lib/tag/index.less +45 -1
- package/lib/tag/var.less +13 -0
- package/lib/title-bar/TitleBar.d.ts +34 -12
- package/lib/title-bar/TitleBar.js +42 -10
- package/lib/title-bar/index.css +1 -1
- package/lib/title-bar/index.d.ts +18 -2
- package/lib/title-bar/index.less +15 -2
- package/lib/title-bar/style/index.js +2 -0
- package/lib/title-bar/style/less.js +2 -0
- package/lib/title-bar/var.less +6 -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 +382 -120
- package/lib/vant.es.js +382 -120
- package/lib/vant.js +382 -120
- 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.es.js
CHANGED
|
@@ -2720,6 +2720,8 @@ const cellSharedProps = {
|
|
|
2720
2720
|
title: numericProp,
|
|
2721
2721
|
value: numericProp,
|
|
2722
2722
|
label: numericProp,
|
|
2723
|
+
description: numericProp,
|
|
2724
|
+
threeLine: Boolean,
|
|
2723
2725
|
labelSize: numericProp,
|
|
2724
2726
|
avatar: String,
|
|
2725
2727
|
rightAvatar: String,
|
|
@@ -2819,6 +2821,14 @@ var stdin_default$1O = defineComponent({
|
|
|
2819
2821
|
}, [slots.label ? slots.label() : props2.label]);
|
|
2820
2822
|
}
|
|
2821
2823
|
};
|
|
2824
|
+
const renderDescription = () => {
|
|
2825
|
+
const showDescription = slots.description || isDef(props2.description);
|
|
2826
|
+
if (showDescription) {
|
|
2827
|
+
return createVNode("div", {
|
|
2828
|
+
"class": bem$1B("description")
|
|
2829
|
+
}, [slots.description ? slots.description() : props2.description]);
|
|
2830
|
+
}
|
|
2831
|
+
};
|
|
2822
2832
|
const renderTitle = () => {
|
|
2823
2833
|
if (slots.title || isDef(props2.title)) {
|
|
2824
2834
|
return createVNode("div", {
|
|
@@ -2826,7 +2836,7 @@ var stdin_default$1O = defineComponent({
|
|
|
2826
2836
|
"style": props2.titleStyle
|
|
2827
2837
|
}, [createVNode("div", {
|
|
2828
2838
|
"class": bem$1B("title-row")
|
|
2829
|
-
}, [slots.title ? slots.title() : createVNode("span", null, [props2.title]), renderTags(), renderTitleIcon()]), renderLabel()]);
|
|
2839
|
+
}, [slots.title ? slots.title() : createVNode("span", null, [props2.title]), renderTags(), renderTitleIcon()]), renderLabel(), props2.threeLine && renderDescription()]);
|
|
2830
2840
|
}
|
|
2831
2841
|
};
|
|
2832
2842
|
const renderValue = () => {
|
|
@@ -3014,7 +3024,8 @@ var stdin_default$1O = defineComponent({
|
|
|
3014
3024
|
isLink,
|
|
3015
3025
|
required,
|
|
3016
3026
|
rightIcon,
|
|
3017
|
-
titleBold
|
|
3027
|
+
titleBold,
|
|
3028
|
+
threeLine
|
|
3018
3029
|
} = props2;
|
|
3019
3030
|
const clickable = (_a2 = props2.clickable) != null ? _a2 : isLink || rightIcon === "arrow" || hasSelect("left") || hasSelect("right");
|
|
3020
3031
|
const hasBadge = !!slots.badge || isDef(props2.badge);
|
|
@@ -3024,7 +3035,8 @@ var stdin_default$1O = defineComponent({
|
|
|
3024
3035
|
required,
|
|
3025
3036
|
"title-bold": titleBold,
|
|
3026
3037
|
clickable,
|
|
3027
|
-
borderless: !border
|
|
3038
|
+
borderless: !border,
|
|
3039
|
+
"three-line": threeLine
|
|
3028
3040
|
};
|
|
3029
3041
|
if (cellSize) {
|
|
3030
3042
|
classes[cellSize] = !!cellSize;
|
|
@@ -4543,7 +4555,11 @@ const tagProps = {
|
|
|
4543
4555
|
plain: Boolean,
|
|
4544
4556
|
round: Boolean,
|
|
4545
4557
|
textColor: String,
|
|
4546
|
-
closeable: Boolean
|
|
4558
|
+
closeable: Boolean,
|
|
4559
|
+
rightIcon: String,
|
|
4560
|
+
number: [String, Number],
|
|
4561
|
+
showNumber: Boolean,
|
|
4562
|
+
numberColor: String
|
|
4547
4563
|
};
|
|
4548
4564
|
var stdin_default$1H = defineComponent({
|
|
4549
4565
|
name: name$1y,
|
|
@@ -4577,7 +4593,11 @@ var stdin_default$1H = defineComponent({
|
|
|
4577
4593
|
plain,
|
|
4578
4594
|
round,
|
|
4579
4595
|
size,
|
|
4580
|
-
closeable
|
|
4596
|
+
closeable,
|
|
4597
|
+
rightIcon,
|
|
4598
|
+
number,
|
|
4599
|
+
showNumber,
|
|
4600
|
+
numberColor
|
|
4581
4601
|
} = props2;
|
|
4582
4602
|
const classes = {
|
|
4583
4603
|
mark,
|
|
@@ -4592,10 +4612,19 @@ var stdin_default$1H = defineComponent({
|
|
|
4592
4612
|
"class": [bem$1u("close"), HAPTICS_FEEDBACK],
|
|
4593
4613
|
"onClick": onClose
|
|
4594
4614
|
}, null);
|
|
4615
|
+
const RightIcon = rightIcon && createVNode(Icon, {
|
|
4616
|
+
"name": rightIcon,
|
|
4617
|
+
"class": bem$1u("right-icon")
|
|
4618
|
+
}, null);
|
|
4595
4619
|
return createVNode("span", {
|
|
4596
4620
|
"style": getStyle(),
|
|
4597
4621
|
"class": bem$1u([classes, type])
|
|
4598
|
-
}, [
|
|
4622
|
+
}, [showNumber && number !== void 0 && createVNode("span", {
|
|
4623
|
+
"class": bem$1u("number"),
|
|
4624
|
+
"style": {
|
|
4625
|
+
color: numberColor
|
|
4626
|
+
}
|
|
4627
|
+
}, [number]), (_a = slots.default) == null ? void 0 : _a.call(slots), RightIcon, CloseIcon]);
|
|
4599
4628
|
};
|
|
4600
4629
|
return () => createVNode(Transition, {
|
|
4601
4630
|
"name": props2.closeable ? "van-fade" : void 0
|
|
@@ -7985,6 +8014,7 @@ const [name$1a, bem$19] = createNamespace("cell-group");
|
|
|
7985
8014
|
const cellGroupProps = {
|
|
7986
8015
|
title: String,
|
|
7987
8016
|
inset: Boolean,
|
|
8017
|
+
grayCard: Boolean,
|
|
7988
8018
|
border: truthProp
|
|
7989
8019
|
};
|
|
7990
8020
|
var stdin_default$1j = defineComponent({
|
|
@@ -7999,9 +8029,10 @@ var stdin_default$1j = defineComponent({
|
|
|
7999
8029
|
var _a;
|
|
8000
8030
|
return createVNode("div", mergeProps({
|
|
8001
8031
|
"class": [bem$19({
|
|
8002
|
-
inset: props2.inset
|
|
8032
|
+
inset: props2.inset,
|
|
8033
|
+
"gray-card": props2.grayCard
|
|
8003
8034
|
}), {
|
|
8004
|
-
[BORDER_TOP_BOTTOM]: props2.border && !props2.inset
|
|
8035
|
+
[BORDER_TOP_BOTTOM]: props2.border && !props2.inset && !props2.grayCard
|
|
8005
8036
|
}]
|
|
8006
8037
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
8007
8038
|
};
|
|
@@ -12067,6 +12098,7 @@ const labelProps = {
|
|
|
12067
12098
|
size: makeStringProp("default"),
|
|
12068
12099
|
contentAlign: makeStringProp("follow"),
|
|
12069
12100
|
vertical: Boolean,
|
|
12101
|
+
ellipsis: Boolean,
|
|
12070
12102
|
href: String,
|
|
12071
12103
|
location: String,
|
|
12072
12104
|
tags: {
|
|
@@ -12081,12 +12113,14 @@ const labelProps = {
|
|
|
12081
12113
|
var stdin_default$M = defineComponent({
|
|
12082
12114
|
name: name$E,
|
|
12083
12115
|
props: labelProps,
|
|
12084
|
-
emits: ["click", "click-media"],
|
|
12116
|
+
emits: ["click", "click-media", "long-press"],
|
|
12085
12117
|
setup(props2, {
|
|
12086
12118
|
slots,
|
|
12087
12119
|
emit
|
|
12088
12120
|
}) {
|
|
12121
|
+
let longPressTimer;
|
|
12089
12122
|
const vertical = computed(() => props2.vertical || props2.type === "media");
|
|
12123
|
+
const ellipsis = computed(() => props2.ellipsis && !vertical.value && !["tag", "media"].includes(props2.type));
|
|
12090
12124
|
const displayLabel = computed(() => {
|
|
12091
12125
|
var _a;
|
|
12092
12126
|
const showColon = (_a = props2.showColon) != null ? _a : !vertical.value && props2.contentAlign !== "right";
|
|
@@ -12096,6 +12130,25 @@ var stdin_default$M = defineComponent({
|
|
|
12096
12130
|
return `${props2.label}:`;
|
|
12097
12131
|
});
|
|
12098
12132
|
const showLocation = computed(() => props2.vertical && (props2.type === "bold" || props2.type === "link") && !!props2.location);
|
|
12133
|
+
const clearLongPress = () => {
|
|
12134
|
+
if (longPressTimer !== void 0) {
|
|
12135
|
+
clearTimeout(longPressTimer);
|
|
12136
|
+
longPressTimer = void 0;
|
|
12137
|
+
}
|
|
12138
|
+
};
|
|
12139
|
+
const startLongPress = (target, text) => {
|
|
12140
|
+
if (!ellipsis.value || !text)
|
|
12141
|
+
return;
|
|
12142
|
+
clearLongPress();
|
|
12143
|
+
longPressTimer = setTimeout(() => {
|
|
12144
|
+
longPressTimer = void 0;
|
|
12145
|
+
const payload = {
|
|
12146
|
+
target,
|
|
12147
|
+
text
|
|
12148
|
+
};
|
|
12149
|
+
emit("long-press", payload);
|
|
12150
|
+
}, 500);
|
|
12151
|
+
};
|
|
12099
12152
|
const renderText = () => {
|
|
12100
12153
|
var _a;
|
|
12101
12154
|
const content = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || props2.content;
|
|
@@ -12148,13 +12201,22 @@ var stdin_default$M = defineComponent({
|
|
|
12148
12201
|
"class": bem$E([props2.type, {
|
|
12149
12202
|
mini: props2.size === "mini",
|
|
12150
12203
|
vertical: vertical.value,
|
|
12204
|
+
ellipsis: ellipsis.value,
|
|
12151
12205
|
location: showLocation.value,
|
|
12152
12206
|
"content-right": props2.contentAlign === "right"
|
|
12153
12207
|
}])
|
|
12154
12208
|
}, [props2.showLabel && createVNode("span", {
|
|
12155
|
-
"class": bem$E("label")
|
|
12209
|
+
"class": bem$E("label"),
|
|
12210
|
+
"onPointerdown": () => startLongPress("label", displayLabel.value),
|
|
12211
|
+
"onPointerup": clearLongPress,
|
|
12212
|
+
"onPointercancel": clearLongPress,
|
|
12213
|
+
"onPointerleave": clearLongPress
|
|
12156
12214
|
}, [displayLabel.value]), props2.showContent && createVNode("div", {
|
|
12157
|
-
"class": bem$E("value")
|
|
12215
|
+
"class": bem$E("value"),
|
|
12216
|
+
"onPointerdown": () => startLongPress("content", props2.content),
|
|
12217
|
+
"onPointerup": clearLongPress,
|
|
12218
|
+
"onPointercancel": clearLongPress,
|
|
12219
|
+
"onPointerleave": clearLongPress
|
|
12158
12220
|
}, [renderContent(), showLocation.value && createVNode("div", {
|
|
12159
12221
|
"class": bem$E("location")
|
|
12160
12222
|
}, [createVNode(Icon, {
|
|
@@ -13194,14 +13256,20 @@ var stdin_default$E = defineComponent({
|
|
|
13194
13256
|
warning: {
|
|
13195
13257
|
type: String,
|
|
13196
13258
|
default: ""
|
|
13259
|
+
},
|
|
13260
|
+
picking: {
|
|
13261
|
+
type: Object,
|
|
13262
|
+
default: void 0
|
|
13197
13263
|
}
|
|
13198
13264
|
},
|
|
13199
13265
|
emits: ["update:modelValue", "detail"],
|
|
13200
13266
|
setup(props2, {
|
|
13267
|
+
slots,
|
|
13201
13268
|
emit
|
|
13202
13269
|
}) {
|
|
13203
13270
|
const showInputDialog = ref(false);
|
|
13204
13271
|
const inputValue = ref("");
|
|
13272
|
+
let detailLongPressTimer;
|
|
13205
13273
|
const openInputDialog = () => {
|
|
13206
13274
|
if (!props2.enableInputDialog)
|
|
13207
13275
|
return;
|
|
@@ -13214,6 +13282,25 @@ var stdin_default$E = defineComponent({
|
|
|
13214
13282
|
emit("update:modelValue", Math.max(0, value));
|
|
13215
13283
|
}
|
|
13216
13284
|
};
|
|
13285
|
+
const clearDetailLongPress = () => {
|
|
13286
|
+
if (detailLongPressTimer) {
|
|
13287
|
+
clearTimeout(detailLongPressTimer);
|
|
13288
|
+
detailLongPressTimer = void 0;
|
|
13289
|
+
}
|
|
13290
|
+
};
|
|
13291
|
+
const onDetailLongPressStart = (event) => {
|
|
13292
|
+
const target = event.currentTarget;
|
|
13293
|
+
if (target.scrollWidth <= target.clientWidth) {
|
|
13294
|
+
return;
|
|
13295
|
+
}
|
|
13296
|
+
clearDetailLongPress();
|
|
13297
|
+
detailLongPressTimer = setTimeout(() => {
|
|
13298
|
+
Toast({
|
|
13299
|
+
message: props2.item.detail,
|
|
13300
|
+
position: "middle"
|
|
13301
|
+
});
|
|
13302
|
+
}, 500);
|
|
13303
|
+
};
|
|
13217
13304
|
const highlight = (text) => {
|
|
13218
13305
|
const query = props2.keyword.trim();
|
|
13219
13306
|
if (!query)
|
|
@@ -13236,67 +13323,91 @@ var stdin_default$E = defineComponent({
|
|
|
13236
13323
|
parts.push(text.slice(start));
|
|
13237
13324
|
return parts;
|
|
13238
13325
|
};
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
"
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
"
|
|
13262
|
-
|
|
13263
|
-
"
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
"
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
},
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
"
|
|
13295
|
-
|
|
13326
|
+
onBeforeUnmount(clearDetailLongPress);
|
|
13327
|
+
return () => {
|
|
13328
|
+
var _a, _b, _c, _d, _e;
|
|
13329
|
+
return createVNode("div", {
|
|
13330
|
+
"class": bem$x({
|
|
13331
|
+
selected: props2.selected
|
|
13332
|
+
})
|
|
13333
|
+
}, [createVNode("div", {
|
|
13334
|
+
"class": bem$x("main")
|
|
13335
|
+
}, [createVNode("button", {
|
|
13336
|
+
"type": "button",
|
|
13337
|
+
"class": bem$x("detail"),
|
|
13338
|
+
"onClick": () => emit("detail", props2.item)
|
|
13339
|
+
}, [createVNode("span", null, [highlight(props2.item.name)]), props2.selected && props2.item.kind && createVNode(Tag, {
|
|
13340
|
+
"class": bem$x("kind-tag"),
|
|
13341
|
+
"color": props2.item.kind === "material" ? "#d9ebff" : "#d9f7f7",
|
|
13342
|
+
"textColor": props2.item.kind === "material" ? "var(--van-primary-color)" : "#00aeb3"
|
|
13343
|
+
}, {
|
|
13344
|
+
default: () => [props2.item.kind === "material" ? "物资" : "工具"]
|
|
13345
|
+
}), createVNode(Icon, {
|
|
13346
|
+
"name": "arrow",
|
|
13347
|
+
"size": "12"
|
|
13348
|
+
}, null)]), (((_a = props2.picking) == null ? void 0 : _a.quantityLabel) || slots["stepper-prefix"]) && createVNode("div", {
|
|
13349
|
+
"class": bem$x("stepper-prefix")
|
|
13350
|
+
}, [((_b = props2.picking) == null ? void 0 : _b.quantityLabel) || ((_c = slots["stepper-prefix"]) == null ? void 0 : _c.call(slots))]), createVNode("div", {
|
|
13351
|
+
"class": bem$x("stepper-wrapper")
|
|
13352
|
+
}, [createVNode(Stepper, {
|
|
13353
|
+
"class": bem$x("stepper"),
|
|
13354
|
+
"modelValue": props2.modelValue,
|
|
13355
|
+
"min": 0,
|
|
13356
|
+
"theme": "round",
|
|
13357
|
+
"buttonSize": 18,
|
|
13358
|
+
"disableInput": true,
|
|
13359
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", Number(value))
|
|
13360
|
+
}, null), props2.enableInputDialog && createVNode("button", {
|
|
13361
|
+
"type": "button",
|
|
13362
|
+
"class": bem$x("number-trigger"),
|
|
13363
|
+
"aria-label": "输入数量",
|
|
13364
|
+
"onClick": openInputDialog
|
|
13365
|
+
}, null)]), createVNode("span", {
|
|
13366
|
+
"class": bem$x("unit")
|
|
13367
|
+
}, [props2.item.unit])]), createVNode("p", {
|
|
13368
|
+
"class": bem$x("desc"),
|
|
13369
|
+
"onTouchstart": onDetailLongPressStart,
|
|
13370
|
+
"onTouchmove": clearDetailLongPress,
|
|
13371
|
+
"onTouchend": clearDetailLongPress,
|
|
13372
|
+
"onTouchcancel": clearDetailLongPress,
|
|
13373
|
+
"onMousedown": onDetailLongPressStart,
|
|
13374
|
+
"onMousemove": clearDetailLongPress,
|
|
13375
|
+
"onMouseup": clearDetailLongPress,
|
|
13376
|
+
"onMouseleave": clearDetailLongPress
|
|
13377
|
+
}, [highlight(props2.item.detail)]), props2.showWarning && props2.warning && createVNode("p", {
|
|
13378
|
+
"class": bem$x("warning")
|
|
13379
|
+
}, [props2.warning]), ((_d = props2.picking) == null ? void 0 : _d.outboundValue) !== void 0 && createVNode("p", {
|
|
13380
|
+
"class": bem$x("picking-outbound")
|
|
13381
|
+
}, [createVNode("span", {
|
|
13382
|
+
"class": bem$x("picking-label")
|
|
13383
|
+
}, [props2.picking.outboundLabel || "应出:"]), createVNode("span", {
|
|
13384
|
+
"class": bem$x("picking-value"),
|
|
13385
|
+
"style": {
|
|
13386
|
+
fontWeight: props2.picking.outboundBold ? 600 : 400
|
|
13387
|
+
}
|
|
13388
|
+
}, [props2.picking.outboundValue])]), (_e = slots.default) == null ? void 0 : _e.call(slots), createVNode(Dialog.Component, {
|
|
13389
|
+
"show": showInputDialog.value,
|
|
13390
|
+
"inputValue": inputValue.value,
|
|
13391
|
+
"inputAlign": "left",
|
|
13392
|
+
"title": "输入数量",
|
|
13393
|
+
"inputPlaceholder": "请输入数量",
|
|
13394
|
+
"inputAutofocus": true,
|
|
13395
|
+
"showInput": true,
|
|
13396
|
+
"showCancelButton": true,
|
|
13397
|
+
"onUpdate:show": (value) => {
|
|
13398
|
+
showInputDialog.value = value;
|
|
13399
|
+
},
|
|
13400
|
+
"onUpdate:inputValue": (value) => {
|
|
13401
|
+
inputValue.value = value;
|
|
13402
|
+
},
|
|
13403
|
+
"onConfirm": confirmInputValue
|
|
13404
|
+
}, null)]);
|
|
13405
|
+
};
|
|
13296
13406
|
}
|
|
13297
13407
|
});
|
|
13298
|
-
const
|
|
13299
|
-
|
|
13408
|
+
const MaterialActionList = withInstall(stdin_default$E);
|
|
13409
|
+
const MaterialActionBar = MaterialActionList;
|
|
13410
|
+
var stdin_default$D = MaterialActionList;
|
|
13300
13411
|
const [name$w, bem$w] = createNamespace("material-detail");
|
|
13301
13412
|
const defaultImages = ["/dog1.jpg", "/dog2.jpg", "/dog3.jpg"];
|
|
13302
13413
|
const materialDetailProps = {
|
|
@@ -14226,6 +14337,7 @@ var stdin_default$y = defineComponent({
|
|
|
14226
14337
|
"label": field.label,
|
|
14227
14338
|
"showLabel": field.showLabel,
|
|
14228
14339
|
"showContent": field.showContent,
|
|
14340
|
+
"showColon": field.showColon,
|
|
14229
14341
|
"content": field.content,
|
|
14230
14342
|
"type": field.type,
|
|
14231
14343
|
"vertical": field.vertical,
|
|
@@ -14241,7 +14353,7 @@ var stdin_default$y = defineComponent({
|
|
|
14241
14353
|
route2();
|
|
14242
14354
|
};
|
|
14243
14355
|
const renderBar = () => {
|
|
14244
|
-
var _a, _b, _c;
|
|
14356
|
+
var _a, _b, _c, _d;
|
|
14245
14357
|
return createVNode("section", {
|
|
14246
14358
|
"class": bem$t({
|
|
14247
14359
|
rounded: props2.rounded
|
|
@@ -14263,12 +14375,12 @@ var stdin_default$y = defineComponent({
|
|
|
14263
14375
|
"class": bem$t("quantity")
|
|
14264
14376
|
}, [((_b = slots.quantity) == null ? void 0 : _b.call(slots)) || createVNode(Fragment, null, [props2.quantityLabel && createVNode("span", {
|
|
14265
14377
|
"class": bem$t("quantity-label")
|
|
14266
|
-
}, [props2.quantityLabel]), createVNode("strong", null, [props2.quantity]), props2.unit && createVNode("span", null, [props2.unit])])])]), props2.fields.filter((field) => field.visible !== false).length > 0 && createVNode("div", {
|
|
14378
|
+
}, [props2.quantityLabel]), createVNode("strong", null, [props2.quantity]), props2.unit && createVNode("span", null, [props2.unit])]), (_c = slots["quantity-suffix"]) == null ? void 0 : _c.call(slots)])]), props2.fields.filter((field) => field.visible !== false).length > 0 && createVNode("div", {
|
|
14267
14379
|
"class": bem$t("fields")
|
|
14268
14380
|
}, [props2.fields.map(renderField)])]), props2.divider && createVNode(Divider, {
|
|
14269
14381
|
"hairline": true,
|
|
14270
14382
|
"class": bem$t("divider")
|
|
14271
|
-
}, null), ((
|
|
14383
|
+
}, null), ((_d = slots.default) == null ? void 0 : _d.call(slots)) && createVNode("div", {
|
|
14272
14384
|
"class": bem$t("bottom")
|
|
14273
14385
|
}, [slots.default()])]);
|
|
14274
14386
|
};
|
|
@@ -14288,8 +14400,9 @@ var stdin_default$y = defineComponent({
|
|
|
14288
14400
|
}) : renderBar();
|
|
14289
14401
|
}
|
|
14290
14402
|
});
|
|
14291
|
-
const
|
|
14292
|
-
const
|
|
14403
|
+
const MaterialPreviewList = withInstall(stdin_default$y);
|
|
14404
|
+
const MaterialPreview = MaterialPreviewList;
|
|
14405
|
+
const MaterialDisplayBar = MaterialPreviewList;
|
|
14293
14406
|
const [name$s, bem$s] = createNamespace("multi-person-select");
|
|
14294
14407
|
const defaultGroups$1 = [{
|
|
14295
14408
|
id: "air-conditioning-a",
|
|
@@ -15475,6 +15588,15 @@ var stdin_default$s = defineComponent({
|
|
|
15475
15588
|
const expandedSelected = ref(false);
|
|
15476
15589
|
const searching = ref(false);
|
|
15477
15590
|
const keyword = ref("");
|
|
15591
|
+
const currentSpecialtyItems = (specialty) => specialtyType.value === 0 ? specialty.deviceItems : specialty.systemItems;
|
|
15592
|
+
const expandOnlySpecialty = () => {
|
|
15593
|
+
if (props2.specialties.length === 1) {
|
|
15594
|
+
const [specialty] = props2.specialties;
|
|
15595
|
+
expandedSpecialties.value = extend({}, expandedSpecialties.value, {
|
|
15596
|
+
[specialty.id]: true
|
|
15597
|
+
});
|
|
15598
|
+
}
|
|
15599
|
+
};
|
|
15478
15600
|
const reset = () => {
|
|
15479
15601
|
view.value = 0;
|
|
15480
15602
|
specialtyType.value = 0;
|
|
@@ -15484,6 +15606,7 @@ var stdin_default$s = defineComponent({
|
|
|
15484
15606
|
expandedSpecialties.value = {
|
|
15485
15607
|
"strong-electricity": true
|
|
15486
15608
|
};
|
|
15609
|
+
expandOnlySpecialty();
|
|
15487
15610
|
};
|
|
15488
15611
|
watch(() => props2.show, (show) => show && reset(), {
|
|
15489
15612
|
immediate: true
|
|
@@ -15551,7 +15674,7 @@ var stdin_default$s = defineComponent({
|
|
|
15551
15674
|
const renderSpecialty = (specialty) => {
|
|
15552
15675
|
var _a;
|
|
15553
15676
|
const expanded = (_a = expandedSpecialties.value[specialty.id]) != null ? _a : false;
|
|
15554
|
-
const items =
|
|
15677
|
+
const items = currentSpecialtyItems(specialty);
|
|
15555
15678
|
return createVNode("section", {
|
|
15556
15679
|
"class": bem$n("specialty"),
|
|
15557
15680
|
"key": specialty.id
|
|
@@ -15639,6 +15762,7 @@ var stdin_default$s = defineComponent({
|
|
|
15639
15762
|
"selected": specialtyType.value === 0,
|
|
15640
15763
|
"onClick": () => {
|
|
15641
15764
|
specialtyType.value = 0;
|
|
15765
|
+
expandOnlySpecialty();
|
|
15642
15766
|
}
|
|
15643
15767
|
}, {
|
|
15644
15768
|
default: () => [createTextVNode("设备")]
|
|
@@ -15646,6 +15770,7 @@ var stdin_default$s = defineComponent({
|
|
|
15646
15770
|
"selected": specialtyType.value === 1,
|
|
15647
15771
|
"onClick": () => {
|
|
15648
15772
|
specialtyType.value = 1;
|
|
15773
|
+
expandOnlySpecialty();
|
|
15649
15774
|
}
|
|
15650
15775
|
}, {
|
|
15651
15776
|
default: () => [createTextVNode("系统")]
|
|
@@ -17922,14 +18047,17 @@ const titleBarProps = {
|
|
|
17922
18047
|
showIcon: Boolean,
|
|
17923
18048
|
showDescription: Boolean,
|
|
17924
18049
|
showArrow: Boolean,
|
|
18050
|
+
actionText: makeStringProp("操作"),
|
|
18051
|
+
showAction: Boolean,
|
|
17925
18052
|
size: makeStringProp("default"),
|
|
17926
18053
|
expandable: Boolean,
|
|
17927
|
-
modelValue: truthProp
|
|
18054
|
+
modelValue: truthProp,
|
|
18055
|
+
required: Boolean
|
|
17928
18056
|
};
|
|
17929
18057
|
var stdin_default$9 = defineComponent({
|
|
17930
18058
|
name: name$4,
|
|
17931
18059
|
props: titleBarProps,
|
|
17932
|
-
emits: ["update:modelValue", "change", "click"],
|
|
18060
|
+
emits: ["update:modelValue", "change", "click", "click-action"],
|
|
17933
18061
|
setup(props2, {
|
|
17934
18062
|
slots,
|
|
17935
18063
|
emit
|
|
@@ -17941,27 +18069,55 @@ var stdin_default$9 = defineComponent({
|
|
|
17941
18069
|
emit("update:modelValue", value);
|
|
17942
18070
|
emit("change", value);
|
|
17943
18071
|
};
|
|
18072
|
+
const onHeaderClick = (event) => {
|
|
18073
|
+
emit("click", event);
|
|
18074
|
+
toggle();
|
|
18075
|
+
};
|
|
18076
|
+
const onActionClick = (event) => {
|
|
18077
|
+
event.stopPropagation();
|
|
18078
|
+
emit("click-action", event);
|
|
18079
|
+
};
|
|
18080
|
+
const onHeaderKeydown = (event) => {
|
|
18081
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
18082
|
+
event.preventDefault();
|
|
18083
|
+
emit("click", event);
|
|
18084
|
+
toggle();
|
|
18085
|
+
}
|
|
18086
|
+
};
|
|
17944
18087
|
return () => {
|
|
17945
18088
|
var _a, _b, _c;
|
|
17946
18089
|
return createVNode("section", {
|
|
17947
18090
|
"class": bem$4({
|
|
17948
18091
|
mini: props2.size === "mini",
|
|
17949
|
-
expandable: props2.expandable
|
|
18092
|
+
expandable: props2.expandable,
|
|
18093
|
+
required: props2.required
|
|
17950
18094
|
})
|
|
17951
|
-
}, [createVNode("
|
|
17952
|
-
"type": "button",
|
|
18095
|
+
}, [createVNode("div", {
|
|
17953
18096
|
"class": bem$4("header"),
|
|
18097
|
+
"role": "button",
|
|
18098
|
+
"tabindex": "0",
|
|
17954
18099
|
"aria-expanded": props2.expandable ? props2.modelValue : void 0,
|
|
17955
|
-
"onClick":
|
|
17956
|
-
|
|
17957
|
-
toggle();
|
|
17958
|
-
}
|
|
18100
|
+
"onClick": onHeaderClick,
|
|
18101
|
+
"onKeydown": onHeaderKeydown
|
|
17959
18102
|
}, [props2.showIcon && props2.icon && createVNode(Icon, {
|
|
17960
18103
|
"name": props2.icon,
|
|
17961
18104
|
"class": bem$4("icon")
|
|
17962
18105
|
}, null), createVNode("span", {
|
|
17963
18106
|
"class": bem$4("text")
|
|
17964
|
-
}, [createVNode("
|
|
18107
|
+
}, [createVNode("span", {
|
|
18108
|
+
"class": bem$4("title-row")
|
|
18109
|
+
}, [createVNode("strong", null, [((_a = slots.title) == null ? void 0 : _a.call(slots)) || props2.title]), props2.showAction && props2.actionText && createVNode("span", {
|
|
18110
|
+
"class": bem$4("action")
|
|
18111
|
+
}, [createVNode("i", {
|
|
18112
|
+
"class": bem$4("action-divider")
|
|
18113
|
+
}, null), createVNode(Button, {
|
|
18114
|
+
"type": "text",
|
|
18115
|
+
"size": "normal",
|
|
18116
|
+
"text": props2.actionText,
|
|
18117
|
+
"onClick": onActionClick
|
|
18118
|
+
}, null)])]), props2.size !== "mini" && props2.showDescription && props2.description && createVNode("span", {
|
|
18119
|
+
"class": bem$4("description")
|
|
18120
|
+
}, [((_b = slots.description) == null ? void 0 : _b.call(slots)) || props2.description])]), (props2.showArrow || props2.expandable) && createVNode(Icon, {
|
|
17965
18121
|
"name": "arrow-up",
|
|
17966
18122
|
"class": bem$4("arrow", {
|
|
17967
18123
|
expanded: props2.expandable && props2.modelValue
|
|
@@ -18013,6 +18169,7 @@ function filterFiles(items, maxSize) {
|
|
|
18013
18169
|
return { valid, invalid };
|
|
18014
18170
|
}
|
|
18015
18171
|
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
|
18172
|
+
const VIDEO_REGEXP = /\.(mp4|webm|ogg|mov)(?:$|\?)/i;
|
|
18016
18173
|
const isImageUrl = (url) => IMAGE_REGEXP.test(url);
|
|
18017
18174
|
function isImageFile(item) {
|
|
18018
18175
|
if (item.isImage) {
|
|
@@ -18029,6 +18186,77 @@ function isImageFile(item) {
|
|
|
18029
18186
|
}
|
|
18030
18187
|
return false;
|
|
18031
18188
|
}
|
|
18189
|
+
function isVideoFile(item) {
|
|
18190
|
+
var _a;
|
|
18191
|
+
if ((_a = item.file) == null ? void 0 : _a.type) {
|
|
18192
|
+
return item.file.type.indexOf("video/") === 0;
|
|
18193
|
+
}
|
|
18194
|
+
if (item.url) {
|
|
18195
|
+
return VIDEO_REGEXP.test(item.url);
|
|
18196
|
+
}
|
|
18197
|
+
return typeof item.content === "string" && item.content.indexOf("data:video") === 0;
|
|
18198
|
+
}
|
|
18199
|
+
function createVideoThumbnail(file) {
|
|
18200
|
+
if (typeof document === "undefined" || typeof URL === "undefined" || typeof URL.createObjectURL !== "function") {
|
|
18201
|
+
return Promise.resolve(void 0);
|
|
18202
|
+
}
|
|
18203
|
+
return new Promise((resolve) => {
|
|
18204
|
+
const video = document.createElement("video");
|
|
18205
|
+
const objectUrl = URL.createObjectURL(file);
|
|
18206
|
+
let settled = false;
|
|
18207
|
+
let timeout;
|
|
18208
|
+
const cleanup = () => {
|
|
18209
|
+
if (timeout !== void 0) {
|
|
18210
|
+
window.clearTimeout(timeout);
|
|
18211
|
+
}
|
|
18212
|
+
URL.revokeObjectURL(objectUrl);
|
|
18213
|
+
video.removeAttribute("src");
|
|
18214
|
+
try {
|
|
18215
|
+
video.load();
|
|
18216
|
+
} catch (e) {
|
|
18217
|
+
}
|
|
18218
|
+
};
|
|
18219
|
+
const done = (thumbnail) => {
|
|
18220
|
+
if (settled)
|
|
18221
|
+
return;
|
|
18222
|
+
settled = true;
|
|
18223
|
+
cleanup();
|
|
18224
|
+
resolve(thumbnail);
|
|
18225
|
+
};
|
|
18226
|
+
const captureFrame = () => {
|
|
18227
|
+
if (!video.videoWidth || !video.videoHeight) {
|
|
18228
|
+
done();
|
|
18229
|
+
return;
|
|
18230
|
+
}
|
|
18231
|
+
const canvas = document.createElement("canvas");
|
|
18232
|
+
canvas.width = video.videoWidth;
|
|
18233
|
+
canvas.height = video.videoHeight;
|
|
18234
|
+
const context = canvas.getContext("2d");
|
|
18235
|
+
if (!context) {
|
|
18236
|
+
done();
|
|
18237
|
+
return;
|
|
18238
|
+
}
|
|
18239
|
+
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
18240
|
+
done(canvas.toDataURL("image/jpeg", 0.8));
|
|
18241
|
+
};
|
|
18242
|
+
video.muted = true;
|
|
18243
|
+
video.playsInline = true;
|
|
18244
|
+
video.preload = "auto";
|
|
18245
|
+
video.onloadedmetadata = () => {
|
|
18246
|
+
const duration = Number.isFinite(video.duration) ? video.duration : 0.1;
|
|
18247
|
+
const frameTime = Math.min(0.1, Math.max(duration - 0.01, 0));
|
|
18248
|
+
if (frameTime) {
|
|
18249
|
+
video.currentTime = frameTime;
|
|
18250
|
+
} else {
|
|
18251
|
+
captureFrame();
|
|
18252
|
+
}
|
|
18253
|
+
};
|
|
18254
|
+
video.onseeked = captureFrame;
|
|
18255
|
+
video.onerror = () => done();
|
|
18256
|
+
video.src = objectUrl;
|
|
18257
|
+
timeout = window.setTimeout(() => done(), 3e3);
|
|
18258
|
+
});
|
|
18259
|
+
}
|
|
18032
18260
|
var stdin_default$8 = defineComponent({
|
|
18033
18261
|
props: {
|
|
18034
18262
|
name: numericProp,
|
|
@@ -18040,7 +18268,7 @@ var stdin_default$8 = defineComponent({
|
|
|
18040
18268
|
previewSize: [Number, String, Array],
|
|
18041
18269
|
beforeDelete: Function
|
|
18042
18270
|
},
|
|
18043
|
-
emits: ["delete", "preview"],
|
|
18271
|
+
emits: ["delete", "preview", "click"],
|
|
18044
18272
|
setup(props2, {
|
|
18045
18273
|
emit,
|
|
18046
18274
|
slots
|
|
@@ -18081,7 +18309,11 @@ var stdin_default$8 = defineComponent({
|
|
|
18081
18309
|
done: () => emit("delete")
|
|
18082
18310
|
});
|
|
18083
18311
|
};
|
|
18084
|
-
const onPreview = () =>
|
|
18312
|
+
const onPreview = () => {
|
|
18313
|
+
emit("preview");
|
|
18314
|
+
emit("click");
|
|
18315
|
+
};
|
|
18316
|
+
const onFilePreview = () => emit("click");
|
|
18085
18317
|
const renderDeleteIcon = () => {
|
|
18086
18318
|
if (props2.deletable && props2.item.status !== "uploading") {
|
|
18087
18319
|
const slot = slots["preview-delete"];
|
|
@@ -18119,10 +18351,12 @@ var stdin_default$8 = defineComponent({
|
|
|
18119
18351
|
imageFit,
|
|
18120
18352
|
previewSize
|
|
18121
18353
|
} = props2;
|
|
18122
|
-
|
|
18354
|
+
const isImage2 = isImageFile(item);
|
|
18355
|
+
const isVideo = isVideoFile(item);
|
|
18356
|
+
if (isImage2 || isVideo && item.videoThumbnail) {
|
|
18123
18357
|
return createVNode(Image$1, {
|
|
18124
18358
|
"fit": imageFit,
|
|
18125
|
-
"src": item.content || item.url,
|
|
18359
|
+
"src": isVideo ? item.videoThumbnail : item.content || item.url,
|
|
18126
18360
|
"class": bem$3("preview-image"),
|
|
18127
18361
|
"width": Array.isArray(previewSize) ? previewSize[0] : previewSize,
|
|
18128
18362
|
"height": Array.isArray(previewSize) ? previewSize[1] : previewSize,
|
|
@@ -18134,7 +18368,8 @@ var stdin_default$8 = defineComponent({
|
|
|
18134
18368
|
}
|
|
18135
18369
|
return createVNode("div", {
|
|
18136
18370
|
"class": bem$3("file"),
|
|
18137
|
-
"style": getSizeStyle(props2.previewSize)
|
|
18371
|
+
"style": getSizeStyle(props2.previewSize),
|
|
18372
|
+
"onClick": onFilePreview
|
|
18138
18373
|
}, [createVNode(Icon, {
|
|
18139
18374
|
"class": bem$3("file-icon"),
|
|
18140
18375
|
"name": "description"
|
|
@@ -18147,11 +18382,33 @@ var stdin_default$8 = defineComponent({
|
|
|
18147
18382
|
}, [renderPreview(), renderMask(), renderDeleteIcon()]);
|
|
18148
18383
|
}
|
|
18149
18384
|
});
|
|
18385
|
+
var __async$1 = (__this, __arguments, generator) => {
|
|
18386
|
+
return new Promise((resolve, reject) => {
|
|
18387
|
+
var fulfilled = (value) => {
|
|
18388
|
+
try {
|
|
18389
|
+
step(generator.next(value));
|
|
18390
|
+
} catch (e) {
|
|
18391
|
+
reject(e);
|
|
18392
|
+
}
|
|
18393
|
+
};
|
|
18394
|
+
var rejected = (value) => {
|
|
18395
|
+
try {
|
|
18396
|
+
step(generator.throw(value));
|
|
18397
|
+
} catch (e) {
|
|
18398
|
+
reject(e);
|
|
18399
|
+
}
|
|
18400
|
+
};
|
|
18401
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18402
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
18403
|
+
});
|
|
18404
|
+
};
|
|
18150
18405
|
const uploaderProps = {
|
|
18151
18406
|
name: makeNumericProp(""),
|
|
18152
18407
|
accept: makeStringProp("image/*"),
|
|
18153
18408
|
capture: String,
|
|
18154
18409
|
multiple: Boolean,
|
|
18410
|
+
label: String,
|
|
18411
|
+
required: Boolean,
|
|
18155
18412
|
disabled: Boolean,
|
|
18156
18413
|
readonly: Boolean,
|
|
18157
18414
|
lazyLoad: Boolean,
|
|
@@ -18221,37 +18478,29 @@ var stdin_default$7 = defineComponent({
|
|
|
18221
18478
|
modelValue,
|
|
18222
18479
|
resultType
|
|
18223
18480
|
} = props2;
|
|
18481
|
+
const createFileItem = (file) => __async$1(this, null, function* () {
|
|
18482
|
+
const content = yield readFileContent(file, resultType);
|
|
18483
|
+
const result = {
|
|
18484
|
+
file,
|
|
18485
|
+
status: "",
|
|
18486
|
+
message: ""
|
|
18487
|
+
};
|
|
18488
|
+
if (content) {
|
|
18489
|
+
result.content = content;
|
|
18490
|
+
}
|
|
18491
|
+
if (isVideoFile(result)) {
|
|
18492
|
+
result.videoThumbnail = yield createVideoThumbnail(file);
|
|
18493
|
+
}
|
|
18494
|
+
return result;
|
|
18495
|
+
});
|
|
18224
18496
|
if (Array.isArray(files)) {
|
|
18225
18497
|
const remainCount = +maxCount - modelValue.length;
|
|
18226
18498
|
if (files.length > remainCount) {
|
|
18227
18499
|
files = files.slice(0, remainCount);
|
|
18228
18500
|
}
|
|
18229
|
-
Promise.all(files.map(
|
|
18230
|
-
const fileList = files.map((file, index) => {
|
|
18231
|
-
const result = {
|
|
18232
|
-
file,
|
|
18233
|
-
status: "",
|
|
18234
|
-
message: ""
|
|
18235
|
-
};
|
|
18236
|
-
if (contents[index]) {
|
|
18237
|
-
result.content = contents[index];
|
|
18238
|
-
}
|
|
18239
|
-
return result;
|
|
18240
|
-
});
|
|
18241
|
-
onAfterRead(fileList);
|
|
18242
|
-
});
|
|
18501
|
+
Promise.all(files.map(createFileItem)).then(onAfterRead);
|
|
18243
18502
|
} else {
|
|
18244
|
-
|
|
18245
|
-
const result = {
|
|
18246
|
-
file: files,
|
|
18247
|
-
status: "",
|
|
18248
|
-
message: ""
|
|
18249
|
-
};
|
|
18250
|
-
if (content) {
|
|
18251
|
-
result.content = content;
|
|
18252
|
-
}
|
|
18253
|
-
onAfterRead(result);
|
|
18254
|
-
});
|
|
18503
|
+
createFileItem(files).then(onAfterRead);
|
|
18255
18504
|
}
|
|
18256
18505
|
};
|
|
18257
18506
|
const onChange = (event) => {
|
|
@@ -18284,7 +18533,7 @@ var stdin_default$7 = defineComponent({
|
|
|
18284
18533
|
let imagePreview;
|
|
18285
18534
|
const onClosePreview = () => emit("close-preview");
|
|
18286
18535
|
const previewImage = (item) => {
|
|
18287
|
-
if (props2.previewFullImage) {
|
|
18536
|
+
if (props2.previewFullImage && isImageFile(item)) {
|
|
18288
18537
|
const imageFiles = props2.modelValue.filter(isImageFile);
|
|
18289
18538
|
const images = imageFiles.map((item2) => {
|
|
18290
18539
|
if (item2.file && !item2.url && item2.status !== "failed") {
|
|
@@ -18327,6 +18576,15 @@ var stdin_default$7 = defineComponent({
|
|
|
18327
18576
|
return props2.modelValue.map(renderPreviewItem);
|
|
18328
18577
|
}
|
|
18329
18578
|
};
|
|
18579
|
+
const renderLabel = () => {
|
|
18580
|
+
if (!props2.label)
|
|
18581
|
+
return;
|
|
18582
|
+
return createVNode("div", {
|
|
18583
|
+
"class": bem$3("label")
|
|
18584
|
+
}, [props2.required && createVNode("span", {
|
|
18585
|
+
"class": bem$3("required")
|
|
18586
|
+
}, [createTextVNode("*")]), props2.label]);
|
|
18587
|
+
};
|
|
18330
18588
|
const onClickUpload = (event) => emit("click-upload", event);
|
|
18331
18589
|
const renderUpload = () => {
|
|
18332
18590
|
if (props2.modelValue.length >= props2.maxCount || !props2.showUpload) {
|
|
@@ -18375,8 +18633,10 @@ var stdin_default$7 = defineComponent({
|
|
|
18375
18633
|
});
|
|
18376
18634
|
useCustomFieldValue(() => props2.modelValue);
|
|
18377
18635
|
return () => createVNode("div", {
|
|
18378
|
-
"class": bem$3(
|
|
18379
|
-
|
|
18636
|
+
"class": bem$3({
|
|
18637
|
+
required: props2.required && !props2.label
|
|
18638
|
+
})
|
|
18639
|
+
}, [renderLabel(), createVNode("div", {
|
|
18380
18640
|
"class": bem$3("wrapper", {
|
|
18381
18641
|
disabled: props2.disabled
|
|
18382
18642
|
})
|
|
@@ -20220,7 +20480,7 @@ const Lazyload = {
|
|
|
20220
20480
|
});
|
|
20221
20481
|
}
|
|
20222
20482
|
};
|
|
20223
|
-
const version = "0.0.
|
|
20483
|
+
const version = "0.0.37";
|
|
20224
20484
|
function install(app) {
|
|
20225
20485
|
const components = [
|
|
20226
20486
|
ActionBar,
|
|
@@ -20411,10 +20671,12 @@ export {
|
|
|
20411
20671
|
Locale,
|
|
20412
20672
|
LocationSelect,
|
|
20413
20673
|
MaterialActionBar,
|
|
20674
|
+
MaterialActionList,
|
|
20414
20675
|
MaterialAdd,
|
|
20415
20676
|
MaterialDetail,
|
|
20416
20677
|
MaterialDisplayBar,
|
|
20417
20678
|
MaterialPreview,
|
|
20679
|
+
MaterialPreviewList,
|
|
20418
20680
|
MultiPersonSelect,
|
|
20419
20681
|
NavBar,
|
|
20420
20682
|
NoticeBar,
|