@ninebone/table 0.0.805 β 0.0.807
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 +344 -364
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var ps = Object.defineProperty;
|
|
2
|
+
var ys = (q) => {
|
|
3
|
+
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (
|
|
7
|
-
var E = (
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
5
|
+
var vs = (q, s, e) => s in q ? ps(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
|
+
var h = (q, s) => ps(q, "name", { value: s, configurable: !0 });
|
|
7
|
+
var E = (q, s, e) => vs(q, typeof s != "symbol" ? s + "" : s, e), Ee = (q, s, e) => s.has(q) || ys("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (Ee(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? ys("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), y = (q, s, e, n) => (Ee(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), V = (q, s, e) => (Ee(q, s, "access private method"), e);
|
|
9
|
+
var ms = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(
|
|
11
|
+
y(q, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(q, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ss } from "@ninebone/util";
|
|
18
|
+
const Qe = class Qe extends Ss.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let qe =
|
|
25
|
-
const
|
|
26
|
-
var j,
|
|
27
|
-
const
|
|
23
|
+
h(Qe, "Trace");
|
|
24
|
+
let qe = Qe;
|
|
25
|
+
const C = new qe();
|
|
26
|
+
var j, K, A, Q, tt, et, Zt, st, Jt;
|
|
27
|
+
const ts = class ts extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, j);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, K, !1);
|
|
32
32
|
d(this, A);
|
|
33
|
+
d(this, Q);
|
|
33
34
|
d(this, tt);
|
|
34
35
|
d(this, et);
|
|
35
|
-
d(this,
|
|
36
|
-
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
36
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, j)) return;
|
|
38
38
|
const e = t(this, j).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (y(this,
|
|
39
|
+
e && (y(this, et, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, et).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, j) || !t(this, A) || t(this,
|
|
44
|
+
if (!t(this, j) || !t(this, A) || t(this, K)) return;
|
|
45
45
|
const e = t(this, A).container, n = e.querySelector("table");
|
|
46
46
|
if (!n) return;
|
|
47
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;
|
|
@@ -53,15 +53,15 @@ const es = class es extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const
|
|
57
|
-
i.style.width = `${
|
|
56
|
+
const g = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
|
+
i.style.width = `${g}px`;
|
|
58
58
|
const f = e.scrollLeft, b = c - a;
|
|
59
|
-
let
|
|
60
|
-
b > 0 && (
|
|
61
|
-
const p = l -
|
|
62
|
-
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
|
|
61
|
+
const p = l - g;
|
|
62
|
+
u > p && (u = p), i.style.left = `${u}px`, t(this, A).left.disabled = u === 0, t(this, A).right.disabled = u >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, st, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, A)) return !1;
|
|
66
66
|
const n = t(this, A).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
@@ -69,22 +69,22 @@ const es = class es extends HTMLElement {
|
|
|
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, A).thumb.style.left = `${a}px`,
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`, C.log("1111=========="), t(this, A).left.disabled = a === 0, t(this, A).right.disabled = a >= c - 1;
|
|
73
73
|
const l = n.clientWidth, f = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && f > 0 && (n.scrollLeft = a / c * f), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, Q)), clearInterval(t(this, tt));
|
|
79
79
|
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, st).call(this, i + r), y(this, Q, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Q)), y(this, tt, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, st).call(this, o + r) || clearInterval(t(this, tt));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, Q)), clearInterval(t(this, tt));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
90
|
t(this, A).left.addEventListener(r, n), t(this, A).right.addEventListener(r, n), t(this, A).track.addEventListener(r, n);
|
|
@@ -96,16 +96,16 @@ const es = class es extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const i = t(this, A).track.getBoundingClientRect(), o = t(this, A).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, st).call(this, r.clientX - i.left - o / 2);
|
|
100
100
|
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, K, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const i = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, K)) return;
|
|
105
105
|
const c = t(this, A).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, st).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this,
|
|
108
|
+
y(this, K, !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
|
});
|
|
@@ -189,31 +189,31 @@ const es = class es extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), n.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, K) || this.refresh();
|
|
193
|
+
}), t(this, Jt).call(this), t(this, Zt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, et) && t(this, et).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
j = new WeakMap(),
|
|
202
|
-
let Ce =
|
|
201
|
+
j = new WeakMap(), K = new WeakMap(), A = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Zt = new WeakMap(), st = new WeakMap(), Jt = new WeakMap(), h(ts, "NineTableHScrollBar");
|
|
202
|
+
let Ce = ts;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
|
-
var
|
|
205
|
-
const
|
|
204
|
+
var nt, rt, yt, k, kt, Lt, Qt;
|
|
205
|
+
const es = class es extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
+
d(this, nt);
|
|
208
209
|
d(this, rt);
|
|
209
|
-
d(this, ot);
|
|
210
210
|
d(this, yt, !1);
|
|
211
211
|
d(this, k);
|
|
212
212
|
d(this, kt, 0);
|
|
213
213
|
d(this, Lt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, k).container, n = t(this, k).track, r = t(this, k).thumb, i = e.clientHeight, o = t(this,
|
|
215
|
+
if (!t(this, nt) || !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, nt).data.length, a = t(this, rt).getRowHeight(), c = o * a;
|
|
217
217
|
if (c <= i || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -221,19 +221,18 @@ const ss = class ss extends HTMLElement {
|
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = n.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
r.style.height = `${
|
|
224
|
+
const g = Math.max(Math.min(l * (i / c), l), 20);
|
|
225
|
+
r.style.height = `${g}px`;
|
|
226
226
|
const f = e.scrollTop, b = Math.max(c - i, 1);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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;
|
|
227
|
+
let u = 0;
|
|
228
|
+
b > 0 && (u = f / b * (l - g));
|
|
229
|
+
const p = l - g;
|
|
230
|
+
u < 0 && (u = 0), u > p && (u = p), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
232
231
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
234
|
-
|
|
232
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
233
|
+
C.log("nine-table-vscrollbar.#init");
|
|
235
234
|
const e = t(this, k).container, n = /* @__PURE__ */ h(() => {
|
|
236
|
-
const i = (t(this,
|
|
235
|
+
const i = (t(this, nt).data.get() || []).length, o = t(this, rt).getRowHeight();
|
|
237
236
|
return i * o;
|
|
238
237
|
}, "getContentHeight");
|
|
239
238
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
@@ -241,11 +240,11 @@ const ss = class ss extends HTMLElement {
|
|
|
241
240
|
r.stopPropagation(), r.preventDefault(), y(this, yt, !0), y(this, kt, r.clientY), y(this, Lt, e.scrollTop);
|
|
242
241
|
const i = /* @__PURE__ */ h((a) => {
|
|
243
242
|
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),
|
|
243
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this, kt), u = e.clientHeight, p = n(), x = Math.max(p - u, 1);
|
|
245
244
|
if (f > 0 && x > 0) {
|
|
246
245
|
const w = b / f * x;
|
|
247
246
|
let m = t(this, Lt) + w;
|
|
248
|
-
const T = Math.max(0, p -
|
|
247
|
+
const T = Math.max(0, p - u);
|
|
249
248
|
m < 0 && (m = 0), m > T && (m = T), e.scrollTop = m;
|
|
250
249
|
}
|
|
251
250
|
this.refresh();
|
|
@@ -255,10 +254,10 @@ const ss = class ss extends HTMLElement {
|
|
|
255
254
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
256
255
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
257
256
|
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,
|
|
257
|
+
const i = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, a = r.clientY - i.top - o / 2, l = i.height - o, g = e.clientHeight, f = n(), b = Math.max(f - g, 1);
|
|
259
258
|
if (l > 0 && b > 0) {
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
259
|
+
const u = Math.max(0, Math.min(1, a / l));
|
|
260
|
+
e.scrollTop = u * b;
|
|
262
261
|
}
|
|
263
262
|
this.refresh();
|
|
264
263
|
}), t(this, k).top.addEventListener("click", () => {
|
|
@@ -269,7 +268,7 @@ const ss = class ss extends HTMLElement {
|
|
|
269
268
|
}, "#init"));
|
|
270
269
|
}
|
|
271
270
|
connectedCallback() {
|
|
272
|
-
y(this,
|
|
271
|
+
y(this, nt, this.getRootNode().host), y(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
272
|
<style>
|
|
274
273
|
nine-table-vscrollbar {
|
|
275
274
|
display: flex;
|
|
@@ -334,7 +333,7 @@ const ss = class ss extends HTMLElement {
|
|
|
334
333
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
334
|
`;
|
|
336
335
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const n = t(this,
|
|
336
|
+
const n = t(this, rt).querySelector(".ng-container-body .ng-part-body");
|
|
338
337
|
if (!n) {
|
|
339
338
|
setTimeout(e, 10);
|
|
340
339
|
return;
|
|
@@ -345,40 +344,40 @@ const ss = class ss extends HTMLElement {
|
|
|
345
344
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
345
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
346
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
347
|
+
}), t(this, Qt).call(this), this.refresh();
|
|
349
348
|
}, "initWhenReady");
|
|
350
349
|
e();
|
|
351
350
|
}
|
|
352
351
|
};
|
|
353
|
-
|
|
354
|
-
let Te =
|
|
352
|
+
nt = new WeakMap(), rt = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Qt = new WeakMap(), h(es, "NineTableVScrollBar");
|
|
353
|
+
let Te = es;
|
|
355
354
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
356
|
-
var
|
|
357
|
-
const
|
|
355
|
+
var ot, R, it, Y, O, G, at, It, Ve, Ye, te, ee, Mt, Ht, $t, se, ne, Nt, mt, re, oe;
|
|
356
|
+
const ss = class ss {
|
|
358
357
|
constructor(s) {
|
|
359
|
-
d(this,
|
|
358
|
+
d(this, ot);
|
|
360
359
|
d(this, R);
|
|
361
360
|
d(this, it);
|
|
362
|
-
d(this,
|
|
361
|
+
d(this, Y, /* @__PURE__ */ new Map());
|
|
363
362
|
d(this, O, null);
|
|
364
|
-
d(this,
|
|
363
|
+
d(this, G, null);
|
|
365
364
|
d(this, at, 0);
|
|
366
365
|
d(this, It, 40);
|
|
367
366
|
d(this, Ve, !1);
|
|
368
367
|
d(this, Ye, !1);
|
|
369
368
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
370
|
-
d(this,
|
|
369
|
+
d(this, te, 3);
|
|
371
370
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
371
|
var e;
|
|
373
|
-
|
|
372
|
+
C.log("rowManager.refresh");
|
|
374
373
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
374
|
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
375
|
}, "refresh"));
|
|
377
376
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
|
|
377
|
+
C.log("rowManager.initialize"), y(this, it, {
|
|
379
378
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
379
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), y(this, O, null), t(this,
|
|
380
|
+
}), y(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
382
381
|
const a = t(this, R).querySelector(o);
|
|
383
382
|
if (!a) return;
|
|
384
383
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -386,7 +385,7 @@ const ns = class ns {
|
|
|
386
385
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
386
|
if (!l) return;
|
|
388
387
|
const f = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
388
|
+
t(this, Y).set(o, f);
|
|
390
389
|
});
|
|
391
390
|
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
391
|
if (s) {
|
|
@@ -396,8 +395,8 @@ const ns = class ns {
|
|
|
396
395
|
var f;
|
|
397
396
|
if (o) return;
|
|
398
397
|
o = !0;
|
|
399
|
-
const l = c.scrollTop,
|
|
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 !==
|
|
398
|
+
const l = c.scrollTop, g = c.scrollLeft;
|
|
399
|
+
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), n && n.scrollTop !== l && (n.scrollTop = l), r && r.scrollLeft !== g && (r.scrollLeft = g), i && i.scrollLeft !== g && (i.scrollLeft = g), t(this, mt).call(this, l), (f = t(this, R).querySelector("nine-table-vscrollbar")) == null || f.refresh(), o = !1;
|
|
401
400
|
}, "handleContainerScroll");
|
|
402
401
|
s == null || s.addEventListener("scroll", (c) => {
|
|
403
402
|
a(s);
|
|
@@ -405,15 +404,15 @@ const ns = class ns {
|
|
|
405
404
|
c == null || c.addEventListener("scroll", (l) => {
|
|
406
405
|
if (o) return;
|
|
407
406
|
o = !0;
|
|
408
|
-
const
|
|
409
|
-
s && s.scrollTop !==
|
|
407
|
+
const g = c.scrollTop;
|
|
408
|
+
s && s.scrollTop !== g && (s.scrollTop = g), o = !1;
|
|
410
409
|
});
|
|
411
410
|
});
|
|
412
411
|
}
|
|
413
412
|
}, "initialize"));
|
|
414
|
-
d(this,
|
|
415
|
-
|
|
416
|
-
const n = t(this,
|
|
413
|
+
d(this, ee, /* @__PURE__ */ h((s, e) => {
|
|
414
|
+
C.log("rowManager.#renderRows");
|
|
415
|
+
const n = t(this, Y).get(e);
|
|
417
416
|
if (!n || n.length === 0) return;
|
|
418
417
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
419
418
|
if (!r) return;
|
|
@@ -429,8 +428,8 @@ const ns = class ns {
|
|
|
429
428
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
430
429
|
return t(this, O);
|
|
431
430
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
432
|
-
|
|
433
|
-
const e = t(this,
|
|
431
|
+
C.log("rowManager.#measureAndCacheHeight");
|
|
432
|
+
const e = t(this, Y).get(".ng-container-body");
|
|
434
433
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
435
434
|
const n = s.querySelector("tbody.bindable-tbody");
|
|
436
435
|
if (!n) throw new Error("invalid dom");
|
|
@@ -441,20 +440,20 @@ const ns = class ns {
|
|
|
441
440
|
}), r ? r.before(i) : n.appendChild(i);
|
|
442
441
|
const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
443
442
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
444
|
-
let
|
|
443
|
+
let g = 0;
|
|
445
444
|
const f = n.querySelectorAll("tr");
|
|
446
445
|
return f.forEach((b) => {
|
|
447
|
-
let
|
|
448
|
-
if (
|
|
446
|
+
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
447
|
+
if (u === 0) {
|
|
449
448
|
const p = window.getComputedStyle(b);
|
|
450
|
-
|
|
449
|
+
u = parseFloat(p.height) || parseFloat(p.minHeight) || 0;
|
|
451
450
|
}
|
|
452
|
-
|
|
453
|
-
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l,
|
|
451
|
+
g += u;
|
|
452
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (y(this, O, g), t(this, $t).call(this), t(this, O));
|
|
454
453
|
}, "#measureAndCacheHeight"));
|
|
455
454
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
456
|
-
|
|
457
|
-
const e = (t(this,
|
|
455
|
+
C.log("rowManager.#updateVirtualScrollHeight");
|
|
456
|
+
const e = (t(this, ot).data.get() || []).length, n = t(this, O), r = e * n;
|
|
458
457
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
459
458
|
const o = t(this, R).querySelector(i);
|
|
460
459
|
if (!o) return;
|
|
@@ -465,38 +464,38 @@ const ns = class ns {
|
|
|
465
464
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
466
465
|
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
467
466
|
const s = Math.ceil(t(this, at) / t(this, O));
|
|
468
|
-
y(this, It, s + t(this,
|
|
467
|
+
y(this, It, s + t(this, te));
|
|
469
468
|
}
|
|
470
469
|
}, "#updateRowCount"));
|
|
471
|
-
d(this,
|
|
472
|
-
var a, c, l,
|
|
470
|
+
d(this, se, /* @__PURE__ */ h(() => {
|
|
471
|
+
var a, c, l, g, f, b;
|
|
473
472
|
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
473
|
if (e) {
|
|
475
|
-
const
|
|
474
|
+
const u = 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(u.length, p.length, x.length);
|
|
476
475
|
for (let m = 0; m < w; m++) {
|
|
477
476
|
const T = [
|
|
478
|
-
((a =
|
|
477
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
479
478
|
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
480
479
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
481
480
|
], S = Math.max(...T);
|
|
482
|
-
S > 0 && (
|
|
481
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
483
482
|
}
|
|
484
483
|
}
|
|
485
484
|
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
485
|
if (i) {
|
|
487
|
-
const
|
|
486
|
+
const u = 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(u.length, p.length, x.length);
|
|
488
487
|
for (let m = 0; m < w; m++) {
|
|
489
488
|
const T = [
|
|
490
|
-
((
|
|
489
|
+
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
491
490
|
((f = p[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
492
491
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
493
492
|
], S = Math.max(...T);
|
|
494
|
-
S > 0 && (
|
|
493
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), p[m] && (p[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
495
494
|
}
|
|
496
495
|
}
|
|
497
496
|
}, "#syncRowHeights"));
|
|
498
|
-
d(this,
|
|
499
|
-
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this,
|
|
497
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
498
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (y(this, G, new ResizeObserver((s) => {
|
|
500
499
|
for (const e of s) {
|
|
501
500
|
const n = e.target;
|
|
502
501
|
if (!n.classList.contains("active")) continue;
|
|
@@ -509,46 +508,27 @@ const ns = class ns {
|
|
|
509
508
|
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
509
|
}
|
|
511
510
|
}
|
|
512
|
-
})), t(this,
|
|
511
|
+
})), t(this, G).observe(t(this, R)));
|
|
513
512
|
}, "#initResizeObserver"));
|
|
514
513
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
515
|
-
|
|
514
|
+
C.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
516
515
|
const e = t(this, R).querySelector(s);
|
|
517
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
518
|
-
}), t(this, oe).call(this), t(this,
|
|
516
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, ee).call(this, e, s);
|
|
517
|
+
}), t(this, oe).call(this), t(this, se).call(this);
|
|
519
518
|
}, "#renderAllContainers"));
|
|
520
|
-
d(this, Ue, /* @__PURE__ */ h((s) => {
|
|
521
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
522
|
-
var l;
|
|
523
|
-
const n = t(this, R).querySelector(e);
|
|
524
|
-
if (!n) return;
|
|
525
|
-
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
526
|
-
if (!r) return;
|
|
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
|
-
i.forEach((u, f) => {
|
|
529
|
-
const b = s + Math.floor(f / o);
|
|
530
|
-
if (b >= c) {
|
|
531
|
-
u.style.visibility = "hidden";
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
const g = t(this, U).data.get(b);
|
|
535
|
-
u.style.display = "", t(this, _t).call(this, u, g, b);
|
|
536
|
-
});
|
|
537
|
-
});
|
|
538
|
-
}, "#adjustBufferRows"));
|
|
539
519
|
d(this, mt, /* @__PURE__ */ h((s) => {
|
|
540
520
|
var f, b;
|
|
541
521
|
const e = t(this, O);
|
|
542
522
|
if (!e || e <= 0) return;
|
|
543
|
-
const n = t(this,
|
|
523
|
+
const n = t(this, ot).data.length;
|
|
544
524
|
if (n === 0) return;
|
|
545
|
-
const r = ((f = t(this,
|
|
525
|
+
const r = ((f = t(this, Y).get(".ng-container-body")) == null ? void 0 : f.length) || 1, i = t(this, R).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, n - Math.floor(i.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(s / e)));
|
|
546
526
|
let c = Math.floor(a * e);
|
|
547
|
-
const l = t(this, it).firstTr,
|
|
548
|
-
(b = t(this, it)) == null || b.scrollTables.forEach((
|
|
549
|
-
|
|
550
|
-
}),
|
|
551
|
-
const p = t(this, R).querySelector(
|
|
527
|
+
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
528
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
529
|
+
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
530
|
+
}), g !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
531
|
+
const p = t(this, R).querySelector(u);
|
|
552
532
|
if (!p) return;
|
|
553
533
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
554
534
|
if (!x) return;
|
|
@@ -558,8 +538,8 @@ const ns = class ns {
|
|
|
558
538
|
m.style.display = "none";
|
|
559
539
|
return;
|
|
560
540
|
}
|
|
561
|
-
const M = t(this,
|
|
562
|
-
m.style.display = "", t(this,
|
|
541
|
+
const M = t(this, ot).data.get(S);
|
|
542
|
+
m.style.display = "", t(this, re).call(this, m, M, S);
|
|
563
543
|
});
|
|
564
544
|
});
|
|
565
545
|
}, "#handleScroll"));
|
|
@@ -577,7 +557,7 @@ const ns = class ns {
|
|
|
577
557
|
cell.dataset.row = dataIndex;
|
|
578
558
|
});
|
|
579
559
|
}; */
|
|
580
|
-
d(this,
|
|
560
|
+
d(this, re, /* @__PURE__ */ h((s, e, n) => {
|
|
581
561
|
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, i) => {
|
|
582
562
|
r.dataset.row = n;
|
|
583
563
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -585,8 +565,8 @@ const ns = class ns {
|
|
|
585
565
|
});
|
|
586
566
|
}, "#bindRowData"));
|
|
587
567
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
588
|
-
var c, l,
|
|
589
|
-
|
|
568
|
+
var c, l, g;
|
|
569
|
+
C.log("rowManager.#syncHeaderHeights");
|
|
590
570
|
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");
|
|
591
571
|
if (!e) return;
|
|
592
572
|
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);
|
|
@@ -594,26 +574,26 @@ const ns = class ns {
|
|
|
594
574
|
const b = [
|
|
595
575
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
596
576
|
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
597
|
-
((
|
|
598
|
-
],
|
|
599
|
-
|
|
577
|
+
((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
578
|
+
], u = Math.max(...b);
|
|
579
|
+
u > 0 && (r[f] && (r[f].style.height = `${u}px`), i[f] && (i[f].style.height = `${u}px`), o[f] && (o[f].style.height = `${u}px`));
|
|
600
580
|
}
|
|
601
581
|
}, "#syncHeaderHeights"));
|
|
602
582
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
603
|
-
t(this,
|
|
583
|
+
t(this, G) && (t(this, G).disconnect(), y(this, G, null));
|
|
604
584
|
}, "destroy"));
|
|
605
|
-
y(this,
|
|
585
|
+
y(this, ot, s.getRootNode().host), y(this, R, s), t(this, ne).call(this);
|
|
606
586
|
}
|
|
607
587
|
getRowHeight() {
|
|
608
588
|
return t(this, O);
|
|
609
589
|
}
|
|
610
590
|
templateLength(s = ".ng-container-body") {
|
|
611
591
|
var e;
|
|
612
|
-
return ((e = t(this,
|
|
592
|
+
return ((e = t(this, Y).get(s)) == null ? void 0 : e.length) || 1;
|
|
613
593
|
}
|
|
614
594
|
};
|
|
615
|
-
|
|
616
|
-
let ke =
|
|
595
|
+
ot = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), G = new WeakMap(), at = new WeakMap(), It = new WeakMap(), Ve = new WeakMap(), Ye = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), $t = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), Nt = new WeakMap(), mt = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), h(ss, "RowManager");
|
|
596
|
+
let ke = ss;
|
|
617
597
|
const ie = class ie {
|
|
618
598
|
/**
|
|
619
599
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -628,23 +608,23 @@ const ie = class ie {
|
|
|
628
608
|
if (!s) return null;
|
|
629
609
|
const e = /* @__PURE__ */ h((a) => {
|
|
630
610
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
631
|
-
const
|
|
611
|
+
const g = l.getAttribute("cell-type") || "renderer";
|
|
632
612
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
633
|
-
let f = `cell-${
|
|
634
|
-
const b = l.getAttribute("data-bind"),
|
|
613
|
+
let f = `cell-${g}`;
|
|
614
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), p = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
635
615
|
let w = [];
|
|
636
|
-
b && w.push(`data-bind="${b}"`),
|
|
616
|
+
b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), p && w.push(`maxbyte="${p}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
637
617
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
638
618
|
l.setAttribute("tabindex", "0");
|
|
639
619
|
});
|
|
640
620
|
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
641
621
|
if (!a.querySelector("colgroup")) {
|
|
642
|
-
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1,
|
|
622
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, g = document.createElement("colgroup"), f = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
643
623
|
for (let b = 0; b < l; b++) {
|
|
644
|
-
const
|
|
645
|
-
|
|
624
|
+
const u = document.createElement("col");
|
|
625
|
+
u.setAttribute("width", f), g.appendChild(u);
|
|
646
626
|
}
|
|
647
|
-
a.prepend(
|
|
627
|
+
a.prepend(g);
|
|
648
628
|
}
|
|
649
629
|
if (!a.querySelector("thead")) {
|
|
650
630
|
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
@@ -652,33 +632,33 @@ const ie = class ie {
|
|
|
652
632
|
}
|
|
653
633
|
a.classList.add("nine-table-element");
|
|
654
634
|
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
655
|
-
const l = Array.from(a.querySelectorAll(c + " tr")),
|
|
656
|
-
if (f === 0 ||
|
|
635
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
636
|
+
if (f === 0 || g.length === 0) return;
|
|
657
637
|
let b = 0;
|
|
658
|
-
|
|
638
|
+
g.forEach((p) => {
|
|
659
639
|
b += p.colSpan || 1;
|
|
660
640
|
});
|
|
661
|
-
const
|
|
641
|
+
const u = Array.from(Array(f), () => Array(b).fill(null));
|
|
662
642
|
l.forEach((p) => {
|
|
663
643
|
const x = p.sectionRowIndex;
|
|
664
644
|
let w = 0;
|
|
665
645
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
666
|
-
for (let M = 0; M <
|
|
667
|
-
if (
|
|
646
|
+
for (let M = 0; M < u[x].length; M++)
|
|
647
|
+
if (u[x][M] === null) {
|
|
668
648
|
w = M;
|
|
669
649
|
break;
|
|
670
650
|
}
|
|
671
651
|
const T = m.rowSpan || 1, S = m.colSpan || 1;
|
|
672
652
|
for (let M = 0; M < T; M++)
|
|
673
653
|
for (let W = 0; W < S; W++)
|
|
674
|
-
x + M < f && w + W < b && (
|
|
654
|
+
x + M < f && w + W < b && (u[x + M][w + W] = M === 0 && W === 0 ? "1" : "0");
|
|
675
655
|
});
|
|
676
656
|
}), l.forEach((p) => {
|
|
677
657
|
const x = p.sectionRowIndex;
|
|
678
658
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
679
|
-
for (let m = 0; m <
|
|
680
|
-
if (
|
|
681
|
-
w.dataset.col = m,
|
|
659
|
+
for (let m = 0; m < u[x].length; m++)
|
|
660
|
+
if (u[x][m] === "1") {
|
|
661
|
+
w.dataset.col = m, u[x][m] = "0";
|
|
682
662
|
break;
|
|
683
663
|
}
|
|
684
664
|
});
|
|
@@ -686,8 +666,8 @@ const ie = class ie {
|
|
|
686
666
|
}, "resetColIndex"), i = s.cloneNode(!0);
|
|
687
667
|
return n(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
688
668
|
const l = a.getAttribute("fixed");
|
|
689
|
-
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((
|
|
690
|
-
|
|
669
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
670
|
+
g.setAttribute("fixed", l);
|
|
691
671
|
});
|
|
692
672
|
}), i;
|
|
693
673
|
}
|
|
@@ -695,15 +675,15 @@ const ie = class ie {
|
|
|
695
675
|
};
|
|
696
676
|
h(ie, "TableCompiler");
|
|
697
677
|
let Le = ie;
|
|
698
|
-
var N,
|
|
699
|
-
const
|
|
678
|
+
var N, U, X, qt, xs;
|
|
679
|
+
const ns = class ns {
|
|
700
680
|
constructor(s) {
|
|
701
|
-
d(this,
|
|
681
|
+
d(this, X);
|
|
702
682
|
d(this, N);
|
|
703
|
-
d(this,
|
|
683
|
+
d(this, U, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
704
684
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
705
|
-
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this,
|
|
706
|
-
|
|
685
|
+
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, U);
|
|
686
|
+
C.log("π¨ [CellSelection.render] Rendering range ->", t(this, U));
|
|
707
687
|
const i = t(this, N).querySelectorAll(
|
|
708
688
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
709
689
|
);
|
|
@@ -712,66 +692,66 @@ const rs = class rs {
|
|
|
712
692
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
713
693
|
});
|
|
714
694
|
}), s < 0 || e < 0) {
|
|
715
|
-
|
|
695
|
+
C.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
716
696
|
return;
|
|
717
697
|
}
|
|
718
698
|
let o = 0;
|
|
719
699
|
i.forEach((a) => {
|
|
720
700
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
721
|
-
const { matrixRow: l } =
|
|
722
|
-
l < 0 || c.querySelectorAll("td, th").forEach((
|
|
723
|
-
const f = parseInt(
|
|
701
|
+
const { matrixRow: l } = V(this, X, qt).call(this, c);
|
|
702
|
+
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
703
|
+
const f = parseInt(g.dataset.col, 10);
|
|
724
704
|
if (isNaN(f)) return;
|
|
725
|
-
const b = parseInt(
|
|
726
|
-
p >= s && l <= n && x >= e && f <= r && (o++,
|
|
705
|
+
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), p = l + b - 1, x = f + u - 1;
|
|
706
|
+
p >= s && l <= n && x >= e && f <= r && (o++, g.classList.add("selected"), C.log(g, s, e, n, r), l <= s && g.classList.add("selected-top"), p >= n && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
|
|
727
707
|
});
|
|
728
708
|
});
|
|
729
|
-
}),
|
|
709
|
+
}), C.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
730
710
|
}, "render"));
|
|
731
|
-
y(this, N, s),
|
|
711
|
+
y(this, N, s), V(this, X, xs).call(this), t(this, N).querySelectorAll(
|
|
732
712
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
733
713
|
).forEach((n) => {
|
|
734
714
|
n.addEventListener("scroll", () => {
|
|
735
|
-
t(this,
|
|
715
|
+
t(this, U).startRow >= 0 && t(this, U).startCol >= 0 && this.render();
|
|
736
716
|
});
|
|
737
|
-
}),
|
|
717
|
+
}), C.log("π― [CellSelection] Initialized");
|
|
738
718
|
}
|
|
739
719
|
setRange(s, e, n, r) {
|
|
740
|
-
|
|
720
|
+
C.log(`π [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
741
721
|
let i = Math.min(s, n), o = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
742
722
|
const l = t(this, N).querySelectorAll(
|
|
743
723
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
744
724
|
);
|
|
745
|
-
let
|
|
746
|
-
for (;
|
|
747
|
-
|
|
748
|
-
b.querySelectorAll("tbody tr").forEach((
|
|
749
|
-
if (
|
|
750
|
-
const { matrixRow: p } =
|
|
751
|
-
p < 0 ||
|
|
725
|
+
let g = !0, f = 0;
|
|
726
|
+
for (; g && f < 5; )
|
|
727
|
+
g = !1, f++, l.forEach((b) => {
|
|
728
|
+
b.querySelectorAll("tbody tr").forEach((u) => {
|
|
729
|
+
if (u.classList.contains("nodata")) return;
|
|
730
|
+
const { matrixRow: p } = V(this, X, qt).call(this, u);
|
|
731
|
+
p < 0 || u.querySelectorAll("td, th").forEach((x) => {
|
|
752
732
|
const w = parseInt(x.dataset.col, 10);
|
|
753
733
|
if (isNaN(w)) return;
|
|
754
734
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), S = p + m - 1, M = w + T - 1;
|
|
755
735
|
if (S >= i && p <= o && M >= a && w <= c) {
|
|
756
|
-
const
|
|
757
|
-
(
|
|
736
|
+
const B = Math.min(i, p), Kt = Math.max(o, S), gs = Math.min(a, w), bs = Math.max(c, M);
|
|
737
|
+
(B !== i || Kt !== o || gs !== a || bs !== c) && (i = B, o = Kt, a = gs, c = bs, g = !0);
|
|
758
738
|
}
|
|
759
739
|
});
|
|
760
740
|
});
|
|
761
741
|
});
|
|
762
|
-
y(this,
|
|
742
|
+
y(this, U, { startRow: i, startCol: a, endRow: o, endCol: c }), C.log("π¦ [CellSelection.setRange] Final Range ->", t(this, U)), this.render();
|
|
763
743
|
}
|
|
764
744
|
};
|
|
765
|
-
N = new WeakMap(),
|
|
745
|
+
N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
766
746
|
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
747
|
const e = parseInt(s.dataset.row, 10);
|
|
768
748
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
769
749
|
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);
|
|
770
750
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
771
|
-
}, "#getMatrixRow"),
|
|
751
|
+
}, "#getMatrixRow"), xs = /* @__PURE__ */ h(function() {
|
|
772
752
|
const s = t(this, N).querySelector(".ng-container-top");
|
|
773
753
|
if (!s) {
|
|
774
|
-
|
|
754
|
+
C.log("β [CellSelection] .ng-container-top not found!");
|
|
775
755
|
return;
|
|
776
756
|
}
|
|
777
757
|
s.addEventListener("mousedown", (e) => {
|
|
@@ -779,49 +759,49 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
779
759
|
const n = e.target.closest("td, th");
|
|
780
760
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
781
761
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
782
|
-
const r = n.closest("tr"), { matrixRow: i } =
|
|
762
|
+
const r = n.closest("tr"), { matrixRow: i } = V(this, X, qt).call(this, r), o = parseInt(n.dataset.col, 10);
|
|
783
763
|
if (i < 0) {
|
|
784
764
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
785
765
|
return;
|
|
786
766
|
}
|
|
787
|
-
|
|
767
|
+
C.log(`π±οΈ [MouseDown Success] startRow: ${i}, startCol: ${o}`), t(this, N).navigation.currentCell = n;
|
|
788
768
|
let a = i, c = o;
|
|
789
769
|
const l = /* @__PURE__ */ h((f) => {
|
|
790
770
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
791
|
-
let
|
|
792
|
-
if (!
|
|
771
|
+
let u = b == null ? void 0 : b.closest("td, th");
|
|
772
|
+
if (!u || !t(this, N).contains(u)) {
|
|
793
773
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
794
774
|
for (const T of m) {
|
|
795
775
|
const S = T.getBoundingClientRect();
|
|
796
776
|
if (f.clientX >= S.left && f.clientX <= S.right && f.clientY >= S.top && f.clientY <= S.bottom) {
|
|
797
|
-
|
|
777
|
+
u = T;
|
|
798
778
|
break;
|
|
799
779
|
}
|
|
800
780
|
}
|
|
801
781
|
}
|
|
802
|
-
if (!
|
|
803
|
-
const p =
|
|
782
|
+
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
783
|
+
const p = u.closest("tr"), { matrixRow: x } = V(this, X, qt).call(this, p), w = parseInt(u.dataset.col, 10);
|
|
804
784
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
805
|
-
}, "onMouseMove"),
|
|
806
|
-
|
|
785
|
+
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
786
|
+
C.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
807
787
|
}, "onMouseUp");
|
|
808
|
-
document.addEventListener("mousemove", l), document.addEventListener("mouseup",
|
|
788
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
809
789
|
});
|
|
810
|
-
}, "#initEvents"), h(
|
|
811
|
-
let Ie =
|
|
812
|
-
var F, lt, ae, le, pt, He, Ot, Dt,
|
|
813
|
-
const
|
|
790
|
+
}, "#initEvents"), h(ns, "CellSelection");
|
|
791
|
+
let Ie = ns;
|
|
792
|
+
var F, lt, ae, le, pt, He, _t, Ot, Dt, ct, Wt, ws;
|
|
793
|
+
const rs = class rs {
|
|
814
794
|
constructor(s) {
|
|
815
795
|
d(this, pt);
|
|
816
796
|
d(this, F);
|
|
817
797
|
d(this, lt, null);
|
|
818
798
|
d(this, ae, -1);
|
|
819
799
|
d(this, le, -1);
|
|
820
|
-
d(this,
|
|
800
|
+
d(this, _t, /* @__PURE__ */ h((s) => {
|
|
821
801
|
const e = [];
|
|
822
802
|
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]);
|
|
823
803
|
}, "#getMaxColCell"));
|
|
824
|
-
d(this,
|
|
804
|
+
d(this, Ot, /* @__PURE__ */ h((s, e) => {
|
|
825
805
|
const n = t(this, ct).call(this, s);
|
|
826
806
|
if (n.length === 0) return e + 1;
|
|
827
807
|
let r = e + 1;
|
|
@@ -836,7 +816,7 @@ const os = class os {
|
|
|
836
816
|
}
|
|
837
817
|
return r;
|
|
838
818
|
}, "#getNextCol"));
|
|
839
|
-
d(this,
|
|
819
|
+
d(this, Dt, /* @__PURE__ */ h((s, e) => {
|
|
840
820
|
const n = t(this, ct).call(this, s);
|
|
841
821
|
if (n.length === 0) return Math.max(0, e - 1);
|
|
842
822
|
let r = -1;
|
|
@@ -859,33 +839,33 @@ const os = class os {
|
|
|
859
839
|
return e.forEach((r) => {
|
|
860
840
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
861
841
|
for (const o of i) {
|
|
862
|
-
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1,
|
|
842
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
|
|
863
843
|
if (f === s) {
|
|
864
844
|
n.push(o);
|
|
865
845
|
break;
|
|
866
846
|
}
|
|
867
847
|
const b = Array.from(o.querySelectorAll("td"));
|
|
868
|
-
let
|
|
848
|
+
let u = !1;
|
|
869
849
|
for (const p of b) {
|
|
870
850
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
871
851
|
if (x > 1 && s >= f && s < f + x) {
|
|
872
|
-
n.push(o),
|
|
852
|
+
n.push(o), u = !0;
|
|
873
853
|
break;
|
|
874
854
|
}
|
|
875
855
|
}
|
|
876
|
-
if (
|
|
856
|
+
if (u) break;
|
|
877
857
|
}
|
|
878
858
|
}), n;
|
|
879
859
|
}, "#findTargetTrsByMatrix"));
|
|
880
860
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
881
|
-
d(this,
|
|
861
|
+
d(this, Wt, /* @__PURE__ */ h((s, e, n, r) => {
|
|
882
862
|
const i = t(this, F).querySelectorAll(
|
|
883
863
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
884
864
|
), o = r !== void 0 ? r : s * 1 + e;
|
|
885
865
|
for (const a of i) {
|
|
886
866
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
887
867
|
for (const l of c) {
|
|
888
|
-
const
|
|
868
|
+
const g = parseInt(l.dataset.row, 10), f = c.filter((w) => parseInt(w.dataset.row, 10) === g), b = f.length > 0 ? f.length : 1, u = f.indexOf(l), p = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
|
|
889
869
|
for (const w of x) {
|
|
890
870
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
891
871
|
if (!isNaN(m) && n >= m && n < m + T && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
|
|
@@ -895,7 +875,7 @@ const os = class os {
|
|
|
895
875
|
}
|
|
896
876
|
return null;
|
|
897
877
|
}, "#getNearElement"));
|
|
898
|
-
y(this, F, s),
|
|
878
|
+
y(this, F, s), V(this, pt, ws).call(this), C.log("π― [CellNavigation] Initialized");
|
|
899
879
|
}
|
|
900
880
|
get currentCell() {
|
|
901
881
|
return t(this, lt);
|
|
@@ -908,8 +888,8 @@ const os = class os {
|
|
|
908
888
|
y(this, ae, e), y(this, le, n);
|
|
909
889
|
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
910
890
|
if (i) {
|
|
911
|
-
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),
|
|
912
|
-
t(this, F).selection.setRange(
|
|
891
|
+
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), g = e * c + (l >= 0 ? l : 0);
|
|
892
|
+
t(this, F).selection.setRange(g, n, g, n);
|
|
913
893
|
}
|
|
914
894
|
}
|
|
915
895
|
}
|
|
@@ -918,27 +898,27 @@ const os = class os {
|
|
|
918
898
|
if (!t(this, lt)) return;
|
|
919
899
|
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");
|
|
920
900
|
if (!o) return;
|
|
921
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1,
|
|
922
|
-
let b = f,
|
|
901
|
+
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, g = c.indexOf(n), f = r * l + (g >= 0 ? g : 0);
|
|
902
|
+
let b = f, u = i;
|
|
923
903
|
switch (s.code) {
|
|
924
904
|
case "Tab":
|
|
925
905
|
if (s.preventDefault(), s.shiftKey) {
|
|
926
|
-
if (
|
|
906
|
+
if (u = t(this, Dt).call(this, f, i), u < 0 && f > 0) {
|
|
927
907
|
b = f - 1;
|
|
928
|
-
const W = t(this, ct).call(this, b),
|
|
929
|
-
|
|
908
|
+
const W = t(this, ct).call(this, b), B = t(this, _t).call(this, W);
|
|
909
|
+
u = B ? parseInt(B.dataset.col, 10) : 0;
|
|
930
910
|
}
|
|
931
911
|
} else {
|
|
932
|
-
|
|
933
|
-
const W = t(this, ct).call(this, f),
|
|
934
|
-
|
|
912
|
+
u = t(this, Ot).call(this, f, i);
|
|
913
|
+
const W = t(this, ct).call(this, f), B = t(this, _t).call(this, W), Kt = B ? parseInt(B.dataset.col, 10) + parseInt(B.colSpan || 1, 10) : 0;
|
|
914
|
+
u >= Kt && (b = f + 1, u = 0);
|
|
935
915
|
}
|
|
936
916
|
break;
|
|
937
917
|
case "ArrowRight":
|
|
938
|
-
|
|
918
|
+
u = t(this, Ot).call(this, f, i);
|
|
939
919
|
break;
|
|
940
920
|
case "ArrowLeft":
|
|
941
|
-
|
|
921
|
+
u = t(this, Dt).call(this, f, i);
|
|
942
922
|
break;
|
|
943
923
|
case "ArrowDown":
|
|
944
924
|
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -948,14 +928,14 @@ const os = class os {
|
|
|
948
928
|
break;
|
|
949
929
|
}
|
|
950
930
|
const p = Math.floor(b / l), x = b % l;
|
|
951
|
-
let w = t(this,
|
|
931
|
+
let w = t(this, Wt).call(this, p, x, u, b);
|
|
952
932
|
if (w)
|
|
953
|
-
this.currentCell = w,
|
|
933
|
+
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
954
934
|
else if (p !== r && p >= 0) {
|
|
955
935
|
const W = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
956
936
|
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p * W), setTimeout(() => {
|
|
957
|
-
const
|
|
958
|
-
|
|
937
|
+
const B = t(this, Wt).call(this, p, x, u, b);
|
|
938
|
+
B && (this.currentCell = B, V(this, pt, He).call(this, B));
|
|
959
939
|
}, 0);
|
|
960
940
|
}
|
|
961
941
|
}
|
|
@@ -966,13 +946,13 @@ He = /* @__PURE__ */ h(function(s) {
|
|
|
966
946
|
if (!e) return;
|
|
967
947
|
const n = s.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
968
948
|
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);
|
|
969
|
-
}, "#ensureCellVisible"),
|
|
949
|
+
}, "#ensureCellVisible"), _t = new WeakMap(), Ot = new WeakMap(), Dt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), ws = /* @__PURE__ */ h(function() {
|
|
970
950
|
t(this, F).addEventListener("keydown", (s) => {
|
|
971
951
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
972
952
|
});
|
|
973
|
-
}, "#initEvents"), h(
|
|
974
|
-
let Me =
|
|
975
|
-
var ce, ht, dt, zt,
|
|
953
|
+
}, "#initEvents"), h(rs, "CellNavigation");
|
|
954
|
+
let Me = rs;
|
|
955
|
+
var ce, ht, dt, zt, Bt, he, de, xt, fe, ue;
|
|
976
956
|
const Ct = class Ct extends HTMLElement {
|
|
977
957
|
constructor() {
|
|
978
958
|
super();
|
|
@@ -980,12 +960,12 @@ const Ct = class Ct extends HTMLElement {
|
|
|
980
960
|
d(this, ht, null);
|
|
981
961
|
d(this, dt);
|
|
982
962
|
d(this, zt);
|
|
983
|
-
d(this,
|
|
963
|
+
d(this, Bt);
|
|
984
964
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
985
|
-
|
|
965
|
+
C.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
986
966
|
}, "invalidate"));
|
|
987
967
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
988
|
-
if (
|
|
968
|
+
if (C.log("sheet.generate()"), !e) return;
|
|
989
969
|
y(this, ht, Le.compile(e)), t(this, he).call(this), t(this, de).call(this);
|
|
990
970
|
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");
|
|
991
971
|
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
@@ -1022,8 +1002,8 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1022
1002
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1023
1003
|
if (r === "header") {
|
|
1024
1004
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1005
|
+
const g = document.createElement("tbody");
|
|
1006
|
+
g.className = "fixed-tbody", i.appendChild(g);
|
|
1027
1007
|
}
|
|
1028
1008
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1029
1009
|
return n === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -1044,7 +1024,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1044
1024
|
n && (n.scrollTop = e);
|
|
1045
1025
|
}, "scrollToY"));
|
|
1046
1026
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1047
|
-
t(this, ue).call(this), y(this, zt, new Ie(this)), y(this,
|
|
1027
|
+
t(this, ue).call(this), y(this, zt, new Ie(this)), y(this, Bt, new Me(this));
|
|
1048
1028
|
}, "#init"));
|
|
1049
1029
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1050
1030
|
const e = Ct.SCROLLBAR_SIZE;
|
|
@@ -1257,17 +1237,17 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1257
1237
|
return t(this, zt);
|
|
1258
1238
|
}
|
|
1259
1239
|
get navigation() {
|
|
1260
|
-
return t(this,
|
|
1240
|
+
return t(this, Bt);
|
|
1261
1241
|
}
|
|
1262
1242
|
disconnectedCallback() {
|
|
1263
|
-
this.innerHTML = "",
|
|
1243
|
+
this.innerHTML = "", C.log("NineTableSheet destroyed.");
|
|
1264
1244
|
}
|
|
1265
1245
|
};
|
|
1266
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(),
|
|
1267
|
-
let
|
|
1268
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1269
|
-
var ge,
|
|
1270
|
-
const
|
|
1246
|
+
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Bt = 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);
|
|
1247
|
+
let Gt = Ct;
|
|
1248
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Gt);
|
|
1249
|
+
var ge, Pt;
|
|
1250
|
+
const os = class os extends HTMLElement {
|
|
1271
1251
|
constructor() {
|
|
1272
1252
|
super();
|
|
1273
1253
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
@@ -1275,38 +1255,38 @@ const is = class is extends HTMLElement {
|
|
|
1275
1255
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1276
1256
|
var o;
|
|
1277
1257
|
const r = n.ctrlKey || n.metaKey || n.shiftKey, i = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1278
|
-
t(this,
|
|
1279
|
-
}), t(this,
|
|
1258
|
+
t(this, Pt).call(this, i, r);
|
|
1259
|
+
}), t(this, Pt).call(this, 0, !1);
|
|
1280
1260
|
}, "#init"));
|
|
1281
|
-
d(this,
|
|
1261
|
+
d(this, Pt, /* @__PURE__ */ h((e, n = !1) => {
|
|
1282
1262
|
const r = /* @__PURE__ */ h(() => {
|
|
1283
|
-
const
|
|
1284
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1285
|
-
const b =
|
|
1286
|
-
b.length < 2 || b.forEach((
|
|
1287
|
-
const p = parseInt(
|
|
1263
|
+
const g = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1264
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1265
|
+
const b = g.filter((u) => u.classList.contains("active"));
|
|
1266
|
+
b.length < 2 || b.forEach((u) => {
|
|
1267
|
+
const p = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), w = g[p + 1];
|
|
1288
1268
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1289
1269
|
});
|
|
1290
1270
|
}, "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");
|
|
1291
1271
|
if (!a[e]) return;
|
|
1292
1272
|
if (!n)
|
|
1293
|
-
a.forEach((
|
|
1294
|
-
|
|
1295
|
-
}), c.forEach((
|
|
1273
|
+
a.forEach((g, f) => {
|
|
1274
|
+
g.classList.toggle("active", f === e);
|
|
1275
|
+
}), c.forEach((g, f) => {
|
|
1296
1276
|
const b = f === e;
|
|
1297
|
-
|
|
1277
|
+
g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
|
|
1298
1278
|
});
|
|
1299
1279
|
else {
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1280
|
+
const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1281
|
+
if (g.classList.contains("active") && f.length <= 1)
|
|
1302
1282
|
return;
|
|
1303
|
-
|
|
1283
|
+
g.classList.toggle("active");
|
|
1304
1284
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1305
1285
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1306
1286
|
}
|
|
1307
1287
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1308
|
-
l == null || l.forEach((
|
|
1309
|
-
|
|
1288
|
+
l == null || l.forEach((g) => {
|
|
1289
|
+
g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1310
1290
|
}), r();
|
|
1311
1291
|
}, "#switchSheet"));
|
|
1312
1292
|
}
|
|
@@ -1314,24 +1294,24 @@ const is = class is extends HTMLElement {
|
|
|
1314
1294
|
t(this, ge).call(this);
|
|
1315
1295
|
}
|
|
1316
1296
|
};
|
|
1317
|
-
ge = new WeakMap(),
|
|
1318
|
-
let $e =
|
|
1297
|
+
ge = new WeakMap(), Pt = new WeakMap(), h(os, "NineTableSheets");
|
|
1298
|
+
let $e = os;
|
|
1319
1299
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1320
|
-
var _, be,
|
|
1321
|
-
const
|
|
1300
|
+
var _, be, Ft, pe;
|
|
1301
|
+
const is = class is {
|
|
1322
1302
|
constructor(s) {
|
|
1323
1303
|
d(this, _);
|
|
1324
1304
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1325
1305
|
t(this, pe).call(this), new ResizeObserver((s) => {
|
|
1326
1306
|
for (let e of s)
|
|
1327
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
1307
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Ft).call(this);
|
|
1328
1308
|
}).observe(t(this, _));
|
|
1329
1309
|
}, "#init"));
|
|
1330
|
-
d(this,
|
|
1310
|
+
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
1331
1311
|
var c, l;
|
|
1332
1312
|
const s = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1333
1313
|
if (s.length === 0) return;
|
|
1334
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((
|
|
1314
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((g) => g.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 = Gt.SCROLLBAR_SIZE, a = e * n + r + i + o;
|
|
1335
1315
|
t(this, _).style.height = `${a}px`;
|
|
1336
1316
|
}, "#applyAutoHeight"));
|
|
1337
1317
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
@@ -1463,22 +1443,22 @@ const as = class as {
|
|
|
1463
1443
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1464
1444
|
a == null || a.forEach((c, l) => {
|
|
1465
1445
|
e[l] && setTimeout(() => {
|
|
1466
|
-
c.generate(e[l]), n && t(this,
|
|
1446
|
+
c.generate(e[l]), n && t(this, Ft).call(this);
|
|
1467
1447
|
});
|
|
1468
1448
|
});
|
|
1469
1449
|
}, "#render"));
|
|
1470
1450
|
y(this, _, s), t(this, be).call(this);
|
|
1471
1451
|
}
|
|
1472
1452
|
};
|
|
1473
|
-
_ = new WeakMap(), be = new WeakMap(),
|
|
1474
|
-
let Ne =
|
|
1475
|
-
var
|
|
1476
|
-
const
|
|
1453
|
+
_ = new WeakMap(), be = new WeakMap(), Ft = new WeakMap(), pe = new WeakMap(), h(is, "LayoutManager");
|
|
1454
|
+
let Ne = is;
|
|
1455
|
+
var jt, wt;
|
|
1456
|
+
const as = class as {
|
|
1477
1457
|
constructor(s) {
|
|
1478
|
-
d(this,
|
|
1458
|
+
d(this, jt);
|
|
1479
1459
|
d(this, wt, -1);
|
|
1480
|
-
E(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1481
|
-
y(this,
|
|
1460
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, jt).rawRecords.length, "count"));
|
|
1461
|
+
y(this, jt, s);
|
|
1482
1462
|
}
|
|
1483
1463
|
get at() {
|
|
1484
1464
|
return t(this, wt);
|
|
@@ -1488,25 +1468,25 @@ const ls = class ls {
|
|
|
1488
1468
|
});
|
|
1489
1469
|
}
|
|
1490
1470
|
};
|
|
1491
|
-
|
|
1492
|
-
let _e =
|
|
1493
|
-
var D, L,
|
|
1471
|
+
jt = new WeakMap(), wt = new WeakMap(), h(as, "ngRow");
|
|
1472
|
+
let _e = as;
|
|
1473
|
+
var D, L, z, vt, ye, Z, me, ft, Vt, xe, we, St;
|
|
1494
1474
|
const P = class P {
|
|
1495
1475
|
constructor(s, e) {
|
|
1496
1476
|
d(this, D);
|
|
1497
1477
|
d(this, L);
|
|
1498
|
-
d(this,
|
|
1478
|
+
d(this, z, []);
|
|
1499
1479
|
d(this, vt, []);
|
|
1500
1480
|
d(this, ye, 0);
|
|
1501
|
-
d(this,
|
|
1481
|
+
d(this, Z, []);
|
|
1502
1482
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1503
|
-
y(this,
|
|
1483
|
+
y(this, Z, []);
|
|
1504
1484
|
const s = t(this, D).template || [];
|
|
1505
1485
|
Array.from(s).forEach((e) => {
|
|
1506
1486
|
var n;
|
|
1507
|
-
t(this,
|
|
1487
|
+
t(this, Z).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1508
1488
|
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1509
|
-
e.__ng || (e.__ng = t(this,
|
|
1489
|
+
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1510
1490
|
});
|
|
1511
1491
|
}, "#initialize"));
|
|
1512
1492
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
@@ -1531,21 +1511,21 @@ const P = class P {
|
|
|
1531
1511
|
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1532
1512
|
this.clear(), this.add(s, !1), t(this, ft).call(this);
|
|
1533
1513
|
}, "set"));
|
|
1534
|
-
d(this,
|
|
1514
|
+
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1535
1515
|
rowState: P.ROW_STATE.EMPTY,
|
|
1536
1516
|
deleted: !1,
|
|
1537
1517
|
filtered: !1,
|
|
1538
|
-
height: t(this,
|
|
1518
|
+
height: t(this, Z).slice(),
|
|
1539
1519
|
o: {},
|
|
1540
1520
|
c: {},
|
|
1541
|
-
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1521
|
+
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1542
1522
|
}), "#getDefaultMeta"));
|
|
1543
1523
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1544
|
-
y(this,
|
|
1524
|
+
y(this, z, []), y(this, vt, []), t(this, ft).call(this);
|
|
1545
1525
|
}, "reset"));
|
|
1546
1526
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1547
1527
|
var s;
|
|
1548
|
-
t(this, L).rawRecords = [], y(this,
|
|
1528
|
+
t(this, L).rawRecords = [], y(this, z, []), y(this, vt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
|
|
1549
1529
|
}, "clear"));
|
|
1550
1530
|
d(this, xe, /* @__PURE__ */ h((s) => {
|
|
1551
1531
|
var r;
|
|
@@ -1559,7 +1539,7 @@ const P = class P {
|
|
|
1559
1539
|
}), n;
|
|
1560
1540
|
}, "#json2Array"));
|
|
1561
1541
|
d(this, we, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1562
|
-
e.__ng = t(this,
|
|
1542
|
+
e.__ng = t(this, Vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = P.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1563
1543
|
}), s), "#defaultInsert"));
|
|
1564
1544
|
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1565
1545
|
s === void 0 && (s = {});
|
|
@@ -1574,9 +1554,9 @@ const P = class P {
|
|
|
1574
1554
|
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1575
1555
|
let e = [];
|
|
1576
1556
|
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) => {
|
|
1577
|
-
if (t(this,
|
|
1578
|
-
const r = t(this,
|
|
1579
|
-
t(this,
|
|
1557
|
+
if (t(this, z)[n]) {
|
|
1558
|
+
const r = t(this, z)[n].__ng.rowid;
|
|
1559
|
+
t(this, z)[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) => {
|
|
1580
1560
|
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1581
1561
|
});
|
|
1582
1562
|
}
|
|
@@ -1593,20 +1573,20 @@ const P = class P {
|
|
|
1593
1573
|
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;
|
|
1594
1574
|
}, "setValue"));
|
|
1595
1575
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1596
|
-
y(this, vt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), y(this,
|
|
1576
|
+
y(this, vt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), y(this, z, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
|
|
1597
1577
|
s.__ng.rowidx = e;
|
|
1598
|
-
}), t(this,
|
|
1578
|
+
}), t(this, z).forEach((s, e) => {
|
|
1599
1579
|
s.__ng.i = e;
|
|
1600
1580
|
});
|
|
1601
1581
|
}, "resetRecords"));
|
|
1602
|
-
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1582
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1603
1583
|
d(this, St, /* @__PURE__ */ h((s) => {
|
|
1604
1584
|
var o;
|
|
1605
1585
|
if (!s) return s;
|
|
1606
1586
|
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) => {
|
|
1607
1587
|
const c = {};
|
|
1608
|
-
return r.forEach((l,
|
|
1609
|
-
c[l] = a.v ? a.v[
|
|
1588
|
+
return r.forEach((l, g) => {
|
|
1589
|
+
c[l] = a.v ? a.v[g] : a[l];
|
|
1610
1590
|
}), c.__ng = a.__ng, c;
|
|
1611
1591
|
});
|
|
1612
1592
|
return e ? i[0] : i;
|
|
@@ -1621,19 +1601,19 @@ const P = class P {
|
|
|
1621
1601
|
this.clear(), this.add(s, !1);
|
|
1622
1602
|
}
|
|
1623
1603
|
get nextId() {
|
|
1624
|
-
return ++
|
|
1604
|
+
return ++ms(this, ye)._;
|
|
1625
1605
|
}
|
|
1626
1606
|
get count() {
|
|
1627
|
-
return t(this,
|
|
1607
|
+
return t(this, z).length;
|
|
1628
1608
|
}
|
|
1629
1609
|
get length() {
|
|
1630
|
-
return t(this,
|
|
1610
|
+
return t(this, z).length;
|
|
1631
1611
|
}
|
|
1632
1612
|
getRowCount() {
|
|
1633
1613
|
return this.length;
|
|
1634
1614
|
}
|
|
1635
1615
|
};
|
|
1636
|
-
D = new WeakMap(), L = new WeakMap(),
|
|
1616
|
+
D = new WeakMap(), L = new WeakMap(), z = new WeakMap(), vt = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), me = new WeakMap(), ft = new WeakMap(), Vt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1637
1617
|
E(P, "ROW_STATE", {
|
|
1638
1618
|
EMPTY: "EMPTY",
|
|
1639
1619
|
NORMAL: "NORMAL",
|
|
@@ -1643,7 +1623,7 @@ E(P, "ROW_STATE", {
|
|
|
1643
1623
|
});
|
|
1644
1624
|
let Oe = P;
|
|
1645
1625
|
var ut;
|
|
1646
|
-
const
|
|
1626
|
+
const ls = class ls {
|
|
1647
1627
|
constructor(s) {
|
|
1648
1628
|
d(this, ut);
|
|
1649
1629
|
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 = () => {
|
|
@@ -1663,10 +1643,10 @@ const cs = class cs {
|
|
|
1663
1643
|
}, this.setDataSource([]);
|
|
1664
1644
|
}
|
|
1665
1645
|
};
|
|
1666
|
-
ut = new WeakMap(), h(
|
|
1667
|
-
let De =
|
|
1668
|
-
var Rt, H,
|
|
1669
|
-
const
|
|
1646
|
+
ut = new WeakMap(), h(ls, "ngDataManager");
|
|
1647
|
+
let De = ls;
|
|
1648
|
+
var Rt, H, Yt, ve;
|
|
1649
|
+
const cs = class cs {
|
|
1670
1650
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1671
1651
|
constructor(s) {
|
|
1672
1652
|
d(this, Rt);
|
|
@@ -1674,20 +1654,20 @@ const hs = class hs {
|
|
|
1674
1654
|
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1675
1655
|
s.forEach((n) => {
|
|
1676
1656
|
t(this, H).some((r) => r.name === n) || t(this, H).push({ name: n, type: e });
|
|
1677
|
-
}), t(this,
|
|
1657
|
+
}), t(this, Yt).call(this);
|
|
1678
1658
|
}, "add"));
|
|
1679
|
-
d(this,
|
|
1659
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
1680
1660
|
const s = /* @__PURE__ */ new Map();
|
|
1681
1661
|
t(this, H).forEach((e) => {
|
|
1682
1662
|
s.set(e.name, e.type);
|
|
1683
1663
|
}), 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);
|
|
1684
1664
|
}, "#adjust"));
|
|
1685
1665
|
d(this, ve, /* @__PURE__ */ h(() => {
|
|
1686
|
-
y(this, H, []),
|
|
1666
|
+
y(this, H, []), C.log(t(this, Rt).querySelectorAll("table"));
|
|
1687
1667
|
const s = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1688
1668
|
if (!(!s || s.length === 0)) {
|
|
1689
1669
|
for (const e of s)
|
|
1690
|
-
|
|
1670
|
+
C.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1691
1671
|
const i = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1692
1672
|
i && t(this, H).push({ name: i, type: o });
|
|
1693
1673
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
@@ -1711,7 +1691,7 @@ const hs = class hs {
|
|
|
1711
1691
|
});
|
|
1712
1692
|
});
|
|
1713
1693
|
});
|
|
1714
|
-
t(this,
|
|
1694
|
+
t(this, Yt).call(this);
|
|
1715
1695
|
}
|
|
1716
1696
|
}, "#init"));
|
|
1717
1697
|
y(this, Rt, s), t(this, ve).call(this);
|
|
@@ -1736,17 +1716,17 @@ const hs = class hs {
|
|
|
1736
1716
|
return t(this, H).some((e) => e.name === s);
|
|
1737
1717
|
}
|
|
1738
1718
|
};
|
|
1739
|
-
Rt = new WeakMap(), H = new WeakMap(),
|
|
1740
|
-
let We =
|
|
1719
|
+
Rt = new WeakMap(), H = new WeakMap(), Yt = new WeakMap(), ve = new WeakMap(), h(cs, "ngFields");
|
|
1720
|
+
let We = cs;
|
|
1741
1721
|
var gt, Se, Re;
|
|
1742
|
-
const
|
|
1722
|
+
const hs = class hs extends HTMLElement {
|
|
1743
1723
|
constructor() {
|
|
1744
1724
|
super();
|
|
1745
1725
|
//#created = false;
|
|
1746
1726
|
d(this, gt);
|
|
1747
1727
|
d(this, Se);
|
|
1748
1728
|
d(this, Re, /* @__PURE__ */ h(() => {
|
|
1749
|
-
this.fields = new We(this), y(this, Se, new Ne(this)),
|
|
1729
|
+
this.fields = new We(this), y(this, Se, new Ne(this)), C.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1750
1730
|
}, "#init"));
|
|
1751
1731
|
this.attachShadow({ mode: "open" }), y(this, gt, new De(this));
|
|
1752
1732
|
}
|
|
@@ -1754,7 +1734,7 @@ const ds = class ds extends HTMLElement {
|
|
|
1754
1734
|
t(this, Re).call(this);
|
|
1755
1735
|
}
|
|
1756
1736
|
disconnectedCallback() {
|
|
1757
|
-
|
|
1737
|
+
C.log("NineTable disconnected.");
|
|
1758
1738
|
}
|
|
1759
1739
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1760
1740
|
get data() {
|
|
@@ -1769,9 +1749,9 @@ const ds = class ds extends HTMLElement {
|
|
|
1769
1749
|
return t(this, gt);
|
|
1770
1750
|
}
|
|
1771
1751
|
};
|
|
1772
|
-
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(
|
|
1773
|
-
let
|
|
1774
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1752
|
+
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(hs, "NineTable");
|
|
1753
|
+
let ze = hs;
|
|
1754
|
+
customElements.get("nine-table") || customElements.define("nine-table", ze);
|
|
1775
1755
|
const Tt = class Tt extends HTMLElement {
|
|
1776
1756
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1777
1757
|
constructor() {
|
|
@@ -1784,18 +1764,18 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1784
1764
|
}
|
|
1785
1765
|
};
|
|
1786
1766
|
h(Tt, "BasicCellElement"), E(Tt, "_styleCache", /* @__PURE__ */ new Map()), E(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1787
|
-
let
|
|
1788
|
-
var I,
|
|
1789
|
-
const
|
|
1767
|
+
let Be = Tt;
|
|
1768
|
+
var I, Ut, v, Ue, Xe, Ke, Ge, Ze;
|
|
1769
|
+
const ds = class ds extends Be {
|
|
1790
1770
|
constructor() {
|
|
1791
1771
|
super();
|
|
1792
1772
|
d(this, I);
|
|
1793
|
-
d(this,
|
|
1773
|
+
d(this, Ut);
|
|
1794
1774
|
d(this, v);
|
|
1775
|
+
d(this, Ue);
|
|
1795
1776
|
d(this, Xe);
|
|
1796
1777
|
d(this, Ke);
|
|
1797
1778
|
d(this, Ge);
|
|
1798
|
-
d(this, Ze);
|
|
1799
1779
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1800
1780
|
if (t(this, v))
|
|
1801
1781
|
if (t(this, v).closest("tbody")) {
|
|
@@ -1816,7 +1796,7 @@ const fs = class fs extends ze {
|
|
|
1816
1796
|
} catch {
|
|
1817
1797
|
}
|
|
1818
1798
|
}, "getDisplayText"));
|
|
1819
|
-
d(this,
|
|
1799
|
+
d(this, Ze, /* @__PURE__ */ h(() => {
|
|
1820
1800
|
if (!(!t(this, I) || !t(this, I).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1821
1801
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1822
1802
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
@@ -1829,10 +1809,10 @@ const fs = class fs extends ze {
|
|
|
1829
1809
|
if (parseInt(n.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1830
1810
|
for (var o of r) {
|
|
1831
1811
|
if (o > e) break;
|
|
1832
|
-
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data,
|
|
1812
|
+
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data, g = t(this, I).data.get(c);
|
|
1833
1813
|
t(this, v).dataset.matrixRow;
|
|
1834
|
-
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],
|
|
1835
|
-
if (b !=
|
|
1814
|
+
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], u = f.dataset.expr ? this.getExprValue(f.dataset.expr, g, c) : g[f.dataset.bind];
|
|
1815
|
+
if (b != u) {
|
|
1836
1816
|
i = !0;
|
|
1837
1817
|
break;
|
|
1838
1818
|
}
|
|
@@ -1859,7 +1839,7 @@ const fs = class fs extends ze {
|
|
|
1859
1839
|
}, "getExprValue"));
|
|
1860
1840
|
}
|
|
1861
1841
|
connectedCallback() {
|
|
1862
|
-
super.connectedCallback(), y(this, I, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this,
|
|
1842
|
+
super.connectedCallback(), y(this, I, this.getRootNode().host), y(this, v, this.closest("th,td")), y(this, Ut, t(this, v).closest("tr"));
|
|
1863
1843
|
}
|
|
1864
1844
|
get value() {
|
|
1865
1845
|
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];
|
|
@@ -1878,12 +1858,12 @@ const fs = class fs extends ze {
|
|
|
1878
1858
|
}
|
|
1879
1859
|
refresh() {
|
|
1880
1860
|
const e = t(this, v).dataset.bind;
|
|
1881
|
-
return parseInt(t(this, v).dataset.row), t(this,
|
|
1861
|
+
return parseInt(t(this, v).dataset.row), t(this, Ut).data[e];
|
|
1882
1862
|
}
|
|
1883
1863
|
};
|
|
1884
|
-
I = new WeakMap(),
|
|
1885
|
-
let Pe =
|
|
1886
|
-
const
|
|
1864
|
+
I = new WeakMap(), Ut = new WeakMap(), v = new WeakMap(), Ue = new WeakMap(), Xe = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), h(ds, "CellElement");
|
|
1865
|
+
let Pe = ds;
|
|
1866
|
+
const fs = class fs extends Pe {
|
|
1887
1867
|
constructor() {
|
|
1888
1868
|
super();
|
|
1889
1869
|
}
|
|
@@ -1894,21 +1874,21 @@ const us = class us extends Pe {
|
|
|
1894
1874
|
return super.refresh();
|
|
1895
1875
|
}
|
|
1896
1876
|
};
|
|
1897
|
-
h(
|
|
1898
|
-
let Fe =
|
|
1899
|
-
var
|
|
1900
|
-
const
|
|
1877
|
+
h(fs, "EditableCellElement");
|
|
1878
|
+
let Fe = fs;
|
|
1879
|
+
var Xt, bt, At, Et, Ae, J, Je;
|
|
1880
|
+
const us = class us extends Fe {
|
|
1901
1881
|
constructor() {
|
|
1902
1882
|
super();
|
|
1903
|
-
d(this,
|
|
1883
|
+
d(this, Xt);
|
|
1904
1884
|
d(this, bt);
|
|
1905
1885
|
d(this, At);
|
|
1906
1886
|
d(this, Et);
|
|
1907
1887
|
d(this, Ae);
|
|
1908
|
-
d(this,
|
|
1888
|
+
d(this, J);
|
|
1909
1889
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1910
1890
|
const e = super.refresh();
|
|
1911
|
-
t(this,
|
|
1891
|
+
t(this, Xt).value = e;
|
|
1912
1892
|
}, "refresh"));
|
|
1913
1893
|
/**
|
|
1914
1894
|
dataRefresh = (v) => {
|
|
@@ -1940,22 +1920,22 @@ const gs = class gs extends Fe {
|
|
|
1940
1920
|
if (!v) this.reset();
|
|
1941
1921
|
};
|
|
1942
1922
|
*/
|
|
1943
|
-
d(this,
|
|
1923
|
+
d(this, Je, /* @__PURE__ */ h((e) => {
|
|
1944
1924
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1945
1925
|
if (t(this, bt) == "number") {
|
|
1946
1926
|
let i = [];
|
|
1947
|
-
if (t(this,
|
|
1927
|
+
if (t(this, J) && Number(t(this, J)) > 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, J) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1948
1928
|
var n = e.target.value, r = n.indexOf(".");
|
|
1949
1929
|
if (r >= 0) {
|
|
1950
1930
|
var n = n.substr(r + 1, n.length);
|
|
1951
|
-
n.length >= Number(t(this,
|
|
1931
|
+
n.length >= Number(t(this, J)) && e.preventDefault();
|
|
1952
1932
|
}
|
|
1953
1933
|
}
|
|
1954
1934
|
}
|
|
1955
1935
|
t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1956
1936
|
}
|
|
1957
1937
|
}, "#onKeyDown"));
|
|
1958
|
-
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,
|
|
1938
|
+
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, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1959
1939
|
}
|
|
1960
1940
|
connectedCallback() {
|
|
1961
1941
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1965,11 +1945,11 @@ const gs = class gs extends Fe {
|
|
|
1965
1945
|
${e.join(" ")}
|
|
1966
1946
|
ondragstart="return false;"
|
|
1967
1947
|
>
|
|
1968
|
-
`, super.connectedCallback(), y(this,
|
|
1948
|
+
`, super.connectedCallback(), y(this, Xt, this.querySelector("input"));
|
|
1969
1949
|
}
|
|
1970
1950
|
};
|
|
1971
|
-
|
|
1972
|
-
let je =
|
|
1951
|
+
Xt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ae = new WeakMap(), J = new WeakMap(), Je = new WeakMap(), h(us, "CellInputText");
|
|
1952
|
+
let je = us;
|
|
1973
1953
|
customElements.get("cell-input-text");
|
|
1974
1954
|
customElements.get("cell-input") || customElements.define("cell-input", je);
|
|
1975
1955
|
//# sourceMappingURL=nine-table.js.map
|