@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,42 +1,48 @@
|
|
|
1
1
|
import './NmorphFileCard.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
2
|
+
import { defineComponent as X, useSlots as Y, ref as Z, computed as o, openBlock as a, createElementBlock as t, Fragment as V, createElementVNode as I, normalizeStyle as ee, normalizeClass as oe, createVNode as n, unref as i, withCtx as v, createBlock as b, resolveDynamicComponent as ae, createCommentVNode as l, toDisplayString as h, renderSlot as re } from "vue";
|
|
3
|
+
import { NmorphImageResolution as te, NmorphAudioResolution as le, NmorphVideoResolution as ne, NmorphArchiveResolution as ie, NmorphDocResolution as se } from "../../form/nmorph-file-upload/types.js";
|
|
4
|
+
import { useModifiers as ce } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { createCssSizeVariables as me } from "../../../utils/common.js";
|
|
6
|
+
import { getFileExtension as ue, getPlainFileType as de, getTypeCandidates as pe, isKnownFileType as w } from "../../../utils/file-types.js";
|
|
7
|
+
import fe from "../nmorph-audio-preview/NmorphAudioPreview.vue.js";
|
|
7
8
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
+
import ve from "../nmorph-media-gallery/NmorphMediaGallery.vue.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import he from "../nmorph-video-preview/NmorphVideoPreview.vue.js";
|
|
12
|
+
/* empty css */
|
|
13
|
+
import we from "../../../assets/icons/image.svg.js";
|
|
14
|
+
import _e from "../../../assets/icons/archive.svg.js";
|
|
15
|
+
import E from "../../../assets/icons/doc.svg.js";
|
|
16
|
+
import _ from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
14
17
|
/* empty css */
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
18
|
+
import ye from "../../../assets/icons/audio.svg.js";
|
|
19
|
+
import ge from "../../../assets/icons/video.svg.js";
|
|
20
|
+
import be from "../../../assets/icons/eye.svg.js";
|
|
21
|
+
import ke from "../../../assets/icons/loading.svg.js";
|
|
22
|
+
import Be from "../../../assets/icons/open.svg.js";
|
|
23
|
+
import Ne from "../../../assets/icons/download.svg.js";
|
|
24
|
+
const Se = {
|
|
22
25
|
key: 0,
|
|
23
26
|
class: "nmorph-file-card__icon"
|
|
24
|
-
},
|
|
27
|
+
}, Ce = ["href", "aria-label"], Pe = { class: "nmorph-file-card__body" }, Ae = ["title"], Te = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "nmorph-file-card__name"
|
|
30
|
+
}, xe = {
|
|
25
31
|
key: 0,
|
|
26
32
|
class: "nmorph-file-card__error"
|
|
27
|
-
},
|
|
33
|
+
}, ze = {
|
|
28
34
|
key: 1,
|
|
29
35
|
class: "nmorph-file-card__meta"
|
|
30
|
-
},
|
|
36
|
+
}, Ie = ["title", "aria-label"], He = ["src", "alt"], Me = {
|
|
31
37
|
key: 1,
|
|
32
38
|
class: "nmorph-file-card__visual-size"
|
|
33
|
-
},
|
|
39
|
+
}, De = {
|
|
34
40
|
key: 2,
|
|
35
41
|
class: "nmorph-file-card__badge"
|
|
36
|
-
},
|
|
42
|
+
}, $e = {
|
|
37
43
|
key: 3,
|
|
38
44
|
class: "nmorph-file-card__actions"
|
|
39
|
-
},
|
|
45
|
+
}, Oe = ["aria-label"], Ve = ["href", "aria-label"], Ee = ["href", "download", "aria-label"], Le = "var(--nmorph-contrast-text-color)", co = /* @__PURE__ */ X({
|
|
40
46
|
__name: "NmorphFileCard",
|
|
41
47
|
props: {
|
|
42
48
|
name: {},
|
|
@@ -46,181 +52,242 @@ const ve = {
|
|
|
46
52
|
previewSrc: { default: "" },
|
|
47
53
|
downloadHref: { default: "" },
|
|
48
54
|
mediaPreview: { default: "none" },
|
|
55
|
+
previewMode: { default: "internal" },
|
|
49
56
|
surface: { default: "card" },
|
|
57
|
+
height: { default: void 0 },
|
|
58
|
+
showName: { type: Boolean, default: !0 },
|
|
59
|
+
showMeta: { type: Boolean, default: !0 },
|
|
60
|
+
showSize: { type: Boolean, default: !0 },
|
|
50
61
|
showExtensionBadge: { type: Boolean, default: !0 },
|
|
51
62
|
iconSurface: { type: Boolean, default: !0 },
|
|
52
63
|
compact: { type: Boolean, default: !1 },
|
|
53
64
|
loading: { type: Boolean, default: !1 },
|
|
54
65
|
error: { type: Boolean, default: !1 },
|
|
55
66
|
errorText: { default: "" },
|
|
56
|
-
showDefaultActions: { type: Boolean, default: !0 }
|
|
67
|
+
showDefaultActions: { type: Boolean, default: !0 },
|
|
68
|
+
showPlaybackButton: { type: Boolean, default: !0 }
|
|
57
69
|
},
|
|
58
70
|
emits: ["open", "download", "error"],
|
|
59
|
-
setup(
|
|
60
|
-
const e =
|
|
61
|
-
if (
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
return `${
|
|
65
|
-
},
|
|
66
|
-
() =>
|
|
67
|
-
),
|
|
68
|
-
() =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
setup(L, { emit: R }) {
|
|
72
|
+
const e = L, k = R, F = Y(), B = Z(!1), y = o(() => (e.extension || ue(e.name) || de(e.mimeType)).toLowerCase()), c = o(() => pe(e.mimeType, e.name)), W = o(() => e.mimeType.toLowerCase().startsWith("image/") || c.value.some((r) => w(r, te)) ? we : e.mimeType.toLowerCase().startsWith("audio/") || c.value.some((r) => w(r, le)) ? ye : e.mimeType.toLowerCase().startsWith("video/") || c.value.some((r) => w(r, ne)) ? ge : c.value.some((r) => w(r, ie)) ? _e : c.value.some((r) => w(r, se)) ? E : E), G = (r) => {
|
|
73
|
+
if (r === void 0 || Number.isNaN(r) || r < 0) return "";
|
|
74
|
+
if (r === 0) return "0 B";
|
|
75
|
+
const p = ["B", "KB", "MB", "GB", "TB"], f = Math.min(Math.floor(Math.log(r) / Math.log(1024)), p.length - 1), z = r / 1024 ** f, Q = z >= 10 || f === 0 || Number.isInteger(z) ? 0 : 1;
|
|
76
|
+
return `${z.toFixed(Q)} ${p[f]}`;
|
|
77
|
+
}, N = o(() => e.showSize ? G(e.size) : ""), K = o(() => y.value || e.mimeType), S = o(() => [K.value, N.value].filter(Boolean).join(" · ")), C = o(() => e.mediaPreview === "audio" && !!e.previewSrc && !e.loading && !e.error), m = o(() => e.mediaPreview === "video" && !!e.previewSrc && !e.loading && !e.error), u = o(() => e.mediaPreview === "image" && !!e.previewSrc && !e.loading && !e.error), g = o(
|
|
78
|
+
() => C.value || m.value || u.value
|
|
79
|
+
), s = o(() => m.value || u.value), H = o(() => e.height ?? (e.compact ? "96px" : "120px")), U = o(
|
|
80
|
+
() => me({
|
|
81
|
+
"--nmorph-file-card-height": e.height,
|
|
82
|
+
"--nmorph-file-card-media-height": H.value
|
|
83
|
+
})
|
|
84
|
+
), j = o(() => s.value ? e.showName : e.showName || e.showMeta && !!(e.error && e.errorText || S.value)), P = o(() => !e.previewSrc || e.loading || e.error ? [] : u.value ? [
|
|
85
|
+
{
|
|
86
|
+
kind: "image",
|
|
87
|
+
src: e.previewSrc,
|
|
88
|
+
name: e.name,
|
|
89
|
+
alt: e.name,
|
|
90
|
+
size: e.size,
|
|
91
|
+
downloadHref: e.downloadHref
|
|
92
|
+
}
|
|
93
|
+
] : m.value ? [
|
|
94
|
+
{
|
|
95
|
+
kind: "video",
|
|
96
|
+
src: e.previewSrc,
|
|
97
|
+
name: e.name,
|
|
98
|
+
size: e.size,
|
|
99
|
+
downloadHref: e.downloadHref,
|
|
100
|
+
controls: !0,
|
|
101
|
+
playsinline: !0,
|
|
102
|
+
preload: "metadata"
|
|
103
|
+
}
|
|
104
|
+
] : []), q = o(
|
|
105
|
+
() => e.previewMode === "internal" && P.value.length > 0
|
|
106
|
+
), M = o(() => e.mimeType.toLowerCase() === "application/pdf" || y.value === "pdf"), D = o(() => M.value ? e.previewSrc || e.downloadHref : ""), A = o(
|
|
107
|
+
() => e.showDefaultActions && !!D.value && !g.value && M.value
|
|
108
|
+
), T = o(() => !!F.actions), $ = o(
|
|
109
|
+
() => T.value || e.showDefaultActions && (e.loading || e.previewSrc && !g.value && !A.value || e.downloadHref)
|
|
110
|
+
), J = o(
|
|
111
|
+
() => ce({
|
|
73
112
|
"nmorph-file-card": [
|
|
74
113
|
e.surface,
|
|
75
114
|
e.compact && "compact",
|
|
76
115
|
e.loading && "loading",
|
|
77
116
|
e.error && "error",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
117
|
+
g.value && "media",
|
|
118
|
+
C.value && "media-audio",
|
|
119
|
+
m.value && "media-video",
|
|
120
|
+
u.value && "media-image",
|
|
121
|
+
s.value && "media-visual",
|
|
83
122
|
!e.iconSurface && "icon-plain",
|
|
84
|
-
|
|
123
|
+
!$.value && "no-actions"
|
|
85
124
|
]
|
|
86
125
|
})
|
|
87
|
-
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
_:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
key: 0,
|
|
100
|
-
href: A.value,
|
|
101
|
-
target: "_blank",
|
|
102
|
-
rel: "noopener noreferrer",
|
|
103
|
-
class: "nmorph-file-card__icon-action",
|
|
104
|
-
"aria-label": `Preview ${e.name}`,
|
|
105
|
-
onClick: w
|
|
106
|
-
}, [
|
|
107
|
-
n(l(p), {
|
|
108
|
-
size: "small",
|
|
109
|
-
color: Ae
|
|
110
|
-
}, {
|
|
111
|
-
default: m(() => [
|
|
112
|
-
n(l(de))
|
|
126
|
+
), d = () => {
|
|
127
|
+
q.value && (B.value = !0), e.previewMode !== "none" && k("open");
|
|
128
|
+
}, x = () => k("download"), O = () => k("error");
|
|
129
|
+
return (r, p) => (a(), t(V, null, [
|
|
130
|
+
I("div", {
|
|
131
|
+
class: oe(J.value),
|
|
132
|
+
style: ee(U.value)
|
|
133
|
+
}, [
|
|
134
|
+
s.value ? l("", !0) : (a(), t("div", Se, [
|
|
135
|
+
n(i(_), { size: "medium" }, {
|
|
136
|
+
default: v(() => [
|
|
137
|
+
(a(), b(ae(W.value)))
|
|
113
138
|
]),
|
|
114
139
|
_: 1
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
])),
|
|
118
|
-
g("div", _e, [
|
|
119
|
-
g("div", {
|
|
120
|
-
class: "nmorph-file-card__info",
|
|
121
|
-
title: e.name
|
|
122
|
-
}, [
|
|
123
|
-
g("span", ge, d(e.name), 1),
|
|
124
|
-
c.value ? t("", !0) : (r(), i(q, { key: 0 }, [
|
|
125
|
-
e.error && e.errorText ? (r(), i("span", ye, d(e.errorText), 1)) : x.value ? (r(), i("span", be, d(x.value), 1)) : t("", !0)
|
|
126
|
-
], 64))
|
|
127
|
-
], 8, we),
|
|
128
|
-
k.value ? (r(), T(te, {
|
|
129
|
-
key: 0,
|
|
130
|
-
class: "nmorph-file-card__audio-preview",
|
|
131
|
-
src: e.previewSrc,
|
|
132
|
-
name: e.name,
|
|
133
|
-
surface: "plain",
|
|
134
|
-
embedded: "",
|
|
135
|
-
compact: "",
|
|
136
|
-
"show-icon": !1,
|
|
137
|
-
"show-header": !1,
|
|
138
|
-
"show-default-actions": !1,
|
|
139
|
-
onError: $
|
|
140
|
-
}, null, 8, ["src", "name"])) : t("", !0),
|
|
141
|
-
v.value ? (r(), T(ne, {
|
|
142
|
-
key: 1,
|
|
143
|
-
class: "nmorph-file-card__video-preview",
|
|
144
|
-
src: e.previewSrc,
|
|
145
|
-
name: e.name,
|
|
146
|
-
height: z.value,
|
|
147
|
-
surface: "plain",
|
|
148
|
-
embedded: "",
|
|
149
|
-
compact: "",
|
|
150
|
-
controls: !1,
|
|
151
|
-
"show-meta": !1,
|
|
152
|
-
"show-default-actions": !1,
|
|
153
|
-
"preview-mode": "emit",
|
|
154
|
-
onError: $,
|
|
155
|
-
onPreview: w
|
|
156
|
-
}, null, 8, ["src", "name", "height"])) : t("", !0),
|
|
157
|
-
h.value ? (r(), i("button", {
|
|
158
|
-
key: 2,
|
|
159
|
-
class: "nmorph-file-card__image-preview",
|
|
160
|
-
type: "button",
|
|
161
|
-
title: e.name,
|
|
162
|
-
"aria-label": `Preview ${e.name}`,
|
|
163
|
-
onClick: w
|
|
164
|
-
}, [
|
|
165
|
-
g("img", {
|
|
166
|
-
class: "nmorph-file-card__image",
|
|
167
|
-
src: e.previewSrc,
|
|
168
|
-
alt: e.name
|
|
169
|
-
}, null, 8, Ne)
|
|
170
|
-
], 8, ke)) : t("", !0)
|
|
171
|
-
]),
|
|
172
|
-
c.value && b.value ? (r(), i("span", Be, d(b.value), 1)) : t("", !0),
|
|
173
|
-
e.showExtensionBadge && f.value && !c.value ? (r(), i("span", Ce, d(f.value), 1)) : t("", !0),
|
|
174
|
-
I.value ? (r(), i("div", Se, [
|
|
175
|
-
J(o.$slots, "actions", {}, () => [
|
|
176
|
-
e.loading ? (r(), i("span", {
|
|
140
|
+
}),
|
|
141
|
+
A.value && !e.loading && !e.error ? (a(), t("a", {
|
|
177
142
|
key: 0,
|
|
178
|
-
|
|
179
|
-
role: "status",
|
|
180
|
-
"aria-label": `Uploading ${e.name}`
|
|
181
|
-
}, [
|
|
182
|
-
n(l(p), { size: "small" }, {
|
|
183
|
-
default: m(() => [
|
|
184
|
-
n(l(ue))
|
|
185
|
-
]),
|
|
186
|
-
_: 1
|
|
187
|
-
})
|
|
188
|
-
], 8, Te)) : e.previewSrc && !_.value && !N.value ? (r(), i("a", {
|
|
189
|
-
key: 1,
|
|
190
|
-
href: e.previewSrc,
|
|
143
|
+
href: D.value,
|
|
191
144
|
target: "_blank",
|
|
192
145
|
rel: "noopener noreferrer",
|
|
193
|
-
class: "nmorph-file-
|
|
194
|
-
"aria-label": `
|
|
195
|
-
onClick:
|
|
146
|
+
class: "nmorph-file-card__icon-action",
|
|
147
|
+
"aria-label": `Preview ${e.name}`,
|
|
148
|
+
onClick: d
|
|
196
149
|
}, [
|
|
197
|
-
n(
|
|
198
|
-
|
|
199
|
-
|
|
150
|
+
n(i(_), {
|
|
151
|
+
size: "small",
|
|
152
|
+
color: Le
|
|
153
|
+
}, {
|
|
154
|
+
default: v(() => [
|
|
155
|
+
n(i(be))
|
|
200
156
|
]),
|
|
201
157
|
_: 1
|
|
202
158
|
})
|
|
203
|
-
], 8,
|
|
204
|
-
|
|
159
|
+
], 8, Ce)) : l("", !0)
|
|
160
|
+
])),
|
|
161
|
+
I("div", Pe, [
|
|
162
|
+
j.value ? (a(), t("div", {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: "nmorph-file-card__info",
|
|
165
|
+
title: e.name
|
|
166
|
+
}, [
|
|
167
|
+
e.showName ? (a(), t("span", Te, h(e.name), 1)) : l("", !0),
|
|
168
|
+
!s.value && e.showMeta ? (a(), t(V, { key: 1 }, [
|
|
169
|
+
e.error && e.errorText ? (a(), t("span", xe, h(e.errorText), 1)) : S.value ? (a(), t("span", ze, h(S.value), 1)) : l("", !0)
|
|
170
|
+
], 64)) : l("", !0)
|
|
171
|
+
], 8, Ae)) : l("", !0),
|
|
172
|
+
C.value ? (a(), b(fe, {
|
|
173
|
+
key: 1,
|
|
174
|
+
class: "nmorph-file-card__audio-preview",
|
|
175
|
+
src: e.previewSrc,
|
|
176
|
+
name: e.name,
|
|
177
|
+
surface: "plain",
|
|
178
|
+
embedded: "",
|
|
179
|
+
compact: "",
|
|
180
|
+
"show-icon": !1,
|
|
181
|
+
"show-header": !1,
|
|
182
|
+
"show-playback-button": e.showPlaybackButton,
|
|
183
|
+
"show-default-actions": !1,
|
|
184
|
+
onError: O
|
|
185
|
+
}, null, 8, ["src", "name", "show-playback-button"])) : l("", !0),
|
|
186
|
+
m.value ? (a(), b(he, {
|
|
205
187
|
key: 2,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
188
|
+
class: "nmorph-file-card__video-preview",
|
|
189
|
+
src: e.previewSrc,
|
|
190
|
+
name: e.name,
|
|
191
|
+
height: H.value,
|
|
192
|
+
surface: "plain",
|
|
193
|
+
embedded: "",
|
|
194
|
+
compact: "",
|
|
195
|
+
controls: !1,
|
|
196
|
+
"show-meta": !1,
|
|
197
|
+
"show-playback-button": e.showPlaybackButton,
|
|
198
|
+
"show-default-actions": !1,
|
|
199
|
+
"show-preview-action": !T.value && e.showDefaultActions && e.previewMode !== "none",
|
|
200
|
+
"show-fullscreen-action": !T.value && e.showDefaultActions,
|
|
201
|
+
"preview-mode": "emit",
|
|
202
|
+
onError: O,
|
|
203
|
+
onPreview: d
|
|
204
|
+
}, null, 8, ["src", "name", "height", "show-playback-button", "show-preview-action", "show-fullscreen-action"])) : l("", !0),
|
|
205
|
+
u.value ? (a(), t("button", {
|
|
206
|
+
key: 3,
|
|
207
|
+
class: "nmorph-file-card__image-preview",
|
|
208
|
+
type: "button",
|
|
209
|
+
title: e.name,
|
|
210
|
+
"aria-label": `Preview ${e.name}`,
|
|
211
|
+
onClick: d
|
|
211
212
|
}, [
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
213
|
+
I("img", {
|
|
214
|
+
class: "nmorph-file-card__image",
|
|
215
|
+
src: e.previewSrc,
|
|
216
|
+
alt: e.name
|
|
217
|
+
}, null, 8, He)
|
|
218
|
+
], 8, Ie)) : l("", !0)
|
|
219
|
+
]),
|
|
220
|
+
s.value && N.value ? (a(), t("span", Me, h(N.value), 1)) : l("", !0),
|
|
221
|
+
e.showExtensionBadge && y.value && !s.value ? (a(), t("span", De, h(y.value), 1)) : l("", !0),
|
|
222
|
+
$.value ? (a(), t("div", $e, [
|
|
223
|
+
re(r.$slots, "actions", {
|
|
224
|
+
fileName: e.name,
|
|
225
|
+
previewSrc: e.previewSrc,
|
|
226
|
+
downloadHref: e.downloadHref,
|
|
227
|
+
open: d,
|
|
228
|
+
download: x
|
|
229
|
+
}, () => [
|
|
230
|
+
e.loading ? (a(), t("span", {
|
|
231
|
+
key: 0,
|
|
232
|
+
class: "nmorph-file-card__action-loader",
|
|
233
|
+
role: "status",
|
|
234
|
+
"aria-label": `Uploading ${e.name}`
|
|
235
|
+
}, [
|
|
236
|
+
n(i(_), { size: "small" }, {
|
|
237
|
+
default: v(() => [
|
|
238
|
+
n(i(ke))
|
|
239
|
+
]),
|
|
240
|
+
_: 1
|
|
241
|
+
})
|
|
242
|
+
], 8, Oe)) : e.previewSrc && !g.value && !A.value ? (a(), t("a", {
|
|
243
|
+
key: 1,
|
|
244
|
+
href: e.previewSrc,
|
|
245
|
+
target: "_blank",
|
|
246
|
+
rel: "noopener noreferrer",
|
|
247
|
+
class: "nmorph-file-card__action-link",
|
|
248
|
+
"aria-label": `Open ${e.name}`,
|
|
249
|
+
onClick: d
|
|
250
|
+
}, [
|
|
251
|
+
n(i(_), { size: "small" }, {
|
|
252
|
+
default: v(() => [
|
|
253
|
+
n(i(Be))
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
})
|
|
257
|
+
], 8, Ve)) : l("", !0),
|
|
258
|
+
!e.loading && e.downloadHref ? (a(), t("a", {
|
|
259
|
+
key: 2,
|
|
260
|
+
href: e.downloadHref,
|
|
261
|
+
download: e.name,
|
|
262
|
+
class: "nmorph-file-card__action-link",
|
|
263
|
+
"aria-label": `Download ${e.name}`,
|
|
264
|
+
onClick: x
|
|
265
|
+
}, [
|
|
266
|
+
n(i(_), { size: "small" }, {
|
|
267
|
+
default: v(() => [
|
|
268
|
+
n(i(Ne))
|
|
269
|
+
]),
|
|
270
|
+
_: 1
|
|
271
|
+
})
|
|
272
|
+
], 8, Ee)) : l("", !0)
|
|
273
|
+
])
|
|
274
|
+
])) : l("", !0)
|
|
275
|
+
], 6),
|
|
276
|
+
P.value.length > 0 ? (a(), b(ve, {
|
|
277
|
+
key: 0,
|
|
278
|
+
modelValue: B.value,
|
|
279
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => B.value = f),
|
|
280
|
+
items: P.value,
|
|
281
|
+
"show-navigation-buttons": !1,
|
|
282
|
+
"show-file-name": e.showName,
|
|
283
|
+
"show-file-size": e.showSize,
|
|
284
|
+
"show-file-actions": e.showDefaultActions,
|
|
285
|
+
"show-playback-button": e.showPlaybackButton,
|
|
286
|
+
onDownload: x
|
|
287
|
+
}, null, 8, ["modelValue", "items", "show-file-name", "show-file-size", "show-file-actions", "show-playback-button"])) : l("", !0)
|
|
288
|
+
], 64));
|
|
222
289
|
}
|
|
223
290
|
});
|
|
224
291
|
export {
|
|
225
|
-
|
|
292
|
+
co as default
|
|
226
293
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-media-gallery{display:contents}.nmorph-media-gallery .nmorph-media-gallery__stage{position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;overflow:hidden;pointer-events:none}.nmorph-media-gallery .nmorph-image{width:100%;height:100%;transition:transform var(--transition-03) ease-in-out;pointer-events:none}.nmorph-media-gallery .nmorph-image img{display:block;width:auto;max-width:100%;height:auto;max-height:100%;object-fit:contain;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__video{display:block;width:100%;max-width:100%;height:100%;max-height:100%;background:var(--nmorph-black-color);border-radius:var(--default-border-radius);object-fit:contain;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__play{position:absolute;top:50%;left:50%;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:54px;height:54px;padding:0;color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--border-radius-circular);transform:translate(-50%,-50%);cursor:pointer;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__play .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-media-gallery .nmorph-media-gallery__play:hover{background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-media-gallery.nmorph-media-gallery--video-playing .nmorph-media-gallery__play{opacity:.72}.nmorph-media-gallery .nmorph-media-gallery__action-element{margin-right:var(--indentation-03)}.nmorph-media-gallery.nmorph-media-gallery--image-cover .nmorph-image img{width:100%;height:100%;object-fit:cover}.nmorph-media-gallery.nmorph-media-gallery--video-cover .nmorph-media-gallery__video{object-fit:cover}
|
|
1
|
+
.nmorph-media-gallery__trigger{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:var(--indentation-03);width:100%}.nmorph-media-gallery__trigger--fixed-height{grid-auto-rows:var(--nmorph-media-gallery-trigger-height)}.nmorph-media-gallery__trigger-item{position:relative;min-width:0;overflow:hidden;background:color-mix(in srgb,var(--nmorph-accent-color) 6%,transparent);border-radius:var(--default-border-radius);aspect-ratio:16/9}.nmorph-media-gallery__trigger--fixed-height .nmorph-media-gallery__trigger-item{height:100%;aspect-ratio:auto}.nmorph-media-gallery__trigger-open{position:relative;display:block;width:100%;height:100%;padding:0;overflow:hidden;color:inherit;font:inherit;text-align:initial;background:transparent;border:0;cursor:pointer}.nmorph-media-gallery__trigger-open .nmorph-image,.nmorph-media-gallery__trigger-open .nmorph-media-gallery__trigger-video{display:block;width:100%;height:100%;transition:filter var(--transition-03) ease-in-out}.nmorph-media-gallery__trigger-open .nmorph-image img,.nmorph-media-gallery__trigger-open .nmorph-media-gallery__trigger-video{display:block;width:100%;height:100%;object-fit:cover}.nmorph-media-gallery__trigger-open:hover .nmorph-image,.nmorph-media-gallery__trigger-open:hover .nmorph-media-gallery__trigger-video{filter:brightness(.86)}.nmorph-media-gallery__trigger-name,.nmorph-media-gallery__trigger-size{position:absolute;z-index:2;display:block;box-sizing:border-box;min-width:0;min-height:22px;padding:0 6px;overflow:hidden;color:var(--nmorph-contrast-text-color);line-height:22px;white-space:nowrap;text-overflow:ellipsis;background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border-radius:var(--default-border-radius);pointer-events:none}.nmorph-media-gallery__trigger-name{top:var(--indentation-02);left:var(--indentation-02);max-width:calc(100% - 56px);font-weight:600;font-size:var(--font-size-small)}.nmorph-media-gallery__trigger-item--video .nmorph-media-gallery__trigger-name{max-width:calc(100% - 118px)}.nmorph-media-gallery__trigger-size{right:var(--indentation-02);bottom:var(--indentation-02);max-width:calc(100% - var(--indentation-04));font-size:var(--font-size-extra-small)}.nmorph-media-gallery__trigger-actions{position:absolute;top:var(--indentation-02);right:var(--indentation-02);z-index:3;display:flex;gap:var(--indentation-01)}.nmorph-media-gallery__trigger-action{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:22px;height:22px;padding:0;color:var(--nmorph-contrast-text-color);font:inherit;line-height:1;text-decoration:none;background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--default-border-radius);cursor:pointer}.nmorph-media-gallery__trigger-action .nmorph-icon{flex:0 0 auto;--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-media-gallery__trigger-action:hover{color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-media-gallery__trigger-play{position:absolute;top:50%;left:50%;z-index:2;display:inline-flex;justify-content:center;align-items:center;width:54px;height:54px;color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border-radius:var(--border-radius-circular);transform:translate(-50%,-50%);pointer-events:none}.nmorph-media-gallery__trigger-play .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-media-gallery{display:contents}.nmorph-media-gallery .nmorph-media-gallery__stage{position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;overflow:hidden;pointer-events:none}.nmorph-media-gallery .nmorph-image{width:100%;height:100%;transition:transform var(--transition-03) ease-in-out;pointer-events:none}.nmorph-media-gallery .nmorph-image img{display:block;width:auto;max-width:100%;height:auto;max-height:100%;object-fit:contain;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__video{display:block;width:100%;max-width:100%;height:100%;max-height:100%;background:var(--nmorph-black-color);border-radius:var(--default-border-radius);object-fit:contain;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__play{position:absolute;top:50%;left:50%;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:54px;height:54px;padding:0;color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--border-radius-circular);transform:translate(-50%,-50%);cursor:pointer;pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__play .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-media-gallery .nmorph-media-gallery__play:hover{background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-media-gallery.nmorph-media-gallery--video-playing .nmorph-media-gallery__play{opacity:.72}.nmorph-media-gallery .nmorph-media-gallery__file-name,.nmorph-media-gallery .nmorph-media-gallery__file-size{position:absolute;z-index:2;display:block;box-sizing:border-box;min-width:0;min-height:22px;padding:0 6px;overflow:hidden;color:var(--nmorph-contrast-text-color);line-height:22px;white-space:nowrap;text-overflow:ellipsis;background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border-radius:var(--default-border-radius);pointer-events:none}.nmorph-media-gallery .nmorph-media-gallery__file-name{top:var(--indentation-02);left:var(--indentation-02);max-width:calc(100% - 56px);font-weight:600;font-size:var(--font-size-small)}.nmorph-media-gallery.nmorph-media-gallery--video .nmorph-media-gallery__file-name{max-width:calc(100% - 92px)}.nmorph-media-gallery .nmorph-media-gallery__file-size{right:var(--indentation-02);bottom:var(--indentation-02);max-width:calc(100% - var(--indentation-04));font-size:var(--font-size-extra-small)}.nmorph-media-gallery .nmorph-media-gallery__file-actions{position:absolute;top:var(--indentation-02);right:var(--indentation-02);z-index:3;display:flex;gap:var(--indentation-01);pointer-events:auto}.nmorph-media-gallery .nmorph-media-gallery__file-action{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:22px;height:22px;padding:0;color:var(--nmorph-contrast-text-color);font:inherit;line-height:1;text-decoration:none;background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--default-border-radius);cursor:pointer}.nmorph-media-gallery .nmorph-media-gallery__file-action .nmorph-icon{flex:0 0 auto;--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-media-gallery .nmorph-media-gallery__file-action:hover{background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-media-gallery .nmorph-media-gallery__action-element{margin-right:var(--indentation-03)}.nmorph-media-gallery.nmorph-media-gallery--image-cover .nmorph-image img{width:100%;height:100%;object-fit:cover}.nmorph-media-gallery.nmorph-media-gallery--video-cover .nmorph-media-gallery__video{object-fit:cover}
|