easy-component-ui 3.0.11 → 3.0.13
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/README.md +162 -162
- package/dist/assets/icon.css +1 -1
- package/dist/components/Base.js +190 -188
- package/dist/components/ea-alert.js +71 -54
- package/dist/components/ea-avatar.js +42 -37
- package/dist/components/ea-breadcrumb.js +33 -33
- package/dist/components/ea-button.js +53 -52
- package/dist/components/ea-card.js +63 -27
- package/dist/components/ea-carousel.js +2 -2
- package/dist/components/ea-collapse.js +93 -73
- package/dist/components/ea-color-picker.js +221 -221
- package/dist/components/ea-container.js +90 -61
- package/dist/components/ea-countdown.js +77 -56
- package/dist/components/ea-date-picker.js +1 -1
- package/dist/components/ea-descriptions.js +133 -70
- package/dist/components/ea-dialog.js +4 -4
- package/dist/components/ea-drawer.js +93 -71
- package/dist/components/ea-empty.js +31 -23
- package/dist/components/ea-icon.js +122 -32
- package/dist/components/ea-image-preview.js +237 -193
- package/dist/components/ea-image.js +69 -44
- package/dist/components/ea-input-number.js +9 -9
- package/dist/components/ea-input.js +15 -15
- package/dist/components/ea-layout.js +10 -3
- package/dist/components/ea-link.js +1 -1
- package/dist/components/ea-menu.js +69 -53
- package/dist/components/ea-message-box.js +73 -73
- package/dist/components/ea-message.js +184 -121
- package/dist/components/ea-notification.js +80 -80
- package/dist/components/ea-overlay.js +41 -34
- package/dist/components/ea-page-header.js +5 -5
- package/dist/components/ea-pagination.js +6 -5
- package/dist/components/ea-popconfirm.js +133 -78
- package/dist/components/ea-popover.js +35 -11
- package/dist/components/ea-popper.js +9 -9
- package/dist/components/ea-progress.js +88 -71
- package/dist/components/ea-rate.js +1 -1
- package/dist/components/ea-result.js +20 -20
- package/dist/components/ea-select.js +119 -108
- package/dist/components/ea-skeleton.js +99 -82
- package/dist/components/ea-slider.js +88 -79
- package/dist/components/ea-splitter.js +34 -18
- package/dist/components/ea-statistic.js +72 -4
- package/dist/components/ea-steps.js +108 -74
- package/dist/components/ea-table.js +562 -434
- package/dist/components/ea-tabs.js +28 -28
- package/dist/components/ea-tag.js +37 -43
- package/dist/components/ea-time-picker.js +2 -6
- package/dist/components/ea-timeline.js +11 -12
- package/dist/components/ea-tooltip.js +63 -23
- package/dist/components/ea-tour.js +21 -21
- package/dist/components/ea-transfer.js +2 -2
- package/dist/components/ea-tree.js +1 -1
- package/dist/components/index.js +1 -2
- package/dist/css/ea-card.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-container.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-footer.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-switch.style.js +1 -1
- package/dist/css/ea-tab.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-tabs.style.js +1 -1
- package/dist/css/ea-tag.style.js +1 -1
- package/dist/css/ea-time-picker.style.js +1 -1
- package/dist/css/ea-timeline-item.style.js +1 -1
- package/dist/utils/Variables.js +10 -17
- package/dist/utils/parseTime.js +73 -0
- package/package.json +302 -304
- package/dist/components/ea-loading.js +0 -151
- package/dist/components/ea-statistic2.js +0 -83
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var x = (s) => {
|
|
3
|
+
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import { B as
|
|
9
|
-
import { s as
|
|
10
|
-
import { s as
|
|
11
|
-
var
|
|
12
|
-
class
|
|
5
|
+
var N = (s, i, t) => i in s ? k(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
|
|
6
|
+
var p = (s, i, t) => N(s, typeof i != "symbol" ? i + "" : i, t), R = (s, i, t) => i.has(s) || x("Cannot " + t);
|
|
7
|
+
var e = (s, i, t) => (R(s, i, "read from private field"), t ? t.call(s) : i.get(s)), o = (s, i, t) => i.has(s) ? x("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), r = (s, i, t, a) => (R(s, i, "write to private field"), a ? a.call(s, t) : i.set(s, t), t);
|
|
8
|
+
import { B as $ } from "./Base.js";
|
|
9
|
+
import { s as B } from "../css/ea-collapse.style.js";
|
|
10
|
+
import { s as L } from "../css/ea-collapse-item.style.js";
|
|
11
|
+
var g, c, d, y, C, w;
|
|
12
|
+
class P extends $ {
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
/** @type {HTMLElement} */
|
|
16
|
-
o(this,
|
|
16
|
+
o(this, g);
|
|
17
17
|
/** @type {AbortController} */
|
|
18
|
-
o(this,
|
|
19
|
-
|
|
18
|
+
o(this, c);
|
|
19
|
+
p(this, "state", this.properties({
|
|
20
20
|
accordion: {
|
|
21
21
|
type: Boolean,
|
|
22
22
|
default: !1,
|
|
@@ -30,23 +30,24 @@ class N extends x {
|
|
|
30
30
|
Array: () => !this.accordion
|
|
31
31
|
},
|
|
32
32
|
default: () => this.accordion ? "" : [],
|
|
33
|
-
observer: (
|
|
34
|
-
this.setActiveNames(
|
|
33
|
+
observer: (t) => {
|
|
34
|
+
this.setActiveNames(t);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"expand-icon-position": {
|
|
38
38
|
type: ["left", "right"],
|
|
39
39
|
default: "right",
|
|
40
|
-
observer: (
|
|
40
|
+
observer: (t) => {
|
|
41
41
|
this.querySelectorAll("ea-collapse-item").forEach((a) => {
|
|
42
|
-
a["expand-icon-position"] =
|
|
42
|
+
a["expand-icon-position"] = t;
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}));
|
|
47
|
-
|
|
47
|
+
p(this, "fnState", this.properties({
|
|
48
48
|
beforeCollapse: {
|
|
49
49
|
props: !0,
|
|
50
|
+
rawFunction: !0,
|
|
50
51
|
type: Function,
|
|
51
52
|
default: null,
|
|
52
53
|
observer: () => {
|
|
@@ -57,20 +58,20 @@ class N extends x {
|
|
|
57
58
|
* 更新手风琴模式下的折叠状态
|
|
58
59
|
* @param {string} [activeName]
|
|
59
60
|
*/
|
|
60
|
-
o(this, d, (
|
|
61
|
+
o(this, d, (t = this.active) => {
|
|
61
62
|
[...this.querySelectorAll("ea-collapse-item")].forEach(
|
|
62
|
-
(l) => l.toggleAttribute("active", l.getAttribute("name") ===
|
|
63
|
+
(l) => l.toggleAttribute("active", l.getAttribute("name") === t)
|
|
63
64
|
);
|
|
64
65
|
});
|
|
65
66
|
/**
|
|
66
67
|
* 更新普通模式下的折叠状态
|
|
67
68
|
* @param {string[]} [activeNames]
|
|
68
69
|
*/
|
|
69
|
-
o(this,
|
|
70
|
+
o(this, y, (t = this.active) => {
|
|
70
71
|
[...this.querySelectorAll("ea-collapse-item")].forEach(
|
|
71
72
|
(l) => l.toggleAttribute(
|
|
72
73
|
"active",
|
|
73
|
-
|
|
74
|
+
t.includes(l.getAttribute("name"))
|
|
74
75
|
)
|
|
75
76
|
);
|
|
76
77
|
});
|
|
@@ -78,9 +79,9 @@ class N extends x {
|
|
|
78
79
|
* 折叠项点击事件处理
|
|
79
80
|
* @param {CustomEvent} e
|
|
80
81
|
*/
|
|
81
|
-
o(this,
|
|
82
|
-
|
|
83
|
-
const { name: a, el: l } =
|
|
82
|
+
o(this, C, async (t) => {
|
|
83
|
+
t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
|
|
84
|
+
const { name: a, el: l } = t.detail;
|
|
84
85
|
if (typeof this.beforeCollapse == "function")
|
|
85
86
|
try {
|
|
86
87
|
if (!await this.beforeCollapse({ name: a, el: l })) return;
|
|
@@ -88,10 +89,10 @@ class N extends x {
|
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
91
|
if (this.accordion)
|
|
91
|
-
|
|
92
|
+
e(this, d).call(this, a), this.active = a;
|
|
92
93
|
else
|
|
93
94
|
try {
|
|
94
|
-
this.active.includes(a) ? (this.active = this.active.filter((
|
|
95
|
+
this.active.includes(a) ? (this.active = this.active.filter((q) => q !== a), l.toggleAttribute("active", !1)) : (this.active = [...this.active, a], l.toggleAttribute("active", this.active.includes(a)));
|
|
95
96
|
} catch {
|
|
96
97
|
console.error(
|
|
97
98
|
`${this.tagName}: When 'accordion' is false, 'active' should be an Array type.`,
|
|
@@ -110,7 +111,7 @@ class N extends x {
|
|
|
110
111
|
/**
|
|
111
112
|
* 初始化折叠项的唯一标识及折叠状态
|
|
112
113
|
*/
|
|
113
|
-
o(this,
|
|
114
|
+
o(this, w, () => {
|
|
114
115
|
[...this.querySelectorAll("ea-collapse-item")].forEach((a, l) => {
|
|
115
116
|
a.getAttribute("name") || a.setAttribute("name", l);
|
|
116
117
|
});
|
|
@@ -119,10 +120,10 @@ class N extends x {
|
|
|
119
120
|
* 设置折叠项的展开状态
|
|
120
121
|
* @param {string | string[]} newVal
|
|
121
122
|
*/
|
|
122
|
-
|
|
123
|
-
this.accordion ?
|
|
123
|
+
p(this, "setActiveNames", (t) => {
|
|
124
|
+
this.accordion ? e(this, d).call(this, t) : e(this, y).call(this, t);
|
|
124
125
|
});
|
|
125
|
-
this.stylesheet =
|
|
126
|
+
this.stylesheet = B, this.$render();
|
|
126
127
|
}
|
|
127
128
|
static get observedAttributes() {
|
|
128
129
|
return [...super.observedAttributes, "accordion", "expand-icon-position"];
|
|
@@ -132,43 +133,47 @@ class N extends x {
|
|
|
132
133
|
<div class='ea-collapse' part='container'>
|
|
133
134
|
<slot></slot>
|
|
134
135
|
</div>
|
|
135
|
-
`, r(this,
|
|
136
|
+
`, r(this, g, this.shadowRoot.querySelector(".ea-collapse"));
|
|
136
137
|
}
|
|
137
138
|
connectedCallback() {
|
|
138
|
-
var
|
|
139
|
-
super.connectedCallback(), (
|
|
140
|
-
signal:
|
|
139
|
+
var t;
|
|
140
|
+
super.connectedCallback(), (t = e(this, c)) == null || t.abort(), r(this, c, new AbortController()), e(this, w).call(this), this.addEventListener("collapse-item-click", e(this, C), {
|
|
141
|
+
signal: e(this, c).signal
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
$beforeUnmounted() {
|
|
144
|
-
var
|
|
145
|
-
(
|
|
145
|
+
var t;
|
|
146
|
+
(t = e(this, c)) == null || t.abort();
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
|
-
|
|
149
|
-
window.customElements.get("ea-collapse") || window.customElements.define("ea-collapse",
|
|
150
|
-
var
|
|
151
|
-
class
|
|
149
|
+
g = new WeakMap(), c = new WeakMap(), d = new WeakMap(), y = new WeakMap(), C = new WeakMap(), w = new WeakMap();
|
|
150
|
+
window.customElements.get("ea-collapse") || window.customElements.define("ea-collapse", P);
|
|
151
|
+
var h, u, A, m, S, b, v, n, f, _, E;
|
|
152
|
+
class H extends $ {
|
|
152
153
|
constructor() {
|
|
153
154
|
super();
|
|
154
155
|
/** @type {HTMLElement} */
|
|
155
|
-
o(this,
|
|
156
|
+
o(this, h);
|
|
156
157
|
/** @type {HTMLElement} */
|
|
157
158
|
o(this, u);
|
|
158
159
|
/** @type {HTMLElement} */
|
|
160
|
+
o(this, A);
|
|
161
|
+
/** @type {HTMLSlotElement} */
|
|
159
162
|
o(this, m);
|
|
160
163
|
/** @type {HTMLElement} */
|
|
161
|
-
o(this,
|
|
164
|
+
o(this, S);
|
|
162
165
|
/** @type {HTMLElement} */
|
|
163
166
|
o(this, b);
|
|
167
|
+
/** @type {HTMLSlotElement} */
|
|
168
|
+
o(this, v);
|
|
164
169
|
/** @type {AbortController} */
|
|
165
|
-
o(this,
|
|
166
|
-
|
|
170
|
+
o(this, n);
|
|
171
|
+
p(this, "state", this.properties({
|
|
167
172
|
title: {
|
|
168
173
|
type: String,
|
|
169
174
|
default: "",
|
|
170
|
-
observer: (
|
|
171
|
-
|
|
175
|
+
observer: (t) => {
|
|
176
|
+
e(this, m).textContent = t;
|
|
172
177
|
}
|
|
173
178
|
},
|
|
174
179
|
name: {
|
|
@@ -194,8 +199,8 @@ class B extends x {
|
|
|
194
199
|
active: {
|
|
195
200
|
type: Boolean,
|
|
196
201
|
default: !1,
|
|
197
|
-
observer: (
|
|
198
|
-
|
|
202
|
+
observer: (t) => {
|
|
203
|
+
e(this, f).call(this, t);
|
|
199
204
|
}
|
|
200
205
|
}
|
|
201
206
|
}));
|
|
@@ -203,18 +208,20 @@ class B extends x {
|
|
|
203
208
|
* 更新折叠面板高度
|
|
204
209
|
* @param {boolean} isActive
|
|
205
210
|
*/
|
|
206
|
-
o(this,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
o(this, f, (t = this.active) => {
|
|
212
|
+
queueMicrotask(() => {
|
|
213
|
+
e(this, h).style.setProperty(
|
|
214
|
+
"--ea-collapse-item-content-height",
|
|
215
|
+
t ? `${e(this, b).scrollHeight}px` : "0"
|
|
216
|
+
);
|
|
217
|
+
});
|
|
211
218
|
});
|
|
212
219
|
/**
|
|
213
220
|
* 折叠面板 展开/收起 事件处理
|
|
214
221
|
* @param {Event} e
|
|
215
222
|
*/
|
|
216
|
-
o(this,
|
|
217
|
-
|
|
223
|
+
o(this, _, (t) => {
|
|
224
|
+
t.preventDefault(), t.stopImmediatePropagation(), !this.disabled && this.emit("collapse-item-click", {
|
|
218
225
|
detail: {
|
|
219
226
|
name: this.name,
|
|
220
227
|
el: this
|
|
@@ -223,7 +230,16 @@ class B extends x {
|
|
|
223
230
|
cancelable: !0
|
|
224
231
|
});
|
|
225
232
|
});
|
|
226
|
-
|
|
233
|
+
/**
|
|
234
|
+
* 插槽变化事件处理
|
|
235
|
+
*/
|
|
236
|
+
o(this, E, () => {
|
|
237
|
+
e(this, h).style.setProperty(
|
|
238
|
+
"--ea-collapse-item-content-height",
|
|
239
|
+
"auto"
|
|
240
|
+
), e(this, f).call(this);
|
|
241
|
+
});
|
|
242
|
+
this.stylesheet = L, this.$render();
|
|
227
243
|
}
|
|
228
244
|
static get observedAttributes() {
|
|
229
245
|
return [
|
|
@@ -240,7 +256,7 @@ class B extends x {
|
|
|
240
256
|
* @return {string} 属性值
|
|
241
257
|
*/
|
|
242
258
|
updateContainerClasslist() {
|
|
243
|
-
const
|
|
259
|
+
const t = this.computedClasslist(
|
|
244
260
|
"ea-collapse-item",
|
|
245
261
|
{
|
|
246
262
|
["--indicator-" + this["expand-icon-position"]]: this["expand-icon-position"]
|
|
@@ -249,7 +265,7 @@ class B extends x {
|
|
|
249
265
|
disabled: this.disabled
|
|
250
266
|
}
|
|
251
267
|
);
|
|
252
|
-
return
|
|
268
|
+
return e(this, h).className = t, t;
|
|
253
269
|
}
|
|
254
270
|
$render() {
|
|
255
271
|
this.shadowRoot.innerHTML = `
|
|
@@ -260,7 +276,7 @@ class B extends x {
|
|
|
260
276
|
</span>
|
|
261
277
|
<span class="ea-collapse-item__indicator" part="indicator">
|
|
262
278
|
<slot name="icon">
|
|
263
|
-
<ea-icon class="default-expand-icon"
|
|
279
|
+
<ea-icon class="default-expand-icon" name="angle-down" part="icon"></ea-icon>
|
|
264
280
|
</slot>
|
|
265
281
|
</span>
|
|
266
282
|
</div>
|
|
@@ -268,26 +284,30 @@ class B extends x {
|
|
|
268
284
|
<slot></slot>
|
|
269
285
|
</div>
|
|
270
286
|
</div>
|
|
271
|
-
`, r(this,
|
|
287
|
+
`, r(this, h, this.shadowRoot.querySelector(".ea-collapse-item")), r(this, u, this.shadowRoot.querySelector(
|
|
272
288
|
".ea-collapse-item__title-wrap"
|
|
273
|
-
)), r(this,
|
|
289
|
+
)), r(this, A, this.shadowRoot.querySelector(".ea-collapse-item__title")), r(this, m, this.shadowRoot.querySelector(
|
|
290
|
+
".ea-collapse-item__title slot"
|
|
291
|
+
)), r(this, S, this.shadowRoot.querySelector(
|
|
274
292
|
".ea-collapse-item__title-icon"
|
|
275
|
-
)), r(this, b, this.shadowRoot.querySelector(".ea-collapse-item__content")), this.updateContainerClasslist();
|
|
293
|
+
)), r(this, b, this.shadowRoot.querySelector(".ea-collapse-item__content")), r(this, v, this.shadowRoot.querySelector("slot:not([name])")), this.updateContainerClasslist();
|
|
276
294
|
}
|
|
277
295
|
connectedCallback() {
|
|
278
|
-
var
|
|
279
|
-
super.connectedCallback(), (
|
|
280
|
-
signal:
|
|
296
|
+
var t;
|
|
297
|
+
super.connectedCallback(), (t = e(this, n)) == null || t.abort(), r(this, n, new AbortController()), e(this, u).addEventListener("click", e(this, _), {
|
|
298
|
+
signal: e(this, n).signal
|
|
299
|
+
}), e(this, v).addEventListener("slotchange", e(this, E), {
|
|
300
|
+
signal: e(this, n).signal
|
|
281
301
|
});
|
|
282
302
|
}
|
|
283
303
|
$beforeUnmounted() {
|
|
284
|
-
var
|
|
285
|
-
(
|
|
304
|
+
var t;
|
|
305
|
+
(t = e(this, n)) == null || t.abort();
|
|
286
306
|
}
|
|
287
307
|
}
|
|
288
|
-
|
|
289
|
-
window.customElements.get("ea-collapse-item") || window.customElements.define("ea-collapse-item",
|
|
308
|
+
h = new WeakMap(), u = new WeakMap(), A = new WeakMap(), m = new WeakMap(), S = new WeakMap(), b = new WeakMap(), v = new WeakMap(), n = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), E = new WeakMap();
|
|
309
|
+
window.customElements.get("ea-collapse-item") || window.customElements.define("ea-collapse-item", H);
|
|
290
310
|
export {
|
|
291
|
-
|
|
292
|
-
|
|
311
|
+
P as EaCollapse,
|
|
312
|
+
H as EaCollapseItem
|
|
293
313
|
};
|