easy-component-ui 3.0.10 → 3.0.12
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/Base.js +187 -186
- package/dist/components/ea-breadcrumb.js +33 -33
- package/dist/components/ea-carousel.js +71 -70
- package/dist/components/ea-collapse.js +100 -80
- package/dist/components/ea-color-picker.js +199 -196
- package/dist/components/ea-countdown.js +77 -56
- package/dist/components/ea-descriptions.js +133 -70
- package/dist/components/ea-drawer.js +87 -70
- package/dist/components/ea-empty.js +31 -23
- package/dist/components/ea-menu.js +68 -52
- package/dist/components/ea-overlay.js +35 -29
- package/dist/components/ea-pagination.js +1 -0
- package/dist/components/ea-popconfirm.js +132 -77
- package/dist/components/ea-popper.js +9 -9
- package/dist/components/ea-progress.js +81 -64
- package/dist/components/ea-result.js +22 -22
- package/dist/components/ea-select.js +110 -99
- package/dist/components/ea-skeleton.js +99 -82
- package/dist/components/ea-statistic.js +72 -4
- package/dist/components/ea-steps.js +104 -70
- package/dist/components/ea-table.js +514 -397
- package/dist/components/ea-tag.js +37 -43
- package/dist/components/ea-timeline.js +10 -11
- package/dist/components/index.js +1 -1
- package/dist/css/ea-card.style.js +1 -1
- package/dist/css/ea-carousel.style.js +2 -2
- package/dist/css/ea-collapse-item.style.js +1 -1
- package/dist/css/ea-color-picker-panel.style.js +1 -1
- package/dist/css/ea-descriptions-item.style.js +2 -2
- package/dist/css/ea-descriptions.style.js +1 -1
- package/dist/css/ea-empty.style.js +1 -1
- package/dist/css/ea-progress.style.js +1 -1
- package/dist/css/ea-skeleton.style.js +1 -1
- package/dist/css/ea-step.style.js +1 -1
- package/dist/css/ea-table-column.style.js +4 -0
- package/dist/css/ea-table.style.js +1 -1
- package/dist/css/ea-timeline-item.style.js +1 -1
- package/dist/utils/Variables.js +5 -12
- package/dist/utils/parseTime.js +73 -0
- package/package.json +1 -1
- package/dist/components/ea-statistic2.js +0 -83
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
2
|
var S = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var y = (t,
|
|
6
|
-
var f = (t,
|
|
7
|
-
var
|
|
8
|
-
import { B as
|
|
5
|
+
var y = (t, r, e) => r in t ? E(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
6
|
+
var f = (t, r, e) => y(t, typeof r != "symbol" ? r + "" : r, e), w = (t, r, e) => r.has(t) || S("Cannot " + e);
|
|
7
|
+
var s = (t, r, e) => (w(t, r, "read from private field"), e ? e.call(t) : r.get(t)), a = (t, r, e) => r.has(t) ? S("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), i = (t, r, e, n) => (w(t, r, "write to private field"), n ? n.call(t, e) : r.set(t, e), e);
|
|
8
|
+
import { B as C } from "./Base.js";
|
|
9
9
|
import { s as v } from "../css/ea-breadcrumb.style.js";
|
|
10
10
|
import { s as R } from "../css/ea-breadcrumb-item.style.js";
|
|
11
11
|
import { E as _ } from "../utils/Utils.js";
|
|
12
|
-
var c, d,
|
|
13
|
-
class
|
|
12
|
+
var l, c, d, b, p;
|
|
13
|
+
class $ extends C {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
16
|
/** @type {HTMLElement} */
|
|
17
|
-
a(this,
|
|
17
|
+
a(this, l);
|
|
18
18
|
/** @type {HTMLSlotElement} */
|
|
19
|
-
a(this,
|
|
19
|
+
a(this, c);
|
|
20
20
|
/** @type {AbortController} */
|
|
21
|
-
a(this,
|
|
21
|
+
a(this, d, new AbortController());
|
|
22
22
|
f(this, "state", this.properties({
|
|
23
23
|
separator: {
|
|
24
24
|
type: String,
|
|
@@ -41,10 +41,10 @@ class q extends E {
|
|
|
41
41
|
*/
|
|
42
42
|
a(this, p, () => {
|
|
43
43
|
const n = [...this.shadowRoot.querySelector("#defaultSlot").assignedElements()].filter(
|
|
44
|
-
(
|
|
45
|
-
), o =
|
|
46
|
-
n.forEach((
|
|
47
|
-
g < n.length - 1 && !
|
|
44
|
+
(m) => m.tagName.toLowerCase() === "ea-breadcrumb-item"
|
|
45
|
+
), o = s(this, b).call(this, this.separator);
|
|
46
|
+
n.forEach((m, g) => {
|
|
47
|
+
g < n.length - 1 && !m.querySelector("[slot='separator']") && m.appendChild(o.cloneNode(!0));
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
this.stylesheet = v, this.$render();
|
|
@@ -60,7 +60,7 @@ class q extends E {
|
|
|
60
60
|
const e = this.computedClasslist("ea-breadcrumb", {
|
|
61
61
|
// ['--' + this.type]: this.type,
|
|
62
62
|
});
|
|
63
|
-
return
|
|
63
|
+
return s(this, l).className = e, e;
|
|
64
64
|
}
|
|
65
65
|
$render() {
|
|
66
66
|
this.shadowRoot.innerHTML = `
|
|
@@ -68,34 +68,34 @@ class q extends E {
|
|
|
68
68
|
<slot id="defaultSlot"></slot>
|
|
69
69
|
</nav>
|
|
70
70
|
<slot id="separatorSlot" name="separator"></slot>
|
|
71
|
-
`,
|
|
71
|
+
`, i(this, l, this.shadowRoot.querySelector(".ea-breadcrumb")), i(this, c, this.shadowRoot.querySelector("#defaultSlot"));
|
|
72
72
|
}
|
|
73
73
|
connectedCallback() {
|
|
74
|
-
super.connectedCallback(),
|
|
75
|
-
signal:
|
|
74
|
+
super.connectedCallback(), s(this, c).addEventListener("slotchange", s(this, p), {
|
|
75
|
+
signal: s(this, d).signal
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
$beforeUnmounted() {
|
|
79
79
|
var e;
|
|
80
|
-
(e =
|
|
80
|
+
(e = s(this, d)) == null || e.abort();
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
window.customElements.get("ea-breadcrumb") || window.customElements.define("ea-breadcrumb",
|
|
85
|
-
var
|
|
86
|
-
class
|
|
83
|
+
l = new WeakMap(), c = new WeakMap(), d = new WeakMap(), b = new WeakMap(), p = new WeakMap();
|
|
84
|
+
window.customElements.get("ea-breadcrumb") || window.customElements.define("ea-breadcrumb", $);
|
|
85
|
+
var u, h;
|
|
86
|
+
class q extends C {
|
|
87
87
|
constructor() {
|
|
88
88
|
super();
|
|
89
89
|
/** @type {HTMLElement} */
|
|
90
|
-
a(this,
|
|
90
|
+
a(this, u);
|
|
91
91
|
/** @type {HTMLElement} */
|
|
92
|
-
a(this,
|
|
92
|
+
a(this, h);
|
|
93
93
|
f(this, "state", this.properties({
|
|
94
94
|
href: {
|
|
95
95
|
type: String,
|
|
96
96
|
default: "",
|
|
97
97
|
observer: (e) => {
|
|
98
|
-
|
|
98
|
+
this.$render(), s(this, h).href = this.getAttribute("href");
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}));
|
|
@@ -112,7 +112,7 @@ class A extends E {
|
|
|
112
112
|
const e = this.computedClasslist("ea-breadcrumb-item", {
|
|
113
113
|
// ['--' + this.type]: this.type,
|
|
114
114
|
});
|
|
115
|
-
return
|
|
115
|
+
return s(this, u).className = e, e;
|
|
116
116
|
}
|
|
117
117
|
$render() {
|
|
118
118
|
const e = _.EaElement.h(
|
|
@@ -132,17 +132,17 @@ class A extends E {
|
|
|
132
132
|
<slot name="separator"></slot>
|
|
133
133
|
</span>
|
|
134
134
|
</div>
|
|
135
|
-
`,
|
|
135
|
+
`, i(this, u, this.shadowRoot.querySelector(".ea-breadcrumb-item")), i(this, h, this.shadowRoot.querySelector(
|
|
136
136
|
".ea-breadcrumb-item__content"
|
|
137
|
-
));
|
|
137
|
+
)), this.updateContainerClasslist();
|
|
138
138
|
}
|
|
139
139
|
connectedCallback() {
|
|
140
140
|
super.connectedCallback();
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
window.customElements.get("ea-breadcrumb-item") || window.customElements.define("ea-breadcrumb-item",
|
|
143
|
+
u = new WeakMap(), h = new WeakMap();
|
|
144
|
+
window.customElements.get("ea-breadcrumb-item") || window.customElements.define("ea-breadcrumb-item", q);
|
|
145
145
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
$ as EaBreadcrumb,
|
|
147
|
+
q as EaBreadcrumbItem
|
|
148
148
|
};
|
|
@@ -2,9 +2,9 @@ var j = Object.defineProperty;
|
|
|
2
2
|
var B = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var D = (r,
|
|
6
|
-
var T = (r,
|
|
7
|
-
var t = (r,
|
|
5
|
+
var D = (r, n, e) => n in r ? j(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
|
6
|
+
var T = (r, n, e) => D(r, typeof n != "symbol" ? n + "" : n, e), $ = (r, n, e) => n.has(r) || B("Cannot " + e);
|
|
7
|
+
var t = (r, n, e) => ($(r, n, "read from private field"), e ? e.call(r) : n.get(r)), a = (r, n, e) => n.has(r) ? B("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, e), g = (r, n, e, s) => ($(r, n, "write to private field"), s ? s.call(r, e) : n.set(r, e), e), h = (r, n, e) => ($(r, n, "access private method"), e);
|
|
8
8
|
import { B as N } from "./Base.js";
|
|
9
9
|
import { s as W } from "../css/ea-carousel-item.style.js";
|
|
10
10
|
import { s as X } from "../css/ea-carousel.style.js";
|
|
@@ -27,31 +27,31 @@ class Y extends N {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
window.customElements.get("ea-carousel-item") || window.customElements.define("ea-carousel-item", Y);
|
|
30
|
-
var
|
|
30
|
+
var b, w, _, S, f, p, u, d, v, i, q, E, o, z, O, U, A, I, m, C, x, L, M, H, P, k, R;
|
|
31
31
|
class F extends N {
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
|
-
|
|
34
|
+
a(this, o);
|
|
35
35
|
/** @type {HTMLElement} */
|
|
36
|
-
|
|
36
|
+
a(this, b);
|
|
37
37
|
/** @type {HTMLElement} */
|
|
38
|
-
|
|
38
|
+
a(this, w);
|
|
39
39
|
/** @type {HTMLElement} */
|
|
40
|
-
|
|
40
|
+
a(this, _);
|
|
41
41
|
/** @type {HTMLElement} */
|
|
42
|
-
|
|
42
|
+
a(this, S);
|
|
43
43
|
/** @type {HTMLElement} */
|
|
44
|
-
|
|
44
|
+
a(this, f);
|
|
45
45
|
/** @type {HTMLElement[]} */
|
|
46
|
-
|
|
46
|
+
a(this, p, []);
|
|
47
47
|
/** @type {AbortController} */
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
a(this, u);
|
|
49
|
+
a(this, d, {
|
|
50
50
|
triggerAbortControllers: new AbortController()
|
|
51
51
|
});
|
|
52
52
|
/** @type {MutationObserver | null} */
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
a(this, v, null);
|
|
54
|
+
a(this, i, {
|
|
55
55
|
prevIndex: 0,
|
|
56
56
|
originLength: 0,
|
|
57
57
|
timer: null,
|
|
@@ -79,7 +79,7 @@ class F extends N {
|
|
|
79
79
|
type: Number,
|
|
80
80
|
default: 0,
|
|
81
81
|
observer: (e, s) => {
|
|
82
|
-
if (t(this,
|
|
82
|
+
if (t(this, A).call(this, e), t(this, i).isEnd) return t(this, i).isEnd = !1;
|
|
83
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", {
|
|
84
84
|
detail: {
|
|
85
85
|
current: e,
|
|
@@ -96,7 +96,7 @@ class F extends N {
|
|
|
96
96
|
var s;
|
|
97
97
|
(s = t(this, d).triggerAbortControllers) == null || s.abort(), t(this, d).triggerAbortControllers = new AbortController(), t(this, f).addEventListener(
|
|
98
98
|
e === "hover" ? "mouseover" : "click",
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, M),
|
|
100
100
|
{
|
|
101
101
|
signal: t(this, d).triggerAbortControllers.signal
|
|
102
102
|
}
|
|
@@ -107,6 +107,7 @@ class F extends N {
|
|
|
107
107
|
type: Number,
|
|
108
108
|
default: 3e3,
|
|
109
109
|
observer: () => {
|
|
110
|
+
h(this, o, m).call(this), this.autoplay && h(this, o, C).call(this);
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
arrow: {
|
|
@@ -120,7 +121,7 @@ class F extends N {
|
|
|
120
121
|
type: Boolean,
|
|
121
122
|
default: !0,
|
|
122
123
|
observer: (e) => {
|
|
123
|
-
|
|
124
|
+
h(this, o, m).call(this), e && h(this, o, C).call(this);
|
|
124
125
|
}
|
|
125
126
|
},
|
|
126
127
|
loop: {
|
|
@@ -147,14 +148,14 @@ class F extends N {
|
|
|
147
148
|
* 处理 index 溢出的情况
|
|
148
149
|
* @return {number}
|
|
149
150
|
*/
|
|
150
|
-
|
|
151
|
+
a(this, q, () => this.index === t(this, p).length ? 0 : this.index === -1 ? t(this, p).length - 1 : this.index);
|
|
151
152
|
/**
|
|
152
153
|
* 渲染 轮播图指示器,为了避免vue组件缓存,所以在初始化和组件挂载时都进行渲染
|
|
153
154
|
*/
|
|
154
|
-
|
|
155
|
+
a(this, E, () => {
|
|
155
156
|
const e = Array.from(
|
|
156
157
|
this.querySelectorAll("ea-carousel-item:not([slot])"),
|
|
157
|
-
(s,
|
|
158
|
+
(s, l) => `<button class='ea-carousel__indicator' part='indicator' tabindex="1" data-index="${l}"></button>`
|
|
158
159
|
).join("");
|
|
159
160
|
t(this, f).innerHTML = e, g(this, p, [
|
|
160
161
|
...t(this, f).querySelectorAll(".ea-carousel__indicator")
|
|
@@ -164,17 +165,17 @@ class F extends N {
|
|
|
164
165
|
* 更新轮播图位置
|
|
165
166
|
* @param {number} index
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
-
const { width: s, height:
|
|
168
|
+
a(this, A, (e = 0) => {
|
|
169
|
+
const { width: s, height: l } = t(this, b).getBoundingClientRect(), c = this.direction === "horizontal" ? "X" : "Y", y = this.direction === "horizontal" ? s : l;
|
|
169
170
|
this.style.setProperty(
|
|
170
171
|
"--ea-carousel-transform",
|
|
171
|
-
`translate${
|
|
172
|
-
), t(this,
|
|
172
|
+
`translate${c}(-${(e + 1) * y}px)`
|
|
173
|
+
), t(this, I).call(this);
|
|
173
174
|
});
|
|
174
175
|
/**
|
|
175
176
|
* 更新指示器位置
|
|
176
177
|
*/
|
|
177
|
-
|
|
178
|
+
a(this, I, () => {
|
|
178
179
|
t(this, p).forEach((e, s) => {
|
|
179
180
|
e.classList.toggle("is-active", s === t(this, q).call(this));
|
|
180
181
|
});
|
|
@@ -182,41 +183,41 @@ class F extends N {
|
|
|
182
183
|
/**
|
|
183
184
|
* 开启轮播图过渡属性
|
|
184
185
|
*/
|
|
185
|
-
|
|
186
|
+
a(this, x, () => {
|
|
186
187
|
this.clientHeight, this.style.removeProperty("--ea-carousel-transition");
|
|
187
188
|
});
|
|
188
189
|
/**
|
|
189
190
|
* 关闭轮播图过渡属性
|
|
190
191
|
*/
|
|
191
|
-
|
|
192
|
+
a(this, L, () => {
|
|
192
193
|
this.style.setProperty("--ea-carousel-transition", "none"), this.clientHeight;
|
|
193
194
|
});
|
|
194
195
|
/**
|
|
195
196
|
* 指示器 处理事件,需要按照 `this.trigger` 来确定事件名
|
|
196
197
|
* @param {MouseEvent} e
|
|
197
198
|
*/
|
|
198
|
-
|
|
199
|
+
a(this, M, (e) => {
|
|
199
200
|
const s = t(this, f).querySelectorAll(
|
|
200
201
|
".ea-carousel__indicator"
|
|
201
|
-
),
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
), l = e.target.closest(".ea-carousel__indicator");
|
|
203
|
+
l && s.forEach((c, y) => {
|
|
204
|
+
c.classList.toggle("is-active", c === l), c === l && (this.index = y);
|
|
204
205
|
});
|
|
205
206
|
});
|
|
206
207
|
/**
|
|
207
208
|
* 轮播图切换结束事件,即能确保轮播图在视觉上连续
|
|
208
209
|
*/
|
|
209
|
-
|
|
210
|
-
t(this,
|
|
210
|
+
a(this, H, () => {
|
|
211
|
+
t(this, L).call(this), h(this, o, m).call(this), this.index = t(this, q).call(this), this.autoplay && !t(this, i).isMouseEnter && h(this, o, C).call(this), t(this, x).call(this), t(this, i).pause = !1;
|
|
211
212
|
});
|
|
212
213
|
/**
|
|
213
214
|
* 箭头显示事件
|
|
214
215
|
*/
|
|
215
|
-
|
|
216
|
+
a(this, P, () => {
|
|
216
217
|
const e = () => {
|
|
217
|
-
t(this, i).isMouseEnter = !1, this["pause-on-hover"] &&
|
|
218
|
+
t(this, i).isMouseEnter = !1, this["pause-on-hover"] && h(this, o, C).call(this), this.updateContainerClasslist();
|
|
218
219
|
};
|
|
219
|
-
t(this, i).isMouseEnter = !0, this["pause-on-hover"] &&
|
|
220
|
+
t(this, i).isMouseEnter = !0, this["pause-on-hover"] && h(this, o, m).call(this), this.updateContainerClasslist(), t(this, b).addEventListener("mouseleave", e, {
|
|
220
221
|
signal: t(this, u).signal,
|
|
221
222
|
once: !0
|
|
222
223
|
});
|
|
@@ -224,12 +225,12 @@ class F extends N {
|
|
|
224
225
|
/**
|
|
225
226
|
* 当窗口大小变化时,更新轮播图位置
|
|
226
227
|
*/
|
|
227
|
-
|
|
228
|
+
a(this, k, () => {
|
|
228
229
|
let e = null;
|
|
229
230
|
return {
|
|
230
231
|
listener: () => {
|
|
231
232
|
clearTimeout(e), e = null, e = setTimeout(() => {
|
|
232
|
-
t(this,
|
|
233
|
+
t(this, A).call(this, this.index);
|
|
233
234
|
}, 100);
|
|
234
235
|
},
|
|
235
236
|
unsetHandler: () => {
|
|
@@ -240,9 +241,9 @@ class F extends N {
|
|
|
240
241
|
/**
|
|
241
242
|
* 处理 slotchange 事件,当 slot 内容变化时重新渲染
|
|
242
243
|
*/
|
|
243
|
-
|
|
244
|
-
t(this, i).isProcessingSlotChange || (t(this, i).isProcessingSlotChange = !0, t(this,
|
|
245
|
-
t(this,
|
|
244
|
+
a(this, R, () => {
|
|
245
|
+
t(this, i).isProcessingSlotChange || (t(this, i).isProcessingSlotChange = !0, t(this, L).call(this), h(this, o, m).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, E).call(this), h(this, o, z).call(this), t(this, I).call(this), this.autoplay && h(this, o, C).call(this), queueMicrotask(() => {
|
|
246
|
+
t(this, x).call(this), t(this, i).isProcessingSlotChange = !1;
|
|
246
247
|
}));
|
|
247
248
|
});
|
|
248
249
|
/**
|
|
@@ -292,7 +293,7 @@ class F extends N {
|
|
|
292
293
|
[this["indicator-position"] + "-indicator"]: this["indicator-position"]
|
|
293
294
|
}
|
|
294
295
|
);
|
|
295
|
-
return t(this,
|
|
296
|
+
return t(this, b).className = e, e;
|
|
296
297
|
}
|
|
297
298
|
$render() {
|
|
298
299
|
this.shadowRoot.innerHTML = `
|
|
@@ -312,26 +313,26 @@ class F extends N {
|
|
|
312
313
|
|
|
313
314
|
</footer>
|
|
314
315
|
</div>
|
|
315
|
-
`, g(this,
|
|
316
|
+
`, g(this, b, this.shadowRoot.querySelector(".ea-carousel")), g(this, w, this.shadowRoot.querySelector(".ea-carousel__content")), g(this, f, this.shadowRoot.querySelector(
|
|
316
317
|
".ea-carousel__indicator-wrap"
|
|
317
318
|
)), g(this, _, this.shadowRoot.querySelector(
|
|
318
319
|
".ea-carousel__arrow.arrow-left"
|
|
319
320
|
)), g(this, S, this.shadowRoot.querySelector(
|
|
320
321
|
".ea-carousel__arrow.arrow-right"
|
|
321
|
-
)), t(this,
|
|
322
|
+
)), t(this, E).call(this), this.updateContainerClasslist();
|
|
322
323
|
}
|
|
323
324
|
connectedCallback() {
|
|
324
325
|
var e, s;
|
|
325
326
|
super.connectedCallback(), (e = t(this, u)) == null || e.abort(), g(this, u, new AbortController());
|
|
326
|
-
for (const
|
|
327
|
-
(s = t(this, d)[
|
|
328
|
-
t(this,
|
|
327
|
+
for (const l in t(this, d))
|
|
328
|
+
(s = t(this, d)[l]) == null || s.abort(), t(this, d)[l] = new AbortController();
|
|
329
|
+
t(this, L).call(this), h(this, o, m).call(this), t(this, E).call(this), h(this, o, z).call(this), this.autoplay && h(this, o, C).call(this), t(this, f).addEventListener(
|
|
329
330
|
this.trigger === "hover" ? "mouseover" : "click",
|
|
330
|
-
t(this,
|
|
331
|
+
t(this, M),
|
|
331
332
|
{
|
|
332
333
|
signal: t(this, d).triggerAbortControllers.signal
|
|
333
334
|
}
|
|
334
|
-
), t(this,
|
|
335
|
+
), t(this, w).addEventListener(
|
|
335
336
|
"transitionend",
|
|
336
337
|
t(this, H),
|
|
337
338
|
{ signal: t(this, u).signal }
|
|
@@ -339,25 +340,25 @@ class F extends N {
|
|
|
339
340
|
signal: t(this, u).signal
|
|
340
341
|
}), t(this, S).addEventListener("click", this.next, {
|
|
341
342
|
signal: t(this, u).signal
|
|
342
|
-
})), t(this,
|
|
343
|
+
})), t(this, b).addEventListener("mouseenter", t(this, P), {
|
|
343
344
|
signal: t(this, u).signal
|
|
344
345
|
}), window.addEventListener("resize", t(this, k).call(this).listener, {
|
|
345
346
|
signal: t(this, u).signal
|
|
346
|
-
}), t(this,
|
|
347
|
+
}), t(this, w).querySelector("slot:not([name])").addEventListener("slotchange", t(this, R), {
|
|
347
348
|
signal: t(this, u).signal
|
|
348
349
|
}), queueMicrotask(() => {
|
|
349
|
-
t(this,
|
|
350
|
+
t(this, x).call(this);
|
|
350
351
|
});
|
|
351
352
|
}
|
|
352
353
|
$beforeUnmounted() {
|
|
353
|
-
var e, s,
|
|
354
|
+
var e, s, l, c;
|
|
354
355
|
(e = t(this, u)) == null || e.abort();
|
|
355
|
-
for (const
|
|
356
|
-
(s = t(this, d)[
|
|
357
|
-
(
|
|
356
|
+
for (const y in t(this, d))
|
|
357
|
+
(s = t(this, d)[y]) == null || s.abort();
|
|
358
|
+
(l = t(this, k).call(this)) == null || l.unsetHandler(), (c = t(this, v)) == null || c.disconnect(), g(this, v, null);
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
|
-
|
|
361
|
+
b = new WeakMap(), w = 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(), E = new WeakMap(), o = new WeakSet(), /**
|
|
361
362
|
* 初始化 `轮播图元素` 结构
|
|
362
363
|
*/
|
|
363
364
|
z = function() {
|
|
@@ -366,10 +367,10 @@ z = function() {
|
|
|
366
367
|
if (e.length === 0) return;
|
|
367
368
|
t(this, i).originLength = e.length, this.querySelectorAll(
|
|
368
369
|
'ea-carousel-item[slot^="clone-"]'
|
|
369
|
-
).forEach((
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
t(this,
|
|
370
|
+
).forEach((y) => y.remove());
|
|
371
|
+
const l = e[0].cloneNode(!0), c = e[e.length - 1].cloneNode(!0);
|
|
372
|
+
l.setAttribute("slot", "clone-first"), c.setAttribute("slot", "clone-last"), this.appendChild(l), this.appendChild(c), h(this, o, O).call(this), queueMicrotask(() => {
|
|
373
|
+
t(this, A).call(this);
|
|
373
374
|
});
|
|
374
375
|
} catch {
|
|
375
376
|
}
|
|
@@ -378,7 +379,7 @@ z = function() {
|
|
|
378
379
|
*/
|
|
379
380
|
O = function() {
|
|
380
381
|
t(this, v) && t(this, v).disconnect(), g(this, v, new MutationObserver((s) => {
|
|
381
|
-
s.some((
|
|
382
|
+
s.some((c) => c.type === "childList" && c.target.closest("ea-carousel-item:not([slot])")) && h(this, o, U).call(this);
|
|
382
383
|
})), this.querySelectorAll("ea-carousel-item:not([slot])").forEach((s) => {
|
|
383
384
|
t(this, v).observe(s, {
|
|
384
385
|
childList: !0,
|
|
@@ -394,19 +395,19 @@ U = function() {
|
|
|
394
395
|
if (e.length === 0) return;
|
|
395
396
|
const s = this.querySelector(
|
|
396
397
|
'ea-carousel-item[slot="clone-first"]'
|
|
397
|
-
),
|
|
398
|
-
s && e[0] && (s.innerHTML = e[0].innerHTML),
|
|
399
|
-
},
|
|
398
|
+
), l = this.querySelector('ea-carousel-item[slot="clone-last"]');
|
|
399
|
+
s && e[0] && (s.innerHTML = e[0].innerHTML), l && e[e.length - 1] && (l.innerHTML = e[e.length - 1].innerHTML);
|
|
400
|
+
}, A = new WeakMap(), I = new WeakMap(), /**
|
|
400
401
|
* 清除轮播图自动播放
|
|
401
402
|
*/
|
|
402
|
-
|
|
403
|
+
m = function() {
|
|
403
404
|
t(this, i).timer && (clearInterval(t(this, i).timer), t(this, i).timer = null);
|
|
404
405
|
}, /**
|
|
405
406
|
* 处理轮播图自动播放
|
|
406
407
|
*/
|
|
407
|
-
|
|
408
|
-
this.autoplay && (t(this, i).timer = setInterval(this.next, this.interval));
|
|
409
|
-
},
|
|
408
|
+
C = function() {
|
|
409
|
+
this.autoplay && (h(this, o, m).call(this), t(this, i).timer = setInterval(this.next, this.interval));
|
|
410
|
+
}, x = new WeakMap(), L = new WeakMap(), M = new WeakMap(), H = new WeakMap(), P = new WeakMap(), k = new WeakMap(), R = new WeakMap();
|
|
410
411
|
window.customElements.get("ea-carousel") || window.customElements.define("ea-carousel", F);
|
|
411
412
|
export {
|
|
412
413
|
F as EaCarousel,
|