easy-component-ui 3.0.10 → 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-carousel.js +71 -70
- 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-carousel.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-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,66 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var q = Object.defineProperty;
|
|
2
|
+
var E = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import { B as
|
|
9
|
-
import { s as
|
|
10
|
-
import { E as
|
|
11
|
-
import { s as
|
|
12
|
-
var
|
|
13
|
-
class
|
|
5
|
+
var x = (e, a, t) => a in e ? q(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
6
|
+
var w = (e, a, t) => x(e, typeof a != "symbol" ? a + "" : a, t), k = (e, a, t) => a.has(e) || E("Cannot " + t);
|
|
7
|
+
var s = (e, a, t) => (k(e, a, "read from private field"), t ? t.call(e) : a.get(e)), r = (e, a, t) => a.has(e) ? E("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t), u = (e, a, t, i) => (k(e, a, "write to private field"), i ? i.call(e, t) : a.set(e, t), t), c = (e, a, t) => (k(e, a, "access private method"), t);
|
|
8
|
+
import { B as S } from "./Base.js";
|
|
9
|
+
import { s as H } from "../css/ea-skeleton.style.js";
|
|
10
|
+
import { E as N } from "../utils/Utils.js";
|
|
11
|
+
import { s as $ } from "../css/ea-skeleton-item.style.js";
|
|
12
|
+
var f, C, h, m, n, l, v, T, A, L, y, p;
|
|
13
|
+
class B extends S {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
|
+
r(this, l);
|
|
16
17
|
/** @type {HTMLElement} */
|
|
17
|
-
|
|
18
|
-
/** @type {
|
|
19
|
-
|
|
20
|
-
/** @type {
|
|
21
|
-
|
|
18
|
+
r(this, f);
|
|
19
|
+
/** @type {HTMLSlotElement} */
|
|
20
|
+
r(this, C);
|
|
21
|
+
/** @type {HTMLSlotElement} */
|
|
22
|
+
r(this, h);
|
|
22
23
|
/** @type {AbortController} */
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
r(this, m);
|
|
25
|
+
r(this, n, {
|
|
25
26
|
isChildrenReady: !1,
|
|
26
27
|
templateNode: null,
|
|
27
28
|
loadingThrottle: null
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
+
w(this, "state", this.properties({
|
|
30
31
|
rows: {
|
|
31
32
|
type: Number,
|
|
32
33
|
default: 4,
|
|
33
|
-
observer: () => {
|
|
34
|
+
observer: async (t) => {
|
|
35
|
+
await c(this, l, v).call(this), s(this, y).call(this, t), s(this, p).call(this, this.animated);
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
38
|
animated: {
|
|
37
39
|
type: Boolean,
|
|
38
40
|
default: !1,
|
|
39
|
-
observer: (
|
|
40
|
-
|
|
41
|
+
observer: async (t) => {
|
|
42
|
+
await c(this, l, v).call(this), s(this, p).call(this, t);
|
|
41
43
|
}
|
|
42
44
|
},
|
|
43
45
|
count: {
|
|
44
46
|
type: Number,
|
|
45
47
|
default: 1,
|
|
46
|
-
observer: async (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (i.length || (i = [a(this, r)]), !a(this, l).templateNode) {
|
|
51
|
-
const n = document.createDocumentFragment();
|
|
52
|
-
i.forEach((b) => {
|
|
53
|
-
n.appendChild(b.cloneNode(!0));
|
|
54
|
-
}), a(this, l).templateNode = n;
|
|
55
|
-
}
|
|
56
|
-
const d = document.createDocumentFragment();
|
|
57
|
-
for (let n = 0; n < e; n++) {
|
|
58
|
-
const b = a(this, l).templateNode.cloneNode(!0);
|
|
59
|
-
d.appendChild(b);
|
|
60
|
-
}
|
|
61
|
-
i.length > 1 ? (i.forEach((n) => {
|
|
62
|
-
n.remove();
|
|
63
|
-
}), this.appendChild(d)) : i.length === 1 && i[0].tagName === "EA-SKELETON-ITEM" ? ((C = i[0]) == null || C.remove(), this.appendChild(d)) : (i[0].innerHTML = "", i[0].appendChild(d));
|
|
48
|
+
observer: async (t) => {
|
|
49
|
+
await c(this, l, v).call(this);
|
|
50
|
+
const i = c(this, l, T).call(this), o = c(this, l, L).call(this, t, i), [d] = i, b = i.length > 1, M = (d == null ? void 0 : d.tagName) === "EA-SKELETON-ITEM";
|
|
51
|
+
b || M ? (i.forEach((R) => R.remove()), this.appendChild(o)) : (d.innerHTML = "", d.appendChild(o));
|
|
64
52
|
}
|
|
65
53
|
},
|
|
66
54
|
"throttle-leading": {
|
|
@@ -78,17 +66,17 @@ class M extends E {
|
|
|
78
66
|
loading: {
|
|
79
67
|
type: Boolean,
|
|
80
68
|
default: !0,
|
|
81
|
-
observer: (
|
|
69
|
+
observer: (t) => {
|
|
82
70
|
if (this["throttle-trailing"] || this["throttle-leading"])
|
|
83
71
|
try {
|
|
84
|
-
clearTimeout(
|
|
72
|
+
clearTimeout(s(this, n).loadingThrottle), s(this, n).loadingThrottle = null;
|
|
85
73
|
} catch {
|
|
86
74
|
}
|
|
87
|
-
|
|
75
|
+
s(this, n).loadingThrottle = N.timeout(
|
|
88
76
|
() => {
|
|
89
77
|
this.updateContainerClasslist();
|
|
90
78
|
},
|
|
91
|
-
(
|
|
79
|
+
(t ? this["throttle-trailing"] : this["throttle-leading"]) || 0
|
|
92
80
|
);
|
|
93
81
|
}
|
|
94
82
|
}
|
|
@@ -98,23 +86,23 @@ class M extends E {
|
|
|
98
86
|
* @param {Number} rows
|
|
99
87
|
* @returns
|
|
100
88
|
*/
|
|
101
|
-
|
|
102
|
-
this.querySelectorAll("ea-skeleton-item").length || (
|
|
103
|
-
${Array.from({ length:
|
|
104
|
-
() =>
|
|
89
|
+
r(this, y, (t = this.rows) => {
|
|
90
|
+
this.querySelectorAll("ea-skeleton-item").length || (s(this, h).innerHTML = this.html(`
|
|
91
|
+
${Array.from({ length: t }).map(
|
|
92
|
+
() => N.EaElement.h("ea-skeleton-item", null, {
|
|
105
93
|
variant: "p",
|
|
106
94
|
animated: this.animated
|
|
107
95
|
})
|
|
108
|
-
).join("")}`);
|
|
96
|
+
).join("")}`));
|
|
109
97
|
});
|
|
110
98
|
/**
|
|
111
99
|
* 更新动画状态
|
|
112
100
|
* @param {boolean} isAnimated
|
|
113
101
|
*/
|
|
114
|
-
|
|
115
|
-
[...this.querySelectorAll("ea-skeleton-item")].forEach((
|
|
102
|
+
r(this, p, (t) => {
|
|
103
|
+
s(this, h).assignedElements().filter((o) => o.tagName.toLocaleLowerCase() === "ea-skeleton-item").concat([...s(this, h).querySelectorAll("ea-skeleton-item")]).forEach((o) => o.toggleAttribute("animated", t));
|
|
116
104
|
});
|
|
117
|
-
this.stylesheet =
|
|
105
|
+
this.stylesheet = H, this.$render();
|
|
118
106
|
}
|
|
119
107
|
static get observedAttributes() {
|
|
120
108
|
return [
|
|
@@ -133,41 +121,70 @@ class M extends E {
|
|
|
133
121
|
* @return {string} 属性值
|
|
134
122
|
*/
|
|
135
123
|
updateContainerClasslist() {
|
|
136
|
-
const
|
|
124
|
+
const t = this.computedClasslist(
|
|
137
125
|
"ea-skeleton",
|
|
138
126
|
{},
|
|
139
127
|
{
|
|
140
128
|
loading: this.loading
|
|
141
129
|
}
|
|
142
130
|
);
|
|
143
|
-
return
|
|
131
|
+
return s(this, f).className = t, t;
|
|
144
132
|
}
|
|
145
133
|
async $render() {
|
|
146
134
|
this.shadowRoot.innerHTML = `
|
|
147
135
|
<div class='ea-skeleton' part='container'>
|
|
148
|
-
<slot id="default"></slot>
|
|
149
|
-
<slot id="template" name="template"></slot>
|
|
136
|
+
<slot id="default" part="default-slot"></slot>
|
|
137
|
+
<slot id="template" name="template" part="template-slot"></slot>
|
|
150
138
|
</div>
|
|
151
|
-
`,
|
|
139
|
+
`, u(this, f, this.shadowRoot.querySelector(".ea-skeleton")), u(this, C, this.shadowRoot.querySelector("#default")), u(this, h, this.shadowRoot.querySelector("#template")), this.updateContainerClasslist();
|
|
152
140
|
}
|
|
153
141
|
async connectedCallback() {
|
|
154
142
|
var i;
|
|
155
|
-
super.connectedCallback(), (i =
|
|
156
|
-
const
|
|
157
|
-
|
|
143
|
+
super.connectedCallback(), (i = s(this, m)) == null || i.abort(), u(this, m, new AbortController());
|
|
144
|
+
const t = () => {
|
|
145
|
+
s(this, p).call(this, this.animated);
|
|
158
146
|
};
|
|
159
|
-
|
|
160
|
-
signal:
|
|
147
|
+
s(this, y).call(this), s(this, h).addEventListener("slotchange", t, {
|
|
148
|
+
signal: s(this, m).signal
|
|
161
149
|
});
|
|
162
150
|
}
|
|
163
151
|
$beforeUnmounted() {
|
|
164
|
-
var
|
|
165
|
-
(
|
|
152
|
+
var t;
|
|
153
|
+
(t = s(this, m)) == null || t.abort();
|
|
166
154
|
}
|
|
167
155
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
156
|
+
f = new WeakMap(), C = new WeakMap(), h = new WeakMap(), m = new WeakMap(), n = new WeakMap(), l = new WeakSet(), v = async function() {
|
|
157
|
+
s(this, n).isChildrenReady || (await customElements.whenDefined("ea-skeleton-item"), s(this, n).isChildrenReady = !0);
|
|
158
|
+
}, /**
|
|
159
|
+
* 获取模板元素
|
|
160
|
+
* @returns {HTMLElement[]}
|
|
161
|
+
*/
|
|
162
|
+
T = function() {
|
|
163
|
+
const t = [...this.querySelectorAll("[slot='template']")];
|
|
164
|
+
return t.length ? t : [s(this, h)];
|
|
165
|
+
}, /**
|
|
166
|
+
* 克隆模板元素
|
|
167
|
+
* @param {HTMLElement[]} elements
|
|
168
|
+
* @returns {DocumentFragment}
|
|
169
|
+
*/
|
|
170
|
+
A = function(t) {
|
|
171
|
+
if (s(this, n).templateNode) return s(this, n).templateNode;
|
|
172
|
+
const i = document.createDocumentFragment();
|
|
173
|
+
return t.forEach((o) => i.appendChild(o.cloneNode(!0))), s(this, n).templateNode = i, i;
|
|
174
|
+
}, /**
|
|
175
|
+
* 渲染模板元素
|
|
176
|
+
* @param {number} count
|
|
177
|
+
* @param {HTMLElement[]} elements
|
|
178
|
+
* @returns {DocumentFragment}
|
|
179
|
+
*/
|
|
180
|
+
L = function(t, i) {
|
|
181
|
+
const o = c(this, l, A).call(this, i), d = document.createDocumentFragment();
|
|
182
|
+
for (let b = 0; b < t; b++)
|
|
183
|
+
d.appendChild(o.cloneNode(!0));
|
|
184
|
+
return d;
|
|
185
|
+
}, y = new WeakMap(), p = new WeakMap();
|
|
186
|
+
window.customElements.get("ea-skeleton") || window.customElements.define("ea-skeleton", B);
|
|
187
|
+
const I = `
|
|
171
188
|
<svg id="skeletonImagePlaceholder" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" part="image-svg">
|
|
172
189
|
<path fill="#c0c4cc" d="M0 0h100v100H0z" />
|
|
173
190
|
<path fill="#fff" d="M15 20h70v60H15z" />
|
|
@@ -176,13 +193,13 @@ const L = `
|
|
|
176
193
|
<path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />
|
|
177
194
|
</svg>
|
|
178
195
|
`;
|
|
179
|
-
var
|
|
180
|
-
class
|
|
196
|
+
var g;
|
|
197
|
+
class z extends S {
|
|
181
198
|
constructor() {
|
|
182
199
|
super();
|
|
183
200
|
/** @type {HTMLElement} */
|
|
184
|
-
|
|
185
|
-
|
|
201
|
+
r(this, g);
|
|
202
|
+
w(this, "state", this.properties({
|
|
186
203
|
variant: {
|
|
187
204
|
type: [
|
|
188
205
|
"p",
|
|
@@ -196,8 +213,8 @@ class R extends E {
|
|
|
196
213
|
"rect"
|
|
197
214
|
],
|
|
198
215
|
default: "p",
|
|
199
|
-
observer: (
|
|
200
|
-
|
|
216
|
+
observer: (t) => {
|
|
217
|
+
t === "image" && (s(this, g).innerHTML = I), this.updateContainerClasslist();
|
|
201
218
|
}
|
|
202
219
|
},
|
|
203
220
|
animated: {
|
|
@@ -208,7 +225,7 @@ class R extends E {
|
|
|
208
225
|
}
|
|
209
226
|
}
|
|
210
227
|
}));
|
|
211
|
-
this.stylesheet =
|
|
228
|
+
this.stylesheet = $, this.$render();
|
|
212
229
|
}
|
|
213
230
|
static get observedAttributes() {
|
|
214
231
|
return [...super.observedAttributes, "variant", "animated"];
|
|
@@ -218,7 +235,7 @@ class R extends E {
|
|
|
218
235
|
* @return {string} 属性值
|
|
219
236
|
*/
|
|
220
237
|
updateContainerClasslist() {
|
|
221
|
-
const
|
|
238
|
+
const t = this.computedClasslist(
|
|
222
239
|
"ea-skeleton-item",
|
|
223
240
|
{
|
|
224
241
|
["--" + this.variant]: this.variant
|
|
@@ -227,20 +244,20 @@ class R extends E {
|
|
|
227
244
|
animated: this.animated
|
|
228
245
|
}
|
|
229
246
|
);
|
|
230
|
-
return
|
|
247
|
+
return s(this, g).className = t, t;
|
|
231
248
|
}
|
|
232
249
|
$render() {
|
|
233
250
|
this.shadowRoot.innerHTML = `
|
|
234
251
|
<div class='ea-skeleton-item' part='container'></div>
|
|
235
|
-
`,
|
|
252
|
+
`, u(this, g, this.shadowRoot.querySelector(".ea-skeleton-item"));
|
|
236
253
|
}
|
|
237
254
|
connectedCallback() {
|
|
238
255
|
super.connectedCallback();
|
|
239
256
|
}
|
|
240
257
|
}
|
|
241
|
-
|
|
242
|
-
window.customElements.get("ea-skeleton-item") || window.customElements.define("ea-skeleton-item",
|
|
258
|
+
g = new WeakMap();
|
|
259
|
+
window.customElements.get("ea-skeleton-item") || window.customElements.define("ea-skeleton-item", z);
|
|
243
260
|
export {
|
|
244
|
-
|
|
245
|
-
|
|
261
|
+
B as EaSkeleton,
|
|
262
|
+
z as EaSkeletonItem
|
|
246
263
|
};
|
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var p = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var _ = (t, e, s) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
+
var d = (t, e, s) => _(t, typeof e != "symbol" ? e + "" : e, s), f = (t, e, s) => e.has(t) || p("Cannot " + s);
|
|
7
|
+
var h = (t, e, s) => (f(t, e, "read from private field"), s ? s.call(t) : e.get(t)), a = (t, e, s) => e.has(t) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), i = (t, e, s, u) => (f(t, e, "write to private field"), u ? u.call(t, s) : e.set(t, s), s);
|
|
8
|
+
import { B as x } from "./Base.js";
|
|
9
|
+
import { s as b } from "../css/ea-statistic.style.js";
|
|
10
|
+
var n, r, o, c, l;
|
|
11
|
+
class w extends x {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
/** @type {HTMLElement} */
|
|
15
|
+
a(this, n);
|
|
16
|
+
/** @type {HTMLElement} */
|
|
17
|
+
a(this, r);
|
|
18
|
+
/** @type {HTMLElement} */
|
|
19
|
+
a(this, o);
|
|
20
|
+
/** @type {HTMLElement} */
|
|
21
|
+
a(this, c);
|
|
22
|
+
/** @type {HTMLElement} */
|
|
23
|
+
a(this, l);
|
|
24
|
+
d(this, "state", this.properties({
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "",
|
|
28
|
+
observer: (s) => {
|
|
29
|
+
h(this, r).textContent = s;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 0,
|
|
35
|
+
/** @param {Number} newVal */
|
|
36
|
+
observer: (s) => {
|
|
37
|
+
h(this, o).textContent = s.toLocaleString();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
this.stylesheet = b, this.$render();
|
|
42
|
+
}
|
|
43
|
+
static get observedAttributes() {
|
|
44
|
+
return [...super.observedAttributes, "title", "value"];
|
|
45
|
+
}
|
|
46
|
+
$render() {
|
|
47
|
+
this.shadowRoot.innerHTML = `
|
|
48
|
+
<div class='ea-statistic' part='container'>
|
|
49
|
+
<header class='ea-statistic__header' part='title'>
|
|
50
|
+
<slot name='title'></slot>
|
|
51
|
+
</header>
|
|
52
|
+
<main class='ea-statistic__content' part='content'>
|
|
53
|
+
<span class='ea-statistic__prefix' part='prefix'>
|
|
54
|
+
<slot name='prefix'></slot>
|
|
55
|
+
</span>
|
|
56
|
+
<span class='ea-statistic__number' part='number'>
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</span>
|
|
59
|
+
<span class='ea-statistic__suffix' part='suffix'>
|
|
60
|
+
<slot name='suffix'></slot>
|
|
61
|
+
</span>
|
|
62
|
+
</main>
|
|
63
|
+
</div>
|
|
64
|
+
`, i(this, n, this.shadowRoot.querySelector(".ea-statistic")), i(this, r, this.shadowRoot.querySelector(".ea-statistic__header slot")), i(this, o, this.shadowRoot.querySelector(".ea-statistic__number")), i(this, c, this.shadowRoot.querySelector(".ea-statistic__prefix slot")), i(this, l, this.shadowRoot.querySelector(".ea-statistic__suffix slot"));
|
|
65
|
+
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
super.connectedCallback();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
n = new WeakMap(), r = new WeakMap(), o = new WeakMap(), c = new WeakMap(), l = new WeakMap();
|
|
71
|
+
window.customElements.get("ea-statistic") || window.customElements.define("ea-statistic", w);
|
|
4
72
|
export {
|
|
5
|
-
|
|
73
|
+
w as EaStatistic
|
|
6
74
|
};
|