maz-ui 4.1.7-beta.6 → 4.1.7-beta.8
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/assets/MazAccordion.C7shz8tA.css +1 -0
- package/dist/assets/{MazBtn.D86vFfaR.css → MazBtn.DDnoE3K1.css} +1 -1
- package/dist/assets/MazDropzone.B5e-z_Ba.css +1 -0
- package/dist/assets/MazIcon.Cl1pfRbK.css +1 -0
- package/dist/assets/MazPickerCalendarMonth.CdpSHmMr.css +1 -0
- package/dist/assets/{MazTable.DLVdp4na.css → MazTable.BKlwCDt4.css} +1 -1
- package/dist/chunks/{MazChart.vue_vue_type_script_setup_true_lang.JSYXGyfn.js → MazChart.vue_vue_type_script_setup_true_lang.CUrokkc_.js} +5 -5
- package/dist/chunks/{MazDatePicker.C5f1ViA8.js → MazDatePicker.CYfNHwnV.js} +82 -82
- package/dist/chunks/{MazDialogConfirm.vue_vue_type_script_setup_true_lang.DuEcluOw.js → MazDialogConfirm.vue_vue_type_script_setup_true_lang.BaOg5MoP.js} +4 -4
- package/dist/chunks/{MazDropdown.vue_vue_type_style_index_0_lang.C5WEfuse.js → MazDropdown.vue_vue_type_style_index_0_lang.qBaRy629.js} +41 -41
- package/dist/chunks/{MazInputNumber.vue_vue_type_style_index_0_lang.B6DYpHfi.js → MazInputNumber.vue_vue_type_style_index_0_lang.D_OF4KbM.js} +20 -20
- package/dist/chunks/{MazInputPhoneNumber.BFEXMmvC.js → MazInputPhoneNumber.CbNnLvU_.js} +32 -32
- package/dist/chunks/{MazInputPrice.vue_vue_type_script_setup_true_lang.BA6TDX-T.js → MazInputPrice.vue_vue_type_script_setup_true_lang.CcQ71H1z.js} +6 -6
- package/dist/chunks/{MazPickerCalendar.BpHfGufN.js → MazPickerCalendar.BOSPVh7n.js} +26 -26
- package/dist/chunks/{MazPickerCalendarMonth.Cp41DoYR.js → MazPickerCalendarMonth.C-dBLRva.js} +4 -4
- package/dist/chunks/{MazPickerCalendarSwitcher.eONnlP4p.js → MazPickerCalendarSwitcher.CBt_inzB.js} +1 -1
- package/dist/chunks/{MazPickerHeader.8NgtJicu.js → MazPickerHeader.CPmuARqp.js} +4 -4
- package/dist/chunks/{MazPickerMonthSwitcher.Dlwz6t6Y.js → MazPickerMonthSwitcher.A5uh7cC7.js} +1 -1
- package/dist/chunks/{MazPickerShortcuts.B0CYBkxL.js → MazPickerShortcuts.iJe-kl_a.js} +2 -2
- package/dist/chunks/{MazPickerTime.C4lzgTv-.js → MazPickerTime.xQhgnYKJ.js} +1 -1
- package/dist/chunks/{MazPickerYearSwitcher.B1BVoF2x.js → MazPickerYearSwitcher.eQe37UOI.js} +1 -1
- package/dist/chunks/{MazSwitch.vue_vue_type_style_index_0_lang.Dz7-dIc9.js → MazSwitch.vue_vue_type_style_index_0_lang.DctlXsMK.js} +15 -15
- package/dist/chunks/{MazTable.vue_vue_type_script_setup_true_lang.lsJngJJn.js → MazTable.vue_vue_type_script_setup_true_lang.F9DFa_6O.js} +35 -35
- package/dist/chunks/{PhoneInput.BcmutVwQ.js → PhoneInput.DQZjDqMK.js} +12 -12
- package/dist/chunks/{fullscreen-img.directive.e2KyfwYA.js → fullscreen-img.directive.BqO7XUdi.js} +1 -1
- package/dist/chunks/plus.svg.CdiAbqRP.js +24 -0
- package/dist/components/MazAccordion.js +4 -5
- package/dist/components/MazAnimatedCounter.js +5 -5
- package/dist/components/MazAnimatedElement.js +1 -1
- package/dist/components/MazAnimatedText.js +12 -12
- package/dist/components/MazAvatar.js +25 -25
- package/dist/components/MazBackdrop.js +6 -6
- package/dist/components/MazBadge.js +4 -4
- package/dist/components/MazBottomSheet.js +3 -3
- package/dist/components/MazBtn.js +42 -32
- package/dist/components/MazCard.js +17 -17
- package/dist/components/MazCardSpotlight.js +4 -4
- package/dist/components/MazCarousel.js +3 -3
- package/dist/components/MazChart.js +1 -1
- package/dist/components/MazCheckbox.js +13 -13
- package/dist/components/MazChecklist.js +15 -15
- package/dist/components/MazCircularProgressBar.js +11 -11
- package/dist/components/MazDatePicker.js +1 -1
- package/dist/components/MazDialog.js +9 -9
- package/dist/components/MazDialogConfirm.js +2 -2
- package/dist/components/MazDrawer.js +6 -6
- package/dist/components/MazDropdown.js +1 -1
- package/dist/components/MazDropzone.js +132 -97
- package/dist/components/MazDropzone.vue.d.ts +10 -16
- package/dist/components/MazExpandAnimation.js +1 -1
- package/dist/components/MazFullscreenLoader.js +3 -3
- package/dist/components/MazGallery.js +14 -14
- package/dist/components/MazIcon.js +29 -10
- package/dist/components/MazIcon.vue.d.ts +9 -2
- package/dist/components/MazInput.js +40 -40
- package/dist/components/MazInputCode.js +11 -11
- package/dist/components/MazInputNumber.js +1 -1
- package/dist/components/MazInputPhoneNumber.js +1 -1
- package/dist/components/MazInputPrice.js +1 -1
- package/dist/components/MazInputTags.js +16 -16
- package/dist/components/MazInputTags.vue.d.ts +2 -2
- package/dist/components/MazLazyImg.js +9 -9
- package/dist/components/MazLink.js +18 -18
- package/dist/components/MazLoadingBar.js +1 -1
- package/dist/components/MazPagination.js +20 -20
- package/dist/components/MazPopover.js +15 -15
- package/dist/components/MazPullToRefresh.js +2 -2
- package/dist/components/MazRadio.js +12 -12
- package/dist/components/MazRadioButtons.js +15 -15
- package/dist/components/MazReadingProgressBar.js +3 -3
- package/dist/components/MazSelect.js +30 -30
- package/dist/components/MazSelectCountry.js +34 -34
- package/dist/components/MazSlider.js +6 -6
- package/dist/components/MazSpinner.js +3 -3
- package/dist/components/MazStepper.js +3 -3
- package/dist/components/MazSwitch.js +1 -1
- package/dist/components/MazTable.js +3 -3
- package/dist/components/MazTableCell.js +1 -1
- package/dist/components/MazTableRow.js +2 -2
- package/dist/components/MazTableTitle.js +1 -1
- package/dist/components/MazTabsBar.js +3 -3
- package/dist/components/MazTextarea.js +17 -17
- package/dist/components/index.js +8 -8
- package/dist/composables/useDisplayNames.d.ts +2 -2
- package/dist/composables/useDisplayNames.js +1 -1
- package/dist/composables/useDropzone.js +10 -2
- package/dist/directives/index.js +1 -1
- package/dist/directives/vFullscreenImg.js +1 -1
- package/dist/directives/vZoomImg/zoom-img.directive.d.ts +2 -2
- package/dist/plugins/dialog.js +1 -1
- package/dist/plugins/toast.js +5 -5
- package/dist/resolvers/MazComponentsResolver.js +15 -0
- package/dist/types/components/MazDropzone.vue.d.ts +10 -16
- package/dist/types/components/MazIcon.vue.d.ts +9 -2
- package/dist/types/components/MazInputTags.vue.d.ts +2 -2
- package/dist/types/composables/useDisplayNames.d.ts +2 -2
- package/dist/types/directives/vZoomImg/zoom-img.directive.d.ts +2 -2
- package/package.json +22 -23
- package/dist/assets/MazAccordion.DUQCf8vy.css +0 -1
- package/dist/assets/MazDropzone._2HwHowu.css +0 -1
- package/dist/assets/MazIcon.3Pn7omz5.css +0 -1
- package/dist/assets/MazPickerCalendarMonth.BZJQGPhS.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, defineAsyncComponent, useModel, onBeforeMount, ref, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot, createCommentVNode, createElementVNode, createVNode, TransitionGroup, withCtx, Fragment, renderList, withModifiers, Transition, createBlock, mergeProps, toDisplayString, createTextVNode } from "vue";
|
|
2
|
-
import { MazCheckCircle, MazXCircle, MazTrash, MazArrowUpOnSquare } from "@maz-ui/icons";
|
|
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";
|
|
3
3
|
import { useTranslations } from "@maz-ui/translations";
|
|
4
4
|
import { s as sleep } from "../chunks/sleep.BLRH1qZG.js";
|
|
5
5
|
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
@@ -7,10 +7,13 @@ import { useDropzone } from "../composables/useDropzone.js";
|
|
|
7
7
|
import MazBtn from "./MazBtn.js";
|
|
8
8
|
import MazIcon from "./MazIcon.js";
|
|
9
9
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
10
|
-
import '../assets/MazDropzone.
|
|
10
|
+
import '../assets/MazDropzone.B5e-z_Ba.css';const _hoisted_1 = ["for"], _hoisted_2 = { class: "m-dropzone__icon-container" }, _hoisted_3 = {
|
|
11
|
+
key: 3,
|
|
12
|
+
class: "m-dropzone__file-icon-wrapper"
|
|
13
|
+
}, _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 = { class: "m-dropzone__divider" }, _hoisted_11 = {
|
|
11
14
|
key: 0,
|
|
12
15
|
class: "m-dropzone__info-text"
|
|
13
|
-
},
|
|
16
|
+
}, _hoisted_12 = { key: 0 }, _hoisted_13 = { key: 0 }, _hoisted_14 = ["id", "multiple", "accept", "disabled"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
17
|
__name: "MazDropzone",
|
|
15
18
|
props: /* @__PURE__ */ mergeModels({
|
|
16
19
|
id: {},
|
|
@@ -31,7 +34,8 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
31
34
|
autoUpload: { type: [String, Boolean], default: !1 },
|
|
32
35
|
url: {},
|
|
33
36
|
requestOptions: {},
|
|
34
|
-
transformBody: { type: Function }
|
|
37
|
+
transformBody: { type: Function },
|
|
38
|
+
maxConcurrentUploads: { default: 5 }
|
|
35
39
|
}, {
|
|
36
40
|
modelValue: {
|
|
37
41
|
default: () => []
|
|
@@ -106,7 +110,8 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
106
110
|
}), new Error("NO_FILES_TO_UPLOAD");
|
|
107
111
|
try {
|
|
108
112
|
isUploading.value = !0;
|
|
109
|
-
|
|
113
|
+
const queue = [...filesData.value], activeUploads = [];
|
|
114
|
+
async function uploadFileData(fileData) {
|
|
110
115
|
const formData = getFormData(fileData.file);
|
|
111
116
|
try {
|
|
112
117
|
fileData.error = !1, fileData.uploading = !0;
|
|
@@ -122,6 +127,15 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
122
127
|
fileData.uploading = !1;
|
|
123
128
|
}
|
|
124
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);
|
|
125
139
|
} finally {
|
|
126
140
|
isUploading.value = !1, await sleep(1e3), filesData.value = filesData.value.filter((f) => f.error);
|
|
127
141
|
}
|
|
@@ -243,53 +257,44 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
243
257
|
input.value = "";
|
|
244
258
|
}, 3e3);
|
|
245
259
|
}
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
xml: "document",
|
|
283
|
-
csv: "document",
|
|
284
|
-
tsv: "document",
|
|
285
|
-
txt: "document",
|
|
286
|
-
doc: "document",
|
|
287
|
-
docx: "document",
|
|
288
|
-
document: "document"
|
|
289
|
-
};
|
|
290
|
-
function getFileIcon(fileData) {
|
|
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) {
|
|
291
296
|
const type = fileData.file.type.split("/")?.[1]?.split("+")?.[0]?.toLowerCase(), extension = fileData.file.name.split(".").pop()?.toLowerCase();
|
|
292
|
-
return
|
|
297
|
+
return extensionIconMap.get(type) || extension && extensionIconMap.get(extension) || extensionIconMap.get("document");
|
|
293
298
|
}
|
|
294
299
|
function handleFileInputClick() {
|
|
295
300
|
fileInput.value && fileInput.value.click();
|
|
@@ -297,14 +302,41 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
297
302
|
function handleFileRemove(fileData) {
|
|
298
303
|
fileData.url && URL.revokeObjectURL(fileData.url), filesData.value = filesData.value.filter((f) => f.file !== fileData.file), emits("remove", fileData.file);
|
|
299
304
|
}
|
|
300
|
-
const selectAreaCanBeDisplayed = ref(!0), dataTypesString = computed(() => __props.dataTypes?.map(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
+
}
|
|
308
340
|
function reset() {
|
|
309
341
|
filesData.value.forEach((fileData) => {
|
|
310
342
|
fileData.url && URL.revokeObjectURL(fileData.url);
|
|
@@ -317,7 +349,7 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
317
349
|
filesData.value = filesData.value.filter((f) => f.file !== file);
|
|
318
350
|
}
|
|
319
351
|
function isFileTypeAllowed(file) {
|
|
320
|
-
return !__props.dataTypes || __props.dataTypes.includes("*/*") ? !0 : __props.dataTypes.some((type) => type.endsWith("/*") ? file.type.startsWith(type.slice(0, -1)) : file.type === type);
|
|
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);
|
|
321
353
|
}
|
|
322
354
|
return __expose({
|
|
323
355
|
/**
|
|
@@ -376,12 +408,12 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
376
408
|
tabindex: "0",
|
|
377
409
|
for: `input-file-uploader-${unref(instanceId)}`,
|
|
378
410
|
class: normalizeClass(["m-dropzone m-reset-css", {
|
|
379
|
-
"m-dropzone--disabled":
|
|
411
|
+
"m-dropzone--disabled": __props.disabled,
|
|
380
412
|
"m-dropzone--is-over-drop-zone": unref(isOverDropZone) && !unref(isOverError),
|
|
381
413
|
"m-dropzone--is-over-error": unref(isOverError)
|
|
382
414
|
}]),
|
|
383
415
|
style: normalizeStyle({
|
|
384
|
-
"--active-color": `hsl(var(--maz-${
|
|
416
|
+
"--active-color": `hsl(var(--maz-${__props.color}))`
|
|
385
417
|
})
|
|
386
418
|
}, [
|
|
387
419
|
renderSlot(_ctx.$slots, "files-area", { filesData: filesData.value }, () => [
|
|
@@ -400,49 +432,52 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
400
432
|
}, ["prevent"]))
|
|
401
433
|
}, [
|
|
402
434
|
renderSlot(_ctx.$slots, "file-item", { file }, () => [
|
|
403
|
-
file.thumbnail &&
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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[3] || (_cache[3] = createElementVNode("div", { class: "m-dropzone__overlay" }, null, -1))
|
|
441
|
+
], 64)) : createCommentVNode("", !0),
|
|
409
442
|
createElementVNode("div", _hoisted_2, [
|
|
410
443
|
createVNode(Transition, { name: "icon-scale" }, {
|
|
411
444
|
default: withCtx(() => [
|
|
412
445
|
file.uploading ? (openBlock(), createBlock(unref(MazSpinner), mergeProps({
|
|
413
446
|
key: 0,
|
|
414
|
-
color:
|
|
447
|
+
color: __props.color,
|
|
415
448
|
class: "m-dropzone__spinner"
|
|
416
|
-
}, { ref_for: !0 },
|
|
449
|
+
}, { ref_for: !0 }, __props.spinnerProps), null, 16, ["color"])) : file.success ? (openBlock(), createBlock(unref(MazCheckCircle), {
|
|
417
450
|
key: 1,
|
|
418
451
|
class: "m-dropzone__success-icon"
|
|
419
452
|
})) : file.error ? (openBlock(), createBlock(unref(MazXCircle), {
|
|
420
453
|
key: 2,
|
|
421
454
|
class: "m-dropzone__error-icon"
|
|
422
|
-
})) : (openBlock(),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
+
]))
|
|
427
462
|
]),
|
|
428
463
|
_: 2
|
|
429
464
|
}, 1024)
|
|
430
465
|
]),
|
|
431
|
-
createElementVNode("div",
|
|
432
|
-
createElementVNode("div",
|
|
433
|
-
createElementVNode("span",
|
|
434
|
-
createElementVNode("span",
|
|
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)
|
|
435
470
|
]),
|
|
436
471
|
!file.uploading && !file.success ? (openBlock(), createBlock(MazBtn, mergeProps({
|
|
437
472
|
key: 0,
|
|
438
473
|
size: "xs",
|
|
439
|
-
"rounded-size": "full",
|
|
440
474
|
icon: unref(MazTrash),
|
|
441
|
-
disabled:
|
|
442
|
-
color:
|
|
443
|
-
|
|
475
|
+
disabled: __props.disabled,
|
|
476
|
+
color: "destructive",
|
|
477
|
+
pastel: ""
|
|
478
|
+
}, { ref_for: !0 }, __props.removeFileBtnProps, {
|
|
444
479
|
onClick: withModifiers(($event) => handleFileRemove(file), ["prevent"])
|
|
445
|
-
}), null, 16, ["icon", "disabled", "
|
|
480
|
+
}), null, 16, ["icon", "disabled", "onClick"])) : createCommentVNode("", !0)
|
|
446
481
|
])
|
|
447
482
|
], !0)
|
|
448
483
|
]))), 128))
|
|
@@ -454,30 +489,30 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
454
489
|
key: 0,
|
|
455
490
|
selectFile: handleFileInputClick
|
|
456
491
|
}, () => [
|
|
457
|
-
createElementVNode("div",
|
|
492
|
+
createElementVNode("div", _hoisted_8, [
|
|
458
493
|
renderSlot(_ctx.$slots, "upload-icon", {}, () => [
|
|
459
494
|
createVNode(unref(MazArrowUpOnSquare), { class: "m-dropzone__upload-icon" })
|
|
460
495
|
], !0),
|
|
461
|
-
createElementVNode("span",
|
|
496
|
+
createElementVNode("span", _hoisted_9, toDisplayString(messages.value.dragAndDrop), 1)
|
|
462
497
|
]),
|
|
463
|
-
createElementVNode("span",
|
|
498
|
+
createElementVNode("span", _hoisted_10, toDisplayString(messages.value.divider), 1),
|
|
464
499
|
createVNode(MazBtn, mergeProps({
|
|
465
|
-
disabled:
|
|
466
|
-
color:
|
|
467
|
-
},
|
|
500
|
+
disabled: __props.disabled,
|
|
501
|
+
color: __props.color
|
|
502
|
+
}, __props.selectFileBtnProps, { onClick: handleFileInputClick }), {
|
|
468
503
|
default: withCtx(() => [
|
|
469
504
|
createTextVNode(toDisplayString(messages.value.selectFile), 1)
|
|
470
505
|
]),
|
|
471
506
|
_: 1
|
|
472
507
|
}, 16, ["disabled", "color"]),
|
|
473
|
-
!allFileIsAccepted.value && (messages.value.fileMaxCount || messages.value.fileMaxSize || messages.value.fileTypes) ? (openBlock(), createElementBlock("p",
|
|
508
|
+
!allFileIsAccepted.value && (messages.value.fileMaxCount || messages.value.fileMaxSize || messages.value.fileTypes) ? (openBlock(), createElementBlock("p", _hoisted_11, [
|
|
474
509
|
messages.value.fileMaxCount ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
475
510
|
createTextVNode(toDisplayString(messages.value.fileMaxCount) + " ", 1),
|
|
476
|
-
messages.value.fileMaxSize || messages.value.fileTypes ? (openBlock(), createElementBlock("span",
|
|
511
|
+
messages.value.fileMaxSize || messages.value.fileTypes ? (openBlock(), createElementBlock("span", _hoisted_12, " - ")) : createCommentVNode("", !0)
|
|
477
512
|
], 64)) : createCommentVNode("", !0),
|
|
478
513
|
messages.value.fileMaxSize ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
479
514
|
createTextVNode(toDisplayString(messages.value.fileMaxSize) + " ", 1),
|
|
480
|
-
messages.value.fileTypes ? (openBlock(), createElementBlock("span",
|
|
515
|
+
messages.value.fileTypes ? (openBlock(), createElementBlock("span", _hoisted_13, " - ")) : createCommentVNode("", !0)
|
|
481
516
|
], 64)) : createCommentVNode("", !0),
|
|
482
517
|
messages.value.fileTypes ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
483
518
|
createTextVNode(toDisplayString(messages.value.fileTypes), 1)
|
|
@@ -490,15 +525,15 @@ import '../assets/MazDropzone._2HwHowu.css';const _hoisted_1 = ["for"], _hoisted
|
|
|
490
525
|
ref: fileInput,
|
|
491
526
|
multiple: hasMultiple.value,
|
|
492
527
|
type: "file",
|
|
493
|
-
accept:
|
|
528
|
+
accept: __props.dataTypes?.join(","),
|
|
494
529
|
tabindex: "-1",
|
|
495
|
-
disabled:
|
|
530
|
+
disabled: __props.disabled,
|
|
496
531
|
class: "m-dropzone__file-input",
|
|
497
532
|
onChange: handleFileUpload
|
|
498
|
-
}, null, 40,
|
|
533
|
+
}, null, 40, _hoisted_14)
|
|
499
534
|
], 14, _hoisted_1));
|
|
500
535
|
}
|
|
501
|
-
}), MazDropzone = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
536
|
+
}), MazDropzone = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2e1585c8"]]);
|
|
502
537
|
export {
|
|
503
538
|
MazDropzone as default
|
|
504
539
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MazUiTranslationsNestedSchema } from '@maz-ui/translations';
|
|
2
|
+
import { DeepPartial } from '@maz-ui/utils';
|
|
1
3
|
import { MazBtnProps } from './MazBtn.vue';
|
|
2
4
|
import { MazSpinnerProps } from './MazSpinner.vue';
|
|
3
5
|
import { MazColor } from './types';
|
|
@@ -51,23 +53,9 @@ export type MazDropzoneProps = {
|
|
|
51
53
|
/**
|
|
52
54
|
* Translations
|
|
53
55
|
* @description Custom translations for the component
|
|
54
|
-
* @
|
|
55
|
-
* dragAndDrop: 'Drag and drop your files',
|
|
56
|
-
* fileMaxCount: 'Maximum {count} files',
|
|
57
|
-
* fileMaxSize: 'Maximum {size} MB',
|
|
58
|
-
* fileTypes: 'Allowed file types: {types}',
|
|
59
|
-
* selectFile: 'Select file',
|
|
60
|
-
* divider: 'or'
|
|
61
|
-
* }
|
|
56
|
+
* @type {Partial<MazUiTranslationsNestedSchema['dropzone']>}
|
|
62
57
|
*/
|
|
63
|
-
translations?:
|
|
64
|
-
dragAndDrop?: string;
|
|
65
|
-
fileMaxCount?: string;
|
|
66
|
-
fileMaxSize?: string;
|
|
67
|
-
fileTypes?: string;
|
|
68
|
-
selectFile?: string;
|
|
69
|
-
divider?: string;
|
|
70
|
-
};
|
|
58
|
+
translations?: DeepPartial<MazUiTranslationsNestedSchema['dropzone']>;
|
|
71
59
|
/**
|
|
72
60
|
* Main color of the component
|
|
73
61
|
* @default 'primary'
|
|
@@ -109,6 +97,12 @@ export type MazDropzoneProps = {
|
|
|
109
97
|
* Transform the body of the request
|
|
110
98
|
*/
|
|
111
99
|
transformBody?: (formData: FormData) => RequestInit['body'];
|
|
100
|
+
/**
|
|
101
|
+
* Maximum number of concurrent uploads
|
|
102
|
+
* @description Limit the number of files uploaded simultaneously to avoid overwhelming the server
|
|
103
|
+
* @default 5
|
|
104
|
+
*/
|
|
105
|
+
maxConcurrentUploads?: number;
|
|
112
106
|
};
|
|
113
107
|
export interface MazDropzoneFileData {
|
|
114
108
|
file: File;
|
|
@@ -29,7 +29,7 @@ import '../assets/MazExpandAnimation.DYyRTW8i.css';const _hoisted_1 = ["aria-hid
|
|
|
29
29
|
class: normalizeClass(["m-expand-animation m-reset-css", { "m-expand-animation--expanded": isOpen.value }]),
|
|
30
30
|
"aria-hidden": !isOpen.value,
|
|
31
31
|
role: "region",
|
|
32
|
-
style: normalizeStyle([{ "--expand-animation-duration":
|
|
32
|
+
style: normalizeStyle([{ "--expand-animation-duration": __props.duration, "--expand-animation-timing-function": __props.timingFunction }])
|
|
33
33
|
}, [
|
|
34
34
|
createElementVNode("div", mergeProps({ class: "m-expand-animation__inner" }, _ctx.$attrs, {
|
|
35
35
|
class: {
|
|
@@ -20,11 +20,11 @@ import '../assets/MazFullscreenLoader.W0InbLUf.css';const _hoisted_1 = { key: 0
|
|
|
20
20
|
addClassToDocument();
|
|
21
21
|
}), onUnmounted(() => {
|
|
22
22
|
removeClassFromDocument();
|
|
23
|
-
}), (_ctx, _cache) => (openBlock(), createBlock(Teleport, { to:
|
|
23
|
+
}), (_ctx, _cache) => (openBlock(), createBlock(Teleport, { to: __props.teleportSelector }, [
|
|
24
24
|
createElementVNode("div", mergeProps({ class: "m-fullscreen-loader m-reset-css" }, _ctx.$attrs), [
|
|
25
25
|
createVNode(MazSpinner, {
|
|
26
|
-
color:
|
|
27
|
-
size:
|
|
26
|
+
color: __props.color,
|
|
27
|
+
size: __props.size
|
|
28
28
|
}, null, 8, ["color", "size"]),
|
|
29
29
|
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
30
30
|
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, onBeforeMount, computed, createElementBlock, createCommentVNode, openBlock, normalizeStyle, normalizeClass, createElementVNode, Fragment, renderList, withDirectives, unref, toDisplayString, createVNode } from "vue";
|
|
2
2
|
import { MazNoImage } from "@maz-ui/icons";
|
|
3
3
|
import { d as directive } from "../chunks/lazy-img.directive.BLFnGqQa.js";
|
|
4
|
-
import { d as directive$1 } from "../chunks/fullscreen-img.directive.
|
|
4
|
+
import { d as directive$1 } from "../chunks/fullscreen-img.directive.BqO7XUdi.js";
|
|
5
5
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
6
6
|
import '../assets/MazGallery.BcmVxLFj.css';const _hoisted_1 = { class: "m-gallery__wrapper maz-flex maz-flex-1" }, _hoisted_2 = ["alt"], _hoisted_3 = {
|
|
7
7
|
key: 0,
|
|
@@ -43,12 +43,12 @@ import '../assets/MazGallery.BcmVxLFj.css';const _hoisted_1 = { class: "m-galler
|
|
|
43
43
|
function shouldHaveRemainingLayer(index) {
|
|
44
44
|
return __props.remaining ? (numberImagesRemaining.value && index + 1) === imagesShown.value.length : !1;
|
|
45
45
|
}
|
|
46
|
-
return (_ctx, _cache) =>
|
|
46
|
+
return (_ctx, _cache) => __props.images.length > 0 || __props.hasEmptyLayer ? (openBlock(), createElementBlock("div", {
|
|
47
47
|
key: 0,
|
|
48
|
-
class: normalizeClass(["m-gallery m-reset-css", { "--radius":
|
|
48
|
+
class: normalizeClass(["m-gallery m-reset-css", { "--radius": __props.radius, "--has-background-color": !!__props.backgroundColor }]),
|
|
49
49
|
style: normalizeStyle([sizeStyle.value, {
|
|
50
|
-
"--gallery-separator-color":
|
|
51
|
-
"--gallery-background-color":
|
|
50
|
+
"--gallery-separator-color": __props.separatorColor,
|
|
51
|
+
"--gallery-background-color": __props.backgroundColor
|
|
52
52
|
}])
|
|
53
53
|
}, [
|
|
54
54
|
createElementVNode("section", _hoisted_1, [
|
|
@@ -62,13 +62,13 @@ import '../assets/MazGallery.BcmVxLFj.css';const _hoisted_1 = { class: "m-galler
|
|
|
62
62
|
alt: image.alt,
|
|
63
63
|
loading: "lazy"
|
|
64
64
|
}, null, 8, _hoisted_2), [
|
|
65
|
-
[unref(directive), { src: image.thumbnail, disabled: !
|
|
65
|
+
[unref(directive), { src: image.thumbnail, disabled: !__props.lazy }, "bg-image"],
|
|
66
66
|
[unref(directive$1), {
|
|
67
67
|
src: image.src,
|
|
68
68
|
alt: image.alt,
|
|
69
|
-
disabled: !
|
|
70
|
-
blurOnHover:
|
|
71
|
-
scaleOnHover:
|
|
69
|
+
disabled: !__props.zoom || shouldHaveRemainingLayer(i),
|
|
70
|
+
blurOnHover: __props.blur,
|
|
71
|
+
scaleOnHover: __props.scale
|
|
72
72
|
}]
|
|
73
73
|
]),
|
|
74
74
|
shouldHaveRemainingLayer(i) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [
|
|
@@ -77,15 +77,15 @@ import '../assets/MazGallery.BcmVxLFj.css';const _hoisted_1 = { class: "m-galler
|
|
|
77
77
|
[unref(directive$1), {
|
|
78
78
|
src: image.src,
|
|
79
79
|
alt: image.alt,
|
|
80
|
-
disabled: !
|
|
80
|
+
disabled: !__props.zoom,
|
|
81
81
|
blurOnHover: !1,
|
|
82
|
-
scaleOnHover:
|
|
82
|
+
scaleOnHover: __props.scale
|
|
83
83
|
}]
|
|
84
84
|
]) : createCommentVNode("", !0)
|
|
85
85
|
], 2))), 128)),
|
|
86
|
-
|
|
86
|
+
__props.hasEmptyLayer && __props.images.length === 0 ? (openBlock(), createElementBlock("div", {
|
|
87
87
|
key: 0,
|
|
88
|
-
class: normalizeClass(["m-gallery__empty-layer", { "maz-rounded-xl":
|
|
88
|
+
class: normalizeClass(["m-gallery__empty-layer", { "maz-rounded-xl": __props.radius }]),
|
|
89
89
|
style: normalizeStyle([sizeStyle.value])
|
|
90
90
|
}, [
|
|
91
91
|
createVNode(unref(MazNoImage), { class: "maz-size-8" })
|
|
@@ -95,7 +95,7 @@ import '../assets/MazGallery.BcmVxLFj.css';const _hoisted_1 = { class: "m-galler
|
|
|
95
95
|
key: i,
|
|
96
96
|
class: "m-gallery__hidden"
|
|
97
97
|
})), [
|
|
98
|
-
[unref(directive$1), { src: image.src, disabled: !
|
|
98
|
+
[unref(directive$1), { src: image.src, disabled: !__props.zoom }]
|
|
99
99
|
])), 128))
|
|
100
100
|
], 6)) : createCommentVNode("", !0);
|
|
101
101
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onMounted, watchEffect, createElementBlock,
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, watchEffect, createElementBlock, createBlock, openBlock, mergeProps, resolveDynamicComponent, normalizeStyle, normalizeClass, nextTick } from "vue";
|
|
2
2
|
import { useInjectStrict } from "../composables/useInjectStrict.js";
|
|
3
3
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazIcon.
|
|
4
|
+
import '../assets/MazIcon.Cl1pfRbK.css';const _hoisted_1 = ["innerHTML"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "MazIcon",
|
|
6
6
|
props: {
|
|
7
|
+
icon: { type: [Function, Object] },
|
|
7
8
|
src: {},
|
|
8
9
|
path: {},
|
|
9
10
|
name: {},
|
|
@@ -13,7 +14,7 @@ import '../assets/MazIcon.3Pn7omz5.css';const _hoisted_1 = ["innerHTML"], _sfc_m
|
|
|
13
14
|
},
|
|
14
15
|
emits: ["loaded", "unloaded", "error"],
|
|
15
16
|
setup(__props, { emit: __emit }) {
|
|
16
|
-
const emits = __emit, cache = {}, svgElSource = ref(), svgElem = ref();
|
|
17
|
+
const emits = __emit, predefinedSizes = ["xs", "sm", "md", "lg", "xl"], cache = {}, svgElSource = ref(), svgElem = ref();
|
|
17
18
|
function getMazIconPath() {
|
|
18
19
|
try {
|
|
19
20
|
return useInjectStrict("mazIconPath");
|
|
@@ -21,9 +22,12 @@ import '../assets/MazIcon.3Pn7omz5.css';const _hoisted_1 = ["innerHTML"], _sfc_m
|
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
const iconPath = computed(() => __props.path ?? getMazIconPath()), fullSrc = computed(() =>
|
|
25
|
+
const iconPath = computed(() => __props.path ?? getMazIconPath()), fullSrc = computed(() => {
|
|
26
|
+
if (!__props.icon)
|
|
27
|
+
return __props.src ? __props.src : iconPath.value ? `${iconPath.value}/${__props.name}.svg` : `/${__props.name}.svg`;
|
|
28
|
+
});
|
|
25
29
|
onMounted(() => {
|
|
26
|
-
!__props.name && !__props.src && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
|
|
30
|
+
(__props.icon && __props.src || __props.icon && __props.name) && console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop'), !__props.icon && !__props.name && !__props.src && console.error('[maz-ui](MazIcon) you should provide "icon", "name" or "src" as prop');
|
|
27
31
|
});
|
|
28
32
|
function setTitle(svg, title) {
|
|
29
33
|
const titleTags = svg.querySelectorAll("title");
|
|
@@ -74,22 +78,37 @@ import '../assets/MazIcon.3Pn7omz5.css';const _hoisted_1 = ["innerHTML"], _sfc_m
|
|
|
74
78
|
}), request.addEventListener("error", (error) => reject(error)), request.send();
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
|
-
|
|
81
|
+
const svgStyle = computed(() => {
|
|
82
|
+
if (!(__props.size && predefinedSizes.includes(__props.size)))
|
|
83
|
+
return {
|
|
84
|
+
fontSize: __props.size
|
|
85
|
+
};
|
|
86
|
+
}), svgClasses = computed(() => {
|
|
87
|
+
if (__props.size && predefinedSizes.includes(__props.size))
|
|
88
|
+
return `m-icon--${__props.size}`;
|
|
89
|
+
});
|
|
90
|
+
return watchEffect(() => {
|
|
91
|
+
fullSrc.value && getSource(fullSrc.value);
|
|
92
|
+
}), (_ctx, _cache) => svgElSource.value ? (openBlock(), createElementBlock("svg", mergeProps({
|
|
78
93
|
key: 0,
|
|
79
94
|
ref_key: "svgElem",
|
|
80
95
|
ref: svgElem,
|
|
81
|
-
class: "m-icon m-reset-css",
|
|
96
|
+
class: ["m-icon m-reset-css", svgClasses.value],
|
|
82
97
|
width: "1em",
|
|
83
98
|
height: "1em"
|
|
84
99
|
}, {
|
|
85
100
|
...getSvgAttrs(svgElSource.value),
|
|
86
101
|
...filterAttrs(_ctx.$attrs)
|
|
87
102
|
}, {
|
|
88
|
-
style:
|
|
103
|
+
style: svgStyle.value,
|
|
89
104
|
innerHTML: getSvgContent(svgElSource.value)
|
|
90
|
-
}), null, 16, _hoisted_1)) :
|
|
105
|
+
}), null, 16, _hoisted_1)) : (openBlock(), createBlock(resolveDynamicComponent(__props.icon), {
|
|
106
|
+
key: 1,
|
|
107
|
+
class: normalizeClass(["m-icon m-reset-css", svgClasses.value]),
|
|
108
|
+
style: normalizeStyle(svgStyle.value)
|
|
109
|
+
}, null, 8, ["class", "style"]));
|
|
91
110
|
}
|
|
92
|
-
}), MazIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
111
|
+
}), MazIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ab2a19f1"]]);
|
|
93
112
|
export {
|
|
94
113
|
MazIcon as default
|
|
95
114
|
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
import { IconComponent } from '@maz-ui/icons';
|
|
2
|
+
declare const predefinedSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
3
|
+
type SizeUnit = `${number}px` | `${number}em` | `${number}rem` | `${number}%` | `${number}vw` | `${number}vh` | `${number}cm` | `${number}mm` | `${number}in` | `${number}pt` | `${number}pc` | `${number}ex`;
|
|
4
|
+
type PredefinedSize = typeof predefinedSizes[number];
|
|
5
|
+
type MazIconSize = SizeUnit | PredefinedSize;
|
|
1
6
|
export interface MazIconProps {
|
|
7
|
+
/** The icon component to render - e.g: `import { MazStar } from '@maz-ui/icons'` */
|
|
8
|
+
icon?: IconComponent;
|
|
2
9
|
/** The source path of the SVG file - e.g: `/icons/home.svg` */
|
|
3
10
|
src?: string;
|
|
4
11
|
/** The path of the folder where the SVG files are stored - e.g: `/icons` */
|
|
5
12
|
path?: string;
|
|
6
13
|
/** The name of the SVG file - e.g: `home` */
|
|
7
14
|
name?: string;
|
|
8
|
-
/** The size of the SVG file - e.g: `1em` */
|
|
9
|
-
size?:
|
|
15
|
+
/** The size of the SVG file - e.g: `1em` or can be a predefined size: `'xs' | 'sm' | 'md' | 'lg' | 'xl'` */
|
|
16
|
+
size?: MazIconSize;
|
|
10
17
|
/** The title of the SVG file - e.g: `Home` */
|
|
11
18
|
title?: string;
|
|
12
19
|
/** The function to transform the source of the SVG file - e.g: `(svg) => svg` */
|