@ninebone/table 0.0.350 β 0.0.351
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 +108 -108
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -22,29 +22,29 @@ const te = class te extends ge.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
a(te, "Trace");
|
|
24
24
|
let Pt = te;
|
|
25
|
-
const
|
|
26
|
-
var
|
|
25
|
+
const I = new Pt();
|
|
26
|
+
var _, W, y, N, B, P, mt, Y, xt;
|
|
27
27
|
const ee = class ee extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
h(this,
|
|
30
|
+
h(this, _);
|
|
31
31
|
h(this, W, !1);
|
|
32
32
|
h(this, y);
|
|
33
|
+
h(this, N);
|
|
33
34
|
h(this, B);
|
|
34
35
|
h(this, P);
|
|
35
|
-
h(this, Y);
|
|
36
36
|
h(this, mt, /* @__PURE__ */ a(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (b(this,
|
|
37
|
+
if (!t(this, _)) return;
|
|
38
|
+
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
+
e && (b(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, P).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, y) || t(this, W)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const o = t(this, y).track, r = t(this, y).thumb, n = t(this,
|
|
47
|
+
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && c > l)
|
|
49
49
|
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,9 +59,9 @@ const ee = class ee extends HTMLElement {
|
|
|
59
59
|
let p = 0;
|
|
60
60
|
g > 0 && (p = parseInt(u / g * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
p > E && (p = E), r.style.left = `${p}px`,
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, I.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
@@ -75,16 +75,16 @@ const ee = class ee extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
h(this, xt, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Y).call(this, r + o), b(this, N, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, N)), b(this, B, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Y).call(this, n + o) || clearInterval(t(this, B));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -96,14 +96,14 @@ const ee = class ee extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Y).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
102
|
o.stopPropagation(), o.preventDefault(), b(this, W, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, W)) return;
|
|
105
105
|
const c = t(this, y).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Y).call(this, l.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
108
|
b(this, W, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -112,7 +112,7 @@ const ee = class ee extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (b(this,
|
|
115
|
+
if (b(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 ee = class ee 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;
|
|
@@ -195,17 +195,17 @@ const ee = class ee extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, P) && t(this, P).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
_ = new WeakMap(), W = new WeakMap(), y = new WeakMap(), N = new WeakMap(), B = new WeakMap(), P = new WeakMap(), mt = new WeakMap(), Y = new WeakMap(), xt = new WeakMap(), a(ee, "NineTableHScrollBar");
|
|
202
202
|
let Yt = ee;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Yt);
|
|
204
|
-
var
|
|
204
|
+
var V, O, v, rt, lt, vt;
|
|
205
205
|
const ie = class ie extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
208
|
+
h(this, V);
|
|
209
209
|
h(this, O, !1);
|
|
210
210
|
h(this, v);
|
|
211
211
|
h(this, rt, 0);
|
|
@@ -214,7 +214,7 @@ const ie = class ie extends HTMLElement {
|
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
-
if (!t(this,
|
|
217
|
+
if (!t(this, V) || !t(this, v) || t(this, O)) return;
|
|
218
218
|
const e = t(this, v).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const o = t(this, v).track, r = t(this, v).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
@@ -243,7 +243,7 @@ const ie = class ie extends HTMLElement {
|
|
|
243
243
|
const o = /* @__PURE__ */ a((n) => {
|
|
244
244
|
if (!t(this, O)) return;
|
|
245
245
|
const l = t(this, v).track.getBoundingClientRect(), c = t(this, v).thumb.clientHeight, f = l.height - c, u = n.clientY - t(this, rt), g = e.clientHeight, p = e.querySelector("table");
|
|
246
|
-
|
|
246
|
+
I.log(p), I.log(p.scrollHeight);
|
|
247
247
|
const H = p.scrollHeight - g;
|
|
248
248
|
if (f > 0 && H > 0) {
|
|
249
249
|
const yt = u / f * H;
|
|
@@ -270,7 +270,7 @@ const ie = class ie extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (b(this,
|
|
273
|
+
if (b(this, V, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, V)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -335,7 +335,7 @@ const ie = class ie extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ a(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, V).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,16 +351,16 @@ const ie = class ie extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
V = new WeakMap(), O = new WeakMap(), v = new WeakMap(), rt = new WeakMap(), lt = new WeakMap(), vt = new WeakMap(), a(ie, "NineTableVScrollBar");
|
|
355
355
|
let Vt = ie;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Vt);
|
|
357
|
-
var wt,
|
|
358
|
-
const
|
|
357
|
+
var wt, G;
|
|
358
|
+
const C = class C {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
361
361
|
*/
|
|
362
362
|
static compileAll(i) {
|
|
363
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
363
|
+
return Array.isArray(i) ? i.map((e) => C.compile(e)) : [];
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -369,7 +369,7 @@ const _ = class _ {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o =
|
|
372
|
+
return t(o = C, wt).call(o, e), t(r = C, G).call(r, e, "thead"), t(n = C, G).call(n, e, "tbody"), t(l = C, G).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c, d) => {
|
|
373
373
|
const f = c.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
@@ -377,7 +377,7 @@ const _ = class _ {
|
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
wt = new WeakMap(),
|
|
380
|
+
wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PURE__ */ a((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,7 +391,7 @@ wt = new WeakMap(), J = new WeakMap(), a(_, "TableCompiler"), h(_, wt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), h(
|
|
394
|
+
}, "#ensureTableStructure")), h(C, G, /* @__PURE__ */ a((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
@@ -424,24 +424,24 @@ wt = new WeakMap(), J = new WeakMap(), a(_, "TableCompiler"), h(_, wt, /* @__PUR
|
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
|
-
let Xt =
|
|
428
|
-
var
|
|
427
|
+
let Xt = C;
|
|
428
|
+
var X, w, M, A, z, U, J, St, Et, at, ct, Rt, At, ht, Q, kt;
|
|
429
429
|
const se = class se {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
h(this,
|
|
431
|
+
h(this, X);
|
|
432
432
|
h(this, w);
|
|
433
|
-
h(this,
|
|
433
|
+
h(this, M, /* @__PURE__ */ new Map());
|
|
434
434
|
h(this, A, null);
|
|
435
435
|
h(this, z, null);
|
|
436
|
-
h(this,
|
|
437
|
-
h(this,
|
|
436
|
+
h(this, U, 0);
|
|
437
|
+
h(this, J, 40);
|
|
438
438
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
439
439
|
var e;
|
|
440
440
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
441
|
-
i && (t(this, at).call(this), t(this,
|
|
441
|
+
i && (t(this, at).call(this), t(this, Q).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
443
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
444
|
-
b(this, A, null), t(this,
|
|
444
|
+
b(this, A, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
445
445
|
const r = t(this, w).querySelector(o);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const n = r.querySelector("table");
|
|
@@ -449,15 +449,15 @@ const se = class se {
|
|
|
449
449
|
const l = n.querySelector("tbody.bindable-tbody");
|
|
450
450
|
if (!l) return;
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
|
-
t(this,
|
|
452
|
+
t(this, M).set(o, d);
|
|
453
453
|
});
|
|
454
454
|
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");
|
|
455
455
|
if (i) {
|
|
456
|
-
t(this, Et).call(this, i), t(this, ht).call(this), t(this, at).call(this), t(this,
|
|
456
|
+
t(this, Et).call(this, i), t(this, ht).call(this), t(this, at).call(this), t(this, Q).call(this, i.scrollTop);
|
|
457
457
|
let o = i.scrollTop;
|
|
458
458
|
const r = /* @__PURE__ */ a((n) => {
|
|
459
459
|
var l;
|
|
460
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
460
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, Q).call(this, n), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
461
|
}, "syncScroll");
|
|
462
462
|
i.addEventListener("scroll", () => {
|
|
463
463
|
const n = i.scrollTop;
|
|
@@ -466,13 +466,13 @@ const se = class se {
|
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
468
|
h(this, St, /* @__PURE__ */ a((i, e) => {
|
|
469
|
-
const s = t(this,
|
|
469
|
+
const s = t(this, M).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
472
472
|
if (!o) return;
|
|
473
473
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
474
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
475
|
-
for (let l = 0; l < t(this,
|
|
475
|
+
for (let l = 0; l < t(this, J); l++)
|
|
476
476
|
s.forEach((c) => {
|
|
477
477
|
n.appendChild(c.cloneNode(!0));
|
|
478
478
|
});
|
|
@@ -481,7 +481,7 @@ const se = class se {
|
|
|
481
481
|
h(this, Et, /* @__PURE__ */ a((i) => {
|
|
482
482
|
if (t(this, A) !== null && t(this, A) > 0)
|
|
483
483
|
return t(this, A);
|
|
484
|
-
const e = t(this,
|
|
484
|
+
const e = t(this, M).get(".ng-container-body");
|
|
485
485
|
if (!e || e.length === 0) return 24;
|
|
486
486
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
487
487
|
if (!s) return 24;
|
|
@@ -500,18 +500,18 @@ const se = class se {
|
|
|
500
500
|
}, "#measureAndCacheHeight"));
|
|
501
501
|
h(this, at, /* @__PURE__ */ a(() => {
|
|
502
502
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
503
|
-
const e = t(this,
|
|
503
|
+
const e = t(this, X).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
|
|
504
504
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
505
|
const l = t(this, w).querySelector(n), c = l == null ? void 0 : l.querySelector("table");
|
|
506
506
|
c && (c.style.height = `${r}px`);
|
|
507
507
|
});
|
|
508
508
|
}, "#updateVirtualScrollHeight"));
|
|
509
509
|
h(this, ct, /* @__PURE__ */ a(() => {
|
|
510
|
-
if (t(this,
|
|
511
|
-
const i = Math.ceil(t(this,
|
|
512
|
-
b(this,
|
|
510
|
+
if (t(this, U) > 0 && t(this, A) > 0) {
|
|
511
|
+
const i = Math.ceil(t(this, U) / t(this, A));
|
|
512
|
+
b(this, J, i + 20);
|
|
513
513
|
} else
|
|
514
|
-
b(this,
|
|
514
|
+
b(this, J, 40);
|
|
515
515
|
}, "#updateRowCount"));
|
|
516
516
|
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
517
517
|
var c, d, f;
|
|
@@ -538,7 +538,7 @@ const se = class se {
|
|
|
538
538
|
const n = s.querySelector("thead");
|
|
539
539
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
540
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this,
|
|
541
|
+
t(this, U) !== l && (b(this, U, l), t(this, ct).call(this), t(this, A) !== null && t(this, ht).call(this));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
})), t(this, z).observe(t(this, w)));
|
|
@@ -549,19 +549,19 @@ const se = class se {
|
|
|
549
549
|
e && e.querySelector("tbody.bindable-tbody") && t(this, St).call(this, e, i);
|
|
550
550
|
}), t(this, Rt).call(this);
|
|
551
551
|
}, "#renderAllContainers"));
|
|
552
|
-
h(this,
|
|
552
|
+
h(this, Q, /* @__PURE__ */ a((i) => {
|
|
553
553
|
var r;
|
|
554
554
|
const e = t(this, A);
|
|
555
555
|
if (!e || e <= 0) return;
|
|
556
|
-
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this,
|
|
556
|
+
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, M).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
558
|
const l = t(this, w).querySelector(n);
|
|
559
559
|
if (!l) return;
|
|
560
560
|
const c = l.querySelector("tbody.bindable-tbody");
|
|
561
561
|
if (!c) return;
|
|
562
562
|
Array.from(c.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
|
-
const g = s + Math.floor(u / o), p = t(this,
|
|
564
|
-
|
|
563
|
+
const g = s + Math.floor(u / o), p = t(this, X).data.get(g);
|
|
564
|
+
I.log("--", t(this, X).data.get(0)), f.style.display = "", t(this, kt).call(this, f, p, g);
|
|
565
565
|
});
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
@@ -574,31 +574,31 @@ const se = class se {
|
|
|
574
574
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
575
575
|
t(this, z) && (t(this, z).disconnect(), b(this, z, null));
|
|
576
576
|
}, "destroy"));
|
|
577
|
-
b(this,
|
|
577
|
+
b(this, X, i.getRootNode().host), b(this, w, i), t(this, At).call(this);
|
|
578
578
|
}
|
|
579
579
|
getRowHeight() {
|
|
580
580
|
return t(this, A);
|
|
581
581
|
}
|
|
582
582
|
templateLength(i = ".ng-container-body") {
|
|
583
583
|
var e;
|
|
584
|
-
return ((e = t(this,
|
|
584
|
+
return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
|
|
587
|
+
X = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), at = new WeakMap(), ct = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ht = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
|
|
588
588
|
let Ut = se;
|
|
589
|
-
var qt,
|
|
589
|
+
var qt, tt, j, Tt, Lt, Ht, Ct, _t;
|
|
590
590
|
const ot = class ot extends HTMLElement {
|
|
591
591
|
constructor() {
|
|
592
592
|
super();
|
|
593
593
|
h(this, qt);
|
|
594
|
-
h(this,
|
|
595
|
-
h(this,
|
|
594
|
+
h(this, tt, null);
|
|
595
|
+
h(this, j);
|
|
596
596
|
/**
|
|
597
597
|
* data.set, add, delete
|
|
598
598
|
* filter, sorting : κ³ λ €λμ
|
|
599
599
|
*/
|
|
600
600
|
x(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, j).refresh();
|
|
602
602
|
}, "invalidate"));
|
|
603
603
|
h(this, Tt, /* @__PURE__ */ a(() => {
|
|
604
604
|
[
|
|
@@ -608,7 +608,7 @@ const ot = class ot extends HTMLElement {
|
|
|
608
608
|
].forEach(({ selector: s, type: o }) => {
|
|
609
609
|
const r = this.querySelector(s);
|
|
610
610
|
if (!r) return;
|
|
611
|
-
const n = t(this, Ht).call(this, t(this,
|
|
611
|
+
const n = t(this, Ht).call(this, t(this, tt), o);
|
|
612
612
|
r.innerHTML = "", r.appendChild(n);
|
|
613
613
|
});
|
|
614
614
|
}, "#renderSplitContainers"));
|
|
@@ -624,13 +624,13 @@ const ot = class ot extends HTMLElement {
|
|
|
624
624
|
});
|
|
625
625
|
}, "#updateContainerWidths"));
|
|
626
626
|
x(this, "generate", /* @__PURE__ */ a((e) => {
|
|
627
|
-
e && (b(this,
|
|
627
|
+
e && (b(this, tt, Xt.compile(e)), t(this, tt).style.display = "table", t(this, Tt).call(this), t(this, Lt).call(this), requestAnimationFrame(() => {
|
|
628
628
|
var o;
|
|
629
629
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
630
630
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
631
631
|
r.style.top = `${s}px`;
|
|
632
632
|
});
|
|
633
|
-
}), t(this,
|
|
633
|
+
}), t(this, j).initialize(), setTimeout(() => {
|
|
634
634
|
var s;
|
|
635
635
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
636
636
|
}, 0));
|
|
@@ -652,7 +652,7 @@ const ot = class ot extends HTMLElement {
|
|
|
652
652
|
n.remove();
|
|
653
653
|
}), o;
|
|
654
654
|
}, "#createSplitTable"));
|
|
655
|
-
x(this, "getRowHeight", /* @__PURE__ */ a(() => t(this,
|
|
655
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, j).getRowHeight(), "getRowHeight"));
|
|
656
656
|
x(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
657
657
|
const s = this.querySelector(".ng-container-body");
|
|
658
658
|
s && (s.scrollLeft = e);
|
|
@@ -811,16 +811,16 @@ const ot = class ot extends HTMLElement {
|
|
|
811
811
|
</div>
|
|
812
812
|
`;
|
|
813
813
|
}, "#render"));
|
|
814
|
-
b(this,
|
|
814
|
+
b(this, j, new Ut(this)), b(this, qt, this.getRootNode().host);
|
|
815
815
|
}
|
|
816
816
|
connectedCallback() {
|
|
817
817
|
t(this, Ct).call(this);
|
|
818
818
|
}
|
|
819
819
|
disconnectedCallback() {
|
|
820
|
-
this.innerHTML = "",
|
|
820
|
+
this.innerHTML = "", I.log("NineTableSheet destroyed.");
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
qt = new WeakMap(),
|
|
823
|
+
qt = new WeakMap(), tt = new WeakMap(), j = new WeakMap(), Tt = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), a(ot, "NineTableSheet"), x(ot, "SCROLLBAR_SIZE", 16);
|
|
824
824
|
let pt = ot;
|
|
825
825
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pt);
|
|
826
826
|
var Mt, dt;
|
|
@@ -874,11 +874,11 @@ const ne = class ne extends HTMLElement {
|
|
|
874
874
|
Mt = new WeakMap(), dt = new WeakMap(), a(ne, "NineTableSheets");
|
|
875
875
|
let jt = ne;
|
|
876
876
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", jt);
|
|
877
|
-
var
|
|
877
|
+
var et, R, ft, It;
|
|
878
878
|
const oe = class oe {
|
|
879
879
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
880
880
|
constructor(i) {
|
|
881
|
-
h(this,
|
|
881
|
+
h(this, et);
|
|
882
882
|
h(this, R, []);
|
|
883
883
|
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
884
884
|
i.forEach((s) => {
|
|
@@ -892,11 +892,11 @@ const oe = class oe {
|
|
|
892
892
|
}), b(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
893
893
|
}, "#adjust"));
|
|
894
894
|
h(this, It, /* @__PURE__ */ a(() => {
|
|
895
|
-
b(this, R, []),
|
|
896
|
-
const i = Array.from(t(this,
|
|
895
|
+
b(this, R, []), I.log(t(this, et).querySelectorAll("table"));
|
|
896
|
+
const i = Array.from(t(this, et).querySelectorAll("table"));
|
|
897
897
|
if (!(!i || i.length === 0)) {
|
|
898
898
|
for (const e of i)
|
|
899
|
-
|
|
899
|
+
I.log(e), $("[data-bind]", e).each((s, o) => {
|
|
900
900
|
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
901
901
|
r && t(this, R).push({ name: r, type: n });
|
|
902
902
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -923,7 +923,7 @@ const oe = class oe {
|
|
|
923
923
|
t(this, ft).call(this);
|
|
924
924
|
}
|
|
925
925
|
}, "#init"));
|
|
926
|
-
b(this,
|
|
926
|
+
b(this, et, i), t(this, It).call(this);
|
|
927
927
|
}
|
|
928
928
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
929
929
|
get() {
|
|
@@ -945,7 +945,7 @@ const oe = class oe {
|
|
|
945
945
|
return t(this, R).some((e) => e.name === i);
|
|
946
946
|
}
|
|
947
947
|
};
|
|
948
|
-
|
|
948
|
+
et = new WeakMap(), R = new WeakMap(), ft = new WeakMap(), It = new WeakMap(), a(oe, "ngFields");
|
|
949
949
|
let Ft = oe;
|
|
950
950
|
var k, $t, ut, Wt;
|
|
951
951
|
const re = class re {
|
|
@@ -1098,7 +1098,7 @@ const le = class le {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
bt = new WeakMap(), it = new WeakMap(), a(le, "ngRow");
|
|
1100
1100
|
let Zt = le;
|
|
1101
|
-
var q, S, T, st, Ot,
|
|
1101
|
+
var q, S, T, st, Ot, D, zt, F, gt, Dt, Nt, nt;
|
|
1102
1102
|
const L = class L {
|
|
1103
1103
|
constructor(i, e) {
|
|
1104
1104
|
h(this, q);
|
|
@@ -1106,18 +1106,18 @@ const L = class L {
|
|
|
1106
1106
|
h(this, T, []);
|
|
1107
1107
|
h(this, st, []);
|
|
1108
1108
|
h(this, Ot, 0);
|
|
1109
|
-
h(this,
|
|
1109
|
+
h(this, D, []);
|
|
1110
1110
|
h(this, zt, /* @__PURE__ */ a(() => {
|
|
1111
|
-
b(this,
|
|
1111
|
+
b(this, D, []);
|
|
1112
1112
|
const i = t(this, q).template || [];
|
|
1113
1113
|
Array.from(i).forEach((e) => {
|
|
1114
1114
|
var s;
|
|
1115
|
-
t(this,
|
|
1115
|
+
t(this, D).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1116
1116
|
}), (t(this, S).rawRecords || []).forEach((e) => {
|
|
1117
|
-
e.__ng || (e.__ng = t(this, gt).call(this)), e.__ng.height = t(this,
|
|
1117
|
+
e.__ng || (e.__ng = t(this, gt).call(this)), e.__ng.height = t(this, D).slice();
|
|
1118
1118
|
});
|
|
1119
1119
|
}, "#initialize"));
|
|
1120
|
-
h(this,
|
|
1120
|
+
h(this, F, /* @__PURE__ */ a(() => {
|
|
1121
1121
|
t(this, q).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1122
1122
|
i.invalidate();
|
|
1123
1123
|
});
|
|
@@ -1136,19 +1136,19 @@ const L = class L {
|
|
|
1136
1136
|
return t(this, nt).call(this, s[i]);
|
|
1137
1137
|
}, "get"));
|
|
1138
1138
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
1139
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1139
|
+
this.clear(), this.add(i, !1), t(this, F).call(this);
|
|
1140
1140
|
}, "set"));
|
|
1141
1141
|
h(this, gt, /* @__PURE__ */ a(() => ({
|
|
1142
1142
|
rowState: L.ROW_STATE.EMPTY,
|
|
1143
1143
|
deleted: !1,
|
|
1144
1144
|
filtered: !1,
|
|
1145
|
-
height: t(this,
|
|
1145
|
+
height: t(this, D).slice(),
|
|
1146
1146
|
o: {},
|
|
1147
1147
|
c: {},
|
|
1148
|
-
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1148
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, D).slice(), -1, {}, {}]
|
|
1149
1149
|
}), "#getDefaultMeta"));
|
|
1150
1150
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
1151
|
-
b(this, T, []), b(this, st, []), t(this,
|
|
1151
|
+
b(this, T, []), b(this, st, []), t(this, F).call(this);
|
|
1152
1152
|
}, "reset"));
|
|
1153
1153
|
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
1154
1154
|
var i;
|
|
@@ -1176,7 +1176,7 @@ const L = class L {
|
|
|
1176
1176
|
return e || s.forEach((r, n) => {
|
|
1177
1177
|
const l = t(this, S).rawRecords[o - n];
|
|
1178
1178
|
l && (l.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1179
|
-
}), t(this,
|
|
1179
|
+
}), t(this, F).call(this), o;
|
|
1180
1180
|
}, "add"));
|
|
1181
1181
|
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1182
1182
|
let e = [];
|
|
@@ -1187,7 +1187,7 @@ const L = class L {
|
|
|
1187
1187
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
}), this.resetRecords(), t(this,
|
|
1190
|
+
}), this.resetRecords(), t(this, F).call(this);
|
|
1191
1191
|
}, "delete"));
|
|
1192
1192
|
x(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1193
1193
|
var c;
|
|
@@ -1237,7 +1237,7 @@ const L = class L {
|
|
|
1237
1237
|
return this.length;
|
|
1238
1238
|
}
|
|
1239
1239
|
};
|
|
1240
|
-
q = new WeakMap(), S = new WeakMap(), T = new WeakMap(), st = new WeakMap(), Ot = new WeakMap(),
|
|
1240
|
+
q = new WeakMap(), S = new WeakMap(), T = new WeakMap(), st = new WeakMap(), Ot = new WeakMap(), D = new WeakMap(), zt = new WeakMap(), F = new WeakMap(), gt = new WeakMap(), Dt = new WeakMap(), Nt = new WeakMap(), nt = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1241
1241
|
x(L, "ROW_STATE", {
|
|
1242
1242
|
EMPTY: "EMPTY",
|
|
1243
1243
|
NORMAL: "NORMAL",
|
|
@@ -1246,13 +1246,13 @@ x(L, "ROW_STATE", {
|
|
|
1246
1246
|
DELETE: "DELETE"
|
|
1247
1247
|
});
|
|
1248
1248
|
let Gt = L;
|
|
1249
|
-
var
|
|
1249
|
+
var K;
|
|
1250
1250
|
const ae = class ae {
|
|
1251
1251
|
constructor(i) {
|
|
1252
|
-
h(this,
|
|
1253
|
-
b(this,
|
|
1252
|
+
h(this, K);
|
|
1253
|
+
b(this, K, i), this.row = new Zt(this), this.data = new Gt(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1254
1254
|
var e;
|
|
1255
|
-
(e = t(this,
|
|
1255
|
+
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1256
1256
|
}, this.setDataSource = (e) => {
|
|
1257
1257
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1258
1258
|
}, this.getRowState = (e) => {
|
|
@@ -1267,37 +1267,37 @@ const ae = class ae {
|
|
|
1267
1267
|
}, this.setDataSource([]);
|
|
1268
1268
|
}
|
|
1269
1269
|
};
|
|
1270
|
-
|
|
1270
|
+
K = new WeakMap(), a(ae, "ngDataManager");
|
|
1271
1271
|
let Jt = ae;
|
|
1272
|
-
var
|
|
1272
|
+
var Z, Bt;
|
|
1273
1273
|
const ce = class ce extends HTMLElement {
|
|
1274
1274
|
constructor() {
|
|
1275
1275
|
super();
|
|
1276
1276
|
//#created = false;
|
|
1277
|
-
h(this,
|
|
1277
|
+
h(this, Z);
|
|
1278
1278
|
h(this, Bt);
|
|
1279
|
-
this.attachShadow({ mode: "open" }),
|
|
1279
|
+
this.fields = new Ft(this), this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this));
|
|
1280
1280
|
}
|
|
1281
1281
|
connectedCallback() {
|
|
1282
|
-
b(this, Bt, new Kt(this)),
|
|
1282
|
+
b(this, Bt, new Kt(this)), I.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1283
1283
|
}
|
|
1284
1284
|
disconnectedCallback() {
|
|
1285
|
-
|
|
1285
|
+
I.log("NineTable disconnected.");
|
|
1286
1286
|
}
|
|
1287
1287
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1288
1288
|
get data() {
|
|
1289
|
-
return t(this,
|
|
1289
|
+
return t(this, Z).data;
|
|
1290
1290
|
}
|
|
1291
1291
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1292
1292
|
get row() {
|
|
1293
|
-
return t(this,
|
|
1293
|
+
return t(this, Z).row;
|
|
1294
1294
|
}
|
|
1295
1295
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1296
1296
|
get dataManager() {
|
|
1297
|
-
return t(this,
|
|
1297
|
+
return t(this, Z);
|
|
1298
1298
|
}
|
|
1299
1299
|
};
|
|
1300
|
-
|
|
1300
|
+
Z = new WeakMap(), Bt = new WeakMap(), a(ce, "NineTable");
|
|
1301
1301
|
let Qt = ce;
|
|
1302
1302
|
customElements.get("nine-table") || customElements.define("nine-table", Qt);
|
|
1303
1303
|
//# sourceMappingURL=nine-table.js.map
|