@xwadex/fesd 0.0.49 → 0.0.50
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/image-preview-bundle.js +147 -144
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +20 -21
- package/package.json +1 -1
|
@@ -334,9 +334,9 @@ const ze = {
|
|
|
334
334
|
return n;
|
|
335
335
|
}
|
|
336
336
|
return JSON.parse(n);
|
|
337
|
-
},
|
|
337
|
+
}, L = (n, i) => {
|
|
338
338
|
console.warn(`[${n} warn]: ${i}`);
|
|
339
|
-
},
|
|
339
|
+
}, Fe = (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 = (A) => {
|
|
388
388
|
const z = x(t);
|
|
389
|
-
i && i.emit(
|
|
389
|
+
i && i.emit(A, z), !i && n.on && G(n.on[A]) && n.on[A](z);
|
|
390
390
|
};
|
|
391
391
|
D("beforeScroll");
|
|
392
392
|
const U = () => {
|
|
393
393
|
y += C;
|
|
394
|
-
const
|
|
395
|
-
m[u] =
|
|
394
|
+
const A = Os[r](y, v, T, o);
|
|
395
|
+
m[u] = A, 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, At, hi, Lt, 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, Lt);
|
|
485
484
|
h(this, At);
|
|
485
|
+
h(this, Lt);
|
|
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, Lt, 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) || (L(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && L(`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, At, hi).call(this);
|
|
526
|
+
}, At = 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
|
+
}, Lt = 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
|
+
}, Ye = (n, i) => {
|
|
582
582
|
const { target: t } = n, e = We[t] || x(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 L("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
|
+
Ye(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" && L("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), Ye(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, Ai, Ct, Li, 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
|
+
L("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, Ai).call(this);
|
|
826
|
+
}, _t = new WeakSet(), Ai = 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, Li).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(), Li = 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() {
|
|
@@ -897,10 +897,7 @@ xt = new WeakSet(), Ti = function() {
|
|
|
897
897
|
const { videoId: t, autoplay: e } = this;
|
|
898
898
|
return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
|
|
899
899
|
};
|
|
900
|
-
|
|
901
|
-
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
902
|
-
});
|
|
903
|
-
let J = 0;
|
|
900
|
+
let Z = 0;
|
|
904
901
|
function Ci(n) {
|
|
905
902
|
const i = [];
|
|
906
903
|
return (n || []).forEach((t) => {
|
|
@@ -909,15 +906,15 @@ function Ci(n) {
|
|
|
909
906
|
}
|
|
910
907
|
function Hi(n) {
|
|
911
908
|
const i = Ci(n);
|
|
912
|
-
|
|
909
|
+
Z += 1, Z === 1 && (document.documentElement.classList.add("scrollLock"), $s(i));
|
|
913
910
|
}
|
|
914
911
|
function Mi(n) {
|
|
915
|
-
if (
|
|
912
|
+
if (Z = Math.max(0, Z - 1), Z === 0) {
|
|
916
913
|
const i = Ci(n);
|
|
917
914
|
_s(i), document.documentElement.classList.remove("scrollLock");
|
|
918
915
|
}
|
|
919
916
|
}
|
|
920
|
-
async function
|
|
917
|
+
async function kn(n = 0) {
|
|
921
918
|
if (f(".loading-wrapper").length)
|
|
922
919
|
return;
|
|
923
920
|
f("body").append(`
|
|
@@ -934,12 +931,12 @@ async function xn(n = 0) {
|
|
|
934
931
|
Hi();
|
|
935
932
|
});
|
|
936
933
|
}
|
|
937
|
-
function
|
|
934
|
+
function xn() {
|
|
938
935
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
939
936
|
f(".loading-wrapper").remove(), Mi();
|
|
940
937
|
});
|
|
941
938
|
}
|
|
942
|
-
function
|
|
939
|
+
function $n(n, i) {
|
|
943
940
|
new vn(n, i);
|
|
944
941
|
}
|
|
945
942
|
function Gs() {
|
|
@@ -947,13 +944,13 @@ function Gs() {
|
|
|
947
944
|
} }), e = new dn();
|
|
948
945
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
949
946
|
}
|
|
950
|
-
function
|
|
947
|
+
function _n(n, i = () => {
|
|
951
948
|
}) {
|
|
952
949
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
953
950
|
typeof i == "function" && i();
|
|
954
951
|
}).siblings("[data-tab-content]").hide(), Gs();
|
|
955
952
|
}
|
|
956
|
-
function
|
|
953
|
+
function Cn() {
|
|
957
954
|
je(
|
|
958
955
|
{
|
|
959
956
|
target: document.body,
|
|
@@ -978,27 +975,30 @@ function Hn() {
|
|
|
978
975
|
}
|
|
979
976
|
);
|
|
980
977
|
}
|
|
981
|
-
function
|
|
978
|
+
function Hn() {
|
|
982
979
|
window.onpageshow = function(n) {
|
|
983
980
|
n.persisted && window.location.reload();
|
|
984
981
|
};
|
|
985
982
|
}
|
|
986
|
-
function
|
|
983
|
+
function Mn() {
|
|
987
984
|
const n = navigator.userAgent;
|
|
988
985
|
return {
|
|
989
986
|
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
|
990
987
|
};
|
|
991
988
|
}
|
|
992
|
-
function
|
|
989
|
+
function In(n, i) {
|
|
993
990
|
f(n).on("click", function() {
|
|
994
991
|
f(this).toggleClass(i);
|
|
995
992
|
});
|
|
996
993
|
}
|
|
997
|
-
function
|
|
994
|
+
function qn(n, i) {
|
|
998
995
|
f(n).on("click", function() {
|
|
999
996
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
1000
997
|
});
|
|
1001
998
|
}
|
|
999
|
+
const On = (n) => new Promise((i) => {
|
|
1000
|
+
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
1001
|
+
});
|
|
1002
1002
|
function Rs(n, i = 250) {
|
|
1003
1003
|
let t = null;
|
|
1004
1004
|
return function(...e) {
|
|
@@ -1080,7 +1080,7 @@ function Xn(n) {
|
|
|
1080
1080
|
});
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Fn(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 Yn(n) {
|
|
|
1088
1088
|
n.slideNext();
|
|
1089
1089
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Yn() {
|
|
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 = "";
|
|
@@ -1116,12 +1116,12 @@ function Un() {
|
|
|
1116
1116
|
});
|
|
1117
1117
|
});
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function Jn(n) {
|
|
1120
1120
|
const i = getComputedStyle(n).transform;
|
|
1121
1121
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1122
1122
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function Zn(n) {
|
|
1125
1125
|
const i = getComputedStyle(n).transform;
|
|
1126
1126
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1127
1127
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
@@ -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
|
+
Fe("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) || Fe("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>'), L("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) : L("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
|
+
}) : L("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) || L("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>'), L("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 || L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || L("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 A = 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 && A.classList.add("active");
|
|
1260
|
+
}).observe(A);
|
|
1261
1261
|
}
|
|
1262
1262
|
if (o == "inBox") {
|
|
1263
|
-
const
|
|
1263
|
+
const A = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1264
1264
|
let z;
|
|
1265
|
-
|
|
1265
|
+
A == 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="${A}"
|
|
1290
1290
|
type="image/webp"
|
|
1291
1291
|
/>
|
|
1292
1292
|
<source
|
|
1293
|
-
srcset="${
|
|
1293
|
+
srcset="${A}"
|
|
1294
1294
|
type="image/jpeg"
|
|
1295
1295
|
/>
|
|
1296
|
-
<img src="${
|
|
1296
|
+
<img src="${A}" 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 Fs = {
|
|
1350
1350
|
"zh-tw": {
|
|
1351
1351
|
臺北市: [
|
|
1352
1352
|
["中正區", "100"],
|
|
@@ -2177,7 +2177,7 @@ const Ys = {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
};
|
|
2179
2179
|
let Q;
|
|
2180
|
-
const
|
|
2180
|
+
const Ys = (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 Fs = (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 || L("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");
|
|
@@ -2250,13 +2250,13 @@ const Fs = (n) => {
|
|
|
2250
2250
|
break;
|
|
2251
2251
|
}
|
|
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 = Fs, 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"));
|
|
2259
|
-
},
|
|
2259
|
+
}, Zs = (n, i) => {
|
|
2260
2260
|
const t = n.s.cityLang;
|
|
2261
2261
|
Q[t][i].forEach((e, s) => {
|
|
2262
2262
|
const o = document.createElement("li");
|
|
@@ -2360,11 +2360,11 @@ 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 = Ys(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;
|
|
2367
|
-
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
|
2367
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Js(t), t.s.subDropdownTotalH = 0;
|
|
2368
2368
|
const e = t.getAttribute("d4-value");
|
|
2369
2369
|
switch (t.s.selectType) {
|
|
2370
2370
|
case "single":
|
|
@@ -2373,7 +2373,7 @@ Bt = new WeakSet(), ji = function() {
|
|
|
2373
2373
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2374
2374
|
if (r && l) {
|
|
2375
2375
|
const c = r.getAttribute("d4-value");
|
|
2376
|
-
if (
|
|
2376
|
+
if (Zs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2377
2377
|
const u = e.split(",")[1];
|
|
2378
2378
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2379
2379
|
}
|
|
@@ -2534,7 +2534,7 @@ function gt(n) {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2537
|
+
function Je(n) {
|
|
2538
2538
|
if (gt(n)) {
|
|
2539
2539
|
let i;
|
|
2540
2540
|
const t = Object.keys(gt(n)).map((e) => ({
|
|
@@ -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, Ft, Ri, Yt, Xi, Ut, Fi;
|
|
2627
2627
|
class tn extends HTMLElement {
|
|
2628
2628
|
constructor() {
|
|
2629
2629
|
super();
|
|
2630
2630
|
h(this, Xt);
|
|
2631
|
-
h(this, Yt);
|
|
2632
2631
|
h(this, Ft);
|
|
2632
|
+
h(this, Yt);
|
|
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 =
|
|
2669
|
-
},
|
|
2668
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Je(this), Vs(this), d(this, Ft, Ri).call(this);
|
|
2669
|
+
}, Ft = 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, Yt, Xi).call(this), d(this, Ut, Fi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2682
|
+
}, Yt = 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,11 +2744,11 @@ 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(), Fi = 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;
|
|
2751
|
-
t.s.nowDuration =
|
|
2751
|
+
t.s.nowDuration = Je(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
|
|
2752
2752
|
duration: t.s.nowDuration,
|
|
2753
2753
|
iterations: 1 / 0
|
|
2754
2754
|
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
|
|
@@ -2760,7 +2760,7 @@ Xt = new WeakSet(), Gi = function() {
|
|
|
2760
2760
|
window.addEventListener("resize", Ks(e));
|
|
2761
2761
|
};
|
|
2762
2762
|
customElements.define("marquee-el", tn);
|
|
2763
|
-
const
|
|
2763
|
+
const Ze = function(n, i) {
|
|
2764
2764
|
let t;
|
|
2765
2765
|
return function(e) {
|
|
2766
2766
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
@@ -2782,36 +2782,40 @@ const Je = function(n, i) {
|
|
|
2782
2782
|
}
|
|
2783
2783
|
n.classList.remove(i);
|
|
2784
2784
|
};
|
|
2785
|
-
var
|
|
2785
|
+
var Jt, Yi, Zt, Ui, Qt, Ji, nt, Me, F, ft, Vt, Zi;
|
|
2786
2786
|
class Qe {
|
|
2787
2787
|
constructor(i) {
|
|
2788
2788
|
// 初始化
|
|
2789
|
-
h(this, Zt);
|
|
2790
|
-
// 左右箭頭事件綁定
|
|
2791
2789
|
h(this, Jt);
|
|
2790
|
+
// 左右箭頭事件綁定
|
|
2791
|
+
h(this, Zt);
|
|
2792
2792
|
// 左右拖拉事件綁定
|
|
2793
2793
|
h(this, Qt);
|
|
2794
2794
|
// 卷軸位置判斷
|
|
2795
2795
|
h(this, nt);
|
|
2796
2796
|
// 隱藏按鈕判斷
|
|
2797
|
-
h(this,
|
|
2797
|
+
h(this, F);
|
|
2798
2798
|
// 選項事件綁定
|
|
2799
2799
|
h(this, Vt);
|
|
2800
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
|
2800
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Jt, Yi).call(this);
|
|
2801
2801
|
}
|
|
2802
2802
|
// 更新 active 位置
|
|
2803
2803
|
update(i) {
|
|
2804
2804
|
const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
|
|
2805
|
-
if (e) {
|
|
2806
|
-
const s =
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2805
|
+
if (e && t) {
|
|
2806
|
+
const s = t.querySelectorAll(".item"), o = e === s[0], a = e === s[s.length - 1];
|
|
2807
|
+
let r = "center";
|
|
2808
|
+
o ? r = "start" : a && (r = "end"), setTimeout(() => {
|
|
2809
|
+
e.scrollIntoView({
|
|
2810
|
+
behavior: "smooth",
|
|
2811
|
+
block: "nearest",
|
|
2812
|
+
inline: r
|
|
2813
|
+
});
|
|
2814
|
+
}, 100);
|
|
2811
2815
|
}
|
|
2812
2816
|
}
|
|
2813
2817
|
}
|
|
2814
|
-
|
|
2818
|
+
Jt = new WeakSet(), Yi = function() {
|
|
2815
2819
|
var s, o, a, r;
|
|
2816
2820
|
const i = this;
|
|
2817
2821
|
if (!i.$element)
|
|
@@ -2820,10 +2824,10 @@ Zt = new WeakSet(), Fi = function() {
|
|
|
2820
2824
|
let t = !1;
|
|
2821
2825
|
const e = () => {
|
|
2822
2826
|
t || (requestAnimationFrame(() => {
|
|
2823
|
-
d(this, nt, Me).call(this), d(this,
|
|
2827
|
+
d(this, nt, Me).call(this), d(this, F, ft).call(this), t = !1;
|
|
2824
2828
|
}), t = !0);
|
|
2825
2829
|
};
|
|
2826
|
-
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,
|
|
2830
|
+
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(
|
|
2827
2831
|
S.prepend,
|
|
2828
2832
|
`<div class="navigation">
|
|
2829
2833
|
<div class="button prev">
|
|
@@ -2833,10 +2837,10 @@ Zt = new WeakSet(), Fi = function() {
|
|
|
2833
2837
|
<div></div>
|
|
2834
2838
|
</div>
|
|
2835
2839
|
</div>`
|
|
2836
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i,
|
|
2837
|
-
d(this, nt, Me).call(this), d(this,
|
|
2840
|
+
), 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(), requestAnimationFrame(() => {
|
|
2841
|
+
d(this, nt, Me).call(this), d(this, F, ft).call(this);
|
|
2838
2842
|
});
|
|
2839
|
-
},
|
|
2843
|
+
}, Zt = new WeakSet(), Ui = function() {
|
|
2840
2844
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2841
2845
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2842
2846
|
t.scrollTo({
|
|
@@ -2844,13 +2848,13 @@ Zt = new WeakSet(), Fi = function() {
|
|
|
2844
2848
|
behavior: "smooth"
|
|
2845
2849
|
}), setTimeout(() => {
|
|
2846
2850
|
var r;
|
|
2847
|
-
d(r = i,
|
|
2851
|
+
d(r = i, F, ft).call(r);
|
|
2848
2852
|
}, 100);
|
|
2849
2853
|
};
|
|
2850
2854
|
e.forEach((o) => {
|
|
2851
2855
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2852
2856
|
});
|
|
2853
|
-
}, Qt = new WeakSet(),
|
|
2857
|
+
}, Qt = new WeakSet(), Ji = function() {
|
|
2854
2858
|
const { $wrapper: i } = this;
|
|
2855
2859
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2856
2860
|
const a = function(p) {
|
|
@@ -2883,7 +2887,7 @@ Zt = new WeakSet(), Fi = function() {
|
|
|
2883
2887
|
}, nt = new WeakSet(), Me = function() {
|
|
2884
2888
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2885
2889
|
e <= 0 || (_(i, "scrollable"), s == 0 ? (k(i, "scrollable"), _(t, "start"), k(t, "end")) : s + 1 >= e ? (k(i, "scrollable"), k(t, "start"), _(t, "end")) : (_(t, "center"), k(t, "start"), k(t, "end")));
|
|
2886
|
-
},
|
|
2890
|
+
}, F = new WeakSet(), ft = function() {
|
|
2887
2891
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2888
2892
|
if (!t)
|
|
2889
2893
|
return;
|
|
@@ -2905,7 +2909,7 @@ Zt = new WeakSet(), Fi = function() {
|
|
|
2905
2909
|
}
|
|
2906
2910
|
k(a, "hide");
|
|
2907
2911
|
}) : k(t, "hide");
|
|
2908
|
-
}, Vt = new WeakSet(),
|
|
2912
|
+
}, Vt = new WeakSet(), Zi = function() {
|
|
2909
2913
|
const { $element: i } = this, t = (s) => {
|
|
2910
2914
|
if (this.option.selected) {
|
|
2911
2915
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2961,7 +2965,7 @@ const sn = (n) => {
|
|
|
2961
2965
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2962
2966
|
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;
|
|
2963
2967
|
};
|
|
2964
|
-
var se, es, ne, is, ot, Ie,
|
|
2968
|
+
var se, es, ne, is, ot, Ie, Y, vt;
|
|
2965
2969
|
class nn extends HTMLElement {
|
|
2966
2970
|
constructor() {
|
|
2967
2971
|
super();
|
|
@@ -2970,7 +2974,7 @@ class nn extends HTMLElement {
|
|
|
2970
2974
|
// 斷點設定
|
|
2971
2975
|
h(this, ot);
|
|
2972
2976
|
// check type
|
|
2973
|
-
h(this,
|
|
2977
|
+
h(this, Y);
|
|
2974
2978
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
2975
2979
|
}
|
|
2976
2980
|
static get observedAttributes() {
|
|
@@ -2982,7 +2986,7 @@ class nn extends HTMLElement {
|
|
|
2982
2986
|
case "m4-type":
|
|
2983
2987
|
if (e === null || e === s)
|
|
2984
2988
|
return;
|
|
2985
|
-
this.s.type = s, d(this,
|
|
2989
|
+
this.s.type = s, d(this, Y, vt).call(this);
|
|
2986
2990
|
break;
|
|
2987
2991
|
case "m4-status":
|
|
2988
2992
|
if (e === s)
|
|
@@ -3016,20 +3020,20 @@ se = new WeakSet(), es = function() {
|
|
|
3016
3020
|
}
|
|
3017
3021
|
this.update();
|
|
3018
3022
|
};
|
|
3019
|
-
window.removeEventListener("resize",
|
|
3023
|
+
window.removeEventListener("resize", Ze(e)), window.addEventListener("resize", Ze(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, ne, is).call(this);
|
|
3020
3024
|
}, ne = new WeakSet(), is = function() {
|
|
3021
3025
|
this.classList.add("m4-init"), d(this, ot, Ie).call(this);
|
|
3022
3026
|
}, ot = new WeakSet(), Ie = function() {
|
|
3023
3027
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3024
3028
|
if (!t.length) {
|
|
3025
|
-
d(this,
|
|
3029
|
+
d(this, Y, vt).call(this);
|
|
3026
3030
|
return;
|
|
3027
3031
|
}
|
|
3028
3032
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3029
3033
|
var s, o, a, r;
|
|
3030
|
-
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,
|
|
3034
|
+
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, Y, vt).call(this), window.innerWidth >= e;
|
|
3031
3035
|
});
|
|
3032
|
-
},
|
|
3036
|
+
}, Y = new WeakSet(), vt = function() {
|
|
3033
3037
|
var o;
|
|
3034
3038
|
const { type: t } = this.s;
|
|
3035
3039
|
this.innerHTML = "", [...sn(this)].forEach((a) => {
|
|
@@ -3047,7 +3051,7 @@ se = new WeakSet(), es = function() {
|
|
|
3047
3051
|
(o = this.drag) == null || o.update();
|
|
3048
3052
|
};
|
|
3049
3053
|
customElements.define("multipurpose-nav", nn);
|
|
3050
|
-
var oe, ns, ae, os, at, qe, W,
|
|
3054
|
+
var oe, ns, ae, os, at, qe, W, J, re, as, le, rs, ce, ls, de, cs, ue, ds, he, us, pe, hs, me, ps, ge, ms, N, R, fe, gs, ve, fs, be, vs, ye, bs;
|
|
3051
3055
|
class ss extends HTMLElement {
|
|
3052
3056
|
// 定義組件的初始狀態
|
|
3053
3057
|
constructor(t, e) {
|
|
@@ -3107,19 +3111,19 @@ class ss extends HTMLElement {
|
|
|
3107
3111
|
setActiveTab(t) {
|
|
3108
3112
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
|
3109
3113
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
3110
|
-
const o = d(this, W,
|
|
3114
|
+
const o = d(this, W, J).call(this, s);
|
|
3111
3115
|
e.tabPanels.forEach((a, r) => {
|
|
3112
3116
|
r === o ? d(this, ve, fs).call(this, r) : d(this, fe, gs).call(this, r);
|
|
3113
3117
|
});
|
|
3114
3118
|
}
|
|
3115
3119
|
// 外部呼叫方法 $0.goNext()
|
|
3116
3120
|
goNext() {
|
|
3117
|
-
const t = d(this, W,
|
|
3121
|
+
const t = d(this, W, J).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3118
3122
|
this.setActiveTab(s);
|
|
3119
3123
|
}
|
|
3120
3124
|
// 外部呼叫方法 $0.goPrev()
|
|
3121
3125
|
goPrev() {
|
|
3122
|
-
const t = d(this, W,
|
|
3126
|
+
const t = d(this, W, J).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3123
3127
|
this.setActiveTab(s);
|
|
3124
3128
|
}
|
|
3125
3129
|
// 外部呼叫方法 $0.update()
|
|
@@ -3159,7 +3163,7 @@ oe = new WeakSet(), ns = function() {
|
|
|
3159
3163
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
|
3160
3164
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
3161
3165
|
}), e;
|
|
3162
|
-
}, W = new WeakSet(),
|
|
3166
|
+
}, W = new WeakSet(), J = function(t) {
|
|
3163
3167
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
|
3164
3168
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3165
3169
|
const o = s[0];
|
|
@@ -3275,7 +3279,7 @@ oe = new WeakSet(), ns = function() {
|
|
|
3275
3279
|
break;
|
|
3276
3280
|
}
|
|
3277
3281
|
}, be = new WeakSet(), vs = function(t) {
|
|
3278
|
-
const e = d(this, W,
|
|
3282
|
+
const e = d(this, W, J).call(this, t);
|
|
3279
3283
|
d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
|
|
3280
3284
|
}, ye = new WeakSet(), bs = function() {
|
|
3281
3285
|
const t = this;
|
|
@@ -3387,14 +3391,14 @@ function Es() {
|
|
|
3387
3391
|
});
|
|
3388
3392
|
}
|
|
3389
3393
|
document.addEventListener("click", Es);
|
|
3390
|
-
var ct, Pe, Ee,
|
|
3394
|
+
var ct, Pe, Ee, As, Ae, Ls, Le, Ss;
|
|
3391
3395
|
class cn extends HTMLElement {
|
|
3392
3396
|
constructor() {
|
|
3393
3397
|
super();
|
|
3394
3398
|
h(this, ct);
|
|
3395
3399
|
h(this, Ee);
|
|
3396
|
-
h(this, Le);
|
|
3397
3400
|
h(this, Ae);
|
|
3401
|
+
h(this, Le);
|
|
3398
3402
|
this.initialize = !1;
|
|
3399
3403
|
}
|
|
3400
3404
|
connectedCallback() {
|
|
@@ -3420,13 +3424,13 @@ ct = new WeakSet(), Pe = function() {
|
|
|
3420
3424
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3421
3425
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3422
3426
|
};
|
|
3423
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee,
|
|
3424
|
-
}, Ee = new WeakSet(),
|
|
3425
|
-
d(this,
|
|
3426
|
-
},
|
|
3427
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee, As).call(this);
|
|
3428
|
+
}, Ee = new WeakSet(), As = function() {
|
|
3429
|
+
d(this, Ae, Ls).call(this), d(this, Le, Ss).call(this), this.classList.add("r4-initialize");
|
|
3430
|
+
}, Ae = new WeakSet(), Ls = function() {
|
|
3427
3431
|
const t = this, e = document.createElement("i");
|
|
3428
3432
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3429
|
-
},
|
|
3433
|
+
}, Le = new WeakSet(), Ss = function() {
|
|
3430
3434
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3431
3435
|
e.addEventListener("click", function(a) {
|
|
3432
3436
|
a.stopPropagation(), e.s.options.click && ln(a, e);
|
|
@@ -3623,31 +3627,30 @@ class vn {
|
|
|
3623
3627
|
}
|
|
3624
3628
|
export {
|
|
3625
3629
|
oi as A,
|
|
3626
|
-
|
|
3630
|
+
Mn as B,
|
|
3627
3631
|
rn as C,
|
|
3628
3632
|
Pi as D,
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
+
In as E,
|
|
3634
|
+
qn as F,
|
|
3635
|
+
On as G,
|
|
3636
|
+
Nn as H,
|
|
3633
3637
|
dn as I,
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3638
|
+
Pn as J,
|
|
3639
|
+
jn as K,
|
|
3640
|
+
zn as L,
|
|
3637
3641
|
V as M,
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
+
Bn as N,
|
|
3643
|
+
Wn as O,
|
|
3644
|
+
Gn as P,
|
|
3645
|
+
Rn as Q,
|
|
3642
3646
|
cn as R,
|
|
3643
|
-
|
|
3647
|
+
Xn as S,
|
|
3644
3648
|
ss as T,
|
|
3645
|
-
|
|
3649
|
+
Fn as U,
|
|
3646
3650
|
Yn as V,
|
|
3647
|
-
|
|
3648
|
-
|
|
3651
|
+
Un as W,
|
|
3652
|
+
Jn as X,
|
|
3649
3653
|
Zn as Y,
|
|
3650
|
-
Jn as Z,
|
|
3651
3654
|
E as a,
|
|
3652
3655
|
ut as b,
|
|
3653
3656
|
Ms as c,
|
|
@@ -3663,16 +3666,16 @@ export {
|
|
|
3663
3666
|
vn as m,
|
|
3664
3667
|
Rs as n,
|
|
3665
3668
|
Qn as o,
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
+
Hi as p,
|
|
3670
|
+
Mi as q,
|
|
3671
|
+
kn as r,
|
|
3669
3672
|
Cs as s,
|
|
3670
|
-
|
|
3671
|
-
|
|
3673
|
+
xn as t,
|
|
3674
|
+
$n as u,
|
|
3672
3675
|
_e as v,
|
|
3673
|
-
|
|
3676
|
+
Gs as w,
|
|
3674
3677
|
_n as x,
|
|
3675
|
-
|
|
3676
|
-
|
|
3678
|
+
Cn as y,
|
|
3679
|
+
Hn as z
|
|
3677
3680
|
};
|
|
3678
3681
|
//# sourceMappingURL=image-preview-bundle.js.map
|