easy-component-ui 3.0.14 → 3.0.15

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.
Files changed (167) hide show
  1. package/dist/assets/icon.css +1 -0
  2. package/dist/components/Base.js +941 -0
  3. package/dist/components/ea-alert.js +213 -0
  4. package/dist/components/ea-avatar.js +164 -0
  5. package/dist/components/ea-backtop.js +136 -0
  6. package/dist/components/ea-badge.js +144 -0
  7. package/dist/components/ea-breadcrumb.js +148 -0
  8. package/dist/components/ea-button.js +266 -0
  9. package/dist/components/ea-calendar.js +10 -0
  10. package/dist/components/ea-calendar2.js +673 -0
  11. package/dist/components/ea-card.js +121 -0
  12. package/dist/components/ea-carousel.js +415 -0
  13. package/dist/components/ea-checkbox.js +446 -0
  14. package/dist/components/ea-collapse.js +313 -0
  15. package/dist/components/ea-color-picker.js +888 -0
  16. package/dist/components/ea-container.js +206 -0
  17. package/dist/components/ea-countdown.js +142 -0
  18. package/dist/components/ea-date-picker.js +649 -0
  19. package/dist/components/ea-descriptions.js +474 -0
  20. package/dist/components/ea-dialog.js +249 -0
  21. package/dist/components/ea-drawer.js +216 -0
  22. package/dist/components/ea-dropdown.js +228 -0
  23. package/dist/components/ea-empty.js +93 -0
  24. package/dist/components/ea-icon.js +159 -0
  25. package/dist/components/ea-image-preview.js +532 -0
  26. package/dist/components/ea-image.js +327 -0
  27. package/dist/components/ea-infinite-scroll.js +109 -0
  28. package/dist/components/ea-input-number.js +367 -0
  29. package/dist/components/ea-input.js +588 -0
  30. package/dist/components/ea-layout.js +132 -0
  31. package/dist/components/ea-link.js +101 -0
  32. package/dist/components/ea-menu.js +433 -0
  33. package/dist/components/ea-message-box.js +624 -0
  34. package/dist/components/ea-message.js +313 -0
  35. package/dist/components/ea-notification.js +331 -0
  36. package/dist/components/ea-overlay.js +168 -0
  37. package/dist/components/ea-page-header.js +108 -0
  38. package/dist/components/ea-pagination.js +481 -0
  39. package/dist/components/ea-popconfirm.js +275 -0
  40. package/dist/components/ea-popover.js +147 -0
  41. package/dist/components/ea-popper.js +203 -0
  42. package/dist/components/ea-progress.js +286 -0
  43. package/dist/components/ea-radio.js +364 -0
  44. package/dist/components/ea-rate.js +241 -0
  45. package/dist/components/ea-result.js +100 -0
  46. package/dist/components/ea-scrollbar.js +235 -0
  47. package/dist/components/ea-segmented.js +215 -0
  48. package/dist/components/ea-select.js +609 -0
  49. package/dist/components/ea-skeleton.js +263 -0
  50. package/dist/components/ea-slider.js +430 -0
  51. package/dist/components/ea-space.js +123 -0
  52. package/dist/components/ea-splitter.js +233 -0
  53. package/dist/components/ea-statistic.js +74 -0
  54. package/dist/components/ea-steps.js +346 -0
  55. package/dist/components/ea-switch.js +271 -0
  56. package/dist/components/ea-table.js +1137 -0
  57. package/dist/components/ea-tabs.js +503 -0
  58. package/dist/components/ea-tag.js +228 -0
  59. package/dist/components/ea-text.js +113 -0
  60. package/dist/components/ea-time-picker.js +510 -0
  61. package/dist/components/ea-timeline.js +185 -0
  62. package/dist/components/ea-tooltip.js +161 -0
  63. package/dist/components/ea-tour.js +544 -0
  64. package/dist/components/ea-transfer.js +949 -0
  65. package/dist/components/ea-tree.js +1125 -0
  66. package/dist/components/index.js +60 -0
  67. package/dist/core/FormBase.js +238 -0
  68. package/dist/css/ea-alert.style.js +4 -0
  69. package/dist/css/ea-aside.style.js +4 -0
  70. package/dist/css/ea-avatar.style.js +4 -0
  71. package/dist/css/ea-backtop.style.js +4 -0
  72. package/dist/css/ea-badge.style.js +4 -0
  73. package/dist/css/ea-breadcrumb-item.style.js +4 -0
  74. package/dist/css/ea-breadcrumb.style.js +4 -0
  75. package/dist/css/ea-button-group.style.js +4 -0
  76. package/dist/css/ea-button.style.js +4 -0
  77. package/dist/css/ea-calendar.style.js +4 -0
  78. package/dist/css/ea-card.style.js +4 -0
  79. package/dist/css/ea-carousel-item.style.js +4 -0
  80. package/dist/css/ea-carousel.style.js +4 -0
  81. package/dist/css/ea-check-tag.style.js +4 -0
  82. package/dist/css/ea-checkbox-group.style.js +4 -0
  83. package/dist/css/ea-checkbox.style.js +4 -0
  84. package/dist/css/ea-col.style.js +4 -0
  85. package/dist/css/ea-collapse-item.style.js +4 -0
  86. package/dist/css/ea-collapse.style.js +4 -0
  87. package/dist/css/ea-color-picker-panel.style.js +4 -0
  88. package/dist/css/ea-color-picker.style.js +4 -0
  89. package/dist/css/ea-container.style.js +4 -0
  90. package/dist/css/ea-date-picker.style.js +4 -0
  91. package/dist/css/ea-descriptions-item.style.js +4 -0
  92. package/dist/css/ea-descriptions.style.js +4 -0
  93. package/dist/css/ea-dialog.style.js +4 -0
  94. package/dist/css/ea-drawer.style.js +4 -0
  95. package/dist/css/ea-dropdown-item.style.js +4 -0
  96. package/dist/css/ea-dropdown-menu.style.js +4 -0
  97. package/dist/css/ea-dropdown.style.js +4 -0
  98. package/dist/css/ea-empty.style.js +4 -0
  99. package/dist/css/ea-footer.style.js +4 -0
  100. package/dist/css/ea-header.style.js +4 -0
  101. package/dist/css/ea-icon.style.js +4 -0
  102. package/dist/css/ea-image-preview.style.js +4 -0
  103. package/dist/css/ea-image.style.js +4 -0
  104. package/dist/css/ea-infinite-scroll.style.js +4 -0
  105. package/dist/css/ea-input-number.style.js +4 -0
  106. package/dist/css/ea-input.style.js +4 -0
  107. package/dist/css/ea-link.style.js +4 -0
  108. package/dist/css/ea-main.style.js +4 -0
  109. package/dist/css/ea-menu-item-group.style.js +4 -0
  110. package/dist/css/ea-menu-item.style.js +4 -0
  111. package/dist/css/ea-menu.style.js +4 -0
  112. package/dist/css/ea-message-box.style.js +4 -0
  113. package/dist/css/ea-message.style.js +4 -0
  114. package/dist/css/ea-notification.style.js +4 -0
  115. package/dist/css/ea-option-gropu.style.js +4 -0
  116. package/dist/css/ea-option.style.js +4 -0
  117. package/dist/css/ea-overlay.style.js +4 -0
  118. package/dist/css/ea-page-header.style.js +4 -0
  119. package/dist/css/ea-pagination.style.js +4 -0
  120. package/dist/css/ea-popconfirm.style.js +4 -0
  121. package/dist/css/ea-popover.style.js +4 -0
  122. package/dist/css/ea-popper.style.js +4 -0
  123. package/dist/css/ea-progress.style.js +4 -0
  124. package/dist/css/ea-radio-group.style.js +4 -0
  125. package/dist/css/ea-radio.style.js +4 -0
  126. package/dist/css/ea-rate.style.js +4 -0
  127. package/dist/css/ea-result.style.js +4 -0
  128. package/dist/css/ea-row.style.js +4 -0
  129. package/dist/css/ea-scrollbar.style.js +4 -0
  130. package/dist/css/ea-segmented.style.js +4 -0
  131. package/dist/css/ea-select.style.js +4 -0
  132. package/dist/css/ea-skeleton-item.style.js +4 -0
  133. package/dist/css/ea-skeleton.style.js +4 -0
  134. package/dist/css/ea-slider.style.js +4 -0
  135. package/dist/css/ea-space.style.js +4 -0
  136. package/dist/css/ea-splitter-bar.style.js +4 -0
  137. package/dist/css/ea-splitter-panel.style.js +4 -0
  138. package/dist/css/ea-splitter.style.js +4 -0
  139. package/dist/css/ea-statistic.style.js +4 -0
  140. package/dist/css/ea-step.style.js +4 -0
  141. package/dist/css/ea-steps.style.js +4 -0
  142. package/dist/css/ea-sub-menu.style.js +4 -0
  143. package/dist/css/ea-switch.style.js +4 -0
  144. package/dist/css/ea-tab-panel.style.js +4 -0
  145. package/dist/css/ea-tab.style.js +4 -0
  146. package/dist/css/ea-table-column.style.js +4 -0
  147. package/dist/css/ea-table.style.js +4 -0
  148. package/dist/css/ea-tabs.style.js +4 -0
  149. package/dist/css/ea-tag.style.js +4 -0
  150. package/dist/css/ea-text.style.js +4 -0
  151. package/dist/css/ea-time-picker.style.js +4 -0
  152. package/dist/css/ea-timeline-item.style.js +4 -0
  153. package/dist/css/ea-timeline.style.js +4 -0
  154. package/dist/css/ea-tooltip.style.js +4 -0
  155. package/dist/css/ea-tour-step.style.js +4 -0
  156. package/dist/css/ea-tour.style.js +4 -0
  157. package/dist/css/ea-transfer.style.js +5 -0
  158. package/dist/css/ea-tree.style.js +6 -0
  159. package/dist/css/ea-ui-component.style.js +4 -0
  160. package/dist/favicon.ico +0 -0
  161. package/dist/utils/Color.js +439 -0
  162. package/dist/utils/I18nManager.js +218 -0
  163. package/dist/utils/Utils.js +65 -0
  164. package/dist/utils/Variables.js +12 -0
  165. package/dist/utils/parseTime.js +73 -0
  166. package/dist/utils/timeout.js +9 -0
  167. package/package.json +1 -1
@@ -0,0 +1,121 @@
1
+ var b = Object.defineProperty;
2
+ var y = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var g = (e, s, t) => s in e ? b(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
6
+ var f = (e, s, t) => g(e, typeof s != "symbol" ? s + "" : s, t), v = (e, s, t) => s.has(e) || y("Cannot " + t);
7
+ var a = (e, s, t) => (v(e, s, "read from private field"), t ? t.call(e) : s.get(e)), o = (e, s, t) => s.has(e) ? y("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), h = (e, s, t, l) => (v(e, s, "write to private field"), l ? l.call(e, t) : s.set(e, t), t);
8
+ import { B as E } from "./Base.js";
9
+ import { s as _ } from "../css/ea-card.style.js";
10
+ var c, i, n, r, d, p;
11
+ class S extends E {
12
+ constructor() {
13
+ super();
14
+ /** @type {HTMLElement} */
15
+ o(this, c);
16
+ /** @type {HTMLElement} */
17
+ o(this, i);
18
+ /** @type {HTMLElement} */
19
+ o(this, n);
20
+ /** @type {AbortController} */
21
+ o(this, r, null);
22
+ o(this, d, {
23
+ isHeaderEmpty: !0,
24
+ isFooterEmpty: !0
25
+ });
26
+ f(this, "state", this.properties({
27
+ shadow: {
28
+ type: ["always", "never", "hover"],
29
+ default: "always",
30
+ observer: () => {
31
+ this.updateContainerClasslist();
32
+ }
33
+ },
34
+ header: {
35
+ type: String,
36
+ default: "",
37
+ observer: (t) => {
38
+ a(this, i).innerText = t;
39
+ }
40
+ },
41
+ footer: {
42
+ type: String,
43
+ default: "",
44
+ observer: (t) => {
45
+ a(this, n).innerText = t;
46
+ }
47
+ }
48
+ }));
49
+ /**
50
+ * 更新空状态
51
+ * @param {Event} e 事件
52
+ */
53
+ o(this, p, (t) => {
54
+ const l = t.target;
55
+ let m = l.getAttribute("name") || "";
56
+ m = m.split("").map(
57
+ (u, C) => C === 0 ? u.toUpperCase() : u.toLowerCase()
58
+ ).join("");
59
+ const w = l.assignedElements().length === 0;
60
+ a(this, d)[`is${m}Empty`] = w, this.updateContainerClasslist();
61
+ });
62
+ this.stylesheet = _, this.$render();
63
+ }
64
+ static get observedAttributes() {
65
+ return [...super.observedAttributes, "shadow", "header", "footer"];
66
+ }
67
+ /**
68
+ * 获取 classlist 列表
69
+ * @return {string} 属性值
70
+ */
71
+ updateContainerClasslist() {
72
+ const t = this.computedClasslist(
73
+ "ea-card",
74
+ {
75
+ [`--${this.shadow}-shadow`]: this.shadow
76
+ },
77
+ // 因为在 vue 下,某些场景会出现 css 的 ::slotted 选择器无效,因此这里使用 js 来更新空状态
78
+ {
79
+ "header-empty": a(this, d).isHeaderEmpty,
80
+ "footer-empty": a(this, d).isFooterEmpty
81
+ }
82
+ );
83
+ return a(this, c).className = t, t;
84
+ }
85
+ $render() {
86
+ this.shadowRoot.innerHTML = `
87
+ <div class="ea-card" part="container">
88
+ <div class="ea-card__header" part="header">
89
+ <slot name="header"></slot>
90
+ </div>
91
+ <div class="ea-card__content" part="content">
92
+ <slot></slot>
93
+ </div>
94
+ <div class="ea-card__footer" part="footer">
95
+ <slot name="footer"></slot>
96
+ </div>
97
+ </div>
98
+ `, h(this, c, this.shadowRoot.querySelector(".ea-card")), h(this, i, this.shadowRoot.querySelector(
99
+ ".ea-card__header > slot[name='header']"
100
+ )), h(this, n, this.shadowRoot.querySelector(
101
+ ".ea-card__footer > slot[name='footer']"
102
+ )), this.updateContainerClasslist();
103
+ }
104
+ connectedCallback() {
105
+ var t;
106
+ super.connectedCallback(), (t = a(this, r)) == null || t.abort(), h(this, r, new AbortController()), a(this, i).addEventListener("slotchange", a(this, p), {
107
+ signal: a(this, r).signal
108
+ }), a(this, n).addEventListener("slotchange", a(this, p), {
109
+ signal: a(this, r).signal
110
+ });
111
+ }
112
+ $beforeUnmounted() {
113
+ var t;
114
+ (t = a(this, r)) == null || t.abort();
115
+ }
116
+ }
117
+ c = new WeakMap(), i = new WeakMap(), n = new WeakMap(), r = new WeakMap(), d = new WeakMap(), p = new WeakMap();
118
+ window.customElements.get("ea-card") || window.customElements.define("ea-card", S);
119
+ export {
120
+ S as EaCard
121
+ };
@@ -0,0 +1,415 @@
1
+ var j = Object.defineProperty;
2
+ var B = (r) => {
3
+ throw TypeError(r);
4
+ };
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
+ 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
+ static get observedAttributes() {
13
+ return [...super.observedAttributes];
14
+ }
15
+ constructor() {
16
+ super(), this.stylesheet = W, this.$render();
17
+ }
18
+ $render() {
19
+ this.shadowRoot.innerHTML = `
20
+ <div class='ea-carousel-item' part='container'>
21
+ <slot></slot>
22
+ </div>
23
+ `;
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ }
28
+ }
29
+ window.customElements.get("ea-carousel-item") || window.customElements.define("ea-carousel-item", Y);
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
+ class F extends N {
32
+ constructor() {
33
+ super();
34
+ a(this, o);
35
+ /** @type {HTMLElement} */
36
+ a(this, b);
37
+ /** @type {HTMLElement} */
38
+ a(this, w);
39
+ /** @type {HTMLElement} */
40
+ a(this, _);
41
+ /** @type {HTMLElement} */
42
+ a(this, S);
43
+ /** @type {HTMLElement} */
44
+ a(this, f);
45
+ /** @type {HTMLElement[]} */
46
+ a(this, p, []);
47
+ /** @type {AbortController} */
48
+ a(this, u);
49
+ a(this, d, {
50
+ triggerAbortControllers: new AbortController()
51
+ });
52
+ /** @type {MutationObserver | null} */
53
+ a(this, v, null);
54
+ a(this, i, {
55
+ prevIndex: 0,
56
+ originLength: 0,
57
+ timer: null,
58
+ pause: !1,
59
+ isMouseEnter: !1,
60
+ isEnd: !1,
61
+ isProcessingSlotChange: !1
62
+ });
63
+ T(this, "state", this.properties({
64
+ height: {
65
+ type: String,
66
+ default: "100%",
67
+ observer: (e) => {
68
+ this.style.setProperty("--ea-carousel-height", e);
69
+ }
70
+ },
71
+ direction: {
72
+ type: ["horizontal", "vertical"],
73
+ default: "horizontal",
74
+ observer: () => {
75
+ this.updateContainerClasslist();
76
+ }
77
+ },
78
+ index: {
79
+ type: Number,
80
+ default: 0,
81
+ observer: (e, s) => {
82
+ if (t(this, A).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", {
84
+ detail: {
85
+ current: e,
86
+ prev: s
87
+ }
88
+ });
89
+ }
90
+ },
91
+ trigger: {
92
+ type: ["click", "hover"],
93
+ default: "hover",
94
+ /** @param {'click' | 'hover'} newVal */
95
+ observer: (e) => {
96
+ var s;
97
+ (s = t(this, d).triggerAbortControllers) == null || s.abort(), t(this, d).triggerAbortControllers = new AbortController(), t(this, f).addEventListener(
98
+ e === "hover" ? "mouseover" : "click",
99
+ t(this, M),
100
+ {
101
+ signal: t(this, d).triggerAbortControllers.signal
102
+ }
103
+ );
104
+ }
105
+ },
106
+ interval: {
107
+ type: Number,
108
+ default: 3e3,
109
+ observer: () => {
110
+ h(this, o, m).call(this), this.autoplay && h(this, o, C).call(this);
111
+ }
112
+ },
113
+ arrow: {
114
+ type: ["never", "always", "hover"],
115
+ default: "hover",
116
+ observer: () => {
117
+ this.updateContainerClasslist();
118
+ }
119
+ },
120
+ autoplay: {
121
+ type: Boolean,
122
+ default: !0,
123
+ observer: (e) => {
124
+ h(this, o, m).call(this), e && h(this, o, C).call(this);
125
+ }
126
+ },
127
+ loop: {
128
+ type: Boolean,
129
+ default: !0,
130
+ observer: () => {
131
+ }
132
+ },
133
+ "pause-on-hover": {
134
+ type: Boolean,
135
+ default: !0,
136
+ observer: () => {
137
+ }
138
+ },
139
+ "indicator-position": {
140
+ type: ["", "none", "outside"],
141
+ default: "",
142
+ observer: () => {
143
+ this.updateContainerClasslist();
144
+ }
145
+ }
146
+ }));
147
+ /**
148
+ * 处理 index 溢出的情况
149
+ * @return {number}
150
+ */
151
+ a(this, q, () => this.index === t(this, p).length ? 0 : this.index === -1 ? t(this, p).length - 1 : this.index);
152
+ /**
153
+ * 渲染 轮播图指示器,为了避免vue组件缓存,所以在初始化和组件挂载时都进行渲染
154
+ */
155
+ a(this, E, () => {
156
+ const e = Array.from(
157
+ this.querySelectorAll("ea-carousel-item:not([slot])"),
158
+ (s, l) => `<button class='ea-carousel__indicator' part='indicator' tabindex="1" data-index="${l}"></button>`
159
+ ).join("");
160
+ t(this, f).innerHTML = e, g(this, p, [
161
+ ...t(this, f).querySelectorAll(".ea-carousel__indicator")
162
+ ]);
163
+ });
164
+ /**
165
+ * 更新轮播图位置
166
+ * @param {number} index
167
+ */
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;
170
+ this.style.setProperty(
171
+ "--ea-carousel-transform",
172
+ `translate${c}(-${(e + 1) * y}px)`
173
+ ), t(this, I).call(this);
174
+ });
175
+ /**
176
+ * 更新指示器位置
177
+ */
178
+ a(this, I, () => {
179
+ t(this, p).forEach((e, s) => {
180
+ e.classList.toggle("is-active", s === t(this, q).call(this));
181
+ });
182
+ });
183
+ /**
184
+ * 开启轮播图过渡属性
185
+ */
186
+ a(this, x, () => {
187
+ this.clientHeight, this.style.removeProperty("--ea-carousel-transition");
188
+ });
189
+ /**
190
+ * 关闭轮播图过渡属性
191
+ */
192
+ a(this, L, () => {
193
+ this.style.setProperty("--ea-carousel-transition", "none"), this.clientHeight;
194
+ });
195
+ /**
196
+ * 指示器 处理事件,需要按照 `this.trigger` 来确定事件名
197
+ * @param {MouseEvent} e
198
+ */
199
+ a(this, M, (e) => {
200
+ const s = t(this, f).querySelectorAll(
201
+ ".ea-carousel__indicator"
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);
205
+ });
206
+ });
207
+ /**
208
+ * 轮播图切换结束事件,即能确保轮播图在视觉上连续
209
+ */
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;
212
+ });
213
+ /**
214
+ * 箭头显示事件
215
+ */
216
+ a(this, P, () => {
217
+ const e = () => {
218
+ t(this, i).isMouseEnter = !1, this["pause-on-hover"] && h(this, o, C).call(this), this.updateContainerClasslist();
219
+ };
220
+ t(this, i).isMouseEnter = !0, this["pause-on-hover"] && h(this, o, m).call(this), this.updateContainerClasslist(), t(this, b).addEventListener("mouseleave", e, {
221
+ signal: t(this, u).signal,
222
+ once: !0
223
+ });
224
+ });
225
+ /**
226
+ * 当窗口大小变化时,更新轮播图位置
227
+ */
228
+ a(this, k, () => {
229
+ let e = null;
230
+ return {
231
+ listener: () => {
232
+ clearTimeout(e), e = null, e = setTimeout(() => {
233
+ t(this, A).call(this, this.index);
234
+ }, 100);
235
+ },
236
+ unsetHandler: () => {
237
+ clearTimeout(e), e = null;
238
+ }
239
+ };
240
+ });
241
+ /**
242
+ * 处理 slotchange 事件,当 slot 内容变化时重新渲染
243
+ */
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;
247
+ }));
248
+ });
249
+ /**
250
+ * 上一张轮播图
251
+ */
252
+ T(this, "prev", () => {
253
+ t(this, i).pause || (this.index--, t(this, i).pause = !0);
254
+ });
255
+ /**
256
+ * 下一张轮播图
257
+ */
258
+ T(this, "next", () => {
259
+ t(this, i).pause || (this.index++, t(this, i).pause = !0);
260
+ });
261
+ this.stylesheet = X, this.$render();
262
+ }
263
+ static get observedAttributes() {
264
+ return [
265
+ ...super.observedAttributes,
266
+ "height",
267
+ "index",
268
+ "trigger",
269
+ "autoplay",
270
+ "interval",
271
+ "indicator-position",
272
+ "arrow",
273
+ // "type",
274
+ // "card-scale",
275
+ "loop",
276
+ "direction",
277
+ "pause-on-hover"
278
+ // "motion-blur",
279
+ ];
280
+ }
281
+ /**
282
+ * 获取 classlist 列表
283
+ * @return {string} 属性值
284
+ */
285
+ updateContainerClasslist() {
286
+ const e = this.computedClasslist(
287
+ "ea-carousel",
288
+ {
289
+ ["--" + this.direction]: this.direction
290
+ },
291
+ {
292
+ ["arrow-" + this.arrow]: this.arrow === "always" || this.arrow === "never" || t(this, i).isMouseEnter,
293
+ [this["indicator-position"] + "-indicator"]: this["indicator-position"]
294
+ }
295
+ );
296
+ return t(this, b).className = e, e;
297
+ }
298
+ $render() {
299
+ this.shadowRoot.innerHTML = `
300
+ <div class='ea-carousel' part='container'>
301
+ <button class="ea-carousel__arrow arrow-left" part="arrow-left">
302
+ <ea-icon name="angle-left" part="arrow-left-icon"></ea-icon>
303
+ </button>
304
+ <button class="ea-carousel__arrow arrow-right" part="arrow-right">
305
+ <ea-icon name="angle-right" part="arrow-right-icon"></ea-icon>
306
+ </button>
307
+ <ul class="ea-carousel__content" part="content">
308
+ <slot name="clone-last"></slot>
309
+ <slot></slot>
310
+ <slot name="clone-first"></slot>
311
+ </ul>
312
+ <footer class="ea-carousel__indicator-wrap" part="indicator-wrap">
313
+
314
+ </footer>
315
+ </div>
316
+ `, g(this, b, this.shadowRoot.querySelector(".ea-carousel")), g(this, w, this.shadowRoot.querySelector(".ea-carousel__content")), g(this, f, this.shadowRoot.querySelector(
317
+ ".ea-carousel__indicator-wrap"
318
+ )), g(this, _, this.shadowRoot.querySelector(
319
+ ".ea-carousel__arrow.arrow-left"
320
+ )), g(this, S, this.shadowRoot.querySelector(
321
+ ".ea-carousel__arrow.arrow-right"
322
+ )), t(this, E).call(this), this.updateContainerClasslist();
323
+ }
324
+ connectedCallback() {
325
+ var e, s;
326
+ super.connectedCallback(), (e = t(this, u)) == null || e.abort(), g(this, u, new AbortController());
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(
330
+ this.trigger === "hover" ? "mouseover" : "click",
331
+ t(this, M),
332
+ {
333
+ signal: t(this, d).triggerAbortControllers.signal
334
+ }
335
+ ), t(this, w).addEventListener(
336
+ "transitionend",
337
+ t(this, H),
338
+ { signal: t(this, u).signal }
339
+ ), this.arrow !== "never" && this.direction !== "vertical" && (t(this, _).addEventListener("click", this.prev, {
340
+ signal: t(this, u).signal
341
+ }), t(this, S).addEventListener("click", this.next, {
342
+ signal: t(this, u).signal
343
+ })), t(this, b).addEventListener("mouseenter", t(this, P), {
344
+ signal: t(this, u).signal
345
+ }), window.addEventListener("resize", t(this, k).call(this).listener, {
346
+ signal: t(this, u).signal
347
+ }), t(this, w).querySelector("slot:not([name])").addEventListener("slotchange", t(this, R), {
348
+ signal: t(this, u).signal
349
+ }), queueMicrotask(() => {
350
+ t(this, x).call(this);
351
+ });
352
+ }
353
+ $beforeUnmounted() {
354
+ var e, s, l, c;
355
+ (e = t(this, u)) == null || e.abort();
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);
359
+ }
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(), /**
362
+ * 初始化 `轮播图元素` 结构
363
+ */
364
+ z = function() {
365
+ try {
366
+ const e = this.querySelectorAll("ea-carousel-item:not([slot])");
367
+ if (e.length === 0) return;
368
+ t(this, i).originLength = e.length, this.querySelectorAll(
369
+ 'ea-carousel-item[slot^="clone-"]'
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);
374
+ });
375
+ } catch {
376
+ }
377
+ }, /**
378
+ * 设置 MutationObserver 监听 item 内容变化
379
+ */
380
+ O = function() {
381
+ t(this, v) && t(this, v).disconnect(), g(this, v, new MutationObserver((s) => {
382
+ s.some((c) => c.type === "childList" && c.target.closest("ea-carousel-item:not([slot])")) && h(this, o, U).call(this);
383
+ })), this.querySelectorAll("ea-carousel-item:not([slot])").forEach((s) => {
384
+ t(this, v).observe(s, {
385
+ childList: !0,
386
+ subtree: !0,
387
+ characterData: !0
388
+ });
389
+ });
390
+ }, /**
391
+ * 同步克隆节点的内容
392
+ */
393
+ U = function() {
394
+ const e = this.querySelectorAll("ea-carousel-item:not([slot])");
395
+ if (e.length === 0) return;
396
+ const s = this.querySelector(
397
+ 'ea-carousel-item[slot="clone-first"]'
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(), /**
401
+ * 清除轮播图自动播放
402
+ */
403
+ m = function() {
404
+ t(this, i).timer && (clearInterval(t(this, i).timer), t(this, i).timer = null);
405
+ }, /**
406
+ * 处理轮播图自动播放
407
+ */
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();
411
+ window.customElements.get("ea-carousel") || window.customElements.define("ea-carousel", F);
412
+ export {
413
+ F as EaCarousel,
414
+ Y as EaCarouselItem
415
+ };