easy-component-ui 3.0.12 → 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 +3 -2
- package/dist/components/ea-alert.js +71 -54
- package/dist/components/ea-avatar.js +42 -37
- package/dist/components/ea-button.js +53 -52
- package/dist/components/ea-calendar2.js +329 -327
- package/dist/components/ea-card.js +63 -27
- package/dist/components/ea-carousel.js +2 -2
- package/dist/components/ea-collapse.js +28 -28
- package/dist/components/ea-color-picker.js +63 -66
- package/dist/components/ea-container.js +90 -61
- package/dist/components/ea-date-picker.js +1 -1
- package/dist/components/ea-dialog.js +4 -4
- package/dist/components/ea-drawer.js +51 -46
- 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 +1 -1
- 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 +20 -19
- package/dist/components/ea-page-header.js +5 -5
- package/dist/components/ea-pagination.js +5 -5
- package/dist/components/ea-popconfirm.js +3 -3
- package/dist/components/ea-popover.js +35 -11
- package/dist/components/ea-progress.js +28 -28
- package/dist/components/ea-rate.js +1 -1
- package/dist/components/ea-result.js +13 -13
- package/dist/components/ea-select.js +12 -12
- package/dist/components/ea-slider.js +88 -79
- package/dist/components/ea-splitter.js +34 -18
- package/dist/components/ea-steps.js +33 -33
- package/dist/components/ea-table.js +332 -321
- package/dist/components/ea-tabs.js +28 -28
- package/dist/components/ea-tag.js +6 -6
- package/dist/components/ea-time-picker.js +2 -6
- package/dist/components/ea-timeline.js +1 -1
- 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 +0 -1
- package/dist/css/ea-card.style.js +2 -2
- package/dist/css/ea-container.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-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-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/utils/Variables.js +10 -10
- package/package.json +302 -304
- package/dist/components/ea-loading.js +0 -151
|
@@ -3,8 +3,8 @@ var k = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var P = (t, s, e) => s in t ? S(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
6
|
-
var
|
|
7
|
-
var r = (t, s, e) => (
|
|
6
|
+
var _ = (t, s, e) => P(t, typeof s != "symbol" ? s + "" : s, e), C = (t, s, e) => s.has(t) || k("Cannot " + e);
|
|
7
|
+
var r = (t, s, e) => (C(t, s, "read from private field"), e ? e.call(t) : s.get(t)), p = (t, s, e) => s.has(t) ? k("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), h = (t, s, e, a) => (C(t, s, "write to private field"), a ? a.call(t, e) : s.set(t, e), e), d = (t, s, e) => (C(t, s, "access private method"), e);
|
|
8
8
|
import { B } from "./Base.js";
|
|
9
9
|
import { s as A } from "../css/ea-progress.style.js";
|
|
10
10
|
const $ = `
|
|
@@ -30,13 +30,13 @@ const $ = `
|
|
|
30
30
|
<slot class="ea-progress__percentage"></slot>
|
|
31
31
|
</section>
|
|
32
32
|
`;
|
|
33
|
-
var
|
|
33
|
+
var i, g, o, u, n, y, c, w, b;
|
|
34
34
|
class R extends B {
|
|
35
35
|
constructor() {
|
|
36
36
|
super();
|
|
37
37
|
p(this, c);
|
|
38
38
|
/** @type {HTMLElement} */
|
|
39
|
-
p(this,
|
|
39
|
+
p(this, i);
|
|
40
40
|
/** @type {HTMLElement} */
|
|
41
41
|
p(this, g);
|
|
42
42
|
/** @type {HTMLElement} */
|
|
@@ -45,13 +45,13 @@ class R extends B {
|
|
|
45
45
|
p(this, u);
|
|
46
46
|
/** @type {HTMLElement} */
|
|
47
47
|
p(this, n);
|
|
48
|
-
|
|
48
|
+
_(this, "propState", this.properties({
|
|
49
49
|
color: {
|
|
50
50
|
props: !0,
|
|
51
51
|
type: {
|
|
52
52
|
Array: () => {
|
|
53
|
-
var e,
|
|
54
|
-
return ((
|
|
53
|
+
var e, a;
|
|
54
|
+
return ((a = (e = this.props) == null ? void 0 : e.color) == null ? void 0 : a.length) > 0;
|
|
55
55
|
},
|
|
56
56
|
Function: () => {
|
|
57
57
|
var e;
|
|
@@ -68,7 +68,7 @@ class R extends B {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}));
|
|
71
|
-
|
|
71
|
+
_(this, "state", this.properties({
|
|
72
72
|
percentage: {
|
|
73
73
|
type: Number,
|
|
74
74
|
default: 0,
|
|
@@ -98,7 +98,7 @@ class R extends B {
|
|
|
98
98
|
return console.warn(
|
|
99
99
|
`[EaProgress] The width value ${e} is not supported.`
|
|
100
100
|
);
|
|
101
|
-
r(this,
|
|
101
|
+
r(this, i).style.setProperty("--ea-progress-stroke-width", e);
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"text-inside": {
|
|
@@ -123,7 +123,7 @@ class R extends B {
|
|
|
123
123
|
type: Number,
|
|
124
124
|
default: 3,
|
|
125
125
|
observer: (e) => {
|
|
126
|
-
r(this,
|
|
126
|
+
r(this, i).style.setProperty(
|
|
127
127
|
"--ea-progress-animation-duration",
|
|
128
128
|
`${e}s`
|
|
129
129
|
);
|
|
@@ -147,7 +147,7 @@ class R extends B {
|
|
|
147
147
|
type: String,
|
|
148
148
|
default: "126px",
|
|
149
149
|
observer: (e) => {
|
|
150
|
-
this.type !== "line" && r(this,
|
|
150
|
+
this.type !== "line" && r(this, i).style.setProperty("--ea-progress-size", e);
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
"show-text": {
|
|
@@ -163,21 +163,21 @@ class R extends B {
|
|
|
163
163
|
* @param {string | string[] | function} color 颜色值或函数
|
|
164
164
|
* @param {number} [percentage] 百分比
|
|
165
165
|
*/
|
|
166
|
-
p(this, y, (e,
|
|
166
|
+
p(this, y, (e, a = this.percentage) => {
|
|
167
167
|
if (!(!e || typeof e > "u"))
|
|
168
168
|
if (Array.isArray(e)) {
|
|
169
169
|
let l = e[0];
|
|
170
170
|
for (let f = 0; f < e.length; f++) {
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
173
|
-
l =
|
|
171
|
+
const x = e[f];
|
|
172
|
+
if (a <= x.percentage) {
|
|
173
|
+
l = x;
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
r(this, o).style.setProperty("--ea-progress-path-color", l == null ? void 0 : l.color);
|
|
178
178
|
} else typeof e == "string" ? r(this, o).style.setProperty("--ea-progress-path-color", e) : typeof e == "function" && r(this, o).style.setProperty(
|
|
179
179
|
"--ea-progress-path-color",
|
|
180
|
-
e(
|
|
180
|
+
e(a)
|
|
181
181
|
);
|
|
182
182
|
});
|
|
183
183
|
this.stylesheet = A, this.$render();
|
|
@@ -217,7 +217,7 @@ class R extends B {
|
|
|
217
217
|
"show-text": this["show-text"]
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
|
-
return r(this,
|
|
220
|
+
return r(this, i).className = e, e;
|
|
221
221
|
}
|
|
222
222
|
$render() {
|
|
223
223
|
const e = {
|
|
@@ -238,7 +238,7 @@ class R extends B {
|
|
|
238
238
|
<div class='ea-progress' part='container'>
|
|
239
239
|
${e[this.type]}
|
|
240
240
|
</div>
|
|
241
|
-
`, h(this,
|
|
241
|
+
`, h(this, i, this.shadowRoot.querySelector(".ea-progress")), h(this, g, this.shadowRoot.querySelector(".ea-progress__track")), h(this, o, this.shadowRoot.querySelector(".ea-progress__path")), h(this, u, this.shadowRoot.querySelector(
|
|
242
242
|
".ea-progress__percentage-wrapper"
|
|
243
243
|
)), h(this, n, this.shadowRoot.querySelector(".ea-progress__percentage")), this.updateContainerClasslist();
|
|
244
244
|
}
|
|
@@ -246,16 +246,16 @@ class R extends B {
|
|
|
246
246
|
super.connectedCallback();
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
i = new WeakMap(), g = new WeakMap(), o = new WeakMap(), u = new WeakMap(), n = new WeakMap(), y = new WeakMap(), c = new WeakSet(), /**
|
|
250
250
|
* 更新状态文本/图标
|
|
251
251
|
*/
|
|
252
252
|
w = function() {
|
|
253
253
|
const e = {
|
|
254
|
-
success: "
|
|
255
|
-
warning: "
|
|
256
|
-
exception: "
|
|
254
|
+
success: "circle-check",
|
|
255
|
+
warning: "triangle-exclamation",
|
|
256
|
+
exception: "circle-xmark"
|
|
257
257
|
};
|
|
258
|
-
["success", "exception", "warning"].includes(this.status) && !this["text-inside"] ? r(this, n).innerHTML = `<ea-icon class="ea-progress__status"
|
|
258
|
+
["success", "exception", "warning"].includes(this.status) && !this["text-inside"] ? r(this, n).innerHTML = `<ea-icon class="ea-progress__status" name="${e[this.status]}" part="status-icon"></ea-icon>` : r(this, n).textContent = this.percentage + "%";
|
|
259
259
|
}, /**
|
|
260
260
|
* 更新进度条百分比
|
|
261
261
|
* @param {number} [newVal] 新的百分比值
|
|
@@ -263,18 +263,18 @@ w = function() {
|
|
|
263
263
|
b = function(e = this.percentage) {
|
|
264
264
|
if (e < 0) return this.percentage = 0;
|
|
265
265
|
if (e > 100) return this.percentage = 100;
|
|
266
|
-
const
|
|
266
|
+
const a = this.querySelector("[data-percentage]"), l = {
|
|
267
267
|
line: () => e + "%",
|
|
268
268
|
circle: () => 302 * ((100 - e) / 100) + "px",
|
|
269
269
|
dashboard: () => {
|
|
270
|
-
const
|
|
271
|
-
return r(this, o).style.strokeDasharray =
|
|
270
|
+
const x = 49 - Number(this["stroke-width"].replace("px", "")) / 2, m = 2 * Math.PI * x, v = (100 - e) / 100;
|
|
271
|
+
return r(this, o).style.strokeDasharray = m * (270 / 360) + "px", r(this, g).style.strokeDasharray = m * (270 / 360) + "px", m * (270 / 360) * v + "px";
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
|
-
r(this,
|
|
274
|
+
r(this, i).style.setProperty(
|
|
275
275
|
"--ea-progress-percentage",
|
|
276
276
|
l[this.type]()
|
|
277
|
-
), d(this, c, w).call(this),
|
|
277
|
+
), d(this, c, w).call(this), a && (a.textContent = this.percentage), r(this, y).call(this, this.color, e), this.emit("change", {
|
|
278
278
|
detail: {
|
|
279
279
|
percentage: e
|
|
280
280
|
}
|
|
@@ -73,7 +73,7 @@ class R extends V {
|
|
|
73
73
|
* @param {boolean} [isSelected]
|
|
74
74
|
* @returns {string}
|
|
75
75
|
*/
|
|
76
|
-
default: () => () => '<ea-icon
|
|
76
|
+
default: () => () => '<ea-icon name="star" part="icon"></ea-icon>',
|
|
77
77
|
/** @param {Function} cb */
|
|
78
78
|
observer: (t) => {
|
|
79
79
|
!t || typeof t != "function" || (e(this, r).innerHTML = e(this, v).call(this, t), e(this, c).call(this, this.value - 1));
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
2
|
var h = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var y = (e, s, t) => s in e ?
|
|
5
|
+
var y = (e, s, t) => s in e ? b(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
6
|
var p = (e, s, t) => y(e, typeof s != "symbol" ? s + "" : s, t), _ = (e, s, t) => s.has(e) || h("Cannot " + t);
|
|
7
|
-
var i = (e, s, t) => (_(e, s, "read from private field"), t ? t.call(e) : s.get(e)),
|
|
7
|
+
var i = (e, s, t) => (_(e, s, "read from private field"), t ? t.call(e) : s.get(e)), a = (e, s, t) => s.has(e) ? h("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), o = (e, s, t, d) => (_(e, s, "write to private field"), d ? d.call(e, t) : s.set(e, t), t);
|
|
8
8
|
import { B as v } from "./Base.js";
|
|
9
9
|
import { s as f } from "../css/ea-result.style.js";
|
|
10
|
-
import { t as
|
|
10
|
+
import { t as m } from "../utils/Variables.js";
|
|
11
11
|
var l, r, n, u, c;
|
|
12
12
|
class w extends v {
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
/** @type {HTMLElement} */
|
|
16
|
-
|
|
16
|
+
a(this, l);
|
|
17
17
|
/** @type {HTMLElement} */
|
|
18
|
-
|
|
18
|
+
a(this, r);
|
|
19
19
|
/** @type {HTMLElement} */
|
|
20
|
-
|
|
20
|
+
a(this, n);
|
|
21
21
|
/** @type {HTMLElement} */
|
|
22
|
-
|
|
22
|
+
a(this, u);
|
|
23
23
|
/** @type {HTMLElement} */
|
|
24
|
-
|
|
24
|
+
a(this, c);
|
|
25
25
|
p(this, "state", this.properties({
|
|
26
26
|
type: {
|
|
27
27
|
type: ["primary", "success", "warning", "info", "error"],
|
|
28
28
|
default: "",
|
|
29
29
|
observer: (t) => {
|
|
30
|
-
i(this, r).setAttribute("
|
|
30
|
+
i(this, r).setAttribute("name", m[t]), this.updateContainerClasslist();
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
title: {
|
|
@@ -48,7 +48,7 @@ class w extends v {
|
|
|
48
48
|
type: String,
|
|
49
49
|
default: "",
|
|
50
50
|
observer: (t) => {
|
|
51
|
-
t ? i(this, r).setAttribute("
|
|
51
|
+
t ? i(this, r).setAttribute("name", t) : i(this, r).setAttribute("name", m[this.type]);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
@@ -85,9 +85,9 @@ class w extends v {
|
|
|
85
85
|
<slot name="extra"></slot>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
|
-
`,
|
|
88
|
+
`, o(this, l, this.shadowRoot.querySelector(".ea-result")), o(this, r, this.shadowRoot.querySelector(".ea-result__default-icon")), o(this, n, this.shadowRoot.querySelector(".ea-result__title slot")), o(this, u, this.shadowRoot.querySelector(
|
|
89
89
|
".ea-result__sub-title slot"
|
|
90
|
-
)),
|
|
90
|
+
)), o(this, c, this.shadowRoot.querySelector(".ea-result__extra slot"));
|
|
91
91
|
}
|
|
92
92
|
connectedCallback() {
|
|
93
93
|
super.connectedCallback();
|
|
@@ -383,8 +383,8 @@ class Y extends G {
|
|
|
383
383
|
<div class='ea-select' part='container' tabindex='-1'>
|
|
384
384
|
<ea-input class="ea-select__input" part="input" readonly>
|
|
385
385
|
<section slot="prefix" class="ea-select__tag-wrap" part="tag-wrap"></section>
|
|
386
|
-
<ea-icon slot="suffix" class="ea-select__clear-icon" part="clear-icon"
|
|
387
|
-
<ea-icon slot="suffix" class="ea-select__dropdown-icon" part="dropdown-icon"
|
|
386
|
+
<ea-icon slot="suffix" class="ea-select__clear-icon" part="clear-icon" name='xmark'></ea-icon>
|
|
387
|
+
<ea-icon slot="suffix" class="ea-select__dropdown-icon" part="dropdown-icon" name='angle-down'></ea-icon>
|
|
388
388
|
</ea-input>
|
|
389
389
|
<section class="ea-select__dropdown" part="dropdown">
|
|
390
390
|
<slot></slot>
|
|
@@ -463,7 +463,7 @@ class V extends Event {
|
|
|
463
463
|
super("ea-option-click", { bubbles: !0, composed: !0 }), this.detail = a;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
var _, C,
|
|
466
|
+
var _, C, x;
|
|
467
467
|
class tt extends H {
|
|
468
468
|
constructor() {
|
|
469
469
|
super();
|
|
@@ -501,7 +501,7 @@ class tt extends H {
|
|
|
501
501
|
* 选项选择事件
|
|
502
502
|
* @param {MouseEvent | KeyboardEvent} e
|
|
503
503
|
*/
|
|
504
|
-
l(this,
|
|
504
|
+
l(this, x, (t) => {
|
|
505
505
|
t.preventDefault(), t.stopImmediatePropagation(), !this.disabled && this.dispatchEvent(
|
|
506
506
|
new V({
|
|
507
507
|
value: this.value,
|
|
@@ -540,9 +540,9 @@ class tt extends H {
|
|
|
540
540
|
var s;
|
|
541
541
|
super.connectedCallback(), this.removeAttribute("tabindex"), (s = e(this, C)) == null || s.abort(), v(this, C, new AbortController());
|
|
542
542
|
const t = (i) => {
|
|
543
|
-
i.key === "Enter" && e(this,
|
|
543
|
+
i.key === "Enter" && e(this, x).call(this, i);
|
|
544
544
|
};
|
|
545
|
-
this.addEventListener("click", e(this,
|
|
545
|
+
this.addEventListener("click", e(this, x), {
|
|
546
546
|
signal: e(this, C).signal
|
|
547
547
|
}), this.addEventListener("keydown", t, {
|
|
548
548
|
signal: e(this, C).signal
|
|
@@ -553,16 +553,16 @@ class tt extends H {
|
|
|
553
553
|
(t = e(this, C)) == null || t.abort();
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
_ = new WeakMap(), C = new WeakMap(),
|
|
556
|
+
_ = new WeakMap(), C = new WeakMap(), x = new WeakMap();
|
|
557
557
|
window.customElements.get("ea-option") || window.customElements.define("ea-option", tt);
|
|
558
|
-
var $,
|
|
558
|
+
var $, R, A;
|
|
559
559
|
class et extends H {
|
|
560
560
|
constructor() {
|
|
561
561
|
super();
|
|
562
562
|
/** @type {HTMLElement} */
|
|
563
563
|
l(this, $);
|
|
564
564
|
/** @type {HTMLSlotElement} */
|
|
565
|
-
l(this,
|
|
565
|
+
l(this, R);
|
|
566
566
|
/** @type {AbortController} */
|
|
567
567
|
l(this, A, new AbortController());
|
|
568
568
|
y(this, "state", this.properties({
|
|
@@ -570,7 +570,7 @@ class et extends H {
|
|
|
570
570
|
type: String,
|
|
571
571
|
default: "",
|
|
572
572
|
observer: (t) => {
|
|
573
|
-
e(this,
|
|
573
|
+
e(this, R).textContent = t;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
}));
|
|
@@ -589,7 +589,7 @@ class et extends H {
|
|
|
589
589
|
<slot></slot>
|
|
590
590
|
</section>
|
|
591
591
|
</div>
|
|
592
|
-
`, v(this, $, this.shadowRoot.querySelector(".ea-option-group")), v(this,
|
|
592
|
+
`, v(this, $, this.shadowRoot.querySelector(".ea-option-group")), v(this, R, this.shadowRoot.querySelector("slot[name='header']"));
|
|
593
593
|
}
|
|
594
594
|
connectedCallback() {
|
|
595
595
|
var t;
|
|
@@ -600,7 +600,7 @@ class et extends H {
|
|
|
600
600
|
(t = e(this, A)) == null || t.abort();
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
$ = new WeakMap(),
|
|
603
|
+
$ = new WeakMap(), R = new WeakMap(), A = new WeakMap();
|
|
604
604
|
window.customElements.get("ea-option-group") || window.customElements.define("ea-option-group", et);
|
|
605
605
|
export {
|
|
606
606
|
tt as EaOption,
|