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