@nmorph/nmorph-ui-kit 3.0.1 → 3.0.3
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/assets/icons/external-link.svg.js +2 -2
- package/dist/assets/icons/hand.svg.js +30 -9
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue.js +5 -4
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +143 -124
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.css +1 -1
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.js +10 -10
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue2.js +24 -24
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -1
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +28 -26
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +60 -59
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +28 -26
- package/dist/components/data/nmorph-image/NmorphImage.vue.js +22 -20
- package/dist/components/data/nmorph-image/NmorphImage.vue2.js +24 -18
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +17 -10
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.css +1 -1
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +100 -70
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue2.js +158 -137
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.css +1 -1
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.js +17 -13
- package/dist/components/data/nmorph-progress/NmorphProgress.css +1 -1
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +6 -6
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue2.js +8 -8
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +12 -11
- package/dist/index.umd.js +45 -45
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -0
- package/dist/src/components/data/nmorph-avatar/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-image/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-media-gallery/types.d.ts +10 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import './NmorphMediaGallery.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { createCssSizeVariables as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
2
|
+
import { defineComponent as Ae, ref as c, computed as a, watch as F, onBeforeUnmount as Re } from "vue";
|
|
3
|
+
import { useModifiers as Y } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as Pe } from "../../../utils/common.js";
|
|
5
|
+
import Ve from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
|
|
6
|
+
import Me from "../nmorph-image/NmorphImage.vue.js";
|
|
7
|
+
import Le from "../../../assets/icons/full-screen.svg.js";
|
|
8
|
+
import De from "../../../assets/icons/eye.svg.js";
|
|
9
|
+
import _e from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
|
+
import Ce from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
11
|
+
import Ee from "../../../assets/icons/zoom-out.svg.js";
|
|
12
|
+
import ze from "../../../assets/icons/zoom-in.svg.js";
|
|
13
|
+
import Ke from "../../../assets/icons/shrink.svg.js";
|
|
14
|
+
import $e from "../../../assets/icons/rotate-right.svg.js";
|
|
15
|
+
import Oe from "../../../assets/icons/rotate-left.svg.js";
|
|
16
|
+
import Ze from "../../../assets/icons/play.svg.js";
|
|
17
|
+
import Ue from "../../../assets/icons/enlarge.svg.js";
|
|
18
|
+
import Xe from "../../../assets/icons/download.svg.js";
|
|
19
|
+
const G = 45, ft = /* @__PURE__ */ Ae({
|
|
20
20
|
__name: "NmorphMediaGallery",
|
|
21
21
|
props: {
|
|
22
22
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -35,6 +35,10 @@ const Y = 45, dt = /* @__PURE__ */ He({
|
|
|
35
35
|
showTriggerFullscreenAction: { type: Boolean, required: !1, default: !0 },
|
|
36
36
|
showTriggerDownloadAction: { type: Boolean, required: !1, default: !0 },
|
|
37
37
|
showTriggerPlayButton: { type: Boolean, required: !1, default: !0 },
|
|
38
|
+
triggerImageFit: { type: String, required: !1, default: "cover" },
|
|
39
|
+
triggerVideoFit: { type: String, required: !1, default: "cover" },
|
|
40
|
+
triggerItemClass: { type: Function, required: !1 },
|
|
41
|
+
triggerItemStyle: { type: Function, required: !1 },
|
|
38
42
|
showNavigationButtons: { type: Boolean, required: !1, default: !0 },
|
|
39
43
|
showActionBar: { type: Boolean, required: !1, default: !0 },
|
|
40
44
|
showFileName: { type: Boolean, required: !1, default: !0 },
|
|
@@ -45,105 +49,115 @@ const Y = 45, dt = /* @__PURE__ */ He({
|
|
|
45
49
|
videoFit: { type: String, required: !1, default: "contain" }
|
|
46
50
|
},
|
|
47
51
|
emits: ["update:model-value", "update:active-index", "close", "change", "download", "fullscreen"],
|
|
48
|
-
setup(
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
const t =
|
|
52
|
+
setup(W, { expose: j, emit: J }) {
|
|
53
|
+
j();
|
|
54
|
+
const r = W, l = J, v = c(r.modelValue), m = c(0), h = c(null), q = c({}), y = c(null), i = c(!1), f = c(1), u = c(0), g = c(null), I = c(!1), s = a(() => r.items || []), x = a(() => s.value.length > 1), M = a(() => r.showNavigationButtons && x.value), p = (e) => {
|
|
55
|
+
const t = s.value.length - 1;
|
|
52
56
|
return t < 0 || !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e;
|
|
53
|
-
}, d =
|
|
54
|
-
() =>
|
|
55
|
-
),
|
|
56
|
-
() =>
|
|
57
|
-
),
|
|
58
|
-
() =>
|
|
59
|
-
),
|
|
60
|
-
() =>
|
|
61
|
-
),
|
|
62
|
-
() =>
|
|
63
|
-
), ne =
|
|
64
|
-
() =>
|
|
57
|
+
}, d = a(() => p(m.value)), o = a(() => s.value[d.value]), B = a(() => o.value?.kind === "image"), w = a(() => o.value?.kind === "video"), L = a(
|
|
58
|
+
() => o.value?.kind === "video" ? o.value.controls !== !1 : !1
|
|
59
|
+
), Q = a(() => o.value?.kind === "video" ? o.value.muted === !0 : !1), ee = a(
|
|
60
|
+
() => o.value?.kind === "video" ? o.value.playsinline !== !1 : !0
|
|
61
|
+
), te = a(
|
|
62
|
+
() => o.value?.kind === "video" && o.value.preload || "metadata"
|
|
63
|
+
), re = a(
|
|
64
|
+
() => o.value?.kind === "video" && o.value.name || "video"
|
|
65
|
+
), D = a(() => o.value?.name || ""), oe = a(() => r.showFileName ? D.value : ""), _ = a(() => o.value?.downloadHref || ""), C = a(() => r.showFileActions && w.value && !L.value), ae = a(
|
|
66
|
+
() => r.showFileActions && (C.value || !!_.value)
|
|
67
|
+
), ne = a(
|
|
68
|
+
() => Y({
|
|
65
69
|
"nmorph-media-gallery": [
|
|
66
70
|
v.value && "opened",
|
|
67
71
|
B.value && "image",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
w.value && "video",
|
|
73
|
+
i.value && w.value && "video-playing",
|
|
74
|
+
r.imageFit === "cover" && B.value && "image-cover",
|
|
75
|
+
r.videoFit === "cover" && w.value && "video-cover"
|
|
72
76
|
]
|
|
73
77
|
})
|
|
74
|
-
),
|
|
75
|
-
(
|
|
76
|
-
"--nmorph-private-media-gallery-trigger-height":
|
|
78
|
+
), le = a(() => `rotate(${u.value}deg) scale(${f.value})`), ie = a(() => ({
|
|
79
|
+
...Pe({
|
|
80
|
+
"--nmorph-private-media-gallery-trigger-height": r.height
|
|
81
|
+
}),
|
|
82
|
+
"--nmorph-private-media-gallery-trigger-video-fit": r.triggerVideoFit
|
|
83
|
+
})), ue = a(
|
|
84
|
+
() => Y({
|
|
85
|
+
"nmorph-media-gallery__trigger": [r.height !== void 0 && "fixed-height"]
|
|
77
86
|
})
|
|
78
|
-
),
|
|
79
|
-
() => X({
|
|
80
|
-
"nmorph-media-gallery__trigger": [o.height !== void 0 && "fixed-height"]
|
|
81
|
-
})
|
|
82
|
-
), q = (e) => {
|
|
87
|
+
), S = (e) => {
|
|
83
88
|
if (e === void 0 || Number.isNaN(e) || e < 0) return "";
|
|
84
89
|
if (e === 0) return "0 B";
|
|
85
|
-
const t = ["B", "KB", "MB", "GB", "TB"],
|
|
86
|
-
return `${
|
|
87
|
-
},
|
|
88
|
-
|
|
90
|
+
const t = ["B", "KB", "MB", "GB", "TB"], n = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), V = e / 1024 ** n, He = V >= 10 || n === 0 || Number.isInteger(V) ? 0 : 1;
|
|
91
|
+
return `${V.toFixed(He)} ${t[n]}`;
|
|
92
|
+
}, se = a(() => r.showFileSize ? S(o.value?.size) : ""), de = (e) => e.name || "", ce = (e, t) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${t + 1}`, ve = (e) => S(e.size), E = (e) => e.downloadHref || "", z = (e) => r.showTriggerPreviewAction && e.kind === "video", K = (e) => r.showTriggerFullscreenAction && e.kind === "video", $ = (e) => r.showTriggerDownloadAction && !!E(e), fe = (e) => r.showTriggerActions && (z(e) || K(e) || $(e)), me = (e, t) => {
|
|
93
|
+
q.value[e] = t instanceof HTMLVideoElement ? t : null;
|
|
94
|
+
}, ge = (e, t) => [
|
|
95
|
+
e.itemClass,
|
|
96
|
+
r.triggerItemClass?.(e, t)
|
|
97
|
+
], pe = (e, t) => {
|
|
98
|
+
const n = {
|
|
99
|
+
...e.itemStyle || {},
|
|
100
|
+
...r.triggerItemStyle?.(e, t) || {}
|
|
101
|
+
};
|
|
102
|
+
return typeof e.aspectRatio == "number" && Number.isFinite(e.aspectRatio) && e.aspectRatio > 0 && (n.aspectRatio = String(e.aspectRatio)), n;
|
|
89
103
|
};
|
|
90
|
-
|
|
91
|
-
() =>
|
|
104
|
+
F(
|
|
105
|
+
() => r.modelValue,
|
|
92
106
|
(e) => {
|
|
93
107
|
v.value = e;
|
|
94
108
|
}
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
109
|
+
), F(
|
|
110
|
+
() => r.activeIndex,
|
|
97
111
|
(e) => {
|
|
98
|
-
typeof e == "number" && (m.value =
|
|
112
|
+
typeof e == "number" && (m.value = p(e));
|
|
99
113
|
},
|
|
100
114
|
{ immediate: !0 }
|
|
101
|
-
),
|
|
102
|
-
() => [
|
|
115
|
+
), F(
|
|
116
|
+
() => [r.initialIndex, s.value.length],
|
|
103
117
|
() => {
|
|
104
|
-
typeof
|
|
118
|
+
typeof r.activeIndex != "number" && (m.value = p(r.initialIndex));
|
|
105
119
|
},
|
|
106
120
|
{ immediate: !0 }
|
|
107
|
-
),
|
|
108
|
-
() => [
|
|
121
|
+
), F(
|
|
122
|
+
() => [o.value?.kind, o.value?.src, d.value],
|
|
109
123
|
() => {
|
|
110
|
-
|
|
124
|
+
i.value = !1, y.value = null;
|
|
111
125
|
}
|
|
112
126
|
);
|
|
113
|
-
const
|
|
114
|
-
!h.value || h.value === y.value || (h.value.pause(),
|
|
127
|
+
const N = () => {
|
|
128
|
+
!h.value || h.value === y.value || (h.value.pause(), i.value = !1, y.value = h.value);
|
|
115
129
|
}, b = () => {
|
|
116
|
-
f.value = 1,
|
|
117
|
-
},
|
|
118
|
-
if (!
|
|
119
|
-
const t =
|
|
130
|
+
f.value = 1, u.value = 0;
|
|
131
|
+
}, T = (e) => {
|
|
132
|
+
if (!s.value.length) return;
|
|
133
|
+
const t = p(e);
|
|
120
134
|
if (t === d.value) return;
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
135
|
+
N(), i.value = !1, m.value = t, b(), l("update:active-index", t);
|
|
136
|
+
const n = s.value[t];
|
|
137
|
+
n && l("change", n, t);
|
|
138
|
+
}, k = () => {
|
|
139
|
+
const e = s.value.length;
|
|
140
|
+
e && T(d.value === 0 ? e - 1 : d.value - 1);
|
|
124
141
|
}, H = () => {
|
|
125
|
-
const e =
|
|
126
|
-
e &&
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
s && a("change", s, t);
|
|
136
|
-
}, $ = () => {
|
|
137
|
-
v.value && (w(), v.value = !1, a("update:model-value", !1), a("close"));
|
|
138
|
-
}, pe = () => {
|
|
139
|
-
i.value = i.value + 90, i.value >= 360 && (i.value = 0);
|
|
140
|
-
}, ge = () => {
|
|
141
|
-
i.value = i.value - 90, i.value <= -360 && (i.value = 0);
|
|
142
|
-
}, he = () => {
|
|
143
|
-
f.value = parseFloat(Math.min(f.value + 0.2, 4).toFixed(3));
|
|
142
|
+
const e = s.value.length;
|
|
143
|
+
e && T(d.value === e - 1 ? 0 : d.value + 1);
|
|
144
|
+
}, he = (e) => {
|
|
145
|
+
if (!s.value.length) return;
|
|
146
|
+
const t = p(e);
|
|
147
|
+
N(), i.value = !1, m.value = t, b(), I.value = !0, v.value = !0, l("update:model-value", !0), l("update:active-index", t);
|
|
148
|
+
const n = s.value[t];
|
|
149
|
+
n && l("change", n, t);
|
|
150
|
+
}, O = () => {
|
|
151
|
+
v.value && (N(), v.value = !1, l("update:model-value", !1), l("close"));
|
|
144
152
|
}, ye = () => {
|
|
145
|
-
|
|
153
|
+
u.value = u.value + 90, u.value >= 360 && (u.value = 0);
|
|
146
154
|
}, Ie = () => {
|
|
155
|
+
u.value = u.value - 90, u.value <= -360 && (u.value = 0);
|
|
156
|
+
}, we = () => {
|
|
157
|
+
f.value = parseFloat(Math.min(f.value + 0.2, 4).toFixed(3));
|
|
158
|
+
}, Ne = () => {
|
|
159
|
+
f.value = parseFloat(Math.max(f.value - 0.2, 0.2).toFixed(3));
|
|
160
|
+
}, Fe = () => {
|
|
147
161
|
f.value = 1;
|
|
148
162
|
}, A = async (e) => {
|
|
149
163
|
if (e)
|
|
@@ -156,83 +170,90 @@ const Y = 45, dt = /* @__PURE__ */ He({
|
|
|
156
170
|
e.webkitEnterFullscreen?.();
|
|
157
171
|
} catch {
|
|
158
172
|
}
|
|
159
|
-
},
|
|
160
|
-
!
|
|
161
|
-
},
|
|
162
|
-
e.kind === "video" && (
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
}, Fe = () => {
|
|
166
|
-
r.value && O(r.value, d.value);
|
|
167
|
-
}, xe = () => {
|
|
168
|
-
l.value = !0, y.value = null;
|
|
173
|
+
}, qe = async () => {
|
|
174
|
+
!o.value || o.value.kind !== "video" || (l("fullscreen", o.value, d.value), await A(h.value));
|
|
175
|
+
}, xe = async (e, t) => {
|
|
176
|
+
e.kind === "video" && (l("fullscreen", e, t), await A(q.value[t]));
|
|
177
|
+
}, Z = (e, t) => {
|
|
178
|
+
l("download", e, t);
|
|
169
179
|
}, Be = () => {
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
|
|
180
|
+
o.value && Z(o.value, d.value);
|
|
181
|
+
}, Se = () => {
|
|
182
|
+
i.value = !0, y.value = null;
|
|
173
183
|
}, be = () => {
|
|
174
|
-
|
|
175
|
-
},
|
|
184
|
+
i.value = !1;
|
|
185
|
+
}, Te = () => {
|
|
186
|
+
i.value = !1;
|
|
187
|
+
}, ke = () => {
|
|
188
|
+
i.value = !1;
|
|
189
|
+
}, R = (e) => {
|
|
176
190
|
if (v.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
|
|
177
191
|
if (e.key === "Escape") {
|
|
178
|
-
e.preventDefault(),
|
|
192
|
+
e.preventDefault(), O();
|
|
179
193
|
return;
|
|
180
194
|
}
|
|
181
|
-
x.value && (e.key === "ArrowLeft" && (e.preventDefault(),
|
|
195
|
+
x.value && (e.key === "ArrowLeft" && (e.preventDefault(), k()), e.key === "ArrowRight" && (e.preventDefault(), H()));
|
|
182
196
|
}
|
|
183
|
-
},
|
|
184
|
-
typeof document > "u" || document.addEventListener("keydown",
|
|
197
|
+
}, U = () => {
|
|
198
|
+
typeof document > "u" || document.addEventListener("keydown", R);
|
|
185
199
|
}, P = () => {
|
|
186
|
-
typeof document > "u" || document.removeEventListener("keydown",
|
|
200
|
+
typeof document > "u" || document.removeEventListener("keydown", R);
|
|
187
201
|
};
|
|
188
|
-
|
|
202
|
+
F(
|
|
189
203
|
v,
|
|
190
204
|
(e) => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
205
|
+
if (e) {
|
|
206
|
+
if (U(), y.value = null, I.value) {
|
|
207
|
+
I.value = !1;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
m.value = p(
|
|
211
|
+
typeof r.activeIndex == "number" ? r.activeIndex : r.initialIndex
|
|
212
|
+
);
|
|
213
|
+
} else
|
|
214
|
+
I.value = !1, N(), i.value = !1, P();
|
|
194
215
|
},
|
|
195
216
|
{ immediate: !0 }
|
|
196
|
-
),
|
|
197
|
-
const
|
|
198
|
-
|
|
217
|
+
), Re(P);
|
|
218
|
+
const X = { SWIPE_THRESHOLD: G, props: r, emit: l, open: v, currentIndex: m, currentVideoRef: h, triggerVideoRefs: q, pausedVideoRef: y, videoPlaying: i, scaleLevel: f, rotateLevel: u, pointerStart: g, openingFromTrigger: I, sourceList: s, multipleItems: x, showNavigation: M, getClampedIndex: p, resolvedCurrentIndex: d, currentItem: o, isImage: B, isVideo: w, videoControls: L, videoMuted: Q, videoPlaysinline: ee, videoPreload: te, currentVideoName: re, currentItemName: D, currentName: oe, currentDownloadHref: _, showVideoFullscreenAction: C, showFileActions: ae, modifiers: ne, imageTransform: le, triggerStyle: ie, triggerModifiers: ue, formatSize: S, currentSize: se, getItemName: de, getItemLabel: ce, getItemSize: ve, getItemDownloadHref: E, showTriggerPreviewActionForItem: z, showTriggerFullscreenActionForItem: K, showTriggerDownloadActionForItem: $, showTriggerActionsForItem: fe, setTriggerVideoRef: me, getTriggerItemClass: ge, getTriggerItemStyle: pe, pauseCurrentVideo: N, resetImageTransform: b, setCurrentIndex: T, previousHandler: k, nextHandler: H, openPreviewAt: he, closeHandler: O, rotateRight: ye, rotateLeft: Ie, zoomIn: we, zoomOut: Ne, toggleNormalSize: Fe, requestVideoFullscreen: A, fullscreenHandler: qe, triggerFullscreenHandler: xe, downloadItemHandler: Z, downloadHandler: Be, videoPlayHandler: Se, videoPauseHandler: be, videoEndedHandler: Te, videoErrorHandler: ke, keyboardNavigationHandler: R, addKeyboardNavigationListener: U, removeKeyboardNavigationListener: P, pointerDownHandler: (e) => {
|
|
219
|
+
g.value = { x: e.clientX, y: e.clientY };
|
|
199
220
|
}, pointerUpHandler: (e) => {
|
|
200
|
-
if (!
|
|
201
|
-
|
|
221
|
+
if (!g.value || !M.value) {
|
|
222
|
+
g.value = null;
|
|
202
223
|
return;
|
|
203
224
|
}
|
|
204
|
-
const t = e.clientX -
|
|
205
|
-
|
|
225
|
+
const t = e.clientX - g.value.x, n = e.clientY - g.value.y;
|
|
226
|
+
g.value = null, !(Math.abs(t) < G || Math.abs(t) < Math.abs(n) * 1.2) && (t > 0 ? k() : H());
|
|
206
227
|
}, get NmorphButton() {
|
|
207
|
-
return
|
|
228
|
+
return Ce;
|
|
208
229
|
}, get NmorphIcon() {
|
|
209
|
-
return
|
|
230
|
+
return _e;
|
|
210
231
|
}, get NmorphIconDownload() {
|
|
211
|
-
return
|
|
232
|
+
return Xe;
|
|
212
233
|
}, get NmorphIconEnlarge() {
|
|
213
|
-
return
|
|
234
|
+
return Ue;
|
|
214
235
|
}, get NmorphIconEye() {
|
|
215
|
-
return
|
|
236
|
+
return De;
|
|
216
237
|
}, get NmorphIconFullScreen() {
|
|
217
|
-
return
|
|
238
|
+
return Le;
|
|
218
239
|
}, get NmorphIconPlay() {
|
|
219
|
-
return
|
|
240
|
+
return Ze;
|
|
220
241
|
}, get NmorphIconRotateLeft() {
|
|
221
|
-
return
|
|
242
|
+
return Oe;
|
|
222
243
|
}, get NmorphIconRotateRight() {
|
|
223
|
-
return
|
|
244
|
+
return $e;
|
|
224
245
|
}, get NmorphIconShrink() {
|
|
225
|
-
return
|
|
246
|
+
return Ke;
|
|
226
247
|
}, get NmorphIconZoomIn() {
|
|
227
|
-
return
|
|
248
|
+
return ze;
|
|
228
249
|
}, get NmorphIconZoomOut() {
|
|
229
|
-
return
|
|
250
|
+
return Ee;
|
|
230
251
|
}, get NmorphImage() {
|
|
231
|
-
return
|
|
232
|
-
}, NmorphPreviewPortal:
|
|
233
|
-
return Object.defineProperty(
|
|
252
|
+
return Me;
|
|
253
|
+
}, NmorphPreviewPortal: Ve };
|
|
254
|
+
return Object.defineProperty(X, "__isScriptSetup", { enumerable: !1, value: !0 }), X;
|
|
234
255
|
}
|
|
235
256
|
});
|
|
236
257
|
export {
|
|
237
|
-
|
|
258
|
+
ft as default
|
|
238
259
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-preview-portal{display:contents}.nmorph-preview-portal .nmorph-preview-portal__content{--nmorph-private-preview-portal-content-width: min( calc(100vw - 96px) , 960px);--nmorph-private-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-private-preview-portal-content-width);height:var(--nmorph-private-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-private-preview-portal-btn-margin: 20px}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__left{left:var(--nmorph-private-preview-portal-btn-margin)}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__right{right:var(--nmorph-private-preview-portal-btn-margin)}
|
|
1
|
+
.nmorph-preview-portal{display:contents}.nmorph-preview-portal .nmorph-preview-portal__content{--nmorph-private-preview-portal-content-width: min( calc(100vw - 96px) , 960px);--nmorph-private-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-private-preview-portal-content-width);height:var(--nmorph-private-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__control-button{background:var(--nmorph-overlay-color);border-radius:4px}.nmorph-preview-portal .nmorph-preview-portal__control-button .nmorph-button__content,.nmorph-preview-portal .nmorph-preview-portal__control-button .nmorph-button__content:not(:disabled,[loading=true]):hover{color:var(--nmorph-contrast-text-color);background:transparent;border:0;box-shadow:none}.nmorph-preview-portal .nmorph-preview-portal__control-button .nmorph-button__content .nmorph-icon,.nmorph-preview-portal .nmorph-preview-portal__control-button .nmorph-button__content:not(:disabled,[loading=true]):hover .nmorph-icon{--nmorph-private-icon-color: var(--nmorph-contrast-text-color)}.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-private-preview-portal-btn-margin: 20px}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__left{left:var(--nmorph-private-preview-portal-btn-margin)}.nmorph-preview-portal.nmorph-preview-portal--opened .nmorph-preview-portal__right{right:var(--nmorph-private-preview-portal-btn-margin)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphPreviewPortal.css';
|
|
2
2
|
import v from "./NmorphPreviewPortal.vue2.js";
|
|
3
|
-
import { openBlock as t, createBlock as c, Teleport as
|
|
3
|
+
import { openBlock as t, createBlock as c, Teleport as h, createElementVNode as m, normalizeStyle as f, normalizeClass as n, createVNode as e, withCtx as l, renderSlot as d, createElementBlock as a, createCommentVNode as i } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import w from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
function
|
|
7
|
-
return o.props.show ? (t(), c(
|
|
6
|
+
function _(p, r, N, o, C, k) {
|
|
7
|
+
return o.props.show ? (t(), c(h, {
|
|
8
8
|
key: 0,
|
|
9
9
|
to: "body"
|
|
10
10
|
}, [
|
|
@@ -12,15 +12,15 @@ function N(p, r, C, o, _, k) {
|
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
class: n(o.rootClasses),
|
|
15
|
-
style:
|
|
15
|
+
style: f(o.portalStyle)
|
|
16
16
|
},
|
|
17
17
|
[
|
|
18
18
|
e(o.NmorphOverlay, {
|
|
19
19
|
show: o.props.show,
|
|
20
20
|
"z-index": o.props.zIndex,
|
|
21
21
|
"disabled-teleport": "",
|
|
22
|
-
onOnOutsideClick: r[2] || (r[2] = (
|
|
23
|
-
onOnEscapeKeydown: r[3] || (r[3] = (
|
|
22
|
+
onOnOutsideClick: r[2] || (r[2] = (s) => o.emit("close")),
|
|
23
|
+
onOnEscapeKeydown: r[3] || (r[3] = (s) => o.emit("close"))
|
|
24
24
|
}, {
|
|
25
25
|
default: l(() => [
|
|
26
26
|
m(
|
|
@@ -34,7 +34,7 @@ function N(p, r, C, o, _, k) {
|
|
|
34
34
|
2
|
|
35
35
|
/* CLASS */
|
|
36
36
|
),
|
|
37
|
-
o.props.showNavigation ? (t(),
|
|
37
|
+
o.props.showNavigation ? (t(), a(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
key: 0,
|
|
@@ -42,8 +42,10 @@ function N(p, r, C, o, _, k) {
|
|
|
42
42
|
},
|
|
43
43
|
[
|
|
44
44
|
e(o.NmorphButton, {
|
|
45
|
+
class: "nmorph-preview-portal__control-button",
|
|
45
46
|
design: "plain",
|
|
46
|
-
|
|
47
|
+
borderless: "",
|
|
48
|
+
onClick: r[0] || (r[0] = (s) => o.emit("previous"))
|
|
47
49
|
}, {
|
|
48
50
|
default: l(() => [
|
|
49
51
|
e(o.NmorphIcon, null, {
|
|
@@ -61,7 +63,7 @@ function N(p, r, C, o, _, k) {
|
|
|
61
63
|
2
|
|
62
64
|
/* CLASS */
|
|
63
65
|
)) : i("v-if", !0),
|
|
64
|
-
o.props.showNavigation ? (t(),
|
|
66
|
+
o.props.showNavigation ? (t(), a(
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
69
|
key: 1,
|
|
@@ -69,8 +71,10 @@ function N(p, r, C, o, _, k) {
|
|
|
69
71
|
},
|
|
70
72
|
[
|
|
71
73
|
e(o.NmorphButton, {
|
|
74
|
+
class: "nmorph-preview-portal__control-button",
|
|
72
75
|
design: "plain",
|
|
73
|
-
|
|
76
|
+
borderless: "",
|
|
77
|
+
onClick: r[1] || (r[1] = (s) => o.emit("next"))
|
|
74
78
|
}, {
|
|
75
79
|
default: l(() => [
|
|
76
80
|
e(o.NmorphIcon, null, {
|
|
@@ -88,7 +92,7 @@ function N(p, r, C, o, _, k) {
|
|
|
88
92
|
2
|
|
89
93
|
/* CLASS */
|
|
90
94
|
)) : i("v-if", !0),
|
|
91
|
-
o.props.showActionBar ? (t(),
|
|
95
|
+
o.props.showActionBar ? (t(), a(
|
|
92
96
|
"div",
|
|
93
97
|
{
|
|
94
98
|
key: 2,
|
|
@@ -110,7 +114,7 @@ function N(p, r, C, o, _, k) {
|
|
|
110
114
|
)
|
|
111
115
|
])) : i("v-if", !0);
|
|
112
116
|
}
|
|
113
|
-
const
|
|
117
|
+
const B = /* @__PURE__ */ w(v, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue"]]);
|
|
114
118
|
export {
|
|
115
|
-
|
|
119
|
+
B as default
|
|
116
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-progress{--nmorph-private-progress-height: 8px;--nmorph-private-progress-width-transition: .4s ease-in-out width;--nmorph-private-progress-indeterminate-animation:
|
|
1
|
+
.nmorph-progress{--nmorph-private-progress-height: 8px;--nmorph-private-progress-width-transition: .4s ease-in-out width;--nmorph-private-progress-indeterminate-animation: nmorph-progress-indeterminate 1.4s ease-in-out infinite;display:inline}.nmorph-progress .nmorph-progress__linear{display:flex;align-items:center;height:100%;height:var(--nmorph-private-progress-height)}.nmorph-progress .nmorph-progress__linear .nmorph-progress__outer{width:100%;height:100%;overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--border-radius-40);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-progress .nmorph-progress__linear .nmorph-progress__inner{position:relative;height:100%;border-radius:var(--border-radius-40);transition:var(--nmorph-private-progress-width-transition)}.nmorph-progress .nmorph-progress__linear .nmorph-progress__percentage,.nmorph-progress .nmorph-progress__linear .nmorph-progress__inner-text{margin-left:var(--indentation-03);font-weight:var(--nmorph-typography-caption-font-weight);font-size:var(--nmorph-typography-caption-font-size);line-height:var(--nmorph-typography-caption-line-height)}.nmorph-progress .nmorph-progress__linear .nmorph-progress__inner-text{position:absolute;top:50%;right:var(--indentation-02);color:var(--nmorph-light-shade-color);transform:translateY(-50%)}.nmorph-progress .nmorph-progress__circle{position:relative;width:var(--nmorph-private-progress-circle-size);height:var(--nmorph-private-progress-circle-size);background:var(--nmorph-main-color);border-radius:var(--border-radius-circular);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-progress .nmorph-progress__circle:after{position:absolute;top:50%;left:50%;width:92%;height:92%;background:var(--nmorph-main-color);border-radius:var(--border-radius-circular);box-shadow:0 0 var(--base-shadow-blur) var(--nmorph-dark-shade-color);transform:translate(-50%,-50%);content:""}.nmorph-progress .nmorph-progress__circle-inner-part{position:absolute;top:50%;left:50%;z-index:1;transform:translate(-50%,-50%)}.nmorph-progress .nmorph-progress__circle-ring{transform:rotate(-90deg);transform-origin:center;transition:stroke-dashoffset .5s;fill:none;stroke:var(--nmorph-private-progress-color);stroke-width:4px}.nmorph-progress .nmorph-progress__inner{width:var(--nmorph-private-progress-percentage);background:var(--nmorph-private-progress-color);animation:var(--nmorph-private-progress-animation)}.nmorph-progress.nmorph-progress--indeterminate .nmorph-progress__inner{width:40%;min-width:32px;transform:translate(-100%);transition:none;will-change:transform}@keyframes nmorph-progress-indeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}
|
|
@@ -18,18 +18,18 @@ const C = /* @__PURE__ */ y({
|
|
|
18
18
|
},
|
|
19
19
|
setup(c, { expose: d }) {
|
|
20
20
|
d();
|
|
21
|
-
const e = c,
|
|
21
|
+
const e = c, m = r(
|
|
22
22
|
() => q({
|
|
23
|
-
"nmorph-progress": []
|
|
23
|
+
"nmorph-progress": [e.indeterminate && "indeterminate"]
|
|
24
24
|
})
|
|
25
|
-
),
|
|
25
|
+
), a = r(() => Array.isArray(e.color) ? e.color.find((h) => h.percentage <= e.percentage)?.color : typeof e.color == "function" ? e.color(e.percentage) : e.color), n = r(() => e.indeterminate ? "var(--nmorph-private-progress-indeterminate-animation)" : "none"), i = u(null), t = u(1), f = r(() => `${t.value} ${t.value}`), v = r(() => t.value - e.percentage / 100 * t.value);
|
|
26
26
|
S(() => {
|
|
27
|
-
|
|
27
|
+
i.value && (t.value = 2 * Math.PI * i.value.r.baseVal.value);
|
|
28
28
|
});
|
|
29
29
|
const o = r(() => `${e.circleSize}px`), s = r(() => `${e.percentage}%`), l = r(() => e.height ?? (e.valueInside ? "18px" : void 0)), g = r(() => ({
|
|
30
30
|
...b({
|
|
31
31
|
"--nmorph-private-progress-percentage": s.value,
|
|
32
|
-
"--nmorph-private-progress-color":
|
|
32
|
+
"--nmorph-private-progress-color": a.value,
|
|
33
33
|
"--nmorph-private-progress-animation": n.value,
|
|
34
34
|
"--nmorph-private-progress-circle-size": o.value,
|
|
35
35
|
"--nmorph-private-progress-width-transition": e.widthTransition,
|
|
@@ -38,7 +38,7 @@ const C = /* @__PURE__ */ y({
|
|
|
38
38
|
..._({
|
|
39
39
|
"--nmorph-private-progress-height": l.value
|
|
40
40
|
})
|
|
41
|
-
})), p = { props: e, modifiers:
|
|
41
|
+
})), p = { props: e, modifiers: m, color: a, animation: n, circle: i, circumference: t, strokeDasharray: f, strokeDashoffset: v, circleContainerSize: o, displayPercentage: s, linearHeight: l, styles: g };
|
|
42
42
|
return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -4,10 +4,10 @@ import { useModifiers as Q } from "../../../utils/create-modifiers.js";
|
|
|
4
4
|
import { createCssSizeVariables as X } from "../../../utils/common.js";
|
|
5
5
|
import Y from "../../../assets/icons/video.svg.js";
|
|
6
6
|
import Z from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
7
|
-
import ee from "
|
|
8
|
-
import re from "
|
|
9
|
-
import te from "../../../assets/icons/
|
|
10
|
-
import oe from "../../../assets/icons/
|
|
7
|
+
import ee from "../../../assets/icons/open.svg.js";
|
|
8
|
+
import re from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
9
|
+
import te from "../../../assets/icons/play.svg.js";
|
|
10
|
+
import oe from "../../../assets/icons/pause.svg.js";
|
|
11
11
|
import ae from "../../../assets/icons/loading.svg.js";
|
|
12
12
|
import ne from "../../../assets/icons/full-screen.svg.js";
|
|
13
13
|
import le from "../../../assets/icons/eye.svg.js";
|
|
@@ -133,7 +133,7 @@ const ie = "var(--nmorph-contrast-text-color)", v = 0.25, Se = /* @__PURE__ */ U
|
|
|
133
133
|
};
|
|
134
134
|
O({ videoRef: l });
|
|
135
135
|
const B = { CONTRAST_ICON_COLOR: ie, VIDEO_BUFFER_EPSILON_SECONDS: v, props: e, emit: n, attrs: u, slots: h, videoRef: l, previewOpen: f, playing: o, videoLoaded: s, formatDuration: y, duration: A, mediaReady: d, showPlaybackControl: H, resolvedPreload: F, showFullscreenAction: w, hasPreviewActions: g, hasDefaultActions: N, hasActions: q, modifiers: S, styles: b, rootAttrs: E, rootClass: C, rootStyle: D, openHandler: M, downloadHandler: V, previewHandler: k, closePreviewHandler: x, fullscreenHandler: L, togglePlayback: R, isVideoFullyBuffered: I, updateVideoLoaded: j, playHandler: T, pauseHandler: W, endedHandler: $, errorHandler: z, get NmorphIcon() {
|
|
136
|
-
return
|
|
136
|
+
return re;
|
|
137
137
|
}, get NmorphIconDownload() {
|
|
138
138
|
return se;
|
|
139
139
|
}, get NmorphIconEye() {
|
|
@@ -143,13 +143,13 @@ const ie = "var(--nmorph-contrast-text-color)", v = 0.25, Se = /* @__PURE__ */ U
|
|
|
143
143
|
}, get NmorphIconLoader() {
|
|
144
144
|
return ae;
|
|
145
145
|
}, get NmorphIconOpen() {
|
|
146
|
-
return
|
|
146
|
+
return ee;
|
|
147
147
|
}, get NmorphOverlay() {
|
|
148
148
|
return Z;
|
|
149
149
|
}, get NmorphIconPause() {
|
|
150
|
-
return
|
|
150
|
+
return oe;
|
|
151
151
|
}, get NmorphIconPlay() {
|
|
152
|
-
return
|
|
152
|
+
return te;
|
|
153
153
|
}, get NmorphIconVideo() {
|
|
154
154
|
return Y;
|
|
155
155
|
} };
|