@nmorph/nmorph-ui-kit 2.2.55 → 2.2.56

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.
@@ -1,48 +1,47 @@
1
1
  import './NmorphMediaGallery.css';
2
- import { defineComponent as Ze, ref as k, computed as s, watch as E, onBeforeUnmount as We, openBlock as i, createElementBlock as u, Fragment as me, normalizeStyle as fe, normalizeClass as pe, renderList as je, createElementVNode as x, createBlock as B, unref as l, createVNode as r, withCtx as d, createCommentVNode as v, toDisplayString as D, withModifiers as $ } from "vue";
3
- import { useModifiers as he } from "../../../utils/create-modifiers.js";
4
- import { createCssSizeVariables as Je } from "../../../utils/common.js";
5
- import Qe from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
2
+ import { defineComponent as Xe, ref as k, computed as s, watch as z, onBeforeUnmount as Ye, openBlock as i, createElementBlock as u, Fragment as ve, normalizeStyle as me, normalizeClass as fe, renderList as Ge, createElementVNode as b, createBlock as A, unref as n, createVNode as r, withCtx as c, createCommentVNode as v, toDisplayString as M, withModifiers as P } from "vue";
3
+ import { useModifiers as ge } from "../../../utils/create-modifiers.js";
4
+ import { createCssSizeVariables as Ue } from "../../../utils/common.js";
5
+ import Ze from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
6
6
  /* empty css */
7
- import ge from "../nmorph-image/NmorphImage.vue.js";
7
+ import pe from "../nmorph-image/NmorphImage.vue.js";
8
8
  /* empty css */
9
- import p from "../../basic/nmorph-icon/NmorphIcon.vue.js";
9
+ import f from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
10
  /* empty css */
11
- import ea from "../../../assets/icons/eye.svg.js";
12
- import _e from "../../../assets/icons/full-screen.svg.js";
13
- import M from "../../basic/nmorph-button/NmorphButton.vue.js";
11
+ import We from "../../../assets/icons/eye.svg.js";
12
+ import he from "../../../assets/icons/full-screen.svg.js";
13
+ import H from "../../basic/nmorph-button/NmorphButton.vue.js";
14
14
  /* empty css */
15
- import ye from "../../../assets/icons/play.svg.js";
16
- import ke from "../../../assets/icons/download.svg.js";
17
- import aa from "../../../assets/icons/pause.svg.js";
18
- import ta from "../../../assets/icons/rotate-right.svg.js";
19
- import la from "../../../assets/icons/rotate-left.svg.js";
20
- import oa from "../../../assets/icons/zoom-in.svg.js";
21
- import na from "../../../assets/icons/zoom-out.svg.js";
22
- import ra from "../../../assets/icons/enlarge.svg.js";
23
- import ia from "../../../assets/icons/shrink.svg.js";
24
- const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
15
+ import je from "../../../assets/icons/play.svg.js";
16
+ import _e from "../../../assets/icons/download.svg.js";
17
+ import Je from "../../../assets/icons/rotate-right.svg.js";
18
+ import Qe from "../../../assets/icons/rotate-left.svg.js";
19
+ import eo from "../../../assets/icons/zoom-in.svg.js";
20
+ import oo from "../../../assets/icons/zoom-out.svg.js";
21
+ import to from "../../../assets/icons/enlarge.svg.js";
22
+ import ao from "../../../assets/icons/shrink.svg.js";
23
+ const lo = ["aria-label", "onClick"], no = ["src", "poster", "title"], ro = {
25
24
  key: 2,
26
25
  class: "nmorph-media-gallery__trigger-play"
27
- }, ca = {
26
+ }, io = {
28
27
  key: 3,
29
28
  class: "nmorph-media-gallery__trigger-name"
30
- }, va = {
29
+ }, so = {
31
30
  key: 4,
32
31
  class: "nmorph-media-gallery__trigger-size"
33
- }, ma = {
32
+ }, uo = {
34
33
  key: 0,
35
34
  class: "nmorph-media-gallery__trigger-actions"
36
- }, fa = ["aria-label", "onClick"], pa = ["aria-label", "onClick"], ha = ["href", "download", "aria-label", "onClick"], ga = { class: "nmorph-media-gallery__stage" }, _a = ["src", "poster", "controls", "muted", "playsinline", "preload", "title"], ya = ["aria-label"], ka = {
37
- key: 3,
35
+ }, co = ["aria-label", "onClick"], vo = ["aria-label", "onClick"], mo = ["href", "download", "aria-label", "onClick"], fo = { class: "nmorph-media-gallery__stage" }, go = ["src", "poster", "controls", "muted", "playsinline", "preload", "title"], po = {
36
+ key: 2,
38
37
  class: "nmorph-media-gallery__file-name"
39
- }, wa = {
40
- key: 4,
38
+ }, ho = {
39
+ key: 3,
41
40
  class: "nmorph-media-gallery__file-actions"
42
- }, ba = ["aria-label"], Ia = ["href", "download", "aria-label"], Na = {
43
- key: 5,
41
+ }, _o = ["aria-label"], yo = ["href", "download", "aria-label"], wo = {
42
+ key: 4,
44
43
  class: "nmorph-media-gallery__file-size"
45
- }, xa = { class: "nmorph-media-gallery__action-element" }, Ba = { class: "nmorph-media-gallery__action-element" }, Fa = { class: "nmorph-media-gallery__action-element" }, Ca = { class: "nmorph-media-gallery__action-element" }, Pa = { class: "nmorph-media-gallery__action-element" }, $a = 45, we = 0.25, Qa = /* @__PURE__ */ Ze({
44
+ }, ko = { class: "nmorph-media-gallery__action-element" }, Io = { class: "nmorph-media-gallery__action-element" }, bo = { class: "nmorph-media-gallery__action-element" }, Fo = { class: "nmorph-media-gallery__action-element" }, No = { class: "nmorph-media-gallery__action-element" }, Bo = 45, Uo = /* @__PURE__ */ Xe({
46
45
  __name: "NmorphMediaGallery",
47
46
  props: {
48
47
  modelValue: { type: Boolean, default: !1 },
@@ -55,6 +54,9 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
55
54
  showTriggerName: { type: Boolean, default: !0 },
56
55
  showTriggerSize: { type: Boolean, default: !0 },
57
56
  showTriggerActions: { type: Boolean, default: !0 },
57
+ showTriggerPreviewAction: { type: Boolean, default: !0 },
58
+ showTriggerFullscreenAction: { type: Boolean, default: !0 },
59
+ showTriggerDownloadAction: { type: Boolean, default: !0 },
58
60
  showTriggerPlayButton: { type: Boolean, default: !0 },
59
61
  showNavigationButtons: { type: Boolean, default: !0 },
60
62
  showActionBar: { type: Boolean, default: !0 },
@@ -66,120 +68,106 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
66
68
  videoFit: { default: "contain" }
67
69
  },
68
70
  emits: ["update:model-value", "update:active-index", "close", "change", "download", "fullscreen"],
69
- setup(be, { emit: Ie }) {
70
- const n = be, _ = Ie, w = k(n.modelValue), F = k(0), h = k(null), X = k({}), V = k(null), m = k(!1), b = k(!1), I = k(1), y = k(0), C = k(null), g = s(() => n.items || []), Y = s(() => g.value.length > 1), G = s(() => n.showNavigationButtons && Y.value), P = (e) => {
71
- const t = g.value.length - 1;
71
+ setup(ye, { emit: we }) {
72
+ const l = ye, g = we, _ = k(l.modelValue), F = k(0), N = k(null), K = k({}), C = k(null), p = k(!1), y = k(1), h = k(0), B = k(null), m = s(() => l.items || []), q = s(() => m.value.length > 1), O = s(() => l.showNavigationButtons && q.value), x = (e) => {
73
+ const t = m.value.length - 1;
72
74
  return t < 0 || !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e;
73
- }, N = s(() => P(F.value)), o = s(() => g.value[N.value]), Z = s(() => o.value?.kind === "image"), z = s(() => o.value?.kind === "video"), W = s(
74
- () => o.value?.kind === "video" ? o.value.controls !== !1 : !1
75
- ), Ne = s(() => o.value?.kind === "video" ? o.value.muted === !0 : !1), xe = s(
76
- () => o.value?.kind === "video" ? o.value.playsinline !== !1 : !0
77
- ), j = s(
78
- () => o.value?.kind === "video" && o.value.preload || "metadata"
75
+ }, w = s(() => x(F.value)), a = s(() => m.value[w.value]), X = s(() => a.value?.kind === "image"), V = s(() => a.value?.kind === "video"), Y = s(
76
+ () => a.value?.kind === "video" ? a.value.controls !== !1 : !1
77
+ ), ke = s(() => a.value?.kind === "video" ? a.value.muted === !0 : !1), Ie = s(
78
+ () => a.value?.kind === "video" ? a.value.playsinline !== !1 : !0
79
+ ), be = s(
80
+ () => a.value?.kind === "video" && a.value.preload || "metadata"
81
+ ), Fe = s(
82
+ () => a.value?.kind === "video" && a.value.name || "video"
83
+ ), D = s(() => a.value?.name || ""), G = s(() => l.showFileName ? D.value : ""), L = s(() => a.value?.downloadHref || ""), U = s(() => l.showFileActions && V.value && !Y.value), Ne = s(
84
+ () => l.showFileActions && (U.value || !!L.value)
79
85
  ), Be = s(
80
- () => n.showPlaybackButton && j.value === "metadata" ? "auto" : j.value
81
- ), R = s(
82
- () => o.value?.kind === "video" && o.value.name || "video"
83
- ), A = s(() => o.value?.name || ""), J = s(() => n.showFileName ? A.value : ""), K = s(() => o.value?.downloadHref || ""), Fe = s(() => n.showPlaybackButton && z.value && b.value), Q = s(() => n.showFileActions && z.value && !W.value), Ce = s(
84
- () => n.showFileActions && (Q.value || !!K.value)
85
- ), Pe = s(
86
- () => he({
86
+ () => ge({
87
87
  "nmorph-media-gallery": [
88
- w.value && "opened",
89
- Z.value && "image",
90
- z.value && "video",
91
- m.value && z.value && "video-playing",
92
- n.imageFit === "cover" && Z.value && "image-cover",
93
- n.videoFit === "cover" && z.value && "video-cover"
88
+ _.value && "opened",
89
+ X.value && "image",
90
+ V.value && "video",
91
+ p.value && V.value && "video-playing",
92
+ l.imageFit === "cover" && X.value && "image-cover",
93
+ l.videoFit === "cover" && V.value && "video-cover"
94
94
  ]
95
95
  })
96
- ), $e = s(() => `rotate(${y.value}deg) scale(${I.value})`), Ve = s(
97
- () => Je({
98
- "--nmorph-media-gallery-trigger-height": n.height
96
+ ), xe = s(() => `rotate(${h.value}deg) scale(${y.value})`), Ce = s(
97
+ () => Ue({
98
+ "--nmorph-media-gallery-trigger-height": l.height
99
99
  })
100
- ), ze = s(
101
- () => he({
102
- "nmorph-media-gallery__trigger": [n.height !== void 0 && "fixed-height"]
100
+ ), Te = s(
101
+ () => ge({
102
+ "nmorph-media-gallery__trigger": [l.height !== void 0 && "fixed-height"]
103
103
  })
104
- ), ee = (e) => {
104
+ ), Z = (e) => {
105
105
  if (e === void 0 || Number.isNaN(e) || e < 0) return "";
106
106
  if (e === 0) return "0 B";
107
- const t = ["B", "KB", "MB", "GB", "TB"], a = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), c = e / 1024 ** a, f = c >= 10 || a === 0 || Number.isInteger(c) ? 0 : 1;
108
- return `${c.toFixed(f)} ${t[a]}`;
109
- }, ae = s(() => n.showFileSize ? ee(o.value?.size) : ""), H = (e) => e.name || "", S = (e, t) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${t + 1}`, te = (e) => ee(e.size), O = (e) => e.downloadHref || "", He = (e, t) => {
110
- X.value[e] = t instanceof HTMLVideoElement ? t : null;
107
+ const t = ["B", "KB", "MB", "GB", "TB"], o = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), d = e / 1024 ** o, I = d >= 10 || o === 0 || Number.isInteger(d) ? 0 : 1;
108
+ return `${d.toFixed(I)} ${t[o]}`;
109
+ }, W = s(() => l.showFileSize ? Z(a.value?.size) : ""), T = (e) => e.name || "", $ = (e, t) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${t + 1}`, j = (e) => Z(e.size), J = (e) => e.downloadHref || "", Q = (e) => l.showTriggerPreviewAction && e.kind === "video", ee = (e) => l.showTriggerFullscreenAction && e.kind === "video", oe = (e) => l.showTriggerDownloadAction && !!J(e), $e = (e) => l.showTriggerActions && (Q(e) || ee(e) || oe(e)), ze = (e, t) => {
110
+ K.value[e] = t instanceof HTMLVideoElement ? t : null;
111
111
  };
112
- E(
113
- () => n.modelValue,
112
+ z(
113
+ () => l.modelValue,
114
114
  (e) => {
115
- w.value = e;
115
+ _.value = e;
116
116
  }
117
- ), E(
118
- () => n.activeIndex,
117
+ ), z(
118
+ () => l.activeIndex,
119
119
  (e) => {
120
- typeof e == "number" && (F.value = P(e));
120
+ typeof e == "number" && (F.value = x(e));
121
121
  },
122
122
  { immediate: !0 }
123
- ), E(
124
- () => [n.initialIndex, g.value.length],
123
+ ), z(
124
+ () => [l.initialIndex, m.value.length],
125
125
  () => {
126
- typeof n.activeIndex != "number" && (F.value = P(n.initialIndex));
126
+ typeof l.activeIndex != "number" && (F.value = x(l.initialIndex));
127
127
  },
128
128
  { immediate: !0 }
129
- ), E(
130
- () => [o.value?.kind, o.value?.src, N.value],
129
+ ), z(
130
+ () => [a.value?.kind, a.value?.src, w.value],
131
131
  () => {
132
- m.value = !1, b.value = !1, V.value = null;
132
+ p.value = !1, C.value = null;
133
133
  }
134
134
  );
135
- const T = () => {
136
- !h.value || h.value === V.value || (h.value.pause(), m.value = !1, V.value = h.value);
137
- }, le = () => {
138
- I.value = 1, y.value = 0;
139
- }, oe = (e) => {
140
- if (!g.value.length) return;
141
- const t = P(e);
142
- if (t === N.value) return;
143
- T(), m.value = !1, b.value = !1, F.value = t, le(), _("update:active-index", t);
144
- const a = g.value[t];
145
- a && _("change", a, t);
146
- }, q = () => {
147
- const e = g.value.length;
148
- e && oe(N.value === 0 ? e - 1 : N.value - 1);
149
- }, U = () => {
150
- const e = g.value.length;
151
- e && oe(N.value === e - 1 ? 0 : N.value + 1);
152
- }, ne = (e) => {
153
- if (!g.value.length) return;
154
- const t = P(e);
155
- T(), m.value = !1, b.value = !1, F.value = t, le(), w.value = !0, _("update:model-value", !0), _("update:active-index", t);
156
- const a = g.value[t];
157
- a && _("change", a, t);
158
- }, re = () => {
159
- w.value && (T(), w.value = !1, _("update:model-value", !1), _("close"));
135
+ const S = () => {
136
+ !N.value || N.value === C.value || (N.value.pause(), p.value = !1, C.value = N.value);
137
+ }, te = () => {
138
+ y.value = 1, h.value = 0;
139
+ }, ae = (e) => {
140
+ if (!m.value.length) return;
141
+ const t = x(e);
142
+ if (t === w.value) return;
143
+ S(), p.value = !1, F.value = t, te(), g("update:active-index", t);
144
+ const o = m.value[t];
145
+ o && g("change", o, t);
146
+ }, E = () => {
147
+ const e = m.value.length;
148
+ e && ae(w.value === 0 ? e - 1 : w.value - 1);
149
+ }, R = () => {
150
+ const e = m.value.length;
151
+ e && ae(w.value === e - 1 ? 0 : w.value + 1);
152
+ }, le = (e) => {
153
+ if (!m.value.length) return;
154
+ const t = x(e);
155
+ S(), p.value = !1, F.value = t, te(), _.value = !0, g("update:model-value", !0), g("update:active-index", t);
156
+ const o = m.value[t];
157
+ o && g("change", o, t);
158
+ }, ne = () => {
159
+ _.value && (S(), _.value = !1, g("update:model-value", !1), g("close"));
160
+ }, Ae = () => {
161
+ h.value = h.value + 90, h.value >= 360 && (h.value = 0);
162
+ }, Pe = () => {
163
+ h.value = h.value - 90, h.value <= -360 && (h.value = 0);
164
+ }, He = () => {
165
+ y.value = parseFloat(Math.min(y.value + 0.2, 4).toFixed(3));
166
+ }, Ve = () => {
167
+ y.value = parseFloat(Math.max(y.value - 0.2, 0.2).toFixed(3));
160
168
  }, Se = () => {
161
- y.value = y.value + 90, y.value >= 360 && (y.value = 0);
162
- }, Le = () => {
163
- y.value = y.value - 90, y.value <= -360 && (y.value = 0);
164
- }, Ee = () => {
165
- I.value = parseFloat(Math.min(I.value + 0.2, 4).toFixed(3));
166
- }, Me = () => {
167
- I.value = parseFloat(Math.max(I.value - 0.2, 0.2).toFixed(3));
168
- }, Te = () => {
169
- I.value = 1;
170
- }, De = async () => {
171
- if (!(!h.value || !b.value)) {
172
- if (m.value) {
173
- h.value.pause();
174
- return;
175
- }
176
- try {
177
- await h.value.play();
178
- } catch {
179
- m.value = !1;
180
- }
181
- }
182
- }, ie = async (e) => {
169
+ y.value = 1;
170
+ }, re = async (e) => {
183
171
  if (e)
184
172
  try {
185
173
  const t = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
@@ -190,194 +178,181 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
190
178
  e.webkitEnterFullscreen?.();
191
179
  } catch {
192
180
  }
193
- }, Re = async () => {
194
- !o.value || o.value.kind !== "video" || (_("fullscreen", o.value, N.value), await ie(h.value));
195
- }, Ae = async (e, t) => {
196
- e.kind === "video" && (_("fullscreen", e, t), await ie(X.value[t]));
197
- }, se = (e, t) => {
198
- _("download", e, t);
181
+ }, Me = async () => {
182
+ !a.value || a.value.kind !== "video" || (g("fullscreen", a.value, w.value), await re(N.value));
183
+ }, De = async (e, t) => {
184
+ e.kind === "video" && (g("fullscreen", e, t), await re(K.value[t]));
185
+ }, ie = (e, t) => {
186
+ g("download", e, t);
187
+ }, Le = () => {
188
+ a.value && ie(a.value, w.value);
189
+ }, Ee = () => {
190
+ p.value = !0, C.value = null;
191
+ }, Re = () => {
192
+ p.value = !1;
199
193
  }, Ke = () => {
200
- o.value && se(o.value, N.value);
201
- }, Oe = () => {
202
- m.value = !0, V.value = null;
203
- }, qe = (e) => {
204
- const t = e.duration;
205
- if (!Number.isFinite(t) || t <= 0) return !1;
206
- const a = e.buffered, c = Math.max(0, t - we);
207
- for (let f = 0; f < a.length; f += 1)
208
- try {
209
- if (a.start(f) <= we && a.end(f) >= c) return !0;
210
- } catch {
211
- return !1;
212
- }
213
- return !1;
214
- }, L = () => {
215
- b.value = h.value ? qe(h.value) : !1;
216
- }, Ue = () => {
217
- m.value = !1;
218
- }, Xe = () => {
219
- m.value = !1;
220
- }, Ye = () => {
221
- m.value = !1, b.value = !1;
222
- }, ue = (e) => {
223
- if (w.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
194
+ p.value = !1;
195
+ }, qe = () => {
196
+ p.value = !1;
197
+ }, se = (e) => {
198
+ if (_.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
224
199
  if (e.key === "Escape") {
225
- e.preventDefault(), re();
200
+ e.preventDefault(), ne();
226
201
  return;
227
202
  }
228
- Y.value && (e.key === "ArrowLeft" && (e.preventDefault(), q()), e.key === "ArrowRight" && (e.preventDefault(), U()));
203
+ q.value && (e.key === "ArrowLeft" && (e.preventDefault(), E()), e.key === "ArrowRight" && (e.preventDefault(), R()));
229
204
  }
230
- }, Ge = () => {
231
- typeof document > "u" || document.addEventListener("keydown", ue);
232
- }, de = () => {
233
- typeof document > "u" || document.removeEventListener("keydown", ue);
205
+ }, Oe = () => {
206
+ typeof document > "u" || document.addEventListener("keydown", se);
207
+ }, ue = () => {
208
+ typeof document > "u" || document.removeEventListener("keydown", se);
234
209
  };
235
- E(
236
- w,
210
+ z(
211
+ _,
237
212
  (e) => {
238
- e ? (Ge(), V.value = null, b.value = !1, F.value = P(
239
- typeof n.activeIndex == "number" ? n.activeIndex : n.initialIndex
240
- )) : (T(), m.value = !1, b.value = !1, de());
213
+ e ? (Oe(), C.value = null, F.value = x(
214
+ typeof l.activeIndex == "number" ? l.activeIndex : l.initialIndex
215
+ )) : (S(), p.value = !1, ue());
241
216
  },
242
217
  { immediate: !0 }
243
- ), We(de);
218
+ ), Ye(ue);
244
219
  const ce = (e) => {
245
- C.value = { x: e.clientX, y: e.clientY };
246
- }, ve = (e) => {
247
- if (!C.value || !G.value) {
248
- C.value = null;
220
+ B.value = { x: e.clientX, y: e.clientY };
221
+ }, de = (e) => {
222
+ if (!B.value || !O.value) {
223
+ B.value = null;
249
224
  return;
250
225
  }
251
- const t = e.clientX - C.value.x, a = e.clientY - C.value.y;
252
- C.value = null, !(Math.abs(t) < $a || Math.abs(t) < Math.abs(a) * 1.2) && (t > 0 ? q() : U());
226
+ const t = e.clientX - B.value.x, o = e.clientY - B.value.y;
227
+ B.value = null, !(Math.abs(t) < Bo || Math.abs(t) < Math.abs(o) * 1.2) && (t > 0 ? E() : R());
253
228
  };
254
- return (e, t) => (i(), u(me, null, [
255
- n.showTrigger ? (i(), u("div", {
229
+ return (e, t) => (i(), u(ve, null, [
230
+ l.showTrigger ? (i(), u("div", {
256
231
  key: 0,
257
- class: pe(ze.value),
258
- style: fe(Ve.value)
232
+ class: fe(Te.value),
233
+ style: me(Ce.value)
259
234
  }, [
260
- (i(!0), u(me, null, je(g.value, (a, c) => (i(), u("div", {
261
- key: `${a.kind}-${a.src}-${c}`,
262
- class: pe(["nmorph-media-gallery__trigger-item", `nmorph-media-gallery__trigger-item--${a.kind}`])
235
+ (i(!0), u(ve, null, Ge(m.value, (o, d) => (i(), u("div", {
236
+ key: `${o.kind}-${o.src}-${d}`,
237
+ class: fe(["nmorph-media-gallery__trigger-item", `nmorph-media-gallery__trigger-item--${o.kind}`])
263
238
  }, [
264
- x("button", {
239
+ b("button", {
265
240
  type: "button",
266
241
  class: "nmorph-media-gallery__trigger-open",
267
- "aria-label": `Open ${S(a, c)}`,
268
- onClick: (f) => ne(c)
242
+ "aria-label": `Open ${$(o, d)}`,
243
+ onClick: (I) => le(d)
269
244
  }, [
270
- a.kind === "image" ? (i(), B(l(ge), {
245
+ o.kind === "image" ? (i(), A(n(pe), {
271
246
  key: 0,
272
- src: a.src,
273
- alt: a.alt || S(a, c),
274
- title: H(a),
247
+ src: o.src,
248
+ alt: o.alt || $(o, d),
249
+ title: T(o),
275
250
  fit: "cover",
276
251
  "frame-border": 0
277
252
  }, null, 8, ["src", "alt", "title"])) : (i(), u("video", {
278
253
  key: 1,
279
254
  ref_for: !0,
280
- ref: (f) => He(c, f),
255
+ ref: (I) => ze(d, I),
281
256
  class: "nmorph-media-gallery__trigger-video",
282
- src: a.src,
283
- poster: a.poster || void 0,
257
+ src: o.src,
258
+ poster: o.poster || void 0,
284
259
  muted: "",
285
260
  playsinline: "",
286
261
  preload: "metadata",
287
- title: H(a)
288
- }, null, 8, ua)),
289
- n.showTriggerPlayButton && a.kind === "video" ? (i(), u("span", da, [
290
- r(l(p), {
262
+ title: T(o)
263
+ }, null, 8, no)),
264
+ l.showTriggerPlayButton && o.kind === "video" ? (i(), u("span", ro, [
265
+ r(n(f), {
291
266
  size: "medium",
292
267
  color: "var(--nmorph-contrast-text-color)"
293
268
  }, {
294
- default: d(() => [
295
- r(l(ye))
269
+ default: c(() => [
270
+ r(n(je))
296
271
  ]),
297
272
  _: 1
298
273
  })
299
274
  ])) : v("", !0),
300
- n.showTriggerName && H(a) ? (i(), u("span", ca, D(H(a)), 1)) : v("", !0),
301
- n.showTriggerSize && te(a) ? (i(), u("span", va, D(te(a)), 1)) : v("", !0)
302
- ], 8, sa),
303
- n.showTriggerActions && (O(a) || a.kind === "video") ? (i(), u("div", ma, [
304
- a.kind === "video" ? (i(), u("button", {
275
+ l.showTriggerName && T(o) ? (i(), u("span", io, M(T(o)), 1)) : v("", !0),
276
+ l.showTriggerSize && j(o) ? (i(), u("span", so, M(j(o)), 1)) : v("", !0)
277
+ ], 8, lo),
278
+ $e(o) ? (i(), u("div", uo, [
279
+ Q(o) ? (i(), u("button", {
305
280
  key: 0,
306
281
  type: "button",
307
282
  class: "nmorph-media-gallery__trigger-action",
308
- "aria-label": `Preview ${S(a, c)}`,
309
- onClick: $((f) => ne(c), ["stop"])
283
+ "aria-label": `Preview ${$(o, d)}`,
284
+ onClick: P((I) => le(d), ["stop"])
310
285
  }, [
311
- r(l(p), {
286
+ r(n(f), {
312
287
  size: "small",
313
288
  color: "var(--nmorph-contrast-text-color)"
314
289
  }, {
315
- default: d(() => [
316
- r(l(ea))
290
+ default: c(() => [
291
+ r(n(We))
317
292
  ]),
318
293
  _: 1
319
294
  })
320
- ], 8, fa)) : v("", !0),
321
- a.kind === "video" ? (i(), u("button", {
295
+ ], 8, co)) : v("", !0),
296
+ ee(o) ? (i(), u("button", {
322
297
  key: 1,
323
298
  type: "button",
324
299
  class: "nmorph-media-gallery__trigger-action",
325
- "aria-label": `Fullscreen ${S(a, c)}`,
326
- onClick: $((f) => Ae(a, c), ["stop"])
300
+ "aria-label": `Fullscreen ${$(o, d)}`,
301
+ onClick: P((I) => De(o, d), ["stop"])
327
302
  }, [
328
- r(l(p), {
303
+ r(n(f), {
329
304
  size: "small",
330
305
  color: "var(--nmorph-contrast-text-color)"
331
306
  }, {
332
- default: d(() => [
333
- r(l(_e))
307
+ default: c(() => [
308
+ r(n(he))
334
309
  ]),
335
310
  _: 1
336
311
  })
337
- ], 8, pa)) : v("", !0),
338
- O(a) ? (i(), u("a", {
312
+ ], 8, vo)) : v("", !0),
313
+ oe(o) ? (i(), u("a", {
339
314
  key: 2,
340
- href: O(a),
341
- download: H(a) || void 0,
315
+ href: J(o),
316
+ download: T(o) || void 0,
342
317
  class: "nmorph-media-gallery__trigger-action",
343
- "aria-label": `Download ${S(a, c)}`,
344
- onClick: $((f) => se(a, c), ["stop"])
318
+ "aria-label": `Download ${$(o, d)}`,
319
+ onClick: P((I) => ie(o, d), ["stop"])
345
320
  }, [
346
- r(l(p), {
321
+ r(n(f), {
347
322
  size: "small",
348
323
  color: "var(--nmorph-contrast-text-color)"
349
324
  }, {
350
- default: d(() => [
351
- r(l(ke))
325
+ default: c(() => [
326
+ r(n(_e))
352
327
  ]),
353
328
  _: 1
354
329
  })
355
- ], 8, ha)) : v("", !0)
330
+ ], 8, mo)) : v("", !0)
356
331
  ])) : v("", !0)
357
332
  ], 2))), 128))
358
333
  ], 6)) : v("", !0),
359
- w.value ? (i(), B(Qe, {
334
+ _.value ? (i(), A(Ze, {
360
335
  key: 1,
361
- show: w.value,
362
- "z-index": n.zIndex,
363
- "state-class": Pe.value,
336
+ show: _.value,
337
+ "z-index": l.zIndex,
338
+ "state-class": Be.value,
364
339
  "content-class": "nmorph-media-gallery__content",
365
340
  "left-class": "nmorph-media-gallery__left",
366
341
  "right-class": "nmorph-media-gallery__right",
367
342
  "actions-class": "nmorph-media-gallery__actions",
368
- "show-navigation": G.value,
369
- "show-action-bar": n.showActionBar && o.value?.kind === "image",
370
- onClose: re,
371
- onPrevious: q,
372
- onNext: U
343
+ "show-navigation": O.value,
344
+ "show-action-bar": l.showActionBar && a.value?.kind === "image",
345
+ onClose: ne,
346
+ onPrevious: E,
347
+ onNext: R
373
348
  }, {
374
- actions: d(() => [
375
- x("div", xa, [
376
- r(l(M), { onClick: Se }, {
377
- default: d(() => [
378
- r(l(p), null, {
379
- default: d(() => [
380
- r(l(ta))
349
+ actions: c(() => [
350
+ b("div", ko, [
351
+ r(n(H), { onClick: Ae }, {
352
+ default: c(() => [
353
+ r(n(f), null, {
354
+ default: c(() => [
355
+ r(n(Je))
381
356
  ]),
382
357
  _: 1
383
358
  })
@@ -385,12 +360,12 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
385
360
  _: 1
386
361
  })
387
362
  ]),
388
- x("div", Ba, [
389
- r(l(M), { onClick: Le }, {
390
- default: d(() => [
391
- r(l(p), null, {
392
- default: d(() => [
393
- r(l(la))
363
+ b("div", Io, [
364
+ r(n(H), { onClick: Pe }, {
365
+ default: c(() => [
366
+ r(n(f), null, {
367
+ default: c(() => [
368
+ r(n(Qe))
394
369
  ]),
395
370
  _: 1
396
371
  })
@@ -398,12 +373,12 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
398
373
  _: 1
399
374
  })
400
375
  ]),
401
- x("div", Fa, [
402
- r(l(M), { onClick: Ee }, {
403
- default: d(() => [
404
- r(l(p), null, {
405
- default: d(() => [
406
- r(l(oa))
376
+ b("div", bo, [
377
+ r(n(H), { onClick: He }, {
378
+ default: c(() => [
379
+ r(n(f), null, {
380
+ default: c(() => [
381
+ r(n(eo))
407
382
  ]),
408
383
  _: 1
409
384
  })
@@ -411,12 +386,12 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
411
386
  _: 1
412
387
  })
413
388
  ]),
414
- x("div", Ca, [
415
- r(l(M), { onClick: Me }, {
416
- default: d(() => [
417
- r(l(p), null, {
418
- default: d(() => [
419
- r(l(na))
389
+ b("div", Fo, [
390
+ r(n(H), { onClick: Ve }, {
391
+ default: c(() => [
392
+ r(n(f), null, {
393
+ default: c(() => [
394
+ r(n(oo))
420
395
  ]),
421
396
  _: 1
422
397
  })
@@ -424,15 +399,15 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
424
399
  _: 1
425
400
  })
426
401
  ]),
427
- x("div", Pa, [
428
- r(l(M), {
429
- disabled: I.value === 1,
430
- onClick: Te
402
+ b("div", No, [
403
+ r(n(H), {
404
+ disabled: y.value === 1,
405
+ onClick: Se
431
406
  }, {
432
- default: d(() => [
433
- r(l(p), null, {
434
- default: d(() => [
435
- I.value < 1 ? (i(), B(l(ra), { key: 0 })) : (i(), B(l(ia), { key: 1 }))
407
+ default: c(() => [
408
+ r(n(f), null, {
409
+ default: c(() => [
410
+ y.value < 1 ? (i(), A(n(to), { key: 0 })) : (i(), A(n(ao), { key: 1 }))
436
411
  ]),
437
412
  _: 1
438
413
  })
@@ -441,98 +416,76 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
441
416
  }, 8, ["disabled"])
442
417
  ])
443
418
  ]),
444
- default: d(() => [
445
- x("div", ga, [
446
- o.value?.kind === "image" ? (i(), B(l(ge), {
419
+ default: c(() => [
420
+ b("div", fo, [
421
+ a.value?.kind === "image" ? (i(), A(n(pe), {
447
422
  key: 0,
448
- src: o.value.src,
449
- alt: o.value.alt || o.value.name || "",
450
- title: o.value.name,
451
- fit: n.imageFit,
423
+ src: a.value.src,
424
+ alt: a.value.alt || a.value.name || "",
425
+ title: a.value.name,
426
+ fit: l.imageFit,
452
427
  "frame-border": 0,
453
- style: fe({ transform: $e.value }),
428
+ style: me({ transform: xe.value }),
454
429
  onPointerdown: ce,
455
- onPointerup: ve
456
- }, null, 8, ["src", "alt", "title", "fit", "style"])) : o.value?.kind === "video" ? (i(), u("video", {
430
+ onPointerup: de
431
+ }, null, 8, ["src", "alt", "title", "fit", "style"])) : a.value?.kind === "video" ? (i(), u("video", {
457
432
  key: 1,
458
433
  ref_key: "currentVideoRef",
459
- ref: h,
434
+ ref: N,
460
435
  class: "nmorph-media-gallery__video",
461
- src: o.value.src,
462
- poster: o.value.poster || void 0,
463
- controls: W.value,
464
- muted: Ne.value,
465
- playsinline: xe.value,
466
- preload: Be.value,
467
- title: o.value.name,
436
+ src: a.value.src,
437
+ poster: a.value.poster || void 0,
438
+ controls: Y.value,
439
+ muted: ke.value,
440
+ playsinline: Ie.value,
441
+ preload: be.value,
442
+ title: a.value.name,
468
443
  onPointerdown: ce,
469
- onPointerup: ve,
470
- onLoadedmetadata: L,
471
- onDurationchange: L,
472
- onProgress: L,
473
- onCanplaythrough: L,
474
- onSuspend: L,
475
- onPlay: Oe,
476
- onPause: Ue,
477
- onEnded: Xe,
478
- onError: Ye
479
- }, null, 40, _a)) : v("", !0),
480
- Fe.value ? (i(), u("button", {
481
- key: 2,
482
- class: "nmorph-media-gallery__play",
483
- type: "button",
484
- "aria-label": m.value ? `Pause ${R.value}` : `Play ${R.value}`,
485
- onClick: $(De, ["stop"])
486
- }, [
487
- r(l(p), {
488
- size: "medium",
489
- color: "var(--nmorph-contrast-text-color)"
490
- }, {
491
- default: d(() => [
492
- m.value ? (i(), B(l(aa), { key: 0 })) : (i(), B(l(ye), { key: 1 }))
493
- ]),
494
- _: 1
495
- })
496
- ], 8, ya)) : v("", !0),
497
- J.value ? (i(), u("span", ka, D(J.value), 1)) : v("", !0),
498
- Ce.value ? (i(), u("div", wa, [
499
- Q.value ? (i(), u("button", {
444
+ onPointerup: de,
445
+ onPlay: Ee,
446
+ onPause: Re,
447
+ onEnded: Ke,
448
+ onError: qe
449
+ }, null, 40, go)) : v("", !0),
450
+ G.value ? (i(), u("span", po, M(G.value), 1)) : v("", !0),
451
+ Ne.value ? (i(), u("div", ho, [
452
+ U.value ? (i(), u("button", {
500
453
  key: 0,
501
454
  type: "button",
502
455
  class: "nmorph-media-gallery__file-action",
503
- "aria-label": `Fullscreen ${R.value}`,
504
- onClick: $(Re, ["stop"])
456
+ "aria-label": `Fullscreen ${Fe.value}`,
457
+ onClick: P(Me, ["stop"])
505
458
  }, [
506
- r(l(p), {
459
+ r(n(f), {
507
460
  size: "small",
508
461
  color: "var(--nmorph-contrast-text-color)"
509
462
  }, {
510
- default: d(() => [
511
- r(l(_e))
463
+ default: c(() => [
464
+ r(n(he))
512
465
  ]),
513
466
  _: 1
514
467
  })
515
- ], 8, ba)) : v("", !0),
516
- K.value ? (i(), u("a", {
468
+ ], 8, _o)) : v("", !0),
469
+ L.value ? (i(), u("a", {
517
470
  key: 1,
518
- href: K.value,
519
- download: A.value || void 0,
471
+ href: L.value,
472
+ download: D.value || void 0,
520
473
  class: "nmorph-media-gallery__file-action",
521
- "aria-label": `Download ${A.value || "media"}`,
522
- onClick: $(Ke, ["stop"])
474
+ "aria-label": `Download ${D.value || "media"}`,
475
+ onClick: P(Le, ["stop"])
523
476
  }, [
524
- r(l(p), {
477
+ r(n(f), {
525
478
  size: "small",
526
479
  color: "var(--nmorph-contrast-text-color)"
527
480
  }, {
528
- default: d(() => [
529
- r(l(ke))
481
+ default: c(() => [
482
+ r(n(_e))
530
483
  ]),
531
484
  _: 1
532
485
  })
533
- ], 8, Ia)) : v("", !0)
486
+ ], 8, yo)) : v("", !0)
534
487
  ])) : v("", !0),
535
- ae.value ? (i(), u("span", Na, D(ae.value), 1)) : v("", !0)
488
+ W.value ? (i(), u("span", wo, M(W.value), 1)) : v("", !0)
536
489
  ])
537
490
  ]),
538
491
  _: 1
@@ -541,5 +494,5 @@ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
541
494
  }
542
495
  });
543
496
  export {
544
- Qa as default
497
+ Uo as default
545
498
  };