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,22 +1,22 @@
1
- var q = Object.defineProperty;
2
- var S = (t) => {
3
- throw TypeError(t);
1
+ var k = Object.defineProperty;
2
+ var x = (s) => {
3
+ throw TypeError(s);
4
4
  };
5
- var $ = (t, s, e) => s in t ? q(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
6
- var h = (t, s, e) => $(t, typeof s != "symbol" ? s + "" : s, e), E = (t, s, e) => s.has(t) || S("Cannot " + e);
7
- var i = (t, s, e) => (E(t, s, "read from private field"), e ? e.call(t) : s.get(t)), o = (t, s, e) => s.has(t) ? S("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), r = (t, s, e, a) => (E(t, s, "write to private field"), a ? a.call(t, e) : s.set(t, e), e);
8
- import { B as x } from "./Base.js";
9
- import { s as R } from "../css/ea-collapse.style.js";
10
- import { s as k } from "../css/ea-collapse-item.style.js";
11
- var v, n, d, f, g, y;
12
- class N extends x {
5
+ var N = (s, i, t) => i in s ? k(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
6
+ var p = (s, i, t) => N(s, typeof i != "symbol" ? i + "" : i, t), R = (s, i, t) => i.has(s) || x("Cannot " + t);
7
+ var e = (s, i, t) => (R(s, i, "read from private field"), t ? t.call(s) : i.get(s)), o = (s, i, t) => i.has(s) ? x("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), r = (s, i, t, a) => (R(s, i, "write to private field"), a ? a.call(s, t) : i.set(s, t), t);
8
+ import { B as $ } from "./Base.js";
9
+ import { s as B } from "../css/ea-collapse.style.js";
10
+ import { s as L } from "../css/ea-collapse-item.style.js";
11
+ var g, c, d, y, C, w;
12
+ class P extends $ {
13
13
  constructor() {
14
14
  super();
15
15
  /** @type {HTMLElement} */
16
- o(this, v);
16
+ o(this, g);
17
17
  /** @type {AbortController} */
18
- o(this, n);
19
- h(this, "state", this.properties({
18
+ o(this, c);
19
+ p(this, "state", this.properties({
20
20
  accordion: {
21
21
  type: Boolean,
22
22
  default: !1,
@@ -30,23 +30,24 @@ class N extends x {
30
30
  Array: () => !this.accordion
31
31
  },
32
32
  default: () => this.accordion ? "" : [],
33
- observer: (e) => {
34
- this.setActiveNames(e);
33
+ observer: (t) => {
34
+ this.setActiveNames(t);
35
35
  }
36
36
  },
37
37
  "expand-icon-position": {
38
38
  type: ["left", "right"],
39
39
  default: "right",
40
- observer: (e) => {
40
+ observer: (t) => {
41
41
  this.querySelectorAll("ea-collapse-item").forEach((a) => {
42
- a["expand-icon-position"] = e;
42
+ a["expand-icon-position"] = t;
43
43
  });
44
44
  }
45
45
  }
46
46
  }));
47
- h(this, "fnState", this.properties({
47
+ p(this, "fnState", this.properties({
48
48
  beforeCollapse: {
49
49
  props: !0,
50
+ rawFunction: !0,
50
51
  type: Function,
51
52
  default: null,
52
53
  observer: () => {
@@ -57,20 +58,20 @@ class N extends x {
57
58
  * 更新手风琴模式下的折叠状态
58
59
  * @param {string} [activeName]
59
60
  */
60
- o(this, d, (e = this.active) => {
61
+ o(this, d, (t = this.active) => {
61
62
  [...this.querySelectorAll("ea-collapse-item")].forEach(
62
- (l) => l.toggleAttribute("active", l.getAttribute("name") === e)
63
+ (l) => l.toggleAttribute("active", l.getAttribute("name") === t)
63
64
  );
64
65
  });
65
66
  /**
66
67
  * 更新普通模式下的折叠状态
67
68
  * @param {string[]} [activeNames]
68
69
  */
69
- o(this, f, (e = this.active) => {
70
+ o(this, y, (t = this.active) => {
70
71
  [...this.querySelectorAll("ea-collapse-item")].forEach(
71
72
  (l) => l.toggleAttribute(
72
73
  "active",
73
- e.includes(l.getAttribute("name"))
74
+ t.includes(l.getAttribute("name"))
74
75
  )
75
76
  );
76
77
  });
@@ -78,9 +79,9 @@ class N extends x {
78
79
  * 折叠项点击事件处理
79
80
  * @param {CustomEvent} e
80
81
  */
81
- o(this, g, async (e) => {
82
- e.preventDefault(), e.stopImmediatePropagation(), e.stopPropagation();
83
- const { name: a, el: l } = e.detail;
82
+ o(this, C, async (t) => {
83
+ t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
84
+ const { name: a, el: l } = t.detail;
84
85
  if (typeof this.beforeCollapse == "function")
85
86
  try {
86
87
  if (!await this.beforeCollapse({ name: a, el: l })) return;
@@ -88,10 +89,10 @@ class N extends x {
88
89
  return;
89
90
  }
90
91
  if (this.accordion)
91
- i(this, d).call(this, a), this.active = a;
92
+ e(this, d).call(this, a), this.active = a;
92
93
  else
93
94
  try {
94
- this.active.includes(a) ? (this.active = this.active.filter((_) => _ !== a), l.toggleAttribute("active", !1)) : (this.active = [...this.active, a], l.toggleAttribute("active", this.active.includes(a)));
95
+ this.active.includes(a) ? (this.active = this.active.filter((q) => q !== a), l.toggleAttribute("active", !1)) : (this.active = [...this.active, a], l.toggleAttribute("active", this.active.includes(a)));
95
96
  } catch {
96
97
  console.error(
97
98
  `${this.tagName}: When 'accordion' is false, 'active' should be an Array type.`,
@@ -110,7 +111,7 @@ class N extends x {
110
111
  /**
111
112
  * 初始化折叠项的唯一标识及折叠状态
112
113
  */
113
- o(this, y, () => {
114
+ o(this, w, () => {
114
115
  [...this.querySelectorAll("ea-collapse-item")].forEach((a, l) => {
115
116
  a.getAttribute("name") || a.setAttribute("name", l);
116
117
  });
@@ -119,10 +120,10 @@ class N extends x {
119
120
  * 设置折叠项的展开状态
120
121
  * @param {string | string[]} newVal
121
122
  */
122
- h(this, "setActiveNames", (e) => {
123
- this.accordion ? i(this, d).call(this, e) : i(this, f).call(this, e);
123
+ p(this, "setActiveNames", (t) => {
124
+ this.accordion ? e(this, d).call(this, t) : e(this, y).call(this, t);
124
125
  });
125
- this.stylesheet = R, this.$render();
126
+ this.stylesheet = B, this.$render();
126
127
  }
127
128
  static get observedAttributes() {
128
129
  return [...super.observedAttributes, "accordion", "expand-icon-position"];
@@ -132,43 +133,47 @@ class N extends x {
132
133
  <div class='ea-collapse' part='container'>
133
134
  <slot></slot>
134
135
  </div>
135
- `, r(this, v, this.shadowRoot.querySelector(".ea-collapse"));
136
+ `, r(this, g, this.shadowRoot.querySelector(".ea-collapse"));
136
137
  }
137
138
  connectedCallback() {
138
- var e;
139
- super.connectedCallback(), (e = i(this, n)) == null || e.abort(), r(this, n, new AbortController()), i(this, y).call(this), this.addEventListener("collapse-item-click", i(this, g), {
140
- signal: i(this, n).signal
139
+ var t;
140
+ super.connectedCallback(), (t = e(this, c)) == null || t.abort(), r(this, c, new AbortController()), e(this, w).call(this), this.addEventListener("collapse-item-click", e(this, C), {
141
+ signal: e(this, c).signal
141
142
  });
142
143
  }
143
144
  $beforeUnmounted() {
144
- var e;
145
- (e = i(this, n)) == null || e.abort();
145
+ var t;
146
+ (t = e(this, c)) == null || t.abort();
146
147
  }
147
148
  }
148
- v = new WeakMap(), n = new WeakMap(), d = new WeakMap(), f = new WeakMap(), g = new WeakMap(), y = new WeakMap();
149
- window.customElements.get("ea-collapse") || window.customElements.define("ea-collapse", N);
150
- var p, u, m, C, b, c, w, A;
151
- class B extends x {
149
+ g = new WeakMap(), c = new WeakMap(), d = new WeakMap(), y = new WeakMap(), C = new WeakMap(), w = new WeakMap();
150
+ window.customElements.get("ea-collapse") || window.customElements.define("ea-collapse", P);
151
+ var h, u, A, m, S, b, v, n, f, _, E;
152
+ class H extends $ {
152
153
  constructor() {
153
154
  super();
154
155
  /** @type {HTMLElement} */
155
- o(this, p);
156
+ o(this, h);
156
157
  /** @type {HTMLElement} */
157
158
  o(this, u);
158
159
  /** @type {HTMLElement} */
160
+ o(this, A);
161
+ /** @type {HTMLSlotElement} */
159
162
  o(this, m);
160
163
  /** @type {HTMLElement} */
161
- o(this, C);
164
+ o(this, S);
162
165
  /** @type {HTMLElement} */
163
166
  o(this, b);
167
+ /** @type {HTMLSlotElement} */
168
+ o(this, v);
164
169
  /** @type {AbortController} */
165
- o(this, c);
166
- h(this, "state", this.properties({
170
+ o(this, n);
171
+ p(this, "state", this.properties({
167
172
  title: {
168
173
  type: String,
169
174
  default: "",
170
- observer: (e) => {
171
- i(this, m).textContent = e;
175
+ observer: (t) => {
176
+ e(this, m).textContent = t;
172
177
  }
173
178
  },
174
179
  name: {
@@ -194,8 +199,8 @@ class B extends x {
194
199
  active: {
195
200
  type: Boolean,
196
201
  default: !1,
197
- observer: (e) => {
198
- i(this, w).call(this, e);
202
+ observer: (t) => {
203
+ e(this, f).call(this, t);
199
204
  }
200
205
  }
201
206
  }));
@@ -203,18 +208,20 @@ class B extends x {
203
208
  * 更新折叠面板高度
204
209
  * @param {boolean} isActive
205
210
  */
206
- o(this, w, (e = this.active) => {
207
- i(this, p).style.setProperty(
208
- "--ea-collapse-item-content-height",
209
- e ? `${i(this, b).scrollHeight}px` : "0"
210
- );
211
+ o(this, f, (t = this.active) => {
212
+ queueMicrotask(() => {
213
+ e(this, h).style.setProperty(
214
+ "--ea-collapse-item-content-height",
215
+ t ? `${e(this, b).scrollHeight}px` : "0"
216
+ );
217
+ });
211
218
  });
212
219
  /**
213
220
  * 折叠面板 展开/收起 事件处理
214
221
  * @param {Event} e
215
222
  */
216
- o(this, A, (e) => {
217
- e.preventDefault(), e.stopImmediatePropagation(), !this.disabled && this.emit("collapse-item-click", {
223
+ o(this, _, (t) => {
224
+ t.preventDefault(), t.stopImmediatePropagation(), !this.disabled && this.emit("collapse-item-click", {
218
225
  detail: {
219
226
  name: this.name,
220
227
  el: this
@@ -223,7 +230,16 @@ class B extends x {
223
230
  cancelable: !0
224
231
  });
225
232
  });
226
- this.stylesheet = k, this.$render();
233
+ /**
234
+ * 插槽变化事件处理
235
+ */
236
+ o(this, E, () => {
237
+ e(this, h).style.setProperty(
238
+ "--ea-collapse-item-content-height",
239
+ "auto"
240
+ ), e(this, f).call(this);
241
+ });
242
+ this.stylesheet = L, this.$render();
227
243
  }
228
244
  static get observedAttributes() {
229
245
  return [
@@ -240,7 +256,7 @@ class B extends x {
240
256
  * @return {string} 属性值
241
257
  */
242
258
  updateContainerClasslist() {
243
- const e = this.computedClasslist(
259
+ const t = this.computedClasslist(
244
260
  "ea-collapse-item",
245
261
  {
246
262
  ["--indicator-" + this["expand-icon-position"]]: this["expand-icon-position"]
@@ -249,7 +265,7 @@ class B extends x {
249
265
  disabled: this.disabled
250
266
  }
251
267
  );
252
- return i(this, p).className = e, e;
268
+ return e(this, h).className = t, t;
253
269
  }
254
270
  $render() {
255
271
  this.shadowRoot.innerHTML = `
@@ -260,7 +276,7 @@ class B extends x {
260
276
  </span>
261
277
  <span class="ea-collapse-item__indicator" part="indicator">
262
278
  <slot name="icon">
263
- <ea-icon class="default-expand-icon" icon="icon-angle-down" part="icon"></ea-icon>
279
+ <ea-icon class="default-expand-icon" name="angle-down" part="icon"></ea-icon>
264
280
  </slot>
265
281
  </span>
266
282
  </div>
@@ -268,26 +284,30 @@ class B extends x {
268
284
  <slot></slot>
269
285
  </div>
270
286
  </div>
271
- `, r(this, p, this.shadowRoot.querySelector(".ea-collapse-item")), r(this, u, this.shadowRoot.querySelector(
287
+ `, r(this, h, this.shadowRoot.querySelector(".ea-collapse-item")), r(this, u, this.shadowRoot.querySelector(
272
288
  ".ea-collapse-item__title-wrap"
273
- )), r(this, m, this.shadowRoot.querySelector(".ea-collapse-item__title")), r(this, C, this.shadowRoot.querySelector(
289
+ )), r(this, A, this.shadowRoot.querySelector(".ea-collapse-item__title")), r(this, m, this.shadowRoot.querySelector(
290
+ ".ea-collapse-item__title slot"
291
+ )), r(this, S, this.shadowRoot.querySelector(
274
292
  ".ea-collapse-item__title-icon"
275
- )), r(this, b, this.shadowRoot.querySelector(".ea-collapse-item__content")), this.updateContainerClasslist();
293
+ )), r(this, b, this.shadowRoot.querySelector(".ea-collapse-item__content")), r(this, v, this.shadowRoot.querySelector("slot:not([name])")), this.updateContainerClasslist();
276
294
  }
277
295
  connectedCallback() {
278
- var e;
279
- super.connectedCallback(), (e = i(this, c)) == null || e.abort(), r(this, c, new AbortController()), i(this, u).addEventListener("click", i(this, A), {
280
- signal: i(this, c).signal
296
+ var t;
297
+ super.connectedCallback(), (t = e(this, n)) == null || t.abort(), r(this, n, new AbortController()), e(this, u).addEventListener("click", e(this, _), {
298
+ signal: e(this, n).signal
299
+ }), e(this, v).addEventListener("slotchange", e(this, E), {
300
+ signal: e(this, n).signal
281
301
  });
282
302
  }
283
303
  $beforeUnmounted() {
284
- var e;
285
- (e = i(this, c)) == null || e.abort();
304
+ var t;
305
+ (t = e(this, n)) == null || t.abort();
286
306
  }
287
307
  }
288
- p = new WeakMap(), u = new WeakMap(), m = new WeakMap(), C = new WeakMap(), b = new WeakMap(), c = new WeakMap(), w = new WeakMap(), A = new WeakMap();
289
- window.customElements.get("ea-collapse-item") || window.customElements.define("ea-collapse-item", B);
308
+ h = new WeakMap(), u = new WeakMap(), A = new WeakMap(), m = new WeakMap(), S = new WeakMap(), b = new WeakMap(), v = new WeakMap(), n = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), E = new WeakMap();
309
+ window.customElements.get("ea-collapse-item") || window.customElements.define("ea-collapse-item", H);
290
310
  export {
291
- N as EaCollapse,
292
- B as EaCollapseItem
311
+ P as EaCollapse,
312
+ H as EaCollapseItem
293
313
  };