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