@ninebone/table 0.0.386 β 0.0.387
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/nine-table.js +189 -191
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var xe = (x) => {
|
|
3
3
|
throw TypeError(x);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (x, i) =>
|
|
7
|
-
var v = (x, i, e) =>
|
|
8
|
-
var t = (x, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var Ee = (x, i, e) => i in x ? me(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
|
+
var a = (x, i) => me(x, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (x, i, e) => Ee(x, typeof i != "symbol" ? i + "" : i, e), ve = (x, i, e) => i.has(x) || xe("Cannot " + e);
|
|
8
|
+
var t = (x, i, e) => (ve(x, i, "read from private field"), e ? e.call(x) : i.get(x)), c = (x, i, e) => i.has(x) ? xe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (ve(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
|
+
var we = (x, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
g(x, i, n, e);
|
|
12
12
|
},
|
|
@@ -14,37 +14,37 @@ var Ee = (x, i, e, s) => ({
|
|
|
14
14
|
return t(x, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Re } from "@ninebone/util";
|
|
18
|
+
const le = class le extends Re.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
a(le, "Trace");
|
|
24
|
+
let Kt = le;
|
|
25
|
+
const O = new Kt();
|
|
26
|
+
var _, z, p, Y, X, U, St, F, Et;
|
|
27
|
+
const ae = class ae extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
c(this,
|
|
31
|
-
c(this,
|
|
30
|
+
c(this, _);
|
|
31
|
+
c(this, z, !1);
|
|
32
32
|
c(this, p);
|
|
33
33
|
c(this, Y);
|
|
34
34
|
c(this, X);
|
|
35
35
|
c(this, U);
|
|
36
|
-
c(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
c(this, St, /* @__PURE__ */ a(() => {
|
|
37
|
+
if (!t(this, _)) return;
|
|
38
|
+
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
39
|
e && (g(this, U, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, U).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, p) || t(this, z)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, p).track, r = t(this, p).thumb, o = t(this,
|
|
47
|
+
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && d > l)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,7 +59,7 @@ const he = class he extends HTMLElement {
|
|
|
59
59
|
let y = 0;
|
|
60
60
|
b > 0 && (y = parseInt(u / b * (h - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const m = h - f;
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, O.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
c(this, F, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
@@ -73,7 +73,7 @@ const he = class he extends HTMLElement {
|
|
|
73
73
|
const h = s.clientWidth, u = n.scrollWidth - h;
|
|
74
74
|
return d > 0 && u > 0 && (s.scrollLeft = l / d * u), l > 0 && l < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
c(this,
|
|
76
|
+
c(this, Et, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
78
|
clearInterval(t(this, Y)), clearInterval(t(this, X));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
@@ -99,20 +99,20 @@ const he = class he extends HTMLElement {
|
|
|
99
99
|
t(this, F).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, z, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, z)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
106
|
t(this, F).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
|
-
g(this,
|
|
108
|
+
g(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (g(this,
|
|
115
|
+
if (g(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, _)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const he = class he extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ a(() => {
|
|
180
|
-
const s = t(this,
|
|
180
|
+
const s = t(this, _).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -189,8 +189,8 @@ const he = class he extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, z) || this.refresh();
|
|
193
|
+
}), t(this, Et).call(this), t(this, St).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,26 +198,25 @@ const he = class he extends HTMLElement {
|
|
|
198
198
|
t(this, U) && t(this, U).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
_ = new WeakMap(), z = new WeakMap(), p = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), U = new WeakMap(), St = new WeakMap(), F = new WeakMap(), Et = new WeakMap(), a(ae, "NineTableHScrollBar");
|
|
202
|
+
let Zt = ae;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Zt);
|
|
204
|
+
var D, Q, B, S, ht, dt, Rt;
|
|
205
|
+
const ce = class ce extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
209
|
-
c(this,
|
|
208
|
+
c(this, D);
|
|
209
|
+
c(this, Q);
|
|
210
210
|
c(this, B, !1);
|
|
211
211
|
c(this, S);
|
|
212
|
-
c(this,
|
|
213
|
-
c(this,
|
|
212
|
+
c(this, ht, 0);
|
|
213
|
+
c(this, dt, 0);
|
|
214
214
|
/**
|
|
215
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (((Et = t(this, M).data) == null ? void 0 : Et.get()) || ((Q = t(this, M).data) == null ? void 0 : Q.get()) || []).length, d = (xe = (ct = t(this, M)).getRowHeight) == null ? void 0 : xe.call(ct), h = l * d;
|
|
218
|
+
if (!t(this, D) || !t(this, S) || t(this, B)) return;
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this, D).data.get() || []).length, d = t(this, Q).getRowHeight(), h = l * d;
|
|
221
220
|
if (h <= r) {
|
|
222
221
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
223
222
|
return;
|
|
@@ -233,25 +232,24 @@ const de = class de extends HTMLElement {
|
|
|
233
232
|
const at = f - u;
|
|
234
233
|
k < 0 && (k = 0), k > at && (k = at), n.style.top = `${k}px`, t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= E - 1;
|
|
235
234
|
}, "refresh"));
|
|
236
|
-
c(this,
|
|
235
|
+
c(this, Rt, /* @__PURE__ */ a(() => {
|
|
237
236
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
238
|
-
|
|
239
|
-
const n = ((d = (l = t(this, M).host) == null ? void 0 : l.data) == null ? void 0 : d.get()) || ((f = (h = t(this, M)._host) == null ? void 0 : h.data) == null ? void 0 : f.get()) || [], r = n.length > 0 ? n.length : 61, o = ((b = (u = t(this, M)).getRowHeight) == null ? void 0 : b.call(u)) || 85;
|
|
237
|
+
const r = (t(this, D).data.get() || []).length, o = t(this, Q).getRowHeight();
|
|
240
238
|
return r * o;
|
|
241
239
|
}, "getContentHeight");
|
|
242
240
|
e.addEventListener("scroll", () => {
|
|
243
241
|
t(this, B) || this.refresh();
|
|
244
242
|
}), t(this, S).thumb.addEventListener("mousedown", (n) => {
|
|
245
243
|
if (n.button !== 0) return;
|
|
246
|
-
n.stopPropagation(), n.preventDefault(), g(this, B, !0), g(this,
|
|
244
|
+
n.stopPropagation(), n.preventDefault(), g(this, B, !0), g(this, ht, n.clientY), g(this, dt, e.scrollTop);
|
|
247
245
|
const r = /* @__PURE__ */ a((l) => {
|
|
248
246
|
if (!t(this, B)) return;
|
|
249
|
-
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this,
|
|
247
|
+
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this, ht), y = e.clientHeight, m = s(), E = e.querySelector("table"), k = E ? E.scrollHeight : m, at = Math.max(m - y, k - y, 1);
|
|
250
248
|
if (u > 0 && at > 0) {
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
const
|
|
254
|
-
|
|
249
|
+
const Se = b / u * at;
|
|
250
|
+
let jt = t(this, dt) + Se;
|
|
251
|
+
const pe = Math.max(0, k - y);
|
|
252
|
+
jt > pe && (jt = pe), e.scrollTop = jt;
|
|
255
253
|
}
|
|
256
254
|
this.refresh();
|
|
257
255
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
@@ -274,7 +272,7 @@ const de = class de extends HTMLElement {
|
|
|
274
272
|
}, "#init"));
|
|
275
273
|
}
|
|
276
274
|
connectedCallback() {
|
|
277
|
-
g(this,
|
|
275
|
+
g(this, D, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
278
276
|
<style>
|
|
279
277
|
nine-table-vscrollbar {
|
|
280
278
|
display: flex;
|
|
@@ -338,7 +336,7 @@ const de = class de extends HTMLElement {
|
|
|
338
336
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
337
|
`;
|
|
340
338
|
const e = /* @__PURE__ */ a(() => {
|
|
341
|
-
const s = t(this,
|
|
339
|
+
const s = t(this, D).shadowRoot.querySelector(".ng-container-body");
|
|
342
340
|
if (!s) {
|
|
343
341
|
setTimeout(e, 10);
|
|
344
342
|
return;
|
|
@@ -349,21 +347,21 @@ const de = class de extends HTMLElement {
|
|
|
349
347
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
348
|
top: this.querySelector(".ng-scroll-top"),
|
|
351
349
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
352
|
-
}), t(this,
|
|
350
|
+
}), t(this, Rt).call(this), this.refresh();
|
|
353
351
|
}, "initWhenReady");
|
|
354
352
|
e();
|
|
355
353
|
}
|
|
356
354
|
};
|
|
357
|
-
|
|
358
|
-
let
|
|
359
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
360
|
-
var
|
|
361
|
-
const
|
|
355
|
+
D = new WeakMap(), Q = new WeakMap(), B = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Rt = new WeakMap(), a(ce, "NineTableVScrollBar");
|
|
356
|
+
let Gt = ce;
|
|
357
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Gt);
|
|
358
|
+
var At, tt;
|
|
359
|
+
const M = class M {
|
|
362
360
|
/**
|
|
363
361
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
364
362
|
*/
|
|
365
363
|
static compileAll(i) {
|
|
366
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
364
|
+
return Array.isArray(i) ? i.map((e) => M.compile(e)) : [];
|
|
367
365
|
}
|
|
368
366
|
/**
|
|
369
367
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -372,7 +370,7 @@ const I = class I {
|
|
|
372
370
|
var n, r, o, l;
|
|
373
371
|
if (!i) return null;
|
|
374
372
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(n =
|
|
373
|
+
return t(n = M, At).call(n, e), t(r = M, tt).call(r, e, "thead"), t(o = M, tt).call(o, e, "tbody"), t(l = M, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, h) => {
|
|
376
374
|
const f = d.getAttribute("fixed");
|
|
377
375
|
f && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((u) => {
|
|
378
376
|
u.setAttribute("fixed", f);
|
|
@@ -380,7 +378,7 @@ const I = class I {
|
|
|
380
378
|
}), e;
|
|
381
379
|
}
|
|
382
380
|
};
|
|
383
|
-
|
|
381
|
+
At = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PURE__ */ a((i) => {
|
|
384
382
|
if (!i.querySelector("colgroup")) {
|
|
385
383
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
386
384
|
for (let o = 0; o < s; o++) {
|
|
@@ -394,7 +392,7 @@ kt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), c(I, kt, /* @__PU
|
|
|
394
392
|
s ? s.after(e) : i.prepend(e);
|
|
395
393
|
}
|
|
396
394
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
397
|
-
}, "#ensureTableStructure")), c(
|
|
395
|
+
}, "#ensureTableStructure")), c(M, tt, /* @__PURE__ */ a((i, e) => {
|
|
398
396
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
397
|
if (r === 0 || n.length === 0) return;
|
|
400
398
|
let o = 0;
|
|
@@ -427,26 +425,26 @@ kt = new WeakMap(), tt = new WeakMap(), a(I, "TableCompiler"), c(I, kt, /* @__PU
|
|
|
427
425
|
});
|
|
428
426
|
});
|
|
429
427
|
}, "#resetColIndex"));
|
|
430
|
-
let
|
|
431
|
-
var
|
|
432
|
-
const
|
|
428
|
+
let Jt = M;
|
|
429
|
+
var I, w, W, T, N, j, P, et, Tt, qt, kt, ft, ut, Lt, Ht, gt, Ct, it, bt;
|
|
430
|
+
const he = class he {
|
|
433
431
|
constructor(i) {
|
|
434
|
-
c(this,
|
|
432
|
+
c(this, I);
|
|
435
433
|
c(this, w);
|
|
436
|
-
c(this,
|
|
434
|
+
c(this, W, /* @__PURE__ */ new Map());
|
|
437
435
|
c(this, T, null);
|
|
438
436
|
c(this, N, null);
|
|
439
437
|
c(this, j, 0);
|
|
440
438
|
c(this, P, 40);
|
|
441
439
|
c(this, et, !1);
|
|
442
|
-
c(this,
|
|
440
|
+
c(this, Tt, 3);
|
|
443
441
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
442
|
var e;
|
|
445
443
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
|
-
i && (t(this,
|
|
444
|
+
i && (t(this, ft).call(this), t(this, it).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
445
|
}, "refresh"));
|
|
448
446
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
|
-
g(this, T, null), t(this,
|
|
447
|
+
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
450
448
|
const r = t(this, w).querySelector(n);
|
|
451
449
|
if (!r) return;
|
|
452
450
|
const o = r.querySelector("table");
|
|
@@ -454,11 +452,11 @@ const fe = class fe {
|
|
|
454
452
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
455
453
|
if (!l) return;
|
|
456
454
|
const h = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
-
t(this,
|
|
455
|
+
t(this, W).set(n, h);
|
|
458
456
|
});
|
|
459
457
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
460
458
|
if (i) {
|
|
461
|
-
t(this,
|
|
459
|
+
t(this, kt).call(this, i), t(this, gt).call(this), t(this, ft).call(this), t(this, it).call(this, i.scrollTop);
|
|
462
460
|
let n = i.scrollTop;
|
|
463
461
|
const r = /* @__PURE__ */ a((o) => {
|
|
464
462
|
var l;
|
|
@@ -470,8 +468,8 @@ const fe = class fe {
|
|
|
470
468
|
});
|
|
471
469
|
}
|
|
472
470
|
}, "initialize"));
|
|
473
|
-
c(this,
|
|
474
|
-
const s = t(this,
|
|
471
|
+
c(this, qt, /* @__PURE__ */ a((i, e) => {
|
|
472
|
+
const s = t(this, W).get(e);
|
|
475
473
|
if (!s || s.length === 0) return;
|
|
476
474
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
477
475
|
if (!n) return;
|
|
@@ -483,10 +481,10 @@ const fe = class fe {
|
|
|
483
481
|
});
|
|
484
482
|
r ? r.before(o) : n.appendChild(o);
|
|
485
483
|
}, "#renderRows"));
|
|
486
|
-
c(this,
|
|
484
|
+
c(this, kt, /* @__PURE__ */ a((i) => {
|
|
487
485
|
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
486
|
return t(this, T);
|
|
489
|
-
const e = t(this,
|
|
487
|
+
const e = t(this, W).get(".ng-container-body");
|
|
490
488
|
if (!e || e.length === 0) return 24;
|
|
491
489
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
492
490
|
if (!s) return 24;
|
|
@@ -501,23 +499,23 @@ const fe = class fe {
|
|
|
501
499
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
502
500
|
return u.forEach((b) => {
|
|
503
501
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
504
|
-
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this,
|
|
502
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this, ut).call(this), t(this, T);
|
|
505
503
|
}, "#measureAndCacheHeight"));
|
|
506
|
-
c(this,
|
|
504
|
+
c(this, ft, /* @__PURE__ */ a(() => {
|
|
507
505
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
508
|
-
const s = (t(this,
|
|
509
|
-
|
|
506
|
+
const s = (t(this, I).data.get() || []).length, n = t(this, T) || 24, r = s * n;
|
|
507
|
+
O.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${n}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
510
508
|
const l = t(this, w).querySelector(o), d = l == null ? void 0 : l.querySelector("table");
|
|
511
509
|
d && (d.style.height = `${r}px`);
|
|
512
510
|
});
|
|
513
511
|
}, "#updateVirtualScrollHeight"));
|
|
514
|
-
c(this,
|
|
515
|
-
if ((t(this,
|
|
512
|
+
c(this, ut, /* @__PURE__ */ a(() => {
|
|
513
|
+
if ((t(this, I).data.get() || []).length, t(this, j) > 0 && t(this, T) > 0) {
|
|
516
514
|
const e = Math.ceil(t(this, j) / t(this, T));
|
|
517
|
-
g(this, P, e + t(this,
|
|
515
|
+
g(this, P, e + t(this, Tt)), O.log("visibleRows:", e, "cachedRowCount:", t(this, P));
|
|
518
516
|
}
|
|
519
517
|
}, "#updateRowCount"));
|
|
520
|
-
c(this,
|
|
518
|
+
c(this, Lt, /* @__PURE__ */ a(() => {
|
|
521
519
|
var d, h, f;
|
|
522
520
|
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
523
521
|
if (!e) return;
|
|
@@ -531,7 +529,7 @@ const fe = class fe {
|
|
|
531
529
|
y > 0 && (n[u] && (n[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), o[u] && (o[u].style.height = `${y}px`));
|
|
532
530
|
}
|
|
533
531
|
}, "#syncRowHeights"));
|
|
534
|
-
c(this,
|
|
532
|
+
c(this, Ht, /* @__PURE__ */ a(() => {
|
|
535
533
|
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, N, new ResizeObserver((i) => {
|
|
536
534
|
for (const e of i) {
|
|
537
535
|
const s = e.target;
|
|
@@ -542,33 +540,33 @@ const fe = class fe {
|
|
|
542
540
|
const o = s.querySelector("thead");
|
|
543
541
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
544
542
|
const l = Math.max(n - r, 100);
|
|
545
|
-
t(this, j) !== l && (g(this, j, l), t(this,
|
|
543
|
+
t(this, j) !== l && (g(this, j, l), t(this, ut).call(this), t(this, T) !== null && t(this, gt).call(this));
|
|
546
544
|
}
|
|
547
545
|
}
|
|
548
546
|
})), t(this, N).observe(t(this, w)));
|
|
549
547
|
}, "#initResizeObserver"));
|
|
550
|
-
c(this,
|
|
548
|
+
c(this, gt, /* @__PURE__ */ a(() => {
|
|
551
549
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
552
550
|
const e = t(this, w).querySelector(i);
|
|
553
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
554
|
-
}), t(this,
|
|
551
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, qt).call(this, e, i);
|
|
552
|
+
}), t(this, Lt).call(this);
|
|
555
553
|
}, "#renderAllContainers"));
|
|
556
|
-
c(this,
|
|
554
|
+
c(this, Ct, /* @__PURE__ */ a((i) => {
|
|
557
555
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
558
556
|
var h;
|
|
559
557
|
const s = t(this, w).querySelector(e);
|
|
560
558
|
if (!s) return;
|
|
561
559
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
562
560
|
if (!n) return;
|
|
563
|
-
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((h = t(this,
|
|
561
|
+
const r = Array.from(n.querySelectorAll("tr:not(.nodata)")), o = ((h = t(this, W).get(e)) == null ? void 0 : h.length) || 1, d = (t(this, I).data.get() || []).length;
|
|
564
562
|
r.forEach((f, u) => {
|
|
565
563
|
const b = i + Math.floor(u / o);
|
|
566
564
|
if (b >= d) {
|
|
567
565
|
f.style.display = "none";
|
|
568
566
|
return;
|
|
569
567
|
}
|
|
570
|
-
const y = t(this,
|
|
571
|
-
f.style.display = "", t(this,
|
|
568
|
+
const y = t(this, I).data.get(b);
|
|
569
|
+
f.style.display = "", t(this, bt).call(this, f, y, b);
|
|
572
570
|
});
|
|
573
571
|
});
|
|
574
572
|
}, "#adjustBufferRows"));
|
|
@@ -576,8 +574,8 @@ const fe = class fe {
|
|
|
576
574
|
var d;
|
|
577
575
|
const e = t(this, T);
|
|
578
576
|
if (!e || e <= 0) return;
|
|
579
|
-
const n = (t(this,
|
|
580
|
-
|
|
577
|
+
const n = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, P);
|
|
578
|
+
O.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, P)}, targetDataIndex range: ${r} ~ ${l} (Total: ${n})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
581
579
|
const f = t(this, w).querySelector(h);
|
|
582
580
|
if (!f) return;
|
|
583
581
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
@@ -588,14 +586,14 @@ const fe = class fe {
|
|
|
588
586
|
y.style.display = "none";
|
|
589
587
|
return;
|
|
590
588
|
}
|
|
591
|
-
const k = t(this,
|
|
592
|
-
y.style.display = "", t(this,
|
|
589
|
+
const k = t(this, I).data.get(E);
|
|
590
|
+
y.style.display = "", t(this, bt).call(this, y, k, E);
|
|
593
591
|
});
|
|
594
592
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
595
|
-
t(this,
|
|
593
|
+
t(this, Ct).call(this, r), g(this, et, !1);
|
|
596
594
|
}, 0));
|
|
597
595
|
}, "#handleScroll"));
|
|
598
|
-
c(this,
|
|
596
|
+
c(this, bt, /* @__PURE__ */ a((i, e, s) => {
|
|
599
597
|
i.dataset.row = s, Array.from(i.cells).forEach((n, r) => {
|
|
600
598
|
const o = n.dataset.bind;
|
|
601
599
|
o && e && e[o] !== void 0 ? n.textContent = e[o] : n.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
@@ -604,23 +602,23 @@ const fe = class fe {
|
|
|
604
602
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
605
603
|
t(this, N) && (t(this, N).disconnect(), g(this, N, null));
|
|
606
604
|
}, "destroy"));
|
|
607
|
-
g(this,
|
|
605
|
+
g(this, I, i.getRootNode().host), g(this, w, i), t(this, Ht).call(this);
|
|
608
606
|
}
|
|
609
607
|
getRowHeight() {
|
|
610
608
|
return t(this, T);
|
|
611
609
|
}
|
|
612
610
|
templateLength(i = ".ng-container-body") {
|
|
613
611
|
var e;
|
|
614
|
-
return ((e = t(this,
|
|
612
|
+
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
615
613
|
}
|
|
616
614
|
};
|
|
617
|
-
|
|
618
|
-
let
|
|
619
|
-
var
|
|
620
|
-
const
|
|
615
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), N = new WeakMap(), j = new WeakMap(), P = new WeakMap(), et = new WeakMap(), Tt = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), gt = new WeakMap(), Ct = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), a(he, "RowManager");
|
|
616
|
+
let Qt = he;
|
|
617
|
+
var Mt, st, K, _t, $t, It, Wt, Ot;
|
|
618
|
+
const ct = class ct extends HTMLElement {
|
|
621
619
|
constructor() {
|
|
622
620
|
super();
|
|
623
|
-
c(this,
|
|
621
|
+
c(this, Mt);
|
|
624
622
|
c(this, st, null);
|
|
625
623
|
c(this, K);
|
|
626
624
|
/**
|
|
@@ -630,7 +628,7 @@ const ht = class ht extends HTMLElement {
|
|
|
630
628
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
631
629
|
t(this, K).refresh();
|
|
632
630
|
}, "invalidate"));
|
|
633
|
-
c(this,
|
|
631
|
+
c(this, _t, /* @__PURE__ */ a(() => {
|
|
634
632
|
[
|
|
635
633
|
{ selector: ".ng-container-body", type: null },
|
|
636
634
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -638,11 +636,11 @@ const ht = class ht extends HTMLElement {
|
|
|
638
636
|
].forEach(({ selector: s, type: n }) => {
|
|
639
637
|
const r = this.querySelector(s);
|
|
640
638
|
if (!r) return;
|
|
641
|
-
const o = t(this,
|
|
639
|
+
const o = t(this, It).call(this, t(this, st), n);
|
|
642
640
|
r.innerHTML = "", r.appendChild(o);
|
|
643
641
|
});
|
|
644
642
|
}, "#renderSplitContainers"));
|
|
645
|
-
c(this,
|
|
643
|
+
c(this, $t, /* @__PURE__ */ a(() => {
|
|
646
644
|
["left", "right"].forEach((e) => {
|
|
647
645
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
648
646
|
if (!s || !n) return;
|
|
@@ -654,7 +652,7 @@ const ht = class ht extends HTMLElement {
|
|
|
654
652
|
});
|
|
655
653
|
}, "#updateContainerWidths"));
|
|
656
654
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
657
|
-
e && (g(this, st,
|
|
655
|
+
e && (g(this, st, Jt.compile(e)), t(this, st).style.display = "table", t(this, _t).call(this), t(this, $t).call(this), requestAnimationFrame(() => {
|
|
658
656
|
var n;
|
|
659
657
|
const s = (n = this.querySelector("thead")) == null ? void 0 : n.getBoundingClientRect().height;
|
|
660
658
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -668,7 +666,7 @@ const ht = class ht extends HTMLElement {
|
|
|
668
666
|
/**
|
|
669
667
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
670
668
|
*/
|
|
671
|
-
c(this,
|
|
669
|
+
c(this, It, /* @__PURE__ */ a((e, s) => {
|
|
672
670
|
const n = e.cloneNode(!0), r = n.querySelector("tbody");
|
|
673
671
|
if (r) {
|
|
674
672
|
const o = document.createElement("tbody");
|
|
@@ -691,11 +689,11 @@ const ht = class ht extends HTMLElement {
|
|
|
691
689
|
const s = this.querySelector(".ng-container-body");
|
|
692
690
|
s && (s.scrollTop = e);
|
|
693
691
|
}, "scrollToY"));
|
|
694
|
-
c(this,
|
|
695
|
-
t(this,
|
|
692
|
+
c(this, Wt, /* @__PURE__ */ a(() => {
|
|
693
|
+
t(this, Ot).call(this);
|
|
696
694
|
}, "#init"));
|
|
697
|
-
c(this,
|
|
698
|
-
const e =
|
|
695
|
+
c(this, Ot, /* @__PURE__ */ a(() => {
|
|
696
|
+
const e = ct.SCROLLBAR_SIZE;
|
|
699
697
|
this.innerHTML = `
|
|
700
698
|
<style>
|
|
701
699
|
nine-table-sheet {
|
|
@@ -841,31 +839,31 @@ const ht = class ht extends HTMLElement {
|
|
|
841
839
|
</div>
|
|
842
840
|
`;
|
|
843
841
|
}, "#render"));
|
|
844
|
-
g(this, K, new
|
|
842
|
+
g(this, K, new Qt(this)), g(this, Mt, this.getRootNode().host);
|
|
845
843
|
}
|
|
846
844
|
connectedCallback() {
|
|
847
|
-
t(this,
|
|
845
|
+
t(this, Wt).call(this);
|
|
848
846
|
}
|
|
849
847
|
disconnectedCallback() {
|
|
850
|
-
this.innerHTML = "",
|
|
848
|
+
this.innerHTML = "", O.log("NineTableSheet destroyed.");
|
|
851
849
|
}
|
|
852
850
|
};
|
|
853
|
-
|
|
854
|
-
let
|
|
855
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
856
|
-
var
|
|
857
|
-
const
|
|
851
|
+
Mt = new WeakMap(), st = new WeakMap(), K = new WeakMap(), _t = new WeakMap(), $t = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(ct, "NineTableSheet"), v(ct, "SCROLLBAR_SIZE", 16);
|
|
852
|
+
let wt = ct;
|
|
853
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", wt);
|
|
854
|
+
var zt, yt;
|
|
855
|
+
const de = class de extends HTMLElement {
|
|
858
856
|
constructor() {
|
|
859
857
|
super();
|
|
860
|
-
c(this,
|
|
858
|
+
c(this, zt, /* @__PURE__ */ a(() => {
|
|
861
859
|
var e;
|
|
862
860
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
863
861
|
var o;
|
|
864
862
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
865
|
-
t(this,
|
|
866
|
-
}), t(this,
|
|
863
|
+
t(this, yt).call(this, r, n);
|
|
864
|
+
}), t(this, yt).call(this, 0, !1);
|
|
867
865
|
}, "#init"));
|
|
868
|
-
c(this,
|
|
866
|
+
c(this, yt, /* @__PURE__ */ a((e, s = !1) => {
|
|
869
867
|
const n = /* @__PURE__ */ a(() => {
|
|
870
868
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
871
869
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
@@ -898,30 +896,30 @@ const ue = class ue extends HTMLElement {
|
|
|
898
896
|
}, "#switchSheet"));
|
|
899
897
|
}
|
|
900
898
|
connectedCallback() {
|
|
901
|
-
t(this,
|
|
899
|
+
t(this, zt).call(this);
|
|
902
900
|
}
|
|
903
901
|
};
|
|
904
|
-
|
|
905
|
-
let
|
|
906
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
907
|
-
var q,
|
|
908
|
-
const
|
|
902
|
+
zt = new WeakMap(), yt = new WeakMap(), a(de, "NineTableSheets");
|
|
903
|
+
let te = de;
|
|
904
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", te);
|
|
905
|
+
var q, Dt, pt, Bt;
|
|
906
|
+
const fe = class fe {
|
|
909
907
|
constructor(i) {
|
|
910
908
|
c(this, q);
|
|
911
|
-
c(this,
|
|
912
|
-
t(this,
|
|
909
|
+
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
910
|
+
t(this, Bt).call(this), new ResizeObserver((i) => {
|
|
913
911
|
for (let e of i)
|
|
914
|
-
t(this, q).getAttribute("auto-height") === "true" && t(this,
|
|
912
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, pt).call(this);
|
|
915
913
|
}).observe(t(this, q));
|
|
916
914
|
}, "#init"));
|
|
917
|
-
c(this,
|
|
915
|
+
c(this, pt, /* @__PURE__ */ a(() => {
|
|
918
916
|
var d, h;
|
|
919
917
|
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
920
918
|
if (i.length === 0) return;
|
|
921
|
-
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o =
|
|
919
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o = wt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
922
920
|
t(this, q).style.height = `${l}px`;
|
|
923
921
|
}, "#applyAutoHeight"));
|
|
924
|
-
c(this,
|
|
922
|
+
c(this, Bt, /* @__PURE__ */ a(() => {
|
|
925
923
|
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", n = e.length, r = e.map((d, h) => {
|
|
926
924
|
const u = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, b = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
927
925
|
return u + b;
|
|
@@ -1020,22 +1018,22 @@ const ge = class ge {
|
|
|
1020
1018
|
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1021
1019
|
l == null || l.forEach((d, h) => {
|
|
1022
1020
|
e[h] && setTimeout(() => {
|
|
1023
|
-
d.generate(e[h]), s && t(this,
|
|
1021
|
+
d.generate(e[h]), s && t(this, pt).call(this);
|
|
1024
1022
|
});
|
|
1025
1023
|
});
|
|
1026
1024
|
}, "#render"));
|
|
1027
|
-
g(this, q, i), t(this,
|
|
1025
|
+
g(this, q, i), t(this, Dt).call(this);
|
|
1028
1026
|
}
|
|
1029
1027
|
};
|
|
1030
|
-
q = new WeakMap(),
|
|
1031
|
-
let
|
|
1032
|
-
var
|
|
1033
|
-
const
|
|
1028
|
+
q = new WeakMap(), Dt = new WeakMap(), pt = new WeakMap(), Bt = new WeakMap(), a(fe, "LayoutManager");
|
|
1029
|
+
let ee = fe;
|
|
1030
|
+
var mt, nt;
|
|
1031
|
+
const ue = class ue {
|
|
1034
1032
|
constructor(i) {
|
|
1035
|
-
c(this,
|
|
1033
|
+
c(this, mt);
|
|
1036
1034
|
c(this, nt, -1);
|
|
1037
|
-
v(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1038
|
-
g(this,
|
|
1035
|
+
v(this, "count", /* @__PURE__ */ a(() => t(this, mt).rawRecords.length, "count"));
|
|
1036
|
+
g(this, mt, i);
|
|
1039
1037
|
}
|
|
1040
1038
|
get at() {
|
|
1041
1039
|
return t(this, nt);
|
|
@@ -1045,25 +1043,25 @@ const be = class be {
|
|
|
1045
1043
|
});
|
|
1046
1044
|
}
|
|
1047
1045
|
};
|
|
1048
|
-
|
|
1049
|
-
let
|
|
1050
|
-
var L, R, H, ot,
|
|
1046
|
+
mt = new WeakMap(), nt = new WeakMap(), a(ue, "ngRow");
|
|
1047
|
+
let ie = ue;
|
|
1048
|
+
var L, R, H, ot, Nt, V, Pt, Z, xt, Vt, Yt, rt;
|
|
1051
1049
|
const C = class C {
|
|
1052
1050
|
constructor(i, e) {
|
|
1053
1051
|
c(this, L);
|
|
1054
1052
|
c(this, R);
|
|
1055
1053
|
c(this, H, []);
|
|
1056
1054
|
c(this, ot, []);
|
|
1057
|
-
c(this,
|
|
1055
|
+
c(this, Nt, 0);
|
|
1058
1056
|
c(this, V, []);
|
|
1059
|
-
c(this,
|
|
1057
|
+
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
1060
1058
|
g(this, V, []);
|
|
1061
1059
|
const i = t(this, L).template || [];
|
|
1062
1060
|
Array.from(i).forEach((e) => {
|
|
1063
1061
|
var s;
|
|
1064
1062
|
t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1065
1063
|
}), (t(this, R).rawRecords || []).forEach((e) => {
|
|
1066
|
-
e.__ng || (e.__ng = t(this,
|
|
1064
|
+
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this, V).slice();
|
|
1067
1065
|
});
|
|
1068
1066
|
}, "#initialize"));
|
|
1069
1067
|
c(this, Z, /* @__PURE__ */ a(() => {
|
|
@@ -1087,7 +1085,7 @@ const C = class C {
|
|
|
1087
1085
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1088
1086
|
this.clear(), this.add(i, !1), t(this, Z).call(this);
|
|
1089
1087
|
}, "set"));
|
|
1090
|
-
c(this,
|
|
1088
|
+
c(this, xt, /* @__PURE__ */ a(() => ({
|
|
1091
1089
|
rowState: C.ROW_STATE.EMPTY,
|
|
1092
1090
|
deleted: !1,
|
|
1093
1091
|
filtered: !1,
|
|
@@ -1103,7 +1101,7 @@ const C = class C {
|
|
|
1103
1101
|
var i;
|
|
1104
1102
|
t(this, R).rawRecords = [], g(this, H, []), g(this, ot, []), (i = t(this, R).viewRecords) != null && i.reset && t(this, R).viewRecords.reset();
|
|
1105
1103
|
}, "clear"));
|
|
1106
|
-
c(this,
|
|
1104
|
+
c(this, Vt, /* @__PURE__ */ a((i) => {
|
|
1107
1105
|
var n;
|
|
1108
1106
|
Array.isArray(i) || (i = [i]);
|
|
1109
1107
|
const e = typeof ((n = t(this, L).fields) == null ? void 0 : n.get) == "function" ? t(this, L).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1114,13 +1112,13 @@ const C = class C {
|
|
|
1114
1112
|
}), s.push(o);
|
|
1115
1113
|
}), s;
|
|
1116
1114
|
}, "#json2Array"));
|
|
1117
|
-
c(this,
|
|
1118
|
-
e.__ng = t(this,
|
|
1115
|
+
c(this, Yt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1116
|
+
e.__ng = t(this, xt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1119
1117
|
}), i), "#defaultInsert"));
|
|
1120
1118
|
v(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1121
1119
|
i === void 0 && (i = {});
|
|
1122
|
-
const s = t(this,
|
|
1123
|
-
t(this, R).rawRecords = t(this, R).rawRecords.concat(t(this,
|
|
1120
|
+
const s = t(this, Vt).call(this, i);
|
|
1121
|
+
t(this, R).rawRecords = t(this, R).rawRecords.concat(t(this, Yt).call(this, s)), this.resetRecords();
|
|
1124
1122
|
const n = this.count() - 1;
|
|
1125
1123
|
return e || s.forEach((r, o) => {
|
|
1126
1124
|
const l = t(this, R).rawRecords[n - o];
|
|
@@ -1168,7 +1166,7 @@ const C = class C {
|
|
|
1168
1166
|
return e ? r[0] : r;
|
|
1169
1167
|
}, "#conv"));
|
|
1170
1168
|
v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1171
|
-
g(this, L, i), g(this, R, e), t(this,
|
|
1169
|
+
g(this, L, i), g(this, R, e), t(this, Pt).call(this);
|
|
1172
1170
|
}
|
|
1173
1171
|
get source() {
|
|
1174
1172
|
return t(this, rt).call(this, t(this, R).rawRecords);
|
|
@@ -1177,7 +1175,7 @@ const C = class C {
|
|
|
1177
1175
|
this.clear(), this.add(i, !1);
|
|
1178
1176
|
}
|
|
1179
1177
|
get nextId() {
|
|
1180
|
-
return ++
|
|
1178
|
+
return ++we(this, Nt)._;
|
|
1181
1179
|
}
|
|
1182
1180
|
get length() {
|
|
1183
1181
|
return t(this, H).length;
|
|
@@ -1186,7 +1184,7 @@ const C = class C {
|
|
|
1186
1184
|
return this.length;
|
|
1187
1185
|
}
|
|
1188
1186
|
};
|
|
1189
|
-
L = new WeakMap(), R = new WeakMap(), H = new WeakMap(), ot = new WeakMap(),
|
|
1187
|
+
L = new WeakMap(), R = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), V = new WeakMap(), Pt = new WeakMap(), Z = new WeakMap(), xt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1190
1188
|
v(C, "ROW_STATE", {
|
|
1191
1189
|
EMPTY: "EMPTY",
|
|
1192
1190
|
NORMAL: "NORMAL",
|
|
@@ -1194,12 +1192,12 @@ v(C, "ROW_STATE", {
|
|
|
1194
1192
|
UPDATE: "UPDATE",
|
|
1195
1193
|
DELETE: "DELETE"
|
|
1196
1194
|
});
|
|
1197
|
-
let
|
|
1195
|
+
let se = C;
|
|
1198
1196
|
var G;
|
|
1199
|
-
const
|
|
1197
|
+
const ge = class ge {
|
|
1200
1198
|
constructor(i) {
|
|
1201
1199
|
c(this, G);
|
|
1202
|
-
g(this, G, i), this.row = new
|
|
1200
|
+
g(this, G, i), this.row = new ie(this), this.data = new se(t(this, G), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1203
1201
|
var e;
|
|
1204
1202
|
(e = t(this, G).view) != null && e.redraw && t(this, G).view.redraw();
|
|
1205
1203
|
}, this.setDataSource = (e) => {
|
|
@@ -1216,10 +1214,10 @@ const ye = class ye {
|
|
|
1216
1214
|
}, this.setDataSource([]);
|
|
1217
1215
|
}
|
|
1218
1216
|
};
|
|
1219
|
-
G = new WeakMap(), a(
|
|
1220
|
-
let
|
|
1221
|
-
var lt, A,
|
|
1222
|
-
const
|
|
1217
|
+
G = new WeakMap(), a(ge, "ngDataManager");
|
|
1218
|
+
let ne = ge;
|
|
1219
|
+
var lt, A, vt, Xt;
|
|
1220
|
+
const be = class be {
|
|
1223
1221
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1224
1222
|
constructor(i) {
|
|
1225
1223
|
c(this, lt);
|
|
@@ -1227,20 +1225,20 @@ const pe = class pe {
|
|
|
1227
1225
|
v(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1228
1226
|
i.forEach((s) => {
|
|
1229
1227
|
t(this, A).some((n) => n.name === s) || t(this, A).push({ name: s, type: e });
|
|
1230
|
-
}), t(this,
|
|
1228
|
+
}), t(this, vt).call(this);
|
|
1231
1229
|
}, "add"));
|
|
1232
|
-
c(this,
|
|
1230
|
+
c(this, vt, /* @__PURE__ */ a(() => {
|
|
1233
1231
|
const i = /* @__PURE__ */ new Map();
|
|
1234
1232
|
t(this, A).forEach((e) => {
|
|
1235
1233
|
i.set(e.name, e.type);
|
|
1236
1234
|
}), g(this, A, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, A, t(this, A).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, A).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1237
1235
|
}, "#adjust"));
|
|
1238
|
-
c(this,
|
|
1239
|
-
g(this, A, []),
|
|
1236
|
+
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1237
|
+
g(this, A, []), O.log(t(this, lt).querySelectorAll("table"));
|
|
1240
1238
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1241
1239
|
if (!(!i || i.length === 0)) {
|
|
1242
1240
|
for (const e of i)
|
|
1243
|
-
|
|
1241
|
+
O.log(e), $("[data-bind]", e).each((s, n) => {
|
|
1244
1242
|
const r = n.dataset.bind, o = n.getAttribute("data-type") || "string";
|
|
1245
1243
|
r && t(this, A).push({ name: r, type: o });
|
|
1246
1244
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1264,10 +1262,10 @@ const pe = class pe {
|
|
|
1264
1262
|
});
|
|
1265
1263
|
});
|
|
1266
1264
|
});
|
|
1267
|
-
t(this,
|
|
1265
|
+
t(this, vt).call(this);
|
|
1268
1266
|
}
|
|
1269
1267
|
}, "#init"));
|
|
1270
|
-
g(this, lt, i), t(this,
|
|
1268
|
+
g(this, lt, i), t(this, Xt).call(this);
|
|
1271
1269
|
}
|
|
1272
1270
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1273
1271
|
get() {
|
|
@@ -1289,25 +1287,25 @@ const pe = class pe {
|
|
|
1289
1287
|
return t(this, A).some((e) => e.name === i);
|
|
1290
1288
|
}
|
|
1291
1289
|
};
|
|
1292
|
-
lt = new WeakMap(), A = new WeakMap(),
|
|
1293
|
-
let
|
|
1294
|
-
var J,
|
|
1295
|
-
const
|
|
1290
|
+
lt = new WeakMap(), A = new WeakMap(), vt = new WeakMap(), Xt = new WeakMap(), a(be, "ngFields");
|
|
1291
|
+
let oe = be;
|
|
1292
|
+
var J, Ut, Ft;
|
|
1293
|
+
const ye = class ye extends HTMLElement {
|
|
1296
1294
|
constructor() {
|
|
1297
1295
|
super();
|
|
1298
1296
|
//#created = false;
|
|
1299
1297
|
c(this, J);
|
|
1300
|
-
c(this,
|
|
1301
|
-
c(this,
|
|
1302
|
-
this.fields = new
|
|
1298
|
+
c(this, Ut);
|
|
1299
|
+
c(this, Ft, /* @__PURE__ */ a(() => {
|
|
1300
|
+
this.fields = new oe(this), g(this, Ut, new ee(this)), O.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1303
1301
|
}, "#init"));
|
|
1304
|
-
this.attachShadow({ mode: "open" }), g(this, J, new
|
|
1302
|
+
this.attachShadow({ mode: "open" }), g(this, J, new ne(this));
|
|
1305
1303
|
}
|
|
1306
1304
|
connectedCallback() {
|
|
1307
|
-
t(this,
|
|
1305
|
+
t(this, Ft).call(this);
|
|
1308
1306
|
}
|
|
1309
1307
|
disconnectedCallback() {
|
|
1310
|
-
|
|
1308
|
+
O.log("NineTable disconnected.");
|
|
1311
1309
|
}
|
|
1312
1310
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1313
1311
|
get data() {
|
|
@@ -1322,7 +1320,7 @@ const me = class me extends HTMLElement {
|
|
|
1322
1320
|
return t(this, J);
|
|
1323
1321
|
}
|
|
1324
1322
|
};
|
|
1325
|
-
J = new WeakMap(),
|
|
1326
|
-
let
|
|
1327
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1323
|
+
J = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), a(ye, "NineTable");
|
|
1324
|
+
let re = ye;
|
|
1325
|
+
customElements.get("nine-table") || customElements.define("nine-table", re);
|
|
1328
1326
|
//# sourceMappingURL=nine-table.js.map
|