@ninebone/table 0.0.809 β 0.0.811
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 +397 -397
- 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
|
@@ -4,8 +4,8 @@ var xs = (q) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Rs = (q, s, e) => s in q ? ms(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
6
|
var h = (q, s) => ms(q, "name", { value: s, configurable: !0 });
|
|
7
|
-
var E = (q, s, e) => Rs(q, typeof s != "symbol" ? s + "" : s, e),
|
|
8
|
-
var t = (q, s, e) => (
|
|
7
|
+
var E = (q, s, e) => Rs(q, typeof s != "symbol" ? s + "" : s, e), qe = (q, s, e) => s.has(q) || xs("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (qe(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? xs("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), p = (q, s, e, n) => (qe(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), V = (q, s, e) => (qe(q, s, "access private method"), e);
|
|
9
9
|
var ws = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
11
|
p(q, s, r, e);
|
|
@@ -21,27 +21,27 @@ const es = class es extends As.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
h(es, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const T = new
|
|
26
|
-
var j,
|
|
24
|
+
let Te = es;
|
|
25
|
+
const T = new Te();
|
|
26
|
+
var j, K, A, Q, tt, et, Zt, st, Jt;
|
|
27
27
|
const ss = class ss 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 && (p(this,
|
|
39
|
+
e && (p(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 ss = class ss 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 y = l -
|
|
62
|
-
|
|
59
|
+
let u = 0;
|
|
60
|
+
b > 0 && (u = parseInt(f / b * (l - g), 10)), u < 0 && (u = 0);
|
|
61
|
+
const y = l - g;
|
|
62
|
+
u > y && (u = y), i.style.left = `${u}px`, t(this, A).left.disabled = u === 0, t(this, A).right.disabled = u >= y - 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;
|
|
@@ -73,18 +73,18 @@ const ss = class ss extends HTMLElement {
|
|
|
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), p(this, Q, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Q)), p(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 ss = class ss 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(), p(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(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
|
-
p(this,
|
|
108
|
+
p(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 ss = class ss 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
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
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(ss, "NineTableHScrollBar");
|
|
202
|
+
let Ce = ss;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
|
+
var nt, rt, yt, k, kt, Lt, Qt;
|
|
205
205
|
const ns = class ns extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
+
d(this, nt);
|
|
208
209
|
d(this, rt);
|
|
209
|
-
d(this,
|
|
210
|
-
d(this, mt, !1);
|
|
210
|
+
d(this, yt, !1);
|
|
211
211
|
d(this, k);
|
|
212
|
+
d(this, kt, 0);
|
|
212
213
|
d(this, Lt, 0);
|
|
213
|
-
d(this, It, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this,
|
|
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,43 +221,43 @@ const ns = class ns 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
|
-
let
|
|
228
|
-
b > 0 && (
|
|
229
|
-
const y = l -
|
|
230
|
-
|
|
227
|
+
let u = 0;
|
|
228
|
+
b > 0 && (u = f / b * (l - g));
|
|
229
|
+
const y = l - g;
|
|
230
|
+
u < 0 && (u = 0), u > y && (u = y), r.style.top = `${u}px`, t(this, k).top.disabled = f <= 0, t(this, k).bottom.disabled = f >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
232
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
233
233
|
T.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, k).container, n = /* @__PURE__ */ h(() => {
|
|
235
|
-
const i = (t(this,
|
|
235
|
+
const i = (t(this, nt).data.get() || []).length, o = t(this, rt).getRowHeight();
|
|
236
236
|
return i * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
t(this, k).thumb.addEventListener("mousedown", (r) => {
|
|
239
239
|
if (r.button !== 0) return;
|
|
240
|
-
r.stopPropagation(), r.preventDefault(), p(this,
|
|
240
|
+
r.stopPropagation(), r.preventDefault(), p(this, yt, !0), p(this, kt, r.clientY), p(this, Lt, e.scrollTop);
|
|
241
241
|
const i = /* @__PURE__ */ h((a) => {
|
|
242
|
-
if (!t(this,
|
|
243
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, f = c.height - l, b = a.clientY - t(this,
|
|
242
|
+
if (!t(this, yt)) return;
|
|
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, y = n(), x = Math.max(y - u, 1);
|
|
244
244
|
if (f > 0 && x > 0) {
|
|
245
245
|
const w = b / f * x;
|
|
246
|
-
let m = t(this,
|
|
247
|
-
const C = Math.max(0, y -
|
|
246
|
+
let m = t(this, Lt) + w;
|
|
247
|
+
const C = Math.max(0, y - u);
|
|
248
248
|
m < 0 && (m = 0), m > C && (m = C), e.scrollTop = m;
|
|
249
249
|
}
|
|
250
250
|
this.refresh();
|
|
251
251
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
252
|
-
p(this,
|
|
252
|
+
p(this, yt, !1), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.refresh();
|
|
253
253
|
}, "onMouseUp");
|
|
254
254
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
255
255
|
}), t(this, k).track.addEventListener("mousedown", (r) => {
|
|
256
256
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
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,
|
|
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);
|
|
258
258
|
if (l > 0 && b > 0) {
|
|
259
|
-
const
|
|
260
|
-
e.scrollTop =
|
|
259
|
+
const u = Math.max(0, Math.min(1, a / l));
|
|
260
|
+
e.scrollTop = u * b;
|
|
261
261
|
}
|
|
262
262
|
this.refresh();
|
|
263
263
|
}), t(this, k).top.addEventListener("click", () => {
|
|
@@ -268,7 +268,7 @@ const ns = class ns extends HTMLElement {
|
|
|
268
268
|
}, "#init"));
|
|
269
269
|
}
|
|
270
270
|
connectedCallback() {
|
|
271
|
-
p(this,
|
|
271
|
+
p(this, nt, this.getRootNode().host), p(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
272
272
|
<style>
|
|
273
273
|
nine-table-vscrollbar {
|
|
274
274
|
display: flex;
|
|
@@ -333,7 +333,7 @@ const ns = class ns extends HTMLElement {
|
|
|
333
333
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
334
334
|
`;
|
|
335
335
|
const e = /* @__PURE__ */ h(() => {
|
|
336
|
-
const n = t(this,
|
|
336
|
+
const n = t(this, rt).querySelector(".ng-container-body .ng-part-body");
|
|
337
337
|
if (!n) {
|
|
338
338
|
setTimeout(e, 10);
|
|
339
339
|
return;
|
|
@@ -344,39 +344,39 @@ const ns = class ns extends HTMLElement {
|
|
|
344
344
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
345
345
|
top: this.querySelector(".ng-scroll-top"),
|
|
346
346
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
347
|
-
}), t(this,
|
|
347
|
+
}), t(this, Qt).call(this), this.refresh();
|
|
348
348
|
}, "initWhenReady");
|
|
349
349
|
e();
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
|
|
353
|
-
let
|
|
354
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
355
|
-
var
|
|
352
|
+
nt = new WeakMap(), rt = new WeakMap(), yt = new WeakMap(), k = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Qt = new WeakMap(), h(ns, "NineTableVScrollBar");
|
|
353
|
+
let ke = ns;
|
|
354
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ke);
|
|
355
|
+
var ot, R, it, Y, O, G, at, It, Ye, Ue, te, Xe, ee, se, Mt, Ht, $t, ne, re, Nt, mt, oe, ie;
|
|
356
356
|
const rs = class rs {
|
|
357
357
|
constructor(s) {
|
|
358
|
-
d(this,
|
|
358
|
+
d(this, ot);
|
|
359
359
|
d(this, R);
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, it);
|
|
361
361
|
d(this, Y, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, O, null);
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
363
|
+
d(this, G, null);
|
|
364
|
+
d(this, at, 0);
|
|
365
|
+
d(this, It, 40);
|
|
366
|
+
d(this, Ye, !1);
|
|
366
367
|
d(this, Ue, !1);
|
|
367
|
-
d(this, Xe, !1);
|
|
368
368
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
369
|
-
d(this,
|
|
370
|
-
d(this,
|
|
371
|
-
d(this,
|
|
369
|
+
d(this, te, 3);
|
|
370
|
+
d(this, Xe, 3);
|
|
371
|
+
d(this, ee, 0);
|
|
372
372
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
374
|
T.log("rowManager.refresh");
|
|
375
375
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
-
s && (t(this,
|
|
376
|
+
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());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
-
T.log("rowManager.initialize"), p(this,
|
|
379
|
+
T.log("rowManager.initialize"), p(this, it, {
|
|
380
380
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
382
|
}), p(this, O, null), t(this, Y).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
@@ -391,15 +391,15 @@ const rs = class rs {
|
|
|
391
391
|
});
|
|
392
392
|
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");
|
|
393
393
|
if (s) {
|
|
394
|
-
t(this,
|
|
394
|
+
t(this, Mt).call(this), t(this, Nt).call(this), t(this, Ht).call(this), t(this, mt).call(this, s.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
p(this,
|
|
396
|
+
p(this, ee, s.scrollLeft);
|
|
397
397
|
const a = /* @__PURE__ */ h((c) => {
|
|
398
|
-
var
|
|
398
|
+
var f;
|
|
399
399
|
if (o) return;
|
|
400
400
|
o = !0;
|
|
401
|
-
const l = c.scrollTop,
|
|
402
|
-
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), n && n.scrollTop !== l && (n.scrollTop = l),
|
|
401
|
+
const l = c.scrollTop, g = c.scrollLeft;
|
|
402
|
+
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;
|
|
403
403
|
}, "handleContainerScroll");
|
|
404
404
|
s == null || s.addEventListener("scroll", (c) => {
|
|
405
405
|
a(s);
|
|
@@ -407,13 +407,13 @@ const rs = class rs {
|
|
|
407
407
|
c == null || c.addEventListener("scroll", (l) => {
|
|
408
408
|
if (o) return;
|
|
409
409
|
o = !0;
|
|
410
|
-
const
|
|
411
|
-
s && s.scrollTop !==
|
|
410
|
+
const g = c.scrollTop;
|
|
411
|
+
s && s.scrollTop !== g && (s.scrollTop = g), o = !1;
|
|
412
412
|
});
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
}, "initialize"));
|
|
416
|
-
d(this,
|
|
416
|
+
d(this, se, /* @__PURE__ */ h((s, e) => {
|
|
417
417
|
T.log("rowManager.#renderRows");
|
|
418
418
|
const n = t(this, Y).get(e);
|
|
419
419
|
if (!n || n.length === 0) return;
|
|
@@ -421,13 +421,13 @@ const rs = class rs {
|
|
|
421
421
|
if (!r) return;
|
|
422
422
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
423
423
|
const i = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
424
|
-
for (let a = 0; a < t(this,
|
|
424
|
+
for (let a = 0; a < t(this, It); a++)
|
|
425
425
|
n.forEach((c) => {
|
|
426
426
|
o.appendChild(c.cloneNode(!0));
|
|
427
427
|
});
|
|
428
|
-
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this,
|
|
428
|
+
i ? i.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
429
429
|
}, "#renderRows"));
|
|
430
|
-
d(this,
|
|
430
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
431
431
|
if (t(this, O) !== null && t(this, O) > 0)
|
|
432
432
|
return t(this, O);
|
|
433
433
|
const s = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
@@ -443,20 +443,20 @@ const rs = class rs {
|
|
|
443
443
|
}), r ? r.before(i) : n.appendChild(i);
|
|
444
444
|
const o = t(this, R), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
445
445
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
446
|
-
let
|
|
446
|
+
let g = 0;
|
|
447
447
|
const f = n.querySelectorAll("tr");
|
|
448
448
|
return f.forEach((b) => {
|
|
449
|
-
let
|
|
450
|
-
if (
|
|
449
|
+
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
450
|
+
if (u === 0) {
|
|
451
451
|
const y = window.getComputedStyle(b);
|
|
452
|
-
|
|
452
|
+
u = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
453
453
|
}
|
|
454
|
-
|
|
455
|
-
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l,
|
|
454
|
+
g += u;
|
|
455
|
+
}), f.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, g <= 0 ? -1 : (p(this, O, g), t(this, $t).call(this), t(this, O));
|
|
456
456
|
}, "#measureAndCacheHeight"));
|
|
457
|
-
d(this,
|
|
457
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
458
458
|
T.log("rowManager.#updateVirtualScrollHeight");
|
|
459
|
-
const e = (t(this,
|
|
459
|
+
const e = (t(this, ot).data.get() || []).length, n = t(this, O), r = e * n;
|
|
460
460
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
461
461
|
const o = t(this, R).querySelector(i);
|
|
462
462
|
if (!o) return;
|
|
@@ -464,41 +464,41 @@ const rs = class rs {
|
|
|
464
464
|
a && (a.style.height = `${r}px`);
|
|
465
465
|
});
|
|
466
466
|
}, "#updateVirtualScrollHeight"));
|
|
467
|
-
d(this,
|
|
468
|
-
if (t(this,
|
|
469
|
-
const s = Math.ceil(t(this,
|
|
470
|
-
p(this,
|
|
467
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
468
|
+
if (t(this, at) > 0 && t(this, O) > 0) {
|
|
469
|
+
const s = Math.ceil(t(this, at) / t(this, O));
|
|
470
|
+
p(this, It, s + t(this, te));
|
|
471
471
|
}
|
|
472
472
|
}, "#updateRowCount"));
|
|
473
|
-
d(this,
|
|
474
|
-
var a, c, l,
|
|
473
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
474
|
+
var a, c, l, g, f, b;
|
|
475
475
|
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");
|
|
476
476
|
if (e) {
|
|
477
|
-
const
|
|
477
|
+
const u = s ? Array.from(s.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), x = n ? Array.from(n.querySelectorAll("tbody tr")) : [], w = Math.max(u.length, y.length, x.length);
|
|
478
478
|
for (let m = 0; m < w; m++) {
|
|
479
479
|
const C = [
|
|
480
|
-
((a =
|
|
480
|
+
((a = u[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
481
481
|
((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
482
482
|
((l = x[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
483
483
|
], S = Math.max(...C);
|
|
484
|
-
S > 0 && (
|
|
484
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), y[m] && (y[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
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");
|
|
488
488
|
if (i) {
|
|
489
|
-
const
|
|
489
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(i.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(u.length, y.length, x.length);
|
|
490
490
|
for (let m = 0; m < w; m++) {
|
|
491
491
|
const C = [
|
|
492
|
-
((
|
|
492
|
+
((g = u[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
493
493
|
((f = y[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
494
494
|
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
495
495
|
], S = Math.max(...C);
|
|
496
|
-
S > 0 && (
|
|
496
|
+
S > 0 && (u[m] && (u[m].style.height = `${S}px`), y[m] && (y[m].style.height = `${S}px`), x[m] && (x[m].style.height = `${S}px`));
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}, "#syncRowHeights"));
|
|
500
|
-
d(this,
|
|
501
|
-
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this,
|
|
500
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
501
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this, G, new ResizeObserver((s) => {
|
|
502
502
|
for (const e of s) {
|
|
503
503
|
const n = e.target;
|
|
504
504
|
if (!n.classList.contains("active")) continue;
|
|
@@ -508,30 +508,30 @@ const rs = class rs {
|
|
|
508
508
|
const o = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
509
509
|
o && (i += o.offsetHeight), a && (i += a.offsetHeight);
|
|
510
510
|
const c = Math.max(r - i, 100);
|
|
511
|
-
t(this,
|
|
511
|
+
t(this, at) !== c && (p(this, at, c), t(this, $t).call(this), t(this, O) !== null && (t(this, Nt).call(this), this.refresh()));
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
})), t(this,
|
|
514
|
+
})), t(this, G).observe(t(this, R)));
|
|
515
515
|
}, "#initResizeObserver"));
|
|
516
|
-
d(this,
|
|
516
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
517
517
|
T.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
518
518
|
const e = t(this, R).querySelector(s);
|
|
519
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
520
|
-
}), t(this,
|
|
519
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, se).call(this, e, s);
|
|
520
|
+
}), t(this, ie).call(this), t(this, ne).call(this);
|
|
521
521
|
}, "#renderAllContainers"));
|
|
522
|
-
d(this,
|
|
522
|
+
d(this, mt, /* @__PURE__ */ h((s) => {
|
|
523
523
|
var f, b;
|
|
524
524
|
const e = t(this, O);
|
|
525
525
|
if (!e || e <= 0) return;
|
|
526
|
-
const n = t(this,
|
|
526
|
+
const n = t(this, ot).data.length;
|
|
527
527
|
if (n === 0) return;
|
|
528
528
|
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)));
|
|
529
529
|
let c = Math.floor(a * e);
|
|
530
|
-
const l = t(this,
|
|
531
|
-
(b = t(this,
|
|
532
|
-
|
|
533
|
-
}),
|
|
534
|
-
const y = t(this, R).querySelector(
|
|
530
|
+
const l = t(this, it).firstTr, g = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
531
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((u) => {
|
|
532
|
+
u.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
533
|
+
}), g !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
534
|
+
const y = t(this, R).querySelector(u);
|
|
535
535
|
if (!y) return;
|
|
536
536
|
const x = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
537
537
|
if (!x) return;
|
|
@@ -541,8 +541,8 @@ const rs = class rs {
|
|
|
541
541
|
m.style.display = "none";
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
544
|
-
const M = t(this,
|
|
545
|
-
m.style.display = "", t(this,
|
|
544
|
+
const M = t(this, ot).data.get(S);
|
|
545
|
+
m.style.display = "", t(this, oe).call(this, m, M, S);
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
548
|
}, "#handleScroll"));
|
|
@@ -560,15 +560,15 @@ const rs = class rs {
|
|
|
560
560
|
cell.dataset.row = dataIndex;
|
|
561
561
|
});
|
|
562
562
|
}; */
|
|
563
|
-
d(this,
|
|
563
|
+
d(this, oe, /* @__PURE__ */ h((s, e, n) => {
|
|
564
564
|
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, i) => {
|
|
565
565
|
r.dataset.row = n;
|
|
566
566
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
567
567
|
o && typeof o.refresh == "function" && o.refresh();
|
|
568
568
|
});
|
|
569
569
|
}, "#bindRowData"));
|
|
570
|
-
d(this,
|
|
571
|
-
var c, l,
|
|
570
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
571
|
+
var c, l, g;
|
|
572
572
|
T.log("rowManager.#syncHeaderHeights");
|
|
573
573
|
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");
|
|
574
574
|
if (!e) return;
|
|
@@ -577,15 +577,15 @@ const rs = class rs {
|
|
|
577
577
|
const b = [
|
|
578
578
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
579
579
|
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
580
|
-
((
|
|
581
|
-
],
|
|
582
|
-
|
|
580
|
+
((g = o[f]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
581
|
+
], u = Math.max(...b);
|
|
582
|
+
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`));
|
|
583
583
|
}
|
|
584
584
|
}, "#syncHeaderHeights"));
|
|
585
585
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
586
|
-
t(this,
|
|
586
|
+
t(this, G) && (t(this, G).disconnect(), p(this, G, null));
|
|
587
587
|
}, "destroy"));
|
|
588
|
-
p(this,
|
|
588
|
+
p(this, ot, s.getRootNode().host), p(this, R, s), t(this, re).call(this);
|
|
589
589
|
}
|
|
590
590
|
getRowHeight() {
|
|
591
591
|
return t(this, O);
|
|
@@ -595,14 +595,14 @@ const rs = class rs {
|
|
|
595
595
|
return ((e = t(this, Y).get(s)) == null ? void 0 : e.length) || 1;
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
|
-
|
|
599
|
-
let
|
|
600
|
-
const
|
|
598
|
+
ot = new WeakMap(), R = new WeakMap(), it = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), G = new WeakMap(), at = new WeakMap(), It = new WeakMap(), Ye = new WeakMap(), Ue = new WeakMap(), te = new WeakMap(), Xe = 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(), mt = new WeakMap(), oe = new WeakMap(), ie = new WeakMap(), h(rs, "RowManager");
|
|
599
|
+
let Le = rs;
|
|
600
|
+
const ae = class ae {
|
|
601
601
|
/**
|
|
602
602
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
603
603
|
*/
|
|
604
604
|
static compileAll(s) {
|
|
605
|
-
return Array.isArray(s) ? s.map((e) =>
|
|
605
|
+
return Array.isArray(s) ? s.map((e) => ae.compile(e)) : [];
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
608
608
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -611,23 +611,23 @@ const le = class le {
|
|
|
611
611
|
if (!s) return null;
|
|
612
612
|
const e = /* @__PURE__ */ h((a) => {
|
|
613
613
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
614
|
-
const
|
|
614
|
+
const g = l.getAttribute("cell-type") || "renderer";
|
|
615
615
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
616
|
-
let f = `cell-${
|
|
617
|
-
const b = l.getAttribute("data-bind"),
|
|
616
|
+
let f = `cell-${g}`;
|
|
617
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
618
618
|
let w = [];
|
|
619
|
-
b && w.push(`data-bind="${b}"`),
|
|
619
|
+
b && w.push(`data-bind="${b}"`), u && w.push(`data-expr="${u}"`), y && w.push(`maxbyte="${y}"`), x && w.push(`type="${x}"`), l.innerHTML = `<${f} ${w.join(" ")}></${f}>`;
|
|
620
620
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
621
621
|
l.setAttribute("tabindex", "0");
|
|
622
622
|
});
|
|
623
623
|
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
624
624
|
if (!a.querySelector("colgroup")) {
|
|
625
|
-
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1,
|
|
625
|
+
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);
|
|
626
626
|
for (let b = 0; b < l; b++) {
|
|
627
|
-
const
|
|
628
|
-
|
|
627
|
+
const u = document.createElement("col");
|
|
628
|
+
u.setAttribute("width", f), g.appendChild(u);
|
|
629
629
|
}
|
|
630
|
-
a.prepend(
|
|
630
|
+
a.prepend(g);
|
|
631
631
|
}
|
|
632
632
|
if (!a.querySelector("thead")) {
|
|
633
633
|
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
@@ -635,33 +635,33 @@ const le = class le {
|
|
|
635
635
|
}
|
|
636
636
|
a.classList.add("nine-table-element");
|
|
637
637
|
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
638
|
-
const l = Array.from(a.querySelectorAll(c + " tr")),
|
|
639
|
-
if (f === 0 ||
|
|
638
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), g = Array.from(a.querySelectorAll(c + " th," + c + " td")), f = l.length;
|
|
639
|
+
if (f === 0 || g.length === 0) return;
|
|
640
640
|
let b = 0;
|
|
641
|
-
|
|
641
|
+
g.forEach((y) => {
|
|
642
642
|
b += y.colSpan || 1;
|
|
643
643
|
});
|
|
644
|
-
const
|
|
644
|
+
const u = Array.from(Array(f), () => Array(b).fill(null));
|
|
645
645
|
l.forEach((y) => {
|
|
646
646
|
const x = y.sectionRowIndex;
|
|
647
647
|
let w = 0;
|
|
648
648
|
Array.from(y.querySelectorAll("th,td")).forEach((m) => {
|
|
649
|
-
for (let M = 0; M <
|
|
650
|
-
if (
|
|
649
|
+
for (let M = 0; M < u[x].length; M++)
|
|
650
|
+
if (u[x][M] === null) {
|
|
651
651
|
w = M;
|
|
652
652
|
break;
|
|
653
653
|
}
|
|
654
654
|
const C = m.rowSpan || 1, S = m.colSpan || 1;
|
|
655
655
|
for (let M = 0; M < C; M++)
|
|
656
656
|
for (let W = 0; W < S; W++)
|
|
657
|
-
x + M < f && w + W < b && (
|
|
657
|
+
x + M < f && w + W < b && (u[x + M][w + W] = M === 0 && W === 0 ? "1" : "0");
|
|
658
658
|
});
|
|
659
659
|
}), l.forEach((y) => {
|
|
660
660
|
const x = y.sectionRowIndex;
|
|
661
661
|
Array.from(y.querySelectorAll("th,td")).forEach((w) => {
|
|
662
|
-
for (let m = 0; m <
|
|
663
|
-
if (
|
|
664
|
-
w.dataset.col = m,
|
|
662
|
+
for (let m = 0; m < u[x].length; m++)
|
|
663
|
+
if (u[x][m] === "1") {
|
|
664
|
+
w.dataset.col = m, u[x][m] = "0";
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
667
|
});
|
|
@@ -669,24 +669,24 @@ const le = class le {
|
|
|
669
669
|
}, "resetColIndex"), i = s.cloneNode(!0);
|
|
670
670
|
return n(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
671
671
|
const l = a.getAttribute("fixed");
|
|
672
|
-
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((
|
|
673
|
-
|
|
672
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
673
|
+
g.setAttribute("fixed", l);
|
|
674
674
|
});
|
|
675
675
|
}), i;
|
|
676
676
|
}
|
|
677
677
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
678
678
|
};
|
|
679
|
-
h(
|
|
680
|
-
let
|
|
681
|
-
var N,
|
|
679
|
+
h(ae, "TableCompiler");
|
|
680
|
+
let Ie = ae;
|
|
681
|
+
var N, U, X, qt, vs;
|
|
682
682
|
const os = class os {
|
|
683
683
|
constructor(s) {
|
|
684
|
-
d(this,
|
|
684
|
+
d(this, X);
|
|
685
685
|
d(this, N);
|
|
686
|
-
d(this,
|
|
686
|
+
d(this, U, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
687
687
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
688
|
-
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this,
|
|
689
|
-
T.log("π¨ [CellSelection.render] Rendering range ->", t(this,
|
|
688
|
+
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, U);
|
|
689
|
+
T.log("π¨ [CellSelection.render] Rendering range ->", t(this, U));
|
|
690
690
|
const i = t(this, N).querySelectorAll(
|
|
691
691
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
692
692
|
);
|
|
@@ -701,21 +701,21 @@ const os = class os {
|
|
|
701
701
|
let o = 0;
|
|
702
702
|
i.forEach((a) => {
|
|
703
703
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
704
|
-
const { matrixRow: l } = V(this,
|
|
705
|
-
l < 0 || c.querySelectorAll("td, th").forEach((
|
|
706
|
-
const f = parseInt(
|
|
704
|
+
const { matrixRow: l } = V(this, X, qt).call(this, c);
|
|
705
|
+
l < 0 || c.querySelectorAll("td, th").forEach((g) => {
|
|
706
|
+
const f = parseInt(g.dataset.col, 10);
|
|
707
707
|
if (isNaN(f)) return;
|
|
708
|
-
const b = parseInt(
|
|
709
|
-
y >= s && l <= n && x >= e && f <= r && (o++,
|
|
708
|
+
const b = parseInt(g.rowSpan || 1, 10), u = parseInt(g.colSpan || 1, 10), y = l + b - 1, x = f + u - 1;
|
|
709
|
+
y >= s && l <= n && x >= e && f <= r && (o++, g.classList.add("selected"), T.log(g, s, e, n, r), l <= s && g.classList.add("selected-top"), y >= n && g.classList.add("selected-bottom"), f <= e && g.classList.add("selected-left"), x >= r && g.classList.add("selected-right"));
|
|
710
710
|
});
|
|
711
711
|
});
|
|
712
712
|
}), T.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
713
713
|
}, "render"));
|
|
714
|
-
p(this, N, s), V(this,
|
|
714
|
+
p(this, N, s), V(this, X, vs).call(this), t(this, N).querySelectorAll(
|
|
715
715
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
716
716
|
).forEach((n) => {
|
|
717
717
|
n.addEventListener("scroll", () => {
|
|
718
|
-
t(this,
|
|
718
|
+
t(this, U).startRow >= 0 && t(this, U).startCol >= 0 && this.render();
|
|
719
719
|
});
|
|
720
720
|
}), T.log("π― [CellSelection] Initialized");
|
|
721
721
|
}
|
|
@@ -725,27 +725,27 @@ const os = class os {
|
|
|
725
725
|
const l = t(this, N).querySelectorAll(
|
|
726
726
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
727
727
|
);
|
|
728
|
-
let
|
|
729
|
-
for (;
|
|
730
|
-
|
|
731
|
-
b.querySelectorAll("tbody tr").forEach((
|
|
732
|
-
if (
|
|
733
|
-
const { matrixRow: y } = V(this,
|
|
734
|
-
y < 0 ||
|
|
728
|
+
let g = !0, f = 0;
|
|
729
|
+
for (; g && f < 5; )
|
|
730
|
+
g = !1, f++, l.forEach((b) => {
|
|
731
|
+
b.querySelectorAll("tbody tr").forEach((u) => {
|
|
732
|
+
if (u.classList.contains("nodata")) return;
|
|
733
|
+
const { matrixRow: y } = V(this, X, qt).call(this, u);
|
|
734
|
+
y < 0 || u.querySelectorAll("td, th").forEach((x) => {
|
|
735
735
|
const w = parseInt(x.dataset.col, 10);
|
|
736
736
|
if (isNaN(w)) return;
|
|
737
737
|
const m = parseInt(x.rowSpan || 1, 10), C = parseInt(x.colSpan || 1, 10), S = y + m - 1, M = w + C - 1;
|
|
738
738
|
if (S >= i && y <= o && M >= a && w <= c) {
|
|
739
|
-
const B = Math.min(i, y),
|
|
740
|
-
(B !== i ||
|
|
739
|
+
const B = Math.min(i, y), Kt = Math.max(o, S), ps = Math.min(a, w), ys = Math.max(c, M);
|
|
740
|
+
(B !== i || Kt !== o || ps !== a || ys !== c) && (i = B, o = Kt, a = ps, c = ys, g = !0);
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
});
|
|
745
|
-
p(this,
|
|
745
|
+
p(this, U, { startRow: i, startCol: a, endRow: o, endCol: c }), T.log("π¦ [CellSelection.setRange] Final Range ->", t(this, U)), this.render();
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
|
-
N = new WeakMap(),
|
|
748
|
+
N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
749
749
|
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
750
750
|
const e = parseInt(s.dataset.row, 10);
|
|
751
751
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
@@ -762,7 +762,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), Tt = /* @__PURE__ */ h(
|
|
|
762
762
|
const n = e.target.closest("td, th");
|
|
763
763
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
764
764
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
765
|
-
const r = n.closest("tr"), { matrixRow: i } = V(this,
|
|
765
|
+
const r = n.closest("tr"), { matrixRow: i } = V(this, X, qt).call(this, r), o = parseInt(n.dataset.col, 10);
|
|
766
766
|
if (i < 0) {
|
|
767
767
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
768
768
|
return;
|
|
@@ -771,41 +771,41 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), Tt = /* @__PURE__ */ h(
|
|
|
771
771
|
let a = i, c = o;
|
|
772
772
|
const l = /* @__PURE__ */ h((f) => {
|
|
773
773
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
774
|
-
let
|
|
775
|
-
if (!
|
|
774
|
+
let u = b == null ? void 0 : b.closest("td, th");
|
|
775
|
+
if (!u || !t(this, N).contains(u)) {
|
|
776
776
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
777
777
|
for (const C of m) {
|
|
778
778
|
const S = C.getBoundingClientRect();
|
|
779
779
|
if (f.clientX >= S.left && f.clientX <= S.right && f.clientY >= S.top && f.clientY <= S.bottom) {
|
|
780
|
-
|
|
780
|
+
u = C;
|
|
781
781
|
break;
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
if (!
|
|
786
|
-
const y =
|
|
785
|
+
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
786
|
+
const y = u.closest("tr"), { matrixRow: x } = V(this, X, qt).call(this, y), w = parseInt(u.dataset.col, 10);
|
|
787
787
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
788
|
-
}, "onMouseMove"),
|
|
789
|
-
T.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup",
|
|
788
|
+
}, "onMouseMove"), g = /* @__PURE__ */ h(() => {
|
|
789
|
+
T.log("π±οΈ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", g);
|
|
790
790
|
}, "onMouseUp");
|
|
791
|
-
document.addEventListener("mousemove", l), document.addEventListener("mouseup",
|
|
791
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
792
792
|
});
|
|
793
793
|
}, "#initEvents"), h(os, "CellSelection");
|
|
794
|
-
let
|
|
795
|
-
var F,
|
|
794
|
+
let Me = os;
|
|
795
|
+
var F, lt, le, ce, pt, $e, _t, Ot, Dt, ct, Wt, Ss;
|
|
796
796
|
const is = class is {
|
|
797
797
|
constructor(s) {
|
|
798
|
-
d(this,
|
|
798
|
+
d(this, pt);
|
|
799
799
|
d(this, F);
|
|
800
|
-
d(this,
|
|
800
|
+
d(this, lt, null);
|
|
801
|
+
d(this, le, -1);
|
|
801
802
|
d(this, ce, -1);
|
|
802
|
-
d(this,
|
|
803
|
-
d(this, Ot, /* @__PURE__ */ h((s) => {
|
|
803
|
+
d(this, _t, /* @__PURE__ */ h((s) => {
|
|
804
804
|
const e = [];
|
|
805
805
|
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]);
|
|
806
806
|
}, "#getMaxColCell"));
|
|
807
|
-
d(this,
|
|
808
|
-
const n = t(this,
|
|
807
|
+
d(this, Ot, /* @__PURE__ */ h((s, e) => {
|
|
808
|
+
const n = t(this, ct).call(this, s);
|
|
809
809
|
if (n.length === 0) return e + 1;
|
|
810
810
|
let r = e + 1;
|
|
811
811
|
const i = [];
|
|
@@ -819,8 +819,8 @@ const is = class is {
|
|
|
819
819
|
}
|
|
820
820
|
return r;
|
|
821
821
|
}, "#getNextCol"));
|
|
822
|
-
d(this,
|
|
823
|
-
const n = t(this,
|
|
822
|
+
d(this, Dt, /* @__PURE__ */ h((s, e) => {
|
|
823
|
+
const n = t(this, ct).call(this, s);
|
|
824
824
|
if (n.length === 0) return Math.max(0, e - 1);
|
|
825
825
|
let r = -1;
|
|
826
826
|
const i = [];
|
|
@@ -835,40 +835,40 @@ const is = class is {
|
|
|
835
835
|
return r;
|
|
836
836
|
}, "#getPreviousCol"));
|
|
837
837
|
// π― λ κ±°μμ λ³ν© μ
(rowSpan) λΈλ‘ ν¬μ© νμ λ‘μ§ μ΄μ
|
|
838
|
-
d(this,
|
|
838
|
+
d(this, ct, /* @__PURE__ */ h((s) => {
|
|
839
839
|
const e = t(this, F).querySelectorAll(
|
|
840
840
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
841
841
|
), n = [];
|
|
842
842
|
return e.forEach((r) => {
|
|
843
843
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
844
844
|
for (const o of i) {
|
|
845
|
-
const a = parseInt(o.dataset.row, 10), c = i.filter((y) => parseInt(y.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1,
|
|
845
|
+
const a = parseInt(o.dataset.row, 10), c = i.filter((y) => parseInt(y.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1, g = c.indexOf(o), f = a * l + (g >= 0 ? g : 0);
|
|
846
846
|
if (f === s) {
|
|
847
847
|
n.push(o);
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
850
850
|
const b = Array.from(o.querySelectorAll("td"));
|
|
851
|
-
let
|
|
851
|
+
let u = !1;
|
|
852
852
|
for (const y of b) {
|
|
853
853
|
const x = parseInt(y.rowSpan || 1, 10);
|
|
854
854
|
if (x > 1 && s >= f && s < f + x) {
|
|
855
|
-
n.push(o),
|
|
855
|
+
n.push(o), u = !0;
|
|
856
856
|
break;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
if (
|
|
859
|
+
if (u) break;
|
|
860
860
|
}
|
|
861
861
|
}), n;
|
|
862
862
|
}, "#findTargetTrsByMatrix"));
|
|
863
863
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
864
|
-
d(this,
|
|
864
|
+
d(this, Wt, /* @__PURE__ */ h((s, e, n, r) => {
|
|
865
865
|
const i = t(this, F).querySelectorAll(
|
|
866
866
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
867
867
|
), o = r !== void 0 ? r : s * 1 + e;
|
|
868
868
|
for (const a of i) {
|
|
869
869
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
870
870
|
for (const l of c) {
|
|
871
|
-
const
|
|
871
|
+
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), y = g * b + (u >= 0 ? u : 0), x = Array.from(l.querySelectorAll("td"));
|
|
872
872
|
for (const w of x) {
|
|
873
873
|
const m = parseInt(w.dataset.col, 10), C = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
874
874
|
if (!isNaN(m) && n >= m && n < m + C && o >= y && o < y + S && window.getComputedStyle(w).display !== "none")
|
|
@@ -878,50 +878,50 @@ const is = class is {
|
|
|
878
878
|
}
|
|
879
879
|
return null;
|
|
880
880
|
}, "#getNearElement"));
|
|
881
|
-
p(this, F, s), V(this,
|
|
881
|
+
p(this, F, s), V(this, pt, Ss).call(this), T.log("π― [CellNavigation] Initialized");
|
|
882
882
|
}
|
|
883
883
|
get currentCell() {
|
|
884
|
-
return t(this,
|
|
884
|
+
return t(this, lt);
|
|
885
885
|
}
|
|
886
886
|
set currentCell(s) {
|
|
887
887
|
if (!s) return;
|
|
888
|
-
p(this,
|
|
888
|
+
p(this, lt, s), s.focus({ preventScroll: !0 });
|
|
889
889
|
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
890
890
|
if (!isNaN(e) && !isNaN(n)) {
|
|
891
|
-
p(this,
|
|
891
|
+
p(this, le, e), p(this, ce, n);
|
|
892
892
|
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
893
893
|
if (i) {
|
|
894
|
-
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),
|
|
895
|
-
t(this, F).selection.setRange(
|
|
894
|
+
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);
|
|
895
|
+
t(this, F).selection.setRange(g, n, g, n);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
moveCell(s) {
|
|
900
900
|
var m, C, S, M;
|
|
901
|
-
if (!t(this,
|
|
902
|
-
const e = t(this,
|
|
901
|
+
if (!t(this, lt)) return;
|
|
902
|
+
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");
|
|
903
903
|
if (!o) return;
|
|
904
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1,
|
|
905
|
-
let b = f,
|
|
904
|
+
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);
|
|
905
|
+
let b = f, u = i;
|
|
906
906
|
switch (s.code) {
|
|
907
907
|
case "Tab":
|
|
908
908
|
if (s.preventDefault(), s.shiftKey) {
|
|
909
|
-
if (
|
|
909
|
+
if (u = t(this, Dt).call(this, f, i), u < 0 && f > 0) {
|
|
910
910
|
b = f - 1;
|
|
911
|
-
const W = t(this,
|
|
912
|
-
|
|
911
|
+
const W = t(this, ct).call(this, b), B = t(this, _t).call(this, W);
|
|
912
|
+
u = B ? parseInt(B.dataset.col, 10) : 0;
|
|
913
913
|
}
|
|
914
914
|
} else {
|
|
915
|
-
|
|
916
|
-
const W = t(this,
|
|
917
|
-
|
|
915
|
+
u = t(this, Ot).call(this, f, i);
|
|
916
|
+
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;
|
|
917
|
+
u >= Kt && (b = f + 1, u = 0);
|
|
918
918
|
}
|
|
919
919
|
break;
|
|
920
920
|
case "ArrowRight":
|
|
921
|
-
|
|
921
|
+
u = t(this, Ot).call(this, f, i);
|
|
922
922
|
break;
|
|
923
923
|
case "ArrowLeft":
|
|
924
|
-
|
|
924
|
+
u = t(this, Dt).call(this, f, i);
|
|
925
925
|
break;
|
|
926
926
|
case "ArrowDown":
|
|
927
927
|
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -931,62 +931,62 @@ const is = class is {
|
|
|
931
931
|
break;
|
|
932
932
|
}
|
|
933
933
|
const y = Math.floor(b / l), x = b % l;
|
|
934
|
-
let w = t(this,
|
|
934
|
+
let w = t(this, Wt).call(this, y, x, u, b);
|
|
935
935
|
if (w)
|
|
936
|
-
this.currentCell = w, V(this,
|
|
936
|
+
this.currentCell = w, V(this, pt, $e).call(this, w);
|
|
937
937
|
else if (y !== r && y >= 0) {
|
|
938
938
|
const W = ((C = (m = t(this, F)).getRowHeight) == null ? void 0 : C.call(m)) || 40;
|
|
939
939
|
(M = (S = t(this, F)).scrollToY) == null || M.call(S, y * W), setTimeout(() => {
|
|
940
|
-
const B = t(this,
|
|
941
|
-
B && (this.currentCell = B, V(this,
|
|
940
|
+
const B = t(this, Wt).call(this, y, x, u, b);
|
|
941
|
+
B && (this.currentCell = B, V(this, pt, $e).call(this, B));
|
|
942
942
|
}, 0);
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
};
|
|
946
|
-
F = new WeakMap(),
|
|
947
|
-
|
|
946
|
+
F = new WeakMap(), lt = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), pt = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
947
|
+
$e = /* @__PURE__ */ h(function(s) {
|
|
948
948
|
const e = t(this, F).querySelector(".ng-container-body .ng-part-body");
|
|
949
949
|
if (!e) return;
|
|
950
950
|
const n = s.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
951
951
|
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);
|
|
952
|
-
}, "#ensureCellVisible"),
|
|
952
|
+
}, "#ensureCellVisible"), _t = new WeakMap(), Ot = new WeakMap(), Dt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), Ss = /* @__PURE__ */ h(function() {
|
|
953
953
|
t(this, F).addEventListener("keydown", (s) => {
|
|
954
954
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
955
955
|
});
|
|
956
956
|
}, "#initEvents"), h(is, "CellNavigation");
|
|
957
|
-
let
|
|
958
|
-
var
|
|
959
|
-
const
|
|
957
|
+
let He = is;
|
|
958
|
+
var he, ht, dt, zt, Bt, de, fe, xt, ue, ge;
|
|
959
|
+
const Tt = class Tt extends HTMLElement {
|
|
960
960
|
constructor() {
|
|
961
961
|
super();
|
|
962
|
-
d(this,
|
|
963
|
-
d(this,
|
|
964
|
-
d(this,
|
|
962
|
+
d(this, he);
|
|
963
|
+
d(this, ht, null);
|
|
964
|
+
d(this, dt);
|
|
965
|
+
d(this, zt);
|
|
965
966
|
d(this, Bt);
|
|
966
|
-
d(this, Pt);
|
|
967
967
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
968
|
-
T.log("sheet.invalidate()"), t(this,
|
|
968
|
+
T.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
969
969
|
}, "invalidate"));
|
|
970
970
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
971
971
|
if (T.log("sheet.generate()"), !e) return;
|
|
972
|
-
p(this,
|
|
972
|
+
p(this, ht, Ie.compile(e)), t(this, de).call(this), t(this, fe).call(this);
|
|
973
973
|
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");
|
|
974
|
-
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this,
|
|
974
|
+
n && i && (i.style.top = `${n.offsetHeight}px`), r && i && (i.style.bottom = `${r.offsetHeight}px`), t(this, dt).initialize(), setTimeout(() => {
|
|
975
975
|
var o;
|
|
976
976
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
977
977
|
}, 0);
|
|
978
978
|
}, "generate"));
|
|
979
|
-
d(this,
|
|
979
|
+
d(this, de, /* @__PURE__ */ h(() => {
|
|
980
980
|
[
|
|
981
981
|
{ selector: ".ng-container-body", type: null },
|
|
982
982
|
{ selector: ".ng-container-left", type: "left" },
|
|
983
983
|
{ selector: ".ng-container-right", type: "right" }
|
|
984
984
|
].forEach(({ selector: n, type: r }) => {
|
|
985
985
|
var i, o, a;
|
|
986
|
-
(i = this.querySelector(`${n} .ng-part-header`)) == null || i.appendChild(t(this,
|
|
986
|
+
(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"));
|
|
987
987
|
});
|
|
988
988
|
}, "#renderSplitContainers"));
|
|
989
|
-
d(this,
|
|
989
|
+
d(this, fe, /* @__PURE__ */ h(() => {
|
|
990
990
|
["left", "right", "body"].forEach((e) => {
|
|
991
991
|
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
992
992
|
if (!n || !r || r.length === 0) return;
|
|
@@ -1001,12 +1001,12 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1001
1001
|
}));
|
|
1002
1002
|
});
|
|
1003
1003
|
}, "#updateContainerWidths"));
|
|
1004
|
-
d(this,
|
|
1004
|
+
d(this, xt, /* @__PURE__ */ h((e, n, r) => {
|
|
1005
1005
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1006
1006
|
if (r === "header") {
|
|
1007
1007
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1008
|
+
const g = document.createElement("tbody");
|
|
1009
|
+
g.className = "fixed-tbody", i.appendChild(g);
|
|
1010
1010
|
}
|
|
1011
1011
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1012
1012
|
return n === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -1017,7 +1017,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1017
1017
|
l.remove();
|
|
1018
1018
|
}), i;
|
|
1019
1019
|
}, "#createSplitTable"));
|
|
1020
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
1020
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, dt).getRowHeight(), "getRowHeight"));
|
|
1021
1021
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
1022
1022
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1023
1023
|
n && (n.scrollLeft = e);
|
|
@@ -1026,11 +1026,11 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1026
1026
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
1027
1027
|
n && (n.scrollTop = e);
|
|
1028
1028
|
}, "scrollToY"));
|
|
1029
|
-
d(this,
|
|
1030
|
-
t(this,
|
|
1029
|
+
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1030
|
+
t(this, ge).call(this), p(this, zt, new Me(this)), p(this, Bt, new He(this));
|
|
1031
1031
|
}, "#init"));
|
|
1032
|
-
d(this,
|
|
1033
|
-
const e =
|
|
1032
|
+
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1033
|
+
const e = Tt.SCROLLBAR_SIZE;
|
|
1034
1034
|
this.innerHTML = `
|
|
1035
1035
|
<style>
|
|
1036
1036
|
nine-table-sheet {
|
|
@@ -1231,93 +1231,93 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1231
1231
|
</div>
|
|
1232
1232
|
`;
|
|
1233
1233
|
}, "#render"));
|
|
1234
|
-
p(this,
|
|
1234
|
+
p(this, dt, new Le(this)), p(this, he, this.getRootNode().host);
|
|
1235
1235
|
}
|
|
1236
1236
|
connectedCallback() {
|
|
1237
|
-
t(this,
|
|
1237
|
+
t(this, ue).call(this);
|
|
1238
1238
|
}
|
|
1239
1239
|
get selection() {
|
|
1240
|
-
return t(this,
|
|
1240
|
+
return t(this, zt);
|
|
1241
1241
|
}
|
|
1242
1242
|
get navigation() {
|
|
1243
|
-
return t(this,
|
|
1243
|
+
return t(this, Bt);
|
|
1244
1244
|
}
|
|
1245
1245
|
disconnectedCallback() {
|
|
1246
1246
|
this.innerHTML = "", T.log("NineTableSheet destroyed.");
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
|
-
|
|
1250
|
-
let
|
|
1251
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1252
|
-
var
|
|
1249
|
+
he = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), Bt = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), xt = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), h(Tt, "NineTableSheet"), E(Tt, "SCROLLBAR_SIZE", 16);
|
|
1250
|
+
let Gt = Tt;
|
|
1251
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Gt);
|
|
1252
|
+
var be, Pt;
|
|
1253
1253
|
const as = class as extends HTMLElement {
|
|
1254
1254
|
constructor() {
|
|
1255
1255
|
super();
|
|
1256
|
-
d(this,
|
|
1256
|
+
d(this, be, /* @__PURE__ */ h(() => {
|
|
1257
1257
|
var e;
|
|
1258
1258
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1259
1259
|
var o;
|
|
1260
1260
|
const r = n.ctrlKey || n.metaKey || n.shiftKey, i = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1261
|
-
t(this,
|
|
1262
|
-
}), t(this,
|
|
1261
|
+
t(this, Pt).call(this, i, r);
|
|
1262
|
+
}), t(this, Pt).call(this, 0, !1);
|
|
1263
1263
|
}, "#init"));
|
|
1264
|
-
d(this,
|
|
1264
|
+
d(this, Pt, /* @__PURE__ */ h((e, n = !1) => {
|
|
1265
1265
|
const r = /* @__PURE__ */ h(() => {
|
|
1266
|
-
const
|
|
1267
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1268
|
-
const b =
|
|
1269
|
-
b.length < 2 || b.forEach((
|
|
1270
|
-
const y = parseInt(
|
|
1266
|
+
const g = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1267
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1268
|
+
const b = g.filter((u) => u.classList.contains("active"));
|
|
1269
|
+
b.length < 2 || b.forEach((u) => {
|
|
1270
|
+
const y = parseInt(u.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${y}"]`), w = g[y + 1];
|
|
1271
1271
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1272
1272
|
});
|
|
1273
1273
|
}, "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");
|
|
1274
1274
|
if (!a[e]) return;
|
|
1275
1275
|
if (!n)
|
|
1276
|
-
a.forEach((
|
|
1277
|
-
|
|
1278
|
-
}), c.forEach((
|
|
1276
|
+
a.forEach((g, f) => {
|
|
1277
|
+
g.classList.toggle("active", f === e);
|
|
1278
|
+
}), c.forEach((g, f) => {
|
|
1279
1279
|
const b = f === e;
|
|
1280
|
-
|
|
1280
|
+
g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
|
|
1281
1281
|
});
|
|
1282
1282
|
else {
|
|
1283
|
-
const
|
|
1284
|
-
if (
|
|
1283
|
+
const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1284
|
+
if (g.classList.contains("active") && f.length <= 1)
|
|
1285
1285
|
return;
|
|
1286
|
-
|
|
1286
|
+
g.classList.toggle("active");
|
|
1287
1287
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1288
1288
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1289
1289
|
}
|
|
1290
1290
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1291
|
-
l == null || l.forEach((
|
|
1292
|
-
|
|
1291
|
+
l == null || l.forEach((g) => {
|
|
1292
|
+
g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1293
1293
|
}), r();
|
|
1294
1294
|
}, "#switchSheet"));
|
|
1295
1295
|
}
|
|
1296
1296
|
connectedCallback() {
|
|
1297
|
-
t(this,
|
|
1297
|
+
t(this, be).call(this);
|
|
1298
1298
|
}
|
|
1299
1299
|
};
|
|
1300
|
-
|
|
1301
|
-
let
|
|
1302
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1303
|
-
var _,
|
|
1300
|
+
be = new WeakMap(), Pt = new WeakMap(), h(as, "NineTableSheets");
|
|
1301
|
+
let Ne = as;
|
|
1302
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ne);
|
|
1303
|
+
var _, pe, Ft, ye;
|
|
1304
1304
|
const ls = class ls {
|
|
1305
1305
|
constructor(s) {
|
|
1306
1306
|
d(this, _);
|
|
1307
|
-
d(this,
|
|
1308
|
-
t(this,
|
|
1307
|
+
d(this, pe, /* @__PURE__ */ h(() => {
|
|
1308
|
+
t(this, ye).call(this), new ResizeObserver((s) => {
|
|
1309
1309
|
for (let e of s)
|
|
1310
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
1310
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Ft).call(this);
|
|
1311
1311
|
}).observe(t(this, _));
|
|
1312
1312
|
}, "#init"));
|
|
1313
|
-
d(this,
|
|
1313
|
+
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
1314
1314
|
var c, l;
|
|
1315
1315
|
const s = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1316
1316
|
if (s.length === 0) return;
|
|
1317
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((
|
|
1317
|
+
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;
|
|
1318
1318
|
t(this, _).style.height = `${a}px`;
|
|
1319
1319
|
}, "#applyAutoHeight"));
|
|
1320
|
-
d(this,
|
|
1320
|
+
d(this, ye, /* @__PURE__ */ h(() => {
|
|
1321
1321
|
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) => {
|
|
1322
1322
|
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>` : "";
|
|
1323
1323
|
return f + b;
|
|
@@ -1446,53 +1446,53 @@ const ls = class ls {
|
|
|
1446
1446
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1447
1447
|
a == null || a.forEach((c, l) => {
|
|
1448
1448
|
e[l] && setTimeout(() => {
|
|
1449
|
-
c.generate(e[l]), n && t(this,
|
|
1449
|
+
c.generate(e[l]), n && t(this, Ft).call(this);
|
|
1450
1450
|
});
|
|
1451
1451
|
});
|
|
1452
1452
|
}, "#render"));
|
|
1453
|
-
p(this, _, s), t(this,
|
|
1453
|
+
p(this, _, s), t(this, pe).call(this);
|
|
1454
1454
|
}
|
|
1455
1455
|
};
|
|
1456
|
-
_ = new WeakMap(),
|
|
1457
|
-
let
|
|
1458
|
-
var
|
|
1456
|
+
_ = new WeakMap(), pe = new WeakMap(), Ft = new WeakMap(), ye = new WeakMap(), h(ls, "LayoutManager");
|
|
1457
|
+
let _e = ls;
|
|
1458
|
+
var jt, wt;
|
|
1459
1459
|
const cs = class cs {
|
|
1460
1460
|
constructor(s) {
|
|
1461
|
-
d(this,
|
|
1462
|
-
d(this,
|
|
1463
|
-
E(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1464
|
-
p(this,
|
|
1461
|
+
d(this, jt);
|
|
1462
|
+
d(this, wt, -1);
|
|
1463
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, jt).rawRecords.length, "count"));
|
|
1464
|
+
p(this, jt, s);
|
|
1465
1465
|
}
|
|
1466
1466
|
get at() {
|
|
1467
|
-
return t(this,
|
|
1467
|
+
return t(this, wt);
|
|
1468
1468
|
}
|
|
1469
1469
|
set at(s) {
|
|
1470
|
-
p(this,
|
|
1470
|
+
p(this, wt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, wt)}"]`) && setTimeout(() => {
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
1473
1473
|
};
|
|
1474
|
-
|
|
1475
|
-
let
|
|
1476
|
-
var D, L, z,
|
|
1474
|
+
jt = new WeakMap(), wt = new WeakMap(), h(cs, "ngRow");
|
|
1475
|
+
let Oe = cs;
|
|
1476
|
+
var D, L, z, vt, me, Z, xe, ft, Vt, we, ve, St;
|
|
1477
1477
|
const P = class P {
|
|
1478
1478
|
constructor(s, e) {
|
|
1479
1479
|
d(this, D);
|
|
1480
1480
|
d(this, L);
|
|
1481
1481
|
d(this, z, []);
|
|
1482
|
-
d(this,
|
|
1483
|
-
d(this,
|
|
1484
|
-
d(this,
|
|
1485
|
-
d(this,
|
|
1486
|
-
p(this,
|
|
1482
|
+
d(this, vt, []);
|
|
1483
|
+
d(this, me, 0);
|
|
1484
|
+
d(this, Z, []);
|
|
1485
|
+
d(this, xe, /* @__PURE__ */ h(() => {
|
|
1486
|
+
p(this, Z, []);
|
|
1487
1487
|
const s = t(this, D).template || [];
|
|
1488
1488
|
Array.from(s).forEach((e) => {
|
|
1489
1489
|
var n;
|
|
1490
|
-
t(this,
|
|
1490
|
+
t(this, Z).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1491
1491
|
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1492
|
-
e.__ng || (e.__ng = t(this,
|
|
1492
|
+
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1493
1493
|
});
|
|
1494
1494
|
}, "#initialize"));
|
|
1495
|
-
d(this,
|
|
1495
|
+
d(this, ft, /* @__PURE__ */ h(() => {
|
|
1496
1496
|
const s = t(this, D).shadowRoot.querySelector("nine-table-sheets");
|
|
1497
1497
|
s == null || s.classList.toggle("nodata", this.length === 0), t(this, D).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1498
1498
|
e.invalidate();
|
|
@@ -1502,35 +1502,35 @@ const P = class P {
|
|
|
1502
1502
|
var i;
|
|
1503
1503
|
const n = this.getValidData();
|
|
1504
1504
|
if (!n || n.length <= 0) return;
|
|
1505
|
-
if (s == null) return t(this,
|
|
1505
|
+
if (s == null) return t(this, St).call(this, n);
|
|
1506
1506
|
if (s < 0 || s >= n.length) return null;
|
|
1507
1507
|
const r = typeof ((i = t(this, D).fields) == null ? void 0 : i.get) == "function" ? t(this, D).fields.get() : [];
|
|
1508
1508
|
if (e != null) {
|
|
1509
1509
|
const o = r.indexOf(e);
|
|
1510
1510
|
return o >= 0 ? n[s].v[o] : null;
|
|
1511
1511
|
}
|
|
1512
|
-
return t(this,
|
|
1512
|
+
return t(this, St).call(this, n[s]);
|
|
1513
1513
|
}, "get"));
|
|
1514
1514
|
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1515
|
-
this.clear(), this.add(s, !1), t(this,
|
|
1515
|
+
this.clear(), this.add(s, !1), t(this, ft).call(this);
|
|
1516
1516
|
}, "set"));
|
|
1517
|
-
d(this,
|
|
1517
|
+
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1518
1518
|
rowState: P.ROW_STATE.EMPTY,
|
|
1519
1519
|
deleted: !1,
|
|
1520
1520
|
filtered: !1,
|
|
1521
|
-
height: t(this,
|
|
1521
|
+
height: t(this, Z).slice(),
|
|
1522
1522
|
o: {},
|
|
1523
1523
|
c: {},
|
|
1524
|
-
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1524
|
+
_: [0, 0, 0, 0, P.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1525
1525
|
}), "#getDefaultMeta"));
|
|
1526
1526
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1527
|
-
p(this, z, []), p(this,
|
|
1527
|
+
p(this, z, []), p(this, vt, []), t(this, ft).call(this);
|
|
1528
1528
|
}, "reset"));
|
|
1529
1529
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1530
1530
|
var s;
|
|
1531
|
-
t(this, L).rawRecords = [], p(this, z, []), p(this,
|
|
1531
|
+
t(this, L).rawRecords = [], p(this, z, []), p(this, vt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
|
|
1532
1532
|
}, "clear"));
|
|
1533
|
-
d(this,
|
|
1533
|
+
d(this, we, /* @__PURE__ */ h((s) => {
|
|
1534
1534
|
var r;
|
|
1535
1535
|
Array.isArray(s) || (s = [s]);
|
|
1536
1536
|
const e = typeof ((r = t(this, D).fields) == null ? void 0 : r.get) == "function" ? t(this, D).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
@@ -1541,18 +1541,18 @@ const P = class P {
|
|
|
1541
1541
|
}), n.push(o);
|
|
1542
1542
|
}), n;
|
|
1543
1543
|
}, "#json2Array"));
|
|
1544
|
-
d(this,
|
|
1545
|
-
e.__ng = t(this,
|
|
1544
|
+
d(this, ve, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1545
|
+
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;
|
|
1546
1546
|
}), s), "#defaultInsert"));
|
|
1547
1547
|
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1548
1548
|
s === void 0 && (s = {});
|
|
1549
|
-
const n = t(this,
|
|
1550
|
-
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this,
|
|
1549
|
+
const n = t(this, we).call(this, s);
|
|
1550
|
+
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, ve).call(this, n)), this.resetRecords();
|
|
1551
1551
|
const r = this.count() - 1;
|
|
1552
1552
|
return e || n.forEach((i, o) => {
|
|
1553
1553
|
const a = t(this, L).rawRecords[r - o];
|
|
1554
1554
|
a && (a.__ng.rowState = P.ROW_STATE.EMPTY);
|
|
1555
|
-
}), t(this,
|
|
1555
|
+
}), t(this, ft).call(this), r;
|
|
1556
1556
|
}, "add"));
|
|
1557
1557
|
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1558
1558
|
let e = [];
|
|
@@ -1563,7 +1563,7 @@ const P = class P {
|
|
|
1563
1563
|
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
|
-
}), this.resetRecords(), t(this,
|
|
1566
|
+
}), this.resetRecords(), t(this, ft).call(this);
|
|
1567
1567
|
}, "delete"));
|
|
1568
1568
|
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1569
1569
|
var c;
|
|
@@ -1576,35 +1576,35 @@ const P = class P {
|
|
|
1576
1576
|
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;
|
|
1577
1577
|
}, "setValue"));
|
|
1578
1578
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1579
|
-
p(this,
|
|
1579
|
+
p(this, vt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), p(this, z, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
|
|
1580
1580
|
s.__ng.rowidx = e;
|
|
1581
1581
|
}), t(this, z).forEach((s, e) => {
|
|
1582
1582
|
s.__ng.i = e;
|
|
1583
1583
|
});
|
|
1584
1584
|
}, "resetRecords"));
|
|
1585
1585
|
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1586
|
-
d(this,
|
|
1586
|
+
d(this, St, /* @__PURE__ */ h((s) => {
|
|
1587
1587
|
var o;
|
|
1588
1588
|
if (!s) return s;
|
|
1589
1589
|
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) => {
|
|
1590
1590
|
const c = {};
|
|
1591
|
-
return r.forEach((l,
|
|
1592
|
-
c[l] = a.v ? a.v[
|
|
1591
|
+
return r.forEach((l, g) => {
|
|
1592
|
+
c[l] = a.v ? a.v[g] : a[l];
|
|
1593
1593
|
}), c.__ng = a.__ng, c;
|
|
1594
1594
|
});
|
|
1595
1595
|
return e ? i[0] : i;
|
|
1596
1596
|
}, "#conv"));
|
|
1597
1597
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1598
|
-
p(this, D, s), p(this, L, e), t(this,
|
|
1598
|
+
p(this, D, s), p(this, L, e), t(this, xe).call(this);
|
|
1599
1599
|
}
|
|
1600
1600
|
get source() {
|
|
1601
|
-
return t(this,
|
|
1601
|
+
return t(this, St).call(this, t(this, L).rawRecords);
|
|
1602
1602
|
}
|
|
1603
1603
|
set source(s) {
|
|
1604
1604
|
this.clear(), this.add(s, !1);
|
|
1605
1605
|
}
|
|
1606
1606
|
get nextId() {
|
|
1607
|
-
return ++ws(this,
|
|
1607
|
+
return ++ws(this, me)._;
|
|
1608
1608
|
}
|
|
1609
1609
|
get count() {
|
|
1610
1610
|
return t(this, z).length;
|
|
@@ -1616,7 +1616,7 @@ const P = class P {
|
|
|
1616
1616
|
return this.length;
|
|
1617
1617
|
}
|
|
1618
1618
|
};
|
|
1619
|
-
D = new WeakMap(), L = new WeakMap(), z = new WeakMap(),
|
|
1619
|
+
D = new WeakMap(), L = new WeakMap(), z = new WeakMap(), vt = new WeakMap(), me = new WeakMap(), Z = new WeakMap(), xe = new WeakMap(), ft = new WeakMap(), Vt = new WeakMap(), we = new WeakMap(), ve = new WeakMap(), St = new WeakMap(), h(P, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1620
1620
|
E(P, "ROW_STATE", {
|
|
1621
1621
|
EMPTY: "EMPTY",
|
|
1622
1622
|
NORMAL: "NORMAL",
|
|
@@ -1624,14 +1624,14 @@ E(P, "ROW_STATE", {
|
|
|
1624
1624
|
UPDATE: "UPDATE",
|
|
1625
1625
|
DELETE: "DELETE"
|
|
1626
1626
|
});
|
|
1627
|
-
let
|
|
1628
|
-
var
|
|
1627
|
+
let De = P;
|
|
1628
|
+
var ut;
|
|
1629
1629
|
const hs = class hs {
|
|
1630
1630
|
constructor(s) {
|
|
1631
|
-
d(this,
|
|
1632
|
-
p(this,
|
|
1631
|
+
d(this, ut);
|
|
1632
|
+
p(this, ut, s), this.row = new Oe(this), this.data = new De(t(this, ut), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1633
1633
|
var e;
|
|
1634
|
-
(e = t(this,
|
|
1634
|
+
(e = t(this, ut).view) != null && e.redraw && t(this, ut).view.redraw();
|
|
1635
1635
|
}, this.setDataSource = (e) => {
|
|
1636
1636
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1637
1637
|
}, this.getRowState = (e) => {
|
|
@@ -1646,28 +1646,28 @@ const hs = class hs {
|
|
|
1646
1646
|
}, this.setDataSource([]);
|
|
1647
1647
|
}
|
|
1648
1648
|
};
|
|
1649
|
-
|
|
1650
|
-
let
|
|
1651
|
-
var
|
|
1649
|
+
ut = new WeakMap(), h(hs, "ngDataManager");
|
|
1650
|
+
let We = hs;
|
|
1651
|
+
var Rt, H, Yt, Se;
|
|
1652
1652
|
const ds = class ds {
|
|
1653
1653
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1654
1654
|
constructor(s) {
|
|
1655
|
-
d(this,
|
|
1655
|
+
d(this, Rt);
|
|
1656
1656
|
d(this, H, []);
|
|
1657
1657
|
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1658
1658
|
s.forEach((n) => {
|
|
1659
1659
|
t(this, H).some((r) => r.name === n) || t(this, H).push({ name: n, type: e });
|
|
1660
|
-
}), t(this,
|
|
1660
|
+
}), t(this, Yt).call(this);
|
|
1661
1661
|
}, "add"));
|
|
1662
|
-
d(this,
|
|
1662
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
1663
1663
|
const s = /* @__PURE__ */ new Map();
|
|
1664
1664
|
t(this, H).forEach((e) => {
|
|
1665
1665
|
s.set(e.name, e.type);
|
|
1666
1666
|
}), p(this, H, Array.from(s, ([e, n]) => ({ name: e, type: n }))), p(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);
|
|
1667
1667
|
}, "#adjust"));
|
|
1668
|
-
d(this,
|
|
1669
|
-
p(this, H, []), T.log(t(this,
|
|
1670
|
-
const s = Array.from(t(this,
|
|
1668
|
+
d(this, Se, /* @__PURE__ */ h(() => {
|
|
1669
|
+
p(this, H, []), T.log(t(this, Rt).querySelectorAll("table"));
|
|
1670
|
+
const s = Array.from(t(this, Rt).querySelectorAll("table"));
|
|
1671
1671
|
if (!(!s || s.length === 0)) {
|
|
1672
1672
|
for (const e of s)
|
|
1673
1673
|
T.log(e), $("[data-bind]", e).each((n, r) => {
|
|
@@ -1694,10 +1694,10 @@ const ds = class ds {
|
|
|
1694
1694
|
});
|
|
1695
1695
|
});
|
|
1696
1696
|
});
|
|
1697
|
-
t(this,
|
|
1697
|
+
t(this, Yt).call(this);
|
|
1698
1698
|
}
|
|
1699
1699
|
}, "#init"));
|
|
1700
|
-
p(this,
|
|
1700
|
+
p(this, Rt, s), t(this, Se).call(this);
|
|
1701
1701
|
}
|
|
1702
1702
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1703
1703
|
get() {
|
|
@@ -1719,43 +1719,43 @@ const ds = class ds {
|
|
|
1719
1719
|
return t(this, H).some((e) => e.name === s);
|
|
1720
1720
|
}
|
|
1721
1721
|
};
|
|
1722
|
-
|
|
1723
|
-
let
|
|
1724
|
-
var
|
|
1722
|
+
Rt = new WeakMap(), H = new WeakMap(), Yt = new WeakMap(), Se = new WeakMap(), h(ds, "ngFields");
|
|
1723
|
+
let ze = ds;
|
|
1724
|
+
var gt, Re, Ae;
|
|
1725
1725
|
const fs = class fs extends HTMLElement {
|
|
1726
1726
|
constructor() {
|
|
1727
1727
|
super();
|
|
1728
1728
|
//#created = false;
|
|
1729
|
-
d(this,
|
|
1730
|
-
d(this,
|
|
1731
|
-
d(this,
|
|
1732
|
-
this.fields = new
|
|
1729
|
+
d(this, gt);
|
|
1730
|
+
d(this, Re);
|
|
1731
|
+
d(this, Ae, /* @__PURE__ */ h(() => {
|
|
1732
|
+
this.fields = new ze(this), p(this, Re, new _e(this)), T.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1733
1733
|
}, "#init"));
|
|
1734
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1734
|
+
this.attachShadow({ mode: "open" }), p(this, gt, new We(this));
|
|
1735
1735
|
}
|
|
1736
1736
|
connectedCallback() {
|
|
1737
|
-
t(this,
|
|
1737
|
+
t(this, Ae).call(this);
|
|
1738
1738
|
}
|
|
1739
1739
|
disconnectedCallback() {
|
|
1740
1740
|
T.log("NineTable disconnected.");
|
|
1741
1741
|
}
|
|
1742
1742
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1743
1743
|
get data() {
|
|
1744
|
-
return t(this,
|
|
1744
|
+
return t(this, gt).data;
|
|
1745
1745
|
}
|
|
1746
1746
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1747
1747
|
get row() {
|
|
1748
|
-
return t(this,
|
|
1748
|
+
return t(this, gt).row;
|
|
1749
1749
|
}
|
|
1750
1750
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1751
1751
|
get dataManager() {
|
|
1752
|
-
return t(this,
|
|
1752
|
+
return t(this, gt);
|
|
1753
1753
|
}
|
|
1754
1754
|
};
|
|
1755
|
-
|
|
1756
|
-
let
|
|
1757
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1758
|
-
const
|
|
1755
|
+
gt = new WeakMap(), Re = new WeakMap(), Ae = new WeakMap(), h(fs, "NineTable");
|
|
1756
|
+
let Be = fs;
|
|
1757
|
+
customElements.get("nine-table") || customElements.define("nine-table", Be);
|
|
1758
|
+
const Ct = class Ct extends HTMLElement {
|
|
1759
1759
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1760
1760
|
constructor() {
|
|
1761
1761
|
super();
|
|
@@ -1766,14 +1766,14 @@ const kt = class kt extends HTMLElement {
|
|
|
1766
1766
|
connectedCallback() {
|
|
1767
1767
|
}
|
|
1768
1768
|
};
|
|
1769
|
-
h(
|
|
1770
|
-
let
|
|
1771
|
-
var I,
|
|
1772
|
-
const us = class us extends
|
|
1769
|
+
h(Ct, "BasicCellElement"), E(Ct, "_styleCache", /* @__PURE__ */ new Map()), E(Ct, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1770
|
+
let Pe = Ct;
|
|
1771
|
+
var I, Ut, v, Ke, Ge, Ze, Je, Qe;
|
|
1772
|
+
const us = class us extends Pe {
|
|
1773
1773
|
constructor() {
|
|
1774
1774
|
super();
|
|
1775
1775
|
d(this, I);
|
|
1776
|
-
d(this,
|
|
1776
|
+
d(this, Ut);
|
|
1777
1777
|
d(this, v);
|
|
1778
1778
|
d(this, Ke);
|
|
1779
1779
|
d(this, Ge);
|
|
@@ -1812,10 +1812,10 @@ const us = class us extends Fe {
|
|
|
1812
1812
|
if (parseInt(n.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1813
1813
|
for (var o of r) {
|
|
1814
1814
|
if (o > e) break;
|
|
1815
|
-
var a = parseInt(t(this, v).dataset.row), c = a - 1, l = t(this, v).closest("tr").data,
|
|
1815
|
+
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);
|
|
1816
1816
|
t(this, v).dataset.matrixRow;
|
|
1817
|
-
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],
|
|
1818
|
-
if (b !=
|
|
1817
|
+
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];
|
|
1818
|
+
if (b != u) {
|
|
1819
1819
|
i = !0;
|
|
1820
1820
|
break;
|
|
1821
1821
|
}
|
|
@@ -1842,7 +1842,7 @@ const us = class us extends Fe {
|
|
|
1842
1842
|
}, "getExprValue"));
|
|
1843
1843
|
}
|
|
1844
1844
|
connectedCallback() {
|
|
1845
|
-
super.connectedCallback(), p(this, I, this.getRootNode().host), p(this, v, this.closest("th,td")), p(this,
|
|
1845
|
+
super.connectedCallback(), p(this, I, this.getRootNode().host), p(this, v, this.closest("th,td")), p(this, Ut, t(this, v).closest("tr"));
|
|
1846
1846
|
}
|
|
1847
1847
|
get value() {
|
|
1848
1848
|
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];
|
|
@@ -1861,12 +1861,12 @@ const us = class us extends Fe {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
refresh() {
|
|
1863
1863
|
const e = t(this, v).dataset.bind;
|
|
1864
|
-
return parseInt(t(this, v).dataset.row), t(this,
|
|
1864
|
+
return parseInt(t(this, v).dataset.row), t(this, Ut).data[e];
|
|
1865
1865
|
}
|
|
1866
1866
|
};
|
|
1867
|
-
I = new WeakMap(),
|
|
1868
|
-
let
|
|
1869
|
-
const gs = class gs extends
|
|
1867
|
+
I = new WeakMap(), Ut = new WeakMap(), v = new WeakMap(), Ke = new WeakMap(), Ge = new WeakMap(), Ze = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), h(us, "CellElement");
|
|
1868
|
+
let Fe = us;
|
|
1869
|
+
const gs = class gs extends Fe {
|
|
1870
1870
|
constructor() {
|
|
1871
1871
|
super();
|
|
1872
1872
|
}
|
|
@@ -1878,20 +1878,20 @@ const gs = class gs extends je {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
};
|
|
1880
1880
|
h(gs, "EditableCellElement");
|
|
1881
|
-
let
|
|
1882
|
-
var
|
|
1883
|
-
const bs = class bs extends
|
|
1881
|
+
let je = gs;
|
|
1882
|
+
var Xt, bt, At, Et, Ee, J, ts;
|
|
1883
|
+
const bs = class bs extends je {
|
|
1884
1884
|
constructor() {
|
|
1885
1885
|
super();
|
|
1886
|
-
d(this,
|
|
1887
|
-
d(this,
|
|
1886
|
+
d(this, Xt);
|
|
1887
|
+
d(this, bt);
|
|
1888
|
+
d(this, At);
|
|
1888
1889
|
d(this, Et);
|
|
1889
|
-
d(this,
|
|
1890
|
-
d(this,
|
|
1891
|
-
d(this, Q);
|
|
1890
|
+
d(this, Ee);
|
|
1891
|
+
d(this, J);
|
|
1892
1892
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1893
1893
|
const e = super.refresh();
|
|
1894
|
-
t(this,
|
|
1894
|
+
t(this, Xt).value = e;
|
|
1895
1895
|
}, "refresh"));
|
|
1896
1896
|
/**
|
|
1897
1897
|
dataRefresh = (v) => {
|
|
@@ -1925,20 +1925,20 @@ const bs = class bs extends Ve {
|
|
|
1925
1925
|
*/
|
|
1926
1926
|
d(this, ts, /* @__PURE__ */ h((e) => {
|
|
1927
1927
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1928
|
-
if (t(this,
|
|
1928
|
+
if (t(this, bt) == "number") {
|
|
1929
1929
|
let i = [];
|
|
1930
|
-
if (t(this,
|
|
1930
|
+
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) {
|
|
1931
1931
|
var n = e.target.value, r = n.indexOf(".");
|
|
1932
1932
|
if (r >= 0) {
|
|
1933
1933
|
var n = n.substr(r + 1, n.length);
|
|
1934
|
-
n.length >= Number(t(this,
|
|
1934
|
+
n.length >= Number(t(this, J)) && e.preventDefault();
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
t(this,
|
|
1938
|
+
t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1939
1939
|
}
|
|
1940
1940
|
}, "#onKeyDown"));
|
|
1941
|
-
if (this.applyBaseStyle(), p(this,
|
|
1941
|
+
if (this.applyBaseStyle(), p(this, bt, this.getAttribute("type") || "text"), p(this, At, this.getAttribute("maxbyte")), p(this, Et, this.getAttribute("min")), p(this, Ee, this.getAttribute("max")), p(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, bt))) throw `invalid type : ${t(this, bt)}`;
|
|
1942
1942
|
}
|
|
1943
1943
|
connectedCallback() {
|
|
1944
1944
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1948,11 +1948,11 @@ const bs = class bs extends Ve {
|
|
|
1948
1948
|
${e.join(" ")}
|
|
1949
1949
|
ondragstart="return false;"
|
|
1950
1950
|
>
|
|
1951
|
-
`, super.connectedCallback(), p(this,
|
|
1951
|
+
`, super.connectedCallback(), p(this, Xt, this.querySelector("input"));
|
|
1952
1952
|
}
|
|
1953
1953
|
};
|
|
1954
|
-
|
|
1955
|
-
let
|
|
1954
|
+
Xt = new WeakMap(), bt = new WeakMap(), At = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), J = new WeakMap(), ts = new WeakMap(), h(bs, "CellInputText");
|
|
1955
|
+
let Ve = bs;
|
|
1956
1956
|
customElements.get("cell-input-text");
|
|
1957
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1957
|
+
customElements.get("cell-input") || customElements.define("cell-input", Ve);
|
|
1958
1958
|
//# sourceMappingURL=nine-table.js.map
|