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,66 +1,54 @@
1
- var N = Object.defineProperty;
2
- var y = (t) => {
3
- throw TypeError(t);
1
+ var q = Object.defineProperty;
2
+ var E = (e) => {
3
+ throw TypeError(e);
4
4
  };
5
- var S = (t, s, e) => s in t ? N(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
6
- var v = (t, s, e) => S(t, typeof s != "symbol" ? s + "" : s, e), w = (t, s, e) => s.has(t) || y("Cannot " + e);
7
- var a = (t, s, e) => (w(t, s, "read from private field"), e ? e.call(t) : s.get(t)), o = (t, s, e) => s.has(t) ? y("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), c = (t, s, e, i) => (w(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e);
8
- import { B as E } from "./Base.js";
9
- import { s as T } from "../css/ea-skeleton.style.js";
10
- import { E as k } from "../utils/Utils.js";
11
- import { s as A } from "../css/ea-skeleton-item.style.js";
12
- var u, f, r, h, l, g, p;
13
- class M extends E {
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
- o(this, u);
18
- /** @type {HTMLElement} */
19
- o(this, f);
20
- /** @type {HTMLElement} */
21
- o(this, r);
18
+ r(this, f);
19
+ /** @type {HTMLSlotElement} */
20
+ r(this, C);
21
+ /** @type {HTMLSlotElement} */
22
+ r(this, h);
22
23
  /** @type {AbortController} */
23
- o(this, h);
24
- o(this, l, {
24
+ r(this, m);
25
+ r(this, n, {
25
26
  isChildrenReady: !1,
26
27
  templateNode: null,
27
28
  loadingThrottle: null
28
29
  });
29
- v(this, "state", this.properties({
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: (e) => {
40
- a(this, p).call(this, e);
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 (e) => {
47
- var C;
48
- a(this, l).isChildrenReady || (await customElements.whenDefined("ea-skeleton-item"), a(this, l).isChildrenReady = !0);
49
- let i = [...this.querySelectorAll("[slot='template']")];
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: (e) => {
69
+ observer: (t) => {
82
70
  if (this["throttle-trailing"] || this["throttle-leading"])
83
71
  try {
84
- clearTimeout(a(this, l).loadingThrottle), a(this, l).loadingThrottle = null;
72
+ clearTimeout(s(this, n).loadingThrottle), s(this, n).loadingThrottle = null;
85
73
  } catch {
86
74
  }
87
- a(this, l).loadingThrottle = k.timeout(
75
+ s(this, n).loadingThrottle = N.timeout(
88
76
  () => {
89
77
  this.updateContainerClasslist();
90
78
  },
91
- (e ? this["throttle-trailing"] : this["throttle-leading"]) || 0
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
- o(this, g, (e = this.rows) => {
102
- this.querySelectorAll("ea-skeleton-item").length || (a(this, r).innerHTML = `
103
- ${Array.from({ length: e }).map(
104
- () => k.EaElement.h("ea-skeleton-item", null, {
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
- o(this, p, (e) => {
115
- [...this.querySelectorAll("ea-skeleton-item")].forEach((d) => d.toggleAttribute("animated", e));
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 = T, this.$render();
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 e = this.computedClasslist(
124
+ const t = this.computedClasslist(
137
125
  "ea-skeleton",
138
126
  {},
139
127
  {
140
128
  loading: this.loading
141
129
  }
142
130
  );
143
- return a(this, u).className = e, e;
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
- `, c(this, u, this.shadowRoot.querySelector(".ea-skeleton")), c(this, f, this.shadowRoot.querySelector("#default")), c(this, r, this.shadowRoot.querySelector("#template")), this.updateContainerClasslist();
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 = a(this, h)) == null || i.abort(), c(this, h, new AbortController());
156
- const e = () => {
157
- a(this, p).call(this, this.animated);
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
- a(this, g).call(this), a(this, r).addEventListener("slotchange", e, {
160
- signal: a(this, h).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 e;
165
- (e = a(this, h)) == null || e.abort();
152
+ var t;
153
+ (t = s(this, m)) == null || t.abort();
166
154
  }
167
155
  }
168
- u = new WeakMap(), f = new WeakMap(), r = new WeakMap(), h = new WeakMap(), l = new WeakMap(), g = new WeakMap(), p = new WeakMap();
169
- window.customElements.get("ea-skeleton") || window.customElements.define("ea-skeleton", M);
170
- const L = `
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 m;
180
- class R extends E {
196
+ var g;
197
+ class z extends S {
181
198
  constructor() {
182
199
  super();
183
200
  /** @type {HTMLElement} */
184
- o(this, m);
185
- v(this, "state", this.properties({
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: (e) => {
200
- e === "image" && (a(this, m).innerHTML = L), this.updateContainerClasslist();
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 = A, this.$render();
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 e = this.computedClasslist(
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 a(this, m).className = e, e;
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
- `, c(this, m, this.shadowRoot.querySelector(".ea-skeleton-item"));
252
+ `, u(this, g, this.shadowRoot.querySelector(".ea-skeleton-item"));
236
253
  }
237
254
  connectedCallback() {
238
255
  super.connectedCallback();
239
256
  }
240
257
  }
241
- m = new WeakMap();
242
- window.customElements.get("ea-skeleton-item") || window.customElements.define("ea-skeleton-item", R);
258
+ g = new WeakMap();
259
+ window.customElements.get("ea-skeleton-item") || window.customElements.define("ea-skeleton-item", z);
243
260
  export {
244
- M as EaSkeleton,
245
- R as EaSkeletonItem
261
+ B as EaSkeleton,
262
+ z as EaSkeletonItem
246
263
  };