@ninebone/table 0.0.798 β 0.0.800
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 +350 -351
- 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,17 +1,17 @@
|
|
|
1
1
|
var ys = Object.defineProperty;
|
|
2
|
-
var ms = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var ms = (C) => {
|
|
3
|
+
throw TypeError(C);
|
|
4
4
|
};
|
|
5
|
-
var Ss = (
|
|
6
|
-
var h = (
|
|
7
|
-
var q = (
|
|
8
|
-
var t = (
|
|
9
|
-
var xs = (
|
|
5
|
+
var Ss = (C, n, e) => n in C ? ys(C, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[n] = e;
|
|
6
|
+
var h = (C, n) => ys(C, "name", { value: n, configurable: !0 });
|
|
7
|
+
var q = (C, n, e) => Ss(C, typeof n != "symbol" ? n + "" : n, e), Ee = (C, n, e) => n.has(C) || ms("Cannot " + e);
|
|
8
|
+
var t = (C, n, e) => (Ee(C, n, "read from private field"), e ? e.call(C) : n.get(C)), d = (C, n, e) => n.has(C) ? ms("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(C) : n.set(C, e), y = (C, n, e, s) => (Ee(C, n, "write to private field"), s ? s.call(C, e) : n.set(C, e), e), V = (C, n, e) => (Ee(C, n, "access private method"), e);
|
|
9
|
+
var xs = (C, n, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(
|
|
11
|
+
y(C, n, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(C, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Rs } from "@ninebone/util";
|
|
@@ -22,7 +22,7 @@ const ts = class ts extends Rs.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(ts, "Trace");
|
|
24
24
|
let qe = ts;
|
|
25
|
-
const
|
|
25
|
+
const R = new qe();
|
|
26
26
|
var j, G, E, tt, et, st, Jt, nt, Qt;
|
|
27
27
|
const es = class es extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -42,9 +42,9 @@ const es = class es extends HTMLElement {
|
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, j) || !t(this, E) || t(this, G)) return;
|
|
45
|
-
const e = t(this, E).container,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c =
|
|
45
|
+
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
|
+
if (!s) return;
|
|
47
|
+
const r = t(this, E).track, i = t(this, E).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -63,15 +63,15 @@ const es = class es extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
|
-
const
|
|
66
|
+
const s = t(this, E).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
68
|
const i = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = i.width - o;
|
|
72
|
-
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`,
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && f > 0 && (
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, R.log("1111=========="), t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
+
const l = s.clientWidth, f = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && f > 0 && (s.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
@@ -83,11 +83,11 @@ const es = class es extends HTMLElement {
|
|
|
83
83
|
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this, E).left.addEventListener(r,
|
|
90
|
+
t(this, E).left.addEventListener(r, s), t(this, E).right.addEventListener(r, s), t(this, E).track.addEventListener(r, s);
|
|
91
91
|
}), t(this, E).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
93
|
}), t(this, E).right.addEventListener("mousedown", (r) => {
|
|
@@ -105,7 +105,7 @@ const es = class es extends HTMLElement {
|
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
106
|
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, G, !1),
|
|
108
|
+
y(this, G, !1), s(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -177,18 +177,18 @@ const es = class es extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const s = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, E, {
|
|
186
|
-
container:
|
|
186
|
+
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
191
|
+
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, G) || this.refresh();
|
|
193
193
|
}), t(this, Qt).call(this), t(this, Jt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
@@ -199,8 +199,8 @@ const es = class es extends HTMLElement {
|
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
j = new WeakMap(), G = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Jt = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), h(es, "NineTableHScrollBar");
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
202
|
+
let Ce = es;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
204
|
var rt, ot, yt, k, kt, It, te;
|
|
205
205
|
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
@@ -212,27 +212,27 @@ const ss = class ss extends HTMLElement {
|
|
|
212
212
|
d(this, kt, 0);
|
|
213
213
|
d(this, It, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, k).container,
|
|
215
|
+
if (R.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const l =
|
|
222
|
+
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
|
-
|
|
227
|
+
R.log(e, f, b);
|
|
228
228
|
let g = 0;
|
|
229
229
|
b > 0 && (g = f / b * (l - u));
|
|
230
230
|
const p = l - u;
|
|
231
231
|
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
234
|
-
|
|
235
|
-
const e = t(this, k).container,
|
|
234
|
+
R.log("nine-table-vscrollbar.#init");
|
|
235
|
+
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
236
|
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
237
|
return i * o;
|
|
238
238
|
}, "getContentHeight");
|
|
@@ -241,12 +241,12 @@ const ss = class ss extends HTMLElement {
|
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, It, e.scrollTop);
|
|
242
242
|
const i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p =
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = s(), x = Math.max(p - g, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
247
|
let m = t(this, It) + w;
|
|
248
|
-
const
|
|
249
|
-
m < 0 && (m = 0), m >
|
|
248
|
+
const T = Math.max(0, p - g);
|
|
249
|
+
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
@@ -255,7 +255,7 @@ const ss = class ss extends HTMLElement {
|
|
|
255
255
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f =
|
|
258
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f = s(), b = Math.max(f - u, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
@@ -334,13 +334,13 @@ const ss = class ss 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
|
|
338
|
-
if (!
|
|
337
|
+
const s = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
y(this, k, {
|
|
343
|
-
container:
|
|
343
|
+
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -351,11 +351,11 @@ const ss = class ss extends HTMLElement {
|
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
353
|
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), It = new WeakMap(), te = new WeakMap(), h(ss, "NineTableVScrollBar");
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
354
|
+
let Te = ss;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
356
|
var U, A, it, Y, O, Z, at, Lt, Ye, Ve, ee, se, Mt, Ht, $t, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
|
-
constructor(
|
|
358
|
+
constructor(n) {
|
|
359
359
|
d(this, U);
|
|
360
360
|
d(this, A);
|
|
361
361
|
d(this, it);
|
|
@@ -370,12 +370,12 @@ const ns = class ns {
|
|
|
370
370
|
d(this, ee, 3);
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
373
|
+
R.log("rowManager.refresh");
|
|
374
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop), (e = t(this, A).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
q(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
|
|
378
|
+
R.log("rowManager.initialize"), y(this, it, {
|
|
379
379
|
scrollTables: t(this, A).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, A).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
@@ -388,40 +388,39 @@ const ns = class ns {
|
|
|
388
388
|
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
389
|
t(this, Y).set(o, f);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this,
|
|
391
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body"), r = t(this, A).querySelector(".ng-container-body .ng-part-header"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, n.scrollTop);
|
|
394
394
|
let o = !1;
|
|
395
|
-
s.scrollTop, s.scrollLeft;
|
|
396
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
396
|
var f;
|
|
398
397
|
if (o) return;
|
|
399
398
|
o = !0;
|
|
400
399
|
const l = c.scrollTop, u = c.scrollLeft;
|
|
401
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== u && (r.scrollLeft = u), i && i.scrollLeft !== u && (i.scrollLeft = u), t(this, mt).call(this, l), (f = t(this, A).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
|
|
402
401
|
}, "handleContainerScroll");
|
|
403
|
-
|
|
404
|
-
a(
|
|
405
|
-
}), [e,
|
|
402
|
+
n == null || n.addEventListener("scroll", (c) => {
|
|
403
|
+
a(n);
|
|
404
|
+
}), [e, s].forEach((c) => {
|
|
406
405
|
c == null || c.addEventListener("scroll", (l) => {
|
|
407
406
|
if (o) return;
|
|
408
407
|
o = !0;
|
|
409
408
|
const u = c.scrollTop;
|
|
410
|
-
|
|
409
|
+
n && n.scrollTop !== u && (n.scrollTop = u), o = !1;
|
|
411
410
|
});
|
|
412
411
|
});
|
|
413
412
|
}
|
|
414
413
|
}, "initialize"));
|
|
415
|
-
d(this, se, /* @__PURE__ */ h((
|
|
416
|
-
|
|
417
|
-
const
|
|
418
|
-
if (!
|
|
419
|
-
const r =
|
|
414
|
+
d(this, se, /* @__PURE__ */ h((n, e) => {
|
|
415
|
+
R.log("rowManager.#renderRows");
|
|
416
|
+
const s = t(this, Y).get(e);
|
|
417
|
+
if (!s || s.length === 0) return;
|
|
418
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
420
419
|
if (!r) return;
|
|
421
420
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
422
421
|
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
423
422
|
for (let a = 0; a < t(this, Lt); a++)
|
|
424
|
-
|
|
423
|
+
s.forEach((c) => {
|
|
425
424
|
o.appendChild(c.cloneNode(!0));
|
|
426
425
|
});
|
|
427
426
|
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
@@ -429,21 +428,21 @@ const ns = class ns {
|
|
|
429
428
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
430
429
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
431
430
|
return t(this, O);
|
|
432
|
-
const
|
|
433
|
-
|
|
431
|
+
const n = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
432
|
+
R.log("rowManager.#measureAndCacheHeight");
|
|
434
433
|
const e = t(this, Y).get(".ng-container-body");
|
|
435
434
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
|
|
439
|
-
const r =
|
|
435
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
436
|
+
if (R.log(s), !s) throw new Error("invalid dom");
|
|
437
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
438
|
+
const r = s.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
440
439
|
e.forEach((b) => {
|
|
441
440
|
i.appendChild(b.cloneNode(!0));
|
|
442
|
-
}), r ? r.before(i) :
|
|
441
|
+
}), r ? r.before(i) : s.appendChild(i);
|
|
443
442
|
const o = t(this, A), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
444
443
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
445
444
|
let u = 0;
|
|
446
|
-
const f =
|
|
445
|
+
const f = s.querySelectorAll("tr");
|
|
447
446
|
return f.forEach((b) => {
|
|
448
447
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
449
448
|
if (g === 0) {
|
|
@@ -454,9 +453,9 @@ const ns = class ns {
|
|
|
454
453
|
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, O, u), t(this, $t).call(this), t(this, O));
|
|
455
454
|
}, "#measureAndCacheHeight"));
|
|
456
455
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
457
|
-
|
|
458
|
-
const e = (t(this, U).data.get() || []).length,
|
|
459
|
-
|
|
456
|
+
R.log("rowManager.#updateVirtualScrollHeight");
|
|
457
|
+
const e = (t(this, U).data.get() || []).length, s = t(this, O), r = e * s;
|
|
458
|
+
R.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
460
459
|
const o = t(this, A).querySelector(i);
|
|
461
460
|
if (!o) return;
|
|
462
461
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
@@ -465,46 +464,46 @@ const ns = class ns {
|
|
|
465
464
|
}, "#updateVirtualScrollHeight"));
|
|
466
465
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
467
466
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
468
|
-
const
|
|
469
|
-
y(this, Lt,
|
|
467
|
+
const n = Math.ceil(t(this, at) / t(this, O));
|
|
468
|
+
y(this, Lt, n + t(this, ee));
|
|
470
469
|
}
|
|
471
470
|
}, "#updateRowCount"));
|
|
472
471
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
473
472
|
var a, c, l, u, f, b;
|
|
474
|
-
const
|
|
473
|
+
const n = t(this, A).querySelector(".ng-container-left .ng-part-body table"), e = t(this, A).querySelector(".ng-container-body .ng-part-body table"), s = t(this, A).querySelector(".ng-container-right .ng-part-body table");
|
|
475
474
|
if (e) {
|
|
476
|
-
const g =
|
|
475
|
+
const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
477
476
|
for (let m = 0; m < w; m++) {
|
|
478
|
-
const
|
|
477
|
+
const T = [
|
|
479
478
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
480
479
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
481
480
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
482
|
-
],
|
|
483
|
-
|
|
481
|
+
], S = Math.max(...T);
|
|
482
|
+
S > 0 && (g[m] && (g[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
484
483
|
}
|
|
485
484
|
}
|
|
486
485
|
const r = t(this, A).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, A).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, A).querySelector(".ng-container-right .ng-part-footer table");
|
|
487
486
|
if (i) {
|
|
488
487
|
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
489
488
|
for (let m = 0; m < w; m++) {
|
|
490
|
-
const
|
|
489
|
+
const T = [
|
|
491
490
|
((u = g[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
492
491
|
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
493
492
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
494
|
-
],
|
|
495
|
-
|
|
493
|
+
], S = Math.max(...T);
|
|
494
|
+
S > 0 && (g[m] && (g[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
496
495
|
}
|
|
497
496
|
}
|
|
498
497
|
}, "#syncRowHeights"));
|
|
499
498
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
500
|
-
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((
|
|
501
|
-
for (const e of
|
|
502
|
-
const
|
|
503
|
-
if (!
|
|
499
|
+
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((n) => {
|
|
500
|
+
for (const e of n) {
|
|
501
|
+
const s = e.target;
|
|
502
|
+
if (!s.classList.contains("active")) continue;
|
|
504
503
|
const r = e.contentRect.height;
|
|
505
504
|
if (r > 0) {
|
|
506
505
|
let i = 0;
|
|
507
|
-
const o =
|
|
506
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
508
507
|
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
509
508
|
const c = Math.max(r - i, 100);
|
|
510
509
|
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
@@ -513,21 +512,21 @@ const ns = class ns {
|
|
|
513
512
|
})), t(this, Z).observe(t(this, A)));
|
|
514
513
|
}, "#initResizeObserver"));
|
|
515
514
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
516
|
-
|
|
517
|
-
const e = t(this, A).querySelector(
|
|
518
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e,
|
|
515
|
+
R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
516
|
+
const e = t(this, A).querySelector(n);
|
|
517
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, n);
|
|
519
518
|
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
520
519
|
}, "#renderAllContainers"));
|
|
521
|
-
d(this, Ue, /* @__PURE__ */ h((
|
|
520
|
+
d(this, Ue, /* @__PURE__ */ h((n) => {
|
|
522
521
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
523
522
|
var l;
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
526
|
-
const r =
|
|
523
|
+
const s = t(this, A).querySelector(e);
|
|
524
|
+
if (!s) return;
|
|
525
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
527
526
|
if (!r) return;
|
|
528
527
|
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, Y).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
|
|
529
528
|
i.forEach((u, f) => {
|
|
530
|
-
const b =
|
|
529
|
+
const b = n + Math.floor(f / o);
|
|
531
530
|
if (b >= c) {
|
|
532
531
|
u.style.visibility = "hidden";
|
|
533
532
|
return;
|
|
@@ -537,33 +536,33 @@ const ns = class ns {
|
|
|
537
536
|
});
|
|
538
537
|
});
|
|
539
538
|
}, "#adjustBufferRows"));
|
|
540
|
-
d(this, mt, /* @__PURE__ */ h((
|
|
539
|
+
d(this, mt, /* @__PURE__ */ h((n) => {
|
|
541
540
|
var f, b;
|
|
542
541
|
const e = t(this, O);
|
|
543
542
|
if (!e || e <= 0) return;
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
543
|
+
const s = t(this, U).data.length;
|
|
544
|
+
if (s === 0) return;
|
|
546
545
|
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
547
|
-
|
|
548
|
-
const o = Math.max(0,
|
|
546
|
+
R.log("bodyContainer.clientHeight", i.clientHeight);
|
|
547
|
+
const o = Math.max(0, s - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(n / e)));
|
|
549
548
|
let c = Math.floor(a * e);
|
|
550
|
-
|
|
549
|
+
R.log(`π [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`π [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
551
550
|
const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
552
551
|
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
553
552
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
554
|
-
}), u !== a && (
|
|
553
|
+
}), u !== a && (R.log(`π [Row Bind Trigger] currentStartIndex(${u}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
555
554
|
const p = t(this, A).querySelector(g);
|
|
556
555
|
if (!p) return;
|
|
557
556
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
558
557
|
if (!x) return;
|
|
559
|
-
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m,
|
|
560
|
-
const
|
|
561
|
-
if (
|
|
558
|
+
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, T) => {
|
|
559
|
+
const S = a + Math.floor(T / r);
|
|
560
|
+
if (S >= s) {
|
|
562
561
|
m.style.display = "none";
|
|
563
562
|
return;
|
|
564
563
|
}
|
|
565
|
-
const M = t(this, U).data.get(
|
|
566
|
-
m.style.display = "", t(this, _t).call(this, m, M,
|
|
564
|
+
const M = t(this, U).data.get(S);
|
|
565
|
+
m.style.display = "", t(this, _t).call(this, m, M, S);
|
|
567
566
|
});
|
|
568
567
|
}));
|
|
569
568
|
}, "#handleScroll"));
|
|
@@ -581,19 +580,19 @@ const ns = class ns {
|
|
|
581
580
|
cell.dataset.row = dataIndex;
|
|
582
581
|
});
|
|
583
582
|
}; */
|
|
584
|
-
d(this, _t, /* @__PURE__ */ h((
|
|
585
|
-
|
|
586
|
-
r.dataset.row =
|
|
583
|
+
d(this, _t, /* @__PURE__ */ h((n, e, s) => {
|
|
584
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, i) => {
|
|
585
|
+
r.dataset.row = s;
|
|
587
586
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
588
587
|
o && typeof o.refresh == "function" && o.refresh();
|
|
589
588
|
});
|
|
590
589
|
}, "#bindRowData"));
|
|
591
590
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
592
591
|
var c, l, u;
|
|
593
|
-
|
|
594
|
-
const
|
|
592
|
+
R.log("rowManager.#syncHeaderHeights");
|
|
593
|
+
const n = t(this, A).querySelector(".ng-container-left .ng-part-header table"), e = t(this, A).querySelector(".ng-container-body .ng-part-header table"), s = t(this, A).querySelector(".ng-container-right .ng-part-header table");
|
|
595
594
|
if (!e) return;
|
|
596
|
-
const r =
|
|
595
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
597
596
|
for (let f = 0; f < a; f++) {
|
|
598
597
|
const b = [
|
|
599
598
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -606,14 +605,14 @@ const ns = class ns {
|
|
|
606
605
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
607
606
|
t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
|
|
608
607
|
}, "destroy"));
|
|
609
|
-
y(this, U,
|
|
608
|
+
y(this, U, n.getRootNode().host), y(this, A, n), t(this, re).call(this);
|
|
610
609
|
}
|
|
611
610
|
getRowHeight() {
|
|
612
611
|
return t(this, O);
|
|
613
612
|
}
|
|
614
|
-
templateLength(
|
|
613
|
+
templateLength(n = ".ng-container-body") {
|
|
615
614
|
var e;
|
|
616
|
-
return ((e = t(this, Y).get(
|
|
615
|
+
return ((e = t(this, Y).get(n)) == null ? void 0 : e.length) || 1;
|
|
617
616
|
}
|
|
618
617
|
};
|
|
619
618
|
U = new WeakMap(), A = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), Lt = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), Ue = new WeakMap(), mt = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(ns, "RowManager");
|
|
@@ -622,14 +621,14 @@ const ie = class ie {
|
|
|
622
621
|
/**
|
|
623
622
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
624
623
|
*/
|
|
625
|
-
static compileAll(
|
|
626
|
-
return Array.isArray(
|
|
624
|
+
static compileAll(n) {
|
|
625
|
+
return Array.isArray(n) ? n.map((e) => ie.compile(e)) : [];
|
|
627
626
|
}
|
|
628
627
|
/**
|
|
629
628
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
630
629
|
*/
|
|
631
|
-
static compile(
|
|
632
|
-
if (!
|
|
630
|
+
static compile(n) {
|
|
631
|
+
if (!n) return null;
|
|
633
632
|
const e = /* @__PURE__ */ h((a) => {
|
|
634
633
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
635
634
|
const u = l.getAttribute("cell-type") || "renderer";
|
|
@@ -641,7 +640,7 @@ const ie = class ie {
|
|
|
641
640
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
642
641
|
l.setAttribute("tabindex", "0");
|
|
643
642
|
});
|
|
644
|
-
}, "processCellTypes"),
|
|
643
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
645
644
|
if (!a.querySelector("colgroup")) {
|
|
646
645
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
647
646
|
for (let b = 0; b < l; b++) {
|
|
@@ -672,9 +671,9 @@ const ie = class ie {
|
|
|
672
671
|
w = M;
|
|
673
672
|
break;
|
|
674
673
|
}
|
|
675
|
-
const
|
|
676
|
-
for (let M = 0; M <
|
|
677
|
-
for (let B = 0; B <
|
|
674
|
+
const T = m.rowSpan || 1, S = m.colSpan || 1;
|
|
675
|
+
for (let M = 0; M < T; M++)
|
|
676
|
+
for (let B = 0; B < S; B++)
|
|
678
677
|
x + M < f && w + B < b && (g[x + M][w + B] = M === 0 && B === 0 ? "1" : "0");
|
|
679
678
|
});
|
|
680
679
|
}), l.forEach((p) => {
|
|
@@ -687,8 +686,8 @@ const ie = class ie {
|
|
|
687
686
|
}
|
|
688
687
|
});
|
|
689
688
|
});
|
|
690
|
-
}, "resetColIndex"), i =
|
|
691
|
-
return
|
|
689
|
+
}, "resetColIndex"), i = n.cloneNode(!0);
|
|
690
|
+
return s(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
692
691
|
const l = a.getAttribute("fixed");
|
|
693
692
|
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
694
693
|
u.setAttribute("fixed", l);
|
|
@@ -701,13 +700,13 @@ h(ie, "TableCompiler");
|
|
|
701
700
|
let Ie = ie;
|
|
702
701
|
var N, X, K, qt, ws;
|
|
703
702
|
const rs = class rs {
|
|
704
|
-
constructor(
|
|
703
|
+
constructor(n) {
|
|
705
704
|
d(this, K);
|
|
706
705
|
d(this, N);
|
|
707
706
|
d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
708
707
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
709
|
-
const { startRow:
|
|
710
|
-
|
|
708
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, X);
|
|
709
|
+
R.log("π¨ [CellSelection.render] Rendering range ->", t(this, X));
|
|
711
710
|
const i = t(this, N).querySelectorAll(
|
|
712
711
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
713
712
|
);
|
|
@@ -715,8 +714,8 @@ const rs = class rs {
|
|
|
715
714
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
716
715
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
717
716
|
});
|
|
718
|
-
}),
|
|
719
|
-
|
|
717
|
+
}), n < 0 || e < 0) {
|
|
718
|
+
R.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
720
719
|
return;
|
|
721
720
|
}
|
|
722
721
|
let o = 0;
|
|
@@ -727,22 +726,22 @@ const rs = class rs {
|
|
|
727
726
|
const f = parseInt(u.dataset.col, 10);
|
|
728
727
|
if (isNaN(f)) return;
|
|
729
728
|
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = f + g - 1;
|
|
730
|
-
p >=
|
|
729
|
+
p >= n && l <= s && x >= e && f <= r && (o++, u.classList.add("selected"), R.log(u, n, e, s, r), l <= n && u.classList.add("selected-top"), p >= s && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
|
|
731
730
|
});
|
|
732
731
|
});
|
|
733
|
-
}),
|
|
732
|
+
}), R.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
734
733
|
}, "render"));
|
|
735
|
-
y(this, N,
|
|
734
|
+
y(this, N, n), V(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
736
735
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
737
|
-
).forEach((
|
|
738
|
-
|
|
736
|
+
).forEach((s) => {
|
|
737
|
+
s.addEventListener("scroll", () => {
|
|
739
738
|
t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
|
|
740
739
|
});
|
|
741
|
-
}),
|
|
740
|
+
}), R.log("π― [CellSelection] Initialized");
|
|
742
741
|
}
|
|
743
|
-
setRange(
|
|
744
|
-
|
|
745
|
-
let i = Math.min(
|
|
742
|
+
setRange(n, e, s, r) {
|
|
743
|
+
R.log(`π [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
744
|
+
let i = Math.min(n, s), o = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
746
745
|
const l = t(this, N).querySelectorAll(
|
|
747
746
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
748
747
|
);
|
|
@@ -755,50 +754,50 @@ const rs = class rs {
|
|
|
755
754
|
p < 0 || g.querySelectorAll("td, th").forEach((x) => {
|
|
756
755
|
const w = parseInt(x.dataset.col, 10);
|
|
757
756
|
if (isNaN(w)) return;
|
|
758
|
-
const m = parseInt(x.rowSpan || 1, 10),
|
|
759
|
-
if (
|
|
760
|
-
const z = Math.min(i, p), Gt = Math.max(o,
|
|
757
|
+
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), S = p + m - 1, M = w + T - 1;
|
|
758
|
+
if (S >= i && p <= o && M >= a && w <= c) {
|
|
759
|
+
const z = Math.min(i, p), Gt = Math.max(o, S), bs = Math.min(a, w), ps = Math.max(c, M);
|
|
761
760
|
(z !== i || Gt !== o || bs !== a || ps !== c) && (i = z, o = Gt, a = bs, c = ps, u = !0);
|
|
762
761
|
}
|
|
763
762
|
});
|
|
764
763
|
});
|
|
765
764
|
});
|
|
766
|
-
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }),
|
|
765
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), R.log("π¦ [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
767
766
|
}
|
|
768
767
|
};
|
|
769
|
-
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(
|
|
770
|
-
if (!
|
|
771
|
-
const e = parseInt(
|
|
768
|
+
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(n) {
|
|
769
|
+
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
770
|
+
const e = parseInt(n.dataset.row, 10);
|
|
772
771
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
773
|
-
const
|
|
772
|
+
const s = n.closest("tbody"), i = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(n), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : n.sectionRowIndex % a);
|
|
774
773
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
775
774
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
776
|
-
const
|
|
777
|
-
if (!
|
|
778
|
-
|
|
775
|
+
const n = t(this, N).querySelector(".ng-container-top");
|
|
776
|
+
if (!n) {
|
|
777
|
+
R.log("β [CellSelection] .ng-container-top not found!");
|
|
779
778
|
return;
|
|
780
779
|
}
|
|
781
|
-
|
|
780
|
+
n.addEventListener("mousedown", (e) => {
|
|
782
781
|
if (e.button !== 0) return;
|
|
783
|
-
const
|
|
784
|
-
if (!
|
|
782
|
+
const s = e.target.closest("td, th");
|
|
783
|
+
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
785
784
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
786
|
-
const r =
|
|
785
|
+
const r = s.closest("tr"), { matrixRow: i } = V(this, K, qt).call(this, r), o = parseInt(s.dataset.col, 10);
|
|
787
786
|
if (i < 0) {
|
|
788
787
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
789
788
|
return;
|
|
790
789
|
}
|
|
791
|
-
|
|
790
|
+
R.log(`π±οΈ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = s;
|
|
792
791
|
let a = i, c = o;
|
|
793
792
|
const l = /* @__PURE__ */ h((f) => {
|
|
794
793
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
795
794
|
let g = b == null ? void 0 : b.closest("td, th");
|
|
796
795
|
if (!g || !t(this, N).contains(g)) {
|
|
797
796
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
798
|
-
for (const
|
|
799
|
-
const
|
|
800
|
-
if (f.clientX >=
|
|
801
|
-
g =
|
|
797
|
+
for (const T of m) {
|
|
798
|
+
const S = T.getBoundingClientRect();
|
|
799
|
+
if (f.clientX >= S.left && f.clientX <= S.right && f.clientY >= S.top && f.clientY <= S.bottom) {
|
|
800
|
+
g = T;
|
|
802
801
|
break;
|
|
803
802
|
}
|
|
804
803
|
}
|
|
@@ -807,7 +806,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
807
806
|
const p = g.closest("tr"), { matrixRow: x } = V(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
|
|
808
807
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
809
808
|
}, "onMouseMove"), u = /* @__PURE__ */ h(() => {
|
|
810
|
-
|
|
809
|
+
R.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
|
|
811
810
|
}, "onMouseUp");
|
|
812
811
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
|
|
813
812
|
});
|
|
@@ -815,22 +814,22 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
815
814
|
let Le = rs;
|
|
816
815
|
var F, lt, ae, le, pt, He, Ot, Dt, Bt, ct, Wt, vs;
|
|
817
816
|
const os = class os {
|
|
818
|
-
constructor(
|
|
817
|
+
constructor(n) {
|
|
819
818
|
d(this, pt);
|
|
820
819
|
d(this, F);
|
|
821
820
|
d(this, lt, null);
|
|
822
821
|
d(this, ae, -1);
|
|
823
822
|
d(this, le, -1);
|
|
824
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
823
|
+
d(this, Ot, /* @__PURE__ */ h((n) => {
|
|
825
824
|
const e = [];
|
|
826
|
-
return
|
|
825
|
+
return n.forEach((s) => e.push(...Array.from(s.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((s, r) => parseInt(s.dataset.col, 10) - parseInt(r.dataset.col, 10)), e[e.length - 1]);
|
|
827
826
|
}, "#getMaxColCell"));
|
|
828
|
-
d(this, Dt, /* @__PURE__ */ h((
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
827
|
+
d(this, Dt, /* @__PURE__ */ h((n, e) => {
|
|
828
|
+
const s = t(this, ct).call(this, n);
|
|
829
|
+
if (s.length === 0) return e + 1;
|
|
831
830
|
let r = e + 1;
|
|
832
831
|
const i = [];
|
|
833
|
-
|
|
832
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
834
833
|
for (const o of i) {
|
|
835
834
|
const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
836
835
|
if (e >= a && e < a + c) {
|
|
@@ -840,12 +839,12 @@ const os = class os {
|
|
|
840
839
|
}
|
|
841
840
|
return r;
|
|
842
841
|
}, "#getNextCol"));
|
|
843
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
842
|
+
d(this, Bt, /* @__PURE__ */ h((n, e) => {
|
|
843
|
+
const s = t(this, ct).call(this, n);
|
|
844
|
+
if (s.length === 0) return Math.max(0, e - 1);
|
|
846
845
|
let r = -1;
|
|
847
846
|
const i = [];
|
|
848
|
-
|
|
847
|
+
s.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
849
848
|
for (const o of i) {
|
|
850
849
|
const a = parseInt(o.dataset.col, 10);
|
|
851
850
|
if (a < e)
|
|
@@ -856,77 +855,77 @@ const os = class os {
|
|
|
856
855
|
return r;
|
|
857
856
|
}, "#getPreviousCol"));
|
|
858
857
|
// π― λ κ±°μμ λ³ν© μ
(rowSpan) λΈλ‘ ν¬μ© νμ λ‘μ§ μ΄μ
|
|
859
|
-
d(this, ct, /* @__PURE__ */ h((
|
|
858
|
+
d(this, ct, /* @__PURE__ */ h((n) => {
|
|
860
859
|
const e = t(this, F).querySelectorAll(
|
|
861
860
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
862
|
-
),
|
|
861
|
+
), s = [];
|
|
863
862
|
return e.forEach((r) => {
|
|
864
863
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
865
864
|
for (const o of i) {
|
|
866
865
|
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), f = a * l + (u >= 0 ? u : 0);
|
|
867
|
-
if (f ===
|
|
868
|
-
|
|
866
|
+
if (f === n) {
|
|
867
|
+
s.push(o);
|
|
869
868
|
break;
|
|
870
869
|
}
|
|
871
870
|
const b = Array.from(o.querySelectorAll("td"));
|
|
872
871
|
let g = !1;
|
|
873
872
|
for (const p of b) {
|
|
874
873
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
875
|
-
if (x > 1 &&
|
|
876
|
-
|
|
874
|
+
if (x > 1 && n >= f && n < f + x) {
|
|
875
|
+
s.push(o), g = !0;
|
|
877
876
|
break;
|
|
878
877
|
}
|
|
879
878
|
}
|
|
880
879
|
if (g) break;
|
|
881
880
|
}
|
|
882
|
-
}),
|
|
881
|
+
}), s;
|
|
883
882
|
}, "#findTargetTrsByMatrix"));
|
|
884
883
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
885
|
-
d(this, Wt, /* @__PURE__ */ h((
|
|
884
|
+
d(this, Wt, /* @__PURE__ */ h((n, e, s, r) => {
|
|
886
885
|
const i = t(this, F).querySelectorAll(
|
|
887
886
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
888
|
-
), o = r !== void 0 ? r :
|
|
887
|
+
), o = r !== void 0 ? r : n * 1 + e;
|
|
889
888
|
for (const a of i) {
|
|
890
889
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
891
890
|
for (const l of c) {
|
|
892
891
|
const u = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
|
|
893
892
|
for (const w of x) {
|
|
894
|
-
const m = parseInt(w.dataset.col, 10),
|
|
895
|
-
if (!isNaN(m) &&
|
|
893
|
+
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
894
|
+
if (!isNaN(m) && s >= m && s < m + T && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
|
|
896
895
|
return w;
|
|
897
896
|
}
|
|
898
897
|
}
|
|
899
898
|
}
|
|
900
899
|
return null;
|
|
901
900
|
}, "#getNearElement"));
|
|
902
|
-
y(this, F,
|
|
901
|
+
y(this, F, n), V(this, pt, vs).call(this), R.log("π― [CellNavigation] Initialized");
|
|
903
902
|
}
|
|
904
903
|
get currentCell() {
|
|
905
904
|
return t(this, lt);
|
|
906
905
|
}
|
|
907
|
-
set currentCell(
|
|
908
|
-
if (!
|
|
909
|
-
y(this, lt,
|
|
910
|
-
const e = parseInt(
|
|
911
|
-
if (!isNaN(e) && !isNaN(
|
|
912
|
-
y(this, ae, e), y(this, le,
|
|
913
|
-
const r =
|
|
906
|
+
set currentCell(n) {
|
|
907
|
+
if (!n) return;
|
|
908
|
+
y(this, lt, n), n.focus({ preventScroll: !0 });
|
|
909
|
+
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
910
|
+
if (!isNaN(e) && !isNaN(s)) {
|
|
911
|
+
y(this, ae, e), y(this, le, s);
|
|
912
|
+
const r = n.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
914
913
|
if (i) {
|
|
915
914
|
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
|
|
916
|
-
t(this, F).selection.setRange(u,
|
|
915
|
+
t(this, F).selection.setRange(u, s, u, s);
|
|
917
916
|
}
|
|
918
917
|
}
|
|
919
918
|
}
|
|
920
|
-
moveCell(
|
|
921
|
-
var m,
|
|
919
|
+
moveCell(n) {
|
|
920
|
+
var m, T, S, M;
|
|
922
921
|
if (!t(this, lt)) return;
|
|
923
|
-
const e = t(this, lt),
|
|
922
|
+
const e = t(this, lt), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = s == null ? void 0 : s.closest("tbody");
|
|
924
923
|
if (!o) return;
|
|
925
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(
|
|
924
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((B) => parseInt(B.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(s), f = r * l + (u >= 0 ? u : 0);
|
|
926
925
|
let b = f, g = i;
|
|
927
|
-
switch (
|
|
926
|
+
switch (n.code) {
|
|
928
927
|
case "Tab":
|
|
929
|
-
if (
|
|
928
|
+
if (n.preventDefault(), n.shiftKey) {
|
|
930
929
|
if (g = t(this, Bt).call(this, f, i), g < 0 && f > 0) {
|
|
931
930
|
b = f - 1;
|
|
932
931
|
const B = t(this, ct).call(this, b), z = t(this, Ot).call(this, B);
|
|
@@ -945,10 +944,10 @@ const os = class os {
|
|
|
945
944
|
g = t(this, Bt).call(this, f, i);
|
|
946
945
|
break;
|
|
947
946
|
case "ArrowDown":
|
|
948
|
-
|
|
947
|
+
n.preventDefault(), b = f + (e.rowSpan || 1);
|
|
949
948
|
break;
|
|
950
949
|
case "ArrowUp":
|
|
951
|
-
|
|
950
|
+
n.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
952
951
|
break;
|
|
953
952
|
}
|
|
954
953
|
const p = Math.floor(b / l), x = b % l;
|
|
@@ -956,8 +955,8 @@ const os = class os {
|
|
|
956
955
|
if (w)
|
|
957
956
|
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
958
957
|
else if (p !== r && p >= 0) {
|
|
959
|
-
const B = ((
|
|
960
|
-
(M = (
|
|
958
|
+
const B = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
959
|
+
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p * B), setTimeout(() => {
|
|
961
960
|
const z = t(this, Wt).call(this, p, x, g, b);
|
|
962
961
|
z && (this.currentCell = z, V(this, pt, He).call(this, z));
|
|
963
962
|
}, 0);
|
|
@@ -965,19 +964,19 @@ const os = class os {
|
|
|
965
964
|
}
|
|
966
965
|
};
|
|
967
966
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
968
|
-
He = /* @__PURE__ */ h(function(
|
|
967
|
+
He = /* @__PURE__ */ h(function(n) {
|
|
969
968
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
970
969
|
if (!e) return;
|
|
971
|
-
const
|
|
972
|
-
|
|
970
|
+
const s = n.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
971
|
+
s.top < r.top ? e.scrollTop -= r.top - s.top : s.bottom > r.bottom && (e.scrollTop += s.bottom - r.bottom), s.left < r.left ? e.scrollLeft -= r.left - s.left : s.right > r.right && (e.scrollLeft += s.right - r.right);
|
|
973
972
|
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(), Bt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
974
|
-
t(this, F).addEventListener("keydown", (
|
|
975
|
-
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
973
|
+
t(this, F).addEventListener("keydown", (n) => {
|
|
974
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.code) && this.moveCell(n);
|
|
976
975
|
});
|
|
977
976
|
}, "#initEvents"), h(os, "CellNavigation");
|
|
978
977
|
let Me = os;
|
|
979
978
|
var ce, ht, dt, zt, Pt, he, de, xt, fe, ue;
|
|
980
|
-
const
|
|
979
|
+
const Ct = class Ct extends HTMLElement {
|
|
981
980
|
constructor() {
|
|
982
981
|
super();
|
|
983
982
|
d(this, ce);
|
|
@@ -986,13 +985,13 @@ const Tt = class Tt extends HTMLElement {
|
|
|
986
985
|
d(this, zt);
|
|
987
986
|
d(this, Pt);
|
|
988
987
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
989
|
-
|
|
988
|
+
R.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
990
989
|
}, "invalidate"));
|
|
991
990
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
992
|
-
if (
|
|
991
|
+
if (R.log("sheet.generate()"), !e) return;
|
|
993
992
|
y(this, ht, Ie.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
994
|
-
const
|
|
995
|
-
|
|
993
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
994
|
+
s && i && (i.style.top = `${s.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
996
995
|
var o;
|
|
997
996
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
998
997
|
}, 0);
|
|
@@ -1002,27 +1001,27 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1002
1001
|
{ selector: ".ng-container-body", type: null },
|
|
1003
1002
|
{ selector: ".ng-container-left", type: "left" },
|
|
1004
1003
|
{ selector: ".ng-container-right", type: "right" }
|
|
1005
|
-
].forEach(({ selector:
|
|
1004
|
+
].forEach(({ selector: s, type: r }) => {
|
|
1006
1005
|
var i, o, a;
|
|
1007
|
-
(i = this.querySelector(`${
|
|
1006
|
+
(i = this.querySelector(`${s} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1008
1007
|
});
|
|
1009
1008
|
}, "#renderSplitContainers"));
|
|
1010
1009
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
1011
1010
|
["left", "right", "body"].forEach((e) => {
|
|
1012
|
-
const
|
|
1013
|
-
if (!
|
|
1011
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
1012
|
+
if (!s || !r || r.length === 0) return;
|
|
1014
1013
|
let i = 0;
|
|
1015
1014
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
1016
1015
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
1017
1016
|
isNaN(a) || (i += a);
|
|
1018
|
-
}), e === "body" ? (
|
|
1017
|
+
}), e === "body" ? (s.style.flex = "1", r.forEach((o) => {
|
|
1019
1018
|
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1020
|
-
})) : (
|
|
1019
|
+
})) : (s.style.flex = `0 0 ${i}px`, s.style.width = `${i}px`, r.forEach((o) => {
|
|
1021
1020
|
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1022
1021
|
}));
|
|
1023
1022
|
});
|
|
1024
1023
|
}, "#updateContainerWidths"));
|
|
1025
|
-
d(this, xt, /* @__PURE__ */ h((e,
|
|
1024
|
+
d(this, xt, /* @__PURE__ */ h((e, s, r) => {
|
|
1026
1025
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1027
1026
|
if (r === "header") {
|
|
1028
1027
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -1030,9 +1029,9 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1030
1029
|
u.className = "fixed-tbody", i.appendChild(u);
|
|
1031
1030
|
}
|
|
1032
1031
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1033
|
-
return
|
|
1032
|
+
return s === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1034
1033
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1035
|
-
}) :
|
|
1034
|
+
}) : s === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1036
1035
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1037
1036
|
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1038
1037
|
l.remove();
|
|
@@ -1040,18 +1039,18 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1040
1039
|
}, "#createSplitTable"));
|
|
1041
1040
|
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1042
1041
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1042
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1043
|
+
s && (s.scrollLeft = e);
|
|
1045
1044
|
}, "scrollToX"));
|
|
1046
1045
|
q(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1046
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1047
|
+
s && (s.scrollTop = e);
|
|
1049
1048
|
}, "scrollToY"));
|
|
1050
1049
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1051
1050
|
t(this, ue).call(this), y(this, zt, new Le(this)), y(this, Pt, new Me(this));
|
|
1052
1051
|
}, "#init"));
|
|
1053
1052
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1054
|
-
const e =
|
|
1053
|
+
const e = Ct.SCROLLBAR_SIZE;
|
|
1055
1054
|
this.innerHTML = `
|
|
1056
1055
|
<style>
|
|
1057
1056
|
nine-table-sheet {
|
|
@@ -1264,11 +1263,11 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1264
1263
|
return t(this, Pt);
|
|
1265
1264
|
}
|
|
1266
1265
|
disconnectedCallback() {
|
|
1267
|
-
this.innerHTML = "",
|
|
1266
|
+
this.innerHTML = "", R.log("NineTableSheet destroyed.");
|
|
1268
1267
|
}
|
|
1269
1268
|
};
|
|
1270
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), h(
|
|
1271
|
-
let Zt =
|
|
1269
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), h(Ct, "NineTableSheet"), q(Ct, "SCROLLBAR_SIZE", 16);
|
|
1270
|
+
let Zt = Ct;
|
|
1272
1271
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1273
1272
|
var ge, Ft;
|
|
1274
1273
|
const is = class is extends HTMLElement {
|
|
@@ -1276,13 +1275,13 @@ const is = class is extends HTMLElement {
|
|
|
1276
1275
|
super();
|
|
1277
1276
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1278
1277
|
var e;
|
|
1279
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1278
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1280
1279
|
var o;
|
|
1281
|
-
const r =
|
|
1280
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, i = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1282
1281
|
t(this, Ft).call(this, i, r);
|
|
1283
1282
|
}), t(this, Ft).call(this, 0, !1);
|
|
1284
1283
|
}, "#init"));
|
|
1285
|
-
d(this, Ft, /* @__PURE__ */ h((e,
|
|
1284
|
+
d(this, Ft, /* @__PURE__ */ h((e, s = !1) => {
|
|
1286
1285
|
const r = /* @__PURE__ */ h(() => {
|
|
1287
1286
|
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1288
1287
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1293,7 +1292,7 @@ const is = class is extends HTMLElement {
|
|
|
1293
1292
|
});
|
|
1294
1293
|
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1295
1294
|
if (!a[e]) return;
|
|
1296
|
-
if (!
|
|
1295
|
+
if (!s)
|
|
1297
1296
|
a.forEach((u, f) => {
|
|
1298
1297
|
u.classList.toggle("active", f === e);
|
|
1299
1298
|
}), c.forEach((u, f) => {
|
|
@@ -1323,23 +1322,23 @@ let $e = is;
|
|
|
1323
1322
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1324
1323
|
var _, be, jt, pe;
|
|
1325
1324
|
const as = class as {
|
|
1326
|
-
constructor(
|
|
1325
|
+
constructor(n) {
|
|
1327
1326
|
d(this, _);
|
|
1328
1327
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1329
|
-
t(this, pe).call(this), new ResizeObserver((
|
|
1330
|
-
for (let e of
|
|
1328
|
+
t(this, pe).call(this), new ResizeObserver((n) => {
|
|
1329
|
+
for (let e of n)
|
|
1331
1330
|
t(this, _).getAttribute("auto-height") === "true" && t(this, jt).call(this);
|
|
1332
1331
|
}).observe(t(this, _));
|
|
1333
1332
|
}, "#init"));
|
|
1334
1333
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1335
1334
|
var c, l;
|
|
1336
|
-
const
|
|
1337
|
-
if (
|
|
1338
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10,
|
|
1335
|
+
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1336
|
+
if (n.length === 0) return;
|
|
1337
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * s + r + i + o;
|
|
1339
1338
|
t(this, _).style.height = `${a}px`;
|
|
1340
1339
|
}, "#applyAutoHeight"));
|
|
1341
1340
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1342
|
-
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"),
|
|
1341
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1343
1342
|
const f = `<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>` : "";
|
|
1344
1343
|
return f + b;
|
|
1345
1344
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
@@ -1350,7 +1349,7 @@ const as = class as {
|
|
|
1350
1349
|
flex-direction: column;
|
|
1351
1350
|
position: relative;
|
|
1352
1351
|
overflow: hidden;
|
|
1353
|
-
height: ${
|
|
1352
|
+
height: ${s ? "auto" : "100%"};
|
|
1354
1353
|
background: #fff;
|
|
1355
1354
|
}
|
|
1356
1355
|
|
|
@@ -1467,28 +1466,28 @@ const as = class as {
|
|
|
1467
1466
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1468
1467
|
a == null || a.forEach((c, l) => {
|
|
1469
1468
|
e[l] && setTimeout(() => {
|
|
1470
|
-
c.generate(e[l]),
|
|
1469
|
+
c.generate(e[l]), s && t(this, jt).call(this);
|
|
1471
1470
|
});
|
|
1472
1471
|
});
|
|
1473
1472
|
}, "#render"));
|
|
1474
|
-
y(this, _,
|
|
1473
|
+
y(this, _, n), t(this, be).call(this);
|
|
1475
1474
|
}
|
|
1476
1475
|
};
|
|
1477
1476
|
_ = new WeakMap(), be = new WeakMap(), jt = new WeakMap(), pe = new WeakMap(), h(as, "LayoutManager");
|
|
1478
1477
|
let Ne = as;
|
|
1479
1478
|
var Yt, wt;
|
|
1480
1479
|
const ls = class ls {
|
|
1481
|
-
constructor(
|
|
1480
|
+
constructor(n) {
|
|
1482
1481
|
d(this, Yt);
|
|
1483
1482
|
d(this, wt, -1);
|
|
1484
1483
|
q(this, "count", /* @__PURE__ */ h(() => t(this, Yt).rawRecords.length, "count"));
|
|
1485
|
-
y(this, Yt,
|
|
1484
|
+
y(this, Yt, n);
|
|
1486
1485
|
}
|
|
1487
1486
|
get at() {
|
|
1488
1487
|
return t(this, wt);
|
|
1489
1488
|
}
|
|
1490
|
-
set at(
|
|
1491
|
-
y(this, wt, parseInt(
|
|
1489
|
+
set at(n) {
|
|
1490
|
+
y(this, wt, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1492
1491
|
});
|
|
1493
1492
|
}
|
|
1494
1493
|
};
|
|
@@ -1496,7 +1495,7 @@ Yt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
|
1496
1495
|
let _e = ls;
|
|
1497
1496
|
var D, I, W, vt, ye, J, me, ft, Vt, xe, we, St;
|
|
1498
1497
|
const P = class P {
|
|
1499
|
-
constructor(
|
|
1498
|
+
constructor(n, e) {
|
|
1500
1499
|
d(this, D);
|
|
1501
1500
|
d(this, I);
|
|
1502
1501
|
d(this, W, []);
|
|
@@ -1505,35 +1504,35 @@ const P = class P {
|
|
|
1505
1504
|
d(this, J, []);
|
|
1506
1505
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1507
1506
|
y(this, J, []);
|
|
1508
|
-
const
|
|
1509
|
-
Array.from(
|
|
1510
|
-
var
|
|
1511
|
-
t(this, J).push(((
|
|
1507
|
+
const n = t(this, D).template || [];
|
|
1508
|
+
Array.from(n).forEach((e) => {
|
|
1509
|
+
var s;
|
|
1510
|
+
t(this, J).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1512
1511
|
}), (t(this, I).rawRecords || []).forEach((e) => {
|
|
1513
1512
|
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, J).slice();
|
|
1514
1513
|
});
|
|
1515
1514
|
}, "#initialize"));
|
|
1516
1515
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1516
|
+
const n = t(this, D).shadowRoot.querySelector("nine-table-sheets");
|
|
1517
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1519
1518
|
e.invalidate();
|
|
1520
1519
|
});
|
|
1521
1520
|
}, "#invalidate"));
|
|
1522
|
-
q(this, "get", /* @__PURE__ */ h((
|
|
1521
|
+
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1523
1522
|
var i;
|
|
1524
|
-
const
|
|
1525
|
-
if (!
|
|
1526
|
-
if (
|
|
1527
|
-
if (
|
|
1523
|
+
const s = this.getValidData();
|
|
1524
|
+
if (!s || s.length <= 0) return;
|
|
1525
|
+
if (n == null) return t(this, St).call(this, s);
|
|
1526
|
+
if (n < 0 || n >= s.length) return null;
|
|
1528
1527
|
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1529
1528
|
if (e != null) {
|
|
1530
1529
|
const o = r.indexOf(e);
|
|
1531
|
-
return o >= 0 ? n
|
|
1530
|
+
return o >= 0 ? s[n].v[o] : null;
|
|
1532
1531
|
}
|
|
1533
|
-
return t(this, St).call(this, n
|
|
1532
|
+
return t(this, St).call(this, s[n]);
|
|
1534
1533
|
}, "get"));
|
|
1535
|
-
q(this, "set", /* @__PURE__ */ h((
|
|
1536
|
-
this.clear(), this.add(
|
|
1534
|
+
q(this, "set", /* @__PURE__ */ h((n) => {
|
|
1535
|
+
this.clear(), this.add(n, !1), t(this, ft).call(this);
|
|
1537
1536
|
}, "set"));
|
|
1538
1537
|
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1539
1538
|
rowState: P.ROW_STATE.EMPTY,
|
|
@@ -1548,66 +1547,66 @@ const P = class P {
|
|
|
1548
1547
|
y(this, W, []), y(this, vt, []), t(this, ft).call(this);
|
|
1549
1548
|
}, "reset"));
|
|
1550
1549
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1551
|
-
var
|
|
1552
|
-
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (
|
|
1550
|
+
var n;
|
|
1551
|
+
t(this, I).rawRecords = [], y(this, W, []), y(this, vt, []), (n = t(this, I).viewRecords) != null && n.reset && t(this, I).viewRecords.reset();
|
|
1553
1552
|
}, "clear"));
|
|
1554
|
-
d(this, xe, /* @__PURE__ */ h((
|
|
1553
|
+
d(this, xe, /* @__PURE__ */ h((n) => {
|
|
1555
1554
|
var r;
|
|
1556
|
-
Array.isArray(
|
|
1557
|
-
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(
|
|
1558
|
-
return
|
|
1555
|
+
Array.isArray(n) || (n = [n]);
|
|
1556
|
+
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1557
|
+
return n.forEach((i) => {
|
|
1559
1558
|
const o = { v: [] };
|
|
1560
1559
|
e.forEach((a) => {
|
|
1561
1560
|
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1562
|
-
}),
|
|
1563
|
-
}),
|
|
1561
|
+
}), s.push(o);
|
|
1562
|
+
}), s;
|
|
1564
1563
|
}, "#json2Array"));
|
|
1565
|
-
d(this, we, /* @__PURE__ */ h((
|
|
1564
|
+
d(this, we, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1566
1565
|
e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1567
|
-
}),
|
|
1568
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1569
|
-
|
|
1570
|
-
const
|
|
1571
|
-
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this,
|
|
1566
|
+
}), n), "#defaultInsert"));
|
|
1567
|
+
q(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1568
|
+
n === void 0 && (n = {});
|
|
1569
|
+
const s = t(this, xe).call(this, n);
|
|
1570
|
+
t(this, I).rawRecords = t(this, I).rawRecords.concat(t(this, we).call(this, s)), this.resetRecords();
|
|
1572
1571
|
const r = this.count() - 1;
|
|
1573
|
-
return e ||
|
|
1572
|
+
return e || s.forEach((i, o) => {
|
|
1574
1573
|
const a = t(this, I).rawRecords[r - o];
|
|
1575
1574
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1576
1575
|
}), t(this, ft).call(this), r;
|
|
1577
1576
|
}, "add"));
|
|
1578
|
-
q(this, "delete", /* @__PURE__ */ h((
|
|
1577
|
+
q(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1579
1578
|
let e = [];
|
|
1580
|
-
Array.isArray(
|
|
1581
|
-
if (t(this, W)[
|
|
1582
|
-
const r = t(this, W)[
|
|
1583
|
-
t(this, W)[
|
|
1579
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, I).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1580
|
+
if (t(this, W)[s]) {
|
|
1581
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1582
|
+
t(this, W)[s].__ng.rowState === P.ROW_STATE.INSERT ? t(this, I).rawRecords = t(this, I).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, I).rawRecords.forEach((i) => {
|
|
1584
1583
|
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1585
1584
|
});
|
|
1586
1585
|
}
|
|
1587
1586
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
1588
1587
|
}, "delete"));
|
|
1589
|
-
q(this, "setValue", /* @__PURE__ */ h((
|
|
1588
|
+
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1590
1589
|
var c;
|
|
1591
|
-
|
|
1590
|
+
n = parseInt(n, 10);
|
|
1592
1591
|
const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1593
1592
|
if (i < 0) return;
|
|
1594
|
-
const o = this.getValidData()[
|
|
1593
|
+
const o = this.getValidData()[n];
|
|
1595
1594
|
if (!o) return;
|
|
1596
1595
|
const a = o.v[i];
|
|
1597
|
-
a !==
|
|
1596
|
+
a !== s && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = s;
|
|
1598
1597
|
}, "setValue"));
|
|
1599
1598
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1600
|
-
y(this, vt, t(this, I).rawRecords.filter((
|
|
1601
|
-
|
|
1602
|
-
}), t(this, W).forEach((
|
|
1603
|
-
|
|
1599
|
+
y(this, vt, t(this, I).rawRecords.filter((n) => !n.__ng.deleted)), y(this, W, t(this, I).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, I).rawRecords.forEach((n, e) => {
|
|
1600
|
+
n.__ng.rowidx = e;
|
|
1601
|
+
}), t(this, W).forEach((n, e) => {
|
|
1602
|
+
n.__ng.i = e;
|
|
1604
1603
|
});
|
|
1605
1604
|
}, "resetRecords"));
|
|
1606
1605
|
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, I).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1607
|
-
d(this, St, /* @__PURE__ */ h((
|
|
1606
|
+
d(this, St, /* @__PURE__ */ h((n) => {
|
|
1608
1607
|
var o;
|
|
1609
|
-
if (!
|
|
1610
|
-
const e = !Array.isArray(
|
|
1608
|
+
if (!n) return n;
|
|
1609
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1611
1610
|
const c = {};
|
|
1612
1611
|
return r.forEach((l, u) => {
|
|
1613
1612
|
c[l] = a.v ? a.v[u] : a[l];
|
|
@@ -1616,13 +1615,13 @@ const P = class P {
|
|
|
1616
1615
|
return e ? i[0] : i;
|
|
1617
1616
|
}, "#conv"));
|
|
1618
1617
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1619
|
-
y(this, D,
|
|
1618
|
+
y(this, D, n), y(this, I, e), t(this, me).call(this);
|
|
1620
1619
|
}
|
|
1621
1620
|
get source() {
|
|
1622
1621
|
return t(this, St).call(this, t(this, I).rawRecords);
|
|
1623
1622
|
}
|
|
1624
|
-
set source(
|
|
1625
|
-
this.clear(), this.add(
|
|
1623
|
+
set source(n) {
|
|
1624
|
+
this.clear(), this.add(n, !1);
|
|
1626
1625
|
}
|
|
1627
1626
|
get nextId() {
|
|
1628
1627
|
return ++xs(this, ye)._;
|
|
@@ -1648,22 +1647,22 @@ q(P, "ROW_STATE", {
|
|
|
1648
1647
|
let Oe = P;
|
|
1649
1648
|
var ut;
|
|
1650
1649
|
const cs = class cs {
|
|
1651
|
-
constructor(
|
|
1650
|
+
constructor(n) {
|
|
1652
1651
|
d(this, ut);
|
|
1653
|
-
y(this, ut,
|
|
1652
|
+
y(this, ut, n), this.row = new _e(this), this.data = new Oe(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1654
1653
|
var e;
|
|
1655
1654
|
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1656
1655
|
}, this.setDataSource = (e) => {
|
|
1657
1656
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1658
1657
|
}, this.getRowState = (e) => {
|
|
1659
1658
|
var r, i;
|
|
1660
|
-
const
|
|
1661
|
-
if (!(
|
|
1662
|
-
return (i = (r = this.data.getValidData()[
|
|
1659
|
+
const s = parseInt(e, 10);
|
|
1660
|
+
if (!(s >= this.data.count()))
|
|
1661
|
+
return (i = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1663
1662
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1664
1663
|
this.row.at = e;
|
|
1665
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e,
|
|
1666
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1664
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1665
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1667
1666
|
}, this.setDataSource([]);
|
|
1668
1667
|
}
|
|
1669
1668
|
};
|
|
@@ -1672,31 +1671,31 @@ let De = cs;
|
|
|
1672
1671
|
var Rt, H, Ut, ve;
|
|
1673
1672
|
const hs = class hs {
|
|
1674
1673
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1675
|
-
constructor(
|
|
1674
|
+
constructor(n) {
|
|
1676
1675
|
d(this, Rt);
|
|
1677
1676
|
d(this, H, []);
|
|
1678
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1679
|
-
|
|
1680
|
-
t(this, H).some((r) => r.name ===
|
|
1677
|
+
q(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1678
|
+
n.forEach((s) => {
|
|
1679
|
+
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1681
1680
|
}), t(this, Ut).call(this);
|
|
1682
1681
|
}, "add"));
|
|
1683
1682
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
1684
|
-
const
|
|
1683
|
+
const n = /* @__PURE__ */ new Map();
|
|
1685
1684
|
t(this, H).forEach((e) => {
|
|
1686
|
-
|
|
1687
|
-
}), y(this, H, Array.from(
|
|
1685
|
+
n.set(e.name, e.type);
|
|
1686
|
+
}), y(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1688
1687
|
}, "#adjust"));
|
|
1689
1688
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1690
|
-
y(this, H, []),
|
|
1691
|
-
const
|
|
1692
|
-
if (!(!
|
|
1693
|
-
for (const e of
|
|
1694
|
-
|
|
1689
|
+
y(this, H, []), R.log(t(this, Rt).querySelectorAll("table"));
|
|
1690
|
+
const n = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1691
|
+
if (!(!n || n.length === 0)) {
|
|
1692
|
+
for (const e of n)
|
|
1693
|
+
R.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1695
1694
|
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1696
1695
|
i && t(this, H).push({ name: i, type: o });
|
|
1697
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1698
|
-
$(`[${
|
|
1699
|
-
var o = i.getAttribute(
|
|
1696
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1697
|
+
$(`[${s}]`, e).each((r, i) => {
|
|
1698
|
+
var o = i.getAttribute(s);
|
|
1700
1699
|
if (o.indexOf("data.") < 0) {
|
|
1701
1700
|
const a = o.search(/[(]/g);
|
|
1702
1701
|
if (a > 0)
|
|
@@ -1718,26 +1717,26 @@ const hs = class hs {
|
|
|
1718
1717
|
t(this, Ut).call(this);
|
|
1719
1718
|
}
|
|
1720
1719
|
}, "#init"));
|
|
1721
|
-
y(this, Rt,
|
|
1720
|
+
y(this, Rt, n), t(this, ve).call(this);
|
|
1722
1721
|
}
|
|
1723
1722
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1724
1723
|
get() {
|
|
1725
|
-
return t(this, H).map((
|
|
1724
|
+
return t(this, H).map((n) => n.name);
|
|
1726
1725
|
}
|
|
1727
1726
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1728
1727
|
getFields() {
|
|
1729
1728
|
return t(this, H);
|
|
1730
1729
|
}
|
|
1731
1730
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1732
|
-
getType(
|
|
1733
|
-
const e = t(this, H).find((
|
|
1731
|
+
getType(n) {
|
|
1732
|
+
const e = t(this, H).find((s) => s.name === n);
|
|
1734
1733
|
return e ? e.type : "string";
|
|
1735
1734
|
}
|
|
1736
|
-
indexOf(
|
|
1737
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1735
|
+
indexOf(n) {
|
|
1736
|
+
return t(this, H).findIndex((e) => e.name === n);
|
|
1738
1737
|
}
|
|
1739
|
-
includes(
|
|
1740
|
-
return t(this, H).some((e) => e.name ===
|
|
1738
|
+
includes(n) {
|
|
1739
|
+
return t(this, H).some((e) => e.name === n);
|
|
1741
1740
|
}
|
|
1742
1741
|
};
|
|
1743
1742
|
Rt = new WeakMap(), H = new WeakMap(), Ut = new WeakMap(), ve = new WeakMap(), h(hs, "ngFields");
|
|
@@ -1750,7 +1749,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1750
1749
|
d(this, gt);
|
|
1751
1750
|
d(this, Se);
|
|
1752
1751
|
d(this, Re, /* @__PURE__ */ h(() => {
|
|
1753
|
-
this.fields = new Be(this), y(this, Se, new Ne(this)),
|
|
1752
|
+
this.fields = new Be(this), y(this, Se, new Ne(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1754
1753
|
}, "#init"));
|
|
1755
1754
|
this.attachShadow({ mode: "open" }), y(this, gt, new De(this));
|
|
1756
1755
|
}
|
|
@@ -1758,7 +1757,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1758
1757
|
t(this, Re).call(this);
|
|
1759
1758
|
}
|
|
1760
1759
|
disconnectedCallback() {
|
|
1761
|
-
|
|
1760
|
+
R.log("NineTable disconnected.");
|
|
1762
1761
|
}
|
|
1763
1762
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1764
1763
|
get data() {
|
|
@@ -1776,7 +1775,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1776
1775
|
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1777
1776
|
let We = ds;
|
|
1778
1777
|
customElements.get("nine-table") || customElements.define("nine-table", We);
|
|
1779
|
-
const
|
|
1778
|
+
const Tt = class Tt extends HTMLElement {
|
|
1780
1779
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1781
1780
|
constructor() {
|
|
1782
1781
|
super();
|
|
@@ -1787,8 +1786,8 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1787
1786
|
connectedCallback() {
|
|
1788
1787
|
}
|
|
1789
1788
|
};
|
|
1790
|
-
h(
|
|
1791
|
-
let ze =
|
|
1789
|
+
h(Tt, "BasicCellElement"), q(Tt, "_styleCache", /* @__PURE__ */ new Map()), q(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1790
|
+
let ze = Tt;
|
|
1792
1791
|
var L, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1793
1792
|
const fs = class fs extends ze {
|
|
1794
1793
|
constructor() {
|
|
@@ -1803,15 +1802,15 @@ const fs = class fs extends ze {
|
|
|
1803
1802
|
q(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1804
1803
|
if (t(this, v))
|
|
1805
1804
|
if (t(this, v).closest("tbody")) {
|
|
1806
|
-
const
|
|
1807
|
-
if (!
|
|
1805
|
+
const s = t(this, v).closest("tr").data, r = parseInt(t(this, v).dataset.row);
|
|
1806
|
+
if (!s) return "";
|
|
1808
1807
|
if (ninegrid.isNull(t(this, v).dataset.expr)) {
|
|
1809
1808
|
if (!ninegrid.isNull(t(this, v).dataset.bind))
|
|
1810
|
-
return
|
|
1809
|
+
return s[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
|
|
1811
1810
|
} else try {
|
|
1812
|
-
return this.getExprValue(t(this, v).dataset.expr,
|
|
1811
|
+
return this.getExprValue(t(this, v).dataset.expr, s, r, t(this, v));
|
|
1813
1812
|
} catch {
|
|
1814
|
-
console.error(t(this, v).dataset.expr,
|
|
1813
|
+
console.error(t(this, v).dataset.expr, s, t(this, v).dataset.row);
|
|
1815
1814
|
}
|
|
1816
1815
|
return ninegrid.nvl(e, "");
|
|
1817
1816
|
} else
|
|
@@ -1824,13 +1823,13 @@ const fs = class fs extends ze {
|
|
|
1824
1823
|
if (!(!t(this, L) || !t(this, L).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1825
1824
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1826
1825
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1827
|
-
var
|
|
1828
|
-
$("th,td",
|
|
1829
|
-
var
|
|
1830
|
-
|
|
1826
|
+
var s = t(this, v).closest("tr"), r = [];
|
|
1827
|
+
$("th,td", s).each((m, T) => {
|
|
1828
|
+
var S = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1829
|
+
S && T.dataset.row && (S = parseInt(S), !isNaN(S) && S <= e && r.push(S));
|
|
1831
1830
|
}), r.sort();
|
|
1832
1831
|
var i = !1;
|
|
1833
|
-
if (parseInt(
|
|
1832
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1834
1833
|
for (var o of r) {
|
|
1835
1834
|
if (o > e) break;
|
|
1836
1835
|
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, L).data.get(c);
|
|
@@ -1849,12 +1848,12 @@ const fs = class fs extends ze {
|
|
|
1849
1848
|
}
|
|
1850
1849
|
}
|
|
1851
1850
|
}, "#resetSuppress"));
|
|
1852
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1851
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, i) => {
|
|
1853
1852
|
if (typeof e < "u")
|
|
1854
1853
|
try {
|
|
1855
1854
|
r = parseInt(r);
|
|
1856
1855
|
const o = e.replace("()", "");
|
|
1857
|
-
return t(this, L)[o] ? t(this, L)[o].call(this,
|
|
1856
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, v)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1858
1857
|
} catch {
|
|
1859
1858
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1860
1859
|
}
|
|
@@ -1870,9 +1869,9 @@ const fs = class fs extends ze {
|
|
|
1870
1869
|
return e ?? "";
|
|
1871
1870
|
}
|
|
1872
1871
|
set value(e) {
|
|
1873
|
-
var
|
|
1872
|
+
var s = parseInt(t(this, v).dataset.row);
|
|
1874
1873
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1875
|
-
|
|
1874
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, v).dataset.bind, e, r);
|
|
1876
1875
|
}
|
|
1877
1876
|
get row() {
|
|
1878
1877
|
return parseInt(t(this, v).dataset.row);
|
|
@@ -1949,10 +1948,10 @@ const gs = class gs extends Fe {
|
|
|
1949
1948
|
if (t(this, bt) == "number") {
|
|
1950
1949
|
let i = [];
|
|
1951
1950
|
if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1952
|
-
var
|
|
1951
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1953
1952
|
if (r >= 0) {
|
|
1954
|
-
var
|
|
1955
|
-
|
|
1953
|
+
var s = s.substr(r + 1, s.length);
|
|
1954
|
+
s.length >= Number(t(this, Q)) && e.preventDefault();
|
|
1956
1955
|
}
|
|
1957
1956
|
}
|
|
1958
1957
|
}
|
|
@@ -1962,8 +1961,8 @@ const gs = class gs extends Fe {
|
|
|
1962
1961
|
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this, Q, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1963
1962
|
}
|
|
1964
1963
|
connectedCallback() {
|
|
1965
|
-
for (var e = [],
|
|
1966
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1964
|
+
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
1965
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
|
|
1967
1966
|
this.innerHTML = `
|
|
1968
1967
|
<input type="text"
|
|
1969
1968
|
${e.join(" ")}
|