easy-component-ui 3.0.7 → 3.0.9
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/components/ea-carousel.js +146 -116
- package/dist/css/ea-carousel.style.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var B = (r) => {
|
|
3
|
+
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var t = (
|
|
8
|
-
import { B } from "./Base.js";
|
|
9
|
-
import { s as
|
|
10
|
-
import { s as
|
|
11
|
-
class
|
|
5
|
+
var D = (r, o, e) => o in r ? j(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
6
|
+
var T = (r, o, e) => D(r, typeof o != "symbol" ? o + "" : o, e), $ = (r, o, e) => o.has(r) || B("Cannot " + e);
|
|
7
|
+
var t = (r, o, e) => ($(r, o, "read from private field"), e ? e.call(r) : o.get(r)), n = (r, o, e) => o.has(r) ? B("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, e), g = (r, o, e, s) => ($(r, o, "write to private field"), s ? s.call(r, e) : o.set(r, e), e), c = (r, o, e) => ($(r, o, "access private method"), e);
|
|
8
|
+
import { B as N } from "./Base.js";
|
|
9
|
+
import { s as W } from "../css/ea-carousel-item.style.js";
|
|
10
|
+
import { s as X } from "../css/ea-carousel.style.js";
|
|
11
|
+
class Y extends N {
|
|
12
12
|
static get observedAttributes() {
|
|
13
13
|
return [...super.observedAttributes];
|
|
14
14
|
}
|
|
15
15
|
constructor() {
|
|
16
|
-
super(), this.stylesheet =
|
|
16
|
+
super(), this.stylesheet = W, this.$render();
|
|
17
17
|
}
|
|
18
18
|
$render() {
|
|
19
19
|
this.shadowRoot.innerHTML = `
|
|
@@ -26,38 +26,41 @@ class W extends B {
|
|
|
26
26
|
super.connectedCallback();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
window.customElements.get("ea-carousel-item") || window.customElements.define("ea-carousel-item",
|
|
30
|
-
var
|
|
31
|
-
class
|
|
29
|
+
window.customElements.get("ea-carousel-item") || window.customElements.define("ea-carousel-item", Y);
|
|
30
|
+
var m, C, _, S, f, p, u, d, v, i, q, w, l, z, O, U, E, M, L, y, A, x, I, H, P, k, R;
|
|
31
|
+
class F extends N {
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
|
-
n(this,
|
|
35
|
-
/** @type {HTMLElement} */
|
|
36
|
-
n(this, f);
|
|
34
|
+
n(this, l);
|
|
37
35
|
/** @type {HTMLElement} */
|
|
38
36
|
n(this, m);
|
|
39
37
|
/** @type {HTMLElement} */
|
|
38
|
+
n(this, C);
|
|
39
|
+
/** @type {HTMLElement} */
|
|
40
40
|
n(this, _);
|
|
41
41
|
/** @type {HTMLElement} */
|
|
42
|
-
n(this,
|
|
42
|
+
n(this, S);
|
|
43
43
|
/** @type {HTMLElement} */
|
|
44
|
-
n(this,
|
|
44
|
+
n(this, f);
|
|
45
45
|
/** @type {HTMLElement[]} */
|
|
46
46
|
n(this, p, []);
|
|
47
47
|
/** @type {AbortController} */
|
|
48
|
-
n(this,
|
|
49
|
-
n(this,
|
|
48
|
+
n(this, u);
|
|
49
|
+
n(this, d, {
|
|
50
50
|
triggerAbortControllers: new AbortController()
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
/** @type {MutationObserver | null} */
|
|
53
|
+
n(this, v, null);
|
|
54
|
+
n(this, i, {
|
|
53
55
|
prevIndex: 0,
|
|
54
56
|
originLength: 0,
|
|
55
57
|
timer: null,
|
|
56
58
|
pause: !1,
|
|
57
59
|
isMouseEnter: !1,
|
|
58
|
-
isEnd: !1
|
|
60
|
+
isEnd: !1,
|
|
61
|
+
isProcessingSlotChange: !1
|
|
59
62
|
});
|
|
60
|
-
|
|
63
|
+
T(this, "state", this.properties({
|
|
61
64
|
height: {
|
|
62
65
|
type: String,
|
|
63
66
|
default: "100%",
|
|
@@ -75,12 +78,12 @@ class X extends B {
|
|
|
75
78
|
index: {
|
|
76
79
|
type: Number,
|
|
77
80
|
default: 0,
|
|
78
|
-
observer: (e,
|
|
79
|
-
if (t(this,
|
|
80
|
-
e < 0 ? (e = t(this, p).length - 1,
|
|
81
|
+
observer: (e, s) => {
|
|
82
|
+
if (t(this, E).call(this, e), t(this, i).isEnd) return t(this, i).isEnd = !1;
|
|
83
|
+
e < 0 ? (e = t(this, p).length - 1, s = 0, t(this, i).isEnd = !0) : e > t(this, p).length - 1 && (s = t(this, p).length - 1, e = 0, t(this, i).isEnd = !0), t(this, i).prevIndex = s, this.emit("change", {
|
|
81
84
|
detail: {
|
|
82
85
|
current: e,
|
|
83
|
-
prev:
|
|
86
|
+
prev: s
|
|
84
87
|
}
|
|
85
88
|
});
|
|
86
89
|
}
|
|
@@ -90,12 +93,12 @@ class X extends B {
|
|
|
90
93
|
default: "hover",
|
|
91
94
|
/** @param {'click' | 'hover'} newVal */
|
|
92
95
|
observer: (e) => {
|
|
93
|
-
var
|
|
94
|
-
(
|
|
96
|
+
var s;
|
|
97
|
+
(s = t(this, d).triggerAbortControllers) == null || s.abort(), t(this, d).triggerAbortControllers = new AbortController(), t(this, f).addEventListener(
|
|
95
98
|
e === "hover" ? "mouseover" : "click",
|
|
96
|
-
t(this,
|
|
99
|
+
t(this, I),
|
|
97
100
|
{
|
|
98
|
-
signal: t(this,
|
|
101
|
+
signal: t(this, d).triggerAbortControllers.signal
|
|
99
102
|
}
|
|
100
103
|
);
|
|
101
104
|
}
|
|
@@ -117,7 +120,7 @@ class X extends B {
|
|
|
117
120
|
type: Boolean,
|
|
118
121
|
default: !0,
|
|
119
122
|
observer: (e) => {
|
|
120
|
-
e ? c(this,
|
|
123
|
+
e ? c(this, l, y).call(this) : c(this, l, L).call(this);
|
|
121
124
|
}
|
|
122
125
|
},
|
|
123
126
|
loop: {
|
|
@@ -144,89 +147,89 @@ class X extends B {
|
|
|
144
147
|
* 处理 index 溢出的情况
|
|
145
148
|
* @return {number}
|
|
146
149
|
*/
|
|
147
|
-
n(this,
|
|
150
|
+
n(this, q, () => this.index === t(this, p).length ? 0 : this.index === -1 ? t(this, p).length - 1 : this.index);
|
|
148
151
|
/**
|
|
149
152
|
* 渲染 轮播图指示器,为了避免vue组件缓存,所以在初始化和组件挂载时都进行渲染
|
|
150
153
|
*/
|
|
151
154
|
n(this, w, () => {
|
|
152
155
|
const e = Array.from(
|
|
153
|
-
this.querySelectorAll("ea-carousel-item"),
|
|
154
|
-
(
|
|
156
|
+
this.querySelectorAll("ea-carousel-item:not([slot])"),
|
|
157
|
+
(s, a) => `<button class='ea-carousel__indicator' part='indicator' tabindex="1" data-index="${a}"></button>`
|
|
155
158
|
).join("");
|
|
156
|
-
t(this,
|
|
157
|
-
...t(this,
|
|
159
|
+
t(this, f).innerHTML = e, g(this, p, [
|
|
160
|
+
...t(this, f).querySelectorAll(".ea-carousel__indicator")
|
|
158
161
|
]);
|
|
159
162
|
});
|
|
160
163
|
/**
|
|
161
164
|
* 更新轮播图位置
|
|
162
165
|
* @param {number} index
|
|
163
166
|
*/
|
|
164
|
-
n(this,
|
|
165
|
-
const { width:
|
|
167
|
+
n(this, E, (e = 0) => {
|
|
168
|
+
const { width: s, height: a } = t(this, m).getBoundingClientRect(), h = this.direction === "horizontal" ? "X" : "Y", b = this.direction === "horizontal" ? s : a;
|
|
166
169
|
this.style.setProperty(
|
|
167
170
|
"--ea-carousel-transform",
|
|
168
|
-
`translate${
|
|
169
|
-
), t(this,
|
|
171
|
+
`translate${h}(-${(e + 1) * b}px)`
|
|
172
|
+
), t(this, M).call(this);
|
|
170
173
|
});
|
|
171
174
|
/**
|
|
172
175
|
* 更新指示器位置
|
|
173
176
|
*/
|
|
174
|
-
n(this,
|
|
175
|
-
t(this, p).forEach((e,
|
|
176
|
-
e.classList.toggle("is-active",
|
|
177
|
+
n(this, M, () => {
|
|
178
|
+
t(this, p).forEach((e, s) => {
|
|
179
|
+
e.classList.toggle("is-active", s === t(this, q).call(this));
|
|
177
180
|
});
|
|
178
181
|
});
|
|
179
182
|
/**
|
|
180
183
|
* 开启轮播图过渡属性
|
|
181
184
|
*/
|
|
182
|
-
n(this,
|
|
185
|
+
n(this, A, () => {
|
|
183
186
|
this.clientHeight, this.style.removeProperty("--ea-carousel-transition");
|
|
184
187
|
});
|
|
185
188
|
/**
|
|
186
189
|
* 关闭轮播图过渡属性
|
|
187
190
|
*/
|
|
188
|
-
n(this,
|
|
191
|
+
n(this, x, () => {
|
|
189
192
|
this.style.setProperty("--ea-carousel-transition", "none"), this.clientHeight;
|
|
190
193
|
});
|
|
191
194
|
/**
|
|
192
195
|
* 指示器 处理事件,需要按照 `this.trigger` 来确定事件名
|
|
193
196
|
* @param {MouseEvent} e
|
|
194
197
|
*/
|
|
195
|
-
n(this,
|
|
196
|
-
const
|
|
198
|
+
n(this, I, (e) => {
|
|
199
|
+
const s = t(this, f).querySelectorAll(
|
|
197
200
|
".ea-carousel__indicator"
|
|
198
|
-
),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
), a = e.target.closest(".ea-carousel__indicator");
|
|
202
|
+
a && s.forEach((h, b) => {
|
|
203
|
+
h.classList.toggle("is-active", h === a), h === a && (this.index = b);
|
|
201
204
|
});
|
|
202
205
|
});
|
|
203
206
|
/**
|
|
204
207
|
* 轮播图切换结束事件,即能确保轮播图在视觉上连续
|
|
205
208
|
*/
|
|
206
|
-
n(this,
|
|
207
|
-
t(this,
|
|
209
|
+
n(this, H, () => {
|
|
210
|
+
t(this, x).call(this), this.autoplay && !t(this, i).isMouseEnter && c(this, l, L).call(this), this.index = t(this, q).call(this), this.autoplay && !t(this, i).isMouseEnter && c(this, l, y).call(this), t(this, A).call(this), t(this, i).pause = !1;
|
|
208
211
|
});
|
|
209
212
|
/**
|
|
210
213
|
* 箭头显示事件
|
|
211
214
|
*/
|
|
212
|
-
n(this,
|
|
215
|
+
n(this, P, () => {
|
|
213
216
|
const e = () => {
|
|
214
|
-
t(this,
|
|
217
|
+
t(this, i).isMouseEnter = !1, this["pause-on-hover"] && c(this, l, y).call(this), this.updateContainerClasslist();
|
|
215
218
|
};
|
|
216
|
-
t(this,
|
|
217
|
-
signal: t(this,
|
|
219
|
+
t(this, i).isMouseEnter = !0, this["pause-on-hover"] && c(this, l, L).call(this), this.updateContainerClasslist(), t(this, m).addEventListener("mouseleave", e, {
|
|
220
|
+
signal: t(this, u).signal,
|
|
218
221
|
once: !0
|
|
219
222
|
});
|
|
220
223
|
});
|
|
221
224
|
/**
|
|
222
225
|
* 当窗口大小变化时,更新轮播图位置
|
|
223
226
|
*/
|
|
224
|
-
n(this,
|
|
227
|
+
n(this, k, () => {
|
|
225
228
|
let e = null;
|
|
226
229
|
return {
|
|
227
230
|
listener: () => {
|
|
228
231
|
clearTimeout(e), e = null, e = setTimeout(() => {
|
|
229
|
-
t(this,
|
|
232
|
+
t(this, E).call(this, this.index);
|
|
230
233
|
}, 100);
|
|
231
234
|
},
|
|
232
235
|
unsetHandler: () => {
|
|
@@ -237,24 +240,24 @@ class X extends B {
|
|
|
237
240
|
/**
|
|
238
241
|
* 处理 slotchange 事件,当 slot 内容变化时重新渲染
|
|
239
242
|
*/
|
|
240
|
-
n(this,
|
|
241
|
-
t(this,
|
|
242
|
-
t(this,
|
|
243
|
-
});
|
|
243
|
+
n(this, R, () => {
|
|
244
|
+
t(this, i).isProcessingSlotChange || (t(this, i).isProcessingSlotChange = !0, t(this, x).call(this), c(this, l, L).call(this), t(this, i).prevIndex = 0, t(this, i).originLength = 0, t(this, i).pause = !1, t(this, i).isEnd = !1, this.index = 0, t(this, w).call(this), c(this, l, z).call(this), t(this, M).call(this), this.autoplay && c(this, l, y).call(this), queueMicrotask(() => {
|
|
245
|
+
t(this, A).call(this), t(this, i).isProcessingSlotChange = !1;
|
|
246
|
+
}));
|
|
244
247
|
});
|
|
245
248
|
/**
|
|
246
249
|
* 上一张轮播图
|
|
247
250
|
*/
|
|
248
|
-
|
|
249
|
-
t(this,
|
|
251
|
+
T(this, "prev", () => {
|
|
252
|
+
t(this, i).pause || (this.index--, t(this, i).pause = !0);
|
|
250
253
|
});
|
|
251
254
|
/**
|
|
252
255
|
* 下一张轮播图
|
|
253
256
|
*/
|
|
254
|
-
|
|
255
|
-
t(this,
|
|
257
|
+
T(this, "next", () => {
|
|
258
|
+
t(this, i).pause || (this.index++, t(this, i).pause = !0);
|
|
256
259
|
});
|
|
257
|
-
this.stylesheet =
|
|
260
|
+
this.stylesheet = X, this.$render();
|
|
258
261
|
}
|
|
259
262
|
static get observedAttributes() {
|
|
260
263
|
return [
|
|
@@ -285,11 +288,11 @@ class X extends B {
|
|
|
285
288
|
["--" + this.direction]: this.direction
|
|
286
289
|
},
|
|
287
290
|
{
|
|
288
|
-
["arrow-" + this.arrow]: this.arrow === "always" || this.arrow === "never" || t(this,
|
|
291
|
+
["arrow-" + this.arrow]: this.arrow === "always" || this.arrow === "never" || t(this, i).isMouseEnter,
|
|
289
292
|
[this["indicator-position"] + "-indicator"]: this["indicator-position"]
|
|
290
293
|
}
|
|
291
294
|
);
|
|
292
|
-
return t(this,
|
|
295
|
+
return t(this, m).className = e, e;
|
|
293
296
|
}
|
|
294
297
|
$render() {
|
|
295
298
|
this.shadowRoot.innerHTML = `
|
|
@@ -301,84 +304,111 @@ class X extends B {
|
|
|
301
304
|
<ea-icon icon="icon-angle-right" part="arrow-right-icon"></ea-icon>
|
|
302
305
|
</button>
|
|
303
306
|
<ul class="ea-carousel__content" part="content">
|
|
307
|
+
<slot name="clone-last"></slot>
|
|
304
308
|
<slot></slot>
|
|
309
|
+
<slot name="clone-first"></slot>
|
|
305
310
|
</ul>
|
|
306
311
|
<footer class="ea-carousel__indicator-wrap" part="indicator-wrap">
|
|
307
312
|
|
|
308
313
|
</footer>
|
|
309
314
|
</div>
|
|
310
|
-
`,
|
|
315
|
+
`, g(this, m, this.shadowRoot.querySelector(".ea-carousel")), g(this, C, this.shadowRoot.querySelector(".ea-carousel__content")), g(this, f, this.shadowRoot.querySelector(
|
|
311
316
|
".ea-carousel__indicator-wrap"
|
|
312
|
-
)),
|
|
317
|
+
)), g(this, _, this.shadowRoot.querySelector(
|
|
313
318
|
".ea-carousel__arrow.arrow-left"
|
|
314
|
-
)),
|
|
319
|
+
)), g(this, S, this.shadowRoot.querySelector(
|
|
315
320
|
".ea-carousel__arrow.arrow-right"
|
|
316
321
|
)), t(this, w).call(this), this.updateContainerClasslist();
|
|
317
322
|
}
|
|
318
323
|
connectedCallback() {
|
|
319
|
-
var e,
|
|
320
|
-
super.connectedCallback(), (e = t(this,
|
|
321
|
-
for (const
|
|
322
|
-
(
|
|
323
|
-
t(this,
|
|
324
|
+
var e, s;
|
|
325
|
+
super.connectedCallback(), (e = t(this, u)) == null || e.abort(), g(this, u, new AbortController());
|
|
326
|
+
for (const a in t(this, d))
|
|
327
|
+
(s = t(this, d)[a]) == null || s.abort(), t(this, d)[a] = new AbortController();
|
|
328
|
+
t(this, x).call(this), t(this, w).call(this), c(this, l, z).call(this), this.autoplay && c(this, l, y).call(this), t(this, f).addEventListener(
|
|
324
329
|
this.trigger === "hover" ? "mouseover" : "click",
|
|
325
|
-
t(this,
|
|
330
|
+
t(this, I),
|
|
326
331
|
{
|
|
327
|
-
signal: t(this,
|
|
332
|
+
signal: t(this, d).triggerAbortControllers.signal
|
|
328
333
|
}
|
|
329
|
-
), t(this,
|
|
334
|
+
), t(this, C).addEventListener(
|
|
330
335
|
"transitionend",
|
|
331
|
-
t(this,
|
|
332
|
-
{ signal: t(this,
|
|
336
|
+
t(this, H),
|
|
337
|
+
{ signal: t(this, u).signal }
|
|
333
338
|
), this.arrow !== "never" && this.direction !== "vertical" && (t(this, _).addEventListener("click", this.prev, {
|
|
334
|
-
signal: t(this,
|
|
335
|
-
}), t(this,
|
|
336
|
-
signal: t(this,
|
|
337
|
-
})), t(this,
|
|
338
|
-
signal: t(this,
|
|
339
|
-
}), window.addEventListener("resize", t(this,
|
|
340
|
-
signal: t(this,
|
|
341
|
-
}), t(this,
|
|
342
|
-
signal: t(this,
|
|
339
|
+
signal: t(this, u).signal
|
|
340
|
+
}), t(this, S).addEventListener("click", this.next, {
|
|
341
|
+
signal: t(this, u).signal
|
|
342
|
+
})), t(this, m).addEventListener("mouseenter", t(this, P), {
|
|
343
|
+
signal: t(this, u).signal
|
|
344
|
+
}), window.addEventListener("resize", t(this, k).call(this).listener, {
|
|
345
|
+
signal: t(this, u).signal
|
|
346
|
+
}), t(this, C).querySelector("slot:not([name])").addEventListener("slotchange", t(this, R), {
|
|
347
|
+
signal: t(this, u).signal
|
|
343
348
|
}), queueMicrotask(() => {
|
|
344
|
-
t(this,
|
|
349
|
+
t(this, A).call(this);
|
|
345
350
|
});
|
|
346
351
|
}
|
|
347
352
|
$beforeUnmounted() {
|
|
348
|
-
var e,
|
|
349
|
-
(e = t(this,
|
|
350
|
-
for (const
|
|
351
|
-
(
|
|
352
|
-
(
|
|
353
|
+
var e, s, a, h;
|
|
354
|
+
(e = t(this, u)) == null || e.abort();
|
|
355
|
+
for (const b in t(this, d))
|
|
356
|
+
(s = t(this, d)[b]) == null || s.abort();
|
|
357
|
+
(a = t(this, k).call(this)) == null || a.unsetHandler(), (h = t(this, v)) == null || h.disconnect(), g(this, v, null);
|
|
353
358
|
}
|
|
354
359
|
}
|
|
355
|
-
|
|
360
|
+
m = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), S = new WeakMap(), f = new WeakMap(), p = new WeakMap(), u = new WeakMap(), d = new WeakMap(), v = new WeakMap(), i = new WeakMap(), q = new WeakMap(), w = new WeakMap(), l = new WeakSet(), /**
|
|
356
361
|
* 初始化 `轮播图元素` 结构
|
|
357
362
|
*/
|
|
358
|
-
|
|
363
|
+
z = function() {
|
|
359
364
|
try {
|
|
360
|
-
this.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
365
|
+
const e = this.querySelectorAll("ea-carousel-item:not([slot])");
|
|
366
|
+
if (e.length === 0) return;
|
|
367
|
+
t(this, i).originLength = e.length, this.querySelectorAll(
|
|
368
|
+
'ea-carousel-item[slot^="clone-"]'
|
|
369
|
+
).forEach((b) => b.remove());
|
|
370
|
+
const a = e[0].cloneNode(!0), h = e[e.length - 1].cloneNode(!0);
|
|
371
|
+
a.setAttribute("slot", "clone-first"), h.setAttribute("slot", "clone-last"), this.appendChild(a), this.appendChild(h), c(this, l, O).call(this), queueMicrotask(() => {
|
|
372
|
+
t(this, E).call(this);
|
|
366
373
|
});
|
|
367
374
|
} catch {
|
|
368
375
|
}
|
|
369
|
-
},
|
|
376
|
+
}, /**
|
|
377
|
+
* 设置 MutationObserver 监听 item 内容变化
|
|
378
|
+
*/
|
|
379
|
+
O = function() {
|
|
380
|
+
t(this, v) && t(this, v).disconnect(), g(this, v, new MutationObserver((s) => {
|
|
381
|
+
s.some((h) => h.type === "childList" && h.target.closest("ea-carousel-item:not([slot])")) && c(this, l, U).call(this);
|
|
382
|
+
})), this.querySelectorAll("ea-carousel-item:not([slot])").forEach((s) => {
|
|
383
|
+
t(this, v).observe(s, {
|
|
384
|
+
childList: !0,
|
|
385
|
+
subtree: !0,
|
|
386
|
+
characterData: !0
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
}, /**
|
|
390
|
+
* 同步克隆节点的内容
|
|
391
|
+
*/
|
|
392
|
+
U = function() {
|
|
393
|
+
const e = this.querySelectorAll("ea-carousel-item:not([slot])");
|
|
394
|
+
if (e.length === 0) return;
|
|
395
|
+
const s = this.querySelector(
|
|
396
|
+
'ea-carousel-item[slot="clone-first"]'
|
|
397
|
+
), a = this.querySelector('ea-carousel-item[slot="clone-last"]');
|
|
398
|
+
s && e[0] && (s.innerHTML = e[0].innerHTML), a && e[e.length - 1] && (a.innerHTML = e[e.length - 1].innerHTML);
|
|
399
|
+
}, E = new WeakMap(), M = new WeakMap(), /**
|
|
370
400
|
* 清除轮播图自动播放
|
|
371
401
|
*/
|
|
372
|
-
|
|
373
|
-
t(this,
|
|
402
|
+
L = function() {
|
|
403
|
+
t(this, i).timer && (clearInterval(t(this, i).timer), t(this, i).timer = null);
|
|
374
404
|
}, /**
|
|
375
405
|
* 处理轮播图自动播放
|
|
376
406
|
*/
|
|
377
|
-
|
|
378
|
-
this.autoplay && (t(this,
|
|
379
|
-
},
|
|
380
|
-
window.customElements.get("ea-carousel") || window.customElements.define("ea-carousel",
|
|
407
|
+
y = function() {
|
|
408
|
+
this.autoplay && (t(this, i).timer = setInterval(this.next, this.interval));
|
|
409
|
+
}, A = new WeakMap(), x = new WeakMap(), I = new WeakMap(), H = new WeakMap(), P = new WeakMap(), k = new WeakMap(), R = new WeakMap();
|
|
410
|
+
window.customElements.get("ea-carousel") || window.customElements.define("ea-carousel", F);
|
|
381
411
|
export {
|
|
382
|
-
|
|
383
|
-
|
|
412
|
+
F as EaCarousel,
|
|
413
|
+
Y as EaCarouselItem
|
|
384
414
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const r = ":host{--ea-carousel-indicator-x: 50%;--ea-carousel-indicator-y: 8px;--ea-carousel-arrow-x: 8px;--ea-carousel-indicator-spacing: var(--spacing-sm);--ea-carousel-arrow-border-radius: var(--border-radius-circle);--ea-carousel-height: 100%;--ea-carousel-indicator-width: 16px;--ea-carousel-indicator-height: 4px;--ea-carousel-arrow-size: 24px;--ea-carousel-transform: translateX(0);--ea-carousel-indicator-color: rgba(255, 255, 255, .4);--ea-carousel-indicator-outside-color: rgba(208, 208, 208, .4);--ea-carousel-indicator-active-color: var(--grey-400);--ea-carousel-arrow-color: rgba(31, 45, 61, .11);--ea-carousel-arrow-hover-color: rgba(31, 45, 61, .23);--ea-carousel-transition: var(--transition-slow)}.ea-carousel{position:relative;overflow:hidden;display:flex;flex-direction:column;flex-wrap:nowrap;height:var(--ea-carousel-height)}.ea-carousel__content{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;height:100%;width:100%;transform:var(--ea-carousel-transform);transition:transform var(--ea-carousel-transition)}.ea-carousel__arrow{border:none;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;z-index:1;transform:translateY(-50%);opacity:0;width:var(--ea-carousel-arrow-size);height:var(--ea-carousel-arrow-size);line-height:var(--ea-carousel-arrow-size);font-size:var(--font-size-md);font-weight:800;text-align:center;border-radius:var(--ea-carousel-arrow-border-radius);background-color:var(--ea-carousel-arrow-color);color:var(--color-white);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .3s,transform .3s,opacity .3s}.ea-carousel__arrow.arrow-left{left:var(--ea-carousel-arrow-x);transform:translate(calc(-100% - var(--ea-carousel-arrow-x)),-50%)}.ea-carousel__arrow.arrow-right{right:var(--ea-carousel-arrow-x);transform:translate(calc(100% - var(--ea-carousel-arrow-x)),-50%)}.ea-carousel__arrow:hover{background-color:var(--ea-carousel-arrow-hover-color)}.ea-carousel__arrow ea-icon{color:var(--color-white)}.ea-carousel__indicator-wrap{position:absolute;right:var(--ea-carousel-indicator-x);bottom:var(--ea-carousel-indicator-y);transform:translate(50%);display:flex;flex-direction:row;align-items:center;justify-content:center}.ea-carousel__indicator{box-sizing:border-box;padding:0;border:none;margin:var(--ea-carousel-indicator-spacing);width:var(--ea-carousel-indicator-width);height:var(--ea-carousel-indicator-height);background-color:var(--ea-carousel-indicator-color);transition:background-color .3s}.ea-carousel__indicator.is-active{background-color:var(--ea-carousel-indicator-active-color)}.ea-carousel--vertical .ea-carousel__arrow{display:none}.ea-carousel--vertical .ea-carousel__content{flex-direction:column}.ea-carousel--vertical .ea-carousel__indicator{--ea-carousel-indicator-width: 4px;--ea-carousel-indicator-height: 16px}.ea-carousel--vertical .ea-carousel__indicator-wrap{--ea-carousel-indicator-x: 8px;--ea-carousel-indicator-y: 50%;flex-direction:column;transform:translateY(50%)}.ea-carousel.is-arrow-hover .arrow-left,.ea-carousel.is-arrow-hover .arrow-right,.ea-carousel.is-arrow-always .arrow-left,.ea-carousel.is-arrow-always .arrow-right{opacity:1;transform:translateY(-50%)}.ea-carousel.is-outside-indicator .ea-carousel__indicator-wrap{position:relative;bottom:unset;left:unset}.ea-carousel.is-outside-indicator .ea-carousel__indicator{background-color:var(--ea-carousel-indicator-outside-color)}.ea-carousel.is-outside-indicator .ea-carousel__indicator.is-active{background-color:var(--ea-carousel-indicator-active-color)}";
|
|
1
|
+
const r = ":host{--ea-carousel-indicator-x: 50%;--ea-carousel-indicator-y: 8px;--ea-carousel-arrow-x: 8px;--ea-carousel-indicator-spacing: var(--spacing-sm);--ea-carousel-arrow-border-radius: var(--border-radius-circle);--ea-carousel-height: 100%;--ea-carousel-indicator-width: 16px;--ea-carousel-indicator-height: 4px;--ea-carousel-arrow-size: 24px;--ea-carousel-transform: translateX(0);--ea-carousel-indicator-color: rgba(255, 255, 255, .4);--ea-carousel-indicator-outside-color: rgba(208, 208, 208, .4);--ea-carousel-indicator-active-color: var(--grey-400);--ea-carousel-arrow-color: rgba(31, 45, 61, .11);--ea-carousel-arrow-hover-color: rgba(31, 45, 61, .23);--ea-carousel-transition: var(--transition-slow)}:host{display:block}.ea-carousel{position:relative;overflow:hidden;display:flex;flex-direction:column;flex-wrap:nowrap;height:var(--ea-carousel-height)}.ea-carousel__content{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;height:100%;width:100%;transform:var(--ea-carousel-transform);transition:transform var(--ea-carousel-transition)}.ea-carousel__arrow{border:none;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;z-index:1;transform:translateY(-50%);opacity:0;width:var(--ea-carousel-arrow-size);height:var(--ea-carousel-arrow-size);line-height:var(--ea-carousel-arrow-size);font-size:var(--font-size-md);font-weight:800;text-align:center;border-radius:var(--ea-carousel-arrow-border-radius);background-color:var(--ea-carousel-arrow-color);color:var(--color-white);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .3s,transform .3s,opacity .3s}.ea-carousel__arrow.arrow-left{left:var(--ea-carousel-arrow-x);transform:translate(calc(-100% - var(--ea-carousel-arrow-x)),-50%)}.ea-carousel__arrow.arrow-right{right:var(--ea-carousel-arrow-x);transform:translate(calc(100% - var(--ea-carousel-arrow-x)),-50%)}.ea-carousel__arrow:hover{background-color:var(--ea-carousel-arrow-hover-color)}.ea-carousel__arrow ea-icon{color:var(--color-white)}.ea-carousel__indicator-wrap{position:absolute;right:var(--ea-carousel-indicator-x);bottom:var(--ea-carousel-indicator-y);transform:translate(50%);display:flex;flex-direction:row;align-items:center;justify-content:center}.ea-carousel__indicator{box-sizing:border-box;padding:0;border:none;margin:var(--ea-carousel-indicator-spacing);width:var(--ea-carousel-indicator-width);height:var(--ea-carousel-indicator-height);background-color:var(--ea-carousel-indicator-color);transition:background-color .3s}.ea-carousel__indicator.is-active{background-color:var(--ea-carousel-indicator-active-color)}.ea-carousel--vertical .ea-carousel__arrow{display:none}.ea-carousel--vertical .ea-carousel__content{flex-direction:column}.ea-carousel--vertical .ea-carousel__indicator{--ea-carousel-indicator-width: 4px;--ea-carousel-indicator-height: 16px}.ea-carousel--vertical .ea-carousel__indicator-wrap{--ea-carousel-indicator-x: 8px;--ea-carousel-indicator-y: 50%;flex-direction:column;transform:translateY(50%)}.ea-carousel.is-arrow-hover .arrow-left,.ea-carousel.is-arrow-hover .arrow-right,.ea-carousel.is-arrow-always .arrow-left,.ea-carousel.is-arrow-always .arrow-right{opacity:1;transform:translateY(-50%)}.ea-carousel.is-outside-indicator .ea-carousel__indicator-wrap{position:relative;bottom:unset;left:unset}.ea-carousel.is-outside-indicator .ea-carousel__indicator{background-color:var(--ea-carousel-indicator-outside-color)}.ea-carousel.is-outside-indicator .ea-carousel__indicator.is-active{background-color:var(--ea-carousel-indicator-active-color)}";
|
|
2
2
|
export {
|
|
3
3
|
r as s
|
|
4
4
|
};
|