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,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
|
};
|