maz-ui 3.9.0 → 3.10.0
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/components/MazAvatar.mjs +22 -185
- package/components/MazAvatar.umd.js +2 -2
- package/components/MazBackdrop.mjs +1 -1
- package/components/MazBackdrop.umd.js +1 -1
- package/components/MazBadge.mjs +3 -3
- package/components/MazBadge.umd.js +2 -2
- package/components/MazBottomSheet.mjs +60 -33
- package/components/MazBottomSheet.umd.js +2 -2
- package/components/MazBtn.mjs +25 -20
- package/components/MazBtn.umd.js +2 -2
- package/components/MazCard.mjs +255 -231
- package/components/MazCard.umd.js +2 -2
- package/components/MazCarousel.mjs +93 -38
- package/components/MazCarousel.umd.js +2 -2
- package/components/MazChart.mjs +43 -25
- package/components/MazChart.umd.js +1 -2
- package/components/MazCheckbox.mjs +3 -3
- package/components/MazCheckbox.umd.js +2 -2
- package/components/MazDialog.mjs +61 -34
- package/components/MazDialog.umd.js +2 -2
- package/components/MazDialogPromise.mjs +75 -58
- package/components/MazDialogPromise.umd.js +2 -2
- package/components/MazDrawer.mjs +57 -30
- package/components/MazDrawer.umd.js +2 -2
- package/components/MazDropzone.mjs +4 -4
- package/components/MazDropzone.umd.js +2 -2
- package/components/MazGallery.mjs +16 -181
- package/components/MazGallery.umd.js +2 -2
- package/components/MazIcon.mjs +7 -2
- package/components/MazIcon.umd.js +2 -2
- package/components/MazInput.mjs +46 -40
- package/components/MazInput.umd.js +2 -2
- package/components/MazInputNumber.mjs +175 -125
- package/components/MazInputNumber.umd.js +2 -2
- package/components/MazInputPrice.mjs +97 -91
- package/components/MazInputPrice.umd.js +2 -2
- package/components/MazInputTags.mjs +135 -107
- package/components/MazInputTags.umd.js +2 -2
- package/components/MazLazyImg.mjs +9 -9
- package/components/MazLazyImg.umd.js +2 -2
- package/components/MazPhoneNumberInput.mjs +165 -90
- package/components/MazPhoneNumberInput.umd.js +2 -2
- package/components/MazPicker.mjs +349 -261
- package/components/MazPicker.umd.js +2 -2
- package/components/MazRadioButtons.mjs +3 -3
- package/components/MazRadioButtons.umd.js +2 -2
- package/components/MazSelect.mjs +155 -80
- package/components/MazSelect.umd.js +2 -2
- package/components/MazSlider.mjs +6 -6
- package/components/MazSlider.umd.js +2 -2
- package/components/MazSpinner.mjs +4 -4
- package/components/MazSpinner.umd.js +2 -2
- package/components/MazStepper.mjs +16 -11
- package/components/MazStepper.umd.js +2 -2
- package/components/MazSwitch.mjs +6 -6
- package/components/MazSwitch.umd.js +2 -2
- package/components/MazTabsBar.mjs +29 -24
- package/components/MazTabsBar.umd.js +2 -2
- package/components/MazTabsContent.mjs +7 -2
- package/components/MazTabsContent.umd.js +2 -2
- package/components/MazTabsContentItem.mjs +5 -5
- package/components/MazTabsContentItem.umd.js +2 -2
- package/components/MazTextarea.mjs +26 -17
- package/components/MazTextarea.umd.js +2 -2
- package/components/MazTransitionExpand.mjs +3 -3
- package/components/MazTransitionExpand.umd.js +2 -2
- package/components/assets/check-ac2fdfbb.mjs +31 -0
- package/components/assets/eye-ac35bb54.mjs +44 -0
- package/components/assets/eye-off-4a5fd13d.mjs +31 -0
- package/components/assets/no-photography-7a1e4d68.mjs +36 -0
- package/components/assets/pencil-c1aa23f9.mjs +31 -0
- package/modules/assets/no-photography-7a1e4d68.mjs +36 -0
- package/modules/{maz-ui.mjs → index.mjs} +130 -191
- package/modules/index.umd.js +2 -0
- package/nuxt/index.ts +130 -0
- package/nuxt/runtime/composables/use-toast.ts +8 -0
- package/nuxt/runtime/plugins/toaster.ts +26 -0
- package/package.json +91 -62
- package/tailwindcss/{tailwind.config.js → tailwind.config.ts} +13 -9
- package/tailwindcss/tailwind.css +4 -0
- package/tailwindcss/utils/colors.ts +20 -0
- package/tailwindcss/variables/{breakpoints.js → breakpoints.ts} +1 -1
- package/tailwindcss/variables/colors.ts +44 -0
- package/tailwindcss/variables/{utilities.js → utilities.ts} +1 -1
- package/tailwindcss/variables/{z-indexes.js → z-indexes.ts} +1 -1
- package/components/MazAvatar.d.ts +0 -161
- package/components/MazBackdrop.d.ts +0 -92
- package/components/MazBadge.d.ts +0 -78
- package/components/MazBottomSheet.d.ts +0 -41
- package/components/MazBtn.d.ts +0 -183
- package/components/MazCard.d.ts +0 -199
- package/components/MazCarousel.d.ts +0 -29
- package/components/MazChart.d.ts +0 -22
- package/components/MazCheckbox.d.ts +0 -59
- package/components/MazDialog.d.ts +0 -96
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +0 -30
- package/components/MazDialogPromise.d.ts +0 -77
- package/components/MazDrawer.d.ts +0 -74
- package/components/MazDropzone.d.ts +0 -129
- package/components/MazGallery.d.ts +0 -126
- package/components/MazIcon.d.ts +0 -65
- package/components/MazInput.d.ts +0 -277
- package/components/MazInputNumber.d.ts +0 -66
- package/components/MazInputPrice.d.ts +0 -74
- package/components/MazInputTags.d.ts +0 -95
- package/components/MazLazyImg.d.ts +0 -82
- package/components/MazPhoneNumberInput/constantes/locales.d.ts +0 -12
- package/components/MazPhoneNumberInput/types.d.ts +0 -21
- package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +0 -2
- package/components/MazPhoneNumberInput/utils/index.d.ts +0 -12
- package/components/MazPhoneNumberInput.d.ts +0 -254
- package/components/MazPicker/MazPickerCalendar.vue.d.ts +0 -136
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +0 -21
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +0 -113
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +0 -123
- package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +0 -37
- package/components/MazPicker/MazPickerContainer.vue.d.ts +0 -211
- package/components/MazPicker/MazPickerFooter.vue.d.ts +0 -17
- package/components/MazPicker/MazPickerHeader.vue.d.ts +0 -83
- package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +0 -42
- package/components/MazPicker/MazPickerShortcuts.vue.d.ts +0 -61
- package/components/MazPicker/MazPickerTime.vue.d.ts +0 -128
- package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +0 -34
- package/components/MazPicker/types.d.ts +0 -15
- package/components/MazPicker/utils.d.ts +0 -54
- package/components/MazPicker.d.ts +0 -312
- package/components/MazRadioButtons.d.ts +0 -82
- package/components/MazSelect.d.ts +0 -191
- package/components/MazSlider/utils.d.ts +0 -15
- package/components/MazSlider.d.ts +0 -95
- package/components/MazSpinner.d.ts +0 -29
- package/components/MazStepper.d.ts +0 -119
- package/components/MazSwitch.d.ts +0 -55
- package/components/MazTabsBar.d.ts +0 -48
- package/components/MazTabsContent.d.ts +0 -26
- package/components/MazTabsContentItem.d.ts +0 -24
- package/components/MazTextarea/textarea-autogrow.d.ts +0 -9
- package/components/MazTextarea.d.ts +0 -124
- package/components/MazTransitionExpand.d.ts +0 -14
- package/components/assets/no-photography-584c6185.mjs +0 -4
- package/components/index.d.ts +0 -33
- package/components/index.mjs +0 -35
- package/components/types.d.ts +0 -17
- package/css/aos.css +0 -1
- package/css/main.css +0 -1
- package/maz-ui.d.ts +0 -318
- package/modules/assets/no-photography-584c6185.mjs +0 -4
- package/modules/maz-ui.umd.js +0 -2
- package/tailwindcss/utils/colors.js +0 -26
- package/tailwindcss/variables/colors.js +0 -44
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-toast-container{-webkit-box-sizing:border-box;box-sizing:border-box;position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.m-toast-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container{padding:1rem;z-index:1051}.m-toast-container.--top{top:
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-toast-container{-webkit-box-sizing:border-box;box-sizing:border-box;position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.m-toast-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container{padding:1rem;z-index:1051}.m-toast-container.--top{top:0;display:-webkit-box;display:-ms-flexbox;display:flex}.m-toast-container.--center{width:100%}@media (min-width: 768px){.m-toast-container.--center{position:fixed;left:50%;width:auto;-webkit-transform:translate(-50%,0);transform:translate(-50%)}}.m-toast-container.--bottom{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.m-toast-container.--bottom>:not([hidden])~:not([hidden]){margin-bottom:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-top:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container.--right{right:0;width:100%}@media (min-width: 768px){.m-toast-container.--right{width:auto}}.m-toast-container.--left{left:0;width:100%}@media (min-width: 768px){.m-toast-container.--left{width:auto}}.m-toast[data-v-ce23a6d4],.m-toast *[data-v-ce23a6d4]{-webkit-box-sizing:border-box;box-sizing:border-box}.m-toast[data-v-ce23a6d4]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:center;align-self:center;border-radius:var(--maz-border-radius);padding-left:.5rem;padding-right:.5rem;color:var(--maz-color-white);--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width: 768px){.m-toast.--left[data-v-ce23a6d4],.m-toast.--right[data-v-ce23a6d4]{width:20rem}.m-toast.--center[data-v-ce23a6d4]{width:20rem;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}}.m-toast__message-wrapper[data-v-ce23a6d4]{-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%;padding-top:.75rem;padding-bottom:.75rem}.m-toast__message[data-v-ce23a6d4]{margin:0;font-weight:500}.m-toast .--close[data-v-ce23a6d4]{margin-left:.25rem;display:-webkit-box;display:-ms-flexbox;display:flex;height:1.75rem;width:1.75rem;border-radius:var(--maz-border-radius);background-color:transparent;padding:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-toast .--close[data-v-ce23a6d4]:hover{background-color:#11182733}.m-toast .--close .--icon[data-v-ce23a6d4]{height:1.25rem;width:1.25rem;cursor:pointer}.m-toast.--info[data-v-ce23a6d4]{background-color:var(--maz-color-info);color:var(--maz-color-info-contrast)}.m-toast.--info[data-v-ce23a6d4]:hover{background-color:var(--maz-color-info-600)}.m-toast.--info .--close[data-v-ce23a6d4]{color:var(--maz-color-info-contrast)}.m-toast.--success[data-v-ce23a6d4]{background-color:var(--maz-color-success);color:var(--maz-color-success-contrast)}.m-toast.--success[data-v-ce23a6d4]:hover{background-color:var(--maz-color-success-600)}.m-toast.--success .--close[data-v-ce23a6d4]{color:var(--maz-color-success-contrast)}.m-toast.--warning[data-v-ce23a6d4]{background-color:var(--maz-color-warning);color:var(--maz-color-warning-contrast)}.m-toast.--warning[data-v-ce23a6d4]:hover{background-color:var(--maz-color-warning-600)}.m-toast.--warning .--close[data-v-ce23a6d4]{color:var(--maz-color-warning-contrast)}.m-toast.--danger[data-v-ce23a6d4]{background-color:var(--maz-color-danger);color:var(--maz-color-danger-contrast)}.m-toast.--danger[data-v-ce23a6d4]:hover{background-color:var(--maz-color-danger-600)}.m-toast.--danger .--close[data-v-ce23a6d4]{color:var(--maz-color-danger-contrast)}.m-slide-top-enter-active[data-v-ce23a6d4],.m-slide-top-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-top-enter-from[data-v-ce23a6d4],.m-slide-top-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.m-slide-bottom-enter-active[data-v-ce23a6d4],.m-slide-bottom-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-bottom-enter-from[data-v-ce23a6d4],.m-slide-bottom-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}.m-slide-right-enter-active[data-v-ce23a6d4],.m-slide-right-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-right-enter-from[data-v-ce23a6d4],.m-slide-right-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateX(100%);transform:translate(100%)}.m-slide-left-enter-active[data-v-ce23a6d4],.m-slide-left-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-left-enter-from[data-v-ce23a6d4],.m-slide-left-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateX(-100%);transform:translate(-100%)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}}();
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => {
|
|
5
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
6
|
return value;
|
|
7
7
|
};
|
|
8
|
-
import { inject, createVNode, render, nextTick, defineComponent, ref, computed, onMounted as onMounted$1,
|
|
8
|
+
import { inject, createVNode, render as render$1, nextTick, openBlock, createElementBlock, createElementVNode, defineComponent, ref, computed, onMounted as onMounted$1, createBlock, Transition, withCtx, withDirectives, normalizeClass, toDisplayString, unref, createCommentVNode, vShow } from "vue";
|
|
9
9
|
function injectStrict(key, fallback) {
|
|
10
10
|
const resolved = inject(key, fallback);
|
|
11
11
|
if (!resolved) {
|
|
@@ -71,13 +71,13 @@ function mount(component, {
|
|
|
71
71
|
if (app && app._context)
|
|
72
72
|
vNode.appContext = app._context;
|
|
73
73
|
if (el)
|
|
74
|
-
render(vNode, el);
|
|
74
|
+
render$1(vNode, el);
|
|
75
75
|
else if (typeof document !== "undefined") {
|
|
76
|
-
render(vNode, el = document.createElement("div"));
|
|
76
|
+
render$1(vNode, el = document.createElement("div"));
|
|
77
77
|
}
|
|
78
78
|
const destroy = () => {
|
|
79
79
|
if (el)
|
|
80
|
-
render(null, el);
|
|
80
|
+
render$1(null, el);
|
|
81
81
|
};
|
|
82
82
|
return { vNode, destroy, el };
|
|
83
83
|
}
|
|
@@ -322,6 +322,75 @@ const sleep$1 = (duration) => {
|
|
|
322
322
|
setTimeout(resolve, duration);
|
|
323
323
|
});
|
|
324
324
|
};
|
|
325
|
+
class ScriptLoader {
|
|
326
|
+
constructor({ src, identifier, once = true, async = true, defer = true }) {
|
|
327
|
+
__publicField(this, "src");
|
|
328
|
+
__publicField(this, "script");
|
|
329
|
+
__publicField(this, "once");
|
|
330
|
+
__publicField(this, "async");
|
|
331
|
+
__publicField(this, "defer");
|
|
332
|
+
__publicField(this, "identifier");
|
|
333
|
+
if (typeof window === "undefined") {
|
|
334
|
+
throw new TypeError("[ScriptLoader]: Is supported only on browser side");
|
|
335
|
+
}
|
|
336
|
+
if (!src) {
|
|
337
|
+
throw new Error('[ScriptLoader]: You should provide the attribut "src"');
|
|
338
|
+
}
|
|
339
|
+
if (!identifier) {
|
|
340
|
+
throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');
|
|
341
|
+
}
|
|
342
|
+
this.src = src;
|
|
343
|
+
this.identifier = identifier;
|
|
344
|
+
this.once = once;
|
|
345
|
+
this.async = async;
|
|
346
|
+
this.defer = defer;
|
|
347
|
+
}
|
|
348
|
+
removeTag(tag) {
|
|
349
|
+
var _a;
|
|
350
|
+
if (typeof tag === "string") {
|
|
351
|
+
(_a = document.head.querySelector(`[data-identifier="${tag}"]`)) == null ? void 0 : _a.remove();
|
|
352
|
+
} else {
|
|
353
|
+
tag.remove();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
load() {
|
|
357
|
+
const windowInstance = window;
|
|
358
|
+
const scriptTags = document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);
|
|
359
|
+
if (this.once && windowInstance[this.identifier] && scriptTags.length > 0) {
|
|
360
|
+
this.script = windowInstance[this.identifier];
|
|
361
|
+
return Promise.resolve(this.script);
|
|
362
|
+
}
|
|
363
|
+
if (!this.once && scriptTags.length > 0) {
|
|
364
|
+
for (const tag of scriptTags) {
|
|
365
|
+
this.removeTag(tag);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return this.injectScript();
|
|
369
|
+
}
|
|
370
|
+
injectScript() {
|
|
371
|
+
const windowInstance = window;
|
|
372
|
+
return new Promise((resolve, reject) => {
|
|
373
|
+
try {
|
|
374
|
+
const script = document.createElement("script");
|
|
375
|
+
script.src = this.src;
|
|
376
|
+
script.async = this.async;
|
|
377
|
+
script.defer = this.defer;
|
|
378
|
+
script.dataset.identifier = this.identifier;
|
|
379
|
+
script.addEventListener("error", (error) => {
|
|
380
|
+
return reject(new Error(`[ScriptLoader](injectScript) ${error.message}`));
|
|
381
|
+
});
|
|
382
|
+
script.addEventListener("load", (success) => {
|
|
383
|
+
this.script = success;
|
|
384
|
+
windowInstance[this.identifier] = success;
|
|
385
|
+
return resolve(success);
|
|
386
|
+
});
|
|
387
|
+
document.head.append(script);
|
|
388
|
+
} catch (error) {
|
|
389
|
+
throw new Error(`[ScriptLoader](init) ${error}`);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
325
394
|
const UNIQUE_ID = "__vue_click_away__";
|
|
326
395
|
const getEventType$1 = () => {
|
|
327
396
|
return document.ontouchstart === null ? "touchstart" : "click";
|
|
@@ -359,7 +428,7 @@ const directive$1 = {
|
|
|
359
428
|
updated: onUpdated,
|
|
360
429
|
unmounted: onUnmounted
|
|
361
430
|
};
|
|
362
|
-
const plugin$
|
|
431
|
+
const plugin$5 = {
|
|
363
432
|
install: (app) => {
|
|
364
433
|
app.directive("click-outside", directive$1);
|
|
365
434
|
}
|
|
@@ -401,7 +470,7 @@ const directive = {
|
|
|
401
470
|
mounted: bind,
|
|
402
471
|
unmounted: unbind
|
|
403
472
|
};
|
|
404
|
-
const plugin$
|
|
473
|
+
const plugin$4 = {
|
|
405
474
|
install: (app) => {
|
|
406
475
|
app.directive("closable", directive);
|
|
407
476
|
}
|
|
@@ -772,20 +841,20 @@ class VueZoomImg {
|
|
|
772
841
|
this.img.removeEventListener("load", this.onImgLoadedCallback);
|
|
773
842
|
}
|
|
774
843
|
}
|
|
775
|
-
let instance$
|
|
844
|
+
let instance$3;
|
|
776
845
|
const vZoomImg = {
|
|
777
846
|
created(el, binding) {
|
|
778
|
-
instance$
|
|
779
|
-
instance$
|
|
847
|
+
instance$3 = new VueZoomImg(binding);
|
|
848
|
+
instance$3.create(el);
|
|
780
849
|
},
|
|
781
850
|
updated(_el, binding) {
|
|
782
|
-
instance$
|
|
851
|
+
instance$3.update(binding);
|
|
783
852
|
},
|
|
784
853
|
unmounted(el) {
|
|
785
|
-
instance$
|
|
854
|
+
instance$3.remove(el);
|
|
786
855
|
}
|
|
787
856
|
};
|
|
788
|
-
const plugin$
|
|
857
|
+
const plugin$3 = {
|
|
789
858
|
install(app) {
|
|
790
859
|
app.directive("zoom-img", vZoomImg);
|
|
791
860
|
}
|
|
@@ -818,7 +887,7 @@ class LazyImg {
|
|
|
818
887
|
this.onImgErrorCallback = this.imageHasError.bind(this);
|
|
819
888
|
}
|
|
820
889
|
async loadErrorPhoto() {
|
|
821
|
-
const { default: photo } = await import("./assets/no-photography-
|
|
890
|
+
const { default: photo } = await import("./assets/no-photography-7a1e4d68.mjs");
|
|
822
891
|
return photo;
|
|
823
892
|
}
|
|
824
893
|
buildOptions(opts) {
|
|
@@ -1018,22 +1087,22 @@ class LazyImg {
|
|
|
1018
1087
|
this.observers = [];
|
|
1019
1088
|
}
|
|
1020
1089
|
}
|
|
1021
|
-
let instance$
|
|
1090
|
+
let instance$2;
|
|
1022
1091
|
const vLazyImg = {
|
|
1023
1092
|
created(el, binding) {
|
|
1024
1093
|
const options = typeof binding.value === "object" ? binding.value : {};
|
|
1025
|
-
instance$
|
|
1026
|
-
instance$
|
|
1094
|
+
instance$2 = new LazyImg(options);
|
|
1095
|
+
instance$2.add(el, binding);
|
|
1027
1096
|
},
|
|
1028
1097
|
updated(el, binding) {
|
|
1029
|
-
instance$
|
|
1098
|
+
instance$2.update(el, binding);
|
|
1030
1099
|
},
|
|
1031
1100
|
unmounted(el, binding) {
|
|
1032
|
-
instance$
|
|
1101
|
+
instance$2.remove(el, binding);
|
|
1033
1102
|
}
|
|
1034
1103
|
};
|
|
1035
1104
|
const DIRECTIVE_NAME = "lazy-img";
|
|
1036
|
-
const plugin$
|
|
1105
|
+
const plugin$2 = {
|
|
1037
1106
|
install(app, opts = {}) {
|
|
1038
1107
|
const options = {
|
|
1039
1108
|
...DEFAULT_OPTIONS$5,
|
|
@@ -1197,160 +1266,32 @@ class ToasterTimer {
|
|
|
1197
1266
|
clearTimeout(this.timer);
|
|
1198
1267
|
}
|
|
1199
1268
|
}
|
|
1200
|
-
const _hoisted_1$1 =
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1269
|
+
const _hoisted_1$1 = {
|
|
1270
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1271
|
+
fill: "none",
|
|
1272
|
+
stroke: "currentColor",
|
|
1273
|
+
"aria-hidden": "true",
|
|
1274
|
+
viewBox: "0 0 24 24"
|
|
1275
|
+
};
|
|
1276
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode(
|
|
1277
|
+
"path",
|
|
1278
|
+
{
|
|
1279
|
+
"stroke-linecap": "round",
|
|
1280
|
+
"stroke-linejoin": "round",
|
|
1281
|
+
"stroke-width": "2",
|
|
1282
|
+
d: "M6 18 18 6M6 6l12 12"
|
|
1213
1283
|
},
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
|
-
const iconPath = computed(() => props.path ?? getMazIconPath());
|
|
1228
|
-
const fullSrc = computed(() => {
|
|
1229
|
-
if (props.src) {
|
|
1230
|
-
return props.src;
|
|
1231
|
-
} else if (iconPath.value) {
|
|
1232
|
-
return `${iconPath.value}/${props.name}.svg`;
|
|
1233
|
-
} else {
|
|
1234
|
-
return `/${props.name}.svg`;
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
onMounted$1(() => {
|
|
1238
|
-
if (!props.name && !props.src) {
|
|
1239
|
-
console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
const setTitle = (svg, title) => {
|
|
1243
|
-
const titleTags = svg.querySelectorAll("title");
|
|
1244
|
-
if (titleTags.length > 0) {
|
|
1245
|
-
titleTags[0].textContent = title;
|
|
1246
|
-
} else {
|
|
1247
|
-
const titleEl = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
1248
|
-
titleEl.textContent = title;
|
|
1249
|
-
svg.append(titleEl);
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
const filterAttrs = (attrs) => {
|
|
1253
|
-
return Object.keys(attrs).reduce((result, key) => {
|
|
1254
|
-
if (attrs[key] !== false && attrs[key] !== null && attrs[key] !== void 0) {
|
|
1255
|
-
result[key] = attrs[key];
|
|
1256
|
-
}
|
|
1257
|
-
return result;
|
|
1258
|
-
}, {});
|
|
1259
|
-
};
|
|
1260
|
-
const getSvgAttrs = (svgEl) => {
|
|
1261
|
-
const svgAttrs = {};
|
|
1262
|
-
const attrs = svgEl.attributes;
|
|
1263
|
-
if (!attrs) {
|
|
1264
|
-
return svgAttrs;
|
|
1265
|
-
}
|
|
1266
|
-
for (let i = attrs.length - 1; i >= 0; i--) {
|
|
1267
|
-
svgAttrs[attrs[i].name] = attrs[i].value;
|
|
1268
|
-
}
|
|
1269
|
-
return svgAttrs;
|
|
1270
|
-
};
|
|
1271
|
-
const getSvgContent = (svgEl) => {
|
|
1272
|
-
let svgElNode = svgEl.cloneNode(true);
|
|
1273
|
-
svgElNode = props.transformSource(svgEl);
|
|
1274
|
-
if (props.title) {
|
|
1275
|
-
setTitle(svgElNode, props.title);
|
|
1276
|
-
}
|
|
1277
|
-
return svgEl.innerHTML;
|
|
1278
|
-
};
|
|
1279
|
-
const getSource = async (src) => {
|
|
1280
|
-
if (!cache[src]) {
|
|
1281
|
-
cache[src] = download(src);
|
|
1282
|
-
}
|
|
1283
|
-
try {
|
|
1284
|
-
svgElSource.value = await cache[src];
|
|
1285
|
-
await nextTick();
|
|
1286
|
-
emits("loaded", svgElem.value);
|
|
1287
|
-
} catch (error) {
|
|
1288
|
-
if (svgElSource.value) {
|
|
1289
|
-
svgElSource.value = void 0;
|
|
1290
|
-
emits("unloaded");
|
|
1291
|
-
}
|
|
1292
|
-
delete cache[src];
|
|
1293
|
-
emits("error", error);
|
|
1294
|
-
}
|
|
1295
|
-
};
|
|
1296
|
-
const download = (url) => {
|
|
1297
|
-
return new Promise((resolve, reject) => {
|
|
1298
|
-
const request = new XMLHttpRequest();
|
|
1299
|
-
request.open("GET", url, true);
|
|
1300
|
-
request.addEventListener("load", () => {
|
|
1301
|
-
if (request.status >= 200 && request.status < 400) {
|
|
1302
|
-
try {
|
|
1303
|
-
const parser = new DOMParser();
|
|
1304
|
-
const result = parser.parseFromString(request.responseText, "text/xml");
|
|
1305
|
-
let svgEl = result.querySelectorAll("svg")[0];
|
|
1306
|
-
if (svgEl) {
|
|
1307
|
-
svgEl = props.transformSource(svgEl);
|
|
1308
|
-
resolve(svgEl);
|
|
1309
|
-
} else {
|
|
1310
|
-
reject(new Error('Loaded file is not valid SVG"'));
|
|
1311
|
-
}
|
|
1312
|
-
} catch (error) {
|
|
1313
|
-
reject(error);
|
|
1314
|
-
}
|
|
1315
|
-
} else {
|
|
1316
|
-
reject(new Error("Error loading SVG"));
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
request.addEventListener("error", () => reject());
|
|
1320
|
-
request.send();
|
|
1321
|
-
});
|
|
1322
|
-
};
|
|
1323
|
-
watchEffect(() => getSource(fullSrc.value));
|
|
1324
|
-
return (_ctx, _cache) => {
|
|
1325
|
-
return openBlock(), createElementBlock(
|
|
1326
|
-
Fragment,
|
|
1327
|
-
null,
|
|
1328
|
-
[
|
|
1329
|
-
createCommentVNode(" eslint-disable vue/no-v-html "),
|
|
1330
|
-
createCommentVNode(" eslint-disable vue/html-self-closing "),
|
|
1331
|
-
svgElSource.value ? (openBlock(), createElementBlock("svg", mergeProps({
|
|
1332
|
-
key: 0,
|
|
1333
|
-
ref_key: "svgElem",
|
|
1334
|
-
ref: svgElem,
|
|
1335
|
-
width: "1em",
|
|
1336
|
-
height: "1em"
|
|
1337
|
-
}, {
|
|
1338
|
-
...getSvgAttrs(svgElSource.value),
|
|
1339
|
-
...filterAttrs(_ctx.$attrs)
|
|
1340
|
-
}, {
|
|
1341
|
-
style: `font-size: ${__props.size}`,
|
|
1342
|
-
innerHTML: getSvgContent(svgElSource.value)
|
|
1343
|
-
}), null, 16, _hoisted_1$1)) : createCommentVNode("v-if", true),
|
|
1344
|
-
createCommentVNode(" eslint-enable vue/no-v-html "),
|
|
1345
|
-
createCommentVNode(" eslint-enable vue/html-self-closing ")
|
|
1346
|
-
],
|
|
1347
|
-
2112
|
|
1348
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
1349
|
-
);
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
});
|
|
1353
|
-
const XIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIGFyaWEtaGlkZGVuPSJ0cnVlIj4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTYgMThMMTggNk02IDZsMTIgMTIiLz4KPC9zdmc+Cg==";
|
|
1284
|
+
null,
|
|
1285
|
+
-1
|
|
1286
|
+
/* HOISTED */
|
|
1287
|
+
);
|
|
1288
|
+
const _hoisted_3$1 = [
|
|
1289
|
+
_hoisted_2$1
|
|
1290
|
+
];
|
|
1291
|
+
function render(_ctx, _cache) {
|
|
1292
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
|
1293
|
+
}
|
|
1294
|
+
const XIcon = { render };
|
|
1354
1295
|
const _hoisted_1 = { class: "m-toast__message-wrapper" };
|
|
1355
1296
|
const _hoisted_2 = { class: "m-toast__message" };
|
|
1356
1297
|
const _hoisted_3 = {
|
|
@@ -1470,7 +1411,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1470
1411
|
});
|
|
1471
1412
|
return (_ctx, _cache) => {
|
|
1472
1413
|
return openBlock(), createBlock(Transition, {
|
|
1473
|
-
name:
|
|
1414
|
+
name: transitionName.value,
|
|
1474
1415
|
persisted: ""
|
|
1475
1416
|
}, {
|
|
1476
1417
|
default: withCtx(() => [
|
|
@@ -1479,7 +1420,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1479
1420
|
{
|
|
1480
1421
|
ref_key: "Toaster",
|
|
1481
1422
|
ref: Toaster,
|
|
1482
|
-
class: normalizeClass(["m-toast", [`--${__props.type}`, `--${
|
|
1423
|
+
class: normalizeClass(["m-toast", [`--${__props.type}`, `--${positionY.value}`, `--${positionX.value}`]]),
|
|
1483
1424
|
role: "alert",
|
|
1484
1425
|
onMouseover: _cache[0] || (_cache[0] = ($event) => toggleTimer(true)),
|
|
1485
1426
|
onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleTimer(false)),
|
|
@@ -1496,10 +1437,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1496
1437
|
)
|
|
1497
1438
|
]),
|
|
1498
1439
|
!__props.persistent ? (openBlock(), createElementBlock("button", _hoisted_3, [
|
|
1499
|
-
createVNode(
|
|
1500
|
-
src: unref(XIcon),
|
|
1501
|
-
class: "--icon"
|
|
1502
|
-
}, null, 8, ["src"])
|
|
1440
|
+
createVNode(unref(XIcon), { class: "--icon" })
|
|
1503
1441
|
])) : createCommentVNode("v-if", true)
|
|
1504
1442
|
],
|
|
1505
1443
|
34
|
|
@@ -1515,7 +1453,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1515
1453
|
}
|
|
1516
1454
|
});
|
|
1517
1455
|
const MazToast_vue_vue_type_style_index_0_lang = "";
|
|
1518
|
-
const
|
|
1456
|
+
const MazToast_vue_vue_type_style_index_1_scoped_ce23a6d4_lang = "";
|
|
1519
1457
|
const _export_sfc = (sfc, props) => {
|
|
1520
1458
|
const target = sfc.__vccOpts || sfc;
|
|
1521
1459
|
for (const [key, val] of props) {
|
|
@@ -1523,7 +1461,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
1523
1461
|
}
|
|
1524
1462
|
return target;
|
|
1525
1463
|
};
|
|
1526
|
-
const MazToast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1464
|
+
const MazToast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce23a6d4"]]);
|
|
1527
1465
|
class ToasterHandler {
|
|
1528
1466
|
constructor(app, globalOptions) {
|
|
1529
1467
|
this.app = app;
|
|
@@ -1565,14 +1503,14 @@ const defaultOptions = {
|
|
|
1565
1503
|
timeout: 1e4,
|
|
1566
1504
|
persistent: true
|
|
1567
1505
|
};
|
|
1568
|
-
let
|
|
1569
|
-
const
|
|
1506
|
+
let toastInstance;
|
|
1507
|
+
const installToaster = {
|
|
1570
1508
|
install(app, options) {
|
|
1571
|
-
|
|
1509
|
+
toastInstance = new ToasterHandler(app, {
|
|
1572
1510
|
...defaultOptions,
|
|
1573
1511
|
...options
|
|
1574
1512
|
});
|
|
1575
|
-
app.provide("toast",
|
|
1513
|
+
app.provide("toast", toastInstance);
|
|
1576
1514
|
}
|
|
1577
1515
|
};
|
|
1578
1516
|
const DEFAULT_LOADER = "";
|
|
@@ -1843,6 +1781,7 @@ const useUserVisibility = ({
|
|
|
1843
1781
|
export {
|
|
1844
1782
|
AosHandler,
|
|
1845
1783
|
IdleTimeout,
|
|
1784
|
+
ScriptLoader,
|
|
1846
1785
|
ToasterHandler,
|
|
1847
1786
|
UserVisibility,
|
|
1848
1787
|
WaitHandler,
|
|
@@ -1855,14 +1794,14 @@ export {
|
|
|
1855
1794
|
plugin as installAos,
|
|
1856
1795
|
installDirectives,
|
|
1857
1796
|
installFilters,
|
|
1858
|
-
|
|
1797
|
+
installToaster,
|
|
1859
1798
|
plugin$1 as installWait,
|
|
1860
1799
|
isClient,
|
|
1861
1800
|
mount,
|
|
1862
1801
|
number,
|
|
1863
1802
|
sleep$1 as sleep,
|
|
1864
1803
|
theme,
|
|
1865
|
-
|
|
1804
|
+
toastInstance,
|
|
1866
1805
|
truthyFilter,
|
|
1867
1806
|
useAos,
|
|
1868
1807
|
useIdleTimeout,
|
|
@@ -1872,12 +1811,12 @@ export {
|
|
|
1872
1811
|
useUserVisibility,
|
|
1873
1812
|
useWait,
|
|
1874
1813
|
directive$1 as vClickOutside,
|
|
1875
|
-
plugin$
|
|
1814
|
+
plugin$5 as vClickOutsideInstall,
|
|
1876
1815
|
directive as vClosable,
|
|
1877
|
-
plugin$
|
|
1816
|
+
plugin$4 as vClosableInstall,
|
|
1878
1817
|
vLazyImg,
|
|
1879
|
-
plugin$
|
|
1818
|
+
plugin$2 as vLazyImgInstall,
|
|
1880
1819
|
vZoomImg,
|
|
1881
|
-
plugin$
|
|
1820
|
+
plugin$3 as vZoomImgInstall,
|
|
1882
1821
|
instance$1 as waitInstance
|
|
1883
1822
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".m-toast-container{-webkit-box-sizing:border-box;box-sizing:border-box;position:fixed;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.m-toast-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container{padding:1rem;z-index:1051}.m-toast-container.--top{top:0;display:-webkit-box;display:-ms-flexbox;display:flex}.m-toast-container.--center{width:100%}@media (min-width: 768px){.m-toast-container.--center{position:fixed;left:50%;width:auto;-webkit-transform:translate(-50%,0);transform:translate(-50%)}}.m-toast-container.--bottom{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.m-toast-container.--bottom>:not([hidden])~:not([hidden]){margin-bottom:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-top:calc(.5rem * var(--tw-space-y-reverse))}.m-toast-container.--right{right:0;width:100%}@media (min-width: 768px){.m-toast-container.--right{width:auto}}.m-toast-container.--left{left:0;width:100%}@media (min-width: 768px){.m-toast-container.--left{width:auto}}.m-toast[data-v-ce23a6d4],.m-toast *[data-v-ce23a6d4]{-webkit-box-sizing:border-box;box-sizing:border-box}.m-toast[data-v-ce23a6d4]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:center;align-self:center;border-radius:var(--maz-border-radius);padding-left:.5rem;padding-right:.5rem;color:var(--maz-color-white);--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width: 768px){.m-toast.--left[data-v-ce23a6d4],.m-toast.--right[data-v-ce23a6d4]{width:20rem}.m-toast.--center[data-v-ce23a6d4]{width:20rem;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}}.m-toast__message-wrapper[data-v-ce23a6d4]{-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%;padding-top:.75rem;padding-bottom:.75rem}.m-toast__message[data-v-ce23a6d4]{margin:0;font-weight:500}.m-toast .--close[data-v-ce23a6d4]{margin-left:.25rem;display:-webkit-box;display:-ms-flexbox;display:flex;height:1.75rem;width:1.75rem;border-radius:var(--maz-border-radius);background-color:transparent;padding:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-toast .--close[data-v-ce23a6d4]:hover{background-color:#11182733}.m-toast .--close .--icon[data-v-ce23a6d4]{height:1.25rem;width:1.25rem;cursor:pointer}.m-toast.--info[data-v-ce23a6d4]{background-color:var(--maz-color-info);color:var(--maz-color-info-contrast)}.m-toast.--info[data-v-ce23a6d4]:hover{background-color:var(--maz-color-info-600)}.m-toast.--info .--close[data-v-ce23a6d4]{color:var(--maz-color-info-contrast)}.m-toast.--success[data-v-ce23a6d4]{background-color:var(--maz-color-success);color:var(--maz-color-success-contrast)}.m-toast.--success[data-v-ce23a6d4]:hover{background-color:var(--maz-color-success-600)}.m-toast.--success .--close[data-v-ce23a6d4]{color:var(--maz-color-success-contrast)}.m-toast.--warning[data-v-ce23a6d4]{background-color:var(--maz-color-warning);color:var(--maz-color-warning-contrast)}.m-toast.--warning[data-v-ce23a6d4]:hover{background-color:var(--maz-color-warning-600)}.m-toast.--warning .--close[data-v-ce23a6d4]{color:var(--maz-color-warning-contrast)}.m-toast.--danger[data-v-ce23a6d4]{background-color:var(--maz-color-danger);color:var(--maz-color-danger-contrast)}.m-toast.--danger[data-v-ce23a6d4]:hover{background-color:var(--maz-color-danger-600)}.m-toast.--danger .--close[data-v-ce23a6d4]{color:var(--maz-color-danger-contrast)}.m-slide-top-enter-active[data-v-ce23a6d4],.m-slide-top-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-top-enter-from[data-v-ce23a6d4],.m-slide-top-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.m-slide-bottom-enter-active[data-v-ce23a6d4],.m-slide-bottom-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateY(0);transform:translateY(0)}.m-slide-bottom-enter-from[data-v-ce23a6d4],.m-slide-bottom-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}.m-slide-right-enter-active[data-v-ce23a6d4],.m-slide-right-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-right-enter-from[data-v-ce23a6d4],.m-slide-right-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateX(100%);transform:translate(100%)}.m-slide-left-enter-active[data-v-ce23a6d4],.m-slide-left-leave-active[data-v-ce23a6d4]{opacity:1;-webkit-transition:all .3s;transition:all .3s;-webkit-transform:translateX(0);transform:translate(0)}.m-slide-left-enter-from[data-v-ce23a6d4],.m-slide-left-leave-to[data-v-ce23a6d4]{opacity:0;-webkit-transform:translateX(-100%);transform:translate(-100%)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}}();
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,t){"use strict";var i=Object.defineProperty,s=(e,t,s)=>(((e,t,s)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!=typeof t?t+"":t,s),s);function o(e,i){const s=t.inject(e,i);if(!s)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${e}`);return s}function n(e,{props:i,children:s,element:o,app:n}={}){let r=o;const a=t.createVNode(e,i,s);n&&n._context&&(a.appContext=n._context),r?t.render(a,r):"undefined"!=typeof document&&t.render(a,r=document.createElement("div"));return{vNode:a,destroy:()=>{r&&t.render(null,r)},el:r}}function r(){return"undefined"!=typeof document}class a{constructor(e,t){s(this,"defaultOptions",{element:void 0,timeout:3e5,once:!1,immediate:!0,ssr:!1}),s(this,"options"),s(this,"timeoutHandler"),s(this,"isIdle",!1),s(this,"isDestroy",!1),s(this,"startTime",0),s(this,"remainingTime",0),s(this,"lastClientX",-1),s(this,"lastClientY",-1),s(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]),s(this,"handleEvent",(e=>{try{if(this.remainingTime>0)return;if("mousemove"===e.type){const{clientX:t,clientY:i}=e;if(void 0===t&&void 0===i||t===this.lastClientX&&i===this.lastClientY)return;this.lastClientX=t,this.lastClientY=i}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}})),this.callback=e,this.options={...this.defaultOptions,...t},!this.options.ssr&&r()?this.start():this.options.ssr||r()||console.warn('[IdleTimeout](constructor) executed on server side - set immediate option to "false"')}get element(){return this.options.element??document.body}start(){if(r()){for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}else console.warn("[IdleTimeout](start) you should run this method on client side")}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle})}destroy(){if(r()){this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}else console.warn("[IdleTimeout](destroy) you should run this method on client side")}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle})}}class l{constructor(e,t){s(this,"eventHandlerFunction"),s(this,"event","visibilitychange"),s(this,"timeoutHandler"),s(this,"options"),s(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0,ssr:!1}),s(this,"isVisible",!1),this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),!this.options.ssr&&r()?this.start():this.options.ssr||r()||console.warn('[UserVisibility](constructor) executed on server side - set "ssr" option to "false"')}start(){r()?(this.options.immediate&&this.emitCallback(),this.addEventListener()):console.warn("[UserVisibility](start) you should run this method on client side")}emitCallback(){this.isVisible="visible"===document.visibilityState,this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){"visible"!==document.visibilityState||this.isVisible?"hidden"===document.visibilityState&&this.initTimeout():(this.clearTimeout(),this.emitCallback())}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}const d="__vue_click_away__",m=()=>null===document.ontouchstart?"touchstart":"click",c=async(e,i)=>{u(e);const s=i.instance,o=i.value,n="function"==typeof o;if(!n)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await t.nextTick(),e[d]=t=>{if((!e||!e.contains(t.target))&&o&&n)return o.call(s,t)};const r=m();document.addEventListener(r,e[d],!1)},u=e=>{const t=m();document.removeEventListener(t,e[d],!1),delete e[d]},h={mounted:c,updated:(e,t)=>{t.value!==t.oldValue&&c(e,t)},unmounted:u},p={install:e=>{e.directive("click-outside",h)}},v=(e,t,i,s)=>{e.stopPropagation();const{handler:o,exclude:n}=i.value;let r=!1;if(n&&n.length>0)for(const a of n)if(!r){r=s.context.$refs[a].contains(e.target)}t.contains(e.target)||r||s.context[o]()},g=()=>null===document.ontouchstart?"touchstart":"click",f={mounted:(e,t,i)=>{const s=g();document.addEventListener(s,(s=>v(s,e,t,i)))},unmounted:(e,t,i)=>{const s=g();document.removeEventListener(s,(s=>v(s,e,t,i)))}},b={install:e=>{e.directive("closable",f)}},y={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class w{constructor(e){if(s(this,"options"),s(this,"loader"),s(this,"wrapper"),s(this,"img"),s(this,"keydownHandler"),s(this,"onImgLoadedCallback"),s(this,"buttonsAdded"),s(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1}),s(this,"mouseEnterListener"),s(this,"mouseLeaveListener"),s(this,"renderPreviewListener"),!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if("object"==typeof e.value&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,..."object"==typeof e.value?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout((()=>e.classList.add("maz-zoom-img-instance"))),e.setAttribute("data-src",this.options.src),this.options.alt&&e.setAttribute("data-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-src"),e.removeAttribute("data-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle("\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}");const i=document.createElement("div");i.classList.add("maz-zoom-img"),i.setAttribute("id","MazImgPreviewFullsize"),i.addEventListener("click",(e=>{i.isEqualNode(e.target)&&this.closePreview()})),"object"==typeof t&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),i.append(this.wrapper),document.body.append(i),this.keyboardEventHandler(!0),setTimeout((()=>{i&&i.classList.add("maz-animate")}),100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],i=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,i){const e=this.getButton("previous"),i=this.getButton("next");t.push(e,i)}this.wrapper.append(e),i&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=y.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),"Escape"!==e.key&&" "!==e.key||this.closePreview(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||this.nextPreviousImage("ArrowRight"===e.key)}getButton(e="close"){const t=document.createElement("button");return t.innerHTML=y[e],t.addEventListener("click",(()=>{"close"===e?this.closePreview():this.allInstances&&this.nextPreviousImage("next"===e)})),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),i=document.querySelector(".maz-zoom-img-instance.maz-is-open");i&&i.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout((()=>{e&&e.remove(),t&&t.remove()}),300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,i=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(i){const e=this.allInstances.indexOf(i),s=t?e+1:e-1,o=this.allInstances[this.getNewInstanceIndex(s)];o&&this.useNextInstance(i,o)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const i=t.getAttribute("data-src"),s=t.getAttribute("data-alt");this.wrapper.style.width="",this.loader.hidden=!1,i&&this.img.setAttribute("src",i),s&&this.img.setAttribute("alt",s)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let z;const L={created(e,t){z=new w(t),z.create(e)},updated(e,t){z.update(t)},unmounted(e){z.remove(e)}},I={install(e){e.directive("zoom-img",L)}},E={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class T{constructor(e={}){s(this,"observers",[]),s(this,"defaultOptions",E),s(this,"options"),s(this,"onImgLoadedCallback"),s(this,"onImgErrorCallback"),s(this,"hasImgLoaded",!1),this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then((()=>ge));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,i;this.addClass(e,this.options.loadingClass),null==(i=(t=this.options).onLoading)||i.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,i;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),null==(i=(t=this.options).onLoaded)||i.call(t,e)}imageHasError(e,t){var i,s;console.warn("[maz-ui][MazLazyImg] Error while loading image",t),this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),null==(s=(i=this.options).onError)||s.call(i,e),this.setDefaultPhoto(e)}getImageUrl(e,t){const i=this.getImgElement(e).getAttribute("data-src");if(i)return i;t.value;const s="object"==typeof t.value?t.value.src:t.value;return s||console.warn("[maz-ui][MazLazyImg] src url is not defined"),s}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const i of t){const e=i.getAttribute("data-srcset");e?i.srcset=e:console.warn('[maz-ui][MazLazyImg] the "[data-srcset]" attribute is not provided on "<source />"')}else console.warn('[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'),this.imageHasError(e)}hasBgImgMode(e){return"bg-image"===e.arg}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.errorPhoto??await this.loadErrorPhoto(),i=e.querySelectorAll("source");if(i.length>0)for await(const s of i)s.srcset=t;else this.setImgSrc(e,t)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",(()=>this.onImgLoadedCallback(e)),{once:!0}),t.addEventListener("error",(t=>this.onImgErrorCallback(e,t)),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const i=this.getImageUrl(e,t);if(!i)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${i}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,i))}}setImgSrc(e,t){this.getImgElement(e).src=t}handleIntersectionObserver(e,t,i,s){var o,n;this.observers.push(s);for(const r of i)if(r.isIntersecting){if(null==(n=(o=this.options).onIntersecting)||n.call(o,r.target),this.options.observerOnce&&s.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const i=this.options.observerOptions;new IntersectionObserver(((i,s)=>{this.handleIntersectionObserver(e,t,i,s)}),i).observe(e)}async imageHandler(e,t,i){if("update"===i)for await(const s of this.observers)s.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,i){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,i)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error('[MazLazyImg] You can\'t use the "bg-image" mode with "<picture />" element');setTimeout((()=>this.setBaseClass(e)),0),e.getAttribute("src")||this.setImgSrc(e,"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const i of this.observers)i.unobserve(e);this.observers=[]}}let k;const C={created(e,t){const i="object"==typeof t.value?t.value:{};k=new T(i),k.add(e,t)},updated(e,t){k.update(e,t)},unmounted(e,t){k.remove(e,t)}},A={install(e,t={}){const i={...E,...t,observerOptions:{...E.observerOptions,...t.observerOptions}},s=new T(i);e.directive("lazy-img",{created:s.add.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)})}},x=[{name:"click-outside",directive:h},{name:"closable",directive:f},{name:"zoom-img",directive:L},{name:"lazy-img",directive:C}],S={install(e){for(const{name:t,directive:i}of x)e.directive(t,i)}},H=e=>e?(e=e.toString()).charAt(0).toUpperCase()+e.slice(1):"",O={style:"currency",minimumFractionDigits:2,round:!1},P=(e,t,i)=>{const s={...O,...i};((e,t,i)=>{if(void 0===e)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(void 0===i.currency)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")})(e,t,s);try{return((e,t,i)=>{let s=Number(e);return i.round&&(s=Math.floor(s),i.minimumFractionDigits=0),new Intl.NumberFormat(t,i).format(s)})(e,t,s)}catch(o){throw new Error(`[maz-ui](FilterCurrency) ${o}`)}},_={month:"short",day:"numeric",year:"numeric"},M=(e,t,i)=>{if(void 0===t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const s=i??_;try{const i=e instanceof Date?e:new Date(e);return new Intl.DateTimeFormat(t,s).format(i)}catch(o){throw new Error(`[maz-ui](FilterDate) ${o}`)}},D={minimumFractionDigits:2},V=(e,t,i)=>{const s={...D,...i};if(void 0===e)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(void 0===t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if("string"!=typeof t)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(t,s).format(Number(e))}catch(o){throw new Error(`[maz-ui](FilterNumber) ${o}`)}},N={capitalize:H,currency:P,date:M,number:V},B={install(e){e.provide("filters",N)}};class q{constructor(e,t){s(this,"callback"),s(this,"delay"),s(this,"timer"),s(this,"startedAt"),this.startedAt=Date.now(),this.callback=e,this.delay=t,this.start()}pause(){this.stop(),this.delay-=Date.now()-this.startedAt}resume(){this.startedAt=Date.now(),this.start()}start(){this.timer=setTimeout(this.callback,this.delay)}stop(){clearTimeout(this.timer)}}const F={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},$=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 18 6M6 6l12 12"},null,-1)];const j={render:function(e,i){return t.openBlock(),t.createElementBlock("svg",F,$)}},U={class:"m-toast__message-wrapper"},Y={class:"m-toast__message"},K={key:0,class:"--close"},R=((e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i})(t.defineComponent({__name:"MazToast",props:{position:{type:String,default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:Number,default:1e4},queue:{type:Boolean,default:!1},noPauseOnHover:{type:Boolean,default:!1},type:{type:String,default:"info",validator:e=>["info","success","warning","danger"].includes(e)},message:{type:String,required:!0},persistent:{type:Boolean,default:!1}},emits:["close","click"],setup(e,{emit:i}){const s=e,o=t.ref(),n=t.computed((()=>s.position.includes("top")?"top":"bottom")),r=t.computed((()=>s.position.includes("left")?"left":s.position.includes("right")?"right":"center")),a=t.computed((()=>"center"!==r.value?"right"===r.value?"m-slide-right":"m-slide-left":"top"===n.value?"m-slide-top":"m-slide-bottom")),l=t.ref(!1),d=t.ref(),m=t.ref(),c=`m-toast-container --${n.value} --${r.value}`,u=`.${c.replaceAll(" ",".")}`,h=()=>{if((()=>{const e=document.querySelector(u);return!(!s.queue&&!1===s.maxToasts)&&("number"==typeof s.maxToasts&&e?s.maxToasts<=e.childElementCount:e&&e.childElementCount>0)})())return void(m.value=setTimeout(h,250));const e=document.querySelector(u);o.value&&e&&e.prepend(o.value),l.value=!0,d.value=s.timeout?new q(v,s.timeout):void 0};const p=e=>{d.value&&!s.noPauseOnHover&&(e?d.value.pause():d.value.resume())},v=()=>{d.value&&d.value.stop(),m.value&&clearTimeout(m.value),l.value=!1,setTimeout((()=>{var e;i("close"),null==(e=o.value)||e.remove();const t=document.querySelector(u);t&&!(null==t?void 0:t.hasChildNodes())&&t.remove()}),300)};return t.onMounted((()=>{(()=>{const e=document.querySelector(u);if(!e&&!e){const e=document.body,t=document.createElement("div");t.className=c,e.append(t)}})(),h()})),(d,m)=>(t.openBlock(),t.createBlock(t.Transition,{name:a.value,persisted:""},{default:t.withCtx((()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"Toaster",ref:o,class:t.normalizeClass(["m-toast",[`--${e.type}`,`--${n.value}`,`--${r.value}`]]),role:"alert",onMouseover:m[0]||(m[0]=e=>p(!0)),onMouseleave:m[1]||(m[1]=e=>p(!1)),onClick:m[2]||(m[2]=e=>(i("click",e),void(s.persistent||v())))},[t.createElementVNode("div",U,[t.createElementVNode("p",Y,t.toDisplayString(e.message),1)]),e.persistent?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("button",K,[t.createVNode(t.unref(j),{class:"--icon"})]))],34),[[t.vShow,l.value]])])),_:1},8,["name"]))}}),[["__scopeId","data-v-ce23a6d4"]]);class W{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const i={...{message:e,...t},...this.globalOptions,...t};n(R,{props:i,app:this.app})}getLocalOptions(e,t){return{type:e,...t}}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}const X={position:"bottom-right",timeout:1e4,persistent:!0};e.toastInstance=void 0;const G={install(t,i){e.toastInstance=new W(t,{...X,...i}),t.provide("toast",e.toastInstance)}};class Z{constructor(){s(this,"_loaders",t.ref([]))}get loaders(){return t.computed((()=>this._loaders.value))}stop(e=""){var t;this._loaders.value=(t=this._loaders.value,(e="")=>t.filter((t=>t!==e)))(e)}start(e=""){var t;return this._loaders.value=(t=this._loaders.value,(e="")=>(e=>e.filter(((e,t,i)=>t===i.indexOf(e))))([...t,e]))(e),()=>this.stop(e)}get anyLoading(){return t.computed((()=>this._loaders.value.length>0))}isLoading(e=""){return t.computed((()=>{return(t=this._loaders.value,(e="")=>"function"==typeof e?t.findIndex(((...t)=>e(...t)))>-1:t.includes(e))(e);var t})).value}}const Q=new Z,J={install:e=>{e.provide("wait",Q)}},ee=100,te={root:void 0,rootMargin:"0px",threshold:.2},ie={once:!0,duration:300};class se{constructor(e){s(this,"options"),this.options={delay:(null==e?void 0:e.delay)??ee,observer:{...te,...null==e?void 0:e.observer},animation:{...ie,...null==e?void 0:e.animation}}}runAnimations(){if(r())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}async handleObserver(){var e;await(e=this.options.delay,new Promise((t=>setTimeout(t,e))));const t=new IntersectionObserver(this.handleIntersect.bind(this),{...this.options.observer});for(const i of document.querySelectorAll("[data-maz-aos]")){const e=i.getAttribute("data-maz-aos-anchor");if(e){const i=document.querySelector(e);i?(i.setAttribute("data-maz-aos-children","true"),t.observe(i)):console.warn(`[maz-ui](aos) no element found with selector "${e}"`)}else t.observe(i)}}handleIntersect(e,t){for(const i of e){const e="true"===i.target.getAttribute("data-maz-aos-children"),s=i.target.getAttribute("data-maz-aos")?[i.target]:[];if(e){const e=[...document.querySelectorAll("[data-maz-aos-anchor]")].map((e=>e.getAttribute("data-maz-aos-anchor")===`#${i.target.id}`?e:void 0));for(const t of e)t&&s.push(t)}for(const o of s){const e=o.getAttribute("data-maz-aos-once"),s="string"==typeof e?"true"===e:this.options.animation.once;if("number"==typeof this.options.observer.threshold&&i.intersectionRatio>this.options.observer.threshold){o.getAttribute("data-maz-aos-duration")||(o.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout((()=>{o.style.transitionDuration="0"}),1e3)),o.classList.add("maz-aos-animate"),s&&t.unobserve(o)}else o.classList.remove("maz-aos-animate")}}}}e.aosInstance=void 0;const oe={install:(t,i)=>{e.aosInstance=new se(i),t.provide("aos",e.aosInstance),r()&&((null==i?void 0:i.router)?i.router.afterEach((async()=>{e.aosInstance.runAnimations()})):e.aosInstance.runAnimations())}},ne={darkClass:"dark",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light"},re=t.ref(),ae=({darkClass:e,storageThemeKey:t,storageThemeValueDark:i,setLocalStorageValue:s=!0})=>{document.documentElement.classList.add(e),re.value=i,s&&(localStorage[t]=i)},le=({darkClass:e,storageThemeKey:t,storageThemeValueLight:i,setLocalStorageValue:s=!0})=>{document.documentElement.classList.remove(e),re.value=i,s&&(localStorage[t]=i)},de=({shouldSetDarkMode:e,...t})=>e?ae(t):le(t),me=t.ref(),ce=t.ref(),ue={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},he=[t.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),t.createElementVNode("path",{d:"M8.9 6.07 7.48 4.66 9 3h6l1.83 2H20c1.1 0 2 .9 2 2v12c0 .05-.01.1-.02.16L20 17.17V7h-4.05l-1.83-2H9.88L8.9 6.07zm11.59 17.24L18.17 21H4c-1.1 0-2-.9-2-2V7c0-.59.27-1.12.68-1.49l-2-2L2.1 2.1l19.8 19.8-1.41 1.41zM9.19 12.02c-.11.31-.19.63-.19.98 0 1.66 1.34 3 3 3 .35 0 .67-.08.98-.19l-3.79-3.79zM16.17 19l-1.68-1.68c-.73.43-1.58.68-2.49.68-2.76 0-5-2.24-5-5 0-.91.25-1.76.68-2.49L4.17 7H4v12h12.17zm-1.36-7.02 2.07 2.07c.08-.34.12-.69.12-1.05 0-2.76-2.24-5-5-5-.36 0-.71.04-1.06.12l2.07 2.07c.84.3 1.5.96 1.8 1.79z"},null,-1)];function pe(e,i){return t.openBlock(),t.createElementBlock("svg",ue,he)}const ve={render:pe},ge=Object.freeze(Object.defineProperty({__proto__:null,default:ve,render:pe},Symbol.toStringTag,{value:"Module"}));e.AosHandler=se,e.IdleTimeout=a,e.ScriptLoader=class{constructor({src:e,identifier:t,once:i=!0,async:o=!0,defer:n=!0}){if(s(this,"src"),s(this,"script"),s(this,"once"),s(this,"async"),s(this,"defer"),s(this,"identifier"),"undefined"==typeof window)throw new TypeError("[ScriptLoader]: Is supported only on browser side");if(!e)throw new Error('[ScriptLoader]: You should provide the attribut "src"');if(!t)throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');this.src=e,this.identifier=t,this.once=i,this.async=o,this.defer=n}removeTag(e){var t;"string"==typeof e?null==(t=document.head.querySelector(`[data-identifier="${e}"]`))||t.remove():e.remove()}load(){const e=window,t=document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);if(this.once&&e[this.identifier]&&t.length>0)return this.script=e[this.identifier],Promise.resolve(this.script);if(!this.once&&t.length>0)for(const i of t)this.removeTag(i);return this.injectScript()}injectScript(){const e=window;return new Promise(((t,i)=>{try{const s=document.createElement("script");s.src=this.src,s.async=this.async,s.defer=this.defer,s.dataset.identifier=this.identifier,s.addEventListener("error",(e=>i(new Error(`[ScriptLoader](injectScript) ${e.message}`)))),s.addEventListener("load",(i=>(this.script=i,e[this.identifier]=i,t(i)))),document.head.append(s)}catch(s){throw new Error(`[ScriptLoader](init) ${s}`)}}))}},e.ToasterHandler=W,e.UserVisibility=l,e.WaitHandler=Z,e.capitalize=H,e.currency=P,e.date=M,e.debounce=function(e,t=0,i=!1){let s,o;const n=function(){s&&(clearTimeout(s),o=void 0,s=void 0)},r=function(...r){if(!t)return e.apply(this,r);const a=this,l=i&&!s;return n(),o=function(){e.apply(a,r)},s=setTimeout((function(){if(s=void 0,!l){const e=o;if(o=void 0,void 0!==e)return e()}}),t),l?o():void 0};return r.cancel=n,r.flush=function(){const e=o;n(),e&&e()},r},e.injectStrict=o,e.installAos=oe,e.installDirectives=S,e.installFilters=B,e.installToaster=G,e.installWait=J,e.isClient=r,e.mount=n,e.number=V,e.sleep=e=>new Promise((t=>{setTimeout(t,e)})),e.theme=re,e.truthyFilter=function(e){return!!e},e.useAos=()=>({aos:o("aos")}),e.useIdleTimeout=({callback:e,options:t})=>{const i=new a(e,t);me.value=i;return{idle:me}},e.useInstanceUniqId=({componentName:e,instance:i,providedId:s})=>({instanceId:t.computed((()=>s??`${e}-${null==i?void 0:i.uid}`))}),e.useThemeHandler=(e=ne)=>{const i={...ne,...e};return{autoSetTheme:()=>(e=>{localStorage[e.storageThemeKey]===e.storageThemeValueDark||!(e.storageThemeKey in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?ae({...e,setLocalStorageValue:!1}):le({...e,setLocalStorageValue:!1})})(i),toggleTheme:()=>(e=>localStorage[e.storageThemeKey]===e.storageThemeValueDark?le(e):ae(e))(i),setDarkTheme:()=>de({...i,shouldSetDarkMode:!0}),setLightTheme:()=>de({...i,shouldSetDarkMode:!1}),hasDarkTheme:t.computed((()=>re.value===i.storageThemeValueDark)),hasLightTheme:t.computed((()=>re.value===i.storageThemeValueLight)),theme:re}},e.useToast=()=>({toast:o("toast")}),e.useUserVisibility=({callback:e,options:t})=>{const i=new l(e,t);ce.value=i;return{visibility:ce}},e.useWait=()=>({wait:o("wait")}),e.vClickOutside=h,e.vClickOutsideInstall=p,e.vClosable=f,e.vClosableInstall=b,e.vLazyImg=C,e.vLazyImgInstall=A,e.vZoomImg=L,e.vZoomImgInstall=I,e.waitInstance=Q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|