maz-ui 3.22.4 → 3.23.1
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 +2 -2
- package/components/MazBackdrop.mjs +67 -107
- package/components/MazBadge.mjs +41 -50
- package/components/MazBottomSheet.mjs +2 -2
- package/components/MazBtn.mjs +2 -2
- package/components/MazCard.mjs +2 -2
- package/components/MazCarousel.mjs +2 -2
- package/components/MazChart.mjs +53 -63
- package/components/MazCheckbox.mjs +84 -128
- package/components/MazDialog.mjs +2 -2
- package/components/MazDialogPromise.mjs +3 -3
- package/components/MazDrawer.mjs +2 -2
- package/components/MazDropdown.mjs +2 -2
- package/components/MazDropzone.mjs +2 -2
- package/components/MazFullscreenLoader.mjs +14 -18
- package/components/MazGallery.mjs +352 -558
- package/components/MazIcon.mjs +76 -140
- package/components/MazInput.mjs +2 -2
- package/components/MazInputNumber.mjs +72 -99
- package/components/MazInputPrice.mjs +2 -2
- package/components/MazInputTags.mjs +2 -2
- package/components/MazLazyImg.mjs +2 -2
- package/components/MazPhoneNumberInput.mjs +2 -2
- package/components/MazPicker.mjs +2 -2
- package/components/MazRadio.mjs +65 -94
- package/components/MazRadioButtons.mjs +64 -78
- package/components/MazSelect.mjs +2 -2
- package/components/MazSlider.mjs +213 -325
- package/components/MazSpinner.mjs +25 -34
- package/components/MazStepper.mjs +2 -2
- package/components/MazSwitch.mjs +43 -60
- package/components/MazTabs.mjs +16 -25
- package/components/MazTabsBar.mjs +2 -2
- package/components/MazTabsContent.mjs +34 -43
- package/components/MazTabsContentItem.mjs +49 -63
- package/components/MazTextarea.mjs +124 -169
- package/components/MazTransitionExpand.mjs +36 -54
- package/components/assets/MazBackdrop.css +1 -1
- package/components/assets/MazBottomSheet.css +1 -1
- package/components/assets/MazDialog.css +1 -1
- package/components/assets/MazDialogPromise.css +1 -1
- package/components/assets/MazDrawer.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/chunks/MazAvatar-1636f58b.mjs +126 -0
- package/components/chunks/MazBottomSheet-c24f92f8.mjs +217 -0
- package/components/chunks/MazBtn-124f3700.mjs +153 -0
- package/components/chunks/MazBtn-1e61862b.mjs +153 -0
- package/components/chunks/MazBtn-2d1d1ba5.mjs +153 -0
- package/components/chunks/MazBtn-3d74f737.mjs +153 -0
- package/components/chunks/MazBtn-4a447126.mjs +153 -0
- package/components/chunks/MazBtn-555928ed.mjs +153 -0
- package/components/chunks/MazBtn-571454f6.mjs +153 -0
- package/components/chunks/MazBtn-5e426592.mjs +153 -0
- package/components/chunks/MazBtn-683effc1.mjs +153 -0
- package/components/chunks/MazBtn-6905cc39.mjs +153 -0
- package/components/chunks/MazBtn-6ce4cfd3.mjs +153 -0
- package/components/chunks/MazBtn-74656d5b.mjs +153 -0
- package/components/chunks/MazBtn-7706b2da.mjs +158 -0
- package/components/chunks/MazBtn-a7a913dd.mjs +153 -0
- package/components/chunks/MazBtn-fb3c7af8.mjs +153 -0
- package/components/chunks/MazCard-bcc36489.mjs +214 -0
- package/components/chunks/MazCarousel-6da75122.mjs +107 -0
- package/components/chunks/MazCheckbox-040dc2c4.mjs +117 -0
- package/components/chunks/MazCheckbox-3a2b48b4.mjs +117 -0
- package/components/chunks/MazDialog-44eda544.mjs +250 -0
- package/components/chunks/MazDialogPromise-eec5acde.mjs +419 -0
- package/components/chunks/MazDrawer-b628b37e.mjs +206 -0
- package/components/chunks/MazDropdown-6f2248b0.mjs +345 -0
- package/components/chunks/MazDropzone-8cac10a6.mjs +242 -0
- package/components/chunks/MazGallery-6b8ecedf.mjs +617 -0
- package/components/chunks/MazIcon-52a76873.mjs +101 -0
- package/components/chunks/MazIcon-95e31ff8.mjs +96 -0
- package/components/chunks/MazInput-1ed4f946.mjs +283 -0
- package/components/chunks/MazInput-8a217995.mjs +271 -0
- package/components/chunks/MazInput-c51881ea.mjs +278 -0
- package/components/chunks/MazInputPrice-cd348d46.mjs +392 -0
- package/components/chunks/MazInputTags-aa95fae7.mjs +446 -0
- package/components/chunks/MazLazyImg-0412ab38.mjs +259 -0
- package/components/chunks/MazLazyImg-47d3449a.mjs +254 -0
- package/components/chunks/MazPhoneNumberInput-e1bf46f9.mjs +1216 -0
- package/components/chunks/MazPicker-e4620d8b.mjs +1140 -0
- package/components/chunks/MazPickerCalendar-da62262c.mjs +535 -0
- package/components/chunks/MazPickerHeader-a2e041eb.mjs +186 -0
- package/components/chunks/MazPickerMonthSwitcher-5bf8bd08.mjs +97 -0
- package/components/chunks/MazPickerShortcuts-7f95430e.mjs +74 -0
- package/components/chunks/MazPickerTime-717402ae.mjs +219 -0
- package/components/chunks/MazPickerYearSwitcher-85f97b6d.mjs +106 -0
- package/components/chunks/MazSelect-6ff6bb96.mjs +652 -0
- package/components/chunks/MazSpinner-054f948c.mjs +39 -0
- package/components/chunks/MazSpinner-059ee1d2.mjs +39 -0
- package/components/chunks/MazSpinner-08ee440b.mjs +39 -0
- package/components/chunks/MazSpinner-13403729.mjs +39 -0
- package/components/chunks/MazSpinner-44011019.mjs +39 -0
- package/components/chunks/MazSpinner-452a1534.mjs +39 -0
- package/components/chunks/MazSpinner-4c02cfd2.mjs +39 -0
- package/components/chunks/MazSpinner-51aa73ca.mjs +39 -0
- package/components/chunks/MazSpinner-6d1d24d5.mjs +39 -0
- package/components/chunks/MazSpinner-6e7c4705.mjs +39 -0
- package/components/chunks/MazSpinner-7895f54f.mjs +39 -0
- package/components/chunks/MazSpinner-7eee202e.mjs +39 -0
- package/components/chunks/MazSpinner-805e14a6.mjs +39 -0
- package/components/chunks/MazSpinner-85080b43.mjs +39 -0
- package/components/chunks/MazSpinner-a13a50c9.mjs +39 -0
- package/components/chunks/MazSpinner-a6d61cee.mjs +43 -0
- package/components/chunks/MazSpinner-c67b05bb.mjs +39 -0
- package/components/chunks/MazSpinner-caa33afc.mjs +39 -0
- package/components/chunks/MazSpinner-cb8fbe9a.mjs +39 -0
- package/components/chunks/MazSpinner-d9ef329f.mjs +39 -0
- package/components/chunks/MazStepper-39f018f3.mjs +191 -0
- package/components/chunks/MazTabsBar-27965f16.mjs +132 -0
- package/components/chunks/MazTransitionExpand-55cfbecb.mjs +41 -0
- package/components/chunks/MazTransitionExpand-cd24498f.mjs +41 -0
- package/components/chunks/_plugin-vue_export-helper-dad06003.mjs +9 -0
- package/components/chunks/check-31d7ba2f.mjs +30 -0
- package/components/chunks/check-c9b483c0.mjs +30 -0
- package/components/chunks/{check-circle-7acfa4c4.mjs → check-circle-59c383ed.mjs} +10 -12
- package/components/chunks/chevron-down-2b60111a.mjs +30 -0
- package/components/chunks/chevron-left-39b4621e.mjs +30 -0
- package/components/chunks/chevron-right-949a60fa.mjs +30 -0
- package/components/chunks/debounce-19c516b6.mjs +11 -0
- package/components/chunks/examples.mobile.json-f63d22fb.mjs +4 -0
- package/components/chunks/{exclamation-circle-2e115536.mjs → exclamation-circle-e2620aab.mjs} +10 -12
- package/components/chunks/{exclamation-triangle-10eb48dc.mjs → exclamation-triangle-21bf116a.mjs} +10 -12
- package/components/chunks/{eye-fbb13657.mjs → eye-dc12ce09.mjs} +12 -15
- package/components/chunks/{eye-slash-342420ff.mjs → eye-slash-fa42a017.mjs} +10 -12
- package/components/chunks/{magnifying-glass-5dffa35e.mjs → magnifying-glass-908981c0.mjs} +10 -12
- package/components/chunks/minus-e71140e1.mjs +30 -0
- package/components/chunks/no-photography-4c6c77cf.mjs +4 -0
- package/components/chunks/{no-photography-b0d08d6f.mjs → no-photography-be94ddda.mjs} +12 -15
- package/components/chunks/{no-symbol-975ce547.mjs → no-symbol-87477ad0.mjs} +10 -12
- package/components/chunks/{pencil-2f766dc8.mjs → pencil-4c35b4e7.mjs} +10 -12
- package/components/chunks/plus-c20544c3.mjs +30 -0
- package/components/chunks/x-mark-35f2f1e7.mjs +30 -0
- package/components/chunks/x-mark-7761acf4.mjs +29 -0
- package/modules/chunks/MazBtn-2f302422.cjs +1 -0
- package/modules/chunks/MazBtn-760c3b29.mjs +153 -0
- package/modules/chunks/MazIcon-0bd6b78e.mjs +96 -0
- package/modules/chunks/MazIcon-599a907f.cjs +1 -0
- package/modules/chunks/MazSpinner-03bd76bd.mjs +39 -0
- package/modules/chunks/MazSpinner-6ffa8db1.cjs +1 -0
- package/modules/chunks/{arrow-top-right-on-square-32bbe5a1.mjs → arrow-top-right-on-square-15191934.mjs} +10 -12
- package/modules/chunks/arrow-top-right-on-square-8e4ea6e2.cjs +1 -0
- package/modules/chunks/chevron-left-36731110.cjs +1 -0
- package/modules/chunks/chevron-left-39b4621e.mjs +30 -0
- package/modules/chunks/index-6a90ef88.mjs +1618 -0
- package/modules/chunks/index-794680d2.cjs +124 -0
- package/modules/chunks/{link-4eb05848.mjs → link-bb14441d.mjs} +10 -12
- package/modules/chunks/link-c7791a2a.cjs +1 -0
- package/modules/chunks/no-photography-0f6fcaf4.cjs +1 -0
- package/modules/chunks/no-photography-4c6c77cf.mjs +4 -0
- package/modules/chunks/x-mark-35f2f1e7.mjs +30 -0
- package/modules/chunks/x-mark-a28deca5.cjs +1 -0
- package/modules/index.cjs +1 -0
- package/modules/index.mjs +42 -42
- package/nuxt/index.json +1 -1
- package/package.json +14 -4
- package/types/resolvers/index.d.ts +1 -0
- package/types/resolvers/unplugin-vue-components-resolver.d.ts +8 -0
- package/types/utils/index.d.ts +3 -0
- package/components/chunks/MazAvatar-358d78d4.mjs +0 -138
- package/components/chunks/MazBottomSheet-61090f4a.mjs +0 -267
- package/components/chunks/MazBtn-0e02f0da.mjs +0 -184
- package/components/chunks/MazBtn-1daf9063.mjs +0 -184
- package/components/chunks/MazBtn-2f4fa942.mjs +0 -184
- package/components/chunks/MazBtn-31c6b731.mjs +0 -184
- package/components/chunks/MazBtn-48382169.mjs +0 -184
- package/components/chunks/MazBtn-4e1e116e.mjs +0 -184
- package/components/chunks/MazBtn-50abc4c5.mjs +0 -184
- package/components/chunks/MazBtn-84e12b6a.mjs +0 -184
- package/components/chunks/MazBtn-b42e3575.mjs +0 -184
- package/components/chunks/MazBtn-b56a7278.mjs +0 -184
- package/components/chunks/MazBtn-bbd6e9c8.mjs +0 -184
- package/components/chunks/MazBtn-cf0c8fcb.mjs +0 -184
- package/components/chunks/MazBtn-d92908b2.mjs +0 -191
- package/components/chunks/MazBtn-f48da79c.mjs +0 -184
- package/components/chunks/MazBtn-fec4c3b7.mjs +0 -184
- package/components/chunks/MazCard-4331dca0.mjs +0 -237
- package/components/chunks/MazCarousel-7825c7c9.mjs +0 -133
- package/components/chunks/MazCheckbox-ab5ddda2.mjs +0 -153
- package/components/chunks/MazCheckbox-e0bbe6ec.mjs +0 -153
- package/components/chunks/MazDialog-83e54b8c.mjs +0 -290
- package/components/chunks/MazDialogPromise-6967e821.mjs +0 -474
- package/components/chunks/MazDrawer-d778b3d2.mjs +0 -256
- package/components/chunks/MazDropdown-6f4482d7.mjs +0 -426
- package/components/chunks/MazDropzone-d1bb62dc.mjs +0 -325
- package/components/chunks/MazGallery-b2dc4286.mjs +0 -821
- package/components/chunks/MazIcon-b779da0a.mjs +0 -159
- package/components/chunks/MazIcon-bda198b4.mjs +0 -165
- package/components/chunks/MazInput-713b00d0.mjs +0 -326
- package/components/chunks/MazInput-b9386887.mjs +0 -341
- package/components/chunks/MazInput-c33627dd.mjs +0 -334
- package/components/chunks/MazInputPrice-452297f5.mjs +0 -481
- package/components/chunks/MazInputTags-7a463b81.mjs +0 -526
- package/components/chunks/MazLazyImg-6e395356.mjs +0 -336
- package/components/chunks/MazLazyImg-e0d8b6d0.mjs +0 -329
- package/components/chunks/MazPhoneNumberInput-48fe2445.mjs +0 -1536
- package/components/chunks/MazPicker-50fc11d1.mjs +0 -1352
- package/components/chunks/MazPickerCalendar-cacb361c.mjs +0 -689
- package/components/chunks/MazPickerHeader-63d45179.mjs +0 -216
- package/components/chunks/MazPickerMonthSwitcher-913c6e2c.mjs +0 -110
- package/components/chunks/MazPickerShortcuts-c6fabfc6.mjs +0 -88
- package/components/chunks/MazPickerTime-5e4475da.mjs +0 -301
- package/components/chunks/MazPickerYearSwitcher-dd4fa89c.mjs +0 -125
- package/components/chunks/MazSelect-2e5cd411.mjs +0 -850
- package/components/chunks/MazSpinner-022d7bee.mjs +0 -46
- package/components/chunks/MazSpinner-100c99b8.mjs +0 -46
- package/components/chunks/MazSpinner-191ad23b.mjs +0 -46
- package/components/chunks/MazSpinner-3155378b.mjs +0 -46
- package/components/chunks/MazSpinner-339a9006.mjs +0 -46
- package/components/chunks/MazSpinner-53979e96.mjs +0 -46
- package/components/chunks/MazSpinner-68d2f2ac.mjs +0 -46
- package/components/chunks/MazSpinner-6b563b22.mjs +0 -46
- package/components/chunks/MazSpinner-7cdc13e7.mjs +0 -46
- package/components/chunks/MazSpinner-8859d658.mjs +0 -46
- package/components/chunks/MazSpinner-8e180605.mjs +0 -52
- package/components/chunks/MazSpinner-9950424b.mjs +0 -46
- package/components/chunks/MazSpinner-c8270a93.mjs +0 -46
- package/components/chunks/MazSpinner-cb491238.mjs +0 -46
- package/components/chunks/MazSpinner-cb6f99f3.mjs +0 -46
- package/components/chunks/MazSpinner-ce4be8f1.mjs +0 -46
- package/components/chunks/MazSpinner-e5a9f319.mjs +0 -46
- package/components/chunks/MazSpinner-e92bd359.mjs +0 -46
- package/components/chunks/MazSpinner-eea9056d.mjs +0 -46
- package/components/chunks/MazSpinner-f1e69f29.mjs +0 -46
- package/components/chunks/MazStepper-4c19dbfc.mjs +0 -255
- package/components/chunks/MazTabsBar-3c2e2d69.mjs +0 -157
- package/components/chunks/MazTransitionExpand-474b00d4.mjs +0 -57
- package/components/chunks/MazTransitionExpand-f9e5a2d6.mjs +0 -57
- package/components/chunks/_plugin-vue_export-helper-cc2b3d55.mjs +0 -10
- package/components/chunks/check-8da249b1.mjs +0 -32
- package/components/chunks/check-f2fcce10.mjs +0 -32
- package/components/chunks/chevron-down-a78b9604.mjs +0 -32
- package/components/chunks/chevron-left-3365d59b.mjs +0 -32
- package/components/chunks/chevron-right-02f9e837.mjs +0 -32
- package/components/chunks/debounce-7d66ffa9.mjs +0 -12
- package/components/chunks/examples.mobile.json-618ba782.mjs +0 -4
- package/components/chunks/minus-c9cdee90.mjs +0 -32
- package/components/chunks/no-photography-7f2be516.mjs +0 -4
- package/components/chunks/plus-b1b0a5a8.mjs +0 -32
- package/components/chunks/x-mark-3b05101b.mjs +0 -31
- package/components/chunks/x-mark-c6ff45dd.mjs +0 -32
- package/modules/chunks/MazBtn-90ffd148.mjs +0 -184
- package/modules/chunks/MazIcon-988edef7.mjs +0 -159
- package/modules/chunks/MazSpinner-a16a3d8f.mjs +0 -46
- package/modules/chunks/chevron-left-3365d59b.mjs +0 -32
- package/modules/chunks/index-b1625fc2.mjs +0 -2315
- package/modules/chunks/no-photography-7f2be516.mjs +0 -4
- package/modules/chunks/x-mark-c6ff45dd.mjs +0 -32
|
@@ -0,0 +1,1618 @@
|
|
|
1
|
+
var Ge = Object.defineProperty;
|
|
2
|
+
var Qe = (s, e, t) => e in s ? Ge(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var r = (s, e, t) => (Qe(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import "../assets/index.css";
|
|
5
|
+
import { inject as Je, createVNode as _, render as J, nextTick as ke, defineComponent as Ae, defineAsyncComponent as $, onBeforeMount as et, ref as h, computed as y, onMounted as ve, onBeforeUnmount as tt, openBlock as z, createElementBlock as Z, normalizeClass as ue, withModifiers as M, withKeys as st, withDirectives as me, unref as L, vShow as de, createCommentVNode as q, createElementVNode as D, Transition as xe, withCtx as oe, createBlock as Y, toDisplayString as le, createTextVNode as it } from "vue";
|
|
6
|
+
function fe(s, e) {
|
|
7
|
+
const t = Je(s, e);
|
|
8
|
+
if (!t)
|
|
9
|
+
throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${s}`);
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function es(s, e) {
|
|
13
|
+
let t;
|
|
14
|
+
return function(...i) {
|
|
15
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
16
|
+
s.apply(this, i);
|
|
17
|
+
}, e);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function ts(s) {
|
|
21
|
+
return !!s;
|
|
22
|
+
}
|
|
23
|
+
function Ce(s, e) {
|
|
24
|
+
let t = e == null ? void 0 : e.element;
|
|
25
|
+
function i() {
|
|
26
|
+
t && J(null, t);
|
|
27
|
+
}
|
|
28
|
+
const o = _(
|
|
29
|
+
s,
|
|
30
|
+
{ ...e == null ? void 0 : e.props, ...e != null && e.addDestroyInProps ? { destroy: i } : {} },
|
|
31
|
+
e == null ? void 0 : e.children
|
|
32
|
+
);
|
|
33
|
+
return e != null && e.app ? (o.appContext = e.app._context, t ? J(o, t) : typeof document < "u" && (t = document.createElement("div"), J(o, t))) : (t = t ?? document.body, J(o, t)), { vNode: o, destroy: i, el: t };
|
|
34
|
+
}
|
|
35
|
+
function F() {
|
|
36
|
+
return typeof document < "u";
|
|
37
|
+
}
|
|
38
|
+
class ot {
|
|
39
|
+
constructor(e, t) {
|
|
40
|
+
r(this, "defaultOptions", {
|
|
41
|
+
element: void 0,
|
|
42
|
+
timeout: 60 * 1e3 * 5,
|
|
43
|
+
// 5 minutes
|
|
44
|
+
once: !1,
|
|
45
|
+
immediate: !0
|
|
46
|
+
});
|
|
47
|
+
r(this, "options");
|
|
48
|
+
r(this, "timeoutHandler");
|
|
49
|
+
r(this, "isIdle", !1);
|
|
50
|
+
r(this, "isDestroy", !1);
|
|
51
|
+
r(this, "startTime", 0);
|
|
52
|
+
r(this, "remainingTime", 0);
|
|
53
|
+
r(this, "lastClientX", -1);
|
|
54
|
+
r(this, "lastClientY", -1);
|
|
55
|
+
r(this, "eventNames", [
|
|
56
|
+
"DOMMouseScroll",
|
|
57
|
+
"mousedown",
|
|
58
|
+
"mousemove",
|
|
59
|
+
"mousewheel",
|
|
60
|
+
"MSPointerDown",
|
|
61
|
+
"MSPointerMove",
|
|
62
|
+
"keydown",
|
|
63
|
+
"touchmove",
|
|
64
|
+
"touchstart",
|
|
65
|
+
"wheel",
|
|
66
|
+
"click"
|
|
67
|
+
]);
|
|
68
|
+
r(this, "handleEvent", (e) => {
|
|
69
|
+
try {
|
|
70
|
+
if (this.remainingTime > 0)
|
|
71
|
+
return;
|
|
72
|
+
if (e.type === "mousemove") {
|
|
73
|
+
const { clientX: t, clientY: i } = e;
|
|
74
|
+
if (t === void 0 && i === void 0 || t === this.lastClientX && i === this.lastClientY)
|
|
75
|
+
return;
|
|
76
|
+
this.lastClientX = t, this.lastClientY = i;
|
|
77
|
+
}
|
|
78
|
+
this.resetTimeout(), this.callback({ isIdle: this.isIdle, eventType: e.type });
|
|
79
|
+
} catch (t) {
|
|
80
|
+
throw new Error(`[IdleTimeout](handleEvent) ${t}`);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
this.callback = e, this.options = {
|
|
84
|
+
...this.defaultOptions,
|
|
85
|
+
...t
|
|
86
|
+
}, F() && this.start();
|
|
87
|
+
}
|
|
88
|
+
get element() {
|
|
89
|
+
return this.options.element ?? document.body;
|
|
90
|
+
}
|
|
91
|
+
start() {
|
|
92
|
+
if (!F()) {
|
|
93
|
+
console.warn("[IdleTimeout](start) you should run this method on client side");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
for (const e of this.eventNames)
|
|
97
|
+
this.element.addEventListener(e, this.handleEvent);
|
|
98
|
+
this.resetTimeout(), this.options.immediate && this.callback({ isIdle: !1 });
|
|
99
|
+
}
|
|
100
|
+
pause() {
|
|
101
|
+
const e = this.startTime + this.options.timeout - Date.now();
|
|
102
|
+
e <= 0 || (this.remainingTime = e, this.timeoutHandler && (clearTimeout(this.timeoutHandler), this.timeoutHandler = void 0));
|
|
103
|
+
}
|
|
104
|
+
resume() {
|
|
105
|
+
this.remainingTime <= 0 || (this.resetTimeout(), this.callback({ isIdle: this.isIdle }), this.remainingTime = 0);
|
|
106
|
+
}
|
|
107
|
+
reset() {
|
|
108
|
+
this.isDestroy = !1, this.isIdle = !1, this.remainingTime = 0, this.resetTimeout(), this.callback({ isIdle: this.isIdle });
|
|
109
|
+
}
|
|
110
|
+
destroy() {
|
|
111
|
+
if (!F()) {
|
|
112
|
+
console.warn("[IdleTimeout](destroy) you should run this method on client side");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.isDestroy = !0;
|
|
116
|
+
for (const e of this.eventNames)
|
|
117
|
+
this.element.removeEventListener(e, this.handleEvent);
|
|
118
|
+
this.timeoutHandler && clearTimeout(this.timeoutHandler);
|
|
119
|
+
}
|
|
120
|
+
resetTimeout() {
|
|
121
|
+
this.isIdle = !1, this.timeoutHandler && (clearTimeout(this.timeoutHandler), this.timeoutHandler = void 0), this.timeoutHandler = setTimeout(
|
|
122
|
+
this.handleTimeout.bind(this),
|
|
123
|
+
this.remainingTime || this.options.timeout
|
|
124
|
+
), this.startTime = Date.now();
|
|
125
|
+
}
|
|
126
|
+
handleTimeout() {
|
|
127
|
+
this.isIdle = !0, this.callback({ isIdle: this.isIdle }), this.options.once && this.destroy();
|
|
128
|
+
}
|
|
129
|
+
get destroyed() {
|
|
130
|
+
return this.isDestroy;
|
|
131
|
+
}
|
|
132
|
+
get timeout() {
|
|
133
|
+
return this.options.timeout;
|
|
134
|
+
}
|
|
135
|
+
set timeout(e) {
|
|
136
|
+
this.options.timeout = e;
|
|
137
|
+
}
|
|
138
|
+
get idle() {
|
|
139
|
+
return this.isIdle;
|
|
140
|
+
}
|
|
141
|
+
set idle(e) {
|
|
142
|
+
e ? this.handleTimeout() : this.reset(), this.callback({ isIdle: this.isIdle });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
class nt {
|
|
146
|
+
constructor(e, t) {
|
|
147
|
+
r(this, "eventHandlerFunction");
|
|
148
|
+
r(this, "event", "visibilitychange");
|
|
149
|
+
r(this, "timeoutHandler");
|
|
150
|
+
r(this, "options");
|
|
151
|
+
r(this, "defaultOptions", {
|
|
152
|
+
timeout: 5e3,
|
|
153
|
+
once: !1,
|
|
154
|
+
immediate: !0
|
|
155
|
+
});
|
|
156
|
+
r(this, "isVisible", !1);
|
|
157
|
+
this.callback = e, this.options = {
|
|
158
|
+
...this.defaultOptions,
|
|
159
|
+
...t
|
|
160
|
+
}, this.eventHandlerFunction = this.eventHandler.bind(this), F() && this.start();
|
|
161
|
+
}
|
|
162
|
+
start() {
|
|
163
|
+
if (!F()) {
|
|
164
|
+
console.warn("[UserVisibility](start) you should run this method on client side");
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this.options.immediate && this.emitCallback(), this.addEventListener();
|
|
168
|
+
}
|
|
169
|
+
emitCallback() {
|
|
170
|
+
this.isVisible = document.visibilityState === "visible", this.callback({ isVisible: this.isVisible }), this.options.once && this.destroy();
|
|
171
|
+
}
|
|
172
|
+
eventHandler() {
|
|
173
|
+
document.visibilityState === "visible" && !this.isVisible ? (this.clearTimeout(), this.emitCallback()) : document.visibilityState === "hidden" && this.initTimeout();
|
|
174
|
+
}
|
|
175
|
+
clearTimeout() {
|
|
176
|
+
this.timeoutHandler && (clearTimeout(this.timeoutHandler), this.timeoutHandler = void 0);
|
|
177
|
+
}
|
|
178
|
+
initTimeout() {
|
|
179
|
+
this.clearTimeout(), this.timeoutHandler = setTimeout(this.emitCallback.bind(this), this.options.timeout);
|
|
180
|
+
}
|
|
181
|
+
addEventListener() {
|
|
182
|
+
document.addEventListener(this.event, this.eventHandlerFunction);
|
|
183
|
+
}
|
|
184
|
+
removeEventListener() {
|
|
185
|
+
document.removeEventListener(this.event, this.eventHandlerFunction);
|
|
186
|
+
}
|
|
187
|
+
destroy() {
|
|
188
|
+
this.removeEventListener(), this.timeoutHandler && clearTimeout(this.timeoutHandler);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const X = (s) => new Promise((e) => {
|
|
192
|
+
setTimeout(e, s);
|
|
193
|
+
});
|
|
194
|
+
class ss {
|
|
195
|
+
constructor({ src: e, identifier: t, once: i = !0, async: o = !0, defer: l = !0 }) {
|
|
196
|
+
r(this, "src");
|
|
197
|
+
r(this, "script");
|
|
198
|
+
r(this, "once");
|
|
199
|
+
r(this, "async");
|
|
200
|
+
r(this, "defer");
|
|
201
|
+
r(this, "identifier");
|
|
202
|
+
if (typeof window > "u")
|
|
203
|
+
throw new TypeError("[ScriptLoader]: Is supported only on browser side");
|
|
204
|
+
if (!e)
|
|
205
|
+
throw new Error('[ScriptLoader]: You should provide the attribut "src"');
|
|
206
|
+
if (!t)
|
|
207
|
+
throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');
|
|
208
|
+
this.src = e, this.identifier = t, this.once = i, this.async = o, this.defer = l;
|
|
209
|
+
}
|
|
210
|
+
removeTag(e) {
|
|
211
|
+
var t;
|
|
212
|
+
typeof e == "string" ? (t = document.head.querySelector(`[data-identifier="${e}"]`)) == null || t.remove() : e.remove();
|
|
213
|
+
}
|
|
214
|
+
load() {
|
|
215
|
+
const e = window, t = document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);
|
|
216
|
+
if (this.once && e[this.identifier] && t.length > 0)
|
|
217
|
+
return this.script = e[this.identifier], Promise.resolve(this.script);
|
|
218
|
+
if (!this.once && t.length > 0)
|
|
219
|
+
for (const i of t)
|
|
220
|
+
this.removeTag(i);
|
|
221
|
+
return this.injectScript();
|
|
222
|
+
}
|
|
223
|
+
injectScript() {
|
|
224
|
+
const e = window;
|
|
225
|
+
return new Promise((t, i) => {
|
|
226
|
+
try {
|
|
227
|
+
const o = document.createElement("script");
|
|
228
|
+
o.src = this.src, o.async = this.async, o.defer = this.defer, o.dataset.identifier = this.identifier, o.addEventListener("error", (l) => i(new Error(`[ScriptLoader](injectScript) ${l.message}`))), o.addEventListener("load", (l) => (this.script = l, e[this.identifier] = l, t(l))), document.head.append(o);
|
|
229
|
+
} catch (o) {
|
|
230
|
+
throw new Error(`[ScriptLoader](init) ${o}`);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function is(s) {
|
|
236
|
+
return [...s].map((t) => t.charCodeAt(0) % 32 + 127461).map((t) => String.fromCodePoint(t)).join("");
|
|
237
|
+
}
|
|
238
|
+
const ne = "__vue_click_away__", Se = () => document.ontouchstart === null ? "touchstart" : "click", Oe = async (s, e) => {
|
|
239
|
+
Pe(s);
|
|
240
|
+
const t = e.instance, i = e.value, o = typeof i == "function";
|
|
241
|
+
if (!o)
|
|
242
|
+
throw new Error("[maz-ui](vClickOutside) the callback should be a function");
|
|
243
|
+
await ke(), s[ne] = (d) => {
|
|
244
|
+
if ((!s || !s.contains(d.target)) && i && o)
|
|
245
|
+
return i.call(t, d);
|
|
246
|
+
};
|
|
247
|
+
const l = Se();
|
|
248
|
+
document.addEventListener(l, s[ne], !1);
|
|
249
|
+
}, Pe = (s) => {
|
|
250
|
+
const e = Se();
|
|
251
|
+
document.removeEventListener(e, s[ne], !1), delete s[ne];
|
|
252
|
+
}, rt = (s, e) => {
|
|
253
|
+
e.value !== e.oldValue && Oe(s, e);
|
|
254
|
+
}, He = {
|
|
255
|
+
mounted: Oe,
|
|
256
|
+
updated: rt,
|
|
257
|
+
unmounted: Pe
|
|
258
|
+
}, os = {
|
|
259
|
+
install: (s) => {
|
|
260
|
+
s.directive("click-outside", He);
|
|
261
|
+
}
|
|
262
|
+
}, _e = (s, e, t, i) => {
|
|
263
|
+
s.stopPropagation();
|
|
264
|
+
const { handler: o, exclude: l } = t.value;
|
|
265
|
+
let d = !1;
|
|
266
|
+
if (l && l.length > 0)
|
|
267
|
+
for (const n of l)
|
|
268
|
+
d || (d = i.context.$refs[n].contains(s.target));
|
|
269
|
+
!e.contains(s.target) && !d && i.context[o]();
|
|
270
|
+
}, $e = () => document.ontouchstart === null ? "touchstart" : "click", at = (s, e, t) => {
|
|
271
|
+
const i = $e();
|
|
272
|
+
document.removeEventListener(
|
|
273
|
+
i,
|
|
274
|
+
(o) => _e(o, s, e, t)
|
|
275
|
+
);
|
|
276
|
+
}, lt = (s, e, t) => {
|
|
277
|
+
const i = $e();
|
|
278
|
+
document.addEventListener(
|
|
279
|
+
i,
|
|
280
|
+
(o) => _e(o, s, e, t)
|
|
281
|
+
);
|
|
282
|
+
}, Me = {
|
|
283
|
+
mounted: lt,
|
|
284
|
+
unmounted: at
|
|
285
|
+
}, ns = {
|
|
286
|
+
install: (s) => {
|
|
287
|
+
s.directive("closable", Me);
|
|
288
|
+
}
|
|
289
|
+
}, ct = `
|
|
290
|
+
.maz-zoom-img {
|
|
291
|
+
position: fixed;
|
|
292
|
+
top: 0;
|
|
293
|
+
bottom: 0;
|
|
294
|
+
left: 0;
|
|
295
|
+
right: 0;
|
|
296
|
+
padding: 1rem;
|
|
297
|
+
z-index: 1050;
|
|
298
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
justify-content: center;
|
|
302
|
+
flex-direction: column;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.maz-zoom-img,
|
|
306
|
+
.maz-zoom-img * {
|
|
307
|
+
box-sizing: border-box;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.maz-zoom-img .maz-zoom-img__wrapper {
|
|
311
|
+
position: relative;
|
|
312
|
+
display: flex;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
align-items: center;
|
|
315
|
+
min-width: 0;
|
|
316
|
+
min-height: 0;
|
|
317
|
+
max-width: 100%;
|
|
318
|
+
max-height: 100%;
|
|
319
|
+
transition: all 300ms ease-in-out;
|
|
320
|
+
opacity: 0;
|
|
321
|
+
transform: scale(0.5);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
|
|
325
|
+
opacity: 1;
|
|
326
|
+
transform: scale(1);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader {
|
|
330
|
+
position: absolute;
|
|
331
|
+
top: 0;
|
|
332
|
+
bottom: 0;
|
|
333
|
+
left: 0;
|
|
334
|
+
right: 0;
|
|
335
|
+
display: flex;
|
|
336
|
+
align-items: center;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
339
|
+
border-radius: 1rem;
|
|
340
|
+
z-index: 2;
|
|
341
|
+
min-width: 60px;
|
|
342
|
+
min-height: 60px;
|
|
343
|
+
}
|
|
344
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
|
|
345
|
+
display: none;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@-webkit-keyframes spin {
|
|
349
|
+
0% { transform: rotate(0deg); }
|
|
350
|
+
100% { transform: rotate(360deg); }
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@keyframes spin {
|
|
354
|
+
0% { transform: rotate(0deg); }
|
|
355
|
+
100% { transform: rotate(360deg); }
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
|
|
359
|
+
animation: spin .6s linear infinite;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.maz-zoom-img img {
|
|
363
|
+
max-width: 100%;
|
|
364
|
+
max-height: 100%;
|
|
365
|
+
min-width: 0;
|
|
366
|
+
border-radius: 1rem;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.maz-zoom-img .maz-zoom-btn {
|
|
370
|
+
margin: 0 auto;
|
|
371
|
+
border: none;
|
|
372
|
+
background-color: hsla(0, 0%, 7%, 0.5);
|
|
373
|
+
box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
|
|
374
|
+
height: 2.2rem;
|
|
375
|
+
min-height: 2.2rem;
|
|
376
|
+
width: 2.2rem;
|
|
377
|
+
min-width: 2.2rem;
|
|
378
|
+
display: flex;
|
|
379
|
+
align-items: center;
|
|
380
|
+
justify-content: center;
|
|
381
|
+
border-radius: 2.2rem;
|
|
382
|
+
cursor: pointer;
|
|
383
|
+
flex: 0 0 auto;
|
|
384
|
+
outline: none;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.maz-zoom-img .maz-zoom-btn svg {
|
|
388
|
+
fill: white;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
|
|
392
|
+
position: absolute;
|
|
393
|
+
top: 0.5rem;
|
|
394
|
+
right: 0.5rem;
|
|
395
|
+
z-index: 1;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
|
|
399
|
+
position: absolute;
|
|
400
|
+
left: 0.5rem;
|
|
401
|
+
z-index: 1;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
|
|
405
|
+
position: absolute;
|
|
406
|
+
right: 0.5rem;
|
|
407
|
+
z-index: 1;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.maz-zoom-img .maz-zoom-btn:hover {
|
|
411
|
+
background-color: hsl(0, 0%, 0%);
|
|
412
|
+
}`, be = {
|
|
413
|
+
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>',
|
|
414
|
+
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>',
|
|
415
|
+
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>',
|
|
416
|
+
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>'
|
|
417
|
+
};
|
|
418
|
+
class ut {
|
|
419
|
+
constructor(e) {
|
|
420
|
+
r(this, "options");
|
|
421
|
+
r(this, "loader");
|
|
422
|
+
r(this, "wrapper");
|
|
423
|
+
r(this, "img");
|
|
424
|
+
r(this, "keydownHandler");
|
|
425
|
+
r(this, "onImgLoadedCallback");
|
|
426
|
+
r(this, "buttonsAdded");
|
|
427
|
+
r(this, "defaultOptions", {
|
|
428
|
+
scale: !0,
|
|
429
|
+
blur: !0,
|
|
430
|
+
disabled: !1
|
|
431
|
+
});
|
|
432
|
+
r(this, "mouseEnterListener");
|
|
433
|
+
r(this, "mouseLeaveListener");
|
|
434
|
+
r(this, "renderPreviewListener");
|
|
435
|
+
if (!e.value)
|
|
436
|
+
throw new Error(
|
|
437
|
+
'[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`'
|
|
438
|
+
);
|
|
439
|
+
if (typeof e.value == "object" && !e.value.src)
|
|
440
|
+
throw new Error("[maz-ui](zoom-img) src of image must be provided");
|
|
441
|
+
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);
|
|
442
|
+
}
|
|
443
|
+
buildOptions(e) {
|
|
444
|
+
return {
|
|
445
|
+
...this.defaultOptions,
|
|
446
|
+
...typeof e.value == "object" ? e.value : { src: e.value }
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
get allInstances() {
|
|
450
|
+
return [...document.querySelectorAll(".maz-zoom-img-instance")];
|
|
451
|
+
}
|
|
452
|
+
create(e) {
|
|
453
|
+
this.options.disabled || (e.style.cursor = "pointer", setTimeout(() => e.classList.add("maz-zoom-img-instance")), e.setAttribute("data-zoom-src", this.options.src), this.options.alt && e.setAttribute("data-zoom-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));
|
|
454
|
+
}
|
|
455
|
+
update(e) {
|
|
456
|
+
this.options = this.buildOptions(e);
|
|
457
|
+
}
|
|
458
|
+
remove(e) {
|
|
459
|
+
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-zoom-src"), e.removeAttribute("data-zoom-alt"), e.style.cursor = "";
|
|
460
|
+
}
|
|
461
|
+
renderPreview(e, t) {
|
|
462
|
+
e.classList.add(
|
|
463
|
+
"maz-is-open"
|
|
464
|
+
/* OPEN */
|
|
465
|
+
), this.addStyle(ct);
|
|
466
|
+
const i = document.createElement("div");
|
|
467
|
+
i.classList.add("maz-zoom-img"), i.setAttribute("id", "MazImgPreviewFullsize"), i.addEventListener("click", (o) => {
|
|
468
|
+
i.isEqualNode(o.target) && this.closePreview();
|
|
469
|
+
}), typeof t == "object" && (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(() => {
|
|
470
|
+
i && i.classList.add("maz-animate");
|
|
471
|
+
}, 100);
|
|
472
|
+
}
|
|
473
|
+
onImgLoaded() {
|
|
474
|
+
this.wrapper.style.width = `${this.img.width}px`, this.wrapper.style.minWidth = "200px", this.loader.hidden = !0;
|
|
475
|
+
const e = this.getButton(), t = [], i = this.allInstances.length > 1;
|
|
476
|
+
if (!this.buttonsAdded) {
|
|
477
|
+
if (this.buttonsAdded = !0, i) {
|
|
478
|
+
const o = this.getButton("previous"), l = this.getButton("next");
|
|
479
|
+
t.push(o, l);
|
|
480
|
+
}
|
|
481
|
+
this.wrapper.append(e), i && (this.wrapper.prepend(t[0]), this.wrapper.append(t[1]));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
getLoader() {
|
|
485
|
+
const e = document.createElement("div");
|
|
486
|
+
return e.classList.add("maz-zoom-img__loader"), e.innerHTML = be.spinner, e;
|
|
487
|
+
}
|
|
488
|
+
mouseLeave(e) {
|
|
489
|
+
this.options.scale && (e.style.transform = ""), this.options.blur && (e.style.filter = ""), e.style.zIndex = "";
|
|
490
|
+
}
|
|
491
|
+
mouseEnter(e) {
|
|
492
|
+
e.style.zIndex = "1", this.options.scale && (e.style.transform = "scale(1.1)"), this.options.blur && (e.style.filter = "blur(2px)");
|
|
493
|
+
}
|
|
494
|
+
keydownLister(e) {
|
|
495
|
+
e.preventDefault(), (e.key === "Escape" || e.key === " ") && this.closePreview(), (e.key === "ArrowLeft" || e.key === "ArrowRight") && this.nextPreviousImage(e.key === "ArrowRight");
|
|
496
|
+
}
|
|
497
|
+
getButton(e = "close") {
|
|
498
|
+
const t = document.createElement("button");
|
|
499
|
+
return t.innerHTML = be[e], t.addEventListener("click", () => {
|
|
500
|
+
e === "close" ? this.closePreview() : this.allInstances && this.nextPreviousImage(e === "next");
|
|
501
|
+
}), t.classList.add("maz-zoom-btn"), t.classList.add(`maz-zoom-btn--${e}`), t;
|
|
502
|
+
}
|
|
503
|
+
closePreview() {
|
|
504
|
+
const e = document.querySelector("#MazImgPreviewFullsize"), t = document.querySelector("#MazPreviewStyle"), i = document.querySelector(
|
|
505
|
+
".maz-zoom-img-instance.maz-is-open"
|
|
506
|
+
);
|
|
507
|
+
i && i.classList.remove(
|
|
508
|
+
"maz-is-open"
|
|
509
|
+
/* OPEN */
|
|
510
|
+
), e && e.classList.remove("maz-animate"), this.keyboardEventHandler(!1), setTimeout(() => {
|
|
511
|
+
e && e.remove(), t && t.remove();
|
|
512
|
+
}, 300);
|
|
513
|
+
}
|
|
514
|
+
getNewInstanceIndex(e) {
|
|
515
|
+
return e < 0 ? this.allInstances.length - 1 : e >= this.allInstances.length ? 0 : e;
|
|
516
|
+
}
|
|
517
|
+
nextPreviousImage(e) {
|
|
518
|
+
const t = e, i = document.querySelector(
|
|
519
|
+
".maz-zoom-img-instance.maz-is-open"
|
|
520
|
+
);
|
|
521
|
+
if (i) {
|
|
522
|
+
const o = this.allInstances.indexOf(i), l = t ? o + 1 : o - 1, d = this.allInstances[this.getNewInstanceIndex(l)];
|
|
523
|
+
d && this.useNextInstance(i, d);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
useNextInstance(e, t) {
|
|
527
|
+
e.classList.remove(
|
|
528
|
+
"maz-is-open"
|
|
529
|
+
/* OPEN */
|
|
530
|
+
), t.classList.add(
|
|
531
|
+
"maz-is-open"
|
|
532
|
+
/* OPEN */
|
|
533
|
+
);
|
|
534
|
+
const i = t.getAttribute("data-zoom-src"), o = t.getAttribute("data-zoom-alt");
|
|
535
|
+
this.wrapper.style.width = "", this.loader.hidden = !1, i && this.img.setAttribute("src", i), o && this.img.setAttribute("alt", o);
|
|
536
|
+
}
|
|
537
|
+
addStyle(e) {
|
|
538
|
+
const t = document.createElement("style");
|
|
539
|
+
t.id = "MazPreviewStyle", t.textContent = e, document.head.append(t);
|
|
540
|
+
}
|
|
541
|
+
keyboardEventHandler(e) {
|
|
542
|
+
if (e)
|
|
543
|
+
return document.addEventListener("keydown", this.keydownHandler);
|
|
544
|
+
document.removeEventListener("keydown", this.keydownHandler);
|
|
545
|
+
}
|
|
546
|
+
imgEventHandler(e) {
|
|
547
|
+
if (e)
|
|
548
|
+
return this.img.addEventListener("load", this.onImgLoadedCallback);
|
|
549
|
+
this.img.removeEventListener("load", this.onImgLoadedCallback);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
let ee;
|
|
553
|
+
const De = {
|
|
554
|
+
created(s, e) {
|
|
555
|
+
ee = new ut(e), ee.create(s);
|
|
556
|
+
},
|
|
557
|
+
updated(s, e) {
|
|
558
|
+
ee.update(e);
|
|
559
|
+
},
|
|
560
|
+
unmounted(s) {
|
|
561
|
+
ee.remove(s);
|
|
562
|
+
}
|
|
563
|
+
}, rs = {
|
|
564
|
+
install(s) {
|
|
565
|
+
s.directive("zoom-img", De);
|
|
566
|
+
}
|
|
567
|
+
}, mt = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", he = {
|
|
568
|
+
baseClass: "m-lazy-img",
|
|
569
|
+
loadedClass: "m-lazy-loaded",
|
|
570
|
+
loadingClass: "m-lazy-loading",
|
|
571
|
+
errorClass: "m-lazy-error",
|
|
572
|
+
noPhotoClass: "m-lazy-no-photo",
|
|
573
|
+
noPhoto: !1,
|
|
574
|
+
observerOnce: !0,
|
|
575
|
+
loadOnce: !1,
|
|
576
|
+
noUseErrorPhoto: !1,
|
|
577
|
+
observerOptions: {
|
|
578
|
+
threshold: 0.1
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
class Fe {
|
|
582
|
+
constructor(e = {}) {
|
|
583
|
+
r(this, "observers", []);
|
|
584
|
+
r(this, "defaultOptions", he);
|
|
585
|
+
r(this, "options");
|
|
586
|
+
r(this, "onImgLoadedCallback");
|
|
587
|
+
r(this, "onImgErrorCallback");
|
|
588
|
+
r(this, "hasImgLoaded", !1);
|
|
589
|
+
this.options = this.buildOptions(e), this.onImgLoadedCallback = this.imageIsLoaded.bind(this), this.onImgErrorCallback = this.imageHasError.bind(this);
|
|
590
|
+
}
|
|
591
|
+
async loadErrorPhoto() {
|
|
592
|
+
const { default: e } = await import("./no-photography-4c6c77cf.mjs");
|
|
593
|
+
return e;
|
|
594
|
+
}
|
|
595
|
+
buildOptions(e) {
|
|
596
|
+
return {
|
|
597
|
+
...this.defaultOptions,
|
|
598
|
+
...e,
|
|
599
|
+
observerOptions: {
|
|
600
|
+
...this.defaultOptions.observerOptions,
|
|
601
|
+
...e.observerOptions
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
removeClass(e, t) {
|
|
606
|
+
e.classList.remove(t);
|
|
607
|
+
}
|
|
608
|
+
addClass(e, t) {
|
|
609
|
+
e.classList.add(t);
|
|
610
|
+
}
|
|
611
|
+
removeAllStateClasses(e) {
|
|
612
|
+
this.removeClass(e, this.options.loadedClass), this.removeClass(e, this.options.loadingClass), this.removeClass(e, this.options.errorClass), this.removeClass(e, this.options.noPhotoClass);
|
|
613
|
+
}
|
|
614
|
+
setBaseClass(e) {
|
|
615
|
+
this.addClass(e, this.options.baseClass);
|
|
616
|
+
}
|
|
617
|
+
imageIsLoading(e) {
|
|
618
|
+
var t, i;
|
|
619
|
+
this.addClass(e, this.options.loadingClass), (i = (t = this.options).onLoading) == null || i.call(t, e);
|
|
620
|
+
}
|
|
621
|
+
imageHasNoPhoto(e) {
|
|
622
|
+
this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.noPhotoClass), this.setDefaultPhoto(e);
|
|
623
|
+
}
|
|
624
|
+
imageIsLoaded(e) {
|
|
625
|
+
var t, i;
|
|
626
|
+
this.hasImgLoaded = !0, this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.loadedClass), (i = (t = this.options).onLoaded) == null || i.call(t, e);
|
|
627
|
+
}
|
|
628
|
+
imageHasError(e, t) {
|
|
629
|
+
var i, o;
|
|
630
|
+
console.warn("[maz-ui][MazLazyImg] Error while loading image", t), this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.errorClass), (o = (i = this.options).onError) == null || o.call(i, e), this.setDefaultPhoto(e);
|
|
631
|
+
}
|
|
632
|
+
getImageUrl(e, t) {
|
|
633
|
+
const i = this.getImgElement(e).getAttribute("data-lazy-src");
|
|
634
|
+
if (i)
|
|
635
|
+
return i;
|
|
636
|
+
t.value;
|
|
637
|
+
const o = typeof t.value == "object" ? t.value.src : t.value;
|
|
638
|
+
return o || console.warn("[maz-ui][MazLazyImg] src url is not defined"), o;
|
|
639
|
+
}
|
|
640
|
+
async setPictureSourceUrls(e) {
|
|
641
|
+
const t = e.querySelectorAll("source");
|
|
642
|
+
if (t.length > 0)
|
|
643
|
+
for await (const i of t) {
|
|
644
|
+
const o = i.getAttribute("data-lazy-srcset");
|
|
645
|
+
o ? i.srcset = o : console.warn(
|
|
646
|
+
'[maz-ui][MazLazyImg] the "[data-lazy-srcset]" attribute is not provided on "<source />"'
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
else
|
|
650
|
+
console.warn(
|
|
651
|
+
'[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'
|
|
652
|
+
), this.imageHasError(e);
|
|
653
|
+
}
|
|
654
|
+
hasBgImgMode(e) {
|
|
655
|
+
return e.arg === "bg-image";
|
|
656
|
+
}
|
|
657
|
+
isPictureElement(e) {
|
|
658
|
+
return e instanceof HTMLPictureElement;
|
|
659
|
+
}
|
|
660
|
+
getImgElement(e) {
|
|
661
|
+
return this.isPictureElement(e) ? e.querySelector("img") : e;
|
|
662
|
+
}
|
|
663
|
+
async setDefaultPhoto(e) {
|
|
664
|
+
if (this.options.noUseErrorPhoto)
|
|
665
|
+
return;
|
|
666
|
+
const t = this.options.errorPhoto ?? await this.loadErrorPhoto(), i = e.querySelectorAll("source");
|
|
667
|
+
if (i.length > 0)
|
|
668
|
+
for await (const o of i)
|
|
669
|
+
o.srcset = t;
|
|
670
|
+
else
|
|
671
|
+
this.setImgSrc(e, t);
|
|
672
|
+
}
|
|
673
|
+
addEventListenerToImg(e) {
|
|
674
|
+
const t = this.getImgElement(e);
|
|
675
|
+
t.addEventListener("load", () => this.onImgLoadedCallback(e), {
|
|
676
|
+
once: !0
|
|
677
|
+
}), t.addEventListener("error", (i) => this.onImgErrorCallback(e, i), { once: !0 });
|
|
678
|
+
}
|
|
679
|
+
async loadImage(e, t) {
|
|
680
|
+
if (this.imageIsLoading(e), this.isPictureElement(e))
|
|
681
|
+
this.addEventListenerToImg(e), await this.setPictureSourceUrls(e);
|
|
682
|
+
else {
|
|
683
|
+
const i = this.getImageUrl(e, t);
|
|
684
|
+
if (!i)
|
|
685
|
+
return this.imageHasError(e);
|
|
686
|
+
this.hasBgImgMode(t) ? (e.style.backgroundImage = `url('${i}')`, this.imageIsLoaded(e)) : (this.addEventListenerToImg(e), this.setImgSrc(e, i));
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
setImgSrc(e, t) {
|
|
690
|
+
const i = this.getImgElement(e);
|
|
691
|
+
i.src = t;
|
|
692
|
+
}
|
|
693
|
+
handleIntersectionObserver(e, t, i, o) {
|
|
694
|
+
var l, d;
|
|
695
|
+
this.observers.push(o);
|
|
696
|
+
for (const n of i)
|
|
697
|
+
if (n.isIntersecting) {
|
|
698
|
+
if ((d = (l = this.options).onIntersecting) == null || d.call(l, n.target), this.options.observerOnce && o.unobserve(e), this.options.loadOnce && this.hasImgLoaded)
|
|
699
|
+
return;
|
|
700
|
+
this.loadImage(e, t);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
createObserver(e, t) {
|
|
704
|
+
const i = (d, n) => {
|
|
705
|
+
this.handleIntersectionObserver(e, t, d, n);
|
|
706
|
+
}, o = this.options.observerOptions;
|
|
707
|
+
new IntersectionObserver(i, o).observe(e);
|
|
708
|
+
}
|
|
709
|
+
async imageHandler(e, t, i) {
|
|
710
|
+
if (i === "update")
|
|
711
|
+
for await (const o of this.observers)
|
|
712
|
+
o.unobserve(e);
|
|
713
|
+
window.IntersectionObserver ? this.createObserver(e, t) : this.loadImage(e, t);
|
|
714
|
+
}
|
|
715
|
+
async bindUpdateHandler(e, t, i) {
|
|
716
|
+
if (this.options.noPhoto)
|
|
717
|
+
return this.imageHasNoPhoto(e);
|
|
718
|
+
await this.imageHandler(e, t, i);
|
|
719
|
+
}
|
|
720
|
+
async add(e, t) {
|
|
721
|
+
if (this.hasBgImgMode(t) && this.isPictureElement(e))
|
|
722
|
+
throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);
|
|
723
|
+
setTimeout(() => this.setBaseClass(e), 0), e.getAttribute("src") || this.setImgSrc(e, mt), await this.bindUpdateHandler(e, t, "bind");
|
|
724
|
+
}
|
|
725
|
+
async update(e, t) {
|
|
726
|
+
t.value !== t.oldValue && (this.hasImgLoaded = !1, this.removeAllStateClasses(e), await this.bindUpdateHandler(e, t, "update"));
|
|
727
|
+
}
|
|
728
|
+
remove(e, t) {
|
|
729
|
+
this.hasImgLoaded = !1, this.hasBgImgMode(t) && (e.style.backgroundImage = ""), this.removeAllStateClasses(e);
|
|
730
|
+
for (const i of this.observers)
|
|
731
|
+
i.unobserve(e);
|
|
732
|
+
this.observers = [];
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
let te;
|
|
736
|
+
const dt = {
|
|
737
|
+
created(s, e) {
|
|
738
|
+
const t = typeof e.value == "object" ? e.value : {};
|
|
739
|
+
te = new Fe(t), te.add(s, e);
|
|
740
|
+
},
|
|
741
|
+
updated(s, e) {
|
|
742
|
+
te.update(s, e);
|
|
743
|
+
},
|
|
744
|
+
unmounted(s, e) {
|
|
745
|
+
te.remove(s, e);
|
|
746
|
+
}
|
|
747
|
+
}, ht = "lazy-img", as = {
|
|
748
|
+
install(s, e = {}) {
|
|
749
|
+
const t = {
|
|
750
|
+
...he,
|
|
751
|
+
...e,
|
|
752
|
+
observerOptions: {
|
|
753
|
+
...he.observerOptions,
|
|
754
|
+
...e.observerOptions
|
|
755
|
+
}
|
|
756
|
+
}, i = new Fe(t);
|
|
757
|
+
s.directive(ht, {
|
|
758
|
+
created: i.add.bind(i),
|
|
759
|
+
updated: i.update.bind(i),
|
|
760
|
+
unmounted: i.remove.bind(i)
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
}, vt = ["onClick", "onKeypress"], ft = { class: "m-fullscreen-img-scroller" }, gt = ["src", "alt"], pt = /* @__PURE__ */ Ae({
|
|
764
|
+
__name: "MazFullscreenImg",
|
|
765
|
+
props: {
|
|
766
|
+
destroy: { type: Function, default: void 0 },
|
|
767
|
+
src: {},
|
|
768
|
+
alt: { default: void 0 },
|
|
769
|
+
openInstanceClass: {},
|
|
770
|
+
zoom: { type: Boolean, default: !0 },
|
|
771
|
+
disabled: { type: Boolean },
|
|
772
|
+
clickedElementBounds: {},
|
|
773
|
+
clickedElement: {},
|
|
774
|
+
animated: { type: Boolean, default: !0 },
|
|
775
|
+
scaleAnimation: { type: Boolean }
|
|
776
|
+
},
|
|
777
|
+
emits: ["close", "previous", "next", "before-close"],
|
|
778
|
+
setup(s, { emit: e }) {
|
|
779
|
+
const t = e, i = $(() => import("./MazSpinner-03bd76bd.mjs")), o = $(() => import("./x-mark-35f2f1e7.mjs")), l = $(() => import("./chevron-left-39b4621e.mjs"));
|
|
780
|
+
let d;
|
|
781
|
+
et(async () => {
|
|
782
|
+
d = await import("vue-scrollto");
|
|
783
|
+
});
|
|
784
|
+
const n = s, p = h(!1), E = h(!1), b = h(!1), C = h(!1), S = h(!1), I = h(!1), w = h(!1), B = h(n.clickedElement instanceof HTMLImageElement), R = h(n.src), O = h(n.alt), G = h(), c = h(), T = y(
|
|
785
|
+
() => B.value && n.animated && !n.scaleAnimation
|
|
786
|
+
), K = y(
|
|
787
|
+
() => (B.value || !n.animated) && !n.scaleAnimation
|
|
788
|
+
), N = h(!1), Q = y(() => I.value ? `--is-zoomed maz-cursor-zoom-in maz-max-w-[none] ${N.value ? "maz-h-screen maz-w-auto" : "maz-h-auto maz-w-screen"}` : `cursor-zoom-out ${N.value ? "maz-w-screen maz-h-screen --is-landscape" : "maz-h-screen maz-w-auto"}`);
|
|
789
|
+
function re() {
|
|
790
|
+
E.value = !0, b.value = !1, C.value = !0;
|
|
791
|
+
}
|
|
792
|
+
function P() {
|
|
793
|
+
t("before-close"), p.value = !1;
|
|
794
|
+
}
|
|
795
|
+
function m(u) {
|
|
796
|
+
u.key === "Escape" && (u.preventDefault(), P()), (u.key === "ArrowLeft" || u.key === "ArrowRight") && (u.preventDefault(), ae(u.key === "ArrowRight"));
|
|
797
|
+
}
|
|
798
|
+
function f() {
|
|
799
|
+
document.documentElement.classList.add("--m-fullscreen-open");
|
|
800
|
+
}
|
|
801
|
+
function g() {
|
|
802
|
+
document.documentElement.classList.remove("--m-fullscreen-open");
|
|
803
|
+
}
|
|
804
|
+
function W() {
|
|
805
|
+
return [...document.querySelectorAll(".m-fullscreen-img-instance")];
|
|
806
|
+
}
|
|
807
|
+
function je(u, a) {
|
|
808
|
+
return a < 0 ? u.length - 1 : a >= u.length ? 0 : a;
|
|
809
|
+
}
|
|
810
|
+
async function Re(u, a) {
|
|
811
|
+
u.classList.remove(n.openInstanceClass), a.classList.add(n.openInstanceClass);
|
|
812
|
+
const v = a.getAttribute("data-src"), k = a.getAttribute("data-alt");
|
|
813
|
+
O.value = k ?? void 0, v && (R.value = v), E.value = !1, await X(300), E.value || (b.value = !0);
|
|
814
|
+
}
|
|
815
|
+
function ae(u) {
|
|
816
|
+
const a = document.querySelector(
|
|
817
|
+
`.m-fullscreen-img-instance.${n.openInstanceClass}`
|
|
818
|
+
);
|
|
819
|
+
if (a) {
|
|
820
|
+
const v = W(), k = v.indexOf(a), H = u ? k + 1 : k - 1, A = v[je(v, H)];
|
|
821
|
+
A && Re(a, A), t(u ? "next" : "previous");
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
async function Ke(u) {
|
|
825
|
+
const a = u.target;
|
|
826
|
+
a.style.width = `${a.clientWidth}px`, a.style.height = `${a.clientHeight}px`, await X(0), I.value = !I.value, a.style.removeProperty("width"), a.style.removeProperty("height"), await X(0);
|
|
827
|
+
const v = a.clientWidth / u.clientY, H = window.innerWidth / v - window.innerHeight / 2;
|
|
828
|
+
d.scrollTo(a, 200, {
|
|
829
|
+
container: a.parentElement,
|
|
830
|
+
easing: "linear",
|
|
831
|
+
offset: I.value ? H : 0
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
ve(async () => {
|
|
835
|
+
await ke(), document.addEventListener("keydown", m), p.value = !0, b.value = !0, f(), S.value = W().length > 1, c.value && (N.value = n.clickedElementBounds.height < n.clickedElementBounds.width);
|
|
836
|
+
});
|
|
837
|
+
function ye() {
|
|
838
|
+
c.value && (w.value = !0, c.value.style.removeProperty("margin-left"), c.value.style.removeProperty("margin-right"), c.value.style.opacity = "0.5", c.value.style.width = `${n.clickedElementBounds.width}px`, c.value.style.height = `${n.clickedElementBounds.height}px`, c.value.style.top = `${n.clickedElementBounds.top}px`, c.value.style.left = `${n.clickedElementBounds.left}px`);
|
|
839
|
+
}
|
|
840
|
+
async function We() {
|
|
841
|
+
if (await X(0), c.value) {
|
|
842
|
+
c.value.style.opacity = "1", c.value.style.removeProperty("height"), c.value.style.removeProperty("width"), c.value.style.removeProperty("transform");
|
|
843
|
+
const u = window.innerWidth, a = window.innerHeight, v = n.clickedElementBounds.height, k = n.clickedElementBounds.width;
|
|
844
|
+
if (N.value) {
|
|
845
|
+
c.value.style.left = "0px";
|
|
846
|
+
const H = v * u / k, A = (a - H) / 2;
|
|
847
|
+
c.value.style.top = `${A <= 0 ? 0 : A}px`;
|
|
848
|
+
} else {
|
|
849
|
+
c.value.style.top = "0px";
|
|
850
|
+
const H = k * a / v, A = (u - H) / 2;
|
|
851
|
+
c.value.style.left = `${A <= 0 ? 0 : A}px`;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
function Ye() {
|
|
856
|
+
c.value && (c.value.style.removeProperty("top"), c.value.style.removeProperty("left"), c.value.style.marginLeft = "auto", c.value.style.marginRight = "auto", c.value.style.removeProperty("opacity")), w.value = !1;
|
|
857
|
+
}
|
|
858
|
+
function Xe() {
|
|
859
|
+
if (c.value) {
|
|
860
|
+
const { left: u, top: a } = c.value.getBoundingClientRect();
|
|
861
|
+
c.value.style.left = `${u}px`, c.value.style.top = `${a}px`, c.value.style.width = `${c.value.width}px`, c.value.style.height = `${c.value.height}px`, w.value = !0;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
function Ze() {
|
|
865
|
+
var u, a;
|
|
866
|
+
t("close"), (u = G.value) == null || u.remove(), (a = n.destroy) == null || a.call(n);
|
|
867
|
+
}
|
|
868
|
+
return tt(() => {
|
|
869
|
+
document.removeEventListener("keydown", m), g();
|
|
870
|
+
}), (u, a) => (z(), Z("div", {
|
|
871
|
+
ref_key: "FullscreenImgElement",
|
|
872
|
+
ref: G,
|
|
873
|
+
role: "button",
|
|
874
|
+
class: ue(["m-fullscreen-img", { "--animation-active": w.value }]),
|
|
875
|
+
tabindex: "0",
|
|
876
|
+
onClick: M(P, ["self"]),
|
|
877
|
+
onKeypress: st(M(P, ["prevent"]), ["esc"])
|
|
878
|
+
}, [
|
|
879
|
+
me(_(
|
|
880
|
+
L(i),
|
|
881
|
+
{ class: "m-fullscreen-img-loader maz-h-16" },
|
|
882
|
+
null,
|
|
883
|
+
512
|
|
884
|
+
/* NEED_PATCH */
|
|
885
|
+
), [
|
|
886
|
+
[de, b.value]
|
|
887
|
+
]),
|
|
888
|
+
C.value && S.value ? (z(), Z("button", {
|
|
889
|
+
key: 0,
|
|
890
|
+
type: "button",
|
|
891
|
+
class: "m-fullscreen-btn --next",
|
|
892
|
+
onClick: a[0] || (a[0] = M((v) => ae(!0), ["stop"]))
|
|
893
|
+
}, [
|
|
894
|
+
_(L(l), { class: "maz-rotate-90 maz-text-2xl" })
|
|
895
|
+
])) : q("v-if", !0),
|
|
896
|
+
p.value && C.value && S.value ? (z(), Z("button", {
|
|
897
|
+
key: 1,
|
|
898
|
+
type: "button",
|
|
899
|
+
class: "m-fullscreen-btn --previous",
|
|
900
|
+
onClick: a[1] || (a[1] = M((v) => ae(!1), ["stop"]))
|
|
901
|
+
}, [
|
|
902
|
+
_(L(l), { class: "maz-text-2xl" })
|
|
903
|
+
])) : q("v-if", !0),
|
|
904
|
+
D("button", {
|
|
905
|
+
type: "button",
|
|
906
|
+
class: "m-fullscreen-btn --close",
|
|
907
|
+
onClick: P
|
|
908
|
+
}, [
|
|
909
|
+
_(L(o), { class: "maz-text-2xl" })
|
|
910
|
+
]),
|
|
911
|
+
D("div", ft, [
|
|
912
|
+
_(xe, {
|
|
913
|
+
name: K.value ? void 0 : "maz-scale-fade",
|
|
914
|
+
onBeforeEnter: a[3] || (a[3] = (v) => T.value && ye()),
|
|
915
|
+
onEnter: a[4] || (a[4] = (v) => T.value && We()),
|
|
916
|
+
onAfterEnter: a[5] || (a[5] = (v) => T.value && Ye()),
|
|
917
|
+
onBeforeLeave: a[6] || (a[6] = (v) => T.value && Xe()),
|
|
918
|
+
onLeave: a[7] || (a[7] = (v) => T.value && ye()),
|
|
919
|
+
onAfterLeave: Ze,
|
|
920
|
+
persisted: ""
|
|
921
|
+
}, {
|
|
922
|
+
default: oe(() => [
|
|
923
|
+
me(D("img", {
|
|
924
|
+
id: "ZvImgElement",
|
|
925
|
+
ref_key: "ImgElement",
|
|
926
|
+
ref: c,
|
|
927
|
+
src: R.value,
|
|
928
|
+
alt: O.value,
|
|
929
|
+
tabindex: "0",
|
|
930
|
+
class: ue([{ zoomable: u.zoom }, Q.value]),
|
|
931
|
+
onLoad: re,
|
|
932
|
+
onClick: a[2] || (a[2] = (v) => u.zoom ? Ke(v) : void 0)
|
|
933
|
+
}, null, 42, gt), [
|
|
934
|
+
[de, p.value]
|
|
935
|
+
])
|
|
936
|
+
]),
|
|
937
|
+
_: 1
|
|
938
|
+
/* STABLE */
|
|
939
|
+
}, 8, ["name"])
|
|
940
|
+
])
|
|
941
|
+
], 42, vt));
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
const Be = (s, e) => {
|
|
945
|
+
const t = s.__vccOpts || s;
|
|
946
|
+
for (const [i, o] of e)
|
|
947
|
+
t[i] = o;
|
|
948
|
+
return t;
|
|
949
|
+
}, yt = /* @__PURE__ */ Be(pt, [["__scopeId", "data-v-1b5808d8"]]), we = "m-fullscreen-is-open";
|
|
950
|
+
class bt {
|
|
951
|
+
constructor() {
|
|
952
|
+
r(this, "options");
|
|
953
|
+
r(this, "defaultOptions", {
|
|
954
|
+
scaleOnHover: !1,
|
|
955
|
+
blurOnHover: !1,
|
|
956
|
+
disabled: !1,
|
|
957
|
+
animated: !0,
|
|
958
|
+
zoom: !0,
|
|
959
|
+
scaleAnimation: !1
|
|
960
|
+
});
|
|
961
|
+
r(this, "mouseEnterListener");
|
|
962
|
+
r(this, "mouseLeaveListener");
|
|
963
|
+
r(this, "renderPreviewListener");
|
|
964
|
+
}
|
|
965
|
+
buildOptions(e, t) {
|
|
966
|
+
const i = typeof t.value == "object" ? t.value : { src: t.value, alt: void 0 }, o = (i == null ? void 0 : i.src) ?? this.getImgSrc(e), l = (i == null ? void 0 : i.alt) ?? this.getImgAlt(e);
|
|
967
|
+
return {
|
|
968
|
+
...this.defaultOptions,
|
|
969
|
+
...i,
|
|
970
|
+
src: o,
|
|
971
|
+
alt: l
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
get allInstances() {
|
|
975
|
+
return [...document.querySelectorAll(".m-fullscreen-img-instance")];
|
|
976
|
+
}
|
|
977
|
+
getImgSrc(e) {
|
|
978
|
+
var i;
|
|
979
|
+
const t = ((i = this.options) == null ? void 0 : i.src) || e.getAttribute("src") || e.getAttribute("data-src");
|
|
980
|
+
if (!t)
|
|
981
|
+
throw new Error(
|
|
982
|
+
'[maz-ui](fullscreen-img) src of image must be provided by `v-fullscreen=""`, `v-fullscreen="{ src: "" }"`, `src=""` or `data-src=""` atributes'
|
|
983
|
+
);
|
|
984
|
+
return t;
|
|
985
|
+
}
|
|
986
|
+
getImgAlt(e) {
|
|
987
|
+
var t;
|
|
988
|
+
return ((t = this.options) == null ? void 0 : t.alt) || e.getAttribute("alt") || e.getAttribute("data-alt");
|
|
989
|
+
}
|
|
990
|
+
create(e, t) {
|
|
991
|
+
if (this.options = this.buildOptions(e, t), this.options.disabled)
|
|
992
|
+
return;
|
|
993
|
+
e.style.cursor = "move", (this.options.scaleOnHover || this.options.blurOnHover) && (e.style.transition = "all 300ms ease-in-out"), e.classList.add("m-fullscreen-img-instance"), e.setAttribute("data-src", this.getImgSrc(e));
|
|
994
|
+
const i = this.getImgAlt(e);
|
|
995
|
+
i && e.setAttribute("data-alt", i), this.mouseEnterListener = () => this.mouseEnter(e), this.mouseLeaveListener = () => this.mouseLeave(e), this.renderPreviewListener = () => this.renderPreview(e), e.addEventListener("mouseenter", this.mouseEnterListener), e.addEventListener("mouseleave", this.mouseLeaveListener), e.addEventListener("click", this.renderPreviewListener);
|
|
996
|
+
}
|
|
997
|
+
update(e, t) {
|
|
998
|
+
this.options = this.buildOptions(e, t);
|
|
999
|
+
}
|
|
1000
|
+
remove(e) {
|
|
1001
|
+
e.removeEventListener("mouseenter", this.mouseEnterListener), e.removeEventListener("mouseleave", this.mouseLeaveListener), e.removeEventListener("click", this.renderPreviewListener), e.classList.remove("m-fullscreen-img-instance"), e.style.cursor = "";
|
|
1002
|
+
}
|
|
1003
|
+
renderPreview(e) {
|
|
1004
|
+
return e.classList.add(we), Ce(yt, {
|
|
1005
|
+
props: {
|
|
1006
|
+
...this.options,
|
|
1007
|
+
openInstanceClass: we,
|
|
1008
|
+
clickedElement: e,
|
|
1009
|
+
clickedElementBounds: e.getBoundingClientRect()
|
|
1010
|
+
},
|
|
1011
|
+
addDestroyInProps: !0
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
mouseLeave(e) {
|
|
1015
|
+
this.options.scaleOnHover && (e.style.transform = ""), this.options.blurOnHover && (e.style.filter = ""), e.style.zIndex = "";
|
|
1016
|
+
}
|
|
1017
|
+
mouseEnter(e) {
|
|
1018
|
+
e.style.zIndex = "1", this.options.scaleOnHover && (e.style.transform = "scale(1.05)"), this.options.blurOnHover && (e.style.filter = "blur(3px)");
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
let se;
|
|
1022
|
+
const Ne = {
|
|
1023
|
+
mounted(s, e) {
|
|
1024
|
+
return se = new bt(), se.create(s, e);
|
|
1025
|
+
},
|
|
1026
|
+
updated(s, e) {
|
|
1027
|
+
return se.update(s, e);
|
|
1028
|
+
},
|
|
1029
|
+
unmounted(s) {
|
|
1030
|
+
return se.remove(s);
|
|
1031
|
+
}
|
|
1032
|
+
}, ls = {
|
|
1033
|
+
install(s) {
|
|
1034
|
+
s.directive("fullscreen-img", Ne);
|
|
1035
|
+
}
|
|
1036
|
+
}, wt = [
|
|
1037
|
+
{
|
|
1038
|
+
name: "click-outside",
|
|
1039
|
+
directive: He
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
name: "closable",
|
|
1043
|
+
directive: Me
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "zoom-img",
|
|
1047
|
+
directive: De
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: "lazy-img",
|
|
1051
|
+
directive: dt
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
name: "fullscreen-img",
|
|
1055
|
+
directive: Ne
|
|
1056
|
+
}
|
|
1057
|
+
], cs = {
|
|
1058
|
+
install(s) {
|
|
1059
|
+
for (const { name: e, directive: t } of wt)
|
|
1060
|
+
s.directive(e, t);
|
|
1061
|
+
}
|
|
1062
|
+
}, zt = (s) => s ? (s = s.toString(), s.charAt(0).toUpperCase() + s.slice(1)) : "", Et = {
|
|
1063
|
+
style: "currency",
|
|
1064
|
+
minimumFractionDigits: 2,
|
|
1065
|
+
round: !1
|
|
1066
|
+
}, Lt = (s, e, t) => {
|
|
1067
|
+
let i = Number(s);
|
|
1068
|
+
return t.round && (i = Math.floor(i), t.minimumFractionDigits = 0), new Intl.NumberFormat(e, t).format(i);
|
|
1069
|
+
}, It = (s, e, t) => {
|
|
1070
|
+
if (s === void 0)
|
|
1071
|
+
throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");
|
|
1072
|
+
if (e === void 0)
|
|
1073
|
+
throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");
|
|
1074
|
+
if (typeof e != "string")
|
|
1075
|
+
throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");
|
|
1076
|
+
if (t.currency === void 0)
|
|
1077
|
+
throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.");
|
|
1078
|
+
}, Tt = (s, e, t) => {
|
|
1079
|
+
const i = {
|
|
1080
|
+
...Et,
|
|
1081
|
+
...t
|
|
1082
|
+
};
|
|
1083
|
+
It(s, e, i);
|
|
1084
|
+
try {
|
|
1085
|
+
return Lt(s, e, i);
|
|
1086
|
+
} catch (o) {
|
|
1087
|
+
throw new Error(`[maz-ui](FilterCurrency) ${o}`);
|
|
1088
|
+
}
|
|
1089
|
+
}, kt = {
|
|
1090
|
+
month: "short",
|
|
1091
|
+
day: "numeric",
|
|
1092
|
+
year: "numeric"
|
|
1093
|
+
}, At = (s, e, t) => {
|
|
1094
|
+
if (e === void 0)
|
|
1095
|
+
throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");
|
|
1096
|
+
if (typeof e != "string")
|
|
1097
|
+
throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");
|
|
1098
|
+
const i = t ?? kt;
|
|
1099
|
+
try {
|
|
1100
|
+
const o = s instanceof Date ? s : new Date(s);
|
|
1101
|
+
return new Intl.DateTimeFormat(e, i).format(o);
|
|
1102
|
+
} catch (o) {
|
|
1103
|
+
throw new Error(`[maz-ui](FilterDate) ${o}`);
|
|
1104
|
+
}
|
|
1105
|
+
}, xt = {
|
|
1106
|
+
minimumFractionDigits: 2
|
|
1107
|
+
}, Ct = (s, e, t) => {
|
|
1108
|
+
const i = {
|
|
1109
|
+
...xt,
|
|
1110
|
+
...t
|
|
1111
|
+
};
|
|
1112
|
+
if (s === void 0)
|
|
1113
|
+
throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");
|
|
1114
|
+
if (e === void 0)
|
|
1115
|
+
throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");
|
|
1116
|
+
if (typeof e != "string")
|
|
1117
|
+
throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");
|
|
1118
|
+
try {
|
|
1119
|
+
return new Intl.NumberFormat(e, i).format(Number(s));
|
|
1120
|
+
} catch (o) {
|
|
1121
|
+
throw new Error(`[maz-ui](FilterNumber) ${o}`);
|
|
1122
|
+
}
|
|
1123
|
+
}, St = {
|
|
1124
|
+
capitalize: zt,
|
|
1125
|
+
currency: Tt,
|
|
1126
|
+
date: At,
|
|
1127
|
+
number: Ct
|
|
1128
|
+
}, us = {
|
|
1129
|
+
install(s) {
|
|
1130
|
+
s.provide("filters", St);
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
class Ot {
|
|
1134
|
+
constructor(e, t) {
|
|
1135
|
+
r(this, "callback");
|
|
1136
|
+
r(this, "delay");
|
|
1137
|
+
r(this, "timer");
|
|
1138
|
+
r(this, "startedAt");
|
|
1139
|
+
this.startedAt = Date.now(), this.callback = e, this.delay = t, this.start();
|
|
1140
|
+
}
|
|
1141
|
+
pause() {
|
|
1142
|
+
this.stop(), this.delay -= Date.now() - this.startedAt;
|
|
1143
|
+
}
|
|
1144
|
+
resume() {
|
|
1145
|
+
this.startedAt = Date.now(), this.start();
|
|
1146
|
+
}
|
|
1147
|
+
start() {
|
|
1148
|
+
this.timer = setTimeout(this.callback, this.delay);
|
|
1149
|
+
}
|
|
1150
|
+
stop() {
|
|
1151
|
+
clearTimeout(this.timer);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
const Pt = { class: "m-toast__message-wrapper" }, Ht = { class: "m-toast__message" }, _t = { class: "maz-flex maz-items-center maz-gap-2" }, $t = { key: 0 }, Mt = /* @__PURE__ */ Ae({
|
|
1155
|
+
__name: "MazToast",
|
|
1156
|
+
props: {
|
|
1157
|
+
position: {
|
|
1158
|
+
type: String,
|
|
1159
|
+
default: "bottom-right"
|
|
1160
|
+
},
|
|
1161
|
+
maxToasts: { type: [Number, Boolean], default: !1 },
|
|
1162
|
+
timeout: { type: Number, default: 1e4 },
|
|
1163
|
+
queue: { type: Boolean, default: !1 },
|
|
1164
|
+
noPauseOnHover: { type: Boolean, default: !1 },
|
|
1165
|
+
type: {
|
|
1166
|
+
type: String,
|
|
1167
|
+
default: "info",
|
|
1168
|
+
validator: (s) => ["info", "success", "warning", "danger"].includes(s)
|
|
1169
|
+
},
|
|
1170
|
+
message: { type: String, required: !0 },
|
|
1171
|
+
link: { type: Object, default: void 0 },
|
|
1172
|
+
action: { type: Object, default: void 0 },
|
|
1173
|
+
persistent: { type: Boolean, default: !1 }
|
|
1174
|
+
},
|
|
1175
|
+
emits: ["close", "click"],
|
|
1176
|
+
setup(s, { emit: e }) {
|
|
1177
|
+
const t = $(() => import("./x-mark-35f2f1e7.mjs")), i = $(
|
|
1178
|
+
() => import("./arrow-top-right-on-square-15191934.mjs")
|
|
1179
|
+
), o = $(() => import("./link-bb14441d.mjs")), l = $(() => import("./MazBtn-760c3b29.mjs")), d = h(), n = s, p = e, E = y(() => n.position.includes("top") ? "top" : "bottom"), b = y(() => n.position.includes("left") ? "left" : n.position.includes("right") ? "right" : "center"), C = y(() => b.value !== "center" ? b.value === "right" ? "m-slide-right" : "m-slide-left" : E.value === "top" ? "m-slide-top" : "m-slide-bottom"), S = h(!1), I = h(!1), w = h(), B = h(), R = `m-toast-container --${E.value} --${b.value}`, O = `.${R.replaceAll(" ", ".")}`, G = () => {
|
|
1180
|
+
const m = document.querySelector(O);
|
|
1181
|
+
if (!m && !m) {
|
|
1182
|
+
const f = document.body, g = document.createElement("div");
|
|
1183
|
+
g.className = R, f.append(g);
|
|
1184
|
+
}
|
|
1185
|
+
}, c = () => {
|
|
1186
|
+
const m = document.querySelector(O);
|
|
1187
|
+
return !n.queue && n.maxToasts === !1 ? !1 : typeof n.maxToasts == "number" && m ? n.maxToasts <= m.childElementCount : m && m.childElementCount > 0;
|
|
1188
|
+
}, T = () => {
|
|
1189
|
+
if (c()) {
|
|
1190
|
+
B.value = setTimeout(T, 250);
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
const m = document.querySelector(O);
|
|
1194
|
+
d.value && m && m.prepend(d.value), I.value = !0, w.value = n.timeout ? new Ot(P, n.timeout) : void 0;
|
|
1195
|
+
};
|
|
1196
|
+
function K(m) {
|
|
1197
|
+
p("click", m), n.persistent || P();
|
|
1198
|
+
}
|
|
1199
|
+
async function N(m, f) {
|
|
1200
|
+
var g;
|
|
1201
|
+
S.value = !0, await m(), S.value = !1, (g = n.action) != null && g.closeToast && K(f);
|
|
1202
|
+
}
|
|
1203
|
+
const Q = (m) => {
|
|
1204
|
+
w.value && !n.noPauseOnHover && (m ? w.value.pause() : w.value.resume());
|
|
1205
|
+
}, re = () => {
|
|
1206
|
+
w.value && w.value.stop(), B.value && clearTimeout(B.value);
|
|
1207
|
+
}, P = () => {
|
|
1208
|
+
re(), I.value = !1, setTimeout(() => {
|
|
1209
|
+
var f;
|
|
1210
|
+
p("close"), (f = d.value) == null || f.remove();
|
|
1211
|
+
const m = document.querySelector(O);
|
|
1212
|
+
m && !(m != null && m.hasChildNodes()) && m.remove();
|
|
1213
|
+
}, 300);
|
|
1214
|
+
};
|
|
1215
|
+
return ve(() => {
|
|
1216
|
+
G(), T();
|
|
1217
|
+
}), (m, f) => (z(), Y(xe, {
|
|
1218
|
+
name: C.value,
|
|
1219
|
+
persisted: ""
|
|
1220
|
+
}, {
|
|
1221
|
+
default: oe(() => [
|
|
1222
|
+
me(D(
|
|
1223
|
+
"button",
|
|
1224
|
+
{
|
|
1225
|
+
ref_key: "Toaster",
|
|
1226
|
+
ref: d,
|
|
1227
|
+
class: ue(["m-toast", [`--${s.type}`, `--${E.value}`, `--${b.value}`]]),
|
|
1228
|
+
role: "alert",
|
|
1229
|
+
onMouseover: f[2] || (f[2] = (g) => Q(!0)),
|
|
1230
|
+
onMouseleave: f[3] || (f[3] = (g) => Q(!1)),
|
|
1231
|
+
onClick: f[4] || (f[4] = M((g) => {
|
|
1232
|
+
var W;
|
|
1233
|
+
return s.link && !((W = s.link) != null && W.closeToast) ? void 0 : K(g);
|
|
1234
|
+
}, ["stop"]))
|
|
1235
|
+
},
|
|
1236
|
+
[
|
|
1237
|
+
D("div", Pt, [
|
|
1238
|
+
D(
|
|
1239
|
+
"p",
|
|
1240
|
+
Ht,
|
|
1241
|
+
le(s.message),
|
|
1242
|
+
1
|
|
1243
|
+
/* TEXT */
|
|
1244
|
+
)
|
|
1245
|
+
]),
|
|
1246
|
+
s.action ? (z(), Y(L(l), {
|
|
1247
|
+
key: 0,
|
|
1248
|
+
color: s.type,
|
|
1249
|
+
pastel: "",
|
|
1250
|
+
loading: S.value,
|
|
1251
|
+
size: "sm",
|
|
1252
|
+
onClick: f[0] || (f[0] = M((g) => N(s.action.func, g), ["stop"]))
|
|
1253
|
+
}, {
|
|
1254
|
+
default: oe(() => [
|
|
1255
|
+
it(
|
|
1256
|
+
le(s.action.text),
|
|
1257
|
+
1
|
|
1258
|
+
/* TEXT */
|
|
1259
|
+
)
|
|
1260
|
+
]),
|
|
1261
|
+
_: 1
|
|
1262
|
+
/* STABLE */
|
|
1263
|
+
}, 8, ["color", "loading"])) : q("v-if", !0),
|
|
1264
|
+
s.link ? (z(), Y(L(l), {
|
|
1265
|
+
key: 1,
|
|
1266
|
+
color: s.type,
|
|
1267
|
+
pastel: "",
|
|
1268
|
+
size: "xs",
|
|
1269
|
+
href: s.link.href,
|
|
1270
|
+
target: s.link.target ?? "_self"
|
|
1271
|
+
}, {
|
|
1272
|
+
default: oe(() => {
|
|
1273
|
+
var g;
|
|
1274
|
+
return [
|
|
1275
|
+
D("div", _t, [
|
|
1276
|
+
s.link.text ? (z(), Z(
|
|
1277
|
+
"span",
|
|
1278
|
+
$t,
|
|
1279
|
+
le(s.link.text),
|
|
1280
|
+
1
|
|
1281
|
+
/* TEXT */
|
|
1282
|
+
)) : q("v-if", !0),
|
|
1283
|
+
((g = s.link) == null ? void 0 : g.target) == "_blank" ? (z(), Y(L(i), {
|
|
1284
|
+
key: 1,
|
|
1285
|
+
class: "maz-text-xl"
|
|
1286
|
+
})) : (z(), Y(L(o), {
|
|
1287
|
+
key: 2,
|
|
1288
|
+
class: "maz-text-xl"
|
|
1289
|
+
}))
|
|
1290
|
+
])
|
|
1291
|
+
];
|
|
1292
|
+
}),
|
|
1293
|
+
_: 1
|
|
1294
|
+
/* STABLE */
|
|
1295
|
+
}, 8, ["color", "href", "target"])) : q("v-if", !0),
|
|
1296
|
+
s.persistent ? q("v-if", !0) : (z(), Z("button", {
|
|
1297
|
+
key: 2,
|
|
1298
|
+
class: "--close",
|
|
1299
|
+
onClick: f[1] || (f[1] = M((g) => K(g), ["stop"]))
|
|
1300
|
+
}, [
|
|
1301
|
+
_(L(t), { class: "--icon maz-text-xl" })
|
|
1302
|
+
]))
|
|
1303
|
+
],
|
|
1304
|
+
34
|
|
1305
|
+
/* CLASS, HYDRATE_EVENTS */
|
|
1306
|
+
), [
|
|
1307
|
+
[de, I.value]
|
|
1308
|
+
])
|
|
1309
|
+
]),
|
|
1310
|
+
_: 1
|
|
1311
|
+
/* STABLE */
|
|
1312
|
+
}, 8, ["name"]));
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
const Dt = /* @__PURE__ */ Be(Mt, [["__scopeId", "data-v-27a7b86f"]]), Ft = {
|
|
1316
|
+
position: "bottom-right",
|
|
1317
|
+
timeout: 1e4,
|
|
1318
|
+
persistent: !1
|
|
1319
|
+
};
|
|
1320
|
+
class Bt {
|
|
1321
|
+
constructor(e, t) {
|
|
1322
|
+
this.app = e, this.globalOptions = t;
|
|
1323
|
+
}
|
|
1324
|
+
show(e, t) {
|
|
1325
|
+
const i = { message: e, ...t }, o = {
|
|
1326
|
+
...Ft,
|
|
1327
|
+
...i,
|
|
1328
|
+
...this.globalOptions,
|
|
1329
|
+
...t
|
|
1330
|
+
};
|
|
1331
|
+
Ce(Dt, {
|
|
1332
|
+
props: o,
|
|
1333
|
+
app: this.app
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
getLocalOptions(e, t) {
|
|
1337
|
+
return {
|
|
1338
|
+
type: e,
|
|
1339
|
+
...t
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
success(e, t) {
|
|
1343
|
+
return this.show(e, this.getLocalOptions("success", t));
|
|
1344
|
+
}
|
|
1345
|
+
error(e, t) {
|
|
1346
|
+
return this.show(e, this.getLocalOptions("danger", t));
|
|
1347
|
+
}
|
|
1348
|
+
info(e, t) {
|
|
1349
|
+
return this.show(e, this.getLocalOptions("info", t));
|
|
1350
|
+
}
|
|
1351
|
+
warning(e, t) {
|
|
1352
|
+
return this.show(e, this.getLocalOptions("warning", t));
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
let ze;
|
|
1356
|
+
const ms = {
|
|
1357
|
+
install(s, e) {
|
|
1358
|
+
ze = new Bt(s, e), s.provide("toast", ze);
|
|
1359
|
+
}
|
|
1360
|
+
}, U = "", Nt = (s) => s.filter((e, t, i) => t === i.indexOf(e)), qt = (s) => (e = U) => typeof e == "function" ? s.findIndex((...t) => e(...t)) > -1 : s.includes(e), Ut = (s) => s.length > 0, Vt = (s) => (e = U) => Nt([...s, e]), jt = (s) => (e = U) => s.filter((t) => t !== e);
|
|
1361
|
+
class Rt {
|
|
1362
|
+
constructor() {
|
|
1363
|
+
r(this, "_loaders", h([]));
|
|
1364
|
+
}
|
|
1365
|
+
get loaders() {
|
|
1366
|
+
return y(() => this._loaders.value);
|
|
1367
|
+
}
|
|
1368
|
+
stop(e = U) {
|
|
1369
|
+
this._loaders.value = jt(this._loaders.value)(e);
|
|
1370
|
+
}
|
|
1371
|
+
start(e = U) {
|
|
1372
|
+
return this._loaders.value = Vt(this._loaders.value)(e), () => this.stop(e);
|
|
1373
|
+
}
|
|
1374
|
+
get anyLoading() {
|
|
1375
|
+
return y(() => Ut(this._loaders.value));
|
|
1376
|
+
}
|
|
1377
|
+
isLoading(e = U) {
|
|
1378
|
+
return y(() => qt(this._loaders.value)(e)).value;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
const Kt = new Rt(), ds = {
|
|
1382
|
+
install: (s) => {
|
|
1383
|
+
s.provide("wait", Kt);
|
|
1384
|
+
}
|
|
1385
|
+
}, ce = {
|
|
1386
|
+
delay: 100,
|
|
1387
|
+
observer: {
|
|
1388
|
+
root: void 0,
|
|
1389
|
+
rootMargin: "0px",
|
|
1390
|
+
threshold: 0.2
|
|
1391
|
+
},
|
|
1392
|
+
animation: {
|
|
1393
|
+
once: !0,
|
|
1394
|
+
duration: 300,
|
|
1395
|
+
delay: 0
|
|
1396
|
+
}
|
|
1397
|
+
};
|
|
1398
|
+
class Wt {
|
|
1399
|
+
constructor(e) {
|
|
1400
|
+
r(this, "options");
|
|
1401
|
+
this.options = {
|
|
1402
|
+
delay: (e == null ? void 0 : e.delay) ?? ce.delay,
|
|
1403
|
+
observer: {
|
|
1404
|
+
...ce.observer,
|
|
1405
|
+
...e == null ? void 0 : e.observer
|
|
1406
|
+
},
|
|
1407
|
+
animation: {
|
|
1408
|
+
...ce.animation,
|
|
1409
|
+
...e == null ? void 0 : e.animation
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
async handleObserver() {
|
|
1414
|
+
await X(this.options.delay);
|
|
1415
|
+
const e = new IntersectionObserver(this.handleIntersect.bind(this), {
|
|
1416
|
+
...this.options.observer
|
|
1417
|
+
});
|
|
1418
|
+
for (const t of document.querySelectorAll("[data-maz-aos]")) {
|
|
1419
|
+
const i = t.getAttribute("data-maz-aos-anchor");
|
|
1420
|
+
if (i) {
|
|
1421
|
+
const o = document.querySelector(i);
|
|
1422
|
+
o ? (o.setAttribute("data-maz-aos-children", "true"), e.observe(o)) : console.warn(`[maz-ui](aos) no element found with selector "${i}"`);
|
|
1423
|
+
} else
|
|
1424
|
+
e.observe(t);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
runAnimations() {
|
|
1428
|
+
if (F())
|
|
1429
|
+
return this.handleObserver();
|
|
1430
|
+
console.warn("[MazAos](runAnimations) should be executed on client side");
|
|
1431
|
+
}
|
|
1432
|
+
handleIntersect(e, t) {
|
|
1433
|
+
for (const i of e) {
|
|
1434
|
+
const l = i.target.getAttribute("data-maz-aos-children") === "true", d = i.target.getAttribute("data-maz-aos") ? [i.target] : [];
|
|
1435
|
+
if (l) {
|
|
1436
|
+
const n = [...document.querySelectorAll("[data-maz-aos-anchor]")].map(
|
|
1437
|
+
(p) => p.getAttribute("data-maz-aos-anchor") === `#${i.target.id}` ? p : void 0
|
|
1438
|
+
);
|
|
1439
|
+
for (const p of n)
|
|
1440
|
+
p && d.push(p);
|
|
1441
|
+
}
|
|
1442
|
+
for (const n of d) {
|
|
1443
|
+
const p = n.getAttribute("data-maz-aos-once"), E = typeof p == "string" ? p === "true" : this.options.animation.once;
|
|
1444
|
+
if (typeof this.options.observer.threshold == "number" && i.intersectionRatio > this.options.observer.threshold) {
|
|
1445
|
+
const b = n.getAttribute("data-maz-aos-duration"), C = n.getAttribute("data-maz-aos-delay");
|
|
1446
|
+
b || (n.style.transitionDuration = `${this.options.animation.duration}ms`, setTimeout(() => {
|
|
1447
|
+
n.style.transitionDuration = "0";
|
|
1448
|
+
}, 1e3)), C || (n.style.transitionDelay = `${this.options.animation.delay}ms`, setTimeout(() => {
|
|
1449
|
+
n.style.transitionDelay = "0";
|
|
1450
|
+
}, 1e3)), n.classList.add("maz-aos-animate"), E && t.unobserve(n);
|
|
1451
|
+
} else
|
|
1452
|
+
n.classList.remove("maz-aos-animate");
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
let ie;
|
|
1458
|
+
const hs = {
|
|
1459
|
+
install: (s, e) => {
|
|
1460
|
+
ie = new Wt(e), s.provide("aos", ie), F() && (e != null && e.router ? e.router.afterEach(async () => {
|
|
1461
|
+
ie.runAnimations();
|
|
1462
|
+
}) : ie.runAnimations());
|
|
1463
|
+
}
|
|
1464
|
+
}, Ee = {
|
|
1465
|
+
darkClass: "dark",
|
|
1466
|
+
lightClass: "light",
|
|
1467
|
+
storageThemeKey: "theme",
|
|
1468
|
+
storageThemeValueDark: "dark",
|
|
1469
|
+
storageThemeValueLight: "light",
|
|
1470
|
+
storageThemeValueSystem: "system"
|
|
1471
|
+
}, j = h("system"), x = h("system");
|
|
1472
|
+
function ge({
|
|
1473
|
+
darkClass: s,
|
|
1474
|
+
lightClass: e,
|
|
1475
|
+
storageThemeKey: t,
|
|
1476
|
+
storageThemeValueDark: i,
|
|
1477
|
+
setLocalStorageValue: o = !0,
|
|
1478
|
+
setSelectedTheme: l = !0
|
|
1479
|
+
}) {
|
|
1480
|
+
document.documentElement.classList.remove(e), document.documentElement.classList.add(s), j.value = i, l && (x.value = i), o && (localStorage[t] = i);
|
|
1481
|
+
}
|
|
1482
|
+
function pe({
|
|
1483
|
+
darkClass: s,
|
|
1484
|
+
lightClass: e,
|
|
1485
|
+
storageThemeKey: t,
|
|
1486
|
+
storageThemeValueLight: i,
|
|
1487
|
+
setLocalStorageValue: o = !0,
|
|
1488
|
+
setSelectedTheme: l = !0
|
|
1489
|
+
}) {
|
|
1490
|
+
document.documentElement.classList.remove(s), document.documentElement.classList.add(e), j.value = i, l && (x.value = i), o && (localStorage[t] = i);
|
|
1491
|
+
}
|
|
1492
|
+
function qe(s) {
|
|
1493
|
+
document.documentElement.classList.remove(s.darkClass), document.documentElement.classList.remove(s.lightClass), j.value = s.storageThemeValueSystem, x.value = s.storageThemeValueSystem, s.setLocalStorageValue && (localStorage[s.storageThemeKey] = s.storageThemeValueSystem), Ue({ ...s, setSelectedTheme: !1 });
|
|
1494
|
+
}
|
|
1495
|
+
function Le() {
|
|
1496
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1497
|
+
}
|
|
1498
|
+
function Ue(s) {
|
|
1499
|
+
localStorage[s.storageThemeKey] === s.storageThemeValueDark || !(s.storageThemeKey in localStorage) && Le() || localStorage[s.storageThemeKey] === s.storageThemeValueSystem && Le() ? ge({
|
|
1500
|
+
...s,
|
|
1501
|
+
setLocalStorageValue: !1,
|
|
1502
|
+
setSelectedTheme: !1
|
|
1503
|
+
}) : pe({
|
|
1504
|
+
...s,
|
|
1505
|
+
setLocalStorageValue: !1,
|
|
1506
|
+
setSelectedTheme: !1
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
function Ie({
|
|
1510
|
+
shouldSetDarkMode: s,
|
|
1511
|
+
...e
|
|
1512
|
+
}) {
|
|
1513
|
+
return typeof s != "boolean" ? qe(e) : s ? ge(e) : pe(e);
|
|
1514
|
+
}
|
|
1515
|
+
function Yt(s) {
|
|
1516
|
+
return j.value === s.storageThemeValueDark ? pe(s) : ge(s);
|
|
1517
|
+
}
|
|
1518
|
+
function vs(s = Ee) {
|
|
1519
|
+
const e = {
|
|
1520
|
+
...Ee,
|
|
1521
|
+
...s
|
|
1522
|
+
}, t = y(() => x.value === e.storageThemeValueDark), i = y(() => x.value === e.storageThemeValueLight), o = y(() => x.value === e.storageThemeValueSystem);
|
|
1523
|
+
return ve(() => {
|
|
1524
|
+
localStorage[e.storageThemeKey] && (j.value = localStorage[e.storageThemeKey], x.value = localStorage[e.storageThemeKey]);
|
|
1525
|
+
}), {
|
|
1526
|
+
autoSetTheme: () => Ue(e),
|
|
1527
|
+
toggleTheme: () => Yt(e),
|
|
1528
|
+
setSystemTheme: () => qe({ ...e, setLocalStorageValue: !0 }),
|
|
1529
|
+
setDarkTheme: () => Ie({ ...e, shouldSetDarkMode: !0 }),
|
|
1530
|
+
setLightTheme: () => Ie({ ...e, shouldSetDarkMode: !1 }),
|
|
1531
|
+
hasDarkTheme: t,
|
|
1532
|
+
hasLightTheme: i,
|
|
1533
|
+
hasSystemTheme: o,
|
|
1534
|
+
theme: j,
|
|
1535
|
+
selectedTheme: x
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
const fs = ({
|
|
1539
|
+
componentName: s,
|
|
1540
|
+
instance: e,
|
|
1541
|
+
providedId: t
|
|
1542
|
+
}) => y(() => t ?? `${s}-${e == null ? void 0 : e.uid}`), gs = () => fe("aos"), ps = () => fe("wait"), ys = () => fe("toast"), bs = ({
|
|
1543
|
+
callback: s,
|
|
1544
|
+
options: e
|
|
1545
|
+
}) => new ot(s, e), ws = ({
|
|
1546
|
+
callback: s,
|
|
1547
|
+
options: e
|
|
1548
|
+
}) => new nt(s, e), Xt = h(), V = h([]), Zt = (s, e) => new Promise((t, i) => {
|
|
1549
|
+
V.value = [
|
|
1550
|
+
...V.value,
|
|
1551
|
+
{
|
|
1552
|
+
id: s,
|
|
1553
|
+
isActive: !0,
|
|
1554
|
+
resolve: async () => {
|
|
1555
|
+
await (e == null ? void 0 : e()), t(!0);
|
|
1556
|
+
},
|
|
1557
|
+
reject: i
|
|
1558
|
+
}
|
|
1559
|
+
];
|
|
1560
|
+
}), Ve = (s) => (V.value = V.value.filter(({ id: e }) => e !== s), V.value), Te = (s, e, t = !1) => {
|
|
1561
|
+
var i;
|
|
1562
|
+
e && ((i = e[s]) == null || i.call(e, t), e.isActive = !1, setTimeout(() => {
|
|
1563
|
+
Ve(e.id);
|
|
1564
|
+
}, 500));
|
|
1565
|
+
}, zs = () => ({
|
|
1566
|
+
confirmDialogData: Xt,
|
|
1567
|
+
dialogState: V,
|
|
1568
|
+
showDialogAndWaitChoice: Zt,
|
|
1569
|
+
removeDialogFromState: Ve,
|
|
1570
|
+
rejectDialog: (s, e = !1) => Te("reject", s, e),
|
|
1571
|
+
resolveDialog: (s, e = !1) => Te("resolve", s, e)
|
|
1572
|
+
});
|
|
1573
|
+
export {
|
|
1574
|
+
Kt as A,
|
|
1575
|
+
Wt as B,
|
|
1576
|
+
hs as C,
|
|
1577
|
+
ie as D,
|
|
1578
|
+
vs as E,
|
|
1579
|
+
fs as F,
|
|
1580
|
+
gs as G,
|
|
1581
|
+
ps as H,
|
|
1582
|
+
ot as I,
|
|
1583
|
+
ys as J,
|
|
1584
|
+
bs as K,
|
|
1585
|
+
ws as L,
|
|
1586
|
+
zs as M,
|
|
1587
|
+
ss as S,
|
|
1588
|
+
Bt as T,
|
|
1589
|
+
nt as U,
|
|
1590
|
+
Rt as W,
|
|
1591
|
+
Be as _,
|
|
1592
|
+
F as a,
|
|
1593
|
+
cs as b,
|
|
1594
|
+
is as c,
|
|
1595
|
+
es as d,
|
|
1596
|
+
He as e,
|
|
1597
|
+
as as f,
|
|
1598
|
+
De as g,
|
|
1599
|
+
rs as h,
|
|
1600
|
+
fe as i,
|
|
1601
|
+
Ne as j,
|
|
1602
|
+
ls as k,
|
|
1603
|
+
Me as l,
|
|
1604
|
+
Ce as m,
|
|
1605
|
+
ns as n,
|
|
1606
|
+
us as o,
|
|
1607
|
+
os as p,
|
|
1608
|
+
zt as q,
|
|
1609
|
+
Tt as r,
|
|
1610
|
+
X as s,
|
|
1611
|
+
ts as t,
|
|
1612
|
+
At as u,
|
|
1613
|
+
dt as v,
|
|
1614
|
+
Ct as w,
|
|
1615
|
+
ms as x,
|
|
1616
|
+
ze as y,
|
|
1617
|
+
ds as z
|
|
1618
|
+
};
|