vant 2.12.33 → 2.12.36

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.33';
364
+ var version = '2.12.36';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -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() {
@@ -104,6 +104,14 @@ var _default2 = createComponent({
104
104
  return this.fileList;
105
105
  }
106
106
  },
107
+ created: function created() {
108
+ this.urls = [];
109
+ },
110
+ beforeDestroy: function beforeDestroy() {
111
+ this.urls.forEach(function (url) {
112
+ return URL.revokeObjectURL(url);
113
+ });
114
+ },
107
115
  methods: {
108
116
  getDetail: function getDetail(index) {
109
117
  if (index === void 0) {
@@ -282,7 +290,13 @@ var _default2 = createComponent({
282
290
  return (0, _utils2.isImageFile)(item);
283
291
  });
284
292
  var imageContents = imageFiles.map(function (item) {
285
- return item.content || item.url;
293
+ if (item.file && !item.url) {
294
+ item.url = URL.createObjectURL(item.file);
295
+
296
+ _this5.urls.push(item.url);
297
+ }
298
+
299
+ return item.url;
286
300
  });
287
301
  this.imagePreview = (0, _imagePreview.default)((0, _extends2.default)({
288
302
  images: imageContents,
package/lib/vant.js CHANGED
@@ -6677,11 +6677,9 @@ var Month_createNamespace = Object(create["a" /* createNamespace */])('calendar-
6677
6677
  },
6678
6678
  methods: {
6679
6679
  getHeight: function getHeight() {
6680
- if (!this.height) {
6681
- this.height = this.$el.getBoundingClientRect().height;
6682
- }
6680
+ var _this$$el;
6683
6681
 
6684
- return this.height;
6682
+ return ((_this$$el = this.$el) == null ? void 0 : _this$$el.getBoundingClientRect().height) || 0;
6685
6683
  },
6686
6684
  scrollIntoView: function scrollIntoView(body) {
6687
6685
  var _this$$refs = this.$refs,
@@ -7077,6 +7075,11 @@ var Header_createNamespace = Object(create["a" /* createNamespace */])('calendar
7077
7075
  }
7078
7076
  }
7079
7077
  },
7078
+ inject: {
7079
+ vanPopup: {
7080
+ default: null
7081
+ }
7082
+ },
7080
7083
  data: function data() {
7081
7084
  return {
7082
7085
  subtitle: '',
@@ -7127,7 +7130,11 @@ var Header_createNamespace = Object(create["a" /* createNamespace */])('calendar
7127
7130
  }
7128
7131
  },
7129
7132
  mounted: function mounted() {
7130
- this.init();
7133
+ var _this$vanPopup;
7134
+
7135
+ this.init(); // https://github.com/youzan/vant/issues/9845
7136
+
7137
+ (_this$vanPopup = this.vanPopup) == null ? void 0 : _this$vanPopup.$on('opened', this.onScroll);
7131
7138
  },
7132
7139
 
7133
7140
  /* istanbul ignore next */
@@ -11027,6 +11034,9 @@ var TimePicker_createNamespace = Object(create["a" /* createNamespace */])('time
11027
11034
  this.updateInnerValue();
11028
11035
  this.$nextTick(function () {
11029
11036
  _this2.$nextTick(function () {
11037
+ // https://github.com/youzan/vant/issues/9775
11038
+ _this2.updateInnerValue();
11039
+
11030
11040
  _this2.$emit('change', picker);
11031
11041
  });
11032
11042
  });
@@ -11359,6 +11369,9 @@ var DatePicker_createNamespace = Object(create["a" /* createNamespace */])('date
11359
11369
  this.updateInnerValue();
11360
11370
  this.$nextTick(function () {
11361
11371
  _this4.$nextTick(function () {
11372
+ // https://github.com/youzan/vant/issues/9775
11373
+ _this4.updateInnerValue();
11374
+
11362
11375
  _this4.$emit('change', picker);
11363
11376
  });
11364
11377
  });
@@ -12781,10 +12794,16 @@ var swipe_createNamespace = Object(create["a" /* createNamespace */])('swipe'),
12781
12794
  },
12782
12795
  onTouchMove: function onTouchMove(event) {
12783
12796
  if (!this.touchable || !this.swiping) return;
12784
- this.touchMove(event);
12797
+ this.touchMove(event); // if user starting to touchmove, prevent the event bubbling to
12798
+ // avoid affecting the parent components
12785
12799
 
12786
- if (this.isCorrectDirection) {
12800
+ var shouldPrevent = this.isCorrectDirection || this.offsetY > this.offsetX === this.vertical;
12801
+
12802
+ if (shouldPrevent) {
12787
12803
  preventDefault(event, this.stopPropagation);
12804
+ }
12805
+
12806
+ if (this.isCorrectDirection) {
12788
12807
  this.move({
12789
12808
  offset: this.delta
12790
12809
  });
@@ -19131,6 +19150,14 @@ var uploader_createNamespace = Object(create["a" /* createNamespace */])('upload
19131
19150
  return this.fileList;
19132
19151
  }
19133
19152
  },
19153
+ created: function created() {
19154
+ this.urls = [];
19155
+ },
19156
+ beforeDestroy: function beforeDestroy() {
19157
+ this.urls.forEach(function (url) {
19158
+ return URL.revokeObjectURL(url);
19159
+ });
19160
+ },
19134
19161
  methods: {
19135
19162
  getDetail: function getDetail(index) {
19136
19163
  if (index === void 0) {
@@ -19309,7 +19336,13 @@ var uploader_createNamespace = Object(create["a" /* createNamespace */])('upload
19309
19336
  return isImageFile(item);
19310
19337
  });
19311
19338
  var imageContents = imageFiles.map(function (item) {
19312
- return item.content || item.url;
19339
+ if (item.file && !item.url) {
19340
+ item.url = URL.createObjectURL(item.file);
19341
+
19342
+ _this5.urls.push(item.url);
19343
+ }
19344
+
19345
+ return item.url;
19313
19346
  });
19314
19347
  this.imagePreview = image_preview(_extends({
19315
19348
  images: imageContents,
@@ -21809,9 +21842,11 @@ var tabbar_item_createNamespace = Object(create["a" /* createNamespace */])('tab
21809
21842
  var config = Object(utils["f" /* isObject */])(to) ? to : {
21810
21843
  path: to
21811
21844
  };
21812
- var pathMatched = config.path === $route.path;
21813
- var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === $route.name;
21814
- return pathMatched || nameMatched;
21845
+ return !!$route.matched.find(function (r) {
21846
+ var pathMatched = config.path === r.path;
21847
+ var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === r.name;
21848
+ return pathMatched || nameMatched;
21849
+ });
21815
21850
  }
21816
21851
  },
21817
21852
  active: function active() {
@@ -22114,7 +22149,7 @@ TreeSelect.props = {
22114
22149
 
22115
22150
 
22116
22151
 
22117
- var version = '2.12.33';
22152
+ var version = '2.12.36';
22118
22153
 
22119
22154
  function install(Vue) {
22120
22155
  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];