zartui 3.1.38 → 3.1.40
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.d.ts +5 -2
- package/es/media-picker/MediaPicker.mjs +10 -6
- package/es/media-picker/index.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/MediaPicker.d.ts +5 -2
- package/lib/media-picker/MediaPicker.js +10 -6
- package/lib/media-picker/index.d.ts +1 -1
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +10 -7
- package/lib/zartui.es.js +10 -7
- package/lib/zartui.js +10 -7
- package/lib/zartui.min.js +1 -1
- package/package.json +7 -7
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -76,7 +76,7 @@ import { Timeline } from "./timeline/index.mjs";
|
|
|
76
76
|
import { Toast } from "./toast/index.mjs";
|
|
77
77
|
import { Uploader } from "./uploader/index.mjs";
|
|
78
78
|
import { Video } from "./video/index.mjs";
|
|
79
|
-
const version = "3.1.
|
|
79
|
+
const version = "3.1.40";
|
|
80
80
|
function install(app) {
|
|
81
81
|
const components = [
|
|
82
82
|
ActionSheet,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { Media, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType } from './type';
|
|
1
|
+
import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from './type';
|
|
3
3
|
import { MediaPlayerProps } from '../media-player';
|
|
4
4
|
declare const mediaPickerProps: {
|
|
5
5
|
disabled: BooleanConstructor;
|
|
@@ -81,6 +81,9 @@ declare const mediaPickerProps: {
|
|
|
81
81
|
mediaPlayerProps: PropType<Partial<MediaPlayerProps>>;
|
|
82
82
|
};
|
|
83
83
|
export type MediaPickerProps = ExtractPropTypes<typeof mediaPickerProps>;
|
|
84
|
+
export type MediaPickerInstance = ComponentPublicInstance<{
|
|
85
|
+
mediaPickAction: (mediaType: MediaType, mediaAddType: MediaAddType) => void;
|
|
86
|
+
}>;
|
|
84
87
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
85
88
|
disabled: BooleanConstructor;
|
|
86
89
|
showTitle: BooleanConstructor;
|
|
@@ -43,6 +43,7 @@ import { showImagePreview } from "../image-preview/index.mjs";
|
|
|
43
43
|
import { ImageProcessor, checkWatermarkConfigSupported, CompressOptions, ResizeOptions } from "@egova-mobile/app-media-utils";
|
|
44
44
|
import { isEmptyValue } from "../field/utils.mjs";
|
|
45
45
|
import { wxUploadImage } from "./util/wx-util.mjs";
|
|
46
|
+
import { useExpose } from "../composables/use-expose.mjs";
|
|
46
47
|
const [name, bem] = createNamespace("media-picker");
|
|
47
48
|
const FILE_SIZE_LIMIT = 100;
|
|
48
49
|
const mediaPickerProps = {
|
|
@@ -141,7 +142,7 @@ var stdin_default = defineComponent({
|
|
|
141
142
|
const triggerHiddenInput = (ref2) => {
|
|
142
143
|
ref2 && ref2.click();
|
|
143
144
|
};
|
|
144
|
-
const
|
|
145
|
+
const mediaPickAction = (mediaType, mediaAddType) => {
|
|
145
146
|
if (props.disabled) {
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
@@ -217,24 +218,24 @@ var stdin_default = defineComponent({
|
|
|
217
218
|
return [{
|
|
218
219
|
name: "\u62CD\u6444",
|
|
219
220
|
callback: () => {
|
|
220
|
-
|
|
221
|
+
mediaPickAction("video", "take");
|
|
221
222
|
}
|
|
222
223
|
}, {
|
|
223
224
|
name: "\u89C6\u9891\u6587\u4EF6",
|
|
224
225
|
callback: () => {
|
|
225
|
-
|
|
226
|
+
mediaPickAction("video", "pick");
|
|
226
227
|
}
|
|
227
228
|
}];
|
|
228
229
|
} else if (audioOptionsVisible.value) {
|
|
229
230
|
return [{
|
|
230
231
|
name: "\u5F55\u97F3",
|
|
231
232
|
callback: () => {
|
|
232
|
-
|
|
233
|
+
mediaPickAction("audio", "take");
|
|
233
234
|
}
|
|
234
235
|
}, {
|
|
235
236
|
name: "\u97F3\u9891\u6587\u4EF6",
|
|
236
237
|
callback: () => {
|
|
237
|
-
|
|
238
|
+
mediaPickAction("audio", "pick");
|
|
238
239
|
}
|
|
239
240
|
}];
|
|
240
241
|
}
|
|
@@ -576,7 +577,7 @@ var stdin_default = defineComponent({
|
|
|
576
577
|
"class": bem("box")
|
|
577
578
|
}, [_createVNode("div", {
|
|
578
579
|
"class": bem("button"),
|
|
579
|
-
"onClick": () =>
|
|
580
|
+
"onClick": () => mediaPickAction(mediaType, mediaAddType)
|
|
580
581
|
}, [renderIcon(mediaType, mediaAddType)]), _createVNode("div", {
|
|
581
582
|
"class": bem("label")
|
|
582
583
|
}, [label])]);
|
|
@@ -772,6 +773,9 @@ var stdin_default = defineComponent({
|
|
|
772
773
|
actionVisible.value = false;
|
|
773
774
|
action.func && action.func();
|
|
774
775
|
};
|
|
776
|
+
useExpose({
|
|
777
|
+
mediaPickAction
|
|
778
|
+
});
|
|
775
779
|
return () => {
|
|
776
780
|
const title = props.showTitle && _createVNode("div", {
|
|
777
781
|
"class": bem("title")
|
|
@@ -162,7 +162,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
|
|
|
162
162
|
imageSizeType: import("./type").MediaSizeType;
|
|
163
163
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
164
164
|
export default MediaPicker;
|
|
165
|
-
export type { MediaPickerProps } from './MediaPicker';
|
|
165
|
+
export type { MediaPickerProps, MediaPickerInstance } from './MediaPicker';
|
|
166
166
|
export type { Media, MediaType, MediaAddType, MediaUploadStatus, MediaPreview, MediaPick, MediaBeforeRead, MediaAfterRead, MediaBeforeDelete, MediaPickerThemeVars, MediaSizeType, } from './type';
|
|
167
167
|
export { defaultMedia } from './type';
|
|
168
168
|
declare module 'vue' {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -180,7 +180,7 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
|
|
|
180
180
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
|
181
181
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
|
182
182
|
__reExport(stdin_exports, require("./video"), module.exports);
|
|
183
|
-
const version = "3.1.
|
|
183
|
+
const version = "3.1.40";
|
|
184
184
|
function install(app) {
|
|
185
185
|
const components = [
|
|
186
186
|
import_action_sheet.ActionSheet,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { Media, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType } from './type';
|
|
1
|
+
import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from './type';
|
|
3
3
|
import { MediaPlayerProps } from '../media-player';
|
|
4
4
|
declare const mediaPickerProps: {
|
|
5
5
|
disabled: BooleanConstructor;
|
|
@@ -81,6 +81,9 @@ declare const mediaPickerProps: {
|
|
|
81
81
|
mediaPlayerProps: PropType<Partial<MediaPlayerProps>>;
|
|
82
82
|
};
|
|
83
83
|
export type MediaPickerProps = ExtractPropTypes<typeof mediaPickerProps>;
|
|
84
|
+
export type MediaPickerInstance = ComponentPublicInstance<{
|
|
85
|
+
mediaPickAction: (mediaType: MediaType, mediaAddType: MediaAddType) => void;
|
|
86
|
+
}>;
|
|
84
87
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
85
88
|
disabled: BooleanConstructor;
|
|
86
89
|
showTitle: BooleanConstructor;
|
|
@@ -75,6 +75,7 @@ var import_image_preview = require("../image-preview");
|
|
|
75
75
|
var import_app_media_utils = require("@egova-mobile/app-media-utils");
|
|
76
76
|
var import_utils2 = require("../field/utils");
|
|
77
77
|
var import_wx_util = require("./util/wx-util");
|
|
78
|
+
var import_use_expose = require("../composables/use-expose");
|
|
78
79
|
const [name, bem] = (0, import_utils.createNamespace)("media-picker");
|
|
79
80
|
const FILE_SIZE_LIMIT = 100;
|
|
80
81
|
const mediaPickerProps = {
|
|
@@ -173,7 +174,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
173
174
|
const triggerHiddenInput = (ref2) => {
|
|
174
175
|
ref2 && ref2.click();
|
|
175
176
|
};
|
|
176
|
-
const
|
|
177
|
+
const mediaPickAction = (mediaType, mediaAddType) => {
|
|
177
178
|
if (props.disabled) {
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
@@ -249,24 +250,24 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
249
250
|
return [{
|
|
250
251
|
name: "\u62CD\u6444",
|
|
251
252
|
callback: () => {
|
|
252
|
-
|
|
253
|
+
mediaPickAction("video", "take");
|
|
253
254
|
}
|
|
254
255
|
}, {
|
|
255
256
|
name: "\u89C6\u9891\u6587\u4EF6",
|
|
256
257
|
callback: () => {
|
|
257
|
-
|
|
258
|
+
mediaPickAction("video", "pick");
|
|
258
259
|
}
|
|
259
260
|
}];
|
|
260
261
|
} else if (audioOptionsVisible.value) {
|
|
261
262
|
return [{
|
|
262
263
|
name: "\u5F55\u97F3",
|
|
263
264
|
callback: () => {
|
|
264
|
-
|
|
265
|
+
mediaPickAction("audio", "take");
|
|
265
266
|
}
|
|
266
267
|
}, {
|
|
267
268
|
name: "\u97F3\u9891\u6587\u4EF6",
|
|
268
269
|
callback: () => {
|
|
269
|
-
|
|
270
|
+
mediaPickAction("audio", "pick");
|
|
270
271
|
}
|
|
271
272
|
}];
|
|
272
273
|
}
|
|
@@ -608,7 +609,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
608
609
|
"class": bem("box")
|
|
609
610
|
}, [(0, import_vue.createVNode)("div", {
|
|
610
611
|
"class": bem("button"),
|
|
611
|
-
"onClick": () =>
|
|
612
|
+
"onClick": () => mediaPickAction(mediaType, mediaAddType)
|
|
612
613
|
}, [renderIcon(mediaType, mediaAddType)]), (0, import_vue.createVNode)("div", {
|
|
613
614
|
"class": bem("label")
|
|
614
615
|
}, [label])]);
|
|
@@ -804,6 +805,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
804
805
|
actionVisible.value = false;
|
|
805
806
|
action.func && action.func();
|
|
806
807
|
};
|
|
808
|
+
(0, import_use_expose.useExpose)({
|
|
809
|
+
mediaPickAction
|
|
810
|
+
});
|
|
807
811
|
return () => {
|
|
808
812
|
const title = props.showTitle && (0, import_vue.createVNode)("div", {
|
|
809
813
|
"class": bem("title")
|
|
@@ -162,7 +162,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
|
|
|
162
162
|
imageSizeType: import("./type").MediaSizeType;
|
|
163
163
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
164
164
|
export default MediaPicker;
|
|
165
|
-
export type { MediaPickerProps } from './MediaPicker';
|
|
165
|
+
export type { MediaPickerProps, MediaPickerInstance } from './MediaPicker';
|
|
166
166
|
export type { Media, MediaType, MediaAddType, MediaUploadStatus, MediaPreview, MediaPick, MediaBeforeRead, MediaAfterRead, MediaBeforeDelete, MediaPickerThemeVars, MediaSizeType, } from './type';
|
|
167
167
|
export { defaultMedia } from './type';
|
|
168
168
|
declare module 'vue' {
|