@nmorph/nmorph-ui-kit 2.2.51 → 2.2.52
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 +118 -86
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +183 -225
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.css +1 -0
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +298 -0
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue3.js +6 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.css +1 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.js +110 -0
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue3.js +6 -0
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +6 -5
- package/dist/index.es.js +866 -863
- package/dist/index.umd.js +21 -21
- package/dist/outside-hooks/use-nmorph-theme.js +16 -16
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/index.d.ts +2 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-file-card/types.d.ts +1 -1
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.d.ts +26 -0
- package/dist/src/components/data/nmorph-media-gallery/types.d.ts +34 -0
- package/dist/src/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.d.ts +43 -0
- package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +2 -1
- package/dist/src/components/data/nmorph-video-preview/types.d.ts +2 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +24 -23
|
@@ -0,0 +1,298 @@
|
|
|
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";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import he from "../nmorph-image/NmorphImage.vue.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import k from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import w from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
11
|
+
/* 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({
|
|
21
|
+
__name: "NmorphMediaGallery",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { type: Boolean, default: !1 },
|
|
24
|
+
items: {},
|
|
25
|
+
initialIndex: { default: 0 },
|
|
26
|
+
activeIndex: { default: void 0 },
|
|
27
|
+
zIndex: { default: void 0 },
|
|
28
|
+
showNavigationButtons: { type: Boolean, default: !0 },
|
|
29
|
+
showActionBar: { type: Boolean, default: !0 },
|
|
30
|
+
imageFit: { default: "contain" },
|
|
31
|
+
videoFit: { default: "contain" }
|
|
32
|
+
},
|
|
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({
|
|
48
|
+
"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"
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
), q = i(() => `rotate(${s.value}deg) scale(${d.value})`);
|
|
58
|
+
C(
|
|
59
|
+
() => o.modelValue,
|
|
60
|
+
(e) => {
|
|
61
|
+
c.value = e;
|
|
62
|
+
}
|
|
63
|
+
), C(
|
|
64
|
+
() => o.activeIndex,
|
|
65
|
+
(e) => {
|
|
66
|
+
typeof e == "number" && (I.value = x(e));
|
|
67
|
+
},
|
|
68
|
+
{ immediate: !0 }
|
|
69
|
+
), C(
|
|
70
|
+
() => [o.initialIndex, m.value.length],
|
|
71
|
+
() => {
|
|
72
|
+
typeof o.activeIndex != "number" && (I.value = x(o.initialIndex));
|
|
73
|
+
},
|
|
74
|
+
{ immediate: !0 }
|
|
75
|
+
);
|
|
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);
|
|
99
|
+
}, ae = () => {
|
|
100
|
+
d.value = parseFloat(Math.min(d.value + 0.2, 4).toFixed(3));
|
|
101
|
+
}, 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();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
await v.value.play();
|
|
113
|
+
} catch {
|
|
114
|
+
u.value = !1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, ne = () => {
|
|
118
|
+
u.value = !0, b.value = null;
|
|
119
|
+
}, 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)) {
|
|
127
|
+
if (e.key === "Escape") {
|
|
128
|
+
e.preventDefault(), K();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
F.value && (e.key === "ArrowLeft" && (e.preventDefault(), H()), e.key === "ArrowRight" && (e.preventDefault(), B()));
|
|
132
|
+
}
|
|
133
|
+
}, se = () => {
|
|
134
|
+
typeof document > "u" || document.addEventListener("keydown", S);
|
|
135
|
+
}, D = () => {
|
|
136
|
+
typeof document > "u" || document.removeEventListener("keydown", S);
|
|
137
|
+
};
|
|
138
|
+
C(
|
|
139
|
+
c,
|
|
140
|
+
(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());
|
|
144
|
+
},
|
|
145
|
+
{ 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;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
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());
|
|
156
|
+
};
|
|
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))
|
|
179
|
+
]),
|
|
180
|
+
_: 1
|
|
181
|
+
})
|
|
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))
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
})
|
|
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))
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
})
|
|
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))
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
})
|
|
221
|
+
]),
|
|
222
|
+
_: 1
|
|
223
|
+
})
|
|
224
|
+
]),
|
|
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 }))
|
|
234
|
+
]),
|
|
235
|
+
_: 1
|
|
236
|
+
})
|
|
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);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
export {
|
|
297
|
+
Je as default
|
|
298
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.nmorph-preview-portal{display:contents}.nmorph-preview-portal .nmorph-preview-portal__content{--nmorph-preview-portal-content-width: min( calc(100vw - 96px) , 960px);--nmorph-preview-portal-content-height: min( calc(100vh - 180px) , 720px);position:absolute;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:var(--nmorph-preview-portal-content-width);height:var(--nmorph-preview-portal-content-height);transform:translate(-50%,-50%);transition:var(--transition-04) opacity ease-in-out;pointer-events:none}.nmorph-preview-portal .nmorph-preview-portal__actions{position:absolute;bottom:-50px;left:50%;z-index:2;display:flex;height:0;transform:translate(-50%);transition:ease-in-out bottom var(--transition-03)}.nmorph-preview-portal .nmorph-button__content{box-shadow:none}.nmorph-preview-portal .nmorph-preview-portal__left,.nmorph-preview-portal .nmorph-preview-portal__right{z-index:2}.nmorph-preview-portal .nmorph-preview-portal__left{position:absolute;top:50%;left:-100%;transform:rotate(90deg) translate(-50%);transition:ease-in-out left var(--transition-03)}.nmorph-preview-portal .nmorph-preview-portal__right{position:absolute;top:50%;right:-100%;transform:rotate(270deg) translate(50%);transition:ease-in-out right var(--transition-03)}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__actions{bottom:50px}.nmorph-preview-portal.nmorph-preview-portal--opened{--nmorph-preview-portal-btn-margin: 20px}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__left{left:var(--nmorph-preview-portal-btn-margin)}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__right{right:var(--nmorph-preview-portal-btn-margin)}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import './NmorphPreviewPortal.css';
|
|
2
|
+
import { defineComponent as k, computed as u, openBlock as r, createBlock as B, Teleport as $, createElementVNode as f, normalizeStyle as N, normalizeClass as a, createVNode as o, unref as s, withCtx as l, renderSlot as v, createElementBlock as m, createCommentVNode as i } from "vue";
|
|
3
|
+
import { createCssSizeVariables as x } from "../../../utils/common.js";
|
|
4
|
+
import z from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import c from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import w from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import C from "../../../assets/icons/chevron-down.svg.js";
|
|
11
|
+
const D = /* @__PURE__ */ k({
|
|
12
|
+
__name: "NmorphPreviewPortal",
|
|
13
|
+
props: {
|
|
14
|
+
show: { type: Boolean },
|
|
15
|
+
zIndex: { default: void 0 },
|
|
16
|
+
rootClass: { default: "" },
|
|
17
|
+
stateClass: { default: "" },
|
|
18
|
+
contentClass: { default: "" },
|
|
19
|
+
leftClass: { default: "" },
|
|
20
|
+
rightClass: { default: "" },
|
|
21
|
+
actionsClass: { default: "" },
|
|
22
|
+
navigationButtonMargin: { default: void 0 },
|
|
23
|
+
showNavigation: { type: Boolean, default: !1 },
|
|
24
|
+
showActionBar: { type: Boolean, default: !1 }
|
|
25
|
+
},
|
|
26
|
+
emits: ["close", "previous", "next"],
|
|
27
|
+
setup(h, { emit: _ }) {
|
|
28
|
+
const e = h, n = _, y = u(() => [
|
|
29
|
+
"nmorph-preview-portal",
|
|
30
|
+
e.rootClass,
|
|
31
|
+
e.stateClass,
|
|
32
|
+
e.show && "nmorph-preview-portal--opened"
|
|
33
|
+
]), g = u(
|
|
34
|
+
() => x({
|
|
35
|
+
"--nmorph-preview-portal-btn-margin": e.navigationButtonMargin
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
return (d, t) => e.show ? (r(), B($, {
|
|
39
|
+
key: 0,
|
|
40
|
+
to: "body"
|
|
41
|
+
}, [
|
|
42
|
+
f("div", {
|
|
43
|
+
class: a(y.value),
|
|
44
|
+
style: N(g.value)
|
|
45
|
+
}, [
|
|
46
|
+
o(s(z), {
|
|
47
|
+
show: e.show,
|
|
48
|
+
"z-index": e.zIndex,
|
|
49
|
+
"disabled-teleport": "",
|
|
50
|
+
onOnOutsideClick: t[2] || (t[2] = (p) => n("close")),
|
|
51
|
+
onOnEscapeKeydown: t[3] || (t[3] = (p) => n("close"))
|
|
52
|
+
}, {
|
|
53
|
+
default: l(() => [
|
|
54
|
+
f("div", {
|
|
55
|
+
class: a(["nmorph-preview-portal__content", e.contentClass])
|
|
56
|
+
}, [
|
|
57
|
+
v(d.$slots, "default")
|
|
58
|
+
], 2),
|
|
59
|
+
e.showNavigation ? (r(), m("div", {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: a(["nmorph-preview-portal__left", e.leftClass])
|
|
62
|
+
}, [
|
|
63
|
+
o(s(c), {
|
|
64
|
+
onClick: t[0] || (t[0] = (p) => n("previous"))
|
|
65
|
+
}, {
|
|
66
|
+
default: l(() => [
|
|
67
|
+
o(s(w), null, {
|
|
68
|
+
default: l(() => [
|
|
69
|
+
o(s(C))
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
})
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
})
|
|
76
|
+
], 2)) : i("", !0),
|
|
77
|
+
e.showNavigation ? (r(), m("div", {
|
|
78
|
+
key: 1,
|
|
79
|
+
class: a(["nmorph-preview-portal__right", e.rightClass])
|
|
80
|
+
}, [
|
|
81
|
+
o(s(c), {
|
|
82
|
+
onClick: t[1] || (t[1] = (p) => n("next"))
|
|
83
|
+
}, {
|
|
84
|
+
default: l(() => [
|
|
85
|
+
o(s(w), null, {
|
|
86
|
+
default: l(() => [
|
|
87
|
+
o(s(C))
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
})
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
94
|
+
], 2)) : i("", !0),
|
|
95
|
+
e.showActionBar ? (r(), m("div", {
|
|
96
|
+
key: 2,
|
|
97
|
+
class: a(["nmorph-preview-portal__actions", e.actionsClass])
|
|
98
|
+
}, [
|
|
99
|
+
v(d.$slots, "actions")
|
|
100
|
+
], 2)) : i("", !0)
|
|
101
|
+
]),
|
|
102
|
+
_: 3
|
|
103
|
+
}, 8, ["show", "z-index"])
|
|
104
|
+
], 6)
|
|
105
|
+
])) : i("", !0);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
D as default
|
|
110
|
+
};
|
|
@@ -57,7 +57,8 @@ const pe = ["src", "poster", "controls", "muted", "playsinline", "preload"], me
|
|
|
57
57
|
errorText: { default: "" },
|
|
58
58
|
showDefaultActions: { type: Boolean, default: !0 },
|
|
59
59
|
showPreviewAction: { type: Boolean, default: !0 },
|
|
60
|
-
showFullscreenAction: { type: Boolean, default: !0 }
|
|
60
|
+
showFullscreenAction: { type: Boolean, default: !0 },
|
|
61
|
+
previewMode: { default: "internal" }
|
|
61
62
|
},
|
|
62
63
|
emits: ["play", "pause", "open", "preview", "fullscreen", "download", "error"],
|
|
63
64
|
setup(P, { expose: C, emit: N }) {
|
|
@@ -84,8 +85,8 @@ const pe = ["src", "poster", "controls", "muted", "playsinline", "preload"], me
|
|
|
84
85
|
"--nmorph-video-preview-width": e.width,
|
|
85
86
|
"--nmorph-video-preview-height": e.height
|
|
86
87
|
})
|
|
87
|
-
), I = s(() => Object.fromEntries(Object.entries(h).filter(([o]) => o !== "class" && o !== "style"))), z = s(() => [E.value, h.class]), D = s(() => [F.value, h.style]),
|
|
88
|
-
f.value = !0, c("preview");
|
|
88
|
+
), I = s(() => Object.fromEntries(Object.entries(h).filter(([o]) => o !== "class" && o !== "style"))), z = s(() => [E.value, h.class]), D = s(() => [F.value, h.style]), M = () => c("open"), x = () => c("download"), R = () => {
|
|
89
|
+
e.previewMode === "internal" && (f.value = !0), c("preview");
|
|
89
90
|
}, B = () => {
|
|
90
91
|
f.value = !1;
|
|
91
92
|
}, T = async () => {
|
|
@@ -227,7 +228,7 @@ const pe = ["src", "poster", "controls", "muted", "playsinline", "preload"], me
|
|
|
227
228
|
rel: "noopener noreferrer",
|
|
228
229
|
class: "nmorph-video-preview__action-link",
|
|
229
230
|
"aria-label": `Open ${e.name || "video"}`,
|
|
230
|
-
onClick:
|
|
231
|
+
onClick: M
|
|
231
232
|
}, [
|
|
232
233
|
l(r(u), { size: "small" }, {
|
|
233
234
|
default: d(() => [
|
|
@@ -242,7 +243,7 @@ const pe = ["src", "poster", "controls", "muted", "playsinline", "preload"], me
|
|
|
242
243
|
download: e.name,
|
|
243
244
|
class: "nmorph-video-preview__action-link",
|
|
244
245
|
"aria-label": `Download ${e.name || "video"}`,
|
|
245
|
-
onClick:
|
|
246
|
+
onClick: x
|
|
246
247
|
}, [
|
|
247
248
|
l(r(u), { size: "small" }, {
|
|
248
249
|
default: d(() => [
|