vant 3.5.4 → 3.6.0

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 (78) hide show
  1. package/README.md +4 -0
  2. package/changelog.generated.md +33 -2
  3. package/es/badge/Badge.mjs +1 -1
  4. package/es/calendar/Calendar.mjs +3 -4
  5. package/es/composables/use-global-z-index.d.ts +4 -0
  6. package/es/composables/use-global-z-index.mjs +9 -0
  7. package/es/composables/use-height.mjs +2 -0
  8. package/es/composables/use-lock-scroll.mjs +3 -1
  9. package/es/config-provider/ConfigProvider.d.ts +3 -0
  10. package/es/config-provider/ConfigProvider.mjs +8 -1
  11. package/es/config-provider/index.d.ts +2 -0
  12. package/es/empty/Empty.d.ts +1 -1
  13. package/es/empty/Empty.mjs +281 -16
  14. package/es/field/Field.mjs +4 -1
  15. package/es/field/types.d.ts +1 -0
  16. package/es/field/utils.d.ts +1 -0
  17. package/es/field/utils.mjs +8 -2
  18. package/es/index.d.ts +2 -1
  19. package/es/index.mjs +4 -1
  20. package/es/popover/Popover.mjs +11 -9
  21. package/es/popup/Popup.mjs +6 -5
  22. package/es/pull-refresh/PullRefresh.mjs +10 -3
  23. package/es/search/index.css +1 -1
  24. package/es/search/index.less +3 -1
  25. package/es/space/Space.d.ts +48 -0
  26. package/es/space/Space.mjs +87 -0
  27. package/es/space/index.css +1 -0
  28. package/es/space/index.d.ts +37 -0
  29. package/es/space/index.less +38 -0
  30. package/es/space/index.mjs +8 -0
  31. package/es/space/style/index.d.ts +1 -0
  32. package/es/space/style/index.mjs +2 -0
  33. package/es/space/style/less.d.ts +1 -0
  34. package/es/space/style/less.mjs +2 -0
  35. package/lib/badge/Badge.js +1 -1
  36. package/lib/calendar/Calendar.js +3 -4
  37. package/lib/composables/use-global-z-index.d.ts +4 -0
  38. package/lib/composables/use-global-z-index.js +28 -0
  39. package/lib/composables/use-height.js +2 -0
  40. package/lib/composables/use-lock-scroll.js +3 -1
  41. package/lib/config-provider/ConfigProvider.d.ts +3 -0
  42. package/lib/config-provider/ConfigProvider.js +7 -0
  43. package/lib/config-provider/index.d.ts +2 -0
  44. package/lib/empty/Empty.d.ts +1 -1
  45. package/lib/empty/Empty.js +281 -16
  46. package/lib/field/Field.js +3 -0
  47. package/lib/field/types.d.ts +1 -0
  48. package/lib/field/utils.d.ts +1 -0
  49. package/lib/field/utils.js +8 -2
  50. package/lib/index.css +1 -1
  51. package/lib/index.d.ts +2 -1
  52. package/lib/index.js +4 -1
  53. package/lib/index.less +1 -0
  54. package/lib/popover/Popover.js +10 -8
  55. package/lib/popup/Popup.js +6 -5
  56. package/lib/pull-refresh/PullRefresh.js +9 -2
  57. package/lib/search/index.css +1 -1
  58. package/lib/search/index.less +3 -1
  59. package/lib/space/Space.d.ts +48 -0
  60. package/lib/space/Space.js +106 -0
  61. package/lib/space/index.css +1 -0
  62. package/lib/space/index.d.ts +37 -0
  63. package/lib/space/index.js +30 -0
  64. package/lib/space/index.less +38 -0
  65. package/lib/space/style/index.d.ts +1 -0
  66. package/lib/space/style/index.js +2 -0
  67. package/lib/space/style/less.d.ts +1 -0
  68. package/lib/space/style/less.js +2 -0
  69. package/lib/vant.cjs.js +1170 -1055
  70. package/lib/vant.es.js +1171 -1056
  71. package/lib/vant.js +1176 -1057
  72. package/lib/vant.min.js +1 -1
  73. package/lib/web-types.json +1042 -970
  74. package/package.json +2 -2
  75. package/es/empty/Images.d.ts +0 -4
  76. package/es/empty/Images.mjs +0 -271
  77. package/lib/empty/Images.d.ts +0 -4
  78. package/lib/empty/Images.js +0 -290
@@ -1,5 +1,5 @@
1
1
  import { mergeProps as _mergeProps, Fragment as _Fragment, createVNode as _createVNode } from "vue";
2
- import { ref, watch, nextTick, onMounted, onBeforeUnmount, defineComponent } from "vue";
2
+ import { ref, watch, nextTick, onMounted, watchEffect, onBeforeUnmount, defineComponent } from "vue";
3
3
  import { createPopper, offsetModifier } from "@vant/popperjs";
4
4
  import { pick, extend, truthProp, numericProp, unknownProp, BORDER_BOTTOM, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
5
5
  import { useClickAway } from "@vant/use";
@@ -41,6 +41,7 @@ var stdin_default = defineComponent({
41
41
  attrs
42
42
  }) {
43
43
  let popper;
44
+ const popupRef = ref();
44
45
  const wrapperRef = ref();
45
46
  const popoverRef = ref();
46
47
  const getPopoverOptions = () => ({
@@ -81,10 +82,6 @@ var stdin_default = defineComponent({
81
82
  updateShow(!props.show);
82
83
  }
83
84
  };
84
- const onTouchstart = (event) => {
85
- event.stopPropagation();
86
- emit("touchstart", event);
87
- };
88
85
  const onClickAction = (action, index) => {
89
86
  if (action.disabled) {
90
87
  return;
@@ -95,7 +92,7 @@ var stdin_default = defineComponent({
95
92
  }
96
93
  };
97
94
  const onClickAway = () => {
98
- if (props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
95
+ if (props.show && props.closeOnClickOutside && (!props.overlay || props.closeOnClickOverlay)) {
99
96
  updateShow(false);
100
97
  }
101
98
  };
@@ -135,7 +132,13 @@ var stdin_default = defineComponent({
135
132
  "onClick": () => onClickAction(action, index)
136
133
  }, [renderActionContent(action, index)]);
137
134
  };
138
- onMounted(updateLocation);
135
+ onMounted(() => {
136
+ updateLocation();
137
+ watchEffect(() => {
138
+ var _a;
139
+ popupRef.value = (_a = popoverRef.value) == null ? void 0 : _a.popupRef.value;
140
+ });
141
+ });
139
142
  onBeforeUnmount(() => {
140
143
  if (popper) {
141
144
  popper.destroy();
@@ -143,7 +146,7 @@ var stdin_default = defineComponent({
143
146
  }
144
147
  });
145
148
  watch(() => [props.show, props.offset, props.placement], updateLocation);
146
- useClickAway(wrapperRef, onClickAway, {
149
+ useClickAway([wrapperRef, popupRef], onClickAway, {
147
150
  eventName: "touchstart"
148
151
  });
149
152
  return () => {
@@ -158,7 +161,6 @@ var stdin_default = defineComponent({
158
161
  "position": "",
159
162
  "transition": "van-popover-zoom",
160
163
  "lockScroll": false,
161
- "onTouchstart": onTouchstart,
162
164
  "onUpdate:show": updateShow
163
165
  }, attrs, pick(props, popupProps)), {
164
166
  default: () => [props.showArrow && _createVNode("div", {
@@ -7,6 +7,7 @@ import { useExpose } from "../composables/use-expose.mjs";
7
7
  import { useLockScroll } from "../composables/use-lock-scroll.mjs";
8
8
  import { useLazyRender } from "../composables/use-lazy-render.mjs";
9
9
  import { POPUP_TOGGLE_KEY } from "../composables/on-popup-reopen.mjs";
10
+ import { useGlobalZIndex } from "../composables/use-global-z-index.mjs";
10
11
  import { Icon } from "../icon/index.mjs";
11
12
  import { Overlay } from "../overlay/index.mjs";
12
13
  const popupProps = extend({}, popupSharedProps, {
@@ -22,7 +23,6 @@ const popupProps = extend({}, popupSharedProps, {
22
23
  safeAreaInsetBottom: Boolean
23
24
  });
24
25
  const [name, bem] = createNamespace("popup");
25
- let globalZIndex = 2e3;
26
26
  var stdin_default = defineComponent({
27
27
  name,
28
28
  inheritAttrs: false,
@@ -50,11 +50,8 @@ var stdin_default = defineComponent({
50
50
  });
51
51
  const open = () => {
52
52
  if (!opened) {
53
- if (props.zIndex !== void 0) {
54
- globalZIndex = +props.zIndex;
55
- }
56
53
  opened = true;
57
- zIndex.value = ++globalZIndex;
54
+ zIndex.value = props.zIndex !== void 0 ? +props.zIndex : useGlobalZIndex();
58
55
  emit("open");
59
56
  }
60
57
  };
@@ -83,6 +80,8 @@ var stdin_default = defineComponent({
83
80
  "zIndex": zIndex.value,
84
81
  "duration": props.duration,
85
82
  "customStyle": props.overlayStyle,
83
+ "role": props.closeOnClickOverlay ? "button" : void 0,
84
+ "tabindex": props.closeOnClickOverlay ? 0 : void 0,
86
85
  "onClick": onClickOverlay
87
86
  }, {
88
87
  default: slots["overlay-content"]
@@ -119,6 +118,8 @@ var stdin_default = defineComponent({
119
118
  return _withDirectives(_createVNode("div", _mergeProps({
120
119
  "ref": popupRef,
121
120
  "style": style.value,
121
+ "role": "dialog",
122
+ "tabindex": 0,
122
123
  "class": [bem({
123
124
  round,
124
125
  [position]: position
@@ -1,7 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, reactive, nextTick, defineComponent } from "vue";
3
3
  import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
4
- import { useScrollParent } from "@vant/use";
4
+ import { useEventListener, useScrollParent } from "@vant/use";
5
5
  import { useTouch } from "../composables/use-touch.mjs";
6
6
  import { Loading } from "../loading/index.mjs";
7
7
  const [name, bem, t] = createNamespace("pull-refresh");
@@ -29,6 +29,7 @@ var stdin_default = defineComponent({
29
29
  }) {
30
30
  let reachTop;
31
31
  const root = ref();
32
+ const track = ref();
32
33
  const scrollParent = useScrollParent(root);
33
34
  const state = reactive({
34
35
  status: "normal",
@@ -161,6 +162,13 @@ var stdin_default = defineComponent({
161
162
  setStatus(0, false);
162
163
  }
163
164
  });
165
+ useEventListener("touchstart", onTouchStart, {
166
+ target: track,
167
+ passive: true
168
+ });
169
+ useEventListener("touchmove", onTouchMove, {
170
+ target: track
171
+ });
164
172
  return () => {
165
173
  var _a;
166
174
  const trackStyle = {
@@ -171,10 +179,9 @@ var stdin_default = defineComponent({
171
179
  "ref": root,
172
180
  "class": bem()
173
181
  }, [_createVNode("div", {
182
+ "ref": track,
174
183
  "class": bem("track"),
175
184
  "style": trackStyle,
176
- "onTouchstart": onTouchStart,
177
- "onTouchmove": onTouchMove,
178
185
  "onTouchend": onTouchEnd,
179
186
  "onTouchcancel": onTouchEnd
180
187
  }, [_createVNode("div", {
@@ -1 +1 @@
1
- :root{--van-search-padding: 10px var(--van-padding-sm);--van-search-background-color: var(--van-background-color-light);--van-search-content-background-color: var(--van-gray-1);--van-search-input-height: 34px;--van-search-label-padding: 0 5px;--van-search-label-color: var(--van-text-color);--van-search-label-font-size: var(--van-font-size-md);--van-search-left-icon-color: var(--van-gray-6);--van-search-action-padding: 0 var(--van-padding-xs);--van-search-action-text-color: var(--van-text-color);--van-search-action-font-size: var(--van-font-size-md)}.van-search{display:flex;align-items:center;box-sizing:border-box;padding:var(--van-search-padding);background:var(--van-search-background-color)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background-color);border-radius:var(--van-border-radius-sm)}.van-search__content--round{border-radius:var(--van-border-radius-max)}.van-search__label{padding:var(--van-search-label-padding);color:var(--van-search-label-color);font-size:var(--van-search-label-font-size);line-height:var(--van-search-input-height)}.van-search__field{flex:1;padding:5px var(--van-padding-xs) 5px 0;background-color:transparent}.van-search__field .van-field__left-icon{color:var(--van-search-left-icon-color)}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:var(--van-search-action-padding);color:var(--van-search-action-text-color);font-size:var(--van-search-action-font-size);line-height:var(--van-search-input-height);cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:var(--van-active-color)}
1
+ :root{--van-search-padding: 10px var(--van-padding-sm);--van-search-background-color: var(--van-background-color-light);--van-search-content-background-color: var(--van-gray-1);--van-search-input-height: 34px;--van-search-label-padding: 0 5px;--van-search-label-color: var(--van-text-color);--van-search-label-font-size: var(--van-font-size-md);--van-search-left-icon-color: var(--van-gray-6);--van-search-action-padding: 0 var(--van-padding-xs);--van-search-action-text-color: var(--van-text-color);--van-search-action-font-size: var(--van-font-size-md)}.van-search{display:flex;align-items:center;box-sizing:border-box;padding:var(--van-search-padding);background:var(--van-search-background-color)}.van-search__content{display:flex;flex:1;padding-left:var(--van-padding-sm);background:var(--van-search-content-background-color);border-radius:var(--van-border-radius-sm)}.van-search__content--round{border-radius:var(--van-border-radius-max)}.van-search__label{padding:var(--van-search-label-padding);color:var(--van-search-label-color);font-size:var(--van-search-label-font-size);line-height:var(--van-search-input-height)}.van-search__field{flex:1;align-items:center;padding:0 var(--van-padding-xs) 0 0;height:var(--van-search-input-height);background-color:transparent}.van-search__field .van-field__left-icon{color:var(--van-search-left-icon-color)}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:var(--van-search-action-padding);color:var(--van-search-action-text-color);font-size:var(--van-search-action-font-size);line-height:var(--van-search-input-height);cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:var(--van-active-color)}
@@ -42,7 +42,9 @@
42
42
 
43
43
  &__field {
44
44
  flex: 1;
45
- padding: 5px var(--van-padding-xs) 5px 0;
45
+ align-items: center;
46
+ padding: 0 var(--van-padding-xs) 0 0;
47
+ height: var(--van-search-input-height);
46
48
  background-color: transparent;
47
49
 
48
50
  .van-field__left-icon {
@@ -0,0 +1,48 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ export declare type SpaceSize = number | string;
3
+ export declare type SpaceAlign = 'start' | 'end' | 'center' | 'baseline';
4
+ declare const spaceProps: {
5
+ align: PropType<SpaceAlign>;
6
+ direction: {
7
+ type: PropType<"vertical" | "horizontal">;
8
+ default: string;
9
+ };
10
+ size: {
11
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
12
+ default: number;
13
+ };
14
+ wrap: BooleanConstructor;
15
+ fill: BooleanConstructor;
16
+ };
17
+ export declare type SpaceProps = ExtractPropTypes<typeof spaceProps>;
18
+ declare const _default: import("vue").DefineComponent<{
19
+ align: PropType<SpaceAlign>;
20
+ direction: {
21
+ type: PropType<"vertical" | "horizontal">;
22
+ default: string;
23
+ };
24
+ size: {
25
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
26
+ default: number;
27
+ };
28
+ wrap: BooleanConstructor;
29
+ fill: BooleanConstructor;
30
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
31
+ align: PropType<SpaceAlign>;
32
+ direction: {
33
+ type: PropType<"vertical" | "horizontal">;
34
+ default: string;
35
+ };
36
+ size: {
37
+ type: PropType<string | number | [SpaceSize, SpaceSize]>;
38
+ default: number;
39
+ };
40
+ wrap: BooleanConstructor;
41
+ fill: BooleanConstructor;
42
+ }>>, {
43
+ fill: boolean;
44
+ size: string | number | [SpaceSize, SpaceSize];
45
+ wrap: boolean;
46
+ direction: "vertical" | "horizontal";
47
+ }>;
48
+ export default _default;
@@ -0,0 +1,87 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { computed, defineComponent, Fragment } from "vue";
3
+ import { createNamespace } from "../utils/index.mjs";
4
+ const [name, bem] = createNamespace("space");
5
+ const spaceProps = {
6
+ align: String,
7
+ direction: {
8
+ type: String,
9
+ default: "horizontal"
10
+ },
11
+ size: {
12
+ type: [Number, String, Array],
13
+ default: 8
14
+ },
15
+ wrap: Boolean,
16
+ fill: Boolean
17
+ };
18
+ function filterEmpty(children = []) {
19
+ const nodes = [];
20
+ children.forEach((child) => {
21
+ if (Array.isArray(child)) {
22
+ nodes.push(...child);
23
+ } else if (child.type === Fragment) {
24
+ nodes.push(...filterEmpty(child.children));
25
+ } else {
26
+ nodes.push(child);
27
+ }
28
+ });
29
+ return nodes.filter((c) => {
30
+ var _a;
31
+ return !(c && (typeof Comment !== "undefined" && c.type === Comment || c.type === Fragment && ((_a = c.children) == null ? void 0 : _a.length) === 0 || c.type === Text && c.children.trim() === ""));
32
+ });
33
+ }
34
+ var stdin_default = defineComponent({
35
+ name,
36
+ props: spaceProps,
37
+ setup(props, {
38
+ slots
39
+ }) {
40
+ const mergedAlign = computed(() => {
41
+ var _a;
42
+ return (_a = props.align) != null ? _a : props.direction === "horizontal" ? "center" : "";
43
+ });
44
+ const getMargin = (size) => {
45
+ if (typeof size === "number") {
46
+ return size + "px";
47
+ }
48
+ return size;
49
+ };
50
+ const getMarginStyle = (isLast) => {
51
+ const style = {};
52
+ const marginRight = `${getMargin(Array.isArray(props.size) ? props.size[0] : props.size)}`;
53
+ const marginBottom = `${getMargin(Array.isArray(props.size) ? props.size[1] : props.size)}`;
54
+ if (isLast) {
55
+ return props.wrap ? {
56
+ marginBottom
57
+ } : {};
58
+ }
59
+ if (props.direction === "horizontal") {
60
+ style.marginRight = marginRight;
61
+ }
62
+ if (props.direction === "vertical" || props.wrap) {
63
+ style.marginBottom = marginBottom;
64
+ }
65
+ return style;
66
+ };
67
+ return () => {
68
+ var _a;
69
+ const children = filterEmpty((_a = slots.default) == null ? void 0 : _a.call(slots));
70
+ return _createVNode("div", {
71
+ "class": [bem({
72
+ [props.direction]: props.direction,
73
+ [`align-${mergedAlign.value}`]: mergedAlign.value,
74
+ wrap: props.wrap,
75
+ fill: props.fill
76
+ })]
77
+ }, [children.map((c, i) => _createVNode("div", {
78
+ "key": `item-${i}`,
79
+ "class": `${name}-item`,
80
+ "style": getMarginStyle(i === children.length - 1)
81
+ }, [c]))]);
82
+ };
83
+ }
84
+ });
85
+ export {
86
+ stdin_default as default
87
+ };
@@ -0,0 +1 @@
1
+ .van-space{display:inline-flex}.van-space--horizontal .van-space-item{display:flex;align-items:center}.van-space--vertical{flex-direction:column}.van-space--align-baseline{align-items:baseline}.van-space--align-start{align-items:flex-start}.van-space--align-end{align-items:flex-end}.van-space--align-center{align-items:center}.van-space--wrap{flex-wrap:wrap}.van-space--fill{display:flex}
@@ -0,0 +1,37 @@
1
+ export declare const Space: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ align: import("vue").PropType<import("./Space").SpaceAlign>;
3
+ direction: {
4
+ type: import("vue").PropType<"vertical" | "horizontal">;
5
+ default: string;
6
+ };
7
+ size: {
8
+ type: import("vue").PropType<string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize]>;
9
+ default: number;
10
+ };
11
+ wrap: BooleanConstructor;
12
+ fill: BooleanConstructor;
13
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
+ align: import("vue").PropType<import("./Space").SpaceAlign>;
15
+ direction: {
16
+ type: import("vue").PropType<"vertical" | "horizontal">;
17
+ default: string;
18
+ };
19
+ size: {
20
+ type: import("vue").PropType<string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize]>;
21
+ default: number;
22
+ };
23
+ wrap: BooleanConstructor;
24
+ fill: BooleanConstructor;
25
+ }>>, {
26
+ fill: boolean;
27
+ size: string | number | [import("./Space").SpaceSize, import("./Space").SpaceSize];
28
+ wrap: boolean;
29
+ direction: "vertical" | "horizontal";
30
+ }>>;
31
+ export default Space;
32
+ export type { SpaceProps, SpaceSize, SpaceAlign } from './Space';
33
+ declare module 'vue' {
34
+ interface GlobalComponents {
35
+ VanSpace: typeof Space;
36
+ }
37
+ }
@@ -0,0 +1,38 @@
1
+ .van-space {
2
+ display: inline-flex;
3
+
4
+ &--horizontal {
5
+ .van-space-item {
6
+ display: flex;
7
+ align-items: center;
8
+ }
9
+ }
10
+
11
+ &--vertical {
12
+ flex-direction: column;
13
+ }
14
+
15
+ &--align-baseline {
16
+ align-items: baseline;
17
+ }
18
+
19
+ &--align-start {
20
+ align-items: flex-start;
21
+ }
22
+
23
+ &--align-end {
24
+ align-items: flex-end;
25
+ }
26
+
27
+ &--align-center {
28
+ align-items: center;
29
+ }
30
+
31
+ &--wrap {
32
+ flex-wrap: wrap;
33
+ }
34
+
35
+ &--fill {
36
+ display: flex;
37
+ }
38
+ }
@@ -0,0 +1,8 @@
1
+ import { withInstall } from "../utils/index.mjs";
2
+ import _Space from "./Space.mjs";
3
+ const Space = withInstall(_Space);
4
+ var stdin_default = Space;
5
+ export {
6
+ Space,
7
+ stdin_default as default
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.css";
2
+ import "../index.css";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.less";
2
+ import "../index.less";
@@ -48,7 +48,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
48
48
  content,
49
49
  showZero
50
50
  } = props;
51
- return (0, import_utils.isDef)(content) && content !== "" && (showZero || content !== 0);
51
+ return (0, import_utils.isDef)(content) && content !== "" && (showZero || content !== 0 && content !== "0");
52
52
  };
53
53
  const renderContent = () => {
54
54
  const {
@@ -137,9 +137,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
137
137
  const months = (0, import_vue2.computed)(() => {
138
138
  const months2 = [];
139
139
  const cursor = new Date(props.minDate);
140
- if (props.lazyRender && !props.show && props.poppable) {
141
- return months2;
142
- }
143
140
  cursor.setDate(1);
144
141
  do {
145
142
  months2.push(new Date(cursor));
@@ -217,7 +214,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
217
214
  }
218
215
  if (currentDate.value) {
219
216
  const targetDate = props.type === "single" ? currentDate.value : currentDate.value[0];
220
- scrollToDate(targetDate);
217
+ if ((0, import_utils.isDate)(targetDate)) {
218
+ scrollToDate(targetDate);
219
+ }
221
220
  } else {
222
221
  (0, import_use.raf)(onScroll);
223
222
  }
@@ -0,0 +1,4 @@
1
+ /** the global z-index is automatically incremented after reading */
2
+ export declare const useGlobalZIndex: () => number;
3
+ /** reset the global z-index */
4
+ export declare const setGlobalZIndex: (val: number) => void;
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ setGlobalZIndex: () => setGlobalZIndex,
21
+ useGlobalZIndex: () => useGlobalZIndex
22
+ });
23
+ module.exports = __toCommonJS(stdin_exports);
24
+ let globalZIndex = 2e3;
25
+ const useGlobalZIndex = () => ++globalZIndex;
26
+ const setGlobalZIndex = (val) => {
27
+ globalZIndex = val;
28
+ };
@@ -22,6 +22,7 @@ __export(stdin_exports, {
22
22
  module.exports = __toCommonJS(stdin_exports);
23
23
  var import_use = require("@vant/use");
24
24
  var import_vue = require("vue");
25
+ var import_on_popup_reopen = require("./on-popup-reopen");
25
26
  const useHeight = (element, withSafeArea) => {
26
27
  const height = (0, import_vue.ref)();
27
28
  const setHeight = () => {
@@ -35,5 +36,6 @@ const useHeight = (element, withSafeArea) => {
35
36
  }
36
37
  }
37
38
  });
39
+ (0, import_on_popup_reopen.onPopupReopen)(() => (0, import_vue.nextTick)(setHeight));
38
40
  return height;
39
41
  };
@@ -28,9 +28,11 @@ let totalLockCount = 0;
28
28
  const BODY_LOCK_CLASS = "van-overflow-hidden";
29
29
  function useLockScroll(rootRef, shouldLock) {
30
30
  const touch = (0, import_use_touch.useTouch)();
31
+ const DIRECTION_UP = "01";
32
+ const DIRECTION_DOWN = "10";
31
33
  const onTouchMove = (event) => {
32
34
  touch.move(event);
33
- const direction = touch.deltaY.value > 0 ? "10" : "01";
35
+ const direction = touch.deltaY.value > 0 ? DIRECTION_DOWN : DIRECTION_UP;
34
36
  const el = (0, import_use.getScrollParent)(event.target, rootRef.value);
35
37
  const { scrollHeight, offsetHeight, scrollTop } = el;
36
38
  let status = "11";
@@ -9,6 +9,7 @@ declare const configProviderProps: {
9
9
  type: PropType<keyof HTMLElementTagNameMap>;
10
10
  default: keyof HTMLElementTagNameMap;
11
11
  };
12
+ zIndex: NumberConstructor;
12
13
  themeVars: PropType<Record<string, Numeric>>;
13
14
  iconPrefix: StringConstructor;
14
15
  };
@@ -18,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
18
19
  type: PropType<keyof HTMLElementTagNameMap>;
19
20
  default: keyof HTMLElementTagNameMap;
20
21
  };
22
+ zIndex: NumberConstructor;
21
23
  themeVars: PropType<Record<string, Numeric>>;
22
24
  iconPrefix: StringConstructor;
23
25
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
@@ -25,6 +27,7 @@ declare const _default: import("vue").DefineComponent<{
25
27
  type: PropType<keyof HTMLElementTagNameMap>;
26
28
  default: keyof HTMLElementTagNameMap;
27
29
  };
30
+ zIndex: NumberConstructor;
28
31
  themeVars: PropType<Record<string, Numeric>>;
29
32
  iconPrefix: StringConstructor;
30
33
  }>>, {
@@ -24,10 +24,12 @@ module.exports = __toCommonJS(stdin_exports);
24
24
  var import_vue = require("vue");
25
25
  var import_vue2 = require("vue");
26
26
  var import_utils = require("../utils");
27
+ var import_use_global_z_index = require("../composables/use-global-z-index");
27
28
  const [name, bem] = (0, import_utils.createNamespace)("config-provider");
28
29
  const CONFIG_PROVIDER_KEY = Symbol(name);
29
30
  const configProviderProps = {
30
31
  tag: (0, import_utils.makeStringProp)("div"),
32
+ zIndex: Number,
31
33
  themeVars: Object,
32
34
  iconPrefix: String
33
35
  };
@@ -50,6 +52,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
50
52
  }
51
53
  });
52
54
  (0, import_vue2.provide)(CONFIG_PROVIDER_KEY, props);
55
+ (0, import_vue2.watchEffect)(() => {
56
+ if (props.zIndex !== void 0) {
57
+ (0, import_use_global_z_index.setGlobalZIndex)(props.zIndex);
58
+ }
59
+ });
53
60
  return () => (0, import_vue.createVNode)(props.tag, {
54
61
  "class": bem(),
55
62
  "style": style.value
@@ -3,6 +3,7 @@ export declare const ConfigProvider: import("../utils").WithInstall<import("vue"
3
3
  type: import("vue").PropType<keyof HTMLElementTagNameMap>;
4
4
  default: keyof HTMLElementTagNameMap;
5
5
  };
6
+ zIndex: NumberConstructor;
6
7
  themeVars: import("vue").PropType<Record<string, import("../utils").Numeric>>;
7
8
  iconPrefix: StringConstructor;
8
9
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -10,6 +11,7 @@ export declare const ConfigProvider: import("../utils").WithInstall<import("vue"
10
11
  type: import("vue").PropType<keyof HTMLElementTagNameMap>;
11
12
  default: keyof HTMLElementTagNameMap;
12
13
  };
14
+ zIndex: NumberConstructor;
13
15
  themeVars: import("vue").PropType<Record<string, import("../utils").Numeric>>;
14
16
  iconPrefix: StringConstructor;
15
17
  }>>, {
@@ -1,4 +1,4 @@
1
- import { PropType, type ExtractPropTypes } from 'vue';
1
+ import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import { Numeric } from '../utils';
3
3
  declare const emptyProps: {
4
4
  image: {