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/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/media-picker/MediaPicker.mjs +21 -25
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/MediaPicker.js +20 -24
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +21 -25
- package/lib/zartui.es.js +21 -25
- package/lib/zartui.js +21 -25
- package/lib/zartui.min.js +1 -1
- package/package.json +4 -4
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -77,7 +77,7 @@ import { Timeline } from "./timeline/index.mjs";
|
|
|
77
77
|
import { Toast } from "./toast/index.mjs";
|
|
78
78
|
import { Uploader } from "./uploader/index.mjs";
|
|
79
79
|
import { Video } from "./video/index.mjs";
|
|
80
|
-
const version = "3.1.
|
|
80
|
+
const version = "3.1.52";
|
|
81
81
|
function install(app) {
|
|
82
82
|
const components = [
|
|
83
83
|
ActionSheet,
|
|
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
import { createVNode as _createVNode, mergeProps as _mergeProps, vShow as _vShow, withDirectives as _withDirectives } from "vue";
|
|
22
|
-
import { createNamespace, isDef,
|
|
22
|
+
import { createNamespace, isDef, isWeixin, makeArrayProp, makeNumberProp, makeStringProp, truthProp } from "../utils/index.mjs";
|
|
23
23
|
import { computed, defineComponent, ref } from "vue";
|
|
24
24
|
import { showFailToast, showLoadingToast, closeToast } from "../toast/index.mjs";
|
|
25
25
|
import DeleteIcon from "./image/DeleteIcon.mjs";
|
|
@@ -460,7 +460,7 @@ var stdin_default = defineComponent({
|
|
|
460
460
|
}
|
|
461
461
|
});
|
|
462
462
|
};
|
|
463
|
-
const handleInputFiles = (event) => {
|
|
463
|
+
const handleInputFiles = (event) => __async(this, null, function* () {
|
|
464
464
|
const _files = event.target.files;
|
|
465
465
|
if (!_files || _files.length === 0) {
|
|
466
466
|
return;
|
|
@@ -473,23 +473,25 @@ var stdin_default = defineComponent({
|
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
475
|
if (props.beforeRead) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
476
|
+
try {
|
|
477
|
+
const response = yield props.beforeRead(files);
|
|
478
|
+
if (!response) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (Array.isArray(response)) {
|
|
482
|
+
const data = response.filter((file) => !!file);
|
|
483
|
+
readFiles(data);
|
|
484
|
+
} else {
|
|
485
|
+
readFiles(files);
|
|
486
|
+
}
|
|
487
|
+
} catch (error) {
|
|
488
|
+
showFailToast(error == null ? void 0 : error.message);
|
|
488
489
|
return;
|
|
489
490
|
}
|
|
491
|
+
} else {
|
|
492
|
+
readFiles(files);
|
|
490
493
|
}
|
|
491
|
-
|
|
492
|
-
};
|
|
494
|
+
});
|
|
493
495
|
const hiddenInput = () => [_createVNode("input", {
|
|
494
496
|
"type": "file",
|
|
495
497
|
"accept": "image/*",
|
|
@@ -689,21 +691,15 @@ var stdin_default = defineComponent({
|
|
|
689
691
|
}, [media.label]);
|
|
690
692
|
}
|
|
691
693
|
};
|
|
692
|
-
const onDelete = (media, index) => {
|
|
694
|
+
const onDelete = (media, index) => __async(this, null, function* () {
|
|
693
695
|
if (props.beforeDelete) {
|
|
694
|
-
const response = props.beforeDelete(media);
|
|
696
|
+
const response = yield props.beforeDelete(media);
|
|
695
697
|
if (!response) {
|
|
696
698
|
return;
|
|
697
699
|
}
|
|
698
|
-
if (isPromise(response)) {
|
|
699
|
-
response.then(() => {
|
|
700
|
-
deleteMedia(media, index);
|
|
701
|
-
});
|
|
702
|
-
return;
|
|
703
|
-
}
|
|
704
700
|
}
|
|
705
701
|
deleteMedia(media, index);
|
|
706
|
-
};
|
|
702
|
+
});
|
|
707
703
|
const previewMedia = (index) => __async(this, null, function* () {
|
|
708
704
|
var _a;
|
|
709
705
|
if (props.preview && props.preview(props.mediaList, index)) {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -182,7 +182,7 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
|
|
|
182
182
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
|
183
183
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
|
184
184
|
__reExport(stdin_exports, require("./video"), module.exports);
|
|
185
|
-
const version = "3.1.
|
|
185
|
+
const version = "3.1.52";
|
|
186
186
|
function install(app) {
|
|
187
187
|
const components = [
|
|
188
188
|
import_action_sheet.ActionSheet,
|
|
@@ -492,7 +492,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
494
|
};
|
|
495
|
-
const handleInputFiles = (event) => {
|
|
495
|
+
const handleInputFiles = (event) => __async(this, null, function* () {
|
|
496
496
|
const _files = event.target.files;
|
|
497
497
|
if (!_files || _files.length === 0) {
|
|
498
498
|
return;
|
|
@@ -505,23 +505,25 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
507
|
if (props.beforeRead) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
508
|
+
try {
|
|
509
|
+
const response = yield props.beforeRead(files);
|
|
510
|
+
if (!response) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (Array.isArray(response)) {
|
|
514
|
+
const data = response.filter((file) => !!file);
|
|
515
|
+
readFiles(data);
|
|
516
|
+
} else {
|
|
517
|
+
readFiles(files);
|
|
518
|
+
}
|
|
519
|
+
} catch (error) {
|
|
520
|
+
(0, import_toast.showFailToast)(error == null ? void 0 : error.message);
|
|
520
521
|
return;
|
|
521
522
|
}
|
|
523
|
+
} else {
|
|
524
|
+
readFiles(files);
|
|
522
525
|
}
|
|
523
|
-
|
|
524
|
-
};
|
|
526
|
+
});
|
|
525
527
|
const hiddenInput = () => [(0, import_vue.createVNode)("input", {
|
|
526
528
|
"type": "file",
|
|
527
529
|
"accept": "image/*",
|
|
@@ -721,21 +723,15 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
721
723
|
}, [media.label]);
|
|
722
724
|
}
|
|
723
725
|
};
|
|
724
|
-
const onDelete = (media, index) => {
|
|
726
|
+
const onDelete = (media, index) => __async(this, null, function* () {
|
|
725
727
|
if (props.beforeDelete) {
|
|
726
|
-
const response = props.beforeDelete(media);
|
|
728
|
+
const response = yield props.beforeDelete(media);
|
|
727
729
|
if (!response) {
|
|
728
730
|
return;
|
|
729
731
|
}
|
|
730
|
-
if ((0, import_utils.isPromise)(response)) {
|
|
731
|
-
response.then(() => {
|
|
732
|
-
deleteMedia(media, index);
|
|
733
|
-
});
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
732
|
}
|
|
737
733
|
deleteMedia(media, index);
|
|
738
|
-
};
|
|
734
|
+
});
|
|
739
735
|
const previewMedia = (index) => __async(this, null, function* () {
|
|
740
736
|
var _a;
|
|
741
737
|
if (props.preview && props.preview(props.mediaList, index)) {
|