@ninebone/table 0.0.576 → 0.0.578
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 +145 -147
- 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
|
@@ -5,10 +5,10 @@ var Ve = (R) => {
|
|
|
5
5
|
var Xe = (R, r, e) => r in R ? Fe(R, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[r] = e;
|
|
6
6
|
var h = (R, r) => Fe(R, "name", { value: r, configurable: !0 });
|
|
7
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),
|
|
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
9
|
var Ue = (R, r, e, s) => ({
|
|
10
10
|
set _(i) {
|
|
11
|
-
|
|
11
|
+
y(R, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(R, r, s);
|
|
@@ -36,7 +36,7 @@ const Me = class Me extends HTMLElement {
|
|
|
36
36
|
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
@@ -77,8 +77,8 @@ const Me = class Me extends HTMLElement {
|
|
|
77
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 + i),
|
|
81
|
-
clearInterval(t(this, X)),
|
|
80
|
+
t(this, G).call(this, n + i), y(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, G).call(this, o + i) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
@@ -99,20 +99,20 @@ const Me = class Me extends HTMLElement {
|
|
|
99
99
|
t(this, G).call(this, i.clientX - n.left - o / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
101
|
if (i.button !== 0) return;
|
|
102
|
-
i.stopPropagation(), i.preventDefault(),
|
|
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((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
106
106
|
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (y(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
y(this, w, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -201,19 +201,19 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F,
|
|
204
|
+
var F, ot, J, q, mt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
|
-
d(this,
|
|
209
|
+
d(this, ot);
|
|
210
210
|
d(this, J, !1);
|
|
211
211
|
d(this, q);
|
|
212
|
+
d(this, mt, 0);
|
|
212
213
|
d(this, xt, 0);
|
|
213
|
-
d(this, vt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this,
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, i = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
218
|
i.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
@@ -232,26 +232,26 @@ const $e = class $e extends HTMLElement {
|
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
-
const n = (t(this, F).data.get() || []).length, o = t(this,
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, q).thumb.addEventListener("mousedown", (i) => {
|
|
241
241
|
if (i.button !== 0) return;
|
|
242
|
-
i.stopPropagation(), i.preventDefault(),
|
|
242
|
+
i.stopPropagation(), i.preventDefault(), y(this, J, !0), y(this, mt, i.clientY), y(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this,
|
|
245
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, mt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
247
|
const E = g / u * v;
|
|
248
|
-
let x = t(this,
|
|
248
|
+
let x = t(this, xt) + E;
|
|
249
249
|
const M = Math.max(0, m - b);
|
|
250
250
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
|
-
|
|
254
|
+
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, q).track.addEventListener("mousedown", (i) => {
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
|
|
273
|
+
y(this, F, this.getRootNode().host), y(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
y(this, q, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,10 +351,10 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var D, S, Q, P, I, V, tt,
|
|
357
|
+
var D, S, Q, P, I, V, tt, vt, Se, Ee, Wt, Ot, Bt, wt, St, zt, Pt, Et, Ae, at, At, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(r) {
|
|
360
360
|
d(this, D);
|
|
@@ -364,7 +364,7 @@ const Ie = class Ie {
|
|
|
364
364
|
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
|
-
d(this,
|
|
367
|
+
d(this, vt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
@@ -373,13 +373,13 @@ const Ie = class Ie {
|
|
|
373
373
|
var e;
|
|
374
374
|
W.log("rowManager.refresh");
|
|
375
375
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
-
r && (t(this,
|
|
376
|
+
r && (t(this, wt).call(this), t(this, at).call(this, r.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
-
W.log("rowManager.initialize"),
|
|
379
|
+
W.log("rowManager.initialize"), y(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}),
|
|
382
|
+
}), y(this, I, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -391,13 +391,13 @@ const Ie = class Ie {
|
|
|
391
391
|
});
|
|
392
392
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (r) {
|
|
394
|
-
t(this, Bt).call(this, r), t(this,
|
|
394
|
+
t(this, Bt).call(this, r), t(this, Et).call(this), t(this, wt).call(this), t(this, at).call(this, r.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this,
|
|
400
|
+
r && r.scrollTop !== l && (r.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), i && i.scrollLeft !== f && (i.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, at).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[r, e, s].forEach((c) => {
|
|
403
403
|
c && c.addEventListener("scroll", () => {
|
|
@@ -414,7 +414,7 @@ const Ie = class Ie {
|
|
|
414
414
|
if (!i) return;
|
|
415
415
|
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
|
-
for (let a = 0; a < t(this,
|
|
417
|
+
for (let a = 0; a < t(this, vt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
@@ -439,9 +439,9 @@ const Ie = class Ie {
|
|
|
439
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
440
|
return u.forEach((g) => {
|
|
441
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l,
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, I, f > 0 ? f : 24), t(this, St).call(this), t(this, I);
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
|
-
d(this,
|
|
444
|
+
d(this, wt, /* @__PURE__ */ h(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
446
|
const e = (t(this, D).data.get() || []).length, s = t(this, I), i = e * s;
|
|
447
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -451,10 +451,10 @@ const Ie = class Ie {
|
|
|
451
451
|
a && (a.style.height = `${i}px`);
|
|
452
452
|
});
|
|
453
453
|
}, "#updateVirtualScrollHeight"));
|
|
454
|
-
d(this,
|
|
454
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
455
455
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
456
|
const r = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
-
|
|
457
|
+
y(this, vt, r + t(this, Wt));
|
|
458
458
|
}
|
|
459
459
|
}, "#updateRowCount"));
|
|
460
460
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
@@ -485,7 +485,7 @@ const Ie = class Ie {
|
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
487
487
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
488
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((r) => {
|
|
489
489
|
for (const e of r) {
|
|
490
490
|
const s = e.target;
|
|
491
491
|
if (!s.classList.contains("active")) continue;
|
|
@@ -495,12 +495,12 @@ const Ie = class Ie {
|
|
|
495
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
496
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
497
497
|
const c = Math.max(i - n, 100);
|
|
498
|
-
t(this, tt) !== c && (
|
|
498
|
+
t(this, tt) !== c && (y(this, tt, c), t(this, St).call(this), t(this, I) !== null && (t(this, Et).call(this), this.refresh()));
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
})), t(this, V).observe(t(this, S)));
|
|
502
502
|
}, "#initResizeObserver"));
|
|
503
|
-
d(this,
|
|
503
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
504
504
|
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
505
505
|
const e = t(this, S).querySelector(r);
|
|
506
506
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, r);
|
|
@@ -521,11 +521,11 @@ const Ie = class Ie {
|
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
523
|
const b = t(this, D).data.get(g);
|
|
524
|
-
f.style.display = "", t(this,
|
|
524
|
+
f.style.display = "", t(this, At).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this,
|
|
528
|
+
d(this, at, /* @__PURE__ */ h((r) => {
|
|
529
529
|
var f, u;
|
|
530
530
|
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
@@ -546,7 +546,7 @@ const Ie = class Ie {
|
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
548
|
const T = t(this, D).data.get(M);
|
|
549
|
-
E.style.display = "", t(this,
|
|
549
|
+
E.style.display = "", t(this, At).call(this, E, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,7 +564,7 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this,
|
|
567
|
+
d(this, At, /* @__PURE__ */ h((r, e, s) => {
|
|
568
568
|
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
569
569
|
i.dataset.row = s;
|
|
570
570
|
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -587,9 +587,9 @@ const Ie = class Ie {
|
|
|
587
587
|
}
|
|
588
588
|
}, "#syncHeaderHeights"));
|
|
589
589
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
590
|
-
t(this, V) && (t(this, V).disconnect(),
|
|
590
|
+
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
591
591
|
}, "destroy"));
|
|
592
|
-
|
|
592
|
+
y(this, D, r.getRootNode().host), y(this, S, r), t(this, Pt).call(this);
|
|
593
593
|
}
|
|
594
594
|
getRowHeight() {
|
|
595
595
|
return t(this, I);
|
|
@@ -599,7 +599,7 @@ const Ie = class Ie {
|
|
|
599
599
|
return ((e = t(this, P).get(r)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(),
|
|
602
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), vt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), at = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
@@ -655,8 +655,8 @@ const jt = class jt {
|
|
|
655
655
|
}
|
|
656
656
|
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
657
657
|
for (let B = 0; B < M; B++)
|
|
658
|
-
for (let
|
|
659
|
-
v + B < u && E +
|
|
658
|
+
for (let bt = 0; bt < T; bt++)
|
|
659
|
+
v + B < u && E + bt < g && (b[v + B][E + bt] = B === 0 && bt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
662
662
|
const v = m.sectionRowIndex;
|
|
@@ -680,15 +680,15 @@ const jt = class jt {
|
|
|
680
680
|
};
|
|
681
681
|
h(jt, "TableCompiler");
|
|
682
682
|
let he = jt;
|
|
683
|
-
var Ft,
|
|
683
|
+
var Ft, lt, et, Vt, Yt, Rt, Ut, Xt;
|
|
684
684
|
const yt = class yt extends HTMLElement {
|
|
685
685
|
constructor() {
|
|
686
686
|
super();
|
|
687
687
|
d(this, Ft);
|
|
688
|
-
d(this,
|
|
689
|
-
d(this,
|
|
688
|
+
d(this, lt, null);
|
|
689
|
+
d(this, et);
|
|
690
690
|
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
691
|
-
t(this,
|
|
691
|
+
t(this, et).refresh();
|
|
692
692
|
}, "invalidate"));
|
|
693
693
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
694
694
|
[
|
|
@@ -699,16 +699,14 @@ const yt = class yt extends HTMLElement {
|
|
|
699
699
|
const n = this.querySelector(s);
|
|
700
700
|
if (!n) return;
|
|
701
701
|
n.innerHTML = "";
|
|
702
|
-
const o = document.createElement("div");
|
|
703
|
-
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
704
|
-
const a = document.createElement("div");
|
|
702
|
+
const o = this.querySelector(`${s} .ng-part-header`), a = document.createElement("div");
|
|
705
703
|
a.className = "ng-part-body";
|
|
706
704
|
const c = document.createElement("div");
|
|
707
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this,
|
|
705
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, Rt).call(this, t(this, lt), i, "body"));
|
|
708
706
|
const l = document.createElement("div");
|
|
709
707
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
710
708
|
const f = document.createElement("div");
|
|
711
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
709
|
+
f.className = "ng-part-footer", f.appendChild(t(this, Rt).call(this, t(this, lt), i, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
712
710
|
});
|
|
713
711
|
}, "#renderSplitContainers"));
|
|
714
712
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
@@ -723,12 +721,12 @@ const yt = class yt extends HTMLElement {
|
|
|
723
721
|
});
|
|
724
722
|
}, "#updateContainerWidths"));
|
|
725
723
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
726
|
-
e && (
|
|
724
|
+
e && (y(this, lt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
727
725
|
var s;
|
|
728
726
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
729
727
|
}, 0));
|
|
730
728
|
}, "generate"));
|
|
731
|
-
d(this,
|
|
729
|
+
d(this, Rt, /* @__PURE__ */ h((e, s, i) => {
|
|
732
730
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
733
731
|
if (i === "header") {
|
|
734
732
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -744,7 +742,7 @@ const yt = class yt extends HTMLElement {
|
|
|
744
742
|
l.remove();
|
|
745
743
|
}), n;
|
|
746
744
|
}, "#createSplitTable"));
|
|
747
|
-
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
745
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
748
746
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
749
747
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
750
748
|
s && (s.scrollLeft = e);
|
|
@@ -906,7 +904,7 @@ const yt = class yt extends HTMLElement {
|
|
|
906
904
|
</div>
|
|
907
905
|
`;
|
|
908
906
|
}, "#render"));
|
|
909
|
-
|
|
907
|
+
y(this, et, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
910
908
|
}
|
|
911
909
|
connectedCallback() {
|
|
912
910
|
t(this, Ut).call(this);
|
|
@@ -915,7 +913,7 @@ const yt = class yt extends HTMLElement {
|
|
|
915
913
|
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
916
914
|
}
|
|
917
915
|
};
|
|
918
|
-
Ft = new WeakMap(),
|
|
916
|
+
Ft = new WeakMap(), lt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), Rt = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), A(yt, "SCROLLBAR_SIZE", 16);
|
|
919
917
|
let $t = yt;
|
|
920
918
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
921
919
|
var Kt, qt;
|
|
@@ -1106,40 +1104,40 @@ const Ne = class Ne {
|
|
|
1106
1104
|
});
|
|
1107
1105
|
});
|
|
1108
1106
|
}, "#render"));
|
|
1109
|
-
|
|
1107
|
+
y(this, H, r), t(this, Zt).call(this);
|
|
1110
1108
|
}
|
|
1111
1109
|
};
|
|
1112
1110
|
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1113
1111
|
let fe = Ne;
|
|
1114
|
-
var kt,
|
|
1112
|
+
var kt, ct;
|
|
1115
1113
|
const We = class We {
|
|
1116
1114
|
constructor(r) {
|
|
1117
1115
|
d(this, kt);
|
|
1118
|
-
d(this,
|
|
1116
|
+
d(this, ct, -1);
|
|
1119
1117
|
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1120
|
-
|
|
1118
|
+
y(this, kt, r);
|
|
1121
1119
|
}
|
|
1122
1120
|
get at() {
|
|
1123
|
-
return t(this,
|
|
1121
|
+
return t(this, ct);
|
|
1124
1122
|
}
|
|
1125
1123
|
set at(r) {
|
|
1126
|
-
|
|
1124
|
+
y(this, ct, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ct)}"]`) && setTimeout(() => {
|
|
1127
1125
|
});
|
|
1128
1126
|
}
|
|
1129
1127
|
};
|
|
1130
|
-
kt = new WeakMap(),
|
|
1128
|
+
kt = new WeakMap(), ct = new WeakMap(), h(We, "ngRow");
|
|
1131
1129
|
let ue = We;
|
|
1132
|
-
var _, k, N,
|
|
1130
|
+
var _, k, N, ht, Jt, Y, Qt, st, Ct, te, ee, dt;
|
|
1133
1131
|
const O = class O {
|
|
1134
1132
|
constructor(r, e) {
|
|
1135
1133
|
d(this, _);
|
|
1136
1134
|
d(this, k);
|
|
1137
1135
|
d(this, N, []);
|
|
1138
|
-
d(this,
|
|
1136
|
+
d(this, ht, []);
|
|
1139
1137
|
d(this, Jt, 0);
|
|
1140
1138
|
d(this, Y, []);
|
|
1141
1139
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1142
|
-
|
|
1140
|
+
y(this, Y, []);
|
|
1143
1141
|
const r = t(this, _).template || [];
|
|
1144
1142
|
Array.from(r).forEach((e) => {
|
|
1145
1143
|
var s;
|
|
@@ -1148,7 +1146,7 @@ const O = class O {
|
|
|
1148
1146
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1149
1147
|
});
|
|
1150
1148
|
}, "#initialize"));
|
|
1151
|
-
d(this,
|
|
1149
|
+
d(this, st, /* @__PURE__ */ h(() => {
|
|
1152
1150
|
const r = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1153
1151
|
r == null || r.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1154
1152
|
e.invalidate();
|
|
@@ -1158,17 +1156,17 @@ const O = class O {
|
|
|
1158
1156
|
var n;
|
|
1159
1157
|
const s = this.getValidData();
|
|
1160
1158
|
if (!s || s.length <= 0) return;
|
|
1161
|
-
if (r == null) return t(this,
|
|
1159
|
+
if (r == null) return t(this, dt).call(this, s);
|
|
1162
1160
|
if (r < 0 || r >= s.length) return null;
|
|
1163
1161
|
const i = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1164
1162
|
if (e != null) {
|
|
1165
1163
|
const o = i.indexOf(e);
|
|
1166
1164
|
return o >= 0 ? s[r].v[o] : null;
|
|
1167
1165
|
}
|
|
1168
|
-
return t(this,
|
|
1166
|
+
return t(this, dt).call(this, s[r]);
|
|
1169
1167
|
}, "get"));
|
|
1170
1168
|
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1171
|
-
this.clear(), this.add(r, !1), t(this,
|
|
1169
|
+
this.clear(), this.add(r, !1), t(this, st).call(this);
|
|
1172
1170
|
}, "set"));
|
|
1173
1171
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1174
1172
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1180,11 +1178,11 @@ const O = class O {
|
|
|
1180
1178
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1181
1179
|
}), "#getDefaultMeta"));
|
|
1182
1180
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1183
|
-
|
|
1181
|
+
y(this, N, []), y(this, ht, []), t(this, st).call(this);
|
|
1184
1182
|
}, "reset"));
|
|
1185
1183
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1186
1184
|
var r;
|
|
1187
|
-
t(this, k).rawRecords = [],
|
|
1185
|
+
t(this, k).rawRecords = [], y(this, N, []), y(this, ht, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1188
1186
|
}, "clear"));
|
|
1189
1187
|
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1190
1188
|
var i;
|
|
@@ -1208,7 +1206,7 @@ const O = class O {
|
|
|
1208
1206
|
return e || s.forEach((n, o) => {
|
|
1209
1207
|
const a = t(this, k).rawRecords[i - o];
|
|
1210
1208
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1211
|
-
}), t(this,
|
|
1209
|
+
}), t(this, st).call(this), i;
|
|
1212
1210
|
}, "add"));
|
|
1213
1211
|
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1214
1212
|
let e = [];
|
|
@@ -1219,7 +1217,7 @@ const O = class O {
|
|
|
1219
1217
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1220
1218
|
});
|
|
1221
1219
|
}
|
|
1222
|
-
}), this.resetRecords(), t(this,
|
|
1220
|
+
}), this.resetRecords(), t(this, st).call(this);
|
|
1223
1221
|
}, "delete"));
|
|
1224
1222
|
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1225
1223
|
var c;
|
|
@@ -1232,14 +1230,14 @@ const O = class O {
|
|
|
1232
1230
|
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1233
1231
|
}, "setValue"));
|
|
1234
1232
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1235
|
-
|
|
1233
|
+
y(this, ht, t(this, k).rawRecords.filter((r) => !r.__ng.deleted)), y(this, N, t(this, k).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, k).rawRecords.forEach((r, e) => {
|
|
1236
1234
|
r.__ng.rowidx = e;
|
|
1237
1235
|
}), t(this, N).forEach((r, e) => {
|
|
1238
1236
|
r.__ng.i = e;
|
|
1239
1237
|
});
|
|
1240
1238
|
}, "resetRecords"));
|
|
1241
1239
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1242
|
-
d(this,
|
|
1240
|
+
d(this, dt, /* @__PURE__ */ h((r) => {
|
|
1243
1241
|
var o;
|
|
1244
1242
|
if (!r) return r;
|
|
1245
1243
|
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
@@ -1251,10 +1249,10 @@ const O = class O {
|
|
|
1251
1249
|
return e ? n[0] : n;
|
|
1252
1250
|
}, "#conv"));
|
|
1253
1251
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1254
|
-
|
|
1252
|
+
y(this, _, r), y(this, k, e), t(this, Qt).call(this);
|
|
1255
1253
|
}
|
|
1256
1254
|
get source() {
|
|
1257
|
-
return t(this,
|
|
1255
|
+
return t(this, dt).call(this, t(this, k).rawRecords);
|
|
1258
1256
|
}
|
|
1259
1257
|
set source(r) {
|
|
1260
1258
|
this.clear(), this.add(r, !1);
|
|
@@ -1272,7 +1270,7 @@ const O = class O {
|
|
|
1272
1270
|
return this.length;
|
|
1273
1271
|
}
|
|
1274
1272
|
};
|
|
1275
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(),
|
|
1273
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), ht = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), dt = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1276
1274
|
A(O, "ROW_STATE", {
|
|
1277
1275
|
EMPTY: "EMPTY",
|
|
1278
1276
|
NORMAL: "NORMAL",
|
|
@@ -1281,13 +1279,13 @@ A(O, "ROW_STATE", {
|
|
|
1281
1279
|
DELETE: "DELETE"
|
|
1282
1280
|
});
|
|
1283
1281
|
let ge = O;
|
|
1284
|
-
var
|
|
1282
|
+
var rt;
|
|
1285
1283
|
const Oe = class Oe {
|
|
1286
1284
|
constructor(r) {
|
|
1287
|
-
d(this,
|
|
1288
|
-
|
|
1285
|
+
d(this, rt);
|
|
1286
|
+
y(this, rt, r), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1289
1287
|
var e;
|
|
1290
|
-
(e = t(this,
|
|
1288
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1291
1289
|
}, this.setDataSource = (e) => {
|
|
1292
1290
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1293
1291
|
}, this.getRowState = (e) => {
|
|
@@ -1302,13 +1300,13 @@ const Oe = class Oe {
|
|
|
1302
1300
|
}, this.setDataSource([]);
|
|
1303
1301
|
}
|
|
1304
1302
|
};
|
|
1305
|
-
|
|
1303
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1306
1304
|
let be = Oe;
|
|
1307
|
-
var
|
|
1305
|
+
var ft, L, Lt, se;
|
|
1308
1306
|
const Be = class Be {
|
|
1309
1307
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1310
1308
|
constructor(r) {
|
|
1311
|
-
d(this,
|
|
1309
|
+
d(this, ft);
|
|
1312
1310
|
d(this, L, []);
|
|
1313
1311
|
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1314
1312
|
r.forEach((s) => {
|
|
@@ -1319,11 +1317,11 @@ const Be = class Be {
|
|
|
1319
1317
|
const r = /* @__PURE__ */ new Map();
|
|
1320
1318
|
t(this, L).forEach((e) => {
|
|
1321
1319
|
r.set(e.name, e.type);
|
|
1322
|
-
}),
|
|
1320
|
+
}), 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);
|
|
1323
1321
|
}, "#adjust"));
|
|
1324
1322
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1325
|
-
|
|
1326
|
-
const r = Array.from(t(this,
|
|
1323
|
+
y(this, L, []), W.log(t(this, ft).querySelectorAll("table"));
|
|
1324
|
+
const r = Array.from(t(this, ft).querySelectorAll("table"));
|
|
1327
1325
|
if (!(!r || r.length === 0)) {
|
|
1328
1326
|
for (const e of r)
|
|
1329
1327
|
W.log(e), $("[data-bind]", e).each((s, i) => {
|
|
@@ -1353,7 +1351,7 @@ const Be = class Be {
|
|
|
1353
1351
|
t(this, Lt).call(this);
|
|
1354
1352
|
}
|
|
1355
1353
|
}, "#init"));
|
|
1356
|
-
|
|
1354
|
+
y(this, ft, r), t(this, se).call(this);
|
|
1357
1355
|
}
|
|
1358
1356
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1359
1357
|
get() {
|
|
@@ -1375,19 +1373,19 @@ const Be = class Be {
|
|
|
1375
1373
|
return t(this, L).some((e) => e.name === r);
|
|
1376
1374
|
}
|
|
1377
1375
|
};
|
|
1378
|
-
|
|
1379
|
-
let
|
|
1380
|
-
var
|
|
1376
|
+
ft = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1377
|
+
let ye = Be;
|
|
1378
|
+
var it, re, ie;
|
|
1381
1379
|
const ze = class ze extends HTMLElement {
|
|
1382
1380
|
constructor() {
|
|
1383
1381
|
super();
|
|
1384
1382
|
//#created = false;
|
|
1385
|
-
d(this,
|
|
1383
|
+
d(this, it);
|
|
1386
1384
|
d(this, re);
|
|
1387
1385
|
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1388
|
-
this.fields = new
|
|
1386
|
+
this.fields = new ye(this), y(this, re, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1389
1387
|
}, "#init"));
|
|
1390
|
-
this.attachShadow({ mode: "open" }),
|
|
1388
|
+
this.attachShadow({ mode: "open" }), y(this, it, new be(this));
|
|
1391
1389
|
}
|
|
1392
1390
|
connectedCallback() {
|
|
1393
1391
|
t(this, ie).call(this);
|
|
@@ -1397,21 +1395,21 @@ const ze = class ze extends HTMLElement {
|
|
|
1397
1395
|
}
|
|
1398
1396
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1399
1397
|
get data() {
|
|
1400
|
-
return t(this,
|
|
1398
|
+
return t(this, it).data;
|
|
1401
1399
|
}
|
|
1402
1400
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1403
1401
|
get row() {
|
|
1404
|
-
return t(this,
|
|
1402
|
+
return t(this, it).row;
|
|
1405
1403
|
}
|
|
1406
1404
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1407
1405
|
get dataManager() {
|
|
1408
|
-
return t(this,
|
|
1406
|
+
return t(this, it);
|
|
1409
1407
|
}
|
|
1410
1408
|
};
|
|
1411
|
-
|
|
1412
|
-
let
|
|
1413
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1414
|
-
const
|
|
1409
|
+
it = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), h(ze, "NineTable");
|
|
1410
|
+
let pe = ze;
|
|
1411
|
+
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1412
|
+
const pt = class pt extends HTMLElement {
|
|
1415
1413
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1416
1414
|
constructor() {
|
|
1417
1415
|
super();
|
|
@@ -1422,44 +1420,44 @@ const mt = class mt extends HTMLElement {
|
|
|
1422
1420
|
connectedCallback() {
|
|
1423
1421
|
}
|
|
1424
1422
|
};
|
|
1425
|
-
h(
|
|
1426
|
-
let me =
|
|
1427
|
-
var C, Ht,
|
|
1423
|
+
h(pt, "BasicCellElement"), A(pt, "_styleCache", /* @__PURE__ */ new Map()), A(pt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1424
|
+
let me = pt;
|
|
1425
|
+
var C, Ht, p, Re, qe, Te, ke, Ce;
|
|
1428
1426
|
const Pe = class Pe extends me {
|
|
1429
1427
|
constructor() {
|
|
1430
1428
|
super();
|
|
1431
1429
|
d(this, C);
|
|
1432
1430
|
d(this, Ht);
|
|
1433
|
-
d(this,
|
|
1431
|
+
d(this, p);
|
|
1434
1432
|
d(this, Re);
|
|
1435
1433
|
d(this, qe);
|
|
1436
1434
|
d(this, Te);
|
|
1437
1435
|
d(this, ke);
|
|
1438
1436
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1439
|
-
if (t(this,
|
|
1440
|
-
if (t(this,
|
|
1441
|
-
const s = t(this,
|
|
1437
|
+
if (t(this, p))
|
|
1438
|
+
if (t(this, p).closest("tbody")) {
|
|
1439
|
+
const s = t(this, p).closest("tr").data, i = parseInt(t(this, p).dataset.row);
|
|
1442
1440
|
if (!s) return "";
|
|
1443
|
-
if (ninegrid.isNull(t(this,
|
|
1444
|
-
if (!ninegrid.isNull(t(this,
|
|
1445
|
-
return s[t(this,
|
|
1441
|
+
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1442
|
+
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1443
|
+
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1446
1444
|
} else try {
|
|
1447
|
-
return this.getExprValue(t(this,
|
|
1445
|
+
return this.getExprValue(t(this, p).dataset.expr, s, i, t(this, p));
|
|
1448
1446
|
} catch {
|
|
1449
|
-
console.error(t(this,
|
|
1447
|
+
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1450
1448
|
}
|
|
1451
1449
|
return ninegrid.nvl(e, "");
|
|
1452
1450
|
} else
|
|
1453
1451
|
try {
|
|
1454
|
-
return t(this, C).exprFunction(t(this,
|
|
1452
|
+
return t(this, C).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, C).data);
|
|
1455
1453
|
} catch {
|
|
1456
1454
|
}
|
|
1457
1455
|
}, "getDisplayText"));
|
|
1458
1456
|
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1459
|
-
if (!(!t(this, C) || !t(this, C).template || !t(this,
|
|
1460
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1457
|
+
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1458
|
+
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1461
1459
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1462
|
-
var s = t(this,
|
|
1460
|
+
var s = t(this, p).closest("tr"), i = [];
|
|
1463
1461
|
$("th,td", s).each((x, M) => {
|
|
1464
1462
|
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1465
1463
|
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
@@ -1468,9 +1466,9 @@ const Pe = class Pe extends me {
|
|
|
1468
1466
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1469
1467
|
for (var o of i) {
|
|
1470
1468
|
if (o > e) break;
|
|
1471
|
-
var a = parseInt(t(this,
|
|
1472
|
-
t(this,
|
|
1473
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this,
|
|
1469
|
+
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1470
|
+
t(this, p).dataset.matrixRow;
|
|
1471
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1474
1472
|
if (g != b) {
|
|
1475
1473
|
n = !0;
|
|
1476
1474
|
break;
|
|
@@ -1478,9 +1476,9 @@ const Pe = class Pe extends me {
|
|
|
1478
1476
|
}
|
|
1479
1477
|
else
|
|
1480
1478
|
n = !0;
|
|
1481
|
-
n ? ninegrid.j.querySelectorAll(t(this,
|
|
1482
|
-
var m = parseInt(t(this,
|
|
1483
|
-
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this,
|
|
1479
|
+
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"));
|
|
1480
|
+
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}"]`);
|
|
1481
|
+
$(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");
|
|
1484
1482
|
}
|
|
1485
1483
|
}
|
|
1486
1484
|
}, "#resetSuppress"));
|
|
@@ -1489,7 +1487,7 @@ const Pe = class Pe extends me {
|
|
|
1489
1487
|
try {
|
|
1490
1488
|
i = parseInt(i);
|
|
1491
1489
|
const o = e.replace("()", "");
|
|
1492
|
-
return t(this, C)[o] ? t(this, C)[o].call(this, s, i, t(this,
|
|
1490
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, i, t(this, p)) : t(this, C).exprFunction(e).call(this, s, i, t(this, C).data);
|
|
1493
1491
|
} catch {
|
|
1494
1492
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1495
1493
|
}
|
|
@@ -1498,29 +1496,29 @@ const Pe = class Pe extends me {
|
|
|
1498
1496
|
}, "getExprValue"));
|
|
1499
1497
|
}
|
|
1500
1498
|
connectedCallback() {
|
|
1501
|
-
super.connectedCallback(),
|
|
1499
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1502
1500
|
}
|
|
1503
1501
|
get value() {
|
|
1504
|
-
var e = !t(this, C) || !t(this, C).dataManager || !t(this,
|
|
1502
|
+
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];
|
|
1505
1503
|
return e ?? "";
|
|
1506
1504
|
}
|
|
1507
1505
|
set value(e) {
|
|
1508
|
-
var s = parseInt(t(this,
|
|
1506
|
+
var s = parseInt(t(this, p).dataset.row);
|
|
1509
1507
|
const i = this.getAttribute("update-row-state") != "false";
|
|
1510
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this,
|
|
1508
|
+
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);
|
|
1511
1509
|
}
|
|
1512
1510
|
get row() {
|
|
1513
|
-
return parseInt(t(this,
|
|
1511
|
+
return parseInt(t(this, p).dataset.row);
|
|
1514
1512
|
}
|
|
1515
1513
|
get data() {
|
|
1516
|
-
return t(this,
|
|
1514
|
+
return t(this, p).closest("tr").data;
|
|
1517
1515
|
}
|
|
1518
1516
|
refresh() {
|
|
1519
|
-
const e = t(this,
|
|
1520
|
-
return parseInt(t(this,
|
|
1517
|
+
const e = t(this, p).dataset.bind;
|
|
1518
|
+
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1521
1519
|
}
|
|
1522
1520
|
};
|
|
1523
|
-
C = new WeakMap(), Ht = new WeakMap(),
|
|
1521
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(Pe, "CellElement");
|
|
1524
1522
|
let xe = Pe;
|
|
1525
1523
|
const De = class De extends xe {
|
|
1526
1524
|
constructor() {
|
|
@@ -1535,14 +1533,14 @@ const De = class De extends xe {
|
|
|
1535
1533
|
};
|
|
1536
1534
|
h(De, "EditableCellElement");
|
|
1537
1535
|
let ve = De;
|
|
1538
|
-
var Mt,
|
|
1536
|
+
var Mt, nt, ut, gt, ne, U, Le;
|
|
1539
1537
|
const je = class je extends ve {
|
|
1540
1538
|
constructor() {
|
|
1541
1539
|
super();
|
|
1542
1540
|
d(this, Mt);
|
|
1543
|
-
d(this,
|
|
1541
|
+
d(this, nt);
|
|
1542
|
+
d(this, ut);
|
|
1544
1543
|
d(this, gt);
|
|
1545
|
-
d(this, bt);
|
|
1546
1544
|
d(this, ne);
|
|
1547
1545
|
d(this, U);
|
|
1548
1546
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
@@ -1581,9 +1579,9 @@ const je = class je extends ve {
|
|
|
1581
1579
|
*/
|
|
1582
1580
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1583
1581
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1584
|
-
if (t(this,
|
|
1582
|
+
if (t(this, nt) == "number") {
|
|
1585
1583
|
let n = [];
|
|
1586
|
-
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this,
|
|
1584
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, gt) && Number(t(this, gt)) >= 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) {
|
|
1587
1585
|
var s = e.target.value, i = s.indexOf(".");
|
|
1588
1586
|
if (i >= 0) {
|
|
1589
1587
|
var s = s.substr(i + 1, s.length);
|
|
@@ -1591,10 +1589,10 @@ const je = class je extends ve {
|
|
|
1591
1589
|
}
|
|
1592
1590
|
}
|
|
1593
1591
|
}
|
|
1594
|
-
t(this,
|
|
1592
|
+
t(this, ut) && ninegrid.getByteLength(e.target.value) >= Number(t(this, ut)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1595
1593
|
}
|
|
1596
1594
|
}, "#onKeyDown"));
|
|
1597
|
-
if (this.applyBaseStyle(),
|
|
1595
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, ut, this.getAttribute("maxbyte")), y(this, gt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1598
1596
|
}
|
|
1599
1597
|
connectedCallback() {
|
|
1600
1598
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1604,10 +1602,10 @@ const je = class je extends ve {
|
|
|
1604
1602
|
${e.join(" ")}
|
|
1605
1603
|
ondragstart="return false;"
|
|
1606
1604
|
>
|
|
1607
|
-
`, super.connectedCallback(),
|
|
1605
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1608
1606
|
}
|
|
1609
1607
|
};
|
|
1610
|
-
Mt = new WeakMap(),
|
|
1608
|
+
Mt = new WeakMap(), nt = new WeakMap(), ut = new WeakMap(), gt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1611
1609
|
let we = je;
|
|
1612
1610
|
customElements.get("cell-input-text");
|
|
1613
1611
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|