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.
Files changed (160) hide show
  1. package/es/cell/Cell.d.ts +9 -0
  2. package/es/cell/Cell.mjs +15 -3
  3. package/es/cell/index.css +1 -1
  4. package/es/cell/index.d.ts +5 -0
  5. package/es/cell/index.less +24 -2
  6. package/es/cell/var.less +6 -0
  7. package/es/cell-group/CellGroup.d.ts +4 -0
  8. package/es/cell-group/CellGroup.mjs +4 -2
  9. package/es/cell-group/index.css +1 -1
  10. package/es/cell-group/index.d.ts +3 -0
  11. package/es/cell-group/index.less +27 -0
  12. package/es/cell-group/var.less +3 -0
  13. package/es/collapse-item/CollapseItem.d.ts +7 -0
  14. package/es/collapse-item/index.d.ts +5 -0
  15. package/es/field/Field.d.ts +7 -0
  16. package/es/field/index.d.ts +5 -0
  17. package/es/index.d.ts +1 -1
  18. package/es/index.mjs +1 -1
  19. package/es/label/Label.d.ts +11 -1
  20. package/es/label/Label.mjs +34 -3
  21. package/es/label/index.css +1 -1
  22. package/es/label/index.d.ts +6 -2
  23. package/es/label/index.less +22 -0
  24. package/es/label/var.less +1 -0
  25. package/es/loading/index.css +1 -1
  26. package/es/loading/index.less +1 -1
  27. package/es/material-action-bar/MaterialActionBar.d.ts +15 -0
  28. package/es/material-action-bar/MaterialActionBar.mjs +107 -58
  29. package/es/material-action-bar/index.css +1 -1
  30. package/es/material-action-bar/index.d.ts +76 -2
  31. package/es/material-action-bar/index.less +6 -2
  32. package/es/material-action-bar/index.mjs +4 -2
  33. package/es/material-action-bar/style/index.mjs +1 -0
  34. package/es/material-action-bar/style/less.mjs +1 -0
  35. package/es/material-add/index.css +1 -1
  36. package/es/material-add/style/index.mjs +1 -0
  37. package/es/material-add/style/less.mjs +1 -0
  38. package/es/material-display-bar/MaterialDisplayBar.d.ts +2 -1
  39. package/es/material-display-bar/MaterialDisplayBar.mjs +4 -3
  40. package/es/material-display-bar/index.css +1 -1
  41. package/es/material-display-bar/index.d.ts +105 -4
  42. package/es/material-display-bar/index.mjs +5 -3
  43. package/es/material-display-bar/var.less +1 -1
  44. package/es/object-select/ObjectSelect.mjs +13 -1
  45. package/es/style/base.css +1 -1
  46. package/es/style/base.less +5 -0
  47. package/es/style/css-variables.css +1 -1
  48. package/es/style/css-variables.less +1 -0
  49. package/es/style/var.less +1 -0
  50. package/es/tag/Tag.d.ts +15 -2
  51. package/es/tag/Tag.mjs +20 -3
  52. package/es/tag/index.css +1 -1
  53. package/es/tag/index.d.ts +9 -0
  54. package/es/tag/index.less +45 -1
  55. package/es/tag/var.less +13 -0
  56. package/es/title-bar/TitleBar.d.ts +34 -12
  57. package/es/title-bar/TitleBar.mjs +42 -10
  58. package/es/title-bar/index.css +1 -1
  59. package/es/title-bar/index.d.ts +18 -2
  60. package/es/title-bar/index.less +15 -2
  61. package/es/title-bar/style/index.mjs +2 -0
  62. package/es/title-bar/style/less.mjs +2 -0
  63. package/es/title-bar/var.less +6 -0
  64. package/es/uploader/Uploader.d.ts +7 -0
  65. package/es/uploader/Uploader.mjs +55 -30
  66. package/es/uploader/UploaderPreviewItem.d.ts +2 -1
  67. package/es/uploader/UploaderPreviewItem.mjs +13 -6
  68. package/es/uploader/index.css +1 -1
  69. package/es/uploader/index.d.ts +5 -0
  70. package/es/uploader/index.less +30 -0
  71. package/es/uploader/types.d.ts +1 -0
  72. package/es/uploader/utils.d.ts +2 -0
  73. package/es/uploader/utils.mjs +74 -0
  74. package/es/uploader/var.less +5 -0
  75. package/lib/cell/Cell.d.ts +9 -0
  76. package/lib/cell/Cell.js +15 -3
  77. package/lib/cell/index.css +1 -1
  78. package/lib/cell/index.d.ts +5 -0
  79. package/lib/cell/index.less +24 -2
  80. package/lib/cell/var.less +6 -0
  81. package/lib/cell-group/CellGroup.d.ts +4 -0
  82. package/lib/cell-group/CellGroup.js +4 -2
  83. package/lib/cell-group/index.css +1 -1
  84. package/lib/cell-group/index.d.ts +3 -0
  85. package/lib/cell-group/index.less +27 -0
  86. package/lib/cell-group/var.less +3 -0
  87. package/lib/collapse-item/CollapseItem.d.ts +7 -0
  88. package/lib/collapse-item/index.d.ts +5 -0
  89. package/lib/field/Field.d.ts +7 -0
  90. package/lib/field/index.d.ts +5 -0
  91. package/lib/index.css +1 -1
  92. package/lib/index.d.ts +1 -1
  93. package/lib/index.js +1 -1
  94. package/lib/index.less +1 -1
  95. package/lib/label/Label.d.ts +11 -1
  96. package/lib/label/Label.js +34 -3
  97. package/lib/label/index.css +1 -1
  98. package/lib/label/index.d.ts +6 -2
  99. package/lib/label/index.less +22 -0
  100. package/lib/label/var.less +1 -0
  101. package/lib/loading/index.css +1 -1
  102. package/lib/loading/index.less +1 -1
  103. package/lib/material-action-bar/MaterialActionBar.d.ts +15 -0
  104. package/lib/material-action-bar/MaterialActionBar.js +106 -57
  105. package/lib/material-action-bar/index.css +1 -1
  106. package/lib/material-action-bar/index.d.ts +76 -2
  107. package/lib/material-action-bar/index.js +4 -2
  108. package/lib/material-action-bar/index.less +6 -2
  109. package/lib/material-action-bar/style/index.js +1 -0
  110. package/lib/material-action-bar/style/less.js +1 -0
  111. package/lib/material-add/index.css +1 -1
  112. package/lib/material-add/style/index.js +1 -0
  113. package/lib/material-add/style/less.js +1 -0
  114. package/lib/material-display-bar/MaterialDisplayBar.d.ts +2 -1
  115. package/lib/material-display-bar/MaterialDisplayBar.js +4 -3
  116. package/lib/material-display-bar/index.css +1 -1
  117. package/lib/material-display-bar/index.d.ts +105 -4
  118. package/lib/material-display-bar/index.js +5 -3
  119. package/lib/material-display-bar/var.less +1 -1
  120. package/lib/object-select/ObjectSelect.js +13 -1
  121. package/lib/style/base.css +1 -1
  122. package/lib/style/base.less +5 -0
  123. package/lib/style/css-variables.css +1 -1
  124. package/lib/style/css-variables.less +1 -0
  125. package/lib/style/var.less +1 -0
  126. package/lib/tag/Tag.d.ts +15 -2
  127. package/lib/tag/Tag.js +20 -3
  128. package/lib/tag/index.css +1 -1
  129. package/lib/tag/index.d.ts +9 -0
  130. package/lib/tag/index.less +45 -1
  131. package/lib/tag/var.less +13 -0
  132. package/lib/title-bar/TitleBar.d.ts +34 -12
  133. package/lib/title-bar/TitleBar.js +42 -10
  134. package/lib/title-bar/index.css +1 -1
  135. package/lib/title-bar/index.d.ts +18 -2
  136. package/lib/title-bar/index.less +15 -2
  137. package/lib/title-bar/style/index.js +2 -0
  138. package/lib/title-bar/style/less.js +2 -0
  139. package/lib/title-bar/var.less +6 -0
  140. package/lib/uploader/Uploader.d.ts +7 -0
  141. package/lib/uploader/Uploader.js +53 -28
  142. package/lib/uploader/UploaderPreviewItem.d.ts +2 -1
  143. package/lib/uploader/UploaderPreviewItem.js +12 -5
  144. package/lib/uploader/index.css +1 -1
  145. package/lib/uploader/index.d.ts +5 -0
  146. package/lib/uploader/index.less +30 -0
  147. package/lib/uploader/types.d.ts +1 -0
  148. package/lib/uploader/utils.d.ts +2 -0
  149. package/lib/uploader/utils.js +74 -0
  150. package/lib/uploader/var.less +5 -0
  151. package/lib/vant.cjs.js +382 -120
  152. package/lib/vant.es.js +382 -120
  153. package/lib/vant.js +382 -120
  154. package/lib/vant.min.js +1 -1
  155. package/lib/web-types.json +1 -1
  156. package/package.json +1 -1
  157. package/skills/use-persagy-vant/SKILL.md +4 -3
  158. package/skills/use-persagy-vant/references/component-documentation.md +4 -4
  159. package/skills/use-persagy-vant/references/component-variant-selection.md +53 -0
  160. 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;
@@ -4889,7 +4901,11 @@
4889
4901
  plain: Boolean,
4890
4902
  round: Boolean,
4891
4903
  textColor: String,
4892
- closeable: Boolean
4904
+ closeable: Boolean,
4905
+ rightIcon: String,
4906
+ number: [String, Number],
4907
+ showNumber: Boolean,
4908
+ numberColor: String
4893
4909
  };
4894
4910
  var stdin_default$1H = vue.defineComponent({
4895
4911
  name: name$1y,
@@ -4923,7 +4939,11 @@
4923
4939
  plain,
4924
4940
  round: round2,
4925
4941
  size,
4926
- closeable
4942
+ closeable,
4943
+ rightIcon,
4944
+ number,
4945
+ showNumber,
4946
+ numberColor
4927
4947
  } = props2;
4928
4948
  const classes = {
4929
4949
  mark,
@@ -4938,10 +4958,19 @@
4938
4958
  "class": [bem$1u("close"), HAPTICS_FEEDBACK],
4939
4959
  "onClick": onClose
4940
4960
  }, null);
4961
+ const RightIcon = rightIcon && vue.createVNode(Icon, {
4962
+ "name": rightIcon,
4963
+ "class": bem$1u("right-icon")
4964
+ }, null);
4941
4965
  return vue.createVNode("span", {
4942
4966
  "style": getStyle(),
4943
4967
  "class": bem$1u([classes, type])
4944
- }, [(_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
4968
+ }, [showNumber && number !== void 0 && vue.createVNode("span", {
4969
+ "class": bem$1u("number"),
4970
+ "style": {
4971
+ color: numberColor
4972
+ }
4973
+ }, [number]), (_a = slots.default) == null ? void 0 : _a.call(slots), RightIcon, CloseIcon]);
4945
4974
  };
4946
4975
  return () => vue.createVNode(vue.Transition, {
4947
4976
  "name": props2.closeable ? "van-fade" : void 0
@@ -9209,6 +9238,7 @@
9209
9238
  const cellGroupProps = {
9210
9239
  title: String,
9211
9240
  inset: Boolean,
9241
+ grayCard: Boolean,
9212
9242
  border: truthProp
9213
9243
  };
9214
9244
  var stdin_default$1j = vue.defineComponent({
@@ -9223,9 +9253,10 @@
9223
9253
  var _a;
9224
9254
  return vue.createVNode("div", vue.mergeProps({
9225
9255
  "class": [bem$19({
9226
- inset: props2.inset
9256
+ inset: props2.inset,
9257
+ "gray-card": props2.grayCard
9227
9258
  }), {
9228
- [BORDER_TOP_BOTTOM]: props2.border && !props2.inset
9259
+ [BORDER_TOP_BOTTOM]: props2.border && !props2.inset && !props2.grayCard
9229
9260
  }]
9230
9261
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
9231
9262
  };
@@ -13262,6 +13293,7 @@
13262
13293
  size: makeStringProp("default"),
13263
13294
  contentAlign: makeStringProp("follow"),
13264
13295
  vertical: Boolean,
13296
+ ellipsis: Boolean,
13265
13297
  href: String,
13266
13298
  location: String,
13267
13299
  tags: {
@@ -13276,12 +13308,14 @@
13276
13308
  var stdin_default$M = vue.defineComponent({
13277
13309
  name: name$E,
13278
13310
  props: labelProps,
13279
- emits: ["click", "click-media"],
13311
+ emits: ["click", "click-media", "long-press"],
13280
13312
  setup(props2, {
13281
13313
  slots,
13282
13314
  emit
13283
13315
  }) {
13316
+ let longPressTimer;
13284
13317
  const vertical = vue.computed(() => props2.vertical || props2.type === "media");
13318
+ const ellipsis = vue.computed(() => props2.ellipsis && !vertical.value && !["tag", "media"].includes(props2.type));
13285
13319
  const displayLabel = vue.computed(() => {
13286
13320
  var _a;
13287
13321
  const showColon = (_a = props2.showColon) != null ? _a : !vertical.value && props2.contentAlign !== "right";
@@ -13291,6 +13325,25 @@
13291
13325
  return `${props2.label}:`;
13292
13326
  });
13293
13327
  const showLocation = vue.computed(() => props2.vertical && (props2.type === "bold" || props2.type === "link") && !!props2.location);
13328
+ const clearLongPress = () => {
13329
+ if (longPressTimer !== void 0) {
13330
+ clearTimeout(longPressTimer);
13331
+ longPressTimer = void 0;
13332
+ }
13333
+ };
13334
+ const startLongPress = (target, text) => {
13335
+ if (!ellipsis.value || !text)
13336
+ return;
13337
+ clearLongPress();
13338
+ longPressTimer = setTimeout(() => {
13339
+ longPressTimer = void 0;
13340
+ const payload = {
13341
+ target,
13342
+ text
13343
+ };
13344
+ emit("long-press", payload);
13345
+ }, 500);
13346
+ };
13294
13347
  const renderText = () => {
13295
13348
  var _a;
13296
13349
  const content = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || props2.content;
@@ -13343,13 +13396,22 @@
13343
13396
  "class": bem$E([props2.type, {
13344
13397
  mini: props2.size === "mini",
13345
13398
  vertical: vertical.value,
13399
+ ellipsis: ellipsis.value,
13346
13400
  location: showLocation.value,
13347
13401
  "content-right": props2.contentAlign === "right"
13348
13402
  }])
13349
13403
  }, [props2.showLabel && vue.createVNode("span", {
13350
- "class": bem$E("label")
13404
+ "class": bem$E("label"),
13405
+ "onPointerdown": () => startLongPress("label", displayLabel.value),
13406
+ "onPointerup": clearLongPress,
13407
+ "onPointercancel": clearLongPress,
13408
+ "onPointerleave": clearLongPress
13351
13409
  }, [displayLabel.value]), props2.showContent && vue.createVNode("div", {
13352
- "class": bem$E("value")
13410
+ "class": bem$E("value"),
13411
+ "onPointerdown": () => startLongPress("content", props2.content),
13412
+ "onPointerup": clearLongPress,
13413
+ "onPointercancel": clearLongPress,
13414
+ "onPointerleave": clearLongPress
13353
13415
  }, [renderContent(), showLocation.value && vue.createVNode("div", {
13354
13416
  "class": bem$E("location")
13355
13417
  }, [vue.createVNode(Icon, {
@@ -14389,14 +14451,20 @@
14389
14451
  warning: {
14390
14452
  type: String,
14391
14453
  default: ""
14454
+ },
14455
+ picking: {
14456
+ type: Object,
14457
+ default: void 0
14392
14458
  }
14393
14459
  },
14394
14460
  emits: ["update:modelValue", "detail"],
14395
14461
  setup(props2, {
14462
+ slots,
14396
14463
  emit
14397
14464
  }) {
14398
14465
  const showInputDialog = vue.ref(false);
14399
14466
  const inputValue = vue.ref("");
14467
+ let detailLongPressTimer;
14400
14468
  const openInputDialog = () => {
14401
14469
  if (!props2.enableInputDialog)
14402
14470
  return;
@@ -14409,6 +14477,25 @@
14409
14477
  emit("update:modelValue", Math.max(0, value));
14410
14478
  }
14411
14479
  };
14480
+ const clearDetailLongPress = () => {
14481
+ if (detailLongPressTimer) {
14482
+ clearTimeout(detailLongPressTimer);
14483
+ detailLongPressTimer = void 0;
14484
+ }
14485
+ };
14486
+ const onDetailLongPressStart = (event) => {
14487
+ const target = event.currentTarget;
14488
+ if (target.scrollWidth <= target.clientWidth) {
14489
+ return;
14490
+ }
14491
+ clearDetailLongPress();
14492
+ detailLongPressTimer = setTimeout(() => {
14493
+ Toast({
14494
+ message: props2.item.detail,
14495
+ position: "middle"
14496
+ });
14497
+ }, 500);
14498
+ };
14412
14499
  const highlight = (text) => {
14413
14500
  const query = props2.keyword.trim();
14414
14501
  if (!query)
@@ -14431,67 +14518,91 @@
14431
14518
  parts.push(text.slice(start2));
14432
14519
  return parts;
14433
14520
  };
14434
- return () => vue.createVNode("div", {
14435
- "class": bem$x({
14436
- selected: props2.selected
14437
- })
14438
- }, [vue.createVNode("div", {
14439
- "class": bem$x("main")
14440
- }, [vue.createVNode("button", {
14441
- "type": "button",
14442
- "class": bem$x("detail"),
14443
- "onClick": () => emit("detail", props2.item)
14444
- }, [vue.createVNode("span", null, [highlight(props2.item.name)]), props2.selected && props2.item.kind && vue.createVNode(Tag, {
14445
- "class": bem$x("kind-tag"),
14446
- "color": props2.item.kind === "material" ? "#d9ebff" : "#d9f7f7",
14447
- "textColor": props2.item.kind === "material" ? "var(--van-primary-color)" : "#00aeb3"
14448
- }, {
14449
- default: () => [props2.item.kind === "material" ? "物资" : "工具"]
14450
- }), vue.createVNode(Icon, {
14451
- "name": "arrow",
14452
- "size": "12"
14453
- }, null)]), vue.createVNode("div", {
14454
- "class": bem$x("stepper-wrapper")
14455
- }, [vue.createVNode(Stepper, {
14456
- "class": bem$x("stepper"),
14457
- "modelValue": props2.modelValue,
14458
- "min": 0,
14459
- "theme": "round",
14460
- "buttonSize": 18,
14461
- "disableInput": true,
14462
- "onUpdate:modelValue": (value) => emit("update:modelValue", Number(value))
14463
- }, null), props2.enableInputDialog && vue.createVNode("button", {
14464
- "type": "button",
14465
- "class": bem$x("number-trigger"),
14466
- "aria-label": "输入数量",
14467
- "onClick": openInputDialog
14468
- }, null)]), vue.createVNode("span", {
14469
- "class": bem$x("unit")
14470
- }, [props2.item.unit])]), vue.createVNode("p", {
14471
- "class": bem$x("desc")
14472
- }, [highlight(props2.item.detail)]), props2.showWarning && props2.warning && vue.createVNode("p", {
14473
- "class": bem$x("warning")
14474
- }, [props2.warning]), vue.createVNode(Dialog.Component, {
14475
- "show": showInputDialog.value,
14476
- "inputValue": inputValue.value,
14477
- "inputAlign": "left",
14478
- "title": "输入数量",
14479
- "inputPlaceholder": "请输入数量",
14480
- "inputAutofocus": true,
14481
- "showInput": true,
14482
- "showCancelButton": true,
14483
- "onUpdate:show": (value) => {
14484
- showInputDialog.value = value;
14485
- },
14486
- "onUpdate:inputValue": (value) => {
14487
- inputValue.value = value;
14488
- },
14489
- "onConfirm": confirmInputValue
14490
- }, null)]);
14521
+ vue.onBeforeUnmount(clearDetailLongPress);
14522
+ return () => {
14523
+ var _a, _b, _c, _d, _e;
14524
+ return vue.createVNode("div", {
14525
+ "class": bem$x({
14526
+ selected: props2.selected
14527
+ })
14528
+ }, [vue.createVNode("div", {
14529
+ "class": bem$x("main")
14530
+ }, [vue.createVNode("button", {
14531
+ "type": "button",
14532
+ "class": bem$x("detail"),
14533
+ "onClick": () => emit("detail", props2.item)
14534
+ }, [vue.createVNode("span", null, [highlight(props2.item.name)]), props2.selected && props2.item.kind && vue.createVNode(Tag, {
14535
+ "class": bem$x("kind-tag"),
14536
+ "color": props2.item.kind === "material" ? "#d9ebff" : "#d9f7f7",
14537
+ "textColor": props2.item.kind === "material" ? "var(--van-primary-color)" : "#00aeb3"
14538
+ }, {
14539
+ default: () => [props2.item.kind === "material" ? "物资" : "工具"]
14540
+ }), vue.createVNode(Icon, {
14541
+ "name": "arrow",
14542
+ "size": "12"
14543
+ }, null)]), (((_a = props2.picking) == null ? void 0 : _a.quantityLabel) || slots["stepper-prefix"]) && vue.createVNode("div", {
14544
+ "class": bem$x("stepper-prefix")
14545
+ }, [((_b = props2.picking) == null ? void 0 : _b.quantityLabel) || ((_c = slots["stepper-prefix"]) == null ? void 0 : _c.call(slots))]), vue.createVNode("div", {
14546
+ "class": bem$x("stepper-wrapper")
14547
+ }, [vue.createVNode(Stepper, {
14548
+ "class": bem$x("stepper"),
14549
+ "modelValue": props2.modelValue,
14550
+ "min": 0,
14551
+ "theme": "round",
14552
+ "buttonSize": 18,
14553
+ "disableInput": true,
14554
+ "onUpdate:modelValue": (value) => emit("update:modelValue", Number(value))
14555
+ }, null), props2.enableInputDialog && vue.createVNode("button", {
14556
+ "type": "button",
14557
+ "class": bem$x("number-trigger"),
14558
+ "aria-label": "输入数量",
14559
+ "onClick": openInputDialog
14560
+ }, null)]), vue.createVNode("span", {
14561
+ "class": bem$x("unit")
14562
+ }, [props2.item.unit])]), vue.createVNode("p", {
14563
+ "class": bem$x("desc"),
14564
+ "onTouchstart": onDetailLongPressStart,
14565
+ "onTouchmove": clearDetailLongPress,
14566
+ "onTouchend": clearDetailLongPress,
14567
+ "onTouchcancel": clearDetailLongPress,
14568
+ "onMousedown": onDetailLongPressStart,
14569
+ "onMousemove": clearDetailLongPress,
14570
+ "onMouseup": clearDetailLongPress,
14571
+ "onMouseleave": clearDetailLongPress
14572
+ }, [highlight(props2.item.detail)]), props2.showWarning && props2.warning && vue.createVNode("p", {
14573
+ "class": bem$x("warning")
14574
+ }, [props2.warning]), ((_d = props2.picking) == null ? void 0 : _d.outboundValue) !== void 0 && vue.createVNode("p", {
14575
+ "class": bem$x("picking-outbound")
14576
+ }, [vue.createVNode("span", {
14577
+ "class": bem$x("picking-label")
14578
+ }, [props2.picking.outboundLabel || "应出:"]), vue.createVNode("span", {
14579
+ "class": bem$x("picking-value"),
14580
+ "style": {
14581
+ fontWeight: props2.picking.outboundBold ? 600 : 400
14582
+ }
14583
+ }, [props2.picking.outboundValue])]), (_e = slots.default) == null ? void 0 : _e.call(slots), vue.createVNode(Dialog.Component, {
14584
+ "show": showInputDialog.value,
14585
+ "inputValue": inputValue.value,
14586
+ "inputAlign": "left",
14587
+ "title": "输入数量",
14588
+ "inputPlaceholder": "请输入数量",
14589
+ "inputAutofocus": true,
14590
+ "showInput": true,
14591
+ "showCancelButton": true,
14592
+ "onUpdate:show": (value) => {
14593
+ showInputDialog.value = value;
14594
+ },
14595
+ "onUpdate:inputValue": (value) => {
14596
+ inputValue.value = value;
14597
+ },
14598
+ "onConfirm": confirmInputValue
14599
+ }, null)]);
14600
+ };
14491
14601
  }
14492
14602
  });
14493
- const MaterialActionBar = withInstall(stdin_default$E);
14494
- var stdin_default$D = MaterialActionBar;
14603
+ const MaterialActionList = withInstall(stdin_default$E);
14604
+ const MaterialActionBar = MaterialActionList;
14605
+ var stdin_default$D = MaterialActionList;
14495
14606
  const [name$w, bem$w] = createNamespace("material-detail");
14496
14607
  const defaultImages = ["/dog1.jpg", "/dog2.jpg", "/dog3.jpg"];
14497
14608
  const materialDetailProps = {
@@ -15421,6 +15532,7 @@
15421
15532
  "label": field.label,
15422
15533
  "showLabel": field.showLabel,
15423
15534
  "showContent": field.showContent,
15535
+ "showColon": field.showColon,
15424
15536
  "content": field.content,
15425
15537
  "type": field.type,
15426
15538
  "vertical": field.vertical,
@@ -15436,7 +15548,7 @@
15436
15548
  route2();
15437
15549
  };
15438
15550
  const renderBar = () => {
15439
- var _a, _b, _c;
15551
+ var _a, _b, _c, _d;
15440
15552
  return vue.createVNode("section", {
15441
15553
  "class": bem$t({
15442
15554
  rounded: props2.rounded
@@ -15458,12 +15570,12 @@
15458
15570
  "class": bem$t("quantity")
15459
15571
  }, [((_b = slots.quantity) == null ? void 0 : _b.call(slots)) || vue.createVNode(vue.Fragment, null, [props2.quantityLabel && vue.createVNode("span", {
15460
15572
  "class": bem$t("quantity-label")
15461
- }, [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", {
15573
+ }, [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", {
15462
15574
  "class": bem$t("fields")
15463
15575
  }, [props2.fields.map(renderField)])]), props2.divider && vue.createVNode(Divider, {
15464
15576
  "hairline": true,
15465
15577
  "class": bem$t("divider")
15466
- }, null), ((_c = slots.default) == null ? void 0 : _c.call(slots)) && vue.createVNode("div", {
15578
+ }, null), ((_d = slots.default) == null ? void 0 : _d.call(slots)) && vue.createVNode("div", {
15467
15579
  "class": bem$t("bottom")
15468
15580
  }, [slots.default()])]);
15469
15581
  };
@@ -15483,8 +15595,9 @@
15483
15595
  }) : renderBar();
15484
15596
  }
15485
15597
  });
15486
- const MaterialPreview = withInstall(stdin_default$y);
15487
- const MaterialDisplayBar = MaterialPreview;
15598
+ const MaterialPreviewList = withInstall(stdin_default$y);
15599
+ const MaterialPreview = MaterialPreviewList;
15600
+ const MaterialDisplayBar = MaterialPreviewList;
15488
15601
  const [name$s, bem$s] = createNamespace("multi-person-select");
15489
15602
  const defaultGroups$1 = [{
15490
15603
  id: "air-conditioning-a",
@@ -16670,6 +16783,15 @@
16670
16783
  const expandedSelected = vue.ref(false);
16671
16784
  const searching = vue.ref(false);
16672
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
+ };
16673
16795
  const reset = () => {
16674
16796
  view.value = 0;
16675
16797
  specialtyType.value = 0;
@@ -16679,6 +16801,7 @@
16679
16801
  expandedSpecialties.value = {
16680
16802
  "strong-electricity": true
16681
16803
  };
16804
+ expandOnlySpecialty();
16682
16805
  };
16683
16806
  vue.watch(() => props2.show, (show) => show && reset(), {
16684
16807
  immediate: true
@@ -16746,7 +16869,7 @@
16746
16869
  const renderSpecialty = (specialty) => {
16747
16870
  var _a;
16748
16871
  const expanded = (_a = expandedSpecialties.value[specialty.id]) != null ? _a : false;
16749
- const items = specialtyType.value === 0 ? specialty.deviceItems : specialty.systemItems;
16872
+ const items = currentSpecialtyItems(specialty);
16750
16873
  return vue.createVNode("section", {
16751
16874
  "class": bem$n("specialty"),
16752
16875
  "key": specialty.id
@@ -16834,6 +16957,7 @@
16834
16957
  "selected": specialtyType.value === 0,
16835
16958
  "onClick": () => {
16836
16959
  specialtyType.value = 0;
16960
+ expandOnlySpecialty();
16837
16961
  }
16838
16962
  }, {
16839
16963
  default: () => [vue.createTextVNode("设备")]
@@ -16841,6 +16965,7 @@
16841
16965
  "selected": specialtyType.value === 1,
16842
16966
  "onClick": () => {
16843
16967
  specialtyType.value = 1;
16968
+ expandOnlySpecialty();
16844
16969
  }
16845
16970
  }, {
16846
16971
  default: () => [vue.createTextVNode("系统")]
@@ -19111,14 +19236,17 @@
19111
19236
  showIcon: Boolean,
19112
19237
  showDescription: Boolean,
19113
19238
  showArrow: Boolean,
19239
+ actionText: makeStringProp("操作"),
19240
+ showAction: Boolean,
19114
19241
  size: makeStringProp("default"),
19115
19242
  expandable: Boolean,
19116
- modelValue: truthProp
19243
+ modelValue: truthProp,
19244
+ required: Boolean
19117
19245
  };
19118
19246
  var stdin_default$9 = vue.defineComponent({
19119
19247
  name: name$4,
19120
19248
  props: titleBarProps,
19121
- emits: ["update:modelValue", "change", "click"],
19249
+ emits: ["update:modelValue", "change", "click", "click-action"],
19122
19250
  setup(props2, {
19123
19251
  slots,
19124
19252
  emit
@@ -19130,27 +19258,55 @@
19130
19258
  emit("update:modelValue", value);
19131
19259
  emit("change", value);
19132
19260
  };
19261
+ const onHeaderClick = (event) => {
19262
+ emit("click", event);
19263
+ toggle();
19264
+ };
19265
+ const onActionClick = (event) => {
19266
+ event.stopPropagation();
19267
+ emit("click-action", event);
19268
+ };
19269
+ const onHeaderKeydown = (event) => {
19270
+ if (event.key === "Enter" || event.key === " ") {
19271
+ event.preventDefault();
19272
+ emit("click", event);
19273
+ toggle();
19274
+ }
19275
+ };
19133
19276
  return () => {
19134
19277
  var _a, _b, _c;
19135
19278
  return vue.createVNode("section", {
19136
19279
  "class": bem$4({
19137
19280
  mini: props2.size === "mini",
19138
- expandable: props2.expandable
19281
+ expandable: props2.expandable,
19282
+ required: props2.required
19139
19283
  })
19140
- }, [vue.createVNode("button", {
19141
- "type": "button",
19284
+ }, [vue.createVNode("div", {
19142
19285
  "class": bem$4("header"),
19286
+ "role": "button",
19287
+ "tabindex": "0",
19143
19288
  "aria-expanded": props2.expandable ? props2.modelValue : void 0,
19144
- "onClick": (event) => {
19145
- emit("click", event);
19146
- toggle();
19147
- }
19289
+ "onClick": onHeaderClick,
19290
+ "onKeydown": onHeaderKeydown
19148
19291
  }, [props2.showIcon && props2.icon && vue.createVNode(Icon, {
19149
19292
  "name": props2.icon,
19150
19293
  "class": bem$4("icon")
19151
19294
  }, null), vue.createVNode("span", {
19152
19295
  "class": bem$4("text")
19153
- }, [vue.createVNode("strong", null, [((_a = slots.title) == null ? void 0 : _a.call(slots)) || props2.title]), props2.size !== "mini" && props2.showDescription && props2.description && vue.createVNode("span", null, [((_b = slots.description) == null ? void 0 : _b.call(slots)) || props2.description])]), (props2.showArrow || props2.expandable) && vue.createVNode(Icon, {
19296
+ }, [vue.createVNode("span", {
19297
+ "class": bem$4("title-row")
19298
+ }, [vue.createVNode("strong", null, [((_a = slots.title) == null ? void 0 : _a.call(slots)) || props2.title]), props2.showAction && props2.actionText && vue.createVNode("span", {
19299
+ "class": bem$4("action")
19300
+ }, [vue.createVNode("i", {
19301
+ "class": bem$4("action-divider")
19302
+ }, null), vue.createVNode(Button, {
19303
+ "type": "text",
19304
+ "size": "normal",
19305
+ "text": props2.actionText,
19306
+ "onClick": onActionClick
19307
+ }, null)])]), props2.size !== "mini" && props2.showDescription && props2.description && vue.createVNode("span", {
19308
+ "class": bem$4("description")
19309
+ }, [((_b = slots.description) == null ? void 0 : _b.call(slots)) || props2.description])]), (props2.showArrow || props2.expandable) && vue.createVNode(Icon, {
19154
19310
  "name": "arrow-up",
19155
19311
  "class": bem$4("arrow", {
19156
19312
  expanded: props2.expandable && props2.modelValue
@@ -19202,6 +19358,7 @@
19202
19358
  return { valid, invalid };
19203
19359
  }
19204
19360
  const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
19361
+ const VIDEO_REGEXP = /\.(mp4|webm|ogg|mov)(?:$|\?)/i;
19205
19362
  const isImageUrl = (url) => IMAGE_REGEXP.test(url);
19206
19363
  function isImageFile(item) {
19207
19364
  if (item.isImage) {
@@ -19218,6 +19375,77 @@
19218
19375
  }
19219
19376
  return false;
19220
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
+ }
19221
19449
  var stdin_default$8 = vue.defineComponent({
19222
19450
  props: {
19223
19451
  name: numericProp,
@@ -19229,7 +19457,7 @@
19229
19457
  previewSize: [Number, String, Array],
19230
19458
  beforeDelete: Function
19231
19459
  },
19232
- emits: ["delete", "preview"],
19460
+ emits: ["delete", "preview", "click"],
19233
19461
  setup(props2, {
19234
19462
  emit,
19235
19463
  slots
@@ -19270,7 +19498,11 @@
19270
19498
  done: () => emit("delete")
19271
19499
  });
19272
19500
  };
19273
- const onPreview = () => emit("preview");
19501
+ const onPreview = () => {
19502
+ emit("preview");
19503
+ emit("click");
19504
+ };
19505
+ const onFilePreview = () => emit("click");
19274
19506
  const renderDeleteIcon = () => {
19275
19507
  if (props2.deletable && props2.item.status !== "uploading") {
19276
19508
  const slot = slots["preview-delete"];
@@ -19308,10 +19540,12 @@
19308
19540
  imageFit,
19309
19541
  previewSize
19310
19542
  } = props2;
19311
- if (isImageFile(item)) {
19543
+ const isImage2 = isImageFile(item);
19544
+ const isVideo = isVideoFile(item);
19545
+ if (isImage2 || isVideo && item.videoThumbnail) {
19312
19546
  return vue.createVNode(Image$1, {
19313
19547
  "fit": imageFit,
19314
- "src": item.content || item.url,
19548
+ "src": isVideo ? item.videoThumbnail : item.content || item.url,
19315
19549
  "class": bem$3("preview-image"),
19316
19550
  "width": Array.isArray(previewSize) ? previewSize[0] : previewSize,
19317
19551
  "height": Array.isArray(previewSize) ? previewSize[1] : previewSize,
@@ -19323,7 +19557,8 @@
19323
19557
  }
19324
19558
  return vue.createVNode("div", {
19325
19559
  "class": bem$3("file"),
19326
- "style": getSizeStyle(props2.previewSize)
19560
+ "style": getSizeStyle(props2.previewSize),
19561
+ "onClick": onFilePreview
19327
19562
  }, [vue.createVNode(Icon, {
19328
19563
  "class": bem$3("file-icon"),
19329
19564
  "name": "description"
@@ -19336,11 +19571,33 @@
19336
19571
  }, [renderPreview(), renderMask(), renderDeleteIcon()]);
19337
19572
  }
19338
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
+ };
19339
19594
  const uploaderProps = {
19340
19595
  name: makeNumericProp(""),
19341
19596
  accept: makeStringProp("image/*"),
19342
19597
  capture: String,
19343
19598
  multiple: Boolean,
19599
+ label: String,
19600
+ required: Boolean,
19344
19601
  disabled: Boolean,
19345
19602
  readonly: Boolean,
19346
19603
  lazyLoad: Boolean,
@@ -19410,37 +19667,29 @@
19410
19667
  modelValue,
19411
19668
  resultType
19412
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
+ });
19413
19685
  if (Array.isArray(files)) {
19414
19686
  const remainCount = +maxCount - modelValue.length;
19415
19687
  if (files.length > remainCount) {
19416
19688
  files = files.slice(0, remainCount);
19417
19689
  }
19418
- Promise.all(files.map((file) => readFileContent(file, resultType))).then((contents) => {
19419
- const fileList = files.map((file, index) => {
19420
- const result = {
19421
- file,
19422
- status: "",
19423
- message: ""
19424
- };
19425
- if (contents[index]) {
19426
- result.content = contents[index];
19427
- }
19428
- return result;
19429
- });
19430
- onAfterRead(fileList);
19431
- });
19690
+ Promise.all(files.map(createFileItem)).then(onAfterRead);
19432
19691
  } else {
19433
- readFileContent(files, resultType).then((content) => {
19434
- const result = {
19435
- file: files,
19436
- status: "",
19437
- message: ""
19438
- };
19439
- if (content) {
19440
- result.content = content;
19441
- }
19442
- onAfterRead(result);
19443
- });
19692
+ createFileItem(files).then(onAfterRead);
19444
19693
  }
19445
19694
  };
19446
19695
  const onChange = (event) => {
@@ -19473,7 +19722,7 @@
19473
19722
  let imagePreview;
19474
19723
  const onClosePreview = () => emit("close-preview");
19475
19724
  const previewImage = (item) => {
19476
- if (props2.previewFullImage) {
19725
+ if (props2.previewFullImage && isImageFile(item)) {
19477
19726
  const imageFiles = props2.modelValue.filter(isImageFile);
19478
19727
  const images = imageFiles.map((item2) => {
19479
19728
  if (item2.file && !item2.url && item2.status !== "failed") {
@@ -19516,6 +19765,15 @@
19516
19765
  return props2.modelValue.map(renderPreviewItem);
19517
19766
  }
19518
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
+ };
19519
19777
  const onClickUpload = (event) => emit("click-upload", event);
19520
19778
  const renderUpload = () => {
19521
19779
  if (props2.modelValue.length >= props2.maxCount || !props2.showUpload) {
@@ -19564,8 +19822,10 @@
19564
19822
  });
19565
19823
  useCustomFieldValue(() => props2.modelValue);
19566
19824
  return () => vue.createVNode("div", {
19567
- "class": bem$3()
19568
- }, [vue.createVNode("div", {
19825
+ "class": bem$3({
19826
+ required: props2.required && !props2.label
19827
+ })
19828
+ }, [renderLabel(), vue.createVNode("div", {
19569
19829
  "class": bem$3("wrapper", {
19570
19830
  disabled: props2.disabled
19571
19831
  })
@@ -23809,7 +24069,7 @@
23809
24069
  });
23810
24070
  }
23811
24071
  };
23812
- const version = "0.0.35";
24072
+ const version = "0.0.37";
23813
24073
  function install(app) {
23814
24074
  const components = [
23815
24075
  ActionBar,
@@ -23999,10 +24259,12 @@
23999
24259
  exports2.Locale = Locale;
24000
24260
  exports2.LocationSelect = LocationSelect;
24001
24261
  exports2.MaterialActionBar = MaterialActionBar;
24262
+ exports2.MaterialActionList = MaterialActionList;
24002
24263
  exports2.MaterialAdd = MaterialAdd;
24003
24264
  exports2.MaterialDetail = MaterialDetail;
24004
24265
  exports2.MaterialDisplayBar = MaterialDisplayBar;
24005
24266
  exports2.MaterialPreview = MaterialPreview;
24267
+ exports2.MaterialPreviewList = MaterialPreviewList;
24006
24268
  exports2.MultiPersonSelect = MultiPersonSelect;
24007
24269
  exports2.NavBar = NavBar;
24008
24270
  exports2.NoticeBar = NoticeBar;