@xwadex/fesd 0.0.14-re.88 → 0.0.14-re.90
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/fesd-bundle.css +1 -1
- package/dist/image-preview-bundle.js +117 -119
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -88,7 +88,7 @@ const Y = {
|
|
88
88
|
</div>
|
89
89
|
`;
|
90
90
|
}
|
91
|
-
},
|
91
|
+
}, $ = {
|
92
92
|
SETTINGS: {
|
93
93
|
direction: "left",
|
94
94
|
// 方向 - top || right || bottom || left
|
@@ -180,7 +180,7 @@ const Y = {
|
|
180
180
|
beforeScroll: null,
|
181
181
|
afterScroll: null
|
182
182
|
}
|
183
|
-
},
|
183
|
+
}, C = {
|
184
184
|
SETTINGS: {
|
185
185
|
type: "drag",
|
186
186
|
drag: {
|
@@ -297,19 +297,19 @@ const Y = {
|
|
297
297
|
article4: ws,
|
298
298
|
collapse4: Je,
|
299
299
|
dropdown4: qe,
|
300
|
-
marquee4:
|
300
|
+
marquee4: $,
|
301
301
|
modal4: I,
|
302
|
-
multipurpose4:
|
302
|
+
multipurpose4: C,
|
303
303
|
ripple4: Ze,
|
304
304
|
share4: ys,
|
305
305
|
tab4: Ue,
|
306
306
|
video4: Y
|
307
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
307
|
+
}, Symbol.toStringTag, { value: "Module" })), E = {
|
308
308
|
before: "beforebegin",
|
309
309
|
after: "afterend",
|
310
310
|
append: "beforeend",
|
311
311
|
prepend: "afterbegin"
|
312
|
-
}, at = (n) => typeof n == "string" && n !== "", ye = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) =>
|
312
|
+
}, at = (n) => typeof n == "string" && n !== "", ye = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) => A(n) !== null, j = (n) => typeof n == "function", A = (n) => ye(n) ? n : document.querySelector(n), L = (n) => rt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
313
313
|
const i = document.createElement("div");
|
314
314
|
return i.innerHTML = n, i.childNodes;
|
315
315
|
}, As = (n) => {
|
@@ -319,13 +319,13 @@ const Y = {
|
|
319
319
|
return n;
|
320
320
|
}
|
321
321
|
return JSON.parse(n);
|
322
|
-
},
|
322
|
+
}, T = (n, i) => {
|
323
323
|
console.warn(`[${n} warn]: ${i}`);
|
324
324
|
}, je = (n, i) => {
|
325
325
|
console.error(`[${n} error]: ${i}`);
|
326
326
|
}, O = {
|
327
327
|
on(n, i) {
|
328
|
-
if (!
|
328
|
+
if (!j(i))
|
329
329
|
return this;
|
330
330
|
const { __events__: t } = this;
|
331
331
|
return n.split(" ").forEach((e) => {
|
@@ -341,7 +341,7 @@ const Y = {
|
|
341
341
|
}), this;
|
342
342
|
},
|
343
343
|
once(n, i) {
|
344
|
-
if (!
|
344
|
+
if (!j(i))
|
345
345
|
return this;
|
346
346
|
const t = (...e) => {
|
347
347
|
this.off(n, t), i.apply(this, e);
|
@@ -351,7 +351,7 @@ const Y = {
|
|
351
351
|
emit(...n) {
|
352
352
|
const { __events__: i } = this, t = n[0], e = n.slice(1, n.length);
|
353
353
|
return i[t] ? (i[t].forEach((s) => {
|
354
|
-
|
354
|
+
j(s) && s.apply(this, e);
|
355
355
|
}), this) : this;
|
356
356
|
}
|
357
357
|
}, Ls = {
|
@@ -365,19 +365,19 @@ const Y = {
|
|
365
365
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
366
366
|
}
|
367
367
|
}, we = (n, i) => {
|
368
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = w(e) ?
|
369
|
-
let
|
370
|
-
if (
|
368
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = w(e) ? A(e) : document.scrollingElement, f = m[u], b = w(t) ? A(t).getBoundingClientRect()[p] : 0 - f, y = w(s) ? A(s).getBoundingClientRect()[g] : 0, H = b - a - y, G = 15;
|
369
|
+
let S = 0;
|
370
|
+
if (H === 0)
|
371
371
|
return;
|
372
372
|
const R = (X) => {
|
373
|
-
const Ne =
|
374
|
-
i && i.emit(X, Ne), !i && n.on &&
|
373
|
+
const Ne = A(t);
|
374
|
+
i && i.emit(X, Ne), !i && n.on && j(n.on[X]) && n.on[X](Ne);
|
375
375
|
};
|
376
376
|
R("beforeScroll");
|
377
377
|
const Pe = () => {
|
378
|
-
|
379
|
-
const X = Ls[r](
|
380
|
-
m[u] = X,
|
378
|
+
S += G;
|
379
|
+
const X = Ls[r](S, f, H, o);
|
380
|
+
m[u] = X, S < o && requestAnimationFrame(Pe), S >= o && R("afterScroll");
|
381
381
|
};
|
382
382
|
requestAnimationFrame(Pe);
|
383
383
|
};
|
@@ -423,7 +423,7 @@ J = new WeakSet(), Ee = function() {
|
|
423
423
|
if (!at(i) || !w(i))
|
424
424
|
return;
|
425
425
|
const { SETTINGS: e, EVENTS: s } = lt;
|
426
|
-
if (this.elements = t.state == "not active" ?
|
426
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.elements = L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
427
427
|
for (const [o, a] of Object.entries(this.options.on))
|
428
428
|
this.__events__[o] = [a];
|
429
429
|
d(this, pt, Ve).call(this);
|
@@ -497,7 +497,7 @@ gt = new WeakSet(), ei = function() {
|
|
497
497
|
const { ATTRS: t } = I;
|
498
498
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
499
499
|
const e = this.getAttribute(t.id) || Ts();
|
500
|
-
this.getAttribute(t.id) || (
|
500
|
+
this.getAttribute(t.id) || (T(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && T(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, ft, ii).call(this);
|
501
501
|
}, ft = new WeakSet(), ii = function() {
|
502
502
|
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, vt, si).call(this);
|
503
503
|
}, vt = new WeakSet(), si = function() {
|
@@ -560,14 +560,14 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
560
560
|
if (!i)
|
561
561
|
return;
|
562
562
|
const e = n[i];
|
563
|
-
e &&
|
563
|
+
e && j(e) && e.apply(n, t);
|
564
564
|
}, ri = (n, ...i) => {
|
565
|
-
n &&
|
565
|
+
n && j(n) && n.apply(U, i);
|
566
566
|
}, ze = (n, i) => {
|
567
|
-
const { target: t } = n, e = Ie[t] ||
|
567
|
+
const { target: t } = n, e = Ie[t] || A(n.target);
|
568
568
|
e && li(n, i), e || Ds(n, i);
|
569
569
|
}, li = (n, i) => {
|
570
|
-
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] ||
|
570
|
+
const { target: t, action: e, on: s, e: o } = n, a = Ie[t] || A(n.target);
|
571
571
|
switch (["open", "close", "destroy"].forEach((l) => {
|
572
572
|
a.once(l, () => {
|
573
573
|
i && (i.emit(l, a, o), ai(i, s[l], a, o)), i || ri(s[l], a);
|
@@ -590,23 +590,23 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
590
590
|
}, Ds = async (n, i) => {
|
591
591
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
592
592
|
if (!e)
|
593
|
-
return
|
593
|
+
return T("modal4", "cannot find target or data-modal-route is not defined");
|
594
594
|
const r = (l, ...c) => {
|
595
595
|
i && (i.emit(l, ...c), ai(i, o[l], ...c)), i || ri(o[l], ...c);
|
596
596
|
};
|
597
597
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
598
|
-
const c = Es(l), u =
|
598
|
+
const c = Es(l), u = A(s) || A(I.SETTINGS.container);
|
599
599
|
[...c].forEach((g) => {
|
600
600
|
u.append(g);
|
601
601
|
});
|
602
|
-
const p = Ie[t] ||
|
602
|
+
const p = Ie[t] || A(n.target);
|
603
603
|
r("complete", p), li(n, i);
|
604
604
|
}).catch((l) => {
|
605
605
|
r("error", l);
|
606
606
|
});
|
607
607
|
};
|
608
608
|
var Z, Ae, wt, ci, Tt, di;
|
609
|
-
const
|
609
|
+
const P = class P {
|
610
610
|
constructor(i, t = {}) {
|
611
611
|
h(this, Z);
|
612
612
|
h(this, wt);
|
@@ -633,11 +633,11 @@ const N = class N {
|
|
633
633
|
}
|
634
634
|
/** static method 'defineMethods' */
|
635
635
|
static defineMethods(i) {
|
636
|
-
|
637
|
-
const t =
|
636
|
+
P.prototype.__methods__ || (P.prototype.__methods__ = {});
|
637
|
+
const t = P.prototype.__methods__;
|
638
638
|
for (const [e, s] of Object.entries(i))
|
639
|
-
|
640
|
-
Object.assign(
|
639
|
+
j(s) && (t[e] = s);
|
640
|
+
Object.assign(P.prototype, P.prototype.__methods__);
|
641
641
|
}
|
642
642
|
};
|
643
643
|
Z = new WeakSet(), Ae = function() {
|
@@ -645,7 +645,7 @@ Z = new WeakSet(), Ae = function() {
|
|
645
645
|
if (!at(i) || !w(i))
|
646
646
|
return;
|
647
647
|
const { SETTINGS: e, EVENTS: s } = I;
|
648
|
-
if (this.elements = t.state == "not active" ?
|
648
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
649
649
|
for (const [o, a] of Object.entries(this.options.on))
|
650
650
|
this.__events__[o] = [a];
|
651
651
|
d(this, wt, ci).call(this);
|
@@ -656,7 +656,7 @@ Z = new WeakSet(), Ae = function() {
|
|
656
656
|
}), this.emit("init");
|
657
657
|
}, Tt = new WeakSet(), di = function(i) {
|
658
658
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
659
|
-
o && typeof o != "object" &&
|
659
|
+
o && typeof o != "object" && T("modal4", "data-modal-on must be a json string.");
|
660
660
|
const a = {
|
661
661
|
target: this.getAttribute("data-modal-target") || t.target,
|
662
662
|
action: this.getAttribute("data-modal-action") || t.action,
|
@@ -669,7 +669,7 @@ Z = new WeakSet(), Ae = function() {
|
|
669
669
|
this.addEventListener("click", e);
|
670
670
|
}, 200), ze(a, s);
|
671
671
|
};
|
672
|
-
let U =
|
672
|
+
let U = P;
|
673
673
|
Object.assign(U.prototype, O);
|
674
674
|
customElements.define("modern-modal", ti);
|
675
675
|
const _s = (n, i) => {
|
@@ -702,7 +702,7 @@ class ui {
|
|
702
702
|
const { elements: t, options: e } = this;
|
703
703
|
if (!t)
|
704
704
|
return this;
|
705
|
-
const { scroller: s } = e, o = s === window || !w(s) ? window :
|
705
|
+
const { scroller: s } = e, o = s === window || !w(s) ? window : A(s);
|
706
706
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
707
707
|
if (!a.aost)
|
708
708
|
return;
|
@@ -720,12 +720,12 @@ Q = new WeakSet(), Le = function() {
|
|
720
720
|
if (!at(i) || !w(i))
|
721
721
|
return;
|
722
722
|
const { SETTINGS: e, EVENTS: s } = Ye;
|
723
|
-
if (this.elements = t.state == "not active" ?
|
723
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
724
724
|
for (const [o, a] of Object.entries(this.options.on))
|
725
725
|
this.__events__[o] = [a];
|
726
726
|
d(this, Et, hi).call(this);
|
727
727
|
}, Et = new WeakSet(), hi = function() {
|
728
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window :
|
728
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : A(e);
|
729
729
|
this.eventHandler = () => {
|
730
730
|
_s(s, i);
|
731
731
|
}, i.forEach((a) => {
|
@@ -800,7 +800,7 @@ class xs extends HTMLElement {
|
|
800
800
|
}
|
801
801
|
At = new WeakSet(), pi = function() {
|
802
802
|
if (!this.getAttribute("video-id")) {
|
803
|
-
|
803
|
+
T("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
804
804
|
return;
|
805
805
|
}
|
806
806
|
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Lt, mi).call(this);
|
@@ -833,7 +833,7 @@ At = new WeakSet(), pi = function() {
|
|
833
833
|
e = d(this, Ct, Ti).call(this);
|
834
834
|
break;
|
835
835
|
}
|
836
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
836
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(E.prepend, e);
|
837
837
|
}, Dt = new WeakSet(), fi = function() {
|
838
838
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
839
839
|
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>`;
|
@@ -1105,7 +1105,7 @@ class qs {
|
|
1105
1105
|
}
|
1106
1106
|
V = new WeakSet(), Se = function() {
|
1107
1107
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
|
1108
|
-
if (this.elements = t.state == "not active" ?
|
1108
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
1109
1109
|
for (const [o, a] of Object.entries(this.options.on))
|
1110
1110
|
this.__events__[o] = [a];
|
1111
1111
|
d(this, Ht, Li).call(this);
|
@@ -1119,31 +1119,31 @@ V = new WeakSet(), Se = function() {
|
|
1119
1119
|
if (l === "onBox") {
|
1120
1120
|
let g = null;
|
1121
1121
|
if (u === "on") {
|
1122
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1122
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
1123
1123
|
const m = s.querySelector("img");
|
1124
|
-
m.insertAdjacentHTML(
|
1124
|
+
m.insertAdjacentHTML(E.after, t[o]);
|
1125
1125
|
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1126
1126
|
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1127
1127
|
const y = b.thumbnail_url;
|
1128
1128
|
m.setAttribute("src", `${y}`);
|
1129
1129
|
}).catch(function(b) {
|
1130
1130
|
console.log("error");
|
1131
|
-
}) :
|
1131
|
+
}) : T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
1132
1132
|
}
|
1133
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
1133
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
1134
1134
|
} else if (l === "onPage") {
|
1135
1135
|
let g = null;
|
1136
1136
|
if (u == "on") {
|
1137
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
1137
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), T("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
1138
1138
|
const m = s.querySelector("img");
|
1139
|
-
m.insertAdjacentHTML(
|
1139
|
+
m.insertAdjacentHTML(E.after, t[o]);
|
1140
1140
|
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1141
1141
|
!f && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !f && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
1142
1142
|
const y = b.thumbnail_url;
|
1143
1143
|
m.setAttribute("src", `${y}`);
|
1144
1144
|
}).catch(function(b) {
|
1145
1145
|
console.log("error");
|
1146
|
-
}) : f ||
|
1146
|
+
}) : f || T("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || T("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
1147
1147
|
} else {
|
1148
1148
|
s.innerHTML = Te(e);
|
1149
1149
|
return;
|
@@ -1173,10 +1173,8 @@ V = new WeakSet(), Se = function() {
|
|
1173
1173
|
const m = g.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1174
1174
|
if (u.update(), Ei([...m]), l == "instagram") {
|
1175
1175
|
const f = document.querySelector("[video-template] .modal-content");
|
1176
|
-
|
1177
|
-
|
1178
|
-
for (let P of _)
|
1179
|
-
P.contentRect.height !== b && f.classList.add("active");
|
1176
|
+
new ResizeObserver((y) => {
|
1177
|
+
y[0].contentRect.height > 50 && f.classList.add("active");
|
1180
1178
|
}).observe(f);
|
1181
1179
|
}
|
1182
1180
|
},
|
@@ -2059,9 +2057,9 @@ const Oe = {
|
|
2059
2057
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2060
2058
|
i && i.forEach((e) => {
|
2061
2059
|
const s = document.querySelector(e);
|
2062
|
-
s ||
|
2060
|
+
s || T("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && x(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
2063
2061
|
});
|
2064
|
-
},
|
2062
|
+
}, x = (n, i) => {
|
2065
2063
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2066
2064
|
if (i < 0 || i.length === 0) {
|
2067
2065
|
switch (e.forEach((s) => {
|
@@ -2102,7 +2100,7 @@ const Oe = {
|
|
2102
2100
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
2103
2101
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2104
2102
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
2105
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
2103
|
+
n.s.selectDisplayEl.insertAdjacentHTML(E.append, u);
|
2106
2104
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2107
2105
|
index: [...e].indexOf(r),
|
2108
2106
|
id: r.getAttribute("data-option"),
|
@@ -2126,7 +2124,7 @@ const Oe = {
|
|
2126
2124
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
2127
2125
|
});
|
2128
2126
|
}, _i = () => {
|
2129
|
-
|
2127
|
+
L('dropdown-el[d4-status="open"]').forEach((i) => {
|
2130
2128
|
i.close();
|
2131
2129
|
});
|
2132
2130
|
}, js = () => {
|
@@ -2169,7 +2167,7 @@ class ki extends HTMLElement {
|
|
2169
2167
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2170
2168
|
case "single":
|
2171
2169
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2172
|
-
w(r) ?
|
2170
|
+
w(r) ? x(o, [...o.s.allLi].indexOf(r)) : x(o, -1);
|
2173
2171
|
break;
|
2174
2172
|
case "multiple":
|
2175
2173
|
const l = [];
|
@@ -2178,17 +2176,17 @@ class ki extends HTMLElement {
|
|
2178
2176
|
w(p) && (p.classList.add("active"), l.push(p));
|
2179
2177
|
});
|
2180
2178
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
2181
|
-
|
2179
|
+
x(o, c);
|
2182
2180
|
break;
|
2183
2181
|
}
|
2184
2182
|
else
|
2185
|
-
|
2183
|
+
x(o, -1);
|
2186
2184
|
o.emit("change");
|
2187
2185
|
break;
|
2188
2186
|
case "d4-placeholder":
|
2189
2187
|
if (e === null)
|
2190
2188
|
return;
|
2191
|
-
e !== s && o.s.value.index < 0 &&
|
2189
|
+
e !== s && o.s.value.index < 0 && x(o, o.s.value.index);
|
2192
2190
|
break;
|
2193
2191
|
}
|
2194
2192
|
}
|
@@ -2269,7 +2267,7 @@ It = new WeakSet(), $i = function() {
|
|
2269
2267
|
};
|
2270
2268
|
break;
|
2271
2269
|
}
|
2272
|
-
|
2270
|
+
x(t, t.s.value.index), d(s = t, Nt, Hi).call(s), t.classList.add("d4-initialize");
|
2273
2271
|
}, Nt = new WeakSet(), Hi = function() {
|
2274
2272
|
const t = this;
|
2275
2273
|
t.__events__.dropdownToggle = () => {
|
@@ -2332,10 +2330,10 @@ It = new WeakSet(), $i = function() {
|
|
2332
2330
|
c.stopPropagation();
|
2333
2331
|
const f = u.querySelector(".sub-dropdown"), b = f.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
2334
2332
|
f.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
2335
|
-
const
|
2336
|
-
s = g + e.s.subDropdownTotalH, o = s >
|
2333
|
+
const H = parseInt(f.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), S = () => {
|
2334
|
+
s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2337
2335
|
};
|
2338
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
2336
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= H, S()) : (u.classList.add("open"), e.s.subDropdownTotalH += H, S());
|
2339
2337
|
const R = () => {
|
2340
2338
|
e.__scroller__.update(!0), f.removeEventListener("transitionend", R);
|
2341
2339
|
};
|
@@ -2345,15 +2343,15 @@ It = new WeakSet(), $i = function() {
|
|
2345
2343
|
case "single":
|
2346
2344
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2347
2345
|
const f = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
2348
|
-
y && (y.querySelector(".dropdown-list").textContent = "",
|
2349
|
-
const
|
2350
|
-
|
2346
|
+
y && (y.querySelector(".dropdown-list").textContent = "", x(y, -1), Oe[f][b].forEach((H, G) => {
|
2347
|
+
const S = document.createElement("li");
|
2348
|
+
S.textContent = H[0], S.setAttribute("data-option", H[0]), y.querySelector(".dropdown-list").append(S);
|
2351
2349
|
}), e.__events__.selectOption(y));
|
2352
2350
|
}
|
2353
2351
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2354
2352
|
break;
|
2355
2353
|
case "multiple":
|
2356
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
2354
|
+
c.stopPropagation(), u.classList.toggle("active"), x(e, p);
|
2357
2355
|
break;
|
2358
2356
|
}
|
2359
2357
|
});
|
@@ -2424,7 +2422,7 @@ function zs(n) {
|
|
2424
2422
|
}
|
2425
2423
|
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
2426
2424
|
}
|
2427
|
-
function
|
2425
|
+
function _(n) {
|
2428
2426
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2429
2427
|
let s = {};
|
2430
2428
|
switch (i) {
|
@@ -2513,20 +2511,20 @@ class Bs extends HTMLElement {
|
|
2513
2511
|
}
|
2514
2512
|
jt = new WeakSet(), Mi = function() {
|
2515
2513
|
const t = {
|
2516
|
-
direction: this.getAttribute("direction") ||
|
2514
|
+
direction: this.getAttribute("direction") || $.SETTINGS.direction,
|
2517
2515
|
// up / down / left / right
|
2518
|
-
behavior: this.getAttribute("behavior") ||
|
2516
|
+
behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
|
2519
2517
|
// normal / alternate / endStop
|
2520
|
-
duration: Number(this.getAttribute("duration")) ||
|
2518
|
+
duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
|
2521
2519
|
// ms
|
2522
|
-
durationBreakpoints: ct(this) ||
|
2523
|
-
autoplay: this.getAttribute("autoplay") ||
|
2520
|
+
durationBreakpoints: ct(this) || $.SETTINGS.durationBreakpoints,
|
2521
|
+
autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
|
2524
2522
|
// normal / alternate / endStop
|
2525
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2523
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
|
2526
2524
|
// true / false
|
2527
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2525
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
|
2528
2526
|
// true / false
|
2529
|
-
gap: Number(this.getAttribute("gap")) ||
|
2527
|
+
gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
|
2530
2528
|
};
|
2531
2529
|
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, zt, qi).call(this);
|
2532
2530
|
}, zt = new WeakSet(), qi = function() {
|
@@ -2548,10 +2546,10 @@ jt = new WeakSet(), Mi = function() {
|
|
2548
2546
|
function u() {
|
2549
2547
|
switch (s) {
|
2550
2548
|
case "normal":
|
2551
|
-
t.s.animateEl.style.transform = `${
|
2549
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2552
2550
|
duration: t.s.nowDuration,
|
2553
2551
|
iterations: 1 / 0
|
2554
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2552
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${_(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2555
2553
|
duration: t.s.nowDuration,
|
2556
2554
|
delay: -t.s.nowDuration / 2,
|
2557
2555
|
iterations: 1 / 0
|
@@ -2580,7 +2578,7 @@ jt = new WeakSet(), Mi = function() {
|
|
2580
2578
|
duration: g,
|
2581
2579
|
fill: "forwards"
|
2582
2580
|
}).finished.then(() => {
|
2583
|
-
t.s.animation = t.s.animateEl.animate(
|
2581
|
+
t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2584
2582
|
duration: t.s.nowDuration,
|
2585
2583
|
iterations: 1 / 0
|
2586
2584
|
});
|
@@ -2589,7 +2587,7 @@ jt = new WeakSet(), Mi = function() {
|
|
2589
2587
|
});
|
2590
2588
|
break;
|
2591
2589
|
case "endStop":
|
2592
|
-
t.s.animateEl.style.transform = `${
|
2590
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2593
2591
|
duration: t.s.nowDuration,
|
2594
2592
|
fill: "forwards"
|
2595
2593
|
});
|
@@ -2611,10 +2609,10 @@ jt = new WeakSet(), Mi = function() {
|
|
2611
2609
|
const t = this;
|
2612
2610
|
function e() {
|
2613
2611
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2614
|
-
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(
|
2612
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2615
2613
|
duration: t.s.nowDuration,
|
2616
2614
|
iterations: 1 / 0
|
2617
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2615
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2618
2616
|
duration: t.s.nowDuration,
|
2619
2617
|
delay: -t.s.nowDuration / 2,
|
2620
2618
|
iterations: 1 / 0
|
@@ -2628,7 +2626,7 @@ const ht = function(n, i) {
|
|
2628
2626
|
return function(e) {
|
2629
2627
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2630
2628
|
};
|
2631
|
-
},
|
2629
|
+
}, k = (n, i) => {
|
2632
2630
|
if (rt(n)) {
|
2633
2631
|
n.forEach((t) => {
|
2634
2632
|
t.classList.add(i);
|
@@ -2645,7 +2643,7 @@ const ht = function(n, i) {
|
|
2645
2643
|
}
|
2646
2644
|
n.classList.remove(i);
|
2647
2645
|
};
|
2648
|
-
var Gt, Pi, Rt, Ni, Xt, ji, tt, _e,
|
2646
|
+
var Gt, Pi, Rt, Ni, Xt, ji, tt, _e, W, dt, Ft, zi;
|
2649
2647
|
class Ge {
|
2650
2648
|
constructor(i) {
|
2651
2649
|
// 初始化
|
@@ -2657,7 +2655,7 @@ class Ge {
|
|
2657
2655
|
// 卷軸位置判斷
|
2658
2656
|
h(this, tt);
|
2659
2657
|
// 隱藏按鈕判斷
|
2660
|
-
h(this,
|
2658
|
+
h(this, W);
|
2661
2659
|
// 選項事件綁定
|
2662
2660
|
h(this, Ft);
|
2663
2661
|
this.$element = i, this.option = i.s.option.drag, d(this, Gt, Pi).call(this);
|
@@ -2682,10 +2680,10 @@ Gt = new WeakSet(), Pi = function() {
|
|
2682
2680
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2683
2681
|
const t = () => {
|
2684
2682
|
var c, u;
|
2685
|
-
d(c = i, tt, _e).call(c), d(u = i,
|
2683
|
+
d(c = i, tt, _e).call(c), d(u = i, W, dt).call(u);
|
2686
2684
|
};
|
2687
2685
|
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", ht(t)), window.addEventListener("resize", ht(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Xt, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2688
|
-
|
2686
|
+
E.prepend,
|
2689
2687
|
`<div class="navigation">
|
2690
2688
|
<div class="button prev">
|
2691
2689
|
<div></div>
|
@@ -2694,7 +2692,7 @@ Gt = new WeakSet(), Pi = function() {
|
|
2694
2692
|
<div></div>
|
2695
2693
|
</div>
|
2696
2694
|
</div>`
|
2697
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Rt, Ni).call(o)), d(a = i, tt, _e).call(a), d(r = i,
|
2695
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Rt, Ni).call(o)), d(a = i, tt, _e).call(a), d(r = i, W, dt).call(r), d(l = i, Ft, zi).call(l), i.update();
|
2698
2696
|
}, Rt = new WeakSet(), Ni = function() {
|
2699
2697
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2700
2698
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
@@ -2703,7 +2701,7 @@ Gt = new WeakSet(), Pi = function() {
|
|
2703
2701
|
behavior: "smooth"
|
2704
2702
|
}), setTimeout(() => {
|
2705
2703
|
var r;
|
2706
|
-
d(r = i,
|
2704
|
+
d(r = i, W, dt).call(r);
|
2707
2705
|
}, 100);
|
2708
2706
|
};
|
2709
2707
|
e.forEach((o) => {
|
@@ -2741,25 +2739,25 @@ Gt = new WeakSet(), Pi = function() {
|
|
2741
2739
|
});
|
2742
2740
|
}, tt = new WeakSet(), _e = function() {
|
2743
2741
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = t.scrollLeft;
|
2744
|
-
e <= 0 || (
|
2745
|
-
},
|
2742
|
+
e <= 0 || (k(i, "scrollable"), s == 0 ? (D(i, "scrollable"), k(t, "start"), D(t, "end")) : s >= e ? (D(i, "scrollable"), D(t, "start"), k(t, "end")) : (k(t, "center"), D(t, "start"), D(t, "end")));
|
2743
|
+
}, W = new WeakSet(), dt = function() {
|
2746
2744
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2747
2745
|
if (!t)
|
2748
2746
|
return;
|
2749
2747
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2750
2748
|
if (s <= 0) {
|
2751
|
-
|
2749
|
+
k(t, "hide"), D(t, "active"), k(e, "noScrollable");
|
2752
2750
|
return;
|
2753
2751
|
}
|
2754
|
-
s > 0 && (
|
2752
|
+
s > 0 && (k(t, "active"), D(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2755
2753
|
if (a.classList.contains("next")) {
|
2756
2754
|
D(a, "hide");
|
2757
2755
|
return;
|
2758
2756
|
}
|
2759
|
-
|
2757
|
+
k(a, "hide");
|
2760
2758
|
}) : o >= s ? t.forEach((a) => {
|
2761
2759
|
if (a.classList.contains("next")) {
|
2762
|
-
|
2760
|
+
k(a, "hide");
|
2763
2761
|
return;
|
2764
2762
|
}
|
2765
2763
|
D(a, "hide");
|
@@ -2796,7 +2794,7 @@ Yt = new WeakSet(), Wi = function() {
|
|
2796
2794
|
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Ut, Bi).call(this) && d(this, Jt, Gi).call(this), d(this, Zt, Ri).call(this));
|
2797
2795
|
}, Ut = new WeakSet(), Bi = function() {
|
2798
2796
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2799
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
2797
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2800
2798
|
}, Jt = new WeakSet(), Gi = function() {
|
2801
2799
|
const { $element: i, $button: t } = this, e = function() {
|
2802
2800
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
@@ -2818,9 +2816,9 @@ Yt = new WeakSet(), Wi = function() {
|
|
2818
2816
|
};
|
2819
2817
|
const Rs = (n) => {
|
2820
2818
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2821
|
-
return i == "drag" && (s.innerHTML =
|
2819
|
+
return i == "drag" && (s.innerHTML = C.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e)), i == "collapse" && (s.innerHTML = C.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, e)), i == "dropdown" && (s.innerHTML = C.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(E.append, e)), s.children;
|
2822
2820
|
};
|
2823
|
-
var Qt, Xi, Vt, Fi, et, ke,
|
2821
|
+
var Qt, Xi, Vt, Fi, et, ke, B, ut;
|
2824
2822
|
class Xs extends HTMLElement {
|
2825
2823
|
constructor() {
|
2826
2824
|
super();
|
@@ -2829,7 +2827,7 @@ class Xs extends HTMLElement {
|
|
2829
2827
|
// 斷點設定
|
2830
2828
|
h(this, et);
|
2831
2829
|
// check type
|
2832
|
-
h(this,
|
2830
|
+
h(this, B);
|
2833
2831
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
2834
2832
|
}
|
2835
2833
|
static get observedAttributes() {
|
@@ -2841,7 +2839,7 @@ class Xs extends HTMLElement {
|
|
2841
2839
|
case "m4-type":
|
2842
2840
|
if (e === null || e === s)
|
2843
2841
|
return;
|
2844
|
-
this.s.type = s, d(this,
|
2842
|
+
this.s.type = s, d(this, B, ut).call(this);
|
2845
2843
|
break;
|
2846
2844
|
case "m4-status":
|
2847
2845
|
if (e === s)
|
@@ -2866,7 +2864,7 @@ class Xs extends HTMLElement {
|
|
2866
2864
|
}
|
2867
2865
|
Qt = new WeakSet(), Xi = function() {
|
2868
2866
|
let t = {};
|
2869
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
2867
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? C.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
2870
2868
|
const e = (s) => {
|
2871
2869
|
if (s.type === "resize") {
|
2872
2870
|
if (window.innerWidth === this.previousWidth)
|
@@ -2875,20 +2873,20 @@ Qt = new WeakSet(), Xi = function() {
|
|
2875
2873
|
}
|
2876
2874
|
this.update();
|
2877
2875
|
};
|
2878
|
-
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({},
|
2876
|
+
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, C.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, C.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, C.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, C.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, Vt, Fi).call(this);
|
2879
2877
|
}, Vt = new WeakSet(), Fi = function() {
|
2880
2878
|
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2881
2879
|
}, et = new WeakSet(), ke = function() {
|
2882
2880
|
const t = Object.keys(this.s.option.breakpoint);
|
2883
2881
|
if (!t.length) {
|
2884
|
-
d(this,
|
2882
|
+
d(this, B, ut).call(this);
|
2885
2883
|
return;
|
2886
2884
|
}
|
2887
2885
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
2888
2886
|
var s, o, a, r;
|
2889
|
-
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,
|
2887
|
+
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, B, ut).call(this), window.innerWidth >= e;
|
2890
2888
|
});
|
2891
|
-
},
|
2889
|
+
}, B = new WeakSet(), ut = function() {
|
2892
2890
|
var o;
|
2893
2891
|
const { type: t } = this.s;
|
2894
2892
|
this.innerHTML = "", [...Rs(this)].forEach((a) => {
|
@@ -2910,7 +2908,7 @@ Qt = new WeakSet(), Xi = function() {
|
|
2910
2908
|
(o = this.constructor.drag) == null || o.update(this);
|
2911
2909
|
};
|
2912
2910
|
customElements.define("multipurpose-nav", Xs);
|
2913
|
-
var Kt, Ui, te, Ji, it, $e,
|
2911
|
+
var Kt, Ui, te, Ji, it, $e, N, F, ee, Zi, ie, Qi, se, Vi, ne, Ki, oe, ts, ae, es, re, is, le, ss, ce, ns, q, z, de, os, ue, as, he, rs, pe, ls;
|
2914
2912
|
class Yi extends HTMLElement {
|
2915
2913
|
// 定義組件的初始狀態
|
2916
2914
|
constructor(t, e) {
|
@@ -2920,7 +2918,7 @@ class Yi extends HTMLElement {
|
|
2920
2918
|
// 第一關 判斷數量以及id設定
|
2921
2919
|
h(this, it);
|
2922
2920
|
// 第二關 id命名提醒
|
2923
|
-
h(this,
|
2921
|
+
h(this, N);
|
2924
2922
|
h(this, ee);
|
2925
2923
|
h(this, ie);
|
2926
2924
|
h(this, se);
|
@@ -2963,26 +2961,26 @@ class Yi extends HTMLElement {
|
|
2963
2961
|
tabClick(t) {
|
2964
2962
|
const { t: e } = this, s = e.tabs.indexOf(t) % e.tabPanels.length, o = e.tabGroup === "true" ? String(s) : t.getAttribute("t4-id");
|
2965
2963
|
this.setActiveTab(o), setTimeout(() => {
|
2966
|
-
d(this, q,
|
2964
|
+
d(this, q, z).call(this, "eventAnchor");
|
2967
2965
|
}, e.transition.duration);
|
2968
2966
|
}
|
2969
2967
|
// 外部呼叫方法 $0.setActiveTab(0)
|
2970
2968
|
setActiveTab(t) {
|
2971
2969
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
2972
2970
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2973
|
-
const o = d(this,
|
2971
|
+
const o = d(this, N, F).call(this, s);
|
2974
2972
|
e.tabPanels.forEach((a, r) => {
|
2975
2973
|
r === o ? d(this, ue, as).call(this, r) : d(this, de, os).call(this, r);
|
2976
2974
|
});
|
2977
2975
|
}
|
2978
2976
|
// 外部呼叫方法 $0.goNext()
|
2979
2977
|
goNext() {
|
2980
|
-
const t = d(this,
|
2978
|
+
const t = d(this, N, F).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2981
2979
|
this.setActiveTab(s);
|
2982
2980
|
}
|
2983
2981
|
// 外部呼叫方法 $0.goPrev()
|
2984
2982
|
goPrev() {
|
2985
|
-
const t = d(this,
|
2983
|
+
const t = d(this, N, F).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2986
2984
|
this.setActiveTab(s);
|
2987
2985
|
}
|
2988
2986
|
// 外部呼叫方法 $0.update()
|
@@ -3022,7 +3020,7 @@ Kt = new WeakSet(), Ui = function() {
|
|
3022
3020
|
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) => {
|
3023
3021
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
3024
3022
|
}), e;
|
3025
|
-
},
|
3023
|
+
}, N = new WeakSet(), F = function(t) {
|
3026
3024
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
3027
3025
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
3028
3026
|
const o = s[0];
|
@@ -3074,7 +3072,7 @@ Kt = new WeakSet(), Ui = function() {
|
|
3074
3072
|
}) : this.t.tabs.forEach((s, o) => {
|
3075
3073
|
s.getAttribute("t4-id") === e ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3076
3074
|
});
|
3077
|
-
}, q = new WeakSet(),
|
3075
|
+
}, q = new WeakSet(), z = function(t, e, s) {
|
3078
3076
|
switch (t) {
|
3079
3077
|
case "step":
|
3080
3078
|
ye(this.t.step) && d(this, ae, es).call(this, e);
|
@@ -3138,8 +3136,8 @@ Kt = new WeakSet(), Ui = function() {
|
|
3138
3136
|
break;
|
3139
3137
|
}
|
3140
3138
|
}, he = new WeakSet(), rs = function(t) {
|
3141
|
-
const e = d(this,
|
3142
|
-
d(this, q,
|
3139
|
+
const e = d(this, N, F).call(this, t);
|
3140
|
+
d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
3143
3141
|
}, pe = new WeakSet(), ls = function() {
|
3144
3142
|
const t = this;
|
3145
3143
|
window.addEventListener(
|
@@ -3213,7 +3211,7 @@ class Us {
|
|
3213
3211
|
}
|
3214
3212
|
st = new WeakSet(), xe = function() {
|
3215
3213
|
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Je;
|
3216
|
-
if (this.elements = t.state == "not active" ?
|
3214
|
+
if (this.elements = t.state == "not active" ? L(i + `:not([${this.active}])`) : L(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
3217
3215
|
for (const [o, a] of Object.entries(this.options.on))
|
3218
3216
|
this.__events__[o] = [a];
|
3219
3217
|
d(this, me, ds).call(this);
|
@@ -3515,8 +3513,8 @@ export {
|
|
3515
3513
|
Ts as c,
|
3516
3514
|
ws as d,
|
3517
3515
|
Y as e,
|
3518
|
-
|
3519
|
-
|
3516
|
+
E as f,
|
3517
|
+
L as g,
|
3520
3518
|
mn as h,
|
3521
3519
|
at as i,
|
3522
3520
|
ui as j,
|