zartui 3.1.52 → 3.1.53

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/lib/zartui.cjs.js CHANGED
@@ -14185,7 +14185,7 @@ var stdin_default$C = vue.defineComponent({
14185
14185
  }
14186
14186
  });
14187
14187
  };
14188
- const handleInputFiles = (event) => {
14188
+ const handleInputFiles = (event) => __async$2(this, null, function* () {
14189
14189
  const _files = event.target.files;
14190
14190
  if (!_files || _files.length === 0) {
14191
14191
  return;
@@ -14198,23 +14198,25 @@ var stdin_default$C = vue.defineComponent({
14198
14198
  return;
14199
14199
  }
14200
14200
  if (props.beforeRead) {
14201
- const response = props.beforeRead(files);
14202
- if (!response) {
14203
- return;
14204
- }
14205
- if (isPromise(response)) {
14206
- response.then((data) => {
14207
- if (data) {
14208
- readFiles(data);
14209
- } else {
14210
- readFiles(files);
14211
- }
14212
- });
14201
+ try {
14202
+ const response = yield props.beforeRead(files);
14203
+ if (!response) {
14204
+ return;
14205
+ }
14206
+ if (Array.isArray(response)) {
14207
+ const data = response.filter((file) => !!file);
14208
+ readFiles(data);
14209
+ } else {
14210
+ readFiles(files);
14211
+ }
14212
+ } catch (error) {
14213
+ showFailToast(error == null ? void 0 : error.message);
14213
14214
  return;
14214
14215
  }
14216
+ } else {
14217
+ readFiles(files);
14215
14218
  }
14216
- readFiles(files);
14217
- };
14219
+ });
14218
14220
  const hiddenInput = () => [vue.createVNode("input", {
14219
14221
  "type": "file",
14220
14222
  "accept": "image/*",
@@ -14414,21 +14416,15 @@ var stdin_default$C = vue.defineComponent({
14414
14416
  }, [media.label]);
14415
14417
  }
14416
14418
  };
14417
- const onDelete = (media, index) => {
14419
+ const onDelete = (media, index) => __async$2(this, null, function* () {
14418
14420
  if (props.beforeDelete) {
14419
- const response = props.beforeDelete(media);
14421
+ const response = yield props.beforeDelete(media);
14420
14422
  if (!response) {
14421
14423
  return;
14422
14424
  }
14423
- if (isPromise(response)) {
14424
- response.then(() => {
14425
- deleteMedia(media, index);
14426
- });
14427
- return;
14428
- }
14429
14425
  }
14430
14426
  deleteMedia(media, index);
14431
- };
14427
+ });
14432
14428
  const previewMedia = (index) => __async$2(this, null, function* () {
14433
14429
  var _a;
14434
14430
  if (props.preview && props.preview(props.mediaList, index)) {
@@ -20944,7 +20940,7 @@ const Lazyload = {
20944
20940
  });
20945
20941
  }
20946
20942
  };
20947
- const version = "3.1.51";
20943
+ const version = "3.1.52";
20948
20944
  function install(app) {
20949
20945
  const components = [
20950
20946
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -14183,7 +14183,7 @@ var stdin_default$C = defineComponent({
14183
14183
  }
14184
14184
  });
14185
14185
  };
14186
- const handleInputFiles = (event) => {
14186
+ const handleInputFiles = (event) => __async$2(this, null, function* () {
14187
14187
  const _files = event.target.files;
14188
14188
  if (!_files || _files.length === 0) {
14189
14189
  return;
@@ -14196,23 +14196,25 @@ var stdin_default$C = defineComponent({
14196
14196
  return;
14197
14197
  }
14198
14198
  if (props.beforeRead) {
14199
- const response = props.beforeRead(files);
14200
- if (!response) {
14201
- return;
14202
- }
14203
- if (isPromise(response)) {
14204
- response.then((data) => {
14205
- if (data) {
14206
- readFiles(data);
14207
- } else {
14208
- readFiles(files);
14209
- }
14210
- });
14199
+ try {
14200
+ const response = yield props.beforeRead(files);
14201
+ if (!response) {
14202
+ return;
14203
+ }
14204
+ if (Array.isArray(response)) {
14205
+ const data = response.filter((file) => !!file);
14206
+ readFiles(data);
14207
+ } else {
14208
+ readFiles(files);
14209
+ }
14210
+ } catch (error) {
14211
+ showFailToast(error == null ? void 0 : error.message);
14211
14212
  return;
14212
14213
  }
14214
+ } else {
14215
+ readFiles(files);
14213
14216
  }
14214
- readFiles(files);
14215
- };
14217
+ });
14216
14218
  const hiddenInput = () => [createVNode("input", {
14217
14219
  "type": "file",
14218
14220
  "accept": "image/*",
@@ -14412,21 +14414,15 @@ var stdin_default$C = defineComponent({
14412
14414
  }, [media.label]);
14413
14415
  }
14414
14416
  };
14415
- const onDelete = (media, index) => {
14417
+ const onDelete = (media, index) => __async$2(this, null, function* () {
14416
14418
  if (props.beforeDelete) {
14417
- const response = props.beforeDelete(media);
14419
+ const response = yield props.beforeDelete(media);
14418
14420
  if (!response) {
14419
14421
  return;
14420
14422
  }
14421
- if (isPromise(response)) {
14422
- response.then(() => {
14423
- deleteMedia(media, index);
14424
- });
14425
- return;
14426
- }
14427
14423
  }
14428
14424
  deleteMedia(media, index);
14429
- };
14425
+ });
14430
14426
  const previewMedia = (index) => __async$2(this, null, function* () {
14431
14427
  var _a;
14432
14428
  if (props.preview && props.preview(props.mediaList, index)) {
@@ -20942,7 +20938,7 @@ const Lazyload = {
20942
20938
  });
20943
20939
  }
20944
20940
  };
20945
- const version = "3.1.51";
20941
+ const version = "3.1.52";
20946
20942
  function install(app) {
20947
20943
  const components = [
20948
20944
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -15961,7 +15961,7 @@
15961
15961
  }
15962
15962
  });
15963
15963
  };
15964
- const handleInputFiles = (event) => {
15964
+ const handleInputFiles = (event) => __async$2(this, null, function* () {
15965
15965
  const _files = event.target.files;
15966
15966
  if (!_files || _files.length === 0) {
15967
15967
  return;
@@ -15974,23 +15974,25 @@
15974
15974
  return;
15975
15975
  }
15976
15976
  if (props.beforeRead) {
15977
- const response = props.beforeRead(files);
15978
- if (!response) {
15979
- return;
15980
- }
15981
- if (isPromise(response)) {
15982
- response.then((data) => {
15983
- if (data) {
15984
- readFiles(data);
15985
- } else {
15986
- readFiles(files);
15987
- }
15988
- });
15977
+ try {
15978
+ const response = yield props.beforeRead(files);
15979
+ if (!response) {
15980
+ return;
15981
+ }
15982
+ if (Array.isArray(response)) {
15983
+ const data = response.filter((file) => !!file);
15984
+ readFiles(data);
15985
+ } else {
15986
+ readFiles(files);
15987
+ }
15988
+ } catch (error) {
15989
+ showFailToast(error == null ? void 0 : error.message);
15989
15990
  return;
15990
15991
  }
15992
+ } else {
15993
+ readFiles(files);
15991
15994
  }
15992
- readFiles(files);
15993
- };
15995
+ });
15994
15996
  const hiddenInput = () => [vue.createVNode("input", {
15995
15997
  "type": "file",
15996
15998
  "accept": "image/*",
@@ -16190,21 +16192,15 @@
16190
16192
  }, [media.label]);
16191
16193
  }
16192
16194
  };
16193
- const onDelete = (media, index2) => {
16195
+ const onDelete = (media, index2) => __async$2(this, null, function* () {
16194
16196
  if (props.beforeDelete) {
16195
- const response = props.beforeDelete(media);
16197
+ const response = yield props.beforeDelete(media);
16196
16198
  if (!response) {
16197
16199
  return;
16198
16200
  }
16199
- if (isPromise(response)) {
16200
- response.then(() => {
16201
- deleteMedia(media, index2);
16202
- });
16203
- return;
16204
- }
16205
16201
  }
16206
16202
  deleteMedia(media, index2);
16207
- };
16203
+ });
16208
16204
  const previewMedia = (index$1) => __async$2(this, null, function* () {
16209
16205
  var _a;
16210
16206
  if (props.preview && props.preview(props.mediaList, index$1)) {
@@ -25004,7 +25000,7 @@
25004
25000
  });
25005
25001
  }
25006
25002
  };
25007
- const version = "3.1.51";
25003
+ const version = "3.1.52";
25008
25004
  function install(app) {
25009
25005
  const components = [
25010
25006
  ActionSheet,