@xwadex/fesd 0.0.52 → 0.0.53
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.
|
@@ -334,9 +334,9 @@ const ze = {
|
|
|
334
334
|
return n;
|
|
335
335
|
}
|
|
336
336
|
return JSON.parse(n);
|
|
337
|
-
},
|
|
337
|
+
}, A = (n, i) => {
|
|
338
338
|
console.warn(`[${n} warn]: ${i}`);
|
|
339
|
-
},
|
|
339
|
+
}, Ye = (n, i) => {
|
|
340
340
|
console.error(`[${n} error]: ${i}`);
|
|
341
341
|
}, j = {
|
|
342
342
|
on(n, i) {
|
|
@@ -384,15 +384,15 @@ const ze = {
|
|
|
384
384
|
let y = 0;
|
|
385
385
|
if (T === 0)
|
|
386
386
|
return;
|
|
387
|
-
const D = (
|
|
387
|
+
const D = (L) => {
|
|
388
388
|
const z = k(t);
|
|
389
|
-
i && i.emit(
|
|
389
|
+
i && i.emit(L, z), !i && n.on && G(n.on[L]) && n.on[L](z);
|
|
390
390
|
};
|
|
391
391
|
D("beforeScroll");
|
|
392
392
|
const U = () => {
|
|
393
393
|
y += C;
|
|
394
|
-
const
|
|
395
|
-
m[u] =
|
|
394
|
+
const L = Os[r](y, v, T, o);
|
|
395
|
+
m[u] = L, y < o && requestAnimationFrame(U), y >= o && D("afterScroll");
|
|
396
396
|
};
|
|
397
397
|
requestAnimationFrame(U);
|
|
398
398
|
};
|
|
@@ -474,15 +474,15 @@ const { MODALS: O } = window, Ns = (n) => {
|
|
|
474
474
|
s.append(o);
|
|
475
475
|
}), e.children[0];
|
|
476
476
|
};
|
|
477
|
-
var wt, ci, Tt, di, Et, ui,
|
|
477
|
+
var wt, ci, Tt, di, Et, ui, Lt, hi, At, pi;
|
|
478
478
|
class li extends HTMLElement {
|
|
479
479
|
constructor() {
|
|
480
480
|
super();
|
|
481
481
|
h(this, wt);
|
|
482
482
|
h(this, Tt);
|
|
483
483
|
h(this, Et);
|
|
484
|
-
h(this, At);
|
|
485
484
|
h(this, Lt);
|
|
485
|
+
h(this, At);
|
|
486
486
|
this.initialize = !1;
|
|
487
487
|
}
|
|
488
488
|
static get observedAttributes() {
|
|
@@ -491,7 +491,7 @@ class li extends HTMLElement {
|
|
|
491
491
|
attributeChangedCallback(t, e, s) {
|
|
492
492
|
switch (t) {
|
|
493
493
|
case ":state":
|
|
494
|
-
d(this,
|
|
494
|
+
d(this, At, pi).call(this, s);
|
|
495
495
|
break;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
@@ -512,7 +512,7 @@ wt = new WeakSet(), ci = function() {
|
|
|
512
512
|
const { ATTRS: t } = P;
|
|
513
513
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
514
514
|
const e = this.getAttribute(t.id) || Ms();
|
|
515
|
-
this.getAttribute(t.id) || (
|
|
515
|
+
this.getAttribute(t.id) || (A(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && A(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this, Tt, di).call(this);
|
|
516
516
|
}, Tt = new WeakSet(), di = function() {
|
|
517
517
|
this.childDom = this.childNodes, this.template = Ns(this), this.innerHTML = "", this.append(this.template), d(this, Et, ui).call(this);
|
|
518
518
|
}, Et = new WeakSet(), ui = function() {
|
|
@@ -522,8 +522,8 @@ wt = new WeakSet(), ci = function() {
|
|
|
522
522
|
x: "hidden"
|
|
523
523
|
},
|
|
524
524
|
autoUpdate: !0
|
|
525
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
526
|
-
},
|
|
525
|
+
}), window.modalScroll = this.__scroller__, d(this, Lt, hi).call(this);
|
|
526
|
+
}, Lt = new WeakSet(), hi = function() {
|
|
527
527
|
var a, r, l;
|
|
528
528
|
const t = this, { ATTRS: e } = P, { close: s, destroy: o } = e;
|
|
529
529
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -539,7 +539,7 @@ wt = new WeakSet(), ci = function() {
|
|
|
539
539
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
540
540
|
c.stopPropagation();
|
|
541
541
|
});
|
|
542
|
-
},
|
|
542
|
+
}, At = new WeakSet(), pi = function(t) {
|
|
543
543
|
const { __scroller__: e } = this;
|
|
544
544
|
if (t === "open") {
|
|
545
545
|
if (this.style.display = "block", e) {
|
|
@@ -578,7 +578,7 @@ const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
|
578
578
|
e && G(e) && e.apply(n, t);
|
|
579
579
|
}, gi = (n, ...i) => {
|
|
580
580
|
n && G(n) && n.apply(V, i);
|
|
581
|
-
},
|
|
581
|
+
}, Fe = (n, i) => {
|
|
582
582
|
const { target: t } = n, e = We[t] || k(n.target);
|
|
583
583
|
e && fi(n, i), e || Ps(n, i);
|
|
584
584
|
}, fi = (n, i) => {
|
|
@@ -605,7 +605,7 @@ const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
|
605
605
|
}, Ps = async (n, i) => {
|
|
606
606
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
607
607
|
if (!e)
|
|
608
|
-
return
|
|
608
|
+
return A("modal4", "cannot find target or data-modal-route is not defined");
|
|
609
609
|
const r = (l, ...c) => {
|
|
610
610
|
i && (i.emit(l, ...c), mi(i, o[l], ...c)), i || gi(o[l], ...c);
|
|
611
611
|
};
|
|
@@ -644,7 +644,7 @@ const B = class B {
|
|
|
644
644
|
/** static method 'open' */
|
|
645
645
|
static open(i) {
|
|
646
646
|
const { SETTINGS: t } = P, e = Object.assign({}, t, { on: {} }, i);
|
|
647
|
-
|
|
647
|
+
Fe(e);
|
|
648
648
|
}
|
|
649
649
|
/** static method 'defineMethods' */
|
|
650
650
|
static defineMethods(i) {
|
|
@@ -671,7 +671,7 @@ tt = new WeakSet(), xe = function() {
|
|
|
671
671
|
}), this.emit("init");
|
|
672
672
|
}, Dt = new WeakSet(), bi = function(i) {
|
|
673
673
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = qs(this.getAttribute("data-modal-on"));
|
|
674
|
-
o && typeof o != "object" &&
|
|
674
|
+
o && typeof o != "object" && A("modal4", "data-modal-on must be a json string.");
|
|
675
675
|
const a = {
|
|
676
676
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
677
677
|
action: this.getAttribute("data-modal-action") || t.action,
|
|
@@ -682,7 +682,7 @@ tt = new WeakSet(), xe = function() {
|
|
|
682
682
|
};
|
|
683
683
|
this.removeEventListener("click", e), setTimeout(() => {
|
|
684
684
|
this.addEventListener("click", e);
|
|
685
|
-
}, 200),
|
|
685
|
+
}, 200), Fe(a, s);
|
|
686
686
|
};
|
|
687
687
|
let V = B;
|
|
688
688
|
Object.assign(V.prototype, j);
|
|
@@ -758,7 +758,7 @@ const Bs = (n) => {
|
|
|
758
758
|
s.append(o);
|
|
759
759
|
}), e.children[0];
|
|
760
760
|
};
|
|
761
|
-
var xt, Ti, $t, Ei, _t,
|
|
761
|
+
var xt, Ti, $t, Ei, _t, Li, Ct, Ai, Ht, Si, Mt, Di, It, ki, qt, xi, Ot, $i, Nt, _i;
|
|
762
762
|
class Ws extends HTMLElement {
|
|
763
763
|
constructor() {
|
|
764
764
|
super();
|
|
@@ -817,13 +817,13 @@ class Ws extends HTMLElement {
|
|
|
817
817
|
}
|
|
818
818
|
xt = new WeakSet(), Ti = function() {
|
|
819
819
|
if (!this.getAttribute("video-id")) {
|
|
820
|
-
|
|
820
|
+
A("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
823
823
|
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, $t, Ei).call(this);
|
|
824
824
|
}, $t = new WeakSet(), Ei = function() {
|
|
825
|
-
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t,
|
|
826
|
-
}, _t = new WeakSet(),
|
|
825
|
+
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t, Li).call(this);
|
|
826
|
+
}, _t = new WeakSet(), Li = function() {
|
|
827
827
|
const { videoType: t, videoMode: e } = this;
|
|
828
828
|
let s = "";
|
|
829
829
|
function o(a) {
|
|
@@ -849,7 +849,7 @@ xt = new WeakSet(), Ti = function() {
|
|
|
849
849
|
case "youtubeAPI":
|
|
850
850
|
break;
|
|
851
851
|
case "youtube":
|
|
852
|
-
document.body.wd_youtube == !1 ? o("video-player") : s = d(this, Ct,
|
|
852
|
+
document.body.wd_youtube == !1 ? o("video-player") : s = d(this, Ct, Ai).call(this);
|
|
853
853
|
break;
|
|
854
854
|
case "youkuAPI":
|
|
855
855
|
break;
|
|
@@ -875,7 +875,7 @@ xt = new WeakSet(), Ti = function() {
|
|
|
875
875
|
break;
|
|
876
876
|
}
|
|
877
877
|
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, s);
|
|
878
|
-
}, Ct = new WeakSet(),
|
|
878
|
+
}, Ct = new WeakSet(), Ai = function() {
|
|
879
879
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
880
880
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
|
881
881
|
}, Ht = new WeakSet(), Si = function() {
|
|
@@ -1080,7 +1080,7 @@ function Xn(n) {
|
|
|
1080
1080
|
});
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Yn(n) {
|
|
1084
1084
|
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
|
1085
1085
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1086
1086
|
a.currentTime = 0;
|
|
@@ -1088,7 +1088,7 @@ function Fn(n) {
|
|
|
1088
1088
|
n.slideNext();
|
|
1089
1089
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Fn() {
|
|
1092
1092
|
f(".number-grow").each(function(n, i) {
|
|
1093
1093
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1094
1094
|
let r = "";
|
|
@@ -1141,7 +1141,7 @@ const X = class X {
|
|
|
1141
1141
|
h(this, st);
|
|
1142
1142
|
h(this, zt);
|
|
1143
1143
|
if (!dt(i) && !Se(i) && !ut(i)) {
|
|
1144
|
-
|
|
1144
|
+
Ye("video4", `找不到該物件 -> ${i}`);
|
|
1145
1145
|
return;
|
|
1146
1146
|
}
|
|
1147
1147
|
this.__storage__ = {
|
|
@@ -1172,16 +1172,16 @@ it = new WeakSet(), Ce = function() {
|
|
|
1172
1172
|
}, Pt = new WeakSet(), Ii = function() {
|
|
1173
1173
|
const { elements: i, options: t } = this;
|
|
1174
1174
|
i.forEach((e) => {
|
|
1175
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, zt, Oi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ue(e.video.params) && !Xs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, jt, qi).call(this, e)), Ue(e.video.params) ||
|
|
1175
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, zt, Oi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ue(e.video.params) && !Xs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, jt, qi).call(this, e)), Ue(e.video.params) || Ye("video4", "無法取得影片 ID");
|
|
1176
1176
|
}), this.emit("init");
|
|
1177
1177
|
}, jt = new WeakSet(), qi = function(i) {
|
|
1178
1178
|
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
|
1179
1179
|
if (l === "onBox" || l === "inBox") {
|
|
1180
1180
|
let g = null;
|
|
1181
1181
|
if (u === "on") {
|
|
1182
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1182
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1183
1183
|
const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
|
|
1184
|
-
if (w ? m.insertAdjacentHTML(S.after, w) :
|
|
1184
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : A("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube")
|
|
1185
1185
|
p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1186
1186
|
else if (!v && r == "vimeo")
|
|
1187
1187
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
@@ -1199,13 +1199,13 @@ it = new WeakSet(), Ce = function() {
|
|
|
1199
1199
|
m.setAttribute("src", `${T}`);
|
|
1200
1200
|
}).catch(function(b) {
|
|
1201
1201
|
console.log("error");
|
|
1202
|
-
}) :
|
|
1202
|
+
}) : A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1203
1203
|
}
|
|
1204
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
|
1204
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, He), g.addEventListener("click", g.video.eventHandler);
|
|
1205
1205
|
} else if (l === "onPage") {
|
|
1206
1206
|
let g = null;
|
|
1207
1207
|
if (u == "on") {
|
|
1208
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1208
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1209
1209
|
const m = s.querySelector("img");
|
|
1210
1210
|
m.insertAdjacentHTML(S.after, t[o]);
|
|
1211
1211
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
@@ -1214,7 +1214,7 @@ it = new WeakSet(), Ce = function() {
|
|
|
1214
1214
|
m.setAttribute("src", `${b}`);
|
|
1215
1215
|
}).catch(function(w) {
|
|
1216
1216
|
console.log("error");
|
|
1217
|
-
}) : v ||
|
|
1217
|
+
}) : v || A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1218
1218
|
} else {
|
|
1219
1219
|
s.innerHTML = pt(e);
|
|
1220
1220
|
return;
|
|
@@ -1254,15 +1254,15 @@ it = new WeakSet(), Ce = function() {
|
|
|
1254
1254
|
var U;
|
|
1255
1255
|
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1256
1256
|
if (b.update(), Hi([...D]), o == "onBox" && u == "instagram") {
|
|
1257
|
-
const
|
|
1257
|
+
const L = document.querySelector("[video-template] .modal-content");
|
|
1258
1258
|
new ResizeObserver((Ge) => {
|
|
1259
|
-
Ge[0].contentRect.height > 50 &&
|
|
1260
|
-
}).observe(
|
|
1259
|
+
Ge[0].contentRect.height > 50 && L.classList.add("active");
|
|
1260
|
+
}).observe(L);
|
|
1261
1261
|
}
|
|
1262
1262
|
if (o == "inBox") {
|
|
1263
|
-
const
|
|
1263
|
+
const L = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1264
1264
|
let z;
|
|
1265
|
-
|
|
1265
|
+
L == null ? z = `
|
|
1266
1266
|
<div
|
|
1267
1267
|
class="photo-box"
|
|
1268
1268
|
video-target
|
|
@@ -1286,14 +1286,14 @@ it = new WeakSet(), Ce = function() {
|
|
|
1286
1286
|
>
|
|
1287
1287
|
<picture>
|
|
1288
1288
|
<source
|
|
1289
|
-
srcset="${
|
|
1289
|
+
srcset="${L}"
|
|
1290
1290
|
type="image/webp"
|
|
1291
1291
|
/>
|
|
1292
1292
|
<source
|
|
1293
|
-
srcset="${
|
|
1293
|
+
srcset="${L}"
|
|
1294
1294
|
type="image/jpeg"
|
|
1295
1295
|
/>
|
|
1296
|
-
<img src="${
|
|
1296
|
+
<img src="${L}" alt="" />
|
|
1297
1297
|
</picture>
|
|
1298
1298
|
</div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
|
|
1299
1299
|
const Re = y.querySelectorAll("[video-target]");
|
|
@@ -1346,7 +1346,7 @@ it = new WeakSet(), Ce = function() {
|
|
|
1346
1346
|
let _e = X;
|
|
1347
1347
|
Object.assign(_e.prototype, j);
|
|
1348
1348
|
customElements.define("video-player", Ws);
|
|
1349
|
-
const
|
|
1349
|
+
const Ys = {
|
|
1350
1350
|
"zh-tw": {
|
|
1351
1351
|
臺北市: [
|
|
1352
1352
|
["中正區", "100"],
|
|
@@ -2177,7 +2177,7 @@ const Fs = {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
};
|
|
2179
2179
|
let Q;
|
|
2180
|
-
const
|
|
2180
|
+
const Fs = (n) => {
|
|
2181
2181
|
const { TEMPLATE: i } = Be, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
|
|
2182
2182
|
e.innerHTML = i(
|
|
2183
2183
|
s,
|
|
@@ -2196,7 +2196,7 @@ const Ys = (n) => {
|
|
|
2196
2196
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2197
2197
|
i && i.forEach((e) => {
|
|
2198
2198
|
const s = document.querySelector(e);
|
|
2199
|
-
s ||
|
|
2199
|
+
s || A("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2200
2200
|
});
|
|
2201
2201
|
}, I = (n, i) => {
|
|
2202
2202
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
@@ -2252,7 +2252,7 @@ const Ys = (n) => {
|
|
|
2252
2252
|
}
|
|
2253
2253
|
}, Js = (n) => {
|
|
2254
2254
|
const i = n.s.cityLang;
|
|
2255
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q =
|
|
2255
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q = Ys, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Q[i]).forEach((t) => {
|
|
2256
2256
|
const e = document.createElement("li");
|
|
2257
2257
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2258
2258
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
@@ -2360,7 +2360,7 @@ class Pi extends HTMLElement {
|
|
|
2360
2360
|
Bt = new WeakSet(), ji = function() {
|
|
2361
2361
|
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Wt, zi).call(this);
|
|
2362
2362
|
}, Wt = new WeakSet(), zi = function() {
|
|
2363
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2363
|
+
this.s.childDom = this.childNodes, this.s.template = Fs(this), this.innerHTML = "", this.append(this.s.template), d(this, Gt, Bi).call(this);
|
|
2364
2364
|
}, Gt = new WeakSet(), Bi = function() {
|
|
2365
2365
|
var s;
|
|
2366
2366
|
const t = this;
|
|
@@ -2623,13 +2623,13 @@ function Ks(n) {
|
|
|
2623
2623
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2624
2624
|
};
|
|
2625
2625
|
}
|
|
2626
|
-
var Xt, Gi,
|
|
2626
|
+
var Xt, Gi, Yt, Ri, Ft, Xi, Ut, Yi;
|
|
2627
2627
|
class tn extends HTMLElement {
|
|
2628
2628
|
constructor() {
|
|
2629
2629
|
super();
|
|
2630
2630
|
h(this, Xt);
|
|
2631
|
-
h(this, Ft);
|
|
2632
2631
|
h(this, Yt);
|
|
2632
|
+
h(this, Ft);
|
|
2633
2633
|
h(this, Ut);
|
|
2634
2634
|
this.initialize = !1;
|
|
2635
2635
|
}
|
|
@@ -2665,8 +2665,8 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2665
2665
|
// true / false
|
|
2666
2666
|
gap: Number(this.getAttribute("gap")) || M.SETTINGS.gap
|
|
2667
2667
|
};
|
|
2668
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = Je(this), Vs(this), d(this,
|
|
2669
|
-
},
|
|
2668
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Je(this), Vs(this), d(this, Yt, Ri).call(this);
|
|
2669
|
+
}, Yt = new WeakSet(), Ri = function() {
|
|
2670
2670
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2671
2671
|
switch (t) {
|
|
2672
2672
|
case "left":
|
|
@@ -2678,8 +2678,8 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2678
2678
|
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
|
|
2679
2679
|
break;
|
|
2680
2680
|
}
|
|
2681
|
-
d(this,
|
|
2682
|
-
},
|
|
2681
|
+
d(this, Ft, Xi).call(this), d(this, Ut, Yi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2682
|
+
}, Ft = new WeakSet(), Xi = function() {
|
|
2683
2683
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2684
2684
|
let c;
|
|
2685
2685
|
function u() {
|
|
@@ -2744,7 +2744,7 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2744
2744
|
}), t.addEventListener("mouseleave", function() {
|
|
2745
2745
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2746
2746
|
});
|
|
2747
|
-
}, Ut = new WeakSet(),
|
|
2747
|
+
}, Ut = new WeakSet(), Yi = function() {
|
|
2748
2748
|
const t = this;
|
|
2749
2749
|
function e() {
|
|
2750
2750
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
@@ -2782,7 +2782,7 @@ const Ze = function(n, i) {
|
|
|
2782
2782
|
}
|
|
2783
2783
|
n.classList.remove(i);
|
|
2784
2784
|
};
|
|
2785
|
-
var Jt,
|
|
2785
|
+
var Jt, Fi, Zt, Ui, Qt, Ji, nt, Me, Y, ft, Vt, Zi;
|
|
2786
2786
|
class Qe {
|
|
2787
2787
|
constructor(i) {
|
|
2788
2788
|
// 初始化
|
|
@@ -2794,34 +2794,31 @@ class Qe {
|
|
|
2794
2794
|
// 卷軸位置判斷
|
|
2795
2795
|
h(this, nt);
|
|
2796
2796
|
// 隱藏按鈕判斷
|
|
2797
|
-
h(this,
|
|
2797
|
+
h(this, Y);
|
|
2798
2798
|
// 選項事件綁定
|
|
2799
2799
|
h(this, Vt);
|
|
2800
|
-
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Jt,
|
|
2800
|
+
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Jt, Fi).call(this);
|
|
2801
2801
|
}
|
|
2802
2802
|
// 更新 active 位置
|
|
2803
2803
|
update(i = !1) {
|
|
2804
2804
|
const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
|
|
2805
2805
|
if (!e || !t)
|
|
2806
2806
|
return;
|
|
2807
|
-
const s =
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
behavior: "smooth",
|
|
2813
|
-
block: "nearest",
|
|
2814
|
-
inline: r
|
|
2807
|
+
const s = () => {
|
|
2808
|
+
const o = t.getBoundingClientRect(), a = e.getBoundingClientRect(), r = o.left + o.width / 2, c = a.left + a.width / 2 - r, u = t.scrollLeft + c;
|
|
2809
|
+
t.scrollTo({
|
|
2810
|
+
left: u,
|
|
2811
|
+
behavior: "smooth"
|
|
2815
2812
|
});
|
|
2816
2813
|
};
|
|
2817
2814
|
if (i && !this._didInitialScroll) {
|
|
2818
|
-
this._didInitialScroll = !0, setTimeout(
|
|
2815
|
+
this._didInitialScroll = !0, setTimeout(s, 250);
|
|
2819
2816
|
return;
|
|
2820
2817
|
}
|
|
2821
|
-
|
|
2818
|
+
s();
|
|
2822
2819
|
}
|
|
2823
2820
|
}
|
|
2824
|
-
Jt = new WeakSet(),
|
|
2821
|
+
Jt = new WeakSet(), Fi = function() {
|
|
2825
2822
|
var s, o, a, r;
|
|
2826
2823
|
const i = this;
|
|
2827
2824
|
if (!i.$element)
|
|
@@ -2830,7 +2827,7 @@ Jt = new WeakSet(), Yi = function() {
|
|
|
2830
2827
|
let t = !1;
|
|
2831
2828
|
const e = () => {
|
|
2832
2829
|
t || (requestAnimationFrame(() => {
|
|
2833
|
-
d(this, nt, Me).call(this), d(this,
|
|
2830
|
+
d(this, nt, Me).call(this), d(this, Y, ft).call(this), t = !1;
|
|
2834
2831
|
}), t = !0);
|
|
2835
2832
|
};
|
|
2836
2833
|
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Qt, Ji).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
@@ -2844,7 +2841,7 @@ Jt = new WeakSet(), Yi = function() {
|
|
|
2844
2841
|
</div>
|
|
2845
2842
|
</div>`
|
|
2846
2843
|
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Zt, Ui).call(a)), d(r = i, Vt, Zi).call(r), i.update(!0), requestAnimationFrame(() => {
|
|
2847
|
-
d(this, nt, Me).call(this), d(this,
|
|
2844
|
+
d(this, nt, Me).call(this), d(this, Y, ft).call(this);
|
|
2848
2845
|
});
|
|
2849
2846
|
}, Zt = new WeakSet(), Ui = function() {
|
|
2850
2847
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
@@ -2854,7 +2851,7 @@ Jt = new WeakSet(), Yi = function() {
|
|
|
2854
2851
|
behavior: "smooth"
|
|
2855
2852
|
}), setTimeout(() => {
|
|
2856
2853
|
var r;
|
|
2857
|
-
d(r = i,
|
|
2854
|
+
d(r = i, Y, ft).call(r);
|
|
2858
2855
|
}, 100);
|
|
2859
2856
|
};
|
|
2860
2857
|
e.forEach((o) => {
|
|
@@ -2893,7 +2890,7 @@ Jt = new WeakSet(), Yi = function() {
|
|
|
2893
2890
|
}, nt = new WeakSet(), Me = function() {
|
|
2894
2891
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2895
2892
|
e <= 0 || ($(i, "scrollable"), s == 0 ? ($(t, "start"), _(t, "end")) : s + 1 >= e ? (_(t, "start"), $(t, "end")) : ($(t, "center"), _(t, "start"), _(t, "end")));
|
|
2896
|
-
},
|
|
2893
|
+
}, Y = new WeakSet(), ft = function() {
|
|
2897
2894
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2898
2895
|
if (!t)
|
|
2899
2896
|
return;
|
|
@@ -2971,7 +2968,7 @@ const sn = (n) => {
|
|
|
2971
2968
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2972
2969
|
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
2973
2970
|
};
|
|
2974
|
-
var se, es, ne, is, ot, Ie,
|
|
2971
|
+
var se, es, ne, is, ot, Ie, F, vt;
|
|
2975
2972
|
class nn extends HTMLElement {
|
|
2976
2973
|
constructor() {
|
|
2977
2974
|
super();
|
|
@@ -2980,7 +2977,7 @@ class nn extends HTMLElement {
|
|
|
2980
2977
|
// 斷點設定
|
|
2981
2978
|
h(this, ot);
|
|
2982
2979
|
// check type
|
|
2983
|
-
h(this,
|
|
2980
|
+
h(this, F);
|
|
2984
2981
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
2985
2982
|
}
|
|
2986
2983
|
static get observedAttributes() {
|
|
@@ -2992,7 +2989,7 @@ class nn extends HTMLElement {
|
|
|
2992
2989
|
case "m4-type":
|
|
2993
2990
|
if (e === null || e === s)
|
|
2994
2991
|
return;
|
|
2995
|
-
this.s.type = s, d(this,
|
|
2992
|
+
this.s.type = s, d(this, F, vt).call(this);
|
|
2996
2993
|
break;
|
|
2997
2994
|
case "m4-status":
|
|
2998
2995
|
if (e === s)
|
|
@@ -3032,14 +3029,14 @@ se = new WeakSet(), es = function() {
|
|
|
3032
3029
|
}, ot = new WeakSet(), Ie = function() {
|
|
3033
3030
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3034
3031
|
if (!t.length) {
|
|
3035
|
-
d(this,
|
|
3032
|
+
d(this, F, vt).call(this);
|
|
3036
3033
|
return;
|
|
3037
3034
|
}
|
|
3038
3035
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3039
3036
|
var s, o, a, r;
|
|
3040
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this,
|
|
3037
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F, vt).call(this), window.innerWidth >= e;
|
|
3041
3038
|
});
|
|
3042
|
-
},
|
|
3039
|
+
}, F = new WeakSet(), vt = function() {
|
|
3043
3040
|
var o;
|
|
3044
3041
|
const { type: t } = this.s;
|
|
3045
3042
|
this.innerHTML = "", [...sn(this)].forEach((a) => {
|
|
@@ -3397,14 +3394,14 @@ function Es() {
|
|
|
3397
3394
|
});
|
|
3398
3395
|
}
|
|
3399
3396
|
document.addEventListener("click", Es);
|
|
3400
|
-
var ct, Pe, Ee,
|
|
3397
|
+
var ct, Pe, Ee, Ls, Le, As, Ae, Ss;
|
|
3401
3398
|
class cn extends HTMLElement {
|
|
3402
3399
|
constructor() {
|
|
3403
3400
|
super();
|
|
3404
3401
|
h(this, ct);
|
|
3405
3402
|
h(this, Ee);
|
|
3406
|
-
h(this, Ae);
|
|
3407
3403
|
h(this, Le);
|
|
3404
|
+
h(this, Ae);
|
|
3408
3405
|
this.initialize = !1;
|
|
3409
3406
|
}
|
|
3410
3407
|
connectedCallback() {
|
|
@@ -3430,13 +3427,13 @@ ct = new WeakSet(), Pe = function() {
|
|
|
3430
3427
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3431
3428
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3432
3429
|
};
|
|
3433
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee,
|
|
3434
|
-
}, Ee = new WeakSet(),
|
|
3435
|
-
d(this,
|
|
3436
|
-
},
|
|
3430
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee, Ls).call(this);
|
|
3431
|
+
}, Ee = new WeakSet(), Ls = function() {
|
|
3432
|
+
d(this, Le, As).call(this), d(this, Ae, Ss).call(this), this.classList.add("r4-initialize");
|
|
3433
|
+
}, Le = new WeakSet(), As = function() {
|
|
3437
3434
|
const t = this, e = document.createElement("i");
|
|
3438
3435
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3439
|
-
},
|
|
3436
|
+
}, Ae = new WeakSet(), Ss = function() {
|
|
3440
3437
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3441
3438
|
e.addEventListener("click", function(a) {
|
|
3442
3439
|
a.stopPropagation(), e.s.options.click && ln(a, e);
|
|
@@ -3652,8 +3649,8 @@ export {
|
|
|
3652
3649
|
cn as R,
|
|
3653
3650
|
Xn as S,
|
|
3654
3651
|
ss as T,
|
|
3655
|
-
|
|
3656
|
-
|
|
3652
|
+
Yn as U,
|
|
3653
|
+
Fn as V,
|
|
3657
3654
|
Un as W,
|
|
3658
3655
|
Jn as X,
|
|
3659
3656
|
Zn as Y,
|