@nmorph/nmorph-ui-kit 2.2.52 → 2.2.54

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