@ninebone/table 0.0.531 β 0.0.533
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 +277 -274
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,16 +2,16 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (R,
|
|
6
|
-
var h = (R,
|
|
7
|
-
var A = (R,
|
|
8
|
-
var t = (R,
|
|
9
|
-
var Ue = (R,
|
|
10
|
-
set _(
|
|
11
|
-
y(R,
|
|
5
|
+
var Xe = (R, r, e) => r in R ? Fe(R, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[r] = e;
|
|
6
|
+
var h = (R, r) => Fe(R, "name", { value: r, configurable: !0 });
|
|
7
|
+
var A = (R, r, e) => Xe(R, typeof r != "symbol" ? r + "" : r, e), Ye = (R, r, e) => r.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, r, e) => (Ye(R, r, "read from private field"), e ? e.call(R) : r.get(R)), d = (R, r, e) => r.has(R) ? Ve("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(R) : r.set(R, e), y = (R, r, e, s) => (Ye(R, r, "write to private field"), s ? s.call(R, e) : r.set(R, e), e);
|
|
9
|
+
var Ue = (R, r, e, s) => ({
|
|
10
|
+
set _(i) {
|
|
11
|
+
y(R, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -44,14 +44,14 @@ const Me = class Me extends HTMLElement {
|
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const i = t(this, w).track, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth, l = s.scrollWidth;
|
|
48
48
|
if (o !== 0 && l > o)
|
|
49
49
|
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const c =
|
|
54
|
+
const c = i.clientWidth;
|
|
55
55
|
if (c <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(c * (o / l), c), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
@@ -63,43 +63,43 @@ const Me = class Me extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
|
+
if (!i) return !1;
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
69
|
let o = e;
|
|
70
70
|
o < 0 && (o = 0);
|
|
71
71
|
const l = n.width - a;
|
|
72
72
|
o > l && (o = l), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= l - 1;
|
|
73
|
-
const c = s.clientWidth, u =
|
|
73
|
+
const c = s.clientWidth, u = i.scrollWidth - c;
|
|
74
74
|
return l > 0 && u > 0 && (s.scrollLeft = o / l * u), o > 0 && o < l - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
77
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + i), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, a +
|
|
83
|
+
t(this, G).call(this, a + i) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
|
+
t(this, w).left.addEventListener(i, s), t(this, w).right.addEventListener(i, s), t(this, w).track.addEventListener(i, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (i) => {
|
|
92
|
+
i.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (i) => {
|
|
94
|
+
i.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (i) => {
|
|
96
|
+
if (i.button !== 0) return;
|
|
97
|
+
i.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
t(this, G).call(this, i.clientX - n.left - a / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
|
+
if (i.button !== 0) return;
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), y(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const l = t(this, w).track.getBoundingClientRect();
|
|
@@ -201,7 +201,7 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let le = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
-
var F, ot, J, q,
|
|
204
|
+
var F, ot, J, q, vt, wt, Wt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -209,26 +209,26 @@ const $e = class $e extends HTMLElement {
|
|
|
209
209
|
d(this, ot);
|
|
210
210
|
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
|
-
d(this, xt, 0);
|
|
213
212
|
d(this, vt, 0);
|
|
213
|
+
d(this, wt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
216
|
H.log("nine-table-vscrollbar.refresh");
|
|
217
|
-
const e = t(this, q).container, s = t(this, q).track,
|
|
217
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, l = t(this, ot).getRowHeight(), c = o * l;
|
|
218
218
|
if (c <= n) {
|
|
219
|
-
|
|
219
|
+
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
220
220
|
return;
|
|
221
221
|
} else
|
|
222
|
-
|
|
222
|
+
i.style.display = "block";
|
|
223
223
|
const f = s.clientHeight;
|
|
224
224
|
if (f <= 0) return;
|
|
225
225
|
const u = Math.max(Math.min(f * (n / c), f), 20);
|
|
226
|
-
|
|
226
|
+
i.style.height = `${u}px`;
|
|
227
227
|
const g = e.scrollTop, b = Math.max(c - n, 1);
|
|
228
228
|
let m = 0;
|
|
229
229
|
b > 0 && (m = g / b * (f - u));
|
|
230
230
|
const v = f - u;
|
|
231
|
-
m < 0 && (m = 0), m > v && (m = v),
|
|
231
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
234
234
|
H.log("nine-table-vscrollbar.#init");
|
|
@@ -238,15 +238,15 @@ const $e = class $e extends HTMLElement {
|
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
e.addEventListener("scroll", () => {
|
|
240
240
|
t(this, J) || this.refresh();
|
|
241
|
-
}), t(this, q).thumb.addEventListener("mousedown", (
|
|
242
|
-
if (
|
|
243
|
-
|
|
241
|
+
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
242
|
+
if (i.button !== 0) return;
|
|
243
|
+
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this, vt, i.clientY), y(this, wt, e.scrollTop);
|
|
244
244
|
const n = /* @__PURE__ */ h((o) => {
|
|
245
245
|
if (!t(this, J)) return;
|
|
246
|
-
const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = o.clientY - t(this,
|
|
246
|
+
const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = o.clientY - t(this, vt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
248
|
const E = g / u * v;
|
|
249
|
-
let x = t(this,
|
|
249
|
+
let x = t(this, wt) + E;
|
|
250
250
|
const M = Math.max(0, m - b);
|
|
251
251
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
252
252
|
}
|
|
@@ -255,9 +255,9 @@ const $e = class $e extends HTMLElement {
|
|
|
255
255
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
256
256
|
}, "onMouseUp");
|
|
257
257
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
|
-
}), t(this, q).track.addEventListener("mousedown", (
|
|
259
|
-
if (
|
|
260
|
-
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o =
|
|
258
|
+
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
259
|
+
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
260
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = i.clientY - n.top - a / 2, c = n.height - a, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
261
261
|
if (c > 0 && g > 0) {
|
|
262
262
|
const b = Math.max(0, Math.min(1, o / c));
|
|
263
263
|
e.scrollTop = b * g;
|
|
@@ -352,31 +352,32 @@ const $e = class $e extends HTMLElement {
|
|
|
352
352
|
e();
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(),
|
|
355
|
+
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
356
356
|
let ce = $e;
|
|
357
357
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
358
|
-
var P, S,
|
|
358
|
+
var P, S, at, D, I, V, Q, St, Ee, lt, Ot, Bt, zt, Et, At, Dt, Pt, Rt, Ae, ct, qt, jt;
|
|
359
359
|
const Ie = class Ie {
|
|
360
|
-
constructor(
|
|
360
|
+
constructor(r) {
|
|
361
361
|
d(this, P);
|
|
362
362
|
d(this, S);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, at);
|
|
364
364
|
d(this, D, /* @__PURE__ */ new Map());
|
|
365
365
|
d(this, I, null);
|
|
366
366
|
d(this, V, null);
|
|
367
367
|
d(this, Q, 0);
|
|
368
368
|
d(this, St, 40);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
|
-
d(this,
|
|
370
|
+
d(this, lt, !1);
|
|
371
371
|
d(this, Ot, 3);
|
|
372
372
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
H.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
r && (t(this, Et).call(this), t(this, ct).call(this, r.scrollTop));
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
H.log("rowManager.initialize"), y(this,
|
|
379
|
-
scrollTables: t(this, S).querySelectorAll(".ng-part-body table")
|
|
378
|
+
H.log("rowManager.initialize"), y(this, at, {
|
|
379
|
+
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
|
+
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
380
381
|
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
381
382
|
const o = t(this, S).querySelector(a);
|
|
382
383
|
if (!o) return;
|
|
@@ -387,50 +388,50 @@ const Ie = class Ie {
|
|
|
387
388
|
const u = Array.from(c.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
388
389
|
t(this, D).set(a, u);
|
|
389
390
|
});
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
t(this, zt).call(this,
|
|
391
|
+
const r = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (r) {
|
|
393
|
+
t(this, zt).call(this, r), t(this, Rt).call(this), t(this, Et).call(this), t(this, ct).call(this, r.scrollTop);
|
|
393
394
|
let a = !1;
|
|
394
395
|
const o = /* @__PURE__ */ h((l, c, f) => {
|
|
395
396
|
var u;
|
|
396
|
-
a || (a = !0,
|
|
397
|
+
a || (a = !0, r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== c && (i.scrollLeft = c), n && n.scrollLeft !== c && (n.scrollLeft = c), t(this, ct).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), a = !1);
|
|
397
398
|
}, "syncScroll");
|
|
398
|
-
[
|
|
399
|
+
[r, e, s].forEach((l) => {
|
|
399
400
|
l && l.addEventListener("scroll", () => {
|
|
400
|
-
t(this,
|
|
401
|
-
o(l.scrollTop, l.scrollLeft), y(this,
|
|
401
|
+
t(this, lt) || (y(this, lt, !0), requestAnimationFrame(() => {
|
|
402
|
+
o(l.scrollTop, l.scrollLeft), y(this, lt, !1);
|
|
402
403
|
}));
|
|
403
404
|
});
|
|
404
405
|
});
|
|
405
406
|
}
|
|
406
407
|
}, "initialize"));
|
|
407
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
408
|
+
d(this, Bt, /* @__PURE__ */ h((r, e) => {
|
|
408
409
|
H.log("rowManager.#renderRows");
|
|
409
410
|
const s = t(this, D).get(e);
|
|
410
411
|
if (!s || s.length === 0) return;
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
|
|
414
|
-
const n =
|
|
412
|
+
const i = r.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
413
|
+
if (!i) return;
|
|
414
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
415
|
+
const n = i.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
415
416
|
for (let o = 0; o < t(this, St); o++)
|
|
416
417
|
s.forEach((l) => {
|
|
417
418
|
a.appendChild(l.cloneNode(!0));
|
|
418
419
|
});
|
|
419
|
-
n ? n.before(a) :
|
|
420
|
+
n ? n.before(a) : i.appendChild(a);
|
|
420
421
|
}, "#renderRows"));
|
|
421
|
-
d(this, zt, /* @__PURE__ */ h((
|
|
422
|
+
d(this, zt, /* @__PURE__ */ h((r) => {
|
|
422
423
|
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
423
424
|
return t(this, I);
|
|
424
425
|
H.log("#measureAndCacheHeight");
|
|
425
426
|
const e = t(this, D).get(".ng-container-body");
|
|
426
427
|
if (!e || e.length === 0) return 24;
|
|
427
|
-
const s =
|
|
428
|
+
const s = r.querySelector("tbody.bindable-tbody");
|
|
428
429
|
if (!s) return 24;
|
|
429
430
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
430
|
-
const
|
|
431
|
+
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
431
432
|
e.forEach((g) => {
|
|
432
433
|
n.appendChild(g.cloneNode(!0));
|
|
433
|
-
}),
|
|
434
|
+
}), i ? i.before(n) : s.appendChild(n);
|
|
434
435
|
const a = t(this, S), o = a.style.display, l = a.style.visibility, c = a.style.position;
|
|
435
436
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
436
437
|
let f = 0;
|
|
@@ -441,25 +442,25 @@ const Ie = class Ie {
|
|
|
441
442
|
}, "#measureAndCacheHeight"));
|
|
442
443
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
443
444
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
444
|
-
const e = (t(this, P).data.get() || []).length, s = t(this, I),
|
|
445
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
445
446
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
446
447
|
const a = t(this, S).querySelector(n);
|
|
447
448
|
if (!a) return;
|
|
448
449
|
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
449
|
-
o && (o.style.height = `${
|
|
450
|
+
o && (o.style.height = `${i}px`);
|
|
450
451
|
});
|
|
451
452
|
}, "#updateVirtualScrollHeight"));
|
|
452
453
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
453
454
|
if (t(this, Q) > 0 && t(this, I) > 0) {
|
|
454
|
-
const
|
|
455
|
-
y(this, St,
|
|
455
|
+
const r = Math.ceil(t(this, Q) / t(this, I));
|
|
456
|
+
y(this, St, r + t(this, Ot));
|
|
456
457
|
}
|
|
457
458
|
}, "#updateRowCount"));
|
|
458
459
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
459
460
|
var o, l, c, f, u, g;
|
|
460
|
-
const
|
|
461
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
461
462
|
if (e) {
|
|
462
|
-
const b =
|
|
463
|
+
const b = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
463
464
|
for (let x = 0; x < E; x++) {
|
|
464
465
|
const M = [
|
|
465
466
|
((o = b[x]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
@@ -469,9 +470,9 @@ const Ie = class Ie {
|
|
|
469
470
|
k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
470
471
|
}
|
|
471
472
|
}
|
|
472
|
-
const
|
|
473
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
473
474
|
if (n) {
|
|
474
|
-
const b =
|
|
475
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, v.length);
|
|
475
476
|
for (let x = 0; x < E; x++) {
|
|
476
477
|
const M = [
|
|
477
478
|
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
@@ -483,37 +484,37 @@ const Ie = class Ie {
|
|
|
483
484
|
}
|
|
484
485
|
}, "#syncRowHeights"));
|
|
485
486
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
486
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((
|
|
487
|
-
for (const e of
|
|
487
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((r) => {
|
|
488
|
+
for (const e of r) {
|
|
488
489
|
const s = e.target;
|
|
489
490
|
if (!s.classList.contains("active")) continue;
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
491
|
+
const i = e.contentRect.height;
|
|
492
|
+
if (i > 0) {
|
|
492
493
|
let n = 0;
|
|
493
494
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
494
495
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
495
|
-
const l = Math.max(
|
|
496
|
+
const l = Math.max(i - n, 100);
|
|
496
497
|
t(this, Q) !== l && (y(this, Q, l), t(this, At).call(this), t(this, I) !== null && (t(this, Rt).call(this), this.refresh()));
|
|
497
498
|
}
|
|
498
499
|
}
|
|
499
500
|
})), t(this, V).observe(t(this, S)));
|
|
500
501
|
}, "#initResizeObserver"));
|
|
501
502
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
502
|
-
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
503
|
-
const e = t(this, S).querySelector(
|
|
504
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e,
|
|
503
|
+
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
504
|
+
const e = t(this, S).querySelector(r);
|
|
505
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, r);
|
|
505
506
|
}), t(this, jt).call(this), t(this, Dt).call(this);
|
|
506
507
|
}, "#renderAllContainers"));
|
|
507
|
-
d(this, Ae, /* @__PURE__ */ h((
|
|
508
|
+
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
508
509
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
509
510
|
var c;
|
|
510
511
|
const s = t(this, S).querySelector(e);
|
|
511
512
|
if (!s) return;
|
|
512
|
-
const
|
|
513
|
-
if (!
|
|
514
|
-
const n = Array.from(
|
|
513
|
+
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
514
|
+
if (!i) return;
|
|
515
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), a = ((c = t(this, D).get(e)) == null ? void 0 : c.length) || 1, l = (t(this, P).data.get() || []).length;
|
|
515
516
|
n.forEach((f, u) => {
|
|
516
|
-
const g =
|
|
517
|
+
const g = r + Math.floor(u / a);
|
|
517
518
|
if (g >= l) {
|
|
518
519
|
f.style.display = "none";
|
|
519
520
|
return;
|
|
@@ -523,20 +524,22 @@ const Ie = class Ie {
|
|
|
523
524
|
});
|
|
524
525
|
});
|
|
525
526
|
}, "#adjustBufferRows"));
|
|
526
|
-
d(this,
|
|
527
|
+
d(this, ct, /* @__PURE__ */ h((r) => {
|
|
527
528
|
var f, u;
|
|
528
529
|
const e = t(this, I);
|
|
529
530
|
if (!e || e <= 0) return;
|
|
530
|
-
const s = t(this, P).data.length,
|
|
531
|
-
(
|
|
531
|
+
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), l = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)");
|
|
532
|
+
H.log(t(this, at).firstTr.dataset.row);
|
|
533
|
+
const c = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
534
|
+
(u = t(this, at)) == null || u.scrollTables.forEach((g) => {
|
|
532
535
|
g.style.transform = `translateY(${n}px)`;
|
|
533
|
-
}), c !==
|
|
536
|
+
}), c !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
534
537
|
const b = t(this, S).querySelector(g);
|
|
535
538
|
if (!b) return;
|
|
536
539
|
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
537
540
|
if (!m) return;
|
|
538
541
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
539
|
-
const M =
|
|
542
|
+
const M = i + Math.floor(x / a);
|
|
540
543
|
if (M >= s) {
|
|
541
544
|
E.style.display = "none";
|
|
542
545
|
return;
|
|
@@ -560,55 +563,55 @@ const Ie = class Ie {
|
|
|
560
563
|
cell.dataset.row = dataIndex;
|
|
561
564
|
});
|
|
562
565
|
}; */
|
|
563
|
-
d(this, qt, /* @__PURE__ */ h((
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const a = Array.from(
|
|
566
|
+
d(this, qt, /* @__PURE__ */ h((r, e, s) => {
|
|
567
|
+
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
568
|
+
i.dataset.row = s;
|
|
569
|
+
const a = Array.from(i.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
567
570
|
a && typeof a.refresh == "function" && a.refresh();
|
|
568
571
|
});
|
|
569
572
|
}, "#bindRowData"));
|
|
570
573
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
571
574
|
var l, c, f;
|
|
572
575
|
H.log("rowManager.#syncHeaderHeights");
|
|
573
|
-
const
|
|
576
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
574
577
|
if (!e) return;
|
|
575
|
-
const
|
|
578
|
+
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(i.length, n.length, a.length);
|
|
576
579
|
for (let u = 0; u < o; u++) {
|
|
577
580
|
const g = [
|
|
578
|
-
((l =
|
|
581
|
+
((l = i[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
579
582
|
((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
580
583
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
581
584
|
], b = Math.max(...g);
|
|
582
|
-
b > 0 && (
|
|
585
|
+
b > 0 && (i[u] && (i[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), a[u] && (a[u].style.height = `${b}px`));
|
|
583
586
|
}
|
|
584
587
|
}, "#syncHeaderHeights"));
|
|
585
588
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
586
589
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
587
590
|
}, "destroy"));
|
|
588
|
-
y(this, P,
|
|
591
|
+
y(this, P, r.getRootNode().host), y(this, S, r), t(this, Pt).call(this);
|
|
589
592
|
}
|
|
590
593
|
getRowHeight() {
|
|
591
594
|
return t(this, I);
|
|
592
595
|
}
|
|
593
|
-
templateLength(
|
|
596
|
+
templateLength(r = ".ng-container-body") {
|
|
594
597
|
var e;
|
|
595
|
-
return ((e = t(this, D).get(
|
|
598
|
+
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
596
599
|
}
|
|
597
600
|
};
|
|
598
|
-
P = new WeakMap(), S = new WeakMap(),
|
|
601
|
+
P = new WeakMap(), S = new WeakMap(), at = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), St = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), Rt = new WeakMap(), Ae = new WeakMap(), ct = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), h(Ie, "RowManager");
|
|
599
602
|
let he = Ie;
|
|
600
603
|
const Ft = class Ft {
|
|
601
604
|
/**
|
|
602
605
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
603
606
|
*/
|
|
604
|
-
static compileAll(
|
|
605
|
-
return Array.isArray(
|
|
607
|
+
static compileAll(r) {
|
|
608
|
+
return Array.isArray(r) ? r.map((e) => Ft.compile(e)) : [];
|
|
606
609
|
}
|
|
607
610
|
/**
|
|
608
611
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
609
612
|
*/
|
|
610
|
-
static compile(
|
|
611
|
-
if (!
|
|
613
|
+
static compile(r) {
|
|
614
|
+
if (!r) return null;
|
|
612
615
|
const e = /* @__PURE__ */ h((o) => {
|
|
613
616
|
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((c) => {
|
|
614
617
|
const f = c.getAttribute("cell-type") || "renderer";
|
|
@@ -632,7 +635,7 @@ const Ft = class Ft {
|
|
|
632
635
|
c ? c.after(l) : o.prepend(l);
|
|
633
636
|
}
|
|
634
637
|
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
635
|
-
}, "ensureTableStructure"),
|
|
638
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((o, l) => {
|
|
636
639
|
const c = Array.from(o.querySelectorAll(l + " tr")), f = Array.from(o.querySelectorAll(l + " th," + l + " td")), u = c.length;
|
|
637
640
|
if (u === 0 || f.length === 0) return;
|
|
638
641
|
let g = 0;
|
|
@@ -651,8 +654,8 @@ const Ft = class Ft {
|
|
|
651
654
|
}
|
|
652
655
|
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
653
656
|
for (let B = 0; B < M; B++)
|
|
654
|
-
for (let
|
|
655
|
-
v + B < u && E +
|
|
657
|
+
for (let pt = 0; pt < k; pt++)
|
|
658
|
+
v + B < u && E + pt < g && (b[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
656
659
|
});
|
|
657
660
|
}), c.forEach((m) => {
|
|
658
661
|
const v = m.sectionRowIndex;
|
|
@@ -664,8 +667,8 @@ const Ft = class Ft {
|
|
|
664
667
|
}
|
|
665
668
|
});
|
|
666
669
|
});
|
|
667
|
-
}, "resetColIndex"), n =
|
|
668
|
-
return s(n), e(n),
|
|
670
|
+
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
671
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, l) => {
|
|
669
672
|
const c = o.getAttribute("fixed");
|
|
670
673
|
c && n.querySelectorAll(`thead [data-col="${l}"], tbody [data-col="${l}"], tfoot [data-col="${l}"]`).forEach((f) => {
|
|
671
674
|
f.setAttribute("fixed", c);
|
|
@@ -676,8 +679,8 @@ const Ft = class Ft {
|
|
|
676
679
|
};
|
|
677
680
|
h(Ft, "TableCompiler");
|
|
678
681
|
let de = Ft;
|
|
679
|
-
var Vt, tt, et, Yt, Ut,
|
|
680
|
-
const
|
|
682
|
+
var Vt, tt, et, Yt, Ut, ht, Xt, Kt;
|
|
683
|
+
const mt = class mt extends HTMLElement {
|
|
681
684
|
constructor() {
|
|
682
685
|
super();
|
|
683
686
|
d(this, Vt);
|
|
@@ -691,28 +694,28 @@ const pt = class pt extends HTMLElement {
|
|
|
691
694
|
{ selector: ".ng-container-body", type: null },
|
|
692
695
|
{ selector: ".ng-container-left", type: "left" },
|
|
693
696
|
{ selector: ".ng-container-right", type: "right" }
|
|
694
|
-
].forEach(({ selector: s, type:
|
|
697
|
+
].forEach(({ selector: s, type: i }) => {
|
|
695
698
|
const n = this.querySelector(s);
|
|
696
699
|
if (!n) return;
|
|
697
700
|
n.innerHTML = "";
|
|
698
701
|
const a = document.createElement("div");
|
|
699
|
-
a.className = "ng-part-header", a.appendChild(t(this,
|
|
702
|
+
a.className = "ng-part-header", a.appendChild(t(this, ht).call(this, t(this, tt), i, "header"));
|
|
700
703
|
const o = document.createElement("div");
|
|
701
704
|
o.className = "ng-part-body";
|
|
702
705
|
const l = document.createElement("div");
|
|
703
|
-
l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(t(this,
|
|
706
|
+
l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(t(this, ht).call(this, t(this, tt), i, "body"));
|
|
704
707
|
const c = document.createElement("div");
|
|
705
708
|
c.className = "ng-virtual-spacer", c.style.width = "100%", c.style.pointerEvents = "none", l.appendChild(c), o.appendChild(l);
|
|
706
709
|
const f = document.createElement("div");
|
|
707
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
710
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ht).call(this, t(this, tt), i, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
708
711
|
});
|
|
709
712
|
}, "#renderSplitContainers"));
|
|
710
713
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
711
714
|
["left", "right", "body"].forEach((e) => {
|
|
712
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
713
|
-
if (!s || !
|
|
715
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
716
|
+
if (!s || !i || i.length === 0) return;
|
|
714
717
|
let n = 0;
|
|
715
|
-
|
|
718
|
+
i[0].querySelectorAll("col").forEach((a) => {
|
|
716
719
|
const o = parseInt(a.getAttribute("width"), 10);
|
|
717
720
|
isNaN(n) || (n += o);
|
|
718
721
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
@@ -724,14 +727,14 @@ const pt = class pt extends HTMLElement {
|
|
|
724
727
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
725
728
|
}, 0));
|
|
726
729
|
}, "generate"));
|
|
727
|
-
d(this,
|
|
730
|
+
d(this, ht, /* @__PURE__ */ h((e, s, i) => {
|
|
728
731
|
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), l = n.querySelector("tfoot");
|
|
729
|
-
if (
|
|
732
|
+
if (i === "header") {
|
|
730
733
|
if (o && o.remove(), l && l.remove(), e.querySelector("tbody")) {
|
|
731
734
|
const f = document.createElement("tbody");
|
|
732
735
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
733
736
|
}
|
|
734
|
-
} else
|
|
737
|
+
} else i === "body" ? (a && a.remove(), l && l.remove(), o && (o.className = "bindable-tbody")) : i === "footer" && (a && a.remove(), o && o.remove());
|
|
735
738
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
736
739
|
c.getAttribute("fixed") !== "left" && c.remove();
|
|
737
740
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
@@ -753,7 +756,7 @@ const pt = class pt extends HTMLElement {
|
|
|
753
756
|
t(this, Kt).call(this);
|
|
754
757
|
}, "#init"));
|
|
755
758
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
756
|
-
const e =
|
|
759
|
+
const e = mt.SCROLLBAR_SIZE;
|
|
757
760
|
this.innerHTML = `
|
|
758
761
|
<style>
|
|
759
762
|
nine-table-sheet {
|
|
@@ -904,8 +907,8 @@ const pt = class pt extends HTMLElement {
|
|
|
904
907
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
905
908
|
}
|
|
906
909
|
};
|
|
907
|
-
Vt = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(),
|
|
908
|
-
let It =
|
|
910
|
+
Vt = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(), ht = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
911
|
+
let It = mt;
|
|
909
912
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
910
913
|
var Zt, kt;
|
|
911
914
|
const _e = class _e extends HTMLElement {
|
|
@@ -915,12 +918,12 @@ const _e = class _e extends HTMLElement {
|
|
|
915
918
|
var e;
|
|
916
919
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
917
920
|
var a;
|
|
918
|
-
const
|
|
919
|
-
t(this, kt).call(this, n,
|
|
921
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
922
|
+
t(this, kt).call(this, n, i);
|
|
920
923
|
}), t(this, kt).call(this, 0, !1);
|
|
921
924
|
}, "#init"));
|
|
922
925
|
d(this, kt, /* @__PURE__ */ h((e, s = !1) => {
|
|
923
|
-
const
|
|
926
|
+
const i = /* @__PURE__ */ h(() => {
|
|
924
927
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
925
928
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
926
929
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
@@ -948,7 +951,7 @@ const _e = class _e extends HTMLElement {
|
|
|
948
951
|
const c = a.querySelectorAll("nine-table-sheet.active");
|
|
949
952
|
c == null || c.forEach((f) => {
|
|
950
953
|
f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
951
|
-
}),
|
|
954
|
+
}), i();
|
|
952
955
|
}, "#switchSheet"));
|
|
953
956
|
}
|
|
954
957
|
connectedCallback() {
|
|
@@ -960,24 +963,24 @@ let fe = _e;
|
|
|
960
963
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
961
964
|
var _, Gt, Tt, Jt;
|
|
962
965
|
const Ne = class Ne {
|
|
963
|
-
constructor(
|
|
966
|
+
constructor(r) {
|
|
964
967
|
d(this, _);
|
|
965
968
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
966
|
-
t(this, Jt).call(this), new ResizeObserver((
|
|
967
|
-
for (let e of
|
|
969
|
+
t(this, Jt).call(this), new ResizeObserver((r) => {
|
|
970
|
+
for (let e of r)
|
|
968
971
|
t(this, _).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
969
972
|
}).observe(t(this, _));
|
|
970
973
|
}, "#init"));
|
|
971
974
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
972
975
|
var l, c;
|
|
973
|
-
const
|
|
974
|
-
if (
|
|
975
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
976
|
+
const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
977
|
+
if (r.length === 0) return;
|
|
978
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (l = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, a = It.SCROLLBAR_SIZE, o = e * s + i + n + a;
|
|
976
979
|
t(this, _).style.height = `${o}px`;
|
|
977
980
|
}, "#applyAutoHeight"));
|
|
978
981
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
979
|
-
const e = Array.from(t(this, _).children).filter((l) => l.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true",
|
|
980
|
-
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c <
|
|
982
|
+
const e = Array.from(t(this, _).children).filter((l) => l.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", i = e.length, n = e.map((l, c) => {
|
|
983
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < i - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
981
984
|
return u + g;
|
|
982
985
|
}).join(""), a = e.map((l, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
983
986
|
t(this, _).shadowRoot.innerHTML = `
|
|
@@ -1078,42 +1081,42 @@ const Ne = class Ne {
|
|
|
1078
1081
|
});
|
|
1079
1082
|
});
|
|
1080
1083
|
}, "#render"));
|
|
1081
|
-
y(this, _,
|
|
1084
|
+
y(this, _, r), t(this, Gt).call(this);
|
|
1082
1085
|
}
|
|
1083
1086
|
};
|
|
1084
1087
|
_ = new WeakMap(), Gt = new WeakMap(), Tt = new WeakMap(), Jt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1085
1088
|
let ue = Ne;
|
|
1086
|
-
var Ct,
|
|
1089
|
+
var Ct, dt;
|
|
1087
1090
|
const We = class We {
|
|
1088
|
-
constructor(
|
|
1091
|
+
constructor(r) {
|
|
1089
1092
|
d(this, Ct);
|
|
1090
|
-
d(this,
|
|
1093
|
+
d(this, dt, -1);
|
|
1091
1094
|
A(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1092
|
-
y(this, Ct,
|
|
1095
|
+
y(this, Ct, r);
|
|
1093
1096
|
}
|
|
1094
1097
|
get at() {
|
|
1095
|
-
return t(this,
|
|
1098
|
+
return t(this, dt);
|
|
1096
1099
|
}
|
|
1097
|
-
set at(
|
|
1098
|
-
y(this,
|
|
1100
|
+
set at(r) {
|
|
1101
|
+
y(this, dt, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, dt)}"]`) && setTimeout(() => {
|
|
1099
1102
|
});
|
|
1100
1103
|
}
|
|
1101
1104
|
};
|
|
1102
|
-
Ct = new WeakMap(),
|
|
1105
|
+
Ct = new WeakMap(), dt = new WeakMap(), h(We, "ngRow");
|
|
1103
1106
|
let ge = We;
|
|
1104
|
-
var N, T, W,
|
|
1107
|
+
var N, T, W, ft, Qt, Y, te, st, Lt, ee, se, ut;
|
|
1105
1108
|
const O = class O {
|
|
1106
|
-
constructor(
|
|
1109
|
+
constructor(r, e) {
|
|
1107
1110
|
d(this, N);
|
|
1108
1111
|
d(this, T);
|
|
1109
1112
|
d(this, W, []);
|
|
1110
|
-
d(this,
|
|
1113
|
+
d(this, ft, []);
|
|
1111
1114
|
d(this, Qt, 0);
|
|
1112
1115
|
d(this, Y, []);
|
|
1113
1116
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
1114
1117
|
y(this, Y, []);
|
|
1115
|
-
const
|
|
1116
|
-
Array.from(
|
|
1118
|
+
const r = t(this, N).template || [];
|
|
1119
|
+
Array.from(r).forEach((e) => {
|
|
1117
1120
|
var s;
|
|
1118
1121
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1119
1122
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
@@ -1121,25 +1124,25 @@ const O = class O {
|
|
|
1121
1124
|
});
|
|
1122
1125
|
}, "#initialize"));
|
|
1123
1126
|
d(this, st, /* @__PURE__ */ h(() => {
|
|
1124
|
-
t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1125
|
-
|
|
1127
|
+
t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((r) => {
|
|
1128
|
+
r.invalidate();
|
|
1126
1129
|
});
|
|
1127
1130
|
}, "#invalidate"));
|
|
1128
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1131
|
+
A(this, "get", /* @__PURE__ */ h((r, e) => {
|
|
1129
1132
|
var n;
|
|
1130
1133
|
const s = this.getValidData();
|
|
1131
1134
|
if (!s || s.length <= 0) return;
|
|
1132
|
-
if (
|
|
1133
|
-
if (
|
|
1134
|
-
const
|
|
1135
|
+
if (r == null) return t(this, ut).call(this, s);
|
|
1136
|
+
if (r < 0 || r >= s.length) return null;
|
|
1137
|
+
const i = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1135
1138
|
if (e != null) {
|
|
1136
|
-
const a =
|
|
1137
|
-
return a >= 0 ? s[
|
|
1139
|
+
const a = i.indexOf(e);
|
|
1140
|
+
return a >= 0 ? s[r].v[a] : null;
|
|
1138
1141
|
}
|
|
1139
|
-
return t(this,
|
|
1142
|
+
return t(this, ut).call(this, s[r]);
|
|
1140
1143
|
}, "get"));
|
|
1141
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1142
|
-
this.clear(), this.add(
|
|
1144
|
+
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1145
|
+
this.clear(), this.add(r, !1), t(this, st).call(this);
|
|
1143
1146
|
}, "set"));
|
|
1144
1147
|
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1145
1148
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1151,84 +1154,84 @@ const O = class O {
|
|
|
1151
1154
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1152
1155
|
}), "#getDefaultMeta"));
|
|
1153
1156
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1154
|
-
y(this, W, []), y(this,
|
|
1157
|
+
y(this, W, []), y(this, ft, []), t(this, st).call(this);
|
|
1155
1158
|
}, "reset"));
|
|
1156
1159
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1157
|
-
var i;
|
|
1158
|
-
t(this, T).rawRecords = [], y(this, W, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1159
|
-
}, "clear"));
|
|
1160
|
-
d(this, ee, /* @__PURE__ */ h((i) => {
|
|
1161
1160
|
var r;
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1161
|
+
t(this, T).rawRecords = [], y(this, W, []), y(this, ft, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1162
|
+
}, "clear"));
|
|
1163
|
+
d(this, ee, /* @__PURE__ */ h((r) => {
|
|
1164
|
+
var i;
|
|
1165
|
+
Array.isArray(r) || (r = [r]);
|
|
1166
|
+
const e = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
1167
|
+
return r.forEach((n) => {
|
|
1165
1168
|
const a = { v: [] };
|
|
1166
1169
|
e.forEach((o) => {
|
|
1167
1170
|
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1168
1171
|
}), s.push(a);
|
|
1169
1172
|
}), s;
|
|
1170
1173
|
}, "#json2Array"));
|
|
1171
|
-
d(this, se, /* @__PURE__ */ h((
|
|
1174
|
+
d(this, se, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1172
1175
|
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1173
|
-
}),
|
|
1174
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1175
|
-
|
|
1176
|
-
const s = t(this, ee).call(this,
|
|
1176
|
+
}), r), "#defaultInsert"));
|
|
1177
|
+
A(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1178
|
+
r === void 0 && (r = {});
|
|
1179
|
+
const s = t(this, ee).call(this, r);
|
|
1177
1180
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, se).call(this, s)), this.resetRecords();
|
|
1178
|
-
const
|
|
1181
|
+
const i = this.count() - 1;
|
|
1179
1182
|
return e || s.forEach((n, a) => {
|
|
1180
|
-
const o = t(this, T).rawRecords[
|
|
1183
|
+
const o = t(this, T).rawRecords[i - a];
|
|
1181
1184
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1182
|
-
}), t(this, st).call(this),
|
|
1185
|
+
}), t(this, st).call(this), i;
|
|
1183
1186
|
}, "add"));
|
|
1184
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1187
|
+
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1185
1188
|
let e = [];
|
|
1186
|
-
Array.isArray(
|
|
1189
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1187
1190
|
if (t(this, W)[s]) {
|
|
1188
|
-
const
|
|
1189
|
-
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1190
|
-
n.__ng.rowid ===
|
|
1191
|
+
const i = t(this, W)[s].__ng.rowid;
|
|
1192
|
+
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, T).rawRecords.forEach((n) => {
|
|
1193
|
+
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1191
1194
|
});
|
|
1192
1195
|
}
|
|
1193
1196
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1194
1197
|
}, "delete"));
|
|
1195
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1198
|
+
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1196
1199
|
var l;
|
|
1197
|
-
|
|
1200
|
+
r = parseInt(r, 10);
|
|
1198
1201
|
const n = (typeof ((l = t(this, N).fields) == null ? void 0 : l.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1199
1202
|
if (n < 0) return;
|
|
1200
|
-
const a = this.getValidData()[
|
|
1203
|
+
const a = this.getValidData()[r];
|
|
1201
1204
|
if (!a) return;
|
|
1202
1205
|
const o = a.v[n];
|
|
1203
1206
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1204
1207
|
}, "setValue"));
|
|
1205
1208
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1206
|
-
y(this,
|
|
1207
|
-
|
|
1208
|
-
}), t(this, W).forEach((
|
|
1209
|
-
|
|
1209
|
+
y(this, ft, t(this, T).rawRecords.filter((r) => !r.__ng.deleted)), y(this, W, t(this, T).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, T).rawRecords.forEach((r, e) => {
|
|
1210
|
+
r.__ng.rowidx = e;
|
|
1211
|
+
}), t(this, W).forEach((r, e) => {
|
|
1212
|
+
r.__ng.i = e;
|
|
1210
1213
|
});
|
|
1211
1214
|
}, "resetRecords"));
|
|
1212
1215
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1213
|
-
d(this,
|
|
1216
|
+
d(this, ut, /* @__PURE__ */ h((r) => {
|
|
1214
1217
|
var a;
|
|
1215
|
-
if (!
|
|
1216
|
-
const e = !Array.isArray(
|
|
1218
|
+
if (!r) return r;
|
|
1219
|
+
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((a = t(this, N).fields) == null ? void 0 : a.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1217
1220
|
const l = {};
|
|
1218
|
-
return
|
|
1221
|
+
return i.forEach((c, f) => {
|
|
1219
1222
|
l[c] = o.v ? o.v[f] : o[c];
|
|
1220
1223
|
}), l.__ng = o.__ng, l;
|
|
1221
1224
|
});
|
|
1222
1225
|
return e ? n[0] : n;
|
|
1223
1226
|
}, "#conv"));
|
|
1224
1227
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1225
|
-
y(this, N,
|
|
1228
|
+
y(this, N, r), y(this, T, e), t(this, te).call(this);
|
|
1226
1229
|
}
|
|
1227
1230
|
get source() {
|
|
1228
|
-
return t(this,
|
|
1231
|
+
return t(this, ut).call(this, t(this, T).rawRecords);
|
|
1229
1232
|
}
|
|
1230
|
-
set source(
|
|
1231
|
-
this.clear(), this.add(
|
|
1233
|
+
set source(r) {
|
|
1234
|
+
this.clear(), this.add(r, !1);
|
|
1232
1235
|
}
|
|
1233
1236
|
get nextId() {
|
|
1234
1237
|
return ++Ue(this, Qt)._;
|
|
@@ -1243,7 +1246,7 @@ const O = class O {
|
|
|
1243
1246
|
return this.length;
|
|
1244
1247
|
}
|
|
1245
1248
|
};
|
|
1246
|
-
N = new WeakMap(), T = new WeakMap(), W = new WeakMap(),
|
|
1249
|
+
N = new WeakMap(), T = new WeakMap(), W = new WeakMap(), ft = new WeakMap(), Qt = new WeakMap(), Y = new WeakMap(), te = new WeakMap(), st = new WeakMap(), Lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), ut = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1247
1250
|
A(O, "ROW_STATE", {
|
|
1248
1251
|
EMPTY: "EMPTY",
|
|
1249
1252
|
NORMAL: "NORMAL",
|
|
@@ -1252,56 +1255,56 @@ A(O, "ROW_STATE", {
|
|
|
1252
1255
|
DELETE: "DELETE"
|
|
1253
1256
|
});
|
|
1254
1257
|
let be = O;
|
|
1255
|
-
var
|
|
1258
|
+
var rt;
|
|
1256
1259
|
const Oe = class Oe {
|
|
1257
|
-
constructor(
|
|
1258
|
-
d(this,
|
|
1259
|
-
y(this,
|
|
1260
|
+
constructor(r) {
|
|
1261
|
+
d(this, rt);
|
|
1262
|
+
y(this, rt, r), this.row = new ge(this), this.data = new be(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1260
1263
|
var e;
|
|
1261
|
-
(e = t(this,
|
|
1264
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1262
1265
|
}, this.setDataSource = (e) => {
|
|
1263
1266
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1264
1267
|
}, this.getRowState = (e) => {
|
|
1265
|
-
var
|
|
1268
|
+
var i, n;
|
|
1266
1269
|
const s = parseInt(e, 10);
|
|
1267
1270
|
if (!(s >= this.data.count()))
|
|
1268
|
-
return (n = (
|
|
1271
|
+
return (n = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : n.rowState;
|
|
1269
1272
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1270
1273
|
this.row.at = e;
|
|
1271
|
-
}, 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,
|
|
1272
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1274
|
+
}, 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, i) => {
|
|
1275
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1273
1276
|
}, this.setDataSource([]);
|
|
1274
1277
|
}
|
|
1275
1278
|
};
|
|
1276
|
-
|
|
1279
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1277
1280
|
let ye = Oe;
|
|
1278
|
-
var
|
|
1281
|
+
var gt, L, Ht, re;
|
|
1279
1282
|
const Be = class Be {
|
|
1280
1283
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1281
|
-
constructor(
|
|
1282
|
-
d(this,
|
|
1284
|
+
constructor(r) {
|
|
1285
|
+
d(this, gt);
|
|
1283
1286
|
d(this, L, []);
|
|
1284
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1285
|
-
|
|
1286
|
-
t(this, L).some((
|
|
1287
|
+
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1288
|
+
r.forEach((s) => {
|
|
1289
|
+
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1287
1290
|
}), t(this, Ht).call(this);
|
|
1288
1291
|
}, "add"));
|
|
1289
1292
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
1290
|
-
const
|
|
1293
|
+
const r = /* @__PURE__ */ new Map();
|
|
1291
1294
|
t(this, L).forEach((e) => {
|
|
1292
|
-
|
|
1293
|
-
}), y(this, L, Array.from(
|
|
1295
|
+
r.set(e.name, e.type);
|
|
1296
|
+
}), y(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1294
1297
|
}, "#adjust"));
|
|
1295
|
-
d(this,
|
|
1296
|
-
y(this, L, []), H.log(t(this,
|
|
1297
|
-
const
|
|
1298
|
-
if (!(!
|
|
1299
|
-
for (const e of
|
|
1300
|
-
H.log(e), $("[data-bind]", e).each((s,
|
|
1301
|
-
const n =
|
|
1298
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1299
|
+
y(this, L, []), H.log(t(this, gt).querySelectorAll("table"));
|
|
1300
|
+
const r = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1301
|
+
if (!(!r || r.length === 0)) {
|
|
1302
|
+
for (const e of r)
|
|
1303
|
+
H.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1304
|
+
const n = i.dataset.bind, a = i.getAttribute("data-type") || "string";
|
|
1302
1305
|
n && t(this, L).push({ name: n, type: a });
|
|
1303
1306
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1304
|
-
$(`[${s}]`, e).each((
|
|
1307
|
+
$(`[${s}]`, e).each((i, n) => {
|
|
1305
1308
|
var a = n.getAttribute(s);
|
|
1306
1309
|
if (a.indexOf("data.") < 0) {
|
|
1307
1310
|
const o = a.search(/[(]/g);
|
|
@@ -1324,41 +1327,41 @@ const Be = class Be {
|
|
|
1324
1327
|
t(this, Ht).call(this);
|
|
1325
1328
|
}
|
|
1326
1329
|
}, "#init"));
|
|
1327
|
-
y(this,
|
|
1330
|
+
y(this, gt, r), t(this, re).call(this);
|
|
1328
1331
|
}
|
|
1329
1332
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1330
1333
|
get() {
|
|
1331
|
-
return t(this, L).map((
|
|
1334
|
+
return t(this, L).map((r) => r.name);
|
|
1332
1335
|
}
|
|
1333
1336
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1334
1337
|
getFields() {
|
|
1335
1338
|
return t(this, L);
|
|
1336
1339
|
}
|
|
1337
1340
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1338
|
-
getType(
|
|
1339
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1341
|
+
getType(r) {
|
|
1342
|
+
const e = t(this, L).find((s) => s.name === r);
|
|
1340
1343
|
return e ? e.type : "string";
|
|
1341
1344
|
}
|
|
1342
|
-
indexOf(
|
|
1343
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1345
|
+
indexOf(r) {
|
|
1346
|
+
return t(this, L).findIndex((e) => e.name === r);
|
|
1344
1347
|
}
|
|
1345
|
-
includes(
|
|
1346
|
-
return t(this, L).some((e) => e.name ===
|
|
1348
|
+
includes(r) {
|
|
1349
|
+
return t(this, L).some((e) => e.name === r);
|
|
1347
1350
|
}
|
|
1348
1351
|
};
|
|
1349
|
-
|
|
1352
|
+
gt = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(), re = new WeakMap(), h(Be, "ngFields");
|
|
1350
1353
|
let pe = Be;
|
|
1351
|
-
var
|
|
1354
|
+
var it, ie, ne;
|
|
1352
1355
|
const ze = class ze extends HTMLElement {
|
|
1353
1356
|
constructor() {
|
|
1354
1357
|
super();
|
|
1355
1358
|
//#created = false;
|
|
1356
|
-
d(this,
|
|
1357
|
-
d(this,
|
|
1359
|
+
d(this, it);
|
|
1360
|
+
d(this, ie);
|
|
1358
1361
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1359
|
-
this.fields = new pe(this), y(this,
|
|
1362
|
+
this.fields = new pe(this), y(this, ie, new ue(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1360
1363
|
}, "#init"));
|
|
1361
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1364
|
+
this.attachShadow({ mode: "open" }), y(this, it, new ye(this));
|
|
1362
1365
|
}
|
|
1363
1366
|
connectedCallback() {
|
|
1364
1367
|
t(this, ne).call(this);
|
|
@@ -1368,21 +1371,21 @@ const ze = class ze extends HTMLElement {
|
|
|
1368
1371
|
}
|
|
1369
1372
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1370
1373
|
get data() {
|
|
1371
|
-
return t(this,
|
|
1374
|
+
return t(this, it).data;
|
|
1372
1375
|
}
|
|
1373
1376
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1374
1377
|
get row() {
|
|
1375
|
-
return t(this,
|
|
1378
|
+
return t(this, it).row;
|
|
1376
1379
|
}
|
|
1377
1380
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1378
1381
|
get dataManager() {
|
|
1379
|
-
return t(this,
|
|
1382
|
+
return t(this, it);
|
|
1380
1383
|
}
|
|
1381
1384
|
};
|
|
1382
|
-
|
|
1385
|
+
it = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), h(ze, "NineTable");
|
|
1383
1386
|
let me = ze;
|
|
1384
1387
|
customElements.get("nine-table") || customElements.define("nine-table", me);
|
|
1385
|
-
const
|
|
1388
|
+
const xt = class xt extends HTMLElement {
|
|
1386
1389
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1387
1390
|
constructor() {
|
|
1388
1391
|
super();
|
|
@@ -1393,8 +1396,8 @@ const mt = class mt extends HTMLElement {
|
|
|
1393
1396
|
connectedCallback() {
|
|
1394
1397
|
}
|
|
1395
1398
|
};
|
|
1396
|
-
h(
|
|
1397
|
-
let xe =
|
|
1399
|
+
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
|
+
let xe = xt;
|
|
1398
1401
|
var C, Mt, p, Re, qe, ke, Te, Ce;
|
|
1399
1402
|
const De = class De extends xe {
|
|
1400
1403
|
constructor() {
|
|
@@ -1409,13 +1412,13 @@ const De = class De extends xe {
|
|
|
1409
1412
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1410
1413
|
if (t(this, p))
|
|
1411
1414
|
if (t(this, p).closest("tbody")) {
|
|
1412
|
-
const s = t(this, p).closest("tr").data,
|
|
1415
|
+
const s = t(this, p).closest("tr").data, i = parseInt(t(this, p).dataset.row);
|
|
1413
1416
|
if (!s) return "";
|
|
1414
1417
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1415
1418
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1416
1419
|
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1417
1420
|
} else try {
|
|
1418
|
-
return this.getExprValue(t(this, p).dataset.expr, s,
|
|
1421
|
+
return this.getExprValue(t(this, p).dataset.expr, s, i, t(this, p));
|
|
1419
1422
|
} catch {
|
|
1420
1423
|
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1421
1424
|
}
|
|
@@ -1430,14 +1433,14 @@ const De = class De extends xe {
|
|
|
1430
1433
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1431
1434
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1432
1435
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1433
|
-
var s = t(this, p).closest("tr"),
|
|
1436
|
+
var s = t(this, p).closest("tr"), i = [];
|
|
1434
1437
|
$("th,td", s).each((x, M) => {
|
|
1435
1438
|
var k = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1436
|
-
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e &&
|
|
1437
|
-
}),
|
|
1439
|
+
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && i.push(k));
|
|
1440
|
+
}), i.sort();
|
|
1438
1441
|
var n = !1;
|
|
1439
1442
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1440
|
-
for (var a of
|
|
1443
|
+
for (var a of i) {
|
|
1441
1444
|
if (a > e) break;
|
|
1442
1445
|
var o = parseInt(t(this, p).dataset.row), l = o - 1, c = t(this, p).closest("tr").data, f = t(this, C).data.get(l);
|
|
1443
1446
|
t(this, p).dataset.matrixRow;
|
|
@@ -1455,12 +1458,12 @@ const De = class De extends xe {
|
|
|
1455
1458
|
}
|
|
1456
1459
|
}
|
|
1457
1460
|
}, "#resetSuppress"));
|
|
1458
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1461
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
1459
1462
|
if (typeof e < "u")
|
|
1460
1463
|
try {
|
|
1461
|
-
|
|
1464
|
+
i = parseInt(i);
|
|
1462
1465
|
const a = e.replace("()", "");
|
|
1463
|
-
return t(this, C)[a] ? t(this, C)[a].call(this, s,
|
|
1466
|
+
return t(this, C)[a] ? t(this, C)[a].call(this, s, i, t(this, p)) : t(this, C).exprFunction(e).call(this, s, i, t(this, C).data);
|
|
1464
1467
|
} catch {
|
|
1465
1468
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1466
1469
|
}
|
|
@@ -1477,8 +1480,8 @@ const De = class De extends xe {
|
|
|
1477
1480
|
}
|
|
1478
1481
|
set value(e) {
|
|
1479
1482
|
var s = parseInt(t(this, p).dataset.row);
|
|
1480
|
-
const
|
|
1481
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e,
|
|
1483
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1484
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, i) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, i);
|
|
1482
1485
|
}
|
|
1483
1486
|
get row() {
|
|
1484
1487
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1506,14 +1509,14 @@ const Pe = class Pe extends ve {
|
|
|
1506
1509
|
};
|
|
1507
1510
|
h(Pe, "EditableCellElement");
|
|
1508
1511
|
let we = Pe;
|
|
1509
|
-
var $t, nt,
|
|
1512
|
+
var $t, nt, bt, yt, oe, U, Le;
|
|
1510
1513
|
const je = class je extends we {
|
|
1511
1514
|
constructor() {
|
|
1512
1515
|
super();
|
|
1513
1516
|
d(this, $t);
|
|
1514
1517
|
d(this, nt);
|
|
1515
|
-
d(this, gt);
|
|
1516
1518
|
d(this, bt);
|
|
1519
|
+
d(this, yt);
|
|
1517
1520
|
d(this, oe);
|
|
1518
1521
|
d(this, U);
|
|
1519
1522
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -1554,18 +1557,18 @@ const je = class je extends we {
|
|
|
1554
1557
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1555
1558
|
if (t(this, nt) == "number") {
|
|
1556
1559
|
let n = [];
|
|
1557
|
-
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this,
|
|
1558
|
-
var s = e.target.value,
|
|
1559
|
-
if (
|
|
1560
|
-
var s = s.substr(
|
|
1560
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1561
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1562
|
+
if (i >= 0) {
|
|
1563
|
+
var s = s.substr(i + 1, s.length);
|
|
1561
1564
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1562
1565
|
}
|
|
1563
1566
|
}
|
|
1564
1567
|
}
|
|
1565
|
-
t(this,
|
|
1568
|
+
t(this, bt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, bt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1566
1569
|
}
|
|
1567
1570
|
}, "#onKeyDown"));
|
|
1568
|
-
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this,
|
|
1571
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, bt, this.getAttribute("maxbyte")), y(this, yt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1569
1572
|
}
|
|
1570
1573
|
connectedCallback() {
|
|
1571
1574
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1578,7 +1581,7 @@ const je = class je extends we {
|
|
|
1578
1581
|
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1579
1582
|
}
|
|
1580
1583
|
};
|
|
1581
|
-
$t = new WeakMap(), nt = new WeakMap(),
|
|
1584
|
+
$t = new WeakMap(), nt = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), oe = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1582
1585
|
let Se = je;
|
|
1583
1586
|
customElements.get("cell-input-text");
|
|
1584
1587
|
customElements.get("cell-input") || customElements.define("cell-input", Se);
|