@ninebone/table 0.0.555 β 0.0.557
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 +334 -332
- 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
|
@@ -3,8 +3,8 @@ var Ve = (R) => {
|
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
5
|
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var h = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
8
|
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), p = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
9
|
var Ue = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -20,70 +20,70 @@ const He = class He extends Ke.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
h(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const N = new oe();
|
|
26
|
-
var
|
|
26
|
+
var P, 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, P);
|
|
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
|
-
d(this, It, /* @__PURE__ */
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, P)) return;
|
|
38
|
+
const e = t(this, P).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
|
-
|
|
44
|
-
if (!t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, P) || !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 r = t(this, w).track, n = t(this, w).thumb,
|
|
48
|
-
if (
|
|
49
|
-
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, a = t(this, P).querySelector(".ng-container-bottom"), o = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (o !== 0 && c > o)
|
|
49
|
+
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (
|
|
56
|
+
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft, g =
|
|
58
|
+
const u = e.scrollLeft, g = c - o;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
|
-
const
|
|
62
|
-
b >
|
|
61
|
+
const x = l - f;
|
|
62
|
+
b > x && (b = x), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, G, /* @__PURE__ */
|
|
64
|
+
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this, w).track.getBoundingClientRect(),
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
|
+
let o = e;
|
|
70
|
+
o < 0 && (o = 0);
|
|
71
|
+
const c = n.width - a;
|
|
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
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = o / c * u), o > 0 && o < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, _t, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, G).call(this, n + r), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
|
-
const
|
|
83
|
-
t(this, G).call(this,
|
|
82
|
+
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, a + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
@@ -95,24 +95,24 @@ const Me = class Me extends HTMLElement {
|
|
|
95
95
|
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this, w).track.getBoundingClientRect(),
|
|
99
|
-
t(this, G).call(this, r.clientX - n.left -
|
|
98
|
+
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - a / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
-
const n = /* @__PURE__ */
|
|
103
|
+
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
p(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
105
|
+
const c = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, o.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
108
|
+
p(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, P, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, P)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,8 +176,8 @@ const Me = class Me extends HTMLElement {
|
|
|
176
176
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
|
-
const e = /* @__PURE__ */
|
|
180
|
-
const s = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ h(() => {
|
|
180
|
+
const s = t(this, P).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
|
+
P = 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;
|
|
@@ -211,9 +211,9 @@ const $e = class $e extends HTMLElement {
|
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
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, r = t(this, q).thumb, n = e.clientHeight,
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = 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
|
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
@@ -224,41 +224,41 @@ const $e = class $e extends HTMLElement {
|
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
|
-
let
|
|
228
|
-
b > 0 && (
|
|
227
|
+
let x = 0;
|
|
228
|
+
b > 0 && (x = g / b * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
|
|
230
|
+
x < 0 && (x = 0), x > v && (x = v), r.style.top = `${x}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Nt, /* @__PURE__ */
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
N.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this, q).container, s = /* @__PURE__ */
|
|
235
|
-
const n = (t(this, F).data.get() || []).length,
|
|
236
|
-
return n *
|
|
234
|
+
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, a = t(this, at).getRowHeight();
|
|
236
|
+
return n * a;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), p(this, J, !0), p(this, xt, r.clientY), p(this, vt, e.scrollTop);
|
|
243
|
-
const n = /* @__PURE__ */
|
|
243
|
+
const n = /* @__PURE__ */ h((o) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
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);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
|
|
247
|
+
const A = g / u * v;
|
|
248
|
+
let m = t(this, vt) + A;
|
|
249
|
+
const W = Math.max(0, x - b);
|
|
250
|
+
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup",
|
|
253
|
+
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
254
|
+
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
257
257
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
258
258
|
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
259
|
-
const n = t(this, q).track.getBoundingClientRect(),
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = r.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
|
-
const b = Math.max(0, Math.min(1,
|
|
261
|
+
const b = Math.max(0, Math.min(1, o / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
@@ -334,7 +334,7 @@ const $e = class $e extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
337
|
+
const e = /* @__PURE__ */ h(() => {
|
|
338
338
|
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
@@ -351,16 +351,16 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(),
|
|
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, z, H, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, Pt, zt, At, Ae, lt, Rt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
360
|
d(this, D);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, z, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, H, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
@@ -368,51 +368,52 @@ const Ie = class Ie {
|
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
d(this, Wt, 3);
|
|
371
|
-
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
N.log("rowManager.refresh");
|
|
374
374
|
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
375
|
i && (t(this, St).call(this), t(this, lt).call(this, i.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,
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
386
|
-
const l =
|
|
381
|
+
}), p(this, H, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
382
|
+
const o = t(this, S).querySelector(a);
|
|
383
|
+
if (!o) return;
|
|
384
|
+
const c = o.querySelector(".ng-part-body table");
|
|
385
|
+
if (!c) return;
|
|
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, z).set(a, u);
|
|
390
390
|
});
|
|
391
391
|
const i = 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"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
-
i && (t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop), i.addEventListener("scroll", () => {
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
i && (t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop), i.addEventListener("scroll", (a) => {
|
|
393
|
+
a.stopPropagation();
|
|
394
|
+
const o = i.scrollTop, c = i.scrollLeft;
|
|
395
|
+
e && (e.scrollTop = o), s && (s.scrollTop = o), r && (r.scrollLeft = c), n && (n.scrollLeft = c), t(this, lt).call(this, o);
|
|
395
396
|
}));
|
|
396
397
|
}, "initialize"));
|
|
397
|
-
d(this, Ot, /* @__PURE__ */
|
|
398
|
+
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
398
399
|
N.log("rowManager.#renderRows");
|
|
399
|
-
const s = t(this,
|
|
400
|
+
const s = t(this, z).get(e);
|
|
400
401
|
if (!s || s.length === 0) return;
|
|
401
402
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
402
403
|
if (!r) return;
|
|
403
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
404
|
-
const n = r.querySelector("tr.nodata"),
|
|
405
|
-
for (let
|
|
406
|
-
s.forEach((
|
|
407
|
-
|
|
404
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
405
|
+
const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
406
|
+
for (let o = 0; o < t(this, wt); o++)
|
|
407
|
+
s.forEach((c) => {
|
|
408
|
+
a.appendChild(c.cloneNode(!0));
|
|
408
409
|
});
|
|
409
|
-
n ? n.before(
|
|
410
|
+
n ? n.before(a) : r.appendChild(a), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
410
411
|
}, "#renderRows"));
|
|
411
|
-
d(this, Bt, /* @__PURE__ */
|
|
412
|
+
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
412
413
|
if (N.log("rowManager.#measureAndCacheHeight"), t(this, H) !== null && t(this, H) > 0)
|
|
413
414
|
return t(this, H);
|
|
414
415
|
N.log("#measureAndCacheHeight");
|
|
415
|
-
const e = t(this,
|
|
416
|
+
const e = t(this, z).get(".ng-container-body");
|
|
416
417
|
if (!e || e.length === 0) return 24;
|
|
417
418
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
418
419
|
if (!s) return 24;
|
|
@@ -421,58 +422,58 @@ const Ie = class Ie {
|
|
|
421
422
|
e.forEach((g) => {
|
|
422
423
|
n.appendChild(g.cloneNode(!0));
|
|
423
424
|
}), r ? r.before(n) : s.appendChild(n);
|
|
424
|
-
const
|
|
425
|
-
(
|
|
425
|
+
const a = t(this, S), o = a.style.display, c = a.style.visibility, l = a.style.position;
|
|
426
|
+
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
426
427
|
let f = 0;
|
|
427
428
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
428
429
|
return u.forEach((g) => {
|
|
429
430
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
430
|
-
}), u.forEach((g) => g.remove()),
|
|
431
|
+
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = c, a.style.position = l, p(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
|
|
431
432
|
}, "#measureAndCacheHeight"));
|
|
432
|
-
d(this, St, /* @__PURE__ */
|
|
433
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
433
434
|
N.log("rowManager.#updateVirtualScrollHeight");
|
|
434
435
|
const e = (t(this, D).data.get() || []).length, s = t(this, H), r = e * s;
|
|
435
436
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
438
|
-
const
|
|
439
|
-
|
|
437
|
+
const a = t(this, S).querySelector(n);
|
|
438
|
+
if (!a) return;
|
|
439
|
+
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
440
|
+
o && (o.style.height = `${r}px`);
|
|
440
441
|
});
|
|
441
442
|
}, "#updateVirtualScrollHeight"));
|
|
442
|
-
d(this, Et, /* @__PURE__ */
|
|
443
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
443
444
|
if (t(this, tt) > 0 && t(this, H) > 0) {
|
|
444
445
|
const i = Math.ceil(t(this, tt) / t(this, H));
|
|
445
446
|
p(this, wt, i + t(this, Wt));
|
|
446
447
|
}
|
|
447
448
|
}, "#updateRowCount"));
|
|
448
|
-
d(this,
|
|
449
|
-
var
|
|
449
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
450
|
+
var o, c, l, f, u, g;
|
|
450
451
|
const i = 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");
|
|
451
452
|
if (e) {
|
|
452
|
-
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [],
|
|
453
|
-
for (let
|
|
454
|
-
const
|
|
455
|
-
((
|
|
456
|
-
((
|
|
457
|
-
((l = v[
|
|
458
|
-
], C = Math.max(...
|
|
459
|
-
C > 0 && (b[
|
|
453
|
+
const b = i ? Array.from(i.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
|
+
for (let m = 0; m < A; m++) {
|
|
455
|
+
const W = [
|
|
456
|
+
((o = b[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
457
|
+
((c = x[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
458
|
+
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
459
|
+
], C = Math.max(...W);
|
|
460
|
+
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`));
|
|
460
461
|
}
|
|
461
462
|
}
|
|
462
|
-
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"),
|
|
463
|
+
const r = 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");
|
|
463
464
|
if (n) {
|
|
464
|
-
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
465
|
-
for (let
|
|
466
|
-
const
|
|
467
|
-
((f = b[
|
|
468
|
-
((u = m
|
|
469
|
-
((g = v[
|
|
470
|
-
], C = Math.max(...
|
|
471
|
-
C > 0 && (b[
|
|
465
|
+
const b = r ? Array.from(r.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
|
+
for (let m = 0; m < A; m++) {
|
|
467
|
+
const W = [
|
|
468
|
+
((f = b[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
469
|
+
((u = x[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
470
|
+
((g = v[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
471
|
+
], C = Math.max(...W);
|
|
472
|
+
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`));
|
|
472
473
|
}
|
|
473
474
|
}
|
|
474
475
|
}, "#syncRowHeights"));
|
|
475
|
-
d(this,
|
|
476
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
476
477
|
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((i) => {
|
|
477
478
|
for (const e of i) {
|
|
478
479
|
const s = e.target;
|
|
@@ -480,31 +481,31 @@ const Ie = class Ie {
|
|
|
480
481
|
const r = e.contentRect.height;
|
|
481
482
|
if (r > 0) {
|
|
482
483
|
let n = 0;
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
t(this, tt) !==
|
|
484
|
+
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
485
|
+
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
486
|
+
const c = Math.max(r - n, 100);
|
|
487
|
+
t(this, tt) !== c && (p(this, tt, c), t(this, Et).call(this), t(this, H) !== null && (t(this, At).call(this), this.refresh()));
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
490
|
})), t(this, V).observe(t(this, S)));
|
|
490
491
|
}, "#initResizeObserver"));
|
|
491
|
-
d(this, At, /* @__PURE__ */
|
|
492
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
492
493
|
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
493
494
|
const e = t(this, S).querySelector(i);
|
|
494
495
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
495
|
-
}), t(this, Dt).call(this), t(this,
|
|
496
|
+
}), t(this, Dt).call(this), t(this, Pt).call(this);
|
|
496
497
|
}, "#renderAllContainers"));
|
|
497
|
-
d(this, Ae, /* @__PURE__ */
|
|
498
|
+
d(this, Ae, /* @__PURE__ */ h((i) => {
|
|
498
499
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
499
500
|
var l;
|
|
500
501
|
const s = t(this, S).querySelector(e);
|
|
501
502
|
if (!s) return;
|
|
502
503
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
503
504
|
if (!r) return;
|
|
504
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")),
|
|
505
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), a = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
505
506
|
n.forEach((f, u) => {
|
|
506
|
-
const g = i + Math.floor(u /
|
|
507
|
-
if (g >=
|
|
507
|
+
const g = i + Math.floor(u / a);
|
|
508
|
+
if (g >= c) {
|
|
508
509
|
f.style.display = "none";
|
|
509
510
|
return;
|
|
510
511
|
}
|
|
@@ -513,25 +514,26 @@ const Ie = class Ie {
|
|
|
513
514
|
});
|
|
514
515
|
});
|
|
515
516
|
}, "#adjustBufferRows"));
|
|
516
|
-
d(this, lt, /* @__PURE__ */
|
|
517
|
-
var
|
|
517
|
+
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
518
|
+
var l, f;
|
|
518
519
|
const e = t(this, H);
|
|
519
520
|
if (!e || e <= 0) return;
|
|
520
|
-
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = ((
|
|
521
|
-
(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
const g = u.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
|
+
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = r * e, a = ((l = t(this, z).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
|
+
(f = t(this, Q)) == null || f.scrollTables.forEach((u) => {
|
|
523
|
+
u.style.transform = `translate3d(0, ${n}px, 0)`;
|
|
524
|
+
}), c !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
525
|
+
const g = t(this, S).querySelector(u);
|
|
526
526
|
if (!g) return;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
527
|
+
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
528
|
+
if (!b) return;
|
|
529
|
+
Array.from(b.querySelectorAll("tr:not(.nodata)")).forEach((v, A) => {
|
|
530
|
+
const m = r + Math.floor(A / a);
|
|
531
|
+
if (m >= s) {
|
|
532
|
+
v.style.display = "none";
|
|
531
533
|
return;
|
|
532
534
|
}
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
+
const W = t(this, D).data.get(m);
|
|
536
|
+
v.style.display = "", t(this, Rt).call(this, v, W, m);
|
|
535
537
|
});
|
|
536
538
|
});
|
|
537
539
|
}, "#handleScroll"));
|
|
@@ -549,42 +551,42 @@ const Ie = class Ie {
|
|
|
549
551
|
cell.dataset.row = dataIndex;
|
|
550
552
|
});
|
|
551
553
|
}; */
|
|
552
|
-
d(this, Rt, /* @__PURE__ */
|
|
554
|
+
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
553
555
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
554
556
|
r.dataset.row = s;
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
+
const a = Array.from(r.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
558
|
+
a && typeof a.refresh == "function" && a.refresh();
|
|
557
559
|
});
|
|
558
560
|
}, "#bindRowData"));
|
|
559
|
-
d(this, Dt, /* @__PURE__ */
|
|
560
|
-
var
|
|
561
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
562
|
+
var c, l, f;
|
|
561
563
|
N.log("rowManager.#syncHeaderHeights");
|
|
562
564
|
const i = 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");
|
|
563
565
|
if (!e) return;
|
|
564
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
565
|
-
for (let u = 0; u <
|
|
566
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(r.length, n.length, a.length);
|
|
567
|
+
for (let u = 0; u < o; u++) {
|
|
566
568
|
const g = [
|
|
567
|
-
((
|
|
569
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
568
570
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
569
|
-
((f =
|
|
571
|
+
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
570
572
|
], b = Math.max(...g);
|
|
571
|
-
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`),
|
|
573
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), a[u] && (a[u].style.height = `${b}px`));
|
|
572
574
|
}
|
|
573
575
|
}, "#syncHeaderHeights"));
|
|
574
|
-
|
|
576
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
575
577
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
576
578
|
}, "destroy"));
|
|
577
|
-
p(this, D, i.getRootNode().host), p(this, S, i), t(this,
|
|
579
|
+
p(this, D, i.getRootNode().host), p(this, S, i), t(this, zt).call(this);
|
|
578
580
|
}
|
|
579
581
|
getRowHeight() {
|
|
580
582
|
return t(this, H);
|
|
581
583
|
}
|
|
582
584
|
templateLength(i = ".ng-container-body") {
|
|
583
585
|
var e;
|
|
584
|
-
return ((e = t(this,
|
|
586
|
+
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
587
|
}
|
|
586
588
|
};
|
|
587
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(),
|
|
589
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), z = 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(), Pt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(), h(Ie, "RowManager");
|
|
588
590
|
let ce = Ie;
|
|
589
591
|
const jt = class jt {
|
|
590
592
|
/**
|
|
@@ -598,72 +600,72 @@ const jt = class jt {
|
|
|
598
600
|
*/
|
|
599
601
|
static compile(i) {
|
|
600
602
|
if (!i) return null;
|
|
601
|
-
const e = /* @__PURE__ */
|
|
602
|
-
|
|
603
|
+
const e = /* @__PURE__ */ h((o) => {
|
|
604
|
+
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
603
605
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
604
606
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
605
607
|
let u = `cell-${f}`;
|
|
606
|
-
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"),
|
|
607
|
-
let
|
|
608
|
-
g &&
|
|
608
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), x = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
609
|
+
let A = [];
|
|
610
|
+
g && A.push(`data-bind="${g}"`), b && A.push(`data-expr="${b}"`), x && A.push(`maxbyte="${x}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
609
611
|
});
|
|
610
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
611
|
-
if (!
|
|
612
|
-
const
|
|
612
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
613
|
+
if (!o.querySelector("colgroup")) {
|
|
614
|
+
const c = o.querySelector("tbody tr") || o.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / l), 100);
|
|
613
615
|
for (let g = 0; g < l; g++) {
|
|
614
616
|
const b = document.createElement("col");
|
|
615
617
|
b.setAttribute("width", u), f.appendChild(b);
|
|
616
618
|
}
|
|
617
|
-
|
|
619
|
+
o.prepend(f);
|
|
618
620
|
}
|
|
619
|
-
if (!
|
|
620
|
-
const
|
|
621
|
-
l ? l.after(
|
|
621
|
+
if (!o.querySelector("thead")) {
|
|
622
|
+
const c = document.createElement("thead"), l = o.querySelector("colgroup");
|
|
623
|
+
l ? l.after(c) : o.prepend(c);
|
|
622
624
|
}
|
|
623
|
-
|
|
624
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */
|
|
625
|
-
const l = Array.from(
|
|
625
|
+
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
626
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((o, c) => {
|
|
627
|
+
const l = Array.from(o.querySelectorAll(c + " tr")), f = Array.from(o.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
626
628
|
if (u === 0 || f.length === 0) return;
|
|
627
629
|
let g = 0;
|
|
628
|
-
f.forEach((
|
|
629
|
-
g +=
|
|
630
|
+
f.forEach((x) => {
|
|
631
|
+
g += x.colSpan || 1;
|
|
630
632
|
});
|
|
631
633
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
632
|
-
l.forEach((
|
|
633
|
-
const v =
|
|
634
|
-
let
|
|
635
|
-
Array.from(
|
|
634
|
+
l.forEach((x) => {
|
|
635
|
+
const v = x.sectionRowIndex;
|
|
636
|
+
let A = 0;
|
|
637
|
+
Array.from(x.querySelectorAll("th,td")).forEach((m) => {
|
|
636
638
|
for (let B = 0; B < b[v].length; B++)
|
|
637
639
|
if (b[v][B] === null) {
|
|
638
|
-
|
|
640
|
+
A = B;
|
|
639
641
|
break;
|
|
640
642
|
}
|
|
641
|
-
const
|
|
642
|
-
for (let B = 0; B <
|
|
643
|
+
const W = m.rowSpan || 1, C = m.colSpan || 1;
|
|
644
|
+
for (let B = 0; B < W; B++)
|
|
643
645
|
for (let pt = 0; pt < C; pt++)
|
|
644
|
-
v + B < u &&
|
|
646
|
+
v + B < u && A + pt < g && (b[v + B][A + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
645
647
|
});
|
|
646
|
-
}), l.forEach((
|
|
647
|
-
const v =
|
|
648
|
-
Array.from(
|
|
649
|
-
for (let
|
|
650
|
-
if (b[v][
|
|
651
|
-
|
|
648
|
+
}), l.forEach((x) => {
|
|
649
|
+
const v = x.sectionRowIndex;
|
|
650
|
+
Array.from(x.querySelectorAll("th,td")).forEach((A) => {
|
|
651
|
+
for (let m = 0; m < b[v].length; m++)
|
|
652
|
+
if (b[v][m] === "1") {
|
|
653
|
+
A.dataset.col = m, b[v][m] = "0";
|
|
652
654
|
break;
|
|
653
655
|
}
|
|
654
656
|
});
|
|
655
657
|
});
|
|
656
658
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
657
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
658
|
-
const l =
|
|
659
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
659
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, c) => {
|
|
660
|
+
const l = o.getAttribute("fixed");
|
|
661
|
+
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
660
662
|
f.setAttribute("fixed", l);
|
|
661
663
|
});
|
|
662
664
|
}), n;
|
|
663
665
|
}
|
|
664
666
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
665
667
|
};
|
|
666
|
-
|
|
668
|
+
h(jt, "TableCompiler");
|
|
667
669
|
let he = jt;
|
|
668
670
|
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
669
671
|
const yt = class yt extends HTMLElement {
|
|
@@ -672,10 +674,10 @@ const yt = class yt extends HTMLElement {
|
|
|
672
674
|
d(this, Ft);
|
|
673
675
|
d(this, et, null);
|
|
674
676
|
d(this, st);
|
|
675
|
-
|
|
677
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
676
678
|
t(this, st).refresh();
|
|
677
679
|
}, "invalidate"));
|
|
678
|
-
d(this, Vt, /* @__PURE__ */
|
|
680
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
679
681
|
[
|
|
680
682
|
{ selector: ".ng-container-body", type: null },
|
|
681
683
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -684,43 +686,43 @@ const yt = class yt extends HTMLElement {
|
|
|
684
686
|
const n = this.querySelector(s);
|
|
685
687
|
if (!n) return;
|
|
686
688
|
n.innerHTML = "";
|
|
687
|
-
const o = document.createElement("div");
|
|
688
|
-
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
689
689
|
const a = document.createElement("div");
|
|
690
|
-
a.className = "ng-part-
|
|
691
|
-
const
|
|
692
|
-
|
|
690
|
+
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
691
|
+
const o = document.createElement("div");
|
|
692
|
+
o.className = "ng-part-body";
|
|
693
|
+
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), r, "body"));
|
|
693
695
|
const l = document.createElement("div");
|
|
694
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none",
|
|
696
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), o.appendChild(c);
|
|
695
697
|
const f = document.createElement("div");
|
|
696
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), r, "footer")), n.appendChild(
|
|
698
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), r, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
697
699
|
});
|
|
698
700
|
}, "#renderSplitContainers"));
|
|
699
|
-
d(this, Yt, /* @__PURE__ */
|
|
701
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
700
702
|
["left", "right", "body"].forEach((e) => {
|
|
701
703
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
702
704
|
if (!s || !r || r.length === 0) return;
|
|
703
705
|
let n = 0;
|
|
704
|
-
r[0].querySelectorAll("col").forEach((
|
|
705
|
-
const
|
|
706
|
-
isNaN(n) || (n +=
|
|
706
|
+
r[0].querySelectorAll("col").forEach((a) => {
|
|
707
|
+
const o = parseInt(a.getAttribute("width"), 10);
|
|
708
|
+
isNaN(n) || (n += o);
|
|
707
709
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
708
710
|
});
|
|
709
711
|
}, "#updateContainerWidths"));
|
|
710
|
-
|
|
712
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
711
713
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
712
714
|
var s;
|
|
713
715
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
714
716
|
}, 0));
|
|
715
717
|
}, "generate"));
|
|
716
|
-
d(this, ct, /* @__PURE__ */
|
|
717
|
-
const n = e.cloneNode(!0),
|
|
718
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
719
|
+
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
718
720
|
if (r === "header") {
|
|
719
|
-
if (
|
|
721
|
+
if (o && o.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
720
722
|
const f = document.createElement("tbody");
|
|
721
723
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
722
724
|
}
|
|
723
|
-
} else r === "body" ? (
|
|
725
|
+
} else r === "body" ? (a && a.remove(), c && c.remove(), o && (o.className = "bindable-tbody")) : r === "footer" && (a && a.remove(), o && o.remove());
|
|
724
726
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
725
727
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
726
728
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -729,19 +731,19 @@ const yt = class yt extends HTMLElement {
|
|
|
729
731
|
l.remove();
|
|
730
732
|
}), n;
|
|
731
733
|
}, "#createSplitTable"));
|
|
732
|
-
|
|
733
|
-
|
|
734
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
735
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
734
736
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
735
737
|
s && (s.scrollLeft = e);
|
|
736
738
|
}, "scrollToX"));
|
|
737
|
-
|
|
739
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
738
740
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
739
741
|
s && (s.scrollTop = e);
|
|
740
742
|
}, "scrollToY"));
|
|
741
|
-
d(this, Ut, /* @__PURE__ */
|
|
743
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
742
744
|
t(this, Xt).call(this);
|
|
743
745
|
}, "#init"));
|
|
744
|
-
d(this, Xt, /* @__PURE__ */
|
|
746
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
745
747
|
const e = yt.SCROLLBAR_SIZE;
|
|
746
748
|
this.innerHTML = `
|
|
747
749
|
<style>
|
|
@@ -905,48 +907,48 @@ const yt = class yt extends HTMLElement {
|
|
|
905
907
|
this.innerHTML = "", N.log("NineTableSheet destroyed.");
|
|
906
908
|
}
|
|
907
909
|
};
|
|
908
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(),
|
|
910
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), E(yt, "SCROLLBAR_SIZE", 16);
|
|
909
911
|
let $t = yt;
|
|
910
912
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
911
913
|
var Kt, qt;
|
|
912
914
|
const _e = class _e extends HTMLElement {
|
|
913
915
|
constructor() {
|
|
914
916
|
super();
|
|
915
|
-
d(this, Kt, /* @__PURE__ */
|
|
917
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
916
918
|
var e;
|
|
917
919
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
918
|
-
var
|
|
919
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((
|
|
920
|
+
var a;
|
|
921
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
920
922
|
t(this, qt).call(this, n, r);
|
|
921
923
|
}), t(this, qt).call(this, 0, !1);
|
|
922
924
|
}, "#init"));
|
|
923
|
-
d(this, qt, /* @__PURE__ */
|
|
924
|
-
const r = /* @__PURE__ */
|
|
925
|
+
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
926
|
+
const r = /* @__PURE__ */ h(() => {
|
|
925
927
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
926
928
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
927
929
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
928
930
|
g.length < 2 || g.forEach((b) => {
|
|
929
|
-
const
|
|
930
|
-
v &&
|
|
931
|
+
const x = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${x}"]`), A = f[x + 1];
|
|
932
|
+
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
931
933
|
});
|
|
932
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
933
|
-
if (!
|
|
934
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), c = a.querySelectorAll("nine-table-sheet");
|
|
935
|
+
if (!o[e]) return;
|
|
934
936
|
if (!s)
|
|
935
|
-
|
|
937
|
+
o.forEach((f, u) => {
|
|
936
938
|
f.classList.toggle("active", u === e);
|
|
937
|
-
}),
|
|
939
|
+
}), c.forEach((f, u) => {
|
|
938
940
|
const g = u === e;
|
|
939
941
|
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
940
942
|
});
|
|
941
943
|
else {
|
|
942
|
-
const f =
|
|
944
|
+
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
943
945
|
if (f.classList.contains("active") && u.length <= 1)
|
|
944
946
|
return;
|
|
945
947
|
f.classList.toggle("active");
|
|
946
|
-
const g =
|
|
948
|
+
const g = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
947
949
|
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
948
950
|
}
|
|
949
|
-
const l =
|
|
951
|
+
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
950
952
|
l == null || l.forEach((f) => {
|
|
951
953
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
952
954
|
}), r();
|
|
@@ -956,31 +958,31 @@ const _e = class _e extends HTMLElement {
|
|
|
956
958
|
t(this, Kt).call(this);
|
|
957
959
|
}
|
|
958
960
|
};
|
|
959
|
-
Kt = new WeakMap(), qt = new WeakMap(),
|
|
961
|
+
Kt = new WeakMap(), qt = new WeakMap(), h(_e, "NineTableSheets");
|
|
960
962
|
let de = _e;
|
|
961
963
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
962
964
|
var M, Zt, Tt, Gt;
|
|
963
965
|
const Ne = class Ne {
|
|
964
966
|
constructor(i) {
|
|
965
967
|
d(this, M);
|
|
966
|
-
d(this, Zt, /* @__PURE__ */
|
|
968
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
967
969
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
968
970
|
for (let e of i)
|
|
969
971
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
970
972
|
}).observe(t(this, M));
|
|
971
973
|
}, "#init"));
|
|
972
|
-
d(this, Tt, /* @__PURE__ */
|
|
973
|
-
var
|
|
974
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
975
|
+
var c, l;
|
|
974
976
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
975
977
|
if (i.length === 0) return;
|
|
976
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
977
|
-
t(this, M).style.height = `${
|
|
978
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (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 + r + n + a;
|
|
979
|
+
t(this, M).style.height = `${o}px`;
|
|
978
980
|
}, "#applyAutoHeight"));
|
|
979
|
-
d(this, Gt, /* @__PURE__ */
|
|
980
|
-
const e = Array.from(t(this, M).children).filter((
|
|
981
|
+
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", r = e.length, n = e.map((c, l) => {
|
|
981
983
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
982
984
|
return u + g;
|
|
983
|
-
}).join(""),
|
|
985
|
+
}).join(""), a = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
984
986
|
t(this, M).shadowRoot.innerHTML = `
|
|
985
987
|
<style>
|
|
986
988
|
:host {
|
|
@@ -1064,7 +1066,7 @@ const Ne = class Ne {
|
|
|
1064
1066
|
<nine-table-sheets>
|
|
1065
1067
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1066
1068
|
<nine-table-sheets-footer>
|
|
1067
|
-
<div class="nine-tab-bar">${
|
|
1069
|
+
<div class="nine-tab-bar">${a}</div>
|
|
1068
1070
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1069
1071
|
</nine-table-sheets-footer>
|
|
1070
1072
|
</nine-table-sheets>
|
|
@@ -1072,24 +1074,24 @@ const Ne = class Ne {
|
|
|
1072
1074
|
</nine-table-body>
|
|
1073
1075
|
<nine-table-footer></nine-table-footer>
|
|
1074
1076
|
`;
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
+
const o = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1078
|
+
o == null || o.forEach((c, l) => {
|
|
1077
1079
|
e[l] && setTimeout(() => {
|
|
1078
|
-
|
|
1080
|
+
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1079
1081
|
});
|
|
1080
1082
|
});
|
|
1081
1083
|
}, "#render"));
|
|
1082
1084
|
p(this, M, i), t(this, Zt).call(this);
|
|
1083
1085
|
}
|
|
1084
1086
|
};
|
|
1085
|
-
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(),
|
|
1087
|
+
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1086
1088
|
let fe = Ne;
|
|
1087
1089
|
var kt, ht;
|
|
1088
1090
|
const We = class We {
|
|
1089
1091
|
constructor(i) {
|
|
1090
1092
|
d(this, kt);
|
|
1091
1093
|
d(this, ht, -1);
|
|
1092
|
-
|
|
1094
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1093
1095
|
p(this, kt, i);
|
|
1094
1096
|
}
|
|
1095
1097
|
get at() {
|
|
@@ -1100,10 +1102,10 @@ const We = class We {
|
|
|
1100
1102
|
});
|
|
1101
1103
|
}
|
|
1102
1104
|
};
|
|
1103
|
-
kt = new WeakMap(), ht = new WeakMap(),
|
|
1105
|
+
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1104
1106
|
let ue = We;
|
|
1105
1107
|
var I, T, _, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1106
|
-
const
|
|
1108
|
+
const O = class O {
|
|
1107
1109
|
constructor(i, e) {
|
|
1108
1110
|
d(this, I);
|
|
1109
1111
|
d(this, T);
|
|
@@ -1111,7 +1113,7 @@ const W = class W {
|
|
|
1111
1113
|
d(this, dt, []);
|
|
1112
1114
|
d(this, Jt, 0);
|
|
1113
1115
|
d(this, Y, []);
|
|
1114
|
-
d(this, Qt, /* @__PURE__ */
|
|
1116
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1115
1117
|
p(this, Y, []);
|
|
1116
1118
|
const i = t(this, I).template || [];
|
|
1117
1119
|
Array.from(i).forEach((e) => {
|
|
@@ -1121,12 +1123,12 @@ const W = class W {
|
|
|
1121
1123
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1122
1124
|
});
|
|
1123
1125
|
}, "#initialize"));
|
|
1124
|
-
d(this, it, /* @__PURE__ */
|
|
1126
|
+
d(this, it, /* @__PURE__ */ h(() => {
|
|
1125
1127
|
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1126
1128
|
i.invalidate();
|
|
1127
1129
|
});
|
|
1128
1130
|
}, "#invalidate"));
|
|
1129
|
-
|
|
1131
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1130
1132
|
var n;
|
|
1131
1133
|
const s = this.getValidData();
|
|
1132
1134
|
if (!s || s.length <= 0) return;
|
|
@@ -1134,95 +1136,95 @@ const W = class W {
|
|
|
1134
1136
|
if (i < 0 || i >= s.length) return null;
|
|
1135
1137
|
const r = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1136
1138
|
if (e != null) {
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1139
|
+
const a = r.indexOf(e);
|
|
1140
|
+
return a >= 0 ? s[i].v[a] : null;
|
|
1139
1141
|
}
|
|
1140
1142
|
return t(this, ft).call(this, s[i]);
|
|
1141
1143
|
}, "get"));
|
|
1142
|
-
|
|
1144
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1143
1145
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1144
1146
|
}, "set"));
|
|
1145
|
-
d(this, Ct, /* @__PURE__ */
|
|
1146
|
-
rowState:
|
|
1147
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1148
|
+
rowState: O.ROW_STATE.EMPTY,
|
|
1147
1149
|
deleted: !1,
|
|
1148
1150
|
filtered: !1,
|
|
1149
1151
|
height: t(this, Y).slice(),
|
|
1150
1152
|
o: {},
|
|
1151
1153
|
c: {},
|
|
1152
|
-
_: [0, 0, 0, 0,
|
|
1154
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1153
1155
|
}), "#getDefaultMeta"));
|
|
1154
|
-
|
|
1156
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1155
1157
|
p(this, _, []), p(this, dt, []), t(this, it).call(this);
|
|
1156
1158
|
}, "reset"));
|
|
1157
|
-
|
|
1159
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1158
1160
|
var i;
|
|
1159
1161
|
t(this, T).rawRecords = [], p(this, _, []), p(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1160
1162
|
}, "clear"));
|
|
1161
|
-
d(this, te, /* @__PURE__ */
|
|
1163
|
+
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1162
1164
|
var r;
|
|
1163
1165
|
Array.isArray(i) || (i = [i]);
|
|
1164
1166
|
const e = typeof ((r = t(this, I).fields) == null ? void 0 : r.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1165
1167
|
return i.forEach((n) => {
|
|
1166
|
-
const
|
|
1167
|
-
e.forEach((
|
|
1168
|
-
|
|
1169
|
-
}), s.push(
|
|
1168
|
+
const a = { v: [] };
|
|
1169
|
+
e.forEach((o) => {
|
|
1170
|
+
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1171
|
+
}), s.push(a);
|
|
1170
1172
|
}), s;
|
|
1171
1173
|
}, "#json2Array"));
|
|
1172
|
-
d(this, ee, /* @__PURE__ */
|
|
1173
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1174
|
+
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1175
|
+
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;
|
|
1174
1176
|
}), i), "#defaultInsert"));
|
|
1175
|
-
|
|
1177
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1176
1178
|
i === void 0 && (i = {});
|
|
1177
1179
|
const s = t(this, te).call(this, i);
|
|
1178
1180
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1179
1181
|
const r = this.count() - 1;
|
|
1180
|
-
return e || s.forEach((n,
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1182
|
+
return e || s.forEach((n, a) => {
|
|
1183
|
+
const o = t(this, T).rawRecords[r - a];
|
|
1184
|
+
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1183
1185
|
}), t(this, it).call(this), r;
|
|
1184
1186
|
}, "add"));
|
|
1185
|
-
|
|
1187
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1186
1188
|
let e = [];
|
|
1187
1189
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1188
1190
|
if (t(this, _)[s]) {
|
|
1189
1191
|
const r = t(this, _)[s].__ng.rowid;
|
|
1190
|
-
t(this, _)[s].__ng.rowState ===
|
|
1191
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1192
|
+
t(this, _)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1193
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1192
1194
|
});
|
|
1193
1195
|
}
|
|
1194
1196
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1195
1197
|
}, "delete"));
|
|
1196
|
-
|
|
1197
|
-
var
|
|
1198
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1199
|
+
var c;
|
|
1198
1200
|
i = parseInt(i, 10);
|
|
1199
|
-
const n = (typeof ((
|
|
1201
|
+
const n = (typeof ((c = t(this, I).fields) == null ? void 0 : c.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
1200
1202
|
if (n < 0) return;
|
|
1201
|
-
const
|
|
1202
|
-
if (!
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1203
|
+
const a = this.getValidData()[i];
|
|
1204
|
+
if (!a) return;
|
|
1205
|
+
const o = a.v[n];
|
|
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;
|
|
1205
1207
|
}, "setValue"));
|
|
1206
|
-
|
|
1208
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1207
1209
|
p(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), p(this, _, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1208
1210
|
i.__ng.rowidx = e;
|
|
1209
1211
|
}), t(this, _).forEach((i, e) => {
|
|
1210
1212
|
i.__ng.i = e;
|
|
1211
1213
|
});
|
|
1212
1214
|
}, "resetRecords"));
|
|
1213
|
-
|
|
1214
|
-
d(this, ft, /* @__PURE__ */
|
|
1215
|
-
var
|
|
1215
|
+
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((i) => {
|
|
1217
|
+
var a;
|
|
1216
1218
|
if (!i) return i;
|
|
1217
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1218
|
-
const
|
|
1219
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = 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
|
+
const c = {};
|
|
1219
1221
|
return r.forEach((l, f) => {
|
|
1220
|
-
|
|
1221
|
-
}),
|
|
1222
|
+
c[l] = o.v ? o.v[f] : o[l];
|
|
1223
|
+
}), c.__ng = o.__ng, c;
|
|
1222
1224
|
});
|
|
1223
1225
|
return e ? n[0] : n;
|
|
1224
1226
|
}, "#conv"));
|
|
1225
|
-
|
|
1227
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1226
1228
|
p(this, I, i), p(this, T, e), t(this, Qt).call(this);
|
|
1227
1229
|
}
|
|
1228
1230
|
get source() {
|
|
@@ -1244,15 +1246,15 @@ const W = class W {
|
|
|
1244
1246
|
return this.length;
|
|
1245
1247
|
}
|
|
1246
1248
|
};
|
|
1247
|
-
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(),
|
|
1248
|
-
|
|
1249
|
+
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1250
|
+
E(O, "ROW_STATE", {
|
|
1249
1251
|
EMPTY: "EMPTY",
|
|
1250
1252
|
NORMAL: "NORMAL",
|
|
1251
1253
|
INSERT: "INSERT",
|
|
1252
1254
|
UPDATE: "UPDATE",
|
|
1253
1255
|
DELETE: "DELETE"
|
|
1254
1256
|
});
|
|
1255
|
-
let ge =
|
|
1257
|
+
let ge = O;
|
|
1256
1258
|
var rt;
|
|
1257
1259
|
const Oe = class Oe {
|
|
1258
1260
|
constructor(i) {
|
|
@@ -1274,7 +1276,7 @@ const Oe = class Oe {
|
|
|
1274
1276
|
}, this.setDataSource([]);
|
|
1275
1277
|
}
|
|
1276
1278
|
};
|
|
1277
|
-
rt = new WeakMap(),
|
|
1279
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1278
1280
|
let be = Oe;
|
|
1279
1281
|
var ut, L, Lt, se;
|
|
1280
1282
|
const Be = class Be {
|
|
@@ -1282,42 +1284,42 @@ const Be = class Be {
|
|
|
1282
1284
|
constructor(i) {
|
|
1283
1285
|
d(this, ut);
|
|
1284
1286
|
d(this, L, []);
|
|
1285
|
-
|
|
1287
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1286
1288
|
i.forEach((s) => {
|
|
1287
1289
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1288
1290
|
}), t(this, Lt).call(this);
|
|
1289
1291
|
}, "add"));
|
|
1290
|
-
d(this, Lt, /* @__PURE__ */
|
|
1292
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1291
1293
|
const i = /* @__PURE__ */ new Map();
|
|
1292
1294
|
t(this, L).forEach((e) => {
|
|
1293
1295
|
i.set(e.name, e.type);
|
|
1294
1296
|
}), p(this, L, Array.from(i, ([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);
|
|
1295
1297
|
}, "#adjust"));
|
|
1296
|
-
d(this, se, /* @__PURE__ */
|
|
1298
|
+
d(this, se, /* @__PURE__ */ h(() => {
|
|
1297
1299
|
p(this, L, []), N.log(t(this, ut).querySelectorAll("table"));
|
|
1298
1300
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1299
1301
|
if (!(!i || i.length === 0)) {
|
|
1300
1302
|
for (const e of i)
|
|
1301
1303
|
N.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1302
|
-
const n = r.dataset.bind,
|
|
1303
|
-
n && t(this, L).push({ name: n, type:
|
|
1304
|
+
const n = r.dataset.bind, a = r.getAttribute("data-type") || "string";
|
|
1305
|
+
n && t(this, L).push({ name: n, type: a });
|
|
1304
1306
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1305
1307
|
$(`[${s}]`, e).each((r, n) => {
|
|
1306
|
-
var
|
|
1307
|
-
if (
|
|
1308
|
-
const
|
|
1309
|
-
if (
|
|
1308
|
+
var a = n.getAttribute(s);
|
|
1309
|
+
if (a.indexOf("data.") < 0) {
|
|
1310
|
+
const o = a.search(/[(]/g);
|
|
1311
|
+
if (o > 0)
|
|
1310
1312
|
try {
|
|
1311
|
-
|
|
1313
|
+
a = String(window[a.substring(0, o).trim()]);
|
|
1312
1314
|
} catch {
|
|
1313
|
-
|
|
1315
|
+
a = "";
|
|
1314
1316
|
}
|
|
1315
1317
|
}
|
|
1316
|
-
|
|
1317
|
-
if (
|
|
1318
|
-
const
|
|
1318
|
+
a.split("data.").forEach((o) => {
|
|
1319
|
+
if (o.trim() != "") {
|
|
1320
|
+
const c = o.search(/[^_A-Za-z0-9]/g);
|
|
1319
1321
|
let l = "";
|
|
1320
|
-
|
|
1322
|
+
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1321
1323
|
}
|
|
1322
1324
|
});
|
|
1323
1325
|
});
|
|
@@ -1347,16 +1349,16 @@ const Be = class Be {
|
|
|
1347
1349
|
return t(this, L).some((e) => e.name === i);
|
|
1348
1350
|
}
|
|
1349
1351
|
};
|
|
1350
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(),
|
|
1352
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1351
1353
|
let pe = Be;
|
|
1352
1354
|
var nt, ie, re;
|
|
1353
|
-
const
|
|
1355
|
+
const Pe = class Pe extends HTMLElement {
|
|
1354
1356
|
constructor() {
|
|
1355
1357
|
super();
|
|
1356
1358
|
//#created = false;
|
|
1357
1359
|
d(this, nt);
|
|
1358
1360
|
d(this, ie);
|
|
1359
|
-
d(this, re, /* @__PURE__ */
|
|
1361
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1360
1362
|
this.fields = new pe(this), p(this, ie, new fe(this)), N.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1361
1363
|
}, "#init"));
|
|
1362
1364
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
@@ -1380,8 +1382,8 @@ const ze = class ze extends HTMLElement {
|
|
|
1380
1382
|
return t(this, nt);
|
|
1381
1383
|
}
|
|
1382
1384
|
};
|
|
1383
|
-
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(),
|
|
1384
|
-
let ye =
|
|
1385
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), h(Pe, "NineTable");
|
|
1386
|
+
let ye = Pe;
|
|
1385
1387
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1386
1388
|
const mt = class mt extends HTMLElement {
|
|
1387
1389
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
@@ -1394,10 +1396,10 @@ const mt = class mt extends HTMLElement {
|
|
|
1394
1396
|
connectedCallback() {
|
|
1395
1397
|
}
|
|
1396
1398
|
};
|
|
1397
|
-
|
|
1399
|
+
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1398
1400
|
let me = mt;
|
|
1399
1401
|
var k, Ht, y, Re, qe, Te, ke, Ce;
|
|
1400
|
-
const
|
|
1402
|
+
const ze = class ze extends me {
|
|
1401
1403
|
constructor() {
|
|
1402
1404
|
super();
|
|
1403
1405
|
d(this, k);
|
|
@@ -1407,7 +1409,7 @@ const Pe = class Pe extends me {
|
|
|
1407
1409
|
d(this, qe);
|
|
1408
1410
|
d(this, Te);
|
|
1409
1411
|
d(this, ke);
|
|
1410
|
-
|
|
1412
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1411
1413
|
if (t(this, y))
|
|
1412
1414
|
if (t(this, y).closest("tbody")) {
|
|
1413
1415
|
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
@@ -1427,22 +1429,22 @@ const Pe = class Pe extends me {
|
|
|
1427
1429
|
} catch {
|
|
1428
1430
|
}
|
|
1429
1431
|
}, "getDisplayText"));
|
|
1430
|
-
d(this, Ce, /* @__PURE__ */
|
|
1432
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1431
1433
|
if (!(!t(this, k) || !t(this, k).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1432
1434
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1433
1435
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1434
1436
|
var s = t(this, y).closest("tr"), r = [];
|
|
1435
|
-
$("th,td", s).each((
|
|
1436
|
-
var C = ninegrid.j.querySelectorAll(
|
|
1437
|
-
C &&
|
|
1437
|
+
$("th,td", s).each((m, W) => {
|
|
1438
|
+
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1439
|
+
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1438
1440
|
}), r.sort();
|
|
1439
1441
|
var n = !1;
|
|
1440
1442
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
1441
|
-
for (var
|
|
1442
|
-
if (
|
|
1443
|
-
var
|
|
1443
|
+
for (var a of r) {
|
|
1444
|
+
if (a > e) break;
|
|
1445
|
+
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);
|
|
1444
1446
|
t(this, y).dataset.matrixRow;
|
|
1445
|
-
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${
|
|
1447
|
+
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, o) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1446
1448
|
if (g != b) {
|
|
1447
1449
|
n = !0;
|
|
1448
1450
|
break;
|
|
@@ -1451,17 +1453,17 @@ const Pe = class Pe extends me {
|
|
|
1451
1453
|
else
|
|
1452
1454
|
n = !0;
|
|
1453
1455
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1454
|
-
var
|
|
1455
|
-
$(
|
|
1456
|
+
var x = parseInt(t(this, y).dataset.matrixRow), v = x - 1, A = t(this, k).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1457
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1456
1458
|
}
|
|
1457
1459
|
}
|
|
1458
1460
|
}, "#resetSuppress"));
|
|
1459
|
-
|
|
1461
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1460
1462
|
if (typeof e < "u")
|
|
1461
1463
|
try {
|
|
1462
1464
|
r = parseInt(r);
|
|
1463
|
-
const
|
|
1464
|
-
return t(this, k)[
|
|
1465
|
+
const a = e.replace("()", "");
|
|
1466
|
+
return t(this, k)[a] ? t(this, k)[a].call(this, s, r, t(this, y)) : t(this, k).exprFunction(e).call(this, s, r, t(this, k).data);
|
|
1465
1467
|
} catch {
|
|
1466
1468
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1467
1469
|
}
|
|
@@ -1492,8 +1494,8 @@ const Pe = class Pe extends me {
|
|
|
1492
1494
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1493
1495
|
}
|
|
1494
1496
|
};
|
|
1495
|
-
k = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(),
|
|
1496
|
-
let xe =
|
|
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(ze, "CellElement");
|
|
1498
|
+
let xe = ze;
|
|
1497
1499
|
const De = class De extends xe {
|
|
1498
1500
|
constructor() {
|
|
1499
1501
|
super();
|
|
@@ -1505,7 +1507,7 @@ const De = class De extends xe {
|
|
|
1505
1507
|
return super.refresh();
|
|
1506
1508
|
}
|
|
1507
1509
|
};
|
|
1508
|
-
|
|
1510
|
+
h(De, "EditableCellElement");
|
|
1509
1511
|
let ve = De;
|
|
1510
1512
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1511
1513
|
const je = class je extends ve {
|
|
@@ -1517,7 +1519,7 @@ const je = class je extends ve {
|
|
|
1517
1519
|
d(this, bt);
|
|
1518
1520
|
d(this, ne);
|
|
1519
1521
|
d(this, U);
|
|
1520
|
-
|
|
1522
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1521
1523
|
const e = super.refresh();
|
|
1522
1524
|
t(this, Mt).value = e;
|
|
1523
1525
|
}, "refresh"));
|
|
@@ -1551,7 +1553,7 @@ const je = class je extends ve {
|
|
|
1551
1553
|
if (!v) this.reset();
|
|
1552
1554
|
};
|
|
1553
1555
|
*/
|
|
1554
|
-
d(this, Le, /* @__PURE__ */
|
|
1556
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1555
1557
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1556
1558
|
if (t(this, ot) == "number") {
|
|
1557
1559
|
let n = [];
|
|
@@ -1579,7 +1581,7 @@ const je = class je extends ve {
|
|
|
1579
1581
|
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1580
1582
|
}
|
|
1581
1583
|
};
|
|
1582
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(),
|
|
1584
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1583
1585
|
let we = je;
|
|
1584
1586
|
customElements.get("cell-input-text");
|
|
1585
1587
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|