vant 4.6.1 → 4.6.3

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 (104) hide show
  1. package/README.md +1 -1
  2. package/es/address-list/AddressList.d.ts +13 -0
  3. package/es/address-list/AddressList.mjs +3 -2
  4. package/es/address-list/index.d.ts +9 -0
  5. package/es/checkbox/Checkbox.d.ts +14 -23
  6. package/es/checkbox/Checkbox.mjs +2 -1
  7. package/es/checkbox/Checker.d.ts +6 -15
  8. package/es/checkbox/Checker.mjs +18 -6
  9. package/es/checkbox/index.d.ts +2 -9
  10. package/es/checkbox-group/CheckboxGroup.d.ts +14 -1
  11. package/es/checkbox-group/CheckboxGroup.mjs +2 -1
  12. package/es/checkbox-group/index.d.ts +9 -0
  13. package/es/field/Field.d.ts +25 -0
  14. package/es/field/Field.mjs +9 -0
  15. package/es/field/index.d.ts +13 -0
  16. package/es/floating-bubble/FloatingBubble.d.ts +16 -21
  17. package/es/floating-bubble/FloatingBubble.mjs +6 -8
  18. package/es/floating-bubble/index.css +1 -1
  19. package/es/floating-bubble/index.d.ts +19 -19
  20. package/es/floating-bubble/types.d.ts +12 -0
  21. package/es/index.d.ts +1 -1
  22. package/es/index.mjs +1 -1
  23. package/es/pagination/index.css +1 -1
  24. package/es/radio/Radio.d.ts +18 -25
  25. package/es/radio/Radio.mjs +5 -3
  26. package/es/radio/index.css +1 -1
  27. package/es/radio/index.d.ts +4 -9
  28. package/es/radio/types.d.ts +1 -0
  29. package/es/radio-group/RadioGroup.d.ts +4 -0
  30. package/es/radio-group/RadioGroup.mjs +1 -0
  31. package/es/radio-group/index.d.ts +2 -0
  32. package/es/search/Search.d.ts +19 -0
  33. package/es/search/index.d.ts +13 -0
  34. package/es/tab/Tab.mjs +2 -2
  35. package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
  36. package/es/text-ellipsis/TextEllipsis.mjs +50 -19
  37. package/es/text-ellipsis/index.d.ts +9 -0
  38. package/es/utils/basic.d.ts +8 -0
  39. package/es/utils/basic.mjs +28 -7
  40. package/es/utils/create.mjs +1 -2
  41. package/es/utils/deep-assign.mjs +1 -1
  42. package/es/utils/deep-clone.mjs +1 -1
  43. package/es/utils/dom.mjs +1 -1
  44. package/es/utils/format.mjs +1 -1
  45. package/es/utils/index.d.ts +0 -1
  46. package/es/utils/index.mjs +0 -1
  47. package/es/utils/interceptor.mjs +1 -2
  48. package/lib/address-list/AddressList.d.ts +13 -0
  49. package/lib/address-list/AddressList.js +3 -2
  50. package/lib/address-list/index.d.ts +9 -0
  51. package/lib/checkbox/Checkbox.d.ts +14 -23
  52. package/lib/checkbox/Checkbox.js +1 -0
  53. package/lib/checkbox/Checker.d.ts +6 -15
  54. package/lib/checkbox/Checker.js +17 -5
  55. package/lib/checkbox/index.d.ts +2 -9
  56. package/lib/checkbox-group/CheckboxGroup.d.ts +14 -1
  57. package/lib/checkbox-group/CheckboxGroup.js +1 -0
  58. package/lib/checkbox-group/index.d.ts +9 -0
  59. package/lib/field/Field.d.ts +25 -0
  60. package/lib/field/Field.js +9 -0
  61. package/lib/field/index.d.ts +13 -0
  62. package/lib/floating-bubble/FloatingBubble.d.ts +16 -21
  63. package/lib/floating-bubble/FloatingBubble.js +6 -8
  64. package/lib/floating-bubble/index.css +1 -1
  65. package/lib/floating-bubble/index.d.ts +19 -19
  66. package/lib/floating-bubble/types.d.ts +12 -0
  67. package/lib/index.css +1 -1
  68. package/lib/index.d.ts +1 -1
  69. package/lib/index.js +1 -1
  70. package/lib/pagination/index.css +1 -1
  71. package/lib/radio/Radio.d.ts +18 -25
  72. package/lib/radio/Radio.js +4 -2
  73. package/lib/radio/index.css +1 -1
  74. package/lib/radio/index.d.ts +4 -9
  75. package/lib/radio/types.d.ts +1 -0
  76. package/lib/radio-group/RadioGroup.d.ts +4 -0
  77. package/lib/radio-group/RadioGroup.js +1 -0
  78. package/lib/radio-group/index.d.ts +2 -0
  79. package/lib/search/Search.d.ts +19 -0
  80. package/lib/search/index.d.ts +13 -0
  81. package/lib/tab/Tab.js +2 -2
  82. package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
  83. package/lib/text-ellipsis/TextEllipsis.js +49 -18
  84. package/lib/text-ellipsis/index.d.ts +9 -0
  85. package/lib/utils/basic.d.ts +8 -0
  86. package/lib/utils/basic.js +29 -8
  87. package/lib/utils/create.js +1 -2
  88. package/lib/utils/deep-assign.js +3 -3
  89. package/lib/utils/deep-clone.js +3 -3
  90. package/lib/utils/dom.js +2 -2
  91. package/lib/utils/format.js +4 -4
  92. package/lib/utils/index.d.ts +0 -1
  93. package/lib/utils/index.js +0 -1
  94. package/lib/utils/interceptor.js +1 -2
  95. package/lib/vant.cjs.js +107 -48
  96. package/lib/vant.es.js +107 -48
  97. package/lib/vant.js +172 -59
  98. package/lib/vant.min.js +1 -1
  99. package/lib/web-types.json +1 -1
  100. package/package.json +1 -1
  101. package/es/utils/validate.d.ts +0 -9
  102. package/es/utils/validate.mjs +0 -22
  103. package/lib/utils/validate.d.ts +0 -9
  104. package/lib/utils/validate.js +0 -41
package/lib/vant.js CHANGED
@@ -2,10 +2,14 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.vant = {}, global.Vue));
3
3
  })(this, function(exports2, vue) {
4
4
  "use strict";
5
+ function noop() {
6
+ }
7
+ const extend = Object.assign;
8
+ const inBrowser$1 = typeof window !== "undefined";
9
+ const isObject$1 = (val) => val !== null && typeof val === "object";
5
10
  const isDef = (val) => val !== void 0 && val !== null;
6
11
  const isFunction = (val) => typeof val === "function";
7
- const isObject = (val) => val !== null && typeof val === "object";
8
- const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
12
+ const isPromise = (val) => isObject$1(val) && isFunction(val.then) && isFunction(val.catch);
9
13
  const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
10
14
  function isMobile(value) {
11
15
  value = value.replace(/[^-|\d]/g, "");
@@ -13,26 +17,25 @@
13
17
  }
14
18
  const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
15
19
  const isIOS$1 = () => inBrowser$1 ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
16
- function noop() {
17
- }
18
- const extend = Object.assign;
19
- const inBrowser$1 = typeof window !== "undefined";
20
20
  function get(object, path) {
21
21
  const keys = path.split(".");
22
22
  let result = object;
23
23
  keys.forEach((key) => {
24
24
  var _a;
25
- result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
25
+ result = isObject$1(result) ? (_a = result[key]) != null ? _a : "" : "";
26
26
  });
27
27
  return result;
28
28
  }
29
29
  function pick(obj, keys, ignoreUndefined) {
30
- return keys.reduce((ret, key) => {
31
- if (!ignoreUndefined || obj[key] !== void 0) {
32
- ret[key] = obj[key];
33
- }
34
- return ret;
35
- }, {});
30
+ return keys.reduce(
31
+ (ret, key) => {
32
+ if (!ignoreUndefined || obj[key] !== void 0) {
33
+ ret[key] = obj[key];
34
+ }
35
+ return ret;
36
+ },
37
+ {}
38
+ );
36
39
  }
37
40
  const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
38
41
  const toArray = (item) => Array.isArray(item) ? item : [item];
@@ -614,7 +617,7 @@
614
617
  if (!isDef(val)) {
615
618
  return;
616
619
  }
617
- if (!hasOwnProperty.call(to, key) || !isObject(val)) {
620
+ if (!hasOwnProperty.call(to, key) || !isObject$1(val)) {
618
621
  to[key] = val;
619
622
  } else {
620
623
  to[key] = deepAssign(Object(to[key]), val);
@@ -2292,7 +2295,9 @@
2292
2295
  });
2293
2296
  return propRef;
2294
2297
  };
2298
+ const isArray = Array.isArray;
2295
2299
  const isString = (val) => typeof val === "string";
2300
+ const isObject = (val) => val !== null && typeof val === "object";
2296
2301
  const cacheStringFunction = (fn) => {
2297
2302
  const cache = /* @__PURE__ */ Object.create(null);
2298
2303
  return (str) => {
@@ -2304,6 +2309,38 @@
2304
2309
  const hyphenate = cacheStringFunction(
2305
2310
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
2306
2311
  );
2312
+ function normalizeStyle(value) {
2313
+ if (isArray(value)) {
2314
+ const res = {};
2315
+ for (let i = 0; i < value.length; i++) {
2316
+ const item = value[i];
2317
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
2318
+ if (normalized) {
2319
+ for (const key in normalized) {
2320
+ res[key] = normalized[key];
2321
+ }
2322
+ }
2323
+ }
2324
+ return res;
2325
+ } else if (isString(value)) {
2326
+ return value;
2327
+ } else if (isObject(value)) {
2328
+ return value;
2329
+ }
2330
+ }
2331
+ const listDelimiterRE = /;(?![^(]*\))/g;
2332
+ const propertyDelimiterRE = /:([^]+)/;
2333
+ const styleCommentRE = /\/\*[^]*?\*\//g;
2334
+ function parseStringStyle(cssText) {
2335
+ const ret = {};
2336
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
2337
+ if (item) {
2338
+ const tmp = item.split(propertyDelimiterRE);
2339
+ tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
2340
+ }
2341
+ });
2342
+ return ret;
2343
+ }
2307
2344
  function stringifyStyle(styles) {
2308
2345
  let ret = "";
2309
2346
  if (!styles || isString(styles)) {
@@ -2318,6 +2355,26 @@
2318
2355
  }
2319
2356
  return ret;
2320
2357
  }
2358
+ function normalizeClass(value) {
2359
+ let res = "";
2360
+ if (isString(value)) {
2361
+ res = value;
2362
+ } else if (isArray(value)) {
2363
+ for (let i = 0; i < value.length; i++) {
2364
+ const normalized = normalizeClass(value[i]);
2365
+ if (normalized) {
2366
+ res += normalized + " ";
2367
+ }
2368
+ }
2369
+ } else if (isObject(value)) {
2370
+ for (const name2 in value) {
2371
+ if (value[name2]) {
2372
+ res += name2 + " ";
2373
+ }
2374
+ }
2375
+ }
2376
+ return res.trim();
2377
+ }
2321
2378
  function scrollLeftTo(scroller, to, duration) {
2322
2379
  let rafId;
2323
2380
  let count = 0;
@@ -3512,8 +3569,8 @@
3512
3569
  titleClass,
3513
3570
  titleStyle
3514
3571
  } = props2;
3515
- parsedClass.value = titleClass ? vue.normalizeClass(titleClass) : "";
3516
- parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? stringifyStyle(vue.normalizeStyle(titleStyle)) : titleStyle;
3572
+ parsedClass.value = titleClass ? normalizeClass(titleClass) : "";
3573
+ parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? stringifyStyle(normalizeStyle(titleStyle)) : titleStyle;
3517
3574
  });
3518
3575
  const renderTitle = (onClickTab) => vue.createVNode(TabTitle, vue.mergeProps({
3519
3576
  "key": id,
@@ -4332,7 +4389,7 @@
4332
4389
  const scrollTop = getRootScrollTop();
4333
4390
  input.style.height = "auto";
4334
4391
  let height2 = input.scrollHeight;
4335
- if (isObject(autosize)) {
4392
+ if (isObject$1(autosize)) {
4336
4393
  const { maxHeight, minHeight } = autosize;
4337
4394
  if (maxHeight !== void 0) {
4338
4395
  height2 = Math.min(height2, maxHeight);
@@ -4382,8 +4439,14 @@
4382
4439
  inputAlign: String,
4383
4440
  placeholder: String,
4384
4441
  autocomplete: String,
4442
+ autocapitalize: String,
4443
+ autocorrect: String,
4385
4444
  errorMessage: String,
4386
4445
  enterkeyhint: String,
4446
+ spellcheck: {
4447
+ type: Boolean,
4448
+ default: null
4449
+ },
4387
4450
  clearTrigger: makeStringProp("focus"),
4388
4451
  formatTrigger: makeStringProp("onChange"),
4389
4452
  error: {
@@ -4711,7 +4774,10 @@
4711
4774
  autofocus: props2.autofocus,
4712
4775
  placeholder: props2.placeholder,
4713
4776
  autocomplete: props2.autocomplete,
4777
+ autocapitalize: props2.autocapitalize,
4778
+ autocorrect: props2.autocorrect,
4714
4779
  enterkeyhint: props2.enterkeyhint,
4780
+ spellcheck: props2.spellcheck,
4715
4781
  "aria-labelledby": props2.label ? `${id}-label` : void 0,
4716
4782
  onBlur,
4717
4783
  onFocus,
@@ -5061,7 +5127,7 @@
5061
5127
  let currentOptions$2 = extend({}, defaultOptions$1);
5062
5128
  const defaultOptionsMap = /* @__PURE__ */ new Map();
5063
5129
  function parseOptions$1(message) {
5064
- if (isObject(message)) {
5130
+ if (isObject$1(message)) {
5065
5131
  return message;
5066
5132
  }
5067
5133
  return {
@@ -5361,7 +5427,7 @@
5361
5427
  const data = vue.reactive({});
5362
5428
  const showAreaPopup = vue.ref(false);
5363
5429
  const detailFocused = vue.ref(false);
5364
- const areaListLoaded = vue.computed(() => isObject(props2.areaList) && Object.keys(props2.areaList).length);
5430
+ const areaListLoaded = vue.computed(() => isObject$1(props2.areaList) && Object.keys(props2.areaList).length);
5365
5431
  const areaText = vue.computed(() => {
5366
5432
  const {
5367
5433
  province,
@@ -5584,6 +5650,7 @@
5584
5650
  const AddressEdit = withInstall(stdin_default$1q);
5585
5651
  const [name$1f, bem$1b] = createNamespace("radio-group");
5586
5652
  const radioGroupProps = {
5653
+ shape: String,
5587
5654
  disabled: Boolean,
5588
5655
  iconSize: numericProp,
5589
5656
  direction: String,
@@ -5693,7 +5760,6 @@
5693
5760
  const Tag = withInstall(stdin_default$1o);
5694
5761
  const checkerProps = {
5695
5762
  name: unknownProp,
5696
- shape: makeStringProp("round"),
5697
5763
  disabled: Boolean,
5698
5764
  iconSize: numericProp,
5699
5765
  modelValue: unknownProp,
@@ -5705,6 +5771,7 @@
5705
5771
  props: extend({}, checkerProps, {
5706
5772
  bem: makeRequiredProp(Function),
5707
5773
  role: String,
5774
+ shape: String,
5708
5775
  parent: Object,
5709
5776
  checked: Boolean,
5710
5777
  bindGroup: truthProp
@@ -5743,6 +5810,9 @@
5743
5810
  };
5744
5811
  }
5745
5812
  });
5813
+ const shape = vue.computed(() => {
5814
+ return props2.shape || getParentProp("shape") || "round";
5815
+ });
5746
5816
  const onClick = (event) => {
5747
5817
  const {
5748
5818
  target
@@ -5755,27 +5825,36 @@
5755
5825
  emit("click", event);
5756
5826
  };
5757
5827
  const renderIcon = () => {
5828
+ var _a, _b;
5758
5829
  const {
5759
5830
  bem: bem2,
5760
- shape,
5761
5831
  checked
5762
5832
  } = props2;
5763
5833
  const iconSize = props2.iconSize || getParentProp("iconSize");
5764
5834
  return vue.createVNode("div", {
5765
5835
  "ref": iconRef,
5766
- "class": bem2("icon", [shape, {
5836
+ "class": bem2("icon", [shape.value, {
5767
5837
  disabled: disabled.value,
5768
5838
  checked
5769
5839
  }]),
5770
- "style": {
5840
+ "style": shape.value !== "dot" ? {
5771
5841
  fontSize: addUnit(iconSize)
5842
+ } : {
5843
+ width: addUnit(iconSize),
5844
+ height: addUnit(iconSize),
5845
+ borderColor: (_a = iconStyle.value) == null ? void 0 : _a.borderColor
5772
5846
  }
5773
5847
  }, [slots.icon ? slots.icon({
5774
5848
  checked,
5775
5849
  disabled: disabled.value
5776
- }) : vue.createVNode(Icon, {
5850
+ }) : shape.value !== "dot" ? vue.createVNode(Icon, {
5777
5851
  "name": "success",
5778
5852
  "style": iconStyle.value
5853
+ }, null) : vue.createVNode("div", {
5854
+ "class": bem2("icon--dot__icon"),
5855
+ "style": {
5856
+ backgroundColor: (_b = iconStyle.value) == null ? void 0 : _b.backgroundColor
5857
+ }
5779
5858
  }, null)]);
5780
5859
  };
5781
5860
  const renderLabel = () => {
@@ -5802,11 +5881,13 @@
5802
5881
  };
5803
5882
  }
5804
5883
  });
5805
- const radioProps = checkerProps;
5884
+ const radioProps = extend({}, checkerProps, {
5885
+ shape: String
5886
+ });
5806
5887
  const [name$1d, bem$19] = createNamespace("radio");
5807
5888
  var stdin_default$1m = vue.defineComponent({
5808
5889
  name: name$1d,
5809
- props: checkerProps,
5890
+ props: radioProps,
5810
5891
  emits: ["update:modelValue"],
5811
5892
  setup(props2, {
5812
5893
  emit,
@@ -5930,6 +6011,7 @@
5930
6011
  switchable: truthProp,
5931
6012
  disabledText: String,
5932
6013
  disabledList: makeArrayProp(),
6014
+ showAddButton: truthProp,
5933
6015
  addButtonText: String,
5934
6016
  defaultTagText: String,
5935
6017
  rightIcon: makeStringProp("edit")
@@ -5971,7 +6053,7 @@
5971
6053
  return list.map((item, index) => renderItem(item, index, disabled));
5972
6054
  }
5973
6055
  };
5974
- const renderBottom = () => vue.createVNode("div", {
6056
+ const renderBottom = () => props2.showAddButton ? vue.createVNode("div", {
5975
6057
  "class": [bem$17("bottom"), "van-safe-area-bottom"]
5976
6058
  }, [vue.createVNode(Button, {
5977
6059
  "round": true,
@@ -5980,7 +6062,7 @@
5980
6062
  "text": props2.addButtonText || t$h("add"),
5981
6063
  "class": bem$17("add"),
5982
6064
  "onClick": () => emit("add")
5983
- }, null)]);
6065
+ }, null)]) : void 0;
5984
6066
  return () => {
5985
6067
  var _a, _b;
5986
6068
  const List2 = renderList(props2.list);
@@ -7796,6 +7878,7 @@
7796
7878
  const [name$10, bem$$] = createNamespace("checkbox-group");
7797
7879
  const checkboxGroupProps = {
7798
7880
  max: numericProp,
7881
+ shape: makeStringProp("round"),
7799
7882
  disabled: Boolean,
7800
7883
  iconSize: numericProp,
7801
7884
  direction: String,
@@ -7857,6 +7940,7 @@
7857
7940
  });
7858
7941
  const [name$$, bem$_] = createNamespace("checkbox");
7859
7942
  const checkboxProps = extend({}, checkerProps, {
7943
+ shape: String,
7860
7944
  bindGroup: truthProp
7861
7945
  });
7862
7946
  var stdin_default$18 = vue.defineComponent({
@@ -8008,7 +8092,7 @@
8008
8092
  strokeLinecap
8009
8093
  } = props2;
8010
8094
  const offset2 = PERIMETER * currentRate / 100;
8011
- const color = isObject(props2.color) ? `url(#${id})` : props2.color;
8095
+ const color = isObject$1(props2.color) ? `url(#${id})` : props2.color;
8012
8096
  const style = {
8013
8097
  stroke: color,
8014
8098
  strokeWidth: `${+strokeWidth + 1}px`,
@@ -8038,7 +8122,7 @@
8038
8122
  const {
8039
8123
  color
8040
8124
  } = props2;
8041
- if (!isObject(color)) {
8125
+ if (!isObject$1(color)) {
8042
8126
  return;
8043
8127
  }
8044
8128
  const Stops = Object.keys(color).sort((a, b) => parseFloat(a) - parseFloat(b)).map((key, index) => vue.createVNode("stop", {
@@ -10066,10 +10150,10 @@
10066
10150
  const DropdownItem = withInstall(stdin_default$S);
10067
10151
  const DropdownMenu = withInstall(stdin_default$T);
10068
10152
  const floatingBubbleProps = {
10153
+ gap: makeNumberProp(24),
10154
+ icon: String,
10069
10155
  axis: makeStringProp("y"),
10070
10156
  magnetic: String,
10071
- icon: String,
10072
- gap: makeNumberProp(24),
10073
10157
  offset: {
10074
10158
  type: Object,
10075
10159
  default: () => ({
@@ -10100,8 +10184,8 @@
10100
10184
  });
10101
10185
  const boundary = vue.computed(() => ({
10102
10186
  top: props2.gap,
10103
- right: windowWidth.value - state.value.height - props2.gap,
10104
- bottom: windowHeight.value - state.value.width - props2.gap,
10187
+ right: windowWidth.value - state.value.width - props2.gap,
10188
+ bottom: windowHeight.value - state.value.height - props2.gap,
10105
10189
  left: props2.gap
10106
10190
  }));
10107
10191
  const dragging = vue.ref(false);
@@ -10199,9 +10283,7 @@
10199
10283
  initialized = true;
10200
10284
  });
10201
10285
  });
10202
- vue.watch([windowWidth, windowHeight, () => props2.gap, () => props2.offset], () => updateState(), {
10203
- deep: true
10204
- });
10286
+ vue.watch([windowWidth, windowHeight, () => props2.gap, () => props2.offset], updateState);
10205
10287
  const show = vue.ref(true);
10206
10288
  vue.onActivated(() => {
10207
10289
  show.value = true;
@@ -11750,7 +11832,7 @@
11750
11832
  });
11751
11833
  let timer;
11752
11834
  let instance;
11753
- const parseOptions = (message) => isObject(message) ? message : {
11835
+ const parseOptions = (message) => isObject$1(message) ? message : {
11754
11836
  message
11755
11837
  };
11756
11838
  function initInstance() {
@@ -15684,7 +15766,7 @@
15684
15766
  const {
15685
15767
  to
15686
15768
  } = props2;
15687
- const config = isObject(to) ? to : {
15769
+ const config = isObject$1(to) ? to : {
15688
15770
  path: to
15689
15771
  };
15690
15772
  return !!$route.matched.find((val) => {
@@ -15758,7 +15840,8 @@
15758
15840
  dots: makeStringProp("..."),
15759
15841
  content: makeStringProp(""),
15760
15842
  expandText: makeStringProp(""),
15761
- collapseText: makeStringProp("")
15843
+ collapseText: makeStringProp(""),
15844
+ position: makeStringProp("end")
15762
15845
  };
15763
15846
  var stdin_default$9 = vue.defineComponent({
15764
15847
  name: name$4,
@@ -15771,6 +15854,7 @@
15771
15854
  const expanded = vue.ref(false);
15772
15855
  const hasAction = vue.ref(false);
15773
15856
  const root = vue.ref();
15857
+ const actionText = vue.computed(() => expanded.value ? props2.expandText : props2.collapseText);
15774
15858
  const pxToNum = (value) => {
15775
15859
  if (!value)
15776
15860
  return 0;
@@ -15799,24 +15883,53 @@
15799
15883
  };
15800
15884
  const calcEllipsisText = (container2, maxHeight2) => {
15801
15885
  const {
15802
- dots,
15803
15886
  content,
15804
- expandText
15887
+ position,
15888
+ dots
15805
15889
  } = props2;
15806
- let left2 = 0;
15807
- let right2 = content.length;
15808
- let res = -1;
15809
- while (left2 <= right2) {
15810
- const mid = Math.floor((left2 + right2) / 2);
15811
- container2.innerText = content.slice(0, mid) + dots + expandText;
15812
- if (container2.offsetHeight <= maxHeight2) {
15813
- left2 = mid + 1;
15814
- res = mid;
15815
- } else {
15816
- right2 = mid - 1;
15890
+ const end2 = content.length;
15891
+ const calcEllipse = () => {
15892
+ const tail = (left2, right2) => {
15893
+ if (right2 - left2 <= 1) {
15894
+ if (position === "end") {
15895
+ return content.slice(0, left2) + dots;
15896
+ }
15897
+ return dots + content.slice(right2, end2);
15898
+ }
15899
+ const middle2 = Math.round(left2 + right2 >> 1);
15900
+ if (position === "end") {
15901
+ container2.innerText = content.slice(0, middle2) + dots + actionText.value;
15902
+ } else {
15903
+ container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
15904
+ }
15905
+ if (container2.offsetHeight > maxHeight2) {
15906
+ if (position === "end") {
15907
+ return tail(left2, middle2);
15908
+ }
15909
+ return tail(middle2, right2);
15910
+ }
15911
+ if (position === "end") {
15912
+ return tail(middle2, right2);
15913
+ }
15914
+ return tail(left2, middle2);
15915
+ };
15916
+ container2.innerText = tail(0, end2);
15917
+ };
15918
+ const middleTail = (leftPart, rightPart) => {
15919
+ if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
15920
+ return content.slice(0, leftPart[1]) + dots + dots + content.slice(rightPart[1], end2);
15817
15921
  }
15818
- }
15819
- return content.slice(0, res) + dots;
15922
+ const leftMiddle = Math.floor(leftPart[0] + leftPart[1] >> 1);
15923
+ const rightMiddle = Math.ceil(rightPart[0] + rightPart[1] >> 1);
15924
+ container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + actionText.value + props2.dots + props2.content.slice(rightMiddle, end2);
15925
+ if (container2.offsetHeight >= maxHeight2) {
15926
+ return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
15927
+ }
15928
+ return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
15929
+ };
15930
+ const middle = 0 + end2 >> 1;
15931
+ props2.position === "middle" ? container2.innerText = middleTail([0, middle], [middle, end2]) : calcEllipse();
15932
+ return container2.innerText;
15820
15933
  };
15821
15934
  const container = cloneContainer();
15822
15935
  if (!container)
@@ -15826,7 +15939,7 @@
15826
15939
  paddingTop,
15827
15940
  lineHeight
15828
15941
  } = container.style;
15829
- const maxHeight = (Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom);
15942
+ const maxHeight = Math.ceil((Number(props2.rows) + 0.5) * pxToNum(lineHeight) + pxToNum(paddingTop) + pxToNum(paddingBottom));
15830
15943
  if (maxHeight < container.offsetHeight) {
15831
15944
  hasAction.value = true;
15832
15945
  text.value = calcEllipsisText(container, maxHeight);
@@ -15845,7 +15958,7 @@
15845
15958
  "onClick": onClickAction
15846
15959
  }, [expanded.value ? props2.collapseText : props2.expandText]);
15847
15960
  vue.onMounted(calcEllipsised);
15848
- vue.watch(() => [props2.content, props2.rows], calcEllipsised);
15961
+ vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
15849
15962
  useEventListener("resize", calcEllipsised);
15850
15963
  return () => vue.createVNode("div", {
15851
15964
  "ref": root,
@@ -17239,7 +17352,7 @@
17239
17352
  valueFormatter(value) {
17240
17353
  let src = value;
17241
17354
  let { loading, error } = this.options;
17242
- if (isObject(value)) {
17355
+ if (isObject$1(value)) {
17243
17356
  ({ src } = value);
17244
17357
  loading = value.loading || this.options.loading;
17245
17358
  error = value.error || this.options.error;
@@ -17484,7 +17597,7 @@
17484
17597
  });
17485
17598
  }
17486
17599
  };
17487
- const version = "4.6.1";
17600
+ const version = "4.6.3";
17488
17601
  function install(app) {
17489
17602
  const components = [
17490
17603
  ActionBar,