@nmorph/nmorph-ui-kit 2.2.54 → 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 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";
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 he from "../nmorph-image/NmorphImage.vue.js";
7
+ import pe from "../nmorph-image/NmorphImage.vue.js";
8
8
  /* empty css */
9
9
  import f from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
10
  /* empty css */
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
+ 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 _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 = {
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
- }, sa = {
26
+ }, io = {
28
27
  key: 3,
29
28
  class: "nmorph-media-gallery__trigger-name"
30
- }, ua = {
29
+ }, so = {
31
30
  key: 4,
32
31
  class: "nmorph-media-gallery__trigger-size"
33
- }, ca = {
32
+ }, uo = {
34
33
  key: 0,
35
34
  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,
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
- }, _a = {
40
- key: 4,
38
+ }, ho = {
39
+ key: 3,
41
40
  class: "nmorph-media-gallery__file-actions"
42
- }, ya = ["aria-label"], ka = ["href", "download", "aria-label"], wa = {
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
- }, 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({
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 na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
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,305 +68,291 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
66
68
  videoFit: { default: "contain" }
67
69
  },
68
70
  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)
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;
74
+ return t < 0 || !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e;
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"
83
81
  ), Fe = s(
84
- () => pe({
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)
85
+ ), Be = s(
86
+ () => ge({
85
87
  "nmorph-media-gallery": [
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"
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"
92
94
  ]
93
95
  })
94
- ), Ce = s(() => `rotate(${g.value}deg) scale(${w.value})`), $e = s(
95
- () => Ze({
96
- "--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
97
99
  })
98
- ), Pe = s(
99
- () => pe({
100
- "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"]
101
103
  })
102
- ), J = (e) => {
104
+ ), Z = (e) => {
103
105
  if (e === void 0 || Number.isNaN(e) || e < 0) return "";
104
106
  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;
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;
109
111
  };
110
- S(
111
- () => n.modelValue,
112
+ z(
113
+ () => l.modelValue,
112
114
  (e) => {
113
- y.value = e;
115
+ _.value = e;
114
116
  }
115
- ), S(
116
- () => n.activeIndex,
117
+ ), z(
118
+ () => l.activeIndex,
117
119
  (e) => {
118
- typeof e == "number" && (F.value = $(e));
120
+ typeof e == "number" && (F.value = x(e));
119
121
  },
120
122
  { immediate: !0 }
121
- ), S(
122
- () => [n.initialIndex, p.value.length],
123
+ ), z(
124
+ () => [l.initialIndex, m.value.length],
123
125
  () => {
124
- typeof n.activeIndex != "number" && (F.value = $(n.initialIndex));
126
+ typeof l.activeIndex != "number" && (F.value = x(l.initialIndex));
125
127
  },
126
128
  { immediate: !0 }
127
- ), S(
128
- () => [t.value?.kind, t.value?.src, b.value],
129
+ ), z(
130
+ () => [a.value?.kind, a.value?.src, w.value],
129
131
  () => {
130
- m.value = !1, I.value = !1, z.value = null;
132
+ p.value = !1, C.value = null;
131
133
  }
132
134
  );
133
- const T = () => {
134
- !k.value || k.value === z.value || (k.value.pause(), m.value = !1, z.value = k.value);
135
- }, ae = () => {
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);
135
+ const S = () => {
136
+ !N.value || N.value === C.value || (N.value.pause(), p.value = !1, C.value = N.value);
156
137
  }, te = () => {
157
- y.value && (T(), y.value = !1, h("update:model-value", !1), h("close"));
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);
158
164
  }, He = () => {
159
- g.value = g.value + 90, g.value >= 360 && (g.value = 0);
165
+ y.value = parseFloat(Math.min(y.value + 0.2, 4).toFixed(3));
160
166
  }, 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));
167
+ y.value = parseFloat(Math.max(y.value - 0.2, 0.2).toFixed(3));
164
168
  }, 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();
172
- return;
173
- }
174
- try {
175
- await k.value.play();
176
- } catch {
177
- m.value = !1;
178
- }
179
- }
180
- }, ne = async (e) => {
169
+ y.value = 1;
170
+ }, re = async (e) => {
181
171
  if (e)
182
172
  try {
183
- const l = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
184
- if (l) {
185
- await l;
173
+ const t = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
174
+ if (t) {
175
+ await t;
186
176
  return;
187
177
  }
188
178
  e.webkitEnterFullscreen?.();
189
179
  } catch {
190
180
  }
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);
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;
197
191
  }, Re = () => {
198
- t.value && re(t.value, b.value);
199
- }, De = () => {
200
- m.value = !0, z.value = null;
201
- }, ie = () => {
202
- I.value = !0;
192
+ p.value = !1;
203
193
  }, Ke = () => {
204
- m.value = !1;
194
+ p.value = !1;
205
195
  }, qe = () => {
206
- m.value = !1;
207
- }, Oe = () => {
208
- m.value = !1, I.value = !1;
196
+ p.value = !1;
209
197
  }, se = (e) => {
210
- if (y.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
198
+ if (_.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
211
199
  if (e.key === "Escape") {
212
- e.preventDefault(), te();
200
+ e.preventDefault(), ne();
213
201
  return;
214
202
  }
215
- Y.value && (e.key === "ArrowLeft" && (e.preventDefault(), q()), e.key === "ArrowRight" && (e.preventDefault(), O()));
203
+ q.value && (e.key === "ArrowLeft" && (e.preventDefault(), E()), e.key === "ArrowRight" && (e.preventDefault(), R()));
216
204
  }
217
- }, Xe = () => {
205
+ }, Oe = () => {
218
206
  typeof document > "u" || document.addEventListener("keydown", se);
219
207
  }, ue = () => {
220
208
  typeof document > "u" || document.removeEventListener("keydown", se);
221
209
  };
222
- S(
223
- y,
210
+ z(
211
+ _,
224
212
  (e) => {
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());
213
+ e ? (Oe(), C.value = null, F.value = x(
214
+ typeof l.activeIndex == "number" ? l.activeIndex : l.initialIndex
215
+ )) : (S(), p.value = !1, ue());
228
216
  },
229
217
  { immediate: !0 }
230
- ), Ge(ue);
218
+ ), Ye(ue);
231
219
  const ce = (e) => {
232
- C.value = { x: e.clientX, y: e.clientY };
220
+ B.value = { x: e.clientX, y: e.clientY };
233
221
  }, de = (e) => {
234
- if (!C.value || !G.value) {
235
- C.value = null;
222
+ if (!B.value || !O.value) {
223
+ B.value = null;
236
224
  return;
237
225
  }
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());
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());
240
228
  };
241
- return (e, l) => (i(), u(ve, null, [
242
- n.showTrigger ? (i(), u("div", {
229
+ return (e, t) => (i(), u(ve, null, [
230
+ l.showTrigger ? (i(), u("div", {
243
231
  key: 0,
244
- class: fe(Pe.value),
245
- style: me($e.value)
232
+ class: fe(Te.value),
233
+ style: me(Ce.value)
246
234
  }, [
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}`])
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}`])
250
238
  }, [
251
- x("button", {
239
+ b("button", {
252
240
  type: "button",
253
241
  class: "nmorph-media-gallery__trigger-open",
254
- "aria-label": `Open ${L(a, v)}`,
255
- onClick: (N) => oe(v)
242
+ "aria-label": `Open ${$(o, d)}`,
243
+ onClick: (I) => le(d)
256
244
  }, [
257
- a.kind === "image" ? (i(), B(o(he), {
245
+ o.kind === "image" ? (i(), A(n(pe), {
258
246
  key: 0,
259
- src: a.src,
260
- alt: a.alt || L(a, v),
261
- title: V(a),
247
+ src: o.src,
248
+ alt: o.alt || $(o, d),
249
+ title: T(o),
262
250
  fit: "cover",
263
251
  "frame-border": 0
264
252
  }, null, 8, ["src", "alt", "title"])) : (i(), u("video", {
265
253
  key: 1,
266
254
  ref_for: !0,
267
- ref: (N) => ze(v, N),
255
+ ref: (I) => ze(d, I),
268
256
  class: "nmorph-media-gallery__trigger-video",
269
- src: a.src,
270
- poster: a.poster || void 0,
257
+ src: o.src,
258
+ poster: o.poster || void 0,
271
259
  muted: "",
272
260
  playsinline: "",
273
261
  preload: "metadata",
274
- title: V(a)
275
- }, null, 8, ra)),
276
- n.showTriggerPlayButton && a.kind === "video" ? (i(), u("span", ia, [
277
- r(o(f), {
262
+ title: T(o)
263
+ }, null, 8, no)),
264
+ l.showTriggerPlayButton && o.kind === "video" ? (i(), u("span", ro, [
265
+ r(n(f), {
278
266
  size: "medium",
279
267
  color: "var(--nmorph-contrast-text-color)"
280
268
  }, {
281
269
  default: c(() => [
282
- r(o(_e))
270
+ r(n(je))
283
271
  ]),
284
272
  _: 1
285
273
  })
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", {
274
+ ])) : v("", !0),
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", {
292
280
  key: 0,
293
281
  type: "button",
294
282
  class: "nmorph-media-gallery__trigger-action",
295
- "aria-label": `Preview ${L(a, v)}`,
296
- onClick: P((N) => oe(v), ["stop"])
283
+ "aria-label": `Preview ${$(o, d)}`,
284
+ onClick: P((I) => le(d), ["stop"])
297
285
  }, [
298
- r(o(f), {
286
+ r(n(f), {
299
287
  size: "small",
300
288
  color: "var(--nmorph-contrast-text-color)"
301
289
  }, {
302
290
  default: c(() => [
303
- r(o(je))
291
+ r(n(We))
304
292
  ]),
305
293
  _: 1
306
294
  })
307
- ], 8, da)) : d("", !0),
308
- a.kind === "video" ? (i(), u("button", {
295
+ ], 8, co)) : v("", !0),
296
+ ee(o) ? (i(), u("button", {
309
297
  key: 1,
310
298
  type: "button",
311
299
  class: "nmorph-media-gallery__trigger-action",
312
- "aria-label": `Fullscreen ${L(a, v)}`,
313
- onClick: P((N) => Ee(a, v), ["stop"])
300
+ "aria-label": `Fullscreen ${$(o, d)}`,
301
+ onClick: P((I) => De(o, d), ["stop"])
314
302
  }, [
315
- r(o(f), {
303
+ r(n(f), {
316
304
  size: "small",
317
305
  color: "var(--nmorph-contrast-text-color)"
318
306
  }, {
319
307
  default: c(() => [
320
- r(o(ge))
308
+ r(n(he))
321
309
  ]),
322
310
  _: 1
323
311
  })
324
- ], 8, va)) : d("", !0),
325
- K(a) ? (i(), u("a", {
312
+ ], 8, vo)) : v("", !0),
313
+ oe(o) ? (i(), u("a", {
326
314
  key: 2,
327
- href: K(a),
328
- download: V(a) || void 0,
315
+ href: J(o),
316
+ download: T(o) || void 0,
329
317
  class: "nmorph-media-gallery__trigger-action",
330
- "aria-label": `Download ${L(a, v)}`,
331
- onClick: P((N) => re(a, v), ["stop"])
318
+ "aria-label": `Download ${$(o, d)}`,
319
+ onClick: P((I) => ie(o, d), ["stop"])
332
320
  }, [
333
- r(o(f), {
321
+ r(n(f), {
334
322
  size: "small",
335
323
  color: "var(--nmorph-contrast-text-color)"
336
324
  }, {
337
325
  default: c(() => [
338
- r(o(ye))
326
+ r(n(_e))
339
327
  ]),
340
328
  _: 1
341
329
  })
342
- ], 8, ma)) : d("", !0)
343
- ])) : d("", !0)
330
+ ], 8, mo)) : v("", !0)
331
+ ])) : v("", !0)
344
332
  ], 2))), 128))
345
- ], 6)) : d("", !0),
346
- y.value ? (i(), B(We, {
333
+ ], 6)) : v("", !0),
334
+ _.value ? (i(), A(Ze, {
347
335
  key: 1,
348
- show: y.value,
349
- "z-index": n.zIndex,
350
- "state-class": Fe.value,
336
+ show: _.value,
337
+ "z-index": l.zIndex,
338
+ "state-class": Be.value,
351
339
  "content-class": "nmorph-media-gallery__content",
352
340
  "left-class": "nmorph-media-gallery__left",
353
341
  "right-class": "nmorph-media-gallery__right",
354
342
  "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
343
+ "show-navigation": O.value,
344
+ "show-action-bar": l.showActionBar && a.value?.kind === "image",
345
+ onClose: ne,
346
+ onPrevious: E,
347
+ onNext: R
360
348
  }, {
361
349
  actions: c(() => [
362
- x("div", ba, [
363
- r(o(M), { onClick: He }, {
350
+ b("div", ko, [
351
+ r(n(H), { onClick: Ae }, {
364
352
  default: c(() => [
365
- r(o(f), null, {
353
+ r(n(f), null, {
366
354
  default: c(() => [
367
- r(o(Qe))
355
+ r(n(Je))
368
356
  ]),
369
357
  _: 1
370
358
  })
@@ -372,12 +360,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
372
360
  _: 1
373
361
  })
374
362
  ]),
375
- x("div", Ia, [
376
- r(o(M), { onClick: Ve }, {
363
+ b("div", Io, [
364
+ r(n(H), { onClick: Pe }, {
377
365
  default: c(() => [
378
- r(o(f), null, {
366
+ r(n(f), null, {
379
367
  default: c(() => [
380
- r(o(ea))
368
+ r(n(Qe))
381
369
  ]),
382
370
  _: 1
383
371
  })
@@ -385,12 +373,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
385
373
  _: 1
386
374
  })
387
375
  ]),
388
- x("div", Na, [
389
- r(o(M), { onClick: Le }, {
376
+ b("div", bo, [
377
+ r(n(H), { onClick: He }, {
390
378
  default: c(() => [
391
- r(o(f), null, {
379
+ r(n(f), null, {
392
380
  default: c(() => [
393
- r(o(aa))
381
+ r(n(eo))
394
382
  ]),
395
383
  _: 1
396
384
  })
@@ -398,12 +386,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
398
386
  _: 1
399
387
  })
400
388
  ]),
401
- x("div", xa, [
402
- r(o(M), { onClick: Se }, {
389
+ b("div", Fo, [
390
+ r(n(H), { onClick: Ve }, {
403
391
  default: c(() => [
404
- r(o(f), null, {
392
+ r(n(f), null, {
405
393
  default: c(() => [
406
- r(o(la))
394
+ r(n(oo))
407
395
  ]),
408
396
  _: 1
409
397
  })
@@ -411,15 +399,15 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
411
399
  _: 1
412
400
  })
413
401
  ]),
414
- x("div", Ba, [
415
- r(o(M), {
416
- disabled: w.value === 1,
417
- onClick: Me
402
+ b("div", No, [
403
+ r(n(H), {
404
+ disabled: y.value === 1,
405
+ onClick: Se
418
406
  }, {
419
407
  default: c(() => [
420
- r(o(f), null, {
408
+ r(n(f), null, {
421
409
  default: c(() => [
422
- w.value < 1 ? (i(), B(o(oa), { key: 0 })) : (i(), B(o(ta), { key: 1 }))
410
+ y.value < 1 ? (i(), A(n(to), { key: 0 })) : (i(), A(n(ao), { key: 1 }))
423
411
  ]),
424
412
  _: 1
425
413
  })
@@ -429,101 +417,82 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
429
417
  ])
430
418
  ]),
431
419
  default: c(() => [
432
- x("div", fa, [
433
- t.value?.kind === "image" ? (i(), B(o(he), {
420
+ b("div", fo, [
421
+ a.value?.kind === "image" ? (i(), A(n(pe), {
434
422
  key: 0,
435
- src: t.value.src,
436
- alt: t.value.alt || t.value.name || "",
437
- title: t.value.name,
438
- 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,
439
427
  "frame-border": 0,
440
- style: me({ transform: Ce.value }),
428
+ style: me({ transform: xe.value }),
441
429
  onPointerdown: ce,
442
430
  onPointerup: de
443
- }, null, 8, ["src", "alt", "title", "fit", "style"])) : t.value?.kind === "video" ? (i(), u("video", {
431
+ }, null, 8, ["src", "alt", "title", "fit", "style"])) : a.value?.kind === "video" ? (i(), u("video", {
444
432
  key: 1,
445
433
  ref_key: "currentVideoRef",
446
- ref: k,
434
+ ref: N,
447
435
  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,
436
+ src: a.value.src,
437
+ poster: a.value.poster || void 0,
438
+ controls: Y.value,
439
+ muted: ke.value,
452
440
  playsinline: Ie.value,
453
- preload: Ne.value,
454
- title: t.value.name,
441
+ preload: be.value,
442
+ title: a.value.name,
455
443
  onPointerdown: ce,
456
444
  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 }))
477
- ]),
478
- _: 1
479
- })
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", {
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", {
484
453
  key: 0,
485
454
  type: "button",
486
455
  class: "nmorph-media-gallery__file-action",
487
- "aria-label": `Fullscreen ${E.value}`,
488
- onClick: P(Ae, ["stop"])
456
+ "aria-label": `Fullscreen ${Fe.value}`,
457
+ onClick: P(Me, ["stop"])
489
458
  }, [
490
- r(o(f), {
459
+ r(n(f), {
491
460
  size: "small",
492
461
  color: "var(--nmorph-contrast-text-color)"
493
462
  }, {
494
463
  default: c(() => [
495
- r(o(ge))
464
+ r(n(he))
496
465
  ]),
497
466
  _: 1
498
467
  })
499
- ], 8, ya)) : d("", !0),
500
- D.value ? (i(), u("a", {
468
+ ], 8, _o)) : v("", !0),
469
+ L.value ? (i(), u("a", {
501
470
  key: 1,
502
- href: D.value,
503
- download: R.value || void 0,
471
+ href: L.value,
472
+ download: D.value || void 0,
504
473
  class: "nmorph-media-gallery__file-action",
505
- "aria-label": `Download ${R.value || "media"}`,
506
- onClick: P(Re, ["stop"])
474
+ "aria-label": `Download ${D.value || "media"}`,
475
+ onClick: P(Le, ["stop"])
507
476
  }, [
508
- r(o(f), {
477
+ r(n(f), {
509
478
  size: "small",
510
479
  color: "var(--nmorph-contrast-text-color)"
511
480
  }, {
512
481
  default: c(() => [
513
- r(o(ye))
482
+ r(n(_e))
514
483
  ]),
515
484
  _: 1
516
485
  })
517
- ], 8, ka)) : d("", !0)
518
- ])) : d("", !0),
519
- Q.value ? (i(), u("span", wa, A(Q.value), 1)) : d("", !0)
486
+ ], 8, yo)) : v("", !0)
487
+ ])) : v("", !0),
488
+ W.value ? (i(), u("span", wo, M(W.value), 1)) : v("", !0)
520
489
  ])
521
490
  ]),
522
491
  _: 1
523
- }, 8, ["show", "z-index", "state-class", "show-navigation", "show-action-bar"])) : d("", !0)
492
+ }, 8, ["show", "z-index", "state-class", "show-navigation", "show-action-bar"])) : v("", !0)
524
493
  ], 64));
525
494
  }
526
495
  });
527
496
  export {
528
- Wa as default
497
+ Uo as default
529
498
  };