vant 2.12.35 → 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.
@@ -90,11 +90,9 @@ export default createComponent({
90
90
  },
91
91
  methods: {
92
92
  getHeight: function getHeight() {
93
- if (!this.height) {
94
- this.height = this.$el.getBoundingClientRect().height;
95
- }
93
+ var _this$$el;
96
94
 
97
- return this.height;
95
+ return ((_this$$el = this.$el) == null ? void 0 : _this$$el.getBoundingClientRect().height) || 0;
98
96
  },
99
97
  scrollIntoView: function scrollIntoView(body) {
100
98
  var _this$$refs = this.$refs,
@@ -98,6 +98,11 @@ export default createComponent({
98
98
  }
99
99
  }
100
100
  },
101
+ inject: {
102
+ vanPopup: {
103
+ default: null
104
+ }
105
+ },
101
106
  data: function data() {
102
107
  return {
103
108
  subtitle: '',
@@ -148,7 +153,11 @@ export default createComponent({
148
153
  }
149
154
  },
150
155
  mounted: function mounted() {
151
- this.init();
156
+ var _this$vanPopup;
157
+
158
+ this.init(); // https://github.com/youzan/vant/issues/9845
159
+
160
+ (_this$vanPopup = this.vanPopup) == null ? void 0 : _this$vanPopup.$on('opened', this.onScroll);
152
161
  },
153
162
 
154
163
  /* istanbul ignore next */
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.35';
90
+ var version = '2.12.36';
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];
@@ -90,6 +90,14 @@ export default createComponent({
90
90
  return this.fileList;
91
91
  }
92
92
  },
93
+ created: function created() {
94
+ this.urls = [];
95
+ },
96
+ beforeDestroy: function beforeDestroy() {
97
+ this.urls.forEach(function (url) {
98
+ return URL.revokeObjectURL(url);
99
+ });
100
+ },
93
101
  methods: {
94
102
  getDetail: function getDetail(index) {
95
103
  if (index === void 0) {
@@ -268,7 +276,13 @@ export default createComponent({
268
276
  return isImageFile(item);
269
277
  });
270
278
  var imageContents = imageFiles.map(function (item) {
271
- return item.content || item.url;
279
+ if (item.file && !item.url) {
280
+ item.url = URL.createObjectURL(item.file);
281
+
282
+ _this5.urls.push(item.url);
283
+ }
284
+
285
+ return item.url;
272
286
  });
273
287
  this.imagePreview = ImagePreview(_extends({
274
288
  images: imageContents,
@@ -98,11 +98,9 @@ var _default = createComponent({
98
98
  },
99
99
  methods: {
100
100
  getHeight: function getHeight() {
101
- if (!this.height) {
102
- this.height = this.$el.getBoundingClientRect().height;
103
- }
101
+ var _this$$el;
104
102
 
105
- return this.height;
103
+ return ((_this$$el = this.$el) == null ? void 0 : _this$$el.getBoundingClientRect().height) || 0;
106
104
  },
107
105
  scrollIntoView: function scrollIntoView(body) {
108
106
  var _this$$refs = this.$refs,
@@ -114,6 +114,11 @@ var _default2 = (0, _utils.createComponent)({
114
114
  }
115
115
  }
116
116
  },
117
+ inject: {
118
+ vanPopup: {
119
+ default: null
120
+ }
121
+ },
117
122
  data: function data() {
118
123
  return {
119
124
  subtitle: '',
@@ -164,7 +169,11 @@ var _default2 = (0, _utils.createComponent)({
164
169
  }
165
170
  },
166
171
  mounted: function mounted() {
167
- this.init();
172
+ var _this$vanPopup;
173
+
174
+ this.init(); // https://github.com/youzan/vant/issues/9845
175
+
176
+ (_this$vanPopup = this.vanPopup) == null ? void 0 : _this$vanPopup.$on('opened', this.onScroll);
168
177
  },
169
178
 
170
179
  /* istanbul ignore next */
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.35';
364
+ var version = '2.12.36';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -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 */
@@ -19143,6 +19150,14 @@ var uploader_createNamespace = Object(create["a" /* createNamespace */])('upload
19143
19150
  return this.fileList;
19144
19151
  }
19145
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
+ },
19146
19161
  methods: {
19147
19162
  getDetail: function getDetail(index) {
19148
19163
  if (index === void 0) {
@@ -19321,7 +19336,13 @@ var uploader_createNamespace = Object(create["a" /* createNamespace */])('upload
19321
19336
  return isImageFile(item);
19322
19337
  });
19323
19338
  var imageContents = imageFiles.map(function (item) {
19324
- 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;
19325
19346
  });
19326
19347
  this.imagePreview = image_preview(_extends({
19327
19348
  images: imageContents,
@@ -22128,7 +22149,7 @@ TreeSelect.props = {
22128
22149
 
22129
22150
 
22130
22151
 
22131
- var version = '2.12.35';
22152
+ var version = '2.12.36';
22132
22153
 
22133
22154
  function install(Vue) {
22134
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];