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