@xwadex/fesd 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ const Y = {
|
|
20
20
|
videoId: null,
|
21
21
|
videoType: null,
|
22
22
|
videoAutoplay: "off",
|
23
|
+
videoKeep: "off",
|
23
24
|
videoMode: "onBox",
|
24
25
|
videoButton: ".playButton",
|
25
26
|
videoCover: "on",
|
@@ -88,7 +89,7 @@ const Y = {
|
|
88
89
|
</div>
|
89
90
|
`;
|
90
91
|
}
|
91
|
-
},
|
92
|
+
}, x = {
|
92
93
|
SETTINGS: {
|
93
94
|
direction: "left",
|
94
95
|
// 方向 - top || right || bottom || left
|
@@ -162,7 +163,7 @@ const Y = {
|
|
162
163
|
enter: null,
|
163
164
|
leave: null
|
164
165
|
}
|
165
|
-
},
|
166
|
+
}, ct = {
|
166
167
|
SETTINGS: {
|
167
168
|
target: null,
|
168
169
|
container: null,
|
@@ -180,7 +181,7 @@ const Y = {
|
|
180
181
|
beforeScroll: null,
|
181
182
|
afterScroll: null
|
182
183
|
}
|
183
|
-
},
|
184
|
+
}, H = {
|
184
185
|
SETTINGS: {
|
185
186
|
type: "drag",
|
186
187
|
drag: {
|
@@ -292,14 +293,14 @@ const Y = {
|
|
292
293
|
}
|
293
294
|
}, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
294
295
|
__proto__: null,
|
295
|
-
anchor4:
|
296
|
+
anchor4: ct,
|
296
297
|
aost4: Ye,
|
297
298
|
article4: ws,
|
298
299
|
collapse4: Je,
|
299
300
|
dropdown4: qe,
|
300
|
-
marquee4:
|
301
|
+
marquee4: x,
|
301
302
|
modal4: I,
|
302
|
-
multipurpose4:
|
303
|
+
multipurpose4: H,
|
303
304
|
ripple4: Ze,
|
304
305
|
share4: ys,
|
305
306
|
tab4: Ue,
|
@@ -309,7 +310,7 @@ const Y = {
|
|
309
310
|
after: "afterend",
|
310
311
|
append: "beforeend",
|
311
312
|
prepend: "afterbegin"
|
312
|
-
}, at = (n) => typeof n == "string" && n !== "",
|
313
|
+
}, at = (n) => typeof n == "string" && n !== "", we = (n) => n instanceof HTMLElement, rt = (n) => n instanceof NodeList, w = (n) => A(n) !== null, j = (n) => typeof n == "function", A = (n) => we(n) ? n : document.querySelector(n), L = (n) => rt(n) ? n : document.querySelectorAll(n), Ts = () => Math.random().toString(36).substr(2, 9), Es = (n) => {
|
313
314
|
const i = document.createElement("div");
|
314
315
|
return i.innerHTML = n, i.childNodes;
|
315
316
|
}, As = (n) => {
|
@@ -364,10 +365,10 @@ const Y = {
|
|
364
365
|
easeOutQuart(n, i, t, e) {
|
365
366
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
366
367
|
}
|
367
|
-
},
|
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,
|
368
|
+
}, Te = (n, i) => {
|
369
|
+
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, _ = b - a - y, G = 15;
|
369
370
|
let S = 0;
|
370
|
-
if (
|
371
|
+
if (_ === 0)
|
371
372
|
return;
|
372
373
|
const R = (X) => {
|
373
374
|
const Pe = A(t);
|
@@ -376,17 +377,17 @@ const Y = {
|
|
376
377
|
R("beforeScroll");
|
377
378
|
const Ne = () => {
|
378
379
|
S += G;
|
379
|
-
const X = Ls[r](S, f,
|
380
|
+
const X = Ls[r](S, f, _, o);
|
380
381
|
m[u] = X, S < o && requestAnimationFrame(Ne), S >= o && R("afterScroll");
|
381
382
|
};
|
382
383
|
requestAnimationFrame(Ne);
|
383
384
|
};
|
384
|
-
var J, Ee,
|
385
|
+
var J, Ee, mt, Ve, gt, Ke;
|
385
386
|
class Qe {
|
386
387
|
constructor(i, t = {}) {
|
387
388
|
h(this, J);
|
388
|
-
h(this, pt);
|
389
389
|
h(this, mt);
|
390
|
+
h(this, gt);
|
390
391
|
this.__storage__ = {
|
391
392
|
el: i,
|
392
393
|
options: t
|
@@ -403,18 +404,18 @@ class Qe {
|
|
403
404
|
return d(i = this.destroy(), J, Ee).call(i), this.emit("afterUpdate"), this;
|
404
405
|
}
|
405
406
|
static run(i) {
|
406
|
-
const { SETTINGS: t } =
|
407
|
+
const { SETTINGS: t } = ct, e = Object.assign({}, t, i);
|
407
408
|
setTimeout(() => {
|
408
|
-
|
409
|
+
Te(e);
|
409
410
|
}, e.delay);
|
410
411
|
}
|
411
412
|
static url(i) {
|
412
|
-
const { SETTINGS: t } =
|
413
|
+
const { SETTINGS: t } = ct, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
|
413
414
|
if (!a)
|
414
415
|
return;
|
415
416
|
const r = Object.assign({}, t, i, { target: a });
|
416
417
|
setTimeout(() => {
|
417
|
-
|
418
|
+
Te(r);
|
418
419
|
}, r.delay);
|
419
420
|
}
|
420
421
|
}
|
@@ -422,17 +423,17 @@ J = new WeakSet(), Ee = function() {
|
|
422
423
|
const { el: i, options: t } = this.__storage__;
|
423
424
|
if (!at(i) || !w(i))
|
424
425
|
return;
|
425
|
-
const { SETTINGS: e, EVENTS: s } =
|
426
|
+
const { SETTINGS: e, EVENTS: s } = ct;
|
426
427
|
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
428
|
for (const [o, a] of Object.entries(this.options.on))
|
428
429
|
this.__events__[o] = [a];
|
429
|
-
d(this,
|
430
|
-
},
|
430
|
+
d(this, mt, Ve).call(this);
|
431
|
+
}, mt = new WeakSet(), Ve = function() {
|
431
432
|
const { elements: i, options: t } = this;
|
432
433
|
i.forEach((e) => {
|
433
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
434
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, gt, Ke), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
434
435
|
}), this.emit("afterInit");
|
435
|
-
},
|
436
|
+
}, gt = new WeakSet(), Ke = function() {
|
436
437
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
437
438
|
target: this.getAttribute("data-anchor-target") || i.target,
|
438
439
|
container: this.getAttribute("data-anchor-container") || i.container,
|
@@ -446,7 +447,7 @@ J = new WeakSet(), Ee = function() {
|
|
446
447
|
this.removeEventListener("click", t), setTimeout(() => {
|
447
448
|
this.addEventListener("click", t);
|
448
449
|
}, s.speed), setTimeout(() => {
|
449
|
-
|
450
|
+
Te(s, e);
|
450
451
|
}, s.delay);
|
451
452
|
};
|
452
453
|
Object.assign(Qe.prototype, O);
|
@@ -459,15 +460,15 @@ const { MODALS: M } = window, Ss = (n) => {
|
|
459
460
|
s.append(o);
|
460
461
|
}), e.children[0];
|
461
462
|
};
|
462
|
-
var
|
463
|
+
var ft, ei, vt, ii, bt, si, yt, ni, wt, oi;
|
463
464
|
class ti extends HTMLElement {
|
464
465
|
constructor() {
|
465
466
|
super();
|
466
|
-
h(this, gt);
|
467
467
|
h(this, ft);
|
468
468
|
h(this, vt);
|
469
469
|
h(this, bt);
|
470
470
|
h(this, yt);
|
471
|
+
h(this, wt);
|
471
472
|
this.initialize = !1;
|
472
473
|
}
|
473
474
|
static get observedAttributes() {
|
@@ -476,12 +477,12 @@ class ti extends HTMLElement {
|
|
476
477
|
attributeChangedCallback(t, e, s) {
|
477
478
|
switch (t) {
|
478
479
|
case ":state":
|
479
|
-
d(this,
|
480
|
+
d(this, wt, oi).call(this, s);
|
480
481
|
break;
|
481
482
|
}
|
482
483
|
}
|
483
484
|
connectedCallback() {
|
484
|
-
this.initialize || (this.initialize = !0, d(this,
|
485
|
+
this.initialize || (this.initialize = !0, d(this, ft, ei).call(this));
|
485
486
|
}
|
486
487
|
open() {
|
487
488
|
return this.setAttribute(":state", "open"), this;
|
@@ -493,22 +494,22 @@ class ti extends HTMLElement {
|
|
493
494
|
return this.setAttribute(":state", "destroy"), this;
|
494
495
|
}
|
495
496
|
}
|
496
|
-
|
497
|
+
ft = new WeakSet(), ei = function() {
|
497
498
|
const { ATTRS: t } = I;
|
498
499
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
499
500
|
const e = this.getAttribute(t.id) || Ts();
|
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,
|
501
|
-
},
|
502
|
-
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this,
|
503
|
-
},
|
501
|
+
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, vt, ii).call(this);
|
502
|
+
}, vt = new WeakSet(), ii = function() {
|
503
|
+
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), d(this, bt, si).call(this);
|
504
|
+
}, bt = new WeakSet(), si = function() {
|
504
505
|
const t = this.querySelector(".modal-scroller");
|
505
506
|
this.__scroller__ = Me(t, {
|
506
507
|
overflowBehavior: {
|
507
508
|
x: "hidden"
|
508
509
|
},
|
509
510
|
autoUpdate: !0
|
510
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
511
|
-
},
|
511
|
+
}), window.modalScroll = this.__scroller__, d(this, yt, ni).call(this);
|
512
|
+
}, yt = new WeakSet(), ni = function() {
|
512
513
|
var a, r, l;
|
513
514
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
514
515
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
@@ -524,7 +525,7 @@ gt = new WeakSet(), ei = function() {
|
|
524
525
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
525
526
|
c.stopPropagation();
|
526
527
|
});
|
527
|
-
},
|
528
|
+
}, wt = new WeakSet(), oi = function(t) {
|
528
529
|
const { __scroller__: e } = this;
|
529
530
|
if (t === "open") {
|
530
531
|
if (this.style.display = "block", e) {
|
@@ -605,12 +606,12 @@ const { MODALS: Ie } = window, ai = (n, i, ...t) => {
|
|
605
606
|
r("error", l);
|
606
607
|
});
|
607
608
|
};
|
608
|
-
var Z, Ae,
|
609
|
+
var Z, Ae, Tt, ci, Et, di;
|
609
610
|
const N = class N {
|
610
611
|
constructor(i, t = {}) {
|
611
612
|
h(this, Z);
|
612
|
-
h(this, wt);
|
613
613
|
h(this, Tt);
|
614
|
+
h(this, Et);
|
614
615
|
this.__storage__ = {
|
615
616
|
el: i,
|
616
617
|
options: t
|
@@ -648,13 +649,13 @@ Z = new WeakSet(), Ae = function() {
|
|
648
649
|
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
650
|
for (const [o, a] of Object.entries(this.options.on))
|
650
651
|
this.__events__[o] = [a];
|
651
|
-
d(this,
|
652
|
-
},
|
652
|
+
d(this, Tt, ci).call(this);
|
653
|
+
}, Tt = new WeakSet(), ci = function() {
|
653
654
|
const { elements: i, options: t } = this;
|
654
655
|
i.forEach((e) => {
|
655
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
656
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Et, di), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
656
657
|
}), this.emit("init");
|
657
|
-
},
|
658
|
+
}, Et = new WeakSet(), di = function(i) {
|
658
659
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = As(this.getAttribute("data-modal-on"));
|
659
660
|
o && typeof o != "object" && T("modal4", "data-modal-on must be a json string.");
|
660
661
|
const a = {
|
@@ -688,11 +689,11 @@ const _s = (n, i) => {
|
|
688
689
|
}
|
689
690
|
});
|
690
691
|
}, ks = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
691
|
-
var Q, Le,
|
692
|
+
var Q, Le, At, hi;
|
692
693
|
class ui {
|
693
694
|
constructor(i, t = {}) {
|
694
695
|
h(this, Q);
|
695
|
-
h(this,
|
696
|
+
h(this, At);
|
696
697
|
this.__storage__ = {
|
697
698
|
el: i,
|
698
699
|
options: t
|
@@ -723,8 +724,8 @@ Q = new WeakSet(), Le = function() {
|
|
723
724
|
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
725
|
for (const [o, a] of Object.entries(this.options.on))
|
725
726
|
this.__events__[o] = [a];
|
726
|
-
d(this,
|
727
|
-
},
|
727
|
+
d(this, At, hi).call(this);
|
728
|
+
}, At = new WeakSet(), hi = function() {
|
728
729
|
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : A(e);
|
729
730
|
this.eventHandler = () => {
|
730
731
|
_s(s, i);
|
@@ -743,25 +744,25 @@ const $s = (n) => {
|
|
743
744
|
s.append(o);
|
744
745
|
}), e.children[0];
|
745
746
|
};
|
746
|
-
var
|
747
|
+
var Lt, pi, St, mi, Dt, gi, _t, fi, kt, vi, $t, bi, xt, yi, Ct, wi, Ht, Ti;
|
747
748
|
class xs extends HTMLElement {
|
748
749
|
constructor() {
|
749
750
|
super();
|
750
|
-
h(this, At);
|
751
751
|
h(this, Lt);
|
752
752
|
h(this, St);
|
753
|
-
// youtube iframe
|
754
753
|
h(this, Dt);
|
755
|
-
//
|
754
|
+
// youtube iframe
|
756
755
|
h(this, _t);
|
757
|
-
//
|
756
|
+
// vimeo iframe
|
758
757
|
h(this, kt);
|
758
|
+
// youku iframe
|
759
759
|
h(this, $t);
|
760
|
-
// 2025.02.11 新增 ig
|
761
760
|
h(this, xt);
|
762
|
-
// 2025.02.11 新增
|
761
|
+
// 2025.02.11 新增 ig
|
763
762
|
h(this, Ct);
|
764
|
-
|
763
|
+
// 2025.02.11 新增 tiktok
|
764
|
+
h(this, Ht);
|
765
|
+
d(this, Lt, pi).call(this);
|
765
766
|
}
|
766
767
|
play() {
|
767
768
|
const { videoType: t } = this;
|
@@ -798,58 +799,58 @@ class xs extends HTMLElement {
|
|
798
799
|
}
|
799
800
|
}
|
800
801
|
}
|
801
|
-
|
802
|
+
Lt = new WeakSet(), pi = function() {
|
802
803
|
if (!this.getAttribute("video-id")) {
|
803
804
|
T("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
804
805
|
return;
|
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,
|
807
|
-
},
|
808
|
-
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this,
|
809
|
-
},
|
807
|
+
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, St, mi).call(this);
|
808
|
+
}, St = new WeakSet(), mi = function() {
|
809
|
+
this.childDom = this.childNodes, this.template = $s(this), this.innerHTML = "", this.append(this.template), d(this, Dt, gi).call(this);
|
810
|
+
}, Dt = new WeakSet(), gi = function() {
|
810
811
|
const { videoType: t } = this;
|
811
812
|
let e = "";
|
812
813
|
switch (t) {
|
813
814
|
case "youtubeAPI":
|
814
815
|
break;
|
815
816
|
case "youtube":
|
816
|
-
e = d(this,
|
817
|
+
e = d(this, _t, fi).call(this);
|
817
818
|
break;
|
818
819
|
case "youkuAPI":
|
819
820
|
break;
|
820
821
|
case "youku":
|
821
|
-
e = d(this,
|
822
|
+
e = d(this, $t, bi).call(this);
|
822
823
|
break;
|
823
824
|
case "vimeo":
|
824
|
-
e = d(this,
|
825
|
+
e = d(this, kt, vi).call(this);
|
825
826
|
break;
|
826
827
|
case "bilibili":
|
827
|
-
e = d(this,
|
828
|
+
e = d(this, xt, yi).call(this);
|
828
829
|
break;
|
829
830
|
case "instagram":
|
830
|
-
e = d(this,
|
831
|
+
e = d(this, Ct, wi).call(this);
|
831
832
|
break;
|
832
833
|
case "tiktok":
|
833
|
-
e = d(this,
|
834
|
+
e = d(this, Ht, Ti).call(this);
|
834
835
|
break;
|
835
836
|
}
|
836
837
|
this.querySelector(".player-wrapper").insertAdjacentHTML(E.prepend, e);
|
837
|
-
},
|
838
|
+
}, _t = new WeakSet(), fi = function() {
|
838
839
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
839
840
|
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>`;
|
840
|
-
},
|
841
|
+
}, kt = new WeakSet(), vi = function() {
|
841
842
|
const { videoId: t, autoplay: e, hash: s } = this;
|
842
843
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
843
|
-
},
|
844
|
+
}, $t = new WeakSet(), bi = function() {
|
844
845
|
const { videoId: t, autoplay: e } = this;
|
845
846
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
846
|
-
},
|
847
|
+
}, xt = new WeakSet(), yi = function() {
|
847
848
|
const { videoId: t, autoplay: e } = this;
|
848
849
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
849
|
-
},
|
850
|
+
}, Ct = new WeakSet(), wi = function() {
|
850
851
|
const { videoId: t, autoplay: e } = this;
|
851
852
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
852
|
-
},
|
853
|
+
}, Ht = new WeakSet(), Ti = function() {
|
853
854
|
const { videoId: t, autoplay: e } = this;
|
854
855
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
855
856
|
};
|
@@ -1081,16 +1082,16 @@ function jn(n) {
|
|
1081
1082
|
const i = document.createElement("div");
|
1082
1083
|
return i.innerHTML = n, i.childNodes[0];
|
1083
1084
|
}
|
1084
|
-
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on",
|
1085
|
-
var V, Se,
|
1085
|
+
const We = (n) => n.videoId !== "" || typeof n.videoId < "u", Ms = (n) => n.$selector.getAttribute("video4-active") === "on", lt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
1086
|
+
var V, Se, Mt, Li, qt, Si, K, De, It, Di;
|
1086
1087
|
class qs {
|
1087
1088
|
constructor(i, t = {}) {
|
1088
1089
|
h(this, V);
|
1089
|
-
h(this, Ht);
|
1090
1090
|
h(this, Mt);
|
1091
|
-
h(this, K);
|
1092
1091
|
h(this, qt);
|
1093
|
-
|
1092
|
+
h(this, K);
|
1093
|
+
h(this, It);
|
1094
|
+
if (!at(i) && !we(i) && !rt(i)) {
|
1094
1095
|
je("video4", `找不到該物件 -> ${i}`);
|
1095
1096
|
return;
|
1096
1097
|
}
|
@@ -1108,13 +1109,13 @@ V = new WeakSet(), Se = function() {
|
|
1108
1109
|
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
1110
|
for (const [o, a] of Object.entries(this.options.on))
|
1110
1111
|
this.__events__[o] = [a];
|
1111
|
-
d(this,
|
1112
|
-
},
|
1112
|
+
d(this, Mt, Li).call(this);
|
1113
|
+
}, Mt = new WeakSet(), Li = function() {
|
1113
1114
|
const { elements: i, options: t } = this;
|
1114
1115
|
i.forEach((e) => {
|
1115
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
1116
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, It, Di).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !Ms(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, qt, Si).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
|
1116
1117
|
}), this.emit("init");
|
1117
|
-
},
|
1118
|
+
}, qt = new WeakSet(), Si = function(i) {
|
1118
1119
|
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
1119
1120
|
if (l === "onBox") {
|
1120
1121
|
let g = null;
|
@@ -1145,51 +1146,57 @@ V = new WeakSet(), Se = function() {
|
|
1145
1146
|
console.log("error");
|
1146
1147
|
}) : 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
1148
|
} else {
|
1148
|
-
s.innerHTML =
|
1149
|
+
s.innerHTML = lt(e);
|
1149
1150
|
return;
|
1150
1151
|
}
|
1151
1152
|
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, K, De), g.addEventListener("click", g.video.eventHandler);
|
1152
1153
|
}
|
1153
1154
|
}, K = new WeakSet(), De = function(i) {
|
1154
|
-
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a,
|
1155
|
+
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new Fe({ callback_loaded: (g) => {
|
1155
1156
|
} });
|
1156
1157
|
if (o == "onBox") {
|
1157
|
-
const
|
1158
|
+
const g = {
|
1158
1159
|
target: a,
|
1159
|
-
route:
|
1160
|
+
route: l,
|
1160
1161
|
on: {
|
1161
|
-
complete(
|
1162
|
-
if (
|
1163
|
-
if (
|
1162
|
+
complete(m) {
|
1163
|
+
if (c == "instagram")
|
1164
|
+
if (m.setAttribute("video-typeStyle", `${c}`), window.instgrm)
|
1164
1165
|
window.instgrm.Embeds.process();
|
1165
1166
|
else {
|
1166
|
-
const
|
1167
|
-
|
1167
|
+
const f = document.createElement("script");
|
1168
|
+
f.src = "https://www.instagram.com/embed.js", f.async = !0, document.body.appendChild(f);
|
1168
1169
|
}
|
1169
1170
|
else
|
1170
|
-
|
1171
|
+
m.querySelector(".modal-content").insertAdjacentHTML("beforeend", lt(t.params)), m.setAttribute("video-typeStyle", `${c}`);
|
1171
1172
|
},
|
1172
|
-
open(
|
1173
|
-
const
|
1174
|
-
if (
|
1175
|
-
const
|
1176
|
-
new ResizeObserver((
|
1177
|
-
|
1178
|
-
}).observe(
|
1173
|
+
open(m) {
|
1174
|
+
const f = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1175
|
+
if (p.update(), Ei([...f]), c == "instagram") {
|
1176
|
+
const b = document.querySelector("[video-template] .modal-content");
|
1177
|
+
new ResizeObserver((_) => {
|
1178
|
+
_[0].contentRect.height > 50 && b.classList.add("active");
|
1179
|
+
}).observe(b);
|
1179
1180
|
}
|
1180
1181
|
},
|
1181
|
-
close(
|
1182
|
-
const
|
1183
|
-
Ai([...
|
1182
|
+
close(m) {
|
1183
|
+
const f = m.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1184
|
+
Ai([...f]);
|
1184
1185
|
},
|
1185
|
-
destroy(
|
1186
|
+
destroy(m) {
|
1186
1187
|
}
|
1187
1188
|
}
|
1188
1189
|
};
|
1189
|
-
U.open(
|
1190
|
-
} else
|
1191
|
-
|
1192
|
-
|
1190
|
+
U.open(g);
|
1191
|
+
} else if (o == "onPage")
|
1192
|
+
if (t.params.videoAutoplay = "on", r == "off") {
|
1193
|
+
s.innerHTML = lt(t.params);
|
1194
|
+
return;
|
1195
|
+
} else {
|
1196
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", lt(t.params));
|
1197
|
+
return;
|
1198
|
+
}
|
1199
|
+
}, It = new WeakSet(), Di = function(i) {
|
1193
1200
|
const { SETTINGS: t } = Y;
|
1194
1201
|
return {
|
1195
1202
|
$selector: i,
|
@@ -1198,6 +1205,7 @@ V = new WeakSet(), Se = function() {
|
|
1198
1205
|
videoAutoplay: i.getAttribute("video-autoplay") || t.videoAutoplay,
|
1199
1206
|
videoMode: i.getAttribute("video-mode") || t.videoMode,
|
1200
1207
|
videoButton: i.getAttribute("video-button") || t.videoButton,
|
1208
|
+
videoKeep: i.getAttribute("video-keep") || t.videoKeep,
|
1201
1209
|
videoCover: i.getAttribute("video-cover") || t.videoCover,
|
1202
1210
|
videoLayoutNo: i.getAttribute("video-layout-no") || t.videoLayoutNo,
|
1203
1211
|
videoTarget: i.getAttribute("video-target") || t.videoTarget,
|
@@ -2057,9 +2065,9 @@ const Oe = {
|
|
2057
2065
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
2058
2066
|
i && i.forEach((e) => {
|
2059
2067
|
const s = document.querySelector(e);
|
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 &&
|
2068
|
+
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 && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
2061
2069
|
});
|
2062
|
-
},
|
2070
|
+
}, C = (n, i) => {
|
2063
2071
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
2064
2072
|
if (i < 0 || i.length === 0) {
|
2065
2073
|
switch (e.forEach((s) => {
|
@@ -2139,14 +2147,14 @@ js();
|
|
2139
2147
|
document.addEventListener("click", function() {
|
2140
2148
|
_i();
|
2141
2149
|
});
|
2142
|
-
var
|
2150
|
+
var Ot, $i, Nt, xi, Pt, Ci, jt, Hi;
|
2143
2151
|
class ki extends HTMLElement {
|
2144
2152
|
constructor() {
|
2145
2153
|
super();
|
2146
|
-
h(this, It);
|
2147
2154
|
h(this, Ot);
|
2148
2155
|
h(this, Nt);
|
2149
2156
|
h(this, Pt);
|
2157
|
+
h(this, jt);
|
2150
2158
|
this.initialize = !1;
|
2151
2159
|
}
|
2152
2160
|
static get observedAttributes() {
|
@@ -2167,7 +2175,7 @@ class ki extends HTMLElement {
|
|
2167
2175
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
2168
2176
|
case "single":
|
2169
2177
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
2170
|
-
w(r) ?
|
2178
|
+
w(r) ? C(o, [...o.s.allLi].indexOf(r)) : C(o, -1);
|
2171
2179
|
break;
|
2172
2180
|
case "multiple":
|
2173
2181
|
const l = [];
|
@@ -2176,23 +2184,23 @@ class ki extends HTMLElement {
|
|
2176
2184
|
w(p) && (p.classList.add("active"), l.push(p));
|
2177
2185
|
});
|
2178
2186
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
2179
|
-
|
2187
|
+
C(o, c);
|
2180
2188
|
break;
|
2181
2189
|
}
|
2182
2190
|
else
|
2183
|
-
|
2191
|
+
C(o, -1);
|
2184
2192
|
o.emit("change");
|
2185
2193
|
break;
|
2186
2194
|
case "d4-placeholder":
|
2187
2195
|
if (e === null)
|
2188
2196
|
return;
|
2189
|
-
e !== s && o.s.value.index < 0 &&
|
2197
|
+
e !== s && o.s.value.index < 0 && C(o, o.s.value.index);
|
2190
2198
|
break;
|
2191
2199
|
}
|
2192
2200
|
}
|
2193
2201
|
connectedCallback() {
|
2194
2202
|
const t = this;
|
2195
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
2203
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Ot, $i).call(this));
|
2196
2204
|
}
|
2197
2205
|
open() {
|
2198
2206
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
|
@@ -2218,11 +2226,11 @@ class ki extends HTMLElement {
|
|
2218
2226
|
this.__events__.selectOption();
|
2219
2227
|
}
|
2220
2228
|
}
|
2221
|
-
|
2222
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
2223
|
-
},
|
2224
|
-
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this,
|
2225
|
-
},
|
2229
|
+
Ot = new WeakSet(), $i = function() {
|
2230
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Nt, xi).call(this);
|
2231
|
+
}, Nt = new WeakSet(), xi = function() {
|
2232
|
+
this.s.childDom = this.childNodes, this.s.template = Is(this), this.innerHTML = "", this.append(this.s.template), d(this, Pt, Ci).call(this);
|
2233
|
+
}, Pt = new WeakSet(), Ci = function() {
|
2226
2234
|
var s;
|
2227
2235
|
const t = this;
|
2228
2236
|
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", Ns(t), t.s.subDropdownTotalH = 0;
|
@@ -2267,8 +2275,8 @@ It = new WeakSet(), $i = function() {
|
|
2267
2275
|
};
|
2268
2276
|
break;
|
2269
2277
|
}
|
2270
|
-
|
2271
|
-
},
|
2278
|
+
C(t, t.s.value.index), d(s = t, jt, Hi).call(s), t.classList.add("d4-initialize");
|
2279
|
+
}, jt = new WeakSet(), Hi = function() {
|
2272
2280
|
const t = this;
|
2273
2281
|
t.__events__.dropdownToggle = () => {
|
2274
2282
|
t.addEventListener("click", function(e) {
|
@@ -2330,10 +2338,10 @@ It = new WeakSet(), $i = function() {
|
|
2330
2338
|
c.stopPropagation();
|
2331
2339
|
const f = u.querySelector(".sub-dropdown"), b = f.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
|
2332
2340
|
f.style.cssText = `--height: ${b.offsetHeight + y}px`;
|
2333
|
-
const
|
2341
|
+
const _ = parseInt(f.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), S = () => {
|
2334
2342
|
s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2335
2343
|
};
|
2336
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
2344
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= _, S()) : (u.classList.add("open"), e.s.subDropdownTotalH += _, S());
|
2337
2345
|
const R = () => {
|
2338
2346
|
e.__scroller__.update(!0), f.removeEventListener("transitionend", R);
|
2339
2347
|
};
|
@@ -2343,15 +2351,15 @@ It = new WeakSet(), $i = function() {
|
|
2343
2351
|
case "single":
|
2344
2352
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
2345
2353
|
const f = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
|
2346
|
-
y && (y.querySelector(".dropdown-list").textContent = "",
|
2354
|
+
y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), Oe[f][b].forEach((_, G) => {
|
2347
2355
|
const S = document.createElement("li");
|
2348
|
-
S.textContent =
|
2356
|
+
S.textContent = _[0], S.setAttribute("data-option", _[0]), y.querySelector(".dropdown-list").append(S);
|
2349
2357
|
}), e.__events__.selectOption(y));
|
2350
2358
|
}
|
2351
2359
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2352
2360
|
break;
|
2353
2361
|
case "multiple":
|
2354
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
2362
|
+
c.stopPropagation(), u.classList.toggle("active"), C(e, p);
|
2355
2363
|
break;
|
2356
2364
|
}
|
2357
2365
|
});
|
@@ -2386,7 +2394,7 @@ It = new WeakSet(), $i = function() {
|
|
2386
2394
|
};
|
2387
2395
|
Object.assign(ki.prototype, O);
|
2388
2396
|
customElements.define("dropdown-el", ki);
|
2389
|
-
function
|
2397
|
+
function dt(n) {
|
2390
2398
|
const i = {};
|
2391
2399
|
return [...n.attributes].forEach((t) => {
|
2392
2400
|
if (t.name.includes("duration-")) {
|
@@ -2396,9 +2404,9 @@ function ct(n) {
|
|
2396
2404
|
}), Object.keys(i).length === 0 ? null : i;
|
2397
2405
|
}
|
2398
2406
|
function Be(n) {
|
2399
|
-
if (
|
2407
|
+
if (dt(n)) {
|
2400
2408
|
let i;
|
2401
|
-
const t = Object.keys(
|
2409
|
+
const t = Object.keys(dt(n)).map((e) => ({
|
2402
2410
|
value: e,
|
2403
2411
|
point: e
|
2404
2412
|
}));
|
@@ -2407,7 +2415,7 @@ function Be(n) {
|
|
2407
2415
|
const { point: s, value: o } = t[e];
|
2408
2416
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
2409
2417
|
}
|
2410
|
-
return i ? Number(
|
2418
|
+
return i ? Number(dt(n)[i]) : n.s.options.duration;
|
2411
2419
|
} else
|
2412
2420
|
return n.s.options.duration;
|
2413
2421
|
}
|
@@ -2422,7 +2430,7 @@ function zs(n) {
|
|
2422
2430
|
}
|
2423
2431
|
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;
|
2424
2432
|
}
|
2425
|
-
function
|
2433
|
+
function k(n) {
|
2426
2434
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2427
2435
|
let s = {};
|
2428
2436
|
switch (i) {
|
@@ -2484,14 +2492,14 @@ function Ws(n) {
|
|
2484
2492
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2485
2493
|
};
|
2486
2494
|
}
|
2487
|
-
var
|
2495
|
+
var zt, Mi, Wt, qi, Bt, Ii, Gt, Oi;
|
2488
2496
|
class Bs extends HTMLElement {
|
2489
2497
|
constructor() {
|
2490
2498
|
super();
|
2491
|
-
h(this, jt);
|
2492
2499
|
h(this, zt);
|
2493
2500
|
h(this, Wt);
|
2494
2501
|
h(this, Bt);
|
2502
|
+
h(this, Gt);
|
2495
2503
|
this.initialize = !1;
|
2496
2504
|
}
|
2497
2505
|
static get observedAttributes() {
|
@@ -2500,7 +2508,7 @@ class Bs extends HTMLElement {
|
|
2500
2508
|
attributeChangedCallback(t, e, s) {
|
2501
2509
|
}
|
2502
2510
|
connectedCallback() {
|
2503
|
-
this.initialize || (this.initialize = !0, d(this,
|
2511
|
+
this.initialize || (this.initialize = !0, d(this, zt, Mi).call(this));
|
2504
2512
|
}
|
2505
2513
|
play() {
|
2506
2514
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -2509,25 +2517,25 @@ class Bs extends HTMLElement {
|
|
2509
2517
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
2510
2518
|
}
|
2511
2519
|
}
|
2512
|
-
|
2520
|
+
zt = new WeakSet(), Mi = function() {
|
2513
2521
|
const t = {
|
2514
|
-
direction: this.getAttribute("direction") ||
|
2522
|
+
direction: this.getAttribute("direction") || x.SETTINGS.direction,
|
2515
2523
|
// up / down / left / right
|
2516
|
-
behavior: this.getAttribute("behavior") ||
|
2524
|
+
behavior: this.getAttribute("behavior") || x.SETTINGS.behavior,
|
2517
2525
|
// normal / alternate / endStop
|
2518
|
-
duration: Number(this.getAttribute("duration")) ||
|
2526
|
+
duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
|
2519
2527
|
// ms
|
2520
|
-
durationBreakpoints:
|
2521
|
-
autoplay: this.getAttribute("autoplay") ||
|
2528
|
+
durationBreakpoints: dt(this) || x.SETTINGS.durationBreakpoints,
|
2529
|
+
autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
|
2522
2530
|
// normal / alternate / endStop
|
2523
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
2531
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
|
2524
2532
|
// true / false
|
2525
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
2533
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : x.SETTINGS.continual,
|
2526
2534
|
// true / false
|
2527
|
-
gap: Number(this.getAttribute("gap")) ||
|
2535
|
+
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
2528
2536
|
};
|
2529
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this,
|
2530
|
-
},
|
2537
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), zs(this), d(this, Wt, qi).call(this);
|
2538
|
+
}, Wt = new WeakSet(), qi = function() {
|
2531
2539
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
2532
2540
|
switch (t) {
|
2533
2541
|
case "left":
|
@@ -2539,17 +2547,17 @@ jt = new WeakSet(), Mi = function() {
|
|
2539
2547
|
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;`;
|
2540
2548
|
break;
|
2541
2549
|
}
|
2542
|
-
d(this,
|
2543
|
-
},
|
2550
|
+
d(this, Bt, Ii).call(this), d(this, Gt, Oi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2551
|
+
}, Bt = new WeakSet(), Ii = function() {
|
2544
2552
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2545
2553
|
let c;
|
2546
2554
|
function u() {
|
2547
2555
|
switch (s) {
|
2548
2556
|
case "normal":
|
2549
|
-
t.s.animateEl.style.transform = `${
|
2557
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2550
2558
|
duration: t.s.nowDuration,
|
2551
2559
|
iterations: 1 / 0
|
2552
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2560
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${k(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2553
2561
|
duration: t.s.nowDuration,
|
2554
2562
|
delay: -t.s.nowDuration / 2,
|
2555
2563
|
iterations: 1 / 0
|
@@ -2578,7 +2586,7 @@ jt = new WeakSet(), Mi = function() {
|
|
2578
2586
|
duration: g,
|
2579
2587
|
fill: "forwards"
|
2580
2588
|
}).finished.then(() => {
|
2581
|
-
t.s.animation = t.s.animateEl.animate(
|
2589
|
+
t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2582
2590
|
duration: t.s.nowDuration,
|
2583
2591
|
iterations: 1 / 0
|
2584
2592
|
});
|
@@ -2587,7 +2595,7 @@ jt = new WeakSet(), Mi = function() {
|
|
2587
2595
|
});
|
2588
2596
|
break;
|
2589
2597
|
case "endStop":
|
2590
|
-
t.s.animateEl.style.transform = `${
|
2598
|
+
t.s.animateEl.style.transform = `${k(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2591
2599
|
duration: t.s.nowDuration,
|
2592
2600
|
fill: "forwards"
|
2593
2601
|
});
|
@@ -2605,14 +2613,14 @@ jt = new WeakSet(), Mi = function() {
|
|
2605
2613
|
}), t.addEventListener("mouseleave", function() {
|
2606
2614
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
2607
2615
|
});
|
2608
|
-
},
|
2616
|
+
}, Gt = new WeakSet(), Oi = function() {
|
2609
2617
|
const t = this;
|
2610
2618
|
function e() {
|
2611
2619
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2612
|
-
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(
|
2620
|
+
t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(k(t).animate1, {
|
2613
2621
|
duration: t.s.nowDuration,
|
2614
2622
|
iterations: 1 / 0
|
2615
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2623
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(k(t).animate2, {
|
2616
2624
|
duration: t.s.nowDuration,
|
2617
2625
|
delay: -t.s.nowDuration / 2,
|
2618
2626
|
iterations: 1 / 0
|
@@ -2621,12 +2629,12 @@ jt = new WeakSet(), Mi = function() {
|
|
2621
2629
|
window.addEventListener("resize", Ws(e));
|
2622
2630
|
};
|
2623
2631
|
customElements.define("marquee-el", Bs);
|
2624
|
-
const
|
2632
|
+
const pt = function(n, i) {
|
2625
2633
|
let t;
|
2626
2634
|
return function(e) {
|
2627
2635
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
2628
2636
|
};
|
2629
|
-
},
|
2637
|
+
}, $ = (n, i) => {
|
2630
2638
|
if (rt(n)) {
|
2631
2639
|
n.forEach((t) => {
|
2632
2640
|
t.classList.add(i);
|
@@ -2643,22 +2651,22 @@ const ht = function(n, i) {
|
|
2643
2651
|
}
|
2644
2652
|
n.classList.remove(i);
|
2645
2653
|
};
|
2646
|
-
var
|
2654
|
+
var Rt, Ni, Xt, Pi, Ft, ji, tt, _e, W, ut, Yt, zi;
|
2647
2655
|
class Ge {
|
2648
2656
|
constructor(i) {
|
2649
2657
|
// 初始化
|
2650
|
-
h(this, Gt);
|
2651
|
-
// 左右箭頭事件綁定
|
2652
2658
|
h(this, Rt);
|
2653
|
-
//
|
2659
|
+
// 左右箭頭事件綁定
|
2654
2660
|
h(this, Xt);
|
2661
|
+
// 左右拖拉事件綁定
|
2662
|
+
h(this, Ft);
|
2655
2663
|
// 卷軸位置判斷
|
2656
2664
|
h(this, tt);
|
2657
2665
|
// 隱藏按鈕判斷
|
2658
2666
|
h(this, W);
|
2659
2667
|
// 選項事件綁定
|
2660
|
-
h(this,
|
2661
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
2668
|
+
h(this, Yt);
|
2669
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Rt, Ni).call(this);
|
2662
2670
|
}
|
2663
2671
|
// 更新 active 位置
|
2664
2672
|
update(i) {
|
@@ -2672,7 +2680,7 @@ class Ge {
|
|
2672
2680
|
}
|
2673
2681
|
}
|
2674
2682
|
}
|
2675
|
-
|
2683
|
+
Rt = new WeakSet(), Ni = function() {
|
2676
2684
|
var e, s, o, a, r, l;
|
2677
2685
|
const i = this;
|
2678
2686
|
if (!i.$element)
|
@@ -2680,9 +2688,9 @@ Gt = new WeakSet(), Ni = function() {
|
|
2680
2688
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2681
2689
|
const t = () => {
|
2682
2690
|
var c, u;
|
2683
|
-
d(c = i, tt, _e).call(c), d(u = i, W,
|
2691
|
+
d(c = i, tt, _e).call(c), d(u = i, W, ut).call(u);
|
2684
2692
|
};
|
2685
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
2693
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", pt(t)), window.addEventListener("resize", pt(t)), (i.option.draggable || i.$element.s.type == "collapse") && d(e = i, Ft, ji).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2686
2694
|
E.prepend,
|
2687
2695
|
`<div class="navigation">
|
2688
2696
|
<div class="button prev">
|
@@ -2692,8 +2700,8 @@ Gt = new WeakSet(), Ni = function() {
|
|
2692
2700
|
<div></div>
|
2693
2701
|
</div>
|
2694
2702
|
</div>`
|
2695
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i,
|
2696
|
-
},
|
2703
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), d(o = i, Xt, Pi).call(o)), d(a = i, tt, _e).call(a), d(r = i, W, ut).call(r), d(l = i, Yt, zi).call(l), i.update();
|
2704
|
+
}, Xt = new WeakSet(), Pi = function() {
|
2697
2705
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2698
2706
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
2699
2707
|
t.scrollTo({
|
@@ -2701,13 +2709,13 @@ Gt = new WeakSet(), Ni = function() {
|
|
2701
2709
|
behavior: "smooth"
|
2702
2710
|
}), setTimeout(() => {
|
2703
2711
|
var r;
|
2704
|
-
d(r = i, W,
|
2712
|
+
d(r = i, W, ut).call(r);
|
2705
2713
|
}, 100);
|
2706
2714
|
};
|
2707
2715
|
e.forEach((o) => {
|
2708
2716
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
2709
2717
|
});
|
2710
|
-
},
|
2718
|
+
}, Ft = new WeakSet(), ji = function() {
|
2711
2719
|
const { $wrapper: i } = this;
|
2712
2720
|
let t = !1, e = !1, s = 0, o = 0;
|
2713
2721
|
const a = function(p) {
|
@@ -2739,30 +2747,30 @@ Gt = new WeakSet(), Ni = function() {
|
|
2739
2747
|
});
|
2740
2748
|
}, tt = new WeakSet(), _e = function() {
|
2741
2749
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
2742
|
-
e <= 0 || (
|
2743
|
-
}, W = new WeakSet(),
|
2750
|
+
e <= 0 || ($(i, "scrollable"), s == 0 ? (D(i, "scrollable"), $(t, "start"), D(t, "end")) : s + 1 >= e ? (D(i, "scrollable"), D(t, "start"), $(t, "end")) : ($(t, "center"), D(t, "start"), D(t, "end")));
|
2751
|
+
}, W = new WeakSet(), ut = function() {
|
2744
2752
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2745
2753
|
if (!t)
|
2746
2754
|
return;
|
2747
2755
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2748
2756
|
if (s <= 0) {
|
2749
|
-
|
2757
|
+
$(t, "hide"), D(t, "active"), $(e, "noScrollable");
|
2750
2758
|
return;
|
2751
2759
|
}
|
2752
|
-
s > 0 && (
|
2760
|
+
s > 0 && ($(t, "active"), D(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2753
2761
|
if (a.classList.contains("next")) {
|
2754
2762
|
D(a, "hide");
|
2755
2763
|
return;
|
2756
2764
|
}
|
2757
|
-
|
2765
|
+
$(a, "hide");
|
2758
2766
|
}) : o + 1 >= s ? t.forEach((a) => {
|
2759
2767
|
if (a.classList.contains("next")) {
|
2760
|
-
|
2768
|
+
$(a, "hide");
|
2761
2769
|
return;
|
2762
2770
|
}
|
2763
2771
|
D(a, "hide");
|
2764
2772
|
}) : D(t, "hide");
|
2765
|
-
},
|
2773
|
+
}, Yt = new WeakSet(), zi = function() {
|
2766
2774
|
const { $element: i } = this, t = (s) => {
|
2767
2775
|
if (this.option.selected) {
|
2768
2776
|
const o = s.getAttribute("data-option").trim();
|
@@ -2776,31 +2784,31 @@ Gt = new WeakSet(), Ni = function() {
|
|
2776
2784
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
2777
2785
|
});
|
2778
2786
|
};
|
2779
|
-
var
|
2787
|
+
var Ut, Wi, Jt, Bi, Zt, Gi, Qt, Ri;
|
2780
2788
|
class Gs {
|
2781
2789
|
constructor(i) {
|
2782
2790
|
// 初始化
|
2783
|
-
h(this, Yt);
|
2784
|
-
// 隱藏按鈕判斷
|
2785
2791
|
h(this, Ut);
|
2786
|
-
//
|
2792
|
+
// 隱藏按鈕判斷
|
2787
2793
|
h(this, Jt);
|
2788
|
-
//
|
2794
|
+
// 展開箭頭事件綁定
|
2789
2795
|
h(this, Zt);
|
2790
|
-
|
2796
|
+
// 選項事件綁定
|
2797
|
+
h(this, Qt);
|
2798
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Ut, Wi).call(this);
|
2791
2799
|
}
|
2792
2800
|
}
|
2793
|
-
|
2794
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
2795
|
-
},
|
2801
|
+
Ut = new WeakSet(), Wi = function() {
|
2802
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Jt, Bi).call(this) && d(this, Zt, Gi).call(this), d(this, Qt, Ri).call(this));
|
2803
|
+
}, Jt = new WeakSet(), Bi = function() {
|
2796
2804
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2797
2805
|
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
2798
|
-
},
|
2806
|
+
}, Zt = new WeakSet(), Gi = function() {
|
2799
2807
|
const { $element: i, $button: t } = this, e = function() {
|
2800
2808
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
2801
2809
|
};
|
2802
2810
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
2803
|
-
},
|
2811
|
+
}, Qt = new WeakSet(), Ri = function() {
|
2804
2812
|
const { $element: i } = this, t = (s, o) => {
|
2805
2813
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
2806
2814
|
const a = s.getAttribute("data-option").trim();
|
@@ -2816,14 +2824,14 @@ Yt = new WeakSet(), Wi = function() {
|
|
2816
2824
|
};
|
2817
2825
|
const Rs = (n) => {
|
2818
2826
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
2819
|
-
return i == "drag" && (s.innerHTML =
|
2827
|
+
return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, e)), i == "collapse" && (s.innerHTML = H.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 = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(E.append, e)), s.children;
|
2820
2828
|
};
|
2821
|
-
var
|
2829
|
+
var Vt, Xi, Kt, Fi, et, ke, B, ht;
|
2822
2830
|
class Xs extends HTMLElement {
|
2823
2831
|
constructor() {
|
2824
2832
|
super();
|
2825
|
-
h(this, Qt);
|
2826
2833
|
h(this, Vt);
|
2834
|
+
h(this, Kt);
|
2827
2835
|
// 斷點設定
|
2828
2836
|
h(this, et);
|
2829
2837
|
// check type
|
@@ -2839,7 +2847,7 @@ class Xs extends HTMLElement {
|
|
2839
2847
|
case "m4-type":
|
2840
2848
|
if (e === null || e === s)
|
2841
2849
|
return;
|
2842
|
-
this.s.type = s, d(this, B,
|
2850
|
+
this.s.type = s, d(this, B, ht).call(this);
|
2843
2851
|
break;
|
2844
2852
|
case "m4-status":
|
2845
2853
|
if (e === s)
|
@@ -2856,15 +2864,15 @@ class Xs extends HTMLElement {
|
|
2856
2864
|
}
|
2857
2865
|
}
|
2858
2866
|
connectedCallback() {
|
2859
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
2867
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Vt, Xi).call(this));
|
2860
2868
|
}
|
2861
2869
|
update() {
|
2862
2870
|
d(this, et, ke).call(this);
|
2863
2871
|
}
|
2864
2872
|
}
|
2865
|
-
|
2873
|
+
Vt = new WeakSet(), Xi = function() {
|
2866
2874
|
let t = {};
|
2867
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
2875
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? H.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
2868
2876
|
const e = (s) => {
|
2869
2877
|
if (s.type === "resize") {
|
2870
2878
|
if (window.innerWidth === this.previousWidth)
|
@@ -2873,20 +2881,20 @@ Qt = new WeakSet(), Xi = function() {
|
|
2873
2881
|
}
|
2874
2882
|
this.update();
|
2875
2883
|
};
|
2876
|
-
window.removeEventListener("resize",
|
2877
|
-
},
|
2884
|
+
window.removeEventListener("resize", pt(e)), window.addEventListener("resize", pt(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, Kt, Fi).call(this);
|
2885
|
+
}, Kt = new WeakSet(), Fi = function() {
|
2878
2886
|
this.classList.add("m4-init"), d(this, et, ke).call(this);
|
2879
2887
|
}, et = new WeakSet(), ke = function() {
|
2880
2888
|
const t = Object.keys(this.s.option.breakpoint);
|
2881
2889
|
if (!t.length) {
|
2882
|
-
d(this, B,
|
2890
|
+
d(this, B, ht).call(this);
|
2883
2891
|
return;
|
2884
2892
|
}
|
2885
2893
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
2886
2894
|
var s, o, a, r;
|
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,
|
2895
|
+
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, ht).call(this), window.innerWidth >= e;
|
2888
2896
|
});
|
2889
|
-
}, B = new WeakSet(),
|
2897
|
+
}, B = new WeakSet(), ht = function() {
|
2890
2898
|
var o;
|
2891
2899
|
const { type: t } = this.s;
|
2892
2900
|
this.innerHTML = "", [...Rs(this)].forEach((a) => {
|
@@ -2908,53 +2916,53 @@ Qt = new WeakSet(), Xi = function() {
|
|
2908
2916
|
(o = this.constructor.drag) == null || o.update(this);
|
2909
2917
|
};
|
2910
2918
|
customElements.define("multipurpose-nav", Xs);
|
2911
|
-
var
|
2919
|
+
var te, Ui, ee, Ji, it, $e, P, F, ie, Zi, se, Qi, ne, Vi, oe, Ki, ae, ts, re, es, le, is, ce, ss, de, ns, q, z, ue, os, he, as, pe, rs, me, ls;
|
2912
2920
|
class Yi extends HTMLElement {
|
2913
2921
|
// 定義組件的初始狀態
|
2914
2922
|
constructor(t, e) {
|
2915
2923
|
super();
|
2916
|
-
h(this, Kt);
|
2917
2924
|
h(this, te);
|
2925
|
+
h(this, ee);
|
2918
2926
|
// 第一關 判斷數量以及id設定
|
2919
2927
|
h(this, it);
|
2920
2928
|
// 第二關 id命名提醒
|
2921
2929
|
h(this, P);
|
2922
|
-
h(this, ee);
|
2923
2930
|
h(this, ie);
|
2924
2931
|
h(this, se);
|
2932
|
+
h(this, ne);
|
2925
2933
|
// 執行函式
|
2926
2934
|
// 移動至指定位置
|
2927
|
-
h(this, ne);
|
2928
|
-
// 移動
|
2929
2935
|
h(this, oe);
|
2930
|
-
//
|
2936
|
+
// 移動
|
2931
2937
|
h(this, ae);
|
2932
|
-
//
|
2938
|
+
// 步驟狀態
|
2933
2939
|
h(this, re);
|
2934
|
-
//
|
2940
|
+
// next 按鈕狀態
|
2935
2941
|
h(this, le);
|
2936
|
-
//
|
2942
|
+
// prev 按鈕狀態
|
2937
2943
|
h(this, ce);
|
2944
|
+
// 頁籤狀態
|
2945
|
+
h(this, de);
|
2938
2946
|
// 第三關各種元件判斷 及 執行
|
2939
2947
|
h(this, q);
|
2940
2948
|
// 消失動畫
|
2941
|
-
h(this, de);
|
2942
|
-
// 出現動畫
|
2943
2949
|
h(this, ue);
|
2944
|
-
//
|
2950
|
+
// 出現動畫
|
2945
2951
|
h(this, he);
|
2946
|
-
//
|
2952
|
+
// 狀態
|
2947
2953
|
h(this, pe);
|
2954
|
+
// resize
|
2955
|
+
h(this, me);
|
2948
2956
|
}
|
2949
2957
|
// 當組件的屬性被更改時會被呼叫
|
2950
2958
|
static get observedAttributes() {
|
2951
2959
|
return ["t4-active"];
|
2952
2960
|
}
|
2953
2961
|
attributeChangedCallback(t, e, s) {
|
2954
|
-
t === "t4-active" && e !== s && d(this,
|
2962
|
+
t === "t4-active" && e !== s && d(this, pe, rs).call(this, s);
|
2955
2963
|
}
|
2956
2964
|
connectedCallback() {
|
2957
|
-
this.classList.contains("t4-initialize") || d(this,
|
2965
|
+
this.classList.contains("t4-initialize") || d(this, te, Ui).call(this);
|
2958
2966
|
}
|
2959
2967
|
// ------------- 我是分隔線呦 -------------
|
2960
2968
|
// 頁籤切換
|
@@ -2970,7 +2978,7 @@ class Yi extends HTMLElement {
|
|
2970
2978
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2971
2979
|
const o = d(this, P, F).call(this, s);
|
2972
2980
|
e.tabPanels.forEach((a, r) => {
|
2973
|
-
r === o ? d(this,
|
2981
|
+
r === o ? d(this, he, as).call(this, r) : d(this, ue, os).call(this, r);
|
2974
2982
|
});
|
2975
2983
|
}
|
2976
2984
|
// 外部呼叫方法 $0.goNext()
|
@@ -2988,7 +2996,7 @@ class Yi extends HTMLElement {
|
|
2988
2996
|
this.t.tabs = d(this, it, $e).call(this), cs(), console.log("tab update!!!!");
|
2989
2997
|
}
|
2990
2998
|
}
|
2991
|
-
|
2999
|
+
te = new WeakSet(), Ui = function() {
|
2992
3000
|
const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ue;
|
2993
3001
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
2994
3002
|
tabs: [],
|
@@ -3008,13 +3016,13 @@ Kt = new WeakSet(), Ui = function() {
|
|
3008
3016
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
3009
3017
|
},
|
3010
3018
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
3011
|
-
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this,
|
3012
|
-
},
|
3013
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
3019
|
+
}, this.__events__ = {}, this.t.tabs = d(this, it, $e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ee, Ji).call(this);
|
3020
|
+
}, ee = new WeakSet(), Ji = function() {
|
3021
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ie, Zi).call(this), this.t.recordUrl) {
|
3014
3022
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
3015
3023
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
3016
3024
|
}
|
3017
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
3025
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, me, ls).call(this);
|
3018
3026
|
}, it = new WeakSet(), $e = function() {
|
3019
3027
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
3020
3028
|
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) => {
|
@@ -3025,19 +3033,19 @@ Kt = new WeakSet(), Ui = function() {
|
|
3025
3033
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
3026
3034
|
const o = s[0];
|
3027
3035
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
3028
|
-
},
|
3036
|
+
}, ie = new WeakSet(), Zi = function() {
|
3029
3037
|
const t = document.createElement("div");
|
3030
3038
|
t.classList.add("swiper-container");
|
3031
3039
|
const e = document.createElement("div");
|
3032
3040
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
3033
3041
|
e.appendChild(s.cloneNode(!0));
|
3034
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
3035
|
-
},
|
3042
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, se, Qi).call(this);
|
3043
|
+
}, se = new WeakSet(), Qi = function() {
|
3036
3044
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
3037
3045
|
t.style.overflow = "hidden", e.style.display = "flex";
|
3038
3046
|
const o = s.length * 100 + "%";
|
3039
3047
|
e.style.width = o;
|
3040
|
-
},
|
3048
|
+
}, ne = new WeakSet(), Vi = function(t) {
|
3041
3049
|
const { t: e } = this;
|
3042
3050
|
if (e.recordUrl === "true") {
|
3043
3051
|
const s = new URLSearchParams(document.location.search);
|
@@ -3045,28 +3053,28 @@ Kt = new WeakSet(), Ui = function() {
|
|
3045
3053
|
const o = `${window.location.pathname}?${s.toString()}`;
|
3046
3054
|
history.replaceState({ t4Id: t }, "", o);
|
3047
3055
|
}
|
3048
|
-
},
|
3056
|
+
}, oe = new WeakSet(), Ki = function() {
|
3049
3057
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
3050
|
-
d(this,
|
3051
|
-
},
|
3058
|
+
d(this, ae, ts).call(this, o);
|
3059
|
+
}, ae = new WeakSet(), ts = function(t) {
|
3052
3060
|
window.scrollTo({
|
3053
3061
|
top: t,
|
3054
3062
|
behavior: "smooth"
|
3055
3063
|
});
|
3056
|
-
},
|
3064
|
+
}, re = new WeakSet(), es = function(t) {
|
3057
3065
|
let e = parseInt(t, 10) + 1;
|
3058
3066
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
3059
|
-
},
|
3067
|
+
}, le = new WeakSet(), is = function(t) {
|
3060
3068
|
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
|
3061
3069
|
e.forEach((a) => {
|
3062
3070
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3063
3071
|
});
|
3064
|
-
},
|
3072
|
+
}, ce = new WeakSet(), ss = function(t) {
|
3065
3073
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
3066
3074
|
e.forEach((a) => {
|
3067
3075
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
3068
3076
|
});
|
3069
|
-
},
|
3077
|
+
}, de = new WeakSet(), ns = function(t, e) {
|
3070
3078
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
3071
3079
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
3072
3080
|
}) : this.t.tabs.forEach((s, o) => {
|
@@ -3075,25 +3083,25 @@ Kt = new WeakSet(), Ui = function() {
|
|
3075
3083
|
}, q = new WeakSet(), z = function(t, e, s) {
|
3076
3084
|
switch (t) {
|
3077
3085
|
case "step":
|
3078
|
-
|
3086
|
+
we(this.t.step) && d(this, re, es).call(this, e);
|
3079
3087
|
break;
|
3080
3088
|
case "eventAnchor":
|
3081
|
-
this.t.anchor && d(this,
|
3089
|
+
this.t.anchor && d(this, oe, Ki).call(this);
|
3082
3090
|
break;
|
3083
3091
|
case "tabState":
|
3084
|
-
this.t.type == "normal" && d(this,
|
3092
|
+
this.t.type == "normal" && d(this, de, ns).call(this, e, s);
|
3085
3093
|
break;
|
3086
3094
|
case "btnState":
|
3087
|
-
d(this,
|
3095
|
+
d(this, le, is).call(this, e), d(this, ce, ss).call(this, e);
|
3088
3096
|
break;
|
3089
3097
|
case "tabUrl":
|
3090
|
-
this.t.recordUrl === "true" && d(this,
|
3098
|
+
this.t.recordUrl === "true" && d(this, ne, Vi).call(this, e);
|
3091
3099
|
break;
|
3092
3100
|
default:
|
3093
3101
|
console.warn("請增加判斷,謝謝");
|
3094
3102
|
break;
|
3095
3103
|
}
|
3096
|
-
},
|
3104
|
+
}, ue = new WeakSet(), os = function(t) {
|
3097
3105
|
const { t: e } = this;
|
3098
3106
|
this.t.transition;
|
3099
3107
|
const s = e.tabPanels[t];
|
@@ -3110,7 +3118,7 @@ Kt = new WeakSet(), Ui = function() {
|
|
3110
3118
|
s.style.display = "none";
|
3111
3119
|
break;
|
3112
3120
|
}
|
3113
|
-
},
|
3121
|
+
}, he = new WeakSet(), as = function(t) {
|
3114
3122
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
3115
3123
|
let r;
|
3116
3124
|
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
@@ -3135,10 +3143,10 @@ Kt = new WeakSet(), Ui = function() {
|
|
3135
3143
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
3136
3144
|
break;
|
3137
3145
|
}
|
3138
|
-
},
|
3146
|
+
}, pe = new WeakSet(), rs = function(t) {
|
3139
3147
|
const e = d(this, P, F).call(this, t);
|
3140
3148
|
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");
|
3141
|
-
},
|
3149
|
+
}, me = new WeakSet(), ls = function() {
|
3142
3150
|
const t = this;
|
3143
3151
|
window.addEventListener(
|
3144
3152
|
"resize",
|
@@ -3193,14 +3201,14 @@ const Re = (n) => {
|
|
3193
3201
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
3194
3202
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
3195
3203
|
};
|
3196
|
-
var st, xe,
|
3204
|
+
var st, xe, ge, ds, fe, us, nt, Ce;
|
3197
3205
|
class Us {
|
3198
3206
|
constructor(i, t = {}) {
|
3199
3207
|
h(this, st);
|
3200
|
-
h(this, me);
|
3201
3208
|
h(this, ge);
|
3209
|
+
h(this, fe);
|
3202
3210
|
h(this, nt);
|
3203
|
-
!at(i) && !
|
3211
|
+
!at(i) && !we(i) && !rt(i) && !w(i) || (this.__storage__ = {
|
3204
3212
|
el: i,
|
3205
3213
|
options: t
|
3206
3214
|
}, this.active = "data-collapse-active", d(this, st, xe).call(this));
|
@@ -3214,13 +3222,13 @@ st = new WeakSet(), xe = function() {
|
|
3214
3222
|
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)
|
3215
3223
|
for (const [o, a] of Object.entries(this.options.on))
|
3216
3224
|
this.__events__[o] = [a];
|
3217
|
-
d(this,
|
3218
|
-
},
|
3225
|
+
d(this, ge, ds).call(this);
|
3226
|
+
}, ge = new WeakSet(), ds = function() {
|
3219
3227
|
const { elements: i, options: t } = this;
|
3220
3228
|
i.forEach((e) => {
|
3221
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
3229
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, fe, us).call(this, e);
|
3222
3230
|
}), this.emit("init");
|
3223
|
-
},
|
3231
|
+
}, fe = new WeakSet(), us = function(i) {
|
3224
3232
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
3225
3233
|
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, nt, Ce)), c.addEventListener("click", d(this, nt, Ce)), r) {
|
3226
3234
|
const p = (g) => {
|
@@ -3248,14 +3256,14 @@ function hs() {
|
|
3248
3256
|
});
|
3249
3257
|
}
|
3250
3258
|
document.addEventListener("click", hs);
|
3251
|
-
var ot, He,
|
3259
|
+
var ot, He, ve, ps, be, ms, ye, gs;
|
3252
3260
|
class Zs extends HTMLElement {
|
3253
3261
|
constructor() {
|
3254
3262
|
super();
|
3255
3263
|
h(this, ot);
|
3256
|
-
h(this, fe);
|
3257
3264
|
h(this, ve);
|
3258
3265
|
h(this, be);
|
3266
|
+
h(this, ye);
|
3259
3267
|
this.initialize = !1;
|
3260
3268
|
}
|
3261
3269
|
connectedCallback() {
|
@@ -3281,13 +3289,13 @@ ot = new WeakSet(), He = function() {
|
|
3281
3289
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3282
3290
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3283
3291
|
};
|
3284
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
3285
|
-
},
|
3286
|
-
d(this,
|
3287
|
-
},
|
3292
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, ve, ps).call(this);
|
3293
|
+
}, ve = new WeakSet(), ps = function() {
|
3294
|
+
d(this, be, ms).call(this), d(this, ye, gs).call(this), this.classList.add("r4-initialize");
|
3295
|
+
}, be = new WeakSet(), ms = function() {
|
3288
3296
|
const t = this, e = document.createElement("i");
|
3289
3297
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
3290
|
-
},
|
3298
|
+
}, ye = new WeakSet(), gs = function() {
|
3291
3299
|
const t = this.querySelector("i.hover-ball"), e = this;
|
3292
3300
|
e.addEventListener("click", function(a) {
|
3293
3301
|
a.stopPropagation(), e.s.options.click && Js(a, e);
|