maz-ui 4.7.5 → 4.7.6
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/dist/chunks/MazAccordion.CKnz73h4.js +1 -0
- package/dist/chunks/MazAlert.B8hE7wet.js +1 -0
- package/dist/chunks/MazAnimatedCounter.GLLYbZAz.js +1 -0
- package/dist/chunks/MazAnimatedElement._8NY8WgC.js +1 -0
- package/dist/chunks/MazAnimatedText.BSZ8FNf-.js +1 -0
- package/dist/chunks/MazAvatar.vO5VNPi8.js +1 -0
- package/dist/chunks/MazBackdrop.Cjbwi8-V.js +1 -0
- package/dist/chunks/MazBadge.BBZJgHXm.js +1 -0
- package/dist/chunks/MazBottomSheet.WgZ6qobx.js +1 -0
- package/dist/chunks/MazBtn.Cc9C1v2l.js +1 -0
- package/dist/chunks/MazBtnGroup.3B1XcqWM.js +1 -0
- package/dist/chunks/MazCard.YYC0LaHY.js +1 -0
- package/dist/chunks/MazCardSpotlight.SpZF61hl.js +1 -0
- package/dist/chunks/MazCarousel.1NT4jcvR.js +1 -0
- package/dist/chunks/MazChart.CDZ2PBTC.js +1 -0
- package/dist/chunks/MazCheckbox.DurIbKdf.js +1 -0
- package/dist/chunks/MazChecklist.D9ezwGpQ.js +1 -0
- package/dist/chunks/MazCircularProgressBar.rATx_hD9.js +1 -0
- package/dist/chunks/MazContainer.zXcfMOs-.js +1 -0
- package/dist/chunks/MazDatePicker.KUP34cbV.js +1 -0
- package/dist/chunks/MazDialog.CtKF3Xzo.js +1 -0
- package/dist/chunks/MazDialogConfirm.CAAHeBPE.js +1 -0
- package/dist/chunks/MazDrawer.Dc_RGG8a.js +1 -0
- package/dist/chunks/MazDropdown.2DUcivzO.js +1 -0
- package/dist/chunks/MazDropzone.CiWiPcFM.js +1 -0
- package/dist/chunks/MazExpandAnimation.CMMwtuQA.js +1 -0
- package/dist/chunks/MazFullscreenLoader.BIVRcZJ8.js +1 -0
- package/dist/chunks/MazGallery.CEmGy0K9.js +1 -0
- package/dist/chunks/MazIcon.ZWAk25ZX.js +1 -0
- package/dist/chunks/MazInput.DJjWLaKg.js +1 -0
- package/dist/chunks/MazInputCode.DKnl3i-X.js +1 -0
- package/dist/chunks/MazInputNumber.B42Mn-9h.js +1 -0
- package/dist/chunks/MazInputPhoneNumber.CLivThtK.js +1 -0
- package/dist/chunks/MazInputPrice.BeL-M944.js +1 -0
- package/dist/chunks/MazInputTags.CIVT9F6Q.js +1 -0
- package/dist/chunks/MazLazyImg.-EMwandx.js +1 -0
- package/dist/chunks/MazLink.BOpxMATj.js +1 -0
- package/dist/chunks/MazLoadingBar.C86AX2Tk.js +1 -0
- package/dist/chunks/MazPagination.CNNKXBsg.js +1 -0
- package/dist/chunks/MazPickerCalendarDays.CSZZbk5Z.js +1 -0
- package/dist/chunks/MazPickerCalendarGrid.DrUHBH6-.js +1 -0
- package/dist/chunks/MazPickerContainer.BZ74M74V.js +1 -0
- package/dist/chunks/MazPopover.Co8BEopX.js +1 -0
- package/dist/chunks/MazPullToRefresh.DMtb6Oa3.js +1 -0
- package/dist/chunks/MazRadio.75ipjTw2.js +1 -0
- package/dist/chunks/MazRadioButtons.DenHCgB3.js +1 -0
- package/dist/chunks/MazReadMore.CDXacQIw.js +1 -0
- package/dist/chunks/MazReadingProgressBar.828Y0mxA.js +1 -0
- package/dist/chunks/MazSelect.yYFAbBb5.js +1 -0
- package/dist/chunks/MazSelectCountry.DvVgk2es.js +1 -0
- package/dist/chunks/MazSkeleton.BewTYJC2.js +1 -0
- package/dist/chunks/MazSlider.BS5QHWK6.js +1 -0
- package/dist/chunks/MazSpinner.D3NN2pow.js +1 -0
- package/dist/chunks/MazStepper.DTu8HG9T.js +1 -0
- package/dist/chunks/MazSwitch.Dvmj-rTW.js +1 -0
- package/dist/chunks/MazTable.DnOehvN6.js +1 -0
- package/dist/chunks/MazTableCell.xbm2NGWL.js +1 -0
- package/dist/chunks/MazTableRow.B5dJiXk1.js +1 -0
- package/dist/chunks/MazTableTitle.DNA_1mCy.js +1 -0
- package/dist/chunks/MazTabs.-0-YP3QQ.js +1 -0
- package/dist/chunks/MazTabsBar.D2JVKMS7.js +1 -0
- package/dist/chunks/MazTabsContent.C9omK25X.js +1 -0
- package/dist/chunks/MazTabsContentItem.mJEAS5R8.js +1 -0
- package/dist/chunks/MazTextarea.BliEP5G5.js +1 -0
- package/dist/chunks/MazUiProvider.BgN8V0lD.js +1 -0
- package/dist/chunks/_plugin-vue_export-helper.ChmETRGw.js +1 -0
- package/dist/chunks/dialog.DexeIC3K.js +1 -0
- package/dist/chunks/dom-events.BPrKJiCz.js +1 -0
- package/dist/chunks/resolveLinkComponent.DAc3sqGH.js +1 -0
- package/dist/chunks/toast.UQ8RRuT9.js +1 -0
- package/dist/chunks/types.DDbvTVqf.js +1 -0
- package/dist/chunks/useMazInputPhoneNumber.B_qQ0ldP.js +1 -0
- package/dist/chunks/utils.B8bfGQxN.js +1 -0
- package/dist/chunks/vFullscreenImg.CZeRh3mw.js +1 -0
- package/dist/chunks/vLazyImg.CXmd3Lp0.js +1 -0
- package/dist/chunks/vZoomImg.CaAHb98S.js +124 -0
- package/dist/components/MazAccordion.js +1 -86
- package/dist/components/MazAlert.js +1 -85
- package/dist/components/MazAnimatedCounter.js +1 -73
- package/dist/components/MazAnimatedElement.js +1 -44
- package/dist/components/MazAnimatedText.js +1 -103
- package/dist/components/MazAvatar.js +1 -125
- package/dist/components/MazBackdrop.js +1 -163
- package/dist/components/MazBadge.js +1 -29
- package/dist/components/MazBottomSheet.js +1 -55
- package/dist/components/MazBtn.js +1 -109
- package/dist/components/MazBtnGroup.js +1 -44
- package/dist/components/MazCard.js +1 -184
- package/dist/components/MazCardSpotlight.js +1 -81
- package/dist/components/MazCarousel.js +1 -104
- package/dist/components/MazChart.js +1 -4
- package/dist/components/MazCheckbox.js +1 -128
- package/dist/components/MazChecklist.js +1 -133
- package/dist/components/MazCircularProgressBar.js +1 -131
- package/dist/components/MazContainer.js +1 -71
- package/dist/components/MazDatePicker/MazPickerCalendar.js +1 -113
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.js +1 -19
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -181
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -75
- package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -90
- package/dist/components/MazDatePicker/MazPickerContainer.js +1 -116
- package/dist/components/MazDatePicker/MazPickerHeader.js +1 -126
- package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -82
- package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -55
- package/dist/components/MazDatePicker/MazPickerTime.js +1 -178
- package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -95
- package/dist/components/MazDatePicker.js +1 -466
- package/dist/components/MazDatePicker.vue.d.ts +2 -6
- package/dist/components/MazDialog.js +1 -115
- package/dist/components/MazDialog.vue.d.ts +2 -6
- package/dist/components/MazDialogConfirm.js +1 -6
- package/dist/components/MazDialogConfirm.vue.d.ts +2 -6
- package/dist/components/MazDrawer.js +1 -70
- package/dist/components/MazDropdown.js +1 -277
- package/dist/components/MazDropdown.vue.d.ts +2 -6
- package/dist/components/MazDropzone.js +1 -533
- package/dist/components/MazExpandAnimation.js +1 -46
- package/dist/components/MazFullscreenLoader.js +1 -38
- package/dist/components/MazGallery.js +1 -105
- package/dist/components/MazIcon.js +1 -114
- package/dist/components/MazInput.js +1 -256
- package/dist/components/MazInputCode.js +1 -152
- package/dist/components/MazInputNumber.js +1 -152
- package/dist/components/MazInputPhoneNumber/PhoneInput.js +1 -114
- package/dist/components/MazInputPhoneNumber.js +1 -253
- package/dist/components/MazInputPrice.js +1 -4
- package/dist/components/MazInputTags.js +1 -145
- package/dist/components/MazLazyImg.js +1 -62
- package/dist/components/MazLink.js +1 -80
- package/dist/components/MazLoadingBar.js +1 -24
- package/dist/components/MazPagination.js +1 -184
- package/dist/components/MazPopover.js +1 -326
- package/dist/components/MazPullToRefresh.js +1 -145
- package/dist/components/MazRadio.js +1 -103
- package/dist/components/MazRadioButtons.js +1 -135
- package/dist/components/MazReadMore.js +1 -110
- package/dist/components/MazReadingProgressBar.js +1 -68
- package/dist/components/MazSelect.js +1 -413
- package/dist/components/MazSelectCountry.js +1 -192
- package/dist/components/MazSkeleton.js +1 -50
- package/dist/components/MazSlider.js +1 -205
- package/dist/components/MazSpinner.js +1 -27
- package/dist/components/MazStepper.js +1 -170
- package/dist/components/MazSwitch.js +1 -4
- package/dist/components/MazTable.js +1 -8
- package/dist/components/MazTableCell.js +1 -18
- package/dist/components/MazTableRow.js +1 -26
- package/dist/components/MazTableTitle.js +1 -18
- package/dist/components/MazTabs.js +1 -4
- package/dist/components/MazTabsBar.js +1 -138
- package/dist/components/MazTabsContent.js +1 -4
- package/dist/components/MazTabsContentItem.js +1 -37
- package/dist/components/MazTextarea.js +1 -147
- package/dist/components/MazUiProvider.js +1 -4
- package/dist/components/index.js +1 -127
- package/dist/composables/index.js +1 -44
- package/dist/composables/useAos.js +1 -7
- package/dist/composables/useBreakpoints.js +1 -34
- package/dist/composables/useDialog.js +1 -7
- package/dist/composables/useDisplayNames.js +1 -111
- package/dist/composables/useDropzone.js +1 -66
- package/dist/composables/useFormField.js +1 -101
- package/dist/composables/useFormValidator.js +1 -163
- package/dist/composables/useFreezeValue.js +1 -8
- package/dist/composables/useIdleTimeout.js +1 -10
- package/dist/composables/useInjectStrict.js +1 -10
- package/dist/composables/useInstanceUniqId.js +1 -12
- package/dist/composables/useMountComponent.js +1 -16
- package/dist/composables/useMutationObserver.js +1 -37
- package/dist/composables/useReadingTime.js +1 -33
- package/dist/composables/useStringMatching.js +1 -42
- package/dist/composables/useSwipe.js +1 -26
- package/dist/composables/useTimer.js +1 -36
- package/dist/composables/useToast.js +1 -14
- package/dist/composables/useUserVisibility.js +1 -10
- package/dist/composables/useWait.js +1 -7
- package/dist/composables/useWindowSize.js +1 -21
- package/dist/directives/index.js +1 -19
- package/dist/directives/vClickOutside.js +1 -104
- package/dist/directives/vFullscreenImg.js +1 -10
- package/dist/directives/vLazyImg.js +1 -23
- package/dist/directives/vTooltip.js +1 -161
- package/dist/directives/vZoomImg.js +1 -286
- package/dist/index.js +1 -1
- package/dist/plugins/aos.js +1 -89
- package/dist/plugins/dialog.js +1 -61
- package/dist/plugins/index.js +1 -17
- package/dist/plugins/maz-ui.js +1 -11
- package/dist/plugins/toast.js +1 -261
- package/dist/plugins/wait.js +1 -43
- package/dist/resolvers/MazComponentsResolver.js +1 -18
- package/dist/resolvers/MazDirectivesResolver.js +1 -14
- package/dist/resolvers/MazModulesResolver.js +1 -76
- package/dist/resolvers/index.js +1 -8
- package/dist/tailwindcss/index.js +1 -20
- package/dist/tailwindcss/tailwind.config.js +1 -35
- package/dist/tailwindcss/utils/colors.js +1 -25
- package/dist/tailwindcss/variables/breakpoints.js +1 -29
- package/dist/tailwindcss/variables/colors.js +1 -33
- package/dist/tailwindcss/variables/design-tokens.js +1 -42
- package/dist/tailwindcss/variables/utilities.js +1 -20
- package/dist/tailwindcss/variables/z-indexes.js +1 -17
- package/package.json +12 -13
- package/dist/chunks/MazChart.vue_vue_type_script_setup_true_lang.DpG9UYdm.js +0 -50
- package/dist/chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js +0 -215
- package/dist/chunks/MazInputPrice.vue_vue_type_script_setup_true_lang.DcNkyw1C.js +0 -77
- package/dist/chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js +0 -84
- package/dist/chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js +0 -517
- package/dist/chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js +0 -28
- package/dist/chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js +0 -26
- package/dist/chunks/MazUiProvider.vue_vue_type_script_setup_true_lang.DtnM1DOn.js +0 -34
- package/dist/chunks/_plugin-vue_export-helper.B--vMWp3.js +0 -9
- package/dist/chunks/dom-events.DTx6Kblx.js +0 -368
- package/dist/chunks/fullscreen-img.directive.BJieSSIt.js +0 -321
- package/dist/chunks/lazy-img.directive.GRfYbidn.js +0 -174
- package/dist/chunks/resolveLinkComponent.CKR2McYy.js +0 -8
- package/dist/chunks/types.D0Bp_UhS.js +0 -6
- package/dist/chunks/useMazInputPhoneNumber.Os-2y9bz.js +0 -157
- package/dist/chunks/utils.D89Q5cCP.js +0 -207
- /package/dist/assets/{fullscreen-img.DFp1SMPU.css → vFullscreenImg.DFp1SMPU.css} +0 -0
|
@@ -1,533 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MazLogoJs, MazLogoTypescript, MazLogoVue, MazLogoReact, MazLogoJson, MazLogoXml, MazLogoHtml, MazLogoMarkdown, MazLogoProperties, MazLogoTxt, MazLogoCsv, MazLogoXls, MazLogoXliff, MazLogoApple, MazLogoAndroid, MazPhoto, MazFilm, MazSpeakerWave, MazArchiveBox, MazCommandLine, MazCodeBracket, MazCog, MazPresentationChartBar, MazDocumentText, MazPencilSquare, MazPaintBrush, MazDocumentIcon, MazCheckCircle, MazXCircle, MazTrash, MazArrowUpOnSquare } from "@maz-ui/icons/lazy";
|
|
3
|
-
import { useTranslations } from "@maz-ui/translations/composables/useTranslations";
|
|
4
|
-
import { sleep } from "@maz-ui/utils/helpers/sleep";
|
|
5
|
-
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
6
|
-
import { useDropzone } from "../composables/useDropzone.js";
|
|
7
|
-
import MazBtn from "./MazBtn.js";
|
|
8
|
-
import MazIcon from "./MazIcon.js";
|
|
9
|
-
import MazLink from "./MazLink.js";
|
|
10
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
11
|
-
import '../assets/MazDropzone.oxdW4qvt.css';const _hoisted_1 = ["for"], _hoisted_2 = { class: "m-dropzone__icon-container" }, _hoisted_3 = {
|
|
12
|
-
key: 3,
|
|
13
|
-
class: "m-dropzone__file-icon-wrapper"
|
|
14
|
-
}, _hoisted_4 = { class: "m-dropzone__description" }, _hoisted_5 = { class: "m-dropzone__file-info" }, _hoisted_6 = { class: "m-dropzone__file-name" }, _hoisted_7 = { class: "m-dropzone__file-size" }, _hoisted_8 = { class: "m-dropzone__content" }, _hoisted_9 = { class: "m-dropzone__upload-text" }, _hoisted_10 = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "m-dropzone__info-text"
|
|
17
|
-
}, _hoisted_11 = { key: 0 }, _hoisted_12 = { key: 1 }, _hoisted_13 = { key: 2 }, _hoisted_14 = ["id", "multiple", "accept", "disabled"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
__name: "MazDropzone",
|
|
19
|
-
props: /* @__PURE__ */ mergeModels({
|
|
20
|
-
id: {},
|
|
21
|
-
multiple: { type: Boolean, default: !1 },
|
|
22
|
-
dataTypes: {},
|
|
23
|
-
preventDefaultForUnhandled: { type: Boolean, default: !0 },
|
|
24
|
-
maxFileSize: {},
|
|
25
|
-
maxFiles: {},
|
|
26
|
-
disabled: { type: Boolean, default: !1 },
|
|
27
|
-
preview: { type: Boolean, default: !0 },
|
|
28
|
-
minFileSize: {},
|
|
29
|
-
allowDuplicates: { type: Boolean, default: !1 },
|
|
30
|
-
translations: {},
|
|
31
|
-
color: { default: "primary" },
|
|
32
|
-
removeFileBtnProps: { default: () => ({}) },
|
|
33
|
-
spinnerProps: { default: () => ({}) },
|
|
34
|
-
autoUpload: { type: [String, Boolean], default: !1 },
|
|
35
|
-
url: {},
|
|
36
|
-
requestOptions: {},
|
|
37
|
-
transformBody: { type: Function },
|
|
38
|
-
maxConcurrentUploads: { default: 5 }
|
|
39
|
-
}, {
|
|
40
|
-
modelValue: {
|
|
41
|
-
default: () => []
|
|
42
|
-
},
|
|
43
|
-
modelModifiers: {}
|
|
44
|
-
}),
|
|
45
|
-
emits: /* @__PURE__ */ mergeModels(["drop", "enter", "leave", "over", "add", "remove", "error", "upload-error", "upload-error-multiple", "upload-success", "upload-success-multiple"], ["update:modelValue"]),
|
|
46
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
47
|
-
const emits = __emit, MazSpinner = defineAsyncComponent(() => import("./MazSpinner.js")), filesData = useModel(__props, "modelValue");
|
|
48
|
-
onBeforeMount(async () => {
|
|
49
|
-
filesData.value.length && (filesData.value = await Promise.all(filesData.value.map((fileData) => getFileData(fileData.file))));
|
|
50
|
-
});
|
|
51
|
-
const dropZoneRef = ref(), isUploading = ref(!1), hasMultiple = computed(() => __props.multiple || (__props.maxFiles ? __props.maxFiles > 1 : !1) || __props.autoUpload === "multiple"), instanceId = useInstanceUniqId({
|
|
52
|
-
componentName: "MazDropzone",
|
|
53
|
-
providedId: __props.id
|
|
54
|
-
});
|
|
55
|
-
function uploadFile(formData) {
|
|
56
|
-
if (!__props.url)
|
|
57
|
-
throw emits("error", {
|
|
58
|
-
files: null,
|
|
59
|
-
event: null,
|
|
60
|
-
code: "NO_URL"
|
|
61
|
-
}), new Error("NO_URL");
|
|
62
|
-
try {
|
|
63
|
-
const body = __props.transformBody?.(formData) ?? formData;
|
|
64
|
-
return fetch(__props.url, {
|
|
65
|
-
method: "POST",
|
|
66
|
-
body,
|
|
67
|
-
...__props.requestOptions
|
|
68
|
-
});
|
|
69
|
-
} catch {
|
|
70
|
-
emits("error", {
|
|
71
|
-
files: null,
|
|
72
|
-
event: null,
|
|
73
|
-
code: "FILE_UPLOAD_ERROR"
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getFormData(file) {
|
|
78
|
-
const formData = new FormData();
|
|
79
|
-
return formData.append("file", file), formData;
|
|
80
|
-
}
|
|
81
|
-
function getFormDataMultiple() {
|
|
82
|
-
const formData = new FormData();
|
|
83
|
-
return filesData.value.forEach((fileData) => formData.append("files", fileData.file)), formData;
|
|
84
|
-
}
|
|
85
|
-
async function uploadFilesMultiple() {
|
|
86
|
-
if (!filesData.value.length) {
|
|
87
|
-
emits("error", {
|
|
88
|
-
files: filesData.value.map((f) => f.file),
|
|
89
|
-
event: null,
|
|
90
|
-
code: "NO_FILES_TO_UPLOAD"
|
|
91
|
-
});
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
isUploading.value = !0, filesData.value = filesData.value.map((f) => ({ ...f, uploading: !0, success: !1, error: !1 }));
|
|
96
|
-
const formData = getFormDataMultiple(), response = await uploadFile(formData);
|
|
97
|
-
filesData.value = filesData.value.map((f) => ({ ...f, uploading: !1, success: !0, error: !1 })), emits("upload-success-multiple", { files: filesData.value.map((f) => f.file), response });
|
|
98
|
-
} catch (error) {
|
|
99
|
-
filesData.value = filesData.value.map((f) => ({ ...f, uploading: !1, success: !1, error: !0 })), emits("upload-error-multiple", { files: filesData.value.map((f) => f.file), code: "FILE_UPLOAD_ERROR_MULTIPLE", error });
|
|
100
|
-
} finally {
|
|
101
|
-
isUploading.value = !1, await sleep(1e3), filesData.value = filesData.value.filter((f) => f.error);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async function uploadFiles() {
|
|
105
|
-
if (!filesData.value.length)
|
|
106
|
-
throw emits("error", {
|
|
107
|
-
files: filesData.value.map((f) => f.file),
|
|
108
|
-
event: null,
|
|
109
|
-
code: "NO_FILES_TO_UPLOAD"
|
|
110
|
-
}), new Error("NO_FILES_TO_UPLOAD");
|
|
111
|
-
try {
|
|
112
|
-
isUploading.value = !0;
|
|
113
|
-
const queue = [...filesData.value], activeUploads = [];
|
|
114
|
-
async function uploadFileData(fileData) {
|
|
115
|
-
const formData = getFormData(fileData.file);
|
|
116
|
-
try {
|
|
117
|
-
fileData.error = !1, fileData.uploading = !0;
|
|
118
|
-
const response = await uploadFile(formData);
|
|
119
|
-
emits("upload-success", { file: fileData.file, response }), fileData.success = !0;
|
|
120
|
-
} catch (error) {
|
|
121
|
-
fileData.error = !0, emits("upload-error", {
|
|
122
|
-
file: fileData.file,
|
|
123
|
-
code: "FILE_UPLOAD_ERROR",
|
|
124
|
-
error
|
|
125
|
-
});
|
|
126
|
-
} finally {
|
|
127
|
-
fileData.uploading = !1;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
async function processQueue() {
|
|
131
|
-
for (; queue.length > 0; ) {
|
|
132
|
-
const fileData = queue.shift();
|
|
133
|
-
fileData && await uploadFileData(fileData);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
for (let i = 0; i < Math.min(__props.maxConcurrentUploads, filesData.value.length); i++)
|
|
137
|
-
activeUploads.push(processQueue());
|
|
138
|
-
await Promise.allSettled(activeUploads);
|
|
139
|
-
} finally {
|
|
140
|
-
isUploading.value = !1, await sleep(1e3), filesData.value = filesData.value.filter((f) => f.error);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
async function getFileData(file) {
|
|
144
|
-
const fileData = {
|
|
145
|
-
file,
|
|
146
|
-
name: file.name,
|
|
147
|
-
size: file.size,
|
|
148
|
-
type: file.type,
|
|
149
|
-
lastModified: file.lastModified,
|
|
150
|
-
sizeInMb: (file.size / 1024 / 1024).toFixed(2),
|
|
151
|
-
lastModifiedDate: new Date(file.lastModified),
|
|
152
|
-
url: URL.createObjectURL(file),
|
|
153
|
-
thumbnail: void 0,
|
|
154
|
-
uploading: !1,
|
|
155
|
-
success: !1,
|
|
156
|
-
error: !1
|
|
157
|
-
};
|
|
158
|
-
return file.type.startsWith("image/") && await new Promise((resolve) => {
|
|
159
|
-
const reader = new FileReader();
|
|
160
|
-
reader.onload = (event) => {
|
|
161
|
-
const thumbnail = event.target?.result;
|
|
162
|
-
fileData.thumbnail = thumbnail || void 0, resolve(null);
|
|
163
|
-
}, reader.readAsDataURL(file);
|
|
164
|
-
}), __props.maxFileSize && file.size > __props.maxFileSize * 1024 * 1024 && emits("error", {
|
|
165
|
-
files: [file],
|
|
166
|
-
event: null,
|
|
167
|
-
code: "FILE_SIZE_EXCEEDED"
|
|
168
|
-
}), __props.minFileSize && file.size < __props.minFileSize * 1024 * 1024 && emits("error", {
|
|
169
|
-
files: [file],
|
|
170
|
-
event: null,
|
|
171
|
-
code: "FILE_SIZE_TOO_SMALL"
|
|
172
|
-
}), fileData;
|
|
173
|
-
}
|
|
174
|
-
async function handleFiles(files) {
|
|
175
|
-
if (__props.disabled || !files)
|
|
176
|
-
return null;
|
|
177
|
-
for await (const file of files) {
|
|
178
|
-
if (!isFileTypeAllowed(file)) {
|
|
179
|
-
emits("error", {
|
|
180
|
-
files: [file],
|
|
181
|
-
event: null,
|
|
182
|
-
code: "FILE_TYPE_NOT_ALLOWED"
|
|
183
|
-
});
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
if (!hasMultiple.value && filesData.value.length >= 1) {
|
|
187
|
-
emits("error", {
|
|
188
|
-
files: [file],
|
|
189
|
-
event: null,
|
|
190
|
-
code: "MAX_FILES_EXCEEDED"
|
|
191
|
-
});
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
if (__props.maxFiles && filesData.value.length >= __props.maxFiles) {
|
|
195
|
-
emits("error", {
|
|
196
|
-
files: [file],
|
|
197
|
-
event: null,
|
|
198
|
-
code: "MAX_FILES_EXCEEDED"
|
|
199
|
-
});
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (__props.maxFileSize && file.size > __props.maxFileSize * 1024 * 1024) {
|
|
203
|
-
emits("error", {
|
|
204
|
-
files: [file],
|
|
205
|
-
event: null,
|
|
206
|
-
code: "FILE_SIZE_EXCEEDED"
|
|
207
|
-
});
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
if (__props.minFileSize && file.size < __props.minFileSize * 1024 * 1024) {
|
|
211
|
-
emits("error", {
|
|
212
|
-
files: [file],
|
|
213
|
-
event: null,
|
|
214
|
-
code: "FILE_SIZE_TOO_SMALL"
|
|
215
|
-
});
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
if (!__props.allowDuplicates && filesData.value.some((f) => f.name === file.name && f.size === file.size && f.type === file.type)) {
|
|
219
|
-
emits("error", {
|
|
220
|
-
files: [file],
|
|
221
|
-
event: null,
|
|
222
|
-
code: "FILE_DUPLICATED"
|
|
223
|
-
});
|
|
224
|
-
continue;
|
|
225
|
-
}
|
|
226
|
-
const fileData = await getFileData(file);
|
|
227
|
-
filesData.value = [...filesData.value, fileData], emits("add", fileData.file);
|
|
228
|
-
}
|
|
229
|
-
return __props.autoUpload === "single" ? uploadFiles() : __props.autoUpload === "multiple" && uploadFilesMultiple(), filesData.value;
|
|
230
|
-
}
|
|
231
|
-
async function onDrop(files, event) {
|
|
232
|
-
await handleFiles(files), emits("drop", {
|
|
233
|
-
files,
|
|
234
|
-
event
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
function onError(files, event) {
|
|
238
|
-
emits("error", {
|
|
239
|
-
files,
|
|
240
|
-
event,
|
|
241
|
-
code: "FILE_TYPE_NOT_ALLOWED"
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
function onEnter(files, event) {
|
|
245
|
-
emits("enter", { files, event });
|
|
246
|
-
}
|
|
247
|
-
function onLeave(files, event) {
|
|
248
|
-
emits("leave", { files, event });
|
|
249
|
-
}
|
|
250
|
-
function onOver(files, event) {
|
|
251
|
-
emits("over", { files, event });
|
|
252
|
-
}
|
|
253
|
-
const { isOverDropZone, isOverError } = useDropzone(dropZoneRef, { dataTypes: __props.dataTypes, onDrop, preventDefaultForUnhandled: __props.preventDefaultForUnhandled, multiple: hasMultiple.value, onError, onEnter, onLeave, onOver }), fileInput = ref();
|
|
254
|
-
function handleFileUpload(event) {
|
|
255
|
-
const input = event.target, files = input?.files;
|
|
256
|
-
files && handleFiles(files), setTimeout(() => {
|
|
257
|
-
input.value = "";
|
|
258
|
-
}, 3e3);
|
|
259
|
-
}
|
|
260
|
-
const extensionIconMap = (() => {
|
|
261
|
-
const map = /* @__PURE__ */ new Map(), groups = [
|
|
262
|
-
[MazLogoJs, ["js", "mjs", "cjs"]],
|
|
263
|
-
[MazLogoTypescript, ["ts", "tsx", "mts", "cts"]],
|
|
264
|
-
[MazLogoVue, ["vue"]],
|
|
265
|
-
[MazLogoReact, ["jsx"]],
|
|
266
|
-
[MazLogoJson, ["json", "jsonc", "json5"]],
|
|
267
|
-
[MazLogoXml, ["xml"]],
|
|
268
|
-
[MazLogoHtml, ["html", "htm"]],
|
|
269
|
-
[MazLogoMarkdown, ["md", "markdown", "mdx"]],
|
|
270
|
-
[MazLogoProperties, ["properties"]],
|
|
271
|
-
[MazLogoTxt, ["txt"]],
|
|
272
|
-
[MazLogoCsv, ["csv"]],
|
|
273
|
-
[MazLogoXls, ["xls", "xlsx"]],
|
|
274
|
-
[MazLogoXliff, ["xliff", "xlf"]],
|
|
275
|
-
[MazLogoApple, ["strings", "stringsdict", "xcstrings"]],
|
|
276
|
-
[MazLogoAndroid, ["apk"]],
|
|
277
|
-
[MazPhoto, ["jpeg", "jpg", "png", "tiff", "bmp", "webp", "svg", "ico", "gif", "heic", "heif", "avif"]],
|
|
278
|
-
[MazFilm, ["mp4", "webm", "avi", "mov", "mkv", "flv", "wmv", "m4v", "mpeg", "mpg", "3gp", "ogv"]],
|
|
279
|
-
[MazSpeakerWave, ["mp3", "wav", "m4a", "aac", "flac", "ogg", "oga", "opus", "wma", "alac", "aiff"]],
|
|
280
|
-
[MazArchiveBox, ["zip", "rar", "tar", "gz", "7z", "bz2", "xz"]],
|
|
281
|
-
[MazCommandLine, ["exe", "dll", "so", "dylib", "dmg", "deb", "rpm", "app", "bat", "cmd"]],
|
|
282
|
-
[MazCodeBracket, ["css", "scss", "sass", "less", "py", "java", "cpp", "c", "h", "hpp", "go", "rs", "rust", "php", "rb", "swift", "kt", "kotlin", "sql", "sh", "bash", "zsh", "yaml", "yml", "toml", "ini"]],
|
|
283
|
-
[MazCog, ["conf", "config", "env", "cfg"]],
|
|
284
|
-
[MazPresentationChartBar, ["ppt", "pptx", "key", "odp"]],
|
|
285
|
-
[MazDocumentText, ["rtf", "odt"]],
|
|
286
|
-
[MazPencilSquare, ["ttf", "otf", "woff", "woff2", "eot"]],
|
|
287
|
-
[MazPaintBrush, ["ai", "psd", "sketch", "fig", "xd", "eps"]],
|
|
288
|
-
[MazDocumentIcon, ["pdf", "doc", "docx", "tsv", "document"]]
|
|
289
|
-
];
|
|
290
|
-
for (const [icon, extensions] of groups)
|
|
291
|
-
for (const ext of extensions)
|
|
292
|
-
map.set(ext, icon);
|
|
293
|
-
return map;
|
|
294
|
-
})();
|
|
295
|
-
function getIconComponent(fileData) {
|
|
296
|
-
const type = fileData.file.type.split("/")?.[1]?.split("+")?.[0]?.toLowerCase(), extension = fileData.file.name.split(".").pop()?.toLowerCase();
|
|
297
|
-
return extensionIconMap.get(type) || extension && extensionIconMap.get(extension) || extensionIconMap.get("document");
|
|
298
|
-
}
|
|
299
|
-
function handleFileInputClick() {
|
|
300
|
-
fileInput.value && fileInput.value.click();
|
|
301
|
-
}
|
|
302
|
-
function handleFileRemove(fileData) {
|
|
303
|
-
fileData.url && URL.revokeObjectURL(fileData.url), filesData.value = filesData.value.filter((f) => f.file !== fileData.file), emits("remove", fileData.file);
|
|
304
|
-
}
|
|
305
|
-
const selectAreaCanBeDisplayed = ref(!0), dataTypesString = computed(() => __props.dataTypes?.map(formatReadable).join(", ")), allFileIsAccepted = computed(() => __props.dataTypes?.length === 1 && __props.dataTypes[0] === "*/*"), { t } = useTranslations(), messages = computed(() => {
|
|
306
|
-
const customTranslations = __props.translations || {};
|
|
307
|
-
return {
|
|
308
|
-
dragAndDrop: customTranslations.dragAndDrop ?? t("dropzone.dragAndDrop"),
|
|
309
|
-
fileMaxCount: __props.maxFiles ? customTranslations.fileMaxCount ?? t("dropzone.fileMaxCount", { count: __props.maxFiles }) : void 0,
|
|
310
|
-
fileMaxSize: __props.maxFileSize ? customTranslations.fileMaxSize ?? t("dropzone.fileMaxSize", { size: __props.maxFileSize }) : void 0,
|
|
311
|
-
fileTypes: dataTypesString.value ? customTranslations.fileTypes ?? t("dropzone.fileTypes", { types: dataTypesString.value }) : void 0,
|
|
312
|
-
selectFile: customTranslations.selectFile ?? t("dropzone.selectFile"),
|
|
313
|
-
divider: customTranslations.divider ?? t("dropzone.divider")
|
|
314
|
-
};
|
|
315
|
-
});
|
|
316
|
-
function formatReadable(fmt) {
|
|
317
|
-
if (fmt.startsWith("."))
|
|
318
|
-
return fmt;
|
|
319
|
-
if (fmt.includes("/")) {
|
|
320
|
-
const [type, subtype] = fmt.split("/");
|
|
321
|
-
if (subtype === "*") {
|
|
322
|
-
const customTypes = __props.translations?.types || {};
|
|
323
|
-
switch (type) {
|
|
324
|
-
case "image":
|
|
325
|
-
return customTypes.image ?? t("dropzone.types.image");
|
|
326
|
-
case "video":
|
|
327
|
-
return customTypes.video ?? t("dropzone.types.video");
|
|
328
|
-
case "audio":
|
|
329
|
-
return customTypes.audio ?? t("dropzone.types.audio");
|
|
330
|
-
case "text":
|
|
331
|
-
return customTypes.text ?? t("dropzone.types.text");
|
|
332
|
-
default:
|
|
333
|
-
return fmt;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return subtype;
|
|
337
|
-
}
|
|
338
|
-
return fmt;
|
|
339
|
-
}
|
|
340
|
-
function reset() {
|
|
341
|
-
filesData.value.forEach((fileData) => {
|
|
342
|
-
fileData.url && URL.revokeObjectURL(fileData.url);
|
|
343
|
-
}), filesData.value = [];
|
|
344
|
-
}
|
|
345
|
-
function addFile(file) {
|
|
346
|
-
handleFiles([file]);
|
|
347
|
-
}
|
|
348
|
-
function removeFile(file) {
|
|
349
|
-
filesData.value = filesData.value.filter((f) => f.file !== file);
|
|
350
|
-
}
|
|
351
|
-
function isFileTypeAllowed(file) {
|
|
352
|
-
return !__props.dataTypes || __props.dataTypes.includes("*/*") ? !0 : __props.dataTypes.some((type) => type.startsWith(".") ? file.name.toLowerCase().endsWith(type.toLowerCase()) : type.endsWith("/*") ? file.type.startsWith(type.slice(0, -1)) : file.type === type);
|
|
353
|
-
}
|
|
354
|
-
return __expose({
|
|
355
|
-
/**
|
|
356
|
-
* Upload files
|
|
357
|
-
* @description With this method, the files are uploaded one by one (a request for each file)
|
|
358
|
-
* @usage `mazDropzoneInstance.value?.uploadFiles()`
|
|
359
|
-
*/
|
|
360
|
-
uploadFiles,
|
|
361
|
-
/**
|
|
362
|
-
* Upload multiple files
|
|
363
|
-
* @description With this method, the files are uploaded all at once in a single request
|
|
364
|
-
* @usage `mazDropzoneInstance.value?.uploadFilesMultiple()`
|
|
365
|
-
*/
|
|
366
|
-
uploadFilesMultiple,
|
|
367
|
-
/**
|
|
368
|
-
* Get form data
|
|
369
|
-
* @description Get the form data of one file
|
|
370
|
-
* @usage `const formData = mazDropzoneInstance.value?.getFormData(file)`
|
|
371
|
-
*/
|
|
372
|
-
getFormData,
|
|
373
|
-
/**
|
|
374
|
-
* Get form data multiple
|
|
375
|
-
* @description Get the form data of all files
|
|
376
|
-
* @usage `const formData = mazDropzoneInstance.value?.getFormDataMultiple()`
|
|
377
|
-
*/
|
|
378
|
-
getFormDataMultiple,
|
|
379
|
-
/**
|
|
380
|
-
* Reset the files
|
|
381
|
-
* @description Remove all files from the dropzone
|
|
382
|
-
* @usage `mazDropzoneInstance.value?.reset()`
|
|
383
|
-
*/
|
|
384
|
-
reset,
|
|
385
|
-
/**
|
|
386
|
-
* Check if the files are uploading
|
|
387
|
-
* @type boolean
|
|
388
|
-
* @description Check if the files are uploading
|
|
389
|
-
* @usage `const isUploading = mazDropzoneInstance.value?.isUploading`
|
|
390
|
-
*/
|
|
391
|
-
isUploading,
|
|
392
|
-
/**
|
|
393
|
-
* Add a file to the dropzone
|
|
394
|
-
* @description Add a file manually to the dropzone
|
|
395
|
-
* @usage `mazDropzoneInstance.value?.addFile(file)`
|
|
396
|
-
*/
|
|
397
|
-
addFile,
|
|
398
|
-
/**
|
|
399
|
-
* Remove a file from the dropzone
|
|
400
|
-
* @description Remove a file manually from the dropzone
|
|
401
|
-
* @usage `mazDropzoneInstance.value?.removeFile(file)`
|
|
402
|
-
*/
|
|
403
|
-
removeFile
|
|
404
|
-
}), (_ctx, _cache) => (openBlock(), createElementBlock("label", {
|
|
405
|
-
ref_key: "dropZoneRef",
|
|
406
|
-
ref: dropZoneRef,
|
|
407
|
-
role: "button",
|
|
408
|
-
tabindex: "0",
|
|
409
|
-
for: `input-file-uploader-${unref(instanceId)}`,
|
|
410
|
-
class: normalizeClass(["m-dropzone m-reset-css", {
|
|
411
|
-
"m-dropzone--disabled": __props.disabled,
|
|
412
|
-
"m-dropzone--is-over-drop-zone": unref(isOverDropZone) && !unref(isOverError),
|
|
413
|
-
"m-dropzone--is-over-error": unref(isOverError)
|
|
414
|
-
}]),
|
|
415
|
-
style: normalizeStyle({
|
|
416
|
-
"--active-color": `hsl(var(--maz-${__props.color}))`
|
|
417
|
-
})
|
|
418
|
-
}, [
|
|
419
|
-
renderSlot(_ctx.$slots, "files-area", { filesData: filesData.value }, () => [
|
|
420
|
-
createVNode(TransitionGroup, {
|
|
421
|
-
name: "file-scale",
|
|
422
|
-
tag: "div",
|
|
423
|
-
class: "m-dropzone__files-container",
|
|
424
|
-
onBeforeEnter: _cache[1] || (_cache[1] = ($event) => selectAreaCanBeDisplayed.value = !1),
|
|
425
|
-
onAfterLeave: _cache[2] || (_cache[2] = ($event) => selectAreaCanBeDisplayed.value = filesData.value.length === 0)
|
|
426
|
-
}, {
|
|
427
|
-
default: withCtx(() => [
|
|
428
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(filesData.value, (file) => (openBlock(), createElementBlock("div", {
|
|
429
|
-
key: `${file.name}-${file.size}-${file}`,
|
|
430
|
-
class: "m-dropzone__file-item group",
|
|
431
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
432
|
-
}, ["prevent"]))
|
|
433
|
-
}, [
|
|
434
|
-
renderSlot(_ctx.$slots, "file-item", { file }, () => [
|
|
435
|
-
file.thumbnail && __props.preview ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
436
|
-
createElementVNode("div", {
|
|
437
|
-
style: normalizeStyle({ backgroundImage: `url(${file.thumbnail})`, backgroundSize: "cover", backgroundPosition: "center" }),
|
|
438
|
-
class: "m-dropzone__thumbnail"
|
|
439
|
-
}, null, 4),
|
|
440
|
-
_cache[4] || (_cache[4] = createElementVNode("div", { class: "m-dropzone__overlay" }, null, -1))
|
|
441
|
-
], 64)) : createCommentVNode("", !0),
|
|
442
|
-
createElementVNode("div", _hoisted_2, [
|
|
443
|
-
createVNode(Transition, { name: "icon-scale" }, {
|
|
444
|
-
default: withCtx(() => [
|
|
445
|
-
file.uploading ? (openBlock(), createBlock(unref(MazSpinner), mergeProps({
|
|
446
|
-
key: 0,
|
|
447
|
-
color: __props.color,
|
|
448
|
-
class: "m-dropzone__spinner"
|
|
449
|
-
}, { ref_for: !0 }, __props.spinnerProps), null, 16, ["color"])) : file.success ? (openBlock(), createBlock(unref(MazCheckCircle), {
|
|
450
|
-
key: 1,
|
|
451
|
-
class: "m-dropzone__success-icon"
|
|
452
|
-
})) : file.error ? (openBlock(), createBlock(unref(MazXCircle), {
|
|
453
|
-
key: 2,
|
|
454
|
-
class: "m-dropzone__error-icon"
|
|
455
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
456
|
-
createVNode(MazIcon, {
|
|
457
|
-
icon: getIconComponent(file),
|
|
458
|
-
size: "lg",
|
|
459
|
-
class: "m-dropzone__file-icon"
|
|
460
|
-
}, null, 8, ["icon"])
|
|
461
|
-
]))
|
|
462
|
-
]),
|
|
463
|
-
_: 2
|
|
464
|
-
}, 1024)
|
|
465
|
-
]),
|
|
466
|
-
createElementVNode("div", _hoisted_4, [
|
|
467
|
-
createElementVNode("div", _hoisted_5, [
|
|
468
|
-
createElementVNode("span", _hoisted_6, toDisplayString(file.name), 1),
|
|
469
|
-
createElementVNode("span", _hoisted_7, toDisplayString(file.sizeInMb) + " MB", 1)
|
|
470
|
-
]),
|
|
471
|
-
!file.uploading && !file.success ? (openBlock(), createBlock(MazBtn, mergeProps({
|
|
472
|
-
key: 0,
|
|
473
|
-
size: "xs",
|
|
474
|
-
icon: unref(MazTrash),
|
|
475
|
-
disabled: __props.disabled,
|
|
476
|
-
color: "destructive",
|
|
477
|
-
pastel: ""
|
|
478
|
-
}, { ref_for: !0 }, __props.removeFileBtnProps, {
|
|
479
|
-
onClick: withModifiers(($event) => handleFileRemove(file), ["prevent"])
|
|
480
|
-
}), null, 16, ["icon", "disabled", "onClick"])) : createCommentVNode("", !0)
|
|
481
|
-
])
|
|
482
|
-
], !0)
|
|
483
|
-
]))), 128))
|
|
484
|
-
]),
|
|
485
|
-
_: 3
|
|
486
|
-
})
|
|
487
|
-
], !0),
|
|
488
|
-
filesData.value.length === 0 && selectAreaCanBeDisplayed.value ? renderSlot(_ctx.$slots, "no-files-area", {
|
|
489
|
-
key: 0,
|
|
490
|
-
selectFile: handleFileInputClick
|
|
491
|
-
}, () => [
|
|
492
|
-
createElementVNode("div", _hoisted_8, [
|
|
493
|
-
renderSlot(_ctx.$slots, "upload-icon", {}, () => [
|
|
494
|
-
createVNode(unref(MazArrowUpOnSquare), { class: "m-dropzone__upload-icon" })
|
|
495
|
-
], !0),
|
|
496
|
-
createElementVNode("span", _hoisted_9, [
|
|
497
|
-
createTextVNode(toDisplayString(messages.value.dragAndDrop) + " " + toDisplayString(messages.value.divider) + " ", 1),
|
|
498
|
-
createVNode(MazLink, {
|
|
499
|
-
color: "inherit",
|
|
500
|
-
underline: "",
|
|
501
|
-
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => !__props.disabled && handleFileInputClick(), ["prevent"]))
|
|
502
|
-
}, {
|
|
503
|
-
default: withCtx(() => [
|
|
504
|
-
createTextVNode(toDisplayString(messages.value.selectFile), 1)
|
|
505
|
-
]),
|
|
506
|
-
_: 1
|
|
507
|
-
})
|
|
508
|
-
])
|
|
509
|
-
]),
|
|
510
|
-
!allFileIsAccepted.value && (messages.value.fileMaxCount || messages.value.fileMaxSize || messages.value.fileTypes) ? (openBlock(), createElementBlock("p", _hoisted_10, [
|
|
511
|
-
messages.value.fileMaxCount ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(messages.value.fileMaxCount), 1)) : createCommentVNode("", !0),
|
|
512
|
-
messages.value.fileMaxSize ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(messages.value.fileMaxSize), 1)) : createCommentVNode("", !0),
|
|
513
|
-
messages.value.fileTypes ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(messages.value.fileTypes), 1)) : createCommentVNode("", !0)
|
|
514
|
-
])) : createCommentVNode("", !0)
|
|
515
|
-
], !0) : createCommentVNode("", !0),
|
|
516
|
-
createElementVNode("input", {
|
|
517
|
-
id: `input-file-uploader-${unref(instanceId)}`,
|
|
518
|
-
ref_key: "fileInput",
|
|
519
|
-
ref: fileInput,
|
|
520
|
-
multiple: hasMultiple.value,
|
|
521
|
-
type: "file",
|
|
522
|
-
accept: __props.dataTypes?.join(","),
|
|
523
|
-
tabindex: "-1",
|
|
524
|
-
disabled: __props.disabled,
|
|
525
|
-
class: "m-dropzone__file-input",
|
|
526
|
-
onChange: handleFileUpload
|
|
527
|
-
}, null, 40, _hoisted_14)
|
|
528
|
-
], 14, _hoisted_1));
|
|
529
|
-
}
|
|
530
|
-
}), MazDropzone = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0d91ca4e"]]);
|
|
531
|
-
export {
|
|
532
|
-
MazDropzone as default
|
|
533
|
-
};
|
|
1
|
+
import"../chunks/MazLink.BOpxMATj.js";import"../chunks/MazBtn.Cc9C1v2l.js";import"../chunks/MazIcon.ZWAk25ZX.js";import{t as MazDropzone_default}from"../chunks/MazDropzone.CiWiPcFM.js";export{MazDropzone_default as default};
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
3
|
-
import '../assets/MazExpandAnimation.BdhcwTAg.css';const _hoisted_1 = ["aria-hidden"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
-
inheritAttrs: !1,
|
|
5
|
-
__name: "MazExpandAnimation",
|
|
6
|
-
props: /* @__PURE__ */ mergeModels({
|
|
7
|
-
duration: { default: "300ms" },
|
|
8
|
-
timingFunction: { default: "ease-in-out" }
|
|
9
|
-
}, {
|
|
10
|
-
modelValue: { type: Boolean },
|
|
11
|
-
modelModifiers: {}
|
|
12
|
-
}),
|
|
13
|
-
emits: ["update:modelValue"],
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const isOpen = useModel(__props, "modelValue"), hasOverflowHidden = ref(!isOpen.value), expandAnimationRef = ref();
|
|
16
|
-
function onTransitionStart() {
|
|
17
|
-
isOpen.value || (hasOverflowHidden.value = !0);
|
|
18
|
-
}
|
|
19
|
-
function onTransitionEnd() {
|
|
20
|
-
isOpen.value && (hasOverflowHidden.value = !1);
|
|
21
|
-
}
|
|
22
|
-
return onMounted(() => {
|
|
23
|
-
expandAnimationRef.value?.addEventListener("transitionstart", onTransitionStart, !1), expandAnimationRef.value?.addEventListener("transitionend", onTransitionEnd, !1);
|
|
24
|
-
}), onUnmounted(() => {
|
|
25
|
-
expandAnimationRef.value?.removeEventListener("transitionstart", onTransitionStart, !1), expandAnimationRef.value?.removeEventListener("transitionend", onTransitionEnd, !1);
|
|
26
|
-
}), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
|
|
27
|
-
ref_key: "expandAnimationRef",
|
|
28
|
-
ref: expandAnimationRef,
|
|
29
|
-
class: normalizeClass(["m-expand-animation m-reset-css", { "m-expand-animation--expanded": isOpen.value }]),
|
|
30
|
-
"aria-hidden": !isOpen.value,
|
|
31
|
-
role: "region",
|
|
32
|
-
style: normalizeStyle([{ "--expand-animation-duration": __props.duration, "--expand-animation-timing-function": __props.timingFunction }])
|
|
33
|
-
}, [
|
|
34
|
-
createElementVNode("div", mergeProps({ class: "m-expand-animation__inner" }, _ctx.$attrs, {
|
|
35
|
-
class: {
|
|
36
|
-
"--overflow-hidden": hasOverflowHidden.value
|
|
37
|
-
}
|
|
38
|
-
}), [
|
|
39
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
40
|
-
], 16)
|
|
41
|
-
], 14, _hoisted_1));
|
|
42
|
-
}
|
|
43
|
-
}), MazExpandAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-25a0e87a"]]);
|
|
44
|
-
export {
|
|
45
|
-
MazExpandAnimation as default
|
|
46
|
-
};
|
|
1
|
+
import{t as MazExpandAnimation_default}from"../chunks/MazExpandAnimation.CMMwtuQA.js";export{MazExpandAnimation_default as default};
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MazSpinner from "./MazSpinner.js";
|
|
3
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazFullscreenLoader.BzVX-jFd.css';const _hoisted_1 = { key: 0 }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
__name: "MazFullscreenLoader",
|
|
7
|
-
props: {
|
|
8
|
-
color: { default: "primary" },
|
|
9
|
-
size: { default: "3em" },
|
|
10
|
-
teleportSelector: { default: "body" }
|
|
11
|
-
},
|
|
12
|
-
setup(__props) {
|
|
13
|
-
function addClassToDocument() {
|
|
14
|
-
document.documentElement.classList.add("--maz-fullscreen-loader-present");
|
|
15
|
-
}
|
|
16
|
-
function removeClassFromDocument() {
|
|
17
|
-
document.documentElement.classList.remove("--maz-fullscreen-loader-present");
|
|
18
|
-
}
|
|
19
|
-
return onMounted(() => {
|
|
20
|
-
addClassToDocument();
|
|
21
|
-
}), onUnmounted(() => {
|
|
22
|
-
removeClassFromDocument();
|
|
23
|
-
}), (_ctx, _cache) => (openBlock(), createBlock(Teleport, { to: __props.teleportSelector }, [
|
|
24
|
-
createElementVNode("div", mergeProps({ class: "m-fullscreen-loader m-reset-css" }, _ctx.$attrs), [
|
|
25
|
-
createVNode(MazSpinner, {
|
|
26
|
-
color: __props.color,
|
|
27
|
-
size: __props.size
|
|
28
|
-
}, null, 8, ["color", "size"]),
|
|
29
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
30
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
31
|
-
])) : createCommentVNode("", !0)
|
|
32
|
-
], 16)
|
|
33
|
-
], 8, ["to"]));
|
|
34
|
-
}
|
|
35
|
-
}), MazFullscreenLoader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-62bb4284"]]);
|
|
36
|
-
export {
|
|
37
|
-
MazFullscreenLoader as default
|
|
38
|
-
};
|
|
1
|
+
import"../chunks/MazSpinner.D3NN2pow.js";import{t as MazFullscreenLoader_default}from"../chunks/MazFullscreenLoader.BIVRcZJ8.js";export{MazFullscreenLoader_default as default};
|