vant 4.2.0 → 4.2.1

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 (49) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.mjs +1 -1
  3. package/es/pagination/Pagination.d.ts +26 -0
  4. package/es/pagination/Pagination.mjs +14 -4
  5. package/es/pagination/index.css +1 -1
  6. package/es/pagination/index.d.ts +18 -0
  7. package/es/picker/Picker.d.ts +2 -1
  8. package/es/picker/Picker.mjs +16 -6
  9. package/es/picker/PickerColumn.d.ts +2 -1
  10. package/es/picker/PickerColumn.mjs +10 -4
  11. package/es/picker/index.d.ts +2 -1
  12. package/es/sticky/Sticky.mjs +20 -4
  13. package/es/tab/Tab.mjs +24 -6
  14. package/es/{tabs/TabsTitle.d.ts → tab/TabTitle.d.ts} +1 -2
  15. package/es/{tabs/TabsTitle.mjs → tab/TabTitle.mjs} +2 -2
  16. package/es/tabs/Tabs.d.ts +1 -1
  17. package/es/tabs/Tabs.mjs +15 -30
  18. package/es/tabs/index.d.ts +1 -1
  19. package/es/tabs/style/index.mjs +0 -1
  20. package/es/tabs/types.d.ts +3 -1
  21. package/es/watermark/Watermark.mjs +3 -1
  22. package/lib/index.css +1 -1
  23. package/lib/index.d.ts +1 -1
  24. package/lib/index.js +1 -1
  25. package/lib/pagination/Pagination.d.ts +26 -0
  26. package/lib/pagination/Pagination.js +13 -3
  27. package/lib/pagination/index.css +1 -1
  28. package/lib/pagination/index.d.ts +18 -0
  29. package/lib/picker/Picker.d.ts +2 -1
  30. package/lib/picker/Picker.js +16 -6
  31. package/lib/picker/PickerColumn.d.ts +2 -1
  32. package/lib/picker/PickerColumn.js +9 -3
  33. package/lib/picker/index.d.ts +2 -1
  34. package/lib/sticky/Sticky.js +18 -2
  35. package/lib/tab/Tab.js +21 -3
  36. package/lib/{tabs/TabsTitle.d.ts → tab/TabTitle.d.ts} +1 -2
  37. package/lib/{tabs/TabsTitle.js → tab/TabTitle.js} +2 -2
  38. package/lib/tabs/Tabs.d.ts +1 -1
  39. package/lib/tabs/Tabs.js +13 -28
  40. package/lib/tabs/index.d.ts +1 -1
  41. package/lib/tabs/style/index.js +0 -1
  42. package/lib/tabs/types.d.ts +3 -1
  43. package/lib/vant.cjs.js +227 -180
  44. package/lib/vant.es.js +227 -180
  45. package/lib/vant.js +227 -180
  46. package/lib/vant.min.js +1 -1
  47. package/lib/watermark/Watermark.js +3 -1
  48. package/lib/web-types.json +1 -1
  49. package/package.json +1 -1
package/lib/vant.js CHANGED
@@ -626,7 +626,7 @@
626
626
  });
627
627
  return to;
628
628
  }
629
- var stdin_default$1P = {
629
+ var stdin_default$1O = {
630
630
  name: "姓名",
631
631
  tel: "电话",
632
632
  save: "保存",
@@ -689,7 +689,7 @@
689
689
  };
690
690
  const lang = vue.ref("zh-CN");
691
691
  const messages = vue.reactive({
692
- "zh-CN": stdin_default$1P
692
+ "zh-CN": stdin_default$1O
693
693
  });
694
694
  const Locale = {
695
695
  messages() {
@@ -704,11 +704,11 @@
704
704
  }
705
705
  };
706
706
  const useCurrentLang = () => lang;
707
- var stdin_default$1O = Locale;
707
+ var stdin_default$1N = Locale;
708
708
  function createTranslate(name2) {
709
709
  const prefix = camelize(name2) + ".";
710
710
  return (path, ...args) => {
711
- const messages2 = stdin_default$1O.messages();
711
+ const messages2 = stdin_default$1N.messages();
712
712
  const message = get(messages2, prefix + path) || get(messages2, path);
713
713
  return isFunction(message) ? message(...args) : message;
714
714
  };
@@ -836,7 +836,7 @@
836
836
  placeholder: Boolean,
837
837
  safeAreaInsetBottom: truthProp
838
838
  };
839
- var stdin_default$1N = vue.defineComponent({
839
+ var stdin_default$1M = vue.defineComponent({
840
840
  name: name$1D,
841
841
  props: actionBarProps,
842
842
  setup(props, {
@@ -865,7 +865,7 @@
865
865
  };
866
866
  }
867
867
  });
868
- const ActionBar = withInstall(stdin_default$1N);
868
+ const ActionBar = withInstall(stdin_default$1M);
869
869
  function useExpose(apis) {
870
870
  const instance2 = vue.getCurrentInstance();
871
871
  if (instance2) {
@@ -904,7 +904,7 @@
904
904
  showZero: truthProp,
905
905
  position: makeStringProp("top-right")
906
906
  };
907
- var stdin_default$1M = vue.defineComponent({
907
+ var stdin_default$1L = vue.defineComponent({
908
908
  name: name$1C,
909
909
  props: badgeProps,
910
910
  setup(props, {
@@ -991,7 +991,7 @@
991
991
  };
992
992
  }
993
993
  });
994
- const Badge = withInstall(stdin_default$1M);
994
+ const Badge = withInstall(stdin_default$1L);
995
995
  let globalZIndex = 2e3;
996
996
  const useGlobalZIndex = () => ++globalZIndex;
997
997
  const setGlobalZIndex = (val) => {
@@ -1015,7 +1015,7 @@
1015
1015
  });
1016
1016
  return cssVars;
1017
1017
  }
1018
- var stdin_default$1L = vue.defineComponent({
1018
+ var stdin_default$1K = vue.defineComponent({
1019
1019
  name: name$1B,
1020
1020
  props: configProviderProps,
1021
1021
  setup(props, {
@@ -1070,7 +1070,7 @@
1070
1070
  badgeProps: Object,
1071
1071
  classPrefix: String
1072
1072
  };
1073
- var stdin_default$1K = vue.defineComponent({
1073
+ var stdin_default$1J = vue.defineComponent({
1074
1074
  name: name$1A,
1075
1075
  props: iconProps,
1076
1076
  setup(props, {
@@ -1109,7 +1109,7 @@
1109
1109
  };
1110
1110
  }
1111
1111
  });
1112
- const Icon = withInstall(stdin_default$1K);
1112
+ const Icon = withInstall(stdin_default$1J);
1113
1113
  const [name$1z, bem$1u] = createNamespace("loading");
1114
1114
  const SpinIcon = Array(12).fill(null).map((_, index) => vue.createVNode("i", {
1115
1115
  "class": bem$1u("line", String(index + 1))
@@ -1131,7 +1131,7 @@
1131
1131
  textSize: numericProp,
1132
1132
  textColor: String
1133
1133
  };
1134
- var stdin_default$1J = vue.defineComponent({
1134
+ var stdin_default$1I = vue.defineComponent({
1135
1135
  name: name$1z,
1136
1136
  props: loadingProps,
1137
1137
  setup(props, {
@@ -1174,7 +1174,7 @@
1174
1174
  };
1175
1175
  }
1176
1176
  });
1177
- const Loading = withInstall(stdin_default$1J);
1177
+ const Loading = withInstall(stdin_default$1I);
1178
1178
  const [name$1y, bem$1t] = createNamespace("button");
1179
1179
  const buttonProps = extend({}, routeProps, {
1180
1180
  tag: makeStringProp("button"),
@@ -1197,7 +1197,7 @@
1197
1197
  loadingType: String,
1198
1198
  iconPosition: makeStringProp("left")
1199
1199
  });
1200
- var stdin_default$1I = vue.defineComponent({
1200
+ var stdin_default$1H = vue.defineComponent({
1201
1201
  name: name$1y,
1202
1202
  props: buttonProps,
1203
1203
  emits: ["click"],
@@ -1314,7 +1314,7 @@
1314
1314
  };
1315
1315
  }
1316
1316
  });
1317
- const Button = withInstall(stdin_default$1I);
1317
+ const Button = withInstall(stdin_default$1H);
1318
1318
  const [name$1x, bem$1s] = createNamespace("action-bar-button");
1319
1319
  const actionBarButtonProps = extend({}, routeProps, {
1320
1320
  type: String,
@@ -1324,7 +1324,7 @@
1324
1324
  loading: Boolean,
1325
1325
  disabled: Boolean
1326
1326
  });
1327
- var stdin_default$1H = vue.defineComponent({
1327
+ var stdin_default$1G = vue.defineComponent({
1328
1328
  name: name$1x,
1329
1329
  props: actionBarButtonProps,
1330
1330
  setup(props, {
@@ -1377,7 +1377,7 @@
1377
1377
  };
1378
1378
  }
1379
1379
  });
1380
- const ActionBarButton = withInstall(stdin_default$1H);
1380
+ const ActionBarButton = withInstall(stdin_default$1G);
1381
1381
  const [name$1w, bem$1r] = createNamespace("action-bar-icon");
1382
1382
  const actionBarIconProps = extend({}, routeProps, {
1383
1383
  dot: Boolean,
@@ -1389,7 +1389,7 @@
1389
1389
  badgeProps: Object,
1390
1390
  iconPrefix: String
1391
1391
  });
1392
- var stdin_default$1G = vue.defineComponent({
1392
+ var stdin_default$1F = vue.defineComponent({
1393
1393
  name: name$1w,
1394
1394
  props: actionBarIconProps,
1395
1395
  setup(props, {
@@ -1435,7 +1435,7 @@
1435
1435
  }, [renderIcon(), slots.default ? slots.default() : props.text]);
1436
1436
  }
1437
1437
  });
1438
- const ActionBarIcon = withInstall(stdin_default$1G);
1438
+ const ActionBarIcon = withInstall(stdin_default$1F);
1439
1439
  const popupSharedProps = {
1440
1440
  // whether to show popup
1441
1441
  show: Boolean,
@@ -1596,7 +1596,7 @@
1596
1596
  lazyRender: truthProp,
1597
1597
  customStyle: Object
1598
1598
  };
1599
- var stdin_default$1F = vue.defineComponent({
1599
+ var stdin_default$1E = vue.defineComponent({
1600
1600
  name: name$1v,
1601
1601
  props: overlayProps,
1602
1602
  setup(props, {
@@ -1632,7 +1632,7 @@
1632
1632
  });
1633
1633
  }
1634
1634
  });
1635
- const Overlay = withInstall(stdin_default$1F);
1635
+ const Overlay = withInstall(stdin_default$1E);
1636
1636
  const popupProps$2 = extend({}, popupSharedProps, {
1637
1637
  round: Boolean,
1638
1638
  position: makeStringProp("center"),
@@ -1646,7 +1646,7 @@
1646
1646
  safeAreaInsetBottom: Boolean
1647
1647
  });
1648
1648
  const [name$1u, bem$1p] = createNamespace("popup");
1649
- var stdin_default$1E = vue.defineComponent({
1649
+ var stdin_default$1D = vue.defineComponent({
1650
1650
  name: name$1u,
1651
1651
  inheritAttrs: false,
1652
1652
  props: popupProps$2,
@@ -1824,7 +1824,7 @@
1824
1824
  };
1825
1825
  }
1826
1826
  });
1827
- const Popup = withInstall(stdin_default$1E);
1827
+ const Popup = withInstall(stdin_default$1D);
1828
1828
  const [name$1t, bem$1o] = createNamespace("action-sheet");
1829
1829
  const actionSheetProps = extend({}, popupSharedProps, {
1830
1830
  title: String,
@@ -1839,7 +1839,7 @@
1839
1839
  safeAreaInsetBottom: truthProp
1840
1840
  });
1841
1841
  const popupInheritKeys$2 = [...popupSharedPropKeys, "round", "closeOnPopstate", "safeAreaInsetBottom"];
1842
- var stdin_default$1D = vue.defineComponent({
1842
+ var stdin_default$1C = vue.defineComponent({
1843
1843
  name: name$1t,
1844
1844
  props: actionSheetProps,
1845
1845
  emits: ["select", "cancel", "update:show"],
@@ -1946,7 +1946,7 @@
1946
1946
  });
1947
1947
  }
1948
1948
  });
1949
- const ActionSheet = withInstall(stdin_default$1D);
1949
+ const ActionSheet = withInstall(stdin_default$1C);
1950
1950
  const [name$1s, bem$1n, t$j] = createNamespace("picker");
1951
1951
  const getFirstEnabledOption = (options) => options.find((option) => !option.disabled) || options[0];
1952
1952
  function getColumnsType(columns, fields) {
@@ -2018,7 +2018,7 @@
2018
2018
  const MOMENTUM_DISTANCE = 15;
2019
2019
  const [name$1r, bem$1m] = createNamespace("picker-column");
2020
2020
  const PICKER_KEY = Symbol(name$1r);
2021
- var stdin_default$1C = vue.defineComponent({
2021
+ var stdin_default$1B = vue.defineComponent({
2022
2022
  name: name$1r,
2023
2023
  props: {
2024
2024
  value: numericProp,
@@ -2030,7 +2030,7 @@
2030
2030
  swipeDuration: makeRequiredProp(numericProp),
2031
2031
  visibleOptionNum: makeRequiredProp(numericProp)
2032
2032
  },
2033
- emits: ["change", "clickOption"],
2033
+ emits: ["change", "clickOption", "scrollInto"],
2034
2034
  setup(props, {
2035
2035
  emit,
2036
2036
  slots
@@ -2074,6 +2074,7 @@
2074
2074
  emit("clickOption", props.options[index]);
2075
2075
  };
2076
2076
  const getIndexByOffset = (offset2) => clamp(Math.round(-offset2 / props.optionHeight), 0, count() - 1);
2077
+ const currentIndex = vue.computed(() => getIndexByOffset(currentOffset.value));
2077
2078
  const momentum = (distance, duration) => {
2078
2079
  const speed = Math.abs(distance / duration);
2079
2080
  distance = currentOffset.value + speed / 3e-3 * (distance < 0 ? -1 : 1);
@@ -2113,11 +2114,16 @@
2113
2114
  moving = true;
2114
2115
  preventDefault(event, true);
2115
2116
  }
2116
- currentOffset.value = clamp(startOffset + touch.deltaY.value, -(count() * props.optionHeight), props.optionHeight);
2117
+ const newOffset = clamp(startOffset + touch.deltaY.value, -(count() * props.optionHeight), props.optionHeight);
2118
+ const newIndex = getIndexByOffset(newOffset);
2119
+ if (newIndex !== currentIndex.value) {
2120
+ emit("scrollInto", props.options[newIndex]);
2121
+ }
2122
+ currentOffset.value = newOffset;
2117
2123
  const now = Date.now();
2118
2124
  if (now - touchStartTime > MOMENTUM_TIME) {
2119
2125
  touchStartTime = now;
2120
- momentumOffset = currentOffset.value;
2126
+ momentumOffset = newOffset;
2121
2127
  }
2122
2128
  };
2123
2129
  const onTouchEnd = () => {
@@ -2204,7 +2210,7 @@
2204
2210
  };
2205
2211
  const pickerToolbarSlots = ["cancel", "confirm", "title", "toolbar"];
2206
2212
  const pickerToolbarPropKeys = Object.keys(pickerToolbarProps);
2207
- var stdin_default$1B = vue.defineComponent({
2213
+ var stdin_default$1A = vue.defineComponent({
2208
2214
  name: name$1q,
2209
2215
  props: pickerToolbarProps,
2210
2216
  emits: ["confirm", "cancel"],
@@ -2330,7 +2336,7 @@
2330
2336
  offsetTop: makeNumericProp(0),
2331
2337
  offsetBottom: makeNumericProp(0)
2332
2338
  };
2333
- var stdin_default$1A = vue.defineComponent({
2339
+ var stdin_default$1z = vue.defineComponent({
2334
2340
  name: name$1p,
2335
2341
  props: stickyProps,
2336
2342
  emits: ["scroll", "change"],
@@ -2348,8 +2354,12 @@
2348
2354
  // root height
2349
2355
  transform: 0
2350
2356
  });
2357
+ const isReset = vue.ref(false);
2351
2358
  const offset2 = vue.computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
2352
2359
  const rootStyle = vue.computed(() => {
2360
+ if (isReset.value) {
2361
+ return;
2362
+ }
2353
2363
  const {
2354
2364
  fixed,
2355
2365
  height: height2,
@@ -2363,7 +2373,7 @@
2363
2373
  }
2364
2374
  });
2365
2375
  const stickyStyle = vue.computed(() => {
2366
- if (!state.fixed) {
2376
+ if (!state.fixed || isReset.value) {
2367
2377
  return;
2368
2378
  }
2369
2379
  const style = extend(getZIndexStyle(props.zIndex), {
@@ -2422,6 +2432,18 @@
2422
2432
  passive: true
2423
2433
  });
2424
2434
  useVisibilityChange(root, onScroll);
2435
+ vue.watch([windowWidth, windowHeight], () => {
2436
+ if (!root.value || isHidden(root) || !state.fixed) {
2437
+ return;
2438
+ }
2439
+ isReset.value = true;
2440
+ vue.nextTick(() => {
2441
+ const rootRect = useRect(root);
2442
+ state.width = rootRect.width;
2443
+ state.height = rootRect.height;
2444
+ isReset.value = false;
2445
+ });
2446
+ });
2425
2447
  return () => {
2426
2448
  var _a;
2427
2449
  return vue.createVNode("div", {
@@ -2429,98 +2451,15 @@
2429
2451
  "style": rootStyle.value
2430
2452
  }, [vue.createVNode("div", {
2431
2453
  "class": bem$1l({
2432
- fixed: state.fixed
2454
+ fixed: state.fixed && !isReset.value
2433
2455
  }),
2434
2456
  "style": stickyStyle.value
2435
2457
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
2436
2458
  };
2437
2459
  }
2438
2460
  });
2439
- const Sticky = withInstall(stdin_default$1A);
2440
- const [name$1o, bem$1k] = createNamespace("tab");
2441
- var stdin_default$1z = vue.defineComponent({
2442
- name: name$1o,
2443
- props: {
2444
- id: String,
2445
- dot: Boolean,
2446
- type: String,
2447
- color: String,
2448
- title: String,
2449
- badge: numericProp,
2450
- shrink: Boolean,
2451
- isActive: Boolean,
2452
- disabled: Boolean,
2453
- controls: String,
2454
- scrollable: Boolean,
2455
- activeColor: String,
2456
- inactiveColor: String,
2457
- showZeroBadge: truthProp
2458
- },
2459
- setup(props, {
2460
- slots
2461
- }) {
2462
- const style = vue.computed(() => {
2463
- const style2 = {};
2464
- const {
2465
- type,
2466
- color,
2467
- disabled,
2468
- isActive,
2469
- activeColor,
2470
- inactiveColor
2471
- } = props;
2472
- const isCard = type === "card";
2473
- if (color && isCard) {
2474
- style2.borderColor = color;
2475
- if (!disabled) {
2476
- if (isActive) {
2477
- style2.backgroundColor = color;
2478
- } else {
2479
- style2.color = color;
2480
- }
2481
- }
2482
- }
2483
- const titleColor = isActive ? activeColor : inactiveColor;
2484
- if (titleColor) {
2485
- style2.color = titleColor;
2486
- }
2487
- return style2;
2488
- });
2489
- const renderText = () => {
2490
- const Text = vue.createVNode("span", {
2491
- "class": bem$1k("text", {
2492
- ellipsis: !props.scrollable
2493
- })
2494
- }, [slots.title ? slots.title() : props.title]);
2495
- if (props.dot || isDef(props.badge) && props.badge !== "") {
2496
- return vue.createVNode(Badge, {
2497
- "dot": props.dot,
2498
- "content": props.badge,
2499
- "showZero": props.showZeroBadge
2500
- }, {
2501
- default: () => [Text]
2502
- });
2503
- }
2504
- return Text;
2505
- };
2506
- return () => vue.createVNode("div", {
2507
- "id": props.id,
2508
- "role": "tab",
2509
- "class": [bem$1k([props.type, {
2510
- grow: props.scrollable && !props.shrink,
2511
- shrink: props.shrink,
2512
- active: props.isActive,
2513
- disabled: props.disabled
2514
- }])],
2515
- "style": style.value,
2516
- "tabindex": props.disabled ? void 0 : props.isActive ? 0 : -1,
2517
- "aria-selected": props.isActive,
2518
- "aria-disabled": props.disabled || void 0,
2519
- "aria-controls": props.controls
2520
- }, [renderText()]);
2521
- }
2522
- });
2523
- const [name$1n, bem$1j] = createNamespace("swipe");
2461
+ const Sticky = withInstall(stdin_default$1z);
2462
+ const [name$1o, bem$1k] = createNamespace("swipe");
2524
2463
  const swipeProps = {
2525
2464
  loop: truthProp,
2526
2465
  width: numericProp,
@@ -2535,9 +2474,9 @@
2535
2474
  showIndicators: truthProp,
2536
2475
  stopPropagation: truthProp
2537
2476
  };
2538
- const SWIPE_KEY = Symbol(name$1n);
2477
+ const SWIPE_KEY = Symbol(name$1o);
2539
2478
  var stdin_default$1y = vue.defineComponent({
2540
- name: name$1n,
2479
+ name: name$1o,
2541
2480
  props: swipeProps,
2542
2481
  emits: ["change", "dragStart", "dragEnd"],
2543
2482
  setup(props, {
@@ -2815,7 +2754,7 @@
2815
2754
  } : void 0;
2816
2755
  return vue.createVNode("i", {
2817
2756
  "style": style,
2818
- "class": bem$1j("indicator", {
2757
+ "class": bem$1k("indicator", {
2819
2758
  active
2820
2759
  })
2821
2760
  }, null);
@@ -2829,7 +2768,7 @@
2829
2768
  }
2830
2769
  if (props.showIndicators && count.value > 1) {
2831
2770
  return vue.createVNode("div", {
2832
- "class": bem$1j("indicators", {
2771
+ "class": bem$1k("indicators", {
2833
2772
  vertical: props.vertical
2834
2773
  })
2835
2774
  }, [Array(count.value).fill("").map(renderDot)]);
@@ -2871,11 +2810,11 @@
2871
2810
  var _a;
2872
2811
  return vue.createVNode("div", {
2873
2812
  "ref": root,
2874
- "class": bem$1j()
2813
+ "class": bem$1k()
2875
2814
  }, [vue.createVNode("div", {
2876
2815
  "ref": track,
2877
2816
  "style": trackStyle.value,
2878
- "class": bem$1j("track", {
2817
+ "class": bem$1k("track", {
2879
2818
  vertical: props.vertical
2880
2819
  }),
2881
2820
  "onTouchstartPassive": onTouchStart,
@@ -2886,9 +2825,9 @@
2886
2825
  }
2887
2826
  });
2888
2827
  const Swipe = withInstall(stdin_default$1y);
2889
- const [name$1m, bem$1i] = createNamespace("tabs");
2828
+ const [name$1n, bem$1j] = createNamespace("tabs");
2890
2829
  var stdin_default$1x = vue.defineComponent({
2891
- name: name$1m,
2830
+ name: name$1n,
2892
2831
  props: {
2893
2832
  count: makeRequiredProp(Number),
2894
2833
  inited: Boolean,
@@ -2912,7 +2851,7 @@
2912
2851
  return vue.createVNode(Swipe, {
2913
2852
  "ref": swipeRef,
2914
2853
  "loop": false,
2915
- "class": bem$1i("track"),
2854
+ "class": bem$1j("track"),
2916
2855
  "duration": +props.duration * 1e3,
2917
2856
  "touchable": props.swipeable,
2918
2857
  "lazyRender": props.lazyRender,
@@ -2940,13 +2879,13 @@
2940
2879
  swipeRef
2941
2880
  });
2942
2881
  return () => vue.createVNode("div", {
2943
- "class": bem$1i("content", {
2882
+ "class": bem$1j("content", {
2944
2883
  animated: props.animated || props.swipeable
2945
2884
  })
2946
2885
  }, [renderChildren()]);
2947
2886
  }
2948
2887
  });
2949
- const [name$1l, bem$1h] = createNamespace("tabs");
2888
+ const [name$1m, bem$1i] = createNamespace("tabs");
2950
2889
  const tabsProps = {
2951
2890
  type: makeStringProp("line"),
2952
2891
  color: String,
@@ -2969,9 +2908,9 @@
2969
2908
  titleActiveColor: String,
2970
2909
  titleInactiveColor: String
2971
2910
  };
2972
- const TABS_KEY = Symbol(name$1l);
2911
+ const TABS_KEY = Symbol(name$1m);
2973
2912
  var stdin_default$1w = vue.defineComponent({
2974
- name: name$1l,
2913
+ name: name$1m,
2975
2914
  props: tabsProps,
2976
2915
  emits: ["change", "scroll", "rendered", "clickTab", "update:active"],
2977
2916
  setup(props, {
@@ -3160,28 +3099,10 @@
3160
3099
  setCurrentIndex(index);
3161
3100
  }
3162
3101
  };
3163
- const renderNav = () => children.map((item, index) => vue.createVNode(stdin_default$1z, vue.mergeProps({
3164
- "key": item.id,
3165
- "id": `${id}-${index}`,
3166
- "ref": setTitleRefs(index),
3167
- "type": props.type,
3168
- "color": props.color,
3169
- "style": item.titleStyle,
3170
- "class": item.titleClass,
3171
- "shrink": props.shrink,
3172
- "isActive": index === state.currentIndex,
3173
- "controls": item.id,
3174
- "scrollable": scrollable.value,
3175
- "activeColor": props.titleActiveColor,
3176
- "inactiveColor": props.titleInactiveColor,
3177
- "onClick": (event) => onClickTab(item, index, event)
3178
- }, pick(item, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
3179
- title: item.$slots.title
3180
- }));
3181
3102
  const renderLine = () => {
3182
3103
  if (props.type === "line" && children.length) {
3183
3104
  return vue.createVNode("div", {
3184
- "class": bem$1h("line"),
3105
+ "class": bem$1i("line"),
3185
3106
  "style": state.lineStyle
3186
3107
  }, null);
3187
3108
  }
@@ -3195,19 +3116,19 @@
3195
3116
  } = props;
3196
3117
  const Header = [vue.createVNode("div", {
3197
3118
  "ref": sticky ? void 0 : wrapRef,
3198
- "class": [bem$1h("wrap"), {
3119
+ "class": [bem$1i("wrap"), {
3199
3120
  [BORDER_TOP_BOTTOM]: type === "line" && border
3200
3121
  }]
3201
3122
  }, [vue.createVNode("div", {
3202
3123
  "ref": navRef,
3203
3124
  "role": "tablist",
3204
- "class": bem$1h("nav", [type, {
3125
+ "class": bem$1i("nav", [type, {
3205
3126
  shrink: props.shrink,
3206
3127
  complete: scrollable.value
3207
3128
  }]),
3208
3129
  "style": navStyle.value,
3209
3130
  "aria-orientation": "horizontal"
3210
- }, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
3131
+ }, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), children.map((item) => item.renderTitle(onClickTab)), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
3211
3132
  if (sticky) {
3212
3133
  return vue.createVNode("div", {
3213
3134
  "ref": wrapRef
@@ -3215,7 +3136,16 @@
3215
3136
  }
3216
3137
  return Header;
3217
3138
  };
3218
- vue.watch([() => props.color, windowWidth], setLine);
3139
+ const resize = () => {
3140
+ setLine();
3141
+ vue.nextTick(() => {
3142
+ var _a, _b;
3143
+ scrollIntoView(true);
3144
+ (_b = (_a = contentRef.value) == null ? void 0 : _a.swipeRef.value) == null ? void 0 : _b.resize();
3145
+ });
3146
+ };
3147
+ vue.watch(() => [props.color, props.duration, props.lineWidth, props.lineHeight], setLine);
3148
+ vue.watch(windowWidth, resize);
3219
3149
  vue.watch(() => props.active, (value) => {
3220
3150
  if (value !== currentName.value) {
3221
3151
  setCurrentIndexByName(value);
@@ -3241,13 +3171,6 @@
3241
3171
  });
3242
3172
  };
3243
3173
  const onRendered = (name2, title) => emit("rendered", name2, title);
3244
- const resize = () => {
3245
- setLine();
3246
- vue.nextTick(() => {
3247
- var _a, _b;
3248
- return (_b = (_a = contentRef.value) == null ? void 0 : _a.swipeRef.value) == null ? void 0 : _b.resize();
3249
- });
3250
- };
3251
3174
  useExpose({
3252
3175
  resize,
3253
3176
  scrollTo
@@ -3264,13 +3187,15 @@
3264
3187
  id,
3265
3188
  props,
3266
3189
  setLine,
3190
+ scrollable,
3267
3191
  onRendered,
3268
3192
  currentName,
3193
+ setTitleRefs,
3269
3194
  scrollIntoView
3270
3195
  });
3271
3196
  return () => vue.createVNode("div", {
3272
3197
  "ref": root,
3273
- "class": bem$1h([props.type])
3198
+ "class": bem$1i([props.type])
3274
3199
  }, [props.sticky ? vue.createVNode(Sticky, {
3275
3200
  "container": root.value,
3276
3201
  "offsetTop": offsetTopPx.value,
@@ -3297,6 +3222,89 @@
3297
3222
  });
3298
3223
  const TAB_STATUS_KEY = Symbol();
3299
3224
  const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
3225
+ const [name$1l, bem$1h] = createNamespace("tab");
3226
+ const TabTitle = vue.defineComponent({
3227
+ name: name$1l,
3228
+ props: {
3229
+ id: String,
3230
+ dot: Boolean,
3231
+ type: String,
3232
+ color: String,
3233
+ title: String,
3234
+ badge: numericProp,
3235
+ shrink: Boolean,
3236
+ isActive: Boolean,
3237
+ disabled: Boolean,
3238
+ controls: String,
3239
+ scrollable: Boolean,
3240
+ activeColor: String,
3241
+ inactiveColor: String,
3242
+ showZeroBadge: truthProp
3243
+ },
3244
+ setup(props, {
3245
+ slots
3246
+ }) {
3247
+ const style = vue.computed(() => {
3248
+ const style2 = {};
3249
+ const {
3250
+ type,
3251
+ color,
3252
+ disabled,
3253
+ isActive,
3254
+ activeColor,
3255
+ inactiveColor
3256
+ } = props;
3257
+ const isCard = type === "card";
3258
+ if (color && isCard) {
3259
+ style2.borderColor = color;
3260
+ if (!disabled) {
3261
+ if (isActive) {
3262
+ style2.backgroundColor = color;
3263
+ } else {
3264
+ style2.color = color;
3265
+ }
3266
+ }
3267
+ }
3268
+ const titleColor = isActive ? activeColor : inactiveColor;
3269
+ if (titleColor) {
3270
+ style2.color = titleColor;
3271
+ }
3272
+ return style2;
3273
+ });
3274
+ const renderText = () => {
3275
+ const Text = vue.createVNode("span", {
3276
+ "class": bem$1h("text", {
3277
+ ellipsis: !props.scrollable
3278
+ })
3279
+ }, [slots.title ? slots.title() : props.title]);
3280
+ if (props.dot || isDef(props.badge) && props.badge !== "") {
3281
+ return vue.createVNode(Badge, {
3282
+ "dot": props.dot,
3283
+ "content": props.badge,
3284
+ "showZero": props.showZeroBadge
3285
+ }, {
3286
+ default: () => [Text]
3287
+ });
3288
+ }
3289
+ return Text;
3290
+ };
3291
+ return () => vue.createVNode("div", {
3292
+ "id": props.id,
3293
+ "role": "tab",
3294
+ "class": [bem$1h([props.type, {
3295
+ grow: props.scrollable && !props.shrink,
3296
+ shrink: props.shrink,
3297
+ active: props.isActive,
3298
+ disabled: props.disabled
3299
+ }])],
3300
+ "style": style.value,
3301
+ "tabindex": props.disabled ? void 0 : props.isActive ? 0 : -1,
3302
+ "aria-selected": props.isActive,
3303
+ "aria-disabled": props.disabled || void 0,
3304
+ "aria-controls": props.controls
3305
+ }, [renderText()]);
3306
+ }
3307
+ });
3300
3308
  const [name$1k, bem$1g] = createNamespace("swipe-item");
3301
3309
  var stdin_default$1v = vue.defineComponent({
3302
3310
  name: name$1k,
@@ -3387,6 +3395,7 @@
3387
3395
  }) {
3388
3396
  const id = useId();
3389
3397
  const inited = vue.ref(false);
3398
+ const instance2 = vue.getCurrentInstance();
3390
3399
  const {
3391
3400
  parent,
3392
3401
  index
@@ -3413,6 +3422,21 @@
3413
3422
  }
3414
3423
  return isActive;
3415
3424
  });
3425
+ const renderTitle = (onClickTab) => vue.createVNode(TabTitle, vue.mergeProps({
3426
+ "key": id,
3427
+ "id": `${parent.id}-${index.value}`,
3428
+ "ref": parent.setTitleRefs(index.value),
3429
+ "style": props.titleStyle,
3430
+ "class": props.titleClass,
3431
+ "isActive": active.value,
3432
+ "controls": id,
3433
+ "scrollable": parent.scrollable.value,
3434
+ "activeColor": parent.props.titleActiveColor,
3435
+ "inactiveColor": parent.props.titleInactiveColor,
3436
+ "onClick": (event) => onClickTab(instance2.proxy, index.value, event)
3437
+ }, pick(parent.props, ["type", "color", "shrink"]), pick(props, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
3438
+ title: slots.title
3439
+ });
3416
3440
  const hasInactiveClass = vue.ref(!active.value);
3417
3441
  vue.watch(active, (val) => {
3418
3442
  if (val) {
@@ -3428,6 +3452,10 @@
3428
3452
  parent.scrollIntoView();
3429
3453
  });
3430
3454
  vue.provide(TAB_STATUS_KEY, active);
3455
+ useExpose({
3456
+ id,
3457
+ renderTitle
3458
+ });
3431
3459
  return () => {
3432
3460
  var _a;
3433
3461
  const label = `${parent.id}-${index.value}`;
@@ -3462,9 +3490,6 @@
3462
3490
  }
3463
3491
  const shouldRender = inited.value || scrollspy || !lazyRender;
3464
3492
  const Content = shouldRender ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null;
3465
- useExpose({
3466
- id
3467
- });
3468
3493
  return vue.withDirectives(vue.createVNode("div", {
3469
3494
  "id": id,
3470
3495
  "role": "tabpanel",
@@ -3512,7 +3537,7 @@
3512
3537
  const confirmButtonText = showNextButton() ? props.nextStepText : props.confirmButtonText;
3513
3538
  return vue.createVNode("div", {
3514
3539
  "class": bem$1e()
3515
- }, [vue.createVNode(stdin_default$1B, {
3540
+ }, [vue.createVNode(stdin_default$1A, {
3516
3541
  "title": props.title,
3517
3542
  "cancelButtonText": props.cancelButtonText,
3518
3543
  "confirmButtonText": confirmButtonText,
@@ -3554,7 +3579,7 @@
3554
3579
  var stdin_default$1s = vue.defineComponent({
3555
3580
  name: name$1s,
3556
3581
  props: pickerProps,
3557
- emits: ["confirm", "cancel", "change", "clickOption", "update:modelValue"],
3582
+ emits: ["confirm", "cancel", "change", "scrollInto", "clickOption", "update:modelValue"],
3558
3583
  setup(props, {
3559
3584
  emit,
3560
3585
  slots
@@ -3616,10 +3641,14 @@
3616
3641
  }, getEventParams()));
3617
3642
  });
3618
3643
  };
3619
- const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
3620
- columnIndex,
3621
- currentOption
3622
- }, getEventParams()));
3644
+ const onClickOption = (currentOption, columnIndex) => {
3645
+ const params = {
3646
+ columnIndex,
3647
+ currentOption
3648
+ };
3649
+ emit("clickOption", extend(getEventParams(), params));
3650
+ emit("scrollInto", params);
3651
+ };
3623
3652
  const confirm = () => {
3624
3653
  children.forEach((child) => child.stopMomentum());
3625
3654
  const params = getEventParams();
@@ -3629,7 +3658,7 @@
3629
3658
  return params;
3630
3659
  };
3631
3660
  const cancel = () => emit("cancel", getEventParams());
3632
- const renderColumnItems = () => currentColumns.value.map((options, columnIndex) => vue.createVNode(stdin_default$1C, {
3661
+ const renderColumnItems = () => currentColumns.value.map((options, columnIndex) => vue.createVNode(stdin_default$1B, {
3633
3662
  "value": selectedValues.value[columnIndex],
3634
3663
  "fields": fields.value,
3635
3664
  "options": options,
@@ -3639,7 +3668,13 @@
3639
3668
  "swipeDuration": props.swipeDuration,
3640
3669
  "visibleOptionNum": props.visibleOptionNum,
3641
3670
  "onChange": (value) => onChange(value, columnIndex),
3642
- "onClickOption": (option) => onClickOption(option, columnIndex)
3671
+ "onClickOption": (option) => onClickOption(option, columnIndex),
3672
+ "onScrollInto": (option) => {
3673
+ emit("scrollInto", {
3674
+ currentOption: option,
3675
+ columnIndex
3676
+ });
3677
+ }
3643
3678
  }, {
3644
3679
  option: slots.option
3645
3680
  }));
@@ -3673,7 +3708,7 @@
3673
3708
  };
3674
3709
  const renderToolbar = () => {
3675
3710
  if (props.showToolbar && !parent) {
3676
- return vue.createVNode(stdin_default$1B, vue.mergeProps(pick(props, pickerToolbarPropKeys), {
3711
+ return vue.createVNode(stdin_default$1A, vue.mergeProps(pick(props, pickerToolbarPropKeys), {
3677
3712
  "onConfirm": confirm,
3678
3713
  "onCancel": cancel
3679
3714
  }), pick(slots, pickerToolbarSlots));
@@ -8117,7 +8152,7 @@
8117
8152
  }
8118
8153
  });
8119
8154
  const CollapseItem = withInstall(stdin_default$_);
8120
- const ConfigProvider = withInstall(stdin_default$1L);
8155
+ const ConfigProvider = withInstall(stdin_default$1K);
8121
8156
  const [name$Q, bem$P, t$d] = createNamespace("contact-card");
8122
8157
  const contactCardProps = {
8123
8158
  tel: String,
@@ -11495,7 +11530,9 @@
11495
11530
  totalItems: makeNumericProp(0),
11496
11531
  showPageSize: makeNumericProp(5),
11497
11532
  itemsPerPage: makeNumericProp(10),
11498
- forceEllipses: Boolean
11533
+ forceEllipses: Boolean,
11534
+ showPrevButton: truthProp,
11535
+ showNextButton: truthProp
11499
11536
  };
11500
11537
  var stdin_default$A = vue.defineComponent({
11501
11538
  name: name$s,
@@ -11565,8 +11602,12 @@
11565
11602
  const renderPrevButton = () => {
11566
11603
  const {
11567
11604
  mode,
11568
- modelValue
11605
+ modelValue,
11606
+ showPrevButton
11569
11607
  } = props;
11608
+ if (!showPrevButton) {
11609
+ return;
11610
+ }
11570
11611
  const slot = slots["prev-text"];
11571
11612
  const disabled = modelValue === 1;
11572
11613
  return vue.createVNode("li", {
@@ -11584,8 +11625,12 @@
11584
11625
  const renderNextButton = () => {
11585
11626
  const {
11586
11627
  mode,
11587
- modelValue
11628
+ modelValue,
11629
+ showNextButton
11588
11630
  } = props;
11631
+ if (!showNextButton) {
11632
+ return;
11633
+ }
11589
11634
  const slot = slots["next-text"];
11590
11635
  const disabled = modelValue === count.value;
11591
11636
  return vue.createVNode("li", {
@@ -15664,6 +15709,7 @@
15664
15709
  if (props.image && !slots.content) {
15665
15710
  return vue.createVNode("image", {
15666
15711
  "href": imageBase64.value,
15712
+ "xlink:href": imageBase64.value,
15667
15713
  "x": "0",
15668
15714
  "y": "0",
15669
15715
  "width": props.width,
@@ -15692,6 +15738,7 @@
15692
15738
  "width": svgWidth,
15693
15739
  "height": svgHeight,
15694
15740
  "xmlns": "http://www.w3.org/2000/svg",
15741
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
15695
15742
  "style": {
15696
15743
  padding: `0 ${props.gapX}px ${props.gapY}px 0`,
15697
15744
  opacity: props.opacity
@@ -15714,7 +15761,7 @@
15714
15761
  };
15715
15762
  const makeSvgToBlobUrl = (svgStr) => {
15716
15763
  const svgBlob = new Blob([svgStr], {
15717
- type: "image/svg+xml;charset=utf-8"
15764
+ type: "image/svg+xml"
15718
15765
  });
15719
15766
  return URL.createObjectURL(svgBlob);
15720
15767
  };
@@ -16615,7 +16662,7 @@
16615
16662
  });
16616
16663
  }
16617
16664
  };
16618
- const version = "4.2.0";
16665
+ const version = "4.2.1";
16619
16666
  function install(app) {
16620
16667
  const components = [
16621
16668
  ActionBar,