@ninebone/table 0.0.805 β 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 -337
- 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,46 +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,
|
|
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)));
|
|
546
527
|
let c = Math.floor(a * e);
|
|
547
|
-
const l = t(this, it).firstTr,
|
|
548
|
-
(b = t(this, it)) == null || b.scrollTables.forEach((
|
|
549
|
-
|
|
550
|
-
}),
|
|
551
|
-
const p = t(this, R).querySelector(
|
|
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);
|
|
552
533
|
if (!p) return;
|
|
553
534
|
const x = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
554
535
|
if (!x) return;
|
|
@@ -558,8 +539,8 @@ const ns = class ns {
|
|
|
558
539
|
m.style.display = "none";
|
|
559
540
|
return;
|
|
560
541
|
}
|
|
561
|
-
const M = t(this,
|
|
562
|
-
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);
|
|
563
544
|
});
|
|
564
545
|
});
|
|
565
546
|
}, "#handleScroll"));
|
|
@@ -577,7 +558,7 @@ const ns = class ns {
|
|
|
577
558
|
cell.dataset.row = dataIndex;
|
|
578
559
|
});
|
|
579
560
|
}; */
|
|
580
|
-
d(this,
|
|
561
|
+
d(this, re, /* @__PURE__ */ h((s, e, n) => {
|
|
581
562
|
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, i) => {
|
|
582
563
|
r.dataset.row = n;
|
|
583
564
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
@@ -585,7 +566,7 @@ const ns = class ns {
|
|
|
585
566
|
});
|
|
586
567
|
}, "#bindRowData"));
|
|
587
568
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
588
|
-
var c, l,
|
|
569
|
+
var c, l, g;
|
|
589
570
|
q.log("rowManager.#syncHeaderHeights");
|
|
590
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");
|
|
591
572
|
if (!e) return;
|
|
@@ -594,26 +575,26 @@ const ns = class ns {
|
|
|
594
575
|
const b = [
|
|
595
576
|
((c = r[f]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
596
577
|
((l = i[f]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
597
|
-
((
|
|
598
|
-
],
|
|
599
|
-
|
|
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`));
|
|
600
581
|
}
|
|
601
582
|
}, "#syncHeaderHeights"));
|
|
602
583
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
603
|
-
t(this,
|
|
584
|
+
t(this, G) && (t(this, G).disconnect(), y(this, G, null));
|
|
604
585
|
}, "destroy"));
|
|
605
|
-
y(this,
|
|
586
|
+
y(this, ot, s.getRootNode().host), y(this, R, s), t(this, ne).call(this);
|
|
606
587
|
}
|
|
607
588
|
getRowHeight() {
|
|
608
589
|
return t(this, O);
|
|
609
590
|
}
|
|
610
591
|
templateLength(s = ".ng-container-body") {
|
|
611
592
|
var e;
|
|
612
|
-
return ((e = t(this,
|
|
593
|
+
return ((e = t(this, Y).get(s)) == null ? void 0 : e.length) || 1;
|
|
613
594
|
}
|
|
614
595
|
};
|
|
615
|
-
|
|
616
|
-
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;
|
|
617
598
|
const ie = class ie {
|
|
618
599
|
/**
|
|
619
600
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -628,23 +609,23 @@ const ie = class ie {
|
|
|
628
609
|
if (!s) return null;
|
|
629
610
|
const e = /* @__PURE__ */ h((a) => {
|
|
630
611
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
631
|
-
const
|
|
612
|
+
const g = l.getAttribute("cell-type") || "renderer";
|
|
632
613
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
633
|
-
let f = `cell-${
|
|
634
|
-
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");
|
|
635
616
|
let w = [];
|
|
636
|
-
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}>`;
|
|
637
618
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
638
619
|
l.setAttribute("tabindex", "0");
|
|
639
620
|
});
|
|
640
621
|
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
641
622
|
if (!a.querySelector("colgroup")) {
|
|
642
|
-
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);
|
|
643
624
|
for (let b = 0; b < l; b++) {
|
|
644
|
-
const
|
|
645
|
-
|
|
625
|
+
const u = document.createElement("col");
|
|
626
|
+
u.setAttribute("width", f), g.appendChild(u);
|
|
646
627
|
}
|
|
647
|
-
a.prepend(
|
|
628
|
+
a.prepend(g);
|
|
648
629
|
}
|
|
649
630
|
if (!a.querySelector("thead")) {
|
|
650
631
|
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
@@ -652,33 +633,33 @@ const ie = class ie {
|
|
|
652
633
|
}
|
|
653
634
|
a.classList.add("nine-table-element");
|
|
654
635
|
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
655
|
-
const l = Array.from(a.querySelectorAll(c + " tr")),
|
|
656
|
-
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;
|
|
657
638
|
let b = 0;
|
|
658
|
-
|
|
639
|
+
g.forEach((p) => {
|
|
659
640
|
b += p.colSpan || 1;
|
|
660
641
|
});
|
|
661
|
-
const
|
|
642
|
+
const u = Array.from(Array(f), () => Array(b).fill(null));
|
|
662
643
|
l.forEach((p) => {
|
|
663
644
|
const x = p.sectionRowIndex;
|
|
664
645
|
let w = 0;
|
|
665
646
|
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
666
|
-
for (let M = 0; M <
|
|
667
|
-
if (
|
|
647
|
+
for (let M = 0; M < u[x].length; M++)
|
|
648
|
+
if (u[x][M] === null) {
|
|
668
649
|
w = M;
|
|
669
650
|
break;
|
|
670
651
|
}
|
|
671
652
|
const T = m.rowSpan || 1, S = m.colSpan || 1;
|
|
672
653
|
for (let M = 0; M < T; M++)
|
|
673
654
|
for (let W = 0; W < S; W++)
|
|
674
|
-
x + M < f && w + W < b && (
|
|
655
|
+
x + M < f && w + W < b && (u[x + M][w + W] = M === 0 && W === 0 ? "1" : "0");
|
|
675
656
|
});
|
|
676
657
|
}), l.forEach((p) => {
|
|
677
658
|
const x = p.sectionRowIndex;
|
|
678
659
|
Array.from(p.querySelectorAll("th,td")).forEach((w) => {
|
|
679
|
-
for (let m = 0; m <
|
|
680
|
-
if (
|
|
681
|
-
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";
|
|
682
663
|
break;
|
|
683
664
|
}
|
|
684
665
|
});
|
|
@@ -686,8 +667,8 @@ const ie = class ie {
|
|
|
686
667
|
}, "resetColIndex"), i = s.cloneNode(!0);
|
|
687
668
|
return n(i), e(i), r(i, "thead"), r(i, "tbody"), r(i, "tfoot"), Array.from(i.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
688
669
|
const l = a.getAttribute("fixed");
|
|
689
|
-
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((
|
|
690
|
-
|
|
670
|
+
l && i.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((g) => {
|
|
671
|
+
g.setAttribute("fixed", l);
|
|
691
672
|
});
|
|
692
673
|
}), i;
|
|
693
674
|
}
|
|
@@ -695,15 +676,15 @@ const ie = class ie {
|
|
|
695
676
|
};
|
|
696
677
|
h(ie, "TableCompiler");
|
|
697
678
|
let Le = ie;
|
|
698
|
-
var N,
|
|
699
|
-
const
|
|
679
|
+
var N, U, X, qt, xs;
|
|
680
|
+
const ns = class ns {
|
|
700
681
|
constructor(s) {
|
|
701
|
-
d(this,
|
|
682
|
+
d(this, X);
|
|
702
683
|
d(this, N);
|
|
703
|
-
d(this,
|
|
684
|
+
d(this, U, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
704
685
|
E(this, "render", /* @__PURE__ */ h(() => {
|
|
705
|
-
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this,
|
|
706
|
-
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));
|
|
707
688
|
const i = t(this, N).querySelectorAll(
|
|
708
689
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
709
690
|
);
|
|
@@ -718,21 +699,21 @@ const rs = class rs {
|
|
|
718
699
|
let o = 0;
|
|
719
700
|
i.forEach((a) => {
|
|
720
701
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
721
|
-
const { matrixRow: l } =
|
|
722
|
-
l < 0 || c.querySelectorAll("td, th").forEach((
|
|
723
|
-
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);
|
|
724
705
|
if (isNaN(f)) return;
|
|
725
|
-
const b = parseInt(
|
|
726
|
-
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"));
|
|
727
708
|
});
|
|
728
709
|
});
|
|
729
710
|
}), q.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
730
711
|
}, "render"));
|
|
731
|
-
y(this, N, s),
|
|
712
|
+
y(this, N, s), V(this, X, xs).call(this), t(this, N).querySelectorAll(
|
|
732
713
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
733
714
|
).forEach((n) => {
|
|
734
715
|
n.addEventListener("scroll", () => {
|
|
735
|
-
t(this,
|
|
716
|
+
t(this, U).startRow >= 0 && t(this, U).startCol >= 0 && this.render();
|
|
736
717
|
});
|
|
737
718
|
}), q.log("π― [CellSelection] Initialized");
|
|
738
719
|
}
|
|
@@ -742,33 +723,33 @@ const rs = class rs {
|
|
|
742
723
|
const l = t(this, N).querySelectorAll(
|
|
743
724
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
744
725
|
);
|
|
745
|
-
let
|
|
746
|
-
for (;
|
|
747
|
-
|
|
748
|
-
b.querySelectorAll("tbody tr").forEach((
|
|
749
|
-
if (
|
|
750
|
-
const { matrixRow: p } =
|
|
751
|
-
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) => {
|
|
752
733
|
const w = parseInt(x.dataset.col, 10);
|
|
753
734
|
if (isNaN(w)) return;
|
|
754
735
|
const m = parseInt(x.rowSpan || 1, 10), T = parseInt(x.colSpan || 1, 10), S = p + m - 1, M = w + T - 1;
|
|
755
736
|
if (S >= i && p <= o && M >= a && w <= c) {
|
|
756
|
-
const
|
|
757
|
-
(
|
|
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);
|
|
758
739
|
}
|
|
759
740
|
});
|
|
760
741
|
});
|
|
761
742
|
});
|
|
762
|
-
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();
|
|
763
744
|
}
|
|
764
745
|
};
|
|
765
|
-
N = new WeakMap(),
|
|
746
|
+
N = new WeakMap(), U = new WeakMap(), X = new WeakSet(), qt = /* @__PURE__ */ h(function(s) {
|
|
766
747
|
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
748
|
const e = parseInt(s.dataset.row, 10);
|
|
768
749
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
769
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);
|
|
770
751
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
771
|
-
}, "#getMatrixRow"),
|
|
752
|
+
}, "#getMatrixRow"), xs = /* @__PURE__ */ h(function() {
|
|
772
753
|
const s = t(this, N).querySelector(".ng-container-top");
|
|
773
754
|
if (!s) {
|
|
774
755
|
q.log("β [CellSelection] .ng-container-top not found!");
|
|
@@ -779,7 +760,7 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
779
760
|
const n = e.target.closest("td, th");
|
|
780
761
|
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
781
762
|
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
782
|
-
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);
|
|
783
764
|
if (i < 0) {
|
|
784
765
|
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
785
766
|
return;
|
|
@@ -788,40 +769,40 @@ N = new WeakMap(), X = new WeakMap(), K = new WeakSet(), qt = /* @__PURE__ */ h(
|
|
|
788
769
|
let a = i, c = o;
|
|
789
770
|
const l = /* @__PURE__ */ h((f) => {
|
|
790
771
|
const b = document.elementFromPoint(f.clientX, f.clientY);
|
|
791
|
-
let
|
|
792
|
-
if (!
|
|
772
|
+
let u = b == null ? void 0 : b.closest("td, th");
|
|
773
|
+
if (!u || !t(this, N).contains(u)) {
|
|
793
774
|
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
794
775
|
for (const T of m) {
|
|
795
776
|
const S = T.getBoundingClientRect();
|
|
796
777
|
if (f.clientX >= S.left && f.clientX <= S.right && f.clientY >= S.top && f.clientY <= S.bottom) {
|
|
797
|
-
|
|
778
|
+
u = T;
|
|
798
779
|
break;
|
|
799
780
|
}
|
|
800
781
|
}
|
|
801
782
|
}
|
|
802
|
-
if (!
|
|
803
|
-
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);
|
|
804
785
|
x < 0 || a === x && c === w || (a = x, c = w, this.setRange(i, o, x, w));
|
|
805
|
-
}, "onMouseMove"),
|
|
806
|
-
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);
|
|
807
788
|
}, "onMouseUp");
|
|
808
|
-
document.addEventListener("mousemove", l), document.addEventListener("mouseup",
|
|
789
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", g);
|
|
809
790
|
});
|
|
810
|
-
}, "#initEvents"), h(
|
|
811
|
-
let Ie =
|
|
812
|
-
var F, lt, ae, le, pt, He, Ot, Dt,
|
|
813
|
-
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 {
|
|
814
795
|
constructor(s) {
|
|
815
796
|
d(this, pt);
|
|
816
797
|
d(this, F);
|
|
817
798
|
d(this, lt, null);
|
|
818
799
|
d(this, ae, -1);
|
|
819
800
|
d(this, le, -1);
|
|
820
|
-
d(this,
|
|
801
|
+
d(this, _t, /* @__PURE__ */ h((s) => {
|
|
821
802
|
const e = [];
|
|
822
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]);
|
|
823
804
|
}, "#getMaxColCell"));
|
|
824
|
-
d(this,
|
|
805
|
+
d(this, Ot, /* @__PURE__ */ h((s, e) => {
|
|
825
806
|
const n = t(this, ct).call(this, s);
|
|
826
807
|
if (n.length === 0) return e + 1;
|
|
827
808
|
let r = e + 1;
|
|
@@ -836,7 +817,7 @@ const os = class os {
|
|
|
836
817
|
}
|
|
837
818
|
return r;
|
|
838
819
|
}, "#getNextCol"));
|
|
839
|
-
d(this,
|
|
820
|
+
d(this, Dt, /* @__PURE__ */ h((s, e) => {
|
|
840
821
|
const n = t(this, ct).call(this, s);
|
|
841
822
|
if (n.length === 0) return Math.max(0, e - 1);
|
|
842
823
|
let r = -1;
|
|
@@ -859,33 +840,33 @@ const os = class os {
|
|
|
859
840
|
return e.forEach((r) => {
|
|
860
841
|
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)"));
|
|
861
842
|
for (const o of i) {
|
|
862
|
-
const a = parseInt(o.dataset.row, 10), c = i.filter((p) => parseInt(p.dataset.row, 10) === a), l = c.length > 0 ? c.length : 1,
|
|
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);
|
|
863
844
|
if (f === s) {
|
|
864
845
|
n.push(o);
|
|
865
846
|
break;
|
|
866
847
|
}
|
|
867
848
|
const b = Array.from(o.querySelectorAll("td"));
|
|
868
|
-
let
|
|
849
|
+
let u = !1;
|
|
869
850
|
for (const p of b) {
|
|
870
851
|
const x = parseInt(p.rowSpan || 1, 10);
|
|
871
852
|
if (x > 1 && s >= f && s < f + x) {
|
|
872
|
-
n.push(o),
|
|
853
|
+
n.push(o), u = !0;
|
|
873
854
|
break;
|
|
874
855
|
}
|
|
875
856
|
}
|
|
876
|
-
if (
|
|
857
|
+
if (u) break;
|
|
877
858
|
}
|
|
878
859
|
}), n;
|
|
879
860
|
}, "#findTargetTrsByMatrix"));
|
|
880
861
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
881
|
-
d(this,
|
|
862
|
+
d(this, Wt, /* @__PURE__ */ h((s, e, n, r) => {
|
|
882
863
|
const i = t(this, F).querySelectorAll(
|
|
883
864
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
884
865
|
), o = r !== void 0 ? r : s * 1 + e;
|
|
885
866
|
for (const a of i) {
|
|
886
867
|
const c = Array.from(a.querySelectorAll("tbody tr:not(.nodata)"));
|
|
887
868
|
for (const l of c) {
|
|
888
|
-
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"));
|
|
889
870
|
for (const w of x) {
|
|
890
871
|
const m = parseInt(w.dataset.col, 10), T = parseInt(w.colSpan || 1, 10), S = parseInt(w.rowSpan || 1, 10);
|
|
891
872
|
if (!isNaN(m) && n >= m && n < m + T && o >= p && o < p + S && window.getComputedStyle(w).display !== "none")
|
|
@@ -895,7 +876,7 @@ const os = class os {
|
|
|
895
876
|
}
|
|
896
877
|
return null;
|
|
897
878
|
}, "#getNearElement"));
|
|
898
|
-
y(this, F, s),
|
|
879
|
+
y(this, F, s), V(this, pt, ws).call(this), q.log("π― [CellNavigation] Initialized");
|
|
899
880
|
}
|
|
900
881
|
get currentCell() {
|
|
901
882
|
return t(this, lt);
|
|
@@ -908,8 +889,8 @@ const os = class os {
|
|
|
908
889
|
y(this, ae, e), y(this, le, n);
|
|
909
890
|
const r = s.closest("tr"), i = r == null ? void 0 : r.closest("tbody");
|
|
910
891
|
if (i) {
|
|
911
|
-
const a = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((f) => parseInt(f.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r),
|
|
912
|
-
t(this, F).selection.setRange(
|
|
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);
|
|
913
894
|
}
|
|
914
895
|
}
|
|
915
896
|
}
|
|
@@ -918,27 +899,27 @@ const os = class os {
|
|
|
918
899
|
if (!t(this, lt)) return;
|
|
919
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");
|
|
920
901
|
if (!o) return;
|
|
921
|
-
const c = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((W) => parseInt(W.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1,
|
|
922
|
-
let b = f,
|
|
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;
|
|
923
904
|
switch (s.code) {
|
|
924
905
|
case "Tab":
|
|
925
906
|
if (s.preventDefault(), s.shiftKey) {
|
|
926
|
-
if (
|
|
907
|
+
if (u = t(this, Dt).call(this, f, i), u < 0 && f > 0) {
|
|
927
908
|
b = f - 1;
|
|
928
|
-
const W = t(this, ct).call(this, b),
|
|
929
|
-
|
|
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;
|
|
930
911
|
}
|
|
931
912
|
} else {
|
|
932
|
-
|
|
933
|
-
const W = t(this, ct).call(this, f),
|
|
934
|
-
|
|
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);
|
|
935
916
|
}
|
|
936
917
|
break;
|
|
937
918
|
case "ArrowRight":
|
|
938
|
-
|
|
919
|
+
u = t(this, Ot).call(this, f, i);
|
|
939
920
|
break;
|
|
940
921
|
case "ArrowLeft":
|
|
941
|
-
|
|
922
|
+
u = t(this, Dt).call(this, f, i);
|
|
942
923
|
break;
|
|
943
924
|
case "ArrowDown":
|
|
944
925
|
s.preventDefault(), b = f + (e.rowSpan || 1);
|
|
@@ -948,14 +929,14 @@ const os = class os {
|
|
|
948
929
|
break;
|
|
949
930
|
}
|
|
950
931
|
const p = Math.floor(b / l), x = b % l;
|
|
951
|
-
let w = t(this,
|
|
932
|
+
let w = t(this, Wt).call(this, p, x, u, b);
|
|
952
933
|
if (w)
|
|
953
|
-
this.currentCell = w,
|
|
934
|
+
this.currentCell = w, V(this, pt, He).call(this, w);
|
|
954
935
|
else if (p !== r && p >= 0) {
|
|
955
936
|
const W = ((T = (m = t(this, F)).getRowHeight) == null ? void 0 : T.call(m)) || 40;
|
|
956
937
|
(M = (S = t(this, F)).scrollToY) == null || M.call(S, p * W), setTimeout(() => {
|
|
957
|
-
const
|
|
958
|
-
|
|
938
|
+
const B = t(this, Wt).call(this, p, x, u, b);
|
|
939
|
+
B && (this.currentCell = B, V(this, pt, He).call(this, B));
|
|
959
940
|
}, 0);
|
|
960
941
|
}
|
|
961
942
|
}
|
|
@@ -966,13 +947,13 @@ He = /* @__PURE__ */ h(function(s) {
|
|
|
966
947
|
if (!e) return;
|
|
967
948
|
const n = s.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
968
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);
|
|
969
|
-
}, "#ensureCellVisible"),
|
|
950
|
+
}, "#ensureCellVisible"), _t = new WeakMap(), Ot = new WeakMap(), Dt = new WeakMap(), ct = new WeakMap(), Wt = new WeakMap(), ws = /* @__PURE__ */ h(function() {
|
|
970
951
|
t(this, F).addEventListener("keydown", (s) => {
|
|
971
952
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
972
953
|
});
|
|
973
|
-
}, "#initEvents"), h(
|
|
974
|
-
let Me =
|
|
975
|
-
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;
|
|
976
957
|
const Ct = class Ct extends HTMLElement {
|
|
977
958
|
constructor() {
|
|
978
959
|
super();
|
|
@@ -980,7 +961,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
980
961
|
d(this, ht, null);
|
|
981
962
|
d(this, dt);
|
|
982
963
|
d(this, zt);
|
|
983
|
-
d(this,
|
|
964
|
+
d(this, Bt);
|
|
984
965
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
985
966
|
q.log("sheet.invalidate()"), t(this, dt).refresh();
|
|
986
967
|
}, "invalidate"));
|
|
@@ -1022,8 +1003,8 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1022
1003
|
const i = e.cloneNode(!0), o = i.querySelector("thead"), a = i.querySelector("tbody"), c = i.querySelector("tfoot");
|
|
1023
1004
|
if (r === "header") {
|
|
1024
1005
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1006
|
+
const g = document.createElement("tbody");
|
|
1007
|
+
g.className = "fixed-tbody", i.appendChild(g);
|
|
1027
1008
|
}
|
|
1028
1009
|
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
1029
1010
|
return n === "left" ? i.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -1044,7 +1025,7 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1044
1025
|
n && (n.scrollTop = e);
|
|
1045
1026
|
}, "scrollToY"));
|
|
1046
1027
|
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1047
|
-
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));
|
|
1048
1029
|
}, "#init"));
|
|
1049
1030
|
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1050
1031
|
const e = Ct.SCROLLBAR_SIZE;
|
|
@@ -1257,17 +1238,17 @@ const Ct = class Ct extends HTMLElement {
|
|
|
1257
1238
|
return t(this, zt);
|
|
1258
1239
|
}
|
|
1259
1240
|
get navigation() {
|
|
1260
|
-
return t(this,
|
|
1241
|
+
return t(this, Bt);
|
|
1261
1242
|
}
|
|
1262
1243
|
disconnectedCallback() {
|
|
1263
1244
|
this.innerHTML = "", q.log("NineTableSheet destroyed.");
|
|
1264
1245
|
}
|
|
1265
1246
|
};
|
|
1266
|
-
ce = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(),
|
|
1267
|
-
let
|
|
1268
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1269
|
-
var ge,
|
|
1270
|
-
const
|
|
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 {
|
|
1271
1252
|
constructor() {
|
|
1272
1253
|
super();
|
|
1273
1254
|
d(this, ge, /* @__PURE__ */ h(() => {
|
|
@@ -1275,38 +1256,38 @@ const is = class is extends HTMLElement {
|
|
|
1275
1256
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1276
1257
|
var o;
|
|
1277
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);
|
|
1278
|
-
t(this,
|
|
1279
|
-
}), t(this,
|
|
1259
|
+
t(this, Pt).call(this, i, r);
|
|
1260
|
+
}), t(this, Pt).call(this, 0, !1);
|
|
1280
1261
|
}, "#init"));
|
|
1281
|
-
d(this,
|
|
1262
|
+
d(this, Pt, /* @__PURE__ */ h((e, n = !1) => {
|
|
1282
1263
|
const r = /* @__PURE__ */ h(() => {
|
|
1283
|
-
const
|
|
1284
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
1285
|
-
const b =
|
|
1286
|
-
b.length < 2 || b.forEach((
|
|
1287
|
-
const p = parseInt(
|
|
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];
|
|
1288
1269
|
x && w && w.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
1289
1270
|
});
|
|
1290
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");
|
|
1291
1272
|
if (!a[e]) return;
|
|
1292
1273
|
if (!n)
|
|
1293
|
-
a.forEach((
|
|
1294
|
-
|
|
1295
|
-
}), c.forEach((
|
|
1274
|
+
a.forEach((g, f) => {
|
|
1275
|
+
g.classList.toggle("active", f === e);
|
|
1276
|
+
}), c.forEach((g, f) => {
|
|
1296
1277
|
const b = f === e;
|
|
1297
|
-
|
|
1278
|
+
g.classList.toggle("active", b), g.style.flex = b ? "1 1 100%" : "";
|
|
1298
1279
|
});
|
|
1299
1280
|
else {
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1281
|
+
const g = a[e], f = i.querySelectorAll(".nine-tab-item.active");
|
|
1282
|
+
if (g.classList.contains("active") && f.length <= 1)
|
|
1302
1283
|
return;
|
|
1303
|
-
|
|
1284
|
+
g.classList.toggle("active");
|
|
1304
1285
|
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
1305
1286
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
1306
1287
|
}
|
|
1307
1288
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1308
|
-
l == null || l.forEach((
|
|
1309
|
-
|
|
1289
|
+
l == null || l.forEach((g) => {
|
|
1290
|
+
g.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1310
1291
|
}), r();
|
|
1311
1292
|
}, "#switchSheet"));
|
|
1312
1293
|
}
|
|
@@ -1314,24 +1295,24 @@ const is = class is extends HTMLElement {
|
|
|
1314
1295
|
t(this, ge).call(this);
|
|
1315
1296
|
}
|
|
1316
1297
|
};
|
|
1317
|
-
ge = new WeakMap(),
|
|
1318
|
-
let $e =
|
|
1298
|
+
ge = new WeakMap(), Pt = new WeakMap(), h(os, "NineTableSheets");
|
|
1299
|
+
let $e = os;
|
|
1319
1300
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", $e);
|
|
1320
|
-
var _, be,
|
|
1321
|
-
const
|
|
1301
|
+
var _, be, Ft, pe;
|
|
1302
|
+
const is = class is {
|
|
1322
1303
|
constructor(s) {
|
|
1323
1304
|
d(this, _);
|
|
1324
1305
|
d(this, be, /* @__PURE__ */ h(() => {
|
|
1325
1306
|
t(this, pe).call(this), new ResizeObserver((s) => {
|
|
1326
1307
|
for (let e of s)
|
|
1327
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
1308
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Ft).call(this);
|
|
1328
1309
|
}).observe(t(this, _));
|
|
1329
1310
|
}, "#init"));
|
|
1330
|
-
d(this,
|
|
1311
|
+
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
1331
1312
|
var c, l;
|
|
1332
1313
|
const s = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1333
1314
|
if (s.length === 0) return;
|
|
1334
|
-
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;
|
|
1335
1316
|
t(this, _).style.height = `${a}px`;
|
|
1336
1317
|
}, "#applyAutoHeight"));
|
|
1337
1318
|
d(this, pe, /* @__PURE__ */ h(() => {
|
|
@@ -1463,22 +1444,22 @@ const as = class as {
|
|
|
1463
1444
|
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1464
1445
|
a == null || a.forEach((c, l) => {
|
|
1465
1446
|
e[l] && setTimeout(() => {
|
|
1466
|
-
c.generate(e[l]), n && t(this,
|
|
1447
|
+
c.generate(e[l]), n && t(this, Ft).call(this);
|
|
1467
1448
|
});
|
|
1468
1449
|
});
|
|
1469
1450
|
}, "#render"));
|
|
1470
1451
|
y(this, _, s), t(this, be).call(this);
|
|
1471
1452
|
}
|
|
1472
1453
|
};
|
|
1473
|
-
_ = new WeakMap(), be = new WeakMap(),
|
|
1474
|
-
let Ne =
|
|
1475
|
-
var
|
|
1476
|
-
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 {
|
|
1477
1458
|
constructor(s) {
|
|
1478
|
-
d(this,
|
|
1459
|
+
d(this, jt);
|
|
1479
1460
|
d(this, wt, -1);
|
|
1480
|
-
E(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1481
|
-
y(this,
|
|
1461
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, jt).rawRecords.length, "count"));
|
|
1462
|
+
y(this, jt, s);
|
|
1482
1463
|
}
|
|
1483
1464
|
get at() {
|
|
1484
1465
|
return t(this, wt);
|
|
@@ -1488,25 +1469,25 @@ const ls = class ls {
|
|
|
1488
1469
|
});
|
|
1489
1470
|
}
|
|
1490
1471
|
};
|
|
1491
|
-
|
|
1492
|
-
let _e =
|
|
1493
|
-
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;
|
|
1494
1475
|
const P = class P {
|
|
1495
1476
|
constructor(s, e) {
|
|
1496
1477
|
d(this, D);
|
|
1497
1478
|
d(this, L);
|
|
1498
|
-
d(this,
|
|
1479
|
+
d(this, z, []);
|
|
1499
1480
|
d(this, vt, []);
|
|
1500
1481
|
d(this, ye, 0);
|
|
1501
|
-
d(this,
|
|
1482
|
+
d(this, Z, []);
|
|
1502
1483
|
d(this, me, /* @__PURE__ */ h(() => {
|
|
1503
|
-
y(this,
|
|
1484
|
+
y(this, Z, []);
|
|
1504
1485
|
const s = t(this, D).template || [];
|
|
1505
1486
|
Array.from(s).forEach((e) => {
|
|
1506
1487
|
var n;
|
|
1507
|
-
t(this,
|
|
1488
|
+
t(this, Z).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1508
1489
|
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1509
|
-
e.__ng || (e.__ng = t(this,
|
|
1490
|
+
e.__ng || (e.__ng = t(this, Vt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1510
1491
|
});
|
|
1511
1492
|
}, "#initialize"));
|
|
1512
1493
|
d(this, ft, /* @__PURE__ */ h(() => {
|
|
@@ -1531,21 +1512,21 @@ const P = class P {
|
|
|
1531
1512
|
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1532
1513
|
this.clear(), this.add(s, !1), t(this, ft).call(this);
|
|
1533
1514
|
}, "set"));
|
|
1534
|
-
d(this,
|
|
1515
|
+
d(this, Vt, /* @__PURE__ */ h(() => ({
|
|
1535
1516
|
rowState: P.ROW_STATE.EMPTY,
|
|
1536
1517
|
deleted: !1,
|
|
1537
1518
|
filtered: !1,
|
|
1538
|
-
height: t(this,
|
|
1519
|
+
height: t(this, Z).slice(),
|
|
1539
1520
|
o: {},
|
|
1540
1521
|
c: {},
|
|
1541
|
-
_: [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, {}, {}]
|
|
1542
1523
|
}), "#getDefaultMeta"));
|
|
1543
1524
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1544
|
-
y(this,
|
|
1525
|
+
y(this, z, []), y(this, vt, []), t(this, ft).call(this);
|
|
1545
1526
|
}, "reset"));
|
|
1546
1527
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1547
1528
|
var s;
|
|
1548
|
-
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();
|
|
1549
1530
|
}, "clear"));
|
|
1550
1531
|
d(this, xe, /* @__PURE__ */ h((s) => {
|
|
1551
1532
|
var r;
|
|
@@ -1559,7 +1540,7 @@ const P = class P {
|
|
|
1559
1540
|
}), n;
|
|
1560
1541
|
}, "#json2Array"));
|
|
1561
1542
|
d(this, we, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1562
|
-
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;
|
|
1563
1544
|
}), s), "#defaultInsert"));
|
|
1564
1545
|
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1565
1546
|
s === void 0 && (s = {});
|
|
@@ -1574,9 +1555,9 @@ const P = class P {
|
|
|
1574
1555
|
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1575
1556
|
let e = [];
|
|
1576
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) => {
|
|
1577
|
-
if (t(this,
|
|
1578
|
-
const r = t(this,
|
|
1579
|
-
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) => {
|
|
1580
1561
|
i.__ng.rowid === r && (i.__ng.deleted = !0, i.__ng.rowState = P.ROW_STATE.DELETE);
|
|
1581
1562
|
});
|
|
1582
1563
|
}
|
|
@@ -1593,20 +1574,20 @@ const P = class P {
|
|
|
1593
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;
|
|
1594
1575
|
}, "setValue"));
|
|
1595
1576
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1596
|
-
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) => {
|
|
1597
1578
|
s.__ng.rowidx = e;
|
|
1598
|
-
}), t(this,
|
|
1579
|
+
}), t(this, z).forEach((s, e) => {
|
|
1599
1580
|
s.__ng.i = e;
|
|
1600
1581
|
});
|
|
1601
1582
|
}, "resetRecords"));
|
|
1602
|
-
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"));
|
|
1603
1584
|
d(this, St, /* @__PURE__ */ h((s) => {
|
|
1604
1585
|
var o;
|
|
1605
1586
|
if (!s) return s;
|
|
1606
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) => {
|
|
1607
1588
|
const c = {};
|
|
1608
|
-
return r.forEach((l,
|
|
1609
|
-
c[l] = a.v ? a.v[
|
|
1589
|
+
return r.forEach((l, g) => {
|
|
1590
|
+
c[l] = a.v ? a.v[g] : a[l];
|
|
1610
1591
|
}), c.__ng = a.__ng, c;
|
|
1611
1592
|
});
|
|
1612
1593
|
return e ? i[0] : i;
|
|
@@ -1621,19 +1602,19 @@ const P = class P {
|
|
|
1621
1602
|
this.clear(), this.add(s, !1);
|
|
1622
1603
|
}
|
|
1623
1604
|
get nextId() {
|
|
1624
|
-
return ++
|
|
1605
|
+
return ++ms(this, ye)._;
|
|
1625
1606
|
}
|
|
1626
1607
|
get count() {
|
|
1627
|
-
return t(this,
|
|
1608
|
+
return t(this, z).length;
|
|
1628
1609
|
}
|
|
1629
1610
|
get length() {
|
|
1630
|
-
return t(this,
|
|
1611
|
+
return t(this, z).length;
|
|
1631
1612
|
}
|
|
1632
1613
|
getRowCount() {
|
|
1633
1614
|
return this.length;
|
|
1634
1615
|
}
|
|
1635
1616
|
};
|
|
1636
|
-
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"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1637
1618
|
E(P, "ROW_STATE", {
|
|
1638
1619
|
EMPTY: "EMPTY",
|
|
1639
1620
|
NORMAL: "NORMAL",
|
|
@@ -1643,7 +1624,7 @@ E(P, "ROW_STATE", {
|
|
|
1643
1624
|
});
|
|
1644
1625
|
let Oe = P;
|
|
1645
1626
|
var ut;
|
|
1646
|
-
const
|
|
1627
|
+
const ls = class ls {
|
|
1647
1628
|
constructor(s) {
|
|
1648
1629
|
d(this, ut);
|
|
1649
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 = () => {
|
|
@@ -1663,10 +1644,10 @@ const cs = class cs {
|
|
|
1663
1644
|
}, this.setDataSource([]);
|
|
1664
1645
|
}
|
|
1665
1646
|
};
|
|
1666
|
-
ut = new WeakMap(), h(
|
|
1667
|
-
let De =
|
|
1668
|
-
var Rt, H,
|
|
1669
|
-
const
|
|
1647
|
+
ut = new WeakMap(), h(ls, "ngDataManager");
|
|
1648
|
+
let De = ls;
|
|
1649
|
+
var Rt, H, Yt, ve;
|
|
1650
|
+
const cs = class cs {
|
|
1670
1651
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1671
1652
|
constructor(s) {
|
|
1672
1653
|
d(this, Rt);
|
|
@@ -1674,9 +1655,9 @@ const hs = class hs {
|
|
|
1674
1655
|
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1675
1656
|
s.forEach((n) => {
|
|
1676
1657
|
t(this, H).some((r) => r.name === n) || t(this, H).push({ name: n, type: e });
|
|
1677
|
-
}), t(this,
|
|
1658
|
+
}), t(this, Yt).call(this);
|
|
1678
1659
|
}, "add"));
|
|
1679
|
-
d(this,
|
|
1660
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
1680
1661
|
const s = /* @__PURE__ */ new Map();
|
|
1681
1662
|
t(this, H).forEach((e) => {
|
|
1682
1663
|
s.set(e.name, e.type);
|
|
@@ -1711,7 +1692,7 @@ const hs = class hs {
|
|
|
1711
1692
|
});
|
|
1712
1693
|
});
|
|
1713
1694
|
});
|
|
1714
|
-
t(this,
|
|
1695
|
+
t(this, Yt).call(this);
|
|
1715
1696
|
}
|
|
1716
1697
|
}, "#init"));
|
|
1717
1698
|
y(this, Rt, s), t(this, ve).call(this);
|
|
@@ -1736,10 +1717,10 @@ const hs = class hs {
|
|
|
1736
1717
|
return t(this, H).some((e) => e.name === s);
|
|
1737
1718
|
}
|
|
1738
1719
|
};
|
|
1739
|
-
Rt = new WeakMap(), H = new WeakMap(),
|
|
1740
|
-
let We =
|
|
1720
|
+
Rt = new WeakMap(), H = new WeakMap(), Yt = new WeakMap(), ve = new WeakMap(), h(cs, "ngFields");
|
|
1721
|
+
let We = cs;
|
|
1741
1722
|
var gt, Se, Re;
|
|
1742
|
-
const
|
|
1723
|
+
const hs = class hs extends HTMLElement {
|
|
1743
1724
|
constructor() {
|
|
1744
1725
|
super();
|
|
1745
1726
|
//#created = false;
|
|
@@ -1769,9 +1750,9 @@ const ds = class ds extends HTMLElement {
|
|
|
1769
1750
|
return t(this, gt);
|
|
1770
1751
|
}
|
|
1771
1752
|
};
|
|
1772
|
-
gt = new WeakMap(), Se = new WeakMap(), Re = new WeakMap(), h(
|
|
1773
|
-
let
|
|
1774
|
-
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);
|
|
1775
1756
|
const Tt = class Tt extends HTMLElement {
|
|
1776
1757
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1777
1758
|
constructor() {
|
|
@@ -1784,18 +1765,18 @@ const Tt = class Tt extends HTMLElement {
|
|
|
1784
1765
|
}
|
|
1785
1766
|
};
|
|
1786
1767
|
h(Tt, "BasicCellElement"), E(Tt, "_styleCache", /* @__PURE__ */ new Map()), E(Tt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1787
|
-
let
|
|
1788
|
-
var I,
|
|
1789
|
-
const
|
|
1768
|
+
let Be = Tt;
|
|
1769
|
+
var I, Ut, v, Ue, Xe, Ke, Ge, Ze;
|
|
1770
|
+
const ds = class ds extends Be {
|
|
1790
1771
|
constructor() {
|
|
1791
1772
|
super();
|
|
1792
1773
|
d(this, I);
|
|
1793
|
-
d(this,
|
|
1774
|
+
d(this, Ut);
|
|
1794
1775
|
d(this, v);
|
|
1776
|
+
d(this, Ue);
|
|
1795
1777
|
d(this, Xe);
|
|
1796
1778
|
d(this, Ke);
|
|
1797
1779
|
d(this, Ge);
|
|
1798
|
-
d(this, Ze);
|
|
1799
1780
|
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1800
1781
|
if (t(this, v))
|
|
1801
1782
|
if (t(this, v).closest("tbody")) {
|
|
@@ -1816,7 +1797,7 @@ const fs = class fs extends ze {
|
|
|
1816
1797
|
} catch {
|
|
1817
1798
|
}
|
|
1818
1799
|
}, "getDisplayText"));
|
|
1819
|
-
d(this,
|
|
1800
|
+
d(this, Ze, /* @__PURE__ */ h(() => {
|
|
1820
1801
|
if (!(!t(this, I) || !t(this, I).template || !t(this, v).closest("tbody.bindable"))) {
|
|
1821
1802
|
var e = ninegrid.j.querySelectorAll(t(this, v)).attr("suppress");
|
|
1822
1803
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
@@ -1829,10 +1810,10 @@ const fs = class fs extends ze {
|
|
|
1829
1810
|
if (parseInt(n.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1830
1811
|
for (var o of r) {
|
|
1831
1812
|
if (o > e) break;
|
|
1832
|
-
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);
|
|
1833
1814
|
t(this, v).dataset.matrixRow;
|
|
1834
|
-
var f = t(this, I).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, v).dataset.matrixRow}"]`), b = f.dataset.expr ? this.getExprValue(f.dataset.expr, l, a) : l[f.dataset.bind],
|
|
1835
|
-
if (b !=
|
|
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) {
|
|
1836
1817
|
i = !0;
|
|
1837
1818
|
break;
|
|
1838
1819
|
}
|
|
@@ -1859,7 +1840,7 @@ const fs = class fs extends ze {
|
|
|
1859
1840
|
}, "getExprValue"));
|
|
1860
1841
|
}
|
|
1861
1842
|
connectedCallback() {
|
|
1862
|
-
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"));
|
|
1863
1844
|
}
|
|
1864
1845
|
get value() {
|
|
1865
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];
|
|
@@ -1878,12 +1859,12 @@ const fs = class fs extends ze {
|
|
|
1878
1859
|
}
|
|
1879
1860
|
refresh() {
|
|
1880
1861
|
const e = t(this, v).dataset.bind;
|
|
1881
|
-
return parseInt(t(this, v).dataset.row), t(this,
|
|
1862
|
+
return parseInt(t(this, v).dataset.row), t(this, Ut).data[e];
|
|
1882
1863
|
}
|
|
1883
1864
|
};
|
|
1884
|
-
I = new WeakMap(),
|
|
1885
|
-
let Pe =
|
|
1886
|
-
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 {
|
|
1887
1868
|
constructor() {
|
|
1888
1869
|
super();
|
|
1889
1870
|
}
|
|
@@ -1894,21 +1875,21 @@ const us = class us extends Pe {
|
|
|
1894
1875
|
return super.refresh();
|
|
1895
1876
|
}
|
|
1896
1877
|
};
|
|
1897
|
-
h(
|
|
1898
|
-
let Fe =
|
|
1899
|
-
var
|
|
1900
|
-
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 {
|
|
1901
1882
|
constructor() {
|
|
1902
1883
|
super();
|
|
1903
|
-
d(this,
|
|
1884
|
+
d(this, Xt);
|
|
1904
1885
|
d(this, bt);
|
|
1905
1886
|
d(this, At);
|
|
1906
1887
|
d(this, Et);
|
|
1907
1888
|
d(this, Ae);
|
|
1908
|
-
d(this,
|
|
1889
|
+
d(this, J);
|
|
1909
1890
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1910
1891
|
const e = super.refresh();
|
|
1911
|
-
t(this,
|
|
1892
|
+
t(this, Xt).value = e;
|
|
1912
1893
|
}, "refresh"));
|
|
1913
1894
|
/**
|
|
1914
1895
|
dataRefresh = (v) => {
|
|
@@ -1940,22 +1921,22 @@ const gs = class gs extends Fe {
|
|
|
1940
1921
|
if (!v) this.reset();
|
|
1941
1922
|
};
|
|
1942
1923
|
*/
|
|
1943
|
-
d(this,
|
|
1924
|
+
d(this, Je, /* @__PURE__ */ h((e) => {
|
|
1944
1925
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1945
1926
|
if (t(this, bt) == "number") {
|
|
1946
1927
|
let i = [];
|
|
1947
|
-
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) {
|
|
1948
1929
|
var n = e.target.value, r = n.indexOf(".");
|
|
1949
1930
|
if (r >= 0) {
|
|
1950
1931
|
var n = n.substr(r + 1, n.length);
|
|
1951
|
-
n.length >= Number(t(this,
|
|
1932
|
+
n.length >= Number(t(this, J)) && e.preventDefault();
|
|
1952
1933
|
}
|
|
1953
1934
|
}
|
|
1954
1935
|
}
|
|
1955
1936
|
t(this, At) && ninegrid.getByteLength(e.target.value) >= Number(t(this, At)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1956
1937
|
}
|
|
1957
1938
|
}, "#onKeyDown"));
|
|
1958
|
-
if (this.applyBaseStyle(), y(this, bt, this.getAttribute("type") || "text"), y(this, At, this.getAttribute("maxbyte")), y(this, Et, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this,
|
|
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)}`;
|
|
1959
1940
|
}
|
|
1960
1941
|
connectedCallback() {
|
|
1961
1942
|
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
@@ -1965,11 +1946,11 @@ const gs = class gs extends Fe {
|
|
|
1965
1946
|
${e.join(" ")}
|
|
1966
1947
|
ondragstart="return false;"
|
|
1967
1948
|
>
|
|
1968
|
-
`, super.connectedCallback(), y(this,
|
|
1949
|
+
`, super.connectedCallback(), y(this, Xt, this.querySelector("input"));
|
|
1969
1950
|
}
|
|
1970
1951
|
};
|
|
1971
|
-
|
|
1972
|
-
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;
|
|
1973
1954
|
customElements.get("cell-input-text");
|
|
1974
1955
|
customElements.get("cell-input") || customElements.define("cell-input", je);
|
|
1975
1956
|
//# sourceMappingURL=nine-table.js.map
|