easy-component-ui 3.0.12 → 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 (61) hide show
  1. package/README.md +162 -162
  2. package/dist/assets/icon.css +1 -1
  3. package/dist/components/Base.js +3 -2
  4. package/dist/components/ea-alert.js +71 -54
  5. package/dist/components/ea-avatar.js +42 -37
  6. package/dist/components/ea-button.js +53 -52
  7. package/dist/components/ea-calendar2.js +329 -327
  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 +28 -28
  11. package/dist/components/ea-color-picker.js +63 -66
  12. package/dist/components/ea-container.js +90 -61
  13. package/dist/components/ea-date-picker.js +1 -1
  14. package/dist/components/ea-dialog.js +4 -4
  15. package/dist/components/ea-drawer.js +51 -46
  16. package/dist/components/ea-icon.js +122 -32
  17. package/dist/components/ea-image-preview.js +237 -193
  18. package/dist/components/ea-image.js +69 -44
  19. package/dist/components/ea-input-number.js +9 -9
  20. package/dist/components/ea-input.js +15 -15
  21. package/dist/components/ea-layout.js +10 -3
  22. package/dist/components/ea-link.js +1 -1
  23. package/dist/components/ea-menu.js +1 -1
  24. package/dist/components/ea-message-box.js +73 -73
  25. package/dist/components/ea-message.js +184 -121
  26. package/dist/components/ea-notification.js +80 -80
  27. package/dist/components/ea-overlay.js +20 -19
  28. package/dist/components/ea-page-header.js +5 -5
  29. package/dist/components/ea-pagination.js +5 -5
  30. package/dist/components/ea-popconfirm.js +3 -3
  31. package/dist/components/ea-popover.js +35 -11
  32. package/dist/components/ea-progress.js +28 -28
  33. package/dist/components/ea-rate.js +1 -1
  34. package/dist/components/ea-result.js +13 -13
  35. package/dist/components/ea-select.js +12 -12
  36. package/dist/components/ea-slider.js +88 -79
  37. package/dist/components/ea-splitter.js +34 -18
  38. package/dist/components/ea-steps.js +33 -33
  39. package/dist/components/ea-table.js +332 -321
  40. package/dist/components/ea-tabs.js +28 -28
  41. package/dist/components/ea-tag.js +6 -6
  42. package/dist/components/ea-time-picker.js +2 -6
  43. package/dist/components/ea-timeline.js +1 -1
  44. package/dist/components/ea-tooltip.js +63 -23
  45. package/dist/components/ea-tour.js +21 -21
  46. package/dist/components/ea-transfer.js +2 -2
  47. package/dist/components/ea-tree.js +1 -1
  48. package/dist/components/index.js +0 -1
  49. package/dist/css/ea-card.style.js +2 -2
  50. package/dist/css/ea-container.style.js +1 -1
  51. package/dist/css/ea-footer.style.js +1 -1
  52. package/dist/css/ea-progress.style.js +1 -1
  53. package/dist/css/ea-step.style.js +1 -1
  54. package/dist/css/ea-switch.style.js +1 -1
  55. package/dist/css/ea-tab.style.js +1 -1
  56. package/dist/css/ea-tabs.style.js +1 -1
  57. package/dist/css/ea-tag.style.js +1 -1
  58. package/dist/css/ea-time-picker.style.js +1 -1
  59. package/dist/utils/Variables.js +10 -10
  60. package/package.json +302 -304
  61. package/dist/components/ea-loading.js +0 -151
@@ -1,46 +1,46 @@
1
- var U = Object.defineProperty;
1
+ var $ = Object.defineProperty;
2
2
  var O = (i) => {
3
3
  throw TypeError(i);
4
4
  };
5
- var z = (i, s, e) => s in i ? U(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e;
5
+ var z = (i, s, e) => s in i ? $(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e;
6
6
  var H = (i, s, e) => z(i, typeof s != "symbol" ? s + "" : s, e), I = (i, s, e) => s.has(i) || O("Cannot " + e);
7
- var t = (i, s, e) => (I(i, s, "read from private field"), e ? e.call(i) : s.get(i)), o = (i, s, e) => s.has(i) ? O("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), l = (i, s, e, n) => (I(i, s, "write to private field"), n ? n.call(i, e) : s.set(i, e), e);
7
+ var t = (i, s, e) => (I(i, s, "read from private field"), e ? e.call(i) : s.get(i)), a = (i, s, e) => s.has(i) ? O("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), l = (i, s, e, n) => (I(i, s, "write to private field"), n ? n.call(i, e) : s.set(i, e), e);
8
8
  import { EaOverlay as V } from "./ea-overlay.js";
9
9
  import "./ea-input.js";
10
10
  import { s as N } from "../css/ea-message-box.style.js";
11
11
  import { t as K } from "../utils/timeout.js";
12
- import { E as $ } from "../utils/Utils.js";
13
- var p, f, v, y, g, B, C, a, _, E, r, h, c, u, b, S, L, T, w, M;
12
+ import { E as U } from "../utils/Utils.js";
13
+ var m, f, v, y, g, B, C, o, _, E, r, h, c, u, b, S, L, T, w, M;
14
14
  class D extends V {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  /** @type {HTMLElement} */
18
- o(this, p);
18
+ a(this, m);
19
19
  /** @type {HTMLElement} */
20
- o(this, f);
20
+ a(this, f);
21
21
  /** @type {HTMLElement} */
22
- o(this, v);
22
+ a(this, v);
23
23
  /** @type {HTMLElement} */
24
- o(this, y);
24
+ a(this, y);
25
25
  /** @type {HTMLElement} */
26
- o(this, g);
26
+ a(this, g);
27
27
  /** @type {HTMLElement} */
28
- o(this, B);
28
+ a(this, B);
29
29
  /** @type {HTMLElement} */
30
- o(this, C);
30
+ a(this, C);
31
31
  /** @type {HTMLInputElement} */
32
- o(this, a);
32
+ a(this, o);
33
33
  /** @type {HTMLElement} */
34
- o(this, _);
34
+ a(this, _);
35
35
  /** @type {HTMLElement} */
36
- o(this, E);
36
+ a(this, E);
37
37
  /** @type {HTMLElement} */
38
- o(this, r);
38
+ a(this, r);
39
39
  /** @type {HTMLElement} */
40
- o(this, h);
40
+ a(this, h);
41
41
  /** @type {AbortController} */
42
- o(this, c);
43
- o(this, u, {
42
+ a(this, c);
43
+ a(this, u, {
44
44
  inputPattern: null,
45
45
  dangerouslyUseHTMLString: !1,
46
46
  confirmButtonLoading: !1
@@ -53,14 +53,14 @@ class D extends V {
53
53
  const n = this.shadowRoot.querySelector(
54
54
  ".ea-overlay__content"
55
55
  );
56
- t(this, S).call(this, e, n), t(this, p).className = this.updateContainerClasslist();
56
+ t(this, S).call(this, e, n), t(this, m).className = this.updateContainerClasslist();
57
57
  }
58
58
  },
59
59
  visible: {
60
60
  type: Boolean,
61
61
  default: !1,
62
62
  observer: async (e) => {
63
- this.status = e, t(this, p).className = this.updateContainerClasslist();
63
+ this.status = e, t(this, m).className = this.updateContainerClasslist();
64
64
  }
65
65
  },
66
66
  title: {
@@ -82,27 +82,27 @@ class D extends V {
82
82
  default: "",
83
83
  observer: (e) => {
84
84
  const n = {
85
- primary: "info",
86
- success: "ok-circled",
87
- info: "info",
88
- warning: "attention-alt",
89
- error: "cancel-circled"
85
+ primary: "circle-info",
86
+ success: "circle-check",
87
+ info: "circle-info",
88
+ warning: "triangle-exclamation",
89
+ error: "circle-xmark"
90
90
  };
91
- this.icon = `icon-${n[e]}`, t(this, p).className = this.updateContainerClasslist();
91
+ this.icon = n[e], t(this, m).className = this.updateContainerClasslist();
92
92
  }
93
93
  },
94
94
  icon: {
95
95
  type: String,
96
96
  default: "",
97
97
  observer: (e) => {
98
- t(this, y) && (t(this, y).icon = e);
98
+ t(this, y) && (t(this, y).name = e);
99
99
  }
100
100
  },
101
101
  closeIcon: {
102
102
  type: String,
103
- default: "icon-cancel",
103
+ default: "xmark",
104
104
  observer: (e) => {
105
- t(this, g).icon = e;
105
+ t(this, g).name = e;
106
106
  }
107
107
  },
108
108
  showClose: {
@@ -143,7 +143,7 @@ class D extends V {
143
143
  type: Boolean,
144
144
  default: !1,
145
145
  observer: (e) => {
146
- t(this, p).className = this.updateContainerClasslist();
146
+ t(this, m).className = this.updateContainerClasslist();
147
147
  }
148
148
  },
149
149
  roundButton: {
@@ -164,42 +164,42 @@ class D extends V {
164
164
  type: Boolean,
165
165
  default: !1,
166
166
  observer: (e) => {
167
- t(this, a).style.display = e ? "block" : "none";
167
+ t(this, o).style.display = e ? "block" : "none";
168
168
  }
169
169
  },
170
170
  inputPlaceholder: {
171
171
  type: String,
172
172
  default: "",
173
173
  observer: (e) => {
174
- t(this, a) && (t(this, a).placeholder = e);
174
+ t(this, o) && (t(this, o).placeholder = e);
175
175
  }
176
176
  },
177
177
  inputType: {
178
178
  type: String,
179
179
  default: "text",
180
180
  observer: (e) => {
181
- t(this, a) && (t(this, a).type = e);
181
+ t(this, o) && (t(this, o).type = e);
182
182
  }
183
183
  },
184
184
  inputValue: {
185
185
  type: String,
186
186
  default: "",
187
187
  observer: (e) => {
188
- t(this, a) && (t(this, a).value = e);
188
+ t(this, o) && (t(this, o).value = e);
189
189
  }
190
190
  },
191
191
  inputErrorMessage: {
192
192
  type: String,
193
193
  default: "",
194
194
  observer: (e) => {
195
- t(this, a) && this.inputPattern && (t(this, _).textContent = e);
195
+ t(this, o) && this.inputPattern && (t(this, _).textContent = e);
196
196
  }
197
197
  },
198
198
  draggable: {
199
199
  type: Boolean,
200
200
  default: !1,
201
201
  observer: (e) => {
202
- t(this, p).className = this.updateContainerClasslist();
202
+ t(this, m).className = this.updateContainerClasslist();
203
203
  }
204
204
  }
205
205
  }));
@@ -208,14 +208,14 @@ class D extends V {
208
208
  * @param {string} customEventName 自定义事件名称
209
209
  * @param {object} detail 自定义事件详情
210
210
  */
211
- o(this, b, (e, n) => {
211
+ a(this, b, (e, n) => {
212
212
  this.emit(e, {
213
213
  detail: n,
214
214
  bubbles: !0,
215
215
  composed: !0
216
216
  });
217
217
  });
218
- o(this, S, (e, n) => {
218
+ a(this, S, (e, n) => {
219
219
  n.innerHTML = `
220
220
  <div class="ea-message-box-main" part="container">
221
221
  <header class="ea-message-box-main__header" part="header">
@@ -223,7 +223,7 @@ class D extends V {
223
223
  <ea-icon class="ea-message-box-main__type-icon" part="type-icon"></ea-icon>
224
224
  <span class="ea-message-box-main__title" part="title"></span>
225
225
  </div>
226
- <ea-icon class="ea-message-box-main__icon-close" icon="icon-cancel" part="close-icon"></ea-icon>
226
+ <ea-icon class="ea-message-box-main__icon-close" name="xmark" part="close-icon"></ea-icon>
227
227
  </header>
228
228
  <main class="ea-message-box-main__content" part="content">
229
229
  <div class="ea-message-box-main__description" part="description"></div>
@@ -235,7 +235,7 @@ class D extends V {
235
235
  <ea-button class="ea-message-box-main__confirm-button" type="primary" part="confirm-button">OK</ea-button>
236
236
  </footer>
237
237
  </div>
238
- `, l(this, p, this.shadowRoot.querySelector(".ea-overlay")), l(this, f, this.shadowRoot.querySelector(
238
+ `, l(this, m, this.shadowRoot.querySelector(".ea-overlay")), l(this, f, this.shadowRoot.querySelector(
239
239
  ".ea-message-box-main__header"
240
240
  )), l(this, v, this.shadowRoot.querySelector(".ea-message-box-main__title")), l(this, y, this.shadowRoot.querySelector(
241
241
  ".ea-message-box-main__type-icon"
@@ -251,20 +251,20 @@ class D extends V {
251
251
  ".ea-message-box-main__confirm-button"
252
252
  )), l(this, C, this.shadowRoot.querySelector(
253
253
  ".ea-message-box-main__description"
254
- )), l(this, a, this.shadowRoot.querySelector(".ea-message-box-main__input")), l(this, _, this.shadowRoot.querySelector(
254
+ )), l(this, o, this.shadowRoot.querySelector(".ea-message-box-main__input")), l(this, _, this.shadowRoot.querySelector(
255
255
  ".ea-message-box-main__invalid-message"
256
- )), t(this, a) && K(() => {
257
- t(this, a).focus();
256
+ )), t(this, o) && K(() => {
257
+ t(this, o).focus();
258
258
  }, 0);
259
259
  });
260
260
  /**
261
261
  * 处理带有匹配规则的输入框输入
262
262
  * @returns {Promise<boolean>} Promise.
263
263
  */
264
- o(this, L, () => new Promise((e, n) => {
265
- if (!t(this, a) || !this.inputPattern) return e(!0);
266
- const d = this.inputPattern.test(t(this, a).value);
267
- t(this, p).classList.toggle("is-invalid", !d), d ? e(!0) : n(
264
+ a(this, L, () => new Promise((e, n) => {
265
+ if (!t(this, o) || !this.inputPattern) return e(!0);
266
+ const d = this.inputPattern.test(t(this, o).value);
267
+ t(this, m).classList.toggle("is-invalid", !d), d ? e(!0) : n(
268
268
  new Error(
269
269
  `[EaMessageBox] ${this["input-error-message"] || "input pattern is not valid."}`
270
270
  )
@@ -273,7 +273,7 @@ class D extends V {
273
273
  /**
274
274
  * 初始化确认事件
275
275
  */
276
- o(this, T, async () => {
276
+ a(this, T, async () => {
277
277
  var e;
278
278
  try {
279
279
  await t(this, L).call(this), (e = t(this, c)) == null || e.abort(), t(this, b).call(this, "confirm");
@@ -283,13 +283,13 @@ class D extends V {
283
283
  /**
284
284
  * 触发取消事件
285
285
  */
286
- o(this, w, () => {
286
+ a(this, w, () => {
287
287
  this.distinguishCancelAndClose ? t(this, b).call(this, "message-close") : t(this, b).call(this, "cancel");
288
288
  });
289
289
  /**
290
290
  * 初始化拖拽事件
291
291
  */
292
- o(this, M, (e) => {
292
+ a(this, M, (e) => {
293
293
  if (!t(this, f).contains(e.target) || t(this, f) === e.target)
294
294
  return;
295
295
  const n = new AbortController(), d = this.shadowRoot.querySelector(
@@ -338,7 +338,7 @@ class D extends V {
338
338
  return t(this, u).confirmButtonLoading;
339
339
  }
340
340
  set confirmButtonLoading(e) {
341
- t(this, u).confirmButtonLoading = e, t(this, r) && (t(this, a).disabled = e, t(this, r).loading = e);
341
+ t(this, u).confirmButtonLoading = e, t(this, r) && (t(this, o).disabled = e, t(this, r).loading = e);
342
342
  }
343
343
  // #endregion
344
344
  // ------- end -------
@@ -353,7 +353,7 @@ class D extends V {
353
353
  // #endregion
354
354
  // ------- end -------
355
355
  static get observedAttributes() {
356
- return $.Array.toLowerCamelCase([
356
+ return U.Array.toLowerCamelCase([
357
357
  ...super.observedAttributes,
358
358
  "boxType",
359
359
  "visible",
@@ -396,7 +396,7 @@ class D extends V {
396
396
  "--draggable": this.draggable
397
397
  },
398
398
  {
399
- invalid: t(this, a) && ((e = t(this, a)) == null ? void 0 : e.invalid),
399
+ invalid: t(this, o) && ((e = t(this, o)) == null ? void 0 : e.invalid),
400
400
  [`${this["box-type"]}-box`]: this["box-type"]
401
401
  }
402
402
  )}`;
@@ -433,9 +433,9 @@ class D extends V {
433
433
  (e = t(this, c)) == null || e.abort();
434
434
  }
435
435
  }
436
- p = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), g = new WeakMap(), B = new WeakMap(), C = new WeakMap(), a = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), r = new WeakMap(), h = new WeakMap(), c = new WeakMap(), u = new WeakMap(), b = new WeakMap(), S = new WeakMap(), L = new WeakMap(), T = new WeakMap(), w = new WeakMap(), M = new WeakMap();
436
+ m = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), g = new WeakMap(), B = new WeakMap(), C = new WeakMap(), o = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), r = new WeakMap(), h = new WeakMap(), c = new WeakMap(), u = new WeakMap(), b = new WeakMap(), S = new WeakMap(), L = new WeakMap(), T = new WeakMap(), w = new WeakMap(), M = new WeakMap();
437
437
  window.customElements.get("ea-message-box") || window.customElements.define("ea-message-box", D);
438
- var P, A, k, q;
438
+ var P, k, A, q;
439
439
  class X {
440
440
  /**
441
441
  *
@@ -443,7 +443,7 @@ class X {
443
443
  */
444
444
  constructor(s) {
445
445
  /** @type {MessageBoxOptions} */
446
- o(this, P, {
446
+ a(this, P, {
447
447
  boxType: "personalized",
448
448
  distinguishCancelAndClose: !1,
449
449
  title: "",
@@ -475,7 +475,7 @@ class X {
475
475
  appendTo: "body",
476
476
  beforeClose: null
477
477
  });
478
- o(this, A, [
478
+ a(this, k, [
479
479
  "inputPattern",
480
480
  "inputValidator",
481
481
  "beforeClose",
@@ -488,7 +488,7 @@ class X {
488
488
  * @param {HTMLElement} el
489
489
  * @param {String | HTMLElement} appendTo
490
490
  */
491
- o(this, k, (s, e) => {
491
+ a(this, A, (s, e) => {
492
492
  if (e instanceof HTMLElement)
493
493
  e.appendChild(s);
494
494
  else {
@@ -501,13 +501,13 @@ class X {
501
501
  * @param {MessageBoxOptions} options
502
502
  * @returns
503
503
  */
504
- o(this, q, (s) => {
504
+ a(this, q, (s) => {
505
505
  const e = document.createElement("ea-message-box");
506
506
  for (const n in s)
507
- if (t(this, A).includes(n))
507
+ if (t(this, k).includes(n))
508
508
  e[n] = s[n];
509
509
  else {
510
- const d = $.String.toLowerCamelCase(n);
510
+ const d = U.String.toLowerCamelCase(n);
511
511
  e.setAttribute(d, s[n]);
512
512
  }
513
513
  return e;
@@ -518,11 +518,11 @@ class X {
518
518
  s
519
519
  );
520
520
  const e = t(this, q).call(this, s);
521
- this.instance = e, t(this, k).call(this, e, s.appendTo);
521
+ this.instance = e, t(this, A).call(this, e, s.appendTo);
522
522
  }
523
523
  }
524
- P = new WeakMap(), A = new WeakMap(), k = new WeakMap(), q = new WeakMap();
525
- const m = (i) => {
524
+ P = new WeakMap(), k = new WeakMap(), A = new WeakMap(), q = new WeakMap();
525
+ const p = (i) => {
526
526
  const s = new AbortController(), e = new X(i).instance;
527
527
  return e.visible = !0, e.addEventListener(
528
528
  "closed",
@@ -587,7 +587,7 @@ const m = (i) => {
587
587
  );
588
588
  });
589
589
  };
590
- m.alert = (i = "", s = "", e = "") => m({
590
+ p.alert = (i = "", s = "", e = "") => p({
591
591
  message: i,
592
592
  title: s,
593
593
  closeOnClickModal: !1,
@@ -595,7 +595,7 @@ m.alert = (i = "", s = "", e = "") => m({
595
595
  boxType: "alert",
596
596
  ...e
597
597
  });
598
- m.confirm = (i = "", s = "", e = "") => m({
598
+ p.confirm = (i = "", s = "", e = "") => p({
599
599
  message: i,
600
600
  title: s,
601
601
  showConfirmButton: !0,
@@ -604,7 +604,7 @@ m.confirm = (i = "", s = "", e = "") => m({
604
604
  boxType: "confirm",
605
605
  ...e
606
606
  });
607
- m.prompt = (i = "", s = "", e = "") => m({
607
+ p.prompt = (i = "", s = "", e = "") => p({
608
608
  message: i,
609
609
  title: s,
610
610
  showConfirmButton: !0,
@@ -614,11 +614,11 @@ m.prompt = (i = "", s = "", e = "") => m({
614
614
  boxType: "prompt",
615
615
  ...e
616
616
  });
617
- window.$alert = m.alert;
618
- window.$confirm = m.confirm;
619
- window.$prompt = m.prompt;
620
- window.$msgbox = m;
617
+ window.$alert = p.alert;
618
+ window.$confirm = p.confirm;
619
+ window.$prompt = p.prompt;
620
+ window.$msgbox = p;
621
621
  export {
622
- m as EaMessageBox,
622
+ p as EaMessageBox,
623
623
  D as EaMessageBoxElement
624
624
  };