easy-component-ui 3.0.12 → 3.0.14
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/package.json +308 -304
- package/dist/assets/icon.css +0 -1
- package/dist/components/Base.js +0 -873
- package/dist/components/ea-alert.js +0 -196
- package/dist/components/ea-avatar.js +0 -159
- package/dist/components/ea-backtop.js +0 -136
- package/dist/components/ea-badge.js +0 -144
- package/dist/components/ea-breadcrumb.js +0 -148
- package/dist/components/ea-button.js +0 -265
- package/dist/components/ea-calendar.js +0 -10
- package/dist/components/ea-calendar2.js +0 -671
- package/dist/components/ea-card.js +0 -85
- package/dist/components/ea-carousel.js +0 -415
- package/dist/components/ea-checkbox.js +0 -446
- package/dist/components/ea-collapse.js +0 -313
- package/dist/components/ea-color-picker.js +0 -891
- package/dist/components/ea-container.js +0 -177
- package/dist/components/ea-countdown.js +0 -142
- package/dist/components/ea-date-picker.js +0 -649
- package/dist/components/ea-descriptions.js +0 -474
- package/dist/components/ea-dialog.js +0 -249
- package/dist/components/ea-drawer.js +0 -211
- package/dist/components/ea-dropdown.js +0 -228
- package/dist/components/ea-empty.js +0 -93
- package/dist/components/ea-icon.js +0 -68
- package/dist/components/ea-image-preview.js +0 -488
- package/dist/components/ea-image.js +0 -302
- package/dist/components/ea-infinite-scroll.js +0 -109
- package/dist/components/ea-input-number.js +0 -367
- package/dist/components/ea-input.js +0 -588
- package/dist/components/ea-layout.js +0 -125
- package/dist/components/ea-link.js +0 -101
- package/dist/components/ea-loading.js +0 -151
- package/dist/components/ea-menu.js +0 -433
- package/dist/components/ea-message-box.js +0 -624
- package/dist/components/ea-message.js +0 -251
- package/dist/components/ea-notification.js +0 -331
- package/dist/components/ea-overlay.js +0 -167
- package/dist/components/ea-page-header.js +0 -108
- package/dist/components/ea-pagination.js +0 -481
- package/dist/components/ea-popconfirm.js +0 -275
- package/dist/components/ea-popover.js +0 -123
- package/dist/components/ea-popper.js +0 -203
- package/dist/components/ea-progress.js +0 -286
- package/dist/components/ea-radio.js +0 -364
- package/dist/components/ea-rate.js +0 -241
- package/dist/components/ea-result.js +0 -100
- package/dist/components/ea-scrollbar.js +0 -235
- package/dist/components/ea-segmented.js +0 -215
- package/dist/components/ea-select.js +0 -609
- package/dist/components/ea-skeleton.js +0 -263
- package/dist/components/ea-slider.js +0 -421
- package/dist/components/ea-space.js +0 -123
- package/dist/components/ea-splitter.js +0 -217
- package/dist/components/ea-statistic.js +0 -74
- package/dist/components/ea-steps.js +0 -346
- package/dist/components/ea-switch.js +0 -271
- package/dist/components/ea-table.js +0 -1124
- package/dist/components/ea-tabs.js +0 -501
- package/dist/components/ea-tag.js +0 -228
- package/dist/components/ea-text.js +0 -113
- package/dist/components/ea-time-picker.js +0 -514
- package/dist/components/ea-timeline.js +0 -185
- package/dist/components/ea-tooltip.js +0 -121
- package/dist/components/ea-tour.js +0 -544
- package/dist/components/ea-transfer.js +0 -949
- package/dist/components/ea-tree.js +0 -1125
- package/dist/components/index.js +0 -61
- package/dist/core/FormBase.js +0 -238
- package/dist/css/ea-alert.style.js +0 -4
- package/dist/css/ea-aside.style.js +0 -4
- package/dist/css/ea-avatar.style.js +0 -4
- package/dist/css/ea-backtop.style.js +0 -4
- package/dist/css/ea-badge.style.js +0 -4
- package/dist/css/ea-breadcrumb-item.style.js +0 -4
- package/dist/css/ea-breadcrumb.style.js +0 -4
- package/dist/css/ea-button-group.style.js +0 -4
- package/dist/css/ea-button.style.js +0 -4
- package/dist/css/ea-calendar.style.js +0 -4
- package/dist/css/ea-card.style.js +0 -4
- package/dist/css/ea-carousel-item.style.js +0 -4
- package/dist/css/ea-carousel.style.js +0 -4
- package/dist/css/ea-check-tag.style.js +0 -4
- package/dist/css/ea-checkbox-group.style.js +0 -4
- package/dist/css/ea-checkbox.style.js +0 -4
- package/dist/css/ea-col.style.js +0 -4
- package/dist/css/ea-collapse-item.style.js +0 -4
- package/dist/css/ea-collapse.style.js +0 -4
- package/dist/css/ea-color-picker-panel.style.js +0 -4
- package/dist/css/ea-color-picker.style.js +0 -4
- package/dist/css/ea-container.style.js +0 -4
- package/dist/css/ea-date-picker.style.js +0 -4
- package/dist/css/ea-descriptions-item.style.js +0 -4
- package/dist/css/ea-descriptions.style.js +0 -4
- package/dist/css/ea-dialog.style.js +0 -4
- package/dist/css/ea-drawer.style.js +0 -4
- package/dist/css/ea-dropdown-item.style.js +0 -4
- package/dist/css/ea-dropdown-menu.style.js +0 -4
- package/dist/css/ea-dropdown.style.js +0 -4
- package/dist/css/ea-empty.style.js +0 -4
- package/dist/css/ea-footer.style.js +0 -4
- package/dist/css/ea-header.style.js +0 -4
- package/dist/css/ea-icon.style.js +0 -4
- package/dist/css/ea-image-preview.style.js +0 -4
- package/dist/css/ea-image.style.js +0 -4
- package/dist/css/ea-infinite-scroll.style.js +0 -4
- package/dist/css/ea-input-number.style.js +0 -4
- package/dist/css/ea-input.style.js +0 -4
- package/dist/css/ea-link.style.js +0 -4
- package/dist/css/ea-main.style.js +0 -4
- package/dist/css/ea-menu-item-group.style.js +0 -4
- package/dist/css/ea-menu-item.style.js +0 -4
- package/dist/css/ea-menu.style.js +0 -4
- package/dist/css/ea-message-box.style.js +0 -4
- package/dist/css/ea-message.style.js +0 -4
- package/dist/css/ea-notification.style.js +0 -4
- package/dist/css/ea-option-gropu.style.js +0 -4
- package/dist/css/ea-option.style.js +0 -4
- package/dist/css/ea-overlay.style.js +0 -4
- package/dist/css/ea-page-header.style.js +0 -4
- package/dist/css/ea-pagination.style.js +0 -4
- package/dist/css/ea-popconfirm.style.js +0 -4
- package/dist/css/ea-popover.style.js +0 -4
- package/dist/css/ea-popper.style.js +0 -4
- package/dist/css/ea-progress.style.js +0 -4
- package/dist/css/ea-radio-group.style.js +0 -4
- package/dist/css/ea-radio.style.js +0 -4
- package/dist/css/ea-rate.style.js +0 -4
- package/dist/css/ea-result.style.js +0 -4
- package/dist/css/ea-row.style.js +0 -4
- package/dist/css/ea-scrollbar.style.js +0 -4
- package/dist/css/ea-segmented.style.js +0 -4
- package/dist/css/ea-select.style.js +0 -4
- package/dist/css/ea-skeleton-item.style.js +0 -4
- package/dist/css/ea-skeleton.style.js +0 -4
- package/dist/css/ea-slider.style.js +0 -4
- package/dist/css/ea-space.style.js +0 -4
- package/dist/css/ea-splitter-bar.style.js +0 -4
- package/dist/css/ea-splitter-panel.style.js +0 -4
- package/dist/css/ea-splitter.style.js +0 -4
- package/dist/css/ea-statistic.style.js +0 -4
- package/dist/css/ea-step.style.js +0 -4
- package/dist/css/ea-steps.style.js +0 -4
- package/dist/css/ea-sub-menu.style.js +0 -4
- package/dist/css/ea-switch.style.js +0 -4
- package/dist/css/ea-tab-panel.style.js +0 -4
- package/dist/css/ea-tab.style.js +0 -4
- package/dist/css/ea-table-column.style.js +0 -4
- package/dist/css/ea-table.style.js +0 -4
- package/dist/css/ea-tabs.style.js +0 -4
- package/dist/css/ea-tag.style.js +0 -4
- package/dist/css/ea-text.style.js +0 -4
- package/dist/css/ea-time-picker.style.js +0 -4
- package/dist/css/ea-timeline-item.style.js +0 -4
- package/dist/css/ea-timeline.style.js +0 -4
- package/dist/css/ea-tooltip.style.js +0 -4
- package/dist/css/ea-tour-step.style.js +0 -4
- package/dist/css/ea-tour.style.js +0 -4
- package/dist/css/ea-transfer.style.js +0 -5
- package/dist/css/ea-tree.style.js +0 -6
- package/dist/css/ea-ui-component.style.js +0 -4
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +0 -439
- package/dist/utils/I18nManager.js +0 -218
- package/dist/utils/Utils.js +0 -65
- package/dist/utils/Variables.js +0 -12
- package/dist/utils/parseTime.js +0 -73
- package/dist/utils/timeout.js +0 -9
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
var I = Object.defineProperty;
|
|
2
|
-
var R = (s) => {
|
|
3
|
-
throw TypeError(s);
|
|
4
|
-
};
|
|
5
|
-
var N = (s, i, e) => i in s ? I(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
|
|
6
|
-
var p = (s, i, e) => N(s, typeof i != "symbol" ? i + "" : i, e), H = (s, i, e) => i.has(s) || R("Cannot " + e);
|
|
7
|
-
var t = (s, i, e) => (H(s, i, "read from private field"), e ? e.call(s) : i.get(s)), r = (s, i, e) => i.has(s) ? R("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, e), a = (s, i, e, o) => (H(s, i, "write to private field"), o ? o.call(s, e) : i.set(s, e), e);
|
|
8
|
-
import { B as q } from "./Base.js";
|
|
9
|
-
import { s as P } from "../css/ea-menu.style.js";
|
|
10
|
-
import { s as T } from "../css/ea-menu-item.style.js";
|
|
11
|
-
import { s as U } from "../css/ea-menu-item-group.style.js";
|
|
12
|
-
import { s as z } from "../css/ea-sub-menu.style.js";
|
|
13
|
-
var u, c, E, v, x;
|
|
14
|
-
class D extends q {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
/** @type {HTMLElement} */
|
|
18
|
-
r(this, u);
|
|
19
|
-
/** @type {AbortController} */
|
|
20
|
-
r(this, c, new AbortController());
|
|
21
|
-
p(this, "state", this.properties({
|
|
22
|
-
mode: {
|
|
23
|
-
type: ["horizontal", "vertical"],
|
|
24
|
-
default: "vertical",
|
|
25
|
-
observer: (e) => {
|
|
26
|
-
t(this, E).call(this, e), this.updateContainerClasslist();
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"background-color": {
|
|
30
|
-
type: String,
|
|
31
|
-
default: "#ffffff",
|
|
32
|
-
observer: (e) => {
|
|
33
|
-
t(this, u).style.setProperty("--ea-menu-bg-color", e);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"text-color": {
|
|
37
|
-
type: String,
|
|
38
|
-
default: "#303133",
|
|
39
|
-
observer: (e) => {
|
|
40
|
-
t(this, u).style.setProperty("--ea-menu-text-color", e);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"active-text-color": {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "#409eff",
|
|
46
|
-
observer: (e) => {
|
|
47
|
-
t(this, u).style.setProperty(
|
|
48
|
-
"--ea-menu-active-text-color",
|
|
49
|
-
e
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"default-active": {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "",
|
|
56
|
-
observer: () => {
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
// TODO: 没写😋
|
|
60
|
-
collapse: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: !1,
|
|
63
|
-
observer: () => {
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// TODO: 没写disabled😋
|
|
67
|
-
}));
|
|
68
|
-
/**
|
|
69
|
-
* 更新子菜单模式
|
|
70
|
-
* @param {string} mode
|
|
71
|
-
*/
|
|
72
|
-
r(this, E, (e) => {
|
|
73
|
-
this.querySelectorAll("ea-sub-menu").forEach((o) => {
|
|
74
|
-
o.setAttribute("mode", e);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
/**
|
|
78
|
-
* 处理菜单项点击事件
|
|
79
|
-
* @param {MouseEvent} e
|
|
80
|
-
*/
|
|
81
|
-
r(this, v, (e) => {
|
|
82
|
-
const o = [...this.querySelectorAll("ea-menu-item")], l = [...this.querySelectorAll("ea-sub-menu")], b = e.target.closest("ea-menu-item");
|
|
83
|
-
if (e.target.closest("ea-sub-menu") || b) {
|
|
84
|
-
const L = (B) => B.removeAttribute("active");
|
|
85
|
-
o.forEach(L), l.forEach(L);
|
|
86
|
-
}
|
|
87
|
-
b && (b.toggleAttribute("active", !0), this.emit("select", {
|
|
88
|
-
detail: {
|
|
89
|
-
index: b.index || b.getAttribute("index"),
|
|
90
|
-
target: b
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
93
|
-
});
|
|
94
|
-
/**
|
|
95
|
-
* 初始化默认激活项
|
|
96
|
-
*/
|
|
97
|
-
r(this, x, () => {
|
|
98
|
-
const e = this.querySelector(
|
|
99
|
-
`ea-menu-item[index="${this["default-active"]}"]`
|
|
100
|
-
);
|
|
101
|
-
e && e.click();
|
|
102
|
-
});
|
|
103
|
-
this.stylesheet = P, this.$render();
|
|
104
|
-
}
|
|
105
|
-
static get observedAttributes() {
|
|
106
|
-
return [
|
|
107
|
-
...super.observedAttributes,
|
|
108
|
-
"mode",
|
|
109
|
-
"background-color",
|
|
110
|
-
"text-color",
|
|
111
|
-
"active-text-color",
|
|
112
|
-
"collapse",
|
|
113
|
-
"default-active"
|
|
114
|
-
];
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* 获取 classlist 列表
|
|
118
|
-
* @return {string} 属性值
|
|
119
|
-
*/
|
|
120
|
-
updateContainerClasslist() {
|
|
121
|
-
const e = this.computedClasslist(
|
|
122
|
-
"ea-menu",
|
|
123
|
-
{
|
|
124
|
-
["--" + this.mode]: this.mode
|
|
125
|
-
},
|
|
126
|
-
{}
|
|
127
|
-
);
|
|
128
|
-
return t(this, u).className = e, e;
|
|
129
|
-
}
|
|
130
|
-
$render() {
|
|
131
|
-
this.shadowRoot.innerHTML = `
|
|
132
|
-
<ul class='ea-menu' role="menubar" part='container'>
|
|
133
|
-
<slot></slot>
|
|
134
|
-
</ul>
|
|
135
|
-
`, a(this, u, this.shadowRoot.querySelector(".ea-menu")), this.updateContainerClasslist();
|
|
136
|
-
}
|
|
137
|
-
connectedCallback() {
|
|
138
|
-
var e;
|
|
139
|
-
super.connectedCallback(), (e = t(this, c)) == null || e.abort(), a(this, c, new AbortController()), this.addEventListener("click", t(this, v), {
|
|
140
|
-
signal: t(this, c).signal
|
|
141
|
-
}), this.addEventListener("ea-sub-menu-click", t(this, v), {
|
|
142
|
-
signal: t(this, c).signal
|
|
143
|
-
}), t(this, x).call(this);
|
|
144
|
-
}
|
|
145
|
-
$beforeUnmounted() {
|
|
146
|
-
t(this, c).abort();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
u = new WeakMap(), c = new WeakMap(), E = new WeakMap(), v = new WeakMap(), x = new WeakMap();
|
|
150
|
-
window.customElements.get("ea-menu") || window.customElements.define("ea-menu", D);
|
|
151
|
-
var f;
|
|
152
|
-
class G extends q {
|
|
153
|
-
constructor() {
|
|
154
|
-
super();
|
|
155
|
-
/** @type {HTMLElement} */
|
|
156
|
-
r(this, f);
|
|
157
|
-
p(this, "state", this.properties({
|
|
158
|
-
index: {
|
|
159
|
-
type: String,
|
|
160
|
-
default: "",
|
|
161
|
-
observer: () => {
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
disabled: {
|
|
165
|
-
type: Boolean,
|
|
166
|
-
default: !1,
|
|
167
|
-
observer: () => {
|
|
168
|
-
this.updateContainerClasslist();
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
active: {
|
|
172
|
-
type: Boolean,
|
|
173
|
-
default: !1,
|
|
174
|
-
observer: () => {
|
|
175
|
-
this.updateContainerClasslist();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}));
|
|
179
|
-
this.stylesheet = T, this.$render();
|
|
180
|
-
}
|
|
181
|
-
static get observedAttributes() {
|
|
182
|
-
return [...super.observedAttributes, "index", "disabled", "active"];
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* 获取 classlist 列表
|
|
186
|
-
* @return {string} 属性值
|
|
187
|
-
*/
|
|
188
|
-
updateContainerClasslist() {
|
|
189
|
-
const e = this.computedClasslist(
|
|
190
|
-
"ea-menu-item",
|
|
191
|
-
{},
|
|
192
|
-
{
|
|
193
|
-
disabled: this.disabled,
|
|
194
|
-
active: this.active
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
return t(this, f).className = e, e;
|
|
198
|
-
}
|
|
199
|
-
$render() {
|
|
200
|
-
this.shadowRoot.innerHTML = `
|
|
201
|
-
<li class='ea-menu-item' role="menuitem" part='container'>
|
|
202
|
-
<slot></slot>
|
|
203
|
-
</li>
|
|
204
|
-
`, a(this, f, this.shadowRoot.querySelector(".ea-menu-item"));
|
|
205
|
-
}
|
|
206
|
-
connectedCallback() {
|
|
207
|
-
super.connectedCallback();
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
f = new WeakMap();
|
|
211
|
-
window.customElements.get("ea-menu-item") || window.customElements.define("ea-menu-item", G);
|
|
212
|
-
var S, C, $;
|
|
213
|
-
class V extends q {
|
|
214
|
-
constructor() {
|
|
215
|
-
super();
|
|
216
|
-
/** @type {HTMLElement} */
|
|
217
|
-
r(this, S);
|
|
218
|
-
/** @type {HTMLSlotElement} */
|
|
219
|
-
r(this, C);
|
|
220
|
-
/** @type {AbortController} */
|
|
221
|
-
r(this, $, new AbortController());
|
|
222
|
-
p(this, "state", this.properties({
|
|
223
|
-
title: {
|
|
224
|
-
type: String,
|
|
225
|
-
default: "",
|
|
226
|
-
observer: (e) => {
|
|
227
|
-
t(this, C).textContent = e;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}));
|
|
231
|
-
this.stylesheet = U, this.$render();
|
|
232
|
-
}
|
|
233
|
-
static get observedAttributes() {
|
|
234
|
-
return [...super.observedAttributes, "title"];
|
|
235
|
-
}
|
|
236
|
-
$render() {
|
|
237
|
-
this.shadowRoot.innerHTML = `
|
|
238
|
-
<div class='ea-menu-item-group' part='container'>
|
|
239
|
-
<header class='ea-menu-item-group__title' part='title'>
|
|
240
|
-
<slot name="title">${this.title}</slot>
|
|
241
|
-
</header>
|
|
242
|
-
<div class='ea-menu-item-group__content' part='content'>
|
|
243
|
-
<slot></slot>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
`, a(this, S, this.shadowRoot.querySelector(".ea-menu-item-group")), a(this, C, this.shadowRoot.querySelector("slot[name='title']"));
|
|
247
|
-
}
|
|
248
|
-
connectedCallback() {
|
|
249
|
-
super.connectedCallback();
|
|
250
|
-
}
|
|
251
|
-
$beforeUnmounted() {
|
|
252
|
-
t(this, $).abort();
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
S = new WeakMap(), C = new WeakMap(), $ = new WeakMap();
|
|
256
|
-
window.customElements.get("ea-menu-item-group") || window.customElements.define("ea-menu-item-group", V);
|
|
257
|
-
var g, y, w, n, m, h, d, k, M, _, A;
|
|
258
|
-
class j extends q {
|
|
259
|
-
constructor() {
|
|
260
|
-
super();
|
|
261
|
-
/** @type {HTMLElement} */
|
|
262
|
-
r(this, g);
|
|
263
|
-
/** @type {HTMLElement} */
|
|
264
|
-
r(this, y);
|
|
265
|
-
/** @type {HTMLSlotElement} */
|
|
266
|
-
r(this, w);
|
|
267
|
-
/** @type {HTMLElement} */
|
|
268
|
-
r(this, n);
|
|
269
|
-
/** @type {AbortController} */
|
|
270
|
-
r(this, m, new AbortController());
|
|
271
|
-
/** @type {AbortController} */
|
|
272
|
-
r(this, h, new AbortController());
|
|
273
|
-
/** @type {AbortController} */
|
|
274
|
-
r(this, d, new AbortController());
|
|
275
|
-
p(this, "state", this.properties({
|
|
276
|
-
open: {
|
|
277
|
-
props: !0,
|
|
278
|
-
type: Boolean,
|
|
279
|
-
default: !1,
|
|
280
|
-
observer: () => {
|
|
281
|
-
this.updateContainerClasslist();
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
index: {
|
|
285
|
-
type: String,
|
|
286
|
-
default: "",
|
|
287
|
-
observer: () => {
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
disabled: {
|
|
291
|
-
type: Boolean,
|
|
292
|
-
default: !1,
|
|
293
|
-
observer: () => {
|
|
294
|
-
this.updateContainerClasslist();
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
active: {
|
|
298
|
-
type: Boolean,
|
|
299
|
-
default: !1,
|
|
300
|
-
observer: () => {
|
|
301
|
-
this.updateContainerClasslist();
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
mode: {
|
|
305
|
-
type: ["horizontal", "vertical"],
|
|
306
|
-
default: "vertical",
|
|
307
|
-
observer: (e) => {
|
|
308
|
-
t(this, A).call(this, e), this.updateContainerClasslist();
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
label: {
|
|
312
|
-
type: String,
|
|
313
|
-
default: "",
|
|
314
|
-
observer: (e) => {
|
|
315
|
-
t(this, w).textContent = e;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}));
|
|
319
|
-
/**
|
|
320
|
-
* 菜单项点击事件
|
|
321
|
-
* @param {MouseEvent} e
|
|
322
|
-
*/
|
|
323
|
-
r(this, k, (e) => {
|
|
324
|
-
e.stopImmediatePropagation(), e.preventDefault();
|
|
325
|
-
const o = e.target.closest("ea-menu-item"), l = this.closest("ea-sub-menu") === this ? this.parentElement.closest("ea-sub-menu") : this.closest("ea-sub-menu");
|
|
326
|
-
o && (this.emit("ea-sub-menu-click", {
|
|
327
|
-
detail: { index: this.index },
|
|
328
|
-
bubbles: !0
|
|
329
|
-
}), this.setAttribute("active", "true"), l && l.setAttribute("active", "true"), o.setAttribute("active", "true"));
|
|
330
|
-
});
|
|
331
|
-
/**
|
|
332
|
-
* 鼠标悬停事件
|
|
333
|
-
* @param {MouseEvent} e
|
|
334
|
-
*/
|
|
335
|
-
r(this, M, () => {
|
|
336
|
-
var o;
|
|
337
|
-
(o = t(this, h)) == null || o.abort(), a(this, h, new AbortController()), this.open = !0;
|
|
338
|
-
const e = () => {
|
|
339
|
-
var l;
|
|
340
|
-
this.open = !1, (l = t(this, h)) == null || l.abort();
|
|
341
|
-
};
|
|
342
|
-
this.addEventListener("mouseleave", e, {
|
|
343
|
-
signal: t(this, h).signal
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
/**
|
|
347
|
-
* 垂直菜单折叠事件
|
|
348
|
-
*/
|
|
349
|
-
r(this, _, () => {
|
|
350
|
-
this.open = !this.open, this.open || (t(this, n).style.setProperty("--ea-sub-menu-transition", "none"), t(this, n).offsetHeight, t(this, n).style.height = `${t(this, n).scrollHeight}px`, t(this, n).offsetHeight, t(this, n).style.removeProperty("--ea-sub-menu-transition")), t(this, n).style.height = `${this.open ? t(this, n).scrollHeight : 0}px`, t(this, n).addEventListener(
|
|
351
|
-
"transitionend",
|
|
352
|
-
() => {
|
|
353
|
-
t(this, n).style.height = this.open ? "100%" : 0;
|
|
354
|
-
},
|
|
355
|
-
{ once: !0 }
|
|
356
|
-
);
|
|
357
|
-
});
|
|
358
|
-
/**
|
|
359
|
-
* 菜单模式切换
|
|
360
|
-
* @param {string} [mode]
|
|
361
|
-
*/
|
|
362
|
-
r(this, A, (e = this.mode) => {
|
|
363
|
-
var o;
|
|
364
|
-
(o = t(this, d)) == null || o.abort(), a(this, d, new AbortController()), e === "vertical" ? t(this, y).addEventListener("click", t(this, _), {
|
|
365
|
-
signal: t(this, d).signal
|
|
366
|
-
}) : this.addEventListener("mouseenter", t(this, M), {
|
|
367
|
-
signal: t(this, d).signal
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
this.stylesheet = z, this.$render();
|
|
371
|
-
}
|
|
372
|
-
static get observedAttributes() {
|
|
373
|
-
return [
|
|
374
|
-
...super.observedAttributes,
|
|
375
|
-
"active",
|
|
376
|
-
"index",
|
|
377
|
-
"disabled",
|
|
378
|
-
"mode",
|
|
379
|
-
"label"
|
|
380
|
-
];
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* 获取 classlist 列表
|
|
384
|
-
* @return {string} 属性值
|
|
385
|
-
*/
|
|
386
|
-
updateContainerClasslist() {
|
|
387
|
-
const e = this.computedClasslist(
|
|
388
|
-
"ea-sub-menu",
|
|
389
|
-
{
|
|
390
|
-
["--" + this.mode]: this.mode
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
disabled: this.disabled,
|
|
394
|
-
active: this.active,
|
|
395
|
-
open: this.open
|
|
396
|
-
}
|
|
397
|
-
);
|
|
398
|
-
return t(this, g).className = e, e;
|
|
399
|
-
}
|
|
400
|
-
$render() {
|
|
401
|
-
var o;
|
|
402
|
-
const e = (o = this.parentElement) == null ? void 0 : o.closest("ea-sub-menu");
|
|
403
|
-
this.shadowRoot.innerHTML = `
|
|
404
|
-
<div class='ea-sub-menu' part='container'>
|
|
405
|
-
<header class='ea-sub-menu__title' part='title'>
|
|
406
|
-
<slot name='title'></slot>
|
|
407
|
-
<ea-icon icon="${e ? "icon-angle-right" : "icon-angle-down"}" class='ea-sub-menu__arrow' part='arrow'></ea-icon>
|
|
408
|
-
</header>
|
|
409
|
-
<ul class='ea-sub-menu__content' part='content'>
|
|
410
|
-
<slot></slot>
|
|
411
|
-
</ul>
|
|
412
|
-
</div>
|
|
413
|
-
`, a(this, g, this.shadowRoot.querySelector(".ea-sub-menu")), a(this, y, this.shadowRoot.querySelector(".ea-sub-menu__title")), a(this, w, this.shadowRoot.querySelector("slot[name='title']")), a(this, n, this.shadowRoot.querySelector(".ea-sub-menu__content")), this.updateContainerClasslist();
|
|
414
|
-
}
|
|
415
|
-
connectedCallback() {
|
|
416
|
-
var e;
|
|
417
|
-
super.connectedCallback(), (e = t(this, m)) == null || e.abort(), a(this, m, new AbortController()), this.addEventListener("click", t(this, k), {
|
|
418
|
-
signal: t(this, m).signal
|
|
419
|
-
}), t(this, A).call(this), this.updateContainerClasslist();
|
|
420
|
-
}
|
|
421
|
-
$beforeUnmounted() {
|
|
422
|
-
var e, o, l;
|
|
423
|
-
(e = t(this, m)) == null || e.abort(), (o = t(this, h)) == null || o.abort(), (l = t(this, d)) == null || l.abort();
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
g = new WeakMap(), y = new WeakMap(), w = new WeakMap(), n = new WeakMap(), m = new WeakMap(), h = new WeakMap(), d = new WeakMap(), k = new WeakMap(), M = new WeakMap(), _ = new WeakMap(), A = new WeakMap();
|
|
427
|
-
window.customElements.get("ea-sub-menu") || window.customElements.define("ea-sub-menu", j);
|
|
428
|
-
export {
|
|
429
|
-
D as EaMenu,
|
|
430
|
-
G as EaMenuItem,
|
|
431
|
-
V as EaMenuItemGroup,
|
|
432
|
-
j as EaSubMenu
|
|
433
|
-
};
|