@ulu/frontend-vue 0.5.13 → 0.5.14
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.
|
@@ -20,7 +20,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
20
20
|
noBackdrop: boolean;
|
|
21
21
|
noMinHeight: boolean;
|
|
22
22
|
autoIframe: boolean;
|
|
23
|
-
|
|
23
|
+
noPauseVideos: boolean;
|
|
24
24
|
labelledby?: string | undefined;
|
|
25
25
|
describedby?: string | undefined;
|
|
26
26
|
title?: string | undefined;
|
|
@@ -44,7 +44,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
44
44
|
readonly noBackdrop?: boolean | undefined;
|
|
45
45
|
readonly noMinHeight?: boolean | undefined;
|
|
46
46
|
readonly autoIframe?: boolean | undefined;
|
|
47
|
-
readonly
|
|
47
|
+
readonly noPauseVideos?: boolean | undefined;
|
|
48
48
|
readonly labelledby?: string | undefined;
|
|
49
49
|
readonly describedby?: string | undefined;
|
|
50
50
|
readonly title?: string | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useSlots as J, ref as n, computed as u, watch as M, nextTick as w, onMounted as K, onBeforeUnmount as Q, createBlock as
|
|
1
|
+
import { useSlots as J, ref as n, computed as u, watch as M, nextTick as w, onMounted as K, onBeforeUnmount as Q, createBlock as F, openBlock as d, Teleport as Z, createElementVNode as f, withModifiers as x, normalizeStyle as H, normalizeClass as r, unref as L, createElementBlock as C, createCommentVNode as g, renderSlot as m, toDisplayString as ee, createVNode as T } from "vue";
|
|
2
2
|
import R from "../elements/UluIcon.vue.js";
|
|
3
3
|
import { useModifiers as le } from "../../composables/useModifiers.js";
|
|
4
4
|
import { preventScroll as oe, wasClickOutside as te } from "@ulu/utils/browser/dom.js";
|
|
5
5
|
import { getSoleIframeLayout as se, youtubePrepVideos as ie, youtubePauseVideos as ae, Resizer as ne, observeDialogToggle as re } from "@ulu/frontend";
|
|
6
6
|
import { newId as ce } from "../../utils/dom.js";
|
|
7
|
-
const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "modal__title-text" },
|
|
7
|
+
const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "modal__title-text" }, pe = {
|
|
8
8
|
__name: "UluModal",
|
|
9
9
|
props: {
|
|
10
10
|
/**
|
|
@@ -123,9 +123,9 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
123
123
|
*/
|
|
124
124
|
autoIframe: Boolean,
|
|
125
125
|
/**
|
|
126
|
-
* Opt-
|
|
126
|
+
* Opt-out behavior to prevent pausing videos (YouTube and native <video>) when the modal closes.
|
|
127
127
|
*/
|
|
128
|
-
|
|
128
|
+
noPauseVideos: Boolean
|
|
129
129
|
},
|
|
130
130
|
emits: ["update:modelValue", "close", "open"],
|
|
131
131
|
setup(t, { emit: j }) {
|
|
@@ -166,28 +166,28 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
166
166
|
s === o.value && te(o.value, l) && a();
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
|
-
let y = null, b = null, S = null,
|
|
169
|
+
let y = null, b = null, S = null, z = null, p = null;
|
|
170
170
|
const Y = () => {
|
|
171
171
|
!e.nonModal && e.preventScroll && (y = re(o.value, (l) => {
|
|
172
|
-
l ? b = oe({ preventShift: e.preventScrollShift }) :
|
|
172
|
+
l ? b = oe({ preventShift: e.preventScrollShift }) : P();
|
|
173
173
|
}));
|
|
174
174
|
}, G = () => {
|
|
175
175
|
y && (y.destroy(), y = null);
|
|
176
|
-
},
|
|
176
|
+
}, P = () => {
|
|
177
177
|
b && (b(), b = null);
|
|
178
178
|
}, I = () => {
|
|
179
179
|
if (v.value) {
|
|
180
180
|
const l = e.position === "center" ? { fromX: "right", fromY: "bottom", multiplier: 2 } : { fromX: e.position === "right" ? "left" : "right" };
|
|
181
|
-
S = new ne(o.value, $.value, l),
|
|
181
|
+
S = new ne(o.value, $.value, l), z = () => {
|
|
182
182
|
B.value = !0;
|
|
183
|
-
},
|
|
183
|
+
}, p = () => {
|
|
184
184
|
setTimeout(() => {
|
|
185
185
|
B.value = !1;
|
|
186
186
|
}, 0);
|
|
187
|
-
}, o.value.addEventListener("ulu:resizer:start",
|
|
187
|
+
}, o.value.addEventListener("ulu:resizer:start", z), o.value.addEventListener("ulu:resizer:end", p);
|
|
188
188
|
}
|
|
189
189
|
}, V = () => {
|
|
190
|
-
S && (S.destroy(), S = null),
|
|
190
|
+
S && (S.destroy(), S = null), z && o.value && o.value.removeEventListener("ulu:resizer:start", z), p && o.value && o.value.removeEventListener("ulu:resizer:end", p);
|
|
191
191
|
};
|
|
192
192
|
return M(() => e.modelValue, (l) => {
|
|
193
193
|
w(() => {
|
|
@@ -197,9 +197,9 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
197
197
|
const s = se(k.value);
|
|
198
198
|
s && (s.iframe.classList.add("modal__frame-content"), s.isStaticSize ? (i.value.isStaticSize = !0, i.value.isFill = !1, i.value.bodyStyle = { aspectRatio: s.aspectRatio }) : (i.value.isFill = !0, i.value.isStaticSize = !1, i.value.bodyStyle = s.fillHeight ? { minHeight: s.fillHeight } : {}));
|
|
199
199
|
}
|
|
200
|
-
e.
|
|
200
|
+
e.noPauseVideos || ie(o.value), o.value[e.nonModal ? "show" : "showModal"](), c("open");
|
|
201
201
|
} else
|
|
202
|
-
e.
|
|
202
|
+
e.noPauseVideos || (ae(o.value), o.value.querySelectorAll("video").forEach((h) => h.pause())), o.value.close(), i.value = { isStaticSize: !1, isFill: !1, bodyStyle: {} };
|
|
203
203
|
});
|
|
204
204
|
}, { immediate: !0 }), M(v, (l) => {
|
|
205
205
|
l ? w(() => {
|
|
@@ -212,18 +212,18 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
212
212
|
}), K(() => {
|
|
213
213
|
Y(), I();
|
|
214
214
|
}), Q(() => {
|
|
215
|
-
o.value && o.value.open && o.value.close(), G(),
|
|
216
|
-
}), (l, s) => (d(),
|
|
215
|
+
o.value && o.value.open && o.value.close(), G(), P(), V();
|
|
216
|
+
}), (l, s) => (d(), F(Z, {
|
|
217
217
|
to: t.teleport === !1 ? null : t.teleport,
|
|
218
218
|
disabled: t.teleport === !1
|
|
219
219
|
}, [
|
|
220
220
|
f("dialog", {
|
|
221
|
-
class: r(["modal", [
|
|
221
|
+
class: r(["modal", [L(U), t.classes.container]]),
|
|
222
222
|
"aria-labelledby": X.value,
|
|
223
223
|
"aria-describedby": t.describedby,
|
|
224
224
|
ref_key: "container",
|
|
225
225
|
ref: o,
|
|
226
|
-
style:
|
|
226
|
+
style: H({ width: N.value }),
|
|
227
227
|
onCancel: x(a, ["prevent"]),
|
|
228
228
|
onClose: q,
|
|
229
229
|
onClick: W
|
|
@@ -234,10 +234,10 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
234
234
|
}, [
|
|
235
235
|
f("h2", {
|
|
236
236
|
class: r(["modal__title", t.classes.title]),
|
|
237
|
-
id:
|
|
237
|
+
id: L(E)
|
|
238
238
|
}, [
|
|
239
239
|
m(l.$slots, "title", { close: a }, () => [
|
|
240
|
-
t.titleIcon ? (d(),
|
|
240
|
+
t.titleIcon ? (d(), F(R, {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: "modal__title-icon",
|
|
243
243
|
icon: t.titleIcon
|
|
@@ -252,7 +252,7 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
252
252
|
autofocus: ""
|
|
253
253
|
}, [
|
|
254
254
|
m(l.$slots, "closeIcon", {}, () => [
|
|
255
|
-
|
|
255
|
+
T(R, {
|
|
256
256
|
class: "modal__close-icon",
|
|
257
257
|
icon: t.closeIcon || "type:close"
|
|
258
258
|
}, null, 8, ["icon"])
|
|
@@ -261,7 +261,7 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
261
261
|
], 2)) : g("", !0),
|
|
262
262
|
f("div", {
|
|
263
263
|
class: r(["modal__body", t.classes.body]),
|
|
264
|
-
style:
|
|
264
|
+
style: H(i.value.bodyStyle),
|
|
265
265
|
ref_key: "body",
|
|
266
266
|
ref: k
|
|
267
267
|
}, [
|
|
@@ -281,7 +281,7 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
281
281
|
type: "button"
|
|
282
282
|
}, [
|
|
283
283
|
m(l.$slots, "resizerIcon", {}, () => [
|
|
284
|
-
|
|
284
|
+
T(R, {
|
|
285
285
|
class: "modal__resizer-icon",
|
|
286
286
|
icon: t.resizerIcon || _.value
|
|
287
287
|
}, null, 8, ["icon"])
|
|
@@ -292,5 +292,5 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
|
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
export {
|
|
295
|
-
|
|
295
|
+
pe as default
|
|
296
296
|
};
|
|
@@ -195,9 +195,9 @@
|
|
|
195
195
|
*/
|
|
196
196
|
autoIframe: Boolean,
|
|
197
197
|
/**
|
|
198
|
-
* Opt-
|
|
198
|
+
* Opt-out behavior to prevent pausing videos (YouTube and native <video>) when the modal closes.
|
|
199
199
|
*/
|
|
200
|
-
|
|
200
|
+
noPauseVideos: Boolean,
|
|
201
201
|
});
|
|
202
202
|
|
|
203
203
|
const slots = useSlots();
|
|
@@ -363,13 +363,13 @@
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
if (props.
|
|
366
|
+
if (!props.noPauseVideos) {
|
|
367
367
|
youtubePrepVideos(container.value);
|
|
368
368
|
}
|
|
369
369
|
container.value[props.nonModal ? "show" : "showModal"]();
|
|
370
370
|
emit("open");
|
|
371
371
|
} else {
|
|
372
|
-
if (props.
|
|
372
|
+
if (!props.noPauseVideos) {
|
|
373
373
|
youtubePauseVideos(container.value);
|
|
374
374
|
const nativeVideos = container.value.querySelectorAll("video");
|
|
375
375
|
nativeVideos.forEach(video => video.pause());
|
package/package.json
CHANGED