vant 4.6.0 → 4.6.2

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 (74) hide show
  1. package/README.md +7 -7
  2. package/es/checkbox/Checkbox.d.ts +14 -13
  3. package/es/checkbox/Checkbox.mjs +2 -1
  4. package/es/checkbox/Checker.d.ts +9 -13
  5. package/es/checkbox/Checker.mjs +13 -3
  6. package/es/checkbox/index.d.ts +8 -8
  7. package/es/field/Field.d.ts +25 -0
  8. package/es/field/Field.mjs +9 -0
  9. package/es/field/index.d.ts +13 -0
  10. package/es/floating-bubble/FloatingBubble.d.ts +16 -21
  11. package/es/floating-bubble/FloatingBubble.mjs +6 -8
  12. package/es/floating-bubble/index.css +1 -1
  13. package/es/floating-bubble/index.d.ts +18 -18
  14. package/es/floating-bubble/types.d.ts +13 -1
  15. package/es/floating-panel/FloatingPanel.mjs +2 -5
  16. package/es/index.d.ts +1 -1
  17. package/es/index.mjs +1 -1
  18. package/es/lazyload/vue-lazyload/util.d.ts +2 -2
  19. package/es/pagination/index.css +1 -1
  20. package/es/radio/Radio.d.ts +18 -15
  21. package/es/radio/Radio.mjs +5 -3
  22. package/es/radio/index.css +1 -1
  23. package/es/radio/index.d.ts +11 -9
  24. package/es/radio/types.d.ts +1 -0
  25. package/es/search/Search.d.ts +19 -0
  26. package/es/search/index.d.ts +13 -0
  27. package/es/style/base.css +1 -1
  28. package/es/submit-bar/types.d.ts +0 -1
  29. package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
  30. package/es/text-ellipsis/TextEllipsis.mjs +50 -19
  31. package/es/text-ellipsis/index.d.ts +9 -0
  32. package/es/uploader/Uploader.mjs +6 -4
  33. package/es/uploader/UploaderPreviewItem.mjs +1 -1
  34. package/es/uploader/types.d.ts +1 -0
  35. package/lib/checkbox/Checkbox.d.ts +14 -13
  36. package/lib/checkbox/Checkbox.js +1 -0
  37. package/lib/checkbox/Checker.d.ts +9 -13
  38. package/lib/checkbox/Checker.js +13 -3
  39. package/lib/checkbox/index.d.ts +8 -8
  40. package/lib/field/Field.d.ts +25 -0
  41. package/lib/field/Field.js +9 -0
  42. package/lib/field/index.d.ts +13 -0
  43. package/lib/floating-bubble/FloatingBubble.d.ts +16 -21
  44. package/lib/floating-bubble/FloatingBubble.js +6 -8
  45. package/lib/floating-bubble/index.css +1 -1
  46. package/lib/floating-bubble/index.d.ts +18 -18
  47. package/lib/floating-bubble/types.d.ts +13 -1
  48. package/lib/floating-panel/FloatingPanel.js +1 -4
  49. package/lib/index.css +1 -1
  50. package/lib/index.d.ts +1 -1
  51. package/lib/index.js +1 -1
  52. package/lib/lazyload/vue-lazyload/util.d.ts +2 -2
  53. package/lib/pagination/index.css +1 -1
  54. package/lib/radio/Radio.d.ts +18 -15
  55. package/lib/radio/Radio.js +4 -2
  56. package/lib/radio/index.css +1 -1
  57. package/lib/radio/index.d.ts +11 -9
  58. package/lib/radio/types.d.ts +1 -0
  59. package/lib/search/Search.d.ts +19 -0
  60. package/lib/search/index.d.ts +13 -0
  61. package/lib/style/base.css +1 -1
  62. package/lib/submit-bar/types.d.ts +0 -1
  63. package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
  64. package/lib/text-ellipsis/TextEllipsis.js +49 -18
  65. package/lib/text-ellipsis/index.d.ts +9 -0
  66. package/lib/uploader/Uploader.js +6 -4
  67. package/lib/uploader/UploaderPreviewItem.js +1 -1
  68. package/lib/uploader/types.d.ts +1 -0
  69. package/lib/vant.cjs.js +99 -49
  70. package/lib/vant.es.js +99 -49
  71. package/lib/vant.js +110 -187
  72. package/lib/vant.min.js +1 -1
  73. package/lib/web-types.json +1 -1
  74. package/package.json +1 -1
package/lib/vant.js CHANGED
@@ -502,7 +502,7 @@
502
502
  const parentHidden = el.offsetParent === null && style.position !== "fixed";
503
503
  return hidden || parentHidden;
504
504
  }
505
- const { width: windowWidth, height: windowHeight$1 } = useWindowSize();
505
+ const { width: windowWidth, height: windowHeight } = useWindowSize();
506
506
  function addUnit(value) {
507
507
  if (isDef(value)) {
508
508
  return isNumeric(value) ? `${value}px` : String(value);
@@ -550,7 +550,7 @@
550
550
  }
551
551
  function convertVh(value) {
552
552
  value = value.replace(/vh/g, "");
553
- return +value * windowHeight$1.value / 100;
553
+ return +value * windowHeight.value / 100;
554
554
  }
555
555
  function unitToPx(value) {
556
556
  if (typeof value === "number") {
@@ -826,7 +826,7 @@
826
826
  }
827
827
  });
828
828
  onPopupReopen(() => vue.nextTick(setHeight));
829
- vue.watch([windowWidth, windowHeight$1], setHeight);
829
+ vue.watch([windowWidth, windowHeight], setHeight);
830
830
  return height2;
831
831
  };
832
832
  function usePlaceholder(contentRef, bem2) {
@@ -2509,7 +2509,7 @@
2509
2509
  passive: true
2510
2510
  });
2511
2511
  useVisibilityChange(root, onScroll);
2512
- vue.watch([windowWidth, windowHeight$1], () => {
2512
+ vue.watch([windowWidth, windowHeight], () => {
2513
2513
  if (!root.value || isHidden(root) || !state.fixed) {
2514
2514
  return;
2515
2515
  }
@@ -2867,7 +2867,7 @@
2867
2867
  vue.watch(() => props2.initialSwipe, (value) => initialize(+value));
2868
2868
  vue.watch(count, () => initialize(state.active));
2869
2869
  vue.watch(() => props2.autoplay, autoplay);
2870
- vue.watch([windowWidth, windowHeight$1, () => props2.width, () => props2.height], resize);
2870
+ vue.watch([windowWidth, windowHeight, () => props2.width, () => props2.height], resize);
2871
2871
  vue.watch(usePageVisibility(), (visible) => {
2872
2872
  if (visible === "visible") {
2873
2873
  autoplay();
@@ -4382,8 +4382,14 @@
4382
4382
  inputAlign: String,
4383
4383
  placeholder: String,
4384
4384
  autocomplete: String,
4385
+ autocapitalize: String,
4386
+ autocorrect: String,
4385
4387
  errorMessage: String,
4386
4388
  enterkeyhint: String,
4389
+ spellcheck: {
4390
+ type: Boolean,
4391
+ default: null
4392
+ },
4387
4393
  clearTrigger: makeStringProp("focus"),
4388
4394
  formatTrigger: makeStringProp("onChange"),
4389
4395
  error: {
@@ -4711,7 +4717,10 @@
4711
4717
  autofocus: props2.autofocus,
4712
4718
  placeholder: props2.placeholder,
4713
4719
  autocomplete: props2.autocomplete,
4720
+ autocapitalize: props2.autocapitalize,
4721
+ autocorrect: props2.autocorrect,
4714
4722
  enterkeyhint: props2.enterkeyhint,
4723
+ spellcheck: props2.spellcheck,
4715
4724
  "aria-labelledby": props2.label ? `${id}-label` : void 0,
4716
4725
  onBlur,
4717
4726
  onFocus,
@@ -5693,7 +5702,6 @@
5693
5702
  const Tag = withInstall(stdin_default$1o);
5694
5703
  const checkerProps = {
5695
5704
  name: unknownProp,
5696
- shape: makeStringProp("round"),
5697
5705
  disabled: Boolean,
5698
5706
  iconSize: numericProp,
5699
5707
  modelValue: unknownProp,
@@ -5705,6 +5713,7 @@
5705
5713
  props: extend({}, checkerProps, {
5706
5714
  bem: makeRequiredProp(Function),
5707
5715
  role: String,
5716
+ shape: makeStringProp("round"),
5708
5717
  parent: Object,
5709
5718
  checked: Boolean,
5710
5719
  bindGroup: truthProp
@@ -5755,6 +5764,7 @@
5755
5764
  emit("click", event);
5756
5765
  };
5757
5766
  const renderIcon = () => {
5767
+ var _a, _b;
5758
5768
  const {
5759
5769
  bem: bem2,
5760
5770
  shape,
@@ -5767,15 +5777,24 @@
5767
5777
  disabled: disabled.value,
5768
5778
  checked
5769
5779
  }]),
5770
- "style": {
5780
+ "style": shape !== "dot" ? {
5771
5781
  fontSize: addUnit(iconSize)
5782
+ } : {
5783
+ width: addUnit(iconSize),
5784
+ height: addUnit(iconSize),
5785
+ borderColor: (_a = iconStyle.value) == null ? void 0 : _a.borderColor
5772
5786
  }
5773
5787
  }, [slots.icon ? slots.icon({
5774
5788
  checked,
5775
5789
  disabled: disabled.value
5776
- }) : vue.createVNode(Icon, {
5790
+ }) : shape !== "dot" ? vue.createVNode(Icon, {
5777
5791
  "name": "success",
5778
5792
  "style": iconStyle.value
5793
+ }, null) : vue.createVNode("div", {
5794
+ "class": bem2("icon--dot__icon"),
5795
+ "style": {
5796
+ backgroundColor: (_b = iconStyle.value) == null ? void 0 : _b.backgroundColor
5797
+ }
5779
5798
  }, null)]);
5780
5799
  };
5781
5800
  const renderLabel = () => {
@@ -5802,11 +5821,13 @@
5802
5821
  };
5803
5822
  }
5804
5823
  });
5805
- const radioProps = checkerProps;
5824
+ const radioProps = extend({}, checkerProps, {
5825
+ shape: makeStringProp("round")
5826
+ });
5806
5827
  const [name$1d, bem$19] = createNamespace("radio");
5807
5828
  var stdin_default$1m = vue.defineComponent({
5808
5829
  name: name$1d,
5809
- props: checkerProps,
5830
+ props: radioProps,
5810
5831
  emits: ["update:modelValue"],
5811
5832
  setup(props2, {
5812
5833
  emit,
@@ -7857,6 +7878,7 @@
7857
7878
  });
7858
7879
  const [name$$, bem$_] = createNamespace("checkbox");
7859
7880
  const checkboxProps = extend({}, checkerProps, {
7881
+ shape: makeStringProp("round"),
7860
7882
  bindGroup: truthProp
7861
7883
  });
7862
7884
  var stdin_default$18 = vue.defineComponent({
@@ -7930,7 +7952,7 @@
7930
7952
  const CheckboxGroup = withInstall(stdin_default$19);
7931
7953
  const [name$_, bem$Z] = createNamespace("circle");
7932
7954
  let uid = 0;
7933
- const format$1 = (rate) => Math.min(Math.max(+rate, 0), 100);
7955
+ const format = (rate) => Math.min(Math.max(+rate, 0), 100);
7934
7956
  function getPath(clockwise, viewBoxSize) {
7935
7957
  const sweepFlag = clockwise ? 1 : 0;
7936
7958
  return `M ${viewBoxSize / 2} ${viewBoxSize / 2} m 0, -500 a 500, 500 0 1, ${sweepFlag} 0, 1000 a 500, 500 0 1, ${sweepFlag} 0, -1000`;
@@ -7978,13 +8000,13 @@
7978
8000
  let rafId;
7979
8001
  const startTime = Date.now();
7980
8002
  const startRate = props2.currentRate;
7981
- const endRate = format$1(rate);
8003
+ const endRate = format(rate);
7982
8004
  const duration = Math.abs((startRate - endRate) * 1e3 / +props2.speed);
7983
8005
  const animate = () => {
7984
8006
  const now = Date.now();
7985
8007
  const progress = Math.min((now - startTime) / duration, 1);
7986
8008
  const rate2 = progress * (endRate - startRate) + startRate;
7987
- emit("update:currentRate", format$1(parseFloat(rate2.toFixed(1))));
8009
+ emit("update:currentRate", format(parseFloat(rate2.toFixed(1))));
7988
8010
  if (endRate > startRate ? rate2 < endRate : rate2 > endRate) {
7989
8011
  rafId = raf(animate);
7990
8012
  }
@@ -9210,7 +9232,7 @@
9210
9232
  const TABS_HEIGHT = 44;
9211
9233
  const rootHeight = useRect(root).height;
9212
9234
  const headerHeight = useRect(barRef).height + TABS_HEIGHT;
9213
- listHeight.value = (rootHeight > headerHeight ? rootHeight : windowHeight$1.value) - headerHeight;
9235
+ listHeight.value = (rootHeight > headerHeight ? rootHeight : windowHeight.value) - headerHeight;
9214
9236
  };
9215
9237
  const onExchange = () => {
9216
9238
  emit("exchange", currentCode.value);
@@ -9314,7 +9336,7 @@
9314
9336
  vue.watch(() => props2.code, (value) => {
9315
9337
  currentCode.value = value;
9316
9338
  });
9317
- vue.watch(windowHeight$1, updateListHeight);
9339
+ vue.watch(windowHeight, updateListHeight);
9318
9340
  vue.watch(currentCode, (value) => emit("update:code", value));
9319
9341
  vue.watch(() => props2.displayedCouponIndex, scrollToCoupon);
9320
9342
  vue.onMounted(() => {
@@ -9812,7 +9834,7 @@
9812
9834
  if (props2.direction === "down") {
9813
9835
  offset2.value = rect.bottom;
9814
9836
  } else {
9815
- offset2.value = windowHeight$1.value - rect.top;
9837
+ offset2.value = windowHeight.value - rect.top;
9816
9838
  }
9817
9839
  }
9818
9840
  };
@@ -10066,10 +10088,10 @@
10066
10088
  const DropdownItem = withInstall(stdin_default$S);
10067
10089
  const DropdownMenu = withInstall(stdin_default$T);
10068
10090
  const floatingBubbleProps = {
10091
+ gap: makeNumberProp(24),
10092
+ icon: String,
10069
10093
  axis: makeStringProp("y"),
10070
10094
  magnetic: String,
10071
- icon: String,
10072
- gap: makeNumberProp(24),
10073
10095
  offset: {
10074
10096
  type: Object,
10075
10097
  default: () => ({
@@ -10100,8 +10122,8 @@
10100
10122
  });
10101
10123
  const boundary = vue.computed(() => ({
10102
10124
  top: props2.gap,
10103
- right: windowWidth.value - state.value.height - props2.gap,
10104
- bottom: windowHeight$1.value - state.value.width - props2.gap,
10125
+ right: windowWidth.value - state.value.width - props2.gap,
10126
+ bottom: windowHeight.value - state.value.height - props2.gap,
10105
10127
  left: props2.gap
10106
10128
  }));
10107
10129
  const dragging = vue.ref(false);
@@ -10126,7 +10148,7 @@
10126
10148
  } = props2;
10127
10149
  state.value = {
10128
10150
  x: offset2.x > -1 ? offset2.x : windowWidth.value - width2 - props2.gap,
10129
- y: offset2.y > -1 ? offset2.y : windowHeight$1.value - height2 - props2.gap,
10151
+ y: offset2.y > -1 ? offset2.y : windowHeight.value - height2 - props2.gap,
10130
10152
  width: width2,
10131
10153
  height: height2
10132
10154
  };
@@ -10199,9 +10221,7 @@
10199
10221
  initialized = true;
10200
10222
  });
10201
10223
  });
10202
- vue.watch([windowWidth, windowHeight$1, () => props2.gap, () => props2.offset], () => updateState(), {
10203
- deep: true
10204
- });
10224
+ vue.watch([windowWidth, windowHeight, () => props2.gap, () => props2.offset], updateState);
10205
10225
  const show = vue.ref(true);
10206
10226
  vue.onActivated(() => {
10207
10227
  show.value = true;
@@ -10233,9 +10253,6 @@
10233
10253
  }
10234
10254
  });
10235
10255
  const FloatingBubble = withInstall(stdin_default$R);
10236
- const {
10237
- height: windowHeight
10238
- } = useWindowSize();
10239
10256
  const floatingPanelProps = {
10240
10257
  height: makeNumericProp(0),
10241
10258
  anchors: makeArrayProp(),
@@ -10960,7 +10977,7 @@
10960
10977
  swipeTo
10961
10978
  });
10962
10979
  vue.onMounted(resize);
10963
- vue.watch([windowWidth, windowHeight$1], resize);
10980
+ vue.watch([windowWidth, windowHeight], resize);
10964
10981
  vue.watch(() => props2.startPosition, (value) => setActive(+value));
10965
10982
  vue.watch(() => props2.show, (value) => {
10966
10983
  const {
@@ -12370,7 +12387,7 @@
12370
12387
  var round = Math.round;
12371
12388
  function getUAString() {
12372
12389
  var uaData = navigator.userAgentData;
12373
- if (uaData != null && uaData.brands) {
12390
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
12374
12391
  return uaData.brands.map(function(item) {
12375
12392
  return item.brand + "/" + item.version;
12376
12393
  }).join(" ");
@@ -12664,89 +12681,6 @@
12664
12681
  return pending;
12665
12682
  };
12666
12683
  }
12667
- function format(str) {
12668
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12669
- args[_key - 1] = arguments[_key];
12670
- }
12671
- return [].concat(args).reduce(function(p, c) {
12672
- return p.replace(/%s/, c);
12673
- }, str);
12674
- }
12675
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
12676
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
12677
- var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
12678
- function validateModifiers(modifiers) {
12679
- modifiers.forEach(function(modifier) {
12680
- [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self2) {
12681
- return self2.indexOf(value) === index;
12682
- }).forEach(function(key) {
12683
- switch (key) {
12684
- case "name":
12685
- if (typeof modifier.name !== "string") {
12686
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
12687
- }
12688
- break;
12689
- case "enabled":
12690
- if (typeof modifier.enabled !== "boolean") {
12691
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
12692
- }
12693
- break;
12694
- case "phase":
12695
- if (modifierPhases.indexOf(modifier.phase) < 0) {
12696
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
12697
- }
12698
- break;
12699
- case "fn":
12700
- if (typeof modifier.fn !== "function") {
12701
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
12702
- }
12703
- break;
12704
- case "effect":
12705
- if (modifier.effect != null && typeof modifier.effect !== "function") {
12706
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
12707
- }
12708
- break;
12709
- case "requires":
12710
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
12711
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
12712
- }
12713
- break;
12714
- case "requiresIfExists":
12715
- if (!Array.isArray(modifier.requiresIfExists)) {
12716
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
12717
- }
12718
- break;
12719
- case "options":
12720
- case "data":
12721
- break;
12722
- default:
12723
- console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
12724
- return '"' + s + '"';
12725
- }).join(", ") + '; but "' + key + '" was provided.');
12726
- }
12727
- modifier.requires && modifier.requires.forEach(function(requirement) {
12728
- if (modifiers.find(function(mod) {
12729
- return mod.name === requirement;
12730
- }) == null) {
12731
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
12732
- }
12733
- });
12734
- });
12735
- });
12736
- }
12737
- function uniqueBy(arr, fn2) {
12738
- var identifiers = /* @__PURE__ */ new Set();
12739
- return arr.filter(function(item) {
12740
- var identifier = fn2(item);
12741
- if (!identifiers.has(identifier)) {
12742
- identifiers.add(identifier);
12743
- return true;
12744
- }
12745
- });
12746
- }
12747
- function getBasePlacement(placement) {
12748
- return placement.split("-")[0];
12749
- }
12750
12684
  function mergeByName(modifiers) {
12751
12685
  var merged = modifiers.reduce(function(merged2, current2) {
12752
12686
  var existing = merged2[current2.name];
@@ -12760,6 +12694,9 @@
12760
12694
  return merged[key];
12761
12695
  });
12762
12696
  }
12697
+ function getBasePlacement(placement) {
12698
+ return placement.split("-")[0];
12699
+ }
12763
12700
  function getVariation(placement) {
12764
12701
  return placement.split("-")[1];
12765
12702
  }
@@ -12818,8 +12755,6 @@
12818
12755
  }
12819
12756
  return offsets;
12820
12757
  }
12821
- var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
12822
- var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
12823
12758
  var DEFAULT_OPTIONS = {
12824
12759
  placement: "bottom",
12825
12760
  modifiers: [],
@@ -12870,28 +12805,6 @@
12870
12805
  state.orderedModifiers = orderedModifiers.filter(function(m) {
12871
12806
  return m.enabled;
12872
12807
  });
12873
- {
12874
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
12875
- var name2 = _ref.name;
12876
- return name2;
12877
- });
12878
- validateModifiers(modifiers);
12879
- if (getBasePlacement(state.options.placement) === auto) {
12880
- var flipModifier = state.orderedModifiers.find(function(_ref2) {
12881
- var name2 = _ref2.name;
12882
- return name2 === "flip";
12883
- });
12884
- if (!flipModifier) {
12885
- console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
12886
- }
12887
- }
12888
- var _getComputedStyle = getComputedStyle(popper), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
12889
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
12890
- return parseFloat(margin);
12891
- })) {
12892
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
12893
- }
12894
- }
12895
12808
  runModifierEffects();
12896
12809
  return instance2.update();
12897
12810
  },
@@ -12906,9 +12819,6 @@
12906
12819
  }
12907
12820
  var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
12908
12821
  if (!areValidElements(reference2, popper2)) {
12909
- {
12910
- console.error(INVALID_ELEMENT_ERROR);
12911
- }
12912
12822
  return;
12913
12823
  }
12914
12824
  state.rects = {
@@ -12920,15 +12830,7 @@
12920
12830
  state.orderedModifiers.forEach(function(modifier) {
12921
12831
  return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
12922
12832
  });
12923
- var __debug_loops__ = 0;
12924
12833
  for (var index = 0; index < state.orderedModifiers.length; index++) {
12925
- {
12926
- __debug_loops__ += 1;
12927
- if (__debug_loops__ > 100) {
12928
- console.error(INFINITE_LOOP_ERROR);
12929
- break;
12930
- }
12931
- }
12932
12834
  if (state.reset === true) {
12933
12835
  state.reset = false;
12934
12836
  index = -1;
@@ -12959,9 +12861,6 @@
12959
12861
  }
12960
12862
  };
12961
12863
  if (!areValidElements(reference, popper)) {
12962
- {
12963
- console.error(INVALID_ELEMENT_ERROR);
12964
- }
12965
12864
  return instance2;
12966
12865
  }
12967
12866
  instance2.setOptions(options).then(function(state2) {
@@ -12970,8 +12869,8 @@
12970
12869
  }
12971
12870
  });
12972
12871
  function runModifierEffects() {
12973
- state.orderedModifiers.forEach(function(_ref3) {
12974
- var name2 = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect3 = _ref3.effect;
12872
+ state.orderedModifiers.forEach(function(_ref) {
12873
+ var name2 = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect3 = _ref.effect;
12975
12874
  if (typeof effect3 === "function") {
12976
12875
  var cleanupFn = effect3({
12977
12876
  state,
@@ -13052,9 +12951,8 @@
13052
12951
  bottom: "auto",
13053
12952
  left: "auto"
13054
12953
  };
13055
- function roundOffsetsByDPR(_ref) {
12954
+ function roundOffsetsByDPR(_ref, win) {
13056
12955
  var x = _ref.x, y = _ref.y;
13057
- var win = window;
13058
12956
  var dpr = win.devicePixelRatio || 1;
13059
12957
  return {
13060
12958
  x: round(x * dpr) / dpr || 0,
@@ -13116,7 +13014,7 @@
13116
13014
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
13117
13015
  x,
13118
13016
  y
13119
- }) : {
13017
+ }, getWindow(popper)) : {
13120
13018
  x,
13121
13019
  y
13122
13020
  };
@@ -13131,14 +13029,6 @@
13131
13029
  function computeStyles(_ref5) {
13132
13030
  var state = _ref5.state, options = _ref5.options;
13133
13031
  var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
13134
- {
13135
- var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
13136
- if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
13137
- return transitionProperty.indexOf(property) >= 0;
13138
- })) {
13139
- console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
13140
- }
13141
- }
13142
13032
  var commonStyles = {
13143
13033
  placement: getBasePlacement(state.placement),
13144
13034
  variation: getVariation(state.placement),
@@ -15888,7 +15778,8 @@
15888
15778
  dots: makeStringProp("..."),
15889
15779
  content: makeStringProp(""),
15890
15780
  expandText: makeStringProp(""),
15891
- collapseText: makeStringProp("")
15781
+ collapseText: makeStringProp(""),
15782
+ position: makeStringProp("end")
15892
15783
  };
15893
15784
  var stdin_default$9 = vue.defineComponent({
15894
15785
  name: name$4,
@@ -15901,6 +15792,7 @@
15901
15792
  const expanded = vue.ref(false);
15902
15793
  const hasAction = vue.ref(false);
15903
15794
  const root = vue.ref();
15795
+ const actionText = vue.computed(() => expanded.value ? props2.expandText : props2.collapseText);
15904
15796
  const pxToNum = (value) => {
15905
15797
  if (!value)
15906
15798
  return 0;
@@ -15929,24 +15821,53 @@
15929
15821
  };
15930
15822
  const calcEllipsisText = (container2, maxHeight2) => {
15931
15823
  const {
15932
- dots,
15933
15824
  content,
15934
- expandText
15825
+ position,
15826
+ dots
15935
15827
  } = props2;
15936
- let left2 = 0;
15937
- let right2 = content.length;
15938
- let res = -1;
15939
- while (left2 <= right2) {
15940
- const mid = Math.floor((left2 + right2) / 2);
15941
- container2.innerText = content.slice(0, mid) + dots + expandText;
15942
- if (container2.offsetHeight <= maxHeight2) {
15943
- left2 = mid + 1;
15944
- res = mid;
15945
- } else {
15946
- right2 = mid - 1;
15828
+ const end2 = content.length;
15829
+ const calcEllipse = () => {
15830
+ const tail = (left2, right2) => {
15831
+ if (right2 - left2 <= 1) {
15832
+ if (position === "end") {
15833
+ return content.slice(0, left2) + dots;
15834
+ }
15835
+ return dots + content.slice(right2, end2);
15836
+ }
15837
+ const middle2 = Math.round(left2 + right2 >> 1);
15838
+ if (position === "end") {
15839
+ container2.innerText = content.slice(0, middle2) + dots + actionText.value;
15840
+ } else {
15841
+ container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
15842
+ }
15843
+ if (container2.offsetHeight > maxHeight2) {
15844
+ if (position === "end") {
15845
+ return tail(left2, middle2);
15846
+ }
15847
+ return tail(middle2, right2);
15848
+ }
15849
+ if (position === "end") {
15850
+ return tail(middle2, right2);
15851
+ }
15852
+ return tail(left2, middle2);
15853
+ };
15854
+ container2.innerText = tail(0, end2);
15855
+ };
15856
+ const middleTail = (leftPart, rightPart) => {
15857
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
15858
+ return content.slice(0, leftPart[1]) + dots + dots + content.slice(rightPart[1], end2);
15947
15859
  }
15948
- }
15949
- return content.slice(0, res) + dots;
15860
+ const leftMiddle = Math.floor(leftPart[0] + leftPart[1] >> 1);
15861
+ const rightMiddle = Math.ceil(rightPart[0] + rightPart[1] >> 1);
15862
+ container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + actionText.value + props2.dots + props2.content.slice(rightMiddle, end2);
15863
+ if (container2.offsetHeight >= maxHeight2) {
15864
+ return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
15865
+ }
15866
+ return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
15867
+ };
15868
+ const middle = 0 + end2 >> 1;
15869
+ props2.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end2]) : calcEllipse();
15870
+ return container2.innerText;
15950
15871
  };
15951
15872
  const container = cloneContainer();
15952
15873
  if (!container)
@@ -15956,7 +15877,7 @@
15956
15877
  paddingTop,
15957
15878
  lineHeight
15958
15879
  } = container.style;
15959
- const maxHeight = (Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
15880
+ const maxHeight = Math.ceil((Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
15960
15881
  if (maxHeight < container.offsetHeight) {
15961
15882
  hasAction.value = true;
15962
15883
  text.value = calcEllipsisText(container, maxHeight);
@@ -15975,7 +15896,7 @@
15975
15896
  "onClick": onClickAction
15976
15897
  }, [expanded.value ? props2.collapseText : props2.expandText]);
15977
15898
  vue.onMounted(calcEllipsised);
15978
- vue.watch(() => [props2.content, props2.rows], calcEllipsised);
15899
+ vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
15979
15900
  useEventListener("resize", calcEllipsised);
15980
15901
  return () => vue.createVNode("div", {
15981
15902
  "ref": root,
@@ -16350,7 +16271,7 @@
16350
16271
  if (isImageFile(item)) {
16351
16272
  return vue.createVNode(Image$1, {
16352
16273
  "fit": imageFit,
16353
- "src": item.content || item.url,
16274
+ "src": item.objectUrl || item.content || item.url,
16354
16275
  "class": bem$1("preview-image"),
16355
16276
  "width": Array.isArray(previewSize) ? previewSize[0] : previewSize,
16356
16277
  "height": Array.isArray(previewSize) ? previewSize[1] : previewSize,
@@ -16468,7 +16389,8 @@
16468
16389
  const result = {
16469
16390
  file,
16470
16391
  status: "",
16471
- message: ""
16392
+ message: "",
16393
+ objectUrl: URL.createObjectURL(file)
16472
16394
  };
16473
16395
  if (contents[index]) {
16474
16396
  result.content = contents[index];
@@ -16482,7 +16404,8 @@
16482
16404
  const result = {
16483
16405
  file: files,
16484
16406
  status: "",
16485
- message: ""
16407
+ message: "",
16408
+ objectUrl: URL.createObjectURL(files)
16486
16409
  };
16487
16410
  if (content) {
16488
16411
  result.content = content;
@@ -16524,8 +16447,8 @@
16524
16447
  if (props2.previewFullImage) {
16525
16448
  const imageFiles = props2.modelValue.filter(isImageFile);
16526
16449
  const images = imageFiles.map((item2) => {
16527
- if (item2.file && !item2.url && item2.status !== "failed") {
16528
- item2.url = URL.createObjectURL(item2.file);
16450
+ if (item2.objectUrl && !item2.url && item2.status !== "failed") {
16451
+ item2.url = item2.objectUrl;
16529
16452
  urls.push(item2.url);
16530
16453
  }
16531
16454
  return item2.url;
@@ -17612,7 +17535,7 @@
17612
17535
  });
17613
17536
  }
17614
17537
  };
17615
- const version = "4.6.0";
17538
+ const version = "4.6.2";
17616
17539
  function install(app) {
17617
17540
  const components = [
17618
17541
  ActionBar,