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