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.
@@ -1,19 +1,19 @@
1
- var P = Object.defineProperty;
2
- var z = (i) => {
3
- throw TypeError(i);
1
+ var j = Object.defineProperty;
2
+ var B = (r) => {
3
+ throw TypeError(r);
4
4
  };
5
- var O = (i, o, e) => o in i ? P(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
6
- var S = (i, o, e) => O(i, typeof o != "symbol" ? o + "" : o, e), $ = (i, o, e) => o.has(i) || z("Cannot " + e);
7
- var t = (i, o, e) => ($(i, o, "read from private field"), e ? e.call(i) : o.get(i)), n = (i, o, e) => o.has(i) ? z("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, e), v = (i, o, e, r) => ($(i, o, "write to private field"), r ? r.call(i, e) : o.set(i, e), e), c = (i, o, e) => ($(i, o, "access private method"), e);
8
- import { B } from "./Base.js";
9
- import { s as U } from "../css/ea-carousel-item.style.js";
10
- import { s as j } from "../css/ea-carousel.style.js";
11
- class W extends B {
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 = U, this.$render();
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", W);
30
- var f, m, _, A, g, p, h, u, s, L, w, a, N, y, I, x, b, C, E, k, q, R, M, T;
31
- class X extends B {
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, a);
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, A);
42
+ n(this, S);
43
43
  /** @type {HTMLElement} */
44
- n(this, g);
44
+ n(this, f);
45
45
  /** @type {HTMLElement[]} */
46
46
  n(this, p, []);
47
47
  /** @type {AbortController} */
48
- n(this, h);
49
- n(this, u, {
48
+ n(this, u);
49
+ n(this, d, {
50
50
  triggerAbortControllers: new AbortController()
51
51
  });
52
- n(this, s, {
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
- S(this, "state", this.properties({
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, r) => {
79
- if (t(this, y).call(this, e), t(this, s).isEnd) return t(this, s).isEnd = !1;
80
- e < 0 ? (e = t(this, p).length - 1, r = 0, t(this, s).isEnd = !0) : e > t(this, p).length - 1 && (r = t(this, p).length - 1, e = 0, t(this, s).isEnd = !0), t(this, s).prevIndex = r, this.emit("change", {
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: r
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 r;
94
- (r = t(this, u).triggerAbortControllers) == null || r.abort(), t(this, u).triggerAbortControllers = new AbortController(), t(this, g).addEventListener(
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, k),
99
+ t(this, I),
97
100
  {
98
- signal: t(this, u).triggerAbortControllers.signal
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, a, b).call(this) : c(this, a, x).call(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, L, () => this.index === t(this, p).length ? 0 : this.index === -1 ? t(this, p).length - 1 : this.index);
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
- (r, l) => `<button class='ea-carousel__indicator' part='indicator' tabindex="1" data-index="${l}"></button>`
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, g).innerHTML = e, v(this, p, [
157
- ...t(this, g).querySelectorAll(".ea-carousel__indicator")
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, y, (e = 0) => {
165
- const { width: r, height: l } = t(this, f).getBoundingClientRect(), d = this.direction === "horizontal" ? "X" : "Y", H = this.direction === "horizontal" ? r : l;
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${d}(-${(e + 1) * H}px)`
169
- ), t(this, I).call(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, I, () => {
175
- t(this, p).forEach((e, r) => {
176
- e.classList.toggle("is-active", r === t(this, L).call(this));
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, C, () => {
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, E, () => {
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, k, (e) => {
196
- const r = t(this, g).querySelectorAll(
198
+ n(this, I, (e) => {
199
+ const s = t(this, f).querySelectorAll(
197
200
  ".ea-carousel__indicator"
198
- ), l = e.target.closest(".ea-carousel__indicator");
199
- l && r.forEach((d, H) => {
200
- d.classList.toggle("is-active", d === l), d === l && (this.index = H);
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, q, () => {
207
- t(this, E).call(this), this.autoplay && !t(this, s).isMouseEnter && c(this, a, x).call(this), this.index = t(this, L).call(this), this.autoplay && !t(this, s).isMouseEnter && c(this, a, b).call(this), t(this, C).call(this), t(this, s).pause = !1;
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, R, () => {
215
+ n(this, P, () => {
213
216
  const e = () => {
214
- t(this, s).isMouseEnter = !1, this["pause-on-hover"] && c(this, a, b).call(this), this.updateContainerClasslist();
217
+ t(this, i).isMouseEnter = !1, this["pause-on-hover"] && c(this, l, y).call(this), this.updateContainerClasslist();
215
218
  };
216
- t(this, s).isMouseEnter = !0, this["pause-on-hover"] && c(this, a, x).call(this), this.updateContainerClasslist(), t(this, f).addEventListener("mouseleave", e, {
217
- signal: t(this, h).signal,
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, M, () => {
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, y).call(this, this.index);
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, T, () => {
241
- t(this, E).call(this), c(this, a, x).call(this), t(this, s).prevIndex = 0, t(this, s).originLength = 0, t(this, s).pause = !1, t(this, s).isEnd = !1, this.index = 0, t(this, w).call(this), c(this, a, N).call(this), t(this, I).call(this), this.autoplay && c(this, a, b).call(this), queueMicrotask(() => {
242
- t(this, C).call(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
- S(this, "prev", () => {
249
- t(this, s).pause || (this.index--, t(this, s).pause = !0);
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
- S(this, "next", () => {
255
- t(this, s).pause || (this.index++, t(this, s).pause = !0);
257
+ T(this, "next", () => {
258
+ t(this, i).pause || (this.index++, t(this, i).pause = !0);
256
259
  });
257
- this.stylesheet = j, this.$render();
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, s).isMouseEnter,
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, f).className = e, e;
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
- `, v(this, f, this.shadowRoot.querySelector(".ea-carousel")), v(this, m, this.shadowRoot.querySelector(".ea-carousel__content")), v(this, g, this.shadowRoot.querySelector(
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
- )), v(this, _, this.shadowRoot.querySelector(
317
+ )), g(this, _, this.shadowRoot.querySelector(
313
318
  ".ea-carousel__arrow.arrow-left"
314
- )), v(this, A, this.shadowRoot.querySelector(
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, r;
320
- super.connectedCallback(), (e = t(this, h)) == null || e.abort(), v(this, h, new AbortController());
321
- for (const l in t(this, u))
322
- (r = t(this, u)[l]) == null || r.abort(), t(this, u)[l] = new AbortController();
323
- t(this, E).call(this), t(this, w).call(this), c(this, a, N).call(this), this.autoplay && c(this, a, b).call(this), t(this, g).addEventListener(
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, k),
330
+ t(this, I),
326
331
  {
327
- signal: t(this, u).triggerAbortControllers.signal
332
+ signal: t(this, d).triggerAbortControllers.signal
328
333
  }
329
- ), t(this, m).addEventListener(
334
+ ), t(this, C).addEventListener(
330
335
  "transitionend",
331
- t(this, q),
332
- { signal: t(this, h).signal }
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, h).signal
335
- }), t(this, A).addEventListener("click", this.next, {
336
- signal: t(this, h).signal
337
- })), t(this, f).addEventListener("mouseenter", t(this, R), {
338
- signal: t(this, h).signal
339
- }), window.addEventListener("resize", t(this, M).call(this).listener, {
340
- signal: t(this, h).signal
341
- }), t(this, m).querySelector("slot").addEventListener("slotchange", t(this, T), {
342
- signal: t(this, h).signal
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, C).call(this);
349
+ t(this, A).call(this);
345
350
  });
346
351
  }
347
352
  $beforeUnmounted() {
348
- var e, r, l;
349
- (e = t(this, h)) == null || e.abort();
350
- for (const d in t(this, u))
351
- (r = t(this, u)[d]) == null || r.abort();
352
- (l = t(this, M).call(this)) == null || l.unsetHandler();
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
- f = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), g = new WeakMap(), p = new WeakMap(), h = new WeakMap(), u = new WeakMap(), s = new WeakMap(), L = new WeakMap(), w = new WeakMap(), a = new WeakSet(), /**
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
- N = function() {
363
+ z = function() {
359
364
  try {
360
- this.childNodes.forEach((d) => {
361
- d.tagName !== "EA-CAROUSEL-ITEM" && d.remove();
362
- });
363
- const e = this.children, r = e[0].cloneNode(!0), l = e[e.length - 1].cloneNode(!0);
364
- t(this, s).originLength = e.length, this.insertBefore(l, this.firstChild), this.appendChild(r), queueMicrotask(() => {
365
- t(this, y).call(this);
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
- }, y = new WeakMap(), I = new WeakMap(), /**
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
- x = function() {
373
- t(this, s).timer && (clearInterval(t(this, s).timer), t(this, s).timer = null);
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
- b = function() {
378
- this.autoplay && (t(this, s).timer = setInterval(this.next, this.interval));
379
- }, C = new WeakMap(), E = new WeakMap(), k = new WeakMap(), q = new WeakMap(), R = new WeakMap(), M = new WeakMap(), T = new WeakMap();
380
- window.customElements.get("ea-carousel") || window.customElements.define("ea-carousel", X);
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
- X as EaCarousel,
383
- W as EaCarouselItem
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-component-ui",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "使用 WebComponent 编写的原生组件库",
5
5
  "main": "dist/components/index.js",
6
6
  "module": "dist/components/index.js",