@ninebone/table 0.0.530 → 0.0.532
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 +531 -528
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Fe = Object.defineProperty;
|
|
2
|
+
var Ve = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (R,
|
|
7
|
-
var
|
|
8
|
-
var t = (R,
|
|
9
|
-
var
|
|
10
|
-
set _(
|
|
11
|
-
y(R,
|
|
5
|
+
var Xe = (R, r, e) => r in R ? Fe(R, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[r] = e;
|
|
6
|
+
var h = (R, r) => Fe(R, "name", { value: r, configurable: !0 });
|
|
7
|
+
var A = (R, r, e) => Xe(R, typeof r != "symbol" ? r + "" : r, e), Ye = (R, r, e) => r.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, r, e) => (Ye(R, r, "read from private field"), e ? e.call(R) : r.get(R)), d = (R, r, e) => r.has(R) ? Ve("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(R) : r.set(R, e), y = (R, r, e, s) => (Ye(R, r, "write to private field"), s ? s.call(R, e) : r.set(R, e), e);
|
|
9
|
+
var Ue = (R, r, e, s) => ({
|
|
10
|
+
set _(i) {
|
|
11
|
+
y(R, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ke } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Ke.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var z, j, w, X, K, Z,
|
|
27
|
-
const
|
|
23
|
+
h(He, "Trace");
|
|
24
|
+
let ae = He;
|
|
25
|
+
const H = new ae();
|
|
26
|
+
var z, j, w, X, K, Z, _t, G, Nt;
|
|
27
|
+
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
@@ -33,73 +33,73 @@ const He = class He extends HTMLElement {
|
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
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__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const i = t(this, w).track, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (o !== 0 && c > o)
|
|
49
49
|
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
const u = e.scrollLeft, b = c - o;
|
|
59
|
+
let g = 0;
|
|
60
|
+
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
|
+
const m = l - f;
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
|
+
if (!i) return !1;
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
69
|
let o = e;
|
|
70
70
|
o < 0 && (o = 0);
|
|
71
71
|
const c = n.width - a;
|
|
72
72
|
o > c && (o = c), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= c - 1;
|
|
73
|
-
const l = s.clientWidth, u =
|
|
73
|
+
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = o / c * u), o > 0 && o < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
76
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + i), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, a +
|
|
83
|
+
t(this, G).call(this, a + i) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
|
+
t(this, w).left.addEventListener(i, s), t(this, w).right.addEventListener(i, s), t(this, w).track.addEventListener(i, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (i) => {
|
|
92
|
+
i.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (i) => {
|
|
94
|
+
i.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (i) => {
|
|
96
|
+
if (i.button !== 0) return;
|
|
97
|
+
i.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
t(this, G).call(this, i.clientX - n.left - a / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
|
+
if (i.button !== 0) return;
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), y(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
@@ -190,7 +190,7 @@ const He = class He extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Nt).call(this), t(this, _t).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,11 +198,11 @@ const He = class He extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var F, ot, J, q, xt, vt,
|
|
205
|
-
const
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
|
+
let le = Me;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
+
var F, ot, J, q, xt, vt, Wt;
|
|
205
|
+
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
@@ -211,56 +211,56 @@ const Me = class Me extends HTMLElement {
|
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
213
213
|
d(this, vt, 0);
|
|
214
|
-
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
|
|
217
|
-
const e = t(this, q).container, s = t(this, q).track,
|
|
216
|
+
H.log("nine-table-vscrollbar.refresh");
|
|
217
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = o * c;
|
|
218
218
|
if (l <= n) {
|
|
219
|
-
|
|
219
|
+
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
220
220
|
return;
|
|
221
221
|
} else
|
|
222
|
-
|
|
222
|
+
i.style.display = "block";
|
|
223
223
|
const f = s.clientHeight;
|
|
224
224
|
if (f <= 0) return;
|
|
225
225
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
let
|
|
229
|
-
|
|
226
|
+
i.style.height = `${u}px`;
|
|
227
|
+
const b = e.scrollTop, g = Math.max(l - n, 1);
|
|
228
|
+
let m = 0;
|
|
229
|
+
g > 0 && (m = b / g * (f - u));
|
|
230
230
|
const v = f - u;
|
|
231
|
-
|
|
231
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
234
|
-
|
|
233
|
+
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
234
|
+
H.log("nine-table-vscrollbar.#init");
|
|
235
235
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
236
236
|
const n = (t(this, F).data.get() || []).length, a = t(this, ot).getRowHeight();
|
|
237
237
|
return n * a;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
e.addEventListener("scroll", () => {
|
|
240
240
|
t(this, J) || this.refresh();
|
|
241
|
-
}), t(this, q).thumb.addEventListener("mousedown", (
|
|
242
|
-
if (
|
|
243
|
-
|
|
241
|
+
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
242
|
+
if (i.button !== 0) return;
|
|
243
|
+
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this, xt, i.clientY), y(this, vt, e.scrollTop);
|
|
244
244
|
const n = /* @__PURE__ */ h((o) => {
|
|
245
245
|
if (!t(this, J)) return;
|
|
246
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l,
|
|
246
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, b = o.clientY - t(this, xt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
|
-
const
|
|
249
|
-
let
|
|
250
|
-
const
|
|
251
|
-
|
|
248
|
+
const E = b / u * v;
|
|
249
|
+
let x = t(this, vt) + E;
|
|
250
|
+
const M = Math.max(0, m - g);
|
|
251
|
+
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
252
252
|
}
|
|
253
253
|
this.refresh();
|
|
254
254
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
255
255
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
256
256
|
}, "onMouseUp");
|
|
257
257
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
|
-
}), t(this, q).track.addEventListener("mousedown", (
|
|
259
|
-
if (
|
|
260
|
-
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o =
|
|
261
|
-
if (l > 0 &&
|
|
262
|
-
const
|
|
263
|
-
e.scrollTop =
|
|
258
|
+
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
259
|
+
if (i.button !== 0 || i.target === t(this, q).thumb) return;
|
|
260
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = i.clientY - n.top - a / 2, l = n.height - a, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
261
|
+
if (l > 0 && b > 0) {
|
|
262
|
+
const g = Math.max(0, Math.min(1, o / l));
|
|
263
|
+
e.scrollTop = g * b;
|
|
264
264
|
}
|
|
265
265
|
this.refresh();
|
|
266
266
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -347,201 +347,204 @@ const Me = class Me extends HTMLElement {
|
|
|
347
347
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
348
348
|
top: this.querySelector(".ng-scroll-top"),
|
|
349
349
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
350
|
-
}), t(this,
|
|
350
|
+
}), t(this, Wt).call(this), this.refresh();
|
|
351
351
|
}, "initWhenReady");
|
|
352
352
|
e();
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(),
|
|
356
|
-
let
|
|
357
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
358
|
-
var P, S, D,
|
|
359
|
-
const
|
|
360
|
-
constructor(
|
|
355
|
+
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
356
|
+
let ce = $e;
|
|
357
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
358
|
+
var P, S, wt, D, I, V, Q, St, Ee, at, Ot, Bt, zt, Et, At, Dt, Pt, Rt, Ae, lt, qt, jt;
|
|
359
|
+
const Ie = class Ie {
|
|
360
|
+
constructor(r) {
|
|
361
361
|
d(this, P);
|
|
362
362
|
d(this, S);
|
|
363
|
+
d(this, wt);
|
|
363
364
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
365
|
+
d(this, I, null);
|
|
365
366
|
d(this, V, null);
|
|
366
367
|
d(this, Q, 0);
|
|
367
|
-
d(this,
|
|
368
|
-
d(this,
|
|
368
|
+
d(this, St, 40);
|
|
369
|
+
d(this, Ee, !1);
|
|
369
370
|
d(this, at, !1);
|
|
370
|
-
d(this,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
|
|
371
|
+
d(this, Ot, 3);
|
|
372
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
|
+
H.log("rowManager.refresh");
|
|
374
|
+
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
r && (t(this, Et).call(this), t(this, lt).call(this, r.scrollTop));
|
|
375
376
|
}, "refresh"));
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
const l =
|
|
377
|
+
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
+
H.log("rowManager.initialize");
|
|
379
|
+
const r = t(this, S).querySelector(".ng-container-body"), e = r == null ? void 0 : r.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)");
|
|
380
|
+
H.log(e), y(this, wt, {
|
|
381
|
+
scrollTables: t(this, S).querySelectorAll(".ng-part-body table")
|
|
382
|
+
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
383
|
+
const l = t(this, S).querySelector(c);
|
|
383
384
|
if (!l) return;
|
|
384
|
-
const
|
|
385
|
-
|
|
385
|
+
const f = l.querySelector(".ng-part-body table");
|
|
386
|
+
if (!f) return;
|
|
387
|
+
const u = f.querySelector("tbody.bindable-tbody");
|
|
388
|
+
if (!u) return;
|
|
389
|
+
const g = Array.from(u.querySelectorAll("tr")).map((m) => m.cloneNode(!0));
|
|
390
|
+
t(this, D).set(c, g);
|
|
386
391
|
});
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
t(this,
|
|
390
|
-
let
|
|
391
|
-
const
|
|
392
|
-
var
|
|
393
|
-
|
|
392
|
+
const s = t(this, S).querySelector(".ng-container-body .ng-part-body"), i = t(this, S).querySelector(".ng-container-left .ng-part-body"), n = t(this, S).querySelector(".ng-container-right .ng-part-body"), a = t(this, S).querySelector(".ng-container-body .ng-part-header"), o = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (s) {
|
|
394
|
+
t(this, zt).call(this, s), t(this, Rt).call(this), t(this, Et).call(this), t(this, lt).call(this, s.scrollTop);
|
|
395
|
+
let c = !1;
|
|
396
|
+
const l = /* @__PURE__ */ h((f, u, b) => {
|
|
397
|
+
var g;
|
|
398
|
+
c || (c = !0, s && s.scrollTop !== f && (s.scrollTop = f), i && i.scrollTop !== f && (i.scrollTop = f), n && n.scrollTop !== f && (n.scrollTop = f), a && a.scrollLeft !== u && (a.scrollLeft = u), o && o.scrollLeft !== u && (o.scrollLeft = u), t(this, lt).call(this, f), (g = t(this, S).querySelector("nine-table-vscrollbar")) == null || g.refresh(), c = !1);
|
|
394
399
|
}, "syncScroll");
|
|
395
|
-
[
|
|
396
|
-
|
|
400
|
+
[s, i, n].forEach((f) => {
|
|
401
|
+
f && f.addEventListener("scroll", () => {
|
|
397
402
|
t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
|
|
398
|
-
|
|
403
|
+
l(f.scrollTop, f.scrollLeft), y(this, at, !1);
|
|
399
404
|
}));
|
|
400
405
|
});
|
|
401
406
|
});
|
|
402
407
|
}
|
|
403
408
|
}, "initialize"));
|
|
404
|
-
d(this,
|
|
405
|
-
|
|
409
|
+
d(this, Bt, /* @__PURE__ */ h((r, e) => {
|
|
410
|
+
H.log("rowManager.#renderRows");
|
|
406
411
|
const s = t(this, D).get(e);
|
|
407
412
|
if (!s || s.length === 0) return;
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
|
|
411
|
-
const n =
|
|
412
|
-
for (let o = 0; o < t(this,
|
|
413
|
+
const i = r.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!i) return;
|
|
415
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
416
|
+
const n = i.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
417
|
+
for (let o = 0; o < t(this, St); o++)
|
|
413
418
|
s.forEach((c) => {
|
|
414
419
|
a.appendChild(c.cloneNode(!0));
|
|
415
420
|
});
|
|
416
|
-
n ? n.before(a) :
|
|
421
|
+
n ? n.before(a) : i.appendChild(a);
|
|
417
422
|
}, "#renderRows"));
|
|
418
|
-
d(this,
|
|
419
|
-
if (
|
|
420
|
-
return t(this,
|
|
421
|
-
|
|
423
|
+
d(this, zt, /* @__PURE__ */ h((r) => {
|
|
424
|
+
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
|
+
return t(this, I);
|
|
426
|
+
H.log("#measureAndCacheHeight");
|
|
422
427
|
const e = t(this, D).get(".ng-container-body");
|
|
423
428
|
if (!e || e.length === 0) return 24;
|
|
424
|
-
const s =
|
|
429
|
+
const s = r.querySelector("tbody.bindable-tbody");
|
|
425
430
|
if (!s) return 24;
|
|
426
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
427
|
-
const
|
|
428
|
-
e.forEach((
|
|
429
|
-
n.appendChild(
|
|
430
|
-
}),
|
|
431
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
432
|
+
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
|
+
e.forEach((b) => {
|
|
434
|
+
n.appendChild(b.cloneNode(!0));
|
|
435
|
+
}), i ? i.before(n) : s.appendChild(n);
|
|
431
436
|
const a = t(this, S), o = a.style.display, c = a.style.visibility, l = a.style.position;
|
|
432
437
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
433
438
|
let f = 0;
|
|
434
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
435
|
-
return u.forEach((
|
|
436
|
-
f +=
|
|
437
|
-
}), u.forEach((
|
|
440
|
+
return u.forEach((b) => {
|
|
441
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
442
|
+
}), u.forEach((b) => b.remove()), a.style.display = o, a.style.visibility = c, a.style.position = l, y(this, I, f > 0 ? f : 24), t(this, At).call(this), t(this, I);
|
|
438
443
|
}, "#measureAndCacheHeight"));
|
|
439
|
-
d(this,
|
|
440
|
-
|
|
441
|
-
const e = (t(this, P).data.get() || []).length, s = t(this,
|
|
444
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
445
|
+
H.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
442
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
443
448
|
const a = t(this, S).querySelector(n);
|
|
444
449
|
if (!a) return;
|
|
445
450
|
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
446
|
-
o && (o.style.height = `${
|
|
451
|
+
o && (o.style.height = `${i}px`);
|
|
447
452
|
});
|
|
448
453
|
}, "#updateVirtualScrollHeight"));
|
|
449
|
-
d(this,
|
|
450
|
-
if (t(this, Q) > 0 && t(this,
|
|
451
|
-
const
|
|
452
|
-
y(this,
|
|
454
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
455
|
+
if (t(this, Q) > 0 && t(this, I) > 0) {
|
|
456
|
+
const r = Math.ceil(t(this, Q) / t(this, I));
|
|
457
|
+
y(this, St, r + t(this, Ot));
|
|
453
458
|
}
|
|
454
459
|
}, "#updateRowCount"));
|
|
455
|
-
d(this,
|
|
456
|
-
var o, c, l, f, u,
|
|
457
|
-
const
|
|
460
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
461
|
+
var o, c, l, f, u, b;
|
|
462
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
458
463
|
if (e) {
|
|
459
|
-
const
|
|
460
|
-
for (let
|
|
461
|
-
const
|
|
462
|
-
((o =
|
|
463
|
-
((c = x
|
|
464
|
-
((l = v[
|
|
465
|
-
],
|
|
466
|
-
|
|
464
|
+
const g = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(g.length, m.length, v.length);
|
|
465
|
+
for (let x = 0; x < E; x++) {
|
|
466
|
+
const M = [
|
|
467
|
+
((o = g[x]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
468
|
+
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
469
|
+
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
|
+
], k = Math.max(...M);
|
|
471
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
467
472
|
}
|
|
468
473
|
}
|
|
469
|
-
const
|
|
474
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
470
475
|
if (n) {
|
|
471
|
-
const
|
|
472
|
-
for (let
|
|
473
|
-
const
|
|
474
|
-
((f =
|
|
475
|
-
((u = x
|
|
476
|
-
((
|
|
477
|
-
],
|
|
478
|
-
|
|
476
|
+
const g = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], E = Math.max(g.length, m.length, v.length);
|
|
477
|
+
for (let x = 0; x < E; x++) {
|
|
478
|
+
const M = [
|
|
479
|
+
((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
|
+
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
|
+
((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
482
|
+
], k = Math.max(...M);
|
|
483
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
479
484
|
}
|
|
480
485
|
}
|
|
481
486
|
}, "#syncRowHeights"));
|
|
482
|
-
d(this,
|
|
483
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((
|
|
484
|
-
for (const e of
|
|
487
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((r) => {
|
|
489
|
+
for (const e of r) {
|
|
485
490
|
const s = e.target;
|
|
486
491
|
if (!s.classList.contains("active")) continue;
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
492
|
+
const i = e.contentRect.height;
|
|
493
|
+
if (i > 0) {
|
|
489
494
|
let n = 0;
|
|
490
495
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
491
496
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
492
|
-
const c = Math.max(
|
|
493
|
-
t(this, Q) !== c && (y(this, Q, c), t(this,
|
|
497
|
+
const c = Math.max(i - n, 100);
|
|
498
|
+
t(this, Q) !== c && (y(this, Q, c), t(this, At).call(this), t(this, I) !== null && (t(this, Rt).call(this), this.refresh()));
|
|
494
499
|
}
|
|
495
500
|
}
|
|
496
501
|
})), t(this, V).observe(t(this, S)));
|
|
497
502
|
}, "#initResizeObserver"));
|
|
498
|
-
d(this,
|
|
499
|
-
|
|
500
|
-
const e = t(this, S).querySelector(
|
|
501
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
502
|
-
}), t(this,
|
|
503
|
+
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
504
|
+
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
505
|
+
const e = t(this, S).querySelector(r);
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, r);
|
|
507
|
+
}), t(this, jt).call(this), t(this, Dt).call(this);
|
|
503
508
|
}, "#renderAllContainers"));
|
|
504
|
-
d(this,
|
|
509
|
+
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
505
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
506
511
|
var l;
|
|
507
512
|
const s = t(this, S).querySelector(e);
|
|
508
513
|
if (!s) return;
|
|
509
|
-
const
|
|
510
|
-
if (!
|
|
511
|
-
const n = Array.from(
|
|
514
|
+
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
|
+
if (!i) return;
|
|
516
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), a = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
512
517
|
n.forEach((f, u) => {
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
518
|
+
const b = r + Math.floor(u / a);
|
|
519
|
+
if (b >= c) {
|
|
515
520
|
f.style.display = "none";
|
|
516
521
|
return;
|
|
517
522
|
}
|
|
518
|
-
const
|
|
519
|
-
f.style.display = "", t(this,
|
|
523
|
+
const g = t(this, P).data.get(b);
|
|
524
|
+
f.style.display = "", t(this, qt).call(this, f, g, b);
|
|
520
525
|
});
|
|
521
526
|
});
|
|
522
527
|
}, "#adjustBufferRows"));
|
|
523
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
524
|
-
var f;
|
|
525
|
-
const e = t(this,
|
|
528
|
+
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
529
|
+
var f, u;
|
|
530
|
+
const e = t(this, I);
|
|
526
531
|
if (!e || e <= 0) return;
|
|
527
|
-
const s = t(this, P).data.length;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}), C.log("#handleScroll", l, r), l !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
533
|
-
const g = t(this, S).querySelector(u);
|
|
532
|
+
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), c = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
533
|
+
(u = t(this, wt)) == null || u.scrollTables.forEach((b) => {
|
|
534
|
+
b.style.transform = `translateY(${n}px)`;
|
|
535
|
+
}), l !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
536
|
+
const g = t(this, S).querySelector(b);
|
|
534
537
|
if (!g) return;
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
537
|
-
Array.from(
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
|
|
538
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
539
|
+
if (!m) return;
|
|
540
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
541
|
+
const M = i + Math.floor(x / a);
|
|
542
|
+
if (M >= s) {
|
|
543
|
+
E.style.display = "none";
|
|
541
544
|
return;
|
|
542
545
|
}
|
|
543
|
-
const
|
|
544
|
-
|
|
546
|
+
const k = t(this, P).data.get(M);
|
|
547
|
+
E.style.display = "", t(this, qt).call(this, E, k, M);
|
|
545
548
|
});
|
|
546
549
|
});
|
|
547
550
|
}, "#handleScroll"));
|
|
@@ -559,70 +562,70 @@ const $e = class $e {
|
|
|
559
562
|
cell.dataset.row = dataIndex;
|
|
560
563
|
});
|
|
561
564
|
}; */
|
|
562
|
-
d(this,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const a = Array.from(
|
|
565
|
+
d(this, qt, /* @__PURE__ */ h((r, e, s) => {
|
|
566
|
+
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
567
|
+
i.dataset.row = s;
|
|
568
|
+
const a = Array.from(i.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
566
569
|
a && typeof a.refresh == "function" && a.refresh();
|
|
567
570
|
});
|
|
568
571
|
}, "#bindRowData"));
|
|
569
|
-
d(this,
|
|
572
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
570
573
|
var c, l, f;
|
|
571
|
-
|
|
572
|
-
const
|
|
574
|
+
H.log("rowManager.#syncHeaderHeights");
|
|
575
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
573
576
|
if (!e) return;
|
|
574
|
-
const
|
|
577
|
+
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(i.length, n.length, a.length);
|
|
575
578
|
for (let u = 0; u < o; u++) {
|
|
576
|
-
const
|
|
577
|
-
((c =
|
|
579
|
+
const b = [
|
|
580
|
+
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
578
581
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
579
582
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
580
|
-
],
|
|
581
|
-
|
|
583
|
+
], g = Math.max(...b);
|
|
584
|
+
g > 0 && (i[u] && (i[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), a[u] && (a[u].style.height = `${g}px`));
|
|
582
585
|
}
|
|
583
586
|
}, "#syncHeaderHeights"));
|
|
584
|
-
|
|
587
|
+
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
585
588
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
586
589
|
}, "destroy"));
|
|
587
|
-
y(this, P,
|
|
590
|
+
y(this, P, r.getRootNode().host), y(this, S, r), t(this, Pt).call(this);
|
|
588
591
|
}
|
|
589
592
|
getRowHeight() {
|
|
590
|
-
return t(this,
|
|
593
|
+
return t(this, I);
|
|
591
594
|
}
|
|
592
|
-
templateLength(
|
|
595
|
+
templateLength(r = ".ng-container-body") {
|
|
593
596
|
var e;
|
|
594
|
-
return ((e = t(this, D).get(
|
|
597
|
+
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
595
598
|
}
|
|
596
599
|
};
|
|
597
|
-
P = new WeakMap(), S = new WeakMap(),
|
|
598
|
-
let
|
|
599
|
-
const
|
|
600
|
+
P = new WeakMap(), S = new WeakMap(), wt = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), St = new WeakMap(), Ee = new WeakMap(), at = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), Rt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), jt = new WeakMap(), h(Ie, "RowManager");
|
|
601
|
+
let he = Ie;
|
|
602
|
+
const Ft = class Ft {
|
|
600
603
|
/**
|
|
601
604
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
602
605
|
*/
|
|
603
|
-
static compileAll(
|
|
604
|
-
return Array.isArray(
|
|
606
|
+
static compileAll(r) {
|
|
607
|
+
return Array.isArray(r) ? r.map((e) => Ft.compile(e)) : [];
|
|
605
608
|
}
|
|
606
609
|
/**
|
|
607
610
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
608
611
|
*/
|
|
609
|
-
static compile(
|
|
610
|
-
if (!
|
|
612
|
+
static compile(r) {
|
|
613
|
+
if (!r) return null;
|
|
611
614
|
const e = /* @__PURE__ */ h((o) => {
|
|
612
615
|
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
613
616
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
614
617
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
615
618
|
let u = `cell-${f}`;
|
|
616
|
-
const
|
|
617
|
-
let
|
|
618
|
-
|
|
619
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
620
|
+
let E = [];
|
|
621
|
+
b && E.push(`data-bind="${b}"`), g && E.push(`data-expr="${g}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), l.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
619
622
|
});
|
|
620
623
|
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
621
624
|
if (!o.querySelector("colgroup")) {
|
|
622
625
|
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);
|
|
623
|
-
for (let
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
+
for (let b = 0; b < l; b++) {
|
|
627
|
+
const g = document.createElement("col");
|
|
628
|
+
g.setAttribute("width", u), f.appendChild(g);
|
|
626
629
|
}
|
|
627
630
|
o.prepend(f);
|
|
628
631
|
}
|
|
@@ -631,40 +634,40 @@ const jt = class jt {
|
|
|
631
634
|
l ? l.after(c) : o.prepend(c);
|
|
632
635
|
}
|
|
633
636
|
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
634
|
-
}, "ensureTableStructure"),
|
|
637
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((o, c) => {
|
|
635
638
|
const l = Array.from(o.querySelectorAll(c + " tr")), f = Array.from(o.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
636
639
|
if (u === 0 || f.length === 0) return;
|
|
637
|
-
let
|
|
638
|
-
f.forEach((
|
|
639
|
-
|
|
640
|
+
let b = 0;
|
|
641
|
+
f.forEach((m) => {
|
|
642
|
+
b += m.colSpan || 1;
|
|
640
643
|
});
|
|
641
|
-
const
|
|
642
|
-
l.forEach((
|
|
643
|
-
const v =
|
|
644
|
-
let
|
|
645
|
-
Array.from(
|
|
646
|
-
for (let B = 0; B <
|
|
647
|
-
if (
|
|
648
|
-
|
|
644
|
+
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
645
|
+
l.forEach((m) => {
|
|
646
|
+
const v = m.sectionRowIndex;
|
|
647
|
+
let E = 0;
|
|
648
|
+
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
649
|
+
for (let B = 0; B < g[v].length; B++)
|
|
650
|
+
if (g[v][B] === null) {
|
|
651
|
+
E = B;
|
|
649
652
|
break;
|
|
650
653
|
}
|
|
651
|
-
const
|
|
652
|
-
for (let B = 0; B <
|
|
653
|
-
for (let yt = 0; yt <
|
|
654
|
-
v + B < u &&
|
|
654
|
+
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
655
|
+
for (let B = 0; B < M; B++)
|
|
656
|
+
for (let yt = 0; yt < k; yt++)
|
|
657
|
+
v + B < u && E + yt < b && (g[v + B][E + yt] = B === 0 && yt === 0 ? "1" : "0");
|
|
655
658
|
});
|
|
656
|
-
}), l.forEach((
|
|
657
|
-
const v =
|
|
658
|
-
Array.from(
|
|
659
|
-
for (let
|
|
660
|
-
if (
|
|
661
|
-
|
|
659
|
+
}), l.forEach((m) => {
|
|
660
|
+
const v = m.sectionRowIndex;
|
|
661
|
+
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
662
|
+
for (let x = 0; x < g[v].length; x++)
|
|
663
|
+
if (g[v][x] === "1") {
|
|
664
|
+
E.dataset.col = x, g[v][x] = "0";
|
|
662
665
|
break;
|
|
663
666
|
}
|
|
664
667
|
});
|
|
665
668
|
});
|
|
666
|
-
}, "resetColIndex"), n =
|
|
667
|
-
return s(n), e(n),
|
|
669
|
+
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
670
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, c) => {
|
|
668
671
|
const l = o.getAttribute("fixed");
|
|
669
672
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
670
673
|
f.setAttribute("fixed", l);
|
|
@@ -673,64 +676,64 @@ const jt = class jt {
|
|
|
673
676
|
}
|
|
674
677
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
675
678
|
};
|
|
676
|
-
h(
|
|
677
|
-
let
|
|
678
|
-
var
|
|
679
|
+
h(Ft, "TableCompiler");
|
|
680
|
+
let de = Ft;
|
|
681
|
+
var Vt, tt, et, Yt, Ut, ct, Xt, Kt;
|
|
679
682
|
const pt = class pt extends HTMLElement {
|
|
680
683
|
constructor() {
|
|
681
684
|
super();
|
|
682
|
-
d(this,
|
|
685
|
+
d(this, Vt);
|
|
683
686
|
d(this, tt, null);
|
|
684
687
|
d(this, et);
|
|
685
|
-
|
|
688
|
+
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
686
689
|
t(this, et).refresh();
|
|
687
690
|
}, "invalidate"));
|
|
688
|
-
d(this,
|
|
691
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
689
692
|
[
|
|
690
693
|
{ selector: ".ng-container-body", type: null },
|
|
691
694
|
{ selector: ".ng-container-left", type: "left" },
|
|
692
695
|
{ selector: ".ng-container-right", type: "right" }
|
|
693
|
-
].forEach(({ selector: s, type:
|
|
696
|
+
].forEach(({ selector: s, type: i }) => {
|
|
694
697
|
const n = this.querySelector(s);
|
|
695
698
|
if (!n) return;
|
|
696
699
|
n.innerHTML = "";
|
|
697
700
|
const a = document.createElement("div");
|
|
698
|
-
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, tt),
|
|
701
|
+
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, tt), i, "header"));
|
|
699
702
|
const o = document.createElement("div");
|
|
700
703
|
o.className = "ng-part-body";
|
|
701
704
|
const c = document.createElement("div");
|
|
702
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt),
|
|
705
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt), i, "body"));
|
|
703
706
|
const l = document.createElement("div");
|
|
704
707
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), o.appendChild(c);
|
|
705
708
|
const f = document.createElement("div");
|
|
706
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt),
|
|
709
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), i, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
707
710
|
});
|
|
708
711
|
}, "#renderSplitContainers"));
|
|
709
|
-
d(this,
|
|
712
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
710
713
|
["left", "right", "body"].forEach((e) => {
|
|
711
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
712
|
-
if (!s || !
|
|
714
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
715
|
+
if (!s || !i || i.length === 0) return;
|
|
713
716
|
let n = 0;
|
|
714
|
-
|
|
717
|
+
i[0].querySelectorAll("col").forEach((a) => {
|
|
715
718
|
const o = parseInt(a.getAttribute("width"), 10);
|
|
716
719
|
isNaN(n) || (n += o);
|
|
717
720
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
718
721
|
});
|
|
719
722
|
}, "#updateContainerWidths"));
|
|
720
|
-
|
|
721
|
-
e && (y(this, tt,
|
|
723
|
+
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
724
|
+
e && (y(this, tt, de.compile(e)), t(this, Yt).call(this), t(this, Ut).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
722
725
|
var s;
|
|
723
726
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
724
727
|
}, 0));
|
|
725
728
|
}, "generate"));
|
|
726
|
-
d(this, ct, /* @__PURE__ */ h((e, s,
|
|
729
|
+
d(this, ct, /* @__PURE__ */ h((e, s, i) => {
|
|
727
730
|
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
728
|
-
if (
|
|
731
|
+
if (i === "header") {
|
|
729
732
|
if (o && o.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
730
733
|
const f = document.createElement("tbody");
|
|
731
734
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
732
735
|
}
|
|
733
|
-
} else
|
|
736
|
+
} else i === "body" ? (a && a.remove(), c && c.remove(), o && (o.className = "bindable-tbody")) : i === "footer" && (a && a.remove(), o && o.remove());
|
|
734
737
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
735
738
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
736
739
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -739,19 +742,19 @@ const pt = class pt extends HTMLElement {
|
|
|
739
742
|
l.remove();
|
|
740
743
|
}), n;
|
|
741
744
|
}, "#createSplitTable"));
|
|
742
|
-
|
|
743
|
-
|
|
745
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
746
|
+
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
744
747
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
745
748
|
s && (s.scrollLeft = e);
|
|
746
749
|
}, "scrollToX"));
|
|
747
|
-
|
|
750
|
+
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
748
751
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
749
752
|
s && (s.scrollTop = e);
|
|
750
753
|
}, "scrollToY"));
|
|
751
|
-
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
752
|
-
t(this, Xt).call(this);
|
|
753
|
-
}, "#init"));
|
|
754
754
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
755
|
+
t(this, Kt).call(this);
|
|
756
|
+
}, "#init"));
|
|
757
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
755
758
|
const e = pt.SCROLLBAR_SIZE;
|
|
756
759
|
this.innerHTML = `
|
|
757
760
|
<style>
|
|
@@ -894,38 +897,38 @@ const pt = class pt extends HTMLElement {
|
|
|
894
897
|
</div>
|
|
895
898
|
`;
|
|
896
899
|
}, "#render"));
|
|
897
|
-
y(this, et, new
|
|
900
|
+
y(this, et, new he(this)), y(this, Vt, this.getRootNode().host);
|
|
898
901
|
}
|
|
899
902
|
connectedCallback() {
|
|
900
|
-
t(this,
|
|
903
|
+
t(this, Xt).call(this);
|
|
901
904
|
}
|
|
902
905
|
disconnectedCallback() {
|
|
903
|
-
this.innerHTML = "",
|
|
906
|
+
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
904
907
|
}
|
|
905
908
|
};
|
|
906
|
-
|
|
907
|
-
let
|
|
908
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
909
|
-
var
|
|
910
|
-
const
|
|
909
|
+
Vt = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Yt = new WeakMap(), Ut = new WeakMap(), ct = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), h(pt, "NineTableSheet"), A(pt, "SCROLLBAR_SIZE", 16);
|
|
910
|
+
let It = pt;
|
|
911
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", It);
|
|
912
|
+
var Zt, kt;
|
|
913
|
+
const _e = class _e extends HTMLElement {
|
|
911
914
|
constructor() {
|
|
912
915
|
super();
|
|
913
|
-
d(this,
|
|
916
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
914
917
|
var e;
|
|
915
918
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
916
919
|
var a;
|
|
917
|
-
const
|
|
918
|
-
t(this,
|
|
919
|
-
}), t(this,
|
|
920
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
921
|
+
t(this, kt).call(this, n, i);
|
|
922
|
+
}), t(this, kt).call(this, 0, !1);
|
|
920
923
|
}, "#init"));
|
|
921
|
-
d(this,
|
|
922
|
-
const
|
|
924
|
+
d(this, kt, /* @__PURE__ */ h((e, s = !1) => {
|
|
925
|
+
const i = /* @__PURE__ */ h(() => {
|
|
923
926
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
924
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
const
|
|
928
|
-
v &&
|
|
927
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
928
|
+
const b = f.filter((g) => g.classList.contains("active"));
|
|
929
|
+
b.length < 2 || b.forEach((g) => {
|
|
930
|
+
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
931
|
+
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
929
932
|
});
|
|
930
933
|
}, "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");
|
|
931
934
|
if (!o[e]) return;
|
|
@@ -933,53 +936,53 @@ const Ie = class Ie extends HTMLElement {
|
|
|
933
936
|
o.forEach((f, u) => {
|
|
934
937
|
f.classList.toggle("active", u === e);
|
|
935
938
|
}), c.forEach((f, u) => {
|
|
936
|
-
const
|
|
937
|
-
f.classList.toggle("active",
|
|
939
|
+
const b = u === e;
|
|
940
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
938
941
|
});
|
|
939
942
|
else {
|
|
940
943
|
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
941
944
|
if (f.classList.contains("active") && u.length <= 1)
|
|
942
945
|
return;
|
|
943
946
|
f.classList.toggle("active");
|
|
944
|
-
const
|
|
945
|
-
|
|
947
|
+
const b = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
948
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
946
949
|
}
|
|
947
950
|
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
948
951
|
l == null || l.forEach((f) => {
|
|
949
952
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
950
|
-
}),
|
|
953
|
+
}), i();
|
|
951
954
|
}, "#switchSheet"));
|
|
952
955
|
}
|
|
953
956
|
connectedCallback() {
|
|
954
|
-
t(this,
|
|
957
|
+
t(this, Zt).call(this);
|
|
955
958
|
}
|
|
956
959
|
};
|
|
957
|
-
|
|
958
|
-
let
|
|
959
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
960
|
-
var
|
|
961
|
-
const
|
|
962
|
-
constructor(
|
|
963
|
-
d(this,
|
|
964
|
-
d(this,
|
|
965
|
-
t(this,
|
|
966
|
-
for (let e of
|
|
967
|
-
t(this,
|
|
968
|
-
}).observe(t(this,
|
|
960
|
+
Zt = new WeakMap(), kt = new WeakMap(), h(_e, "NineTableSheets");
|
|
961
|
+
let fe = _e;
|
|
962
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
963
|
+
var _, Gt, Tt, Jt;
|
|
964
|
+
const Ne = class Ne {
|
|
965
|
+
constructor(r) {
|
|
966
|
+
d(this, _);
|
|
967
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
968
|
+
t(this, Jt).call(this), new ResizeObserver((r) => {
|
|
969
|
+
for (let e of r)
|
|
970
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
971
|
+
}).observe(t(this, _));
|
|
969
972
|
}, "#init"));
|
|
970
|
-
d(this,
|
|
973
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
971
974
|
var c, l;
|
|
972
|
-
const
|
|
973
|
-
if (
|
|
974
|
-
const e = parseInt(t(this,
|
|
975
|
-
t(this,
|
|
975
|
+
const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
976
|
+
if (r.length === 0) return;
|
|
977
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, a = It.SCROLLBAR_SIZE, o = e * s + i + n + a;
|
|
978
|
+
t(this, _).style.height = `${o}px`;
|
|
976
979
|
}, "#applyAutoHeight"));
|
|
977
|
-
d(this,
|
|
978
|
-
const e = Array.from(t(this,
|
|
979
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
980
|
-
return u +
|
|
980
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
981
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, l) => {
|
|
982
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
983
|
+
return u + b;
|
|
981
984
|
}).join(""), a = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
982
|
-
t(this,
|
|
985
|
+
t(this, _).shadowRoot.innerHTML = `
|
|
983
986
|
<style>
|
|
984
987
|
:host {
|
|
985
988
|
display: flex;
|
|
@@ -1070,77 +1073,77 @@ const _e = class _e {
|
|
|
1070
1073
|
</nine-table-body>
|
|
1071
1074
|
<nine-table-footer></nine-table-footer>
|
|
1072
1075
|
`;
|
|
1073
|
-
const o = t(this,
|
|
1076
|
+
const o = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1074
1077
|
o == null || o.forEach((c, l) => {
|
|
1075
1078
|
e[l] && setTimeout(() => {
|
|
1076
|
-
c.generate(e[l]), s && t(this,
|
|
1079
|
+
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1077
1080
|
});
|
|
1078
1081
|
});
|
|
1079
1082
|
}, "#render"));
|
|
1080
|
-
y(this,
|
|
1083
|
+
y(this, _, r), t(this, Gt).call(this);
|
|
1081
1084
|
}
|
|
1082
1085
|
};
|
|
1083
|
-
|
|
1084
|
-
let
|
|
1085
|
-
var
|
|
1086
|
-
const
|
|
1087
|
-
constructor(
|
|
1088
|
-
d(this,
|
|
1086
|
+
_ = new WeakMap(), Gt = new WeakMap(), Tt = new WeakMap(), Jt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1087
|
+
let ue = Ne;
|
|
1088
|
+
var Ct, ht;
|
|
1089
|
+
const We = class We {
|
|
1090
|
+
constructor(r) {
|
|
1091
|
+
d(this, Ct);
|
|
1089
1092
|
d(this, ht, -1);
|
|
1090
|
-
|
|
1091
|
-
y(this,
|
|
1093
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1094
|
+
y(this, Ct, r);
|
|
1092
1095
|
}
|
|
1093
1096
|
get at() {
|
|
1094
1097
|
return t(this, ht);
|
|
1095
1098
|
}
|
|
1096
|
-
set at(
|
|
1097
|
-
y(this, ht, parseInt(
|
|
1099
|
+
set at(r) {
|
|
1100
|
+
y(this, ht, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1098
1101
|
});
|
|
1099
1102
|
}
|
|
1100
1103
|
};
|
|
1101
|
-
|
|
1102
|
-
let
|
|
1103
|
-
var
|
|
1104
|
+
Ct = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1105
|
+
let ge = We;
|
|
1106
|
+
var N, T, W, dt, Qt, Y, te, st, Lt, ee, se, ft;
|
|
1104
1107
|
const O = class O {
|
|
1105
|
-
constructor(
|
|
1106
|
-
d(this,
|
|
1107
|
-
d(this,
|
|
1108
|
-
d(this,
|
|
1108
|
+
constructor(r, e) {
|
|
1109
|
+
d(this, N);
|
|
1110
|
+
d(this, T);
|
|
1111
|
+
d(this, W, []);
|
|
1109
1112
|
d(this, dt, []);
|
|
1110
|
-
d(this,
|
|
1113
|
+
d(this, Qt, 0);
|
|
1111
1114
|
d(this, Y, []);
|
|
1112
|
-
d(this,
|
|
1115
|
+
d(this, te, /* @__PURE__ */ h(() => {
|
|
1113
1116
|
y(this, Y, []);
|
|
1114
|
-
const
|
|
1115
|
-
Array.from(
|
|
1117
|
+
const r = t(this, N).template || [];
|
|
1118
|
+
Array.from(r).forEach((e) => {
|
|
1116
1119
|
var s;
|
|
1117
1120
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1118
|
-
}), (t(this,
|
|
1119
|
-
e.__ng || (e.__ng = t(this,
|
|
1121
|
+
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1122
|
+
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1120
1123
|
});
|
|
1121
1124
|
}, "#initialize"));
|
|
1122
1125
|
d(this, st, /* @__PURE__ */ h(() => {
|
|
1123
|
-
t(this,
|
|
1124
|
-
|
|
1126
|
+
t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((r) => {
|
|
1127
|
+
r.invalidate();
|
|
1125
1128
|
});
|
|
1126
1129
|
}, "#invalidate"));
|
|
1127
|
-
|
|
1130
|
+
A(this, "get", /* @__PURE__ */ h((r, e) => {
|
|
1128
1131
|
var n;
|
|
1129
1132
|
const s = this.getValidData();
|
|
1130
1133
|
if (!s || s.length <= 0) return;
|
|
1131
|
-
if (
|
|
1132
|
-
if (
|
|
1133
|
-
const
|
|
1134
|
+
if (r == null) return t(this, ft).call(this, s);
|
|
1135
|
+
if (r < 0 || r >= s.length) return null;
|
|
1136
|
+
const i = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1134
1137
|
if (e != null) {
|
|
1135
|
-
const a =
|
|
1136
|
-
return a >= 0 ? s[
|
|
1138
|
+
const a = i.indexOf(e);
|
|
1139
|
+
return a >= 0 ? s[r].v[a] : null;
|
|
1137
1140
|
}
|
|
1138
|
-
return t(this, ft).call(this, s[
|
|
1141
|
+
return t(this, ft).call(this, s[r]);
|
|
1139
1142
|
}, "get"));
|
|
1140
|
-
|
|
1141
|
-
this.clear(), this.add(
|
|
1143
|
+
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1144
|
+
this.clear(), this.add(r, !1), t(this, st).call(this);
|
|
1142
1145
|
}, "set"));
|
|
1143
|
-
d(this,
|
|
1146
|
+
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1144
1147
|
rowState: O.ROW_STATE.EMPTY,
|
|
1145
1148
|
deleted: !1,
|
|
1146
1149
|
filtered: !1,
|
|
@@ -1149,158 +1152,158 @@ const O = class O {
|
|
|
1149
1152
|
c: {},
|
|
1150
1153
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1151
1154
|
}), "#getDefaultMeta"));
|
|
1152
|
-
|
|
1153
|
-
y(this,
|
|
1155
|
+
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1156
|
+
y(this, W, []), y(this, dt, []), t(this, st).call(this);
|
|
1154
1157
|
}, "reset"));
|
|
1155
|
-
|
|
1156
|
-
var i;
|
|
1157
|
-
t(this, k).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1158
|
-
}, "clear"));
|
|
1159
|
-
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1158
|
+
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1160
1159
|
var r;
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1160
|
+
t(this, T).rawRecords = [], y(this, W, []), y(this, dt, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1161
|
+
}, "clear"));
|
|
1162
|
+
d(this, ee, /* @__PURE__ */ h((r) => {
|
|
1163
|
+
var i;
|
|
1164
|
+
Array.isArray(r) || (r = [r]);
|
|
1165
|
+
const e = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
1166
|
+
return r.forEach((n) => {
|
|
1164
1167
|
const a = { v: [] };
|
|
1165
1168
|
e.forEach((o) => {
|
|
1166
1169
|
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1167
1170
|
}), s.push(a);
|
|
1168
1171
|
}), s;
|
|
1169
1172
|
}, "#json2Array"));
|
|
1170
|
-
d(this,
|
|
1171
|
-
e.__ng = t(this,
|
|
1172
|
-
}),
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
const s = t(this,
|
|
1176
|
-
t(this,
|
|
1177
|
-
const
|
|
1173
|
+
d(this, se, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1174
|
+
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1175
|
+
}), r), "#defaultInsert"));
|
|
1176
|
+
A(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1177
|
+
r === void 0 && (r = {});
|
|
1178
|
+
const s = t(this, ee).call(this, r);
|
|
1179
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, se).call(this, s)), this.resetRecords();
|
|
1180
|
+
const i = this.count() - 1;
|
|
1178
1181
|
return e || s.forEach((n, a) => {
|
|
1179
|
-
const o = t(this,
|
|
1182
|
+
const o = t(this, T).rawRecords[i - a];
|
|
1180
1183
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1181
|
-
}), t(this, st).call(this),
|
|
1184
|
+
}), t(this, st).call(this), i;
|
|
1182
1185
|
}, "add"));
|
|
1183
|
-
|
|
1186
|
+
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1184
1187
|
let e = [];
|
|
1185
|
-
Array.isArray(
|
|
1186
|
-
if (t(this,
|
|
1187
|
-
const
|
|
1188
|
-
t(this,
|
|
1189
|
-
n.__ng.rowid ===
|
|
1188
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1189
|
+
if (t(this, W)[s]) {
|
|
1190
|
+
const i = t(this, W)[s].__ng.rowid;
|
|
1191
|
+
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, T).rawRecords.forEach((n) => {
|
|
1192
|
+
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1190
1193
|
});
|
|
1191
1194
|
}
|
|
1192
1195
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1193
1196
|
}, "delete"));
|
|
1194
|
-
|
|
1197
|
+
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1195
1198
|
var c;
|
|
1196
|
-
|
|
1197
|
-
const n = (typeof ((c = t(this,
|
|
1199
|
+
r = parseInt(r, 10);
|
|
1200
|
+
const n = (typeof ((c = t(this, N).fields) == null ? void 0 : c.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1198
1201
|
if (n < 0) return;
|
|
1199
|
-
const a = this.getValidData()[
|
|
1202
|
+
const a = this.getValidData()[r];
|
|
1200
1203
|
if (!a) return;
|
|
1201
1204
|
const o = a.v[n];
|
|
1202
1205
|
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;
|
|
1203
1206
|
}, "setValue"));
|
|
1204
|
-
|
|
1205
|
-
y(this, dt, t(this,
|
|
1206
|
-
|
|
1207
|
-
}), t(this,
|
|
1208
|
-
|
|
1207
|
+
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1208
|
+
y(this, dt, t(this, T).rawRecords.filter((r) => !r.__ng.deleted)), y(this, W, t(this, T).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, T).rawRecords.forEach((r, e) => {
|
|
1209
|
+
r.__ng.rowidx = e;
|
|
1210
|
+
}), t(this, W).forEach((r, e) => {
|
|
1211
|
+
r.__ng.i = e;
|
|
1209
1212
|
});
|
|
1210
1213
|
}, "resetRecords"));
|
|
1211
|
-
|
|
1212
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1214
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1215
|
+
d(this, ft, /* @__PURE__ */ h((r) => {
|
|
1213
1216
|
var a;
|
|
1214
|
-
if (!
|
|
1215
|
-
const e = !Array.isArray(
|
|
1217
|
+
if (!r) return r;
|
|
1218
|
+
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((a = t(this, N).fields) == null ? void 0 : a.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1216
1219
|
const c = {};
|
|
1217
|
-
return
|
|
1220
|
+
return i.forEach((l, f) => {
|
|
1218
1221
|
c[l] = o.v ? o.v[f] : o[l];
|
|
1219
1222
|
}), c.__ng = o.__ng, c;
|
|
1220
1223
|
});
|
|
1221
1224
|
return e ? n[0] : n;
|
|
1222
1225
|
}, "#conv"));
|
|
1223
|
-
|
|
1224
|
-
y(this,
|
|
1226
|
+
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1227
|
+
y(this, N, r), y(this, T, e), t(this, te).call(this);
|
|
1225
1228
|
}
|
|
1226
1229
|
get source() {
|
|
1227
|
-
return t(this, ft).call(this, t(this,
|
|
1230
|
+
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1228
1231
|
}
|
|
1229
|
-
set source(
|
|
1230
|
-
this.clear(), this.add(
|
|
1232
|
+
set source(r) {
|
|
1233
|
+
this.clear(), this.add(r, !1);
|
|
1231
1234
|
}
|
|
1232
1235
|
get nextId() {
|
|
1233
|
-
return ++
|
|
1236
|
+
return ++Ue(this, Qt)._;
|
|
1234
1237
|
}
|
|
1235
1238
|
get count() {
|
|
1236
|
-
return t(this,
|
|
1239
|
+
return t(this, W).length;
|
|
1237
1240
|
}
|
|
1238
1241
|
get length() {
|
|
1239
|
-
return t(this,
|
|
1242
|
+
return t(this, W).length;
|
|
1240
1243
|
}
|
|
1241
1244
|
getRowCount() {
|
|
1242
1245
|
return this.length;
|
|
1243
1246
|
}
|
|
1244
1247
|
};
|
|
1245
|
-
|
|
1246
|
-
|
|
1248
|
+
N = new WeakMap(), T = new WeakMap(), W = new WeakMap(), dt = new WeakMap(), Qt = new WeakMap(), Y = new WeakMap(), te = new WeakMap(), st = new WeakMap(), Lt = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1249
|
+
A(O, "ROW_STATE", {
|
|
1247
1250
|
EMPTY: "EMPTY",
|
|
1248
1251
|
NORMAL: "NORMAL",
|
|
1249
1252
|
INSERT: "INSERT",
|
|
1250
1253
|
UPDATE: "UPDATE",
|
|
1251
1254
|
DELETE: "DELETE"
|
|
1252
1255
|
});
|
|
1253
|
-
let
|
|
1254
|
-
var
|
|
1255
|
-
const
|
|
1256
|
-
constructor(
|
|
1257
|
-
d(this,
|
|
1258
|
-
y(this,
|
|
1256
|
+
let be = O;
|
|
1257
|
+
var rt;
|
|
1258
|
+
const Oe = class Oe {
|
|
1259
|
+
constructor(r) {
|
|
1260
|
+
d(this, rt);
|
|
1261
|
+
y(this, rt, r), this.row = new ge(this), this.data = new be(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1259
1262
|
var e;
|
|
1260
|
-
(e = t(this,
|
|
1263
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1261
1264
|
}, this.setDataSource = (e) => {
|
|
1262
1265
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1263
1266
|
}, this.getRowState = (e) => {
|
|
1264
|
-
var
|
|
1267
|
+
var i, n;
|
|
1265
1268
|
const s = parseInt(e, 10);
|
|
1266
1269
|
if (!(s >= this.data.count()))
|
|
1267
|
-
return (n = (
|
|
1270
|
+
return (n = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : n.rowState;
|
|
1268
1271
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1269
1272
|
this.row.at = e;
|
|
1270
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1271
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1273
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, i) => {
|
|
1274
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1272
1275
|
}, this.setDataSource([]);
|
|
1273
1276
|
}
|
|
1274
1277
|
};
|
|
1275
|
-
|
|
1276
|
-
let
|
|
1277
|
-
var ut,
|
|
1278
|
-
const
|
|
1278
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1279
|
+
let ye = Oe;
|
|
1280
|
+
var ut, L, Ht, re;
|
|
1281
|
+
const Be = class Be {
|
|
1279
1282
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1280
|
-
constructor(
|
|
1283
|
+
constructor(r) {
|
|
1281
1284
|
d(this, ut);
|
|
1282
|
-
d(this,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
t(this,
|
|
1286
|
-
}), t(this,
|
|
1285
|
+
d(this, L, []);
|
|
1286
|
+
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1287
|
+
r.forEach((s) => {
|
|
1288
|
+
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1289
|
+
}), t(this, Ht).call(this);
|
|
1287
1290
|
}, "add"));
|
|
1288
|
-
d(this,
|
|
1289
|
-
const
|
|
1290
|
-
t(this,
|
|
1291
|
-
|
|
1292
|
-
}), y(this,
|
|
1291
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
1292
|
+
const r = /* @__PURE__ */ new Map();
|
|
1293
|
+
t(this, L).forEach((e) => {
|
|
1294
|
+
r.set(e.name, e.type);
|
|
1295
|
+
}), y(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1293
1296
|
}, "#adjust"));
|
|
1294
|
-
d(this,
|
|
1295
|
-
y(this,
|
|
1296
|
-
const
|
|
1297
|
-
if (!(!
|
|
1298
|
-
for (const e of
|
|
1299
|
-
|
|
1300
|
-
const n =
|
|
1301
|
-
n && t(this,
|
|
1297
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1298
|
+
y(this, L, []), H.log(t(this, ut).querySelectorAll("table"));
|
|
1299
|
+
const r = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1300
|
+
if (!(!r || r.length === 0)) {
|
|
1301
|
+
for (const e of r)
|
|
1302
|
+
H.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1303
|
+
const n = i.dataset.bind, a = i.getAttribute("data-type") || "string";
|
|
1304
|
+
n && t(this, L).push({ name: n, type: a });
|
|
1302
1305
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1303
|
-
$(`[${s}]`, e).each((
|
|
1306
|
+
$(`[${s}]`, e).each((i, n) => {
|
|
1304
1307
|
var a = n.getAttribute(s);
|
|
1305
1308
|
if (a.indexOf("data.") < 0) {
|
|
1306
1309
|
const o = a.search(/[(]/g);
|
|
@@ -1315,72 +1318,72 @@ const Oe = class Oe {
|
|
|
1315
1318
|
if (o.trim() != "") {
|
|
1316
1319
|
const c = o.search(/[^_A-Za-z0-9]/g);
|
|
1317
1320
|
let l = "";
|
|
1318
|
-
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this,
|
|
1321
|
+
c >= 0 ? l = o.substring(0, c) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1319
1322
|
}
|
|
1320
1323
|
});
|
|
1321
1324
|
});
|
|
1322
1325
|
});
|
|
1323
|
-
t(this,
|
|
1326
|
+
t(this, Ht).call(this);
|
|
1324
1327
|
}
|
|
1325
1328
|
}, "#init"));
|
|
1326
|
-
y(this, ut,
|
|
1329
|
+
y(this, ut, r), t(this, re).call(this);
|
|
1327
1330
|
}
|
|
1328
1331
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1329
1332
|
get() {
|
|
1330
|
-
return t(this,
|
|
1333
|
+
return t(this, L).map((r) => r.name);
|
|
1331
1334
|
}
|
|
1332
1335
|
// 🎯 내부 객체 통째로 얻기
|
|
1333
1336
|
getFields() {
|
|
1334
|
-
return t(this,
|
|
1337
|
+
return t(this, L);
|
|
1335
1338
|
}
|
|
1336
1339
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1337
|
-
getType(
|
|
1338
|
-
const e = t(this,
|
|
1340
|
+
getType(r) {
|
|
1341
|
+
const e = t(this, L).find((s) => s.name === r);
|
|
1339
1342
|
return e ? e.type : "string";
|
|
1340
1343
|
}
|
|
1341
|
-
indexOf(
|
|
1342
|
-
return t(this,
|
|
1344
|
+
indexOf(r) {
|
|
1345
|
+
return t(this, L).findIndex((e) => e.name === r);
|
|
1343
1346
|
}
|
|
1344
|
-
includes(
|
|
1345
|
-
return t(this,
|
|
1347
|
+
includes(r) {
|
|
1348
|
+
return t(this, L).some((e) => e.name === r);
|
|
1346
1349
|
}
|
|
1347
1350
|
};
|
|
1348
|
-
ut = new WeakMap(),
|
|
1349
|
-
let
|
|
1350
|
-
var
|
|
1351
|
-
const
|
|
1351
|
+
ut = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(), re = new WeakMap(), h(Be, "ngFields");
|
|
1352
|
+
let pe = Be;
|
|
1353
|
+
var it, ie, ne;
|
|
1354
|
+
const ze = class ze extends HTMLElement {
|
|
1352
1355
|
constructor() {
|
|
1353
1356
|
super();
|
|
1354
1357
|
//#created = false;
|
|
1355
|
-
d(this,
|
|
1358
|
+
d(this, it);
|
|
1356
1359
|
d(this, ie);
|
|
1357
|
-
d(this,
|
|
1358
|
-
this.fields = new
|
|
1360
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1361
|
+
this.fields = new pe(this), y(this, ie, new ue(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1359
1362
|
}, "#init"));
|
|
1360
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1363
|
+
this.attachShadow({ mode: "open" }), y(this, it, new ye(this));
|
|
1361
1364
|
}
|
|
1362
1365
|
connectedCallback() {
|
|
1363
|
-
t(this,
|
|
1366
|
+
t(this, ne).call(this);
|
|
1364
1367
|
}
|
|
1365
1368
|
disconnectedCallback() {
|
|
1366
|
-
|
|
1369
|
+
H.log("NineTable disconnected.");
|
|
1367
1370
|
}
|
|
1368
1371
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1369
1372
|
get data() {
|
|
1370
|
-
return t(this,
|
|
1373
|
+
return t(this, it).data;
|
|
1371
1374
|
}
|
|
1372
1375
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1373
1376
|
get row() {
|
|
1374
|
-
return t(this,
|
|
1377
|
+
return t(this, it).row;
|
|
1375
1378
|
}
|
|
1376
1379
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1377
1380
|
get dataManager() {
|
|
1378
|
-
return t(this,
|
|
1381
|
+
return t(this, it);
|
|
1379
1382
|
}
|
|
1380
1383
|
};
|
|
1381
|
-
|
|
1382
|
-
let
|
|
1383
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1384
|
+
it = new WeakMap(), ie = new WeakMap(), ne = new WeakMap(), h(ze, "NineTable");
|
|
1385
|
+
let me = ze;
|
|
1386
|
+
customElements.get("nine-table") || customElements.define("nine-table", me);
|
|
1384
1387
|
const mt = class mt extends HTMLElement {
|
|
1385
1388
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1386
1389
|
constructor() {
|
|
@@ -1392,56 +1395,56 @@ const mt = class mt extends HTMLElement {
|
|
|
1392
1395
|
connectedCallback() {
|
|
1393
1396
|
}
|
|
1394
1397
|
};
|
|
1395
|
-
h(mt, "BasicCellElement"),
|
|
1396
|
-
let
|
|
1397
|
-
var
|
|
1398
|
-
const
|
|
1398
|
+
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1399
|
+
let xe = mt;
|
|
1400
|
+
var C, Mt, p, Re, qe, ke, Te, Ce;
|
|
1401
|
+
const De = class De extends xe {
|
|
1399
1402
|
constructor() {
|
|
1400
1403
|
super();
|
|
1401
|
-
d(this,
|
|
1402
|
-
d(this,
|
|
1404
|
+
d(this, C);
|
|
1405
|
+
d(this, Mt);
|
|
1403
1406
|
d(this, p);
|
|
1404
|
-
d(this, Ae);
|
|
1405
1407
|
d(this, Re);
|
|
1406
1408
|
d(this, qe);
|
|
1407
1409
|
d(this, ke);
|
|
1408
|
-
|
|
1410
|
+
d(this, Te);
|
|
1411
|
+
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1409
1412
|
if (t(this, p))
|
|
1410
1413
|
if (t(this, p).closest("tbody")) {
|
|
1411
|
-
const s = t(this, p).closest("tr").data,
|
|
1414
|
+
const s = t(this, p).closest("tr").data, i = parseInt(t(this, p).dataset.row);
|
|
1412
1415
|
if (!s) return "";
|
|
1413
1416
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1414
1417
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1415
1418
|
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1416
1419
|
} else try {
|
|
1417
|
-
return this.getExprValue(t(this, p).dataset.expr, s,
|
|
1420
|
+
return this.getExprValue(t(this, p).dataset.expr, s, i, t(this, p));
|
|
1418
1421
|
} catch {
|
|
1419
1422
|
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1420
1423
|
}
|
|
1421
1424
|
return ninegrid.nvl(e, "");
|
|
1422
1425
|
} else
|
|
1423
1426
|
try {
|
|
1424
|
-
return t(this,
|
|
1427
|
+
return t(this, C).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, C).data);
|
|
1425
1428
|
} catch {
|
|
1426
1429
|
}
|
|
1427
1430
|
}, "getDisplayText"));
|
|
1428
|
-
d(this,
|
|
1429
|
-
if (!(!t(this,
|
|
1431
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1432
|
+
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1430
1433
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1431
1434
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1432
|
-
var s = t(this, p).closest("tr"),
|
|
1433
|
-
$("th,td", s).each((
|
|
1434
|
-
var
|
|
1435
|
-
|
|
1436
|
-
}),
|
|
1435
|
+
var s = t(this, p).closest("tr"), i = [];
|
|
1436
|
+
$("th,td", s).each((x, M) => {
|
|
1437
|
+
var k = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1438
|
+
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && i.push(k));
|
|
1439
|
+
}), i.sort();
|
|
1437
1440
|
var n = !1;
|
|
1438
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1439
|
-
for (var a of
|
|
1441
|
+
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1442
|
+
for (var a of i) {
|
|
1440
1443
|
if (a > e) break;
|
|
1441
|
-
var o = parseInt(t(this, p).dataset.row), c = o - 1, l = t(this, p).closest("tr").data, f = t(this,
|
|
1444
|
+
var o = parseInt(t(this, p).dataset.row), c = o - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1442
1445
|
t(this, p).dataset.matrixRow;
|
|
1443
|
-
var u = t(this,
|
|
1444
|
-
if (
|
|
1446
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, o) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1447
|
+
if (b != g) {
|
|
1445
1448
|
n = !0;
|
|
1446
1449
|
break;
|
|
1447
1450
|
}
|
|
@@ -1449,17 +1452,17 @@ const ze = class ze extends me {
|
|
|
1449
1452
|
else
|
|
1450
1453
|
n = !0;
|
|
1451
1454
|
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"));
|
|
1452
|
-
var
|
|
1453
|
-
$(
|
|
1455
|
+
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1456
|
+
$(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");
|
|
1454
1457
|
}
|
|
1455
1458
|
}
|
|
1456
1459
|
}, "#resetSuppress"));
|
|
1457
|
-
|
|
1460
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
1458
1461
|
if (typeof e < "u")
|
|
1459
1462
|
try {
|
|
1460
|
-
|
|
1463
|
+
i = parseInt(i);
|
|
1461
1464
|
const a = e.replace("()", "");
|
|
1462
|
-
return t(this,
|
|
1465
|
+
return t(this, C)[a] ? t(this, C)[a].call(this, s, i, t(this, p)) : t(this, C).exprFunction(e).call(this, s, i, t(this, C).data);
|
|
1463
1466
|
} catch {
|
|
1464
1467
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1465
1468
|
}
|
|
@@ -1468,16 +1471,16 @@ const ze = class ze extends me {
|
|
|
1468
1471
|
}, "getExprValue"));
|
|
1469
1472
|
}
|
|
1470
1473
|
connectedCallback() {
|
|
1471
|
-
super.connectedCallback(), y(this,
|
|
1474
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Mt, t(this, p).closest("tr"));
|
|
1472
1475
|
}
|
|
1473
1476
|
get value() {
|
|
1474
|
-
var e = !t(this,
|
|
1477
|
+
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];
|
|
1475
1478
|
return e ?? "";
|
|
1476
1479
|
}
|
|
1477
1480
|
set value(e) {
|
|
1478
1481
|
var s = parseInt(t(this, p).dataset.row);
|
|
1479
|
-
const
|
|
1480
|
-
s < 0 ? t(this,
|
|
1482
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1483
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, i) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, i);
|
|
1481
1484
|
}
|
|
1482
1485
|
get row() {
|
|
1483
1486
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1487,12 +1490,12 @@ const ze = class ze extends me {
|
|
|
1487
1490
|
}
|
|
1488
1491
|
refresh() {
|
|
1489
1492
|
const e = t(this, p).dataset.bind;
|
|
1490
|
-
return parseInt(t(this, p).dataset.row), t(this,
|
|
1493
|
+
return parseInt(t(this, p).dataset.row), t(this, Mt).data[e];
|
|
1491
1494
|
}
|
|
1492
1495
|
};
|
|
1493
|
-
|
|
1494
|
-
let
|
|
1495
|
-
const
|
|
1496
|
+
C = new WeakMap(), Mt = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1497
|
+
let ve = De;
|
|
1498
|
+
const Pe = class Pe extends ve {
|
|
1496
1499
|
constructor() {
|
|
1497
1500
|
super();
|
|
1498
1501
|
}
|
|
@@ -1503,21 +1506,21 @@ const De = class De extends xe {
|
|
|
1503
1506
|
return super.refresh();
|
|
1504
1507
|
}
|
|
1505
1508
|
};
|
|
1506
|
-
h(
|
|
1507
|
-
let
|
|
1508
|
-
var
|
|
1509
|
-
const
|
|
1509
|
+
h(Pe, "EditableCellElement");
|
|
1510
|
+
let we = Pe;
|
|
1511
|
+
var $t, nt, gt, bt, oe, U, Le;
|
|
1512
|
+
const je = class je extends we {
|
|
1510
1513
|
constructor() {
|
|
1511
1514
|
super();
|
|
1512
|
-
d(this,
|
|
1515
|
+
d(this, $t);
|
|
1513
1516
|
d(this, nt);
|
|
1514
1517
|
d(this, gt);
|
|
1515
1518
|
d(this, bt);
|
|
1516
|
-
d(this,
|
|
1519
|
+
d(this, oe);
|
|
1517
1520
|
d(this, U);
|
|
1518
|
-
|
|
1521
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1519
1522
|
const e = super.refresh();
|
|
1520
|
-
|
|
1523
|
+
H.log("::", e), t(this, $t).value = e;
|
|
1521
1524
|
}, "refresh"));
|
|
1522
1525
|
/**
|
|
1523
1526
|
dataRefresh = (v) => {
|
|
@@ -1549,14 +1552,14 @@ const Pe = class Pe extends ve {
|
|
|
1549
1552
|
if (!v) this.reset();
|
|
1550
1553
|
};
|
|
1551
1554
|
*/
|
|
1552
|
-
d(this,
|
|
1555
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1553
1556
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1554
1557
|
if (t(this, nt) == "number") {
|
|
1555
1558
|
let n = [];
|
|
1556
1559
|
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1557
|
-
var s = e.target.value,
|
|
1558
|
-
if (
|
|
1559
|
-
var s = s.substr(
|
|
1560
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1561
|
+
if (i >= 0) {
|
|
1562
|
+
var s = s.substr(i + 1, s.length);
|
|
1560
1563
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1561
1564
|
}
|
|
1562
1565
|
}
|
|
@@ -1564,7 +1567,7 @@ const Pe = class Pe extends ve {
|
|
|
1564
1567
|
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1565
1568
|
}
|
|
1566
1569
|
}, "#onKeyDown"));
|
|
1567
|
-
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this,
|
|
1570
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1568
1571
|
}
|
|
1569
1572
|
connectedCallback() {
|
|
1570
1573
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1574,11 +1577,11 @@ const Pe = class Pe extends ve {
|
|
|
1574
1577
|
${e.join(" ")}
|
|
1575
1578
|
ondragstart="return false;"
|
|
1576
1579
|
>
|
|
1577
|
-
`, super.connectedCallback(), y(this,
|
|
1580
|
+
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1578
1581
|
}
|
|
1579
1582
|
};
|
|
1580
|
-
|
|
1581
|
-
let
|
|
1583
|
+
$t = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), oe = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1584
|
+
let Se = je;
|
|
1582
1585
|
customElements.get("cell-input-text");
|
|
1583
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1586
|
+
customElements.get("cell-input") || customElements.define("cell-input", Se);
|
|
1584
1587
|
//# sourceMappingURL=nine-table.js.map
|