easy-component-ui 3.0.11 → 3.0.12
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/dist/components/Base.js +187 -186
- package/dist/components/ea-breadcrumb.js +33 -33
- package/dist/components/ea-calendar2.js +327 -329
- package/dist/components/ea-collapse.js +100 -80
- package/dist/components/ea-color-picker.js +199 -196
- package/dist/components/ea-countdown.js +77 -56
- package/dist/components/ea-descriptions.js +133 -70
- package/dist/components/ea-drawer.js +87 -70
- package/dist/components/ea-empty.js +31 -23
- package/dist/components/ea-menu.js +68 -52
- package/dist/components/ea-overlay.js +35 -29
- package/dist/components/ea-pagination.js +1 -0
- package/dist/components/ea-popconfirm.js +132 -77
- package/dist/components/ea-popper.js +9 -9
- package/dist/components/ea-progress.js +81 -64
- package/dist/components/ea-result.js +22 -22
- package/dist/components/ea-select.js +110 -99
- package/dist/components/ea-skeleton.js +99 -82
- package/dist/components/ea-statistic.js +72 -4
- package/dist/components/ea-steps.js +104 -70
- package/dist/components/ea-table.js +514 -397
- package/dist/components/ea-tag.js +37 -43
- package/dist/components/ea-timeline.js +10 -11
- package/dist/components/index.js +1 -1
- package/dist/css/ea-card.style.js +1 -1
- 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-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-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-table-column.style.js +4 -0
- package/dist/css/ea-table.style.js +1 -1
- package/dist/css/ea-timeline-item.style.js +1 -1
- package/dist/utils/Variables.js +5 -12
- package/dist/utils/parseTime.js +73 -0
- package/package.json +1 -1
- package/dist/components/ea-statistic2.js +0 -83
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var k = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var r = (t, s, e) => (m(t, s, "read from private field"), e ? e.call(t) : s.get(t)),
|
|
8
|
-
import { B
|
|
9
|
-
import { s as
|
|
10
|
-
const
|
|
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 C = (t, s, e) => P(t, typeof s != "symbol" ? s + "" : s, e), m = (t, s, e) => s.has(t) || k("Cannot " + e);
|
|
7
|
+
var r = (t, s, e) => (m(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, i) => (m(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e), d = (t, s, e) => (m(t, s, "access private method"), e);
|
|
8
|
+
import { B } from "./Base.js";
|
|
9
|
+
import { s as A } from "../css/ea-progress.style.js";
|
|
10
|
+
const $ = `
|
|
11
11
|
<svg viewBox="0 0 100 100">
|
|
12
12
|
<circle class="ea-progress__track" part="track" cx="50" cy="50" fill="none" stroke-dasharray="302px" stroke-dashoffset="0" />
|
|
13
13
|
<circle class="ea-progress__path" part="path" cx="50" cy="50" fill="none" stroke-dasharray="302px" stroke-dashoffset="0" />
|
|
14
14
|
</svg>
|
|
15
|
-
<section class="ea-progress__percentage" part="percentage">
|
|
16
|
-
<slot></slot>
|
|
15
|
+
<section class="ea-progress__percentage-wrapper" part="percentage">
|
|
16
|
+
<slot class="ea-progress__percentage"></slot>
|
|
17
17
|
</section>
|
|
18
|
-
`,
|
|
18
|
+
`, q = `
|
|
19
19
|
<svg viewBox="0 0 100 100">
|
|
20
20
|
<mask id="myMask">
|
|
21
21
|
<rect class="mask" width="100%" height="20%" fill="white" />
|
|
@@ -26,23 +26,26 @@ const P = `
|
|
|
26
26
|
<circle class="ea-progress__track" part="track" cx="50" cy="50" fill="none" clip-path="url(#myClip)" />
|
|
27
27
|
<circle class="ea-progress__path" part="path" cx="50" cy="50" fill="none" clip-path="url(#myClip)" />
|
|
28
28
|
</svg>
|
|
29
|
-
<section class="ea-progress__percentage" part="percentage">
|
|
30
|
-
<slot></slot>
|
|
29
|
+
<section class="ea-progress__percentage-wrapper" part="percentage">
|
|
30
|
+
<slot class="ea-progress__percentage"></slot>
|
|
31
31
|
</section>
|
|
32
32
|
`;
|
|
33
|
-
var a,
|
|
34
|
-
class
|
|
33
|
+
var a, g, o, u, n, y, c, w, b;
|
|
34
|
+
class R extends B {
|
|
35
35
|
constructor() {
|
|
36
36
|
super();
|
|
37
|
+
p(this, c);
|
|
37
38
|
/** @type {HTMLElement} */
|
|
38
|
-
|
|
39
|
+
p(this, a);
|
|
39
40
|
/** @type {HTMLElement} */
|
|
40
|
-
|
|
41
|
+
p(this, g);
|
|
41
42
|
/** @type {HTMLElement} */
|
|
42
|
-
|
|
43
|
+
p(this, o);
|
|
43
44
|
/** @type {HTMLElement} */
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
p(this, u);
|
|
46
|
+
/** @type {HTMLElement} */
|
|
47
|
+
p(this, n);
|
|
48
|
+
C(this, "propState", this.properties({
|
|
46
49
|
color: {
|
|
47
50
|
props: !0,
|
|
48
51
|
type: {
|
|
@@ -61,51 +64,30 @@ class B extends v {
|
|
|
61
64
|
},
|
|
62
65
|
default: () => this.getAttribute("color") || "",
|
|
63
66
|
observer: (e) => {
|
|
64
|
-
r(this,
|
|
67
|
+
r(this, y).call(this, e, e);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
}));
|
|
68
|
-
|
|
71
|
+
C(this, "state", this.properties({
|
|
69
72
|
percentage: {
|
|
70
73
|
type: Number,
|
|
71
74
|
default: 0,
|
|
72
75
|
observer: (e) => {
|
|
73
|
-
|
|
74
|
-
if (e > 100) return this.percentage = 100;
|
|
75
|
-
const i = this.querySelector("[data-percentage]"), n = {
|
|
76
|
-
success: "icon-ok-circled",
|
|
77
|
-
warning: "icon-attention-circled",
|
|
78
|
-
exception: "icon-cancel-circled"
|
|
79
|
-
}, l = {
|
|
80
|
-
line: () => e + "%",
|
|
81
|
-
circle: () => 302 * ((100 - e) / 100) + "px",
|
|
82
|
-
dashboard: () => {
|
|
83
|
-
const C = 49 - Number(this["stroke-width"].replace("px", "")) / 2, y = 2 * Math.PI * C, b = (100 - e) / 100;
|
|
84
|
-
return r(this, o).style.strokeDasharray = y * (270 / 360) + "px", r(this, d).style.strokeDasharray = y * (270 / 360) + "px", y * (270 / 360) * b + "px";
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
r(this, a).style.setProperty(
|
|
88
|
-
"--ea-progress-percentage",
|
|
89
|
-
l[this.type]()
|
|
90
|
-
), ["success", "exception", "warning"].includes(this.status) && !this["text-inside"] ? r(this, p).innerHTML = `<ea-icon class="ea-progress__status" icon="${n[this.status]}" part="status-icon"></ea-icon>` : r(this, p).textContent = e + "%", i && (i.textContent = this.percentage), r(this, u).call(this, this.color, e), this.emit("change", {
|
|
91
|
-
detail: {
|
|
92
|
-
percentage: e
|
|
93
|
-
}
|
|
94
|
-
});
|
|
76
|
+
d(this, c, b).call(this, e);
|
|
95
77
|
}
|
|
96
78
|
},
|
|
97
79
|
type: {
|
|
98
80
|
type: ["line", "circle", "dashboard"],
|
|
99
81
|
default: "line",
|
|
100
82
|
observer: () => {
|
|
101
|
-
this.$render(), this.updateContainerClasslist();
|
|
83
|
+
this.$render(), this.updateContainerClasslist(), d(this, c, b).call(this);
|
|
102
84
|
}
|
|
103
85
|
},
|
|
104
86
|
status: {
|
|
105
87
|
type: ["success", "exception", "warning"],
|
|
106
88
|
default: "",
|
|
107
89
|
observer: () => {
|
|
108
|
-
this.updateContainerClasslist();
|
|
90
|
+
this.updateContainerClasslist(), d(this, c, w).call(this);
|
|
109
91
|
}
|
|
110
92
|
},
|
|
111
93
|
"stroke-width": {
|
|
@@ -124,7 +106,7 @@ class B extends v {
|
|
|
124
106
|
default: !1,
|
|
125
107
|
observer: (e) => {
|
|
126
108
|
try {
|
|
127
|
-
e
|
|
109
|
+
e ? r(this, o).appendChild(r(this, n)) : r(this, u).appendChild(r(this, n));
|
|
128
110
|
} catch {
|
|
129
111
|
}
|
|
130
112
|
this.updateContainerClasslist();
|
|
@@ -181,24 +163,24 @@ class B extends v {
|
|
|
181
163
|
* @param {string | string[] | function} color 颜色值或函数
|
|
182
164
|
* @param {number} [percentage] 百分比
|
|
183
165
|
*/
|
|
184
|
-
|
|
166
|
+
p(this, y, (e, i = this.percentage) => {
|
|
185
167
|
if (!(!e || typeof e > "u"))
|
|
186
168
|
if (Array.isArray(e)) {
|
|
187
|
-
let
|
|
188
|
-
for (let
|
|
189
|
-
const
|
|
190
|
-
if (i <=
|
|
191
|
-
|
|
169
|
+
let l = e[0];
|
|
170
|
+
for (let f = 0; f < e.length; f++) {
|
|
171
|
+
const _ = e[f];
|
|
172
|
+
if (i <= _.percentage) {
|
|
173
|
+
l = _;
|
|
192
174
|
break;
|
|
193
175
|
}
|
|
194
176
|
}
|
|
195
|
-
r(this, o).style.setProperty("--ea-progress-path-color",
|
|
177
|
+
r(this, o).style.setProperty("--ea-progress-path-color", l == null ? void 0 : l.color);
|
|
196
178
|
} else typeof e == "string" ? r(this, o).style.setProperty("--ea-progress-path-color", e) : typeof e == "function" && r(this, o).style.setProperty(
|
|
197
179
|
"--ea-progress-path-color",
|
|
198
180
|
e(i)
|
|
199
181
|
);
|
|
200
182
|
});
|
|
201
|
-
this.stylesheet =
|
|
183
|
+
this.stylesheet = A, this.$render();
|
|
202
184
|
}
|
|
203
185
|
static get observedAttributes() {
|
|
204
186
|
return [
|
|
@@ -230,7 +212,7 @@ class B extends v {
|
|
|
230
212
|
},
|
|
231
213
|
{
|
|
232
214
|
[this.type]: this.type,
|
|
233
|
-
indeterminate: this.indeterminate && this.type === "line"
|
|
215
|
+
indeterminate: this.indeterminate && this.type === "line",
|
|
234
216
|
"striped-flow": this["striped-flow"],
|
|
235
217
|
"show-text": this["show-text"]
|
|
236
218
|
}
|
|
@@ -242,28 +224,63 @@ class B extends v {
|
|
|
242
224
|
line: `
|
|
243
225
|
<div class='ea-progress' part='container'>
|
|
244
226
|
<section class="ea-progress__track" part="track">
|
|
245
|
-
|
|
227
|
+
<section class="ea-progress__path" part="path"></section>
|
|
246
228
|
</section>
|
|
247
|
-
<section class="ea-progress__percentage" part="percentage">
|
|
229
|
+
<section class="ea-progress__percentage-wrapper" part="percentage">
|
|
248
230
|
<slot class="ea-progress__percentage"></slot>
|
|
249
231
|
</section>
|
|
250
232
|
</div>
|
|
251
233
|
`,
|
|
252
|
-
circle:
|
|
253
|
-
dashboard:
|
|
234
|
+
circle: $,
|
|
235
|
+
dashboard: q
|
|
254
236
|
};
|
|
255
237
|
this.shadowRoot.innerHTML = `
|
|
256
238
|
<div class='ea-progress' part='container'>
|
|
257
239
|
${e[this.type]}
|
|
258
240
|
</div>
|
|
259
|
-
`, h(this, a, this.shadowRoot.querySelector(".ea-progress")), h(this,
|
|
241
|
+
`, h(this, a, 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
|
+
".ea-progress__percentage-wrapper"
|
|
243
|
+
)), h(this, n, this.shadowRoot.querySelector(".ea-progress__percentage")), this.updateContainerClasslist();
|
|
260
244
|
}
|
|
261
245
|
connectedCallback() {
|
|
262
246
|
super.connectedCallback();
|
|
263
247
|
}
|
|
264
248
|
}
|
|
265
|
-
a = new WeakMap(),
|
|
266
|
-
|
|
249
|
+
a = new WeakMap(), g = new WeakMap(), o = new WeakMap(), u = new WeakMap(), n = new WeakMap(), y = new WeakMap(), c = new WeakSet(), /**
|
|
250
|
+
* 更新状态文本/图标
|
|
251
|
+
*/
|
|
252
|
+
w = function() {
|
|
253
|
+
const e = {
|
|
254
|
+
success: "icon-ok-circled",
|
|
255
|
+
warning: "icon-attention-circled",
|
|
256
|
+
exception: "icon-cancel-circled"
|
|
257
|
+
};
|
|
258
|
+
["success", "exception", "warning"].includes(this.status) && !this["text-inside"] ? r(this, n).innerHTML = `<ea-icon class="ea-progress__status" icon="${e[this.status]}" part="status-icon"></ea-icon>` : r(this, n).textContent = this.percentage + "%";
|
|
259
|
+
}, /**
|
|
260
|
+
* 更新进度条百分比
|
|
261
|
+
* @param {number} [newVal] 新的百分比值
|
|
262
|
+
*/
|
|
263
|
+
b = function(e = this.percentage) {
|
|
264
|
+
if (e < 0) return this.percentage = 0;
|
|
265
|
+
if (e > 100) return this.percentage = 100;
|
|
266
|
+
const i = this.querySelector("[data-percentage]"), l = {
|
|
267
|
+
line: () => e + "%",
|
|
268
|
+
circle: () => 302 * ((100 - e) / 100) + "px",
|
|
269
|
+
dashboard: () => {
|
|
270
|
+
const _ = 49 - Number(this["stroke-width"].replace("px", "")) / 2, x = 2 * Math.PI * _, v = (100 - e) / 100;
|
|
271
|
+
return r(this, o).style.strokeDasharray = x * (270 / 360) + "px", r(this, g).style.strokeDasharray = x * (270 / 360) + "px", x * (270 / 360) * v + "px";
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
r(this, a).style.setProperty(
|
|
275
|
+
"--ea-progress-percentage",
|
|
276
|
+
l[this.type]()
|
|
277
|
+
), d(this, c, w).call(this), i && (i.textContent = this.percentage), r(this, y).call(this, this.color, e), this.emit("change", {
|
|
278
|
+
detail: {
|
|
279
|
+
percentage: e
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
window.customElements.get("ea-progress") || window.customElements.define("ea-progress", R);
|
|
267
284
|
export {
|
|
268
|
-
|
|
285
|
+
R as EaProgress
|
|
269
286
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
2
|
var h = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var p = (e, s, t) =>
|
|
7
|
-
var i = (e, s, t) => (_(e, s, "read from private field"), t ? t.call(e) : s.get(e)),
|
|
8
|
-
import { B as
|
|
9
|
-
import { s as
|
|
10
|
-
import { t as
|
|
11
|
-
var l,
|
|
12
|
-
class
|
|
5
|
+
var y = (e, s, t) => s in e ? m(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
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)), o = (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), a = (e, s, t, d) => (_(e, s, "write to private field"), d ? d.call(e, t) : s.set(e, t), t);
|
|
8
|
+
import { B as v } from "./Base.js";
|
|
9
|
+
import { s as f } from "../css/ea-result.style.js";
|
|
10
|
+
import { t as b } from "../utils/Variables.js";
|
|
11
|
+
var l, r, n, u, c;
|
|
12
|
+
class w extends v {
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
/** @type {HTMLElement} */
|
|
16
|
-
|
|
16
|
+
o(this, l);
|
|
17
17
|
/** @type {HTMLElement} */
|
|
18
|
-
|
|
18
|
+
o(this, r);
|
|
19
19
|
/** @type {HTMLElement} */
|
|
20
|
-
|
|
20
|
+
o(this, n);
|
|
21
21
|
/** @type {HTMLElement} */
|
|
22
|
-
|
|
22
|
+
o(this, u);
|
|
23
23
|
/** @type {HTMLElement} */
|
|
24
|
-
|
|
24
|
+
o(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,
|
|
30
|
+
i(this, r).setAttribute("icon", `icon-${b[t]}`), this.updateContainerClasslist();
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
title: {
|
|
@@ -48,11 +48,11 @@ class f extends y {
|
|
|
48
48
|
type: String,
|
|
49
49
|
default: "",
|
|
50
50
|
observer: (t) => {
|
|
51
|
-
i(this,
|
|
51
|
+
t ? i(this, r).setAttribute("icon", t) : i(this, r).setAttribute("icon", `icon-${b[this.type]}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
55
|
-
this.stylesheet =
|
|
55
|
+
this.stylesheet = f, this.$render();
|
|
56
56
|
}
|
|
57
57
|
static get observedAttributes() {
|
|
58
58
|
return [...super.observedAttributes, "type", "title", "sub-title", "icon"];
|
|
@@ -85,16 +85,16 @@ class f extends y {
|
|
|
85
85
|
<slot name="extra"></slot>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
|
-
`,
|
|
88
|
+
`, a(this, l, this.shadowRoot.querySelector(".ea-result")), a(this, r, this.shadowRoot.querySelector(".ea-result__default-icon")), a(this, n, this.shadowRoot.querySelector(".ea-result__title slot")), a(this, u, this.shadowRoot.querySelector(
|
|
89
89
|
".ea-result__sub-title slot"
|
|
90
|
-
)),
|
|
90
|
+
)), a(this, c, this.shadowRoot.querySelector(".ea-result__extra slot"));
|
|
91
91
|
}
|
|
92
92
|
connectedCallback() {
|
|
93
93
|
super.connectedCallback();
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
l = new WeakMap(),
|
|
97
|
-
window.customElements.get("ea-result") || window.customElements.define("ea-result",
|
|
96
|
+
l = new WeakMap(), r = new WeakMap(), n = new WeakMap(), u = new WeakMap(), c = new WeakMap();
|
|
97
|
+
window.customElements.get("ea-result") || window.customElements.define("ea-result", w);
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
w as EaResult
|
|
100
100
|
};
|