@ninebone/table 0.0.752 β 0.0.754
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 +206 -207
- 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
|
@@ -2,10 +2,10 @@ var fs = Object.defineProperty;
|
|
|
2
2
|
var us = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var ys = (q, s, e) => s in q ? fs(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
6
|
var h = (q, s) => fs(q, "name", { value: s, configurable: !0 });
|
|
7
|
-
var E = (q, s, e) =>
|
|
8
|
-
var t = (q, s, e) => (
|
|
7
|
+
var E = (q, s, e) => ys(q, typeof s != "symbol" ? s + "" : s, e), ve = (q, s, e) => s.has(q) || us("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (ve(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? us("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), p = (q, s, e, n) => (ve(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), Q = (q, s, e) => (ve(q, s, "access private method"), e);
|
|
9
9
|
var gs = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
p(q, s, r, e);
|
|
@@ -14,31 +14,31 @@ var gs = (q, s, e, n) => ({
|
|
|
14
14
|
return t(q, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const Xe = class Xe extends
|
|
17
|
+
import { trace as ms } from "@ninebone/util";
|
|
18
|
+
const Xe = class Xe extends ms.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
h(Xe, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var B, K, A,
|
|
24
|
+
let we = Xe;
|
|
25
|
+
const S = new we();
|
|
26
|
+
var B, K, A, tt, et, st, Vt, nt, Ut;
|
|
27
27
|
const Ke = class Ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
31
|
d(this, K, !1);
|
|
32
32
|
d(this, A);
|
|
33
|
-
d(this, Q);
|
|
34
33
|
d(this, tt);
|
|
35
34
|
d(this, et);
|
|
35
|
+
d(this, st);
|
|
36
36
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (p(this,
|
|
39
|
+
e && (p(this, st, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, st).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, B) || !t(this, A) || t(this, K)) return;
|
|
@@ -61,7 +61,7 @@ const Ke = class Ke extends HTMLElement {
|
|
|
61
61
|
const y = l - f;
|
|
62
62
|
g > y && (g = y), o.style.left = `${g}px`, t(this, A).left.disabled = g === 0, t(this, A).right.disabled = g >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, A)) return !1;
|
|
66
66
|
const n = t(this, A).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
@@ -75,16 +75,16 @@ const Ke = class Ke extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
79
|
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, nt).call(this, o + r), p(this, tt, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, tt)), p(this, et, setInterval(() => {
|
|
82
82
|
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, nt).call(this, i + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
90
|
t(this, A).left.addEventListener(r, n), t(this, A).right.addEventListener(r, n), t(this, A).track.addEventListener(r, n);
|
|
@@ -96,14 +96,14 @@ const Ke = class Ke extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const o = t(this, A).track.getBoundingClientRect(), i = t(this, A).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, nt).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, K, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, K)) return;
|
|
105
105
|
const c = t(this, A).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
108
|
p(this, K, !1), n(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
@@ -195,25 +195,25 @@ const Ke = class Ke extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, st) && t(this, st).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), K = new WeakMap(), A = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
201
|
+
B = new WeakMap(), K = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), nt = new WeakMap(), Ut = new WeakMap(), h(Ke, "NineTableHScrollBar");
|
|
202
|
+
let Se = Ke;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Se);
|
|
204
|
+
var rt, ot, bt, C, Tt, Ct, Xt;
|
|
205
205
|
const Ge = class Ge extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this, nt);
|
|
209
208
|
d(this, rt);
|
|
209
|
+
d(this, ot);
|
|
210
210
|
d(this, bt, !1);
|
|
211
211
|
d(this, C);
|
|
212
212
|
d(this, Tt, 0);
|
|
213
213
|
d(this, Ct, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, C).container, n = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this,
|
|
215
|
+
if (S.log("vscrollbar.refresh"), !t(this, rt) || !t(this, C)) return;
|
|
216
|
+
const e = t(this, C).container, n = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = i * a;
|
|
217
217
|
if (c <= o || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -224,16 +224,16 @@ const Ge = class Ge extends HTMLElement {
|
|
|
224
224
|
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
226
|
const u = e.scrollTop, b = Math.max(c - o, 1);
|
|
227
|
-
|
|
227
|
+
S.log(e, u, b);
|
|
228
228
|
let g = 0;
|
|
229
229
|
b > 0 && (g = u / b * (l - f));
|
|
230
230
|
const y = l - f;
|
|
231
231
|
g < 0 && (g = 0), g > y && (g = y), r.style.top = `${g}px`, t(this, C).top.disabled = u <= 0, t(this, C).bottom.disabled = u >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
234
|
-
|
|
234
|
+
S.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, C).container, n = /* @__PURE__ */ h(() => {
|
|
236
|
-
const o = (t(this,
|
|
236
|
+
const o = (t(this, rt).data.get() || []).length, i = t(this, ot).getRowHeight();
|
|
237
237
|
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, C).thumb.addEventListener("mousedown", (r) => {
|
|
@@ -243,8 +243,8 @@ const Ge = class Ge extends HTMLElement {
|
|
|
243
243
|
if (!t(this, bt)) return;
|
|
244
244
|
const c = t(this, C).track.getBoundingClientRect(), l = t(this, C).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, Tt), g = e.clientHeight, y = n(), v = Math.max(y - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const
|
|
247
|
-
let m = t(this, Ct) +
|
|
246
|
+
const w = b / u * v;
|
|
247
|
+
let m = t(this, Ct) + w;
|
|
248
248
|
const I = Math.max(0, y - g);
|
|
249
249
|
m < 0 && (m = 0), m > I && (m = I), e.scrollTop = m;
|
|
250
250
|
}
|
|
@@ -269,7 +269,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
p(this,
|
|
272
|
+
p(this, rt, this.getRootNode().host), p(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,7 +334,7 @@ const Ge = class Ge extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const n = t(this,
|
|
337
|
+
const n = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
@@ -350,32 +350,32 @@ const Ge = class Ge extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var j, R,
|
|
353
|
+
rt = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), C = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Xt = new WeakMap(), h(Ge, "NineTableVScrollBar");
|
|
354
|
+
let Re = Ge;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Re);
|
|
356
|
+
var j, R, it, P, D, G, at, kt, ze, We, Kt, Gt, Lt, It, Ht, Zt, Jt, Mt, Be, pt, $t, Qt;
|
|
357
357
|
const Ze = class Ze {
|
|
358
358
|
constructor(s) {
|
|
359
359
|
d(this, j);
|
|
360
360
|
d(this, R);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, it);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, D, null);
|
|
364
364
|
d(this, G, null);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, at, 0);
|
|
366
366
|
d(this, kt, 40);
|
|
367
|
-
d(this, Oe, !1);
|
|
368
367
|
d(this, ze, !1);
|
|
368
|
+
d(this, We, !1);
|
|
369
369
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
370
370
|
d(this, Kt, 3);
|
|
371
371
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
373
|
+
S.log("rowManager.refresh");
|
|
374
374
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
375
|
s && (t(this, Lt).call(this), t(this, It).call(this), t(this, pt).call(this, s.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
|
|
378
|
+
S.log("rowManager.initialize"), p(this, it, {
|
|
379
379
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), p(this, D, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -401,13 +401,13 @@ const Ze = class Ze {
|
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[s, e, n].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", (l) => {
|
|
404
|
-
|
|
404
|
+
S.log(l), S.log("rowManager.scroll event"), a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
409
|
d(this, Gt, /* @__PURE__ */ h((s, e) => {
|
|
410
|
-
|
|
410
|
+
S.log("rowManager.#renderRows");
|
|
411
411
|
const n = t(this, P).get(e);
|
|
412
412
|
if (!n || n.length === 0) return;
|
|
413
413
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -418,17 +418,17 @@ const Ze = class Ze {
|
|
|
418
418
|
n.forEach((c) => {
|
|
419
419
|
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this,
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, D) !== null && t(this, D) > 0)
|
|
425
425
|
return t(this, D);
|
|
426
426
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
-
|
|
427
|
+
S.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, P).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
430
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
431
|
-
if (
|
|
431
|
+
if (S.log(n), !n) throw new Error("invalid dom");
|
|
432
432
|
n.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
433
|
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
@@ -448,9 +448,9 @@ const Ze = class Ze {
|
|
|
448
448
|
}), u.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, D, f), t(this, Ht).call(this), t(this, D));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, It, /* @__PURE__ */ h(() => {
|
|
451
|
-
|
|
451
|
+
S.log("rowManager.#updateVirtualScrollHeight");
|
|
452
452
|
const e = (t(this, j).data.get() || []).length, n = t(this, D), r = e * n;
|
|
453
|
-
|
|
453
|
+
S.log("π [VirtualHeight]", { totalCount: e, rowHeight: n, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
454
|
const i = t(this, R).querySelector(o);
|
|
455
455
|
if (!i) return;
|
|
456
456
|
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
@@ -458,8 +458,8 @@ const Ze = class Ze {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const s = Math.ceil(t(this,
|
|
461
|
+
if (t(this, at) > 0 && t(this, D) > 0) {
|
|
462
|
+
const s = Math.ceil(t(this, at) / t(this, D));
|
|
463
463
|
p(this, kt, s + t(this, Kt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
@@ -467,8 +467,8 @@ const Ze = class Ze {
|
|
|
467
467
|
var a, c, l, f, u, b;
|
|
468
468
|
const s = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), n = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), v = n ? Array.from(n.querySelectorAll("tbody tr")) : [],
|
|
471
|
-
for (let m = 0; m <
|
|
470
|
+
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), v = n ? Array.from(n.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, y.length, v.length);
|
|
471
|
+
for (let m = 0; m < w; m++) {
|
|
472
472
|
const I = [
|
|
473
473
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -479,8 +479,8 @@ const Ze = class Ze {
|
|
|
479
479
|
}
|
|
480
480
|
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (o) {
|
|
482
|
-
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")), v = i ? Array.from(i.querySelectorAll("tfoot tr")) : [],
|
|
483
|
-
for (let m = 0; m <
|
|
482
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")), v = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, y.length, v.length);
|
|
483
|
+
for (let m = 0; m < w; m++) {
|
|
484
484
|
const I = [
|
|
485
485
|
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
486
|
((u = y[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
@@ -501,18 +501,18 @@ const Ze = class Ze {
|
|
|
501
501
|
const i = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
502
502
|
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
503
|
const c = Math.max(r - o, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, at) !== c && (p(this, at, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, Mt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
})), t(this, G).observe(t(this, R)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
510
|
-
|
|
510
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
511
511
|
const e = t(this, R).querySelector(s);
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Gt).call(this, e, s);
|
|
513
513
|
}), t(this, Qt).call(this), t(this, Zt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, Be, /* @__PURE__ */ h((s) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
518
|
const n = t(this, R).querySelector(e);
|
|
@@ -538,14 +538,14 @@ const Ze = class Ze {
|
|
|
538
538
|
const n = t(this, j).data.length;
|
|
539
539
|
if (n === 0) return;
|
|
540
540
|
const r = ((u = t(this, P).get(".ng-container-body")) == null ? void 0 : u.length) || 1, o = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
-
|
|
541
|
+
S.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
542
|
const i = Math.max(0, n - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(s / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
544
|
+
S.log(`π [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && S.log(`π [Scroll Inspect] scrollTop: ${s}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, it).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
547
547
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
-
}), f !== a && (
|
|
548
|
+
}), f !== a && (S.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
549
549
|
const y = t(this, R).querySelector(g);
|
|
550
550
|
if (!y) return;
|
|
551
551
|
const v = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
@@ -584,7 +584,7 @@ const Ze = class Ze {
|
|
|
584
584
|
}, "#bindRowData"));
|
|
585
585
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
|
-
|
|
587
|
+
S.log("rowManager.#syncHeaderHeights");
|
|
588
588
|
const s = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), n = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
590
|
const r = s ? Array.from(s.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = n ? Array.from(n.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
|
|
@@ -610,8 +610,8 @@ const Ze = class Ze {
|
|
|
610
610
|
return ((e = t(this, P).get(s)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
j = new WeakMap(), R = new WeakMap(),
|
|
614
|
-
let
|
|
613
|
+
j = new WeakMap(), R = new WeakMap(), it = new WeakMap(), P = new WeakMap(), D = new WeakMap(), G = new WeakMap(), at = new WeakMap(), kt = new WeakMap(), ze = new WeakMap(), We = new WeakMap(), Kt = new WeakMap(), Gt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Ht = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), Mt = new WeakMap(), Be = new WeakMap(), pt = new WeakMap(), $t = new WeakMap(), Qt = new WeakMap(), h(Ze, "RowManager");
|
|
614
|
+
let Ae = Ze;
|
|
615
615
|
const te = class te {
|
|
616
616
|
/**
|
|
617
617
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -630,8 +630,8 @@ const te = class te {
|
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let u = `cell-${f}`;
|
|
632
632
|
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
633
|
-
let
|
|
634
|
-
b &&
|
|
633
|
+
let w = [];
|
|
634
|
+
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), y && w.push(`maxbyte="${y}"`), v && w.push(`type="${v}"`), l.innerHTML = `<${u} ${w.join(" ")}></${u}>`;
|
|
635
635
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
636
636
|
l.setAttribute("tabindex", "0");
|
|
637
637
|
});
|
|
@@ -659,24 +659,24 @@ const te = class te {
|
|
|
659
659
|
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
660
660
|
l.forEach((y) => {
|
|
661
661
|
const v = y.sectionRowIndex;
|
|
662
|
-
let
|
|
662
|
+
let w = 0;
|
|
663
663
|
Array.from(y.querySelectorAll("th,td")).forEach((m) => {
|
|
664
664
|
for (let H = 0; H < g[v].length; H++)
|
|
665
665
|
if (g[v][H] === null) {
|
|
666
|
-
|
|
666
|
+
w = H;
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
const I = m.rowSpan || 1, T = m.colSpan || 1;
|
|
670
670
|
for (let H = 0; H < I; H++)
|
|
671
671
|
for (let F = 0; F < T; F++)
|
|
672
|
-
v + H < u &&
|
|
672
|
+
v + H < u && w + F < b && (g[v + H][w + F] = H === 0 && F === 0 ? "1" : "0");
|
|
673
673
|
});
|
|
674
674
|
}), l.forEach((y) => {
|
|
675
675
|
const v = y.sectionRowIndex;
|
|
676
|
-
Array.from(y.querySelectorAll("th,td")).forEach((
|
|
676
|
+
Array.from(y.querySelectorAll("th,td")).forEach((w) => {
|
|
677
677
|
for (let m = 0; m < g[v].length; m++)
|
|
678
678
|
if (g[v][m] === "1") {
|
|
679
|
-
|
|
679
|
+
w.dataset.col = m, g[v][m] = "0";
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
});
|
|
@@ -692,7 +692,7 @@ const te = class te {
|
|
|
692
692
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
693
693
|
};
|
|
694
694
|
h(te, "TableCompiler");
|
|
695
|
-
let
|
|
695
|
+
let Ee = te;
|
|
696
696
|
var _, Y, U, At, bs;
|
|
697
697
|
const Je = class Je {
|
|
698
698
|
constructor(s) {
|
|
@@ -701,7 +701,7 @@ const Je = class Je {
|
|
|
701
701
|
d(this, Y, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
702
702
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
703
703
|
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, Y);
|
|
704
|
-
|
|
704
|
+
S.log("π¨ [CellSelection.render] Rendering range ->", t(this, Y));
|
|
705
705
|
const o = t(this, _).querySelectorAll(
|
|
706
706
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
707
707
|
);
|
|
@@ -710,32 +710,32 @@ const Je = class Je {
|
|
|
710
710
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
711
711
|
});
|
|
712
712
|
}), s < 0 || e < 0) {
|
|
713
|
-
|
|
713
|
+
S.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
716
|
let i = 0;
|
|
717
717
|
o.forEach((a) => {
|
|
718
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
|
-
const { matrixRow: l } =
|
|
719
|
+
const { matrixRow: l } = Q(this, U, At).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
721
721
|
const u = parseInt(f.dataset.col, 10);
|
|
722
722
|
if (isNaN(u)) return;
|
|
723
723
|
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, v = u + g - 1;
|
|
724
|
-
y >= s && l <= n && v >= e && u <= r && (i++, f.classList.add("selected"),
|
|
724
|
+
y >= s && l <= n && v >= e && u <= r && (i++, f.classList.add("selected"), S.log(f, s, e, n, r), l <= s && f.classList.add("selected-top"), y >= n && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), v >= r && f.classList.add("selected-right"));
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
|
-
}),
|
|
727
|
+
}), S.log(`β¨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
728
728
|
}, "render"));
|
|
729
|
-
p(this, _, s),
|
|
729
|
+
p(this, _, s), Q(this, U, bs).call(this), t(this, _).querySelectorAll(
|
|
730
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
731
731
|
).forEach((n) => {
|
|
732
732
|
n.addEventListener("scroll", () => {
|
|
733
733
|
t(this, Y).startRow >= 0 && t(this, Y).startCol >= 0 && this.render();
|
|
734
734
|
});
|
|
735
|
-
}),
|
|
735
|
+
}), S.log("π― [CellSelection] Initialized");
|
|
736
736
|
}
|
|
737
737
|
setRange(s, e, n, r) {
|
|
738
|
-
|
|
738
|
+
S.log(`π [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
739
739
|
let o = Math.min(s, n), i = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
740
740
|
const l = t(this, _).querySelectorAll(
|
|
741
741
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
@@ -745,19 +745,19 @@ const Je = class Je {
|
|
|
745
745
|
f = !1, u++, l.forEach((b) => {
|
|
746
746
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
747
747
|
if (g.classList.contains("nodata")) return;
|
|
748
|
-
const { matrixRow: y } =
|
|
748
|
+
const { matrixRow: y } = Q(this, U, At).call(this, g);
|
|
749
749
|
y < 0 || g.querySelectorAll("td, th").forEach((v) => {
|
|
750
|
-
const
|
|
751
|
-
if (isNaN(
|
|
752
|
-
const m = parseInt(v.rowSpan || 1, 10), I = parseInt(v.colSpan || 1, 10), T = y + m - 1, H =
|
|
753
|
-
if (T >= o && y <= i && H >= a &&
|
|
754
|
-
const X = Math.min(o, y), cs = Math.max(i, T), hs = Math.min(a,
|
|
750
|
+
const w = parseInt(v.dataset.col, 10);
|
|
751
|
+
if (isNaN(w)) return;
|
|
752
|
+
const m = parseInt(v.rowSpan || 1, 10), I = parseInt(v.colSpan || 1, 10), T = y + m - 1, H = w + I - 1;
|
|
753
|
+
if (T >= o && y <= i && H >= a && w <= c) {
|
|
754
|
+
const X = Math.min(o, y), cs = Math.max(i, T), hs = Math.min(a, w), ds = Math.max(c, H);
|
|
755
755
|
(X !== o || cs !== i || hs !== a || ds !== c) && (o = X, i = cs, a = hs, c = ds, f = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
759
759
|
});
|
|
760
|
-
p(this, Y, { startRow: o, startCol: a, endRow: i, endCol: c }),
|
|
760
|
+
p(this, Y, { startRow: o, startCol: a, endRow: i, endCol: c }), S.log("π¦ [CellSelection.setRange] Final Range ->", t(this, Y)), this.render();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
763
|
_ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(function(s) {
|
|
@@ -769,7 +769,7 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
769
769
|
}, "#getMatrixRow"), bs = /* @__PURE__ */ h(function() {
|
|
770
770
|
const s = t(this, _).querySelector(".ng-container-top");
|
|
771
771
|
if (!s) {
|
|
772
|
-
|
|
772
|
+
S.log("β [CellSelection] .ng-container-top not found!");
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
775
|
s.addEventListener("mousedown", (e) => {
|
|
@@ -777,60 +777,60 @@ _ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
777
777
|
const n = e.target.closest("td, th");
|
|
778
778
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
779
779
|
t(this, _).style.userSelect = "none", t(this, _).style.webkitUserSelect = "none";
|
|
780
|
-
const r = n.closest("tr"), { matrixRow: o } =
|
|
780
|
+
const r = n.closest("tr"), { matrixRow: o } = Q(this, U, At).call(this, r), i = parseInt(n.dataset.col, 10);
|
|
781
781
|
if (o < 0) {
|
|
782
782
|
t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "";
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
|
|
785
|
+
S.log(`π±οΈ [MouseDown Success] startRow: ${o}, startCol: ${i}`), this.setRange(o, i, o, i);
|
|
786
786
|
const a = /* @__PURE__ */ h((l) => {
|
|
787
787
|
const f = document.elementFromPoint(l.clientX, l.clientY);
|
|
788
788
|
let u = f == null ? void 0 : f.closest("td, th");
|
|
789
789
|
if (!u || !t(this, _).contains(u)) {
|
|
790
790
|
const v = t(this, _).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
791
|
-
for (const
|
|
792
|
-
const m =
|
|
791
|
+
for (const w of v) {
|
|
792
|
+
const m = w.getBoundingClientRect();
|
|
793
793
|
if (l.clientX >= m.left && l.clientX <= m.right && l.clientY >= m.top && l.clientY <= m.bottom) {
|
|
794
|
-
u =
|
|
794
|
+
u = w;
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
800
|
-
const b = u.closest("tr"), { matrixRow: g } =
|
|
800
|
+
const b = u.closest("tr"), { matrixRow: g } = Q(this, U, At).call(this, b), y = parseInt(u.dataset.col, 10);
|
|
801
801
|
g < 0 || this.setRange(o, i, g, y);
|
|
802
802
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
803
|
-
|
|
803
|
+
S.log("π±οΈ [MouseUp] Drag ended."), t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "", document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
804
804
|
}, "onMouseUp");
|
|
805
805
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", c);
|
|
806
806
|
});
|
|
807
807
|
}, "#initEvents"), h(Je, "CellSelection");
|
|
808
|
-
let
|
|
809
|
-
var V,
|
|
808
|
+
let qe = Je;
|
|
809
|
+
var V, lt, ee, se, _t, ne, ps;
|
|
810
810
|
const Qe = class Qe {
|
|
811
811
|
// π― ν€λ³΄λ λ€λΉκ²μ΄μ
μ€ μ€ν¬λ‘€ ν λ°©μ§ νλκ·Έ
|
|
812
812
|
constructor(s) {
|
|
813
|
-
d(this,
|
|
813
|
+
d(this, ne);
|
|
814
814
|
d(this, V);
|
|
815
|
-
d(this,
|
|
815
|
+
d(this, lt, null);
|
|
816
816
|
d(this, ee, -1);
|
|
817
817
|
d(this, se, -1);
|
|
818
818
|
d(this, _t, !1);
|
|
819
|
-
p(this, V, s),
|
|
819
|
+
p(this, V, s), Q(this, ne, ps).call(this), S.log("π― [CellNavigation] Initialized");
|
|
820
820
|
}
|
|
821
821
|
get currentCell() {
|
|
822
|
-
return t(this,
|
|
822
|
+
return t(this, lt);
|
|
823
823
|
}
|
|
824
824
|
set currentCell(s) {
|
|
825
825
|
if (!s) return;
|
|
826
|
-
p(this,
|
|
826
|
+
p(this, lt, s), s.focus({ preventScroll: !0 });
|
|
827
827
|
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
828
828
|
if (!isNaN(e) && !isNaN(n)) {
|
|
829
829
|
p(this, ee, e), p(this, se, n);
|
|
830
830
|
const r = s.closest("tr"), o = r == null ? void 0 : r.closest("tbody");
|
|
831
831
|
if (o) {
|
|
832
832
|
const a = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((u) => parseInt(u.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), f = e * c + (l >= 0 ? l : 0);
|
|
833
|
-
p(this, _t, !0), t(this, V).selection.setRange(f, n, f, n), setTimeout(() => {
|
|
833
|
+
p(this, _t, !0), S.log("====================", f, n, f, n), t(this, V).selection.setRange(f, n, f, n), setTimeout(() => {
|
|
834
834
|
p(this, _t, !1);
|
|
835
835
|
}, 0);
|
|
836
836
|
}
|
|
@@ -838,8 +838,8 @@ const Qe = class Qe {
|
|
|
838
838
|
}
|
|
839
839
|
moveCell(s) {
|
|
840
840
|
var I, T, H, F;
|
|
841
|
-
if (!t(this,
|
|
842
|
-
const e = t(this,
|
|
841
|
+
if (!t(this, lt)) return;
|
|
842
|
+
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = n == null ? void 0 : n.closest("tbody"), c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((X) => parseInt(X.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, f = c.indexOf(n);
|
|
843
843
|
let u = r, b = f, g = o;
|
|
844
844
|
switch (s.code) {
|
|
845
845
|
case "Tab":
|
|
@@ -868,48 +868,47 @@ const Qe = class Qe {
|
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
870
|
};
|
|
871
|
-
V = new WeakMap(),
|
|
871
|
+
V = new WeakMap(), lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), _t = new WeakMap(), ne = new WeakSet(), ps = /* @__PURE__ */ h(function() {
|
|
872
872
|
t(this, V).addEventListener("mousedown", (s) => {
|
|
873
|
-
w.log(s);
|
|
874
873
|
const e = s.target.closest("td, th");
|
|
875
|
-
!e || e.dataset.row === void 0 || e.dataset.col === void 0 ||
|
|
874
|
+
!e || e.dataset.row === void 0 || e.dataset.col === void 0 || (this.currentCell = e);
|
|
876
875
|
}), t(this, V).addEventListener("keydown", (s) => {
|
|
877
|
-
|
|
876
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
878
877
|
});
|
|
879
878
|
}, "#initEvents"), h(Qe, "CellNavigation");
|
|
880
|
-
let
|
|
881
|
-
var
|
|
879
|
+
let Te = Qe;
|
|
880
|
+
var re, ct, ht, Nt, Dt, oe, ie, yt, ae, le;
|
|
882
881
|
const Et = class Et extends HTMLElement {
|
|
883
882
|
constructor() {
|
|
884
883
|
super();
|
|
885
|
-
d(this,
|
|
886
|
-
d(this,
|
|
887
|
-
d(this,
|
|
884
|
+
d(this, re);
|
|
885
|
+
d(this, ct, null);
|
|
886
|
+
d(this, ht);
|
|
888
887
|
d(this, Nt);
|
|
889
888
|
d(this, Dt);
|
|
890
889
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
891
|
-
|
|
890
|
+
S.log("sheet.invalidate()"), t(this, ht).refresh();
|
|
892
891
|
}, "invalidate"));
|
|
893
892
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
894
|
-
if (
|
|
895
|
-
p(this,
|
|
893
|
+
if (S.log("sheet.generate()"), !e) return;
|
|
894
|
+
p(this, ct, Ee.compile(e)), t(this, oe).call(this), t(this, ie).call(this);
|
|
896
895
|
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
897
|
-
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this,
|
|
896
|
+
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, ht).initialize(), setTimeout(() => {
|
|
898
897
|
var i;
|
|
899
898
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
900
899
|
}, 0);
|
|
901
900
|
}, "generate"));
|
|
902
|
-
d(this,
|
|
901
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
903
902
|
[
|
|
904
903
|
{ selector: ".ng-container-body", type: null },
|
|
905
904
|
{ selector: ".ng-container-left", type: "left" },
|
|
906
905
|
{ selector: ".ng-container-right", type: "right" }
|
|
907
906
|
].forEach(({ selector: n, type: r }) => {
|
|
908
907
|
var o, i, a;
|
|
909
|
-
(o = this.querySelector(`${n} .ng-part-header`)) == null || o.appendChild(t(this, yt).call(this, t(this,
|
|
908
|
+
(o = this.querySelector(`${n} .ng-part-header`)) == null || o.appendChild(t(this, yt).call(this, t(this, ct), r, "header")), (i = this.querySelector(`${n} .ng-virtual-spacer`)) == null || i.before(t(this, yt).call(this, t(this, ct), r, "body")), (a = this.querySelector(`${n} .ng-part-footer`)) == null || a.appendChild(t(this, yt).call(this, t(this, ct), r, "footer"));
|
|
910
909
|
});
|
|
911
910
|
}, "#renderSplitContainers"));
|
|
912
|
-
d(this,
|
|
911
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
913
912
|
["left", "right", "body"].forEach((e) => {
|
|
914
913
|
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
915
914
|
if (!n || !r || r.length === 0) return;
|
|
@@ -936,7 +935,7 @@ const Et = class Et extends HTMLElement {
|
|
|
936
935
|
l.remove();
|
|
937
936
|
}), o;
|
|
938
937
|
}, "#createSplitTable"));
|
|
939
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
938
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ht).getRowHeight(), "getRowHeight"));
|
|
940
939
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
941
940
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
942
941
|
n && (n.scrollLeft = e);
|
|
@@ -945,10 +944,10 @@ const Et = class Et extends HTMLElement {
|
|
|
945
944
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
946
945
|
n && (n.scrollTop = e);
|
|
947
946
|
}, "scrollToY"));
|
|
948
|
-
d(this, ie, /* @__PURE__ */ h(() => {
|
|
949
|
-
t(this, ae).call(this), p(this, Nt, new Ee(this)), p(this, Dt, new qe(this));
|
|
950
|
-
}, "#init"));
|
|
951
947
|
d(this, ae, /* @__PURE__ */ h(() => {
|
|
948
|
+
t(this, le).call(this), p(this, Nt, new qe(this)), p(this, Dt, new Te(this));
|
|
949
|
+
}, "#init"));
|
|
950
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
952
951
|
const e = Et.SCROLLBAR_SIZE;
|
|
953
952
|
this.innerHTML = `
|
|
954
953
|
<style>
|
|
@@ -1150,10 +1149,10 @@ const Et = class Et extends HTMLElement {
|
|
|
1150
1149
|
</div>
|
|
1151
1150
|
`;
|
|
1152
1151
|
}, "#render"));
|
|
1153
|
-
p(this,
|
|
1152
|
+
p(this, ht, new Ae(this)), p(this, re, this.getRootNode().host);
|
|
1154
1153
|
}
|
|
1155
1154
|
connectedCallback() {
|
|
1156
|
-
t(this,
|
|
1155
|
+
t(this, ae).call(this);
|
|
1157
1156
|
}
|
|
1158
1157
|
get selection() {
|
|
1159
1158
|
return t(this, Nt);
|
|
@@ -1162,17 +1161,17 @@ const Et = class Et extends HTMLElement {
|
|
|
1162
1161
|
return t(this, Dt);
|
|
1163
1162
|
}
|
|
1164
1163
|
disconnectedCallback() {
|
|
1165
|
-
this.innerHTML = "",
|
|
1164
|
+
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1166
1165
|
}
|
|
1167
1166
|
};
|
|
1168
|
-
|
|
1167
|
+
re = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), Nt = new WeakMap(), Dt = new WeakMap(), oe = new WeakMap(), ie = new WeakMap(), yt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), h(Et, "NineTableSheet"), E(Et, "SCROLLBAR_SIZE", 16);
|
|
1169
1168
|
let Yt = Et;
|
|
1170
1169
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Yt);
|
|
1171
|
-
var
|
|
1170
|
+
var ce, Ot;
|
|
1172
1171
|
const ts = class ts extends HTMLElement {
|
|
1173
1172
|
constructor() {
|
|
1174
1173
|
super();
|
|
1175
|
-
d(this,
|
|
1174
|
+
d(this, ce, /* @__PURE__ */ h(() => {
|
|
1176
1175
|
var e;
|
|
1177
1176
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1178
1177
|
var i;
|
|
@@ -1186,8 +1185,8 @@ const ts = class ts extends HTMLElement {
|
|
|
1186
1185
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
1187
1186
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
1188
1187
|
b.length < 2 || b.forEach((g) => {
|
|
1189
|
-
const y = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${y}"]`),
|
|
1190
|
-
v &&
|
|
1188
|
+
const y = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${y}"]`), w = f[y + 1];
|
|
1189
|
+
v && w && w.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
1191
1190
|
});
|
|
1192
1191
|
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
1193
1192
|
if (!a[e]) return;
|
|
@@ -1213,18 +1212,18 @@ const ts = class ts extends HTMLElement {
|
|
|
1213
1212
|
}, "#switchSheet"));
|
|
1214
1213
|
}
|
|
1215
1214
|
connectedCallback() {
|
|
1216
|
-
t(this,
|
|
1215
|
+
t(this, ce).call(this);
|
|
1217
1216
|
}
|
|
1218
1217
|
};
|
|
1219
|
-
|
|
1220
|
-
let
|
|
1221
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1222
|
-
var N,
|
|
1218
|
+
ce = new WeakMap(), Ot = new WeakMap(), h(ts, "NineTableSheets");
|
|
1219
|
+
let Ce = ts;
|
|
1220
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ce);
|
|
1221
|
+
var N, he, zt, de;
|
|
1223
1222
|
const es = class es {
|
|
1224
1223
|
constructor(s) {
|
|
1225
1224
|
d(this, N);
|
|
1226
|
-
d(this,
|
|
1227
|
-
t(this,
|
|
1225
|
+
d(this, he, /* @__PURE__ */ h(() => {
|
|
1226
|
+
t(this, de).call(this), new ResizeObserver((s) => {
|
|
1228
1227
|
for (let e of s)
|
|
1229
1228
|
t(this, N).getAttribute("auto-height") === "true" && t(this, zt).call(this);
|
|
1230
1229
|
}).observe(t(this, N));
|
|
@@ -1236,7 +1235,7 @@ const es = class es {
|
|
|
1236
1235
|
const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((f) => f.getRowHeight())), r = (c = t(this, N).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, N).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Yt.SCROLLBAR_SIZE, a = e * n + r + o + i;
|
|
1237
1236
|
t(this, N).style.height = `${a}px`;
|
|
1238
1237
|
}, "#applyAutoHeight"));
|
|
1239
|
-
d(this,
|
|
1238
|
+
d(this, de, /* @__PURE__ */ h(() => {
|
|
1240
1239
|
const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"), n = t(this, N).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1241
1240
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1242
1241
|
return u + b;
|
|
@@ -1369,11 +1368,11 @@ const es = class es {
|
|
|
1369
1368
|
});
|
|
1370
1369
|
});
|
|
1371
1370
|
}, "#render"));
|
|
1372
|
-
p(this, N, s), t(this,
|
|
1371
|
+
p(this, N, s), t(this, he).call(this);
|
|
1373
1372
|
}
|
|
1374
1373
|
};
|
|
1375
|
-
N = new WeakMap(),
|
|
1376
|
-
let
|
|
1374
|
+
N = new WeakMap(), he = new WeakMap(), zt = new WeakMap(), de = new WeakMap(), h(es, "LayoutManager");
|
|
1375
|
+
let ke = es;
|
|
1377
1376
|
var Wt, mt;
|
|
1378
1377
|
const ss = class ss {
|
|
1379
1378
|
constructor(s) {
|
|
@@ -1391,17 +1390,17 @@ const ss = class ss {
|
|
|
1391
1390
|
}
|
|
1392
1391
|
};
|
|
1393
1392
|
Wt = new WeakMap(), mt = new WeakMap(), h(ss, "ngRow");
|
|
1394
|
-
let
|
|
1395
|
-
var O, k, z, xt,
|
|
1393
|
+
let Le = ss;
|
|
1394
|
+
var O, k, z, xt, fe, Z, ue, dt, Bt, ge, be, vt;
|
|
1396
1395
|
const W = class W {
|
|
1397
1396
|
constructor(s, e) {
|
|
1398
1397
|
d(this, O);
|
|
1399
1398
|
d(this, k);
|
|
1400
1399
|
d(this, z, []);
|
|
1401
1400
|
d(this, xt, []);
|
|
1402
|
-
d(this,
|
|
1401
|
+
d(this, fe, 0);
|
|
1403
1402
|
d(this, Z, []);
|
|
1404
|
-
d(this,
|
|
1403
|
+
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1405
1404
|
p(this, Z, []);
|
|
1406
1405
|
const s = t(this, O).template || [];
|
|
1407
1406
|
Array.from(s).forEach((e) => {
|
|
@@ -1411,7 +1410,7 @@ const W = class W {
|
|
|
1411
1410
|
e.__ng || (e.__ng = t(this, Bt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1412
1411
|
});
|
|
1413
1412
|
}, "#initialize"));
|
|
1414
|
-
d(this,
|
|
1413
|
+
d(this, dt, /* @__PURE__ */ h(() => {
|
|
1415
1414
|
const s = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1416
1415
|
s == null || s.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1417
1416
|
e.invalidate();
|
|
@@ -1431,7 +1430,7 @@ const W = class W {
|
|
|
1431
1430
|
return t(this, vt).call(this, n[s]);
|
|
1432
1431
|
}, "get"));
|
|
1433
1432
|
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1434
|
-
this.clear(), this.add(s, !1), t(this,
|
|
1433
|
+
this.clear(), this.add(s, !1), t(this, dt).call(this);
|
|
1435
1434
|
}, "set"));
|
|
1436
1435
|
d(this, Bt, /* @__PURE__ */ h(() => ({
|
|
1437
1436
|
rowState: W.ROW_STATE.EMPTY,
|
|
@@ -1443,13 +1442,13 @@ const W = class W {
|
|
|
1443
1442
|
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1444
1443
|
}), "#getDefaultMeta"));
|
|
1445
1444
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1446
|
-
p(this, z, []), p(this, xt, []), t(this,
|
|
1445
|
+
p(this, z, []), p(this, xt, []), t(this, dt).call(this);
|
|
1447
1446
|
}, "reset"));
|
|
1448
1447
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1449
1448
|
var s;
|
|
1450
1449
|
t(this, k).rawRecords = [], p(this, z, []), p(this, xt, []), (s = t(this, k).viewRecords) != null && s.reset && t(this, k).viewRecords.reset();
|
|
1451
1450
|
}, "clear"));
|
|
1452
|
-
d(this,
|
|
1451
|
+
d(this, ge, /* @__PURE__ */ h((s) => {
|
|
1453
1452
|
var r;
|
|
1454
1453
|
Array.isArray(s) || (s = [s]);
|
|
1455
1454
|
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
@@ -1460,18 +1459,18 @@ const W = class W {
|
|
|
1460
1459
|
}), n.push(i);
|
|
1461
1460
|
}), n;
|
|
1462
1461
|
}, "#json2Array"));
|
|
1463
|
-
d(this,
|
|
1462
|
+
d(this, be, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1464
1463
|
e.__ng = t(this, Bt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1465
1464
|
}), s), "#defaultInsert"));
|
|
1466
1465
|
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1467
1466
|
s === void 0 && (s = {});
|
|
1468
|
-
const n = t(this,
|
|
1469
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this,
|
|
1467
|
+
const n = t(this, ge).call(this, s);
|
|
1468
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, be).call(this, n)), this.resetRecords();
|
|
1470
1469
|
const r = this.count() - 1;
|
|
1471
1470
|
return e || n.forEach((o, i) => {
|
|
1472
1471
|
const a = t(this, k).rawRecords[r - i];
|
|
1473
1472
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1474
|
-
}), t(this,
|
|
1473
|
+
}), t(this, dt).call(this), r;
|
|
1475
1474
|
}, "add"));
|
|
1476
1475
|
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1477
1476
|
let e = [];
|
|
@@ -1482,7 +1481,7 @@ const W = class W {
|
|
|
1482
1481
|
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1483
1482
|
});
|
|
1484
1483
|
}
|
|
1485
|
-
}), this.resetRecords(), t(this,
|
|
1484
|
+
}), this.resetRecords(), t(this, dt).call(this);
|
|
1486
1485
|
}, "delete"));
|
|
1487
1486
|
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1488
1487
|
var c;
|
|
@@ -1514,7 +1513,7 @@ const W = class W {
|
|
|
1514
1513
|
return e ? o[0] : o;
|
|
1515
1514
|
}, "#conv"));
|
|
1516
1515
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1517
|
-
p(this, O, s), p(this, k, e), t(this,
|
|
1516
|
+
p(this, O, s), p(this, k, e), t(this, ue).call(this);
|
|
1518
1517
|
}
|
|
1519
1518
|
get source() {
|
|
1520
1519
|
return t(this, vt).call(this, t(this, k).rawRecords);
|
|
@@ -1523,7 +1522,7 @@ const W = class W {
|
|
|
1523
1522
|
this.clear(), this.add(s, !1);
|
|
1524
1523
|
}
|
|
1525
1524
|
get nextId() {
|
|
1526
|
-
return ++gs(this,
|
|
1525
|
+
return ++gs(this, fe)._;
|
|
1527
1526
|
}
|
|
1528
1527
|
get count() {
|
|
1529
1528
|
return t(this, z).length;
|
|
@@ -1535,7 +1534,7 @@ const W = class W {
|
|
|
1535
1534
|
return this.length;
|
|
1536
1535
|
}
|
|
1537
1536
|
};
|
|
1538
|
-
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(),
|
|
1537
|
+
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), Z = new WeakMap(), ue = new WeakMap(), dt = new WeakMap(), Bt = new WeakMap(), ge = new WeakMap(), be = new WeakMap(), vt = new WeakMap(), h(W, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1539
1538
|
E(W, "ROW_STATE", {
|
|
1540
1539
|
EMPTY: "EMPTY",
|
|
1541
1540
|
NORMAL: "NORMAL",
|
|
@@ -1543,14 +1542,14 @@ E(W, "ROW_STATE", {
|
|
|
1543
1542
|
UPDATE: "UPDATE",
|
|
1544
1543
|
DELETE: "DELETE"
|
|
1545
1544
|
});
|
|
1546
|
-
let
|
|
1547
|
-
var
|
|
1545
|
+
let Ie = W;
|
|
1546
|
+
var ft;
|
|
1548
1547
|
const ns = class ns {
|
|
1549
1548
|
constructor(s) {
|
|
1550
|
-
d(this,
|
|
1551
|
-
p(this,
|
|
1549
|
+
d(this, ft);
|
|
1550
|
+
p(this, ft, s), this.row = new Le(this), this.data = new Ie(t(this, ft), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1552
1551
|
var e;
|
|
1553
|
-
(e = t(this,
|
|
1552
|
+
(e = t(this, ft).view) != null && e.redraw && t(this, ft).view.redraw();
|
|
1554
1553
|
}, this.setDataSource = (e) => {
|
|
1555
1554
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1556
1555
|
}, this.getRowState = (e) => {
|
|
@@ -1565,9 +1564,9 @@ const ns = class ns {
|
|
|
1565
1564
|
}, this.setDataSource([]);
|
|
1566
1565
|
}
|
|
1567
1566
|
};
|
|
1568
|
-
|
|
1569
|
-
let
|
|
1570
|
-
var wt, M, Pt,
|
|
1567
|
+
ft = new WeakMap(), h(ns, "ngDataManager");
|
|
1568
|
+
let He = ns;
|
|
1569
|
+
var wt, M, Pt, pe;
|
|
1571
1570
|
const rs = class rs {
|
|
1572
1571
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1573
1572
|
constructor(s) {
|
|
@@ -1584,12 +1583,12 @@ const rs = class rs {
|
|
|
1584
1583
|
s.set(e.name, e.type);
|
|
1585
1584
|
}), p(this, M, Array.from(s, ([e, n]) => ({ name: e, type: n }))), p(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1586
1585
|
}, "#adjust"));
|
|
1587
|
-
d(this,
|
|
1588
|
-
p(this, M, []),
|
|
1586
|
+
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1587
|
+
p(this, M, []), S.log(t(this, wt).querySelectorAll("table"));
|
|
1589
1588
|
const s = Array.from(t(this, wt).querySelectorAll("table"));
|
|
1590
1589
|
if (!(!s || s.length === 0)) {
|
|
1591
1590
|
for (const e of s)
|
|
1592
|
-
|
|
1591
|
+
S.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1593
1592
|
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1594
1593
|
o && t(this, M).push({ name: o, type: i });
|
|
1595
1594
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
@@ -1616,7 +1615,7 @@ const rs = class rs {
|
|
|
1616
1615
|
t(this, Pt).call(this);
|
|
1617
1616
|
}
|
|
1618
1617
|
}, "#init"));
|
|
1619
|
-
p(this, wt, s), t(this,
|
|
1618
|
+
p(this, wt, s), t(this, pe).call(this);
|
|
1620
1619
|
}
|
|
1621
1620
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1622
1621
|
get() {
|
|
@@ -1638,42 +1637,42 @@ const rs = class rs {
|
|
|
1638
1637
|
return t(this, M).some((e) => e.name === s);
|
|
1639
1638
|
}
|
|
1640
1639
|
};
|
|
1641
|
-
wt = new WeakMap(), M = new WeakMap(), Pt = new WeakMap(),
|
|
1642
|
-
let
|
|
1643
|
-
var
|
|
1640
|
+
wt = new WeakMap(), M = new WeakMap(), Pt = new WeakMap(), pe = new WeakMap(), h(rs, "ngFields");
|
|
1641
|
+
let Me = rs;
|
|
1642
|
+
var ut, ye, me;
|
|
1644
1643
|
const os = class os extends HTMLElement {
|
|
1645
1644
|
constructor() {
|
|
1646
1645
|
super();
|
|
1647
1646
|
//#created = false;
|
|
1648
|
-
d(this,
|
|
1649
|
-
d(this,
|
|
1650
|
-
d(this,
|
|
1651
|
-
this.fields = new
|
|
1647
|
+
d(this, ut);
|
|
1648
|
+
d(this, ye);
|
|
1649
|
+
d(this, me, /* @__PURE__ */ h(() => {
|
|
1650
|
+
this.fields = new Me(this), p(this, ye, new ke(this)), S.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1652
1651
|
}, "#init"));
|
|
1653
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1652
|
+
this.attachShadow({ mode: "open" }), p(this, ut, new He(this));
|
|
1654
1653
|
}
|
|
1655
1654
|
connectedCallback() {
|
|
1656
|
-
t(this,
|
|
1655
|
+
t(this, me).call(this);
|
|
1657
1656
|
}
|
|
1658
1657
|
disconnectedCallback() {
|
|
1659
|
-
|
|
1658
|
+
S.log("NineTable disconnected.");
|
|
1660
1659
|
}
|
|
1661
1660
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1662
1661
|
get data() {
|
|
1663
|
-
return t(this,
|
|
1662
|
+
return t(this, ut).data;
|
|
1664
1663
|
}
|
|
1665
1664
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1666
1665
|
get row() {
|
|
1667
|
-
return t(this,
|
|
1666
|
+
return t(this, ut).row;
|
|
1668
1667
|
}
|
|
1669
1668
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1670
1669
|
get dataManager() {
|
|
1671
|
-
return t(this,
|
|
1670
|
+
return t(this, ut);
|
|
1672
1671
|
}
|
|
1673
1672
|
};
|
|
1674
|
-
|
|
1675
|
-
let
|
|
1676
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1673
|
+
ut = new WeakMap(), ye = new WeakMap(), me = new WeakMap(), h(os, "NineTable");
|
|
1674
|
+
let $e = os;
|
|
1675
|
+
customElements.get("nine-table") || customElements.define("nine-table", $e);
|
|
1677
1676
|
const qt = class qt extends HTMLElement {
|
|
1678
1677
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1679
1678
|
constructor() {
|
|
@@ -1686,9 +1685,9 @@ const qt = class qt extends HTMLElement {
|
|
|
1686
1685
|
}
|
|
1687
1686
|
};
|
|
1688
1687
|
h(qt, "BasicCellElement"), E(qt, "_styleCache", /* @__PURE__ */ new Map()), E(qt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1689
|
-
let
|
|
1688
|
+
let _e = qt;
|
|
1690
1689
|
var L, Ft, x, Pe, Fe, je, Ye, Ve;
|
|
1691
|
-
const is = class is extends
|
|
1690
|
+
const is = class is extends _e {
|
|
1692
1691
|
constructor() {
|
|
1693
1692
|
super();
|
|
1694
1693
|
d(this, L);
|
|
@@ -1742,8 +1741,8 @@ const is = class is extends $e {
|
|
|
1742
1741
|
else
|
|
1743
1742
|
o = !0;
|
|
1744
1743
|
o ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, x)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, x)).hasClass("hidden") || (o ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, x)).addClass("hidden"));
|
|
1745
|
-
var y = parseInt(t(this, x).dataset.matrixRow), v = y - 1,
|
|
1746
|
-
$(
|
|
1744
|
+
var y = parseInt(t(this, x).dataset.matrixRow), v = y - 1, w = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, x).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1745
|
+
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1747
1746
|
}
|
|
1748
1747
|
}
|
|
1749
1748
|
}, "#resetSuppress"));
|
|
@@ -1784,8 +1783,8 @@ const is = class is extends $e {
|
|
|
1784
1783
|
}
|
|
1785
1784
|
};
|
|
1786
1785
|
L = new WeakMap(), Ft = new WeakMap(), x = new WeakMap(), Pe = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), h(is, "CellElement");
|
|
1787
|
-
let
|
|
1788
|
-
const as = class as extends
|
|
1786
|
+
let Ne = is;
|
|
1787
|
+
const as = class as extends Ne {
|
|
1789
1788
|
constructor() {
|
|
1790
1789
|
super();
|
|
1791
1790
|
}
|
|
@@ -1797,16 +1796,16 @@ const as = class as extends _e {
|
|
|
1797
1796
|
}
|
|
1798
1797
|
};
|
|
1799
1798
|
h(as, "EditableCellElement");
|
|
1800
|
-
let
|
|
1801
|
-
var jt,
|
|
1802
|
-
const ls = class ls extends
|
|
1799
|
+
let De = as;
|
|
1800
|
+
var jt, gt, St, Rt, xe, J, Ue;
|
|
1801
|
+
const ls = class ls extends De {
|
|
1803
1802
|
constructor() {
|
|
1804
1803
|
super();
|
|
1805
1804
|
d(this, jt);
|
|
1806
|
-
d(this,
|
|
1805
|
+
d(this, gt);
|
|
1807
1806
|
d(this, St);
|
|
1808
1807
|
d(this, Rt);
|
|
1809
|
-
d(this,
|
|
1808
|
+
d(this, xe);
|
|
1810
1809
|
d(this, J);
|
|
1811
1810
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1812
1811
|
const e = super.refresh();
|
|
@@ -1844,7 +1843,7 @@ const ls = class ls extends Ne {
|
|
|
1844
1843
|
*/
|
|
1845
1844
|
d(this, Ue, /* @__PURE__ */ h((e) => {
|
|
1846
1845
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1847
|
-
if (t(this,
|
|
1846
|
+
if (t(this, gt) == "number") {
|
|
1848
1847
|
let o = [];
|
|
1849
1848
|
if (t(this, J) && Number(t(this, J)) > 0 && o.push("."), t(this, Rt) && Number(t(this, Rt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, J) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1850
1849
|
var n = e.target.value, r = n.indexOf(".");
|
|
@@ -1857,7 +1856,7 @@ const ls = class ls extends Ne {
|
|
|
1857
1856
|
t(this, St) && ninegrid.getByteLength(e.target.value) >= Number(t(this, St)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1858
1857
|
}
|
|
1859
1858
|
}, "#onKeyDown"));
|
|
1860
|
-
if (this.applyBaseStyle(), p(this,
|
|
1859
|
+
if (this.applyBaseStyle(), p(this, gt, this.getAttribute("type") || "text"), p(this, St, this.getAttribute("maxbyte")), p(this, Rt, this.getAttribute("min")), p(this, xe, this.getAttribute("max")), p(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, gt))) throw `invalid type : ${t(this, gt)}`;
|
|
1861
1860
|
}
|
|
1862
1861
|
connectedCallback() {
|
|
1863
1862
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1870,8 +1869,8 @@ const ls = class ls extends Ne {
|
|
|
1870
1869
|
`, super.connectedCallback(), p(this, jt, this.querySelector("input"));
|
|
1871
1870
|
}
|
|
1872
1871
|
};
|
|
1873
|
-
jt = new WeakMap(),
|
|
1874
|
-
let
|
|
1872
|
+
jt = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), Rt = new WeakMap(), xe = new WeakMap(), J = new WeakMap(), Ue = new WeakMap(), h(ls, "CellInputText");
|
|
1873
|
+
let Oe = ls;
|
|
1875
1874
|
customElements.get("cell-input-text");
|
|
1876
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1875
|
+
customElements.get("cell-input") || customElements.define("cell-input", Oe);
|
|
1877
1876
|
//# sourceMappingURL=nine-table.js.map
|