vant 3.3.3-beta.nuxt3 → 3.3.6

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.d.ts CHANGED
@@ -90,4 +90,4 @@ declare namespace _default {
90
90
  }
91
91
  export default _default;
92
92
  export function install(app: any): void;
93
- export const version: "3.3.2";
93
+ export const version: "3.3.6";
package/es/index.js CHANGED
@@ -84,7 +84,7 @@ import { Tag } from './tag';
84
84
  import { Toast } from './toast';
85
85
  import { TreeSelect } from './tree-select';
86
86
  import { Uploader } from './uploader';
87
- var version = '3.3.2';
87
+ var version = '3.3.6';
88
88
 
89
89
  function install(app) {
90
90
  var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
@@ -1,5 +1,5 @@
1
1
  import { createVNode as _createVNode, mergeProps as _mergeProps, resolveDirective as _resolveDirective } from "vue";
2
- import { ref, reactive, defineComponent } from 'vue'; // Utils
2
+ import { ref, reactive, defineComponent, onBeforeUnmount } from 'vue'; // Utils
3
3
 
4
4
  import { pick, extend, isPromise, truthProp, numericProp, getSizeStyle, makeArrayProp, makeStringProp, makeNumericProp } from '../utils';
5
5
  import { bem, name, toArray, isOversize, filterFiles, isImageFile, readFileContent } from './utils'; // Composables
@@ -50,6 +50,7 @@ export default defineComponent({
50
50
  slots
51
51
  } = _ref;
52
52
  var inputRef = ref();
53
+ var urls = [];
53
54
 
54
55
  var getDetail = function (index) {
55
56
  if (index === void 0) {
@@ -182,7 +183,14 @@ export default defineComponent({
182
183
  var previewImage = item => {
183
184
  if (props.previewFullImage) {
184
185
  var imageFiles = props.modelValue.filter(isImageFile);
185
- var images = imageFiles.map(item => item.content || item.url).filter(Boolean);
186
+ var images = imageFiles.map(item => {
187
+ if (item.file && !item.url) {
188
+ item.url = URL.createObjectURL(item.file);
189
+ urls.push(item.url);
190
+ }
191
+
192
+ return item.url;
193
+ }).filter(Boolean);
186
194
  imagePreview = ImagePreview(extend({
187
195
  images,
188
196
  startPosition: imageFiles.indexOf(item),
@@ -269,6 +277,9 @@ export default defineComponent({
269
277
  }
270
278
  };
271
279
 
280
+ onBeforeUnmount(() => {
281
+ urls.forEach(url => URL.revokeObjectURL(url));
282
+ });
272
283
  useExpose({
273
284
  chooseFile,
274
285
  closeImagePreview
package/lib/index.d.ts CHANGED
@@ -90,4 +90,4 @@ declare namespace _default {
90
90
  }
91
91
  export default _default;
92
92
  export function install(app: any): void;
93
- export const version: "3.3.2";
93
+ export const version: "3.3.6";
package/lib/index.js CHANGED
@@ -782,7 +782,7 @@ Object.keys(_uploader).forEach(function (key) {
782
782
  if (key in exports && exports[key] === _uploader[key]) return;
783
783
  exports[key] = _uploader[key];
784
784
  });
785
- var version = '3.3.2';
785
+ var version = '3.3.6';
786
786
  exports.version = version;
787
787
 
788
788
  function install(app) {
package/lib/ssr.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./dist/vant.cjs.min.js');
4
+ module.exports = require('./vant.cjs.min.js');
5
5
  } else {
6
- module.exports = require('./dist/vant.cjs.js');
6
+ module.exports = require('./vant.cjs.js');
7
7
  };
@@ -64,6 +64,7 @@ var _default = (0, _vue.defineComponent)({
64
64
  slots
65
65
  } = _ref;
66
66
  var inputRef = (0, _vue.ref)();
67
+ var urls = [];
67
68
 
68
69
  var getDetail = function (index) {
69
70
  if (index === void 0) {
@@ -196,7 +197,14 @@ var _default = (0, _vue.defineComponent)({
196
197
  var previewImage = item => {
197
198
  if (props.previewFullImage) {
198
199
  var imageFiles = props.modelValue.filter(_utils2.isImageFile);
199
- var images = imageFiles.map(item => item.content || item.url).filter(Boolean);
200
+ var images = imageFiles.map(item => {
201
+ if (item.file && !item.url) {
202
+ item.url = URL.createObjectURL(item.file);
203
+ urls.push(item.url);
204
+ }
205
+
206
+ return item.url;
207
+ }).filter(Boolean);
200
208
  imagePreview = (0, _imagePreview.ImagePreview)((0, _utils.extend)({
201
209
  images,
202
210
  startPosition: imageFiles.indexOf(item),
@@ -283,6 +291,9 @@ var _default = (0, _vue.defineComponent)({
283
291
  }
284
292
  };
285
293
 
294
+ (0, _vue.onBeforeUnmount)(() => {
295
+ urls.forEach(url => URL.revokeObjectURL(url));
296
+ });
286
297
  (0, _useExpose.useExpose)({
287
298
  chooseFile,
288
299
  closeImagePreview
package/lib/vant.cjs.js CHANGED
@@ -14104,6 +14104,7 @@ var _Uploader = vue.defineComponent({
14104
14104
  slots
14105
14105
  } = _ref;
14106
14106
  var inputRef = vue.ref();
14107
+ var urls = [];
14107
14108
  var getDetail = function(index2) {
14108
14109
  if (index2 === void 0) {
14109
14110
  index2 = props.modelValue.length;
@@ -14210,7 +14211,13 @@ var _Uploader = vue.defineComponent({
14210
14211
  var previewImage = (item) => {
14211
14212
  if (props.previewFullImage) {
14212
14213
  var imageFiles = props.modelValue.filter(isImageFile);
14213
- var images = imageFiles.map((item2) => item2.content || item2.url).filter(Boolean);
14214
+ var images = imageFiles.map((item2) => {
14215
+ if (item2.file && !item2.url) {
14216
+ item2.url = URL.createObjectURL(item2.file);
14217
+ urls.push(item2.url);
14218
+ }
14219
+ return item2.url;
14220
+ }).filter(Boolean);
14214
14221
  imagePreview = ImagePreview(extend({
14215
14222
  images,
14216
14223
  startPosition: imageFiles.indexOf(item),
@@ -14286,6 +14293,9 @@ var _Uploader = vue.defineComponent({
14286
14293
  inputRef.value.click();
14287
14294
  }
14288
14295
  };
14296
+ vue.onBeforeUnmount(() => {
14297
+ urls.forEach((url) => URL.revokeObjectURL(url));
14298
+ });
14289
14299
  useExpose({
14290
14300
  chooseFile,
14291
14301
  closeImagePreview
@@ -14301,7 +14311,7 @@ var _Uploader = vue.defineComponent({
14301
14311
  }
14302
14312
  });
14303
14313
  var Uploader = withInstall(_Uploader);
14304
- var version = "3.3.2";
14314
+ var version = "3.3.6";
14305
14315
  function install(app) {
14306
14316
  var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
14307
14317
  components.forEach((item) => {