@ninebone/table 0.0.559 β 0.0.561
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 +266 -256
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- 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 E = (R,
|
|
8
|
-
var t = (R,
|
|
9
|
-
var Ue = (R,
|
|
10
|
-
set _(
|
|
11
|
-
p(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 E = (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), p = (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
|
+
p(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";
|
|
@@ -23,35 +23,35 @@ const He = class He extends Ke.constructor {
|
|
|
23
23
|
h(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const N = new oe();
|
|
26
|
-
var
|
|
26
|
+
var z, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
36
|
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
37
|
+
if (!t(this, z)) return;
|
|
38
|
+
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
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, c = s.scrollWidth;
|
|
48
48
|
if (o !== 0 && c > 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 l =
|
|
54
|
+
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (o / c), l), 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 c = n.width - a;
|
|
72
72
|
o > c && (o = c), 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 >= c - 1;
|
|
73
|
-
const l = s.clientWidth, u =
|
|
73
|
+
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = o / c * u), o > 0 && o < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__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), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(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(), p(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 c = t(this, w).track.getBoundingClientRect();
|
|
@@ -112,7 +112,7 @@ const Me = class Me extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const Me = class Me 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 s = t(this,
|
|
180
|
+
const s = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -198,7 +198,7 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
204
|
var F, at, J, q, xt, vt, Nt;
|
|
@@ -213,21 +213,21 @@ const $e = class $e extends HTMLElement {
|
|
|
213
213
|
d(this, vt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track,
|
|
216
|
+
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, c = t(this, at).getRowHeight(), l = o * c;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
|
|
218
|
+
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
i.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
|
-
|
|
225
|
+
i.style.height = `${u}px`;
|
|
226
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
227
|
let x = 0;
|
|
228
228
|
b > 0 && (x = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
x < 0 && (x = 0), x > v && (x = v),
|
|
230
|
+
x < 0 && (x = 0), x > v && (x = v), i.style.top = `${x}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
N.log("nine-table-vscrollbar.#init");
|
|
@@ -237,9 +237,9 @@ const $e = class $e extends HTMLElement {
|
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this, q).thumb.addEventListener("mousedown", (
|
|
241
|
-
if (
|
|
242
|
-
|
|
240
|
+
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
241
|
+
if (i.button !== 0) return;
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), p(this, J, !0), p(this, xt, i.clientY), p(this, vt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((o) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
245
|
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = o.clientY - t(this, xt), b = e.clientHeight, x = s(), v = Math.max(x - b, 1);
|
|
@@ -254,9 +254,9 @@ const $e = class $e extends HTMLElement {
|
|
|
254
254
|
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
257
|
-
}), t(this, q).track.addEventListener("mousedown", (
|
|
258
|
-
if (
|
|
259
|
-
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o =
|
|
257
|
+
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
258
|
+
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = i.clientY - n.top - a / 2, l = n.height - a, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, o / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
@@ -354,13 +354,13 @@ const $e = class $e extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var D, S, Q,
|
|
357
|
+
var D, S, Q, P, H, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Pt, At, Ae, lt, Rt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
359
|
+
constructor(r) {
|
|
360
360
|
d(this, D);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, P, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, H, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
@@ -371,14 +371,14 @@ const Ie = class Ie {
|
|
|
371
371
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
N.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
r && (t(this, St).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
378
|
N.log("rowManager.initialize"), p(this, Q, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this, H, null), t(this,
|
|
381
|
+
}), p(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
382
382
|
const o = t(this, S).querySelector(a);
|
|
383
383
|
if (!o) return;
|
|
384
384
|
const c = o.querySelector(".ng-part-body table");
|
|
@@ -386,42 +386,52 @@ const Ie = class Ie {
|
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
389
|
+
t(this, P).set(a, u);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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, Bt).call(this, r), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, r.scrollTop);
|
|
394
|
+
let a = !1;
|
|
395
|
+
const o = /* @__PURE__ */ h((c) => {
|
|
396
|
+
if (a) return;
|
|
397
|
+
a = !0;
|
|
398
|
+
const l = c.scrollTop, f = c.scrollLeft;
|
|
399
|
+
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), a = !1;
|
|
400
|
+
}, "handleContainerScroll");
|
|
401
|
+
[r, e, s].forEach((c) => {
|
|
402
|
+
c && c.addEventListener("scroll", () => {
|
|
403
|
+
o(c);
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
}
|
|
397
407
|
}, "initialize"));
|
|
398
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
408
|
+
d(this, Ot, /* @__PURE__ */ h((r, e) => {
|
|
399
409
|
N.log("rowManager.#renderRows");
|
|
400
|
-
const s = t(this,
|
|
410
|
+
const s = t(this, P).get(e);
|
|
401
411
|
if (!s || s.length === 0) return;
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
-
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();
|
|
406
416
|
for (let o = 0; o < t(this, wt); o++)
|
|
407
417
|
s.forEach((c) => {
|
|
408
418
|
a.appendChild(c.cloneNode(!0));
|
|
409
419
|
});
|
|
410
|
-
n ? n.before(a) :
|
|
420
|
+
n ? n.before(a) : i.appendChild(a), e === ".ng-container-body" && (t(this, Q).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
411
421
|
}, "#renderRows"));
|
|
412
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
422
|
+
d(this, Bt, /* @__PURE__ */ h((r) => {
|
|
413
423
|
if (N.log("rowManager.#measureAndCacheHeight"), t(this, H) !== null && t(this, H) > 0)
|
|
414
424
|
return t(this, H);
|
|
415
425
|
N.log("#measureAndCacheHeight");
|
|
416
|
-
const e = t(this,
|
|
426
|
+
const e = t(this, P).get(".ng-container-body");
|
|
417
427
|
if (!e || e.length === 0) return 24;
|
|
418
|
-
const s =
|
|
428
|
+
const s = r.querySelector("tbody.bindable-tbody");
|
|
419
429
|
if (!s) return 24;
|
|
420
430
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
421
|
-
const
|
|
431
|
+
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
422
432
|
e.forEach((g) => {
|
|
423
433
|
n.appendChild(g.cloneNode(!0));
|
|
424
|
-
}),
|
|
434
|
+
}), i ? i.before(n) : s.appendChild(n);
|
|
425
435
|
const a = t(this, S), o = a.style.display, c = a.style.visibility, l = a.style.position;
|
|
426
436
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
427
437
|
let f = 0;
|
|
@@ -432,25 +442,25 @@ const Ie = class Ie {
|
|
|
432
442
|
}, "#measureAndCacheHeight"));
|
|
433
443
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
434
444
|
N.log("rowManager.#updateVirtualScrollHeight");
|
|
435
|
-
const e = (t(this, D).data.get() || []).length, s = t(this, H),
|
|
445
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, H), i = e * s;
|
|
436
446
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
437
447
|
const a = t(this, S).querySelector(n);
|
|
438
448
|
if (!a) return;
|
|
439
449
|
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
440
|
-
o && (o.style.height = `${
|
|
450
|
+
o && (o.style.height = `${i}px`);
|
|
441
451
|
});
|
|
442
452
|
}, "#updateVirtualScrollHeight"));
|
|
443
453
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
444
454
|
if (t(this, tt) > 0 && t(this, H) > 0) {
|
|
445
|
-
const
|
|
446
|
-
p(this, wt,
|
|
455
|
+
const r = Math.ceil(t(this, tt) / t(this, H));
|
|
456
|
+
p(this, wt, r + t(this, Wt));
|
|
447
457
|
}
|
|
448
458
|
}, "#updateRowCount"));
|
|
449
|
-
d(this,
|
|
459
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
450
460
|
var o, c, l, f, u, g;
|
|
451
|
-
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");
|
|
452
462
|
if (e) {
|
|
453
|
-
const b =
|
|
463
|
+
const b = r ? Array.from(r.querySelectorAll("tbody tr")) : [], x = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
454
464
|
for (let m = 0; m < A; m++) {
|
|
455
465
|
const W = [
|
|
456
466
|
((o = b[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
@@ -460,9 +470,9 @@ const Ie = class Ie {
|
|
|
460
470
|
C > 0 && (b[m] && (b[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
461
471
|
}
|
|
462
472
|
}
|
|
463
|
-
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");
|
|
464
474
|
if (n) {
|
|
465
|
-
const b =
|
|
475
|
+
const b = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], x = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], A = Math.max(b.length, x.length, v.length);
|
|
466
476
|
for (let m = 0; m < A; m++) {
|
|
467
477
|
const W = [
|
|
468
478
|
((f = b[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
@@ -473,38 +483,38 @@ const Ie = class Ie {
|
|
|
473
483
|
}
|
|
474
484
|
}
|
|
475
485
|
}, "#syncRowHeights"));
|
|
476
|
-
d(this,
|
|
477
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((
|
|
478
|
-
for (const e of
|
|
486
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
487
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((r) => {
|
|
488
|
+
for (const e of r) {
|
|
479
489
|
const s = e.target;
|
|
480
490
|
if (!s.classList.contains("active")) continue;
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
491
|
+
const i = e.contentRect.height;
|
|
492
|
+
if (i > 0) {
|
|
483
493
|
let n = 0;
|
|
484
494
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
485
495
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
486
|
-
const c = Math.max(
|
|
496
|
+
const c = Math.max(i - n, 100);
|
|
487
497
|
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this, H) !== null && (t(this, At).call(this), this.refresh()));
|
|
488
498
|
}
|
|
489
499
|
}
|
|
490
500
|
})), t(this, V).observe(t(this, S)));
|
|
491
501
|
}, "#initResizeObserver"));
|
|
492
502
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
493
|
-
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
494
|
-
const e = t(this, S).querySelector(
|
|
495
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
496
|
-
}), t(this, Dt).call(this), t(this,
|
|
503
|
+
N.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, Ot).call(this, e, r);
|
|
506
|
+
}), t(this, Dt).call(this), t(this, zt).call(this);
|
|
497
507
|
}, "#renderAllContainers"));
|
|
498
|
-
d(this, Ae, /* @__PURE__ */ h((
|
|
508
|
+
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
499
509
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
500
510
|
var l;
|
|
501
511
|
const s = t(this, S).querySelector(e);
|
|
502
512
|
if (!s) return;
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
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 = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
506
516
|
n.forEach((f, u) => {
|
|
507
|
-
const g =
|
|
517
|
+
const g = r + Math.floor(u / a);
|
|
508
518
|
if (g >= c) {
|
|
509
519
|
f.style.display = "none";
|
|
510
520
|
return;
|
|
@@ -514,20 +524,20 @@ const Ie = class Ie {
|
|
|
514
524
|
});
|
|
515
525
|
});
|
|
516
526
|
}, "#adjustBufferRows"));
|
|
517
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
527
|
+
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
518
528
|
var l, f;
|
|
519
529
|
const e = t(this, H);
|
|
520
530
|
if (!e || e <= 0) return;
|
|
521
|
-
const s = t(this, D).data.length,
|
|
531
|
+
const s = t(this, D).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((l = t(this, P).get(".ng-container-body")) == null ? void 0 : l.length) || 1, o = t(this, Q).firstTr, c = o && o.dataset.row !== void 0 ? parseInt(o.dataset.row, 10) : -1;
|
|
522
532
|
(f = t(this, Q)) == null || f.scrollTables.forEach((u) => {
|
|
523
533
|
u.style.transform = `translate3d(0, ${n}px, 0)`;
|
|
524
|
-
}), c !==
|
|
534
|
+
}), c !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
525
535
|
const g = t(this, S).querySelector(u);
|
|
526
536
|
if (!g) return;
|
|
527
537
|
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
528
538
|
if (!b) return;
|
|
529
539
|
Array.from(b.querySelectorAll("tr:not(.nodata)")).forEach((v, A) => {
|
|
530
|
-
const m =
|
|
540
|
+
const m = i + Math.floor(A / a);
|
|
531
541
|
if (m >= s) {
|
|
532
542
|
v.style.display = "none";
|
|
533
543
|
return;
|
|
@@ -551,55 +561,55 @@ const Ie = class Ie {
|
|
|
551
561
|
cell.dataset.row = dataIndex;
|
|
552
562
|
});
|
|
553
563
|
}; */
|
|
554
|
-
d(this, Rt, /* @__PURE__ */ h((
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
const a = Array.from(
|
|
564
|
+
d(this, Rt, /* @__PURE__ */ h((r, e, s) => {
|
|
565
|
+
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
566
|
+
i.dataset.row = s;
|
|
567
|
+
const a = Array.from(i.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
558
568
|
a && typeof a.refresh == "function" && a.refresh();
|
|
559
569
|
});
|
|
560
570
|
}, "#bindRowData"));
|
|
561
571
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
562
572
|
var c, l, f;
|
|
563
573
|
N.log("rowManager.#syncHeaderHeights");
|
|
564
|
-
const
|
|
574
|
+
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");
|
|
565
575
|
if (!e) return;
|
|
566
|
-
const
|
|
576
|
+
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);
|
|
567
577
|
for (let u = 0; u < o; u++) {
|
|
568
578
|
const g = [
|
|
569
|
-
((c =
|
|
579
|
+
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
570
580
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
571
581
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
572
582
|
], b = Math.max(...g);
|
|
573
|
-
b > 0 && (
|
|
583
|
+
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`));
|
|
574
584
|
}
|
|
575
585
|
}, "#syncHeaderHeights"));
|
|
576
586
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
577
587
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
578
588
|
}, "destroy"));
|
|
579
|
-
p(this, D,
|
|
589
|
+
p(this, D, r.getRootNode().host), p(this, S, r), t(this, Pt).call(this);
|
|
580
590
|
}
|
|
581
591
|
getRowHeight() {
|
|
582
592
|
return t(this, H);
|
|
583
593
|
}
|
|
584
|
-
templateLength(
|
|
594
|
+
templateLength(r = ".ng-container-body") {
|
|
585
595
|
var e;
|
|
586
|
-
return ((e = t(this,
|
|
596
|
+
return ((e = t(this, P).get(r)) == null ? void 0 : e.length) || 1;
|
|
587
597
|
}
|
|
588
598
|
};
|
|
589
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(),
|
|
599
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), H = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(), h(Ie, "RowManager");
|
|
590
600
|
let ce = Ie;
|
|
591
601
|
const jt = class jt {
|
|
592
602
|
/**
|
|
593
603
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
594
604
|
*/
|
|
595
|
-
static compileAll(
|
|
596
|
-
return Array.isArray(
|
|
605
|
+
static compileAll(r) {
|
|
606
|
+
return Array.isArray(r) ? r.map((e) => jt.compile(e)) : [];
|
|
597
607
|
}
|
|
598
608
|
/**
|
|
599
609
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
600
610
|
*/
|
|
601
|
-
static compile(
|
|
602
|
-
if (!
|
|
611
|
+
static compile(r) {
|
|
612
|
+
if (!r) return null;
|
|
603
613
|
const e = /* @__PURE__ */ h((o) => {
|
|
604
614
|
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
605
615
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
@@ -623,7 +633,7 @@ const jt = class jt {
|
|
|
623
633
|
l ? l.after(c) : o.prepend(c);
|
|
624
634
|
}
|
|
625
635
|
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
626
|
-
}, "ensureTableStructure"),
|
|
636
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((o, c) => {
|
|
627
637
|
const l = Array.from(o.querySelectorAll(c + " tr")), f = Array.from(o.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
628
638
|
if (u === 0 || f.length === 0) return;
|
|
629
639
|
let g = 0;
|
|
@@ -655,8 +665,8 @@ const jt = class jt {
|
|
|
655
665
|
}
|
|
656
666
|
});
|
|
657
667
|
});
|
|
658
|
-
}, "resetColIndex"), n =
|
|
659
|
-
return s(n), e(n),
|
|
668
|
+
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
669
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, c) => {
|
|
660
670
|
const l = o.getAttribute("fixed");
|
|
661
671
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
662
672
|
f.setAttribute("fixed", l);
|
|
@@ -682,28 +692,28 @@ const yt = class yt extends HTMLElement {
|
|
|
682
692
|
{ selector: ".ng-container-body", type: null },
|
|
683
693
|
{ selector: ".ng-container-left", type: "left" },
|
|
684
694
|
{ selector: ".ng-container-right", type: "right" }
|
|
685
|
-
].forEach(({ selector: s, type:
|
|
695
|
+
].forEach(({ selector: s, type: i }) => {
|
|
686
696
|
const n = this.querySelector(s);
|
|
687
697
|
if (!n) return;
|
|
688
698
|
n.innerHTML = "";
|
|
689
699
|
const a = document.createElement("div");
|
|
690
|
-
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et),
|
|
700
|
+
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
691
701
|
const o = document.createElement("div");
|
|
692
702
|
o.className = "ng-part-body";
|
|
693
703
|
const c = document.createElement("div");
|
|
694
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, et),
|
|
704
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
695
705
|
const l = document.createElement("div");
|
|
696
706
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), o.appendChild(c);
|
|
697
707
|
const f = document.createElement("div");
|
|
698
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et),
|
|
708
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), i, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
699
709
|
});
|
|
700
710
|
}, "#renderSplitContainers"));
|
|
701
711
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
702
712
|
["left", "right", "body"].forEach((e) => {
|
|
703
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
704
|
-
if (!s || !
|
|
713
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
714
|
+
if (!s || !i || i.length === 0) return;
|
|
705
715
|
let n = 0;
|
|
706
|
-
|
|
716
|
+
i[0].querySelectorAll("col").forEach((a) => {
|
|
707
717
|
const o = parseInt(a.getAttribute("width"), 10);
|
|
708
718
|
isNaN(n) || (n += o);
|
|
709
719
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
@@ -715,14 +725,14 @@ const yt = class yt extends HTMLElement {
|
|
|
715
725
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
716
726
|
}, 0));
|
|
717
727
|
}, "generate"));
|
|
718
|
-
d(this, ct, /* @__PURE__ */ h((e, s,
|
|
728
|
+
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
719
729
|
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
720
|
-
if (
|
|
730
|
+
if (i === "header") {
|
|
721
731
|
if (o && o.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
722
732
|
const f = document.createElement("tbody");
|
|
723
733
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
724
734
|
}
|
|
725
|
-
} else
|
|
735
|
+
} else i === "body" ? (a && a.remove(), c && c.remove(), o && (o.className = "bindable-tbody")) : i === "footer" && (a && a.remove(), o && o.remove());
|
|
726
736
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
727
737
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
728
738
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -918,12 +928,12 @@ const _e = class _e extends HTMLElement {
|
|
|
918
928
|
var e;
|
|
919
929
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
920
930
|
var a;
|
|
921
|
-
const
|
|
922
|
-
t(this, qt).call(this, n,
|
|
931
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
932
|
+
t(this, qt).call(this, n, i);
|
|
923
933
|
}), t(this, qt).call(this, 0, !1);
|
|
924
934
|
}, "#init"));
|
|
925
935
|
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
926
|
-
const
|
|
936
|
+
const i = /* @__PURE__ */ h(() => {
|
|
927
937
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
928
938
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
929
939
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
@@ -951,7 +961,7 @@ const _e = class _e extends HTMLElement {
|
|
|
951
961
|
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
952
962
|
l == null || l.forEach((f) => {
|
|
953
963
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
954
|
-
}),
|
|
964
|
+
}), i();
|
|
955
965
|
}, "#switchSheet"));
|
|
956
966
|
}
|
|
957
967
|
connectedCallback() {
|
|
@@ -963,24 +973,24 @@ let de = _e;
|
|
|
963
973
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
964
974
|
var M, Zt, Tt, Gt;
|
|
965
975
|
const Ne = class Ne {
|
|
966
|
-
constructor(
|
|
976
|
+
constructor(r) {
|
|
967
977
|
d(this, M);
|
|
968
978
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
969
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
970
|
-
for (let e of
|
|
979
|
+
t(this, Gt).call(this), new ResizeObserver((r) => {
|
|
980
|
+
for (let e of r)
|
|
971
981
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
972
982
|
}).observe(t(this, M));
|
|
973
983
|
}, "#init"));
|
|
974
984
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
975
985
|
var c, l;
|
|
976
|
-
const
|
|
977
|
-
if (
|
|
978
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
986
|
+
const r = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
987
|
+
if (r.length === 0) return;
|
|
988
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (c = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, a = $t.SCROLLBAR_SIZE, o = e * s + i + n + a;
|
|
979
989
|
t(this, M).style.height = `${o}px`;
|
|
980
990
|
}, "#applyAutoHeight"));
|
|
981
991
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
982
|
-
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true",
|
|
983
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l <
|
|
992
|
+
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, l) => {
|
|
993
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
984
994
|
return u + g;
|
|
985
995
|
}).join(""), a = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
986
996
|
t(this, M).shadowRoot.innerHTML = `
|
|
@@ -1081,32 +1091,32 @@ const Ne = class Ne {
|
|
|
1081
1091
|
});
|
|
1082
1092
|
});
|
|
1083
1093
|
}, "#render"));
|
|
1084
|
-
p(this, M,
|
|
1094
|
+
p(this, M, r), t(this, Zt).call(this);
|
|
1085
1095
|
}
|
|
1086
1096
|
};
|
|
1087
1097
|
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1088
1098
|
let fe = Ne;
|
|
1089
1099
|
var kt, ht;
|
|
1090
1100
|
const We = class We {
|
|
1091
|
-
constructor(
|
|
1101
|
+
constructor(r) {
|
|
1092
1102
|
d(this, kt);
|
|
1093
1103
|
d(this, ht, -1);
|
|
1094
1104
|
E(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1095
|
-
p(this, kt,
|
|
1105
|
+
p(this, kt, r);
|
|
1096
1106
|
}
|
|
1097
1107
|
get at() {
|
|
1098
1108
|
return t(this, ht);
|
|
1099
1109
|
}
|
|
1100
|
-
set at(
|
|
1101
|
-
p(this, ht, parseInt(
|
|
1110
|
+
set at(r) {
|
|
1111
|
+
p(this, ht, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1102
1112
|
});
|
|
1103
1113
|
}
|
|
1104
1114
|
};
|
|
1105
1115
|
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1106
1116
|
let ue = We;
|
|
1107
|
-
var I, T, _, dt, Jt, Y, Qt,
|
|
1117
|
+
var I, T, _, dt, Jt, Y, Qt, rt, Ct, te, ee, ft;
|
|
1108
1118
|
const O = class O {
|
|
1109
|
-
constructor(
|
|
1119
|
+
constructor(r, e) {
|
|
1110
1120
|
d(this, I);
|
|
1111
1121
|
d(this, T);
|
|
1112
1122
|
d(this, _, []);
|
|
@@ -1115,34 +1125,34 @@ const O = class O {
|
|
|
1115
1125
|
d(this, Y, []);
|
|
1116
1126
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1117
1127
|
p(this, Y, []);
|
|
1118
|
-
const
|
|
1119
|
-
Array.from(
|
|
1128
|
+
const r = t(this, I).template || [];
|
|
1129
|
+
Array.from(r).forEach((e) => {
|
|
1120
1130
|
var s;
|
|
1121
1131
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1122
1132
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1123
1133
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1124
1134
|
});
|
|
1125
1135
|
}, "#initialize"));
|
|
1126
|
-
d(this,
|
|
1127
|
-
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1128
|
-
|
|
1136
|
+
d(this, rt, /* @__PURE__ */ h(() => {
|
|
1137
|
+
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((r) => {
|
|
1138
|
+
r.invalidate();
|
|
1129
1139
|
});
|
|
1130
1140
|
}, "#invalidate"));
|
|
1131
|
-
E(this, "get", /* @__PURE__ */ h((
|
|
1141
|
+
E(this, "get", /* @__PURE__ */ h((r, e) => {
|
|
1132
1142
|
var n;
|
|
1133
1143
|
const s = this.getValidData();
|
|
1134
1144
|
if (!s || s.length <= 0) return;
|
|
1135
|
-
if (
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1145
|
+
if (r == null) return t(this, ft).call(this, s);
|
|
1146
|
+
if (r < 0 || r >= s.length) return null;
|
|
1147
|
+
const i = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1138
1148
|
if (e != null) {
|
|
1139
|
-
const a =
|
|
1140
|
-
return a >= 0 ? s[
|
|
1149
|
+
const a = i.indexOf(e);
|
|
1150
|
+
return a >= 0 ? s[r].v[a] : null;
|
|
1141
1151
|
}
|
|
1142
|
-
return t(this, ft).call(this, s[
|
|
1152
|
+
return t(this, ft).call(this, s[r]);
|
|
1143
1153
|
}, "get"));
|
|
1144
|
-
E(this, "set", /* @__PURE__ */ h((
|
|
1145
|
-
this.clear(), this.add(
|
|
1154
|
+
E(this, "set", /* @__PURE__ */ h((r) => {
|
|
1155
|
+
this.clear(), this.add(r, !1), t(this, rt).call(this);
|
|
1146
1156
|
}, "set"));
|
|
1147
1157
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1148
1158
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1154,84 +1164,84 @@ const O = class O {
|
|
|
1154
1164
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1155
1165
|
}), "#getDefaultMeta"));
|
|
1156
1166
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1157
|
-
p(this, _, []), p(this, dt, []), t(this,
|
|
1167
|
+
p(this, _, []), p(this, dt, []), t(this, rt).call(this);
|
|
1158
1168
|
}, "reset"));
|
|
1159
1169
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1160
|
-
var i;
|
|
1161
|
-
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1162
|
-
}, "clear"));
|
|
1163
|
-
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1164
1170
|
var r;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1171
|
+
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1172
|
+
}, "clear"));
|
|
1173
|
+
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1174
|
+
var i;
|
|
1175
|
+
Array.isArray(r) || (r = [r]);
|
|
1176
|
+
const e = typeof ((i = t(this, I).fields) == null ? void 0 : i.get) == "function" ? t(this, I).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
1177
|
+
return r.forEach((n) => {
|
|
1168
1178
|
const a = { v: [] };
|
|
1169
1179
|
e.forEach((o) => {
|
|
1170
1180
|
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1171
1181
|
}), s.push(a);
|
|
1172
1182
|
}), s;
|
|
1173
1183
|
}, "#json2Array"));
|
|
1174
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1184
|
+
d(this, ee, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1175
1185
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1176
|
-
}),
|
|
1177
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1178
|
-
|
|
1179
|
-
const s = t(this, te).call(this,
|
|
1186
|
+
}), r), "#defaultInsert"));
|
|
1187
|
+
E(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1188
|
+
r === void 0 && (r = {});
|
|
1189
|
+
const s = t(this, te).call(this, r);
|
|
1180
1190
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1181
|
-
const
|
|
1191
|
+
const i = this.count() - 1;
|
|
1182
1192
|
return e || s.forEach((n, a) => {
|
|
1183
|
-
const o = t(this, T).rawRecords[
|
|
1193
|
+
const o = t(this, T).rawRecords[i - a];
|
|
1184
1194
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1185
|
-
}), t(this,
|
|
1195
|
+
}), t(this, rt).call(this), i;
|
|
1186
1196
|
}, "add"));
|
|
1187
|
-
E(this, "delete", /* @__PURE__ */ h((
|
|
1197
|
+
E(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1188
1198
|
let e = [];
|
|
1189
|
-
Array.isArray(
|
|
1199
|
+
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) => {
|
|
1190
1200
|
if (t(this, _)[s]) {
|
|
1191
|
-
const
|
|
1192
|
-
t(this, _)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1193
|
-
n.__ng.rowid ===
|
|
1201
|
+
const i = t(this, _)[s].__ng.rowid;
|
|
1202
|
+
t(this, _)[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) => {
|
|
1203
|
+
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1194
1204
|
});
|
|
1195
1205
|
}
|
|
1196
|
-
}), this.resetRecords(), t(this,
|
|
1206
|
+
}), this.resetRecords(), t(this, rt).call(this);
|
|
1197
1207
|
}, "delete"));
|
|
1198
|
-
E(this, "setValue", /* @__PURE__ */ h((
|
|
1208
|
+
E(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1199
1209
|
var c;
|
|
1200
|
-
|
|
1210
|
+
r = parseInt(r, 10);
|
|
1201
1211
|
const n = (typeof ((c = t(this, I).fields) == null ? void 0 : c.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
1202
1212
|
if (n < 0) return;
|
|
1203
|
-
const a = this.getValidData()[
|
|
1213
|
+
const a = this.getValidData()[r];
|
|
1204
1214
|
if (!a) return;
|
|
1205
1215
|
const o = a.v[n];
|
|
1206
1216
|
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;
|
|
1207
1217
|
}, "setValue"));
|
|
1208
1218
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1209
|
-
p(this, dt, t(this, T).rawRecords.filter((
|
|
1210
|
-
|
|
1211
|
-
}), t(this, _).forEach((
|
|
1212
|
-
|
|
1219
|
+
p(this, dt, t(this, T).rawRecords.filter((r) => !r.__ng.deleted)), p(this, _, t(this, T).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, T).rawRecords.forEach((r, e) => {
|
|
1220
|
+
r.__ng.rowidx = e;
|
|
1221
|
+
}), t(this, _).forEach((r, e) => {
|
|
1222
|
+
r.__ng.i = e;
|
|
1213
1223
|
});
|
|
1214
1224
|
}, "resetRecords"));
|
|
1215
1225
|
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, _).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1216
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1226
|
+
d(this, ft, /* @__PURE__ */ h((r) => {
|
|
1217
1227
|
var a;
|
|
1218
|
-
if (!
|
|
1219
|
-
const e = !Array.isArray(
|
|
1228
|
+
if (!r) return r;
|
|
1229
|
+
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((a = t(this, I).fields) == null ? void 0 : a.get) == "function" ? t(this, I).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1220
1230
|
const c = {};
|
|
1221
|
-
return
|
|
1231
|
+
return i.forEach((l, f) => {
|
|
1222
1232
|
c[l] = o.v ? o.v[f] : o[l];
|
|
1223
1233
|
}), c.__ng = o.__ng, c;
|
|
1224
1234
|
});
|
|
1225
1235
|
return e ? n[0] : n;
|
|
1226
1236
|
}, "#conv"));
|
|
1227
1237
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1228
|
-
p(this, I,
|
|
1238
|
+
p(this, I, r), p(this, T, e), t(this, Qt).call(this);
|
|
1229
1239
|
}
|
|
1230
1240
|
get source() {
|
|
1231
1241
|
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1232
1242
|
}
|
|
1233
|
-
set source(
|
|
1234
|
-
this.clear(), this.add(
|
|
1243
|
+
set source(r) {
|
|
1244
|
+
this.clear(), this.add(r, !1);
|
|
1235
1245
|
}
|
|
1236
1246
|
get nextId() {
|
|
1237
1247
|
return ++Ue(this, Jt)._;
|
|
@@ -1246,7 +1256,7 @@ const O = class O {
|
|
|
1246
1256
|
return this.length;
|
|
1247
1257
|
}
|
|
1248
1258
|
};
|
|
1249
|
-
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1259
|
+
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), rt = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1250
1260
|
E(O, "ROW_STATE", {
|
|
1251
1261
|
EMPTY: "EMPTY",
|
|
1252
1262
|
NORMAL: "NORMAL",
|
|
@@ -1255,56 +1265,56 @@ E(O, "ROW_STATE", {
|
|
|
1255
1265
|
DELETE: "DELETE"
|
|
1256
1266
|
});
|
|
1257
1267
|
let ge = O;
|
|
1258
|
-
var
|
|
1268
|
+
var it;
|
|
1259
1269
|
const Oe = class Oe {
|
|
1260
|
-
constructor(
|
|
1261
|
-
d(this,
|
|
1262
|
-
p(this,
|
|
1270
|
+
constructor(r) {
|
|
1271
|
+
d(this, it);
|
|
1272
|
+
p(this, it, r), this.row = new ue(this), this.data = new ge(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1263
1273
|
var e;
|
|
1264
|
-
(e = t(this,
|
|
1274
|
+
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1265
1275
|
}, this.setDataSource = (e) => {
|
|
1266
1276
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1267
1277
|
}, this.getRowState = (e) => {
|
|
1268
|
-
var
|
|
1278
|
+
var i, n;
|
|
1269
1279
|
const s = parseInt(e, 10);
|
|
1270
1280
|
if (!(s >= this.data.count()))
|
|
1271
|
-
return (n = (
|
|
1281
|
+
return (n = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : n.rowState;
|
|
1272
1282
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1273
1283
|
this.row.at = e;
|
|
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,
|
|
1275
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1284
|
+
}, 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) => {
|
|
1285
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1276
1286
|
}, this.setDataSource([]);
|
|
1277
1287
|
}
|
|
1278
1288
|
};
|
|
1279
|
-
|
|
1289
|
+
it = new WeakMap(), h(Oe, "ngDataManager");
|
|
1280
1290
|
let be = Oe;
|
|
1281
1291
|
var ut, L, Lt, se;
|
|
1282
1292
|
const Be = class Be {
|
|
1283
1293
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1284
|
-
constructor(
|
|
1294
|
+
constructor(r) {
|
|
1285
1295
|
d(this, ut);
|
|
1286
1296
|
d(this, L, []);
|
|
1287
|
-
E(this, "add", /* @__PURE__ */ h((
|
|
1288
|
-
|
|
1289
|
-
t(this, L).some((
|
|
1297
|
+
E(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1298
|
+
r.forEach((s) => {
|
|
1299
|
+
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1290
1300
|
}), t(this, Lt).call(this);
|
|
1291
1301
|
}, "add"));
|
|
1292
1302
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1293
|
-
const
|
|
1303
|
+
const r = /* @__PURE__ */ new Map();
|
|
1294
1304
|
t(this, L).forEach((e) => {
|
|
1295
|
-
|
|
1296
|
-
}), p(this, L, Array.from(
|
|
1305
|
+
r.set(e.name, e.type);
|
|
1306
|
+
}), p(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), p(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);
|
|
1297
1307
|
}, "#adjust"));
|
|
1298
1308
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1299
1309
|
p(this, L, []), N.log(t(this, ut).querySelectorAll("table"));
|
|
1300
|
-
const
|
|
1301
|
-
if (!(!
|
|
1302
|
-
for (const e of
|
|
1303
|
-
N.log(e), $("[data-bind]", e).each((s,
|
|
1304
|
-
const n =
|
|
1310
|
+
const r = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1311
|
+
if (!(!r || r.length === 0)) {
|
|
1312
|
+
for (const e of r)
|
|
1313
|
+
N.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1314
|
+
const n = i.dataset.bind, a = i.getAttribute("data-type") || "string";
|
|
1305
1315
|
n && t(this, L).push({ name: n, type: a });
|
|
1306
1316
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1307
|
-
$(`[${s}]`, e).each((
|
|
1317
|
+
$(`[${s}]`, e).each((i, n) => {
|
|
1308
1318
|
var a = n.getAttribute(s);
|
|
1309
1319
|
if (a.indexOf("data.") < 0) {
|
|
1310
1320
|
const o = a.search(/[(]/g);
|
|
@@ -1327,44 +1337,44 @@ const Be = class Be {
|
|
|
1327
1337
|
t(this, Lt).call(this);
|
|
1328
1338
|
}
|
|
1329
1339
|
}, "#init"));
|
|
1330
|
-
p(this, ut,
|
|
1340
|
+
p(this, ut, r), t(this, se).call(this);
|
|
1331
1341
|
}
|
|
1332
1342
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1333
1343
|
get() {
|
|
1334
|
-
return t(this, L).map((
|
|
1344
|
+
return t(this, L).map((r) => r.name);
|
|
1335
1345
|
}
|
|
1336
1346
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1337
1347
|
getFields() {
|
|
1338
1348
|
return t(this, L);
|
|
1339
1349
|
}
|
|
1340
1350
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1341
|
-
getType(
|
|
1342
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1351
|
+
getType(r) {
|
|
1352
|
+
const e = t(this, L).find((s) => s.name === r);
|
|
1343
1353
|
return e ? e.type : "string";
|
|
1344
1354
|
}
|
|
1345
|
-
indexOf(
|
|
1346
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1355
|
+
indexOf(r) {
|
|
1356
|
+
return t(this, L).findIndex((e) => e.name === r);
|
|
1347
1357
|
}
|
|
1348
|
-
includes(
|
|
1349
|
-
return t(this, L).some((e) => e.name ===
|
|
1358
|
+
includes(r) {
|
|
1359
|
+
return t(this, L).some((e) => e.name === r);
|
|
1350
1360
|
}
|
|
1351
1361
|
};
|
|
1352
1362
|
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1353
1363
|
let pe = Be;
|
|
1354
|
-
var nt,
|
|
1355
|
-
const
|
|
1364
|
+
var nt, re, ie;
|
|
1365
|
+
const ze = class ze extends HTMLElement {
|
|
1356
1366
|
constructor() {
|
|
1357
1367
|
super();
|
|
1358
1368
|
//#created = false;
|
|
1359
1369
|
d(this, nt);
|
|
1360
|
-
d(this,
|
|
1361
|
-
d(this,
|
|
1362
|
-
this.fields = new pe(this), p(this,
|
|
1370
|
+
d(this, re);
|
|
1371
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1372
|
+
this.fields = new pe(this), p(this, re, new fe(this)), N.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1363
1373
|
}, "#init"));
|
|
1364
1374
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
1365
1375
|
}
|
|
1366
1376
|
connectedCallback() {
|
|
1367
|
-
t(this,
|
|
1377
|
+
t(this, ie).call(this);
|
|
1368
1378
|
}
|
|
1369
1379
|
disconnectedCallback() {
|
|
1370
1380
|
N.log("NineTable disconnected.");
|
|
@@ -1382,8 +1392,8 @@ const Pe = class Pe extends HTMLElement {
|
|
|
1382
1392
|
return t(this, nt);
|
|
1383
1393
|
}
|
|
1384
1394
|
};
|
|
1385
|
-
nt = new WeakMap(),
|
|
1386
|
-
let ye =
|
|
1395
|
+
nt = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1396
|
+
let ye = ze;
|
|
1387
1397
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1388
1398
|
const mt = class mt extends HTMLElement {
|
|
1389
1399
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
@@ -1399,7 +1409,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1399
1409
|
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
1410
|
let me = mt;
|
|
1401
1411
|
var k, Ht, y, Re, qe, Te, ke, Ce;
|
|
1402
|
-
const
|
|
1412
|
+
const Pe = class Pe extends me {
|
|
1403
1413
|
constructor() {
|
|
1404
1414
|
super();
|
|
1405
1415
|
d(this, k);
|
|
@@ -1412,13 +1422,13 @@ const ze = class ze extends me {
|
|
|
1412
1422
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1413
1423
|
if (t(this, y))
|
|
1414
1424
|
if (t(this, y).closest("tbody")) {
|
|
1415
|
-
const s = t(this, y).closest("tr").data,
|
|
1425
|
+
const s = t(this, y).closest("tr").data, i = parseInt(t(this, y).dataset.row);
|
|
1416
1426
|
if (!s) return "";
|
|
1417
1427
|
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1418
1428
|
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1419
1429
|
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1420
1430
|
} else try {
|
|
1421
|
-
return this.getExprValue(t(this, y).dataset.expr, s,
|
|
1431
|
+
return this.getExprValue(t(this, y).dataset.expr, s, i, t(this, y));
|
|
1422
1432
|
} catch {
|
|
1423
1433
|
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1424
1434
|
}
|
|
@@ -1433,14 +1443,14 @@ const ze = class ze extends me {
|
|
|
1433
1443
|
if (!(!t(this, k) || !t(this, k).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1434
1444
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1435
1445
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1436
|
-
var s = t(this, y).closest("tr"),
|
|
1446
|
+
var s = t(this, y).closest("tr"), i = [];
|
|
1437
1447
|
$("th,td", s).each((m, W) => {
|
|
1438
1448
|
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1439
|
-
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e &&
|
|
1440
|
-
}),
|
|
1449
|
+
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && i.push(C));
|
|
1450
|
+
}), i.sort();
|
|
1441
1451
|
var n = !1;
|
|
1442
1452
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
1443
|
-
for (var a of
|
|
1453
|
+
for (var a of i) {
|
|
1444
1454
|
if (a > e) break;
|
|
1445
1455
|
var o = parseInt(t(this, y).dataset.row), c = o - 1, l = t(this, y).closest("tr").data, f = t(this, k).data.get(c);
|
|
1446
1456
|
t(this, y).dataset.matrixRow;
|
|
@@ -1458,12 +1468,12 @@ const ze = class ze extends me {
|
|
|
1458
1468
|
}
|
|
1459
1469
|
}
|
|
1460
1470
|
}, "#resetSuppress"));
|
|
1461
|
-
E(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1471
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
1462
1472
|
if (typeof e < "u")
|
|
1463
1473
|
try {
|
|
1464
|
-
|
|
1474
|
+
i = parseInt(i);
|
|
1465
1475
|
const a = e.replace("()", "");
|
|
1466
|
-
return t(this, k)[a] ? t(this, k)[a].call(this, s,
|
|
1476
|
+
return t(this, k)[a] ? t(this, k)[a].call(this, s, i, t(this, y)) : t(this, k).exprFunction(e).call(this, s, i, t(this, k).data);
|
|
1467
1477
|
} catch {
|
|
1468
1478
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1469
1479
|
}
|
|
@@ -1480,8 +1490,8 @@ const ze = class ze extends me {
|
|
|
1480
1490
|
}
|
|
1481
1491
|
set value(e) {
|
|
1482
1492
|
var s = parseInt(t(this, y).dataset.row);
|
|
1483
|
-
const
|
|
1484
|
-
s < 0 ? t(this, k).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e,
|
|
1493
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1494
|
+
s < 0 ? t(this, k).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, i) : t(this, k).data.setValue(s, t(this, y).dataset.bind, e, i);
|
|
1485
1495
|
}
|
|
1486
1496
|
get row() {
|
|
1487
1497
|
return parseInt(t(this, y).dataset.row);
|
|
@@ -1494,8 +1504,8 @@ const ze = class ze extends me {
|
|
|
1494
1504
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1495
1505
|
}
|
|
1496
1506
|
};
|
|
1497
|
-
k = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(
|
|
1498
|
-
let xe =
|
|
1507
|
+
k = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(Pe, "CellElement");
|
|
1508
|
+
let xe = Pe;
|
|
1499
1509
|
const De = class De extends xe {
|
|
1500
1510
|
constructor() {
|
|
1501
1511
|
super();
|
|
@@ -1558,9 +1568,9 @@ const je = class je extends ve {
|
|
|
1558
1568
|
if (t(this, ot) == "number") {
|
|
1559
1569
|
let n = [];
|
|
1560
1570
|
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 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,
|
|
1562
|
-
if (
|
|
1563
|
-
var s = s.substr(
|
|
1571
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1572
|
+
if (i >= 0) {
|
|
1573
|
+
var s = s.substr(i + 1, s.length);
|
|
1564
1574
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1565
1575
|
}
|
|
1566
1576
|
}
|