vant 4.9.21 → 4.9.22
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.
- package/README.md +2 -2
- package/es/action-bar-button/index.css +1 -1
- package/es/action-sheet/ActionSheet.d.ts +1 -1
- package/es/action-sheet/index.d.ts +1 -1
- package/es/address-list/AddressListItem.d.ts +1 -1
- package/es/area/Area.d.ts +1 -1
- package/es/area/index.d.ts +1 -1
- package/es/calendar/index.css +1 -1
- package/es/composables/on-popup-reopen.mjs +1 -1
- package/es/composables/use-tab-status.mjs +2 -2
- package/es/composables/use-touch.mjs +4 -4
- package/es/date-picker/DatePicker.d.ts +1 -1
- package/es/date-picker/index.d.ts +1 -1
- package/es/dialog/Dialog.d.ts +1 -1
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.d.ts +1 -1
- package/es/field/Field.d.ts +5 -5
- package/es/field/Field.mjs +3 -3
- package/es/field/index.d.ts +3 -3
- package/es/field/types.d.ts +1 -0
- package/es/floating-panel/FloatingPanel.d.ts +13 -0
- package/es/floating-panel/FloatingPanel.mjs +14 -2
- package/es/floating-panel/index.d.ts +9 -0
- package/es/grid/Grid.d.ts +1 -1
- package/es/grid/index.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/list/List.d.ts +13 -3
- package/es/list/List.mjs +5 -2
- package/es/list/index.d.ts +9 -2
- package/es/picker/Picker.d.ts +1 -1
- package/es/picker/index.d.ts +1 -1
- package/es/search/Search.d.ts +4 -4
- package/es/search/Search.mjs +1 -0
- package/es/search/index.d.ts +3 -3
- package/es/share-sheet/ShareSheet.d.ts +1 -1
- package/es/share-sheet/index.d.ts +1 -1
- package/es/stepper/Stepper.mjs +3 -0
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/index.d.ts +1 -1
- package/es/time-picker/TimePicker.d.ts +1 -1
- package/es/time-picker/TimePicker.mjs +1 -1
- package/es/time-picker/index.d.ts +1 -1
- package/es/utils/constant.mjs +1 -1
- package/lib/action-bar-button/index.css +1 -1
- package/lib/action-sheet/ActionSheet.d.ts +1 -1
- package/lib/action-sheet/index.d.ts +1 -1
- package/lib/address-list/AddressListItem.d.ts +1 -1
- package/lib/area/Area.d.ts +1 -1
- package/lib/area/index.d.ts +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/composables/on-popup-reopen.js +1 -1
- package/lib/composables/use-tab-status.js +2 -2
- package/lib/composables/use-touch.js +4 -4
- package/lib/date-picker/DatePicker.d.ts +1 -1
- package/lib/date-picker/index.d.ts +1 -1
- package/lib/dialog/Dialog.d.ts +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/field/Field.d.ts +5 -5
- package/lib/field/Field.js +3 -3
- package/lib/field/index.d.ts +3 -3
- package/lib/field/types.d.ts +1 -0
- package/lib/floating-panel/FloatingPanel.d.ts +13 -0
- package/lib/floating-panel/FloatingPanel.js +14 -2
- package/lib/floating-panel/index.d.ts +9 -0
- package/lib/grid/Grid.d.ts +1 -1
- package/lib/grid/index.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/list/List.d.ts +13 -3
- package/lib/list/List.js +5 -2
- package/lib/list/index.d.ts +9 -2
- package/lib/picker/Picker.d.ts +1 -1
- package/lib/picker/index.d.ts +1 -1
- package/lib/search/Search.d.ts +4 -4
- package/lib/search/Search.js +1 -0
- package/lib/search/index.d.ts +3 -3
- package/lib/share-sheet/ShareSheet.d.ts +1 -1
- package/lib/share-sheet/index.d.ts +1 -1
- package/lib/stepper/Stepper.js +3 -0
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/time-picker/TimePicker.d.ts +1 -1
- package/lib/time-picker/TimePicker.js +1 -1
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/utils/constant.js +1 -1
- package/lib/vant.cjs.js +32 -13
- package/lib/vant.es.js +32 -13
- package/lib/vant.js +40 -21
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +14 -14
package/lib/vant.js
CHANGED
|
@@ -745,7 +745,7 @@
|
|
|
745
745
|
const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
|
|
746
746
|
const BORDER_UNSET_TOP_BOTTOM = `${BORDER}-unset--top-bottom`;
|
|
747
747
|
const HAPTICS_FEEDBACK = "van-haptics-feedback";
|
|
748
|
-
const FORM_KEY = Symbol("van-form");
|
|
748
|
+
const FORM_KEY = /* @__PURE__ */ Symbol("van-form");
|
|
749
749
|
const LONG_PRESS_START_TIME = 500;
|
|
750
750
|
const TAP_OFFSET = 5;
|
|
751
751
|
function callInterceptor(interceptor, {
|
|
@@ -788,7 +788,7 @@
|
|
|
788
788
|
(pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
|
|
789
789
|
);
|
|
790
790
|
}
|
|
791
|
-
const POPUP_TOGGLE_KEY = Symbol();
|
|
791
|
+
const POPUP_TOGGLE_KEY = /* @__PURE__ */ Symbol();
|
|
792
792
|
function onPopupReopen(callback) {
|
|
793
793
|
const popupToggleStatus = vue.inject(POPUP_TOGGLE_KEY, null);
|
|
794
794
|
if (popupToggleStatus) {
|
|
@@ -2353,7 +2353,7 @@
|
|
|
2353
2353
|
return propRef;
|
|
2354
2354
|
};
|
|
2355
2355
|
/**
|
|
2356
|
-
* @vue/shared v3.5.
|
|
2356
|
+
* @vue/shared v3.5.25
|
|
2357
2357
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
2358
2358
|
* @license MIT
|
|
2359
2359
|
**/
|
|
@@ -3418,8 +3418,8 @@
|
|
|
3418
3418
|
})]);
|
|
3419
3419
|
}
|
|
3420
3420
|
});
|
|
3421
|
-
const TAB_STATUS_KEY = Symbol();
|
|
3422
|
-
const ALL_TAB_STATUS_KEY = Symbol();
|
|
3421
|
+
const TAB_STATUS_KEY = /* @__PURE__ */ Symbol();
|
|
3422
|
+
const ALL_TAB_STATUS_KEY = /* @__PURE__ */ Symbol();
|
|
3423
3423
|
const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
|
|
3424
3424
|
const useAllTabStatus = () => vue.inject(ALL_TAB_STATUS_KEY, null);
|
|
3425
3425
|
const useProvideTabStatus = (status) => {
|
|
@@ -4733,7 +4733,7 @@
|
|
|
4733
4733
|
var _a, _b;
|
|
4734
4734
|
const originalValue = value;
|
|
4735
4735
|
value = limitValueLength(value);
|
|
4736
|
-
const limitDiffLen =
|
|
4736
|
+
const limitDiffLen = originalValue.length - value.length;
|
|
4737
4737
|
if (props2.type === "number" || props2.type === "digit") {
|
|
4738
4738
|
const isNumber = props2.type === "number";
|
|
4739
4739
|
value = formatNumber(value, isNumber, isNumber);
|
|
@@ -4759,7 +4759,7 @@
|
|
|
4759
4759
|
selectionEnd
|
|
4760
4760
|
} = inputRef.value;
|
|
4761
4761
|
const bcoVal = cutString(originalValue, selectionEnd);
|
|
4762
|
-
formatterDiffLen =
|
|
4762
|
+
formatterDiffLen = formatter(bcoVal).length - bcoVal.length;
|
|
4763
4763
|
}
|
|
4764
4764
|
}
|
|
4765
4765
|
if (inputRef.value && inputRef.value.value !== value) {
|
|
@@ -4770,7 +4770,7 @@
|
|
|
4770
4770
|
} = inputRef.value;
|
|
4771
4771
|
inputRef.value.value = value;
|
|
4772
4772
|
if (isDef(selectionStart) && isDef(selectionEnd)) {
|
|
4773
|
-
const valueLen =
|
|
4773
|
+
const valueLen = value.length;
|
|
4774
4774
|
if (limitDiffLen) {
|
|
4775
4775
|
selectionStart -= limitDiffLen;
|
|
4776
4776
|
selectionEnd -= limitDiffLen;
|
|
@@ -10743,6 +10743,7 @@
|
|
|
10743
10743
|
height: makeNumericProp(0),
|
|
10744
10744
|
anchors: makeArrayProp(),
|
|
10745
10745
|
duration: makeNumericProp(0.3),
|
|
10746
|
+
magnetic: truthProp,
|
|
10746
10747
|
contentDraggable: truthProp,
|
|
10747
10748
|
lockScroll: Boolean,
|
|
10748
10749
|
safeAreaInsetBottom: truthProp
|
|
@@ -10819,7 +10820,15 @@
|
|
|
10819
10820
|
const onTouchend = () => {
|
|
10820
10821
|
maxScroll = -1;
|
|
10821
10822
|
dragging.value = false;
|
|
10822
|
-
|
|
10823
|
+
if (props2.magnetic) {
|
|
10824
|
+
height.value = closest(anchors.value, height.value);
|
|
10825
|
+
} else {
|
|
10826
|
+
const {
|
|
10827
|
+
min,
|
|
10828
|
+
max
|
|
10829
|
+
} = boundary.value;
|
|
10830
|
+
height.value = Math.max(min, Math.min(max, height.value));
|
|
10831
|
+
}
|
|
10823
10832
|
if (height.value !== -startY) {
|
|
10824
10833
|
emit("heightChange", {
|
|
10825
10834
|
height: height.value
|
|
@@ -10858,7 +10867,10 @@
|
|
|
10858
10867
|
"onTouchcancel": onTouchend
|
|
10859
10868
|
}, [renderHeader(), vue.createVNode("div", {
|
|
10860
10869
|
"class": bem$I("content"),
|
|
10861
|
-
"ref": contentRef
|
|
10870
|
+
"ref": contentRef,
|
|
10871
|
+
"style": {
|
|
10872
|
+
paddingBottom: addUnit(boundary.value.max - height.value)
|
|
10873
|
+
}
|
|
10862
10874
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
|
10863
10875
|
};
|
|
10864
10876
|
}
|
|
@@ -12040,7 +12052,10 @@
|
|
|
12040
12052
|
scroller: Object,
|
|
12041
12053
|
errorText: String,
|
|
12042
12054
|
direction: makeStringProp("down"),
|
|
12043
|
-
loadingText:
|
|
12055
|
+
loadingText: {
|
|
12056
|
+
type: String,
|
|
12057
|
+
default: ""
|
|
12058
|
+
},
|
|
12044
12059
|
finishedText: String,
|
|
12045
12060
|
immediateCheck: truthProp
|
|
12046
12061
|
};
|
|
@@ -12117,7 +12132,7 @@
|
|
|
12117
12132
|
if (loading.value && !props2.finished && !props2.disabled) {
|
|
12118
12133
|
return vue.createVNode("div", {
|
|
12119
12134
|
"class": bem$A("loading")
|
|
12120
|
-
}, [slots.loading ? slots.loading() : vue.createVNode(Loading, {
|
|
12135
|
+
}, [slots.loading ? slots.loading() : props2.loadingText != null && vue.createVNode(Loading, {
|
|
12121
12136
|
"class": bem$A("loading-icon")
|
|
12122
12137
|
}, {
|
|
12123
12138
|
default: () => [props2.loadingText || t$7("loading")]
|
|
@@ -13560,7 +13575,7 @@
|
|
|
13560
13575
|
}
|
|
13561
13576
|
return offsets;
|
|
13562
13577
|
}
|
|
13563
|
-
function
|
|
13578
|
+
function popperOffsets(_ref) {
|
|
13564
13579
|
var state = _ref.state, name2 = _ref.name;
|
|
13565
13580
|
state.modifiersData[name2] = computeOffsets({
|
|
13566
13581
|
reference: state.rects.reference,
|
|
@@ -13568,11 +13583,11 @@
|
|
|
13568
13583
|
placement: state.placement
|
|
13569
13584
|
});
|
|
13570
13585
|
}
|
|
13571
|
-
const
|
|
13586
|
+
const modifiers_popperOffsets = {
|
|
13572
13587
|
name: "popperOffsets",
|
|
13573
13588
|
enabled: true,
|
|
13574
13589
|
phase: "read",
|
|
13575
|
-
fn:
|
|
13590
|
+
fn: popperOffsets,
|
|
13576
13591
|
data: {}
|
|
13577
13592
|
};
|
|
13578
13593
|
var unsetSides = {
|
|
@@ -13649,7 +13664,7 @@
|
|
|
13649
13664
|
}
|
|
13650
13665
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
13651
13666
|
}
|
|
13652
|
-
function
|
|
13667
|
+
function computeStyles(_ref5) {
|
|
13653
13668
|
var state = _ref5.state, options = _ref5.options;
|
|
13654
13669
|
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = void 0 === _options$gpuAccelerat ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = void 0 === _options$adaptive ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = void 0 === _options$roundOffsets ? true : _options$roundOffsets;
|
|
13655
13670
|
var commonStyles = {
|
|
@@ -13676,11 +13691,11 @@
|
|
|
13676
13691
|
"data-popper-placement": state.placement
|
|
13677
13692
|
});
|
|
13678
13693
|
}
|
|
13679
|
-
const
|
|
13694
|
+
const modifiers_computeStyles = {
|
|
13680
13695
|
name: "computeStyles",
|
|
13681
13696
|
enabled: true,
|
|
13682
13697
|
phase: "beforeWrite",
|
|
13683
|
-
fn:
|
|
13698
|
+
fn: computeStyles,
|
|
13684
13699
|
data: {}
|
|
13685
13700
|
};
|
|
13686
13701
|
function applyStyles(_ref) {
|
|
@@ -13744,8 +13759,8 @@
|
|
|
13744
13759
|
};
|
|
13745
13760
|
var popper_lite_defaultModifiers = [
|
|
13746
13761
|
eventListeners,
|
|
13747
|
-
|
|
13748
|
-
|
|
13762
|
+
modifiers_popperOffsets,
|
|
13763
|
+
modifiers_computeStyles,
|
|
13749
13764
|
modifiers_applyStyles
|
|
13750
13765
|
];
|
|
13751
13766
|
var popper_lite_createPopper = /* @__PURE__ */ popperGenerator({
|
|
@@ -14668,6 +14683,7 @@
|
|
|
14668
14683
|
"with-message": fieldAttrs.errorMessage
|
|
14669
14684
|
}),
|
|
14670
14685
|
"border": false,
|
|
14686
|
+
"labelAlign": "left",
|
|
14671
14687
|
"onBlur": onBlur,
|
|
14672
14688
|
"onFocus": onFocus,
|
|
14673
14689
|
"onClear": onClear,
|
|
@@ -15777,6 +15793,9 @@
|
|
|
15777
15793
|
if (allowEmpty && value === "") {
|
|
15778
15794
|
return value;
|
|
15779
15795
|
}
|
|
15796
|
+
if (typeof value === "number" && String(value).includes("e")) {
|
|
15797
|
+
value = value.toFixed(decimalLength ? +decimalLength : 17);
|
|
15798
|
+
}
|
|
15780
15799
|
value = formatNumber(String(value), !props2.integer);
|
|
15781
15800
|
value = value === "" ? 0 : +value;
|
|
15782
15801
|
value = Number.isNaN(value) ? +min : value;
|
|
@@ -18227,7 +18246,7 @@
|
|
|
18227
18246
|
});
|
|
18228
18247
|
}
|
|
18229
18248
|
};
|
|
18230
|
-
const version = "4.9.
|
|
18249
|
+
const version = "4.9.22";
|
|
18231
18250
|
function install(app) {
|
|
18232
18251
|
const components = [
|
|
18233
18252
|
ActionBar,
|