zartui 3.1.89 → 3.1.90
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 +2 -1
- package/es/index.mjs +4 -1
- package/es/media-picker/MediaPicker.d.ts +1 -14
- package/es/media-picker/MediaPicker.mjs +8 -78
- package/es/media-picker/index.css +1 -1
- package/es/media-picker/index.d.ts +1 -10
- package/es/media-picker/type.d.ts +0 -10
- package/es/pagination/Pagination.mjs +3 -1
- package/es/pagination/index.css +1 -1
- package/es/photo-picker/PhotoPicker.d.ts +202 -0
- package/es/photo-picker/PhotoPicker.mjs +510 -0
- package/es/photo-picker/index.css +1 -0
- package/es/photo-picker/index.d.ts +145 -0
- package/es/photo-picker/index.mjs +10 -0
- package/es/photo-picker/style/index.d.ts +1 -0
- package/es/photo-picker/style/index.mjs +15 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/media-picker/MediaPicker.d.ts +1 -14
- package/lib/media-picker/MediaPicker.js +7 -77
- package/lib/media-picker/index.css +1 -1
- package/lib/media-picker/index.d.ts +1 -10
- package/lib/media-picker/type.d.ts +0 -10
- package/lib/pagination/Pagination.js +3 -1
- package/lib/pagination/index.css +1 -1
- package/lib/photo-picker/PhotoPicker.d.ts +202 -0
- package/lib/photo-picker/PhotoPicker.js +539 -0
- package/lib/photo-picker/index.css +1 -0
- package/lib/photo-picker/index.d.ts +145 -0
- package/lib/photo-picker/index.js +39 -0
- package/lib/photo-picker/style/index.d.ts +1 -0
- package/lib/photo-picker/style/index.js +15 -0
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +1394 -966
- package/lib/zartui.es.js +1394 -966
- package/lib/zartui.js +1400 -972
- package/lib/zartui.min.js +2 -2
- package/package.json +3 -3
package/es/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from "./number-keyboard";
|
|
|
45
45
|
export * from "./overlay";
|
|
46
46
|
export * from "./pagination";
|
|
47
47
|
export * from "./password-input";
|
|
48
|
+
export * from "./photo-picker";
|
|
48
49
|
export * from "./picker";
|
|
49
50
|
export * from "./popover";
|
|
50
51
|
export * from "./popup";
|
|
@@ -85,4 +86,4 @@ declare namespace _default {
|
|
|
85
86
|
}
|
|
86
87
|
export default _default;
|
|
87
88
|
export function install(app: any): void;
|
|
88
|
-
export const version: "3.1.
|
|
89
|
+
export const version: "3.1.90";
|
package/es/index.mjs
CHANGED
|
@@ -44,6 +44,7 @@ import { NumberKeyboard } from "./number-keyboard/index.mjs";
|
|
|
44
44
|
import { Overlay } from "./overlay/index.mjs";
|
|
45
45
|
import { Pagination } from "./pagination/index.mjs";
|
|
46
46
|
import { PasswordInput } from "./password-input/index.mjs";
|
|
47
|
+
import { PhotoPicker } from "./photo-picker/index.mjs";
|
|
47
48
|
import { Picker } from "./picker/index.mjs";
|
|
48
49
|
import { Popover } from "./popover/index.mjs";
|
|
49
50
|
import { Popup } from "./popup/index.mjs";
|
|
@@ -78,7 +79,7 @@ import { Timeline } from "./timeline/index.mjs";
|
|
|
78
79
|
import { Toast } from "./toast/index.mjs";
|
|
79
80
|
import { Uploader } from "./uploader/index.mjs";
|
|
80
81
|
import { Video } from "./video/index.mjs";
|
|
81
|
-
const version = "3.1.
|
|
82
|
+
const version = "3.1.90";
|
|
82
83
|
function install(app) {
|
|
83
84
|
const components = [
|
|
84
85
|
ActionSheet,
|
|
@@ -127,6 +128,7 @@ function install(app) {
|
|
|
127
128
|
Overlay,
|
|
128
129
|
Pagination,
|
|
129
130
|
PasswordInput,
|
|
131
|
+
PhotoPicker,
|
|
130
132
|
Picker,
|
|
131
133
|
Popover,
|
|
132
134
|
Popup,
|
|
@@ -217,6 +219,7 @@ export * from "./number-keyboard/index.mjs";
|
|
|
217
219
|
export * from "./overlay/index.mjs";
|
|
218
220
|
export * from "./pagination/index.mjs";
|
|
219
221
|
export * from "./password-input/index.mjs";
|
|
222
|
+
export * from "./photo-picker/index.mjs";
|
|
220
223
|
export * from "./picker/index.mjs";
|
|
221
224
|
export * from "./popover/index.mjs";
|
|
222
225
|
export * from "./popup/index.mjs";
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick,
|
|
2
|
+
import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from './type';
|
|
3
3
|
import { MediaPlayerProps } from '../media-player';
|
|
4
4
|
import { DownloadActionParams } from '../image-preview/ImagePreview';
|
|
5
5
|
declare const mediaPickerProps: {
|
|
6
|
-
variant: {
|
|
7
|
-
type: PropType<MediaPickerVariant>;
|
|
8
|
-
default: MediaPickerVariant;
|
|
9
|
-
};
|
|
10
6
|
sortable: {
|
|
11
7
|
type: BooleanConstructor;
|
|
12
8
|
default: boolean;
|
|
@@ -100,10 +96,6 @@ export type MediaPickerInstance = ComponentPublicInstance<{
|
|
|
100
96
|
mediaPickAction: (mediaType: MediaType, mediaAddType: MediaAddType) => void;
|
|
101
97
|
}>;
|
|
102
98
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
103
|
-
variant: {
|
|
104
|
-
type: PropType<MediaPickerVariant>;
|
|
105
|
-
default: MediaPickerVariant;
|
|
106
|
-
};
|
|
107
99
|
sortable: {
|
|
108
100
|
type: BooleanConstructor;
|
|
109
101
|
default: boolean;
|
|
@@ -192,10 +184,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
192
184
|
};
|
|
193
185
|
mediaPlayerProps: PropType<Partial<MediaPlayerProps>>;
|
|
194
186
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "processing" | "update:mediaList")[], "delete" | "processing" | "update:mediaList", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
195
|
-
variant: {
|
|
196
|
-
type: PropType<MediaPickerVariant>;
|
|
197
|
-
default: MediaPickerVariant;
|
|
198
|
-
};
|
|
199
187
|
sortable: {
|
|
200
188
|
type: BooleanConstructor;
|
|
201
189
|
default: boolean;
|
|
@@ -292,7 +280,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
292
280
|
disabled: boolean;
|
|
293
281
|
showTitle: boolean;
|
|
294
282
|
showDownload: boolean;
|
|
295
|
-
variant: MediaPickerVariant;
|
|
296
283
|
sortable: boolean;
|
|
297
284
|
useFileNameAsLabel: boolean;
|
|
298
285
|
mediaList: Media[];
|
|
@@ -18,7 +18,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import { createVNode as _createVNode,
|
|
21
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps, vShow as _vShow, withDirectives as _withDirectives } from "vue";
|
|
22
22
|
import { createNamespace, isDef, isWeixin, makeArrayProp, makeNumberProp, makeStringProp, truthProp } from "../utils/index.mjs";
|
|
23
23
|
import { computed, defineComponent, nextTick, onBeforeUnmount, ref, watch } from "vue";
|
|
24
24
|
import { showFailToast, showLoadingToast, closeToast } from "../toast/index.mjs";
|
|
@@ -60,7 +60,6 @@ const COMPATIBLE_TYPE_MAPPINGS = {
|
|
|
60
60
|
"m4a": /* @__PURE__ */ new Set(["mp4", "mp4a", "x-m4a"])
|
|
61
61
|
};
|
|
62
62
|
const mediaPickerProps = {
|
|
63
|
-
variant: makeStringProp("default"),
|
|
64
63
|
sortable: {
|
|
65
64
|
type: Boolean,
|
|
66
65
|
default: false
|
|
@@ -149,10 +148,7 @@ var stdin_default = defineComponent({
|
|
|
149
148
|
const gridRef = ref();
|
|
150
149
|
const mediaListPlaceholder = ref([]);
|
|
151
150
|
const sort = ref();
|
|
152
|
-
const
|
|
153
|
-
const attachmentMediaList = computed(() => props.mediaList.filter((media) => media.type === "photo"));
|
|
154
|
-
const attachmentMediaListPlaceholder = computed(() => mediaListPlaceholder.value.filter((media) => media.type === "photo"));
|
|
155
|
-
const shouldIsolateSortableTouch = () => !isAttachmentVariant.value && props.sortable && props.mediaList.length > 0;
|
|
151
|
+
const shouldIsolateSortableTouch = () => props.sortable && props.mediaList.length > 0;
|
|
156
152
|
const stopSortableTouchStartPropagation = (event) => {
|
|
157
153
|
if (!shouldIsolateSortableTouch()) {
|
|
158
154
|
return;
|
|
@@ -168,7 +164,7 @@ var stdin_default = defineComponent({
|
|
|
168
164
|
};
|
|
169
165
|
const initSortable = () => __async(this, null, function* () {
|
|
170
166
|
var _a;
|
|
171
|
-
if (sort.value ||
|
|
167
|
+
if (sort.value || !props.sortable || !props.mediaList.length)
|
|
172
168
|
return;
|
|
173
169
|
yield nextTick();
|
|
174
170
|
const gridEl = (_a = gridRef.value) == null ? void 0 : _a.$el;
|
|
@@ -748,40 +744,6 @@ var stdin_default = defineComponent({
|
|
|
748
744
|
}
|
|
749
745
|
return buttons;
|
|
750
746
|
};
|
|
751
|
-
const renderAttachmentAdd = () => {
|
|
752
|
-
const canTakePhoto = props.allowTakePhoto;
|
|
753
|
-
const canPickPhoto = props.allowPickPhoto;
|
|
754
|
-
if (!canTakePhoto && !canPickPhoto) {
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
if (props.allowTakePhoto && props.allowPickPhoto) {
|
|
758
|
-
return _createVNode("button", {
|
|
759
|
-
"type": "button",
|
|
760
|
-
"class": bem("attachment-add"),
|
|
761
|
-
"disabled": props.disabled,
|
|
762
|
-
"onClick": () => {
|
|
763
|
-
if (props.disabled) {
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
actionVisible.value = true;
|
|
767
|
-
photoOptionsVisible.value = true;
|
|
768
|
-
videoOptionsVisible.value = false;
|
|
769
|
-
audioOptionsVisible.value = false;
|
|
770
|
-
}
|
|
771
|
-
}, [_createVNode("span", {
|
|
772
|
-
"class": bem("attachment-add-icon")
|
|
773
|
-
}, [_createTextVNode("+")])]);
|
|
774
|
-
}
|
|
775
|
-
const addType = canTakePhoto ? "take" : "pick";
|
|
776
|
-
return _createVNode("button", {
|
|
777
|
-
"type": "button",
|
|
778
|
-
"class": bem("attachment-add"),
|
|
779
|
-
"disabled": props.disabled,
|
|
780
|
-
"onClick": () => mediaPickAction("photo", addType)
|
|
781
|
-
}, [_createVNode("span", {
|
|
782
|
-
"class": bem("attachment-add-icon")
|
|
783
|
-
}, [_createTextVNode("+")])]);
|
|
784
|
-
};
|
|
785
747
|
const genThumbnailMask = (media) => {
|
|
786
748
|
const {
|
|
787
749
|
status,
|
|
@@ -948,36 +910,6 @@ var stdin_default = defineComponent({
|
|
|
948
910
|
default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
|
|
949
911
|
});
|
|
950
912
|
});
|
|
951
|
-
const renderAttachmentDelete = (media, index) => {
|
|
952
|
-
if (!media.deletable || media.status === "uploading") {
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
|
-
return _createVNode("button", {
|
|
956
|
-
"type": "button",
|
|
957
|
-
"class": bem("attachment-delete"),
|
|
958
|
-
"onClick": (event) => {
|
|
959
|
-
event.stopPropagation();
|
|
960
|
-
onDelete(media, index);
|
|
961
|
-
}
|
|
962
|
-
}, [_createTextVNode("\xD7")]);
|
|
963
|
-
};
|
|
964
|
-
const renderAttachmentMedia = (media) => {
|
|
965
|
-
const index = props.mediaList.indexOf(media);
|
|
966
|
-
return _createVNode("div", {
|
|
967
|
-
"key": media.uniqueCode,
|
|
968
|
-
"class": bem("attachment-item"),
|
|
969
|
-
"onClick": () => previewMedia(index)
|
|
970
|
-
}, [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), renderAttachmentDelete(media, index)]);
|
|
971
|
-
};
|
|
972
|
-
const renderAttachmentPlaceholder = (media) => _createVNode("div", {
|
|
973
|
-
"key": media.uniqueCode || media.fileName,
|
|
974
|
-
"class": bem("attachment-item")
|
|
975
|
-
}, [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media)]);
|
|
976
|
-
const renderAttachment = () => _createVNode("div", {
|
|
977
|
-
"class": bem("attachment")
|
|
978
|
-
}, [_createVNode("div", {
|
|
979
|
-
"class": bem("attachment-track")
|
|
980
|
-
}, [attachmentMediaList.value.map(renderAttachmentMedia), attachmentMediaListPlaceholder.value.map(renderAttachmentPlaceholder), renderAttachmentAdd()])]);
|
|
981
913
|
const selectAction = (action) => {
|
|
982
914
|
actionVisible.value = false;
|
|
983
915
|
photoOptionsVisible.value = false;
|
|
@@ -985,8 +917,8 @@ var stdin_default = defineComponent({
|
|
|
985
917
|
audioOptionsVisible.value = false;
|
|
986
918
|
action.func && action.func();
|
|
987
919
|
};
|
|
988
|
-
watch(() => [props.sortable, props.mediaList.length
|
|
989
|
-
if (
|
|
920
|
+
watch(() => [props.sortable, props.mediaList.length], (_0) => __async(this, [_0], function* ([sortable, mediaCount]) {
|
|
921
|
+
if (!sortable || !mediaCount) {
|
|
990
922
|
destroySortable();
|
|
991
923
|
return;
|
|
992
924
|
}
|
|
@@ -1010,9 +942,7 @@ var stdin_default = defineComponent({
|
|
|
1010
942
|
}, [props.title]);
|
|
1011
943
|
const showButtons = props.allowTakePhoto || props.allowPickPhoto || props.allowTakeVideo || props.allowPickVideo || props.allowTakeAudio || props.allowPickAudio || props.allowPickFile;
|
|
1012
944
|
return _createVNode("div", {
|
|
1013
|
-
"class": bem(
|
|
1014
|
-
attachment: isAttachmentVariant.value
|
|
1015
|
-
})
|
|
945
|
+
"class": bem()
|
|
1016
946
|
}, [title, hiddenInput(), _createVNode(ZtMediaPlayer, _mergeProps({
|
|
1017
947
|
"show": mediaPlayerVisible.value,
|
|
1018
948
|
"onUpdate:show": ($event) => mediaPlayerVisible.value = $event,
|
|
@@ -1028,7 +958,7 @@ var stdin_default = defineComponent({
|
|
|
1028
958
|
"teleport": "body",
|
|
1029
959
|
"close-on-click-action": true,
|
|
1030
960
|
"onSelect": selectAction
|
|
1031
|
-
}, null),
|
|
961
|
+
}, null), _withDirectives(_createVNode("div", {
|
|
1032
962
|
"class": bem("line")
|
|
1033
963
|
}, [renderButtons(), slots["extend"] ? slots.extend() : ""]), [[_vShow, showButtons]]), _withDirectives(_createVNode(ZtGrid, {
|
|
1034
964
|
"ref": gridRef,
|
|
@@ -1048,7 +978,7 @@ var stdin_default = defineComponent({
|
|
|
1048
978
|
"class": bem("grid")
|
|
1049
979
|
}, {
|
|
1050
980
|
default: () => [renderMediaListPlaceholder()]
|
|
1051
|
-
}), [[_vShow, mediaListPlaceholder.value.length]])])
|
|
981
|
+
}), [[_vShow, mediaListPlaceholder.value.length]])]);
|
|
1052
982
|
};
|
|
1053
983
|
}
|
|
1054
984
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-media-picker-image-color: var(--zt-text-color);--zt-media-picker-button-background: linear-gradient(135deg, #e6ebf0 0%, #fff 100%, #fff 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 var(--zt-white), 4px 4px 8px 0 var(--zt-gray-a1);--zt-media-picker-button-border: 0;--zt-media-picker-button-active-border: 1px solid rgba(255, 255, 255, .75);--zt-media-picker-button-active-box-shadow: inset 4px 4px 8px 0 var(--zt-gray-a2);--zt-media-picker-line-height: 46px;--zt-media-picker-box-size: 48px;--zt-media-picker-icon-size: 32px;--zt-media-picker-title-height: 44px;--zt-media-picker-thumbnail-label-background: rgba(var(--zt-gray-rgb), .5);--zt-media-picker-thumbnail-label-color: var(--zt-white)
|
|
1
|
+
:root{--zt-media-picker-image-color: var(--zt-text-color);--zt-media-picker-button-background: linear-gradient(135deg, #e6ebf0 0%, #fff 100%, #fff 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 var(--zt-white), 4px 4px 8px 0 var(--zt-gray-a1);--zt-media-picker-button-border: 0;--zt-media-picker-button-active-border: 1px solid rgba(255, 255, 255, .75);--zt-media-picker-button-active-box-shadow: inset 4px 4px 8px 0 var(--zt-gray-a2);--zt-media-picker-line-height: 46px;--zt-media-picker-box-size: 48px;--zt-media-picker-icon-size: 32px;--zt-media-picker-title-height: 44px;--zt-media-picker-thumbnail-label-background: rgba(var(--zt-gray-rgb), .5);--zt-media-picker-thumbnail-label-color: var(--zt-white)}:root[zt-theme-size=large]{--zt-media-picker-line-height: 52px;--zt-media-picker-box-size: 54px;--zt-media-picker-icon-size: 38px;--zt-media-picker-title-height: 56px}.zt-media-picker__hidden{display:none}.zt-media-picker__title{position:relative;height:var(--zt-media-picker-title-height);line-height:var(--zt-media-picker-title-height);font-weight:700;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);padding:0 16px}.zt-media-picker__title:before{position:absolute;width:4px;height:16px;background:var(--zt-primary-color);left:0;top:14px;content:" "}.zt-media-picker__title:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-media-picker__line{width:100%;height:calc(var(--zt-media-picker-line-height) * 2);display:flex;align-items:center;overflow-x:auto}.zt-media-picker__line::-webkit-scrollbar{width:0;height:0}.zt-media-picker__line:after{content:" ";min-width:16px;height:10px}.zt-media-picker__box{width:var(--zt-media-picker-box-size);display:flex;flex-direction:column;align-items:center}.zt-media-picker__box:first-child{margin-left:16px}.zt-media-picker__box:not(:last-child){margin-right:24px}.zt-media-picker__button{display:flex;align-items:center;justify-content:center;width:var(--zt-media-picker-box-size);height:var(--zt-media-picker-box-size);background:var(--zt-media-picker-button-background);box-shadow:var(--zt-media-picker-button-box-shadow);border:var(--zt-media-picker-button-border);border-radius:8px;box-sizing:border-box}.zt-media-picker__button:active{background:var(--zt-gray-a04);border:var(--zt-media-picker-button-active-border);box-shadow:var(--zt-media-picker-button-active-box-shadow)}.zt-media-picker__icon{width:var(--zt-media-picker-icon-size);height:var(--zt-media-picker-icon-size);color:var(--zt-media-picker-image-color)}.zt-media-picker__label{margin-top:8px;font-size:var(--zt-font-size-sm);color:var(--zt-gray-a8);letter-spacing:0;text-align:center;line-height:var(--zt-line-height-sm);-webkit-user-select:none;-moz-user-select:none;user-select:none}.zt-media-picker__grid{padding:0 16px 8px!important}.zt-media-picker__delete{box-sizing:content-box;width:20px;height:20px;position:absolute;padding:4px;top:0;right:0}.zt-media-picker .zt-image{width:100%;height:100%}.zt-media-picker .zt-grid-item__content{padding:0}.zt-media-picker__thumbnail{width:100%;height:100%}.zt-media-picker__thumbnail-label{position:absolute;bottom:0;left:0;box-sizing:border-box;width:100%;height:var(--zt-line-height-lg);line-height:var(--zt-line-height-lg);padding:0 var(--zt-padding-xs);overflow:hidden;text-align:center;border-radius:0 0 4px 4px;font-size:var(--zt-font-size-sm);text-overflow:ellipsis;word-break:break-all;white-space:nowrap;color:var(--zt-media-picker-thumbnail-label-color);background-color:var(--zt-media-picker-thumbnail-label-background)}.zt-media-picker__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--zt-white);background-color:var(--zt-uploader-mask-background);border-radius:4px}.zt-media-picker__mask-icon{font-size:var(--zt-font-size-xxxl)}.zt-media-picker__mask-message{margin-top:6px;padding:0 var(--zt-padding-base);font-size:var(--zt-font-size-sm);line-height:var(--zt-uploader-mask-message-line-height)}.zt-media-picker__loading{width:var(--zt-uploader-loading-icon-size);height:var(--zt-uploader-loading-icon-size);color:var(--zt-uploader-icon-color)}.zt-theme-dark{--zt-media-picker-button-background: linear-gradient(135deg, #111c29 0%, #1d2c3e 100%, #1c2a3c 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 rgba(255, 255, 255, .08), 4px 4px 8px 0 rgba(0, 12, 24, .8);--zt-media-picker-button-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-box-shadow: inset 6px 6px 6px 0 #000d1b}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export declare const MediaPicker: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
-
variant: {
|
|
3
|
-
type: import("vue").PropType<import("./type").MediaPickerVariant>;
|
|
4
|
-
default: import("./type").MediaPickerVariant;
|
|
5
|
-
};
|
|
6
2
|
sortable: {
|
|
7
3
|
type: BooleanConstructor;
|
|
8
4
|
default: boolean;
|
|
@@ -81,10 +77,6 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
|
|
|
81
77
|
};
|
|
82
78
|
mediaPlayerProps: import("vue").PropType<Partial<import("..").MediaPlayerProps>>;
|
|
83
79
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "processing" | "update:mediaList")[], "delete" | "processing" | "update:mediaList", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
84
|
-
variant: {
|
|
85
|
-
type: import("vue").PropType<import("./type").MediaPickerVariant>;
|
|
86
|
-
default: import("./type").MediaPickerVariant;
|
|
87
|
-
};
|
|
88
80
|
sortable: {
|
|
89
81
|
type: BooleanConstructor;
|
|
90
82
|
default: boolean;
|
|
@@ -171,7 +163,6 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
|
|
|
171
163
|
disabled: boolean;
|
|
172
164
|
showTitle: boolean;
|
|
173
165
|
showDownload: boolean;
|
|
174
|
-
variant: import("./type").MediaPickerVariant;
|
|
175
166
|
sortable: boolean;
|
|
176
167
|
useFileNameAsLabel: boolean;
|
|
177
168
|
mediaList: import("./type").Media[];
|
|
@@ -196,7 +187,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
|
|
|
196
187
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
197
188
|
export default MediaPicker;
|
|
198
189
|
export type { MediaPickerProps, MediaPickerInstance } from './MediaPicker';
|
|
199
|
-
export type { Media, MediaType, MediaAddType, MediaUploadStatus, MediaPreview, MediaPick, MediaBeforeRead, MediaAfterRead, MediaBeforeDelete, MediaPickerThemeVars,
|
|
190
|
+
export type { Media, MediaType, MediaAddType, MediaUploadStatus, MediaPreview, MediaPick, MediaBeforeRead, MediaAfterRead, MediaBeforeDelete, MediaPickerThemeVars, MediaSizeType, } from './type';
|
|
200
191
|
export { defaultMedia } from './type';
|
|
201
192
|
declare module 'vue' {
|
|
202
193
|
interface GlobalComponents {
|
|
@@ -3,7 +3,6 @@ export type MediaAddType = 'take' | 'pick' | 'take_and_pick';
|
|
|
3
3
|
export type MediaUploadStatus = 'processing' | 'uploading' | 'done' | 'failed';
|
|
4
4
|
export type WxMediaType = 'camera' | 'album';
|
|
5
5
|
export type MediaSizeType = 'original' | 'compressed';
|
|
6
|
-
export type MediaPickerVariant = 'default' | 'attachment';
|
|
7
6
|
export type Media = {
|
|
8
7
|
file?: File;
|
|
9
8
|
url?: string;
|
|
@@ -49,13 +48,4 @@ export type MediaPickerThemeVars = {
|
|
|
49
48
|
mediaPickerBoxSize?: string;
|
|
50
49
|
mediaPickerIconSize?: string;
|
|
51
50
|
mediaPickerTitleHeight?: string;
|
|
52
|
-
mediaPickerAttachmentPadding?: string;
|
|
53
|
-
mediaPickerAttachmentGap?: string;
|
|
54
|
-
mediaPickerAttachmentItemSize?: string;
|
|
55
|
-
mediaPickerAttachmentRadius?: string;
|
|
56
|
-
mediaPickerAttachmentAddBorder?: string;
|
|
57
|
-
mediaPickerAttachmentAddColor?: string;
|
|
58
|
-
mediaPickerAttachmentAddBackground?: string;
|
|
59
|
-
mediaPickerAttachmentDeleteBackground?: string;
|
|
60
|
-
mediaPickerAttachmentDeleteColor?: string;
|
|
61
51
|
};
|
|
@@ -99,7 +99,9 @@ var stdin_default = defineComponent({
|
|
|
99
99
|
"class": bem("popup-pages")
|
|
100
100
|
}, [pages.value.map((page) => _createVNode("button", {
|
|
101
101
|
"type": "button",
|
|
102
|
-
"class": bem("popup-page"
|
|
102
|
+
"class": bem("popup-page", {
|
|
103
|
+
active: page === currentPage.value
|
|
104
|
+
}),
|
|
103
105
|
"onClick": () => onSelect(page)
|
|
104
106
|
}, [page]))]), _createVNode("div", {
|
|
105
107
|
"class": bem("popup-footer")
|
package/es/pagination/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-pagination-bottom: 29px;--zt-pagination-item-size: 44px;--zt-pagination-gap: 16px;--zt-pagination-background: #2d4b7380;--zt-pagination-backdrop-filter: blur(5.44px);--zt-pagination-box-shadow: 0 4px 8px 0 #2d4b7333;--zt-pagination-text-color: #fff;--zt-pagination-disabled-icon-color: rgba(255, 255, 255, .45);--zt-pagination-font-size: 14px;--zt-pagination-text-line-height: 17px;--zt-pagination-z-index: 100}.zt-pagination{position:fixed;left:0;right:0;bottom:var(--zt-pagination-bottom);z-index:var(--zt-pagination-z-index);display:flex;align-items:center;justify-content:center;pointer-events:none}.zt-pagination__button,.zt-pagination__page{height:var(--zt-pagination-item-size);background:var(--zt-pagination-background);-webkit-backdrop-filter:var(--zt-pagination-backdrop-filter);backdrop-filter:var(--zt-pagination-backdrop-filter);box-shadow:var(--zt-pagination-box-shadow)}.zt-pagination__button{width:var(--zt-pagination-item-size);padding:0;border:0;border-radius:50%;color:var(--zt-pagination-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;transition:opacity var(--zt-duration-fast),transform var(--zt-duration-fast)}.zt-pagination__button:not(.zt-pagination__button--disabled):hover{opacity:.88;transform:scale(1.04)}.zt-pagination__button:not(.zt-pagination__button--disabled):active{opacity:.75;transform:scale(.96)}.zt-pagination__button--disabled{color:var(--zt-pagination-disabled-icon-color);cursor:default}.zt-pagination__page{margin:0 var(--zt-pagination-gap);padding:0 27px;border:0;border-radius:22px;display:flex;align-items:center;justify-content:center;color:var(--zt-pagination-text-color);cursor:pointer;pointer-events:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.zt-pagination__text{height:var(--zt-pagination-text-line-height);color:var(--zt-pagination-text-color);font-size:var(--zt-pagination-font-size);line-height:var(--zt-pagination-text-line-height)}.zt-pagination__next-icon{transform:rotate(180deg)}.zt-pagination__popup{height:100%;display:flex;flex-direction:column;background:#fff}.zt-pagination__popup-title{padding-top:var(--zt-popup-close-icon-margin);color:#2d4b73;font-size:18px;font-weight:600;text-align:center}.zt-pagination__popup-pages{flex:1;display:grid;grid-template-columns:repeat(5,40px);grid-auto-rows:40px;justify-content:space-around;row-gap:24px;padding:24px 0;overflow-y:auto}.zt-pagination__popup-page{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:#235;background:#F1F6FA;font-size:16px;line-height:24px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:background-color var(--zt-duration-fast),transform var(--zt-duration-fast),opacity var(--zt-duration-fast)}.zt-pagination__popup-page:hover{background:rgba(45,75,115,.1);transform:scale(1.04)}.zt-pagination__popup-page:active{opacity:.75;transform:scale(.96)}.zt-pagination__popup-footer{padding:8px 16px;border-top:1px solid var(--zt-border-color)}
|
|
1
|
+
:root{--zt-pagination-bottom: 29px;--zt-pagination-item-size: 44px;--zt-pagination-gap: 16px;--zt-pagination-background: #2d4b7380;--zt-pagination-backdrop-filter: blur(5.44px);--zt-pagination-box-shadow: 0 4px 8px 0 #2d4b7333;--zt-pagination-text-color: #fff;--zt-pagination-disabled-icon-color: rgba(255, 255, 255, .45);--zt-pagination-font-size: 14px;--zt-pagination-text-line-height: 17px;--zt-pagination-z-index: 100}.zt-pagination{position:fixed;left:0;right:0;bottom:var(--zt-pagination-bottom);z-index:var(--zt-pagination-z-index);display:flex;align-items:center;justify-content:center;pointer-events:none}.zt-pagination__button,.zt-pagination__page{height:var(--zt-pagination-item-size);background:var(--zt-pagination-background);-webkit-backdrop-filter:var(--zt-pagination-backdrop-filter);backdrop-filter:var(--zt-pagination-backdrop-filter);box-shadow:var(--zt-pagination-box-shadow)}.zt-pagination__button{width:var(--zt-pagination-item-size);padding:0;border:0;border-radius:50%;color:var(--zt-pagination-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;transition:opacity var(--zt-duration-fast),transform var(--zt-duration-fast)}.zt-pagination__button:not(.zt-pagination__button--disabled):hover{opacity:.88;transform:scale(1.04)}.zt-pagination__button:not(.zt-pagination__button--disabled):active{opacity:.75;transform:scale(.96)}.zt-pagination__button--disabled{color:var(--zt-pagination-disabled-icon-color);cursor:default}.zt-pagination__page{margin:0 var(--zt-pagination-gap);padding:0 27px;border:0;border-radius:22px;display:flex;align-items:center;justify-content:center;color:var(--zt-pagination-text-color);cursor:pointer;pointer-events:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.zt-pagination__text{height:var(--zt-pagination-text-line-height);color:var(--zt-pagination-text-color);font-size:var(--zt-pagination-font-size);line-height:var(--zt-pagination-text-line-height)}.zt-pagination__next-icon{transform:rotate(180deg)}.zt-pagination__popup{height:100%;display:flex;flex-direction:column;background:#fff}.zt-pagination__popup-title{padding-top:var(--zt-popup-close-icon-margin);color:#2d4b73;font-size:18px;font-weight:600;text-align:center}.zt-pagination__popup-pages{flex:1;display:grid;grid-template-columns:repeat(5,40px);grid-auto-rows:40px;justify-content:space-around;row-gap:24px;padding:24px 0;overflow-y:auto}.zt-pagination__popup-page{width:40px;height:40px;padding:0;border:0;border-radius:50%;color:#235;background:#F1F6FA;font-size:16px;line-height:24px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:background-color var(--zt-duration-fast),color var(--zt-duration-fast),transform var(--zt-duration-fast),opacity var(--zt-duration-fast)}.zt-pagination__popup-page:not(.zt-pagination__popup-page--active):hover{background:rgba(45,75,115,.1);transform:scale(1.04)}.zt-pagination__popup-page:active{opacity:.75;transform:scale(.96)}.zt-pagination__popup-page--active{color:#fff;background:#3388FF}.zt-pagination__popup-page--active:hover{color:#fff;background:#3388FF;transform:scale(1.04)}.zt-pagination__popup-footer{padding:8px 16px;border-top:1px solid var(--zt-border-color)}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { Media, MediaAddType, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPick, MediaPreview, MediaSizeType, MediaType } from '../media-picker/type';
|
|
3
|
+
import { DownloadActionParams } from '../image-preview/ImagePreview';
|
|
4
|
+
declare const photoPickerProps: {
|
|
5
|
+
disabled: BooleanConstructor;
|
|
6
|
+
showTitle: BooleanConstructor;
|
|
7
|
+
showDownload: BooleanConstructor;
|
|
8
|
+
downloadAction: PropType<(params: DownloadActionParams) => boolean>;
|
|
9
|
+
useFileNameAsLabel: BooleanConstructor;
|
|
10
|
+
title: {
|
|
11
|
+
type: PropType<string>;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
mediaList: {
|
|
15
|
+
type: PropType<Media[]>;
|
|
16
|
+
default: () => Media[];
|
|
17
|
+
};
|
|
18
|
+
attachmentHeight: PropType<string | number>;
|
|
19
|
+
maxAttachmentCount: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
maxImageSideLength: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
maxImageFileSize: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
maxFileSize: {
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
keepFileType: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
watermarkOptions: {
|
|
40
|
+
type: ObjectConstructor;
|
|
41
|
+
default: () => null;
|
|
42
|
+
};
|
|
43
|
+
allowTakePhoto: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: true;
|
|
46
|
+
};
|
|
47
|
+
allowPickPhoto: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: true;
|
|
50
|
+
};
|
|
51
|
+
preview: PropType<MediaPreview>;
|
|
52
|
+
mediaPick: PropType<MediaPick>;
|
|
53
|
+
beforeRead: PropType<MediaBeforeRead>;
|
|
54
|
+
afterRead: PropType<MediaAfterRead>;
|
|
55
|
+
beforeDelete: PropType<MediaBeforeDelete>;
|
|
56
|
+
useWx: BooleanConstructor;
|
|
57
|
+
imageSizeType: {
|
|
58
|
+
type: PropType<MediaSizeType>;
|
|
59
|
+
default: MediaSizeType;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type PhotoPickerProps = ExtractPropTypes<typeof photoPickerProps>;
|
|
63
|
+
export type PhotoPickerInstance = ComponentPublicInstance<{
|
|
64
|
+
mediaPickAction: (mediaType: MediaType, mediaAddType: MediaAddType) => void;
|
|
65
|
+
}>;
|
|
66
|
+
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
67
|
+
disabled: BooleanConstructor;
|
|
68
|
+
showTitle: BooleanConstructor;
|
|
69
|
+
showDownload: BooleanConstructor;
|
|
70
|
+
downloadAction: PropType<(params: DownloadActionParams) => boolean>;
|
|
71
|
+
useFileNameAsLabel: BooleanConstructor;
|
|
72
|
+
title: {
|
|
73
|
+
type: PropType<string>;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
76
|
+
mediaList: {
|
|
77
|
+
type: PropType<Media[]>;
|
|
78
|
+
default: () => Media[];
|
|
79
|
+
};
|
|
80
|
+
attachmentHeight: PropType<string | number>;
|
|
81
|
+
maxAttachmentCount: {
|
|
82
|
+
type: NumberConstructor;
|
|
83
|
+
default: number;
|
|
84
|
+
};
|
|
85
|
+
maxImageSideLength: {
|
|
86
|
+
type: NumberConstructor;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
maxImageFileSize: {
|
|
90
|
+
type: NumberConstructor;
|
|
91
|
+
default: number;
|
|
92
|
+
};
|
|
93
|
+
maxFileSize: {
|
|
94
|
+
type: NumberConstructor;
|
|
95
|
+
default: number;
|
|
96
|
+
};
|
|
97
|
+
keepFileType: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
101
|
+
watermarkOptions: {
|
|
102
|
+
type: ObjectConstructor;
|
|
103
|
+
default: () => null;
|
|
104
|
+
};
|
|
105
|
+
allowTakePhoto: {
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
default: true;
|
|
108
|
+
};
|
|
109
|
+
allowPickPhoto: {
|
|
110
|
+
type: BooleanConstructor;
|
|
111
|
+
default: true;
|
|
112
|
+
};
|
|
113
|
+
preview: PropType<MediaPreview>;
|
|
114
|
+
mediaPick: PropType<MediaPick>;
|
|
115
|
+
beforeRead: PropType<MediaBeforeRead>;
|
|
116
|
+
afterRead: PropType<MediaAfterRead>;
|
|
117
|
+
beforeDelete: PropType<MediaBeforeDelete>;
|
|
118
|
+
useWx: BooleanConstructor;
|
|
119
|
+
imageSizeType: {
|
|
120
|
+
type: PropType<MediaSizeType>;
|
|
121
|
+
default: MediaSizeType;
|
|
122
|
+
};
|
|
123
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "processing" | "update:mediaList")[], "delete" | "processing" | "update:mediaList", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
124
|
+
disabled: BooleanConstructor;
|
|
125
|
+
showTitle: BooleanConstructor;
|
|
126
|
+
showDownload: BooleanConstructor;
|
|
127
|
+
downloadAction: PropType<(params: DownloadActionParams) => boolean>;
|
|
128
|
+
useFileNameAsLabel: BooleanConstructor;
|
|
129
|
+
title: {
|
|
130
|
+
type: PropType<string>;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
mediaList: {
|
|
134
|
+
type: PropType<Media[]>;
|
|
135
|
+
default: () => Media[];
|
|
136
|
+
};
|
|
137
|
+
attachmentHeight: PropType<string | number>;
|
|
138
|
+
maxAttachmentCount: {
|
|
139
|
+
type: NumberConstructor;
|
|
140
|
+
default: number;
|
|
141
|
+
};
|
|
142
|
+
maxImageSideLength: {
|
|
143
|
+
type: NumberConstructor;
|
|
144
|
+
default: number;
|
|
145
|
+
};
|
|
146
|
+
maxImageFileSize: {
|
|
147
|
+
type: NumberConstructor;
|
|
148
|
+
default: number;
|
|
149
|
+
};
|
|
150
|
+
maxFileSize: {
|
|
151
|
+
type: NumberConstructor;
|
|
152
|
+
default: number;
|
|
153
|
+
};
|
|
154
|
+
keepFileType: {
|
|
155
|
+
type: BooleanConstructor;
|
|
156
|
+
default: boolean;
|
|
157
|
+
};
|
|
158
|
+
watermarkOptions: {
|
|
159
|
+
type: ObjectConstructor;
|
|
160
|
+
default: () => null;
|
|
161
|
+
};
|
|
162
|
+
allowTakePhoto: {
|
|
163
|
+
type: BooleanConstructor;
|
|
164
|
+
default: true;
|
|
165
|
+
};
|
|
166
|
+
allowPickPhoto: {
|
|
167
|
+
type: BooleanConstructor;
|
|
168
|
+
default: true;
|
|
169
|
+
};
|
|
170
|
+
preview: PropType<MediaPreview>;
|
|
171
|
+
mediaPick: PropType<MediaPick>;
|
|
172
|
+
beforeRead: PropType<MediaBeforeRead>;
|
|
173
|
+
afterRead: PropType<MediaAfterRead>;
|
|
174
|
+
beforeDelete: PropType<MediaBeforeDelete>;
|
|
175
|
+
useWx: BooleanConstructor;
|
|
176
|
+
imageSizeType: {
|
|
177
|
+
type: PropType<MediaSizeType>;
|
|
178
|
+
default: MediaSizeType;
|
|
179
|
+
};
|
|
180
|
+
}>> & Readonly<{
|
|
181
|
+
onDelete?: ((...args: any[]) => any) | undefined;
|
|
182
|
+
onProcessing?: ((...args: any[]) => any) | undefined;
|
|
183
|
+
"onUpdate:mediaList"?: ((...args: any[]) => any) | undefined;
|
|
184
|
+
}>, {
|
|
185
|
+
title: string;
|
|
186
|
+
disabled: boolean;
|
|
187
|
+
showTitle: boolean;
|
|
188
|
+
showDownload: boolean;
|
|
189
|
+
useFileNameAsLabel: boolean;
|
|
190
|
+
mediaList: Media[];
|
|
191
|
+
maxImageSideLength: number;
|
|
192
|
+
maxImageFileSize: number;
|
|
193
|
+
maxFileSize: number;
|
|
194
|
+
keepFileType: boolean;
|
|
195
|
+
watermarkOptions: Record<string, any>;
|
|
196
|
+
allowTakePhoto: boolean;
|
|
197
|
+
allowPickPhoto: boolean;
|
|
198
|
+
useWx: boolean;
|
|
199
|
+
imageSizeType: MediaSizeType;
|
|
200
|
+
maxAttachmentCount: number;
|
|
201
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
202
|
+
export default _default;
|