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