@nmorph/nmorph-ui-kit 2.2.54 → 2.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/nmorph-file-card/NmorphFileCard.css +1 -1
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue.js +26 -25
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +291 -275
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +141 -125
- package/dist/index.umd.js +20 -20
- package/dist/package.json.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +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%;height:var(--nmorph-file-card-height, auto);min-height:var(--nmorph-file-card-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:var(--nmorph-file-card-media-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:var(--nmorph-file-card-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:var(--nmorph-file-card-media-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;height:100%}.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:var(--nmorph-file-card-media-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
|
+
.nmorph-file-card{display:flex;gap:var(--indentation-03);align-items:center;box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:var(--nmorph-file-card-height, auto);min-height:var(--nmorph-file-card-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:var(--nmorph-file-card-media-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--custom-actions,.nmorph-file-card.nmorph-file-card--compact{position:relative;padding-inline-end:calc(var(--indentation-03) + 44px + var(--indentation-01))}.nmorph-file-card.nmorph-file-card--custom-actions .nmorph-file-card__actions,.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__actions{position:absolute;top:var(--indentation-03);right:var(--indentation-03);z-index:3}.nmorph-file-card.nmorph-file-card--compact{min-height:var(--nmorph-file-card-height, 52px);padding:var(--indentation-02);padding-inline-end:calc(var(--indentation-02) + 44px + var(--indentation-01))}.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:var(--nmorph-file-card-media-height, 96px);margin-top:0}.nmorph-file-card.nmorph-file-card--compact .nmorph-file-card__actions{top:var(--indentation-02);right:var(--indentation-02)}.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;padding-inline-end:0;overflow:hidden}.nmorph-file-card.nmorph-file-card--media-visual .nmorph-file-card__body{position:relative;display:block;width:100%;min-width:0;height:100%}.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:var(--nmorph-file-card-media-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,5 +1,5 @@
|
|
|
1
1
|
import './NmorphFileCard.css';
|
|
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
|
|
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 k, resolveDynamicComponent as ae, createCommentVNode as l, toDisplayString as h, renderSlot as re } from "vue";
|
|
3
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
4
|
import { useModifiers as ce } from "../../../utils/create-modifiers.js";
|
|
5
5
|
import { createCssSizeVariables as me } from "../../../utils/common.js";
|
|
@@ -69,19 +69,19 @@ const Se = {
|
|
|
69
69
|
},
|
|
70
70
|
emits: ["open", "download", "error"],
|
|
71
71
|
setup(L, { emit: R }) {
|
|
72
|
-
const e = L,
|
|
72
|
+
const e = L, B = R, F = Y(), N = 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
73
|
if (r === void 0 || Number.isNaN(r) || r < 0) return "";
|
|
74
74
|
if (r === 0) return "0 B";
|
|
75
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
76
|
return `${z.toFixed(Q)} ${p[f]}`;
|
|
77
|
-
},
|
|
78
|
-
() =>
|
|
77
|
+
}, S = o(() => e.showSize ? G(e.size) : ""), K = o(() => y.value || e.mimeType), C = o(() => [K.value, S.value].filter(Boolean).join(" · ")), P = 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
|
+
() => P.value || m.value || u.value
|
|
79
79
|
), s = o(() => m.value || u.value), H = o(() => e.height ?? (e.compact ? "96px" : "120px")), U = o(
|
|
80
80
|
() => me({
|
|
81
81
|
"--nmorph-file-card-height": e.height,
|
|
82
82
|
"--nmorph-file-card-media-height": H.value
|
|
83
83
|
})
|
|
84
|
-
), j = o(() => s.value ? e.showName : e.showName || e.showMeta && !!(e.error && e.errorText ||
|
|
84
|
+
), j = o(() => s.value ? e.showName : e.showName || e.showMeta && !!(e.error && e.errorText || C.value)), A = o(() => !e.previewSrc || e.loading || e.error ? [] : u.value ? [
|
|
85
85
|
{
|
|
86
86
|
kind: "image",
|
|
87
87
|
src: e.previewSrc,
|
|
@@ -102,11 +102,11 @@ const Se = {
|
|
|
102
102
|
preload: "metadata"
|
|
103
103
|
}
|
|
104
104
|
] : []), q = o(
|
|
105
|
-
() => e.previewMode === "internal" &&
|
|
106
|
-
), M = o(() => e.mimeType.toLowerCase() === "application/pdf" || y.value === "pdf"), D = o(() => M.value ? e.previewSrc || e.downloadHref : ""),
|
|
105
|
+
() => e.previewMode === "internal" && A.value.length > 0
|
|
106
|
+
), M = o(() => e.mimeType.toLowerCase() === "application/pdf" || y.value === "pdf"), D = o(() => M.value ? e.previewSrc || e.downloadHref : ""), T = o(
|
|
107
107
|
() => e.showDefaultActions && !!D.value && !g.value && M.value
|
|
108
|
-
),
|
|
109
|
-
() =>
|
|
108
|
+
), b = o(() => !!F.actions), $ = o(
|
|
109
|
+
() => b.value || e.showDefaultActions && (e.loading || e.previewSrc && !g.value && !T.value || e.downloadHref)
|
|
110
110
|
), J = o(
|
|
111
111
|
() => ce({
|
|
112
112
|
"nmorph-file-card": [
|
|
@@ -115,17 +115,18 @@ const Se = {
|
|
|
115
115
|
e.loading && "loading",
|
|
116
116
|
e.error && "error",
|
|
117
117
|
g.value && "media",
|
|
118
|
-
|
|
118
|
+
P.value && "media-audio",
|
|
119
119
|
m.value && "media-video",
|
|
120
120
|
u.value && "media-image",
|
|
121
121
|
s.value && "media-visual",
|
|
122
|
+
b.value && "custom-actions",
|
|
122
123
|
!e.iconSurface && "icon-plain",
|
|
123
124
|
!$.value && "no-actions"
|
|
124
125
|
]
|
|
125
126
|
})
|
|
126
127
|
), d = () => {
|
|
127
|
-
q.value && (
|
|
128
|
-
}, x = () =>
|
|
128
|
+
q.value && (N.value = !0), e.previewMode !== "none" && B("open");
|
|
129
|
+
}, x = () => B("download"), O = () => B("error");
|
|
129
130
|
return (r, p) => (a(), t(V, null, [
|
|
130
131
|
I("div", {
|
|
131
132
|
class: oe(J.value),
|
|
@@ -134,11 +135,11 @@ const Se = {
|
|
|
134
135
|
s.value ? l("", !0) : (a(), t("div", Se, [
|
|
135
136
|
n(i(_), { size: "medium" }, {
|
|
136
137
|
default: v(() => [
|
|
137
|
-
(a(),
|
|
138
|
+
(a(), k(ae(W.value)))
|
|
138
139
|
]),
|
|
139
140
|
_: 1
|
|
140
141
|
}),
|
|
141
|
-
|
|
142
|
+
T.value && !e.loading && !e.error ? (a(), t("a", {
|
|
142
143
|
key: 0,
|
|
143
144
|
href: D.value,
|
|
144
145
|
target: "_blank",
|
|
@@ -166,10 +167,10 @@ const Se = {
|
|
|
166
167
|
}, [
|
|
167
168
|
e.showName ? (a(), t("span", Te, h(e.name), 1)) : l("", !0),
|
|
168
169
|
!s.value && e.showMeta ? (a(), t(V, { key: 1 }, [
|
|
169
|
-
e.error && e.errorText ? (a(), t("span", xe, h(e.errorText), 1)) :
|
|
170
|
+
e.error && e.errorText ? (a(), t("span", xe, h(e.errorText), 1)) : C.value ? (a(), t("span", ze, h(C.value), 1)) : l("", !0)
|
|
170
171
|
], 64)) : l("", !0)
|
|
171
172
|
], 8, Ae)) : l("", !0),
|
|
172
|
-
|
|
173
|
+
P.value ? (a(), k(fe, {
|
|
173
174
|
key: 1,
|
|
174
175
|
class: "nmorph-file-card__audio-preview",
|
|
175
176
|
src: e.previewSrc,
|
|
@@ -183,7 +184,7 @@ const Se = {
|
|
|
183
184
|
"show-default-actions": !1,
|
|
184
185
|
onError: O
|
|
185
186
|
}, null, 8, ["src", "name", "show-playback-button"])) : l("", !0),
|
|
186
|
-
m.value ? (a(),
|
|
187
|
+
m.value ? (a(), k(he, {
|
|
187
188
|
key: 2,
|
|
188
189
|
class: "nmorph-file-card__video-preview",
|
|
189
190
|
src: e.previewSrc,
|
|
@@ -196,8 +197,8 @@ const Se = {
|
|
|
196
197
|
"show-meta": !1,
|
|
197
198
|
"show-playback-button": e.showPlaybackButton,
|
|
198
199
|
"show-default-actions": !1,
|
|
199
|
-
"show-preview-action": !
|
|
200
|
-
"show-fullscreen-action": !
|
|
200
|
+
"show-preview-action": !b.value && e.showDefaultActions && e.previewMode !== "none",
|
|
201
|
+
"show-fullscreen-action": !b.value && e.showDefaultActions,
|
|
201
202
|
"preview-mode": "emit",
|
|
202
203
|
onError: O,
|
|
203
204
|
onPreview: d
|
|
@@ -217,7 +218,7 @@ const Se = {
|
|
|
217
218
|
}, null, 8, He)
|
|
218
219
|
], 8, Ie)) : l("", !0)
|
|
219
220
|
]),
|
|
220
|
-
s.value &&
|
|
221
|
+
s.value && S.value ? (a(), t("span", Me, h(S.value), 1)) : l("", !0),
|
|
221
222
|
e.showExtensionBadge && y.value && !s.value ? (a(), t("span", De, h(y.value), 1)) : l("", !0),
|
|
222
223
|
$.value ? (a(), t("div", $e, [
|
|
223
224
|
re(r.$slots, "actions", {
|
|
@@ -239,7 +240,7 @@ const Se = {
|
|
|
239
240
|
]),
|
|
240
241
|
_: 1
|
|
241
242
|
})
|
|
242
|
-
], 8, Oe)) : e.previewSrc && !g.value && !
|
|
243
|
+
], 8, Oe)) : e.previewSrc && !g.value && !T.value ? (a(), t("a", {
|
|
243
244
|
key: 1,
|
|
244
245
|
href: e.previewSrc,
|
|
245
246
|
target: "_blank",
|
|
@@ -273,11 +274,11 @@ const Se = {
|
|
|
273
274
|
])
|
|
274
275
|
])) : l("", !0)
|
|
275
276
|
], 6),
|
|
276
|
-
|
|
277
|
+
A.value.length > 0 ? (a(), k(ve, {
|
|
277
278
|
key: 0,
|
|
278
|
-
modelValue:
|
|
279
|
-
"onUpdate:modelValue": p[0] || (p[0] = (f) =>
|
|
280
|
-
items:
|
|
279
|
+
modelValue: N.value,
|
|
280
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => N.value = f),
|
|
281
|
+
items: A.value,
|
|
281
282
|
"show-navigation-buttons": !1,
|
|
282
283
|
"show-file-name": e.showName,
|
|
283
284
|
"show-file-size": e.showSize,
|