vant 2.12.45 → 2.12.48

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.zh-CN.md CHANGED
@@ -26,9 +26,9 @@
26
26
 
27
27
  ### 介绍
28
28
 
29
- Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一。
29
+ Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
30
30
 
31
- 目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)。
31
+ 目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
32
32
 
33
33
  ## 特性
34
34
 
@@ -176,7 +176,8 @@ export default createComponent({
176
176
  "attrs": {
177
177
  "size": "large",
178
178
  "loading": this.loading.cancel,
179
- "text": this.cancelButtonText || t('cancel')
179
+ "text": this.cancelButtonText || t('cancel'),
180
+ "nativeType": "button"
180
181
  },
181
182
  "class": bem('cancel'),
182
183
  "style": {
@@ -191,7 +192,8 @@ export default createComponent({
191
192
  "attrs": {
192
193
  "size": "large",
193
194
  "loading": this.loading.confirm,
194
- "text": this.confirmButtonText || t('confirm')
195
+ "text": this.confirmButtonText || t('confirm'),
196
+ "nativeType": "button"
195
197
  },
196
198
  "class": [bem('confirm'), (_ref = {}, _ref[BORDER_LEFT] = multiple, _ref)],
197
199
  "style": {
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.45';
90
+ var version = '2.12.48';
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];
@@ -0,0 +1,91 @@
1
+ export default {
2
+ name: 'Tên',
3
+ tel: 'điện thoại',
4
+ save: 'tiết kiệm',
5
+ confirm: 'xác nhận',
6
+ cancel: 'Hủy bỏ',
7
+ delete: 'xóa bỏ',
8
+ complete: 'Hoàn thành',
9
+ loading: 'Đang tải...',
10
+ telEmpty: 'Vui lòng điền số điện thoại',
11
+ nameEmpty: 'vui lòng điền tên',
12
+ nameInvalid: 'Vui lòng nhập tên chính xác',
13
+ confirmDelete: 'Bạn có chắc chắn muốn xóa',
14
+ telInvalid: 'Vui lòng nhập số điện thoại chính xác',
15
+ vanCalendar: {
16
+ end: 'chấm dứt',
17
+ start: 'Bắt đầu',
18
+ title: 'chọn ngày',
19
+ confirm: 'Đảm bảo',
20
+ startEnd: 'bắt đầu / kết thúc',
21
+ weekdays: ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
22
+ monthTitle: function monthTitle(year, month) {
23
+ return year + " n\u0103m " + month + " th\xE1ng";
24
+ },
25
+ rangePrompt: function rangePrompt(maxRange) {
26
+ return "C\xE1c ng\xE0y \u0111\u01B0\u1EE3c ch\u1ECDn kh\xF4ng \u0111\u01B0\u1EE3c v\u01B0\u1EE3t qu\xE1 " + maxRange + " ng\xE0y";
27
+ }
28
+ },
29
+ vanCascader: {
30
+ select: 'Xin hãy lựa chọn'
31
+ },
32
+ vanContactCard: {
33
+ addText: 'Thêm địa chỉ liên hệ'
34
+ },
35
+ vanContactList: {
36
+ addText: 'Địa chỉ liên lạc mới'
37
+ },
38
+ vanPagination: {
39
+ prev: 'trang trước',
40
+ next: 'trang sau'
41
+ },
42
+ vanPullRefresh: {
43
+ pulling: 'Kéo xuống để làm mới...',
44
+ loosing: 'Phát hành để làm mới...'
45
+ },
46
+ vanSubmitBar: {
47
+ label: 'toàn bộ:'
48
+ },
49
+ vanCoupon: {
50
+ unlimited: 'Không có ngưỡng sử dụng',
51
+ discount: function discount(_discount) {
52
+ return _discount + " Chi\u1EBFt kh\u1EA5u";
53
+ },
54
+ condition: function condition(_condition) {
55
+ return "C\xF3 s\u1EB5n sau khi chi ti\xEAu " + _condition + " nh\xE2n d\xE2n t\u1EC7";
56
+ }
57
+ },
58
+ vanCouponCell: {
59
+ title: 'phiếu giảm giá',
60
+ tips: 'Chưa có',
61
+ count: function count(_count) {
62
+ return _count + " trang t\xEDnh kh\u1EA3 d\u1EE5ng";
63
+ }
64
+ },
65
+ vanCouponList: {
66
+ empty: 'Chưa có phiếu giảm giá',
67
+ exchange: 'trao đổi',
68
+ close: 'Không sử dụng phiếu giảm giá',
69
+ enable: 'Có sẵn',
70
+ disabled: 'không có sẵn',
71
+ placeholder: 'Vui lòng nhập mã khuyến mãi'
72
+ },
73
+ vanAddressEdit: {
74
+ area: 'vùng',
75
+ postal: 'mã bưu điện',
76
+ areaEmpty: 'vui lòng chọn khu vực',
77
+ addressEmpty: 'Vui lòng điền vào địa chỉ chi tiết',
78
+ postalEmpty: 'Định dạng mã zip không chính xác',
79
+ defaultAddress: 'đặt làm địa chỉ giao hàng mặc định',
80
+ telPlaceholder: 'Số điện thoại của người nhận hàng',
81
+ namePlaceholder: 'Tên người nhận hàng',
82
+ areaPlaceholder: 'Chọn Tỉnh / Thành phố / Quận / Huyện'
83
+ },
84
+ vanAddressEditDetail: {
85
+ label: 'Địa chỉ chi tiết',
86
+ placeholder: 'Số đường phố, số phòng tầng, v.v.'
87
+ },
88
+ vanAddressList: {
89
+ add: 'Thêm địa chỉ'
90
+ }
91
+ };
package/es/step/index.js CHANGED
@@ -23,15 +23,27 @@ export default createComponent({
23
23
  return this.status === 'process';
24
24
  },
25
25
  lineStyle: function lineStyle() {
26
- if (this.status === 'finish') {
26
+ var _this$parent = this.parent,
27
+ activeColor = _this$parent.activeColor,
28
+ inactiveColor = _this$parent.inactiveColor,
29
+ center = _this$parent.center,
30
+ direction = _this$parent.direction;
31
+ var style = {
32
+ background: this.status === 'finish' ? activeColor : inactiveColor
33
+ };
34
+
35
+ if (center && direction === 'vertical') {
36
+ style.top = '50%';
37
+ }
38
+
39
+ return style;
40
+ },
41
+ circleContainerStyle: function circleContainerStyle() {
42
+ if (this.parent.center && this.parent.direction === 'vertical') {
27
43
  return {
28
- background: this.parent.activeColor
44
+ top: '50%'
29
45
  };
30
46
  }
31
-
32
- return {
33
- background: this.parent.inactiveColor
34
- };
35
47
  },
36
48
  titleStyle: function titleStyle() {
37
49
  if (this.active) {
@@ -50,12 +62,12 @@ export default createComponent({
50
62
  methods: {
51
63
  genCircle: function genCircle() {
52
64
  var h = this.$createElement;
53
- var _this$parent = this.parent,
54
- activeIcon = _this$parent.activeIcon,
55
- iconPrefix = _this$parent.iconPrefix,
56
- activeColor = _this$parent.activeColor,
57
- finishIcon = _this$parent.finishIcon,
58
- inactiveIcon = _this$parent.inactiveIcon;
65
+ var _this$parent2 = this.parent,
66
+ activeIcon = _this$parent2.activeIcon,
67
+ iconPrefix = _this$parent2.iconPrefix,
68
+ activeColor = _this$parent2.activeColor,
69
+ finishIcon = _this$parent2.finishIcon,
70
+ inactiveIcon = _this$parent2.inactiveIcon;
59
71
 
60
72
  if (this.active) {
61
73
  return this.slots('active-icon') || h(Icon, {
@@ -123,7 +135,8 @@ export default createComponent({
123
135
  "class": bem('circle-container'),
124
136
  "on": {
125
137
  "click": this.onClickStep
126
- }
138
+ },
139
+ "style": this.circleContainerStyle
127
140
  }, [this.genCircle()]), h("div", {
128
141
  "class": bem('line'),
129
142
  "style": this.lineStyle
package/es/steps/index.js CHANGED
@@ -8,6 +8,7 @@ var _createNamespace = createNamespace('steps'),
8
8
  export default createComponent({
9
9
  mixins: [ParentMixin('vanSteps')],
10
10
  props: {
11
+ center: Boolean,
11
12
  iconPrefix: String,
12
13
  finishIcon: String,
13
14
  activeColor: String,
@@ -70,7 +70,7 @@ export default createComponent({
70
70
  var _this2 = this;
71
71
 
72
72
  this.children.forEach(function (item, index) {
73
- item.nameMatched = (item.name || index) === _this2.value;
73
+ item.nameMatched = item.name === _this2.value || index === _this2.value;
74
74
  });
75
75
  },
76
76
  triggerChange: function triggerChange(active, afterChange) {
@@ -29,23 +29,25 @@ export default createComponent({
29
29
  };
30
30
  },
31
31
  computed: {
32
- routeMatched: function routeMatched() {
33
- var to = this.to,
34
- $route = this.$route;
32
+ active: function active() {
33
+ var routeMode = this.parent.route;
35
34
 
36
- if (to && $route) {
35
+ if (routeMode && '$route' in this) {
36
+ var to = this.to,
37
+ $route = this.$route;
37
38
  var config = isObject(to) ? to : {
38
39
  path: to
39
40
  };
40
41
  return !!$route.matched.find(function (r) {
41
- var pathMatched = config.path === r.path;
42
+ // vue-router 3.x $route.matched[0].path is empty in / and its children paths
43
+ var path = r.path === '' ? '/' : r.path;
44
+ var pathMatched = config.path === path;
42
45
  var nameMatched = isDef(config.name) && config.name === r.name;
43
46
  return pathMatched || nameMatched;
44
47
  });
45
48
  }
46
- },
47
- active: function active() {
48
- return this.parent.route ? this.routeMatched : this.nameMatched;
49
+
50
+ return this.nameMatched;
49
51
  }
50
52
  },
51
53
  methods: {
@@ -4,7 +4,7 @@ function isWindow(val) {
4
4
  // https://github.com/youzan/vant/issues/3823
5
5
 
6
6
 
7
- var overflowScrollReg = /scroll|auto/i;
7
+ var overflowScrollReg = /scroll|auto|overlay/i;
8
8
  export function getScroller(el, root) {
9
9
  if (root === void 0) {
10
10
  root = window;
@@ -189,7 +189,8 @@ var _default = createComponent({
189
189
  "attrs": {
190
190
  "size": "large",
191
191
  "loading": this.loading.cancel,
192
- "text": this.cancelButtonText || t('cancel')
192
+ "text": this.cancelButtonText || t('cancel'),
193
+ "nativeType": "button"
193
194
  },
194
195
  "class": bem('cancel'),
195
196
  "style": {
@@ -204,7 +205,8 @@ var _default = createComponent({
204
205
  "attrs": {
205
206
  "size": "large",
206
207
  "loading": this.loading.confirm,
207
- "text": this.confirmButtonText || t('confirm')
208
+ "text": this.confirmButtonText || t('confirm'),
209
+ "nativeType": "button"
208
210
  },
209
211
  "class": [bem('confirm'), (_ref = {}, _ref[_constant.BORDER_LEFT] = multiple, _ref)],
210
212
  "style": {
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.45';
364
+ var version = '2.12.48';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ name: 'Tên',
7
+ tel: 'điện thoại',
8
+ save: 'tiết kiệm',
9
+ confirm: 'xác nhận',
10
+ cancel: 'Hủy bỏ',
11
+ delete: 'xóa bỏ',
12
+ complete: 'Hoàn thành',
13
+ loading: 'Đang tải...',
14
+ telEmpty: 'Vui lòng điền số điện thoại',
15
+ nameEmpty: 'vui lòng điền tên',
16
+ nameInvalid: 'Vui lòng nhập tên chính xác',
17
+ confirmDelete: 'Bạn có chắc chắn muốn xóa',
18
+ telInvalid: 'Vui lòng nhập số điện thoại chính xác',
19
+ vanCalendar: {
20
+ end: 'chấm dứt',
21
+ start: 'Bắt đầu',
22
+ title: 'chọn ngày',
23
+ confirm: 'Đảm bảo',
24
+ startEnd: 'bắt đầu / kết thúc',
25
+ weekdays: ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
26
+ monthTitle: function monthTitle(year, month) {
27
+ return year + " n\u0103m " + month + " th\xE1ng";
28
+ },
29
+ rangePrompt: function rangePrompt(maxRange) {
30
+ return "C\xE1c ng\xE0y \u0111\u01B0\u1EE3c ch\u1ECDn kh\xF4ng \u0111\u01B0\u1EE3c v\u01B0\u1EE3t qu\xE1 " + maxRange + " ng\xE0y";
31
+ }
32
+ },
33
+ vanCascader: {
34
+ select: 'Xin hãy lựa chọn'
35
+ },
36
+ vanContactCard: {
37
+ addText: 'Thêm địa chỉ liên hệ'
38
+ },
39
+ vanContactList: {
40
+ addText: 'Địa chỉ liên lạc mới'
41
+ },
42
+ vanPagination: {
43
+ prev: 'trang trước',
44
+ next: 'trang sau'
45
+ },
46
+ vanPullRefresh: {
47
+ pulling: 'Kéo xuống để làm mới...',
48
+ loosing: 'Phát hành để làm mới...'
49
+ },
50
+ vanSubmitBar: {
51
+ label: 'toàn bộ:'
52
+ },
53
+ vanCoupon: {
54
+ unlimited: 'Không có ngưỡng sử dụng',
55
+ discount: function discount(_discount) {
56
+ return _discount + " Chi\u1EBFt kh\u1EA5u";
57
+ },
58
+ condition: function condition(_condition) {
59
+ return "C\xF3 s\u1EB5n sau khi chi ti\xEAu " + _condition + " nh\xE2n d\xE2n t\u1EC7";
60
+ }
61
+ },
62
+ vanCouponCell: {
63
+ title: 'phiếu giảm giá',
64
+ tips: 'Chưa có',
65
+ count: function count(_count) {
66
+ return _count + " trang t\xEDnh kh\u1EA3 d\u1EE5ng";
67
+ }
68
+ },
69
+ vanCouponList: {
70
+ empty: 'Chưa có phiếu giảm giá',
71
+ exchange: 'trao đổi',
72
+ close: 'Không sử dụng phiếu giảm giá',
73
+ enable: 'Có sẵn',
74
+ disabled: 'không có sẵn',
75
+ placeholder: 'Vui lòng nhập mã khuyến mãi'
76
+ },
77
+ vanAddressEdit: {
78
+ area: 'vùng',
79
+ postal: 'mã bưu điện',
80
+ areaEmpty: 'vui lòng chọn khu vực',
81
+ addressEmpty: 'Vui lòng điền vào địa chỉ chi tiết',
82
+ postalEmpty: 'Định dạng mã zip không chính xác',
83
+ defaultAddress: 'đặt làm địa chỉ giao hàng mặc định',
84
+ telPlaceholder: 'Số điện thoại của người nhận hàng',
85
+ namePlaceholder: 'Tên người nhận hàng',
86
+ areaPlaceholder: 'Chọn Tỉnh / Thành phố / Quận / Huyện'
87
+ },
88
+ vanAddressEditDetail: {
89
+ label: 'Địa chỉ chi tiết',
90
+ placeholder: 'Số đường phố, số phòng tầng, v.v.'
91
+ },
92
+ vanAddressList: {
93
+ add: 'Thêm địa chỉ'
94
+ }
95
+ };
96
+ exports.default = _default;
package/lib/step/index.js CHANGED
@@ -33,15 +33,27 @@ var _default = createComponent({
33
33
  return this.status === 'process';
34
34
  },
35
35
  lineStyle: function lineStyle() {
36
- if (this.status === 'finish') {
36
+ var _this$parent = this.parent,
37
+ activeColor = _this$parent.activeColor,
38
+ inactiveColor = _this$parent.inactiveColor,
39
+ center = _this$parent.center,
40
+ direction = _this$parent.direction;
41
+ var style = {
42
+ background: this.status === 'finish' ? activeColor : inactiveColor
43
+ };
44
+
45
+ if (center && direction === 'vertical') {
46
+ style.top = '50%';
47
+ }
48
+
49
+ return style;
50
+ },
51
+ circleContainerStyle: function circleContainerStyle() {
52
+ if (this.parent.center && this.parent.direction === 'vertical') {
37
53
  return {
38
- background: this.parent.activeColor
54
+ top: '50%'
39
55
  };
40
56
  }
41
-
42
- return {
43
- background: this.parent.inactiveColor
44
- };
45
57
  },
46
58
  titleStyle: function titleStyle() {
47
59
  if (this.active) {
@@ -60,12 +72,12 @@ var _default = createComponent({
60
72
  methods: {
61
73
  genCircle: function genCircle() {
62
74
  var h = this.$createElement;
63
- var _this$parent = this.parent,
64
- activeIcon = _this$parent.activeIcon,
65
- iconPrefix = _this$parent.iconPrefix,
66
- activeColor = _this$parent.activeColor,
67
- finishIcon = _this$parent.finishIcon,
68
- inactiveIcon = _this$parent.inactiveIcon;
75
+ var _this$parent2 = this.parent,
76
+ activeIcon = _this$parent2.activeIcon,
77
+ iconPrefix = _this$parent2.iconPrefix,
78
+ activeColor = _this$parent2.activeColor,
79
+ finishIcon = _this$parent2.finishIcon,
80
+ inactiveIcon = _this$parent2.inactiveIcon;
69
81
 
70
82
  if (this.active) {
71
83
  return this.slots('active-icon') || h(_icon.default, {
@@ -133,7 +145,8 @@ var _default = createComponent({
133
145
  "class": bem('circle-container'),
134
146
  "on": {
135
147
  "click": this.onClickStep
136
- }
148
+ },
149
+ "style": this.circleContainerStyle
137
150
  }, [this.genCircle()]), h("div", {
138
151
  "class": bem('line'),
139
152
  "style": this.lineStyle
@@ -14,6 +14,7 @@ var _createNamespace = (0, _utils.createNamespace)('steps'),
14
14
  var _default = createComponent({
15
15
  mixins: [(0, _relation.ParentMixin)('vanSteps')],
16
16
  props: {
17
+ center: Boolean,
17
18
  iconPrefix: String,
18
19
  finishIcon: String,
19
20
  activeColor: String,
@@ -78,7 +78,7 @@ var _default = createComponent({
78
78
  var _this2 = this;
79
79
 
80
80
  this.children.forEach(function (item, index) {
81
- item.nameMatched = (item.name || index) === _this2.value;
81
+ item.nameMatched = item.name === _this2.value || index === _this2.value;
82
82
  });
83
83
  },
84
84
  triggerChange: function triggerChange(active, afterChange) {
@@ -41,23 +41,25 @@ var _default = createComponent({
41
41
  };
42
42
  },
43
43
  computed: {
44
- routeMatched: function routeMatched() {
45
- var to = this.to,
46
- $route = this.$route;
44
+ active: function active() {
45
+ var routeMode = this.parent.route;
47
46
 
48
- if (to && $route) {
47
+ if (routeMode && '$route' in this) {
48
+ var to = this.to,
49
+ $route = this.$route;
49
50
  var config = (0, _utils.isObject)(to) ? to : {
50
51
  path: to
51
52
  };
52
53
  return !!$route.matched.find(function (r) {
53
- var pathMatched = config.path === r.path;
54
+ // vue-router 3.x $route.matched[0].path is empty in / and its children paths
55
+ var path = r.path === '' ? '/' : r.path;
56
+ var pathMatched = config.path === path;
54
57
  var nameMatched = (0, _utils.isDef)(config.name) && config.name === r.name;
55
58
  return pathMatched || nameMatched;
56
59
  });
57
60
  }
58
- },
59
- active: function active() {
60
- return this.parent.route ? this.routeMatched : this.nameMatched;
61
+
62
+ return this.nameMatched;
61
63
  }
62
64
  },
63
65
  methods: {
@@ -16,7 +16,7 @@ function isWindow(val) {
16
16
  // https://github.com/youzan/vant/issues/3823
17
17
 
18
18
 
19
- var overflowScrollReg = /scroll|auto/i;
19
+ var overflowScrollReg = /scroll|auto|overlay/i;
20
20
 
21
21
  function getScroller(el, root) {
22
22
  if (root === void 0) {