@nmorph/nmorph-ui-kit 3.0.2 → 3.0.4
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/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-badge/NmorphBadge.css +1 -1
- 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-media-gallery/NmorphMediaGallery.css +1 -1
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +35 -30
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue2.js +207 -147
- 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 +51 -51
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-image/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.d.ts +7 -1
- package/dist/src/components/data/nmorph-media-gallery/types.d.ts +16 -0
- package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +1 -1
- 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 Ee, ref as c, computed as i, watch as x, onBeforeUnmount as De } from "vue";
|
|
3
|
+
import { useModifiers as Q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as Oe } from "../../../utils/common.js";
|
|
5
|
+
import Ge from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
|
|
6
|
+
import ze from "../nmorph-image/NmorphImage.vue.js";
|
|
7
|
+
import $e from "../../../assets/icons/full-screen.svg.js";
|
|
8
|
+
import Ke from "../../../assets/icons/eye.svg.js";
|
|
9
|
+
import Ue from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
|
+
import je from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
11
|
+
import We from "../../../assets/icons/zoom-out.svg.js";
|
|
12
|
+
import Ze from "../../../assets/icons/zoom-in.svg.js";
|
|
13
|
+
import Xe from "../../../assets/icons/shrink.svg.js";
|
|
14
|
+
import Ye from "../../../assets/icons/rotate-right.svg.js";
|
|
15
|
+
import Je from "../../../assets/icons/rotate-left.svg.js";
|
|
16
|
+
import Qe from "../../../assets/icons/play.svg.js";
|
|
17
|
+
import et from "../../../assets/icons/enlarge.svg.js";
|
|
18
|
+
import tt from "../../../assets/icons/download.svg.js";
|
|
19
|
+
const ee = 45, te = 16 / 9, re = 160, oe = 128, Nt = /* @__PURE__ */ Ee({
|
|
20
20
|
__name: "NmorphMediaGallery",
|
|
21
21
|
props: {
|
|
22
22
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -35,6 +35,13 @@ 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
|
+
triggerLayout: { type: String, required: !1, default: "grid" },
|
|
39
|
+
triggerClass: { type: [String, Array, Object], required: !1, default: void 0 },
|
|
40
|
+
triggerStyle: { type: Object, required: !1, default: void 0 },
|
|
41
|
+
triggerImageFit: { type: String, required: !1, default: "cover" },
|
|
42
|
+
triggerVideoFit: { type: String, required: !1, default: "cover" },
|
|
43
|
+
triggerItemClass: { type: Function, required: !1 },
|
|
44
|
+
triggerItemStyle: { type: Function, required: !1 },
|
|
38
45
|
showNavigationButtons: { type: Boolean, required: !1, default: !0 },
|
|
39
46
|
showActionBar: { type: Boolean, required: !1, default: !0 },
|
|
40
47
|
showFileName: { type: Boolean, required: !1, default: !0 },
|
|
@@ -45,107 +52,153 @@ const Y = 45, dt = /* @__PURE__ */ He({
|
|
|
45
52
|
videoFit: { type: String, required: !1, default: "contain" }
|
|
46
53
|
},
|
|
47
54
|
emits: ["update:model-value", "update:active-index", "close", "change", "download", "fullscreen"],
|
|
48
|
-
setup(
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
const t =
|
|
55
|
+
setup(ae, { expose: ie, emit: ne }) {
|
|
56
|
+
ie();
|
|
57
|
+
const r = ae, l = ne, g = c(r.modelValue), v = c(0), h = c(null), S = c({}), y = c(null), u = c(!1), f = c(1), s = c(0), m = c(null), w = c(!1), n = i(() => r.items || []), B = i(() => n.value.length > 1), V = i(() => r.showNavigationButtons && B.value), p = (e) => {
|
|
58
|
+
const t = n.value.length - 1;
|
|
52
59
|
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
|
-
),
|
|
64
|
-
() =>
|
|
60
|
+
}, d = i(() => p(v.value)), a = i(() => n.value[d.value]), R = i(() => a.value?.kind === "image"), N = i(() => a.value?.kind === "video"), C = i(
|
|
61
|
+
() => a.value?.kind === "video" ? a.value.controls !== !1 : !1
|
|
62
|
+
), le = i(() => a.value?.kind === "video" ? a.value.muted === !0 : !1), ue = i(
|
|
63
|
+
() => a.value?.kind === "video" ? a.value.playsinline !== !1 : !0
|
|
64
|
+
), se = i(
|
|
65
|
+
() => a.value?.kind === "video" && a.value.preload || "metadata"
|
|
66
|
+
), de = i(
|
|
67
|
+
() => a.value?.kind === "video" && a.value.name || "video"
|
|
68
|
+
), E = i(() => a.value?.name || ""), ce = i(() => r.showFileName ? E.value : ""), D = i(() => a.value?.downloadHref || ""), O = i(() => r.showFileActions && N.value && !C.value), ge = i(
|
|
69
|
+
() => r.showFileActions && (O.value || !!D.value)
|
|
70
|
+
), fe = i(
|
|
71
|
+
() => Q({
|
|
65
72
|
"nmorph-media-gallery": [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
g.value && "opened",
|
|
74
|
+
R.value && "image",
|
|
75
|
+
N.value && "video",
|
|
76
|
+
u.value && N.value && "video-playing",
|
|
77
|
+
r.imageFit === "cover" && R.value && "image-cover",
|
|
78
|
+
r.videoFit === "cover" && N.value && "video-cover"
|
|
72
79
|
]
|
|
73
80
|
})
|
|
74
|
-
),
|
|
75
|
-
(
|
|
76
|
-
"--nmorph-private-media-gallery-trigger-height":
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
), ve = i(() => `rotate(${s.value}deg) scale(${f.value})`), me = i(() => ({
|
|
82
|
+
...Oe({
|
|
83
|
+
"--nmorph-private-media-gallery-trigger-height": r.height
|
|
84
|
+
}),
|
|
85
|
+
"--nmorph-private-media-gallery-trigger-image-fit": r.triggerImageFit,
|
|
86
|
+
"--nmorph-private-media-gallery-trigger-video-fit": r.triggerVideoFit,
|
|
87
|
+
...r.triggerStyle || {}
|
|
88
|
+
})), G = i(
|
|
89
|
+
() => Q({
|
|
90
|
+
"nmorph-media-gallery__trigger": [
|
|
91
|
+
r.height !== void 0 && "fixed-height",
|
|
92
|
+
r.triggerLayout !== "grid" && r.triggerLayout,
|
|
93
|
+
r.triggerLayout !== "grid" && n.value.length === 1 && "single",
|
|
94
|
+
r.triggerLayout !== "grid" && n.value.length === 2 && "paired",
|
|
95
|
+
r.triggerLayout !== "grid" && n.value.length > 2 && "wrapped"
|
|
96
|
+
]
|
|
81
97
|
})
|
|
82
|
-
),
|
|
98
|
+
), pe = i(() => [G.value, r.triggerClass]), b = (e) => {
|
|
83
99
|
if (e === void 0 || Number.isNaN(e) || e < 0) return "";
|
|
84
100
|
if (e === 0) return "0 B";
|
|
85
|
-
const t = ["B", "KB", "MB", "GB", "TB"],
|
|
86
|
-
return `${
|
|
87
|
-
},
|
|
88
|
-
|
|
101
|
+
const t = ["B", "KB", "MB", "GB", "TB"], o = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), I = e / 1024 ** o, Ce = I >= 10 || o === 0 || Number.isInteger(I) ? 0 : 1;
|
|
102
|
+
return `${I.toFixed(Ce)} ${t[o]}`;
|
|
103
|
+
}, he = i(() => r.showFileSize ? b(a.value?.size) : ""), ye = (e) => e.name || "", Ie = (e, t) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${t + 1}`, we = (e) => b(e.size), z = (e) => e.downloadHref || "", $ = (e) => r.showTriggerPreviewAction && e.kind === "video", K = (e) => r.showTriggerFullscreenAction && e.kind === "video", U = (e) => r.showTriggerDownloadAction && !!z(e), Ne = (e) => r.showTriggerActions && ($(e) || K(e) || U(e)), Fe = (e, t) => {
|
|
104
|
+
S.value[e] = t instanceof HTMLVideoElement ? t : null;
|
|
105
|
+
}, q = (e) => typeof e.aspectRatio == "number" && Number.isFinite(e.aspectRatio) && e.aspectRatio > 0 ? e.aspectRatio : te, j = (e) => {
|
|
106
|
+
if (typeof r.height == "number") return r.height;
|
|
107
|
+
if (typeof r.height == "string") {
|
|
108
|
+
const o = r.height.trim().match(/^(\d+(?:\.\d+)?)px$/)?.[1];
|
|
109
|
+
if (o) return Number.parseFloat(o);
|
|
110
|
+
}
|
|
111
|
+
return e;
|
|
112
|
+
}, T = (e, t) => `${parseFloat((e * j(t)).toFixed(3))}px`, W = (e) => {
|
|
113
|
+
const t = q(e);
|
|
114
|
+
if (r.triggerLayout === "natural") {
|
|
115
|
+
const o = T(t, re);
|
|
116
|
+
return {
|
|
117
|
+
"--nmorph-private-media-gallery-trigger-item-ratio": t,
|
|
118
|
+
"--nmorph-private-media-gallery-trigger-item-basis": o,
|
|
119
|
+
flexGrow: t,
|
|
120
|
+
flexBasis: o
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (r.triggerLayout === "mosaic") {
|
|
124
|
+
const o = T(t, oe);
|
|
125
|
+
return {
|
|
126
|
+
"--nmorph-private-media-gallery-trigger-item-ratio": t,
|
|
127
|
+
"--nmorph-private-media-gallery-trigger-item-basis": o,
|
|
128
|
+
flexGrow: Math.min(Math.max(t, 0.75), 2.35),
|
|
129
|
+
flexBasis: o
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return {};
|
|
133
|
+
}, xe = (e, t) => [
|
|
134
|
+
e.itemClass,
|
|
135
|
+
r.triggerItemClass?.(e, t)
|
|
136
|
+
], Se = (e, t) => {
|
|
137
|
+
const o = {
|
|
138
|
+
...e.itemStyle || {},
|
|
139
|
+
...r.triggerItemStyle?.(e, t) || {}
|
|
140
|
+
}, I = q(e);
|
|
141
|
+
return r.triggerLayout !== "grid" ? (Object.assign(o, W(e)), o.aspectRatio = String(I)) : typeof e.aspectRatio == "number" && Number.isFinite(e.aspectRatio) && e.aspectRatio > 0 && (o.aspectRatio = String(I)), o;
|
|
89
142
|
};
|
|
90
|
-
|
|
91
|
-
() =>
|
|
143
|
+
x(
|
|
144
|
+
() => r.modelValue,
|
|
92
145
|
(e) => {
|
|
93
|
-
|
|
146
|
+
g.value = e;
|
|
94
147
|
}
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
148
|
+
), x(
|
|
149
|
+
() => r.activeIndex,
|
|
97
150
|
(e) => {
|
|
98
|
-
typeof e == "number" && (
|
|
151
|
+
typeof e == "number" && (v.value = p(e));
|
|
99
152
|
},
|
|
100
153
|
{ immediate: !0 }
|
|
101
|
-
),
|
|
102
|
-
() => [
|
|
154
|
+
), x(
|
|
155
|
+
() => [r.initialIndex, n.value.length],
|
|
103
156
|
() => {
|
|
104
|
-
typeof
|
|
157
|
+
typeof r.activeIndex != "number" && (v.value = p(r.initialIndex));
|
|
105
158
|
},
|
|
106
159
|
{ immediate: !0 }
|
|
107
|
-
),
|
|
108
|
-
() => [
|
|
160
|
+
), x(
|
|
161
|
+
() => [a.value?.kind, a.value?.src, d.value],
|
|
109
162
|
() => {
|
|
110
|
-
|
|
163
|
+
u.value = !1, y.value = null;
|
|
111
164
|
}
|
|
112
165
|
);
|
|
113
|
-
const
|
|
114
|
-
!h.value || h.value === y.value || (h.value.pause(),
|
|
115
|
-
},
|
|
116
|
-
f.value = 1,
|
|
117
|
-
},
|
|
118
|
-
if (!
|
|
119
|
-
const t =
|
|
166
|
+
const F = () => {
|
|
167
|
+
!h.value || h.value === y.value || (h.value.pause(), u.value = !1, y.value = h.value);
|
|
168
|
+
}, A = () => {
|
|
169
|
+
f.value = 1, s.value = 0;
|
|
170
|
+
}, H = (e) => {
|
|
171
|
+
if (!n.value.length) return;
|
|
172
|
+
const t = p(e);
|
|
120
173
|
if (t === d.value) return;
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
const e =
|
|
126
|
-
e &&
|
|
127
|
-
},
|
|
128
|
-
const e =
|
|
129
|
-
e &&
|
|
130
|
-
},
|
|
131
|
-
if (!
|
|
132
|
-
const t =
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
},
|
|
174
|
+
F(), u.value = !1, v.value = t, A(), l("update:active-index", t);
|
|
175
|
+
const o = n.value[t];
|
|
176
|
+
o && l("change", o, t);
|
|
177
|
+
}, L = () => {
|
|
178
|
+
const e = n.value.length;
|
|
179
|
+
e && H(d.value === 0 ? e - 1 : d.value - 1);
|
|
180
|
+
}, k = () => {
|
|
181
|
+
const e = n.value.length;
|
|
182
|
+
e && H(d.value === e - 1 ? 0 : d.value + 1);
|
|
183
|
+
}, Be = (e) => {
|
|
184
|
+
if (!n.value.length) return;
|
|
185
|
+
const t = p(e);
|
|
186
|
+
F(), u.value = !1, v.value = t, A(), w.value = !0, g.value = !0, l("update:model-value", !0), l("update:active-index", t);
|
|
187
|
+
const o = n.value[t];
|
|
188
|
+
o && l("change", o, t);
|
|
189
|
+
}, Z = () => {
|
|
190
|
+
g.value && (F(), g.value = !1, l("update:model-value", !1), l("close"));
|
|
191
|
+
}, Re = () => {
|
|
192
|
+
s.value = s.value + 90, s.value >= 360 && (s.value = 0);
|
|
193
|
+
}, be = () => {
|
|
194
|
+
s.value = s.value - 90, s.value <= -360 && (s.value = 0);
|
|
195
|
+
}, qe = () => {
|
|
143
196
|
f.value = parseFloat(Math.min(f.value + 0.2, 4).toFixed(3));
|
|
144
|
-
},
|
|
197
|
+
}, Te = () => {
|
|
145
198
|
f.value = parseFloat(Math.max(f.value - 0.2, 0.2).toFixed(3));
|
|
146
|
-
},
|
|
199
|
+
}, Ae = () => {
|
|
147
200
|
f.value = 1;
|
|
148
|
-
},
|
|
201
|
+
}, _ = async (e) => {
|
|
149
202
|
if (e)
|
|
150
203
|
try {
|
|
151
204
|
const t = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
|
|
@@ -156,83 +209,90 @@ const Y = 45, dt = /* @__PURE__ */ He({
|
|
|
156
209
|
e.webkitEnterFullscreen?.();
|
|
157
210
|
} catch {
|
|
158
211
|
}
|
|
159
|
-
},
|
|
160
|
-
!
|
|
161
|
-
},
|
|
162
|
-
e.kind === "video" && (
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
if (
|
|
212
|
+
}, He = async () => {
|
|
213
|
+
!a.value || a.value.kind !== "video" || (l("fullscreen", a.value, d.value), await _(h.value));
|
|
214
|
+
}, Le = async (e, t) => {
|
|
215
|
+
e.kind === "video" && (l("fullscreen", e, t), await _(S.value[t]));
|
|
216
|
+
}, X = (e, t) => {
|
|
217
|
+
l("download", e, t);
|
|
218
|
+
}, ke = () => {
|
|
219
|
+
a.value && X(a.value, d.value);
|
|
220
|
+
}, _e = () => {
|
|
221
|
+
u.value = !0, y.value = null;
|
|
222
|
+
}, Me = () => {
|
|
223
|
+
u.value = !1;
|
|
224
|
+
}, Pe = () => {
|
|
225
|
+
u.value = !1;
|
|
226
|
+
}, Ve = () => {
|
|
227
|
+
u.value = !1;
|
|
228
|
+
}, M = (e) => {
|
|
229
|
+
if (g.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
|
|
177
230
|
if (e.key === "Escape") {
|
|
178
|
-
e.preventDefault(),
|
|
231
|
+
e.preventDefault(), Z();
|
|
179
232
|
return;
|
|
180
233
|
}
|
|
181
|
-
|
|
234
|
+
B.value && (e.key === "ArrowLeft" && (e.preventDefault(), L()), e.key === "ArrowRight" && (e.preventDefault(), k()));
|
|
182
235
|
}
|
|
183
|
-
},
|
|
184
|
-
typeof document > "u" || document.addEventListener("keydown",
|
|
236
|
+
}, Y = () => {
|
|
237
|
+
typeof document > "u" || document.addEventListener("keydown", M);
|
|
185
238
|
}, P = () => {
|
|
186
|
-
typeof document > "u" || document.removeEventListener("keydown",
|
|
239
|
+
typeof document > "u" || document.removeEventListener("keydown", M);
|
|
187
240
|
};
|
|
188
|
-
|
|
189
|
-
|
|
241
|
+
x(
|
|
242
|
+
g,
|
|
190
243
|
(e) => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
244
|
+
if (e) {
|
|
245
|
+
if (Y(), y.value = null, w.value) {
|
|
246
|
+
w.value = !1;
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
v.value = p(
|
|
250
|
+
typeof r.activeIndex == "number" ? r.activeIndex : r.initialIndex
|
|
251
|
+
);
|
|
252
|
+
} else
|
|
253
|
+
w.value = !1, F(), u.value = !1, P();
|
|
194
254
|
},
|
|
195
255
|
{ immediate: !0 }
|
|
196
|
-
),
|
|
197
|
-
const
|
|
198
|
-
|
|
256
|
+
), De(P);
|
|
257
|
+
const J = { SWIPE_THRESHOLD: ee, DEFAULT_TRIGGER_ASPECT_RATIO: te, NATURAL_TRIGGER_ROW_BASIS: re, MOSAIC_TRIGGER_ROW_BASIS: oe, props: r, emit: l, open: g, currentIndex: v, currentVideoRef: h, triggerVideoRefs: S, pausedVideoRef: y, videoPlaying: u, scaleLevel: f, rotateLevel: s, pointerStart: m, openingFromTrigger: w, sourceList: n, multipleItems: B, showNavigation: V, getClampedIndex: p, resolvedCurrentIndex: d, currentItem: a, isImage: R, isVideo: N, videoControls: C, videoMuted: le, videoPlaysinline: ue, videoPreload: se, currentVideoName: de, currentItemName: E, currentName: ce, currentDownloadHref: D, showVideoFullscreenAction: O, showFileActions: ge, modifiers: fe, imageTransform: ve, triggerStyle: me, triggerModifiers: G, triggerClasses: pe, formatSize: b, currentSize: he, getItemName: ye, getItemLabel: Ie, getItemSize: we, getItemDownloadHref: z, showTriggerPreviewActionForItem: $, showTriggerFullscreenActionForItem: K, showTriggerDownloadActionForItem: U, showTriggerActionsForItem: Ne, setTriggerVideoRef: Fe, getItemAspectRatio: q, getTriggerRowBasis: j, getTriggerFlexBasis: T, getTriggerLayoutStyle: W, getTriggerItemClass: xe, getTriggerItemStyle: Se, pauseCurrentVideo: F, resetImageTransform: A, setCurrentIndex: H, previousHandler: L, nextHandler: k, openPreviewAt: Be, closeHandler: Z, rotateRight: Re, rotateLeft: be, zoomIn: qe, zoomOut: Te, toggleNormalSize: Ae, requestVideoFullscreen: _, fullscreenHandler: He, triggerFullscreenHandler: Le, downloadItemHandler: X, downloadHandler: ke, videoPlayHandler: _e, videoPauseHandler: Me, videoEndedHandler: Pe, videoErrorHandler: Ve, keyboardNavigationHandler: M, addKeyboardNavigationListener: Y, removeKeyboardNavigationListener: P, pointerDownHandler: (e) => {
|
|
258
|
+
m.value = { x: e.clientX, y: e.clientY };
|
|
199
259
|
}, pointerUpHandler: (e) => {
|
|
200
|
-
if (!
|
|
201
|
-
|
|
260
|
+
if (!m.value || !V.value) {
|
|
261
|
+
m.value = null;
|
|
202
262
|
return;
|
|
203
263
|
}
|
|
204
|
-
const t = e.clientX -
|
|
205
|
-
|
|
264
|
+
const t = e.clientX - m.value.x, o = e.clientY - m.value.y;
|
|
265
|
+
m.value = null, !(Math.abs(t) < ee || Math.abs(t) < Math.abs(o) * 1.2) && (t > 0 ? L() : k());
|
|
206
266
|
}, get NmorphButton() {
|
|
207
|
-
return
|
|
267
|
+
return je;
|
|
208
268
|
}, get NmorphIcon() {
|
|
209
|
-
return
|
|
269
|
+
return Ue;
|
|
210
270
|
}, get NmorphIconDownload() {
|
|
211
|
-
return
|
|
271
|
+
return tt;
|
|
212
272
|
}, get NmorphIconEnlarge() {
|
|
213
|
-
return
|
|
273
|
+
return et;
|
|
214
274
|
}, get NmorphIconEye() {
|
|
215
|
-
return
|
|
275
|
+
return Ke;
|
|
216
276
|
}, get NmorphIconFullScreen() {
|
|
217
|
-
return
|
|
277
|
+
return $e;
|
|
218
278
|
}, get NmorphIconPlay() {
|
|
219
|
-
return
|
|
279
|
+
return Qe;
|
|
220
280
|
}, get NmorphIconRotateLeft() {
|
|
221
|
-
return
|
|
281
|
+
return Je;
|
|
222
282
|
}, get NmorphIconRotateRight() {
|
|
223
|
-
return
|
|
283
|
+
return Ye;
|
|
224
284
|
}, get NmorphIconShrink() {
|
|
225
|
-
return
|
|
285
|
+
return Xe;
|
|
226
286
|
}, get NmorphIconZoomIn() {
|
|
227
|
-
return
|
|
287
|
+
return Ze;
|
|
228
288
|
}, get NmorphIconZoomOut() {
|
|
229
|
-
return
|
|
289
|
+
return We;
|
|
230
290
|
}, get NmorphImage() {
|
|
231
|
-
return
|
|
232
|
-
}, NmorphPreviewPortal:
|
|
233
|
-
return Object.defineProperty(
|
|
291
|
+
return ze;
|
|
292
|
+
}, NmorphPreviewPortal: Ge };
|
|
293
|
+
return Object.defineProperty(J, "__isScriptSetup", { enumerable: !1, value: !0 }), J;
|
|
234
294
|
}
|
|
235
295
|
});
|
|
236
296
|
export {
|
|
237
|
-
|
|
297
|
+
Nt as default
|
|
238
298
|
};
|
|
@@ -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
|
} };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import './NmorphBacktop.css';
|
|
2
2
|
import i from "./NmorphBacktop.vue2.js";
|
|
3
|
-
import { openBlock as e, createElementBlock as
|
|
3
|
+
import { openBlock as e, createElementBlock as s, createBlock as a, Teleport as c, createElementVNode as l, normalizeStyle as d, normalizeClass as p, withModifiers as m, renderSlot as f, createVNode as r, withCtx as t } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const _ = { ref: "placeholderDOMEl" };
|
|
7
|
-
function
|
|
8
|
-
return e(),
|
|
7
|
+
function b(n, k, v, o, N, g) {
|
|
8
|
+
return e(), s(
|
|
9
9
|
"div",
|
|
10
10
|
_,
|
|
11
11
|
[
|
|
12
|
-
(e(), a(
|
|
12
|
+
(e(), a(c, {
|
|
13
13
|
to: o.props.teleportTo,
|
|
14
14
|
disabled: !o.isMounted || o.props.teleportDisabled
|
|
15
15
|
}, [
|
|
16
|
-
|
|
16
|
+
l(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
ref: "selfDOMEl",
|
|
@@ -21,19 +21,20 @@ function k(n, v, b, o, N, B) {
|
|
|
21
21
|
style: d(o.styles)
|
|
22
22
|
},
|
|
23
23
|
[
|
|
24
|
-
|
|
24
|
+
l("div", {
|
|
25
25
|
onClick: m(o.scrollToTopHandler, ["stop"])
|
|
26
26
|
}, [
|
|
27
27
|
f(n.$slots, "default", {}, () => [
|
|
28
28
|
r(o.NmorphButton, {
|
|
29
|
-
design: o.props.design
|
|
29
|
+
design: o.props.design,
|
|
30
|
+
borderless: o.props.design === "plain"
|
|
30
31
|
}, {
|
|
31
|
-
default:
|
|
32
|
+
default: t(() => [
|
|
32
33
|
r(o.NmorphIcon, {
|
|
33
34
|
class: "nmorph-backtop__up-icon",
|
|
34
35
|
color: o.props.design === "nmorph" ? void 0 : "var(--nmorph-contrast-text-color)"
|
|
35
36
|
}, {
|
|
36
|
-
default:
|
|
37
|
+
default: t(() => [
|
|
37
38
|
r(o.NmorphIconChevronDown)
|
|
38
39
|
]),
|
|
39
40
|
_: 1
|
|
@@ -42,7 +43,7 @@ function k(n, v, b, o, N, B) {
|
|
|
42
43
|
]),
|
|
43
44
|
_: 1
|
|
44
45
|
/* STABLE */
|
|
45
|
-
}, 8, ["design"])
|
|
46
|
+
}, 8, ["design", "borderless"])
|
|
46
47
|
])
|
|
47
48
|
])
|
|
48
49
|
],
|
|
@@ -55,7 +56,7 @@ function k(n, v, b, o, N, B) {
|
|
|
55
56
|
/* NEED_PATCH */
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
|
-
const D = /* @__PURE__ */ h(i, [["render",
|
|
59
|
+
const D = /* @__PURE__ */ h(i, [["render", b], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-backtop/NmorphBacktop.vue"]]);
|
|
59
60
|
export {
|
|
60
61
|
D as default
|
|
61
62
|
};
|