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,58 +1,58 @@
1
1
  var it = Object.defineProperty;
2
- var ot = (r) => {
3
- throw TypeError(r);
2
+ var ot = (o) => {
3
+ throw TypeError(o);
4
4
  };
5
- var ct = (r, o, e) => o in r ? it(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
6
- var x = (r, o, e) => ct(r, typeof o != "symbol" ? o + "" : o, e), at = (r, o, e) => o.has(r) || ot("Cannot " + e);
7
- var t = (r, o, e) => (at(r, o, "read from private field"), e ? e.call(r) : o.get(r)), p = (r, o, e) => o.has(r) ? ot("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, e), C = (r, o, e, s) => (at(r, o, "write to private field"), s ? s.call(r, e) : o.set(r, e), e), S = (r, o, e) => (at(r, o, "access private method"), e);
5
+ var ct = (o, r, t) => r in o ? it(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t;
6
+ var x = (o, r, t) => ct(o, typeof r != "symbol" ? r + "" : r, t), at = (o, r, t) => r.has(o) || ot("Cannot " + t);
7
+ var e = (o, r, t) => (at(o, r, "read from private field"), t ? t.call(o) : r.get(o)), p = (o, r, t) => r.has(o) ? ot("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(o) : r.set(o, t), C = (o, r, t, s) => (at(o, r, "write to private field"), s ? s.call(o, t) : r.set(o, t), t), S = (o, r, t) => (at(o, r, "access private method"), t);
8
8
  import { E } from "../utils/Utils.js";
9
9
  import { B as rt } from "./Base.js";
10
10
  import "./ea-empty.js";
11
11
  import { s as ht } from "../css/ea-table.style.js";
12
12
  import { s as dt } from "../css/ea-table-column.style.js";
13
13
  class ut extends Event {
14
- constructor(o) {
15
- super("ea-cell-click", { bubbles: !0, composed: !0 }), this.detail = o;
14
+ constructor(r) {
15
+ super("ea-cell-click", { bubbles: !0, composed: !0 }), this.detail = r;
16
16
  }
17
17
  }
18
18
  class pt extends Event {
19
- constructor(o) {
20
- super("ea-current-change", { bubbles: !0, composed: !0 }), this.detail = o;
19
+ constructor(r) {
20
+ super("ea-current-change", { bubbles: !0, composed: !0 }), this.detail = r;
21
21
  }
22
22
  }
23
23
  class bt extends Event {
24
- constructor(o) {
25
- super("ea-row-click", { bubbles: !0, composed: !0 }), this.detail = o;
24
+ constructor(r) {
25
+ super("ea-row-click", { bubbles: !0, composed: !0 }), this.detail = r;
26
26
  }
27
27
  }
28
28
  class mt extends Event {
29
- constructor(o) {
30
- super("ea-select-all", { bubbles: !0, composed: !0 }), this.detail = o;
29
+ constructor(r) {
30
+ super("ea-select-all", { bubbles: !0, composed: !0 }), this.detail = r;
31
31
  }
32
32
  }
33
33
  class ft extends Event {
34
- constructor(o) {
35
- super("ea-select", { bubbles: !0, composed: !0 }), this.detail = o;
34
+ constructor(r) {
35
+ super("ea-select", { bubbles: !0, composed: !0 }), this.detail = r;
36
36
  }
37
37
  }
38
38
  class gt extends Event {
39
- constructor(o) {
40
- super("ea-selection-change", { bubbles: !0, composed: !0 }), this.detail = o;
39
+ constructor(r) {
40
+ super("ea-selection-change", { bubbles: !0, composed: !0 }), this.detail = r;
41
41
  }
42
42
  }
43
- const Et = (r) => E.EaElement.h(
43
+ const Et = (o) => E.EaElement.h(
44
44
  "colgroup",
45
45
  "ea-table__colgroup",
46
46
  {
47
47
  part: "colgroup"
48
48
  },
49
- r.map(
50
- (o) => E.EaElement.h("col", "ea-table__col", {
51
- width: o.width,
49
+ o.map(
50
+ (r) => E.EaElement.h("col", "ea-table__col", {
51
+ width: r.width,
52
52
  part: "col"
53
53
  })
54
54
  )
55
- ), yt = (r) => E.EaElement.h(
55
+ ), yt = (o) => E.EaElement.h(
56
56
  "tfoot",
57
57
  "ea-table__tfoot",
58
58
  {
@@ -64,19 +64,19 @@ const Et = (r) => E.EaElement.h(
64
64
  {
65
65
  part: "tfoot-tr"
66
66
  },
67
- r.map(
68
- (o) => E.EaElement.h(
67
+ o.map(
68
+ (r) => E.EaElement.h(
69
69
  "td",
70
- `ea-table__td ${o.fixed ? ` is-fixed fixed-${o.fixed}` : ""}`,
70
+ `ea-table__td ${r.fixed ? ` is-fixed fixed-${r.fixed}` : ""}`,
71
71
  {
72
72
  part: "tfoot-td",
73
- "data-scope": o.prop
73
+ "data-scope": r.prop
74
74
  }
75
75
  )
76
76
  )
77
77
  )
78
- ), vt = (r) => E.EaElement.h("span", "ea-table__sort-wrapper", {}, [
79
- E.EaElement.h("span", null, {}, r),
78
+ ), vt = (o) => E.EaElement.h("span", "ea-table__sort-wrapper", {}, [
79
+ E.EaElement.h("span", null, {}, o),
80
80
  E.EaElement.h(
81
81
  "span",
82
82
  "ea-table__sort",
@@ -84,11 +84,13 @@ const Et = (r) => E.EaElement.h(
84
84
  [
85
85
  E.EaElement.h("ea-icon", "ea-table__sort-icon", {
86
86
  part: "asc-icon",
87
- icon: "icon-angle-up"
87
+ name: "angle-up",
88
+ size: "small"
88
89
  }),
89
90
  E.EaElement.h("ea-icon", "ea-table__sort-icon", {
90
91
  part: "desc-icon",
91
- icon: "icon-angle-down"
92
+ name: "angle-down",
93
+ size: "small"
92
94
  })
93
95
  ].join("")
94
96
  )
@@ -100,93 +102,95 @@ const Et = (r) => E.EaElement.h(
100
102
  part: "checkbox"
101
103
  },
102
104
  null
103
- ), xt = () => "", Ct = (r) => {
104
- const o = (h) => h === "selection" ? wt() : h === "index" ? xt() : null, e = (h, u) => h ? vt(u) : null;
105
+ ), xt = () => "", Ct = (o) => {
106
+ const r = (c) => c === "selection" ? wt() : c === "index" ? xt() : null, t = (c, u) => c ? vt(u) : null;
105
107
  let s = null;
106
- const l = r.label || r.prop || "", n = o(r.type), i = e(r.sortable, l);
107
- return n ? s = n : i ? s = i : r.header ? s = r.header : s = l, E.EaElement.h(
108
+ const n = o.label || o.prop || "", l = r(o.type), i = t(o.sortable, n);
109
+ return l ? s = l : i ? s = i : o.header ? s = o.header : s = n, E.EaElement.h(
108
110
  "th",
109
- `ea-table__th${r.fixed ? ` is-fixed fixed-${r.fixed}` : ""}${r.sortable ? " is-sortable" : ""}${r.width ? " is-width" : ""}`.trim(),
111
+ `ea-table__th${o.fixed ? ` is-fixed fixed-${o.fixed}` : ""}${o.sortable ? " is-sortable" : ""}${o.width ? " is-width" : ""}`.trim(),
110
112
  {
111
113
  part: "thead-th",
112
- colspan: r.colspan,
113
- rowspan: r.rowspan,
114
- style: [r.width ? `--ea-table-cell-width: ${r.width}` : ""],
115
- "data-scope": r.prop || ""
114
+ colspan: o.colspan,
115
+ rowspan: o.rowspan,
116
+ style: [o.width ? `--ea-table-cell-width: ${o.width}` : ""],
117
+ "data-scope": o.prop || "",
118
+ "data-prop": o.prop || "",
119
+ "data-order": "asc"
116
120
  },
117
121
  s
118
122
  );
119
- }, St = (r) => r.map(
120
- (o) => E.EaElement.h(
123
+ }, St = (o) => o.map(
124
+ (r) => E.EaElement.h(
121
125
  "tr",
122
126
  "ea-table__tr is-thead",
123
127
  {
124
128
  part: "thead-tr"
125
129
  },
126
- o.map(Ct)
130
+ r.map(Ct)
127
131
  )
128
- ), _t = (r) => {
129
- const o = r.reduce((e, s) => (e[s.depth] || (e[s.depth] = []), e[s.depth].push(s), e), []);
132
+ ), _t = (o) => {
133
+ const r = o.reduce((t, s) => (t[s.depth] || (t[s.depth] = []), t[s.depth].push(s), t), []);
130
134
  return E.EaElement.h(
131
135
  "thead",
132
136
  "ea-table__thead",
133
137
  {
134
138
  part: "thead"
135
139
  },
136
- St(o)
140
+ St(r)
137
141
  );
138
142
  };
139
143
  class kt extends Event {
140
- constructor(o) {
141
- super("ea-sort-change", { bubbles: !0, composed: !0 }), this.detail = o;
144
+ constructor(r) {
145
+ super("ea-sort-change", { bubbles: !0, composed: !0 }), this.detail = r;
142
146
  }
143
147
  }
144
148
  class At extends Event {
145
- constructor(o) {
146
- super("ea-cell-mouse-enter", { bubbles: !0, composed: !0 }), this.detail = o;
149
+ constructor(r) {
150
+ super("ea-cell-mouse-enter", { bubbles: !0, composed: !0 }), this.detail = r;
147
151
  }
148
152
  }
149
153
  class Lt extends Event {
150
- constructor(o) {
151
- super("ea-cell-mouse-leave", { bubbles: !0, composed: !0 }), this.detail = o;
154
+ constructor(r) {
155
+ super("ea-cell-mouse-leave", { bubbles: !0, composed: !0 }), this.detail = r;
152
156
  }
153
157
  }
154
158
  class Tt extends Event {
155
- constructor(o) {
156
- super("ea-cell-dblclick", { bubbles: !0, composed: !0 }), this.detail = o;
159
+ constructor(r) {
160
+ super("ea-cell-dblclick", { bubbles: !0, composed: !0 }), this.detail = r;
157
161
  }
158
162
  }
159
163
  class Rt extends Event {
160
- constructor(o) {
161
- super("ea-row-dblclick", { bubbles: !0, composed: !0 }), this.detail = o;
164
+ constructor(r) {
165
+ super("ea-row-dblclick", { bubbles: !0, composed: !0 }), this.detail = r;
162
166
  }
163
167
  }
164
168
  class qt extends Event {
165
- constructor(o) {
166
- super("ea-row-contextmenu", { bubbles: !0, composed: !0 }), this.detail = o;
169
+ constructor(r) {
170
+ super("ea-row-contextmenu", { bubbles: !0, composed: !0 }), this.detail = r;
167
171
  }
168
172
  }
169
173
  class Dt extends Event {
170
- constructor(o) {
171
- super("ea-cell-contextmenu", { bubbles: !0, composed: !0 }), this.detail = o;
174
+ constructor(r) {
175
+ super("ea-cell-contextmenu", { bubbles: !0, composed: !0 }), this.detail = r;
172
176
  }
173
177
  }
174
178
  class $t extends Event {
175
- constructor(o) {
176
- super("ea-header-contextmenu", { bubbles: !0, composed: !0 }), this.detail = o;
179
+ constructor(r) {
180
+ super("ea-header-contextmenu", { bubbles: !0, composed: !0 }), this.detail = r;
177
181
  }
178
182
  }
179
183
  class Mt extends Event {
180
- constructor(o) {
181
- super("ea-header-click", { bubbles: !0, composed: !0 }), this.detail = o;
184
+ constructor(r) {
185
+ super("ea-header-click", { bubbles: !0, composed: !0 }), this.detail = r;
182
186
  }
183
187
  }
184
188
  class Nt extends Event {
185
- constructor(o) {
186
- super("ea-template-cell-click", { bubbles: !0, composed: !0 }), this.detail = o;
189
+ constructor(r) {
190
+ super("ea-template-cell-click", { bubbles: !0, composed: !0 }), this.detail = r;
187
191
  }
188
192
  }
189
- var f, T, w, I, F, B, g, k, c, K, P, D, j, W, $, U, M, G, L, z, J, O, Q, V, X, Y, Z, tt, et;
193
+ var f, T, w, H, I, F, g, k, h, B, K, D, P, W, j, U, $, z, L, G, J, O, Q, V, X, Y, Z, tt, et;
190
194
  class Ht extends rt {
191
195
  constructor() {
192
196
  super();
@@ -197,11 +201,11 @@ class Ht extends rt {
197
201
  /** @type {HTMLElement} */
198
202
  p(this, w);
199
203
  /** @type {HTMLElement} */
200
- p(this, I);
204
+ p(this, H);
201
205
  /** @type {HTMLSlotElement} */
202
- p(this, F);
206
+ p(this, I);
203
207
  /** @type {HTMLElement} */
204
- p(this, B);
208
+ p(this, F);
205
209
  /** @type {AbortController} */
206
210
  p(this, g);
207
211
  p(this, k, {
@@ -210,7 +214,7 @@ class Ht extends rt {
210
214
  /** @type {AbortController | null} */
211
215
  selectAbortController: null
212
216
  });
213
- p(this, c, {
217
+ p(this, h, {
214
218
  isDataRendered: !1,
215
219
  currentRow: {
216
220
  target: null,
@@ -240,15 +244,15 @@ class Ht extends rt {
240
244
  height: {
241
245
  type: String,
242
246
  default: null,
243
- observer: (e) => {
244
- this.style.setProperty("--ea-table-height", e), this.updateContainerClasslist();
247
+ observer: (t) => {
248
+ this.style.setProperty("--ea-table-height", t), this.updateContainerClasslist();
245
249
  }
246
250
  },
247
251
  "max-height": {
248
252
  type: String,
249
253
  default: null,
250
- observer: (e) => {
251
- this.style.setProperty("--ea-table-max-height", e), this.updateContainerClasslist();
254
+ observer: (t) => {
255
+ this.style.setProperty("--ea-table-max-height", t), this.updateContainerClasslist();
252
256
  }
253
257
  },
254
258
  "highlight-current-row": {
@@ -268,9 +272,9 @@ class Ht extends rt {
268
272
  data: {
269
273
  props: !0,
270
274
  type: Array,
271
- default: () => t(this, c).originData,
272
- observer: (e) => {
273
- t(this, c).originData = e, this.setData(e);
275
+ default: () => e(this, h).originData,
276
+ observer: (t) => {
277
+ e(this, h).originData = t, this.setData(t);
274
278
  }
275
279
  }
276
280
  }));
@@ -285,7 +289,7 @@ class Ht extends rt {
285
289
  props: !0,
286
290
  type: Function,
287
291
  rawFunction: !0,
288
- default: () => (e) => e
292
+ default: () => (t) => t
289
293
  },
290
294
  summaryMethod: {
291
295
  props: !0,
@@ -293,19 +297,19 @@ class Ht extends rt {
293
297
  rawFunction: !0,
294
298
  default: () => (
295
299
  /** @param {{columns: ColumnOption, data: any[]}} param */
296
- (e) => {
297
- const { columns: s, data: l } = e, n = [];
298
- return s.forEach((i, h) => {
299
- if (h === 0) {
300
- n[h] = "Sum";
300
+ (t) => {
301
+ const { columns: s, data: n } = t, l = [];
302
+ return s.forEach((i, c) => {
303
+ if (c === 0) {
304
+ l[c] = "Sum";
301
305
  return;
302
306
  }
303
- const u = l.map((a) => Number(a[i.prop]));
304
- u.every((a) => Number.isNaN(a)) ? n[h] = "" : n[h] = u.reduce((a, b) => {
307
+ const u = n.map((a) => Number(a[i.prop]));
308
+ u.every((a) => Number.isNaN(a)) ? l[c] = "" : l[c] = u.reduce((a, b) => {
305
309
  const m = Number(b);
306
310
  return Number.isNaN(m) ? a : a + b;
307
311
  }, 0);
308
- }), n;
312
+ }), l;
309
313
  }
310
314
  )
311
315
  }
@@ -313,49 +317,49 @@ class Ht extends rt {
313
317
  /**
314
318
  * 渲染表格的基本结构
315
319
  */
316
- p(this, K, () => {
317
- const e = [...this.querySelectorAll("ea-table-column")].map(
320
+ p(this, B, () => {
321
+ const t = [...this.querySelectorAll("ea-table-column")].map(
318
322
  (a) => a.getColumnTree
319
323
  );
320
- t(this, c).columns = e;
321
- const s = Et(e), l = _t(e), n = yt(e), i = this.shadowRoot.querySelector(".ea-table__colgroup"), h = this.shadowRoot.querySelector(".ea-table__thead"), u = this.shadowRoot.querySelector(".ea-table__tfoot");
322
- i && (i.innerHTML = s), h && (h.innerHTML = l), u && (u.innerHTML = n);
324
+ e(this, h).columns = t;
325
+ const s = Et(t), n = _t(t), l = yt(t), i = this.shadowRoot.querySelector(".ea-table__colgroup"), c = this.shadowRoot.querySelector(".ea-table__thead"), u = this.shadowRoot.querySelector(".ea-table__tfoot");
326
+ i && (i.innerHTML = s), c && (c.innerHTML = n), u && (u.innerHTML = l);
323
327
  });
324
328
  /**
325
329
  * 初始化带有筛选的列
326
330
  */
327
- p(this, P, () => {
331
+ p(this, K, () => {
328
332
  if (![
329
- ...t(this, f).querySelectorAll(".ea-table__th.is-sortable")
333
+ ...e(this, f).querySelectorAll(".ea-table__th.is-sortable")
330
334
  ].length) return;
331
- const s = (l) => {
332
- const n = l.target.closest(".is-sortable");
333
- if (!n) return;
334
- const { prop: i, order: h } = n.dataset;
335
+ const s = (n) => {
336
+ const l = n.target.closest(".is-sortable");
337
+ if (!l) return;
338
+ const { prop: i, order: c } = l.dataset;
335
339
  if (!i) return;
336
- const u = h === "asc" ? "desc" : "asc", a = {
337
- asc: n.querySelector('[part="asc-icon"]'),
338
- desc: n.querySelector('[part="desc-icon"]')
340
+ const u = c === "asc" ? "desc" : "asc", a = {
341
+ asc: l.querySelector('[part="asc-icon"]'),
342
+ desc: l.querySelector('[part="desc-icon"]')
339
343
  };
340
- n.setAttribute("data-order", u), n.querySelectorAll(".ea-table__sort-icon").forEach((b) => {
344
+ l.setAttribute("data-order", u), l.querySelectorAll(".ea-table__sort-icon").forEach((b) => {
341
345
  b.classList.toggle("is-active", a[u] === b);
342
346
  }), this.sort(i, u);
343
347
  };
344
- t(this, T).addEventListener("click", s, {
345
- signal: t(this, g).signal
348
+ e(this, T).addEventListener("click", s, {
349
+ signal: e(this, g).signal
346
350
  });
347
351
  });
348
352
  /**
349
353
  * @param {any[]} dataSource
350
354
  */
351
- x(this, "setData", async (e) => {
355
+ x(this, "setData", async (t) => {
352
356
  var u;
353
- await customElements.whenDefined("ea-table"), await customElements.whenDefined("ea-table-column"), t(this, c).columns.length === 0 && (t(this, K).call(this), t(this, P).call(this));
354
- const s = document.createDocumentFragment(), l = document.createElement("tr");
355
- l.part = "tbody-tr", l.className = "ea-table__tr";
356
- const n = t(this, c).columns.filter(
357
+ await customElements.whenDefined("ea-table"), await customElements.whenDefined("ea-table-column"), e(this, h).columns.length === 0 && (e(this, B).call(this), e(this, K).call(this));
358
+ const s = document.createDocumentFragment(), n = document.createElement("tr");
359
+ n.part = "tbody-tr", n.className = "ea-table__tr";
360
+ const l = e(this, h).columns.filter(
357
361
  (a) => !a.template || a.template instanceof HTMLTemplateElement
358
- ), i = n.some((a) => a.type === "selection"), h = {
362
+ ), i = l.some((a) => a.type === "selection"), c = {
359
363
  selection: () => this.html(
360
364
  E.EaElement.h(
361
365
  "ea-checkbox",
@@ -377,11 +381,11 @@ class Ht extends rt {
377
381
  )
378
382
  )
379
383
  };
380
- for (const a in t(this, k))
381
- (u = t(this, k)[a]) == null || u.abort(), t(this, k)[a] = new AbortController();
382
- if (t(this, c).isDataRendered = !1, t(this, w).innerHTML = "", t(this, c).dataSource = /* @__PURE__ */ new WeakMap(), t(this, c).originData = e, n.forEach((a) => {
384
+ for (const a in e(this, k))
385
+ (u = e(this, k)[a]) == null || u.abort(), e(this, k)[a] = new AbortController();
386
+ if (e(this, h).isDataRendered = !1, e(this, w).innerHTML = "", e(this, h).dataSource = /* @__PURE__ */ new WeakMap(), e(this, h).originData = t, l.forEach((a) => {
383
387
  var v;
384
- const b = l, { template: m } = a, d = document.createElement("td");
388
+ const b = n, { template: m } = a, d = document.createElement("td");
385
389
  if (d.part = "tbody-td", d.className = "ea-table__td", d.classList.toggle("is-fixed", a.fixed), d.classList.toggle(`fixed-${a.fixed}`, a.fixed), d.classList.toggle(
386
390
  `ea-table__cell--align-${a.align}`,
387
391
  a.align
@@ -390,51 +394,51 @@ class Ht extends rt {
390
394
  A.querySelectorAll("*").forEach((nt) => {
391
395
  nt.setAttribute("data-template-cell", "");
392
396
  }), d.appendChild(A);
393
- } else a.type ? d.innerHTML = (v = h[a.type]) == null ? void 0 : v.call(h) : d.setAttribute("data-scope", a.prop);
397
+ } else a.type ? d.innerHTML = (v = c[a.type]) == null ? void 0 : v.call(c) : d.setAttribute("data-scope", a.prop);
394
398
  b.appendChild(d);
395
- }), e.forEach((a, b) => {
396
- const m = l.cloneNode(!0);
399
+ }), t.forEach((a, b) => {
400
+ const m = n.cloneNode(!0);
397
401
  if (m.setAttribute("data-index", b), typeof this.selectable == "function") {
398
402
  const d = !this.selectable(a);
399
403
  m.querySelector(
400
404
  'ea-checkbox[data-type="selection"]'
401
405
  ).toggleAttribute("disabled", d);
402
406
  }
403
- if (n.some((d) => d.type === "index") && typeof this.indexMethod == "function") {
407
+ if (l.some((d) => d.type === "index") && typeof this.indexMethod == "function") {
404
408
  const d = m.querySelector(".ea-table__index");
405
409
  d.textContent = this.indexMethod(b);
406
410
  }
407
411
  m.querySelectorAll("[data-scope]").forEach((d) => {
408
- const v = d.getAttribute("data-scope"), A = n.find((H) => H.prop === v);
412
+ const v = d.getAttribute("data-scope"), A = l.find((N) => N.prop === v);
409
413
  A ? d.textContent = a[A.prop] : v in a && (d.textContent = a[v]);
410
- }), s.appendChild(m), t(this, c).dataSource.set(m, a), a && typeof a == "object" && t(this, c).dataIndex.set(a, m);
414
+ }), s.appendChild(m), e(this, h).dataSource.set(m, a), a && typeof a == "object" && e(this, h).dataIndex.set(a, m);
411
415
  }), this["show-summary"] && typeof this.summaryMethod == "function") {
412
- const a = t(this, I).querySelectorAll(
416
+ const a = e(this, H).querySelectorAll(
413
417
  ".ea-table__td[data-scope]"
414
- ), b = this.summaryMethod({ columns: n, data: e });
418
+ ), b = this.summaryMethod({ columns: l, data: t });
415
419
  a.forEach((m, d) => {
416
420
  m.textContent = b[d];
417
421
  });
418
422
  }
419
- t(this, w).appendChild(s), i && t(this, f).addEventListener("change", t(this, et), {
420
- signal: t(this, g).signal
421
- }), t(this, W).call(this), t(this, O).call(this), this.updateContainerClasslist(), t(this, c).isDataRendered = !0, this.emit("ea-table-data-rendered");
423
+ e(this, w).appendChild(s), i && e(this, f).addEventListener("change", e(this, et), {
424
+ signal: e(this, g).signal
425
+ }), e(this, W).call(this), e(this, O).call(this), this.updateContainerClasslist(), e(this, h).isDataRendered = !0, this.emit("ea-table-data-rendered");
422
426
  });
423
427
  /**
424
428
  * 排序
425
429
  * @param {string} prop
426
430
  * @param {"asc" | "desc"} order
427
431
  */
428
- x(this, "sort", (e, s = "asc") => {
429
- const l = document.createDocumentFragment(), n = t(this, w).nextElementSibling;
430
- l.appendChild(t(this, w)), [...l.querySelectorAll("tr")].sort((h, u) => {
431
- const a = t(this, c).dataSource.get(h), b = t(this, c).dataSource.get(u);
432
- return s === "asc" ? String(a[e]).localeCompare(b[e]) : String(b[e]).localeCompare(a[e]);
433
- }).forEach((h) => {
434
- t(this, w).appendChild(h);
435
- }), t(this, f).insertBefore(l, n), this.dispatchEvent(
432
+ x(this, "sort", (t, s = "asc") => {
433
+ const n = document.createDocumentFragment(), l = e(this, w).nextElementSibling;
434
+ n.appendChild(e(this, w)), [...n.querySelectorAll("tr")].sort((c, u) => {
435
+ const a = e(this, h).dataSource.get(c), b = e(this, h).dataSource.get(u);
436
+ return s === "asc" ? String(a[t]).localeCompare(b[t]) : String(b[t]).localeCompare(a[t]);
437
+ }).forEach((c) => {
438
+ e(this, w).appendChild(c);
439
+ }), e(this, f).insertBefore(n, l), this.dispatchEvent(
436
440
  new kt({
437
- prop: e,
441
+ prop: t,
438
442
  order: s
439
443
  })
440
444
  );
@@ -443,22 +447,25 @@ class Ht extends rt {
443
447
  * 设置行样式
444
448
  * @param {Function | String} handler
445
449
  */
446
- x(this, "setRowStylePart", (e) => {
447
- if (!t(this, c).isDataRendered)
448
- return console.warn("[EaTable] Please set data first!", this);
449
- const s = [...t(this, w).querySelectorAll("tr")];
450
- if (typeof e == "function")
451
- s.forEach((l, n) => {
452
- const i = e({
453
- row: t(this, c).dataSource.get(l),
454
- rowIndex: n
450
+ x(this, "setRowStylePart", async (t) => {
451
+ e(this, h).isDataRendered || await E.EaElement.addAsyncEventListener(
452
+ this,
453
+ "ea-table-data-rendered",
454
+ !0
455
+ );
456
+ const s = [...e(this, w).querySelectorAll("tr")];
457
+ if (typeof t == "function")
458
+ s.forEach((n, l) => {
459
+ const i = t({
460
+ row: e(this, h).dataSource.get(n),
461
+ rowIndex: l
455
462
  });
456
- i && l.part.add(i);
463
+ i && n.part.add(i);
457
464
  });
458
- else if (typeof e == "string") {
459
- if (!e) return;
460
- s.forEach((l) => {
461
- l.part.add(e);
465
+ else if (typeof t == "string") {
466
+ if (!t) return;
467
+ s.forEach((n) => {
468
+ n.part.add(t);
462
469
  });
463
470
  }
464
471
  });
@@ -468,67 +475,67 @@ class Ht extends rt {
468
475
  * @param {Boolean} selected
469
476
  * @param {boolean} [ignoreSelectable]
470
477
  */
471
- x(this, "toggleRowSelection", (e, s, l = !0) => {
472
- if (!t(this, c).columns.some(
478
+ x(this, "toggleRowSelection", (t, s, n = !0) => {
479
+ if (!e(this, h).columns.some(
473
480
  (a) => a.type === "selection"
474
481
  )) return;
475
- const i = t(this, c).dataIndex.get(e);
482
+ const i = e(this, h).dataIndex.get(t);
476
483
  if (!i) return;
477
- const h = `ea-checkbox[data-type="selection"]${l ? "" : ":not([disabled])"}`, u = i.querySelector(h);
478
- u && (s ? u.toggleAttribute("checked", s) : u.toggleAttribute("checked", !u.checked), t(this, j).call(this), t(this, M).call(this));
484
+ const c = `ea-checkbox[data-type="selection"]${n ? "" : ":not([disabled])"}`, u = i.querySelector(c);
485
+ u && (s ? u.toggleAttribute("checked", s) : u.toggleAttribute("checked", !u.checked), e(this, P).call(this), e(this, $).call(this));
479
486
  });
480
487
  /**
481
488
  * 清空选择
482
489
  */
483
490
  x(this, "clearSelection", () => {
484
491
  [
485
- ...t(this, f).querySelectorAll('ea-checkbox[data-type="selection"]')
492
+ ...e(this, f).querySelectorAll('ea-checkbox[data-type="selection"]')
486
493
  ].forEach((s) => {
487
494
  s.removeAttribute("checked"), s.removeAttribute("indeterminate");
488
- }), t(this, M).call(this);
495
+ }), e(this, $).call(this);
489
496
  });
490
497
  /**
491
498
  * 获取当前选中的行
492
499
  * @returns {any[]}
493
500
  */
494
501
  p(this, D, () => [
495
- ...t(this, w).querySelectorAll(
502
+ ...e(this, w).querySelectorAll(
496
503
  'ea-checkbox[data-type="selection"][checked]'
497
504
  )
498
505
  ].map(
499
- (e) => t(this, c).dataSource.get(e.closest('.ea-table__tr[part="tbody-tr"]'))
506
+ (t) => e(this, h).dataSource.get(t.closest('.ea-table__tr[part="tbody-tr"]'))
500
507
  ));
501
508
  /**
502
509
  * 更新选中状态
503
510
  */
504
- p(this, j, () => {
505
- const e = t(this, T).querySelector(
511
+ p(this, P, () => {
512
+ const t = e(this, T).querySelector(
506
513
  'ea-checkbox[data-type="selection"]'
507
514
  ), s = [
508
- ...t(this, w).querySelectorAll(
515
+ ...e(this, w).querySelectorAll(
509
516
  'ea-checkbox[data-type="selection"]:not([disabled])'
510
517
  )
511
- ].every((n) => n.hasAttribute("checked")), l = [
512
- ...t(this, w).querySelectorAll('ea-checkbox[data-type="selection"]')
513
- ].some((n) => n.hasAttribute("checked"));
514
- s ? (e.toggleAttribute("checked", !0), e.removeAttribute("indeterminate")) : l ? (e.removeAttribute("checked"), e.toggleAttribute("indeterminate", !0)) : (e.removeAttribute("checked"), e.removeAttribute("indeterminate"));
518
+ ].every((l) => l.hasAttribute("checked")), n = [
519
+ ...e(this, w).querySelectorAll('ea-checkbox[data-type="selection"]')
520
+ ].some((l) => l.hasAttribute("checked"));
521
+ s ? (t.toggleAttribute("checked", !0), t.removeAttribute("indeterminate")) : n ? (t.removeAttribute("checked"), t.toggleAttribute("indeterminate", !0)) : (t.removeAttribute("checked"), t.removeAttribute("indeterminate"));
515
522
  });
516
523
  /**
517
524
  * 处理固定列的位置和阴影(box-shadow)
518
525
  */
519
526
  p(this, W, () => {
520
- const e = [...t(this, f).querySelectorAll(".is-fixed")], s = e.filter(
527
+ const t = [...e(this, f).querySelectorAll(".is-fixed")], s = t.filter(
521
528
  (a) => a.classList.contains("fixed-left")
522
- ), l = e.filter(
529
+ ), n = t.filter(
523
530
  (a) => a.classList.contains("fixed-right")
524
- ), n = (a) => {
531
+ ), l = (a) => {
525
532
  const b = a.filter((d) => d.part.contains("thead-th"));
526
533
  if (b.length <= 1) return [a];
527
534
  const m = [];
528
535
  for (let d = 0; d < a.length; d += b.length)
529
536
  m.push(a.slice(d, d + b.length));
530
- return m.reduce((d, v) => (v.forEach((A, H) => {
531
- d[H] = [...d[H], A];
537
+ return m.reduce((d, v) => (v.forEach((A, N) => {
538
+ d[N] = [...d[N], A];
532
539
  }), d), Array(b.length).fill([]));
533
540
  }, i = (a) => {
534
541
  if (!a.length) return;
@@ -544,37 +551,37 @@ class Ht extends rt {
544
551
  }), b.forEach((m) => {
545
552
  m.classList.add("is-last");
546
553
  });
547
- }, [h, u] = [
548
- n(s),
549
- n(l).reverse()
554
+ }, [c, u] = [
555
+ l(s),
556
+ l(n).reverse()
550
557
  ];
551
- i(h), i(u);
558
+ i(c), i(u);
552
559
  });
553
560
  /**
554
561
  * 设置高亮当前行样式
555
562
  * @param {HTMLTableRowElement} currentRow
556
563
  * @param {HTMLTableRowElement} [oldRow]
557
564
  */
558
- p(this, $, (e, s = t(this, c).currentRow.target) => {
559
- var l, n;
560
- this["highlight-current-row"] && ((l = s == null ? void 0 : s.classList) == null || l.remove("is-current"), (n = e == null ? void 0 : e.classList) == null || n.add("is-current"));
565
+ p(this, j, (t, s = e(this, h).currentRow.target) => {
566
+ var n, l;
567
+ this["highlight-current-row"] && ((n = s == null ? void 0 : s.classList) == null || n.remove("is-current"), (l = t == null ? void 0 : t.classList) == null || l.add("is-current"));
561
568
  });
562
569
  /**
563
570
  * 取消高亮当前行样式
564
571
  * @param {HTMLTableRowElement} currentRow
565
572
  */
566
- p(this, U, (e) => {
573
+ p(this, U, (t) => {
567
574
  var s;
568
- !this["highlight-current-row"] || !e || (s = e == null ? void 0 : e.classList) == null || s.remove("is-current");
575
+ !this["highlight-current-row"] || !t || (s = t == null ? void 0 : t.classList) == null || s.remove("is-current");
569
576
  });
570
577
  /**
571
578
  * 派发选择改变事件
572
579
  */
573
- p(this, M, () => {
574
- const e = t(this, D).call(this);
580
+ p(this, $, () => {
581
+ const t = e(this, D).call(this);
575
582
  this.dispatchEvent(
576
583
  new gt({
577
- newSelection: e
584
+ newSelection: t
578
585
  })
579
586
  );
580
587
  });
@@ -582,18 +589,18 @@ class Ht extends rt {
582
589
  * 点击事件: 行点击, 单元格点击
583
590
  * @param {MouseEvent} e
584
591
  */
585
- p(this, G, (e) => {
592
+ p(this, z, (t) => {
586
593
  var i;
587
- const s = e.target.closest("tr[part='tbody-tr']");
588
- if ((i = t(this, k).selectAbortController) == null || i.abort(), !s) return;
589
- const l = () => {
590
- var h;
591
- (h = t(this, k).selectAbortController) == null || h.abort();
592
- }, n = (h) => {
593
- const u = h.target.closest("tr[part='tbody-tr']"), a = h.target.closest("td[part='tbody-td']");
594
- if (l(), u !== s) return;
595
- const b = t(this, c).dataSource.get(s), m = a == null ? void 0 : a.getAttribute("data-scope");
596
- if (t(this, $).call(this, s, t(this, c).currentRow.target), t(this, c).currentRow.target = s, t(this, c).currentRow.value = b, this.dispatchEvent(
594
+ const s = t.target.closest("tr[part='tbody-tr']");
595
+ if ((i = e(this, k).selectAbortController) == null || i.abort(), !s) return;
596
+ const n = () => {
597
+ var c;
598
+ (c = e(this, k).selectAbortController) == null || c.abort();
599
+ }, l = (c) => {
600
+ const u = c.target.closest("tr[part='tbody-tr']"), a = c.target.closest("td[part='tbody-td']");
601
+ if (n(), u !== s) return;
602
+ const b = e(this, h).dataSource.get(s), m = a == null ? void 0 : a.getAttribute("data-scope");
603
+ if (e(this, j).call(this, s, e(this, h).currentRow.target), e(this, h).currentRow.target = s, e(this, h).currentRow.value = b, this.dispatchEvent(
597
604
  new bt({
598
605
  target: s,
599
606
  column: m,
@@ -613,7 +620,7 @@ class Ht extends rt {
613
620
  row: b
614
621
  })
615
622
  );
616
- const d = h.target.closest("[data-template-cell]");
623
+ const d = c.target.closest("[data-template-cell]");
617
624
  if (d) {
618
625
  const v = Number(s.getAttribute("data-index"));
619
626
  this.dispatchEvent(
@@ -621,18 +628,18 @@ class Ht extends rt {
621
628
  target: d,
622
629
  rowData: b,
623
630
  rowIndex: v,
624
- originalEvent: h
631
+ originalEvent: c
625
632
  })
626
633
  );
627
634
  }
628
635
  }
629
636
  };
630
- t(this, k).selectAbortController = new AbortController(), this.addEventListener("mouseout", l, {
637
+ e(this, k).selectAbortController = new AbortController(), this.addEventListener("mouseout", n, {
631
638
  once: !0,
632
- signal: t(this, k).selectAbortController.signal
633
- }), t(this, f).addEventListener("mouseup", n, {
639
+ signal: e(this, k).selectAbortController.signal
640
+ }), e(this, f).addEventListener("mouseup", l, {
634
641
  once: !0,
635
- signal: t(this, k).selectAbortController.signal
642
+ signal: e(this, k).selectAbortController.signal
636
643
  });
637
644
  });
638
645
  /**
@@ -649,16 +656,16 @@ class Ht extends rt {
649
656
  * columnKey: string;
650
657
  * }}
651
658
  */
652
- p(this, L, (e, s) => {
653
- const l = e.target.closest(`tr[part='t${s}-tr']`);
654
- if (!l) return { cell: null, row: null, data: null, columnKey: null };
655
- const n = s === "body" ? "td" : "th", i = e.target.closest(`${n}[part='t${s}-${n}']`), h = t(this, c).dataSource.get(l), u = i == null ? void 0 : i.getAttribute("data-scope");
656
- return s === "body" ? (t(this, $).call(this, l, t(this, c).currentRow.target), t(this, c).currentRow.target = l, t(this, c).currentRow.value = h, {
659
+ p(this, L, (t, s) => {
660
+ const n = t.target.closest(`tr[part='t${s}-tr']`);
661
+ if (!n) return { cell: null, row: null, data: null, columnKey: null };
662
+ const l = s === "body" ? "td" : "th", i = t.target.closest(`${l}[part='t${s}-${l}']`), c = e(this, h).dataSource.get(n), u = i == null ? void 0 : i.getAttribute("data-scope");
663
+ return s === "body" ? {
657
664
  cell: i,
658
- row: l,
659
- data: h,
665
+ row: n,
666
+ data: c,
660
667
  columnKey: u
661
- }) : {
668
+ } : {
662
669
  cell: i,
663
670
  columnKey: u
664
671
  };
@@ -667,19 +674,19 @@ class Ht extends rt {
667
674
  * 鼠标双击事件: 行双击, 单元格双击
668
675
  * @param {MouseEvent} e
669
676
  */
670
- p(this, z, (e) => {
671
- const { row: s, cell: l, data: n, columnKey: i } = t(this, L).call(this, e, "body");
677
+ p(this, G, (t) => {
678
+ const { row: s, cell: n, data: l, columnKey: i } = e(this, L).call(this, t, "body");
672
679
  s && (this.dispatchEvent(
673
680
  new Rt({
674
681
  target: s,
675
682
  column: i,
676
- row: n
683
+ row: l
677
684
  })
678
685
  ), this.dispatchEvent(
679
686
  new Tt({
680
- cell: l,
687
+ cell: n,
681
688
  column: i,
682
- row: n
689
+ row: l
683
690
  })
684
691
  ));
685
692
  });
@@ -687,19 +694,19 @@ class Ht extends rt {
687
694
  * 鼠标右击事件: 行右击, 单元格右击
688
695
  * @param {MouseEvent} e
689
696
  */
690
- p(this, J, (e) => {
691
- const { row: s, cell: l, data: n, columnKey: i } = t(this, L).call(this, e, "body");
697
+ p(this, J, (t) => {
698
+ const { row: s, cell: n, data: l, columnKey: i } = e(this, L).call(this, t, "body");
692
699
  s && (this.dispatchEvent(
693
700
  new qt({
694
701
  target: s,
695
702
  column: i,
696
- row: n
703
+ row: l
697
704
  })
698
705
  ), this.dispatchEvent(
699
706
  new Dt({
700
- cell: l,
707
+ cell: n,
701
708
  column: i,
702
- row: n
709
+ row: l
703
710
  })
704
711
  ));
705
712
  });
@@ -707,18 +714,18 @@ class Ht extends rt {
707
714
  * 滚动事件: 固定列样式
708
715
  */
709
716
  p(this, O, () => {
710
- const e = [...t(this, f).querySelectorAll(".is-fixed")], { scrollLeft: s } = t(this, f), l = Math.floor(t(this, f).scrollWidth - t(this, f).offsetWidth) - 1;
711
- s < l ? s ? e.forEach((n) => {
712
- n.classList.add("not-origin-position");
713
- }) : e.forEach((n) => {
714
- n.classList.toggle(
717
+ const t = [...e(this, f).querySelectorAll(".is-fixed")], { scrollLeft: s } = e(this, f), n = Math.floor(e(this, f).scrollWidth - e(this, f).offsetWidth) - 1;
718
+ s < n ? s ? t.forEach((l) => {
719
+ l.classList.add("not-origin-position");
720
+ }) : t.forEach((l) => {
721
+ l.classList.toggle(
715
722
  "not-origin-position",
716
- !n.classList.contains("fixed-left")
723
+ !l.classList.contains("fixed-left")
717
724
  );
718
- }) : e.forEach((n) => {
719
- n.classList.toggle(
725
+ }) : t.forEach((l) => {
726
+ l.classList.toggle(
720
727
  "not-origin-position",
721
- !n.classList.contains("fixed-right")
728
+ !l.classList.contains("fixed-right")
722
729
  );
723
730
  });
724
731
  });
@@ -726,13 +733,13 @@ class Ht extends rt {
726
733
  * 鼠标进入单元格事件
727
734
  * @param {MouseEvent} e
728
735
  */
729
- p(this, Q, (e) => {
730
- const { row: s, cell: l, data: n, columnKey: i } = t(this, L).call(this, e, "body");
736
+ p(this, Q, (t) => {
737
+ const { row: s, cell: n, data: l, columnKey: i } = e(this, L).call(this, t, "body");
731
738
  s && this.dispatchEvent(
732
739
  new At({
733
740
  column: i,
734
- row: n,
735
- cell: l
741
+ row: l,
742
+ cell: n
736
743
  })
737
744
  );
738
745
  });
@@ -740,13 +747,13 @@ class Ht extends rt {
740
747
  * 鼠标进入单元格事件
741
748
  * @param {MouseEvent} e
742
749
  */
743
- p(this, V, (e) => {
744
- const { row: s, cell: l, data: n, columnKey: i } = t(this, L).call(this, e, "body");
750
+ p(this, V, (t) => {
751
+ const { row: s, cell: n, data: l, columnKey: i } = e(this, L).call(this, t, "body");
745
752
  s && this.dispatchEvent(
746
753
  new Lt({
747
754
  column: i,
748
- row: n,
749
- cell: l
755
+ row: l,
756
+ cell: n
750
757
  })
751
758
  );
752
759
  });
@@ -754,11 +761,11 @@ class Ht extends rt {
754
761
  * 鼠标点击单元格事件
755
762
  * @param {MouseEvent} e
756
763
  */
757
- p(this, X, (e) => {
758
- const { cell: s, columnKey: l } = t(this, L).call(this, e, "head");
764
+ p(this, X, (t) => {
765
+ const { cell: s, columnKey: n } = e(this, L).call(this, t, "head");
759
766
  s && this.dispatchEvent(
760
767
  new Mt({
761
- column: l,
768
+ column: n,
762
769
  cell: s
763
770
  })
764
771
  );
@@ -767,11 +774,11 @@ class Ht extends rt {
767
774
  * 表头鼠标右键事件
768
775
  * @param {MouseEvent} e
769
776
  */
770
- p(this, Y, (e) => {
771
- const { cell: s, columnKey: l } = t(this, L).call(this, e, "head");
777
+ p(this, Y, (t) => {
778
+ const { cell: s, columnKey: n } = e(this, L).call(this, t, "head");
772
779
  s && this.dispatchEvent(
773
780
  new $t({
774
- column: l,
781
+ column: n,
775
782
  cell: s
776
783
  })
777
784
  );
@@ -780,41 +787,41 @@ class Ht extends rt {
780
787
  * 监听默认插槽变化
781
788
  */
782
789
  p(this, Z, () => {
783
- this.$render(), t(this, c).originData.length > 0 && this.setData(t(this, c).originData);
790
+ this.$render(), e(this, h).originData.length > 0 && this.setData(e(this, h).originData);
784
791
  });
785
792
  /**
786
793
  * 监听子元素变化
787
794
  * @param {Event} e
788
795
  */
789
- p(this, tt, (e) => {
790
- e.stopImmediatePropagation(), this.$render(), t(this, c).originData.length > 0 && this.setData(t(this, c).originData);
796
+ p(this, tt, (t) => {
797
+ t.stopImmediatePropagation(), this.$render(), e(this, h).originData.length > 0 && this.setData(e(this, h).originData);
791
798
  });
792
799
  /**
793
800
  * 当存在 selection 列时,checkbox 的改变事件
794
801
  * @param {Event} e
795
802
  */
796
- p(this, et, (e) => {
797
- if (e.target.getAttribute("data-type") !== "selection") return;
798
- e.stopImmediatePropagation();
799
- const { checked: s } = e.detail;
800
- if (e.target.closest(".ea-table__thead")) {
801
- const n = [
802
- ...t(this, w).querySelectorAll('ea-checkbox[data-type="selection"]')
803
+ p(this, et, (t) => {
804
+ if (t.target.getAttribute("data-type") !== "selection") return;
805
+ t.stopImmediatePropagation();
806
+ const { checked: s } = t.detail;
807
+ if (t.target.closest(".ea-table__thead")) {
808
+ const l = [
809
+ ...e(this, w).querySelectorAll('ea-checkbox[data-type="selection"]')
803
810
  ];
804
- e.target.toggleAttribute("checked", e.target.hasAttribute("checked")), n.forEach((h) => {
805
- h.hasAttribute("disabled") || h.toggleAttribute("checked", s);
811
+ t.target.toggleAttribute("checked", t.target.hasAttribute("checked")), l.forEach((c) => {
812
+ c.hasAttribute("disabled") || c.toggleAttribute("checked", s);
806
813
  });
807
- const i = t(this, D).call(this);
814
+ const i = e(this, D).call(this);
808
815
  this.dispatchEvent(new mt({ selection: i }));
809
816
  } else {
810
- const n = t(this, D).call(this), i = t(this, c).dataSource.get(
811
- e.target.closest('.ea-table__tr[part="tbody-tr"]')
817
+ const l = e(this, D).call(this), i = e(this, h).dataSource.get(
818
+ t.target.closest('.ea-table__tr[part="tbody-tr"]')
812
819
  );
813
- t(this, j).call(this), this.dispatchEvent(
814
- new ft({ selection: n, row: i })
820
+ e(this, P).call(this), this.dispatchEvent(
821
+ new ft({ selection: l, row: i })
815
822
  );
816
823
  }
817
- t(this, M).call(this);
824
+ e(this, $).call(this);
818
825
  });
819
826
  this.stylesheet = ht, this.shadowRoot.innerHTML = this.html(`
820
827
  <slot id='defaultSlot' part='default-slot'></slot>
@@ -825,7 +832,7 @@ class Ht extends rt {
825
832
  <tfoot class='ea-table__tfoot' part='tfoot'></tfoot>
826
833
  </table>
827
834
  <slot class="ea-table__empty" name="empty">No Data</slot>
828
- `), C(this, f, this.shadowRoot.querySelector(".ea-table")), C(this, F, this.shadowRoot.querySelector("#defaultSlot")), C(this, T, this.shadowRoot.querySelector(".ea-table__thead")), C(this, w, this.shadowRoot.querySelector(".ea-table__tbody")), C(this, I, this.shadowRoot.querySelector(".ea-table__tfoot")), C(this, B, this.shadowRoot.querySelector(".ea-table__empty"));
835
+ `), C(this, f, this.shadowRoot.querySelector(".ea-table")), C(this, I, this.shadowRoot.querySelector("#defaultSlot")), C(this, T, this.shadowRoot.querySelector(".ea-table__thead")), C(this, w, this.shadowRoot.querySelector(".ea-table__tbody")), C(this, H, this.shadowRoot.querySelector(".ea-table__tfoot")), C(this, F, this.shadowRoot.querySelector(".ea-table__empty"));
829
836
  }
830
837
  static get observedAttributes() {
831
838
  return [
@@ -843,48 +850,48 @@ class Ht extends rt {
843
850
  * @return {string} 属性值
844
851
  */
845
852
  updateContainerClasslist() {
846
- const e = this.computedClasslist(
853
+ const t = this.computedClasslist(
847
854
  "ea-table",
848
855
  {},
849
856
  {
850
857
  stripe: this.stripe,
851
858
  border: this.border,
852
859
  "sticky-header": CSS.supports("height", this.height) || CSS.supports("height", this.maxHeight),
853
- data: t(this, c).originData.length > 0
860
+ data: e(this, h).originData.length > 0
854
861
  }
855
862
  );
856
- return t(this, f).className = e, t(this, B).className = this.computedClasslist(
863
+ return e(this, f).className = t, e(this, F).className = this.computedClasslist(
857
864
  "ea-table__empty",
858
865
  {},
859
866
  {
860
- data: t(this, c).originData.length > 0
867
+ data: e(this, h).originData.length > 0
861
868
  }
862
- ), e;
869
+ ), t;
863
870
  }
864
871
  async $render() {
865
- var e;
866
- await customElements.whenDefined("ea-table-column"), (e = t(this, g)) == null || e.abort(), C(this, g, new AbortController()), t(this, K).call(this), t(this, P).call(this), this.addEventListener("ea-table-column-change", t(this, tt), {
867
- signal: t(this, g).signal
868
- }), t(this, f).addEventListener("mousedown", t(this, G), {
869
- signal: t(this, g).signal
870
- }), t(this, f).addEventListener("dblclick", t(this, z), {
871
- signal: t(this, g).signal
872
- }), t(this, f).addEventListener("contextmenu", t(this, J), {
873
- signal: t(this, g).signal
874
- }), t(this, T).addEventListener("click", t(this, X), {
875
- signal: t(this, g).signal
876
- }), t(this, T).addEventListener(
872
+ var t;
873
+ await customElements.whenDefined("ea-table-column"), (t = e(this, g)) == null || t.abort(), C(this, g, new AbortController()), e(this, B).call(this), e(this, K).call(this), this.addEventListener("ea-table-column-change", e(this, tt), {
874
+ signal: e(this, g).signal
875
+ }), e(this, f).addEventListener("mousedown", e(this, z), {
876
+ signal: e(this, g).signal
877
+ }), e(this, f).addEventListener("dblclick", e(this, G), {
878
+ signal: e(this, g).signal
879
+ }), e(this, f).addEventListener("contextmenu", e(this, J), {
880
+ signal: e(this, g).signal
881
+ }), e(this, T).addEventListener("click", e(this, X), {
882
+ signal: e(this, g).signal
883
+ }), e(this, T).addEventListener(
877
884
  "contextmenu",
878
- t(this, Y),
885
+ e(this, Y),
879
886
  {
880
- signal: t(this, g).signal
887
+ signal: e(this, g).signal
881
888
  }
882
- ), t(this, f).addEventListener("scroll", t(this, O), {
883
- signal: t(this, g).signal
884
- }), t(this, f).addEventListener("mouseover", t(this, Q), {
885
- signal: t(this, g).signal
886
- }), t(this, f).addEventListener("mouseout", t(this, V), {
887
- signal: t(this, g).signal
889
+ ), e(this, f).addEventListener("scroll", e(this, O), {
890
+ signal: e(this, g).signal
891
+ }), e(this, f).addEventListener("mouseover", e(this, Q), {
892
+ signal: e(this, g).signal
893
+ }), e(this, f).addEventListener("mouseout", e(this, V), {
894
+ signal: e(this, g).signal
888
895
  });
889
896
  }
890
897
  /**
@@ -892,32 +899,32 @@ class Ht extends rt {
892
899
  * @returns {Promise<Object>}
893
900
  */
894
901
  getCurrentRow() {
895
- return t(this, c).currentRow;
902
+ return e(this, h).currentRow;
896
903
  }
897
904
  /**
898
905
  * 设置当前行数据
899
906
  * @param {any} row 当前行数据
900
907
  */
901
- setCurrentRow(e) {
902
- let s = null, l = null;
903
- e && typeof e == "object" && (s = t(this, c).dataIndex.get(e) || null, l = e), s && l ? (t(this, $).call(this, s, t(this, c).currentRow.target), t(this, c).currentRow.target = s, t(this, c).currentRow.value = l) : (t(this, U).call(this, t(this, c).currentRow.target), t(this, c).currentRow.value = null, t(this, c).currentRow.target = null);
908
+ setCurrentRow(t) {
909
+ let s = null, n = null;
910
+ t && typeof t == "object" && (s = e(this, h).dataIndex.get(t) || null, n = t), s && n ? (e(this, j).call(this, s, e(this, h).currentRow.target), e(this, h).currentRow.target = s, e(this, h).currentRow.value = n) : (e(this, U).call(this, e(this, h).currentRow.target), e(this, h).currentRow.value = null, e(this, h).currentRow.target = null);
904
911
  }
905
912
  connectedCallback() {
906
- var e;
907
- super.connectedCallback(), (e = t(this, g)) == null || e.abort(), C(this, g, new AbortController()), this.$render(), t(this, F).addEventListener("slotchange", t(this, Z), {
908
- signal: t(this, g).signal
913
+ var t;
914
+ super.connectedCallback(), (t = e(this, g)) == null || t.abort(), C(this, g, new AbortController()), this.$render(), e(this, I).addEventListener("slotchange", e(this, Z), {
915
+ signal: e(this, g).signal
909
916
  });
910
917
  }
911
918
  $beforeUnmounted() {
912
- var e;
913
- (e = t(this, g)) == null || e.abort();
914
- for (const s in t(this, c))
915
- t(this, c)[s] = null;
919
+ var t;
920
+ (t = e(this, g)) == null || t.abort();
921
+ for (const s in e(this, h))
922
+ e(this, h)[s] = null;
916
923
  }
917
924
  }
918
- f = new WeakMap(), T = new WeakMap(), w = new WeakMap(), I = new WeakMap(), F = new WeakMap(), B = new WeakMap(), g = new WeakMap(), k = new WeakMap(), c = new WeakMap(), K = new WeakMap(), P = new WeakMap(), D = new WeakMap(), j = new WeakMap(), W = new WeakMap(), $ = new WeakMap(), U = new WeakMap(), M = new WeakMap(), G = new WeakMap(), L = new WeakMap(), z = new WeakMap(), J = new WeakMap(), O = new WeakMap(), Q = new WeakMap(), V = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), tt = new WeakMap(), et = new WeakMap();
925
+ f = new WeakMap(), T = new WeakMap(), w = new WeakMap(), H = new WeakMap(), I = new WeakMap(), F = new WeakMap(), g = new WeakMap(), k = new WeakMap(), h = new WeakMap(), B = new WeakMap(), K = new WeakMap(), D = new WeakMap(), P = new WeakMap(), W = new WeakMap(), j = new WeakMap(), U = new WeakMap(), $ = new WeakMap(), z = new WeakMap(), L = new WeakMap(), G = new WeakMap(), J = new WeakMap(), O = new WeakMap(), Q = new WeakMap(), V = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), tt = new WeakMap(), et = new WeakMap();
919
926
  window.customElements.get("ea-table") || window.customElements.define("ea-table", Ht);
920
- var R, q, N, st, y, _, lt;
927
+ var R, q, M, st, y, _, lt;
921
928
  class It extends rt {
922
929
  constructor() {
923
930
  super();
@@ -931,8 +938,8 @@ class It extends rt {
931
938
  type: ["selection", "index"],
932
939
  default: "",
933
940
  /** @param {"selection" | "index"} newVal */
934
- observer: (e) => {
935
- e === "selection" && !customElements.get("ea-checkbox") && import("./ea-checkbox.js"), S(this, y, _).call(this);
941
+ observer: (t) => {
942
+ t === "selection" && !customElements.get("ea-checkbox") && import("./ea-checkbox.js"), S(this, y, _).call(this);
936
943
  }
937
944
  },
938
945
  align: {
@@ -946,14 +953,14 @@ class It extends rt {
946
953
  type: String,
947
954
  default: "",
948
955
  observer: () => {
949
- t(this, R) && (t(this, R).textContent = `${this.label}[$${this.prop}]`), S(this, y, _).call(this);
956
+ e(this, R) && (e(this, R).textContent = `${this.label}[$${this.prop}]`), S(this, y, _).call(this);
950
957
  }
951
958
  },
952
959
  prop: {
953
960
  type: String,
954
961
  default: "",
955
962
  observer: () => {
956
- t(this, R) && (t(this, R).textContent = `${this.label}[$${this.prop}]`), S(this, y, _).call(this);
963
+ e(this, R) && (e(this, R).textContent = `${this.label}[$${this.prop}]`), S(this, y, _).call(this);
957
964
  }
958
965
  },
959
966
  colspan: {
@@ -979,7 +986,11 @@ class It extends rt {
979
986
  },
980
987
  fixed: {
981
988
  type: ["left", "right", "false"],
982
- default: () => this.hasAttribute("fixed") && this.getAttribute("fixed") !== "false" ? this.getAttribute("fixed") || "left" : null,
989
+ default: () => {
990
+ if (!this.hasAttribute("fixed")) return null;
991
+ const t = this.getAttribute("fixed");
992
+ return t === "false" || t === "null" || t === "" ? "left" : t || "left";
993
+ },
983
994
  observer: () => {
984
995
  S(this, y, _).call(this);
985
996
  }
@@ -1003,40 +1014,40 @@ class It extends rt {
1003
1014
  * @returns {TableColumnCtx}
1004
1015
  */
1005
1016
  default: () => {
1006
- const e = this.closest("ea-table"), s = [...this.querySelectorAll("& > ea-table-column")], l = this.shadowRoot.querySelector('slot[name="header"]'), n = this.shadowRoot.querySelector("#defaultSlot"), i = ["prop", "label", "width", "fixed", "sortable"];
1007
- let h = null;
1017
+ const t = this.closest("ea-table"), s = [...this.querySelectorAll("& > ea-table-column")], n = this.shadowRoot.querySelector('slot[name="header"]'), l = this.shadowRoot.querySelector("#defaultSlot"), i = ["prop", "label", "width", "fixed", "sortable"];
1018
+ let c = null;
1008
1019
  if (s.length)
1009
- h = s.map((u) => u.getColumnTree);
1020
+ c = s.map((u) => u.getColumnTree);
1010
1021
  else {
1011
- const u = Array.from(n.assignedElements() || []).map((a) => {
1022
+ const u = Array.from(l.assignedElements() || []).map((a) => {
1012
1023
  var b;
1013
1024
  return (b = a.outerHTML) == null ? void 0 : b.trim();
1014
1025
  }).join("");
1015
1026
  if (u) {
1016
1027
  const a = document.createElement("template");
1017
- a.innerHTML = this.html(u), h = a;
1028
+ a.innerHTML = this.html(u), c = a;
1018
1029
  } else
1019
- h = null;
1030
+ c = null;
1020
1031
  }
1021
1032
  return {
1022
1033
  label: this.label,
1023
1034
  prop: this.prop,
1024
1035
  type: this.type,
1025
1036
  colspan: this.colspan,
1026
- rowspan: h ? 1 : t(this, st).call(this, e) - t(this, N).call(this, this, e) + 1,
1037
+ rowspan: c ? 1 : e(this, st).call(this, t) - e(this, M).call(this, this, t) + 1,
1027
1038
  align: this.align,
1028
1039
  width: this.width,
1029
1040
  sortable: this.sortable,
1030
1041
  fixed: this.fixed,
1031
- depth: t(this, N).call(this, this, e),
1042
+ depth: e(this, M).call(this, this, t),
1032
1043
  props: [...this.attributes].filter(
1033
1044
  (u) => !i.includes(u.name)
1034
1045
  ),
1035
- header: l.assignedElements().map((u) => {
1046
+ header: n.assignedElements().map((u) => {
1036
1047
  var a;
1037
1048
  return (a = u.outerHTML) == null ? void 0 : a.trim();
1038
1049
  }).join("") || null,
1039
- template: h
1050
+ template: c
1040
1051
  };
1041
1052
  }
1042
1053
  }
@@ -1047,21 +1058,21 @@ class It extends rt {
1047
1058
  * @param {import("../ea-table/index.js").EaTable} root
1048
1059
  * @returns {number}
1049
1060
  */
1050
- p(this, N, (e, s) => {
1051
- let l = 0;
1052
- for (; e !== s; )
1053
- e = e.parentElement, l++;
1054
- return l;
1061
+ p(this, M, (t, s) => {
1062
+ let n = 0;
1063
+ for (; t !== s; )
1064
+ t = t.parentElement, n++;
1065
+ return n;
1055
1066
  });
1056
1067
  /**
1057
1068
  * 获取最大深度
1058
1069
  * @param {import("../ea-table/index.js").EaTable} root
1059
1070
  * @returns {number}
1060
1071
  */
1061
- p(this, st, (e) => {
1072
+ p(this, st, (t) => {
1062
1073
  let s = 0;
1063
- return e.querySelectorAll("ea-table-column").forEach((l) => {
1064
- s = Math.max(s, t(this, N).call(this, l, e));
1074
+ return t.querySelectorAll("ea-table-column").forEach((n) => {
1075
+ s = Math.max(s, e(this, M).call(this, n, t));
1065
1076
  }), s;
1066
1077
  });
1067
1078
  this.stylesheet = dt, this.$render();
@@ -1094,10 +1105,10 @@ class It extends rt {
1094
1105
  super.connectedCallback(), S(this, y, lt).call(this);
1095
1106
  }
1096
1107
  $beforeUnmounted() {
1097
- t(this, q) && (t(this, q).disconnect(), C(this, q, null));
1108
+ e(this, q) && (e(this, q).disconnect(), C(this, q, null));
1098
1109
  }
1099
1110
  }
1100
- R = new WeakMap(), q = new WeakMap(), N = new WeakMap(), st = new WeakMap(), y = new WeakSet(), /**
1111
+ R = new WeakMap(), q = new WeakMap(), M = new WeakMap(), st = new WeakMap(), y = new WeakSet(), /**
1101
1112
  * 通知父组件更新
1102
1113
  */
1103
1114
  _ = function() {
@@ -1111,7 +1122,7 @@ _ = function() {
1111
1122
  lt = function() {
1112
1123
  C(this, q, new MutationObserver(() => {
1113
1124
  S(this, y, _).call(this);
1114
- })), t(this, q).observe(this, {
1125
+ })), e(this, q).observe(this, {
1115
1126
  childList: !0,
1116
1127
  subtree: !0,
1117
1128
  characterData: !0