@xwadex/fesd 0.0.1-4.7.rc → 0.0.1-4.9.rc
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/assets/fesd-bundle.css +9 -9
- package/dist/assets/fesd-bundle.js +632 -365
- package/dist/assets/fesd-bundle.js.map +1 -1
- package/dist/assets/image-preview-bundle.js +9118 -7471
- package/dist/assets/image-preview-bundle.js.map +1 -1
- package/dist/assets/tools-bundle.js +3201 -4903
- package/dist/assets/tools-bundle.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,55 +1,118 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!e.has(
|
|
1
|
+
var Ft = (i, e, t) => {
|
|
2
|
+
if (!e.has(i))
|
|
3
3
|
throw TypeError("Cannot " + t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
if (e.has(
|
|
5
|
+
var d = (i, e, t) => {
|
|
6
|
+
if (e.has(i))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
e instanceof WeakSet ? e.add(
|
|
8
|
+
e instanceof WeakSet ? e.add(i) : e.set(i, t);
|
|
9
9
|
};
|
|
10
|
-
var o = (
|
|
11
|
-
import { i as
|
|
12
|
-
import { A as
|
|
13
|
-
const
|
|
14
|
-
|
|
10
|
+
var o = (i, e, t) => (Ft(i, e, "access private method"), t);
|
|
11
|
+
import { i as $t, a as ut, g as Lt, v as Ut, c as Vt, S as Jt, b as bt, d as Kt, e as Yt, f as A, s as Qt, m as y, h as $ } from "./image-preview-bundle.js";
|
|
12
|
+
import { A as we, k as ye, C as Ee, j as $e, D as Le, l as Ae, I as Se, M as xe, R as ke, T as Te } from "./image-preview-bundle.js";
|
|
13
|
+
const I = () => {
|
|
14
|
+
const i = navigator.userAgent, e = {
|
|
15
|
+
// Firefox 1.0+
|
|
16
|
+
isFirefox: typeof InstallTrigger < "u",
|
|
17
|
+
// Opera 8.0+
|
|
18
|
+
isOpera: !!window.opr && !!opr.addons || !!window.opera || i.indexOf(" OPR/") >= 0,
|
|
19
|
+
// Internet Explorer 6-11
|
|
20
|
+
isIE: (
|
|
21
|
+
/*@cc_on!@*/
|
|
22
|
+
!!document.documentMode
|
|
23
|
+
),
|
|
24
|
+
// Edge 20+
|
|
25
|
+
isEdge: !document.documentMode && !!window.StyleMedia,
|
|
26
|
+
// Edge (based on chromium) detection
|
|
27
|
+
isEdgeChromium: /\sedg\//i.test(i) || /edg([ea]|ios)/i.test(i),
|
|
28
|
+
// Safari 3.0+ "[object HTMLElementConstructor]"
|
|
29
|
+
isSafari: !/chrome|crios|crmo/i.test(i) && /safari/i.test(i),
|
|
30
|
+
// Chrome 1 - 79
|
|
31
|
+
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(i)
|
|
32
|
+
}, t = {
|
|
33
|
+
// Android
|
|
34
|
+
isAndroid: i.indexOf("Android") > -1 || i.indexOf("Adr") > -1,
|
|
35
|
+
// iOS | ipad
|
|
36
|
+
isiOS: i.indexOf("Mac") > -1 && "ontouchend" in document
|
|
37
|
+
}, s = {
|
|
38
|
+
// window
|
|
39
|
+
isWindows: i.indexOf("Win") > -1,
|
|
40
|
+
// macos
|
|
41
|
+
isMacOS: i.indexOf("Mac") > -1,
|
|
42
|
+
// UNIX
|
|
43
|
+
isUNIX: i.indexOf("X11") > -1,
|
|
44
|
+
// Linux
|
|
45
|
+
isLinux: i.indexOf("Linux") > -1
|
|
46
|
+
};
|
|
47
|
+
return { browser: e, mobile: t, os: s };
|
|
48
|
+
}, Zt = () => {
|
|
49
|
+
const { browser: i } = I();
|
|
50
|
+
return Object.keys(i).find((e) => {
|
|
51
|
+
if (i[e])
|
|
52
|
+
return i[e];
|
|
53
|
+
});
|
|
54
|
+
}, te = () => {
|
|
55
|
+
const { mobile: i } = I();
|
|
56
|
+
return Object.keys(i).some((e) => {
|
|
57
|
+
if (i[e])
|
|
58
|
+
return i[e];
|
|
59
|
+
});
|
|
60
|
+
}, ee = () => {
|
|
61
|
+
const { os: i } = I();
|
|
62
|
+
return Object.keys(i).find((e) => {
|
|
63
|
+
if (i[e])
|
|
64
|
+
return i[e];
|
|
65
|
+
});
|
|
66
|
+
}, se = () => console.dir(I());
|
|
67
|
+
function ue() {
|
|
68
|
+
return {
|
|
69
|
+
init: I,
|
|
70
|
+
isBrowser4: Zt,
|
|
71
|
+
isMobile4: te,
|
|
72
|
+
isOs4: ee,
|
|
73
|
+
logs: se
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const g = (i, e, t) => {
|
|
77
|
+
i && (bt(i) ? i.forEach((s) => s.style[e] = t) : i.style[e] = t);
|
|
15
78
|
};
|
|
16
|
-
var
|
|
17
|
-
class
|
|
79
|
+
var B, At, X, St, W, pt, R, xt, q, mt, G, kt;
|
|
80
|
+
class pe {
|
|
18
81
|
constructor(e, t = {}) {
|
|
19
|
-
|
|
20
|
-
|
|
82
|
+
d(this, B);
|
|
83
|
+
d(this, X);
|
|
21
84
|
// 取得元件上的設定值
|
|
22
|
-
|
|
85
|
+
d(this, W);
|
|
23
86
|
// 設置設定值的 CSS 樣式
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
87
|
+
d(this, R);
|
|
88
|
+
d(this, q);
|
|
89
|
+
d(this, G);
|
|
90
|
+
!$t(e) || !ut(e) || (this.__storage__ = {
|
|
28
91
|
el: e,
|
|
29
92
|
options: t
|
|
30
|
-
}, o(this,
|
|
93
|
+
}, o(this, B, At).call(this));
|
|
31
94
|
}
|
|
32
95
|
update() {
|
|
33
96
|
const { elements: e } = this;
|
|
34
97
|
e.forEach((t) => {
|
|
35
|
-
t.querySelectorAll("._article").forEach((
|
|
36
|
-
|
|
98
|
+
t.querySelectorAll("._article").forEach((s) => {
|
|
99
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), o(this, q, mt).call(this, s);
|
|
37
100
|
});
|
|
38
101
|
});
|
|
39
102
|
}
|
|
40
103
|
}
|
|
41
|
-
|
|
42
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS:
|
|
43
|
-
this.elements =
|
|
44
|
-
},
|
|
104
|
+
B = new WeakSet(), At = function() {
|
|
105
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Kt;
|
|
106
|
+
this.elements = Lt(e), this.options = Object.assign({}, s, t), o(this, X, St).call(this);
|
|
107
|
+
}, X = new WeakSet(), St = function() {
|
|
45
108
|
const { elements: e } = this;
|
|
46
109
|
e.forEach((t) => {
|
|
47
|
-
t.querySelectorAll("._article").forEach((
|
|
48
|
-
var
|
|
49
|
-
|
|
110
|
+
t.querySelectorAll("._article").forEach((s) => {
|
|
111
|
+
var a, n;
|
|
112
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, pt).call(this, s), o(n = o(a = o(this, R, xt).call(this, s), q, mt).call(a, s), G, kt).call(n, s);
|
|
50
113
|
});
|
|
51
114
|
});
|
|
52
|
-
},
|
|
115
|
+
}, W = new WeakSet(), pt = function(e) {
|
|
53
116
|
return {
|
|
54
117
|
// 元件本身
|
|
55
118
|
$selector: e,
|
|
@@ -81,259 +144,462 @@ N = new WeakSet(), bt = function() {
|
|
|
81
144
|
buttonTextColor: e.getAttribute("button-textcolor"),
|
|
82
145
|
descriptionColor: e.getAttribute("description-color")
|
|
83
146
|
};
|
|
84
|
-
},
|
|
147
|
+
}, R = new WeakSet(), xt = function(e) {
|
|
85
148
|
const { params: t } = e.article;
|
|
86
|
-
return
|
|
87
|
-
},
|
|
149
|
+
return g(t.$h, "color", t.hColor), g(t.$subH, "color", t.subHColor), g(t.$p, "color", t.pColor), g(t.$description, "color", t.descriptionColor), g(t.$button, "backgroundColor", t.buttonColor), g(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), g(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), g(t.$backgroundWrap, "backgroundColor", t.typeFullColor), g(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
|
|
150
|
+
}, q = new WeakSet(), mt = function(e) {
|
|
88
151
|
const { params: t } = e.article;
|
|
89
|
-
return t.$video.length && new
|
|
90
|
-
},
|
|
91
|
-
const { basic_rwd: t } = this.options, { params:
|
|
92
|
-
if (!
|
|
152
|
+
return t.$video.length && new Ut(t.$video), this;
|
|
153
|
+
}, G = new WeakSet(), kt = function(e) {
|
|
154
|
+
const { basic_rwd: t } = this.options, { params: s } = e.article;
|
|
155
|
+
if (!s.$swiper)
|
|
93
156
|
return;
|
|
94
|
-
const
|
|
157
|
+
const a = Vt(), n = this;
|
|
95
158
|
let r = {
|
|
96
159
|
on: {
|
|
97
|
-
init(
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
(
|
|
102
|
-
}),
|
|
160
|
+
init(c) {
|
|
161
|
+
const h = c.$el[0];
|
|
162
|
+
s.$video.length && ([...h.querySelectorAll("[video4-active]")].forEach((f) => {
|
|
163
|
+
var b, m;
|
|
164
|
+
(b = f.querySelector(Yt.SETTINGS.videoButton)) == null || b.remove(), (m = f.querySelector(".overlay")) == null || m.remove(), f.removeAttribute("video4-active");
|
|
165
|
+
}), n.update());
|
|
103
166
|
},
|
|
104
|
-
observerUpdate(
|
|
105
|
-
|
|
167
|
+
observerUpdate(c) {
|
|
168
|
+
c.params.autoplay.enabled && (c.autoplay.start(), c.update());
|
|
106
169
|
}
|
|
107
170
|
},
|
|
108
171
|
observer: !0,
|
|
109
172
|
breakpoints: {}
|
|
110
173
|
};
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
nextEl: `.swiper-button-next.swiper-${
|
|
117
|
-
prevEl: `.swiper-button-prev.swiper-${
|
|
174
|
+
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${a}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
|
175
|
+
const c = document.createElement("div");
|
|
176
|
+
c.className = `swiper-button-next swiper-${a}`, s.$swiperButtonCover.appendChild(c);
|
|
177
|
+
const h = document.createElement("div");
|
|
178
|
+
h.className = `swiper-button-prev swiper-${a}`, s.$swiperButtonCover.appendChild(h), r.navigation = {
|
|
179
|
+
nextEl: `.swiper-button-next.swiper-${a}`,
|
|
180
|
+
prevEl: `.swiper-button-prev.swiper-${a}`
|
|
118
181
|
};
|
|
119
182
|
}
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
el: `.swiper-pagination.swiper-${
|
|
183
|
+
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
|
184
|
+
const c = document.createElement("div");
|
|
185
|
+
c.className = `swiper-pagination swiper-${a}`, s.$swiper.appendChild(c), r.pagination = {
|
|
186
|
+
el: `.swiper-pagination.swiper-${a}`,
|
|
124
187
|
clickable: !0
|
|
125
188
|
};
|
|
126
189
|
}
|
|
127
|
-
Number.parseInt(
|
|
128
|
-
slidesPerView:
|
|
129
|
-
}), (
|
|
190
|
+
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (r.breakpoints[t] = {
|
|
191
|
+
slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
|
|
192
|
+
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (r.autoplay = {
|
|
130
193
|
delay: 3e3,
|
|
131
194
|
disableOnInteraction: !1
|
|
132
|
-
}), (
|
|
133
|
-
let
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
return e.article.swiperList = [], e.article.swiperList.push(
|
|
195
|
+
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (r.loop = !0), s.$selector.getAttribute("swiper-speed") && (r.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (r.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (r.pagination.dynamicBullets = !0);
|
|
196
|
+
let l = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
|
197
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (r.navigation = !1, r.pagination = !1, r.autoplay = !1, r.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
|
198
|
+
const p = new Jt(s.$swiper, r);
|
|
199
|
+
return e.article.swiperList = [], e.article.swiperList.push(p), this;
|
|
137
200
|
};
|
|
138
|
-
|
|
139
|
-
|
|
201
|
+
let gt = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", vt = "ontouchend" in document.documentElement ? "touchend" : "mouseup", ct = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
|
202
|
+
function L(i) {
|
|
203
|
+
const e = window.getComputedStyle(i), t = e.transform || e.mozTransform;
|
|
204
|
+
if (t === "none")
|
|
205
|
+
return {
|
|
206
|
+
x: 0,
|
|
207
|
+
y: 0,
|
|
208
|
+
z: 0
|
|
209
|
+
};
|
|
210
|
+
const s = t.includes("3d") ? "3d" : "2d", a = t.match(/matrix.*\((.+)\)/)[1].split(", ");
|
|
211
|
+
if (s === "2d")
|
|
212
|
+
return {
|
|
213
|
+
x: Number(a[4]),
|
|
214
|
+
y: Number(a[5]),
|
|
215
|
+
z: 0
|
|
216
|
+
};
|
|
217
|
+
if (s === "3d")
|
|
218
|
+
return {
|
|
219
|
+
x: Number(a[12]),
|
|
220
|
+
y: Number(a[13]),
|
|
221
|
+
z: Number(a[14])
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function H(i) {
|
|
225
|
+
const t = i.querySelector(".wrapper").querySelectorAll(".item");
|
|
226
|
+
let s = 0;
|
|
227
|
+
return t.forEach((a) => {
|
|
228
|
+
const n = getComputedStyle(a), r = parseInt(n.marginLeft), l = parseInt(n.marginRight);
|
|
229
|
+
s += a.getBoundingClientRect().width + r + l;
|
|
230
|
+
}), s;
|
|
231
|
+
}
|
|
232
|
+
function dt(i) {
|
|
233
|
+
if (L(i.slideWrapEl).x >= i.translateMin)
|
|
234
|
+
return "is-start";
|
|
235
|
+
if (L(i.slideWrapEl).x <= i.translateMax)
|
|
236
|
+
return "is-end";
|
|
237
|
+
if (L(i.slideWrapEl).x < i.translateMin && L(i.slideWrapEl).x > i.translateMax)
|
|
238
|
+
return "is-middle";
|
|
239
|
+
}
|
|
240
|
+
function ie(i) {
|
|
241
|
+
const e = i.el, t = e.querySelector(".wrapper");
|
|
242
|
+
t.addEventListener(gt, function(s) {
|
|
243
|
+
switch (i.isDown = !0, i.slidable && t.classList.add("dragging"), gt) {
|
|
244
|
+
case "mousedown":
|
|
245
|
+
i.startX = s.pageX;
|
|
246
|
+
break;
|
|
247
|
+
case "touchstart":
|
|
248
|
+
i.startX = s.changedTouches[0].pageX;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
i.nowTranslateX = L(t).x;
|
|
252
|
+
}), t.addEventListener(vt, function(s) {
|
|
253
|
+
i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
|
254
|
+
let a;
|
|
255
|
+
switch (ct) {
|
|
256
|
+
case "mousemove":
|
|
257
|
+
a = s.pageX - i.startX;
|
|
258
|
+
break;
|
|
259
|
+
case "touchmove":
|
|
260
|
+
a = s.changedTouches[0].pageX - i.startX;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
if (a === 0 && s.target.closest(".item")) {
|
|
264
|
+
if (vt === "mouseup" && s.button !== 0)
|
|
265
|
+
return;
|
|
266
|
+
t.querySelectorAll(".item").forEach((r) => {
|
|
267
|
+
r.classList.remove("active");
|
|
268
|
+
}), s.target.closest(".item").classList.add("active"), i.moveActive(i.params.speed);
|
|
269
|
+
} else
|
|
270
|
+
i.slidable && i.resetPos(e);
|
|
271
|
+
}), t.addEventListener("mouseleave", function() {
|
|
272
|
+
i.isDown && i.slidable && (i.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), i.resetPos(e));
|
|
273
|
+
}), t.addEventListener(ct, function(s) {
|
|
274
|
+
if (i.draggable && i.slidable) {
|
|
275
|
+
if (!i.isDown)
|
|
276
|
+
return;
|
|
277
|
+
s.preventDefault();
|
|
278
|
+
let a;
|
|
279
|
+
switch (ct) {
|
|
280
|
+
case "mousemove":
|
|
281
|
+
a = s.pageX - i.startX;
|
|
282
|
+
break;
|
|
283
|
+
case "touchmove":
|
|
284
|
+
a = s.changedTouches[0].pageX - i.startX;
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
if (a !== 0) {
|
|
288
|
+
t.classList.add("moving");
|
|
289
|
+
const n = {
|
|
290
|
+
transition: "all 0ms ease 0s",
|
|
291
|
+
transform: `translate3d(${i.nowTranslateX + a}px,0,0)`
|
|
292
|
+
};
|
|
293
|
+
Object.assign(t.style, n);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function ae(i) {
|
|
299
|
+
const e = i.querySelectorAll("a");
|
|
300
|
+
for (var t = 0, s = e.length; t < s; t++)
|
|
301
|
+
e[t].draggable = !1;
|
|
302
|
+
}
|
|
303
|
+
class me {
|
|
304
|
+
constructor(e, t) {
|
|
305
|
+
this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
|
|
306
|
+
speed: 300,
|
|
307
|
+
clickSwitch: !0,
|
|
308
|
+
breakpoint: !1
|
|
309
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth = H(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
|
310
|
+
Math.abs(
|
|
311
|
+
H(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
|
312
|
+
)
|
|
313
|
+
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
|
314
|
+
}
|
|
315
|
+
init() {
|
|
316
|
+
const e = this;
|
|
317
|
+
e.slidable && (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()), window.addEventListener("resize", function() {
|
|
318
|
+
e.update();
|
|
319
|
+
}), ie(e), ae(e.el);
|
|
320
|
+
}
|
|
321
|
+
moveActive(e) {
|
|
322
|
+
const t = this, s = t.slideWrapEl.querySelector(".item.active"), n = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
|
323
|
+
if (t.slidable) {
|
|
324
|
+
if (-n < 0 && -n > t.translateMax) {
|
|
325
|
+
const r = {
|
|
326
|
+
transition: `all ${e || 0}ms ease 0s`,
|
|
327
|
+
transform: `translate3d(-${n}px,0,0)`
|
|
328
|
+
};
|
|
329
|
+
Object.assign(t.slideWrapEl.style, r);
|
|
330
|
+
} else if (-n >= 0) {
|
|
331
|
+
const r = {
|
|
332
|
+
transition: `all ${e || 0}ms ease 0s`,
|
|
333
|
+
transform: "translate3d(0,0,0)"
|
|
334
|
+
};
|
|
335
|
+
Object.assign(t.slideWrapEl.style, r);
|
|
336
|
+
} else {
|
|
337
|
+
const r = {
|
|
338
|
+
transition: `all ${e || 0}ms ease 0s`,
|
|
339
|
+
transform: `translate3d(${t.translateMax}px,0,0)`
|
|
340
|
+
};
|
|
341
|
+
Object.assign(t.slideWrapEl.style, r);
|
|
342
|
+
}
|
|
343
|
+
if (e)
|
|
344
|
+
t.slideWrapEl.addEventListener(
|
|
345
|
+
"transitionend",
|
|
346
|
+
function() {
|
|
347
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
|
|
348
|
+
case "is-start":
|
|
349
|
+
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
350
|
+
break;
|
|
351
|
+
case "is-middle":
|
|
352
|
+
t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
|
|
353
|
+
break;
|
|
354
|
+
case "is-end":
|
|
355
|
+
t.el.classList.remove("is-start"), t.el.classList.add("is-end");
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
!1
|
|
360
|
+
);
|
|
361
|
+
else
|
|
362
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, dt(t)) {
|
|
363
|
+
case "is-start":
|
|
364
|
+
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
|
365
|
+
break;
|
|
366
|
+
case "is-middle":
|
|
367
|
+
t.el.classList.remove("is-start"), t.el.classList.remove("is-end");
|
|
368
|
+
break;
|
|
369
|
+
case "is-end":
|
|
370
|
+
t.el.classList.remove("is-start"), t.el.classList.add("is-end");
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
resetPos() {
|
|
376
|
+
const e = this;
|
|
377
|
+
switch (dt(e)) {
|
|
378
|
+
case "is-start":
|
|
379
|
+
e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
|
|
380
|
+
transition: `all ${e.params.speed}ms ease 0s`,
|
|
381
|
+
transform: "translate3d(0,0,0)"
|
|
382
|
+
});
|
|
383
|
+
break;
|
|
384
|
+
case "is-middle":
|
|
385
|
+
e.el.classList.remove("is-start"), e.el.classList.remove("is-end");
|
|
386
|
+
break;
|
|
387
|
+
case "is-end":
|
|
388
|
+
e.el.classList.remove("is-start"), e.el.classList.add("is-end"), Object.assign(e.slideWrapEl.style, {
|
|
389
|
+
transition: `all ${e.params.speed}ms ease 0s`,
|
|
390
|
+
transform: `translate3d(${e.translateMax}px,0,0)`
|
|
391
|
+
});
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
update() {
|
|
396
|
+
const e = this;
|
|
397
|
+
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = H(e.el), e.translateMax = -Math.floor(
|
|
398
|
+
Math.abs(
|
|
399
|
+
H(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
|
|
400
|
+
)
|
|
401
|
+
), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
const wt = (i) => {
|
|
405
|
+
if (i == "facebook")
|
|
140
406
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
|
141
|
-
if (
|
|
407
|
+
if (i == "line")
|
|
142
408
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "http://line.naver.jp/R/msg/text/?" : "https://lineit.line.me/share/ui?url=";
|
|
143
|
-
if (
|
|
409
|
+
if (i == "twitter")
|
|
144
410
|
return "https://twitter.com/intent/tweet?url=";
|
|
145
|
-
if (
|
|
411
|
+
if (i == "linkedin")
|
|
146
412
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
|
147
|
-
if (
|
|
413
|
+
if (i == "telegram")
|
|
148
414
|
return "https://telegram.me/share/url?url=";
|
|
149
415
|
};
|
|
150
|
-
var
|
|
151
|
-
class
|
|
416
|
+
var P, Tt, z, Wt, F, qt;
|
|
417
|
+
class he {
|
|
152
418
|
constructor(e, t = {}) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
419
|
+
d(this, P);
|
|
420
|
+
d(this, z);
|
|
421
|
+
d(this, F);
|
|
156
422
|
this.__storage__ = {
|
|
157
423
|
el: e,
|
|
158
424
|
options: t
|
|
159
|
-
}, o(this,
|
|
425
|
+
}, o(this, P, Tt).call(this);
|
|
160
426
|
}
|
|
161
427
|
}
|
|
162
|
-
|
|
163
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS:
|
|
164
|
-
|
|
165
|
-
},
|
|
428
|
+
P = new WeakSet(), Tt = function() {
|
|
429
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Qt;
|
|
430
|
+
!$t(e) || !ut(e) || (this.elements = Lt(e), this.options = Object.assign({}, s, t), o(this, z, Wt).call(this));
|
|
431
|
+
}, z = new WeakSet(), Wt = function() {
|
|
166
432
|
const { elements: e, options: t } = this;
|
|
167
|
-
e.forEach((
|
|
168
|
-
|
|
169
|
-
|
|
433
|
+
e.forEach((s) => {
|
|
434
|
+
s.querySelectorAll("[share-target]").forEach((a) => {
|
|
435
|
+
a.share = {}, a.share.instance = this, a.share.params = t, a.share.eventHandler = o(this, F, qt), a.addEventListener("click", a.share.eventHandler);
|
|
170
436
|
});
|
|
171
437
|
});
|
|
172
|
-
},
|
|
173
|
-
const { eventHandler: e, params: t } = this.share,
|
|
438
|
+
}, F = new WeakSet(), qt = function() {
|
|
439
|
+
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), a = {
|
|
174
440
|
source: this.getAttribute("utm-source"),
|
|
175
441
|
medium: this.getAttribute("utm-medium"),
|
|
176
442
|
campaign: this.getAttribute("utm-campaign")
|
|
177
|
-
},
|
|
443
|
+
}, n = {
|
|
178
444
|
success: this.getAttribute("copy-success") || t.success,
|
|
179
445
|
text: this.getAttribute("copy-text") || t.text,
|
|
180
446
|
className: this.getAttribute("copy-class") || t.className,
|
|
181
447
|
duration: this.getAttribute("copy-duration") || t.duration
|
|
182
448
|
}, r = encodeURIComponent(document.URL);
|
|
183
|
-
let
|
|
184
|
-
if (
|
|
449
|
+
let l = r;
|
|
450
|
+
if (s == "wechat") {
|
|
185
451
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${r}&size=250x250`, "share to wechat", "width=300,height=300");
|
|
186
452
|
return;
|
|
187
453
|
}
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
454
|
+
if (s == "url") {
|
|
455
|
+
if (ut(".copied-wrapper"))
|
|
190
456
|
return;
|
|
191
|
-
document.querySelector("body").insertAdjacentHTML(
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
457
|
+
document.querySelector("body").insertAdjacentHTML(A.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
|
458
|
+
const p = document.querySelector(".copied-wrapper");
|
|
459
|
+
n.className && p.classList.add(n.className), p.style.top = this.getBoundingClientRect().top + window.scrollY + "px", p.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", p.style.display = "block";
|
|
460
|
+
const c = document.querySelector("#clipboard");
|
|
461
|
+
if (c.value = n.text ?? window.location.href, c.setSelectionRange(0, 9999), c.select(), document.execCommand("copy")) {
|
|
196
462
|
document.execCommand("copy");
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
463
|
+
const h = document.querySelector(".copied-wrapper"), u = document.querySelector(".copied-wrapper .text");
|
|
464
|
+
u.style.display = "block", u.style.opacity = 0;
|
|
465
|
+
const f = (m, ot) => {
|
|
466
|
+
let S = 0;
|
|
467
|
+
const x = 50, O = x / ot, lt = setInterval(function() {
|
|
468
|
+
S += O, m.style.opacity = S, S >= 1 && (clearInterval(lt), setTimeout(function() {
|
|
469
|
+
b(m, 300, function() {
|
|
470
|
+
h.remove();
|
|
205
471
|
});
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
let
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
},
|
|
472
|
+
}, n.duration));
|
|
473
|
+
}, x);
|
|
474
|
+
}, b = (m, ot, S) => {
|
|
475
|
+
let x = 1;
|
|
476
|
+
const O = 50, lt = O / ot, zt = setInterval(() => {
|
|
477
|
+
x -= lt, m.style.opacity = x, x <= 0 && (clearInterval(zt), m.style.display = "none", S && S());
|
|
478
|
+
}, O);
|
|
213
479
|
};
|
|
214
|
-
|
|
480
|
+
f(u, 300);
|
|
215
481
|
}
|
|
216
482
|
return;
|
|
217
483
|
}
|
|
218
|
-
|
|
484
|
+
l = `${l}${a.source ? `?utm_source=${a.source}` : ""}${a.medium ? `&utm_medium${a.medium}` : ""}${a.campaign ? `&utm_campaign${a.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${wt(s)}${r}`) : window.open(`${wt(s)}${l}"e=${l}`), this.removeEventListener("click", e), setTimeout(() => {
|
|
219
485
|
this.addEventListener("click", e);
|
|
220
486
|
}, 100);
|
|
221
487
|
};
|
|
222
|
-
function
|
|
488
|
+
function D(i) {
|
|
223
489
|
const e = {};
|
|
224
|
-
return [...
|
|
490
|
+
return [...i.attributes].forEach((t) => {
|
|
225
491
|
if (t.name.includes("duration-")) {
|
|
226
|
-
const
|
|
227
|
-
e[
|
|
492
|
+
const s = t.name.replace("duration-", ""), a = t.nodeValue;
|
|
493
|
+
e[s] = Number(a);
|
|
228
494
|
}
|
|
229
495
|
}), Object.keys(e).length === 0 ? null : e;
|
|
230
496
|
}
|
|
231
|
-
function
|
|
232
|
-
if (
|
|
497
|
+
function yt(i) {
|
|
498
|
+
if (D(i)) {
|
|
233
499
|
let e;
|
|
234
|
-
const t = Object.keys(
|
|
235
|
-
value:
|
|
236
|
-
point:
|
|
500
|
+
const t = Object.keys(D(i)).map((s) => ({
|
|
501
|
+
value: s,
|
|
502
|
+
point: s
|
|
237
503
|
}));
|
|
238
|
-
t.sort((
|
|
239
|
-
for (let
|
|
240
|
-
const { point:
|
|
241
|
-
window.matchMedia(`(max-width: ${
|
|
504
|
+
t.sort((s, a) => parseInt(a.value, 10) - parseInt(s.value, 10));
|
|
505
|
+
for (let s = 0; s < t.length; s += 1) {
|
|
506
|
+
const { point: a, value: n } = t[s];
|
|
507
|
+
window.matchMedia(`(max-width: ${n}px)`).matches && (e = a);
|
|
242
508
|
}
|
|
243
|
-
return e ? Number(
|
|
509
|
+
return e ? Number(D(i)[e]) : i.s.options.duration;
|
|
244
510
|
} else
|
|
245
|
-
return
|
|
511
|
+
return i.s.options.duration;
|
|
246
512
|
}
|
|
247
|
-
function
|
|
248
|
-
const { behavior: e, continual: t, gap:
|
|
249
|
-
|
|
250
|
-
r.append(
|
|
513
|
+
function re(i) {
|
|
514
|
+
const { behavior: e, continual: t, gap: s } = i.s.options, a = i.childNodes, n = document.createElement("div"), r = document.createElement("div");
|
|
515
|
+
n.className = "animate-container", r.className = "animate-item", [...a].forEach((p) => {
|
|
516
|
+
r.append(p);
|
|
251
517
|
});
|
|
252
|
-
function
|
|
253
|
-
const
|
|
254
|
-
return
|
|
518
|
+
function l() {
|
|
519
|
+
const p = r.cloneNode(!0);
|
|
520
|
+
return p.classList.add("clone"), i.s.cloneAnimation = null, i.s.cloneAnimateEl = p, p;
|
|
255
521
|
}
|
|
256
|
-
|
|
522
|
+
i.s.animation = null, i.s.animateEl = r, i.textContent = "", n.append(r), i.append(n), r.clientWidth * 2 + s >= i.clientWidth ? e === "normal" && t && n.append(l()) : i.s.options.continual = !1;
|
|
257
523
|
}
|
|
258
|
-
function
|
|
259
|
-
const { behavior: e, direction: t, continual:
|
|
260
|
-
let
|
|
524
|
+
function v(i) {
|
|
525
|
+
const { behavior: e, direction: t, continual: s } = i.s.options;
|
|
526
|
+
let a = {};
|
|
261
527
|
switch (e) {
|
|
262
528
|
case "normal":
|
|
263
|
-
let
|
|
529
|
+
let n, r;
|
|
264
530
|
switch (t) {
|
|
265
531
|
case "top":
|
|
266
|
-
|
|
532
|
+
n = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, r = "translate3d(0,-100%,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
|
|
267
533
|
break;
|
|
268
534
|
case "right":
|
|
269
|
-
|
|
535
|
+
n = s ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", r = s ? "translate3d(200%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
|
|
270
536
|
break;
|
|
271
537
|
case "bottom":
|
|
272
|
-
|
|
538
|
+
n = "translate3d(0,-100%,0)", r = s ? "translate3d(0,100%,0)" : `translate3d(0,${i.clientHeight}px,0)`, a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
|
|
273
539
|
break;
|
|
274
540
|
case "left":
|
|
275
|
-
|
|
541
|
+
n = s ? "translate3d(100%,0,0)" : `translate3d(${i.clientWidth}px,0,0)`, r = "translate3d(-100%,0,0)", a.animate1 = [{ transform: n }, { transform: r }], s && (a.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
|
|
276
542
|
break;
|
|
277
543
|
}
|
|
278
544
|
break;
|
|
279
545
|
case "alternate":
|
|
280
546
|
switch (t) {
|
|
281
547
|
case "top":
|
|
282
|
-
|
|
548
|
+
a.animate1 = [{ transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
|
|
283
549
|
break;
|
|
284
550
|
case "right":
|
|
285
|
-
|
|
551
|
+
a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
|
|
286
552
|
break;
|
|
287
553
|
case "bottom":
|
|
288
|
-
|
|
554
|
+
a.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
|
|
289
555
|
break;
|
|
290
556
|
case "left":
|
|
291
|
-
|
|
557
|
+
a.animate1 = [{ transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${i.clientWidth}px),0,0)` }];
|
|
292
558
|
break;
|
|
293
559
|
}
|
|
294
560
|
break;
|
|
295
561
|
case "endStop":
|
|
296
562
|
switch (t) {
|
|
297
563
|
case "top":
|
|
298
|
-
|
|
564
|
+
a.animate1 = [{ transform: `translate3d(0,${i.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
|
|
299
565
|
break;
|
|
300
566
|
case "right":
|
|
301
|
-
|
|
567
|
+
a.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
302
568
|
break;
|
|
303
569
|
case "bottom":
|
|
304
|
-
|
|
570
|
+
a.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${i.clientHeight}px - 100%),0)` }];
|
|
305
571
|
break;
|
|
306
572
|
case "left":
|
|
307
|
-
|
|
573
|
+
a.animate1 = [{ transform: `translate3d(${i.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${i.clientWidth}px - 100%),0,0)` }];
|
|
308
574
|
break;
|
|
309
575
|
}
|
|
310
576
|
break;
|
|
311
577
|
}
|
|
312
|
-
return
|
|
578
|
+
return a;
|
|
313
579
|
}
|
|
314
|
-
function
|
|
580
|
+
function ne(i) {
|
|
315
581
|
let e;
|
|
316
582
|
return function(t) {
|
|
317
|
-
e && clearTimeout(e), e = setTimeout(
|
|
583
|
+
e && clearTimeout(e), e = setTimeout(i, 200, t);
|
|
318
584
|
};
|
|
319
585
|
}
|
|
320
|
-
var
|
|
321
|
-
class
|
|
586
|
+
var U, Ct, V, Mt, J, It, K, Ot;
|
|
587
|
+
class fe extends HTMLElement {
|
|
322
588
|
constructor() {
|
|
323
589
|
super();
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
590
|
+
d(this, U);
|
|
591
|
+
d(this, V);
|
|
592
|
+
d(this, J);
|
|
593
|
+
d(this, K);
|
|
328
594
|
this.initialize = !1;
|
|
329
595
|
}
|
|
330
596
|
static get observedAttributes() {
|
|
331
597
|
return [];
|
|
332
598
|
}
|
|
333
|
-
attributeChangedCallback(t,
|
|
599
|
+
attributeChangedCallback(t, s, a) {
|
|
334
600
|
}
|
|
335
601
|
connectedCallback() {
|
|
336
|
-
this.initialize || (this.initialize = !0, o(this,
|
|
602
|
+
this.initialize || (this.initialize = !0, o(this, U, Ct).call(this));
|
|
337
603
|
}
|
|
338
604
|
play() {
|
|
339
605
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -342,76 +608,76 @@ class Kt extends HTMLElement {
|
|
|
342
608
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
343
609
|
}
|
|
344
610
|
}
|
|
345
|
-
|
|
611
|
+
U = new WeakSet(), Ct = function() {
|
|
346
612
|
const t = {
|
|
347
|
-
direction: this.getAttribute("direction") ||
|
|
613
|
+
direction: this.getAttribute("direction") || y.SETTINGS.direction,
|
|
348
614
|
// up / down / left / right
|
|
349
|
-
behavior: this.getAttribute("behavior") ||
|
|
615
|
+
behavior: this.getAttribute("behavior") || y.SETTINGS.behavior,
|
|
350
616
|
// normal / alternate / endStop
|
|
351
|
-
duration: Number(this.getAttribute("duration")) ||
|
|
617
|
+
duration: Number(this.getAttribute("duration")) || y.SETTINGS.duration,
|
|
352
618
|
// ms
|
|
353
|
-
durationBreakpoints:
|
|
354
|
-
autoplay: this.getAttribute("autoplay") ||
|
|
619
|
+
durationBreakpoints: D(this) || y.SETTINGS.durationBreakpoints,
|
|
620
|
+
autoplay: this.getAttribute("autoplay") || y.SETTINGS.autoplay,
|
|
355
621
|
// normal / alternate / endStop
|
|
356
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
|
622
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : y.SETTINGS.pauseOnMouseenter,
|
|
357
623
|
// true / false
|
|
358
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
|
624
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : y.SETTINGS.continual,
|
|
359
625
|
// true / false
|
|
360
|
-
gap: Number(this.getAttribute("gap")) ||
|
|
626
|
+
gap: Number(this.getAttribute("gap")) || y.SETTINGS.gap
|
|
361
627
|
};
|
|
362
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
363
|
-
},
|
|
364
|
-
const { direction: t, continual:
|
|
628
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = yt(this), re(this), o(this, V, Mt).call(this);
|
|
629
|
+
}, V = new WeakSet(), Mt = function() {
|
|
630
|
+
const { direction: t, continual: s, gap: a } = this.s.options;
|
|
365
631
|
switch (t) {
|
|
366
632
|
case "left":
|
|
367
633
|
case "right":
|
|
368
|
-
this.style.cssText = `--continual-gap: ${
|
|
634
|
+
this.style.cssText = `--continual-gap: ${a}px;`;
|
|
369
635
|
break;
|
|
370
636
|
case "top":
|
|
371
637
|
case "bottom":
|
|
372
|
-
|
|
638
|
+
s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${a}px;`;
|
|
373
639
|
break;
|
|
374
640
|
}
|
|
375
|
-
o(this,
|
|
376
|
-
},
|
|
377
|
-
const t = this, { direction:
|
|
378
|
-
let
|
|
379
|
-
function
|
|
380
|
-
switch (
|
|
641
|
+
o(this, J, It).call(this), o(this, K, Ot).call(this), s && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
642
|
+
}, J = new WeakSet(), It = function() {
|
|
643
|
+
const t = this, { direction: s, behavior: a, duration: n, autoplay: r, pauseOnMouseenter: l, continual: p } = t.s.options;
|
|
644
|
+
let c;
|
|
645
|
+
function h() {
|
|
646
|
+
switch (a) {
|
|
381
647
|
case "normal":
|
|
382
|
-
t.s.animateEl.style.transform = `${
|
|
648
|
+
t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
|
383
649
|
duration: t.s.nowDuration,
|
|
384
650
|
iterations: 1 / 0
|
|
385
|
-
}),
|
|
651
|
+
}), p && (t.s.cloneAnimateEl.style.transform = `${v(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
|
|
386
652
|
duration: t.s.nowDuration,
|
|
387
653
|
delay: -t.s.nowDuration / 2,
|
|
388
654
|
iterations: 1 / 0
|
|
389
655
|
}));
|
|
390
656
|
break;
|
|
391
657
|
case "alternate":
|
|
392
|
-
let
|
|
658
|
+
let b = function() {
|
|
393
659
|
let m = [];
|
|
394
|
-
switch (
|
|
660
|
+
switch (s) {
|
|
395
661
|
case "top":
|
|
396
|
-
|
|
662
|
+
u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
|
397
663
|
break;
|
|
398
664
|
case "right":
|
|
399
|
-
|
|
665
|
+
u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(t.s.nowDuration / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
400
666
|
break;
|
|
401
667
|
case "bottom":
|
|
402
|
-
|
|
668
|
+
u = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollHeight, m = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
403
669
|
break;
|
|
404
670
|
case "left":
|
|
405
|
-
|
|
671
|
+
u = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(n / (u * 2)) * t.s.animateEl.scrollWidth, m = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
|
406
672
|
break;
|
|
407
673
|
}
|
|
408
674
|
return m;
|
|
409
|
-
},
|
|
410
|
-
(t.clientHeight > t.s.animateEl.scrollHeight ||
|
|
411
|
-
duration:
|
|
675
|
+
}, u, f;
|
|
676
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${b()[0].transform}`, t.s.animateEl.animate(b(), {
|
|
677
|
+
duration: f,
|
|
412
678
|
fill: "forwards"
|
|
413
679
|
}).finished.then(() => {
|
|
414
|
-
t.s.animation = t.s.animateEl.animate(
|
|
680
|
+
t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
|
415
681
|
duration: t.s.nowDuration,
|
|
416
682
|
iterations: 1 / 0
|
|
417
683
|
});
|
|
@@ -420,7 +686,7 @@ F = new WeakSet(), At = function() {
|
|
|
420
686
|
});
|
|
421
687
|
break;
|
|
422
688
|
case "endStop":
|
|
423
|
-
t.s.animateEl.style.transform = `${
|
|
689
|
+
t.s.animateEl.style.transform = `${v(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
|
424
690
|
duration: t.s.nowDuration,
|
|
425
691
|
fill: "forwards"
|
|
426
692
|
});
|
|
@@ -428,94 +694,94 @@ F = new WeakSet(), At = function() {
|
|
|
428
694
|
}
|
|
429
695
|
t.s.animateEl.classList.add("start"), r === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
|
|
430
696
|
}
|
|
431
|
-
clearTimeout(
|
|
697
|
+
clearTimeout(c), c = setTimeout(
|
|
432
698
|
() => {
|
|
433
|
-
|
|
699
|
+
h();
|
|
434
700
|
},
|
|
435
701
|
r || 0
|
|
436
702
|
), t.addEventListener("mouseenter", function() {
|
|
437
|
-
t.s.animation &&
|
|
703
|
+
t.s.animation && l && t.s.animation.playState === "running" && t.pause();
|
|
438
704
|
}), t.addEventListener("mouseleave", function() {
|
|
439
|
-
t.s.animation &&
|
|
705
|
+
t.s.animation && l && t.s.animation.playState === "paused" && t.play();
|
|
440
706
|
});
|
|
441
|
-
},
|
|
707
|
+
}, K = new WeakSet(), Ot = function() {
|
|
442
708
|
const t = this;
|
|
443
|
-
function
|
|
444
|
-
const
|
|
445
|
-
t.s.nowDuration =
|
|
709
|
+
function s() {
|
|
710
|
+
const a = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
711
|
+
t.s.nowDuration = yt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(v(t).animate1, {
|
|
446
712
|
duration: t.s.nowDuration,
|
|
447
713
|
iterations: 1 / 0
|
|
448
|
-
}), t.s.animation.startTime =
|
|
714
|
+
}), t.s.animation.startTime = a, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(v(t).animate2, {
|
|
449
715
|
duration: t.s.nowDuration,
|
|
450
716
|
delay: -t.s.nowDuration / 2,
|
|
451
717
|
iterations: 1 / 0
|
|
452
|
-
}), t.s.cloneAnimation.startTime =
|
|
718
|
+
}), t.s.cloneAnimation.startTime = n);
|
|
453
719
|
}
|
|
454
|
-
window.addEventListener("resize",
|
|
720
|
+
window.addEventListener("resize", ne(s));
|
|
455
721
|
};
|
|
456
|
-
const
|
|
722
|
+
const j = function(i) {
|
|
457
723
|
let e;
|
|
458
724
|
return function(t) {
|
|
459
|
-
e && clearTimeout(e), e = setTimeout(
|
|
725
|
+
e && clearTimeout(e), e = setTimeout(i, 200, t);
|
|
460
726
|
};
|
|
461
|
-
},
|
|
462
|
-
if (
|
|
463
|
-
|
|
727
|
+
}, E = (i, e) => {
|
|
728
|
+
if (bt(i)) {
|
|
729
|
+
i.forEach((t) => {
|
|
464
730
|
t.classList.add(e);
|
|
465
731
|
});
|
|
466
732
|
return;
|
|
467
733
|
}
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
if (
|
|
471
|
-
|
|
734
|
+
i.classList.add(e);
|
|
735
|
+
}, w = (i, e) => {
|
|
736
|
+
if (bt(i)) {
|
|
737
|
+
i.forEach((t) => {
|
|
472
738
|
t.classList.remove(e);
|
|
473
739
|
});
|
|
474
740
|
return;
|
|
475
741
|
}
|
|
476
|
-
|
|
742
|
+
i.classList.remove(e);
|
|
477
743
|
};
|
|
478
|
-
var
|
|
479
|
-
class
|
|
744
|
+
var Y, Ht, Q, Dt, Z, Nt, C, ht, k, N, tt, _t;
|
|
745
|
+
class Et {
|
|
480
746
|
constructor(e) {
|
|
481
747
|
// 初始化
|
|
482
|
-
|
|
748
|
+
d(this, Y);
|
|
483
749
|
// 左右箭頭事件綁定
|
|
484
|
-
|
|
750
|
+
d(this, Q);
|
|
485
751
|
// 左右拖拉事件綁定
|
|
486
|
-
|
|
752
|
+
d(this, Z);
|
|
487
753
|
// 卷軸位置判斷
|
|
488
|
-
|
|
754
|
+
d(this, C);
|
|
489
755
|
// 隱藏按鈕判斷
|
|
490
|
-
|
|
756
|
+
d(this, k);
|
|
491
757
|
// 選項事件綁定
|
|
492
|
-
|
|
493
|
-
this.$element = e, this.option = e.s.option.drag, o(this,
|
|
758
|
+
d(this, tt);
|
|
759
|
+
this.$element = e, this.option = e.s.option.drag, o(this, Y, Ht).call(this);
|
|
494
760
|
}
|
|
495
761
|
// 更新 active 位置
|
|
496
762
|
update(e) {
|
|
497
|
-
const t = e.querySelector(".wrapper"),
|
|
498
|
-
if (
|
|
499
|
-
const
|
|
763
|
+
const t = e.querySelector(".wrapper"), s = t == null ? void 0 : t.querySelector(".active");
|
|
764
|
+
if (s) {
|
|
765
|
+
const a = s.offsetLeft + s.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
|
|
500
766
|
t.scrollTo({
|
|
501
|
-
left:
|
|
767
|
+
left: a,
|
|
502
768
|
behavior: "smooth"
|
|
503
769
|
});
|
|
504
770
|
}
|
|
505
771
|
}
|
|
506
772
|
}
|
|
507
|
-
|
|
508
|
-
var
|
|
773
|
+
Y = new WeakSet(), Ht = function() {
|
|
774
|
+
var s, a, n, r, l, p;
|
|
509
775
|
const e = this;
|
|
510
776
|
if (!e.$element)
|
|
511
777
|
return;
|
|
512
778
|
e.$container = e.$element.querySelector(".drag-container"), e.$wrapper = e.$container.querySelector(".wrapper");
|
|
513
779
|
const t = () => {
|
|
514
|
-
var
|
|
515
|
-
o(
|
|
780
|
+
var c, h;
|
|
781
|
+
o(c = e, C, ht).call(c), o(h = e, k, N).call(h);
|
|
516
782
|
};
|
|
517
|
-
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
|
518
|
-
|
|
783
|
+
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", j(t)), window.addEventListener("resize", j(t)), (e.option.draggable || e.$element.s.type == "collapse") && o(s = e, Z, Nt).call(s), e.option.navigation && e.$element.s.type !== "collapse" && (e.$container.insertAdjacentHTML(
|
|
784
|
+
A.prepend,
|
|
519
785
|
`<div class="navigation">
|
|
520
786
|
<div class="button prev">
|
|
521
787
|
<div></div>
|
|
@@ -524,233 +790,234 @@ V = new WeakSet(), Tt = function() {
|
|
|
524
790
|
<div></div>
|
|
525
791
|
</div>
|
|
526
792
|
</div>`
|
|
527
|
-
), e.$button = (
|
|
528
|
-
},
|
|
529
|
-
const e = this, { $wrapper: t, $button:
|
|
530
|
-
const
|
|
793
|
+
), e.$button = (a = e.$container) == null ? void 0 : a.querySelectorAll(".button"), o(n = e, Q, Dt).call(n)), o(r = e, C, ht).call(r), o(l = e, k, N).call(l), o(p = e, tt, _t).call(p);
|
|
794
|
+
}, Q = new WeakSet(), Dt = function() {
|
|
795
|
+
const e = this, { $wrapper: t, $button: s } = e, a = function() {
|
|
796
|
+
const n = this.classList.contains("next"), r = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
531
797
|
t.scrollTo({
|
|
532
|
-
left:
|
|
798
|
+
left: n ? t.scrollLeft + r : t.scrollLeft - r,
|
|
533
799
|
behavior: "smooth"
|
|
534
800
|
}), setTimeout(() => {
|
|
535
|
-
var
|
|
536
|
-
o(
|
|
801
|
+
var l;
|
|
802
|
+
o(l = e, k, N).call(l);
|
|
537
803
|
}, 100);
|
|
538
804
|
};
|
|
539
|
-
|
|
540
|
-
|
|
805
|
+
s.forEach((n) => {
|
|
806
|
+
n.removeEventListener("click", a), n.addEventListener("click", a);
|
|
541
807
|
});
|
|
542
|
-
},
|
|
808
|
+
}, Z = new WeakSet(), Nt = function() {
|
|
543
809
|
const { $wrapper: e } = this;
|
|
544
|
-
let t = !1,
|
|
545
|
-
const r = function(
|
|
546
|
-
|
|
810
|
+
let t = !1, s = !1, a = 0, n = 0;
|
|
811
|
+
const r = function(u) {
|
|
812
|
+
u.preventDefault(), s = !1, t = !0, a = u.pageX - e.offsetLeft, n = e.scrollLeft;
|
|
547
813
|
};
|
|
548
814
|
e.removeEventListener("mousedown", r), e.addEventListener("mousedown", r);
|
|
549
|
-
const
|
|
550
|
-
|
|
815
|
+
const l = function() {
|
|
816
|
+
s = !1, t = !1;
|
|
551
817
|
};
|
|
552
|
-
e.removeEventListener("mouseleave",
|
|
553
|
-
const
|
|
554
|
-
|
|
818
|
+
e.removeEventListener("mouseleave", l), e.addEventListener("mouseleave", l);
|
|
819
|
+
const p = function(u) {
|
|
820
|
+
u.preventDefault(), t = !1;
|
|
555
821
|
};
|
|
556
|
-
e.removeEventListener("mouseup",
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
822
|
+
e.removeEventListener("mouseup", p), e.addEventListener("mouseup", p);
|
|
823
|
+
const c = function(u) {
|
|
824
|
+
if (u.preventDefault(), s = !0, !t)
|
|
559
825
|
return;
|
|
560
|
-
const
|
|
826
|
+
const b = u.pageX - e.offsetLeft - a;
|
|
561
827
|
e.scrollTo({
|
|
562
|
-
left:
|
|
828
|
+
left: n - b
|
|
563
829
|
});
|
|
564
830
|
};
|
|
565
|
-
e.removeEventListener("mousemove",
|
|
566
|
-
const
|
|
567
|
-
|
|
831
|
+
e.removeEventListener("mousemove", c), e.addEventListener("mousemove", c);
|
|
832
|
+
const h = function(u) {
|
|
833
|
+
s && (u.preventDefault(), u.stopPropagation());
|
|
568
834
|
};
|
|
569
|
-
e.querySelectorAll("a").forEach((
|
|
570
|
-
|
|
835
|
+
e.querySelectorAll("a").forEach((u) => {
|
|
836
|
+
u.removeEventListener("click", h), u.addEventListener("click", h);
|
|
571
837
|
});
|
|
572
|
-
},
|
|
573
|
-
const { $container: e, $wrapper: t } = this,
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
const { $wrapper: e, $button: t, $element:
|
|
838
|
+
}, C = new WeakSet(), ht = function() {
|
|
839
|
+
const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth, a = t.scrollLeft;
|
|
840
|
+
s <= 0 || (E(e, "scrollable"), a == 0 ? (w(e, "scrollable"), E(t, "start"), w(t, "end")) : a >= s ? (w(e, "scrollable"), w(t, "start"), E(t, "end")) : (E(t, "center"), w(t, "start"), w(t, "end")));
|
|
841
|
+
}, k = new WeakSet(), N = function() {
|
|
842
|
+
const { $wrapper: e, $button: t, $element: s } = this;
|
|
577
843
|
if (!t)
|
|
578
844
|
return;
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
|
|
845
|
+
const a = e.scrollWidth - e.clientWidth, n = e.scrollLeft;
|
|
846
|
+
if (a <= 0) {
|
|
847
|
+
E(t, "hide"), E(s, "noScrollable");
|
|
582
848
|
return;
|
|
583
849
|
}
|
|
584
|
-
|
|
850
|
+
n == 0 ? t.forEach((r) => {
|
|
585
851
|
if (r.classList.contains("next")) {
|
|
586
|
-
|
|
852
|
+
w(r, "hide");
|
|
587
853
|
return;
|
|
588
854
|
}
|
|
589
|
-
|
|
590
|
-
}) :
|
|
855
|
+
E(r, "hide");
|
|
856
|
+
}) : n >= a ? t.forEach((r) => {
|
|
591
857
|
if (r.classList.contains("next")) {
|
|
592
|
-
|
|
858
|
+
E(r, "hide");
|
|
593
859
|
return;
|
|
594
860
|
}
|
|
595
|
-
|
|
596
|
-
}) :
|
|
597
|
-
},
|
|
598
|
-
const { $element: e } = this, t = (
|
|
861
|
+
w(r, "hide");
|
|
862
|
+
}) : w(t, "hide");
|
|
863
|
+
}, tt = new WeakSet(), _t = function() {
|
|
864
|
+
const { $element: e } = this, t = (a) => {
|
|
599
865
|
if (this.option.selected) {
|
|
600
|
-
const
|
|
601
|
-
e.setAttribute("m4-status",
|
|
866
|
+
const n = a.getAttribute("data-option").trim();
|
|
867
|
+
e.setAttribute("m4-status", n);
|
|
602
868
|
}
|
|
603
869
|
};
|
|
604
|
-
function
|
|
870
|
+
function s() {
|
|
605
871
|
t(this);
|
|
606
872
|
}
|
|
607
|
-
this.$container.querySelectorAll(".item").forEach((
|
|
608
|
-
|
|
873
|
+
this.$container.querySelectorAll(".item").forEach((a) => {
|
|
874
|
+
a.removeEventListener("click", s), a.addEventListener("click", s);
|
|
609
875
|
});
|
|
610
876
|
};
|
|
611
|
-
var
|
|
612
|
-
class
|
|
877
|
+
var et, jt, st, Bt, it, Xt, at, Rt;
|
|
878
|
+
class oe {
|
|
613
879
|
constructor(e) {
|
|
614
880
|
// 初始化
|
|
615
|
-
|
|
881
|
+
d(this, et);
|
|
616
882
|
// 隱藏按鈕判斷
|
|
617
|
-
|
|
883
|
+
d(this, st);
|
|
618
884
|
// 展開箭頭事件綁定
|
|
619
|
-
|
|
885
|
+
d(this, it);
|
|
620
886
|
// 選項事件綁定
|
|
621
|
-
|
|
622
|
-
this.$element = e, this.option = e.s.option.collapse, o(this,
|
|
887
|
+
d(this, at);
|
|
888
|
+
this.$element = e, this.option = e.s.option.collapse, o(this, et, jt).call(this);
|
|
623
889
|
}
|
|
624
890
|
}
|
|
625
|
-
|
|
626
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this,
|
|
627
|
-
},
|
|
891
|
+
et = new WeakSet(), jt = function() {
|
|
892
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this, st, Bt).call(this) && o(this, it, Xt).call(this), o(this, at, Rt).call(this));
|
|
893
|
+
}, st = new WeakSet(), Bt = function() {
|
|
628
894
|
const e = this.$element.querySelector(".drag-container"), t = e.querySelector(".wrapper");
|
|
629
|
-
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(
|
|
630
|
-
},
|
|
631
|
-
const { $element: e, $button: t } = this,
|
|
895
|
+
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = e.querySelector(".open-collapse"), !0) : !1;
|
|
896
|
+
}, it = new WeakSet(), Xt = function() {
|
|
897
|
+
const { $element: e, $button: t } = this, s = function() {
|
|
632
898
|
e.classList.contains("expand") ? e.classList.remove("expand") : e.classList.add("expand");
|
|
633
899
|
};
|
|
634
|
-
t.removeEventListener("click",
|
|
635
|
-
},
|
|
636
|
-
const { $element: e } = this, t = (
|
|
900
|
+
t.removeEventListener("click", s), t.addEventListener("click", s);
|
|
901
|
+
}, at = new WeakSet(), Rt = function() {
|
|
902
|
+
const { $element: e } = this, t = (a, n) => {
|
|
637
903
|
if (e != null && e.classList.contains("expand") ? e == null || e.classList.remove("expand") : e == null || e.classList.add("expand"), this.option.selected) {
|
|
638
|
-
const r =
|
|
904
|
+
const r = a.getAttribute("data-option").trim();
|
|
639
905
|
e.setAttribute("m4-status", r);
|
|
640
906
|
}
|
|
641
907
|
};
|
|
642
|
-
function
|
|
908
|
+
function s() {
|
|
643
909
|
t(this);
|
|
644
910
|
}
|
|
645
|
-
this.$container.querySelectorAll(".item").forEach((
|
|
646
|
-
|
|
911
|
+
this.$container.querySelectorAll(".item").forEach((a) => {
|
|
912
|
+
a.removeEventListener("click", s), a.addEventListener("click", s);
|
|
647
913
|
});
|
|
648
914
|
};
|
|
649
|
-
const
|
|
650
|
-
const { type: e, option: t, originalDomString:
|
|
651
|
-
return e == "drag" && (
|
|
915
|
+
const le = (i) => {
|
|
916
|
+
const { type: e, option: t, originalDomString: s } = i.s, a = document.createElement("div");
|
|
917
|
+
return e == "drag" && (a.innerHTML = $.TEMPLATE[e]().trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s)), e == "collapse" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.collapse).trim(), a.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, s), a.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, s)), e == "dropdown" && (a.innerHTML = $.TEMPLATE[e](t == null ? void 0 : t.dropdown).trim(), a.querySelector("dropdown-el").insertAdjacentHTML(A.append, s)), a.children;
|
|
652
918
|
};
|
|
653
|
-
var
|
|
654
|
-
class
|
|
919
|
+
var rt, Gt, nt, Pt, M, ft, T, _;
|
|
920
|
+
class be extends HTMLElement {
|
|
655
921
|
constructor() {
|
|
656
922
|
super();
|
|
657
|
-
|
|
658
|
-
|
|
923
|
+
d(this, rt);
|
|
924
|
+
d(this, nt);
|
|
659
925
|
// 斷點設定
|
|
660
|
-
|
|
926
|
+
d(this, M);
|
|
661
927
|
// check type
|
|
662
|
-
|
|
928
|
+
d(this, T);
|
|
663
929
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
664
930
|
}
|
|
665
931
|
static get observedAttributes() {
|
|
666
932
|
return ["m4-type", "m4-status"];
|
|
667
933
|
}
|
|
668
|
-
attributeChangedCallback(t,
|
|
669
|
-
var
|
|
934
|
+
attributeChangedCallback(t, s, a) {
|
|
935
|
+
var n, r, l;
|
|
670
936
|
switch (t) {
|
|
671
937
|
case "m4-type":
|
|
672
|
-
if (
|
|
938
|
+
if (s === null || s === a)
|
|
673
939
|
return;
|
|
674
|
-
this.s.type =
|
|
940
|
+
this.s.type = a, o(this, T, _).call(this);
|
|
675
941
|
break;
|
|
676
942
|
case "m4-status":
|
|
677
|
-
if (
|
|
943
|
+
if (s === a)
|
|
678
944
|
return;
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
945
|
+
const p = this.getAttribute("m4-type");
|
|
946
|
+
if (p !== "drag" && p !== "collapse")
|
|
681
947
|
return;
|
|
682
|
-
this.querySelectorAll(".drag-container .item").forEach((
|
|
683
|
-
|
|
684
|
-
}), (
|
|
685
|
-
|
|
686
|
-
}), (r = this.querySelector(`.collapse-container .item[data-option="${
|
|
948
|
+
this.querySelectorAll(".drag-container .item").forEach((c) => {
|
|
949
|
+
c.classList.remove("active");
|
|
950
|
+
}), (n = this.querySelector(`.drag-container .item[data-option="${a}"]`)) == null || n.classList.add("active"), p === "collapse" && (this.querySelectorAll(".collapse-container .item").forEach((c) => {
|
|
951
|
+
c.classList.remove("active");
|
|
952
|
+
}), (r = this.querySelector(`.collapse-container .item[data-option="${a}"]`)) == null || r.classList.add("active")), (l = this.constructor.drag) == null || l.update(this);
|
|
687
953
|
break;
|
|
688
954
|
}
|
|
689
955
|
}
|
|
690
956
|
connectedCallback() {
|
|
691
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this,
|
|
957
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this, rt, Gt).call(this));
|
|
692
958
|
}
|
|
693
959
|
update() {
|
|
694
|
-
o(this,
|
|
960
|
+
o(this, M, ft).call(this);
|
|
695
961
|
}
|
|
696
962
|
}
|
|
697
|
-
|
|
963
|
+
rt = new WeakSet(), Gt = function() {
|
|
698
964
|
let t = {};
|
|
699
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
965
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? $.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
966
|
+
const s = (a) => {
|
|
967
|
+
if (a.type === "resize") {
|
|
702
968
|
if (window.innerWidth === this.previousWidth)
|
|
703
969
|
return;
|
|
704
970
|
this.previousWidth = window.innerWidth;
|
|
705
971
|
}
|
|
706
972
|
this.update();
|
|
707
973
|
};
|
|
708
|
-
window.removeEventListener("resize",
|
|
709
|
-
},
|
|
710
|
-
this.classList.add("m4-init"), o(this,
|
|
711
|
-
},
|
|
974
|
+
window.removeEventListener("resize", j(s)), window.addEventListener("resize", j(s)), this.s.option = {}, this.s.option.drag = Object.assign({}, $.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, $.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, $.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, $.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), o(this, nt, Pt).call(this);
|
|
975
|
+
}, nt = new WeakSet(), Pt = function() {
|
|
976
|
+
this.classList.add("m4-init"), o(this, M, ft).call(this);
|
|
977
|
+
}, M = new WeakSet(), ft = function() {
|
|
712
978
|
const t = Object.keys(this.s.option.breakpoint);
|
|
713
979
|
if (!t.length) {
|
|
714
|
-
o(this,
|
|
980
|
+
o(this, T, _).call(this);
|
|
715
981
|
return;
|
|
716
982
|
}
|
|
717
|
-
t.map((
|
|
718
|
-
var
|
|
719
|
-
return window.innerWidth >=
|
|
983
|
+
t.map((s) => Number(s)).sort((s, a) => a - s).some((s) => {
|
|
984
|
+
var a, n, r, l;
|
|
985
|
+
return window.innerWidth >= s && (this.s.type = (a = this.s.option.breakpoint[s]) == null ? void 0 : a.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (n = this.s.option.breakpoint[s]) == null ? void 0 : n.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (r = this.s.option.breakpoint[s]) == null ? void 0 : r.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (l = this.s.option.breakpoint[s]) == null ? void 0 : l.dropdown)), o(this, T, _).call(this), window.innerWidth >= s;
|
|
720
986
|
});
|
|
721
|
-
},
|
|
722
|
-
var
|
|
987
|
+
}, T = new WeakSet(), _ = function() {
|
|
988
|
+
var n;
|
|
723
989
|
const { type: t } = this.s;
|
|
724
|
-
this.innerHTML = "", [...
|
|
990
|
+
this.innerHTML = "", [...le(this)].forEach((r) => {
|
|
725
991
|
this.append(r);
|
|
726
992
|
});
|
|
727
|
-
const
|
|
728
|
-
switch (
|
|
993
|
+
const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), a = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
|
994
|
+
switch (s == null || s.classList.add("active"), a == null || a.classList.add("active"), t) {
|
|
729
995
|
case "drag":
|
|
730
|
-
this.constructor.drag = new
|
|
996
|
+
this.constructor.drag = new Et(this);
|
|
731
997
|
break;
|
|
732
998
|
case "collapse":
|
|
733
|
-
this.constructor.drag = new
|
|
999
|
+
this.constructor.drag = new Et(this), this.constructor.collapse = new oe(this);
|
|
734
1000
|
break;
|
|
735
1001
|
}
|
|
736
|
-
(
|
|
1002
|
+
(n = this.constructor.drag) == null || n.update(this);
|
|
737
1003
|
};
|
|
738
1004
|
export {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
1005
|
+
we as Anchor4,
|
|
1006
|
+
ye as Aost4,
|
|
1007
|
+
pe as Article4,
|
|
1008
|
+
me as CategorySlider,
|
|
1009
|
+
Ee as Collapse4,
|
|
1010
|
+
$e as Configs,
|
|
1011
|
+
ue as Detect4,
|
|
1012
|
+
Le as Dropdown4,
|
|
1013
|
+
Ae as ImagePreview,
|
|
1014
|
+
Se as ImageValidate,
|
|
1015
|
+
fe as Marquee4,
|
|
1016
|
+
xe as Modal4,
|
|
1017
|
+
be as Multipurpose4,
|
|
1018
|
+
ke as Ripple4,
|
|
1019
|
+
he as Share4,
|
|
1020
|
+
Te as Tab4,
|
|
1021
|
+
Ut as Video4
|
|
755
1022
|
};
|
|
756
1023
|
//# sourceMappingURL=fesd-bundle.js.map
|