vant 4.0.0-rc.5 → 4.0.0-rc.6

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 (54) hide show
  1. package/es/calendar/Calendar.mjs +10 -3
  2. package/es/calendar/CalendarHeader.d.ts +2 -0
  3. package/es/calendar/CalendarHeader.mjs +5 -1
  4. package/es/cell/Cell.d.ts +17 -0
  5. package/es/cell/Cell.mjs +11 -4
  6. package/es/cell/index.d.ts +9 -0
  7. package/es/collapse-item/CollapseItem.d.ts +13 -0
  8. package/es/collapse-item/index.d.ts +9 -0
  9. package/es/coupon/index.css +1 -1
  10. package/es/coupon-list/index.css +1 -1
  11. package/es/field/Field.d.ts +13 -0
  12. package/es/field/index.d.ts +9 -0
  13. package/es/image-preview/ImagePreview.mjs +3 -1
  14. package/es/image-preview/ImagePreviewItem.mjs +7 -2
  15. package/es/image-preview/index.css +1 -1
  16. package/es/index.d.ts +1 -1
  17. package/es/index.mjs +1 -1
  18. package/es/swipe/Swipe.mjs +1 -1
  19. package/es/toast/Toast.d.ts +4 -1
  20. package/es/toast/Toast.mjs +2 -1
  21. package/es/toast/index.css +1 -1
  22. package/es/toast/index.d.ts +3 -1
  23. package/es/toast/types.d.ts +2 -0
  24. package/lib/calendar/Calendar.js +10 -3
  25. package/lib/calendar/CalendarHeader.d.ts +2 -0
  26. package/lib/calendar/CalendarHeader.js +5 -1
  27. package/lib/cell/Cell.d.ts +17 -0
  28. package/lib/cell/Cell.js +10 -3
  29. package/lib/cell/index.d.ts +9 -0
  30. package/lib/collapse-item/CollapseItem.d.ts +13 -0
  31. package/lib/collapse-item/index.d.ts +9 -0
  32. package/lib/coupon/index.css +1 -1
  33. package/lib/coupon-list/index.css +1 -1
  34. package/lib/field/Field.d.ts +13 -0
  35. package/lib/field/index.d.ts +9 -0
  36. package/lib/image-preview/ImagePreview.js +3 -1
  37. package/lib/image-preview/ImagePreviewItem.js +7 -2
  38. package/lib/image-preview/index.css +1 -1
  39. package/lib/index.css +1 -1
  40. package/lib/index.d.ts +1 -1
  41. package/lib/index.js +1 -1
  42. package/lib/swipe/Swipe.js +1 -1
  43. package/lib/toast/Toast.d.ts +4 -1
  44. package/lib/toast/Toast.js +2 -1
  45. package/lib/toast/index.css +1 -1
  46. package/lib/toast/index.d.ts +3 -1
  47. package/lib/toast/types.d.ts +2 -0
  48. package/lib/vant.cjs.js +39 -13
  49. package/lib/vant.es.js +39 -13
  50. package/lib/vant.js +39 -13
  51. package/lib/vant.min.js +1 -1
  52. package/lib/web-types.json +555 -541
  53. package/package.json +1 -1
  54. package/changelog.generated.md +0 -71
package/lib/index.d.ts CHANGED
@@ -93,4 +93,4 @@ declare namespace _default {
93
93
  }
94
94
  export default _default;
95
95
  export function install(app: any): void;
96
- export const version: "4.0.0-rc.5";
96
+ export const version: "4.0.0-rc.6";
package/lib/index.js CHANGED
@@ -200,7 +200,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
200
200
  __reExport(stdin_exports, require("./toast"), module.exports);
201
201
  __reExport(stdin_exports, require("./tree-select"), module.exports);
202
202
  __reExport(stdin_exports, require("./uploader"), module.exports);
203
- const version = "4.0.0-rc.5";
203
+ const version = "4.0.0-rc.6";
204
204
  function install(app) {
205
205
  const components = [
206
206
  import_action_bar.ActionBar,
@@ -78,7 +78,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
78
78
  }
79
79
  return 0;
80
80
  });
81
- const maxCount = (0, import_vue2.computed)(() => Math.ceil(Math.abs(minOffset.value) / size.value));
81
+ const maxCount = (0, import_vue2.computed)(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
82
82
  const trackSize = (0, import_vue2.computed)(() => count.value * size.value);
83
83
  const activeIndicator = (0, import_vue2.computed)(() => (state.active + count.value) % count.value);
84
84
  const isCorrectDirection = (0, import_vue2.computed)(() => {
@@ -1,6 +1,6 @@
1
1
  import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
2
2
  import { LoadingType } from '../loading';
3
- import type { ToastType, ToastPosition } from './types';
3
+ import type { ToastType, ToastPosition, ToastWordBreak } from './types';
4
4
  export declare const toastProps: {
5
5
  icon: StringConstructor;
6
6
  show: BooleanConstructor;
@@ -20,6 +20,7 @@ export declare const toastProps: {
20
20
  default: ToastPosition;
21
21
  };
22
22
  teleport: PropType<string | import("vue").RendererElement | null | undefined>;
23
+ wordBreak: PropType<ToastWordBreak>;
23
24
  className: PropType<unknown>;
24
25
  iconPrefix: StringConstructor;
25
26
  transition: {
@@ -53,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{
53
54
  default: ToastPosition;
54
55
  };
55
56
  teleport: PropType<string | import("vue").RendererElement | null | undefined>;
57
+ wordBreak: PropType<ToastWordBreak>;
56
58
  className: PropType<unknown>;
57
59
  iconPrefix: StringConstructor;
58
60
  transition: {
@@ -84,6 +86,7 @@ declare const _default: import("vue").DefineComponent<{
84
86
  default: ToastPosition;
85
87
  };
86
88
  teleport: PropType<string | import("vue").RendererElement | null | undefined>;
89
+ wordBreak: PropType<ToastWordBreak>;
87
90
  className: PropType<unknown>;
88
91
  iconPrefix: StringConstructor;
89
92
  transition: {
@@ -40,6 +40,7 @@ const toastProps = {
40
40
  duration: (0, import_utils.makeNumberProp)(2e3),
41
41
  position: (0, import_utils.makeStringProp)("middle"),
42
42
  teleport: [String, Object],
43
+ wordBreak: String,
43
44
  className: import_utils.unknownProp,
44
45
  iconPrefix: String,
45
46
  transition: (0, import_utils.makeStringProp)("van-fade"),
@@ -131,7 +132,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
131
132
  (0, import_vue2.onMounted)(toggleClickable);
132
133
  (0, import_vue2.onUnmounted)(toggleClickable);
133
134
  return () => (0, import_vue.createVNode)(import_popup.Popup, (0, import_vue.mergeProps)({
134
- "class": [bem([props.position, {
135
+ "class": [bem([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
135
136
  [props.type]: !props.icon
136
137
  }]), props.className],
137
138
  "lockScroll": false,
@@ -1 +1 @@
1
- :root{--van-toast-max-width: 70%;--van-toast-font-size: var(--van-font-size-md);--van-toast-text-color: var(--van-white);--van-toast-loading-icon-color: var(--van-white);--van-toast-line-height: var(--van-line-height-md);--van-toast-radius: var(--van-radius-lg);--van-toast-background: rgba(0, 0, 0, .7);--van-toast-icon-size: 36px;--van-toast-text-min-width: 96px;--van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);--van-toast-default-padding: var(--van-padding-md);--van-toast-default-width: 88px;--van-toast-default-min-height: 88px;--van-toast-position-top-distance: 20%;--van-toast-position-bottom-distance: 20%}.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--van-duration-fast);width:var(--van-toast-default-width);max-width:var(--van-toast-max-width);min-height:var(--van-toast-default-min-height);padding:var(--van-toast-default-padding);color:var(--van-toast-text-color);font-size:var(--van-toast-font-size);line-height:var(--van-toast-line-height);white-space:pre-wrap;text-align:center;word-break:break-all;background:var(--van-toast-background);border-radius:var(--van-toast-radius)}.van-toast--unclickable{overflow:hidden;cursor:not-allowed}.van-toast--unclickable *{pointer-events:none}.van-toast--text,.van-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--van-toast-text-min-width);min-height:0;padding:var(--van-toast-text-padding)}.van-toast--text .van-toast__text,.van-toast--html .van-toast__text{margin-top:0}.van-toast--top{top:var(--van-toast-position-top-distance)}.van-toast--bottom{top:auto;bottom:var(--van-toast-position-bottom-distance)}.van-toast__icon{font-size:var(--van-toast-icon-size)}.van-toast__loading{padding:var(--van-padding-base);color:var(--van-toast-loading-icon-color)}.van-toast__text{margin-top:var(--van-padding-xs)}
1
+ :root{--van-toast-max-width: 70%;--van-toast-font-size: var(--van-font-size-md);--van-toast-text-color: var(--van-white);--van-toast-loading-icon-color: var(--van-white);--van-toast-line-height: var(--van-line-height-md);--van-toast-radius: var(--van-radius-lg);--van-toast-background: rgba(0, 0, 0, .7);--van-toast-icon-size: 36px;--van-toast-text-min-width: 96px;--van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);--van-toast-default-padding: var(--van-padding-md);--van-toast-default-width: 88px;--van-toast-default-min-height: 88px;--van-toast-position-top-distance: 20%;--van-toast-position-bottom-distance: 20%}.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--van-duration-fast);width:var(--van-toast-default-width);max-width:var(--van-toast-max-width);min-height:var(--van-toast-default-min-height);padding:var(--van-toast-default-padding);color:var(--van-toast-text-color);font-size:var(--van-toast-font-size);line-height:var(--van-toast-line-height);white-space:pre-wrap;word-break:break-all;text-align:center;background:var(--van-toast-background);border-radius:var(--van-toast-radius)}.van-toast--break-normal{word-break:normal;word-wrap:normal}.van-toast--break-word{word-break:normal;word-wrap:break-word}.van-toast--unclickable{overflow:hidden;cursor:not-allowed}.van-toast--unclickable *{pointer-events:none}.van-toast--text,.van-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--van-toast-text-min-width);min-height:0;padding:var(--van-toast-text-padding)}.van-toast--text .van-toast__text,.van-toast--html .van-toast__text{margin-top:0}.van-toast--top{top:var(--van-toast-position-top-distance)}.van-toast--bottom{top:auto;bottom:var(--van-toast-position-bottom-distance)}.van-toast__icon{font-size:var(--van-toast-icon-size)}.van-toast__loading{padding:var(--van-padding-base);color:var(--van-toast-loading-icon-color)}.van-toast__text{margin-top:var(--van-padding-xs)}
@@ -17,6 +17,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
17
17
  default: import("./types").ToastPosition;
18
18
  };
19
19
  teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
20
+ wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
20
21
  className: import("vue").PropType<unknown>;
21
22
  iconPrefix: StringConstructor;
22
23
  transition: {
@@ -48,6 +49,7 @@ export declare const Toast: import("../utils").WithInstall<import("vue").DefineC
48
49
  default: import("./types").ToastPosition;
49
50
  };
50
51
  teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
52
+ wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
51
53
  className: import("vue").PropType<unknown>;
52
54
  iconPrefix: StringConstructor;
53
55
  transition: {
@@ -77,7 +79,7 @@ export default Toast;
77
79
  export { toastProps } from './Toast';
78
80
  export { showToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, } from './function-call';
79
81
  export type { ToastProps } from './Toast';
80
- export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, } from './types';
82
+ export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, ToastWordBreak, } from './types';
81
83
  declare module 'vue' {
82
84
  interface GlobalComponents {
83
85
  VanToast: typeof Toast;
@@ -3,6 +3,7 @@ import type { LoadingType } from '../loading';
3
3
  import type { Numeric } from '../utils';
4
4
  export declare type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
5
5
  export declare type ToastPosition = 'top' | 'middle' | 'bottom';
6
+ export declare type ToastWordBreak = 'break-all' | 'break-word' | 'normal';
6
7
  export declare type ToastOptions = {
7
8
  icon?: string;
8
9
  type?: ToastType;
@@ -18,6 +19,7 @@ export declare type ToastOptions = {
18
19
  className?: unknown;
19
20
  transition?: string;
20
21
  iconPrefix?: string;
22
+ wordBreak?: ToastWordBreak;
21
23
  loadingType?: LoadingType;
22
24
  forbidClick?: boolean;
23
25
  closeOnClick?: boolean;
package/lib/vant.cjs.js CHANGED
@@ -2156,7 +2156,7 @@ var stdin_default$1o = vue.defineComponent({
2156
2156
  }
2157
2157
  return 0;
2158
2158
  });
2159
- const maxCount = vue.computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
2159
+ const maxCount = vue.computed(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
2160
2160
  const trackSize = vue.computed(() => count.value * size.value);
2161
2161
  const activeIndicator = vue.computed(() => (state.active + count.value) % count.value);
2162
2162
  const isCorrectDirection = vue.computed(() => {
@@ -3434,6 +3434,7 @@ var stdin_default$1h = vue.defineComponent({
3434
3434
  const Area = withInstall(stdin_default$1h);
3435
3435
  const [name$19, bem$15] = createNamespace("cell");
3436
3436
  const cellSharedProps = {
3437
+ tag: makeStringProp("div"),
3437
3438
  icon: String,
3438
3439
  size: String,
3439
3440
  title: numericProp,
@@ -3512,8 +3513,9 @@ var stdin_default$1g = vue.defineComponent({
3512
3513
  }
3513
3514
  };
3514
3515
  return () => {
3515
- var _a, _b;
3516
+ var _a;
3516
3517
  const {
3518
+ tag,
3517
3519
  size,
3518
3520
  center,
3519
3521
  border,
@@ -3530,12 +3532,17 @@ var stdin_default$1g = vue.defineComponent({
3530
3532
  if (size) {
3531
3533
  classes[size] = !!size;
3532
3534
  }
3533
- return vue.createVNode("div", {
3535
+ return vue.createVNode(tag, {
3534
3536
  "class": bem$15(classes),
3535
3537
  "role": clickable ? "button" : void 0,
3536
3538
  "tabindex": clickable ? 0 : void 0,
3537
3539
  "onClick": route2
3538
- }, [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_b = slots.extra) == null ? void 0 : _b.call(slots)]);
3540
+ }, {
3541
+ default: () => {
3542
+ var _a2;
3543
+ return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
3544
+ }
3545
+ });
3539
3546
  };
3540
3547
  }
3541
3548
  });
@@ -4252,6 +4259,7 @@ const toastProps = {
4252
4259
  duration: makeNumberProp(2e3),
4253
4260
  position: makeStringProp("middle"),
4254
4261
  teleport: [String, Object],
4262
+ wordBreak: String,
4255
4263
  className: unknownProp,
4256
4264
  iconPrefix: String,
4257
4265
  transition: makeStringProp("van-fade"),
@@ -4343,7 +4351,7 @@ var stdin_default$1d = vue.defineComponent({
4343
4351
  vue.onMounted(toggleClickable);
4344
4352
  vue.onUnmounted(toggleClickable);
4345
4353
  return () => vue.createVNode(Popup, vue.mergeProps({
4346
- "class": [bem$12([props.position, {
4354
+ "class": [bem$12([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
4347
4355
  [props.type]: !props.icon
4348
4356
  }]), props.className],
4349
4357
  "lockScroll": false,
@@ -5738,6 +5746,7 @@ const [name$W] = createNamespace("calendar-header");
5738
5746
  var stdin_default$11 = vue.defineComponent({
5739
5747
  name: name$W,
5740
5748
  props: {
5749
+ date: Date,
5741
5750
  title: String,
5742
5751
  subtitle: String,
5743
5752
  showTitle: Boolean,
@@ -5761,7 +5770,10 @@ var stdin_default$11 = vue.defineComponent({
5761
5770
  const onClickSubtitle = (event) => emit("clickSubtitle", event);
5762
5771
  const renderSubtitle = () => {
5763
5772
  if (props.showSubtitle) {
5764
- const title = slots.subtitle ? slots.subtitle() : props.subtitle;
5773
+ const title = slots.subtitle ? slots.subtitle({
5774
+ date: props.date,
5775
+ text: props.subtitle
5776
+ }) : props.subtitle;
5765
5777
  return vue.createVNode("div", {
5766
5778
  "class": bem$V("header-subtitle"),
5767
5779
  "onClick": onClickSubtitle
@@ -5881,7 +5893,10 @@ var stdin_default$10 = vue.defineComponent({
5881
5893
  };
5882
5894
  let bodyHeight;
5883
5895
  const bodyRef = vue.ref();
5884
- const subtitle = vue.ref("");
5896
+ const subtitle = vue.ref({
5897
+ text: "",
5898
+ date: void 0
5899
+ });
5885
5900
  const currentDate = vue.ref(getInitialDate());
5886
5901
  const [monthRefs, setMonthRefs] = useRefs();
5887
5902
  const dayOffset = vue.computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
@@ -5942,7 +5957,10 @@ var stdin_default$10 = vue.defineComponent({
5942
5957
  monthRefs.value[index].setVisible(visible);
5943
5958
  });
5944
5959
  if (currentMonth) {
5945
- subtitle.value = currentMonth.getTitle();
5960
+ subtitle.value = {
5961
+ text: currentMonth.getTitle(),
5962
+ date: currentMonth.date
5963
+ };
5946
5964
  }
5947
5965
  };
5948
5966
  const scrollToDate = (targetDate) => {
@@ -6132,8 +6150,9 @@ var stdin_default$10 = vue.defineComponent({
6132
6150
  const renderCalendar = () => vue.createVNode("div", {
6133
6151
  "class": bem$V()
6134
6152
  }, [vue.createVNode(stdin_default$11, {
6153
+ "date": subtitle.value.date,
6135
6154
  "title": props.title,
6136
- "subtitle": subtitle.value,
6155
+ "subtitle": subtitle.value.text,
6137
6156
  "showTitle": props.showTitle,
6138
6157
  "showSubtitle": props.showSubtitle,
6139
6158
  "firstDayOfWeek": dayOffset.value,
@@ -9164,7 +9183,8 @@ var stdin_default$B = vue.defineComponent({
9164
9183
  },
9165
9184
  emits: ["scale", "close"],
9166
9185
  setup(props, {
9167
- emit
9186
+ emit,
9187
+ slots
9168
9188
  }) {
9169
9189
  const state = vue.reactive({
9170
9190
  scale: 1,
@@ -9382,7 +9402,11 @@ var stdin_default$B = vue.defineComponent({
9382
9402
  "onTouchend": onTouchEnd,
9383
9403
  "onTouchcancel": onTouchEnd
9384
9404
  }, {
9385
- default: () => [vue.createVNode(Image$1, {
9405
+ default: () => [slots.image ? vue.createVNode("div", {
9406
+ "class": bem$v("image-wrap")
9407
+ }, [slots.image({
9408
+ src: props.src
9409
+ })]) : vue.createVNode(Image$1, {
9386
9410
  "src": props.src,
9387
9411
  "fit": "contain",
9388
9412
  "class": bem$v("image", {
@@ -9491,7 +9515,9 @@ var stdin_default$A = vue.defineComponent({
9491
9515
  "rootHeight": state.rootHeight,
9492
9516
  "onScale": emitScale,
9493
9517
  "onClose": emitClose
9494
- }, null))]
9518
+ }, {
9519
+ image: slots.image
9520
+ }))]
9495
9521
  });
9496
9522
  const renderClose = () => {
9497
9523
  if (props.closeable) {
@@ -14575,7 +14601,7 @@ const Lazyload = {
14575
14601
  });
14576
14602
  }
14577
14603
  };
14578
- const version = "4.0.0-rc.5";
14604
+ const version = "4.0.0-rc.6";
14579
14605
  function install(app) {
14580
14606
  const components = [
14581
14607
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -2154,7 +2154,7 @@ var stdin_default$1o = defineComponent({
2154
2154
  }
2155
2155
  return 0;
2156
2156
  });
2157
- const maxCount = computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
2157
+ const maxCount = computed(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
2158
2158
  const trackSize = computed(() => count.value * size.value);
2159
2159
  const activeIndicator = computed(() => (state.active + count.value) % count.value);
2160
2160
  const isCorrectDirection = computed(() => {
@@ -3432,6 +3432,7 @@ var stdin_default$1h = defineComponent({
3432
3432
  const Area = withInstall(stdin_default$1h);
3433
3433
  const [name$19, bem$15] = createNamespace("cell");
3434
3434
  const cellSharedProps = {
3435
+ tag: makeStringProp("div"),
3435
3436
  icon: String,
3436
3437
  size: String,
3437
3438
  title: numericProp,
@@ -3510,8 +3511,9 @@ var stdin_default$1g = defineComponent({
3510
3511
  }
3511
3512
  };
3512
3513
  return () => {
3513
- var _a, _b;
3514
+ var _a;
3514
3515
  const {
3516
+ tag,
3515
3517
  size,
3516
3518
  center,
3517
3519
  border,
@@ -3528,12 +3530,17 @@ var stdin_default$1g = defineComponent({
3528
3530
  if (size) {
3529
3531
  classes[size] = !!size;
3530
3532
  }
3531
- return createVNode("div", {
3533
+ return createVNode(tag, {
3532
3534
  "class": bem$15(classes),
3533
3535
  "role": clickable ? "button" : void 0,
3534
3536
  "tabindex": clickable ? 0 : void 0,
3535
3537
  "onClick": route2
3536
- }, [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_b = slots.extra) == null ? void 0 : _b.call(slots)]);
3538
+ }, {
3539
+ default: () => {
3540
+ var _a2;
3541
+ return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
3542
+ }
3543
+ });
3537
3544
  };
3538
3545
  }
3539
3546
  });
@@ -4250,6 +4257,7 @@ const toastProps = {
4250
4257
  duration: makeNumberProp(2e3),
4251
4258
  position: makeStringProp("middle"),
4252
4259
  teleport: [String, Object],
4260
+ wordBreak: String,
4253
4261
  className: unknownProp,
4254
4262
  iconPrefix: String,
4255
4263
  transition: makeStringProp("van-fade"),
@@ -4341,7 +4349,7 @@ var stdin_default$1d = defineComponent({
4341
4349
  onMounted(toggleClickable);
4342
4350
  onUnmounted(toggleClickable);
4343
4351
  return () => createVNode(Popup, mergeProps({
4344
- "class": [bem$12([props.position, {
4352
+ "class": [bem$12([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
4345
4353
  [props.type]: !props.icon
4346
4354
  }]), props.className],
4347
4355
  "lockScroll": false,
@@ -5736,6 +5744,7 @@ const [name$W] = createNamespace("calendar-header");
5736
5744
  var stdin_default$11 = defineComponent({
5737
5745
  name: name$W,
5738
5746
  props: {
5747
+ date: Date,
5739
5748
  title: String,
5740
5749
  subtitle: String,
5741
5750
  showTitle: Boolean,
@@ -5759,7 +5768,10 @@ var stdin_default$11 = defineComponent({
5759
5768
  const onClickSubtitle = (event) => emit("clickSubtitle", event);
5760
5769
  const renderSubtitle = () => {
5761
5770
  if (props.showSubtitle) {
5762
- const title = slots.subtitle ? slots.subtitle() : props.subtitle;
5771
+ const title = slots.subtitle ? slots.subtitle({
5772
+ date: props.date,
5773
+ text: props.subtitle
5774
+ }) : props.subtitle;
5763
5775
  return createVNode("div", {
5764
5776
  "class": bem$V("header-subtitle"),
5765
5777
  "onClick": onClickSubtitle
@@ -5879,7 +5891,10 @@ var stdin_default$10 = defineComponent({
5879
5891
  };
5880
5892
  let bodyHeight;
5881
5893
  const bodyRef = ref();
5882
- const subtitle = ref("");
5894
+ const subtitle = ref({
5895
+ text: "",
5896
+ date: void 0
5897
+ });
5883
5898
  const currentDate = ref(getInitialDate());
5884
5899
  const [monthRefs, setMonthRefs] = useRefs();
5885
5900
  const dayOffset = computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
@@ -5940,7 +5955,10 @@ var stdin_default$10 = defineComponent({
5940
5955
  monthRefs.value[index].setVisible(visible);
5941
5956
  });
5942
5957
  if (currentMonth) {
5943
- subtitle.value = currentMonth.getTitle();
5958
+ subtitle.value = {
5959
+ text: currentMonth.getTitle(),
5960
+ date: currentMonth.date
5961
+ };
5944
5962
  }
5945
5963
  };
5946
5964
  const scrollToDate = (targetDate) => {
@@ -6130,8 +6148,9 @@ var stdin_default$10 = defineComponent({
6130
6148
  const renderCalendar = () => createVNode("div", {
6131
6149
  "class": bem$V()
6132
6150
  }, [createVNode(stdin_default$11, {
6151
+ "date": subtitle.value.date,
6133
6152
  "title": props.title,
6134
- "subtitle": subtitle.value,
6153
+ "subtitle": subtitle.value.text,
6135
6154
  "showTitle": props.showTitle,
6136
6155
  "showSubtitle": props.showSubtitle,
6137
6156
  "firstDayOfWeek": dayOffset.value,
@@ -9162,7 +9181,8 @@ var stdin_default$B = defineComponent({
9162
9181
  },
9163
9182
  emits: ["scale", "close"],
9164
9183
  setup(props, {
9165
- emit
9184
+ emit,
9185
+ slots
9166
9186
  }) {
9167
9187
  const state = reactive({
9168
9188
  scale: 1,
@@ -9380,7 +9400,11 @@ var stdin_default$B = defineComponent({
9380
9400
  "onTouchend": onTouchEnd,
9381
9401
  "onTouchcancel": onTouchEnd
9382
9402
  }, {
9383
- default: () => [createVNode(Image$1, {
9403
+ default: () => [slots.image ? createVNode("div", {
9404
+ "class": bem$v("image-wrap")
9405
+ }, [slots.image({
9406
+ src: props.src
9407
+ })]) : createVNode(Image$1, {
9384
9408
  "src": props.src,
9385
9409
  "fit": "contain",
9386
9410
  "class": bem$v("image", {
@@ -9489,7 +9513,9 @@ var stdin_default$A = defineComponent({
9489
9513
  "rootHeight": state.rootHeight,
9490
9514
  "onScale": emitScale,
9491
9515
  "onClose": emitClose
9492
- }, null))]
9516
+ }, {
9517
+ image: slots.image
9518
+ }))]
9493
9519
  });
9494
9520
  const renderClose = () => {
9495
9521
  if (props.closeable) {
@@ -14573,7 +14599,7 @@ const Lazyload = {
14573
14599
  });
14574
14600
  }
14575
14601
  };
14576
- const version = "4.0.0-rc.5";
14602
+ const version = "4.0.0-rc.6";
14577
14603
  function install(app) {
14578
14604
  const components = [
14579
14605
  ActionBar,
package/lib/vant.js CHANGED
@@ -2520,7 +2520,7 @@
2520
2520
  }
2521
2521
  return 0;
2522
2522
  });
2523
- const maxCount = vue.computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
2523
+ const maxCount = vue.computed(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
2524
2524
  const trackSize = vue.computed(() => count.value * size.value);
2525
2525
  const activeIndicator = vue.computed(() => (state.active + count.value) % count.value);
2526
2526
  const isCorrectDirection = vue.computed(() => {
@@ -3792,6 +3792,7 @@
3792
3792
  const Area = withInstall(stdin_default$1h);
3793
3793
  const [name$19, bem$15] = createNamespace("cell");
3794
3794
  const cellSharedProps = {
3795
+ tag: makeStringProp("div"),
3795
3796
  icon: String,
3796
3797
  size: String,
3797
3798
  title: numericProp,
@@ -3870,8 +3871,9 @@
3870
3871
  }
3871
3872
  };
3872
3873
  return () => {
3873
- var _a, _b;
3874
+ var _a;
3874
3875
  const {
3876
+ tag,
3875
3877
  size,
3876
3878
  center,
3877
3879
  border,
@@ -3888,12 +3890,17 @@
3888
3890
  if (size) {
3889
3891
  classes[size] = !!size;
3890
3892
  }
3891
- return vue.createVNode("div", {
3893
+ return vue.createVNode(tag, {
3892
3894
  "class": bem$15(classes),
3893
3895
  "role": clickable ? "button" : void 0,
3894
3896
  "tabindex": clickable ? 0 : void 0,
3895
3897
  "onClick": route2
3896
- }, [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_b = slots.extra) == null ? void 0 : _b.call(slots)]);
3898
+ }, {
3899
+ default: () => {
3900
+ var _a2;
3901
+ return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
3902
+ }
3903
+ });
3897
3904
  };
3898
3905
  }
3899
3906
  });
@@ -4610,6 +4617,7 @@
4610
4617
  duration: makeNumberProp(2e3),
4611
4618
  position: makeStringProp("middle"),
4612
4619
  teleport: [String, Object],
4620
+ wordBreak: String,
4613
4621
  className: unknownProp,
4614
4622
  iconPrefix: String,
4615
4623
  transition: makeStringProp("van-fade"),
@@ -4701,7 +4709,7 @@
4701
4709
  vue.onMounted(toggleClickable);
4702
4710
  vue.onUnmounted(toggleClickable);
4703
4711
  return () => vue.createVNode(Popup, vue.mergeProps({
4704
- "class": [bem$12([props.position, {
4712
+ "class": [bem$12([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
4705
4713
  [props.type]: !props.icon
4706
4714
  }]), props.className],
4707
4715
  "lockScroll": false,
@@ -6096,6 +6104,7 @@
6096
6104
  var stdin_default$11 = vue.defineComponent({
6097
6105
  name: name$W,
6098
6106
  props: {
6107
+ date: Date,
6099
6108
  title: String,
6100
6109
  subtitle: String,
6101
6110
  showTitle: Boolean,
@@ -6119,7 +6128,10 @@
6119
6128
  const onClickSubtitle = (event) => emit("clickSubtitle", event);
6120
6129
  const renderSubtitle = () => {
6121
6130
  if (props.showSubtitle) {
6122
- const title = slots.subtitle ? slots.subtitle() : props.subtitle;
6131
+ const title = slots.subtitle ? slots.subtitle({
6132
+ date: props.date,
6133
+ text: props.subtitle
6134
+ }) : props.subtitle;
6123
6135
  return vue.createVNode("div", {
6124
6136
  "class": bem$V("header-subtitle"),
6125
6137
  "onClick": onClickSubtitle
@@ -6239,7 +6251,10 @@
6239
6251
  };
6240
6252
  let bodyHeight;
6241
6253
  const bodyRef = vue.ref();
6242
- const subtitle = vue.ref("");
6254
+ const subtitle = vue.ref({
6255
+ text: "",
6256
+ date: void 0
6257
+ });
6243
6258
  const currentDate = vue.ref(getInitialDate());
6244
6259
  const [monthRefs, setMonthRefs] = useRefs();
6245
6260
  const dayOffset = vue.computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
@@ -6300,7 +6315,10 @@
6300
6315
  monthRefs.value[index].setVisible(visible);
6301
6316
  });
6302
6317
  if (currentMonth) {
6303
- subtitle.value = currentMonth.getTitle();
6318
+ subtitle.value = {
6319
+ text: currentMonth.getTitle(),
6320
+ date: currentMonth.date
6321
+ };
6304
6322
  }
6305
6323
  };
6306
6324
  const scrollToDate = (targetDate) => {
@@ -6490,8 +6508,9 @@
6490
6508
  const renderCalendar = () => vue.createVNode("div", {
6491
6509
  "class": bem$V()
6492
6510
  }, [vue.createVNode(stdin_default$11, {
6511
+ "date": subtitle.value.date,
6493
6512
  "title": props.title,
6494
- "subtitle": subtitle.value,
6513
+ "subtitle": subtitle.value.text,
6495
6514
  "showTitle": props.showTitle,
6496
6515
  "showSubtitle": props.showSubtitle,
6497
6516
  "firstDayOfWeek": dayOffset.value,
@@ -9499,7 +9518,8 @@
9499
9518
  },
9500
9519
  emits: ["scale", "close"],
9501
9520
  setup(props, {
9502
- emit
9521
+ emit,
9522
+ slots
9503
9523
  }) {
9504
9524
  const state = vue.reactive({
9505
9525
  scale: 1,
@@ -9717,7 +9737,11 @@
9717
9737
  "onTouchend": onTouchEnd,
9718
9738
  "onTouchcancel": onTouchEnd
9719
9739
  }, {
9720
- default: () => [vue.createVNode(Image$1, {
9740
+ default: () => [slots.image ? vue.createVNode("div", {
9741
+ "class": bem$v("image-wrap")
9742
+ }, [slots.image({
9743
+ src: props.src
9744
+ })]) : vue.createVNode(Image$1, {
9721
9745
  "src": props.src,
9722
9746
  "fit": "contain",
9723
9747
  "class": bem$v("image", {
@@ -9826,7 +9850,9 @@
9826
9850
  "rootHeight": state.rootHeight,
9827
9851
  "onScale": emitScale,
9828
9852
  "onClose": emitClose
9829
- }, null))]
9853
+ }, {
9854
+ image: slots.image
9855
+ }))]
9830
9856
  });
9831
9857
  const renderClose = () => {
9832
9858
  if (props.closeable) {
@@ -15790,7 +15816,7 @@
15790
15816
  });
15791
15817
  }
15792
15818
  };
15793
- const version = "4.0.0-rc.5";
15819
+ const version = "4.0.0-rc.6";
15794
15820
  function install(app) {
15795
15821
  const components = [
15796
15822
  ActionBar,