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.
Files changed (78) hide show
  1. package/README.md +162 -162
  2. package/dist/assets/icon.css +1 -1
  3. package/dist/components/Base.js +190 -188
  4. package/dist/components/ea-alert.js +71 -54
  5. package/dist/components/ea-avatar.js +42 -37
  6. package/dist/components/ea-breadcrumb.js +33 -33
  7. package/dist/components/ea-button.js +53 -52
  8. package/dist/components/ea-card.js +63 -27
  9. package/dist/components/ea-carousel.js +2 -2
  10. package/dist/components/ea-collapse.js +93 -73
  11. package/dist/components/ea-color-picker.js +221 -221
  12. package/dist/components/ea-container.js +90 -61
  13. package/dist/components/ea-countdown.js +77 -56
  14. package/dist/components/ea-date-picker.js +1 -1
  15. package/dist/components/ea-descriptions.js +133 -70
  16. package/dist/components/ea-dialog.js +4 -4
  17. package/dist/components/ea-drawer.js +93 -71
  18. package/dist/components/ea-empty.js +31 -23
  19. package/dist/components/ea-icon.js +122 -32
  20. package/dist/components/ea-image-preview.js +237 -193
  21. package/dist/components/ea-image.js +69 -44
  22. package/dist/components/ea-input-number.js +9 -9
  23. package/dist/components/ea-input.js +15 -15
  24. package/dist/components/ea-layout.js +10 -3
  25. package/dist/components/ea-link.js +1 -1
  26. package/dist/components/ea-menu.js +69 -53
  27. package/dist/components/ea-message-box.js +73 -73
  28. package/dist/components/ea-message.js +184 -121
  29. package/dist/components/ea-notification.js +80 -80
  30. package/dist/components/ea-overlay.js +41 -34
  31. package/dist/components/ea-page-header.js +5 -5
  32. package/dist/components/ea-pagination.js +6 -5
  33. package/dist/components/ea-popconfirm.js +133 -78
  34. package/dist/components/ea-popover.js +35 -11
  35. package/dist/components/ea-popper.js +9 -9
  36. package/dist/components/ea-progress.js +88 -71
  37. package/dist/components/ea-rate.js +1 -1
  38. package/dist/components/ea-result.js +20 -20
  39. package/dist/components/ea-select.js +119 -108
  40. package/dist/components/ea-skeleton.js +99 -82
  41. package/dist/components/ea-slider.js +88 -79
  42. package/dist/components/ea-splitter.js +34 -18
  43. package/dist/components/ea-statistic.js +72 -4
  44. package/dist/components/ea-steps.js +108 -74
  45. package/dist/components/ea-table.js +562 -434
  46. package/dist/components/ea-tabs.js +28 -28
  47. package/dist/components/ea-tag.js +37 -43
  48. package/dist/components/ea-time-picker.js +2 -6
  49. package/dist/components/ea-timeline.js +11 -12
  50. package/dist/components/ea-tooltip.js +63 -23
  51. package/dist/components/ea-tour.js +21 -21
  52. package/dist/components/ea-transfer.js +2 -2
  53. package/dist/components/ea-tree.js +1 -1
  54. package/dist/components/index.js +1 -2
  55. package/dist/css/ea-card.style.js +2 -2
  56. package/dist/css/ea-collapse-item.style.js +1 -1
  57. package/dist/css/ea-color-picker-panel.style.js +1 -1
  58. package/dist/css/ea-container.style.js +1 -1
  59. package/dist/css/ea-descriptions-item.style.js +2 -2
  60. package/dist/css/ea-descriptions.style.js +1 -1
  61. package/dist/css/ea-empty.style.js +1 -1
  62. package/dist/css/ea-footer.style.js +1 -1
  63. package/dist/css/ea-progress.style.js +1 -1
  64. package/dist/css/ea-skeleton.style.js +1 -1
  65. package/dist/css/ea-step.style.js +1 -1
  66. package/dist/css/ea-switch.style.js +1 -1
  67. package/dist/css/ea-tab.style.js +1 -1
  68. package/dist/css/ea-table-column.style.js +4 -0
  69. package/dist/css/ea-table.style.js +1 -1
  70. package/dist/css/ea-tabs.style.js +1 -1
  71. package/dist/css/ea-tag.style.js +1 -1
  72. package/dist/css/ea-time-picker.style.js +1 -1
  73. package/dist/css/ea-timeline-item.style.js +1 -1
  74. package/dist/utils/Variables.js +10 -17
  75. package/dist/utils/parseTime.js +73 -0
  76. package/package.json +302 -304
  77. package/dist/components/ea-loading.js +0 -151
  78. package/dist/components/ea-statistic2.js +0 -83
@@ -1,65 +1,64 @@
1
- var x = Object.defineProperty;
2
- var g = (e) => {
3
- throw TypeError(e);
1
+ var $ = Object.defineProperty;
2
+ var q = (s) => {
3
+ throw TypeError(s);
4
4
  };
5
- var q = (e, s, t) => s in e ? x(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
6
- var S = (e, s, t) => q(e, typeof s != "symbol" ? s + "" : s, t), A = (e, s, t) => s.has(e) || g("Cannot " + t);
7
- var i = (e, s, t) => (A(e, s, "read from private field"), t ? t.call(e) : s.get(e)), a = (e, s, t) => s.has(e) ? g("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), c = (e, s, t, r) => (A(e, s, "write to private field"), r ? r.call(e, t) : s.set(e, t), t);
8
- import { B as _ } from "./Base.js";
9
- import { s as E } from "../css/ea-step.style.js";
10
- import { s as R } from "../css/ea-steps.style.js";
11
- var n, p, h, y, l, d, m, v;
12
- class $ extends _ {
5
+ var B = (s, i, t) => i in s ? $(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
6
+ var x = (s, i, t) => B(s, typeof i != "symbol" ? i + "" : i, t), E = (s, i, t) => i.has(s) || q("Cannot " + t);
7
+ var e = (s, i, t) => (E(s, i, "read from private field"), t ? t.call(s) : i.get(s)), o = (s, i, t) => i.has(s) ? q("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), n = (s, i, t, r) => (E(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t);
8
+ import { B as R } from "./Base.js";
9
+ import { s as N } from "../css/ea-step.style.js";
10
+ import { s as k } from "../css/ea-steps.style.js";
11
+ var l, p, u, C, c, m, b, S, A;
12
+ class I extends R {
13
13
  constructor() {
14
14
  super();
15
- a(this, n);
15
+ o(this, l);
16
16
  /** @type {HTMLElement} */
17
- a(this, h);
17
+ o(this, u);
18
18
  /** @type {HTMLElement} */
19
- a(this, y);
19
+ o(this, C);
20
20
  /** @type {HTMLElement} */
21
- a(this, l);
21
+ o(this, c);
22
22
  /** @type {HTMLElement} */
23
- a(this, d);
23
+ o(this, m);
24
24
  /** @type {HTMLElement} */
25
- a(this, m);
25
+ o(this, b);
26
26
  /** @type {AbortController} */
27
- a(this, v, new AbortController());
28
- S(this, "state", this.properties({
27
+ o(this, S, new AbortController());
28
+ x(this, "state", this.properties({
29
29
  title: {
30
30
  type: String,
31
31
  default: "",
32
32
  observer: (t) => {
33
- i(this, d).textContent = t;
33
+ e(this, m).textContent = t;
34
34
  }
35
35
  },
36
36
  description: {
37
37
  type: String,
38
38
  default: "",
39
39
  observer: (t) => {
40
- i(this, m).textContent = t;
40
+ e(this, b).textContent = t;
41
41
  }
42
42
  },
43
43
  icon: {
44
44
  type: String,
45
45
  default: "",
46
46
  observer: (t) => {
47
- i(this, l).setAttribute("icon", t);
47
+ e(this, c).setAttribute("name", t);
48
48
  }
49
49
  },
50
50
  status: {
51
51
  type: ["", "wait", "process", "finish", "error", "success"],
52
52
  default: "",
53
53
  observer: (t) => {
54
- var r;
55
- this.updateContainerClasslist(), !this.icon && (t === ((r = i(this, n, p)) == null ? void 0 : r.getAttribute("finish-status")) ? (i(this, l).setAttribute("icon", "icon-ok"), i(this, l).textContent = "") : (i(this, l).setAttribute("icon", ""), i(this, l).textContent = this.index + 1));
54
+ this.updateContainerClasslist(), !this.icon && e(this, A).call(this, t);
56
55
  }
57
56
  },
58
57
  index: {
59
58
  type: Number,
60
59
  default: () => {
61
60
  var r;
62
- const t = (r = i(this, n, p)) == null ? void 0 : r.querySelectorAll("ea-step");
61
+ const t = (r = e(this, l, p)) == null ? void 0 : r.querySelectorAll("ea-step");
63
62
  return t ? Array.from(t).indexOf(this) : 0;
64
63
  },
65
64
  observer: () => {
@@ -69,7 +68,7 @@ class $ extends _ {
69
68
  type: Boolean,
70
69
  default: () => {
71
70
  var t;
72
- return !!((t = i(this, n, p)) != null && t.hasAttribute("simple"));
71
+ return !!((t = e(this, l, p)) != null && t.hasAttribute("simple"));
73
72
  },
74
73
  observer: () => {
75
74
  }
@@ -78,7 +77,7 @@ class $ extends _ {
78
77
  type: Boolean,
79
78
  default: () => {
80
79
  var t;
81
- return !!((t = i(this, n, p)) != null && t.hasAttribute("align-center"));
80
+ return !!((t = e(this, l, p)) != null && t.hasAttribute("align-center"));
82
81
  },
83
82
  observer: () => {
84
83
  this.updateContainerClasslist();
@@ -88,14 +87,22 @@ class $ extends _ {
88
87
  type: ["vertical", "horizontal"],
89
88
  default: () => {
90
89
  var t;
91
- return ((t = i(this, n, p)) == null ? void 0 : t.getAttribute("direction")) || "horizontal";
90
+ return ((t = e(this, l, p)) == null ? void 0 : t.getAttribute("direction")) || "horizontal";
92
91
  },
93
92
  observer: () => {
94
93
  this.updateContainerClasslist();
95
94
  }
96
95
  }
97
96
  }));
98
- this.stylesheet = E, this.$render();
97
+ /**
98
+ * 更新步骤状态
99
+ * @param {string} status 活动步骤状态
100
+ */
101
+ o(this, A, (t = this.status) => {
102
+ var r;
103
+ t === ((r = e(this, l, p)) == null ? void 0 : r.getAttribute("finish-status")) ? (e(this, c).setAttribute("name", "check"), e(this, c).textContent = "") : (e(this, c).setAttribute("name", ""), e(this, c).textContent = this.index + 1);
104
+ });
105
+ this.stylesheet = N, this.$render();
99
106
  }
100
107
  static get observedAttributes() {
101
108
  return [
@@ -124,14 +131,14 @@ class $ extends _ {
124
131
  icon: this.icon,
125
132
  simple: this.simple,
126
133
  last: (() => {
127
- var o;
128
- const r = (o = i(this, n, p)) == null ? void 0 : o.querySelectorAll("ea-step");
134
+ var a;
135
+ const r = (a = e(this, l, p)) == null ? void 0 : a.querySelectorAll("ea-step");
129
136
  return r ? r.length - 1 === this.index : !1;
130
137
  })(),
131
138
  first: this.index === 0
132
139
  }
133
140
  );
134
- return i(this, h) && (i(this, h).className = t), t;
141
+ return e(this, u) && (e(this, u).className = t), t;
135
142
  }
136
143
  $render() {
137
144
  this.shadowRoot.innerHTML = `
@@ -156,7 +163,7 @@ class $ extends _ {
156
163
  <slot name="simple-arrow"></slot>
157
164
  </span>
158
165
  </div>
159
- `, c(this, h, this.shadowRoot.querySelector(".ea-step")), c(this, y, this.shadowRoot.querySelector('slot[name="icon"]')), c(this, l, this.shadowRoot.querySelector(".ea-step__icon")), c(this, d, this.shadowRoot.querySelector('slot[name="title"]')), c(this, m, this.shadowRoot.querySelector(
166
+ `, n(this, u, this.shadowRoot.querySelector(".ea-step")), n(this, C, this.shadowRoot.querySelector('slot[name="icon"]')), n(this, c, this.shadowRoot.querySelector(".ea-step__icon")), n(this, m, this.shadowRoot.querySelector('slot[name="title"]')), n(this, b, this.shadowRoot.querySelector(
160
167
  'slot[name="description"]'
161
168
  )), this.updateContainerClasslist();
162
169
  }
@@ -164,26 +171,28 @@ class $ extends _ {
164
171
  super.connectedCallback();
165
172
  }
166
173
  $beforeUnmounted() {
167
- i(this, v).abort();
174
+ e(this, S).abort();
168
175
  }
169
176
  }
170
- n = new WeakSet(), p = function() {
177
+ l = new WeakSet(), p = function() {
171
178
  try {
172
179
  return this.closest("ea-steps");
173
180
  } catch {
174
181
  return null;
175
182
  }
176
- }, h = new WeakMap(), y = new WeakMap(), l = new WeakMap(), d = new WeakMap(), m = new WeakMap(), v = new WeakMap();
177
- window.customElements.get("ea-step") || window.customElements.define("ea-step", $);
178
- var b, w, C;
179
- class B extends _ {
183
+ }, u = new WeakMap(), C = new WeakMap(), c = new WeakMap(), m = new WeakMap(), b = new WeakMap(), S = new WeakMap(), A = new WeakMap();
184
+ window.customElements.get("ea-step") || window.customElements.define("ea-step", I);
185
+ var f, y, h, v, w, _;
186
+ class L extends R {
180
187
  constructor() {
181
188
  super();
182
189
  /** @type {HTMLElement} */
183
- a(this, b);
190
+ o(this, f);
191
+ /** @type {HTMLSlotElement} */
192
+ o(this, y);
184
193
  /** @type {AbortController} */
185
- a(this, w, new AbortController());
186
- S(this, "state", this.properties({
194
+ o(this, h, new AbortController());
195
+ x(this, "state", this.properties({
187
196
  space: {
188
197
  type: String,
189
198
  default: "50%",
@@ -203,7 +212,7 @@ class B extends _ {
203
212
  type: Number,
204
213
  default: 0,
205
214
  observer: (t) => {
206
- i(this, C).call(this, t);
215
+ e(this, v).call(this, t);
207
216
  }
208
217
  },
209
218
  "process-status": {
@@ -228,25 +237,7 @@ class B extends _ {
228
237
  type: Boolean,
229
238
  default: !1,
230
239
  observer: (t) => {
231
- const r = [...this.querySelectorAll("ea-step")];
232
- t ? r.forEach((o) => {
233
- var u;
234
- try {
235
- (u = o.querySelector('[slot="simple-arrow"]')) == null || u.remove();
236
- } catch {
237
- }
238
- try {
239
- const f = document.createElement("ea-icon");
240
- f.setAttribute("slot", "simple-arrow"), f.setAttribute("icon", "icon-angle-right"), f.part = "simple-arrow", o.appendChild(f);
241
- } catch {
242
- }
243
- }) : r.forEach((o) => {
244
- var u;
245
- try {
246
- (u = o.querySelector('[slot="simple-arrow"]')) == null || u.remove();
247
- } catch {
248
- }
249
- }), this.updateContainerClasslist();
240
+ e(this, w).call(this, t), this.updateContainerClasslist();
250
241
  }
251
242
  }
252
243
  }));
@@ -254,12 +245,47 @@ class B extends _ {
254
245
  * 更新步骤状态
255
246
  * @param {number} active
256
247
  */
257
- a(this, C, (t) => {
258
- [...this.querySelectorAll("ea-step")].forEach((o) => {
259
- o.index < t ? o.setAttribute("status", this["finish-status"]) : o.index > t ? o.setAttribute("status", "wait") : o.setAttribute("status", this["process-status"]);
248
+ o(this, v, (t) => {
249
+ [...this.querySelectorAll("ea-step")].forEach((a) => {
250
+ a.index < t ? a.setAttribute("status", this["finish-status"]) : a.index > t ? a.setAttribute("status", "wait") : a.setAttribute("status", this["process-status"]);
251
+ });
252
+ });
253
+ /**
254
+ * 更新简单步骤状态
255
+ * @param {boolean} isSimple
256
+ */
257
+ o(this, w, (t = this.simple) => {
258
+ const r = [...this.querySelectorAll("ea-step")];
259
+ t ? r.forEach((a) => {
260
+ var d;
261
+ try {
262
+ (d = a.querySelector('[slot="simple-arrow"]')) == null || d.remove();
263
+ } catch {
264
+ }
265
+ try {
266
+ const g = document.createElement("ea-icon");
267
+ g.setAttribute("slot", "simple-arrow"), g.setAttribute("name", "angle-right"), g.part = "simple-arrow", a.appendChild(g);
268
+ } catch {
269
+ }
270
+ }) : r.forEach((a) => {
271
+ var d;
272
+ try {
273
+ (d = a.querySelector('[slot="simple-arrow"]')) == null || d.remove();
274
+ } catch {
275
+ }
260
276
  });
261
277
  });
262
- this.stylesheet = R, this.$render();
278
+ /**
279
+ * 处理 slot 变化
280
+ * 更新所有子 ea-step 组件的 index、first、last 状态和 status
281
+ */
282
+ o(this, _, () => {
283
+ const t = [...this.querySelectorAll("ea-step")];
284
+ t.forEach((r, a) => {
285
+ r.index = a, r.toggleAttribute("first", a === 0), r.toggleAttribute("last", a === t.length - 1);
286
+ }), e(this, v).call(this, this.active), e(this, w).call(this);
287
+ });
288
+ this.stylesheet = k, this.$render();
263
289
  }
264
290
  static get observedAttributes() {
265
291
  return [
@@ -288,25 +314,33 @@ class B extends _ {
288
314
  "align-center": this["align-center"]
289
315
  }
290
316
  );
291
- return i(this, b).className = t, t;
317
+ return e(this, f).className = t, t;
292
318
  }
293
319
  $render() {
294
320
  this.shadowRoot.innerHTML = `
295
321
  <div class='ea-steps' part='container'>
296
322
  <slot></slot>
297
323
  </div>
298
- `, c(this, b, this.shadowRoot.querySelector(".ea-steps"));
324
+ `, n(this, f, this.shadowRoot.querySelector(".ea-steps")), n(this, y, this.shadowRoot.querySelector("slot"));
299
325
  }
300
326
  connectedCallback() {
301
- super.connectedCallback();
327
+ var t;
328
+ super.connectedCallback(), (t = e(this, h)) == null || t.abort(), n(this, h, new AbortController()), e(this, y).addEventListener(
329
+ "slotchange",
330
+ () => {
331
+ e(this, _).call(this);
332
+ },
333
+ { signal: e(this, h).signal }
334
+ );
302
335
  }
303
336
  $beforeUnmounted() {
304
- i(this, w).abort();
337
+ var t;
338
+ (t = e(this, h)) == null || t.abort();
305
339
  }
306
340
  }
307
- b = new WeakMap(), w = new WeakMap(), C = new WeakMap();
308
- window.customElements.get("ea-steps") || window.customElements.define("ea-steps", B);
341
+ f = new WeakMap(), y = new WeakMap(), h = new WeakMap(), v = new WeakMap(), w = new WeakMap(), _ = new WeakMap();
342
+ window.customElements.get("ea-steps") || window.customElements.define("ea-steps", L);
309
343
  export {
310
- $ as EaStep,
311
- B as EaSteps
344
+ I as EaStep,
345
+ L as EaSteps
312
346
  };