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