@ninebone/table 0.0.624 β 0.0.625
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 +300 -298
- 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
|
@@ -4,11 +4,11 @@ var Ve = (q) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Xe = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
6
|
var c = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
8
|
-
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e),
|
|
7
|
+
var A = (q, i, e) => Xe(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Ve("Cannot " + e);
|
|
8
|
+
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
9
|
var Ue = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
y(q, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(q, i, s);
|
|
@@ -36,51 +36,51 @@ const Me = class Me extends HTMLElement {
|
|
|
36
36
|
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, B) || !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, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && h > a)
|
|
49
|
+
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
o && (o.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 * (a / h), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
const u = e.scrollLeft, g = h - a;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
|
|
62
|
+
b > m && (b = m), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ c((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 h = n.width -
|
|
72
|
-
|
|
68
|
+
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
|
+
let a = e;
|
|
70
|
+
a < 0 && (a = 0);
|
|
71
|
+
const h = n.width - o;
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= h - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return h > 0 && u > 0 && (s.scrollLeft =
|
|
74
|
+
return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((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
|
-
t(this, G).call(this, n + r),
|
|
81
|
-
clearInterval(t(this, X)),
|
|
82
|
-
const
|
|
83
|
-
t(this, G).call(this,
|
|
80
|
+
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
@@ -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(), o = t(this, w).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(),
|
|
103
|
-
const n = /* @__PURE__ */ c((
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this, G).call(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (y(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
y(this, w, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -211,10 +211,10 @@ const $e = class $e extends HTMLElement {
|
|
|
211
211
|
d(this, T);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight,
|
|
217
|
-
if (l <= n ||
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
|
|
217
|
+
if (l <= n || a === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
@@ -223,43 +223,43 @@ const $e = class $e extends HTMLElement {
|
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
226
|
+
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
|
-
|
|
228
|
+
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const x = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled =
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
M.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
|
|
235
|
-
const n = (t(this, F).data.get() || []).length,
|
|
236
|
-
return n *
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
|
+
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
|
-
r.stopPropagation(), r.preventDefault(),
|
|
243
|
-
const n = /* @__PURE__ */ c((
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l,
|
|
245
|
+
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && x > 0) {
|
|
247
|
-
const
|
|
248
|
-
let v = t(this, xt) +
|
|
249
|
-
const I = Math.max(0, m -
|
|
247
|
+
const E = g / u * x;
|
|
248
|
+
let v = t(this, xt) + E;
|
|
249
|
+
const I = Math.max(0, m - b);
|
|
250
250
|
v < 0 && (v = 0), v > I && (v = I), e.scrollTop = v;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"),
|
|
254
|
-
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
254
|
+
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
|
-
document.addEventListener("mousemove", n), document.addEventListener("mouseup",
|
|
256
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, T).track.addEventListener("mousedown", (r) => {
|
|
258
258
|
if (r.button !== 0 || r.target === t(this, T).thumb) return;
|
|
259
|
-
const n = t(this, T).track.getBoundingClientRect(),
|
|
260
|
-
if (l > 0 &&
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
259
|
+
const n = t(this, T).track.getBoundingClientRect(), o = t(this, T).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
|
+
if (l > 0 && g > 0) {
|
|
261
|
+
const b = Math.max(0, Math.min(1, a / l));
|
|
262
|
+
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, T).top.addEventListener("click", () => {
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
|
|
273
|
+
y(this, F, this.getRootNode().host), y(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
y(this, T, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -354,172 +354,174 @@ const $e = class $e extends HTMLElement {
|
|
|
354
354
|
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, _, V, tt, wt, Se, Ee, Wt, Ot, zt, St, Et, Bt, Dt, At, Ae, lt, qt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, _, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
|
-
d(this,
|
|
369
|
+
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
371
371
|
d(this, Wt, 3);
|
|
372
|
-
|
|
372
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
373
373
|
var e;
|
|
374
374
|
M.log("rowManager.refresh");
|
|
375
375
|
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
376
|
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
|
|
379
|
-
M.log("rowManager.initialize"),
|
|
378
|
+
A(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
|
+
M.log("rowManager.initialize"), y(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}),
|
|
383
|
-
const
|
|
384
|
-
if (!
|
|
385
|
-
const h =
|
|
382
|
+
}), y(this, _, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
|
+
const a = t(this, S).querySelector(o);
|
|
384
|
+
if (!a) return;
|
|
385
|
+
const h = a.querySelector(".ng-part-body table");
|
|
386
386
|
if (!h) return;
|
|
387
387
|
const l = h.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
|
-
const u = Array.from(l.querySelectorAll("tr")).map((
|
|
390
|
-
t(this,
|
|
389
|
+
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
390
|
+
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
392
|
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");
|
|
393
393
|
if (i) {
|
|
394
|
-
t(this, zt).call(this, i), t(this,
|
|
395
|
-
let
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
398
|
-
|
|
394
|
+
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
|
+
let o = !1;
|
|
396
|
+
const a = /* @__PURE__ */ c((h) => {
|
|
397
|
+
if (o) return;
|
|
398
|
+
o = !0;
|
|
399
399
|
const l = h.scrollTop, f = h.scrollLeft;
|
|
400
|
-
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l),
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[i, e, s].forEach((h) => {
|
|
403
403
|
h && h.addEventListener("scroll", () => {
|
|
404
|
-
|
|
404
|
+
a(h);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
409
|
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
410
410
|
M.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
413
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
416
|
-
const n = r.querySelector("tr.nodata"),
|
|
417
|
-
for (let
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
+
for (let a = 0; a < t(this, wt); a++)
|
|
418
418
|
s.forEach((h) => {
|
|
419
|
-
|
|
419
|
+
o.appendChild(h.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(
|
|
421
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, zt, /* @__PURE__ */ c((i) => {
|
|
424
424
|
if (M.log("rowManager.#measureAndCacheHeight"), t(this, _) !== null && t(this, _) > 0)
|
|
425
425
|
return t(this, _);
|
|
426
426
|
M.log("#measureAndCacheHeight");
|
|
427
|
-
const e =
|
|
428
|
-
if (
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
428
|
+
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
429
|
+
const s = i.querySelector("tbody.bindable-tbody");
|
|
430
|
+
if (M.log(s), !s) throw new Error("invalid dom");
|
|
431
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
|
+
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
|
+
e.forEach((g) => {
|
|
434
|
+
n.appendChild(g.cloneNode(!0));
|
|
435
|
+
}), r ? r.before(n) : s.appendChild(n);
|
|
436
|
+
const o = t(this, S), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
437
|
+
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
|
+
let f = 0;
|
|
439
|
+
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
|
+
return u.forEach((g) => {
|
|
441
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, y(this, _, f > 0 ? f : 24), t(this, Et).call(this), t(this, _);
|
|
441
443
|
}, "#measureAndCacheHeight"));
|
|
442
444
|
d(this, St, /* @__PURE__ */ c(() => {
|
|
443
445
|
M.log("rowManager.#updateVirtualScrollHeight");
|
|
444
|
-
const e = (t(this,
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, _), r = e * s;
|
|
445
447
|
M.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
446
|
-
const
|
|
447
|
-
if (!
|
|
448
|
-
const
|
|
449
|
-
|
|
448
|
+
const o = t(this, S).querySelector(n);
|
|
449
|
+
if (!o) return;
|
|
450
|
+
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
451
|
+
a && (a.style.height = `${r}px`);
|
|
450
452
|
});
|
|
451
453
|
}, "#updateVirtualScrollHeight"));
|
|
452
|
-
d(this,
|
|
454
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
453
455
|
if (t(this, tt) > 0 && t(this, _) > 0) {
|
|
454
456
|
const i = Math.ceil(t(this, tt) / t(this, _));
|
|
455
|
-
|
|
457
|
+
y(this, wt, i + t(this, Wt));
|
|
456
458
|
}
|
|
457
459
|
}, "#updateRowCount"));
|
|
458
460
|
d(this, Bt, /* @__PURE__ */ c(() => {
|
|
459
|
-
var
|
|
461
|
+
var a, h, l, f, u, g;
|
|
460
462
|
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");
|
|
461
463
|
if (e) {
|
|
462
|
-
const
|
|
463
|
-
for (let v = 0; v <
|
|
464
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(b.length, m.length, x.length);
|
|
465
|
+
for (let v = 0; v < E; v++) {
|
|
464
466
|
const I = [
|
|
465
|
-
((
|
|
467
|
+
((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
466
468
|
((h = m[v]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
467
469
|
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
468
470
|
], R = Math.max(...I);
|
|
469
|
-
R > 0 && (
|
|
471
|
+
R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
470
472
|
}
|
|
471
473
|
}
|
|
472
|
-
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"),
|
|
474
|
+
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"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
473
475
|
if (n) {
|
|
474
|
-
const
|
|
475
|
-
for (let v = 0; v <
|
|
476
|
+
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(b.length, m.length, x.length);
|
|
477
|
+
for (let v = 0; v < E; v++) {
|
|
476
478
|
const I = [
|
|
477
|
-
((f =
|
|
479
|
+
((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
478
480
|
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
479
|
-
((
|
|
481
|
+
((g = x[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
480
482
|
], R = Math.max(...I);
|
|
481
|
-
R > 0 && (
|
|
483
|
+
R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
482
484
|
}
|
|
483
485
|
}
|
|
484
486
|
}, "#syncRowHeights"));
|
|
485
487
|
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
486
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
487
489
|
for (const e of i) {
|
|
488
490
|
const s = e.target;
|
|
489
491
|
if (!s.classList.contains("active")) continue;
|
|
490
492
|
const r = e.contentRect.height;
|
|
491
493
|
if (r > 0) {
|
|
492
494
|
let n = 0;
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
|
+
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
495
497
|
const h = Math.max(r - n, 100);
|
|
496
|
-
t(this, tt) !== h && (
|
|
498
|
+
t(this, tt) !== h && (y(this, tt, h), t(this, Et).call(this), t(this, _) !== null && (t(this, At).call(this), this.refresh()));
|
|
497
499
|
}
|
|
498
500
|
}
|
|
499
501
|
})), t(this, V).observe(t(this, S)));
|
|
500
502
|
}, "#initResizeObserver"));
|
|
501
|
-
d(this,
|
|
503
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
502
504
|
M.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
503
505
|
const e = t(this, S).querySelector(i);
|
|
504
506
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
505
507
|
}), t(this, Pt).call(this), t(this, Bt).call(this);
|
|
506
508
|
}, "#renderAllContainers"));
|
|
507
|
-
d(this,
|
|
509
|
+
d(this, Ae, /* @__PURE__ */ c((i) => {
|
|
508
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
509
511
|
var l;
|
|
510
512
|
const s = t(this, S).querySelector(e);
|
|
511
513
|
if (!s) return;
|
|
512
514
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
513
515
|
if (!r) return;
|
|
514
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")),
|
|
516
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, P).data.get() || []).length;
|
|
515
517
|
n.forEach((f, u) => {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
+
const g = i + Math.floor(u / o);
|
|
519
|
+
if (g >= h) {
|
|
518
520
|
f.style.visibility = "hidden";
|
|
519
521
|
return;
|
|
520
522
|
}
|
|
521
|
-
const
|
|
522
|
-
f.style.display = "", t(this, qt).call(this, f,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
|
+
f.style.display = "", t(this, qt).call(this, f, b, g);
|
|
523
525
|
});
|
|
524
526
|
});
|
|
525
527
|
}, "#adjustBufferRows"));
|
|
@@ -527,24 +529,24 @@ const Ie = class Ie {
|
|
|
527
529
|
var f, u;
|
|
528
530
|
const e = t(this, _);
|
|
529
531
|
if (!e || e <= 0) return;
|
|
530
|
-
const s = t(this,
|
|
532
|
+
const s = t(this, P).data.length;
|
|
531
533
|
if (s === 0) return;
|
|
532
|
-
const r = ((f = t(this,
|
|
533
|
-
(u = t(this, Q)) == null || u.scrollTables.forEach((
|
|
534
|
-
|
|
535
|
-
}), l !==
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
538
|
-
const m =
|
|
534
|
+
const r = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), o = Math.min(n, Math.max(0, Math.floor(i / e))), a = Math.floor(o * e), h = t(this, Q).firstTr, l = h && h.dataset.row !== void 0 ? parseInt(h.dataset.row, 10) : -1;
|
|
535
|
+
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
|
+
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
|
+
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
538
|
+
const b = t(this, S).querySelector(g);
|
|
539
|
+
if (!b) return;
|
|
540
|
+
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
539
541
|
if (!m) return;
|
|
540
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
541
|
-
const I =
|
|
542
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, v) => {
|
|
543
|
+
const I = o + Math.floor(v / r);
|
|
542
544
|
if (I >= s) {
|
|
543
|
-
|
|
545
|
+
E.style.display = "none";
|
|
544
546
|
return;
|
|
545
547
|
}
|
|
546
|
-
const R = t(this,
|
|
547
|
-
|
|
548
|
+
const R = t(this, P).data.get(I);
|
|
549
|
+
E.style.display = "", t(this, qt).call(this, E, R, I);
|
|
548
550
|
});
|
|
549
551
|
});
|
|
550
552
|
}, "#handleScroll"));
|
|
@@ -565,8 +567,8 @@ const Ie = class Ie {
|
|
|
565
567
|
d(this, qt, /* @__PURE__ */ c((i, e, s) => {
|
|
566
568
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
567
569
|
r.dataset.row = s;
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
571
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
570
572
|
});
|
|
571
573
|
}, "#bindRowData"));
|
|
572
574
|
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
@@ -574,30 +576,30 @@ const Ie = class Ie {
|
|
|
574
576
|
M.log("rowManager.#syncHeaderHeights");
|
|
575
577
|
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");
|
|
576
578
|
if (!e) return;
|
|
577
|
-
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")),
|
|
578
|
-
for (let u = 0; u <
|
|
579
|
-
const
|
|
579
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
580
|
+
for (let u = 0; u < a; u++) {
|
|
581
|
+
const g = [
|
|
580
582
|
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
581
583
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
582
|
-
((f =
|
|
583
|
-
],
|
|
584
|
-
|
|
584
|
+
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
585
|
+
], b = Math.max(...g);
|
|
586
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
585
587
|
}
|
|
586
588
|
}, "#syncHeaderHeights"));
|
|
587
|
-
|
|
588
|
-
t(this, V) && (t(this, V).disconnect(),
|
|
589
|
+
A(this, "destroy", /* @__PURE__ */ c(() => {
|
|
590
|
+
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
589
591
|
}, "destroy"));
|
|
590
|
-
|
|
592
|
+
y(this, P, i.getRootNode().host), y(this, S, i), t(this, Dt).call(this);
|
|
591
593
|
}
|
|
592
594
|
getRowHeight() {
|
|
593
595
|
return t(this, _);
|
|
594
596
|
}
|
|
595
597
|
templateLength(i = ".ng-container-body") {
|
|
596
598
|
var e;
|
|
597
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
598
600
|
}
|
|
599
601
|
};
|
|
600
|
-
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
601
603
|
let ce = Ie;
|
|
602
604
|
const jt = class jt {
|
|
603
605
|
/**
|
|
@@ -611,64 +613,64 @@ const jt = class jt {
|
|
|
611
613
|
*/
|
|
612
614
|
static compile(i) {
|
|
613
615
|
if (!i) return null;
|
|
614
|
-
const e = /* @__PURE__ */ c((
|
|
615
|
-
|
|
616
|
+
const e = /* @__PURE__ */ c((a) => {
|
|
617
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
616
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
617
619
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
618
620
|
let u = `cell-${f}`;
|
|
619
|
-
const
|
|
620
|
-
let
|
|
621
|
-
|
|
621
|
+
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
622
|
+
let E = [];
|
|
623
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), x && E.push(`type="${x}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
622
624
|
});
|
|
623
|
-
}, "processCellTypes"), s = /* @__PURE__ */ c((
|
|
624
|
-
if (!
|
|
625
|
-
const h =
|
|
626
|
-
for (let
|
|
627
|
-
const
|
|
628
|
-
|
|
625
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
626
|
+
if (!a.querySelector("colgroup")) {
|
|
627
|
+
const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
628
|
+
for (let g = 0; g < l; g++) {
|
|
629
|
+
const b = document.createElement("col");
|
|
630
|
+
b.setAttribute("width", u), f.appendChild(b);
|
|
629
631
|
}
|
|
630
|
-
|
|
632
|
+
a.prepend(f);
|
|
631
633
|
}
|
|
632
|
-
if (!
|
|
633
|
-
const h = document.createElement("thead"), l =
|
|
634
|
-
l ? l.after(h) :
|
|
634
|
+
if (!a.querySelector("thead")) {
|
|
635
|
+
const h = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
636
|
+
l ? l.after(h) : a.prepend(h);
|
|
635
637
|
}
|
|
636
|
-
|
|
637
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ c((
|
|
638
|
-
const l = Array.from(
|
|
638
|
+
a.classList.add("nine-table-element");
|
|
639
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((a, h) => {
|
|
640
|
+
const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), u = l.length;
|
|
639
641
|
if (u === 0 || f.length === 0) return;
|
|
640
|
-
let
|
|
642
|
+
let g = 0;
|
|
641
643
|
f.forEach((m) => {
|
|
642
|
-
|
|
644
|
+
g += m.colSpan || 1;
|
|
643
645
|
});
|
|
644
|
-
const
|
|
646
|
+
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
645
647
|
l.forEach((m) => {
|
|
646
648
|
const x = m.sectionRowIndex;
|
|
647
|
-
let
|
|
649
|
+
let E = 0;
|
|
648
650
|
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
649
|
-
for (let z = 0; z <
|
|
650
|
-
if (
|
|
651
|
-
|
|
651
|
+
for (let z = 0; z < b[x].length; z++)
|
|
652
|
+
if (b[x][z] === null) {
|
|
653
|
+
E = z;
|
|
652
654
|
break;
|
|
653
655
|
}
|
|
654
656
|
const I = v.rowSpan || 1, R = v.colSpan || 1;
|
|
655
657
|
for (let z = 0; z < I; z++)
|
|
656
658
|
for (let yt = 0; yt < R; yt++)
|
|
657
|
-
x + z < u &&
|
|
659
|
+
x + z < u && E + yt < g && (b[x + z][E + yt] = z === 0 && yt === 0 ? "1" : "0");
|
|
658
660
|
});
|
|
659
661
|
}), l.forEach((m) => {
|
|
660
662
|
const x = m.sectionRowIndex;
|
|
661
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
662
|
-
for (let v = 0; v <
|
|
663
|
-
if (
|
|
664
|
-
|
|
663
|
+
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
664
|
+
for (let v = 0; v < b[x].length; v++)
|
|
665
|
+
if (b[x][v] === "1") {
|
|
666
|
+
E.dataset.col = v, b[x][v] = "0";
|
|
665
667
|
break;
|
|
666
668
|
}
|
|
667
669
|
});
|
|
668
670
|
});
|
|
669
671
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
670
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((
|
|
671
|
-
const l =
|
|
672
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, h) => {
|
|
673
|
+
const l = a.getAttribute("fixed");
|
|
672
674
|
l && n.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
673
675
|
f.setAttribute("fixed", l);
|
|
674
676
|
});
|
|
@@ -685,7 +687,7 @@ const pt = class pt extends HTMLElement {
|
|
|
685
687
|
d(this, Ft);
|
|
686
688
|
d(this, et, null);
|
|
687
689
|
d(this, st);
|
|
688
|
-
|
|
690
|
+
A(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
689
691
|
t(this, st).refresh();
|
|
690
692
|
}, "invalidate"));
|
|
691
693
|
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
@@ -694,8 +696,8 @@ const pt = class pt extends HTMLElement {
|
|
|
694
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
695
697
|
{ selector: ".ng-container-right", type: "right" }
|
|
696
698
|
].forEach(({ selector: s, type: r }) => {
|
|
697
|
-
var n,
|
|
698
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (
|
|
699
|
+
var n, o, a;
|
|
700
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
699
701
|
});
|
|
700
702
|
}, "#renderSplitContainers"));
|
|
701
703
|
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
@@ -703,29 +705,29 @@ const pt = class pt extends HTMLElement {
|
|
|
703
705
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
704
706
|
if (!s || !r || r.length === 0) return;
|
|
705
707
|
let n = 0;
|
|
706
|
-
r[0].querySelectorAll("col").forEach((
|
|
707
|
-
const
|
|
708
|
-
isNaN(n) || (n +=
|
|
708
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
709
|
+
const a = parseInt(o.getAttribute("width"), 10);
|
|
710
|
+
isNaN(n) || (n += a);
|
|
709
711
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
710
712
|
});
|
|
711
713
|
}, "#updateContainerWidths"));
|
|
712
|
-
|
|
714
|
+
A(this, "generate", /* @__PURE__ */ c((e) => {
|
|
713
715
|
if (!e) return;
|
|
714
|
-
|
|
716
|
+
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
715
717
|
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
716
718
|
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
717
|
-
var
|
|
718
|
-
(
|
|
719
|
+
var o;
|
|
720
|
+
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
719
721
|
}, 0);
|
|
720
722
|
}, "generate"));
|
|
721
723
|
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
722
|
-
const n = e.cloneNode(!0),
|
|
724
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
723
725
|
if (r === "header") {
|
|
724
|
-
if (
|
|
726
|
+
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
725
727
|
const f = document.createElement("tbody");
|
|
726
728
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
727
729
|
}
|
|
728
|
-
} else r === "body" ? (
|
|
730
|
+
} else r === "body" ? (o && o.remove(), h && h.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
729
731
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
730
732
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
731
733
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -734,12 +736,12 @@ const pt = class pt extends HTMLElement {
|
|
|
734
736
|
l.remove();
|
|
735
737
|
}), n;
|
|
736
738
|
}, "#createSplitTable"));
|
|
737
|
-
|
|
738
|
-
|
|
739
|
+
A(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
740
|
+
A(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
739
741
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
740
742
|
s && (s.scrollLeft = e);
|
|
741
743
|
}, "scrollToX"));
|
|
742
|
-
|
|
744
|
+
A(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
743
745
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
746
|
s && (s.scrollTop = e);
|
|
745
747
|
}, "scrollToY"));
|
|
@@ -935,7 +937,7 @@ const pt = class pt extends HTMLElement {
|
|
|
935
937
|
</div>
|
|
936
938
|
`;
|
|
937
939
|
}, "#render"));
|
|
938
|
-
|
|
940
|
+
y(this, st, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
939
941
|
}
|
|
940
942
|
connectedCallback() {
|
|
941
943
|
t(this, Ut).call(this);
|
|
@@ -944,7 +946,7 @@ const pt = class pt extends HTMLElement {
|
|
|
944
946
|
this.innerHTML = "", M.log("NineTableSheet destroyed.");
|
|
945
947
|
}
|
|
946
948
|
};
|
|
947
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"),
|
|
949
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), A(pt, "SCROLLBAR_SIZE", 16);
|
|
948
950
|
let $t = pt;
|
|
949
951
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
950
952
|
var Kt, Rt;
|
|
@@ -954,38 +956,38 @@ const _e = class _e extends HTMLElement {
|
|
|
954
956
|
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
955
957
|
var e;
|
|
956
958
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
957
|
-
var
|
|
958
|
-
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((
|
|
959
|
+
var o;
|
|
960
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
959
961
|
t(this, Rt).call(this, n, r);
|
|
960
962
|
}), t(this, Rt).call(this, 0, !1);
|
|
961
963
|
}, "#init"));
|
|
962
964
|
d(this, Rt, /* @__PURE__ */ c((e, s = !1) => {
|
|
963
965
|
const r = /* @__PURE__ */ c(() => {
|
|
964
966
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
965
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
const m = parseInt(
|
|
969
|
-
x &&
|
|
967
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
968
|
+
const g = f.filter((b) => b.classList.contains("active"));
|
|
969
|
+
g.length < 2 || g.forEach((b) => {
|
|
970
|
+
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
971
|
+
x && E && E.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
970
972
|
});
|
|
971
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"),
|
|
972
|
-
if (!
|
|
973
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
974
|
+
if (!a[e]) return;
|
|
973
975
|
if (!s)
|
|
974
|
-
|
|
976
|
+
a.forEach((f, u) => {
|
|
975
977
|
f.classList.toggle("active", u === e);
|
|
976
978
|
}), h.forEach((f, u) => {
|
|
977
|
-
const
|
|
978
|
-
f.classList.toggle("active",
|
|
979
|
+
const g = u === e;
|
|
980
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
979
981
|
});
|
|
980
982
|
else {
|
|
981
|
-
const f =
|
|
983
|
+
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
982
984
|
if (f.classList.contains("active") && u.length <= 1)
|
|
983
985
|
return;
|
|
984
986
|
f.classList.toggle("active");
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
988
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
987
989
|
}
|
|
988
|
-
const l =
|
|
990
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
989
991
|
l == null || l.forEach((f) => {
|
|
990
992
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
991
993
|
}), r();
|
|
@@ -1012,14 +1014,14 @@ const Ne = class Ne {
|
|
|
1012
1014
|
var h, l;
|
|
1013
1015
|
const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1014
1016
|
if (i.length === 0) return;
|
|
1015
|
-
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height,
|
|
1016
|
-
t(this, H).style.height = `${
|
|
1017
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1018
|
+
t(this, H).style.height = `${a}px`;
|
|
1017
1019
|
}, "#applyAutoHeight"));
|
|
1018
1020
|
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
1019
1021
|
const e = Array.from(t(this, H).children).filter((h) => h.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
1020
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
1021
|
-
return u +
|
|
1022
|
-
}).join(""),
|
|
1022
|
+
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>` : "";
|
|
1023
|
+
return u + g;
|
|
1024
|
+
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1023
1025
|
t(this, H).shadowRoot.innerHTML = `
|
|
1024
1026
|
<style>
|
|
1025
1027
|
:host {
|
|
@@ -1133,7 +1135,7 @@ const Ne = class Ne {
|
|
|
1133
1135
|
<nine-table-sheets>
|
|
1134
1136
|
<nine-table-sheets-body>${n}</nine-table-sheets-body>
|
|
1135
1137
|
<nine-table-sheets-footer>
|
|
1136
|
-
<div class="nine-tab-bar">${
|
|
1138
|
+
<div class="nine-tab-bar">${o}</div>
|
|
1137
1139
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1138
1140
|
</nine-table-sheets-footer>
|
|
1139
1141
|
</nine-table-sheets>
|
|
@@ -1141,14 +1143,14 @@ const Ne = class Ne {
|
|
|
1141
1143
|
</nine-table-body>
|
|
1142
1144
|
<nine-table-footer></nine-table-footer>
|
|
1143
1145
|
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1146
|
+
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1147
|
+
a == null || a.forEach((h, l) => {
|
|
1146
1148
|
e[l] && setTimeout(() => {
|
|
1147
1149
|
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1148
1150
|
});
|
|
1149
1151
|
});
|
|
1150
1152
|
}, "#render"));
|
|
1151
|
-
|
|
1153
|
+
y(this, H, i), t(this, Zt).call(this);
|
|
1152
1154
|
}
|
|
1153
1155
|
};
|
|
1154
1156
|
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
@@ -1158,14 +1160,14 @@ const We = class We {
|
|
|
1158
1160
|
constructor(i) {
|
|
1159
1161
|
d(this, kt);
|
|
1160
1162
|
d(this, ht, -1);
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
+
A(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1164
|
+
y(this, kt, i);
|
|
1163
1165
|
}
|
|
1164
1166
|
get at() {
|
|
1165
1167
|
return t(this, ht);
|
|
1166
1168
|
}
|
|
1167
1169
|
set at(i) {
|
|
1168
|
-
|
|
1170
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1169
1171
|
});
|
|
1170
1172
|
}
|
|
1171
1173
|
};
|
|
@@ -1181,7 +1183,7 @@ const O = class O {
|
|
|
1181
1183
|
d(this, Jt, 0);
|
|
1182
1184
|
d(this, Y, []);
|
|
1183
1185
|
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1184
|
-
|
|
1186
|
+
y(this, Y, []);
|
|
1185
1187
|
const i = t(this, N).template || [];
|
|
1186
1188
|
Array.from(i).forEach((e) => {
|
|
1187
1189
|
var s;
|
|
@@ -1196,7 +1198,7 @@ const O = class O {
|
|
|
1196
1198
|
e.invalidate();
|
|
1197
1199
|
});
|
|
1198
1200
|
}, "#invalidate"));
|
|
1199
|
-
|
|
1201
|
+
A(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1200
1202
|
var n;
|
|
1201
1203
|
const s = this.getValidData();
|
|
1202
1204
|
if (!s || s.length <= 0) return;
|
|
@@ -1204,12 +1206,12 @@ const O = class O {
|
|
|
1204
1206
|
if (i < 0 || i >= s.length) return null;
|
|
1205
1207
|
const r = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1206
1208
|
if (e != null) {
|
|
1207
|
-
const
|
|
1208
|
-
return
|
|
1209
|
+
const o = r.indexOf(e);
|
|
1210
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1209
1211
|
}
|
|
1210
1212
|
return t(this, ft).call(this, s[i]);
|
|
1211
1213
|
}, "get"));
|
|
1212
|
-
|
|
1214
|
+
A(this, "set", /* @__PURE__ */ c((i) => {
|
|
1213
1215
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1214
1216
|
}, "set"));
|
|
1215
1217
|
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
@@ -1221,38 +1223,38 @@ const O = class O {
|
|
|
1221
1223
|
c: {},
|
|
1222
1224
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1223
1225
|
}), "#getDefaultMeta"));
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
+
A(this, "reset", /* @__PURE__ */ c(() => {
|
|
1227
|
+
y(this, W, []), y(this, dt, []), t(this, it).call(this);
|
|
1226
1228
|
}, "reset"));
|
|
1227
|
-
|
|
1229
|
+
A(this, "clear", /* @__PURE__ */ c(() => {
|
|
1228
1230
|
var i;
|
|
1229
|
-
t(this, k).rawRecords = [],
|
|
1231
|
+
t(this, k).rawRecords = [], y(this, W, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1230
1232
|
}, "clear"));
|
|
1231
1233
|
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1232
1234
|
var r;
|
|
1233
1235
|
Array.isArray(i) || (i = [i]);
|
|
1234
1236
|
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1235
1237
|
return i.forEach((n) => {
|
|
1236
|
-
const
|
|
1237
|
-
e.forEach((
|
|
1238
|
-
|
|
1239
|
-
}), s.push(
|
|
1238
|
+
const o = { v: [] };
|
|
1239
|
+
e.forEach((a) => {
|
|
1240
|
+
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1241
|
+
}), s.push(o);
|
|
1240
1242
|
}), s;
|
|
1241
1243
|
}, "#json2Array"));
|
|
1242
1244
|
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1243
1245
|
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;
|
|
1244
1246
|
}), i), "#defaultInsert"));
|
|
1245
|
-
|
|
1247
|
+
A(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1246
1248
|
i === void 0 && (i = {});
|
|
1247
1249
|
const s = t(this, te).call(this, i);
|
|
1248
1250
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1249
1251
|
const r = this.count() - 1;
|
|
1250
|
-
return e || s.forEach((n,
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1252
|
+
return e || s.forEach((n, o) => {
|
|
1253
|
+
const a = t(this, k).rawRecords[r - o];
|
|
1254
|
+
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1253
1255
|
}), t(this, it).call(this), r;
|
|
1254
1256
|
}, "add"));
|
|
1255
|
-
|
|
1257
|
+
A(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1256
1258
|
let e = [];
|
|
1257
1259
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1258
1260
|
if (t(this, W)[s]) {
|
|
@@ -1263,37 +1265,37 @@ const O = class O {
|
|
|
1263
1265
|
}
|
|
1264
1266
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1265
1267
|
}, "delete"));
|
|
1266
|
-
|
|
1268
|
+
A(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1267
1269
|
var h;
|
|
1268
1270
|
i = parseInt(i, 10);
|
|
1269
1271
|
const n = (typeof ((h = t(this, N).fields) == null ? void 0 : h.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1270
1272
|
if (n < 0) return;
|
|
1271
|
-
const
|
|
1272
|
-
if (!
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1273
|
+
const o = this.getValidData()[i];
|
|
1274
|
+
if (!o) return;
|
|
1275
|
+
const a = o.v[n];
|
|
1276
|
+
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1275
1277
|
}, "setValue"));
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
+
A(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1279
|
+
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, W, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1278
1280
|
i.__ng.rowidx = e;
|
|
1279
1281
|
}), t(this, W).forEach((i, e) => {
|
|
1280
1282
|
i.__ng.i = e;
|
|
1281
1283
|
});
|
|
1282
1284
|
}, "resetRecords"));
|
|
1283
|
-
|
|
1285
|
+
A(this, "getValidData", /* @__PURE__ */ c(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1284
1286
|
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1285
|
-
var
|
|
1287
|
+
var o;
|
|
1286
1288
|
if (!i) return i;
|
|
1287
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((
|
|
1289
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, N).fields) == null ? void 0 : o.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1288
1290
|
const h = {};
|
|
1289
1291
|
return r.forEach((l, f) => {
|
|
1290
|
-
h[l] =
|
|
1291
|
-
}), h.__ng =
|
|
1292
|
+
h[l] = a.v ? a.v[f] : a[l];
|
|
1293
|
+
}), h.__ng = a.__ng, h;
|
|
1292
1294
|
});
|
|
1293
1295
|
return e ? n[0] : n;
|
|
1294
1296
|
}, "#conv"));
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
+
A(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1298
|
+
y(this, N, i), y(this, k, e), t(this, Qt).call(this);
|
|
1297
1299
|
}
|
|
1298
1300
|
get source() {
|
|
1299
1301
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
@@ -1315,7 +1317,7 @@ const O = class O {
|
|
|
1315
1317
|
}
|
|
1316
1318
|
};
|
|
1317
1319
|
N = new WeakMap(), k = new WeakMap(), W = 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(), c(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1318
|
-
|
|
1320
|
+
A(O, "ROW_STATE", {
|
|
1319
1321
|
EMPTY: "EMPTY",
|
|
1320
1322
|
NORMAL: "NORMAL",
|
|
1321
1323
|
INSERT: "INSERT",
|
|
@@ -1327,7 +1329,7 @@ var rt;
|
|
|
1327
1329
|
const Oe = class Oe {
|
|
1328
1330
|
constructor(i) {
|
|
1329
1331
|
d(this, rt);
|
|
1330
|
-
|
|
1332
|
+
y(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1331
1333
|
var e;
|
|
1332
1334
|
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1333
1335
|
}, this.setDataSource = (e) => {
|
|
@@ -1352,7 +1354,7 @@ const ze = class ze {
|
|
|
1352
1354
|
constructor(i) {
|
|
1353
1355
|
d(this, ut);
|
|
1354
1356
|
d(this, L, []);
|
|
1355
|
-
|
|
1357
|
+
A(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1356
1358
|
i.forEach((s) => {
|
|
1357
1359
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1358
1360
|
}), t(this, Lt).call(this);
|
|
@@ -1361,33 +1363,33 @@ const ze = class ze {
|
|
|
1361
1363
|
const i = /* @__PURE__ */ new Map();
|
|
1362
1364
|
t(this, L).forEach((e) => {
|
|
1363
1365
|
i.set(e.name, e.type);
|
|
1364
|
-
}),
|
|
1366
|
+
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1365
1367
|
}, "#adjust"));
|
|
1366
1368
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1367
|
-
|
|
1369
|
+
y(this, L, []), M.log(t(this, ut).querySelectorAll("table"));
|
|
1368
1370
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1369
1371
|
if (!(!i || i.length === 0)) {
|
|
1370
1372
|
for (const e of i)
|
|
1371
1373
|
M.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1372
|
-
const n = r.dataset.bind,
|
|
1373
|
-
n && t(this, L).push({ name: n, type:
|
|
1374
|
+
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1375
|
+
n && t(this, L).push({ name: n, type: o });
|
|
1374
1376
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1375
1377
|
$(`[${s}]`, e).each((r, n) => {
|
|
1376
|
-
var
|
|
1377
|
-
if (
|
|
1378
|
-
const
|
|
1379
|
-
if (
|
|
1378
|
+
var o = n.getAttribute(s);
|
|
1379
|
+
if (o.indexOf("data.") < 0) {
|
|
1380
|
+
const a = o.search(/[(]/g);
|
|
1381
|
+
if (a > 0)
|
|
1380
1382
|
try {
|
|
1381
|
-
|
|
1383
|
+
o = String(window[o.substring(0, a).trim()]);
|
|
1382
1384
|
} catch {
|
|
1383
|
-
|
|
1385
|
+
o = "";
|
|
1384
1386
|
}
|
|
1385
1387
|
}
|
|
1386
|
-
|
|
1387
|
-
if (
|
|
1388
|
-
const h =
|
|
1388
|
+
o.split("data.").forEach((a) => {
|
|
1389
|
+
if (a.trim() != "") {
|
|
1390
|
+
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1389
1391
|
let l = "";
|
|
1390
|
-
h >= 0 ? l =
|
|
1392
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1391
1393
|
}
|
|
1392
1394
|
});
|
|
1393
1395
|
});
|
|
@@ -1395,7 +1397,7 @@ const ze = class ze {
|
|
|
1395
1397
|
t(this, Lt).call(this);
|
|
1396
1398
|
}
|
|
1397
1399
|
}, "#init"));
|
|
1398
|
-
|
|
1400
|
+
y(this, ut, i), t(this, se).call(this);
|
|
1399
1401
|
}
|
|
1400
1402
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1401
1403
|
get() {
|
|
@@ -1427,9 +1429,9 @@ const Be = class Be extends HTMLElement {
|
|
|
1427
1429
|
d(this, nt);
|
|
1428
1430
|
d(this, ie);
|
|
1429
1431
|
d(this, re, /* @__PURE__ */ c(() => {
|
|
1430
|
-
this.fields = new ye(this),
|
|
1432
|
+
this.fields = new ye(this), y(this, ie, new fe(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1431
1433
|
}, "#init"));
|
|
1432
|
-
this.attachShadow({ mode: "open" }),
|
|
1434
|
+
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1433
1435
|
}
|
|
1434
1436
|
connectedCallback() {
|
|
1435
1437
|
t(this, re).call(this);
|
|
@@ -1464,7 +1466,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1464
1466
|
connectedCallback() {
|
|
1465
1467
|
}
|
|
1466
1468
|
};
|
|
1467
|
-
c(mt, "BasicCellElement"),
|
|
1469
|
+
c(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1468
1470
|
let me = mt;
|
|
1469
1471
|
var C, Ht, p, qe, Re, Te, ke, Ce;
|
|
1470
1472
|
const De = class De extends me {
|
|
@@ -1477,7 +1479,7 @@ const De = class De extends me {
|
|
|
1477
1479
|
d(this, Re);
|
|
1478
1480
|
d(this, Te);
|
|
1479
1481
|
d(this, ke);
|
|
1480
|
-
|
|
1482
|
+
A(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1481
1483
|
if (t(this, p))
|
|
1482
1484
|
if (t(this, p).closest("tbody")) {
|
|
1483
1485
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1508,12 +1510,12 @@ const De = class De extends me {
|
|
|
1508
1510
|
}), r.sort();
|
|
1509
1511
|
var n = !1;
|
|
1510
1512
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1511
|
-
for (var
|
|
1512
|
-
if (
|
|
1513
|
-
var
|
|
1513
|
+
for (var o of r) {
|
|
1514
|
+
if (o > e) break;
|
|
1515
|
+
var a = parseInt(t(this, p).dataset.row), h = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(h);
|
|
1514
1516
|
t(this, p).dataset.matrixRow;
|
|
1515
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${
|
|
1516
|
-
if (
|
|
1517
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1518
|
+
if (g != b) {
|
|
1517
1519
|
n = !0;
|
|
1518
1520
|
break;
|
|
1519
1521
|
}
|
|
@@ -1521,17 +1523,17 @@ const De = class De extends me {
|
|
|
1521
1523
|
else
|
|
1522
1524
|
n = !0;
|
|
1523
1525
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1524
|
-
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1,
|
|
1525
|
-
$(
|
|
1526
|
+
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1527
|
+
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1526
1528
|
}
|
|
1527
1529
|
}
|
|
1528
1530
|
}, "#resetSuppress"));
|
|
1529
|
-
|
|
1531
|
+
A(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1530
1532
|
if (typeof e < "u")
|
|
1531
1533
|
try {
|
|
1532
1534
|
r = parseInt(r);
|
|
1533
|
-
const
|
|
1534
|
-
return t(this, C)[
|
|
1535
|
+
const o = e.replace("()", "");
|
|
1536
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, r, t(this, p)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1535
1537
|
} catch {
|
|
1536
1538
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1537
1539
|
}
|
|
@@ -1540,7 +1542,7 @@ const De = class De extends me {
|
|
|
1540
1542
|
}, "getExprValue"));
|
|
1541
1543
|
}
|
|
1542
1544
|
connectedCallback() {
|
|
1543
|
-
super.connectedCallback(),
|
|
1545
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1544
1546
|
}
|
|
1545
1547
|
get value() {
|
|
1546
1548
|
var e = !t(this, C) || !t(this, C).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
@@ -1587,7 +1589,7 @@ const je = class je extends xe {
|
|
|
1587
1589
|
d(this, bt);
|
|
1588
1590
|
d(this, ne);
|
|
1589
1591
|
d(this, U);
|
|
1590
|
-
|
|
1592
|
+
A(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1591
1593
|
const e = super.refresh();
|
|
1592
1594
|
t(this, Mt).value = e;
|
|
1593
1595
|
}, "refresh"));
|
|
@@ -1636,7 +1638,7 @@ const je = class je extends xe {
|
|
|
1636
1638
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1637
1639
|
}
|
|
1638
1640
|
}, "#onKeyDown"));
|
|
1639
|
-
if (this.applyBaseStyle(),
|
|
1641
|
+
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1640
1642
|
}
|
|
1641
1643
|
connectedCallback() {
|
|
1642
1644
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1646,7 +1648,7 @@ const je = class je extends xe {
|
|
|
1646
1648
|
${e.join(" ")}
|
|
1647
1649
|
ondragstart="return false;"
|
|
1648
1650
|
>
|
|
1649
|
-
`, super.connectedCallback(),
|
|
1651
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1650
1652
|
}
|
|
1651
1653
|
};
|
|
1652
1654
|
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|