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,503 @@
1
+ var K = Object.defineProperty;
2
+ var j = (i) => {
3
+ throw TypeError(i);
4
+ };
5
+ var Q = (i, o, t) => o in i ? K(i, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[o] = t;
6
+ var q = (i, o, t) => Q(i, typeof o != "symbol" ? o + "" : o, t), F = (i, o, t) => o.has(i) || j("Cannot " + t);
7
+ var e = (i, o, t) => (F(i, o, "read from private field"), t ? t.call(i) : o.get(i)), a = (i, o, t) => o.has(i) ? j("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, t), h = (i, o, t, s) => (F(i, o, "write to private field"), s ? s.call(i, t) : o.set(i, t), t);
8
+ import { B as U } from "./Base.js";
9
+ import { s as X } from "../css/ea-tab.style.js";
10
+ import { s as Y } from "../css/ea-tabs.style.js";
11
+ import { t as G } from "../utils/timeout.js";
12
+ import { s as Z } from "../css/ea-tab-panel.style.js";
13
+ var d, v, _, S, p, x;
14
+ class V extends U {
15
+ constructor() {
16
+ super();
17
+ a(this, d);
18
+ /** @type {HTMLElement} */
19
+ a(this, _);
20
+ /** @type {HTMLElement} */
21
+ a(this, S);
22
+ /** @type {AbortController} */
23
+ a(this, p, new AbortController());
24
+ q(this, "state", this.properties({
25
+ panel: {
26
+ type: String,
27
+ default: "",
28
+ observer: () => {
29
+ }
30
+ },
31
+ type: {
32
+ type: ["", "card", "border-card"],
33
+ default: () => {
34
+ var t;
35
+ return ((t = e(this, d, v)) == null ? void 0 : t.getAttribute("type")) || "";
36
+ },
37
+ observer: () => {
38
+ this.updateContainerClasslist();
39
+ }
40
+ },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: !1,
44
+ observer: () => {
45
+ this.updateContainerClasslist();
46
+ }
47
+ },
48
+ active: {
49
+ type: Boolean,
50
+ default: !1,
51
+ observer: () => {
52
+ this.updateContainerClasslist();
53
+ }
54
+ },
55
+ "tab-position": {
56
+ type: ["", "card", "border-card"],
57
+ default: () => {
58
+ var t;
59
+ return ((t = e(this, d, v)) == null ? void 0 : t.getAttribute("tab-position")) || "top";
60
+ },
61
+ observer: () => {
62
+ this.updateContainerClasslist();
63
+ }
64
+ },
65
+ editable: {
66
+ type: Boolean,
67
+ default: !1,
68
+ observer: () => {
69
+ this.updateContainerClasslist();
70
+ }
71
+ },
72
+ closable: {
73
+ type: Boolean,
74
+ default: !1,
75
+ observer: () => {
76
+ this.updateContainerClasslist();
77
+ }
78
+ }
79
+ }));
80
+ /**
81
+ * 关闭事件,为了避免click事件优先触发。
82
+ * @param {MouseEvent} e
83
+ */
84
+ a(this, x, (t) => {
85
+ t.preventDefault(), t.stopImmediatePropagation(), this.emit("ea-tab-close-icon-click", {
86
+ detail: {
87
+ panel: this.panel
88
+ },
89
+ bubbles: !0
90
+ });
91
+ });
92
+ this.stylesheet = X, this.$render();
93
+ }
94
+ static get observedAttributes() {
95
+ return [
96
+ ...super.observedAttributes,
97
+ "panel",
98
+ "type",
99
+ "disabled",
100
+ "active",
101
+ "tab-position",
102
+ "editable",
103
+ "closable"
104
+ ];
105
+ }
106
+ /**
107
+ * 获取 classlist 列表
108
+ * @return {string} 属性值
109
+ */
110
+ updateContainerClasslist() {
111
+ var l, n, c;
112
+ let t = (l = e(this, d, v)) == null ? void 0 : l.querySelectorAll("ea-tab");
113
+ t = (t == null ? void 0 : t.length) > 0 ? [...t] : [];
114
+ const s = this.computedClasslist(
115
+ "ea-tab",
116
+ {
117
+ ["--" + this.type]: this.type === ((n = e(this, d, v)) == null ? void 0 : n.getAttribute("type")) || "",
118
+ ["--" + this["tab-position"]]: this["tab-position"] === ((c = e(this, d, v)) == null ? void 0 : c.getAttribute("tab-position")) || "top"
119
+ },
120
+ {
121
+ disabled: this.disabled,
122
+ active: this.active,
123
+ last: t.slice(-1)[0] === this,
124
+ first: t.slice(0)[0] === this,
125
+ closable: this.closable ? this.closable : this.editable
126
+ }
127
+ );
128
+ return e(this, _).className = s, s;
129
+ }
130
+ $render() {
131
+ this.shadowRoot.innerHTML = `
132
+ <div class='ea-tab' part='container'>
133
+ <slot></slot>
134
+ <ea-icon class="ea-tab__close-icon" name="xmark" part="close-icon"></ea-icon>
135
+ </div>
136
+ `, h(this, _, this.shadowRoot.querySelector(".ea-tab")), h(this, S, this.shadowRoot.querySelector(".ea-tab__close-icon")), this.updateContainerClasslist();
137
+ }
138
+ connectedCallback() {
139
+ var t;
140
+ super.connectedCallback(), (t = e(this, p)) == null || t.abort(), h(this, p, new AbortController()), e(this, S).addEventListener("click", e(this, x), {
141
+ signal: e(this, p).signal
142
+ });
143
+ }
144
+ $beforeUnmounted() {
145
+ e(this, p).abort();
146
+ }
147
+ }
148
+ d = new WeakSet(), v = function() {
149
+ try {
150
+ return this.closest("ea-tabs");
151
+ } catch {
152
+ return null;
153
+ }
154
+ }, _ = new WeakMap(), S = new WeakMap(), p = new WeakMap(), x = new WeakMap();
155
+ window.customElements.get("ea-tab") || window.customElements.define("ea-tab", V);
156
+ var E, u, f, r, m, g, L, k, y, b, C, $, N, A, B, H, w, P, I, W, O;
157
+ class tt extends U {
158
+ constructor() {
159
+ super();
160
+ /** @type {HTMLElement} */
161
+ a(this, E);
162
+ /** @type {HTMLElement} */
163
+ a(this, u);
164
+ /** @type {HTMLElement} */
165
+ a(this, f);
166
+ /** @type {HTMLElement} */
167
+ a(this, r);
168
+ /** @type {HTMLSlotElement} */
169
+ a(this, m);
170
+ /** @type {HTMLElement} */
171
+ a(this, g);
172
+ /** @type {HTMLElement} */
173
+ a(this, L);
174
+ /** @type {HTMLElement} */
175
+ a(this, k);
176
+ /** @type {HTMLSlotElement} */
177
+ a(this, y);
178
+ /** @type {AbortController} */
179
+ a(this, b, new AbortController());
180
+ /** @type {ResizeObserver} */
181
+ a(this, C);
182
+ q(this, "state", this.properties({
183
+ type: {
184
+ type: ["", "card", "border-card"],
185
+ default: "",
186
+ observer: (t) => {
187
+ this.updateContainerClasslist(), [...e(this, y).assignedElements()].filter(
188
+ (s) => s.tagName.toLowerCase() === "ea-tab-panel" || s.tagName.toLowerCase() === "ea-tab"
189
+ ).forEach((s) => s.setAttribute("type", t));
190
+ }
191
+ },
192
+ active: {
193
+ type: String,
194
+ default: () => {
195
+ const t = this.getAttribute("active");
196
+ if (t)
197
+ return t;
198
+ {
199
+ const s = this.querySelector("ea-tab");
200
+ return s ? s.getAttribute("panel") : "";
201
+ }
202
+ },
203
+ observer: (t) => {
204
+ e(this, A).call(this, t), this.emit("tabs-change", {
205
+ name: t
206
+ });
207
+ }
208
+ },
209
+ "tab-position": {
210
+ type: ["top", "bottom", "left", "right"],
211
+ default: "top",
212
+ observer: (t) => {
213
+ this.updateContainerClasslist(), e(this, H).call(this, t), e(this, A).call(this, this.active), [...e(this, m).assignedElements()].filter(
214
+ (s) => s.tagName.toLowerCase() === "ea-tab-panel" || s.tagName.toLowerCase() === "ea-tab"
215
+ ).forEach((s) => s.setAttribute("tab-position", t));
216
+ }
217
+ },
218
+ editable: {
219
+ type: Boolean,
220
+ default: !1,
221
+ observer: () => {
222
+ }
223
+ }
224
+ }));
225
+ /**
226
+ * 更新指示器位置
227
+ * @param {HTMLElement} tabEl
228
+ * @param {HTMLElement} lineEl
229
+ * @param {HTMLElement} tabPosition
230
+ */
231
+ a(this, $, (t, s = e(this, g), l = this["tab-position"]) => {
232
+ const n = l === "top" || l === "bottom", c = t.getBoundingClientRect(), T = s.getBoundingClientRect();
233
+ this.style.setProperty(
234
+ "--ea-tabs-indicator-size",
235
+ `${n ? t.offsetWidth : t.offsetHeight}px`
236
+ ), this.style.setProperty(
237
+ "--ea-tabs-indicator-x",
238
+ `${n ? c.x - T.x : c.y - T.y}px`
239
+ );
240
+ });
241
+ /**
242
+ * 更新指示器位置
243
+ * @param {HTMLElement} tabEl
244
+ * @param {HTMLElement} [lineEl]
245
+ * @param {HTMLElement} [tabPosition]
246
+ */
247
+ a(this, N, (t, s = e(this, g), l = this["tab-position"]) => {
248
+ const n = t.getBoundingClientRect();
249
+ e(this, r).scrollTo({
250
+ left: t.offsetLeft + n.width,
251
+ top: t.offsetTop + n.height,
252
+ behavior: "smooth"
253
+ });
254
+ });
255
+ /**
256
+ * 更新 tab 激活状态
257
+ * @param {String} activeName
258
+ */
259
+ a(this, A, (t = this.active) => {
260
+ const s = [...this.querySelectorAll("ea-tab-panel")];
261
+ [...this.querySelectorAll("ea-tab")].forEach((n) => {
262
+ const c = n.getAttribute("panel") === t;
263
+ n.toggleAttribute("active", c), c && this.type === "" && e(this, $).call(this, n), c && e(this, N).call(this, n);
264
+ }), s.forEach((n) => {
265
+ n.toggleAttribute(
266
+ "active",
267
+ t === n.getAttribute("name")
268
+ );
269
+ });
270
+ });
271
+ /**
272
+ * 更新 tab 是否为可编辑状态
273
+ * @param {Boolean} isEditable
274
+ */
275
+ a(this, B, (t = this.editable) => {
276
+ this.querySelectorAll("ea-tab").forEach((s) => {
277
+ s.toggleAttribute("editable", t);
278
+ });
279
+ });
280
+ /**
281
+ * @param {"top" | "bottom" | "left" | "right"} tabPosition
282
+ */
283
+ a(this, H, (t = this["tab-position"]) => {
284
+ t === "left" || t === "right" ? (e(this, u).setAttribute("name", "arrow-left"), e(this, f).setAttribute("name", "arrow-right")) : (t === "top" || t === "bottom") && (e(this, u).setAttribute("name", "arrow-up"), e(this, f).setAttribute("name", "arrow-down"));
285
+ });
286
+ /**
287
+ * 当 tab slot 内容变化时触发
288
+ * @param {Event} e
289
+ */
290
+ a(this, w, () => {
291
+ [...this.querySelectorAll("ea-tab")].forEach((s) => {
292
+ s.setAttribute("slot", "nav");
293
+ try {
294
+ s.updateContainerClasslist();
295
+ } catch {
296
+ }
297
+ }), e(this, A).call(this, this.active), e(this, B).call(this, this.editable), this.updateContainerClasslist(), G(() => {
298
+ const s = [...this.querySelectorAll("ea-tab")].find(
299
+ (n) => n.hasAttribute("active")
300
+ );
301
+ if (!s) return;
302
+ const l = s.getBoundingClientRect();
303
+ e(this, r).scrollTo({
304
+ left: s.offsetLeft + l.width,
305
+ top: s.offsetTop + l.height,
306
+ behavior: "smooth"
307
+ });
308
+ }, 0);
309
+ });
310
+ /**
311
+ * 标签切换事件
312
+ * @param {MouseEvent} e
313
+ */
314
+ a(this, P, (t) => {
315
+ const s = t.target.closest("ea-tab");
316
+ if (!s || s != null && s.hasAttribute("disabled")) return;
317
+ const l = s.getAttribute("panel");
318
+ this.active = l, this.emit("tab-click", {
319
+ detail: {
320
+ name: l,
321
+ panel: this.querySelector(`ea-tab-panel[name="${l}"]`)
322
+ },
323
+ bubbles: !0
324
+ });
325
+ });
326
+ /**
327
+ * 滚动至上一视口
328
+ */
329
+ a(this, I, () => {
330
+ e(this, r).scrollTo({
331
+ left: e(this, r).scrollLeft - e(this, r).offsetWidth,
332
+ top: e(this, r).scrollTop - e(this, r).offsetHeight,
333
+ behavior: "smooth"
334
+ });
335
+ });
336
+ /**
337
+ * 滚动至下一视口
338
+ */
339
+ a(this, W, () => {
340
+ e(this, r).scrollTo({
341
+ left: e(this, r).scrollLeft + e(this, r).offsetWidth,
342
+ top: e(this, r).scrollTop + e(this, r).offsetHeight,
343
+ behavior: "smooth"
344
+ });
345
+ });
346
+ /**
347
+ * 删除标签
348
+ * @param {CustomEvent} e
349
+ */
350
+ a(this, O, (t) => {
351
+ t.preventDefault(), t.stopImmediatePropagation();
352
+ const s = t.detail.panel, l = [...this.querySelectorAll("ea-tab")], n = t.target, c = l.indexOf(n), T = this.querySelector(`ea-tab-panel[name="${s}"]`), D = [...this.querySelectorAll("ea-tab")][c - 1 < 0 ? 0 : c - 1].getAttribute("panel");
353
+ this.setAttribute("active", D), T.remove(), n.remove(), this.emit("tab-remove", {
354
+ detail: {
355
+ name: D
356
+ }
357
+ });
358
+ });
359
+ this.stylesheet = Y, this.$render();
360
+ }
361
+ static get observedAttributes() {
362
+ return [
363
+ ...super.observedAttributes,
364
+ "type",
365
+ "active",
366
+ "tab-position",
367
+ "editable"
368
+ ];
369
+ }
370
+ /**
371
+ * 获取 classlist 列表
372
+ * @return {string} 属性值
373
+ */
374
+ updateContainerClasslist() {
375
+ const t = e(this, r).scrollWidth > e(this, r).clientWidth || e(this, r).scrollHeight > e(this, r).clientHeight, s = this.computedClasslist(
376
+ "ea-tabs",
377
+ {
378
+ ["--" + this.type]: this.type,
379
+ ["--" + this["tab-position"]]: this["tab-position"]
380
+ },
381
+ {
382
+ overflow: t
383
+ }
384
+ );
385
+ return e(this, E).className = s, s;
386
+ }
387
+ $render() {
388
+ this.shadowRoot.innerHTML = `
389
+ <div class='ea-tabs' part='container'>
390
+ <nav class='ea-tabs__nav' part='nav'>
391
+ <ea-icon name="angle-left" class="ea-tabs__prev ea-tabs__scroll" part='prev'></ea-icon>
392
+ <slot name='nav'></slot>
393
+ <ea-icon name="angle-right" class="ea-tabs__next ea-tabs__scroll" part='next'></ea-icon>
394
+ </nav>
395
+ <div class="ea-tabs__line" part="line" tabindex="-1">
396
+ <span class="ea-tabs__indicator" part="indicator"></span>
397
+ </div>
398
+ <main class='ea-tabs__content' part='content'>
399
+ <slot></slot>
400
+ </main>
401
+ </div>
402
+ `, h(this, E, this.shadowRoot.querySelector(".ea-tabs")), h(this, u, this.shadowRoot.querySelector(".ea-tabs__prev")), h(this, f, this.shadowRoot.querySelector(".ea-tabs__next")), h(this, r, this.shadowRoot.querySelector(".ea-tabs__nav")), h(this, m, this.shadowRoot.querySelector(
403
+ ".ea-tabs__nav > slot[name=nav]"
404
+ )), h(this, g, this.shadowRoot.querySelector(".ea-tabs__line")), h(this, L, this.shadowRoot.querySelector(".ea-tabs__indicator")), h(this, k, this.shadowRoot.querySelector(".ea-tabs__content")), h(this, y, this.shadowRoot.querySelector(
405
+ ".ea-tabs__content > slot"
406
+ )), e(this, w).call(this);
407
+ }
408
+ connectedCallback() {
409
+ var t, s;
410
+ super.connectedCallback(), (t = e(this, b)) == null || t.abort(), h(this, b, new AbortController()), (s = e(this, C)) == null || s.unobserve(), e(this, r).addEventListener("click", e(this, P), {
411
+ signal: e(this, b).signal
412
+ }), e(this, m).addEventListener("slotchange", e(this, w), {
413
+ signal: e(this, b).signal
414
+ }), e(this, y).addEventListener("slotchange", e(this, w), {
415
+ signal: e(this, b).signal
416
+ }), e(this, u).addEventListener("click", e(this, I), {
417
+ signal: e(this, b).signal
418
+ }), e(this, f).addEventListener("click", e(this, W), {
419
+ signal: e(this, b).signal
420
+ }), this.addEventListener("ea-tab-close-icon-click", e(this, O), {
421
+ signal: e(this, b).signal
422
+ }), h(this, C, new ResizeObserver(() => {
423
+ this.updateContainerClasslist();
424
+ }).observe(e(this, r))), G(() => {
425
+ this.updateContainerClasslist();
426
+ }, 100);
427
+ }
428
+ $beforeUnmounted() {
429
+ var t, s;
430
+ (t = e(this, b)) == null || t.abort(), (s = e(this, C)) == null || s.unobserve();
431
+ }
432
+ }
433
+ E = new WeakMap(), u = new WeakMap(), f = new WeakMap(), r = new WeakMap(), m = new WeakMap(), g = new WeakMap(), L = new WeakMap(), k = new WeakMap(), y = new WeakMap(), b = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), N = new WeakMap(), A = new WeakMap(), B = new WeakMap(), H = new WeakMap(), w = new WeakMap(), P = new WeakMap(), I = new WeakMap(), W = new WeakMap(), O = new WeakMap();
434
+ window.customElements.get("ea-tabs") || window.customElements.define("ea-tabs", tt);
435
+ var z, J, R, M;
436
+ class et extends U {
437
+ constructor() {
438
+ super();
439
+ a(this, z);
440
+ /** @type {HTMLElement} */
441
+ a(this, R);
442
+ /** @type {AbortController} */
443
+ a(this, M, new AbortController());
444
+ q(this, "state", this.properties({
445
+ name: {
446
+ type: String,
447
+ default: "",
448
+ observer: () => {
449
+ }
450
+ },
451
+ type: {
452
+ type: ["", "card", "border-card"],
453
+ default: () => {
454
+ var t;
455
+ return ((t = e(this, z, J)) == null ? void 0 : t.getAttribute("type")) || "";
456
+ },
457
+ observer: () => {
458
+ this.updateContainerClasslist();
459
+ }
460
+ }
461
+ }));
462
+ this.stylesheet = Z, this.$render();
463
+ }
464
+ static get observedAttributes() {
465
+ return [...super.observedAttributes, "name", "type"];
466
+ }
467
+ /**
468
+ * 获取 classlist 列表
469
+ * @return {string} 属性值
470
+ */
471
+ updateContainerClasslist() {
472
+ const t = this.computedClasslist("ea-tab-panel", {
473
+ ["--" + this.type]: this.type
474
+ });
475
+ return e(this, R).className = t, t;
476
+ }
477
+ $render() {
478
+ this.shadowRoot.innerHTML = `
479
+ <div class='ea-tab-panel' part='container'>
480
+ <slot></slot>
481
+ </div>
482
+ `, h(this, R, this.shadowRoot.querySelector(".ea-tab-panel"));
483
+ }
484
+ connectedCallback() {
485
+ super.connectedCallback();
486
+ }
487
+ $beforeUnmounted() {
488
+ e(this, M).abort();
489
+ }
490
+ }
491
+ z = new WeakSet(), J = function() {
492
+ try {
493
+ return this.closest("ea-tabs");
494
+ } catch {
495
+ return null;
496
+ }
497
+ }, R = new WeakMap(), M = new WeakMap();
498
+ window.customElements.get("ea-tab-panel") || window.customElements.define("ea-tab-panel", et);
499
+ export {
500
+ V as EaTab,
501
+ et as EaTabPanel,
502
+ tt as EaTabs
503
+ };