vant 3.2.8 → 3.3.3-beta.nuxt3

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.
Files changed (189) hide show
  1. package/es/address-edit/AddressEdit.js +154 -180
  2. package/es/address-edit/AddressEditDetail.d.ts +10 -9
  3. package/es/address-edit/AddressEditDetail.js +6 -6
  4. package/es/button/Button.js +2 -2
  5. package/es/calendar/Calendar.js +8 -14
  6. package/es/calendar/CalendarHeader.js +1 -3
  7. package/es/calendar/CalendarMonth.js +11 -10
  8. package/es/calendar/types.d.ts +1 -1
  9. package/es/cascader/Cascader.js +10 -2
  10. package/es/checkbox/Checker.js +1 -1
  11. package/es/checkbox/types.d.ts +2 -6
  12. package/es/composables/use-id.d.ts +1 -0
  13. package/es/composables/use-id.js +14 -0
  14. package/es/composables/use-route.d.ts +1 -1
  15. package/es/composables/use-route.js +4 -4
  16. package/es/count-down/CountDown.js +1 -0
  17. package/es/coupon-list/CouponList.js +40 -24
  18. package/es/coupon-list/index.css +1 -1
  19. package/es/coupon-list/index.less +0 -5
  20. package/es/dropdown-item/DropdownItem.js +7 -2
  21. package/es/dropdown-item/types.d.ts +2 -6
  22. package/es/dropdown-menu/DropdownMenu.js +7 -3
  23. package/es/dropdown-menu/types.d.ts +1 -0
  24. package/es/empty/Network.js +22 -34
  25. package/es/field/Field.d.ts +1 -1
  26. package/es/field/Field.js +13 -5
  27. package/es/field/index.d.ts +2 -2
  28. package/es/field/types.d.ts +7 -6
  29. package/es/form/Form.js +2 -2
  30. package/es/image/Image.js +4 -9
  31. package/es/image-preview/ImagePreview.js +3 -4
  32. package/es/index.d.ts +1 -1
  33. package/es/index.js +1 -1
  34. package/es/lazyload/index.d.ts +1 -1
  35. package/es/lazyload/index.js +1 -1
  36. package/es/lazyload/vue-lazyload/index.d.ts +55 -0
  37. package/es/lazyload/vue-lazyload/index.js +46 -0
  38. package/es/lazyload/vue-lazyload/lazy-component.js +53 -0
  39. package/es/lazyload/vue-lazyload/lazy-container.js +98 -0
  40. package/es/lazyload/vue-lazyload/lazy-image.js +115 -0
  41. package/es/lazyload/vue-lazyload/lazy.js +507 -0
  42. package/es/lazyload/vue-lazyload/listener.js +241 -0
  43. package/es/lazyload/vue-lazyload/util.js +183 -0
  44. package/es/list/List.js +3 -1
  45. package/es/locale/lang/pt-BR.d.ts +73 -0
  46. package/es/locale/lang/pt-BR.js +72 -0
  47. package/es/number-keyboard/NumberKeyboardKey.js +4 -4
  48. package/es/pagination/Pagination.js +67 -49
  49. package/es/pagination/index.css +1 -1
  50. package/es/pagination/index.less +32 -31
  51. package/es/password-input/PasswordInput.d.ts +1 -1
  52. package/es/password-input/index.d.ts +1 -1
  53. package/es/popover/Popover.js +2 -0
  54. package/es/popup/Popup.d.ts +1 -2
  55. package/es/popup/Popup.js +2 -5
  56. package/es/popup/index.d.ts +1 -2
  57. package/es/rate/Rate.js +5 -3
  58. package/es/search/Search.js +8 -2
  59. package/es/sidebar/Sidebar.js +1 -0
  60. package/es/sidebar-item/SidebarItem.js +4 -1
  61. package/es/slider/Slider.js +5 -3
  62. package/es/stepper/Stepper.js +11 -8
  63. package/es/swipe/Swipe.js +11 -6
  64. package/es/swipe/index.css +1 -1
  65. package/es/swipe/index.less +2 -0
  66. package/es/swipe/types.d.ts +1 -3
  67. package/es/switch/Switch.js +1 -0
  68. package/es/switch/index.css +1 -1
  69. package/es/switch/index.less +2 -0
  70. package/es/tab/Tab.js +18 -5
  71. package/es/tab/index.css +1 -1
  72. package/es/tab/index.less +1 -1
  73. package/es/tabbar/Tabbar.d.ts +1 -1
  74. package/es/tabbar/Tabbar.js +10 -10
  75. package/es/tabbar-item/TabbarItem.js +16 -7
  76. package/es/tabs/Tabs.js +10 -5
  77. package/es/tabs/TabsTitle.d.ts +6 -0
  78. package/es/tabs/TabsTitle.js +7 -1
  79. package/es/tabs/types.d.ts +1 -0
  80. package/es/uploader/UploaderPreviewItem.js +4 -1
  81. package/es/uploader/utils.d.ts +2 -2
  82. package/es/uploader/utils.js +2 -2
  83. package/es/utils/dom.d.ts +1 -0
  84. package/es/utils/dom.js +6 -2
  85. package/es/utils/format.js +6 -5
  86. package/es/vue-tsx-shim.d.ts +1 -0
  87. package/lib/address-edit/AddressEdit.js +155 -180
  88. package/lib/address-edit/AddressEditDetail.d.ts +10 -9
  89. package/lib/address-edit/AddressEditDetail.js +6 -6
  90. package/lib/button/Button.js +1 -1
  91. package/lib/calendar/Calendar.js +8 -14
  92. package/lib/calendar/CalendarHeader.js +1 -3
  93. package/lib/calendar/CalendarMonth.js +11 -10
  94. package/lib/calendar/types.d.ts +1 -1
  95. package/lib/cascader/Cascader.js +10 -2
  96. package/lib/checkbox/Checker.js +1 -1
  97. package/lib/checkbox/types.d.ts +2 -6
  98. package/lib/composables/use-id.d.ts +1 -0
  99. package/lib/composables/use-id.js +21 -0
  100. package/lib/composables/use-route.d.ts +1 -1
  101. package/lib/composables/use-route.js +4 -4
  102. package/lib/count-down/CountDown.js +1 -0
  103. package/lib/coupon-list/CouponList.js +39 -22
  104. package/lib/coupon-list/index.css +1 -1
  105. package/lib/coupon-list/index.less +0 -5
  106. package/lib/dropdown-item/DropdownItem.js +7 -2
  107. package/lib/dropdown-item/types.d.ts +2 -6
  108. package/lib/dropdown-menu/DropdownMenu.js +7 -2
  109. package/lib/dropdown-menu/types.d.ts +1 -0
  110. package/lib/empty/Network.js +22 -34
  111. package/lib/field/Field.d.ts +1 -1
  112. package/lib/field/Field.js +14 -5
  113. package/lib/field/index.d.ts +2 -2
  114. package/lib/field/types.d.ts +7 -6
  115. package/lib/form/Form.js +1 -1
  116. package/lib/image/Image.js +4 -9
  117. package/lib/image-preview/ImagePreview.js +1 -2
  118. package/lib/index.css +1 -1
  119. package/lib/index.d.ts +1 -1
  120. package/lib/index.js +1 -1
  121. package/lib/lazyload/index.d.ts +1 -1
  122. package/lib/lazyload/index.js +3 -3
  123. package/lib/lazyload/vue-lazyload/index.d.ts +55 -0
  124. package/lib/lazyload/vue-lazyload/index.js +58 -0
  125. package/lib/lazyload/vue-lazyload/lazy-component.js +62 -0
  126. package/lib/lazyload/vue-lazyload/lazy-container.js +106 -0
  127. package/lib/lazyload/vue-lazyload/lazy-image.js +125 -0
  128. package/lib/lazyload/vue-lazyload/lazy.js +520 -0
  129. package/lib/lazyload/vue-lazyload/listener.js +251 -0
  130. package/lib/lazyload/vue-lazyload/util.js +213 -0
  131. package/lib/list/List.js +3 -1
  132. package/lib/locale/lang/pt-BR.d.ts +73 -0
  133. package/lib/locale/lang/pt-BR.js +77 -0
  134. package/lib/number-keyboard/NumberKeyboardKey.js +3 -3
  135. package/lib/pagination/Pagination.js +65 -47
  136. package/lib/pagination/index.css +1 -1
  137. package/lib/pagination/index.less +32 -31
  138. package/lib/password-input/PasswordInput.d.ts +1 -1
  139. package/lib/password-input/index.d.ts +1 -1
  140. package/lib/popover/Popover.js +2 -0
  141. package/lib/popup/Popup.d.ts +1 -2
  142. package/lib/popup/Popup.js +2 -5
  143. package/lib/popup/index.d.ts +1 -2
  144. package/lib/rate/Rate.js +5 -3
  145. package/lib/search/Search.js +9 -2
  146. package/lib/sidebar/Sidebar.js +1 -0
  147. package/lib/sidebar-item/SidebarItem.js +4 -1
  148. package/lib/slider/Slider.js +5 -3
  149. package/lib/ssr.js +7 -0
  150. package/lib/ssr.mjs +1 -0
  151. package/lib/stepper/Stepper.js +11 -8
  152. package/lib/swipe/Swipe.js +9 -4
  153. package/lib/swipe/index.css +1 -1
  154. package/lib/swipe/index.less +2 -0
  155. package/lib/swipe/types.d.ts +1 -3
  156. package/lib/switch/Switch.js +1 -0
  157. package/lib/switch/index.css +1 -1
  158. package/lib/switch/index.less +2 -0
  159. package/lib/tab/Tab.js +20 -5
  160. package/lib/tab/index.css +1 -1
  161. package/lib/tab/index.less +1 -1
  162. package/lib/tabbar/Tabbar.d.ts +1 -1
  163. package/lib/tabbar/Tabbar.js +10 -10
  164. package/lib/tabbar-item/TabbarItem.js +16 -7
  165. package/lib/tabs/Tabs.js +9 -3
  166. package/lib/tabs/TabsTitle.d.ts +6 -0
  167. package/lib/tabs/TabsTitle.js +7 -1
  168. package/lib/tabs/types.d.ts +1 -0
  169. package/lib/uploader/UploaderPreviewItem.js +3 -0
  170. package/lib/uploader/utils.d.ts +2 -2
  171. package/lib/uploader/utils.js +3 -2
  172. package/lib/utils/dom.d.ts +1 -0
  173. package/lib/utils/dom.js +9 -2
  174. package/lib/utils/format.js +7 -5
  175. package/lib/vant.cjs.js +14407 -0
  176. package/lib/vant.cjs.min.js +1 -0
  177. package/lib/vant.es.js +1125 -2186
  178. package/lib/vant.es.min.js +1125 -2186
  179. package/lib/vant.js +1109 -1089
  180. package/lib/vant.min.js +1 -1
  181. package/lib/vue-tsx-shim.d.ts +1 -0
  182. package/package.json +26 -11
  183. package/vetur/attributes.json +557 -557
  184. package/vetur/tags.json +183 -183
  185. package/vetur/web-types.json +1577 -1577
  186. package/es/composables/use-link-field.d.ts +0 -0
  187. package/es/composables/use-link-field.js +0 -0
  188. package/lib/composables/use-link-field.d.ts +0 -0
  189. package/lib/composables/use-link-field.js +0 -1
@@ -0,0 +1,241 @@
1
+ import { useRect } from '@vant/use';
2
+ import { loadImageAsync } from './util';
3
+ import { noop } from '../../utils';
4
+ export default class ReactiveListener {
5
+ constructor(_ref) {
6
+ var {
7
+ el,
8
+ src,
9
+ error,
10
+ loading,
11
+ bindType,
12
+ $parent,
13
+ options,
14
+ cors,
15
+ elRenderer,
16
+ imageCache
17
+ } = _ref;
18
+ this.el = el;
19
+ this.src = src;
20
+ this.error = error;
21
+ this.loading = loading;
22
+ this.bindType = bindType;
23
+ this.attempt = 0;
24
+ this.cors = cors;
25
+ this.naturalHeight = 0;
26
+ this.naturalWidth = 0;
27
+ this.options = options;
28
+ this.$parent = $parent;
29
+ this.elRenderer = elRenderer;
30
+ this.imageCache = imageCache;
31
+ this.performanceData = {
32
+ loadStart: 0,
33
+ loadEnd: 0
34
+ };
35
+ this.filter();
36
+ this.initState();
37
+ this.render('loading', false);
38
+ }
39
+ /*
40
+ * init listener state
41
+ * @return
42
+ */
43
+
44
+
45
+ initState() {
46
+ if ('dataset' in this.el) {
47
+ this.el.dataset.src = this.src;
48
+ } else {
49
+ this.el.setAttribute('data-src', this.src);
50
+ }
51
+
52
+ this.state = {
53
+ loading: false,
54
+ error: false,
55
+ loaded: false,
56
+ rendered: false
57
+ };
58
+ }
59
+ /*
60
+ * record performance
61
+ * @return
62
+ */
63
+
64
+
65
+ record(event) {
66
+ this.performanceData[event] = Date.now();
67
+ }
68
+ /*
69
+ * update image listener data
70
+ * @param {String} image uri
71
+ * @param {String} loading image uri
72
+ * @param {String} error image uri
73
+ * @return
74
+ */
75
+
76
+
77
+ update(_ref2) {
78
+ var {
79
+ src,
80
+ loading,
81
+ error
82
+ } = _ref2;
83
+ var oldSrc = this.src;
84
+ this.src = src;
85
+ this.loading = loading;
86
+ this.error = error;
87
+ this.filter();
88
+
89
+ if (oldSrc !== this.src) {
90
+ this.attempt = 0;
91
+ this.initState();
92
+ }
93
+ }
94
+ /*
95
+ * check el is in view
96
+ * @return {Boolean} el is in view
97
+ */
98
+
99
+
100
+ checkInView() {
101
+ var rect = useRect(this.el);
102
+ return rect.top < window.innerHeight * this.options.preLoad && rect.bottom > this.options.preLoadTop && rect.left < window.innerWidth * this.options.preLoad && rect.right > 0;
103
+ }
104
+ /*
105
+ * listener filter
106
+ */
107
+
108
+
109
+ filter() {
110
+ Object.keys(this.options.filter).forEach(key => {
111
+ this.options.filter[key](this, this.options);
112
+ });
113
+ }
114
+ /*
115
+ * render loading first
116
+ * @params cb:Function
117
+ * @return
118
+ */
119
+
120
+
121
+ renderLoading(cb) {
122
+ this.state.loading = true;
123
+ loadImageAsync({
124
+ src: this.loading,
125
+ cors: this.cors
126
+ }, () => {
127
+ this.render('loading', false);
128
+ this.state.loading = false;
129
+ cb();
130
+ }, () => {
131
+ // handler `loading image` load failed
132
+ cb();
133
+ this.state.loading = false;
134
+ if (process.env.NODE_ENV !== 'production' && !this.options.silent) console.warn("[@vant/lazyload] load failed with loading image(" + this.loading + ")");
135
+ });
136
+ }
137
+ /*
138
+ * try load image and render it
139
+ * @return
140
+ */
141
+
142
+
143
+ load(onFinish) {
144
+ if (onFinish === void 0) {
145
+ onFinish = noop;
146
+ }
147
+
148
+ if (this.attempt > this.options.attempt - 1 && this.state.error) {
149
+ if (process.env.NODE_ENV !== 'production' && !this.options.silent) {
150
+ console.log("[@vant/lazyload] " + this.src + " tried too more than " + this.options.attempt + " times");
151
+ }
152
+
153
+ onFinish();
154
+ return;
155
+ }
156
+
157
+ if (this.state.rendered && this.state.loaded) return;
158
+
159
+ if (this.imageCache.has(this.src)) {
160
+ this.state.loaded = true;
161
+ this.render('loaded', true);
162
+ this.state.rendered = true;
163
+ return onFinish();
164
+ }
165
+
166
+ this.renderLoading(() => {
167
+ var _this$options$adapter, _this$options$adapter2;
168
+
169
+ this.attempt++;
170
+ (_this$options$adapter = (_this$options$adapter2 = this.options.adapter).beforeLoad) == null ? void 0 : _this$options$adapter.call(_this$options$adapter2, this, this.options);
171
+ this.record('loadStart');
172
+ loadImageAsync({
173
+ src: this.src,
174
+ cors: this.cors
175
+ }, data => {
176
+ this.naturalHeight = data.naturalHeight;
177
+ this.naturalWidth = data.naturalWidth;
178
+ this.state.loaded = true;
179
+ this.state.error = false;
180
+ this.record('loadEnd');
181
+ this.render('loaded', false);
182
+ this.state.rendered = true;
183
+ this.imageCache.add(this.src);
184
+ onFinish();
185
+ }, err => {
186
+ !this.options.silent && console.error(err);
187
+ this.state.error = true;
188
+ this.state.loaded = false;
189
+ this.render('error', false);
190
+ });
191
+ });
192
+ }
193
+ /*
194
+ * render image
195
+ * @param {String} state to render // ['loading', 'src', 'error']
196
+ * @param {String} is form cache
197
+ * @return
198
+ */
199
+
200
+
201
+ render(state, cache) {
202
+ this.elRenderer(this, state, cache);
203
+ }
204
+ /*
205
+ * output performance data
206
+ * @return {Object} performance data
207
+ */
208
+
209
+
210
+ performance() {
211
+ var state = 'loading';
212
+ var time = 0;
213
+
214
+ if (this.state.loaded) {
215
+ state = 'loaded';
216
+ time = (this.performanceData.loadEnd - this.performanceData.loadStart) / 1000;
217
+ }
218
+
219
+ if (this.state.error) state = 'error';
220
+ return {
221
+ src: this.src,
222
+ state,
223
+ time
224
+ };
225
+ }
226
+ /*
227
+ * $destroy
228
+ * @return
229
+ */
230
+
231
+
232
+ $destroy() {
233
+ this.el = null;
234
+ this.src = null;
235
+ this.error = null;
236
+ this.loading = null;
237
+ this.bindType = null;
238
+ this.attempt = 0;
239
+ }
240
+
241
+ }
@@ -0,0 +1,183 @@
1
+ import { inBrowser } from '@vant/use';
2
+ export var hasIntersectionObserver = inBrowser && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
3
+ export var modeType = {
4
+ event: 'event',
5
+ observer: 'observer'
6
+ };
7
+ export function remove(arr, item) {
8
+ if (!arr.length) return;
9
+ var index = arr.indexOf(item);
10
+ if (index > -1) return arr.splice(index, 1);
11
+ }
12
+ export function getBestSelectionFromSrcset(el, scale) {
13
+ if (el.tagName !== 'IMG' || !el.getAttribute('data-srcset')) return;
14
+ var options = el.getAttribute('data-srcset');
15
+ var container = el.parentNode;
16
+ var containerWidth = container.offsetWidth * scale;
17
+ var spaceIndex;
18
+ var tmpSrc;
19
+ var tmpWidth;
20
+ options = options.trim().split(',');
21
+ var result = options.map(item => {
22
+ item = item.trim();
23
+ spaceIndex = item.lastIndexOf(' ');
24
+
25
+ if (spaceIndex === -1) {
26
+ tmpSrc = item;
27
+ tmpWidth = 999998;
28
+ } else {
29
+ tmpSrc = item.substr(0, spaceIndex);
30
+ tmpWidth = parseInt(item.substr(spaceIndex + 1, item.length - spaceIndex - 2), 10);
31
+ }
32
+
33
+ return [tmpWidth, tmpSrc];
34
+ });
35
+ result.sort((a, b) => {
36
+ if (a[0] < b[0]) {
37
+ return 1;
38
+ }
39
+
40
+ if (a[0] > b[0]) {
41
+ return -1;
42
+ }
43
+
44
+ if (a[0] === b[0]) {
45
+ if (b[1].indexOf('.webp', b[1].length - 5) !== -1) {
46
+ return 1;
47
+ }
48
+
49
+ if (a[1].indexOf('.webp', a[1].length - 5) !== -1) {
50
+ return -1;
51
+ }
52
+ }
53
+
54
+ return 0;
55
+ });
56
+ var bestSelectedSrc = '';
57
+ var tmpOption;
58
+
59
+ for (var i = 0; i < result.length; i++) {
60
+ tmpOption = result[i];
61
+ bestSelectedSrc = tmpOption[1];
62
+ var next = result[i + 1];
63
+
64
+ if (next && next[0] < containerWidth) {
65
+ bestSelectedSrc = tmpOption[1];
66
+ break;
67
+ } else if (!next) {
68
+ bestSelectedSrc = tmpOption[1];
69
+ break;
70
+ }
71
+ }
72
+
73
+ return bestSelectedSrc;
74
+ }
75
+ export var getDPR = function (scale) {
76
+ if (scale === void 0) {
77
+ scale = 1;
78
+ }
79
+
80
+ return inBrowser ? window.devicePixelRatio || scale : scale;
81
+ };
82
+ export function supportWebp() {
83
+ if (!inBrowser) return false;
84
+ var support = true;
85
+
86
+ try {
87
+ var elem = document.createElement('canvas');
88
+
89
+ if (elem.getContext && elem.getContext('2d')) {
90
+ support = elem.toDataURL('image/webp').indexOf('data:image/webp') === 0;
91
+ }
92
+ } catch (err) {
93
+ support = false;
94
+ }
95
+
96
+ return support;
97
+ }
98
+ export function throttle(action, delay) {
99
+ var timeout = null;
100
+ var lastRun = 0;
101
+ return function () {
102
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
103
+ args[_key] = arguments[_key];
104
+ }
105
+
106
+ if (timeout) {
107
+ return;
108
+ }
109
+
110
+ var elapsed = Date.now() - lastRun;
111
+
112
+ var runCallback = () => {
113
+ lastRun = Date.now();
114
+ timeout = false;
115
+ action.apply(this, args);
116
+ };
117
+
118
+ if (elapsed >= delay) {
119
+ runCallback();
120
+ } else {
121
+ timeout = setTimeout(runCallback, delay);
122
+ }
123
+ };
124
+ }
125
+ export function on(el, type, func) {
126
+ el.addEventListener(type, func, {
127
+ capture: false,
128
+ passive: true
129
+ });
130
+ }
131
+ export function off(el, type, func) {
132
+ el.removeEventListener(type, func, false);
133
+ }
134
+ export var loadImageAsync = (item, resolve, reject) => {
135
+ var image = new Image();
136
+
137
+ if (!item || !item.src) {
138
+ return reject(new Error('image src is required'));
139
+ }
140
+
141
+ image.src = item.src;
142
+
143
+ if (item.cors) {
144
+ image.crossOrigin = item.cors;
145
+ }
146
+
147
+ image.onload = () => resolve({
148
+ naturalHeight: image.naturalHeight,
149
+ naturalWidth: image.naturalWidth,
150
+ src: image.src
151
+ });
152
+
153
+ image.onerror = e => reject(e);
154
+ };
155
+ export class ImageCache {
156
+ constructor(_ref) {
157
+ var {
158
+ max
159
+ } = _ref;
160
+ this.options = {
161
+ max: max || 100
162
+ };
163
+ this.caches = [];
164
+ }
165
+
166
+ has(key) {
167
+ return this.caches.indexOf(key) > -1;
168
+ }
169
+
170
+ add(key) {
171
+ if (this.has(key)) return;
172
+ this.caches.push(key);
173
+
174
+ if (this.caches.length > this.options.max) {
175
+ this.free();
176
+ }
177
+ }
178
+
179
+ free() {
180
+ this.caches.shift();
181
+ }
182
+
183
+ }
package/es/list/List.js CHANGED
@@ -95,7 +95,9 @@ export default defineComponent({
95
95
 
96
96
  if (text) {
97
97
  return _createVNode("div", {
98
+ "role": "button",
98
99
  "class": bem('error-text'),
100
+ "tabindex": 0,
99
101
  "onClick": clickErrorText
100
102
  }, [text]);
101
103
  }
@@ -114,7 +116,7 @@ export default defineComponent({
114
116
  }
115
117
  };
116
118
 
117
- watch([() => props.loading, () => props.finished, () => props.error], check);
119
+ watch(() => [props.loading, props.finished, props.error], check);
118
120
 
119
121
  if (tabStatus) {
120
122
  watch(tabStatus, tabActive => {
@@ -0,0 +1,73 @@
1
+ declare const _default: {
2
+ name: string;
3
+ tel: string;
4
+ save: string;
5
+ confirm: string;
6
+ cancel: string;
7
+ delete: string;
8
+ loading: string;
9
+ noCoupon: string;
10
+ nameEmpty: string;
11
+ telInvalid: string;
12
+ vanCalendar: {
13
+ end: string;
14
+ start: string;
15
+ title: string;
16
+ startEnd: string;
17
+ weekdays: string[];
18
+ monthTitle: (year: number, month: number) => string;
19
+ rangePrompt: (maxRange: number) => string;
20
+ };
21
+ vanCascader: {
22
+ select: string;
23
+ };
24
+ vanContactCard: {
25
+ addText: string;
26
+ };
27
+ vanContactList: {
28
+ addText: string;
29
+ };
30
+ vanPagination: {
31
+ prev: string;
32
+ next: string;
33
+ };
34
+ vanPullRefresh: {
35
+ pulling: string;
36
+ loosing: string;
37
+ };
38
+ vanSubmitBar: {
39
+ label: string;
40
+ };
41
+ vanCoupon: {
42
+ unlimited: string;
43
+ discount: (discount: number) => string;
44
+ condition: (condition: number) => string;
45
+ };
46
+ vanCouponCell: {
47
+ title: string;
48
+ count: (count: number) => string;
49
+ };
50
+ vanCouponList: {
51
+ exchange: string;
52
+ close: string;
53
+ enable: string;
54
+ disabled: string;
55
+ placeholder: string;
56
+ };
57
+ vanAddressEdit: {
58
+ area: string;
59
+ postal: string;
60
+ areaEmpty: string;
61
+ addressEmpty: string;
62
+ postalEmpty: string;
63
+ defaultAddress: string;
64
+ };
65
+ vanAddressEditDetail: {
66
+ label: string;
67
+ placeholder: string;
68
+ };
69
+ vanAddressList: {
70
+ add: string;
71
+ };
72
+ };
73
+ export default _default;
@@ -0,0 +1,72 @@
1
+ export default {
2
+ name: 'Nome',
3
+ tel: 'Fone',
4
+ save: 'Salvar',
5
+ confirm: 'Confirmar',
6
+ cancel: 'Cancelar',
7
+ delete: 'Excluir',
8
+ loading: 'Carregando...',
9
+ noCoupon: 'Nenhum cupom',
10
+ nameEmpty: 'Por favor, preencha o nome',
11
+ telInvalid: 'Telefone em formato inválido',
12
+ vanCalendar: {
13
+ end: 'Fim',
14
+ start: 'Início',
15
+ title: 'Calendário',
16
+ startEnd: 'Início/Fim',
17
+ weekdays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
18
+ monthTitle: (year, month) => month + "/" + year,
19
+ rangePrompt: maxRange => "Escolha no m\xE1ximo " + maxRange + " dias"
20
+ },
21
+ vanCascader: {
22
+ select: 'Selecione'
23
+ },
24
+ vanContactCard: {
25
+ addText: 'Adicionar informações de contato'
26
+ },
27
+ vanContactList: {
28
+ addText: 'Adicionar novo contato'
29
+ },
30
+ vanPagination: {
31
+ prev: 'Anterior',
32
+ next: 'Próximo'
33
+ },
34
+ vanPullRefresh: {
35
+ pulling: 'Puxe para atualizar...',
36
+ loosing: 'Solte para atualizar...'
37
+ },
38
+ vanSubmitBar: {
39
+ label: 'Total:'
40
+ },
41
+ vanCoupon: {
42
+ unlimited: 'Ilimitado',
43
+ discount: discount => discount * 10 + "% de desconto",
44
+ condition: condition => "Pelo menos " + condition
45
+ },
46
+ vanCouponCell: {
47
+ title: 'Cupom',
48
+ count: count => "Voc\xEA possui " + count + " cupom(ns)"
49
+ },
50
+ vanCouponList: {
51
+ exchange: 'Usar',
52
+ close: 'Fechar',
53
+ enable: 'Disponível',
54
+ disabled: 'Indisponível',
55
+ placeholder: 'Código do cupom'
56
+ },
57
+ vanAddressEdit: {
58
+ area: 'Área',
59
+ postal: 'CEP',
60
+ areaEmpty: 'Por favor, selecione uma área de recebimento',
61
+ addressEmpty: 'Endereço não pode ser vazio',
62
+ postalEmpty: 'CEP inválido',
63
+ defaultAddress: 'Usar como endereço padrão'
64
+ },
65
+ vanAddressEditDetail: {
66
+ label: 'Endereço',
67
+ placeholder: 'Endereço'
68
+ },
69
+ vanAddressList: {
70
+ add: 'Adicionar novo endereço'
71
+ }
72
+ };
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, defineComponent } from 'vue';
3
- import { numericProp, createNamespace } from '../utils';
3
+ import { numericProp, createNamespace, preventDefault } from '../utils';
4
4
  import { useTouch } from '../composables/use-touch';
5
5
  import { Loading } from '../loading';
6
6
  var [name, bem] = createNamespace('key');
@@ -9,7 +9,7 @@ var CollapseIcon = _createVNode("svg", {
9
9
  "class": bem('collapse-icon'),
10
10
  "viewBox": "0 0 30 24"
11
11
  }, [_createVNode("path", {
12
- "d": "M25.877 12.843h-1.502c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.5c.187 0 .187 0 .187-.188v-1.511c0-.19 0-.191-.185-.191zM17.999 10.2c0 .188 0 .188.188.188h1.687c.188 0 .188 0 .188-.188V8.688c0-.187.004-.187-.186-.19h-1.69c-.187 0-.187 0-.187.19V10.2zm2.25-3.967h1.5c.188 0 .188 0 .188-.188v-1.7c0-.19 0-.19-.188-.19h-1.5c-.189 0-.189 0-.189.19v1.7c0 .188 0 .188.19.188zm2.063 4.157h3.563c.187 0 .187 0 .187-.189V4.346c0-.19.004-.19-.185-.19h-1.69c-.187 0-.187 0-.187.188v4.155h-1.688c-.187 0-.187 0-.187.189v1.514c0 .19 0 .19.187.19zM14.812 24l2.812-3.4H12l2.813 3.4zm-9-11.157H4.31c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.502c.187 0 .187 0 .187-.188v-1.511c0-.19.01-.191-.189-.191zm15.937 0H8.25c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h13.5c.188 0 .188 0 .188-.188v-1.511c0-.19 0-.191-.188-.191zm-11.438-2.454h1.5c.188 0 .188 0 .188-.188V8.688c0-.187 0-.187-.188-.189h-1.5c-.187 0-.187 0-.187.189V10.2c0 .188 0 .188.187.188zM27.94 0c.563 0 .917.21 1.313.567.518.466.748.757.748 1.51v14.92c0 .567-.188 1.134-.562 1.512-.376.378-.938.566-1.313.566H2.063c-.563 0-.938-.188-1.313-.566-.562-.378-.75-.945-.75-1.511V2.078C0 1.51.188.944.562.567.938.189 1.5 0 1.875 0zm-.062 2H2v14.92h25.877V2zM5.81 4.157c.19 0 .19 0 .19.189v1.762c-.003.126-.024.126-.188.126H4.249c-.126-.003-.126-.023-.126-.188v-1.7c-.187-.19 0-.19.188-.19zm10.5 2.077h1.503c.187 0 .187 0 .187-.188v-1.7c0-.19 0-.19-.187-.19h-1.502c-.188 0-.188.001-.188.19v1.7c0 .188 0 .188.188.188zM7.875 8.5c.187 0 .187.002.187.189V10.2c0 .188 0 .188-.187.188H4.249c-.126-.002-.126-.023-.126-.188V8.625c.003-.126.024-.126.188-.126zm7.875 0c.19.002.19.002.19.189v1.575c-.003.126-.024.126-.19.126h-1.563c-.126-.002-.126-.023-.126-.188V8.625c.002-.126.023-.126.189-.126zm-6-4.342c.187 0 .187 0 .187.189v1.7c0 .188 0 .188-.187.188H8.187c-.126-.003-.126-.023-.126-.188V4.283c.003-.126.024-.126.188-.126zm3.94 0c.185 0 .372 0 .372.189v1.762c-.002.126-.023.126-.187.126h-1.75C12 6.231 12 6.211 12 6.046v-1.7c0-.19.187-.19.187-.19z",
12
+ "d": "M26 13h-2v2h2v-2zm-8-3h2V8h-2v2zm2-4h2V4h-2v2zm2 4h4V4h-2v4h-2v2zm-7 14 3-3h-6l3 3zM6 13H4v2h2v-2zm16 0H8v2h14v-2zm-12-3h2V8h-2v2zM28 0l1 1 1 1v15l-1 2H1l-1-2V2l1-1 1-1zm0 2H2v15h26V2zM6 4v2H4V4zm10 2h2V4h-2v2zM8 9v1H4V8zm8 0v1h-2V8zm-6-5v2H8V4zm4 0v2h-2V4z",
13
13
  "fill": "currentColor"
14
14
  }, null)]);
15
15
 
@@ -17,7 +17,7 @@ var DeleteIcon = _createVNode("svg", {
17
17
  "class": bem('delete-icon'),
18
18
  "viewBox": "0 0 32 22"
19
19
  }, [_createVNode("path", {
20
- "d": "M28.016 0A3.991 3.991 0 0132 3.987v14.026c0 2.2-1.787 3.987-3.98 3.987H10.382c-.509 0-.996-.206-1.374-.585L.89 13.09C.33 12.62 0 11.84 0 11.006c0-.86.325-1.62.887-2.08L9.01.585A1.936 1.936 0 0110.383 0zm0 1.947H10.368L2.24 10.28c-.224.226-.312.432-.312.73 0 .287.094.51.312.729l8.128 8.333h17.648a2.041 2.041 0 002.037-2.04V3.987c0-1.127-.915-2.04-2.037-2.04zM23.028 6a.96.96 0 01.678.292.95.95 0 01-.003 1.377l-3.342 3.348 3.326 3.333c.189.188.292.43.292.679 0 .248-.103.49-.292.679a.96.96 0 01-.678.292.959.959 0 01-.677-.292L18.99 12.36l-3.343 3.345a.96.96 0 01-.677.292.96.96 0 01-.678-.292.962.962 0 01-.292-.68c0-.248.104-.49.292-.679l3.342-3.348-3.342-3.348A.963.963 0 0114 6.971c0-.248.104-.49.292-.679A.96.96 0 0114.97 6a.96.96 0 01.677.292l3.358 3.348 3.345-3.348A.96.96 0 0123.028 6z",
20
+ "d": "M28 0a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H10.4a2 2 0 0 1-1.4-.6L1 13.1c-.6-.5-.9-1.3-.9-2 0-1 .3-1.7.9-2.2L9 .6a2 2 0 0 1 1.4-.6zm0 2H10.4l-8.2 8.3a1 1 0 0 0-.3.7c0 .3.1.5.3.7l8.2 8.4H28a2 2 0 0 0 2-2V4c0-1.1-.9-2-2-2zm-5 4a1 1 0 0 1 .7.3 1 1 0 0 1 0 1.4L20.4 11l3.3 3.3c.2.2.3.5.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3L19 12.4l-3.4 3.3a1 1 0 0 1-.6.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.2.1-.5.3-.7l3.3-3.3-3.3-3.3A1 1 0 0 1 14 7c0-.3.1-.5.3-.7A1 1 0 0 1 15 6a1 1 0 0 1 .6.3L19 9.6l3.3-3.3A1 1 0 0 1 23 6z",
21
21
  "fill": "currentColor"
22
22
  }, null)]);
23
23
 
@@ -59,7 +59,7 @@ export default defineComponent({
59
59
  // eliminate tap delay on safari
60
60
  // see: https://github.com/youzan/vant/issues/6836
61
61
  if (!slots.default) {
62
- event.preventDefault();
62
+ preventDefault(event);
63
63
  }
64
64
 
65
65
  active.value = false;