vant 2.12.33 → 2.12.34-beta.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.
package/es/index.js CHANGED
@@ -87,7 +87,7 @@ import Tag from './tag';
87
87
  import Toast from './toast';
88
88
  import TreeSelect from './tree-select';
89
89
  import Uploader from './uploader';
90
- var version = '2.12.33';
90
+ var version = '2.12.34-beta.0';
91
91
 
92
92
  function install(Vue) {
93
93
  var components = [ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, GoodsAction, GoodsActionButton, GoodsActionIcon, Grid, GridItem, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Panel, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Sku, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
package/es/swipe/index.js CHANGED
@@ -181,10 +181,16 @@ export default createComponent({
181
181
  },
182
182
  onTouchMove: function onTouchMove(event) {
183
183
  if (!this.touchable || !this.swiping) return;
184
- this.touchMove(event);
184
+ this.touchMove(event); // if user starting to touchmove, prevent the event bubbling to
185
+ // avoid affecting the parent components
185
186
 
186
- if (this.isCorrectDirection) {
187
+ var shouldPrevent = this.isCorrectDirection || this.offsetY > this.offsetX === this.vertical;
188
+
189
+ if (shouldPrevent) {
187
190
  preventDefault(event, this.stopPropagation);
191
+ }
192
+
193
+ if (this.isCorrectDirection) {
188
194
  this.move({
189
195
  offset: this.delta
190
196
  });
@@ -37,9 +37,11 @@ export default createComponent({
37
37
  var config = isObject(to) ? to : {
38
38
  path: to
39
39
  };
40
- var pathMatched = config.path === $route.path;
41
- var nameMatched = isDef(config.name) && config.name === $route.name;
42
- return pathMatched || nameMatched;
40
+ return !!$route.matched.find(function (r) {
41
+ var pathMatched = config.path === r.path;
42
+ var nameMatched = isDef(config.name) && config.name === r.name;
43
+ return pathMatched || nameMatched;
44
+ });
43
45
  }
44
46
  },
45
47
  active: function active() {
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.34-beta.0';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -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
  });
@@ -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
@@ -12781,10 +12781,16 @@ var swipe_createNamespace = Object(create["a" /* createNamespace */])('swipe'),
12781
12781
  },
12782
12782
  onTouchMove: function onTouchMove(event) {
12783
12783
  if (!this.touchable || !this.swiping) return;
12784
- this.touchMove(event);
12784
+ this.touchMove(event); // if user starting to touchmove, prevent the event bubbling to
12785
+ // avoid affecting the parent components
12785
12786
 
12786
- if (this.isCorrectDirection) {
12787
+ var shouldPrevent = this.isCorrectDirection || this.offsetY > this.offsetX === this.vertical;
12788
+
12789
+ if (shouldPrevent) {
12787
12790
  preventDefault(event, this.stopPropagation);
12791
+ }
12792
+
12793
+ if (this.isCorrectDirection) {
12788
12794
  this.move({
12789
12795
  offset: this.delta
12790
12796
  });
@@ -21809,9 +21815,11 @@ var tabbar_item_createNamespace = Object(create["a" /* createNamespace */])('tab
21809
21815
  var config = Object(utils["f" /* isObject */])(to) ? to : {
21810
21816
  path: to
21811
21817
  };
21812
- var pathMatched = config.path === $route.path;
21813
- var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === $route.name;
21814
- return pathMatched || nameMatched;
21818
+ return !!$route.matched.find(function (r) {
21819
+ var pathMatched = config.path === r.path;
21820
+ var nameMatched = Object(utils["c" /* isDef */])(config.name) && config.name === r.name;
21821
+ return pathMatched || nameMatched;
21822
+ });
21815
21823
  }
21816
21824
  },
21817
21825
  active: function active() {
@@ -22114,7 +22122,7 @@ TreeSelect.props = {
22114
22122
 
22115
22123
 
22116
22124
 
22117
- var version = '2.12.33';
22125
+ var version = '2.12.34-beta.0';
22118
22126
 
22119
22127
  function install(Vue) {
22120
22128
  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];