@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.
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.css +1 -1
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.js +131 -109
- package/dist/components/data/nmorph-file-card/NmorphFileCard.css +1 -1
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue.js +236 -169
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.css +1 -1
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +459 -228
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +111 -99
- package/dist/index.umd.js +30 -30
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.d.ts +1 -0
- package/dist/src/components/data/nmorph-audio-preview/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-file-card/NmorphFileCard.vue.d.ts +15 -3
- package/dist/src/components/data/nmorph-file-card/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.d.ts +14 -0
- package/dist/src/components/data/nmorph-media-gallery/types.d.ts +20 -6
- package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +3 -2
- package/dist/src/components/data/nmorph-video-preview/types.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import './NmorphMediaGallery.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
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
|
|
9
|
+
import f from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import
|
|
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/
|
|
13
|
-
import ye from "../../../assets/icons/
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
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(
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
() =>
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
42
|
-
),
|
|
43
|
-
() =>
|
|
44
|
-
),
|
|
45
|
-
() =>
|
|
46
|
-
), j =
|
|
47
|
-
() =>
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
),
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
113
|
+
y.value = e;
|
|
62
114
|
}
|
|
63
|
-
),
|
|
64
|
-
() =>
|
|
115
|
+
), S(
|
|
116
|
+
() => n.activeIndex,
|
|
65
117
|
(e) => {
|
|
66
|
-
typeof e == "number" && (
|
|
118
|
+
typeof e == "number" && (F.value = $(e));
|
|
67
119
|
},
|
|
68
120
|
{ immediate: !0 }
|
|
69
|
-
),
|
|
70
|
-
() => [
|
|
121
|
+
), S(
|
|
122
|
+
() => [n.initialIndex, p.value.length],
|
|
71
123
|
() => {
|
|
72
|
-
typeof
|
|
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
|
|
77
|
-
!
|
|
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
|
-
|
|
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
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
|
175
|
+
await k.value.play();
|
|
113
176
|
} catch {
|
|
114
|
-
|
|
177
|
+
m.value = !1;
|
|
115
178
|
}
|
|
116
179
|
}
|
|
117
|
-
}, ne = () => {
|
|
118
|
-
|
|
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
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
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(),
|
|
212
|
+
e.preventDefault(), te();
|
|
129
213
|
return;
|
|
130
214
|
}
|
|
131
|
-
|
|
215
|
+
Y.value && (e.key === "ArrowLeft" && (e.preventDefault(), q()), e.key === "ArrowRight" && (e.preventDefault(), O()));
|
|
132
216
|
}
|
|
133
|
-
},
|
|
134
|
-
typeof document > "u" || document.addEventListener("keydown",
|
|
135
|
-
},
|
|
136
|
-
typeof document > "u" || document.removeEventListener("keydown",
|
|
217
|
+
}, Xe = () => {
|
|
218
|
+
typeof document > "u" || document.addEventListener("keydown", se);
|
|
219
|
+
}, ue = () => {
|
|
220
|
+
typeof document > "u" || document.removeEventListener("keydown", se);
|
|
137
221
|
};
|
|
138
|
-
|
|
139
|
-
|
|
222
|
+
S(
|
|
223
|
+
y,
|
|
140
224
|
(e) => {
|
|
141
|
-
e ? (
|
|
142
|
-
typeof
|
|
143
|
-
)) : (
|
|
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
|
-
),
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
if (!
|
|
151
|
-
|
|
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
|
|
155
|
-
|
|
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,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
-
|
|
528
|
+
Wa as default
|
|
298
529
|
};
|