zartui 3.1.73 → 3.1.75

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.
@@ -35,7 +35,7 @@ export declare const imagePreviewProps: {
35
35
  default: true;
36
36
  };
37
37
  showDownload: BooleanConstructor;
38
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
38
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
39
39
  className: PropType<unknown>;
40
40
  closeIcon: {
41
41
  type: PropType<string>;
@@ -97,7 +97,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
97
97
  default: true;
98
98
  };
99
99
  showDownload: BooleanConstructor;
100
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
100
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
101
101
  className: PropType<unknown>;
102
102
  closeIcon: {
103
103
  type: PropType<string>;
@@ -157,7 +157,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
157
157
  default: true;
158
158
  };
159
159
  showDownload: BooleanConstructor;
160
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
160
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
161
161
  className: PropType<unknown>;
162
162
  closeIcon: {
163
163
  type: PropType<string>;
@@ -64,7 +64,6 @@ var stdin_default = defineComponent({
64
64
  slots
65
65
  }) {
66
66
  const swipeRef = ref();
67
- const hasDownloadSupport = ref(false);
68
67
  const state = reactive({
69
68
  active: 0,
70
69
  rootWidth: 0,
@@ -149,7 +148,7 @@ var stdin_default = defineComponent({
149
148
  });
150
149
  const renderIndex = () => {
151
150
  const image = props.images[state.active];
152
- const showDownload = props.showDownload && hasDownloadSupport.value && !image.url.startsWith("data:");
151
+ const showDownload = props.showDownload && !image.url.startsWith("data:");
153
152
  if (props.showIndex || showDownload) {
154
153
  if (props.showIndex && slots.index) {
155
154
  return _createVNode("div", {
@@ -232,20 +231,9 @@ var stdin_default = defineComponent({
232
231
  useExpose({
233
232
  swipeTo
234
233
  });
235
- onMounted(() => __async(this, null, function* () {
236
- var _a;
234
+ onMounted(() => {
237
235
  resize();
238
- try {
239
- const universalJsSdk = yield import("@egova/universal-js-sdk");
240
- if (universalJsSdk && universalJsSdk.getJSI) {
241
- const fileJsi = (_a = universalJsSdk.getJSI()) == null ? void 0 : _a.file;
242
- hasDownloadSupport.value = !!(fileJsi && fileJsi.download);
243
- }
244
- } catch (e) {
245
- console.warn("Failed to check download support:", e);
246
- hasDownloadSupport.value = false;
247
- }
248
- }));
236
+ });
249
237
  watch([windowWidth, windowHeight], resize);
250
238
  watch(() => props.startPosition, (value) => setActive(+value));
251
239
  watch(() => props.show, (value) => {
@@ -27,7 +27,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
27
27
  default: true;
28
28
  };
29
29
  showDownload: BooleanConstructor;
30
- downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean | void>;
30
+ downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean>;
31
31
  className: import("vue").PropType<unknown>;
32
32
  closeIcon: {
33
33
  type: import("vue").PropType<string>;
@@ -87,7 +87,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
87
87
  default: true;
88
88
  };
89
89
  showDownload: BooleanConstructor;
90
- downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean | void>;
90
+ downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean>;
91
91
  className: import("vue").PropType<unknown>;
92
92
  closeIcon: {
93
93
  type: import("vue").PropType<string>;
@@ -2,7 +2,7 @@ import type { CSSProperties, TeleportProps, ComponentPublicInstance } from 'vue'
2
2
  import type { Interceptor } from '../utils';
3
3
  import type { SwipeToOptions } from '../swipe';
4
4
  import type { PopupCloseIconPosition } from '../popup';
5
- import type { ImagePreviewProps } from './ImagePreview';
5
+ import type { DownloadActionParams, ImagePreviewProps } from './ImagePreview';
6
6
  export type ImageItem = {
7
7
  url: string;
8
8
  title?: string;
@@ -17,6 +17,7 @@ export type ImagePreviewOptions = {
17
17
  showIndex?: boolean;
18
18
  closeable?: boolean;
19
19
  showDownload?: boolean;
20
+ downloadAction?: (params: DownloadActionParams) => boolean;
20
21
  closeIcon?: string;
21
22
  transition?: string;
22
23
  beforeClose?: Interceptor;
package/es/index.d.ts CHANGED
@@ -84,4 +84,4 @@ declare namespace _default {
84
84
  }
85
85
  export default _default;
86
86
  export function install(app: any): void;
87
- export const version: "3.1.73";
87
+ export const version: "3.1.75";
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.73";
80
+ const version = "3.1.75";
81
81
  function install(app) {
82
82
  const components = [
83
83
  ActionSheet,
@@ -1,6 +1,7 @@
1
1
  import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
2
2
  import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from './type';
3
3
  import { MediaPlayerProps } from '../media-player';
4
+ import { DownloadActionParams } from '../image-preview/ImagePreview';
4
5
  declare const mediaPickerProps: {
5
6
  sortable: {
6
7
  type: BooleanConstructor;
@@ -9,6 +10,7 @@ declare const mediaPickerProps: {
9
10
  disabled: BooleanConstructor;
10
11
  showTitle: BooleanConstructor;
11
12
  showDownload: BooleanConstructor;
13
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
12
14
  useFileNameAsLabel: BooleanConstructor;
13
15
  title: {
14
16
  type: PropType<string>;
@@ -97,6 +99,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
97
99
  disabled: BooleanConstructor;
98
100
  showTitle: BooleanConstructor;
99
101
  showDownload: BooleanConstructor;
102
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
100
103
  useFileNameAsLabel: BooleanConstructor;
101
104
  title: {
102
105
  type: PropType<string>;
@@ -180,6 +183,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
180
183
  disabled: BooleanConstructor;
181
184
  showTitle: BooleanConstructor;
182
185
  showDownload: BooleanConstructor;
186
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
183
187
  useFileNameAsLabel: BooleanConstructor;
184
188
  title: {
185
189
  type: PropType<string>;
@@ -55,6 +55,7 @@ const mediaPickerProps = {
55
55
  disabled: Boolean,
56
56
  showTitle: Boolean,
57
57
  showDownload: Boolean,
58
+ downloadAction: Function,
58
59
  useFileNameAsLabel: Boolean,
59
60
  title: makeStringProp("\u6DFB\u52A0\u9644\u4EF6"),
60
61
  mediaList: makeArrayProp(),
@@ -746,6 +747,7 @@ var stdin_default = defineComponent({
746
747
  url: image.url || image.showSrc || ""
747
748
  })),
748
749
  showDownload: props.showDownload,
750
+ downloadAction: props.downloadAction,
749
751
  startPosition: imageIndex,
750
752
  closeable: true
751
753
  });
@@ -6,6 +6,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
6
6
  disabled: BooleanConstructor;
7
7
  showTitle: BooleanConstructor;
8
8
  showDownload: BooleanConstructor;
9
+ downloadAction: import("vue").PropType<(params: import("../image-preview/ImagePreview").DownloadActionParams) => boolean>;
9
10
  useFileNameAsLabel: BooleanConstructor;
10
11
  title: {
11
12
  type: import("vue").PropType<string>;
@@ -79,6 +80,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
79
80
  disabled: BooleanConstructor;
80
81
  showTitle: BooleanConstructor;
81
82
  showDownload: BooleanConstructor;
83
+ downloadAction: import("vue").PropType<(params: import("../image-preview/ImagePreview").DownloadActionParams) => boolean>;
82
84
  useFileNameAsLabel: BooleanConstructor;
83
85
  title: {
84
86
  type: import("vue").PropType<string>;
@@ -35,7 +35,7 @@ export declare const imagePreviewProps: {
35
35
  default: true;
36
36
  };
37
37
  showDownload: BooleanConstructor;
38
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
38
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
39
39
  className: PropType<unknown>;
40
40
  closeIcon: {
41
41
  type: PropType<string>;
@@ -97,7 +97,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
97
97
  default: true;
98
98
  };
99
99
  showDownload: BooleanConstructor;
100
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
100
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
101
101
  className: PropType<unknown>;
102
102
  closeIcon: {
103
103
  type: PropType<string>;
@@ -157,7 +157,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
157
157
  default: true;
158
158
  };
159
159
  showDownload: BooleanConstructor;
160
- downloadAction: PropType<(params: DownloadActionParams) => boolean | void>;
160
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
161
161
  className: PropType<unknown>;
162
162
  closeIcon: {
163
163
  type: PropType<string>;
@@ -97,7 +97,6 @@ var stdin_default = (0, import_vue.defineComponent)({
97
97
  slots
98
98
  }) {
99
99
  const swipeRef = (0, import_vue.ref)();
100
- const hasDownloadSupport = (0, import_vue.ref)(false);
101
100
  const state = (0, import_vue.reactive)({
102
101
  active: 0,
103
102
  rootWidth: 0,
@@ -182,7 +181,7 @@ var stdin_default = (0, import_vue.defineComponent)({
182
181
  });
183
182
  const renderIndex = () => {
184
183
  const image = props.images[state.active];
185
- const showDownload = props.showDownload && hasDownloadSupport.value && !image.url.startsWith("data:");
184
+ const showDownload = props.showDownload && !image.url.startsWith("data:");
186
185
  if (props.showIndex || showDownload) {
187
186
  if (props.showIndex && slots.index) {
188
187
  return (0, import_vue.createVNode)("div", {
@@ -265,20 +264,9 @@ var stdin_default = (0, import_vue.defineComponent)({
265
264
  (0, import_use_expose.useExpose)({
266
265
  swipeTo
267
266
  });
268
- (0, import_vue.onMounted)(() => __async(this, null, function* () {
269
- var _a;
267
+ (0, import_vue.onMounted)(() => {
270
268
  resize();
271
- try {
272
- const universalJsSdk = yield import("@egova/universal-js-sdk");
273
- if (universalJsSdk && universalJsSdk.getJSI) {
274
- const fileJsi = (_a = universalJsSdk.getJSI()) == null ? void 0 : _a.file;
275
- hasDownloadSupport.value = !!(fileJsi && fileJsi.download);
276
- }
277
- } catch (e) {
278
- console.warn("Failed to check download support:", e);
279
- hasDownloadSupport.value = false;
280
- }
281
- }));
269
+ });
282
270
  (0, import_vue.watch)([import_utils.windowWidth, import_utils.windowHeight], resize);
283
271
  (0, import_vue.watch)(() => props.startPosition, (value) => setActive(+value));
284
272
  (0, import_vue.watch)(() => props.show, (value) => {
@@ -27,7 +27,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
27
27
  default: true;
28
28
  };
29
29
  showDownload: BooleanConstructor;
30
- downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean | void>;
30
+ downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean>;
31
31
  className: import("vue").PropType<unknown>;
32
32
  closeIcon: {
33
33
  type: import("vue").PropType<string>;
@@ -87,7 +87,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
87
87
  default: true;
88
88
  };
89
89
  showDownload: BooleanConstructor;
90
- downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean | void>;
90
+ downloadAction: import("vue").PropType<(params: import("./ImagePreview").DownloadActionParams) => boolean>;
91
91
  className: import("vue").PropType<unknown>;
92
92
  closeIcon: {
93
93
  type: import("vue").PropType<string>;
@@ -2,7 +2,7 @@ import type { CSSProperties, TeleportProps, ComponentPublicInstance } from 'vue'
2
2
  import type { Interceptor } from '../utils';
3
3
  import type { SwipeToOptions } from '../swipe';
4
4
  import type { PopupCloseIconPosition } from '../popup';
5
- import type { ImagePreviewProps } from './ImagePreview';
5
+ import type { DownloadActionParams, ImagePreviewProps } from './ImagePreview';
6
6
  export type ImageItem = {
7
7
  url: string;
8
8
  title?: string;
@@ -17,6 +17,7 @@ export type ImagePreviewOptions = {
17
17
  showIndex?: boolean;
18
18
  closeable?: boolean;
19
19
  showDownload?: boolean;
20
+ downloadAction?: (params: DownloadActionParams) => boolean;
20
21
  closeIcon?: string;
21
22
  transition?: string;
22
23
  beforeClose?: Interceptor;
package/lib/index.d.ts CHANGED
@@ -84,4 +84,4 @@ declare namespace _default {
84
84
  }
85
85
  export default _default;
86
86
  export function install(app: any): void;
87
- export const version: "3.1.73";
87
+ export const version: "3.1.75";
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.73";
185
+ const version = "3.1.75";
186
186
  function install(app) {
187
187
  const components = [
188
188
  import_action_sheet.ActionSheet,
@@ -1,6 +1,7 @@
1
1
  import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
2
2
  import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from './type';
3
3
  import { MediaPlayerProps } from '../media-player';
4
+ import { DownloadActionParams } from '../image-preview/ImagePreview';
4
5
  declare const mediaPickerProps: {
5
6
  sortable: {
6
7
  type: BooleanConstructor;
@@ -9,6 +10,7 @@ declare const mediaPickerProps: {
9
10
  disabled: BooleanConstructor;
10
11
  showTitle: BooleanConstructor;
11
12
  showDownload: BooleanConstructor;
13
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
12
14
  useFileNameAsLabel: BooleanConstructor;
13
15
  title: {
14
16
  type: PropType<string>;
@@ -97,6 +99,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
97
99
  disabled: BooleanConstructor;
98
100
  showTitle: BooleanConstructor;
99
101
  showDownload: BooleanConstructor;
102
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
100
103
  useFileNameAsLabel: BooleanConstructor;
101
104
  title: {
102
105
  type: PropType<string>;
@@ -180,6 +183,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
180
183
  disabled: BooleanConstructor;
181
184
  showTitle: BooleanConstructor;
182
185
  showDownload: BooleanConstructor;
186
+ downloadAction: PropType<(params: DownloadActionParams) => boolean>;
183
187
  useFileNameAsLabel: BooleanConstructor;
184
188
  title: {
185
189
  type: PropType<string>;
@@ -87,6 +87,7 @@ const mediaPickerProps = {
87
87
  disabled: Boolean,
88
88
  showTitle: Boolean,
89
89
  showDownload: Boolean,
90
+ downloadAction: Function,
90
91
  useFileNameAsLabel: Boolean,
91
92
  title: (0, import_utils.makeStringProp)("\u6DFB\u52A0\u9644\u4EF6"),
92
93
  mediaList: (0, import_utils.makeArrayProp)(),
@@ -778,6 +779,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
778
779
  url: image.url || image.showSrc || ""
779
780
  })),
780
781
  showDownload: props.showDownload,
782
+ downloadAction: props.downloadAction,
781
783
  startPosition: imageIndex,
782
784
  closeable: true
783
785
  });
@@ -6,6 +6,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
6
6
  disabled: BooleanConstructor;
7
7
  showTitle: BooleanConstructor;
8
8
  showDownload: BooleanConstructor;
9
+ downloadAction: import("vue").PropType<(params: import("../image-preview/ImagePreview").DownloadActionParams) => boolean>;
9
10
  useFileNameAsLabel: BooleanConstructor;
10
11
  title: {
11
12
  type: import("vue").PropType<string>;
@@ -79,6 +80,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
79
80
  disabled: BooleanConstructor;
80
81
  showTitle: BooleanConstructor;
81
82
  showDownload: BooleanConstructor;
83
+ downloadAction: import("vue").PropType<(params: import("../image-preview/ImagePreview").DownloadActionParams) => boolean>;
82
84
  useFileNameAsLabel: BooleanConstructor;
83
85
  title: {
84
86
  type: import("vue").PropType<string>;