vant 2.12.32 → 2.12.35

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/lib/index.js CHANGED
@@ -361,7 +361,7 @@ exports.TreeSelect = _treeSelect.default;
361
361
  var _uploader = _interopRequireDefault(require("./uploader"));
362
362
 
363
363
  exports.Uploader = _uploader.default;
364
- var version = '2.12.32';
364
+ var version = '2.12.35';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -43,7 +43,7 @@ function isOptionDisabled(option) {
43
43
  // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent
44
44
 
45
45
 
46
- var supportMousewheel = ('onwheel' in window);
46
+ var supportMousewheel = _utils.inBrowser && 'onwheel' in window;
47
47
  var mousewheelTimer = null;
48
48
 
49
49
  var _default2 = createComponent({
@@ -1 +1 @@
1
- .van-swipe{position:relative;overflow:hidden;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:-webkit-box;display:-webkit-flex;display:flex;height:100%}.van-swipe__track--vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.van-swipe__indicators{position:absolute;bottom:12px;left:50%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:12px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:6px}.van-swipe__indicator{width:6px;height:6px;background-color:#ebedf0;border-radius:100%;opacity:.3;-webkit-transition:opacity .2s,background-color .2s;transition:opacity .2s,background-color .2s}.van-swipe__indicator:not(:last-child){margin-right:6px}.van-swipe__indicator--active{background-color:#1989fa;opacity:1}
1
+ .van-swipe{position:relative;overflow:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:-webkit-box;display:-webkit-flex;display:flex;height:100%}.van-swipe__track--vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.van-swipe__indicators{position:absolute;bottom:12px;left:50%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:12px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:6px}.van-swipe__indicator{width:6px;height:6px;background-color:#ebedf0;border-radius:100%;opacity:.3;-webkit-transition:opacity .2s,background-color .2s;transition:opacity .2s,background-color .2s}.van-swipe__indicator:not(:last-child){margin-right:6px}.van-swipe__indicator--active{background-color:#1989fa;opacity:1}
@@ -193,10 +193,16 @@ var _default = createComponent({
193
193
  },
194
194
  onTouchMove: function onTouchMove(event) {
195
195
  if (!this.touchable || !this.swiping) return;
196
- this.touchMove(event);
196
+ this.touchMove(event); // if user starting to touchmove, prevent the event bubbling to
197
+ // avoid affecting the parent components
197
198
 
198
- if (this.isCorrectDirection) {
199
+ var shouldPrevent = this.isCorrectDirection || this.offsetY > this.offsetX === this.vertical;
200
+
201
+ if (shouldPrevent) {
199
202
  (0, _event.preventDefault)(event, this.stopPropagation);
203
+ }
204
+
205
+ if (this.isCorrectDirection) {
200
206
  this.move({
201
207
  offset: this.delta
202
208
  });
@@ -3,6 +3,8 @@
3
3
  .van-swipe {
4
4
  position: relative;
5
5
  overflow: hidden;
6
+ // https://github.com/youzan/vant/issues/9931
7
+ transform: translateZ(0);
6
8
  cursor: grab;
7
9
  user-select: none;
8
10
 
@@ -49,9 +49,11 @@ var _default = createComponent({
49
49
  var config = (0, _utils.isObject)(to) ? to : {
50
50
  path: to
51
51
  };
52
- var pathMatched = config.path === $route.path;
53
- var nameMatched = (0, _utils.isDef)(config.name) && config.name === $route.name;
54
- return pathMatched || nameMatched;
52
+ return !!$route.matched.find(function (r) {
53
+ var pathMatched = config.path === r.path;
54
+ var nameMatched = (0, _utils.isDef)(config.name) && config.name === r.name;
55
+ return pathMatched || nameMatched;
56
+ });
55
57
  }
56
58
  },
57
59
  active: function active() {
package/lib/vant.js CHANGED
@@ -2225,7 +2225,7 @@ function isOptionDisabled(option) {
2225
2225
  // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent
2226
2226
 
2227
2227
 
2228
- var supportMousewheel = ('onwheel' in window);
2228
+ var supportMousewheel = utils["b" /* inBrowser */] && 'onwheel' in window;
2229
2229
  var mousewheelTimer = null;
2230
2230
  /* harmony default export */ var PickerColumn = (PickerColumn_createComponent({
2231
2231
  mixins: [TouchMixin],
@@ -11027,6 +11027,9 @@ var TimePicker_createNamespace = Object(create["a" /* createNamespace */])('time
11027
11027
  this.updateInnerValue();
11028
11028
  this.$nextTick(function () {
11029
11029
  _this2.$nextTick(function () {
11030
+ // https://github.com/youzan/vant/issues/9775
11031
+ _this2.updateInnerValue();
11032
+
11030
11033
  _this2.$emit('change', picker);
11031
11034
  });
11032
11035
  });
@@ -11359,6 +11362,9 @@ var DatePicker_createNamespace = Object(create["a" /* createNamespace */])('date
11359
11362
  this.updateInnerValue();
11360
11363
  this.$nextTick(function () {
11361
11364
  _this4.$nextTick(function () {
11365
+ // https://github.com/youzan/vant/issues/9775
11366
+ _this4.updateInnerValue();
11367
+
11362
11368
  _this4.$emit('change', picker);
11363
11369
  });
11364
11370
  });
@@ -12781,10 +12787,16 @@ var swipe_createNamespace = Object(create["a" /* createNamespace */])('swipe'),
12781
12787
  },
12782
12788
  onTouchMove: function onTouchMove(event) {
12783
12789
  if (!this.touchable || !this.swiping) return;
12784
- this.touchMove(event);
12790
+ this.touchMove(event); // if user starting to touchmove, prevent the event bubbling to
12791
+ // avoid affecting the parent components
12785
12792
 
12786
- if (this.isCorrectDirection) {
12793
+ var shouldPrevent = this.isCorrectDirection || this.offsetY > this.offsetX === this.vertical;
12794
+
12795
+ if (shouldPrevent) {
12787
12796
  preventDefault(event, this.stopPropagation);
12797
+ }
12798
+
12799
+ if (this.isCorrectDirection) {
12788
12800
  this.move({
12789
12801
  offset: this.delta
12790
12802
  });
@@ -21809,9 +21821,11 @@ var tabbar_item_createNamespace = Object(create["a" /* createNamespace */])('tab
21809
21821
  var config = Object(utils["f" /* isObject */])(to) ? to : {
21810
21822
  path: to
21811
21823
  };
21812
- var pathMatched = config.path === $route.path;
21813
- var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === $route.name;
21814
- return pathMatched || nameMatched;
21824
+ return !!$route.matched.find(function (r) {
21825
+ var pathMatched = config.path === r.path;
21826
+ var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === r.name;
21827
+ return pathMatched || nameMatched;
21828
+ });
21815
21829
  }
21816
21830
  },
21817
21831
  active: function active() {
@@ -22114,7 +22128,7 @@ TreeSelect.props = {
22114
22128
 
22115
22129
 
22116
22130
 
22117
- var version = '2.12.32';
22131
+ var version = '2.12.35';
22118
22132
 
22119
22133
  function install(Vue) {
22120
22134
  var components = [action_sheet, address_edit, address_list, es_area, badge, es_button, calendar, card, cascader, cell, cell_group, es_checkbox, checkbox_group, circle, col, collapse, collapse_item, contact_card, contact_edit, contact_list, count_down, es_coupon, coupon_cell, coupon_list, datetime_picker, dialog, divider, dropdown_item, dropdown_menu, empty, es_field, es_form, goods_action, goods_action_button, goods_action_icon, grid, grid_item, es_icon, es_image, image_preview, index_anchor, index_bar, es_info, es_list, es_loading, locale["a" /* default */], nav_bar, notice_bar, notify, number_keyboard, es_overlay, pagination, panel, password_input, picker, popover, popup, es_progress, pull_refresh, es_radio, radio_group, es_rate, row, search, share_sheet, sidebar, sidebar_item, skeleton, es_sku, slider, es_step, stepper, steps, es_sticky, submit_bar, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, tabs, es_tag, es_toast, tree_select, uploader];