@ninebone/table 0.0.802 → 0.0.804
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 +423 -424
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,16 +2,16 @@ var ys = Object.defineProperty;
|
|
|
2
2
|
var ms = (C) => {
|
|
3
3
|
throw TypeError(C);
|
|
4
4
|
};
|
|
5
|
-
var Ss = (C,
|
|
6
|
-
var h = (C,
|
|
7
|
-
var
|
|
8
|
-
var t = (C,
|
|
9
|
-
var xs = (C,
|
|
5
|
+
var Ss = (C, s, e) => s in C ? ys(C, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[s] = e;
|
|
6
|
+
var h = (C, s) => ys(C, "name", { value: s, configurable: !0 });
|
|
7
|
+
var E = (C, s, e) => Ss(C, typeof s != "symbol" ? s + "" : s, e), Ee = (C, s, e) => s.has(C) || ms("Cannot " + e);
|
|
8
|
+
var t = (C, s, e) => (Ee(C, s, "read from private field"), e ? e.call(C) : s.get(C)), d = (C, s, e) => s.has(C) ? ms("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(C) : s.set(C, e), y = (C, s, e, n) => (Ee(C, s, "write to private field"), n ? n.call(C, e) : s.set(C, e), e), Y = (C, s, e) => (Ee(C, s, "access private method"), e);
|
|
9
|
+
var xs = (C, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(C,
|
|
11
|
+
y(C, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(C,
|
|
14
|
+
return t(C, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Rs } from "@ninebone/util";
|
|
@@ -22,14 +22,14 @@ const ts = class ts extends Rs.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(ts, "Trace");
|
|
24
24
|
let qe = ts;
|
|
25
|
-
const
|
|
26
|
-
var j, G,
|
|
25
|
+
const q = new qe();
|
|
26
|
+
var j, G, A, tt, et, st, Jt, nt, Qt;
|
|
27
27
|
const es = class es extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, j);
|
|
31
31
|
d(this, G, !1);
|
|
32
|
-
d(this,
|
|
32
|
+
d(this, A);
|
|
33
33
|
d(this, tt);
|
|
34
34
|
d(this, et);
|
|
35
35
|
d(this, st);
|
|
@@ -40,11 +40,11 @@ const es = class es extends HTMLElement {
|
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, st).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this, j) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, j) || !t(this, A) || t(this, G)) return;
|
|
45
|
+
const e = t(this, A).container, n = e.querySelector("table");
|
|
46
|
+
if (!n) return;
|
|
47
|
+
const r = t(this, A).track, i = t(this, A).thumb, o = t(this, j).querySelector(".ng-container-bottom"), a = e.clientWidth, c = n.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,53 +59,53 @@ const es = class es extends HTMLElement {
|
|
|
59
59
|
let g = 0;
|
|
60
60
|
b > 0 && (g = parseInt(f / b * (l - u), 10)), g < 0 && (g = 0);
|
|
61
61
|
const p = l - u;
|
|
62
|
-
g > p && (g = p), i.style.left = `${g}px`, t(this,
|
|
62
|
+
g > p && (g = p), i.style.left = `${g}px`, t(this, A).left.disabled = g === 0, t(this, A).right.disabled = g >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const
|
|
65
|
+
if (!t(this, A)) return !1;
|
|
66
|
+
const n = t(this, A).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const i = t(this,
|
|
68
|
+
const i = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = i.width - o;
|
|
72
|
-
a > c && (a = c), a = parseInt(a, 10), t(this,
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && f > 0 && (
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`, q.log("1111=========="), t(this, A).left.disabled = a === 0, t(this, A).right.disabled = a >= c - 1;
|
|
73
|
+
const l = n.clientWidth, f = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && f > 0 && (n.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
|
-
const i = parseInt(t(this,
|
|
79
|
+
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
80
|
t(this, nt).call(this, i + r), y(this, tt, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, tt)), y(this, et, setInterval(() => {
|
|
82
|
-
const o = parseInt(t(this,
|
|
82
|
+
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
83
|
t(this, nt).call(this, o + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, A).left.addEventListener(r, n), t(this, A).right.addEventListener(r, n), t(this, A).track.addEventListener(r, n);
|
|
91
|
+
}), t(this, A).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, A).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, A).left.addEventListener("touchstart", () => e(-20)), t(this, A).right.addEventListener("touchstart", () => e(20)), t(this, A).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const i = t(this,
|
|
98
|
+
const i = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
|
|
99
99
|
t(this, nt).call(this, r.clientX - i.left - o / 2);
|
|
100
|
-
}), t(this,
|
|
100
|
+
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, G, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const i = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, G)) return;
|
|
105
|
-
const c = t(this,
|
|
105
|
+
const c = t(this, A).track.getBoundingClientRect();
|
|
106
106
|
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, G, !1),
|
|
108
|
+
y(this, G, !1), n(), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -177,18 +177,18 @@ const es = class es extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const n = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!n) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
y(this,
|
|
186
|
-
container:
|
|
185
|
+
y(this, A, {
|
|
186
|
+
container: n,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
191
|
+
}), n.addEventListener("scroll", () => {
|
|
192
192
|
t(this, G) || this.refresh();
|
|
193
193
|
}), t(this, Qt).call(this), t(this, Jt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
@@ -198,10 +198,10 @@ const es = class es extends HTMLElement {
|
|
|
198
198
|
t(this, st) && t(this, st).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
j = new WeakMap(), G = new WeakMap(),
|
|
201
|
+
j = new WeakMap(), G = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Jt = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), h(es, "NineTableHScrollBar");
|
|
202
202
|
let Ce = es;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
|
-
var rt, ot, yt, k, kt,
|
|
204
|
+
var rt, ot, yt, k, kt, Lt, te;
|
|
205
205
|
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
@@ -210,41 +210,41 @@ const ss = class ss extends HTMLElement {
|
|
|
210
210
|
d(this, yt, !1);
|
|
211
211
|
d(this, k);
|
|
212
212
|
d(this, kt, 0);
|
|
213
|
-
d(this,
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, k).container,
|
|
213
|
+
d(this, Lt, 0);
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (q.log("vscrollbar.refresh"), !t(this, rt) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, n = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const l =
|
|
222
|
+
const l = n.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
|
-
|
|
227
|
+
q.log(e, f, b);
|
|
228
228
|
let g = 0;
|
|
229
229
|
b > 0 && (g = f / b * (l - u));
|
|
230
230
|
const p = l - u;
|
|
231
231
|
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, te, /* @__PURE__ */ h(() => {
|
|
234
|
-
|
|
235
|
-
const e = t(this, k).container,
|
|
234
|
+
q.log("nine-table-vscrollbar.#init");
|
|
235
|
+
const e = t(this, k).container, n = /* @__PURE__ */ h(() => {
|
|
236
236
|
const i = (t(this, rt).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
237
237
|
return i * o;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this,
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, Lt, e.scrollTop);
|
|
242
242
|
const i = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, yt)) return;
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p =
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), g = e.clientHeight, p = n(), x = Math.max(p - g, 1);
|
|
245
245
|
if (f > 0 && x > 0) {
|
|
246
246
|
const w = b / f * x;
|
|
247
|
-
let m = t(this,
|
|
247
|
+
let m = t(this, Lt) + w;
|
|
248
248
|
const T = Math.max(0, p - g);
|
|
249
249
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
250
|
}
|
|
@@ -255,7 +255,7 @@ const ss = class ss extends HTMLElement {
|
|
|
255
255
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f =
|
|
258
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, u = e.clientHeight, f = n(), b = Math.max(f - u, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
@@ -334,13 +334,13 @@ const ss = class ss extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
337
|
+
const n = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
y(this, k, {
|
|
343
|
-
container:
|
|
343
|
+
container: n,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -350,77 +350,77 @@ const ss = class ss extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(),
|
|
353
|
+
rt = new WeakMap(), ot = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), h(ss, "NineTableVScrollBar");
|
|
354
354
|
let Te = ss;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
|
-
var U,
|
|
356
|
+
var U, R, it, V, O, Z, at, It, Ve, Ye, ee, se, Mt, Ht, $t, ne, re, Nt, Ue, mt, _t, oe;
|
|
357
357
|
const ns = class ns {
|
|
358
|
-
constructor(
|
|
358
|
+
constructor(s) {
|
|
359
359
|
d(this, U);
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, R);
|
|
361
361
|
d(this, it);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, V, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, O, null);
|
|
364
364
|
d(this, Z, null);
|
|
365
365
|
d(this, at, 0);
|
|
366
|
-
d(this,
|
|
367
|
-
d(this, Ye, !1);
|
|
366
|
+
d(this, It, 40);
|
|
368
367
|
d(this, Ve, !1);
|
|
368
|
+
d(this, Ye, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
370
|
d(this, ee, 3);
|
|
371
|
-
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
373
|
+
q.log("rowManager.refresh");
|
|
374
|
+
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
s && (t(this, Mt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
scrollTables: t(this,
|
|
380
|
-
firstTr: t(this,
|
|
381
|
-
}), y(this, O, null), t(this,
|
|
382
|
-
const a = t(this,
|
|
377
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
+
q.log("rowManager.initialize"), y(this, it, {
|
|
379
|
+
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
|
+
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
+
}), y(this, O, null), t(this, V).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
|
+
const a = t(this, R).querySelector(o);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
385
385
|
if (!c) return;
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
389
|
+
t(this, V).set(o, f);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this,
|
|
391
|
+
const s = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), n = t(this, R).querySelector(".ng-container-right .ng-part-body"), r = t(this, R).querySelector(".ng-container-body .ng-part-header"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (s) {
|
|
393
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop);
|
|
394
394
|
let o = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var f;
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, u = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), n && n.scrollTop !== l && (n.scrollTop = l), r && r.scrollLeft !== u && (r.scrollLeft = u), i && i.scrollLeft !== u && (i.scrollLeft = u), t(this, mt).call(this, l), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
|
|
403
|
-
a(
|
|
404
|
-
}), [e,
|
|
402
|
+
s == null || s.addEventListener("scroll", (c) => {
|
|
403
|
+
a(s);
|
|
404
|
+
}), [e, n].forEach((c) => {
|
|
405
405
|
c == null || c.addEventListener("scroll", (l) => {
|
|
406
406
|
if (o) return;
|
|
407
407
|
o = !0;
|
|
408
408
|
const u = c.scrollTop;
|
|
409
|
-
|
|
409
|
+
s && s.scrollTop !== u && (s.scrollTop = u), o = !1;
|
|
410
410
|
});
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}, "initialize"));
|
|
414
|
-
d(this, se, /* @__PURE__ */ h((
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
const r =
|
|
414
|
+
d(this, se, /* @__PURE__ */ h((s, e) => {
|
|
415
|
+
q.log("rowManager.#renderRows");
|
|
416
|
+
const n = t(this, V).get(e);
|
|
417
|
+
if (!n || n.length === 0) return;
|
|
418
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
419
419
|
if (!r) return;
|
|
420
420
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
421
421
|
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
422
|
-
for (let a = 0; a < t(this,
|
|
423
|
-
|
|
422
|
+
for (let a = 0; a < t(this, It); a++)
|
|
423
|
+
n.forEach((c) => {
|
|
424
424
|
o.appendChild(c.cloneNode(!0));
|
|
425
425
|
});
|
|
426
426
|
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
@@ -428,21 +428,21 @@ const ns = class ns {
|
|
|
428
428
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
429
429
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
430
430
|
return t(this, O);
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
const e = t(this,
|
|
431
|
+
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
432
|
+
q.log("rowManager.#measureAndCacheHeight");
|
|
433
|
+
const e = t(this, V).get(".ng-container-body");
|
|
434
434
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
-
const r =
|
|
435
|
+
const n = s.querySelector("tbody.bindable-tbody");
|
|
436
|
+
if (!n) throw new Error("invalid dom");
|
|
437
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
438
|
+
const r = n.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
439
439
|
e.forEach((b) => {
|
|
440
440
|
i.appendChild(b.cloneNode(!0));
|
|
441
|
-
}), r ? r.before(i) :
|
|
442
|
-
const o = t(this,
|
|
441
|
+
}), r ? r.before(i) : n.appendChild(i);
|
|
442
|
+
const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
443
443
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
444
444
|
let u = 0;
|
|
445
|
-
const f =
|
|
445
|
+
const f = n.querySelectorAll("tr");
|
|
446
446
|
return f.forEach((b) => {
|
|
447
447
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
448
448
|
if (g === 0) {
|
|
@@ -453,10 +453,10 @@ const ns = class ns {
|
|
|
453
453
|
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, u <= 0 ? -1 : (y(this, O, u), t(this, $t).call(this), t(this, O));
|
|
454
454
|
}, "#measureAndCacheHeight"));
|
|
455
455
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
456
|
-
|
|
457
|
-
const e = (t(this, U).data.get() || []).length,
|
|
458
|
-
|
|
459
|
-
const o = t(this,
|
|
456
|
+
q.log("rowManager.#updateVirtualScrollHeight");
|
|
457
|
+
const e = (t(this, U).data.get() || []).length, n = t(this, O), r = e * n;
|
|
458
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
459
|
+
const o = t(this, R).querySelector(i);
|
|
460
460
|
if (!o) return;
|
|
461
461
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
462
462
|
a && (a.style.height = `${r}px`);
|
|
@@ -464,15 +464,15 @@ const ns = class ns {
|
|
|
464
464
|
}, "#updateVirtualScrollHeight"));
|
|
465
465
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
466
466
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
467
|
-
const
|
|
468
|
-
y(this,
|
|
467
|
+
const s = Math.ceil(t(this, at) / t(this, O));
|
|
468
|
+
y(this, It, s + t(this, ee));
|
|
469
469
|
}
|
|
470
470
|
}, "#updateRowCount"));
|
|
471
471
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
472
472
|
var a, c, l, u, f, b;
|
|
473
|
-
const
|
|
473
|
+
const s = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), n = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
474
474
|
if (e) {
|
|
475
|
-
const g =
|
|
475
|
+
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = n ? Array.from(n.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
476
476
|
for (let m = 0; m < w; m++) {
|
|
477
477
|
const T = [
|
|
478
478
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
@@ -482,7 +482,7 @@ const ns = class ns {
|
|
|
482
482
|
S > 0 && (g[m] && (g[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const r = t(this,
|
|
485
|
+
const r = t(this, R).querySelector(".ng-container-left .ng-part-footer table"), i = t(this, R).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, R).querySelector(".ng-container-right .ng-part-footer table");
|
|
486
486
|
if (i) {
|
|
487
487
|
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], p = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, p.length, x.length);
|
|
488
488
|
for (let m = 0; m < w; m++) {
|
|
@@ -496,37 +496,37 @@ const ns = class ns {
|
|
|
496
496
|
}
|
|
497
497
|
}, "#syncRowHeights"));
|
|
498
498
|
d(this, re, /* @__PURE__ */ h(() => {
|
|
499
|
-
!t(this,
|
|
500
|
-
for (const e of
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
499
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, Z, new ResizeObserver((s) => {
|
|
500
|
+
for (const e of s) {
|
|
501
|
+
const n = e.target;
|
|
502
|
+
if (!n.classList.contains("active")) continue;
|
|
503
503
|
const r = e.contentRect.height;
|
|
504
504
|
if (r > 0) {
|
|
505
505
|
let i = 0;
|
|
506
|
-
const o =
|
|
506
|
+
const o = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
507
507
|
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
508
508
|
const c = Math.max(r - i, 100);
|
|
509
509
|
t(this, at) !== c && (y(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
})), t(this, Z).observe(t(this,
|
|
512
|
+
})), t(this, Z).observe(t(this, R)));
|
|
513
513
|
}, "#initResizeObserver"));
|
|
514
514
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
515
|
-
|
|
516
|
-
const e = t(this,
|
|
517
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e,
|
|
515
|
+
q.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
516
|
+
const e = t(this, R).querySelector(s);
|
|
517
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, s);
|
|
518
518
|
}), t(this, oe).call(this), t(this, ne).call(this);
|
|
519
519
|
}, "#renderAllContainers"));
|
|
520
|
-
d(this, Ue, /* @__PURE__ */ h((
|
|
520
|
+
d(this, Ue, /* @__PURE__ */ h((s) => {
|
|
521
521
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
522
522
|
var l;
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
const r =
|
|
523
|
+
const n = t(this, R).querySelector(e);
|
|
524
|
+
if (!n) return;
|
|
525
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
526
526
|
if (!r) return;
|
|
527
|
-
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this,
|
|
527
|
+
const i = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, V).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, U).data.get() || []).length;
|
|
528
528
|
i.forEach((u, f) => {
|
|
529
|
-
const b =
|
|
529
|
+
const b = s + Math.floor(f / o);
|
|
530
530
|
if (b >= c) {
|
|
531
531
|
u.style.visibility = "hidden";
|
|
532
532
|
return;
|
|
@@ -536,35 +536,34 @@ const ns = class ns {
|
|
|
536
536
|
});
|
|
537
537
|
});
|
|
538
538
|
}, "#adjustBufferRows"));
|
|
539
|
-
d(this, mt, /* @__PURE__ */ h((
|
|
539
|
+
d(this, mt, /* @__PURE__ */ h((s) => {
|
|
540
540
|
var f, b;
|
|
541
541
|
const e = t(this, O);
|
|
542
542
|
if (!e || e <= 0) return;
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const r = ((f = t(this,
|
|
546
|
-
|
|
547
|
-
const o = Math.max(0,
|
|
543
|
+
const n = t(this, U).data.length;
|
|
544
|
+
if (n === 0) return;
|
|
545
|
+
const r = ((f = t(this, V).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
546
|
+
q.log("bodyContainer.clientHeight", i.clientHeight);
|
|
547
|
+
const o = Math.max(0, n - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(s / e)));
|
|
548
548
|
let c = Math.floor(a * e);
|
|
549
|
-
R.log(`📜 [Scroll Calc] maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`), a === o && R.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${c}`);
|
|
550
549
|
const l = t(this, it).firstTr, u = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
551
550
|
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
552
551
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
553
|
-
}), u !== a &&
|
|
554
|
-
const p = t(this,
|
|
552
|
+
}), u !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
553
|
+
const p = t(this, R).querySelector(g);
|
|
555
554
|
if (!p) return;
|
|
556
555
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
557
556
|
if (!x) return;
|
|
558
557
|
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, T) => {
|
|
559
558
|
const S = a + Math.floor(T / r);
|
|
560
|
-
if (S >=
|
|
559
|
+
if (S >= n) {
|
|
561
560
|
m.style.display = "none";
|
|
562
561
|
return;
|
|
563
562
|
}
|
|
564
563
|
const M = t(this, U).data.get(S);
|
|
565
564
|
m.style.display = "", t(this, _t).call(this, m, M, S);
|
|
566
565
|
});
|
|
567
|
-
})
|
|
566
|
+
});
|
|
568
567
|
}, "#handleScroll"));
|
|
569
568
|
/**
|
|
570
569
|
#bindRowData = (tr, record, dataIndex) => {
|
|
@@ -580,19 +579,19 @@ const ns = class ns {
|
|
|
580
579
|
cell.dataset.row = dataIndex;
|
|
581
580
|
});
|
|
582
581
|
}; */
|
|
583
|
-
d(this, _t, /* @__PURE__ */ h((
|
|
584
|
-
|
|
585
|
-
r.dataset.row =
|
|
582
|
+
d(this, _t, /* @__PURE__ */ h((s, e, n) => {
|
|
583
|
+
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, i) => {
|
|
584
|
+
r.dataset.row = n;
|
|
586
585
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
587
586
|
o && typeof o.refresh == "function" && o.refresh();
|
|
588
587
|
});
|
|
589
588
|
}, "#bindRowData"));
|
|
590
589
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
591
590
|
var c, l, u;
|
|
592
|
-
|
|
593
|
-
const
|
|
591
|
+
q.log("rowManager.#syncHeaderHeights");
|
|
592
|
+
const s = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), n = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
594
593
|
if (!e) return;
|
|
595
|
-
const r =
|
|
594
|
+
const r = s ? Array.from(s.querySelectorAll("tr")) : [], i = Array.from(e.querySelectorAll("tr")), o = n ? Array.from(n.querySelectorAll("tr")) : [], a = Math.max(r.length, i.length, o.length);
|
|
596
595
|
for (let f = 0; f < a; f++) {
|
|
597
596
|
const b = [
|
|
598
597
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -602,33 +601,33 @@ const ns = class ns {
|
|
|
602
601
|
g > 0 && (r[f] && (r[f].style.height = `${g}px`), i[f] && (i[f].style.height = `${g}px`), o[f] && (o[f].style.height = `${g}px`));
|
|
603
602
|
}
|
|
604
603
|
}, "#syncHeaderHeights"));
|
|
605
|
-
|
|
604
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
606
605
|
t(this, Z) && (t(this, Z).disconnect(), y(this, Z, null));
|
|
607
606
|
}, "destroy"));
|
|
608
|
-
y(this, U,
|
|
607
|
+
y(this, U, s.getRootNode().host), y(this, R, s), t(this, re).call(this);
|
|
609
608
|
}
|
|
610
609
|
getRowHeight() {
|
|
611
610
|
return t(this, O);
|
|
612
611
|
}
|
|
613
|
-
templateLength(
|
|
612
|
+
templateLength(s = ".ng-container-body") {
|
|
614
613
|
var e;
|
|
615
|
-
return ((e = t(this,
|
|
614
|
+
return ((e = t(this, V).get(s)) == null ? void 0 : e.length) || 1;
|
|
616
615
|
}
|
|
617
616
|
};
|
|
618
|
-
U = new WeakMap(),
|
|
617
|
+
U = new WeakMap(), R = new WeakMap(), it = new WeakMap(), V = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), at = new WeakMap(), It = new WeakMap(), Ve = new WeakMap(), Ye = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), Nt = new WeakMap(), Ue = new WeakMap(), mt = new WeakMap(), _t = new WeakMap(), oe = new WeakMap(), h(ns, "RowManager");
|
|
619
618
|
let ke = ns;
|
|
620
619
|
const ie = class ie {
|
|
621
620
|
/**
|
|
622
621
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
623
622
|
*/
|
|
624
|
-
static compileAll(
|
|
625
|
-
return Array.isArray(
|
|
623
|
+
static compileAll(s) {
|
|
624
|
+
return Array.isArray(s) ? s.map((e) => ie.compile(e)) : [];
|
|
626
625
|
}
|
|
627
626
|
/**
|
|
628
627
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
629
628
|
*/
|
|
630
|
-
static compile(
|
|
631
|
-
if (!
|
|
629
|
+
static compile(s) {
|
|
630
|
+
if (!s) return null;
|
|
632
631
|
const e = /* @__PURE__ */ h((a) => {
|
|
633
632
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
634
633
|
const u = l.getAttribute("cell-type") || "renderer";
|
|
@@ -640,7 +639,7 @@ const ie = class ie {
|
|
|
640
639
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
641
640
|
l.setAttribute("tabindex", "0");
|
|
642
641
|
});
|
|
643
|
-
}, "processCellTypes"),
|
|
642
|
+
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
644
643
|
if (!a.querySelector("colgroup")) {
|
|
645
644
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, u = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
646
645
|
for (let b = 0; b < l; b++) {
|
|
@@ -673,8 +672,8 @@ const ie = class ie {
|
|
|
673
672
|
}
|
|
674
673
|
const T = m.rowSpan || 1, S = m.colSpan || 1;
|
|
675
674
|
for (let M = 0; M < T; M++)
|
|
676
|
-
for (let
|
|
677
|
-
x + M < f && w +
|
|
675
|
+
for (let W = 0; W < S; W++)
|
|
676
|
+
x + M < f && w + W < b && (g[x + M][w + W] = M === 0 && W === 0 ? "1" : "0");
|
|
678
677
|
});
|
|
679
678
|
}), l.forEach((p) => {
|
|
680
679
|
const x = p.sectionRowIndex;
|
|
@@ -686,8 +685,8 @@ const ie = class ie {
|
|
|
686
685
|
}
|
|
687
686
|
});
|
|
688
687
|
});
|
|
689
|
-
}, "resetColIndex"), i =
|
|
690
|
-
return
|
|
688
|
+
}, "resetColIndex"), i = s.cloneNode(!0);
|
|
689
|
+
return n(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
691
690
|
const l = a.getAttribute("fixed");
|
|
692
691
|
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
693
692
|
u.setAttribute("fixed", l);
|
|
@@ -697,16 +696,16 @@ const ie = class ie {
|
|
|
697
696
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
698
697
|
};
|
|
699
698
|
h(ie, "TableCompiler");
|
|
700
|
-
let
|
|
699
|
+
let Le = ie;
|
|
701
700
|
var N, X, K, qt, ws;
|
|
702
701
|
const rs = class rs {
|
|
703
|
-
constructor(
|
|
702
|
+
constructor(s) {
|
|
704
703
|
d(this, K);
|
|
705
704
|
d(this, N);
|
|
706
705
|
d(this, X, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
707
|
-
|
|
708
|
-
const { startRow:
|
|
709
|
-
|
|
706
|
+
E(this, "render", /* @__PURE__ */ h(() => {
|
|
707
|
+
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, X);
|
|
708
|
+
q.log("🎨 [CellSelection.render] Rendering range ->", t(this, X));
|
|
710
709
|
const i = t(this, N).querySelectorAll(
|
|
711
710
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
712
711
|
);
|
|
@@ -714,34 +713,34 @@ const rs = class rs {
|
|
|
714
713
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
715
714
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
716
715
|
});
|
|
717
|
-
}),
|
|
718
|
-
|
|
716
|
+
}), s < 0 || e < 0) {
|
|
717
|
+
q.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
719
718
|
return;
|
|
720
719
|
}
|
|
721
720
|
let o = 0;
|
|
722
721
|
i.forEach((a) => {
|
|
723
722
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
724
|
-
const { matrixRow: l } =
|
|
723
|
+
const { matrixRow: l } = Y(this, K, qt).call(this, c);
|
|
725
724
|
l < 0 || c.querySelectorAll("td, th").forEach((u) => {
|
|
726
725
|
const f = parseInt(u.dataset.col, 10);
|
|
727
726
|
if (isNaN(f)) return;
|
|
728
727
|
const b = parseInt(u.rowSpan || 1, 10), g = parseInt(u.colSpan || 1, 10), p = l + b - 1, x = f + g - 1;
|
|
729
|
-
p >=
|
|
728
|
+
p >= s && l <= n && x >= e && f <= r && (o++, u.classList.add("selected"), q.log(u, s, e, n, r), l <= s && u.classList.add("selected-top"), p >= n && u.classList.add("selected-bottom"), f <= e && u.classList.add("selected-left"), x >= r && u.classList.add("selected-right"));
|
|
730
729
|
});
|
|
731
730
|
});
|
|
732
|
-
}),
|
|
731
|
+
}), q.log(`✨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
733
732
|
}, "render"));
|
|
734
|
-
y(this, N,
|
|
733
|
+
y(this, N, s), Y(this, K, ws).call(this), t(this, N).querySelectorAll(
|
|
735
734
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
736
|
-
).forEach((
|
|
737
|
-
|
|
735
|
+
).forEach((n) => {
|
|
736
|
+
n.addEventListener("scroll", () => {
|
|
738
737
|
t(this, X).startRow >= 0 && t(this, X).startCol >= 0 && this.render();
|
|
739
738
|
});
|
|
740
|
-
}),
|
|
739
|
+
}), q.log("🎯 [CellSelection] Initialized");
|
|
741
740
|
}
|
|
742
|
-
setRange(
|
|
743
|
-
|
|
744
|
-
let i = Math.min(
|
|
741
|
+
setRange(s, e, n, r) {
|
|
742
|
+
q.log(`🔍 [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
743
|
+
let i = Math.min(s, n), o = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
745
744
|
const l = t(this, N).querySelectorAll(
|
|
746
745
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
747
746
|
);
|
|
@@ -750,7 +749,7 @@ const rs = class rs {
|
|
|
750
749
|
u = !1, f++, l.forEach((b) => {
|
|
751
750
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
752
751
|
if (g.classList.contains("nodata")) return;
|
|
753
|
-
const { matrixRow: p } =
|
|
752
|
+
const { matrixRow: p } = Y(this, K, qt).call(this, g);
|
|
754
753
|
p < 0 || g.querySelectorAll("td, th").forEach((x) => {
|
|
755
754
|
const w = parseInt(x.dataset.col, 10);
|
|
756
755
|
if (isNaN(w)) return;
|
|
@@ -762,32 +761,32 @@ const rs = class rs {
|
|
|
762
761
|
});
|
|
763
762
|
});
|
|
764
763
|
});
|
|
765
|
-
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }),
|
|
764
|
+
y(this, X, { startRow: i, startCol: a, endRow: o, endCol: c }), q.log("📦 [CellSelection.setRange] Final Range ->", t(this, X)), this.render();
|
|
766
765
|
}
|
|
767
766
|
};
|
|
768
|
-
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(
|
|
769
|
-
if (!
|
|
770
|
-
const e = parseInt(
|
|
767
|
+
N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
768
|
+
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
769
|
+
const e = parseInt(s.dataset.row, 10);
|
|
771
770
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
772
|
-
const
|
|
771
|
+
const n = s.closest("tbody"), i = Array.from(n.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = i.indexOf(s), a = i.length > 0 ? i.length : 1, c = e * a + (o >= 0 ? o : s.sectionRowIndex % a);
|
|
773
772
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
774
773
|
}, "#getMatrixRow"), ws = /* @__PURE__ */ h(function() {
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
777
|
-
|
|
774
|
+
const s = t(this, N).querySelector(".ng-container-top");
|
|
775
|
+
if (!s) {
|
|
776
|
+
q.log("❌ [CellSelection] .ng-container-top not found!");
|
|
778
777
|
return;
|
|
779
778
|
}
|
|
780
|
-
|
|
779
|
+
s.addEventListener("mousedown", (e) => {
|
|
781
780
|
if (e.button !== 0) return;
|
|
782
|
-
const
|
|
783
|
-
if (!
|
|
781
|
+
const n = e.target.closest("td, th");
|
|
782
|
+
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
784
783
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
785
|
-
const r =
|
|
784
|
+
const r = n.closest("tr"), { matrixRow: i } = Y(this, K, qt).call(this, r), o = parseInt(n.dataset.col, 10);
|
|
786
785
|
if (i < 0) {
|
|
787
786
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
788
787
|
return;
|
|
789
788
|
}
|
|
790
|
-
|
|
789
|
+
q.log(`🖱️ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = n;
|
|
791
790
|
let a = i, c = o;
|
|
792
791
|
const l = /* @__PURE__ */ h((f) => {
|
|
793
792
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
@@ -803,33 +802,33 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
803
802
|
}
|
|
804
803
|
}
|
|
805
804
|
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
806
|
-
const p = g.closest("tr"), { matrixRow: x } =
|
|
805
|
+
const p = g.closest("tr"), { matrixRow: x } = Y(this, K, qt).call(this, p), w = parseInt(g.dataset.col, 10);
|
|
807
806
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
808
807
|
}, "onMouseMove"), u = /* @__PURE__ */ h(() => {
|
|
809
|
-
|
|
808
|
+
q.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u);
|
|
810
809
|
}, "onMouseUp");
|
|
811
810
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", u);
|
|
812
811
|
});
|
|
813
812
|
}, "#initEvents"), h(rs, "CellSelection");
|
|
814
|
-
let
|
|
815
|
-
var F, lt, ae, le, pt, He, Ot, Dt,
|
|
813
|
+
let Ie = rs;
|
|
814
|
+
var F, lt, ae, le, pt, He, Ot, Dt, Wt, ct, Bt, vs;
|
|
816
815
|
const os = class os {
|
|
817
|
-
constructor(
|
|
816
|
+
constructor(s) {
|
|
818
817
|
d(this, pt);
|
|
819
818
|
d(this, F);
|
|
820
819
|
d(this, lt, null);
|
|
821
820
|
d(this, ae, -1);
|
|
822
821
|
d(this, le, -1);
|
|
823
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
822
|
+
d(this, Ot, /* @__PURE__ */ h((s) => {
|
|
824
823
|
const e = [];
|
|
825
|
-
return
|
|
824
|
+
return s.forEach((n) => e.push(...Array.from(n.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((n, r) => parseInt(n.dataset.col, 10) - parseInt(r.dataset.col, 10)), e[e.length - 1]);
|
|
826
825
|
}, "#getMaxColCell"));
|
|
827
|
-
d(this, Dt, /* @__PURE__ */ h((
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
826
|
+
d(this, Dt, /* @__PURE__ */ h((s, e) => {
|
|
827
|
+
const n = t(this, ct).call(this, s);
|
|
828
|
+
if (n.length === 0) return e + 1;
|
|
830
829
|
let r = e + 1;
|
|
831
830
|
const i = [];
|
|
832
|
-
|
|
831
|
+
n.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
833
832
|
for (const o of i) {
|
|
834
833
|
const a = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
835
834
|
if (e >= a && e < a + c) {
|
|
@@ -839,12 +838,12 @@ const os = class os {
|
|
|
839
838
|
}
|
|
840
839
|
return r;
|
|
841
840
|
}, "#getNextCol"));
|
|
842
|
-
d(this,
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
841
|
+
d(this, Wt, /* @__PURE__ */ h((s, e) => {
|
|
842
|
+
const n = t(this, ct).call(this, s);
|
|
843
|
+
if (n.length === 0) return Math.max(0, e - 1);
|
|
845
844
|
let r = -1;
|
|
846
845
|
const i = [];
|
|
847
|
-
|
|
846
|
+
n.forEach((o) => i.push(...Array.from(o.querySelectorAll("td")))), i.sort((o, a) => parseInt(o.dataset.col, 10) - parseInt(a.dataset.col, 10));
|
|
848
847
|
for (const o of i) {
|
|
849
848
|
const a = parseInt(o.dataset.col, 10);
|
|
850
849
|
if (a < e)
|
|
@@ -855,85 +854,85 @@ const os = class os {
|
|
|
855
854
|
return r;
|
|
856
855
|
}, "#getPreviousCol"));
|
|
857
856
|
// 🎯 레거시의 병합 셀(rowSpan) 블록 포용 탐색 로직 이식
|
|
858
|
-
d(this, ct, /* @__PURE__ */ h((
|
|
857
|
+
d(this, ct, /* @__PURE__ */ h((s) => {
|
|
859
858
|
const e = t(this, F).querySelectorAll(
|
|
860
859
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
861
|
-
),
|
|
860
|
+
), n = [];
|
|
862
861
|
return e.forEach((r) => {
|
|
863
862
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
864
863
|
for (const o of i) {
|
|
865
864
|
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, u = c.indexOf(o), f = a * l + (u >= 0 ? u : 0);
|
|
866
|
-
if (f ===
|
|
867
|
-
|
|
865
|
+
if (f === s) {
|
|
866
|
+
n.push(o);
|
|
868
867
|
break;
|
|
869
868
|
}
|
|
870
869
|
const b = Array.from(o.querySelectorAll("td"));
|
|
871
870
|
let g = !1;
|
|
872
871
|
for (const p of b) {
|
|
873
872
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
874
|
-
if (x > 1 &&
|
|
875
|
-
|
|
873
|
+
if (x > 1 && s >= f && s < f + x) {
|
|
874
|
+
n.push(o), g = !0;
|
|
876
875
|
break;
|
|
877
876
|
}
|
|
878
877
|
}
|
|
879
878
|
if (g) break;
|
|
880
879
|
}
|
|
881
|
-
}),
|
|
880
|
+
}), n;
|
|
882
881
|
}, "#findTargetTrsByMatrix"));
|
|
883
882
|
// 🎯 rowSpan 및 colSpan 경계를 모두 충족하는 셀을 3분할 전체 영역에서 탐색
|
|
884
|
-
d(this,
|
|
883
|
+
d(this, Bt, /* @__PURE__ */ h((s, e, n, r) => {
|
|
885
884
|
const i = t(this, F).querySelectorAll(
|
|
886
885
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
887
|
-
), o = r !== void 0 ? r :
|
|
886
|
+
), o = r !== void 0 ? r : s * 1 + e;
|
|
888
887
|
for (const a of i) {
|
|
889
888
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
890
889
|
for (const l of c) {
|
|
891
890
|
const u = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === u), b = f.length > 0 ? f.length : 1, g = f.indexOf(l), p = u * b + (g >= 0 ? g : 0), x = Array.from(l.querySelectorAll("td"));
|
|
892
891
|
for (const w of x) {
|
|
893
892
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
894
|
-
if (!isNaN(m) &&
|
|
893
|
+
if (!isNaN(m) && n >= m && n < m + T && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
|
|
895
894
|
return w;
|
|
896
895
|
}
|
|
897
896
|
}
|
|
898
897
|
}
|
|
899
898
|
return null;
|
|
900
899
|
}, "#getNearElement"));
|
|
901
|
-
y(this, F,
|
|
900
|
+
y(this, F, s), Y(this, pt, vs).call(this), q.log("🎯 [CellNavigation] Initialized");
|
|
902
901
|
}
|
|
903
902
|
get currentCell() {
|
|
904
903
|
return t(this, lt);
|
|
905
904
|
}
|
|
906
|
-
set currentCell(
|
|
907
|
-
if (!
|
|
908
|
-
y(this, lt,
|
|
909
|
-
const e = parseInt(
|
|
910
|
-
if (!isNaN(e) && !isNaN(
|
|
911
|
-
y(this, ae, e), y(this, le,
|
|
912
|
-
const r =
|
|
905
|
+
set currentCell(s) {
|
|
906
|
+
if (!s) return;
|
|
907
|
+
y(this, lt, s), s.focus({ preventScroll: !0 });
|
|
908
|
+
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
909
|
+
if (!isNaN(e) && !isNaN(n)) {
|
|
910
|
+
y(this, ae, e), y(this, le, n);
|
|
911
|
+
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
913
912
|
if (i) {
|
|
914
913
|
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), u = e * c + (l >= 0 ? l : 0);
|
|
915
|
-
t(this, F).selection.setRange(u,
|
|
914
|
+
t(this, F).selection.setRange(u, n, u, n);
|
|
916
915
|
}
|
|
917
916
|
}
|
|
918
917
|
}
|
|
919
|
-
moveCell(
|
|
918
|
+
moveCell(s) {
|
|
920
919
|
var m, T, S, M;
|
|
921
920
|
if (!t(this, lt)) return;
|
|
922
|
-
const e = t(this, lt),
|
|
921
|
+
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), i = parseInt(e.dataset.col, 10), o = n == null ? void 0 : n.closest("tbody");
|
|
923
922
|
if (!o) return;
|
|
924
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((
|
|
923
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, u = c.indexOf(n), f = r * l + (u >= 0 ? u : 0);
|
|
925
924
|
let b = f, g = i;
|
|
926
|
-
switch (
|
|
925
|
+
switch (s.code) {
|
|
927
926
|
case "Tab":
|
|
928
|
-
if (
|
|
929
|
-
if (g = t(this,
|
|
927
|
+
if (s.preventDefault(), s.shiftKey) {
|
|
928
|
+
if (g = t(this, Wt).call(this, f, i), g < 0 && f > 0) {
|
|
930
929
|
b = f - 1;
|
|
931
|
-
const
|
|
930
|
+
const W = t(this, ct).call(this, b), z = t(this, Ot).call(this, W);
|
|
932
931
|
g = z ? parseInt(z.dataset.col, 10) : 0;
|
|
933
932
|
}
|
|
934
933
|
} else {
|
|
935
934
|
g = t(this, Dt).call(this, f, i);
|
|
936
|
-
const
|
|
935
|
+
const W = t(this, ct).call(this, f), z = t(this, Ot).call(this, W), Gt = z ? parseInt(z.dataset.col, 10) + parseInt(z.colSpan || 1, 10) : 0;
|
|
937
936
|
g >= Gt && (b = f + 1, g = 0);
|
|
938
937
|
}
|
|
939
938
|
break;
|
|
@@ -941,37 +940,37 @@ const os = class os {
|
|
|
941
940
|
g = t(this, Dt).call(this, f, i);
|
|
942
941
|
break;
|
|
943
942
|
case "ArrowLeft":
|
|
944
|
-
g = t(this,
|
|
943
|
+
g = t(this, Wt).call(this, f, i);
|
|
945
944
|
break;
|
|
946
945
|
case "ArrowDown":
|
|
947
|
-
|
|
946
|
+
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
948
947
|
break;
|
|
949
948
|
case "ArrowUp":
|
|
950
|
-
|
|
949
|
+
s.preventDefault(), b = Math.max(0, f - (e.rowSpan || 1));
|
|
951
950
|
break;
|
|
952
951
|
}
|
|
953
952
|
const p = Math.floor(b / l), x = b % l;
|
|
954
|
-
let w = t(this,
|
|
953
|
+
let w = t(this, Bt).call(this, p, x, g, b);
|
|
955
954
|
if (w)
|
|
956
|
-
this.currentCell = w,
|
|
955
|
+
this.currentCell = w, Y(this, pt, He).call(this, w);
|
|
957
956
|
else if (p !== r && p >= 0) {
|
|
958
|
-
const
|
|
959
|
-
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p *
|
|
960
|
-
const z = t(this,
|
|
961
|
-
z && (this.currentCell = z,
|
|
957
|
+
const W = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
958
|
+
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p * W), setTimeout(() => {
|
|
959
|
+
const z = t(this, Bt).call(this, p, x, g, b);
|
|
960
|
+
z && (this.currentCell = z, Y(this, pt, He).call(this, z));
|
|
962
961
|
}, 0);
|
|
963
962
|
}
|
|
964
963
|
}
|
|
965
964
|
};
|
|
966
965
|
F = new WeakMap(), lt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakSet(), // 🎯 셀이 보이지 않는 영역에 있을 때 컨테이너 스크롤을 동기화하는 함수
|
|
967
|
-
He = /* @__PURE__ */ h(function(
|
|
966
|
+
He = /* @__PURE__ */ h(function(s) {
|
|
968
967
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
969
968
|
if (!e) return;
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(),
|
|
973
|
-
t(this, F).addEventListener("keydown", (
|
|
974
|
-
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
969
|
+
const n = s.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
970
|
+
n.top < r.top ? e.scrollTop -= r.top - n.top : n.bottom > r.bottom && (e.scrollTop += n.bottom - r.bottom), n.left < r.left ? e.scrollLeft -= r.left - n.left : n.right > r.right && (e.scrollLeft += n.right - r.right);
|
|
971
|
+
}, "#ensureCellVisible"), Ot = new WeakMap(), Dt = new WeakMap(), Wt = new WeakMap(), ct = new WeakMap(), Bt = new WeakMap(), vs = /* @__PURE__ */ h(function() {
|
|
972
|
+
t(this, F).addEventListener("keydown", (s) => {
|
|
973
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
975
974
|
});
|
|
976
975
|
}, "#initEvents"), h(os, "CellNavigation");
|
|
977
976
|
let Me = os;
|
|
@@ -984,14 +983,14 @@ const Ct = class Ct extends HTMLElement {
|
|
|
984
983
|
d(this, dt);
|
|
985
984
|
d(this, zt);
|
|
986
985
|
d(this, Pt);
|
|
987
|
-
|
|
988
|
-
|
|
986
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
987
|
+
q.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
989
988
|
}, "invalidate"));
|
|
990
|
-
|
|
991
|
-
if (
|
|
992
|
-
y(this, ht,
|
|
993
|
-
const
|
|
994
|
-
|
|
989
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
990
|
+
if (q.log("sheet.generate()"), !e) return;
|
|
991
|
+
y(this, ht, Le.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
992
|
+
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), i = this.querySelector(".ng-nodata-overlay");
|
|
993
|
+
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
995
994
|
var o;
|
|
996
995
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
997
996
|
}, 0);
|
|
@@ -1001,27 +1000,27 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1001
1000
|
{ selector: ".ng-container-body", type: null },
|
|
1002
1001
|
{ selector: ".ng-container-left", type: "left" },
|
|
1003
1002
|
{ selector: ".ng-container-right", type: "right" }
|
|
1004
|
-
].forEach(({ selector:
|
|
1003
|
+
].forEach(({ selector: n, type: r }) => {
|
|
1005
1004
|
var i, o, a;
|
|
1006
|
-
(i = this.querySelector(`${
|
|
1005
|
+
(i = this.querySelector(`${n} .ng-part-header`)) == null || i.appendChild(t(this, xt).call(this, t(this, ht), r, "header")), (o = this.querySelector(`${n} .ng-virtual-spacer`)) == null || o.before(t(this, xt).call(this, t(this, ht), r, "body")), (a = this.querySelector(`${n} .ng-part-footer`)) == null || a.appendChild(t(this, xt).call(this, t(this, ht), r, "footer"));
|
|
1007
1006
|
});
|
|
1008
1007
|
}, "#renderSplitContainers"));
|
|
1009
1008
|
d(this, de, /* @__PURE__ */ h(() => {
|
|
1010
1009
|
["left", "right", "body"].forEach((e) => {
|
|
1011
|
-
const
|
|
1012
|
-
if (!
|
|
1010
|
+
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
1011
|
+
if (!n || !r || r.length === 0) return;
|
|
1013
1012
|
let i = 0;
|
|
1014
1013
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
1015
1014
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
1016
1015
|
isNaN(a) || (i += a);
|
|
1017
|
-
}), e === "body" ? (
|
|
1016
|
+
}), e === "body" ? (n.style.flex = "1", r.forEach((o) => {
|
|
1018
1017
|
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1019
|
-
})) : (
|
|
1018
|
+
})) : (n.style.flex = `0 0 ${i}px`, n.style.width = `${i}px`, r.forEach((o) => {
|
|
1020
1019
|
o.style.width = `${i}px`, o.style.minWidth = `${i}px`;
|
|
1021
1020
|
}));
|
|
1022
1021
|
});
|
|
1023
1022
|
}, "#updateContainerWidths"));
|
|
1024
|
-
d(this, xt, /* @__PURE__ */ h((e,
|
|
1023
|
+
d(this, xt, /* @__PURE__ */ h((e, n, r) => {
|
|
1025
1024
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1026
1025
|
if (r === "header") {
|
|
1027
1026
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -1029,25 +1028,25 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1029
1028
|
u.className = "fixed-tbody", i.appendChild(u);
|
|
1030
1029
|
}
|
|
1031
1030
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1032
|
-
return
|
|
1031
|
+
return n === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1033
1032
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1034
|
-
}) :
|
|
1033
|
+
}) : n === "right" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1035
1034
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1036
1035
|
}) : i.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1037
1036
|
l.remove();
|
|
1038
1037
|
}), i;
|
|
1039
1038
|
}, "#createSplitTable"));
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1039
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1040
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
1041
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1042
|
+
n && (n.scrollLeft = e);
|
|
1044
1043
|
}, "scrollToX"));
|
|
1045
|
-
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1044
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
1045
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1046
|
+
n && (n.scrollTop = e);
|
|
1048
1047
|
}, "scrollToY"));
|
|
1049
1048
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1050
|
-
t(this, ue).call(this), y(this, zt, new
|
|
1049
|
+
t(this, ue).call(this), y(this, zt, new Ie(this)), y(this, Pt, new Me(this));
|
|
1051
1050
|
}, "#init"));
|
|
1052
1051
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1053
1052
|
const e = Ct.SCROLLBAR_SIZE;
|
|
@@ -1263,10 +1262,10 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1263
1262
|
return t(this, Pt);
|
|
1264
1263
|
}
|
|
1265
1264
|
disconnectedCallback() {
|
|
1266
|
-
this.innerHTML = "",
|
|
1265
|
+
this.innerHTML = "", q.log("NineTableSheet destroyed.");
|
|
1267
1266
|
}
|
|
1268
1267
|
};
|
|
1269
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), h(Ct, "NineTableSheet"),
|
|
1268
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), he = new WeakMap(), de = new WeakMap(), xt = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), h(Ct, "NineTableSheet"), E(Ct, "SCROLLBAR_SIZE", 16);
|
|
1270
1269
|
let Zt = Ct;
|
|
1271
1270
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Zt);
|
|
1272
1271
|
var ge, Ft;
|
|
@@ -1275,13 +1274,13 @@ const is = class is extends HTMLElement {
|
|
|
1275
1274
|
super();
|
|
1276
1275
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1277
1276
|
var e;
|
|
1278
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1277
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1279
1278
|
var o;
|
|
1280
|
-
const r =
|
|
1279
|
+
const r = n.ctrlKey || n.metaKey || n.shiftKey, i = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1281
1280
|
t(this, Ft).call(this, i, r);
|
|
1282
1281
|
}), t(this, Ft).call(this, 0, !1);
|
|
1283
1282
|
}, "#init"));
|
|
1284
|
-
d(this, Ft, /* @__PURE__ */ h((e,
|
|
1283
|
+
d(this, Ft, /* @__PURE__ */ h((e, n = !1) => {
|
|
1285
1284
|
const r = /* @__PURE__ */ h(() => {
|
|
1286
1285
|
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1287
1286
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1292,7 +1291,7 @@ const is = class is extends HTMLElement {
|
|
|
1292
1291
|
});
|
|
1293
1292
|
}, "updateSplitters"), i = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = i.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1294
1293
|
if (!a[e]) return;
|
|
1295
|
-
if (!
|
|
1294
|
+
if (!n)
|
|
1296
1295
|
a.forEach((u, f) => {
|
|
1297
1296
|
u.classList.toggle("active", f === e);
|
|
1298
1297
|
}), c.forEach((u, f) => {
|
|
@@ -1322,23 +1321,23 @@ let $e = is;
|
|
|
1322
1321
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1323
1322
|
var _, be, jt, pe;
|
|
1324
1323
|
const as = class as {
|
|
1325
|
-
constructor(
|
|
1324
|
+
constructor(s) {
|
|
1326
1325
|
d(this, _);
|
|
1327
1326
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1328
|
-
t(this, pe).call(this), new ResizeObserver((
|
|
1329
|
-
for (let e of
|
|
1327
|
+
t(this, pe).call(this), new ResizeObserver((s) => {
|
|
1328
|
+
for (let e of s)
|
|
1330
1329
|
t(this, _).getAttribute("auto-height") === "true" && t(this, jt).call(this);
|
|
1331
1330
|
}).observe(t(this, _));
|
|
1332
1331
|
}, "#init"));
|
|
1333
1332
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1334
1333
|
var c, l;
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1337
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10,
|
|
1334
|
+
const s = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1335
|
+
if (s.length === 0) return;
|
|
1336
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((u) => u.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, i = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Zt.SCROLLBAR_SIZE, a = e * n + r + i + o;
|
|
1338
1337
|
t(this, _).style.height = `${a}px`;
|
|
1339
1338
|
}, "#applyAutoHeight"));
|
|
1340
1339
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1341
|
-
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"),
|
|
1340
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), n = t(this, _).getAttribute("auto-height") === "true", r = e.length, i = e.map((c, l) => {
|
|
1342
1341
|
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1343
1342
|
return f + b;
|
|
1344
1343
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
@@ -1349,7 +1348,7 @@ const as = class as {
|
|
|
1349
1348
|
flex-direction: column;
|
|
1350
1349
|
position: relative;
|
|
1351
1350
|
overflow: hidden;
|
|
1352
|
-
height: ${
|
|
1351
|
+
height: ${n ? "auto" : "100%"};
|
|
1353
1352
|
background: #fff;
|
|
1354
1353
|
}
|
|
1355
1354
|
|
|
@@ -1466,75 +1465,75 @@ const as = class as {
|
|
|
1466
1465
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1467
1466
|
a == null || a.forEach((c, l) => {
|
|
1468
1467
|
e[l] && setTimeout(() => {
|
|
1469
|
-
c.generate(e[l]),
|
|
1468
|
+
c.generate(e[l]), n && t(this, jt).call(this);
|
|
1470
1469
|
});
|
|
1471
1470
|
});
|
|
1472
1471
|
}, "#render"));
|
|
1473
|
-
y(this, _,
|
|
1472
|
+
y(this, _, s), t(this, be).call(this);
|
|
1474
1473
|
}
|
|
1475
1474
|
};
|
|
1476
1475
|
_ = new WeakMap(), be = new WeakMap(), jt = new WeakMap(), pe = new WeakMap(), h(as, "LayoutManager");
|
|
1477
1476
|
let Ne = as;
|
|
1478
|
-
var
|
|
1477
|
+
var Vt, wt;
|
|
1479
1478
|
const ls = class ls {
|
|
1480
|
-
constructor(
|
|
1481
|
-
d(this,
|
|
1479
|
+
constructor(s) {
|
|
1480
|
+
d(this, Vt);
|
|
1482
1481
|
d(this, wt, -1);
|
|
1483
|
-
|
|
1484
|
-
y(this,
|
|
1482
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, Vt).rawRecords.length, "count"));
|
|
1483
|
+
y(this, Vt, s);
|
|
1485
1484
|
}
|
|
1486
1485
|
get at() {
|
|
1487
1486
|
return t(this, wt);
|
|
1488
1487
|
}
|
|
1489
|
-
set at(
|
|
1490
|
-
y(this, wt, parseInt(
|
|
1488
|
+
set at(s) {
|
|
1489
|
+
y(this, wt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1491
1490
|
});
|
|
1492
1491
|
}
|
|
1493
1492
|
};
|
|
1494
|
-
|
|
1493
|
+
Vt = new WeakMap(), wt = new WeakMap(), h(ls, "ngRow");
|
|
1495
1494
|
let _e = ls;
|
|
1496
|
-
var D,
|
|
1495
|
+
var D, L, B, vt, ye, J, me, ft, Yt, xe, we, St;
|
|
1497
1496
|
const P = class P {
|
|
1498
|
-
constructor(
|
|
1497
|
+
constructor(s, e) {
|
|
1499
1498
|
d(this, D);
|
|
1500
|
-
d(this,
|
|
1501
|
-
d(this,
|
|
1499
|
+
d(this, L);
|
|
1500
|
+
d(this, B, []);
|
|
1502
1501
|
d(this, vt, []);
|
|
1503
1502
|
d(this, ye, 0);
|
|
1504
1503
|
d(this, J, []);
|
|
1505
1504
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1506
1505
|
y(this, J, []);
|
|
1507
|
-
const
|
|
1508
|
-
Array.from(
|
|
1509
|
-
var
|
|
1510
|
-
t(this, J).push(((
|
|
1511
|
-
}), (t(this,
|
|
1512
|
-
e.__ng || (e.__ng = t(this,
|
|
1506
|
+
const s = t(this, D).template || [];
|
|
1507
|
+
Array.from(s).forEach((e) => {
|
|
1508
|
+
var n;
|
|
1509
|
+
t(this, J).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1510
|
+
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1511
|
+
e.__ng || (e.__ng = t(this, Yt).call(this)), e.__ng.height = t(this, J).slice();
|
|
1513
1512
|
});
|
|
1514
1513
|
}, "#initialize"));
|
|
1515
1514
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1515
|
+
const s = t(this, D).shadowRoot.querySelector("nine-table-sheets");
|
|
1516
|
+
s == null || s.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1518
1517
|
e.invalidate();
|
|
1519
1518
|
});
|
|
1520
1519
|
}, "#invalidate"));
|
|
1521
|
-
|
|
1520
|
+
E(this, "get", /* @__PURE__ */ h((s, e) => {
|
|
1522
1521
|
var i;
|
|
1523
|
-
const
|
|
1524
|
-
if (!
|
|
1525
|
-
if (
|
|
1526
|
-
if (
|
|
1522
|
+
const n = this.getValidData();
|
|
1523
|
+
if (!n || n.length <= 0) return;
|
|
1524
|
+
if (s == null) return t(this, St).call(this, n);
|
|
1525
|
+
if (s < 0 || s >= n.length) return null;
|
|
1527
1526
|
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1528
1527
|
if (e != null) {
|
|
1529
1528
|
const o = r.indexOf(e);
|
|
1530
|
-
return o >= 0 ? s
|
|
1529
|
+
return o >= 0 ? n[s].v[o] : null;
|
|
1531
1530
|
}
|
|
1532
|
-
return t(this, St).call(this, s
|
|
1531
|
+
return t(this, St).call(this, n[s]);
|
|
1533
1532
|
}, "get"));
|
|
1534
|
-
|
|
1535
|
-
this.clear(), this.add(
|
|
1533
|
+
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1534
|
+
this.clear(), this.add(s, !1), t(this, ft).call(this);
|
|
1536
1535
|
}, "set"));
|
|
1537
|
-
d(this,
|
|
1536
|
+
d(this, Yt, /* @__PURE__ */ h(() => ({
|
|
1538
1537
|
rowState: P.ROW_STATE.EMPTY,
|
|
1539
1538
|
deleted: !1,
|
|
1540
1539
|
filtered: !1,
|
|
@@ -1543,70 +1542,70 @@ const P = class P {
|
|
|
1543
1542
|
c: {},
|
|
1544
1543
|
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, J).slice(), -1, {}, {}]
|
|
1545
1544
|
}), "#getDefaultMeta"));
|
|
1546
|
-
|
|
1547
|
-
y(this,
|
|
1545
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1546
|
+
y(this, B, []), y(this, vt, []), t(this, ft).call(this);
|
|
1548
1547
|
}, "reset"));
|
|
1549
|
-
|
|
1550
|
-
var
|
|
1551
|
-
t(this,
|
|
1548
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1549
|
+
var s;
|
|
1550
|
+
t(this, L).rawRecords = [], y(this, B, []), y(this, vt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
|
|
1552
1551
|
}, "clear"));
|
|
1553
|
-
d(this, xe, /* @__PURE__ */ h((
|
|
1552
|
+
d(this, xe, /* @__PURE__ */ h((s) => {
|
|
1554
1553
|
var r;
|
|
1555
|
-
Array.isArray(
|
|
1556
|
-
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(
|
|
1557
|
-
return
|
|
1554
|
+
Array.isArray(s) || (s = [s]);
|
|
1555
|
+
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
1556
|
+
return s.forEach((i) => {
|
|
1558
1557
|
const o = { v: [] };
|
|
1559
1558
|
e.forEach((a) => {
|
|
1560
1559
|
o.v.push(i[a] !== void 0 && i[a] !== null ? i[a] : "");
|
|
1561
|
-
}),
|
|
1562
|
-
}),
|
|
1560
|
+
}), n.push(o);
|
|
1561
|
+
}), n;
|
|
1563
1562
|
}, "#json2Array"));
|
|
1564
|
-
d(this, we, /* @__PURE__ */ h((
|
|
1565
|
-
e.__ng = t(this,
|
|
1566
|
-
}),
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1570
|
-
t(this,
|
|
1563
|
+
d(this, we, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1564
|
+
e.__ng = t(this, Yt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1565
|
+
}), s), "#defaultInsert"));
|
|
1566
|
+
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1567
|
+
s === void 0 && (s = {});
|
|
1568
|
+
const n = t(this, xe).call(this, s);
|
|
1569
|
+
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, we).call(this, n)), this.resetRecords();
|
|
1571
1570
|
const r = this.count() - 1;
|
|
1572
|
-
return e ||
|
|
1573
|
-
const a = t(this,
|
|
1571
|
+
return e || n.forEach((i, o) => {
|
|
1572
|
+
const a = t(this, L).rawRecords[r - o];
|
|
1574
1573
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1575
1574
|
}), t(this, ft).call(this), r;
|
|
1576
1575
|
}, "add"));
|
|
1577
|
-
|
|
1576
|
+
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1578
1577
|
let e = [];
|
|
1579
|
-
Array.isArray(
|
|
1580
|
-
if (t(this,
|
|
1581
|
-
const r = t(this,
|
|
1582
|
-
t(this,
|
|
1578
|
+
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(s, 10)], e.sort((n, r) => r - n).forEach((n) => {
|
|
1579
|
+
if (t(this, B)[n]) {
|
|
1580
|
+
const r = t(this, B)[n].__ng.rowid;
|
|
1581
|
+
t(this, B)[n].__ng.rowState === P.ROW_STATE.INSERT ? t(this, L).rawRecords = t(this, L).rawRecords.filter((i) => i.__ng.rowid !== r) : t(this, L).rawRecords.forEach((i) => {
|
|
1583
1582
|
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1584
1583
|
});
|
|
1585
1584
|
}
|
|
1586
1585
|
}), this.resetRecords(), t(this, ft).call(this);
|
|
1587
1586
|
}, "delete"));
|
|
1588
|
-
|
|
1587
|
+
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1589
1588
|
var c;
|
|
1590
|
-
|
|
1589
|
+
s = parseInt(s, 10);
|
|
1591
1590
|
const i = (typeof ((c = t(this, D).fields) == null ? void 0 : c.get) == "function" ? t(this, D).fields.get() : []).indexOf(e);
|
|
1592
1591
|
if (i < 0) return;
|
|
1593
|
-
const o = this.getValidData()[
|
|
1592
|
+
const o = this.getValidData()[s];
|
|
1594
1593
|
if (!o) return;
|
|
1595
1594
|
const a = o.v[i];
|
|
1596
|
-
a !==
|
|
1595
|
+
a !== n && o.__ng.rowState !== P.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = P.ROW_STATE.UPDATE), o.v[i] = n;
|
|
1597
1596
|
}, "setValue"));
|
|
1598
|
-
|
|
1599
|
-
y(this, vt, t(this,
|
|
1600
|
-
|
|
1601
|
-
}), t(this,
|
|
1602
|
-
|
|
1597
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1598
|
+
y(this, vt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), y(this, B, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
|
|
1599
|
+
s.__ng.rowidx = e;
|
|
1600
|
+
}), t(this, B).forEach((s, e) => {
|
|
1601
|
+
s.__ng.i = e;
|
|
1603
1602
|
});
|
|
1604
1603
|
}, "resetRecords"));
|
|
1605
|
-
|
|
1606
|
-
d(this, St, /* @__PURE__ */ h((
|
|
1604
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, B).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, B)), "getValidData"));
|
|
1605
|
+
d(this, St, /* @__PURE__ */ h((s) => {
|
|
1607
1606
|
var o;
|
|
1608
|
-
if (!
|
|
1609
|
-
const e = !Array.isArray(
|
|
1607
|
+
if (!s) return s;
|
|
1608
|
+
const e = !Array.isArray(s), n = e ? [s] : s, r = typeof ((o = t(this, D).fields) == null ? void 0 : o.get) == "function" ? t(this, D).fields.get() : [], i = n.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1610
1609
|
const c = {};
|
|
1611
1610
|
return r.forEach((l, u) => {
|
|
1612
1611
|
c[l] = a.v ? a.v[u] : a[l];
|
|
@@ -1614,30 +1613,30 @@ const P = class P {
|
|
|
1614
1613
|
});
|
|
1615
1614
|
return e ? i[0] : i;
|
|
1616
1615
|
}, "#conv"));
|
|
1617
|
-
|
|
1618
|
-
y(this, D,
|
|
1616
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1617
|
+
y(this, D, s), y(this, L, e), t(this, me).call(this);
|
|
1619
1618
|
}
|
|
1620
1619
|
get source() {
|
|
1621
|
-
return t(this, St).call(this, t(this,
|
|
1620
|
+
return t(this, St).call(this, t(this, L).rawRecords);
|
|
1622
1621
|
}
|
|
1623
|
-
set source(
|
|
1624
|
-
this.clear(), this.add(
|
|
1622
|
+
set source(s) {
|
|
1623
|
+
this.clear(), this.add(s, !1);
|
|
1625
1624
|
}
|
|
1626
1625
|
get nextId() {
|
|
1627
1626
|
return ++xs(this, ye)._;
|
|
1628
1627
|
}
|
|
1629
1628
|
get count() {
|
|
1630
|
-
return t(this,
|
|
1629
|
+
return t(this, B).length;
|
|
1631
1630
|
}
|
|
1632
1631
|
get length() {
|
|
1633
|
-
return t(this,
|
|
1632
|
+
return t(this, B).length;
|
|
1634
1633
|
}
|
|
1635
1634
|
getRowCount() {
|
|
1636
1635
|
return this.length;
|
|
1637
1636
|
}
|
|
1638
1637
|
};
|
|
1639
|
-
D = new WeakMap(),
|
|
1640
|
-
|
|
1638
|
+
D = new WeakMap(), L = new WeakMap(), B = new WeakMap(), vt = new WeakMap(), ye = new WeakMap(), J = new WeakMap(), me = new WeakMap(), ft = new WeakMap(), Yt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1639
|
+
E(P, "ROW_STATE", {
|
|
1641
1640
|
EMPTY: "EMPTY",
|
|
1642
1641
|
NORMAL: "NORMAL",
|
|
1643
1642
|
INSERT: "INSERT",
|
|
@@ -1647,22 +1646,22 @@ q(P, "ROW_STATE", {
|
|
|
1647
1646
|
let Oe = P;
|
|
1648
1647
|
var ut;
|
|
1649
1648
|
const cs = class cs {
|
|
1650
|
-
constructor(
|
|
1649
|
+
constructor(s) {
|
|
1651
1650
|
d(this, ut);
|
|
1652
|
-
y(this, ut,
|
|
1651
|
+
y(this, ut, s), this.row = new _e(this), this.data = new Oe(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1653
1652
|
var e;
|
|
1654
1653
|
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1655
1654
|
}, this.setDataSource = (e) => {
|
|
1656
1655
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1657
1656
|
}, this.getRowState = (e) => {
|
|
1658
1657
|
var r, i;
|
|
1659
|
-
const
|
|
1660
|
-
if (!(
|
|
1661
|
-
return (i = (r = this.data.getValidData()[
|
|
1658
|
+
const n = parseInt(e, 10);
|
|
1659
|
+
if (!(n >= this.data.count()))
|
|
1660
|
+
return (i = (r = this.data.getValidData()[n]) == null ? void 0 : r.__ng) == null ? void 0 : i.rowState;
|
|
1662
1661
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1663
1662
|
this.row.at = e;
|
|
1664
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e,
|
|
1665
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1663
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, n) => this.data.get(e, n), this.setColumn = (e, n, r) => {
|
|
1664
|
+
e = parseInt(e, 10), this.data.setValue(e, n, r);
|
|
1666
1665
|
}, this.setDataSource([]);
|
|
1667
1666
|
}
|
|
1668
1667
|
};
|
|
@@ -1671,31 +1670,31 @@ let De = cs;
|
|
|
1671
1670
|
var Rt, H, Ut, ve;
|
|
1672
1671
|
const hs = class hs {
|
|
1673
1672
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1674
|
-
constructor(
|
|
1673
|
+
constructor(s) {
|
|
1675
1674
|
d(this, Rt);
|
|
1676
1675
|
d(this, H, []);
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
t(this, H).some((r) => r.name ===
|
|
1676
|
+
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1677
|
+
s.forEach((n) => {
|
|
1678
|
+
t(this, H).some((r) => r.name === n) || t(this, H).push({ name: n, type: e });
|
|
1680
1679
|
}), t(this, Ut).call(this);
|
|
1681
1680
|
}, "add"));
|
|
1682
1681
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
1683
|
-
const
|
|
1682
|
+
const s = /* @__PURE__ */ new Map();
|
|
1684
1683
|
t(this, H).forEach((e) => {
|
|
1685
|
-
|
|
1686
|
-
}), y(this, H, Array.from(
|
|
1684
|
+
s.set(e.name, e.type);
|
|
1685
|
+
}), y(this, H, Array.from(s, ([e, n]) => ({ name: e, type: n }))), y(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1687
1686
|
}, "#adjust"));
|
|
1688
1687
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1689
|
-
y(this, H, []),
|
|
1690
|
-
const
|
|
1691
|
-
if (!(!
|
|
1692
|
-
for (const e of
|
|
1693
|
-
|
|
1688
|
+
y(this, H, []), q.log(t(this, Rt).querySelectorAll("table"));
|
|
1689
|
+
const s = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1690
|
+
if (!(!s || s.length === 0)) {
|
|
1691
|
+
for (const e of s)
|
|
1692
|
+
q.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1694
1693
|
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1695
1694
|
i && t(this, H).push({ name: i, type: o });
|
|
1696
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1697
|
-
$(`[${
|
|
1698
|
-
var o = i.getAttribute(
|
|
1695
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1696
|
+
$(`[${n}]`, e).each((r, i) => {
|
|
1697
|
+
var o = i.getAttribute(n);
|
|
1699
1698
|
if (o.indexOf("data.") < 0) {
|
|
1700
1699
|
const a = o.search(/[(]/g);
|
|
1701
1700
|
if (a > 0)
|
|
@@ -1717,30 +1716,30 @@ const hs = class hs {
|
|
|
1717
1716
|
t(this, Ut).call(this);
|
|
1718
1717
|
}
|
|
1719
1718
|
}, "#init"));
|
|
1720
|
-
y(this, Rt,
|
|
1719
|
+
y(this, Rt, s), t(this, ve).call(this);
|
|
1721
1720
|
}
|
|
1722
1721
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1723
1722
|
get() {
|
|
1724
|
-
return t(this, H).map((
|
|
1723
|
+
return t(this, H).map((s) => s.name);
|
|
1725
1724
|
}
|
|
1726
1725
|
// 🎯 내부 객체 통째로 얻기
|
|
1727
1726
|
getFields() {
|
|
1728
1727
|
return t(this, H);
|
|
1729
1728
|
}
|
|
1730
1729
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1731
|
-
getType(
|
|
1732
|
-
const e = t(this, H).find((
|
|
1730
|
+
getType(s) {
|
|
1731
|
+
const e = t(this, H).find((n) => n.name === s);
|
|
1733
1732
|
return e ? e.type : "string";
|
|
1734
1733
|
}
|
|
1735
|
-
indexOf(
|
|
1736
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1734
|
+
indexOf(s) {
|
|
1735
|
+
return t(this, H).findIndex((e) => e.name === s);
|
|
1737
1736
|
}
|
|
1738
|
-
includes(
|
|
1739
|
-
return t(this, H).some((e) => e.name ===
|
|
1737
|
+
includes(s) {
|
|
1738
|
+
return t(this, H).some((e) => e.name === s);
|
|
1740
1739
|
}
|
|
1741
1740
|
};
|
|
1742
1741
|
Rt = new WeakMap(), H = new WeakMap(), Ut = new WeakMap(), ve = new WeakMap(), h(hs, "ngFields");
|
|
1743
|
-
let
|
|
1742
|
+
let We = hs;
|
|
1744
1743
|
var gt, Se, Re;
|
|
1745
1744
|
const ds = class ds extends HTMLElement {
|
|
1746
1745
|
constructor() {
|
|
@@ -1749,7 +1748,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1749
1748
|
d(this, gt);
|
|
1750
1749
|
d(this, Se);
|
|
1751
1750
|
d(this, Re, /* @__PURE__ */ h(() => {
|
|
1752
|
-
this.fields = new
|
|
1751
|
+
this.fields = new We(this), y(this, Se, new Ne(this)), q.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1753
1752
|
}, "#init"));
|
|
1754
1753
|
this.attachShadow({ mode: "open" }), y(this, gt, new De(this));
|
|
1755
1754
|
}
|
|
@@ -1757,7 +1756,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1757
1756
|
t(this, Re).call(this);
|
|
1758
1757
|
}
|
|
1759
1758
|
disconnectedCallback() {
|
|
1760
|
-
|
|
1759
|
+
q.log("NineTable disconnected.");
|
|
1761
1760
|
}
|
|
1762
1761
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1763
1762
|
get data() {
|
|
@@ -1773,8 +1772,8 @@ const ds = class ds extends HTMLElement {
|
|
|
1773
1772
|
}
|
|
1774
1773
|
};
|
|
1775
1774
|
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(ds, "NineTable");
|
|
1776
|
-
let
|
|
1777
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1775
|
+
let Be = ds;
|
|
1776
|
+
customElements.get("nine-table") || customElements.define("nine-table", Be);
|
|
1778
1777
|
const Tt = class Tt extends HTMLElement {
|
|
1779
1778
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1780
1779
|
constructor() {
|
|
@@ -1786,55 +1785,55 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1786
1785
|
connectedCallback() {
|
|
1787
1786
|
}
|
|
1788
1787
|
};
|
|
1789
|
-
h(Tt, "BasicCellElement"),
|
|
1788
|
+
h(Tt, "BasicCellElement"), E(Tt, "_styleCache", /* @__PURE__ */ new Map()), E(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1790
1789
|
let ze = Tt;
|
|
1791
|
-
var
|
|
1790
|
+
var I, Xt, v, Xe, Ke, Ge, Ze, Je;
|
|
1792
1791
|
const fs = class fs extends ze {
|
|
1793
1792
|
constructor() {
|
|
1794
1793
|
super();
|
|
1795
|
-
d(this,
|
|
1794
|
+
d(this, I);
|
|
1796
1795
|
d(this, Xt);
|
|
1797
1796
|
d(this, v);
|
|
1798
1797
|
d(this, Xe);
|
|
1799
1798
|
d(this, Ke);
|
|
1800
1799
|
d(this, Ge);
|
|
1801
1800
|
d(this, Ze);
|
|
1802
|
-
|
|
1801
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1803
1802
|
if (t(this, v))
|
|
1804
1803
|
if (t(this, v).closest("tbody")) {
|
|
1805
|
-
const
|
|
1806
|
-
if (!
|
|
1804
|
+
const n = t(this, v).closest("tr").data, r = parseInt(t(this, v).dataset.row);
|
|
1805
|
+
if (!n) return "";
|
|
1807
1806
|
if (ninegrid.isNull(t(this, v).dataset.expr)) {
|
|
1808
1807
|
if (!ninegrid.isNull(t(this, v).dataset.bind))
|
|
1809
|
-
return
|
|
1808
|
+
return n[t(this, v).dataset.bind] || ninegrid.nvl(e, "");
|
|
1810
1809
|
} else try {
|
|
1811
|
-
return this.getExprValue(t(this, v).dataset.expr,
|
|
1810
|
+
return this.getExprValue(t(this, v).dataset.expr, n, r, t(this, v));
|
|
1812
1811
|
} catch {
|
|
1813
|
-
console.error(t(this, v).dataset.expr,
|
|
1812
|
+
console.error(t(this, v).dataset.expr, n, t(this, v).dataset.row);
|
|
1814
1813
|
}
|
|
1815
1814
|
return ninegrid.nvl(e, "");
|
|
1816
1815
|
} else
|
|
1817
1816
|
try {
|
|
1818
|
-
return t(this,
|
|
1817
|
+
return t(this, I).exprFunction(t(this, v).dataset.expr).call(this, null, -1, t(this, I).data);
|
|
1819
1818
|
} catch {
|
|
1820
1819
|
}
|
|
1821
1820
|
}, "getDisplayText"));
|
|
1822
1821
|
d(this, Je, /* @__PURE__ */ h(() => {
|
|
1823
|
-
if (!(!t(this,
|
|
1822
|
+
if (!(!t(this, I) || !t(this, I).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1824
1823
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1825
1824
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1826
|
-
var
|
|
1827
|
-
$("th,td",
|
|
1825
|
+
var n = t(this, v).closest("tr"), r = [];
|
|
1826
|
+
$("th,td", n).each((m, T) => {
|
|
1828
1827
|
var S = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1829
1828
|
S && T.dataset.row && (S = parseInt(S), !isNaN(S) && S <= e && r.push(S));
|
|
1830
1829
|
}), r.sort();
|
|
1831
1830
|
var i = !1;
|
|
1832
|
-
if (parseInt(
|
|
1831
|
+
if (parseInt(n.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1833
1832
|
for (var o of r) {
|
|
1834
1833
|
if (o > e) break;
|
|
1835
|
-
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this,
|
|
1834
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, u = t(this, I).data.get(c);
|
|
1836
1835
|
t(this, v).dataset.matrixRow;
|
|
1837
|
-
var f = t(this,
|
|
1836
|
+
var f = t(this, I).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind], g = f.dataset.expr ? this.getExprValue(f.dataset.expr, u, c) : u[f.dataset.bind];
|
|
1838
1837
|
if (b != g) {
|
|
1839
1838
|
i = !0;
|
|
1840
1839
|
break;
|
|
@@ -1843,17 +1842,17 @@ const fs = class fs extends ze {
|
|
|
1843
1842
|
else
|
|
1844
1843
|
i = !0;
|
|
1845
1844
|
i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, v)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, v)).hasClass("hidden") || (i ? ninegrid.j.querySelectorAll(t(this, v)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, v)).addClass("hidden"));
|
|
1846
|
-
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this,
|
|
1845
|
+
var p = parseInt(t(this, v).dataset.matrixRow), x = p - 1, w = t(this, I).body.querySelector(`tbody.bindable [data-col="${t(this, v).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1847
1846
|
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, v)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1848
1847
|
}
|
|
1849
1848
|
}
|
|
1850
1849
|
}, "#resetSuppress"));
|
|
1851
|
-
|
|
1850
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, n, r, i) => {
|
|
1852
1851
|
if (typeof e < "u")
|
|
1853
1852
|
try {
|
|
1854
1853
|
r = parseInt(r);
|
|
1855
1854
|
const o = e.replace("()", "");
|
|
1856
|
-
return t(this,
|
|
1855
|
+
return t(this, I)[o] ? t(this, I)[o].call(this, n, r, t(this, v)) : t(this, I).exprFunction(e).call(this, n, r, t(this, I).data);
|
|
1857
1856
|
} catch {
|
|
1858
1857
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1859
1858
|
}
|
|
@@ -1862,16 +1861,16 @@ const fs = class fs extends ze {
|
|
|
1862
1861
|
}, "getExprValue"));
|
|
1863
1862
|
}
|
|
1864
1863
|
connectedCallback() {
|
|
1865
|
-
super.connectedCallback(), y(this,
|
|
1864
|
+
super.connectedCallback(), y(this, I, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this, Xt, t(this, v).closest("tr"));
|
|
1866
1865
|
}
|
|
1867
1866
|
get value() {
|
|
1868
|
-
var e = !t(this,
|
|
1867
|
+
var e = !t(this, I) || !t(this, I).dataManager || !t(this, v) || !t(this, v).dataset || !t(this, v).dataset.row || !t(this, v).dataset.bind ? "" : t(this, v).closest("tr").data[t(this, v).dataset.bind];
|
|
1869
1868
|
return e ?? "";
|
|
1870
1869
|
}
|
|
1871
1870
|
set value(e) {
|
|
1872
|
-
var
|
|
1871
|
+
var n = parseInt(t(this, v).dataset.row);
|
|
1873
1872
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1874
|
-
|
|
1873
|
+
n < 0 ? t(this, I).data.setValueNF(parseInt(t(this, v).dataset.index), t(this, v).dataset.bind, e, r) : t(this, I).data.setValue(n, t(this, v).dataset.bind, e, r);
|
|
1875
1874
|
}
|
|
1876
1875
|
get row() {
|
|
1877
1876
|
return parseInt(t(this, v).dataset.row);
|
|
@@ -1884,7 +1883,7 @@ const fs = class fs extends ze {
|
|
|
1884
1883
|
return parseInt(t(this, v).dataset.row), t(this, Xt).data[e];
|
|
1885
1884
|
}
|
|
1886
1885
|
};
|
|
1887
|
-
|
|
1886
|
+
I = new WeakMap(), Xt = new WeakMap(), v = new WeakMap(), Xe = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), h(fs, "CellElement");
|
|
1888
1887
|
let Pe = fs;
|
|
1889
1888
|
const us = class us extends Pe {
|
|
1890
1889
|
constructor() {
|
|
@@ -1909,7 +1908,7 @@ const gs = class gs extends Fe {
|
|
|
1909
1908
|
d(this, Et);
|
|
1910
1909
|
d(this, Ae);
|
|
1911
1910
|
d(this, Q);
|
|
1912
|
-
|
|
1911
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1913
1912
|
const e = super.refresh();
|
|
1914
1913
|
t(this, Kt).value = e;
|
|
1915
1914
|
}, "refresh"));
|
|
@@ -1948,10 +1947,10 @@ const gs = class gs extends Fe {
|
|
|
1948
1947
|
if (t(this, bt) == "number") {
|
|
1949
1948
|
let i = [];
|
|
1950
1949
|
if (t(this, Q) && Number(t(this, Q)) > 0 && i.push("."), t(this, Et) && Number(t(this, Et)) >= 0 && i.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !i.includes(e.key) && e.preventDefault(), t(this, Q) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1951
|
-
var
|
|
1950
|
+
var n = e.target.value, r = n.indexOf(".");
|
|
1952
1951
|
if (r >= 0) {
|
|
1953
|
-
var
|
|
1954
|
-
|
|
1952
|
+
var n = n.substr(r + 1, n.length);
|
|
1953
|
+
n.length >= Number(t(this, Q)) && e.preventDefault();
|
|
1955
1954
|
}
|
|
1956
1955
|
}
|
|
1957
1956
|
}
|
|
@@ -1961,8 +1960,8 @@ const gs = class gs extends Fe {
|
|
|
1961
1960
|
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this, Q, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1962
1961
|
}
|
|
1963
1962
|
connectedCallback() {
|
|
1964
|
-
for (var e = [],
|
|
1965
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1963
|
+
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
1964
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[n].name) && e.push(`${this.attributes[n].name}="${this.attributes[n].value}"`);
|
|
1966
1965
|
this.innerHTML = `
|
|
1967
1966
|
<input type="text"
|
|
1968
1967
|
${e.join(" ")}
|