@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
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-file-card{display:flex;gap:var(--indentation-03);align-items:center;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:64px;padding:var(--indentation-03);color:var(--nmorph-text-color);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-file-card .nmorph-file-card__icon{position:relative;display:flex;flex:0 0 auto;justify-content:center;align-items:center;width:36px;height:36px;color:var(--nmorph-text-color);background:color-mix(in srgb,var(--nmorph-text-color) 10%,transparent);border-radius:var(--default-border-radius);--color: currentColor}.nmorph-file-card .nmorph-file-card__icon-action{position:absolute;right:-4px;bottom:-4px;display:inline-flex;justify-content:center;align-items:center;width:18px;height:18px;color:var(--nmorph-contrast-text-color);text-decoration:none;background:color-mix(in srgb,var(--nmorph-black-color) 36%,transparent);border-radius:var(--border-radius-circular);box-shadow:var(--nmorph-shadow-outset)}.nmorph-file-card .nmorph-file-card__icon-action:hover{background:color-mix(in srgb,var(--nmorph-black-color) 48%,transparent)}.nmorph-file-card .nmorph-file-card__icon-action .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-file-card .nmorph-file-card__body{display:flex;flex:1 1 0;flex-direction:column;gap:var(--indentation-01);min-width:0}.nmorph-file-card .nmorph-file-card__info{display:flex;flex-direction:column;gap:2px;min-width:0}.nmorph-file-card .nmorph-file-card__name,.nmorph-file-card .nmorph-file-card__meta,.nmorph-file-card .nmorph-file-card__error{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-file-card .nmorph-file-card__name{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-file-card .nmorph-file-card__meta,.nmorph-file-card .nmorph-file-card__error{font-size:var(--font-size-extra-small);line-height:var(--line-height-regular)}.nmorph-file-card .nmorph-file-card__meta{color:var(--nmorph-semi-contrast-text-color)}.nmorph-file-card .nmorph-file-card__error{color:var(--nmorph-error-text-color)}.nmorph-file-card .nmorph-file-card__audio-preview,.nmorph-file-card .nmorph-file-card__video-preview{width:100%;min-width:0}.nmorph-file-card .nmorph-file-card__badge{flex:0 0 auto;max-width:72px;padding:2px 6px;overflow:hidden;color:var(--nmorph-accent-color);font-weight:700;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular);white-space:nowrap;text-transform:uppercase;text-overflow:ellipsis;background:color-mix(in srgb,var(--nmorph-accent-color) 10%,transparent);border-radius:var(--default-border-radius)}.nmorph-file-card .nmorph-file-card__actions{display:flex;flex:0 0 auto;gap:var(--indentation-01);align-items:center}.nmorph-file-card .nmorph-file-card__action-link,.nmorph-file-card .nmorph-file-card__action-loader{display:inline-flex;justify-content:center;align-items:center;width:22px;height:22px;color:inherit;text-decoration:none;border-radius:var(--default-border-radius)}.nmorph-file-card .nmorph-file-card__action-link:hover{color:var(--nmorph-accent-color);background:color-mix(in srgb,var(--nmorph-accent-color) 10%,transparent)}.nmorph-file-card .nmorph-file-card__action-link .nmorph-icon{--color: currentColor}.nmorph-file-card .nmorph-file-card__action-loader{color:var(--nmorph-semi-contrast-text-color)}.nmorph-file-card .nmorph-file-card__action-loader .nmorph-icon{--color: currentColor}.nmorph-file-card.nmorph-file-card--compact{min-height:52px;padding:var(--indentation-02)}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__icon{width:30px;height:30px}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__audio-preview,.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__video-preview{margin-top:0}.nmorph-file-card.nmorph-file-card--media-audio.nmorph-file-card--no-actions .nmorph-file-card__body{padding-inline-end:var(--indentation-02)}.nmorph-file-card.nmorph-file-card--media-
|
|
1
|
+
.nmorph-file-card{display:flex;gap:var(--indentation-03);align-items:center;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:64px;padding:var(--indentation-03);color:var(--nmorph-text-color);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-file-card .nmorph-file-card__icon{position:relative;display:flex;flex:0 0 auto;justify-content:center;align-items:center;width:36px;height:36px;color:var(--nmorph-text-color);background:color-mix(in srgb,var(--nmorph-text-color) 10%,transparent);border-radius:var(--default-border-radius);--color: currentColor}.nmorph-file-card .nmorph-file-card__icon-action{position:absolute;right:-4px;bottom:-4px;display:inline-flex;justify-content:center;align-items:center;width:18px;height:18px;color:var(--nmorph-contrast-text-color);text-decoration:none;background:color-mix(in srgb,var(--nmorph-black-color) 36%,transparent);border-radius:var(--border-radius-circular);box-shadow:var(--nmorph-shadow-outset)}.nmorph-file-card .nmorph-file-card__icon-action:hover{background:color-mix(in srgb,var(--nmorph-black-color) 48%,transparent)}.nmorph-file-card .nmorph-file-card__icon-action .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-file-card .nmorph-file-card__body{display:flex;flex:1 1 0;flex-direction:column;gap:var(--indentation-01);min-width:0}.nmorph-file-card .nmorph-file-card__info{display:flex;flex-direction:column;gap:2px;min-width:0}.nmorph-file-card .nmorph-file-card__name,.nmorph-file-card .nmorph-file-card__meta,.nmorph-file-card .nmorph-file-card__error{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-file-card .nmorph-file-card__name{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-regular)}.nmorph-file-card .nmorph-file-card__meta,.nmorph-file-card .nmorph-file-card__error{font-size:var(--font-size-extra-small);line-height:var(--line-height-regular)}.nmorph-file-card .nmorph-file-card__meta{color:var(--nmorph-semi-contrast-text-color)}.nmorph-file-card .nmorph-file-card__error{color:var(--nmorph-error-text-color)}.nmorph-file-card .nmorph-file-card__audio-preview,.nmorph-file-card .nmorph-file-card__video-preview,.nmorph-file-card .nmorph-file-card__image-preview{width:100%;min-width:0}.nmorph-file-card .nmorph-file-card__image-preview{display:block;height:120px;padding:0;overflow:hidden;color:inherit;font:inherit;background:transparent;border:0;border-radius:var(--default-border-radius);cursor:pointer}.nmorph-file-card .nmorph-file-card__image-preview .nmorph-file-card__image{display:block;width:100%;max-width:100%;height:100%;object-fit:cover}.nmorph-file-card .nmorph-file-card__badge{flex:0 0 auto;max-width:72px;padding:2px 6px;overflow:hidden;color:var(--nmorph-accent-color);font-weight:700;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular);white-space:nowrap;text-transform:uppercase;text-overflow:ellipsis;background:color-mix(in srgb,var(--nmorph-accent-color) 10%,transparent);border-radius:var(--default-border-radius)}.nmorph-file-card .nmorph-file-card__visual-size{position:absolute;right:var(--indentation-02);bottom:var(--indentation-02);z-index:2;display:inline-flex;align-items:center;min-width:0;max-width:calc(100% - var(--indentation-04));min-height:22px;padding:0 6px;overflow:hidden;color:var(--nmorph-contrast-text-color);font-size:var(--font-size-extra-small);line-height:var(--line-height-regular);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-file-card .nmorph-file-card__actions{display:flex;flex:0 0 auto;gap:var(--indentation-01);align-items:center}.nmorph-file-card .nmorph-file-card__action-link,.nmorph-file-card .nmorph-file-card__action-loader{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:22px;height:22px;padding:0;color:inherit;line-height:1;text-decoration:none;border-radius:var(--default-border-radius)}.nmorph-file-card .nmorph-file-card__action-link:hover{color:var(--nmorph-accent-color);background:color-mix(in srgb,var(--nmorph-accent-color) 10%,transparent)}.nmorph-file-card .nmorph-file-card__action-link .nmorph-icon{--color: currentColor}.nmorph-file-card .nmorph-file-card__action-loader{color:var(--nmorph-semi-contrast-text-color)}.nmorph-file-card .nmorph-file-card__action-loader .nmorph-icon{--color: currentColor}.nmorph-file-card.nmorph-file-card--compact{min-height:52px;padding:var(--indentation-02)}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__icon{width:30px;height:30px}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__audio-preview,.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__video-preview{margin-top:0}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__image-preview{height:96px;margin-top:0}.nmorph-file-card.nmorph-file-card--media-audio.nmorph-file-card--no-actions .nmorph-file-card__body{padding-inline-end:var(--indentation-02)}.nmorph-file-card.nmorph-file-card--media-visual{position:relative;display:block;gap:0;min-height:0;padding:0;overflow:hidden}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__body{position:relative;display:block;width:100%;min-width:0}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__info{position:absolute;top:var(--indentation-02);left:var(--indentation-02);z-index:2;max-width:calc(100% - 48px);pointer-events:none}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__name{display:block;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)}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__image-preview,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__video-preview,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-video-preview,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-video-preview__media,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__image{display:block;width:100%;max-width:none;height:100%;border-radius:inherit;object-fit:cover}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__actions{position:absolute;top:var(--indentation-02);right:var(--indentation-02);z-index:3}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__action-link,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__action-loader{color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__action-link .nmorph-icon,.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__action-loader .nmorph-icon{flex:0 0 auto;--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__action-link:hover{color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-file-card.nmorph-file-card--media-video .nmorph-file-card__info{max-width:calc(100% - 112px)}.nmorph-file-card.nmorph-file-card--media-video .nmorph-video-preview__actions{right:calc(var(--indentation-02) + 26px)}.nmorph-file-card.nmorph-file-card--media-image .nmorph-file-card__image-preview{border-radius:inherit}.nmorph-file-card.nmorph-file-card--error{outline:1px solid var(--nmorph-error-color)}.nmorph-file-card.nmorph-file-card--soft{background:color-mix(in srgb,var(--nmorph-accent-color) 6%,transparent);box-shadow:none}.nmorph-file-card.nmorph-file-card--soft .nmorph-file-card__icon-action{box-shadow:none}.nmorph-file-card.nmorph-file-card--plain{background:transparent;box-shadow:none}.nmorph-file-card.nmorph-file-card--plain .nmorph-file-card__icon-action{box-shadow:none}.nmorph-file-card.nmorph-file-card--icon-plain .nmorph-file-card__icon{background:transparent}
|
|
@@ -1,36 +1,42 @@
|
|
|
1
1
|
import './NmorphFileCard.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { getFileExtension as
|
|
5
|
-
import { NmorphImageResolution as
|
|
6
|
-
import
|
|
2
|
+
import { defineComponent as K, useSlots as j, computed as a, openBlock as r, createElementBlock as i, normalizeClass as G, createVNode as n, unref as l, withCtx as m, createBlock as T, resolveDynamicComponent as U, createCommentVNode as t, createElementVNode as g, toDisplayString as d, Fragment as q, renderSlot as J } from "vue";
|
|
3
|
+
import { useModifiers as Q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { getFileExtension as X, getPlainFileType as Y, getTypeCandidates as Z, isKnownFileType as u } from "../../../utils/file-types.js";
|
|
5
|
+
import { NmorphImageResolution as ee, NmorphAudioResolution as oe, NmorphVideoResolution as ae, NmorphArchiveResolution as re, NmorphDocResolution as ie } from "../../form/nmorph-file-upload/types.js";
|
|
6
|
+
import te from "../nmorph-audio-preview/NmorphAudioPreview.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
8
|
+
import ne from "../nmorph-video-preview/NmorphVideoPreview.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
10
|
+
import le from "../../../assets/icons/image.svg.js";
|
|
11
|
+
import se from "../../../assets/icons/archive.svg.js";
|
|
12
|
+
import H from "../../../assets/icons/doc.svg.js";
|
|
13
|
+
import p from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
14
14
|
/* empty css */
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
15
|
+
import ce from "../../../assets/icons/audio.svg.js";
|
|
16
|
+
import me from "../../../assets/icons/video.svg.js";
|
|
17
|
+
import de from "../../../assets/icons/eye.svg.js";
|
|
18
|
+
import ue from "../../../assets/icons/loading.svg.js";
|
|
19
|
+
import pe from "../../../assets/icons/open.svg.js";
|
|
20
|
+
import fe from "../../../assets/icons/download.svg.js";
|
|
21
|
+
const ve = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "nmorph-file-card__icon"
|
|
24
|
+
}, he = ["href", "aria-label"], _e = { class: "nmorph-file-card__body" }, we = ["title"], ge = { class: "nmorph-file-card__name" }, ye = {
|
|
22
25
|
key: 0,
|
|
23
26
|
class: "nmorph-file-card__error"
|
|
24
|
-
},
|
|
27
|
+
}, be = {
|
|
25
28
|
key: 1,
|
|
26
29
|
class: "nmorph-file-card__meta"
|
|
27
|
-
},
|
|
28
|
-
key: 0,
|
|
29
|
-
class: "nmorph-file-card__badge"
|
|
30
|
-
}, ge = {
|
|
30
|
+
}, ke = ["title", "aria-label"], Ne = ["src", "alt"], Be = {
|
|
31
31
|
key: 1,
|
|
32
|
+
class: "nmorph-file-card__visual-size"
|
|
33
|
+
}, Ce = {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: "nmorph-file-card__badge"
|
|
36
|
+
}, Se = {
|
|
37
|
+
key: 3,
|
|
32
38
|
class: "nmorph-file-card__actions"
|
|
33
|
-
},
|
|
39
|
+
}, Te = ["aria-label"], xe = ["href", "aria-label"], Pe = ["href", "download", "aria-label"], Ae = "var(--nmorph-contrast-text-color)", Qe = /* @__PURE__ */ K({
|
|
34
40
|
__name: "NmorphFileCard",
|
|
35
41
|
props: {
|
|
36
42
|
name: {},
|
|
@@ -50,67 +56,76 @@ const pe = { class: "nmorph-file-card__icon" }, ue = ["href", "aria-label"], fe
|
|
|
50
56
|
showDefaultActions: { type: Boolean, default: !0 }
|
|
51
57
|
},
|
|
52
58
|
emits: ["open", "download", "error"],
|
|
53
|
-
setup(
|
|
54
|
-
const e =
|
|
59
|
+
setup(D, { emit: E }) {
|
|
60
|
+
const e = D, y = E, L = j(), f = a(() => (e.extension || X(e.name) || Y(e.mimeType)).toLowerCase()), s = a(() => Z(e.mimeType, e.name)), M = a(() => e.mimeType.toLowerCase().startsWith("image/") || s.value.some((o) => u(o, ee)) ? le : e.mimeType.toLowerCase().startsWith("audio/") || s.value.some((o) => u(o, oe)) ? ce : e.mimeType.toLowerCase().startsWith("video/") || s.value.some((o) => u(o, ae)) ? me : s.value.some((o) => u(o, re)) ? se : s.value.some((o) => u(o, ie)) ? H : H), O = (o) => {
|
|
55
61
|
if (o === void 0 || Number.isNaN(o) || o < 0) return "";
|
|
56
62
|
if (o === 0) return "0 B";
|
|
57
|
-
const
|
|
58
|
-
return `${
|
|
59
|
-
},
|
|
60
|
-
() =>
|
|
61
|
-
),
|
|
62
|
-
() =>
|
|
63
|
-
),
|
|
64
|
-
() =>
|
|
63
|
+
const B = ["B", "KB", "MB", "GB", "TB"], C = Math.min(Math.floor(Math.log(o) / Math.log(1024)), B.length - 1), S = o / 1024 ** C, W = S >= 10 || C === 0 || Number.isInteger(S) ? 0 : 1;
|
|
64
|
+
return `${S.toFixed(W)} ${B[C]}`;
|
|
65
|
+
}, b = a(() => O(e.size)), R = a(() => f.value || e.mimeType), x = a(() => [R.value, b.value].filter(Boolean).join(" · ")), k = a(() => e.mediaPreview === "audio" && !!e.previewSrc && !e.loading && !e.error), v = a(() => e.mediaPreview === "video" && !!e.previewSrc && !e.loading && !e.error), h = a(() => e.mediaPreview === "image" && !!e.previewSrc && !e.loading && !e.error), _ = a(
|
|
66
|
+
() => k.value || v.value || h.value
|
|
67
|
+
), c = a(() => v.value || h.value), z = a(() => e.compact ? "96px" : "120px"), P = a(() => e.mimeType.toLowerCase() === "application/pdf" || f.value === "pdf"), A = a(() => P.value ? e.previewSrc || e.downloadHref : ""), N = a(
|
|
68
|
+
() => e.showDefaultActions && !!A.value && !_.value && P.value
|
|
69
|
+
), I = a(
|
|
70
|
+
() => !!L.actions || e.showDefaultActions && (e.loading || e.previewSrc && !_.value && !N.value || e.downloadHref)
|
|
71
|
+
), F = a(
|
|
72
|
+
() => Q({
|
|
65
73
|
"nmorph-file-card": [
|
|
66
74
|
e.surface,
|
|
67
75
|
e.compact && "compact",
|
|
68
76
|
e.loading && "loading",
|
|
69
77
|
e.error && "error",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
_.value && "media",
|
|
79
|
+
k.value && "media-audio",
|
|
80
|
+
v.value && "media-video",
|
|
81
|
+
h.value && "media-image",
|
|
82
|
+
c.value && "media-visual",
|
|
73
83
|
!e.iconSurface && "icon-plain",
|
|
74
|
-
!
|
|
84
|
+
!I.value && "no-actions"
|
|
75
85
|
]
|
|
76
86
|
})
|
|
77
|
-
),
|
|
78
|
-
return (o,
|
|
79
|
-
class:
|
|
87
|
+
), w = () => y("open"), V = () => y("download"), $ = () => y("error");
|
|
88
|
+
return (o, B) => (r(), i("div", {
|
|
89
|
+
class: G(F.value)
|
|
80
90
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
default:
|
|
84
|
-
(r(),
|
|
91
|
+
c.value ? t("", !0) : (r(), i("div", ve, [
|
|
92
|
+
n(l(p), { size: "medium" }, {
|
|
93
|
+
default: m(() => [
|
|
94
|
+
(r(), T(U(M.value)))
|
|
85
95
|
]),
|
|
86
96
|
_: 1
|
|
87
97
|
}),
|
|
88
|
-
|
|
98
|
+
N.value && !e.loading && !e.error ? (r(), i("a", {
|
|
89
99
|
key: 0,
|
|
90
|
-
href:
|
|
100
|
+
href: A.value,
|
|
91
101
|
target: "_blank",
|
|
92
102
|
rel: "noopener noreferrer",
|
|
93
103
|
class: "nmorph-file-card__icon-action",
|
|
94
104
|
"aria-label": `Preview ${e.name}`,
|
|
95
|
-
onClick:
|
|
105
|
+
onClick: w
|
|
96
106
|
}, [
|
|
97
|
-
|
|
107
|
+
n(l(p), {
|
|
98
108
|
size: "small",
|
|
99
|
-
color:
|
|
109
|
+
color: Ae
|
|
100
110
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
|
|
111
|
+
default: m(() => [
|
|
112
|
+
n(l(de))
|
|
103
113
|
]),
|
|
104
114
|
_: 1
|
|
105
115
|
})
|
|
106
|
-
], 8,
|
|
107
|
-
]),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
], 8, he)) : t("", !0)
|
|
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, {
|
|
114
129
|
key: 0,
|
|
115
130
|
class: "nmorph-file-card__audio-preview",
|
|
116
131
|
src: e.previewSrc,
|
|
@@ -121,74 +136,91 @@ const pe = { class: "nmorph-file-card__icon" }, ue = ["href", "aria-label"], fe
|
|
|
121
136
|
"show-icon": !1,
|
|
122
137
|
"show-header": !1,
|
|
123
138
|
"show-default-actions": !1,
|
|
124
|
-
onError:
|
|
125
|
-
}, null, 8, ["src", "name"])) :
|
|
126
|
-
|
|
139
|
+
onError: $
|
|
140
|
+
}, null, 8, ["src", "name"])) : t("", !0),
|
|
141
|
+
v.value ? (r(), T(ne, {
|
|
127
142
|
key: 1,
|
|
128
143
|
class: "nmorph-file-card__video-preview",
|
|
129
144
|
src: e.previewSrc,
|
|
130
145
|
name: e.name,
|
|
131
|
-
height:
|
|
146
|
+
height: z.value,
|
|
132
147
|
surface: "plain",
|
|
133
148
|
embedded: "",
|
|
134
149
|
compact: "",
|
|
135
150
|
controls: !1,
|
|
136
151
|
"show-meta": !1,
|
|
137
152
|
"show-default-actions": !1,
|
|
138
|
-
|
|
139
|
-
|
|
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)
|
|
140
171
|
]),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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", {
|
|
145
177
|
key: 0,
|
|
146
178
|
class: "nmorph-file-card__action-loader",
|
|
147
179
|
role: "status",
|
|
148
180
|
"aria-label": `Uploading ${e.name}`
|
|
149
181
|
}, [
|
|
150
|
-
|
|
151
|
-
default:
|
|
152
|
-
|
|
182
|
+
n(l(p), { size: "small" }, {
|
|
183
|
+
default: m(() => [
|
|
184
|
+
n(l(ue))
|
|
153
185
|
]),
|
|
154
186
|
_: 1
|
|
155
187
|
})
|
|
156
|
-
], 8,
|
|
188
|
+
], 8, Te)) : e.previewSrc && !_.value && !N.value ? (r(), i("a", {
|
|
157
189
|
key: 1,
|
|
158
190
|
href: e.previewSrc,
|
|
159
191
|
target: "_blank",
|
|
160
192
|
rel: "noopener noreferrer",
|
|
161
193
|
class: "nmorph-file-card__action-link",
|
|
162
194
|
"aria-label": `Open ${e.name}`,
|
|
163
|
-
onClick:
|
|
195
|
+
onClick: w
|
|
164
196
|
}, [
|
|
165
|
-
|
|
166
|
-
default:
|
|
167
|
-
|
|
197
|
+
n(l(p), { size: "small" }, {
|
|
198
|
+
default: m(() => [
|
|
199
|
+
n(l(pe))
|
|
168
200
|
]),
|
|
169
201
|
_: 1
|
|
170
202
|
})
|
|
171
|
-
], 8,
|
|
172
|
-
!e.loading && e.downloadHref ? (r(),
|
|
203
|
+
], 8, xe)) : t("", !0),
|
|
204
|
+
!e.loading && e.downloadHref ? (r(), i("a", {
|
|
173
205
|
key: 2,
|
|
174
206
|
href: e.downloadHref,
|
|
175
207
|
download: e.name,
|
|
176
208
|
class: "nmorph-file-card__action-link",
|
|
177
209
|
"aria-label": `Download ${e.name}`,
|
|
178
|
-
onClick:
|
|
210
|
+
onClick: V
|
|
179
211
|
}, [
|
|
180
|
-
|
|
181
|
-
default:
|
|
182
|
-
|
|
212
|
+
n(l(p), { size: "small" }, {
|
|
213
|
+
default: m(() => [
|
|
214
|
+
n(l(fe))
|
|
183
215
|
]),
|
|
184
216
|
_: 1
|
|
185
217
|
})
|
|
186
|
-
], 8,
|
|
218
|
+
], 8, Pe)) : t("", !0)
|
|
187
219
|
])
|
|
188
|
-
])) :
|
|
220
|
+
])) : t("", !0)
|
|
189
221
|
], 2));
|
|
190
222
|
}
|
|
191
223
|
});
|
|
192
224
|
export {
|
|
193
|
-
|
|
225
|
+
Qe as default
|
|
194
226
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-image-preview{--width: 50px;--height: 50px;--nmorph-image-preview-radius: var(--default-border-radius);width:var(--width);height:var(--height);overflow:hidden;border-radius:var(--nmorph-image-preview-radius)}.nmorph-image-preview .nmorph-image-preview__trigger{position:relative;width:100%;height:100%;cursor:pointer}.nmorph-image-preview .nmorph-image-preview__trigger:hover{filter:brightness(.8)}.nmorph-image-preview .nmorph-image-preview__trigger .nmorph-image{width:100%;height:100%}.nmorph-image-preview.nmorph-image-preview--gallery-trigger{width:auto;height:auto;overflow:visible}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger{display:flex;flex-wrap:wrap;gap:var(--nmorph-image-preview-trigger-gap, 8px);width:auto;height:auto}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger:hover{filter:none}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item{position:relative;display:block;width:var(--width);height:var(--height);padding:0;overflow:hidden;color:inherit;font:inherit;background:transparent;border:0;border-radius:var(--nmorph-image-preview-radius);cursor:pointer}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item:hover{filter:brightness(.8)}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item .nmorph-image{width:100%;height:100%}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-more{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:var(--nmorph-white-color);font-weight:600;line-height:var(--line-height-regular);background:color-mix(in srgb,var(--nmorph-black-color) 60%,transparent);pointer-events:none}.nmorph-image-preview__portal{display:contents}.nmorph-image-preview__portal .nmorph-image-preview__content
|
|
1
|
+
.nmorph-image-preview{--width: 50px;--height: 50px;--nmorph-image-preview-radius: var(--default-border-radius);width:var(--width);height:var(--height);overflow:hidden;border-radius:var(--nmorph-image-preview-radius)}.nmorph-image-preview .nmorph-image-preview__trigger{position:relative;width:100%;height:100%;cursor:pointer}.nmorph-image-preview .nmorph-image-preview__trigger:hover{filter:brightness(.8)}.nmorph-image-preview .nmorph-image-preview__trigger .nmorph-image{width:100%;height:100%}.nmorph-image-preview.nmorph-image-preview--gallery-trigger{width:auto;height:auto;overflow:visible}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger{display:flex;flex-wrap:wrap;gap:var(--nmorph-image-preview-trigger-gap, 8px);width:auto;height:auto}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger:hover{filter:none}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item{position:relative;display:block;width:var(--width);height:var(--height);padding:0;overflow:hidden;color:inherit;font:inherit;background:transparent;border:0;border-radius:var(--nmorph-image-preview-radius);cursor:pointer}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item:hover{filter:brightness(.8)}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-item .nmorph-image{width:100%;height:100%}.nmorph-image-preview.nmorph-image-preview--gallery-trigger .nmorph-image-preview__trigger-more{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:var(--nmorph-white-color);font-weight:600;line-height:var(--line-height-regular);background:color-mix(in srgb,var(--nmorph-black-color) 60%,transparent);pointer-events:none}.nmorph-image-preview__portal{display:contents}.nmorph-image-preview__portal .nmorph-image-preview__content .nmorph-image{width:100%;height:100%;pointer-events:none}.nmorph-image-preview__portal .nmorph-image-preview__content .nmorph-image img{display:block;width:auto;max-width:100%;height:auto;max-height:100%;object-fit:contain;pointer-events:auto}.nmorph-image-preview__portal .nmorph-image-preview__action-element{margin-right:var(--indentation-03)}
|