@ninebone/table 0.1.13 β 0.1.15
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 +264 -266
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +2 -2
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,13 +5,13 @@ var ws = (C) => {
|
|
|
5
5
|
var Es = (C, s, e) => s in C ? xs(C, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : C[s] = e;
|
|
6
6
|
var d = (C, s) => xs(C, "name", { value: s, configurable: !0 });
|
|
7
7
|
var A = (C, s, e) => Es(C, typeof s != "symbol" ? s + "" : s, e), Ee = (C, s, e) => s.has(C) || ws("Cannot " + e);
|
|
8
|
-
var t = (C, s, e) => (Ee(C, s, "read from private field"), e ? e.call(C) : s.get(C)), h = (C, s, e) => s.has(C) ? ws("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(C) : s.set(C, e), y = (C, s, e,
|
|
9
|
-
var vs = (C, s, e,
|
|
10
|
-
set _(
|
|
11
|
-
y(C, s,
|
|
8
|
+
var t = (C, s, e) => (Ee(C, s, "read from private field"), e ? e.call(C) : s.get(C)), h = (C, s, e) => s.has(C) ? ws("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(C) : s.set(C, e), y = (C, s, e, r) => (Ee(C, s, "write to private field"), r ? r.call(C, e) : s.set(C, e), e), Y = (C, s, e) => (Ee(C, s, "access private method"), e);
|
|
9
|
+
var vs = (C, s, e, r) => ({
|
|
10
|
+
set _(n) {
|
|
11
|
+
y(C, s, n, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(C, s,
|
|
14
|
+
return t(C, s, r);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as qs } from "@ninebone/util";
|
|
@@ -42,16 +42,16 @@ const es = class es extends HTMLElement {
|
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ d(() => {
|
|
44
44
|
if (!t(this, P) || !t(this, R) || t(this, X)) return;
|
|
45
|
-
const e = t(this, R).container,
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
45
|
+
const e = t(this, R).container, r = e.querySelector("table");
|
|
46
|
+
if (!r) return;
|
|
47
|
+
const n = t(this, R).track, a = t(this, R).thumb, o = t(this, P).querySelector(".ng-container-bottom"), i = e.clientWidth, c = r.scrollWidth;
|
|
48
48
|
if (i !== 0 && c > i)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = n.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (i / c), l), 20);
|
|
57
57
|
a.style.width = `${f}px`;
|
|
@@ -63,49 +63,49 @@ const es = class es extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
h(this, et, /* @__PURE__ */ d((e) => {
|
|
65
65
|
if (!t(this, R)) return !1;
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
66
|
+
const r = t(this, R).container, n = r.querySelector("table");
|
|
67
|
+
if (!n) return !1;
|
|
68
68
|
const a = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientWidth;
|
|
69
69
|
let i = e;
|
|
70
70
|
i < 0 && (i = 0);
|
|
71
71
|
const c = a.width - o;
|
|
72
72
|
i > c && (i = c), i = parseInt(i, 10), t(this, R).thumb.style.left = `${i}px`, q.log("1111=========="), t(this, R).left.disabled = i === 0, t(this, R).right.disabled = i >= c - 1;
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && g > 0 && (
|
|
73
|
+
const l = r.clientWidth, g = n.scrollWidth - l;
|
|
74
|
+
return c > 0 && g > 0 && (r.scrollLeft = i / c * g), i > 0 && i < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
h(this, Zt, /* @__PURE__ */ d(() => {
|
|
77
|
-
const e = /* @__PURE__ */ d((
|
|
77
|
+
const e = /* @__PURE__ */ d((n) => {
|
|
78
78
|
clearInterval(t(this, J)), clearInterval(t(this, Q));
|
|
79
79
|
const a = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, et).call(this, a +
|
|
80
|
+
t(this, et).call(this, a + n), y(this, J, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, J)), y(this, Q, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, et).call(this, o +
|
|
83
|
+
t(this, et).call(this, o + n) || clearInterval(t(this, Q));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), r = /* @__PURE__ */ d(() => {
|
|
87
87
|
clearInterval(t(this, J)), clearInterval(t(this, Q));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, R).left.addEventListener(
|
|
91
|
-
}), t(this, R).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, R).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, R).left.addEventListener("touchstart", () => e(-20)), t(this, R).right.addEventListener("touchstart", () => e(20)), t(this, R).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
|
+
t(this, R).left.addEventListener(n, r), t(this, R).right.addEventListener(n, r), t(this, R).track.addEventListener(n, r);
|
|
91
|
+
}), t(this, R).left.addEventListener("mousedown", (n) => {
|
|
92
|
+
n.button === 0 && e(-20);
|
|
93
|
+
}), t(this, R).right.addEventListener("mousedown", (n) => {
|
|
94
|
+
n.button === 0 && e(20);
|
|
95
|
+
}), t(this, R).left.addEventListener("touchstart", () => e(-20)), t(this, R).right.addEventListener("touchstart", () => e(20)), t(this, R).track.addEventListener("mousedown", (n) => {
|
|
96
|
+
if (n.button !== 0) return;
|
|
97
|
+
n.preventDefault();
|
|
98
98
|
const a = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientWidth;
|
|
99
|
-
t(this, et).call(this,
|
|
100
|
-
}), t(this, R).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
t(this, et).call(this, n.clientX - a.left - o / 2);
|
|
100
|
+
}), t(this, R).thumb.addEventListener("mousedown", (n) => {
|
|
101
|
+
if (n.button !== 0) return;
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), y(this, X, !0), this.shiftX = n.clientX - t(this, R).thumb.getBoundingClientRect().left;
|
|
103
103
|
const a = /* @__PURE__ */ d((i) => {
|
|
104
104
|
if (!t(this, X)) return;
|
|
105
105
|
const c = t(this, R).track.getBoundingClientRect();
|
|
106
106
|
t(this, et).call(this, i.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ d(() => {
|
|
108
|
-
y(this, X, !1),
|
|
108
|
+
y(this, X, !1), r(), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -177,18 +177,18 @@ const es = class es extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ d(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const r = t(this, P).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!r) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, R, {
|
|
186
|
-
container:
|
|
186
|
+
container: r,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
191
|
+
}), r.addEventListener("scroll", () => {
|
|
192
192
|
t(this, X) || this.refresh();
|
|
193
193
|
}), t(this, Zt).call(this), t(this, Kt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
@@ -201,46 +201,46 @@ const es = class es extends HTMLElement {
|
|
|
201
201
|
P = new WeakMap(), X = new WeakMap(), R = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Kt = new WeakMap(), et = new WeakMap(), Zt = new WeakMap(), d(es, "NineTableHScrollBar");
|
|
202
202
|
let Ce = es;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ce);
|
|
204
|
-
var st,
|
|
204
|
+
var st, rt, bt, k, Tt, kt, Gt;
|
|
205
205
|
const ss = class ss extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
h(this, st);
|
|
209
|
-
h(this,
|
|
209
|
+
h(this, rt);
|
|
210
210
|
h(this, bt, !1);
|
|
211
211
|
h(this, k);
|
|
212
212
|
h(this, Tt, 0);
|
|
213
213
|
h(this, kt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ d(() => {
|
|
215
215
|
if (!t(this, st) || !t(this, k)) return;
|
|
216
|
-
const e = t(this, k).container,
|
|
216
|
+
const e = t(this, k).container, r = t(this, k).track, n = t(this, k).thumb, a = e.clientHeight, o = t(this, st).data.length, i = t(this, rt).getRowHeight(), c = o * i;
|
|
217
217
|
if (c <= a || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const l =
|
|
222
|
+
const l = r.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
225
|
-
|
|
225
|
+
n.style.height = `${f}px`;
|
|
226
226
|
const g = e.scrollTop, b = Math.max(c - a, 1);
|
|
227
227
|
let u = 0;
|
|
228
228
|
b > 0 && (u = g / b * (l - f));
|
|
229
229
|
const p = l - f;
|
|
230
|
-
u < 0 && (u = 0), u > p && (u = p),
|
|
230
|
+
u < 0 && (u = 0), u > p && (u = p), n.style.top = `${u}px`, t(this, k).top.disabled = g <= 0, t(this, k).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
h(this, Gt, /* @__PURE__ */ d(() => {
|
|
233
233
|
q.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this, k).container,
|
|
235
|
-
const a = (t(this, st).data.get() || []).length, o = t(this,
|
|
234
|
+
const e = t(this, k).container, r = /* @__PURE__ */ d(() => {
|
|
235
|
+
const a = (t(this, st).data.get() || []).length, o = t(this, rt).getRowHeight();
|
|
236
236
|
return a * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
|
-
t(this, k).thumb.addEventListener("mousedown", (
|
|
239
|
-
if (
|
|
240
|
-
|
|
238
|
+
t(this, k).thumb.addEventListener("mousedown", (n) => {
|
|
239
|
+
if (n.button !== 0) return;
|
|
240
|
+
n.stopPropagation(), n.preventDefault(), y(this, bt, !0), y(this, Tt, n.clientY), y(this, kt, e.scrollTop);
|
|
241
241
|
const a = /* @__PURE__ */ d((i) => {
|
|
242
242
|
if (!t(this, bt)) return;
|
|
243
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = i.clientY - t(this, Tt), u = e.clientHeight, p =
|
|
243
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, g = c.height - l, b = i.clientY - t(this, Tt), u = e.clientHeight, p = r(), m = Math.max(p - u, 1);
|
|
244
244
|
if (g > 0 && m > 0) {
|
|
245
245
|
const v = b / g * m;
|
|
246
246
|
let x = t(this, kt) + v;
|
|
@@ -252,9 +252,9 @@ const ss = class ss extends HTMLElement {
|
|
|
252
252
|
y(this, bt, !1), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o), this.refresh();
|
|
253
253
|
}, "onMouseUp");
|
|
254
254
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
255
|
-
}), t(this, k).track.addEventListener("mousedown", (
|
|
256
|
-
if (
|
|
257
|
-
const a = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, i =
|
|
255
|
+
}), t(this, k).track.addEventListener("mousedown", (n) => {
|
|
256
|
+
if (n.button !== 0 || n.target === t(this, k).thumb) return;
|
|
257
|
+
const a = t(this, k).track.getBoundingClientRect(), o = t(this, k).thumb.clientHeight, i = n.clientY - a.top - o / 2, l = a.height - o, f = e.clientHeight, g = r(), b = Math.max(g - f, 1);
|
|
258
258
|
if (l > 0 && b > 0) {
|
|
259
259
|
const u = Math.max(0, Math.min(1, i / l));
|
|
260
260
|
e.scrollTop = u * b;
|
|
@@ -268,7 +268,7 @@ const ss = class ss extends HTMLElement {
|
|
|
268
268
|
}, "#init"));
|
|
269
269
|
}
|
|
270
270
|
connectedCallback() {
|
|
271
|
-
y(this, st, this.getRootNode().host), y(this,
|
|
271
|
+
y(this, st, this.getRootNode().host), y(this, rt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
272
272
|
<style>
|
|
273
273
|
nine-table-vscrollbar {
|
|
274
274
|
display: flex;
|
|
@@ -333,13 +333,13 @@ const ss = class ss extends HTMLElement {
|
|
|
333
333
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
334
334
|
`;
|
|
335
335
|
const e = /* @__PURE__ */ d(() => {
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
336
|
+
const r = t(this, rt).querySelector(".ng-container-body .ng-part-body");
|
|
337
|
+
if (!r) {
|
|
338
338
|
setTimeout(e, 10);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
y(this, k, {
|
|
342
|
-
container:
|
|
342
|
+
container: r,
|
|
343
343
|
track: this.querySelector(".ng-scroll-track"),
|
|
344
344
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
345
345
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -349,13 +349,13 @@ const ss = class ss extends HTMLElement {
|
|
|
349
349
|
e();
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
st = new WeakMap(),
|
|
352
|
+
st = new WeakMap(), rt = new WeakMap(), bt = new WeakMap(), k = new WeakMap(), Tt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), d(ss, "NineTableVScrollBar");
|
|
353
353
|
let Te = ss;
|
|
354
354
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Te);
|
|
355
|
-
var
|
|
356
|
-
const
|
|
355
|
+
var nt, S, ot, j, D, K, it, Lt, je, Ve, Jt, Ue, Qt, te, It, Mt, Ht, ee, se, $t, pt, re, ne;
|
|
356
|
+
const rs = class rs {
|
|
357
357
|
constructor(s) {
|
|
358
|
-
h(this,
|
|
358
|
+
h(this, nt);
|
|
359
359
|
h(this, S);
|
|
360
360
|
h(this, ot);
|
|
361
361
|
h(this, j, /* @__PURE__ */ new Map());
|
|
@@ -389,7 +389,7 @@ const ns = class ns {
|
|
|
389
389
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, j).set(o, g);
|
|
391
391
|
});
|
|
392
|
-
const s = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"),
|
|
392
|
+
const s = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), r = t(this, S).querySelector(".ng-container-right .ng-part-body"), n = t(this, S).querySelector(".ng-container-body .ng-part-header"), a = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (s) {
|
|
394
394
|
t(this, It).call(this), t(this, $t).call(this), t(this, Mt).call(this), t(this, pt).call(this, s.scrollTop);
|
|
395
395
|
let o = !1;
|
|
@@ -399,11 +399,11 @@ const ns = class ns {
|
|
|
399
399
|
if (o) return;
|
|
400
400
|
o = !0;
|
|
401
401
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
402
|
-
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l),
|
|
402
|
+
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), r && r.scrollTop !== l && (r.scrollTop = l), n && n.scrollLeft !== f && (n.scrollLeft = f), a && a.scrollLeft !== f && (a.scrollLeft = f), t(this, pt).call(this, l), (g = t(this, S).querySelector("nine-table-vscrollbar")) == null || g.refresh(), o = !1;
|
|
403
403
|
}, "handleContainerScroll");
|
|
404
404
|
s == null || s.addEventListener("scroll", (c) => {
|
|
405
405
|
i(s);
|
|
406
|
-
}), [e,
|
|
406
|
+
}), [e, r].forEach((c) => {
|
|
407
407
|
c == null || c.addEventListener("scroll", (l) => {
|
|
408
408
|
if (o) return;
|
|
409
409
|
o = !0;
|
|
@@ -415,17 +415,17 @@ const ns = class ns {
|
|
|
415
415
|
}, "initialize"));
|
|
416
416
|
h(this, te, /* @__PURE__ */ d((s, e) => {
|
|
417
417
|
q.log("rowManager.#renderRows");
|
|
418
|
-
const
|
|
419
|
-
if (!
|
|
420
|
-
const
|
|
421
|
-
if (!
|
|
422
|
-
|
|
423
|
-
const a =
|
|
418
|
+
const r = t(this, j).get(e);
|
|
419
|
+
if (!r || r.length === 0) return;
|
|
420
|
+
const n = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
421
|
+
if (!n) return;
|
|
422
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((i) => i.remove());
|
|
423
|
+
const a = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
424
424
|
for (let i = 0; i < t(this, Lt); i++)
|
|
425
|
-
|
|
425
|
+
r.forEach((c) => {
|
|
426
426
|
o.appendChild(c.cloneNode(!0));
|
|
427
427
|
});
|
|
428
|
-
a ? a.before(o) :
|
|
428
|
+
a ? a.before(o) : n.appendChild(o), e === ".ng-container-body" && (t(this, ot).firstTr = n.querySelector("tr:not(.nodata)"));
|
|
429
429
|
}, "#renderRows"));
|
|
430
430
|
h(this, It, /* @__PURE__ */ d(() => {
|
|
431
431
|
if (t(this, D) !== null && t(this, D) > 0)
|
|
@@ -434,17 +434,17 @@ const ns = class ns {
|
|
|
434
434
|
q.log("rowManager.#measureAndCacheHeight");
|
|
435
435
|
const e = t(this, j).get(".ng-container-body");
|
|
436
436
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
437
|
-
const
|
|
438
|
-
if (!
|
|
439
|
-
|
|
440
|
-
const
|
|
437
|
+
const r = s.querySelector("tbody.bindable-tbody");
|
|
438
|
+
if (!r) throw new Error("invalid dom");
|
|
439
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
440
|
+
const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
441
441
|
e.forEach((b) => {
|
|
442
442
|
a.appendChild(b.cloneNode(!0));
|
|
443
|
-
}),
|
|
443
|
+
}), n ? n.before(a) : r.appendChild(a);
|
|
444
444
|
const o = t(this, S), i = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
445
445
|
(i === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
446
446
|
let f = 0;
|
|
447
|
-
const g =
|
|
447
|
+
const g = r.querySelectorAll("tr");
|
|
448
448
|
return g.forEach((b) => {
|
|
449
449
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
450
450
|
if (u === 0) {
|
|
@@ -456,12 +456,12 @@ const ns = class ns {
|
|
|
456
456
|
}, "#measureAndCacheHeight"));
|
|
457
457
|
h(this, Mt, /* @__PURE__ */ d(() => {
|
|
458
458
|
q.log("rowManager.#updateVirtualScrollHeight");
|
|
459
|
-
const e = (t(this,
|
|
459
|
+
const e = (t(this, nt).data.get() || []).length, r = t(this, D), n = e * r;
|
|
460
460
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
461
461
|
const o = t(this, S).querySelector(a);
|
|
462
462
|
if (!o) return;
|
|
463
463
|
const i = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
464
|
-
i && (i.style.height = `${
|
|
464
|
+
i && (i.style.height = `${n}px`);
|
|
465
465
|
});
|
|
466
466
|
}, "#updateVirtualScrollHeight"));
|
|
467
467
|
h(this, Ht, /* @__PURE__ */ d(() => {
|
|
@@ -472,9 +472,9 @@ const ns = class ns {
|
|
|
472
472
|
}, "#updateRowCount"));
|
|
473
473
|
h(this, ee, /* @__PURE__ */ d(() => {
|
|
474
474
|
var i, c, l, f, g, b;
|
|
475
|
-
const s = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"),
|
|
475
|
+
const s = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), r = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
476
476
|
if (e) {
|
|
477
|
-
const u = s ? Array.from(s.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), m =
|
|
477
|
+
const u = s ? Array.from(s.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), m = r ? Array.from(r.querySelectorAll("tbody tr")) : [], v = Math.max(u.length, p.length, m.length);
|
|
478
478
|
for (let x = 0; x < v; x++) {
|
|
479
479
|
const T = [
|
|
480
480
|
((i = u[x]) == null ? void 0 : i.getBoundingClientRect().height) || 0,
|
|
@@ -484,9 +484,9 @@ const ns = class ns {
|
|
|
484
484
|
E > 0 && (u[x] && (u[x].style.height = `${E}px`), p[x] && (p[x].style.height = `${E}px`), m[x] && (m[x].style.height = `${E}px`));
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
const
|
|
487
|
+
const n = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
488
488
|
if (a) {
|
|
489
|
-
const u =
|
|
489
|
+
const u = n ? Array.from(n.querySelectorAll("tfoot tr")) : [], p = Array.from(a.querySelectorAll("tfoot tr")), m = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], v = Math.max(u.length, p.length, m.length);
|
|
490
490
|
for (let x = 0; x < v; x++) {
|
|
491
491
|
const T = [
|
|
492
492
|
((f = u[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
@@ -500,14 +500,14 @@ const ns = class ns {
|
|
|
500
500
|
h(this, se, /* @__PURE__ */ d(() => {
|
|
501
501
|
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, K, new ResizeObserver((s) => {
|
|
502
502
|
for (const e of s) {
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
503
|
+
const r = e.target;
|
|
504
|
+
if (!r.classList.contains("active")) continue;
|
|
505
|
+
const n = e.contentRect.height;
|
|
506
|
+
if (n > 0) {
|
|
507
507
|
let a = 0;
|
|
508
|
-
const o =
|
|
508
|
+
const o = r.querySelector(".ng-part-header"), i = r.querySelector(".ng-part-footer");
|
|
509
509
|
o && (a += o.offsetHeight), i && (a += i.offsetHeight);
|
|
510
|
-
const c = Math.max(
|
|
510
|
+
const c = Math.max(n - a, 100);
|
|
511
511
|
t(this, it) !== c && (y(this, it, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, $t).call(this), this.refresh()));
|
|
512
512
|
}
|
|
513
513
|
}
|
|
@@ -517,15 +517,15 @@ const ns = class ns {
|
|
|
517
517
|
q.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
518
518
|
const e = t(this, S).querySelector(s);
|
|
519
519
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, te).call(this, e, s);
|
|
520
|
-
}), t(this,
|
|
520
|
+
}), t(this, ne).call(this), t(this, ee).call(this);
|
|
521
521
|
}, "#renderAllContainers"));
|
|
522
522
|
h(this, pt, /* @__PURE__ */ d((s) => {
|
|
523
523
|
var g, b;
|
|
524
524
|
const e = t(this, D);
|
|
525
525
|
if (!e || e <= 0) return;
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
526
|
+
const r = t(this, nt).data.length;
|
|
527
|
+
if (r === 0) return;
|
|
528
|
+
const n = ((g = t(this, j).get(".ng-container-body")) == null ? void 0 : g.length) || 1, a = t(this, S).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, r - Math.floor(a.clientHeight / e)), i = Math.min(o, Math.max(0, Math.floor(s / e)));
|
|
529
529
|
let c = Math.floor(i * e);
|
|
530
530
|
const l = t(this, ot).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
531
531
|
(b = t(this, ot)) == null || b.scrollTables.forEach((u) => {
|
|
@@ -536,13 +536,13 @@ const ns = class ns {
|
|
|
536
536
|
const m = p.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
537
537
|
if (!m) return;
|
|
538
538
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((x, T) => {
|
|
539
|
-
const E = i + Math.floor(T /
|
|
540
|
-
if (E >=
|
|
539
|
+
const E = i + Math.floor(T / n);
|
|
540
|
+
if (E >= r) {
|
|
541
541
|
x.style.display = "none";
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
544
|
-
const _ = t(this,
|
|
545
|
-
x.style.display = "", t(this,
|
|
544
|
+
const _ = t(this, nt).data.get(E);
|
|
545
|
+
x.style.display = "", t(this, re).call(this, x, _, E);
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
548
|
}, "#handleScroll"));
|
|
@@ -560,32 +560,32 @@ const ns = class ns {
|
|
|
560
560
|
cell.dataset.row = dataIndex;
|
|
561
561
|
});
|
|
562
562
|
}; */
|
|
563
|
-
h(this,
|
|
564
|
-
s.dataset.row =
|
|
565
|
-
|
|
566
|
-
const o = Array.from(
|
|
563
|
+
h(this, re, /* @__PURE__ */ d((s, e, r) => {
|
|
564
|
+
s.dataset.row = r, s.data = e, Array.from(s.cells).forEach((n, a) => {
|
|
565
|
+
n.dataset.row = r;
|
|
566
|
+
const o = Array.from(n.children).find((i) => i.tagName.toLowerCase().startsWith("cell-") || typeof i.refresh == "function");
|
|
567
567
|
o && typeof o.refresh == "function" && o.refresh();
|
|
568
568
|
});
|
|
569
569
|
}, "#bindRowData"));
|
|
570
|
-
h(this,
|
|
570
|
+
h(this, ne, /* @__PURE__ */ d(() => {
|
|
571
571
|
var c, l, f;
|
|
572
572
|
q.log("rowManager.#syncHeaderHeights");
|
|
573
|
-
const s = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"),
|
|
573
|
+
const s = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), r = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
574
574
|
if (!e) return;
|
|
575
|
-
const
|
|
575
|
+
const n = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(e.querySelectorAll("tr")), o = r ? Array.from(r.querySelectorAll("tr")) : [], i = Math.max(n.length, a.length, o.length);
|
|
576
576
|
for (let g = 0; g < i; g++) {
|
|
577
577
|
const b = [
|
|
578
|
-
((c =
|
|
578
|
+
((c = n[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
579
579
|
((l = a[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
580
580
|
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
581
581
|
], u = Math.max(...b);
|
|
582
|
-
u > 0 && (
|
|
582
|
+
u > 0 && (n[g] && (n[g].style.height = `${u}px`), a[g] && (a[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`));
|
|
583
583
|
}
|
|
584
584
|
}, "#syncHeaderHeights"));
|
|
585
585
|
A(this, "destroy", /* @__PURE__ */ d(() => {
|
|
586
586
|
t(this, K) && (t(this, K).disconnect(), y(this, K, null));
|
|
587
587
|
}, "destroy"));
|
|
588
|
-
y(this,
|
|
588
|
+
y(this, nt, s.getRootNode().host), y(this, S, s), t(this, se).call(this);
|
|
589
589
|
}
|
|
590
590
|
getRowHeight() {
|
|
591
591
|
return t(this, D);
|
|
@@ -595,8 +595,8 @@ const ns = class ns {
|
|
|
595
595
|
return ((e = t(this, j).get(s)) == null ? void 0 : e.length) || 1;
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
|
-
|
|
599
|
-
let ke =
|
|
598
|
+
nt = new WeakMap(), S = new WeakMap(), ot = new WeakMap(), j = new WeakMap(), D = new WeakMap(), K = new WeakMap(), it = new WeakMap(), Lt = new WeakMap(), je = new WeakMap(), Ve = new WeakMap(), Jt = new WeakMap(), Ue = new WeakMap(), Qt = new WeakMap(), te = new WeakMap(), It = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), $t = new WeakMap(), pt = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), d(rs, "RowManager");
|
|
599
|
+
let ke = rs;
|
|
600
600
|
const oe = class oe {
|
|
601
601
|
/**
|
|
602
602
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -620,7 +620,7 @@ const oe = class oe {
|
|
|
620
620
|
}), i.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
621
621
|
l.setAttribute("tabindex", "0");
|
|
622
622
|
});
|
|
623
|
-
}, "processCellTypes"),
|
|
623
|
+
}, "processCellTypes"), r = /* @__PURE__ */ d((i) => {
|
|
624
624
|
if (!i.querySelector("colgroup")) {
|
|
625
625
|
const c = i.querySelector("tbody tr") || i.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(i.clientWidth / l), 100);
|
|
626
626
|
for (let b = 0; b < l; b++) {
|
|
@@ -634,7 +634,7 @@ const oe = class oe {
|
|
|
634
634
|
l ? l.after(c) : i.prepend(c);
|
|
635
635
|
}
|
|
636
636
|
i.classList.add("nine-table-element");
|
|
637
|
-
}, "ensureTableStructure"),
|
|
637
|
+
}, "ensureTableStructure"), n = /* @__PURE__ */ d((i, c) => {
|
|
638
638
|
const l = Array.from(i.querySelectorAll(c + " tr")), f = Array.from(i.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
639
639
|
if (g === 0 || f.length === 0) return;
|
|
640
640
|
let b = 0;
|
|
@@ -667,7 +667,7 @@ const oe = class oe {
|
|
|
667
667
|
});
|
|
668
668
|
});
|
|
669
669
|
}, "resetColIndex"), a = s.cloneNode(!0);
|
|
670
|
-
return
|
|
670
|
+
return r(a), e(a), n(a, "thead"), n(a, "tbody"), n(a, "tfoot"), Array.from(a.querySelectorAll("colgroup col")).forEach((i, c) => {
|
|
671
671
|
const l = i.getAttribute("fixed");
|
|
672
672
|
l && a.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
673
673
|
f.setAttribute("fixed", l);
|
|
@@ -679,13 +679,13 @@ const oe = class oe {
|
|
|
679
679
|
d(oe, "TableCompiler");
|
|
680
680
|
let Le = oe;
|
|
681
681
|
var H, V, U, Et, Ss;
|
|
682
|
-
const
|
|
682
|
+
const ns = class ns {
|
|
683
683
|
constructor(s) {
|
|
684
684
|
h(this, U);
|
|
685
685
|
h(this, H);
|
|
686
686
|
h(this, V, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
687
687
|
A(this, "render", /* @__PURE__ */ d(() => {
|
|
688
|
-
const { startRow: s, startCol: e, endRow:
|
|
688
|
+
const { startRow: s, startCol: e, endRow: r, endCol: n } = t(this, V);
|
|
689
689
|
q.log("π¨ [CellSelection.render] Rendering range ->", t(this, V));
|
|
690
690
|
const a = t(this, H).querySelectorAll(
|
|
691
691
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
@@ -706,22 +706,22 @@ const rs = class rs {
|
|
|
706
706
|
const g = parseInt(f.dataset.col, 10);
|
|
707
707
|
if (isNaN(g)) return;
|
|
708
708
|
const b = parseInt(f.rowSpan || 1, 10), u = parseInt(f.colSpan || 1, 10), p = l + b - 1, m = g + u - 1;
|
|
709
|
-
p >= s && l <=
|
|
709
|
+
p >= s && l <= r && m >= e && g <= n && (o++, f.classList.add("selected"), q.log(f, s, e, r, n), l <= s && f.classList.add("selected-top"), p >= r && f.classList.add("selected-bottom"), g <= e && f.classList.add("selected-left"), m >= n && f.classList.add("selected-right"));
|
|
710
710
|
});
|
|
711
711
|
});
|
|
712
712
|
}), q.log(`β¨ [CellSelection.render] Total rendered cells marked: ${o}`);
|
|
713
713
|
}, "render"));
|
|
714
714
|
y(this, H, s), Y(this, U, Ss).call(this), t(this, H).querySelectorAll(
|
|
715
715
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
716
|
-
).forEach((
|
|
717
|
-
|
|
716
|
+
).forEach((r) => {
|
|
717
|
+
r.addEventListener("scroll", () => {
|
|
718
718
|
t(this, V).startRow >= 0 && t(this, V).startCol >= 0 && this.render();
|
|
719
719
|
});
|
|
720
720
|
}), q.log("π― [CellSelection] Initialized");
|
|
721
721
|
}
|
|
722
|
-
setRange(s, e,
|
|
723
|
-
q.log(`π [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${
|
|
724
|
-
let a = Math.min(s,
|
|
722
|
+
setRange(s, e, r, n) {
|
|
723
|
+
q.log(`π [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${r}, endCol: ${n}`);
|
|
724
|
+
let a = Math.min(s, r), o = Math.max(s, r), i = Math.min(e, n), c = Math.max(e, n);
|
|
725
725
|
const l = t(this, H).querySelectorAll(
|
|
726
726
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
727
727
|
);
|
|
@@ -749,7 +749,7 @@ H = new WeakMap(), V = new WeakMap(), U = new WeakSet(), Et = /* @__PURE__ */ d(
|
|
|
749
749
|
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
750
750
|
const e = parseInt(s.dataset.row, 10);
|
|
751
751
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
752
|
-
const
|
|
752
|
+
const r = s.closest("tbody"), a = Array.from(r.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), o = a.indexOf(s), i = a.length > 0 ? a.length : 1, c = e * i + (o >= 0 ? o : s.sectionRowIndex % i);
|
|
753
753
|
return { dataRow: e, subRowIndex: o, matrixRow: c };
|
|
754
754
|
}, "#getMatrixRow"), Ss = /* @__PURE__ */ d(function() {
|
|
755
755
|
const s = t(this, H).querySelector(".ng-container-top");
|
|
@@ -759,15 +759,15 @@ H = new WeakMap(), V = new WeakMap(), U = new WeakSet(), Et = /* @__PURE__ */ d(
|
|
|
759
759
|
}
|
|
760
760
|
s.addEventListener("mousedown", (e) => {
|
|
761
761
|
if (e.button !== 0) return;
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
762
|
+
const r = e.target.closest("td, th");
|
|
763
|
+
if (!r || r.dataset.row === void 0 || r.dataset.col === void 0 || r.closest("tr").classList.contains("nodata")) return;
|
|
764
764
|
t(this, H).style.userSelect = "none", t(this, H).style.webkitUserSelect = "none";
|
|
765
|
-
const
|
|
765
|
+
const n = r.closest("tr"), { matrixRow: a } = Y(this, U, Et).call(this, n), o = parseInt(r.dataset.col, 10);
|
|
766
766
|
if (a < 0) {
|
|
767
767
|
t(this, H).style.userSelect = "", t(this, H).style.webkitUserSelect = "";
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
|
-
q.log(`π±οΈ [MouseDown Success] startRow: ${a}, startCol: ${o}`), t(this, H).navigation.currentCell =
|
|
770
|
+
q.log(`π±οΈ [MouseDown Success] startRow: ${a}, startCol: ${o}`), t(this, H).navigation.currentCell = r;
|
|
771
771
|
let i = a, c = o;
|
|
772
772
|
const l = /* @__PURE__ */ d((g) => {
|
|
773
773
|
const b = document.elementFromPoint(g.clientX, g.clientY);
|
|
@@ -790,9 +790,9 @@ H = new WeakMap(), V = new WeakMap(), U = new WeakSet(), Et = /* @__PURE__ */ d(
|
|
|
790
790
|
}, "onMouseUp");
|
|
791
791
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", f);
|
|
792
792
|
});
|
|
793
|
-
}, "#initEvents"), d(
|
|
794
|
-
let Ie =
|
|
795
|
-
var B, at, Nt, ie, ae, At, Rs, _t, Dt, Ot, lt,
|
|
793
|
+
}, "#initEvents"), d(ns, "CellSelection");
|
|
794
|
+
let Ie = ns;
|
|
795
|
+
var B, at, Nt, ie, ae, At, Rs, _t, Dt, Ot, lt, Ye, le, As;
|
|
796
796
|
const os = class os {
|
|
797
797
|
constructor(s) {
|
|
798
798
|
h(this, At);
|
|
@@ -803,49 +803,49 @@ const os = class os {
|
|
|
803
803
|
h(this, ae, -1);
|
|
804
804
|
h(this, _t, /* @__PURE__ */ d((s) => {
|
|
805
805
|
const e = [];
|
|
806
|
-
return s.forEach((
|
|
806
|
+
return s.forEach((r) => e.push(...Array.from(r.querySelectorAll("td")))), e.length === 0 ? null : (e.sort((r, n) => parseInt(r.dataset.col, 10) - parseInt(n.dataset.col, 10)), e[e.length - 1]);
|
|
807
807
|
}, "#getMaxColCell"));
|
|
808
808
|
h(this, Dt, /* @__PURE__ */ d((s, e) => {
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
let
|
|
809
|
+
const r = t(this, lt).call(this, s);
|
|
810
|
+
if (r.length === 0) return e + 1;
|
|
811
|
+
let n = e + 1;
|
|
812
812
|
const a = [];
|
|
813
|
-
|
|
813
|
+
r.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
|
|
814
814
|
for (const o of a) {
|
|
815
815
|
const i = parseInt(o.dataset.col, 10), c = parseInt(o.colSpan || 1, 10);
|
|
816
816
|
if (e >= i && e < i + c) {
|
|
817
|
-
|
|
817
|
+
n = i + c;
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
|
-
return
|
|
821
|
+
return n;
|
|
822
822
|
}, "#getNextCol"));
|
|
823
823
|
h(this, Ot, /* @__PURE__ */ d((s, e) => {
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
let
|
|
824
|
+
const r = t(this, lt).call(this, s);
|
|
825
|
+
if (r.length === 0) return Math.max(0, e - 1);
|
|
826
|
+
let n = -1;
|
|
827
827
|
const a = [];
|
|
828
|
-
|
|
828
|
+
r.forEach((o) => a.push(...Array.from(o.querySelectorAll("td")))), a.sort((o, i) => parseInt(o.dataset.col, 10) - parseInt(i.dataset.col, 10));
|
|
829
829
|
for (const o of a) {
|
|
830
830
|
const i = parseInt(o.dataset.col, 10);
|
|
831
831
|
if (i < e)
|
|
832
|
-
|
|
832
|
+
n = i;
|
|
833
833
|
else
|
|
834
834
|
break;
|
|
835
835
|
}
|
|
836
|
-
return
|
|
836
|
+
return n;
|
|
837
837
|
}, "#getPreviousCol"));
|
|
838
838
|
// π― λ κ±°μμ λ³ν© μ
(rowSpan) λΈλ‘ ν¬μ© νμ λ‘μ§ μ΄μ
|
|
839
839
|
h(this, lt, /* @__PURE__ */ d((s) => {
|
|
840
840
|
const e = t(this, B).querySelectorAll(
|
|
841
841
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
842
|
-
),
|
|
843
|
-
return e.forEach((
|
|
844
|
-
const a = Array.from(
|
|
842
|
+
), r = [];
|
|
843
|
+
return e.forEach((n) => {
|
|
844
|
+
const a = Array.from(n.querySelectorAll("tbody tr:not(.nodata)"));
|
|
845
845
|
for (const o of a) {
|
|
846
846
|
const i = parseInt(o.dataset.row, 10), c = a.filter((p) => parseInt(p.dataset.row, 10) === i), l = c.length > 0 ? c.length : 1, f = c.indexOf(o), g = i * l + (f >= 0 ? f : 0);
|
|
847
847
|
if (g === s) {
|
|
848
|
-
|
|
848
|
+
r.push(o);
|
|
849
849
|
break;
|
|
850
850
|
}
|
|
851
851
|
const b = Array.from(o.querySelectorAll("td"));
|
|
@@ -853,46 +853,44 @@ const os = class os {
|
|
|
853
853
|
for (const p of b) {
|
|
854
854
|
const m = parseInt(p.rowSpan || 1, 10);
|
|
855
855
|
if (m > 1 && s >= g && s < g + m) {
|
|
856
|
-
|
|
856
|
+
r.push(o), u = !0;
|
|
857
857
|
break;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
if (u) break;
|
|
861
861
|
}
|
|
862
|
-
}),
|
|
862
|
+
}), r;
|
|
863
863
|
}, "#findTargetTrsByMatrix"));
|
|
864
864
|
// π― rowSpan λ° colSpan κ²½κ³λ₯Ό λͺ¨λ μΆ©μ‘±νλ μ
μ 3λΆν μ 체 μμμμ νμ
|
|
865
|
-
h(this,
|
|
865
|
+
h(this, Ye, /* @__PURE__ */ d((s, e, r, n) => {
|
|
866
866
|
const a = t(this, B).querySelectorAll(
|
|
867
867
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
868
|
-
), o =
|
|
868
|
+
), o = n !== void 0 ? n : s * 1 + e;
|
|
869
869
|
for (const i of a) {
|
|
870
870
|
const c = Array.from(i.querySelectorAll("tbody tr"));
|
|
871
871
|
for (const l of c) {
|
|
872
872
|
const f = parseInt(l.dataset.row, 10), g = t(this, B).templateLength, b = parseInt(l.dataset.subrow, 10), u = f * g + (b >= 0 ? b : 0), p = Array.from(l.querySelectorAll("td"));
|
|
873
873
|
for (const m of p) {
|
|
874
874
|
const v = parseInt(m.dataset.col, 10), x = parseInt(m.colSpan || 1, 10), T = parseInt(m.rowSpan || 1, 10);
|
|
875
|
-
if (!isNaN(v) &&
|
|
875
|
+
if (!isNaN(v) && r >= v && r < v + x && o >= u && o < u + T && window.getComputedStyle(m).display !== "none")
|
|
876
876
|
return m;
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
return null;
|
|
881
|
-
}, "#
|
|
882
|
-
h(this,
|
|
883
|
-
const a =
|
|
884
|
-
".ng-container-left .ng-part-body tbody tr, .ng-container-body .ng-part-body tbody tr, .ng-container-right .ng-part-body tbody tr"
|
|
885
|
-
));
|
|
881
|
+
}, "#getNearElement_BAK"));
|
|
882
|
+
h(this, le, /* @__PURE__ */ d((s, e, r, n) => {
|
|
883
|
+
const a = n !== void 0 ? n : s * 1 + e, o = Array.from(t(this, B).querySelectorAll(".ng-part-body tbody tr"));
|
|
886
884
|
for (const i of o) {
|
|
887
|
-
const c = parseInt(i.dataset.row, 10)
|
|
885
|
+
const c = parseInt(i.dataset.row, 10), l = t(this, B).templateLength, f = parseInt(i.dataset.subrow, 10), g = c * l + (f >= 0 ? f : 0), b = Array.from(i.querySelectorAll("td"));
|
|
888
886
|
for (const u of b) {
|
|
889
887
|
const p = parseInt(u.dataset.col, 10), m = parseInt(u.colSpan || 1, 10), v = parseInt(u.rowSpan || 1, 10);
|
|
890
|
-
if (!isNaN(p) &&
|
|
888
|
+
if (!isNaN(p) && r >= p && r < p + m && a >= g && a < g + v && window.getComputedStyle(u).display !== "none")
|
|
891
889
|
return u;
|
|
892
890
|
}
|
|
893
891
|
}
|
|
894
892
|
return null;
|
|
895
|
-
}, "#
|
|
893
|
+
}, "#getNearElement"));
|
|
896
894
|
y(this, B, s), Y(this, At, As).call(this), q.log("π― [CellNavigation] Initialized");
|
|
897
895
|
}
|
|
898
896
|
get currentCell() {
|
|
@@ -901,39 +899,39 @@ const os = class os {
|
|
|
901
899
|
set currentCell(s) {
|
|
902
900
|
if (!s) return;
|
|
903
901
|
y(this, at, s), s.focus({ preventScroll: !0 }), y(this, Nt, s.closest("tr"));
|
|
904
|
-
const e = parseInt(s.dataset.row, 10),
|
|
905
|
-
if (!isNaN(e) && !isNaN(
|
|
906
|
-
y(this, ie, e), y(this, ae,
|
|
907
|
-
const
|
|
902
|
+
const e = parseInt(s.dataset.row, 10), r = parseInt(s.dataset.col, 10);
|
|
903
|
+
if (!isNaN(e) && !isNaN(r)) {
|
|
904
|
+
y(this, ie, e), y(this, ae, r);
|
|
905
|
+
const n = s.closest("tr"), a = n == null ? void 0 : n.closest("tbody");
|
|
908
906
|
if (a) {
|
|
909
|
-
const i = Array.from(a.querySelectorAll("tr:not(.nodata)")).filter((g) => parseInt(g.dataset.row, 10) === e), c = i.length > 0 ? i.length : 1, l = i.indexOf(
|
|
910
|
-
t(this, B).selection.setRange(f,
|
|
907
|
+
const i = Array.from(a.querySelectorAll("tr:not(.nodata)")).filter((g) => parseInt(g.dataset.row, 10) === e), c = i.length > 0 ? i.length : 1, l = i.indexOf(n), f = e * c + (l >= 0 ? l : 0);
|
|
908
|
+
t(this, B).selection.setRange(f, r, f, r);
|
|
911
909
|
}
|
|
912
910
|
}
|
|
913
911
|
}
|
|
914
912
|
moveCell(s) {
|
|
915
913
|
if (!t(this, at)) return;
|
|
916
|
-
const e = t(this, at),
|
|
917
|
-
let c = i, l =
|
|
914
|
+
const e = t(this, at), r = parseInt(e.dataset.row, 10), n = parseInt(e.dataset.col, 10), a = t(this, B).templateLength, o = parseInt(t(this, Nt).dataset.subrow, 10), i = r * a + (o >= 0 ? o : 0);
|
|
915
|
+
let c = i, l = n;
|
|
918
916
|
switch (s.code) {
|
|
919
917
|
case "Tab":
|
|
920
918
|
if (s.preventDefault(), s.shiftKey) {
|
|
921
|
-
if (l = t(this, Ot).call(this, i,
|
|
919
|
+
if (l = t(this, Ot).call(this, i, n), l < 0 && i > 0) {
|
|
922
920
|
c = i - 1;
|
|
923
921
|
const u = t(this, lt).call(this, c), p = t(this, _t).call(this, u);
|
|
924
922
|
l = p ? parseInt(p.dataset.col, 10) : 0;
|
|
925
923
|
}
|
|
926
924
|
} else {
|
|
927
|
-
l = t(this, Dt).call(this, i,
|
|
925
|
+
l = t(this, Dt).call(this, i, n);
|
|
928
926
|
const u = t(this, lt).call(this, i), p = t(this, _t).call(this, u), m = p ? parseInt(p.dataset.col, 10) + parseInt(p.colSpan || 1, 10) : 0;
|
|
929
927
|
l >= m && (c = i + 1, l = 0);
|
|
930
928
|
}
|
|
931
929
|
break;
|
|
932
930
|
case "ArrowRight":
|
|
933
|
-
l = t(this, Dt).call(this, i,
|
|
931
|
+
l = t(this, Dt).call(this, i, n);
|
|
934
932
|
break;
|
|
935
933
|
case "ArrowLeft":
|
|
936
|
-
l = t(this, Ot).call(this, i,
|
|
934
|
+
l = t(this, Ot).call(this, i, n);
|
|
937
935
|
break;
|
|
938
936
|
case "ArrowDown":
|
|
939
937
|
s.preventDefault(), c = i + (e.rowSpan || 1);
|
|
@@ -950,7 +948,7 @@ const os = class os {
|
|
|
950
948
|
};
|
|
951
949
|
B = new WeakMap(), at = new WeakMap(), Nt = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), At = new WeakSet(), // π― μ
μ΄ λ³΄μ΄μ§ μλ μμμ μμ λ 컨ν
μ΄λ μ€ν¬λ‘€μ λκΈ°ννλ ν¨μ
|
|
952
950
|
Rs = /* @__PURE__ */ d(function(s) {
|
|
953
|
-
}, "#ensureCellVisible"), _t = new WeakMap(), Dt = new WeakMap(), Ot = new WeakMap(), lt = new WeakMap(),
|
|
951
|
+
}, "#ensureCellVisible"), _t = new WeakMap(), Dt = new WeakMap(), Ot = new WeakMap(), lt = new WeakMap(), Ye = new WeakMap(), le = new WeakMap(), As = /* @__PURE__ */ d(function() {
|
|
954
952
|
t(this, B).addEventListener("keydown", (s) => {
|
|
955
953
|
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
956
954
|
});
|
|
@@ -975,8 +973,8 @@ const qt = class qt extends HTMLElement {
|
|
|
975
973
|
t(this, F).table = Le.compile(e), t(this, F).tbody = {
|
|
976
974
|
tr: t(this, F).table.querySelectorAll("tbody tr")
|
|
977
975
|
}, t(this, he).call(this), t(this, de).call(this);
|
|
978
|
-
const
|
|
979
|
-
|
|
976
|
+
const r = this.querySelector(".ng-container-body .ng-part-header"), n = this.querySelector(".ng-container-body .ng-part-footer"), a = this.querySelector(".ng-nodata-overlay");
|
|
977
|
+
r && a && (a.style.top = `${r.offsetHeight}px`), n && a && (a.style.bottom = `${n.offsetHeight}px`), t(this, ct).initialize(), setTimeout(() => {
|
|
980
978
|
var o;
|
|
981
979
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
982
980
|
}, 0);
|
|
@@ -986,37 +984,37 @@ const qt = class qt extends HTMLElement {
|
|
|
986
984
|
{ selector: ".ng-container-body", type: null },
|
|
987
985
|
{ selector: ".ng-container-left", type: "left" },
|
|
988
986
|
{ selector: ".ng-container-right", type: "right" }
|
|
989
|
-
].forEach(({ selector:
|
|
987
|
+
].forEach(({ selector: r, type: n }) => {
|
|
990
988
|
var a, o, i;
|
|
991
|
-
(a = this.querySelector(`${
|
|
989
|
+
(a = this.querySelector(`${r} .ng-part-header`)) == null || a.appendChild(t(this, yt).call(this, t(this, F).table, n, "header")), (o = this.querySelector(`${r} .ng-virtual-spacer`)) == null || o.before(t(this, yt).call(this, t(this, F).table, n, "body")), (i = this.querySelector(`${r} .ng-part-footer`)) == null || i.appendChild(t(this, yt).call(this, t(this, F).table, n, "footer"));
|
|
992
990
|
});
|
|
993
991
|
}, "#renderSplitContainers"));
|
|
994
992
|
h(this, de, /* @__PURE__ */ d(() => {
|
|
995
993
|
["left", "right", "body"].forEach((e) => {
|
|
996
|
-
const
|
|
997
|
-
if (!
|
|
994
|
+
const r = this.querySelector(`.ng-container-${e}`), n = r == null ? void 0 : r.querySelectorAll("table");
|
|
995
|
+
if (!r || !n || n.length === 0) return;
|
|
998
996
|
let a = 0;
|
|
999
|
-
|
|
997
|
+
n[0].querySelectorAll("col").forEach((o) => {
|
|
1000
998
|
const i = parseInt(o.getAttribute("width"), 10);
|
|
1001
999
|
isNaN(i) || (a += i);
|
|
1002
|
-
}), e === "body" ? (
|
|
1000
|
+
}), e === "body" ? (r.style.flex = "1", n.forEach((o) => {
|
|
1003
1001
|
o.style.width = `${a}px`, o.style.minWidth = `${a}px`;
|
|
1004
|
-
})) : (
|
|
1002
|
+
})) : (r.style.flex = `0 0 ${a}px`, r.style.width = `${a}px`, n.forEach((o) => {
|
|
1005
1003
|
o.style.width = `${a}px`, o.style.minWidth = `${a}px`;
|
|
1006
1004
|
}));
|
|
1007
1005
|
});
|
|
1008
1006
|
}, "#updateContainerWidths"));
|
|
1009
|
-
h(this, yt, /* @__PURE__ */ d((e,
|
|
1007
|
+
h(this, yt, /* @__PURE__ */ d((e, r, n) => {
|
|
1010
1008
|
const a = e.cloneNode(!0), o = a.querySelector("thead"), i = a.querySelector("tbody"), c = a.querySelector("tfoot");
|
|
1011
|
-
if (
|
|
1009
|
+
if (n === "header") {
|
|
1012
1010
|
if (i && i.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
1013
1011
|
const f = document.createElement("tbody");
|
|
1014
1012
|
f.className = "fixed-tbody", a.appendChild(f);
|
|
1015
1013
|
}
|
|
1016
|
-
} else
|
|
1017
|
-
return
|
|
1014
|
+
} else n === "body" ? (o && o.remove(), c && c.remove(), i && (i.className = "bindable-tbody")) : n === "footer" && (o && o.remove(), i && i.remove());
|
|
1015
|
+
return r === "left" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1018
1016
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
1019
|
-
}) :
|
|
1017
|
+
}) : r === "right" ? a.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
1020
1018
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
1021
1019
|
}) : a.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
1022
1020
|
l.remove();
|
|
@@ -1024,12 +1022,12 @@ const qt = class qt extends HTMLElement {
|
|
|
1024
1022
|
}, "#createSplitTable"));
|
|
1025
1023
|
A(this, "getRowHeight", /* @__PURE__ */ d(() => t(this, ct).getRowHeight(), "getRowHeight"));
|
|
1026
1024
|
A(this, "scrollToX", /* @__PURE__ */ d((e) => {
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1025
|
+
const r = this.querySelector(".ng-container-body .ng-part-body");
|
|
1026
|
+
r && (r.scrollLeft = e);
|
|
1029
1027
|
}, "scrollToX"));
|
|
1030
1028
|
A(this, "scrollToY", /* @__PURE__ */ d((e) => {
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1029
|
+
const r = this.querySelector(".ng-container-body .ng-part-body");
|
|
1030
|
+
r && (r.scrollTop = e);
|
|
1033
1031
|
}, "scrollToY"));
|
|
1034
1032
|
h(this, fe, /* @__PURE__ */ d(() => {
|
|
1035
1033
|
t(this, ue).call(this), y(this, Wt, new Ie(this)), y(this, zt, new Me(this));
|
|
@@ -1263,14 +1261,14 @@ const is = class is extends HTMLElement {
|
|
|
1263
1261
|
super();
|
|
1264
1262
|
h(this, ge, /* @__PURE__ */ d(() => {
|
|
1265
1263
|
var e;
|
|
1266
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1264
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (r) => {
|
|
1267
1265
|
var o;
|
|
1268
|
-
const
|
|
1269
|
-
t(this, Bt).call(this, a,
|
|
1266
|
+
const n = r.ctrlKey || r.metaKey || r.shiftKey, a = parseInt((o = r.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
1267
|
+
t(this, Bt).call(this, a, n);
|
|
1270
1268
|
}), t(this, Bt).call(this, 0, !1);
|
|
1271
1269
|
}, "#init"));
|
|
1272
|
-
h(this, Bt, /* @__PURE__ */ d((e,
|
|
1273
|
-
const
|
|
1270
|
+
h(this, Bt, /* @__PURE__ */ d((e, r = !1) => {
|
|
1271
|
+
const n = /* @__PURE__ */ d(() => {
|
|
1274
1272
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1275
1273
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
1276
1274
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
@@ -1280,7 +1278,7 @@ const is = class is extends HTMLElement {
|
|
|
1280
1278
|
});
|
|
1281
1279
|
}, "updateSplitters"), a = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), i = a.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
1282
1280
|
if (!i[e]) return;
|
|
1283
|
-
if (!
|
|
1281
|
+
if (!r)
|
|
1284
1282
|
i.forEach((f, g) => {
|
|
1285
1283
|
f.classList.toggle("active", g === e);
|
|
1286
1284
|
}), c.forEach((f, g) => {
|
|
@@ -1298,7 +1296,7 @@ const is = class is extends HTMLElement {
|
|
|
1298
1296
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
1299
1297
|
l == null || l.forEach((f) => {
|
|
1300
1298
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
1301
|
-
}),
|
|
1299
|
+
}), n();
|
|
1302
1300
|
}, "#switchSheet"));
|
|
1303
1301
|
}
|
|
1304
1302
|
connectedCallback() {
|
|
@@ -1322,12 +1320,12 @@ const as = class as {
|
|
|
1322
1320
|
var c, l;
|
|
1323
1321
|
const s = Array.from(t(this, N).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1324
1322
|
if (s.length === 0) return;
|
|
1325
|
-
const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10,
|
|
1323
|
+
const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10, r = Math.max(...s.map((f) => f.getRowHeight())), n = (c = t(this, N).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, a = (l = t(this, N).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = Xt.SCROLLBAR_SIZE, i = e * r + n + a + o;
|
|
1326
1324
|
t(this, N).style.height = `${i}px`;
|
|
1327
1325
|
}, "#applyAutoHeight"));
|
|
1328
1326
|
h(this, pe, /* @__PURE__ */ d(() => {
|
|
1329
|
-
const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"),
|
|
1330
|
-
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l <
|
|
1327
|
+
const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"), r = t(this, N).getAttribute("auto-height") === "true", n = e.length, a = e.map((c, l) => {
|
|
1328
|
+
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1331
1329
|
return g + b;
|
|
1332
1330
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1333
1331
|
t(this, N).shadowRoot.innerHTML = `
|
|
@@ -1337,7 +1335,7 @@ const as = class as {
|
|
|
1337
1335
|
flex-direction: column;
|
|
1338
1336
|
position: relative;
|
|
1339
1337
|
overflow: hidden;
|
|
1340
|
-
height: ${
|
|
1338
|
+
height: ${r ? "auto" : "100%"};
|
|
1341
1339
|
background: #fff;
|
|
1342
1340
|
}
|
|
1343
1341
|
|
|
@@ -1454,7 +1452,7 @@ const as = class as {
|
|
|
1454
1452
|
const i = t(this, N).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1455
1453
|
i == null || i.forEach((c, l) => {
|
|
1456
1454
|
e[l] && setTimeout(() => {
|
|
1457
|
-
c.generate(e[l]),
|
|
1455
|
+
c.generate(e[l]), r && t(this, Pt).call(this);
|
|
1458
1456
|
});
|
|
1459
1457
|
});
|
|
1460
1458
|
}, "#render"));
|
|
@@ -1494,8 +1492,8 @@ const z = class z {
|
|
|
1494
1492
|
y(this, Z, []);
|
|
1495
1493
|
const s = t(this, O).template || [];
|
|
1496
1494
|
Array.from(s).forEach((e) => {
|
|
1497
|
-
var
|
|
1498
|
-
t(this, Z).push(((
|
|
1495
|
+
var r;
|
|
1496
|
+
t(this, Z).push(((r = e.getBoundingClientRect) == null ? void 0 : r.call(e).height) || 24);
|
|
1499
1497
|
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1500
1498
|
e.__ng || (e.__ng = t(this, jt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1501
1499
|
});
|
|
@@ -1508,16 +1506,16 @@ const z = class z {
|
|
|
1508
1506
|
}, "#invalidate"));
|
|
1509
1507
|
A(this, "get", /* @__PURE__ */ d((s, e) => {
|
|
1510
1508
|
var a;
|
|
1511
|
-
const
|
|
1512
|
-
if (!
|
|
1513
|
-
if (s == null) return t(this, wt).call(this,
|
|
1514
|
-
if (s < 0 || s >=
|
|
1515
|
-
const
|
|
1509
|
+
const r = this.getValidData();
|
|
1510
|
+
if (!r || r.length <= 0) return;
|
|
1511
|
+
if (s == null) return t(this, wt).call(this, r);
|
|
1512
|
+
if (s < 0 || s >= r.length) return null;
|
|
1513
|
+
const n = typeof ((a = t(this, O).fields) == null ? void 0 : a.get) == "function" ? t(this, O).fields.get() : [];
|
|
1516
1514
|
if (e != null) {
|
|
1517
|
-
const o =
|
|
1518
|
-
return o >= 0 ?
|
|
1515
|
+
const o = n.indexOf(e);
|
|
1516
|
+
return o >= 0 ? r[s].v[o] : null;
|
|
1519
1517
|
}
|
|
1520
|
-
return t(this, wt).call(this,
|
|
1518
|
+
return t(this, wt).call(this, r[s]);
|
|
1521
1519
|
}, "get"));
|
|
1522
1520
|
A(this, "set", /* @__PURE__ */ d((s) => {
|
|
1523
1521
|
this.clear(), this.add(s, !1), t(this, ht).call(this);
|
|
@@ -1539,41 +1537,41 @@ const z = class z {
|
|
|
1539
1537
|
t(this, L).rawRecords = [], y(this, W, []), y(this, xt, []), (s = t(this, L).viewRecords) != null && s.reset && t(this, L).viewRecords.reset();
|
|
1540
1538
|
}, "clear"));
|
|
1541
1539
|
h(this, xe, /* @__PURE__ */ d((s) => {
|
|
1542
|
-
var
|
|
1540
|
+
var n;
|
|
1543
1541
|
Array.isArray(s) || (s = [s]);
|
|
1544
|
-
const e = typeof ((
|
|
1542
|
+
const e = typeof ((n = t(this, O).fields) == null ? void 0 : n.get) == "function" ? t(this, O).fields.get() : Object.keys(s[0] || {}), r = [];
|
|
1545
1543
|
return s.forEach((a) => {
|
|
1546
1544
|
const o = { v: [] };
|
|
1547
1545
|
e.forEach((i) => {
|
|
1548
1546
|
o.v.push(a[i] !== void 0 && a[i] !== null ? a[i] : "");
|
|
1549
|
-
}),
|
|
1550
|
-
}),
|
|
1547
|
+
}), r.push(o);
|
|
1548
|
+
}), r;
|
|
1551
1549
|
}, "#json2Array"));
|
|
1552
1550
|
h(this, we, /* @__PURE__ */ d((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1553
1551
|
e.__ng = t(this, jt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = z.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1554
1552
|
}), s), "#defaultInsert"));
|
|
1555
1553
|
A(this, "add", /* @__PURE__ */ d((s, e = !0) => {
|
|
1556
1554
|
s === void 0 && (s = {});
|
|
1557
|
-
const
|
|
1558
|
-
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, we).call(this,
|
|
1559
|
-
const
|
|
1560
|
-
return e ||
|
|
1561
|
-
const i = t(this, L).rawRecords[
|
|
1555
|
+
const r = t(this, xe).call(this, s);
|
|
1556
|
+
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, we).call(this, r)), this.resetRecords();
|
|
1557
|
+
const n = this.count() - 1;
|
|
1558
|
+
return e || r.forEach((a, o) => {
|
|
1559
|
+
const i = t(this, L).rawRecords[n - o];
|
|
1562
1560
|
i && (i.__ng.rowState = z.ROW_STATE.EMPTY);
|
|
1563
|
-
}), t(this, ht).call(this),
|
|
1561
|
+
}), t(this, ht).call(this), n;
|
|
1564
1562
|
}, "add"));
|
|
1565
1563
|
A(this, "delete", /* @__PURE__ */ d((s) => {
|
|
1566
1564
|
let e = [];
|
|
1567
|
-
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(s, 10)], e.sort((
|
|
1568
|
-
if (t(this, W)[
|
|
1569
|
-
const
|
|
1570
|
-
t(this, W)[
|
|
1571
|
-
a.__ng.rowid ===
|
|
1565
|
+
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(s, 10)], e.sort((r, n) => n - r).forEach((r) => {
|
|
1566
|
+
if (t(this, W)[r]) {
|
|
1567
|
+
const n = t(this, W)[r].__ng.rowid;
|
|
1568
|
+
t(this, W)[r].__ng.rowState === z.ROW_STATE.INSERT ? t(this, L).rawRecords = t(this, L).rawRecords.filter((a) => a.__ng.rowid !== n) : t(this, L).rawRecords.forEach((a) => {
|
|
1569
|
+
a.__ng.rowid === n && (a.__ng.deleted = !0, a.__ng.rowState = z.ROW_STATE.DELETE);
|
|
1572
1570
|
});
|
|
1573
1571
|
}
|
|
1574
1572
|
}), this.resetRecords(), t(this, ht).call(this);
|
|
1575
1573
|
}, "delete"));
|
|
1576
|
-
A(this, "setValue", /* @__PURE__ */ d((s, e,
|
|
1574
|
+
A(this, "setValue", /* @__PURE__ */ d((s, e, r) => {
|
|
1577
1575
|
var c;
|
|
1578
1576
|
s = parseInt(s, 10);
|
|
1579
1577
|
const a = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
@@ -1581,7 +1579,7 @@ const z = class z {
|
|
|
1581
1579
|
const o = this.getValidData()[s];
|
|
1582
1580
|
if (!o) return;
|
|
1583
1581
|
const i = o.v[a];
|
|
1584
|
-
i !==
|
|
1582
|
+
i !== r && o.__ng.rowState !== z.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = i), o.__ng.rowState = z.ROW_STATE.UPDATE), o.v[a] = r;
|
|
1585
1583
|
}, "setValue"));
|
|
1586
1584
|
A(this, "resetRecords", /* @__PURE__ */ d(() => {
|
|
1587
1585
|
y(this, xt, t(this, L).rawRecords.filter((s) => !s.__ng.deleted)), y(this, W, t(this, L).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, L).rawRecords.forEach((s, e) => {
|
|
@@ -1594,9 +1592,9 @@ const z = class z {
|
|
|
1594
1592
|
h(this, wt, /* @__PURE__ */ d((s) => {
|
|
1595
1593
|
var o;
|
|
1596
1594
|
if (!s) return s;
|
|
1597
|
-
const e = !Array.isArray(s),
|
|
1595
|
+
const e = !Array.isArray(s), r = e ? [s] : s, n = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [], a = r.filter((i) => !i.__ng.deleted).map((i) => {
|
|
1598
1596
|
const c = {};
|
|
1599
|
-
return
|
|
1597
|
+
return n.forEach((l, f) => {
|
|
1600
1598
|
c[l] = i.v ? i.v[f] : i[l];
|
|
1601
1599
|
}), c.__ng = i.__ng, c;
|
|
1602
1600
|
});
|
|
@@ -1643,14 +1641,14 @@ const cs = class cs {
|
|
|
1643
1641
|
}, this.setDataSource = (e) => {
|
|
1644
1642
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1645
1643
|
}, this.getRowState = (e) => {
|
|
1646
|
-
var
|
|
1647
|
-
const
|
|
1648
|
-
if (!(
|
|
1649
|
-
return (a = (
|
|
1644
|
+
var n, a;
|
|
1645
|
+
const r = parseInt(e, 10);
|
|
1646
|
+
if (!(r >= this.data.count()))
|
|
1647
|
+
return (a = (n = this.data.getValidData()[r]) == null ? void 0 : n.__ng) == null ? void 0 : a.rowState;
|
|
1650
1648
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1651
1649
|
this.row.at = e;
|
|
1652
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e,
|
|
1653
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1650
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, r) => this.data.get(e, r), this.setColumn = (e, r, n) => {
|
|
1651
|
+
e = parseInt(e, 10), this.data.setValue(e, r, n);
|
|
1654
1652
|
}, this.setDataSource([]);
|
|
1655
1653
|
}
|
|
1656
1654
|
};
|
|
@@ -1663,27 +1661,27 @@ const hs = class hs {
|
|
|
1663
1661
|
h(this, vt);
|
|
1664
1662
|
h(this, M, []);
|
|
1665
1663
|
A(this, "add", /* @__PURE__ */ d((s, e = "string") => {
|
|
1666
|
-
s.forEach((
|
|
1667
|
-
t(this, M).some((
|
|
1664
|
+
s.forEach((r) => {
|
|
1665
|
+
t(this, M).some((n) => n.name === r) || t(this, M).push({ name: r, type: e });
|
|
1668
1666
|
}), t(this, Vt).call(this);
|
|
1669
1667
|
}, "add"));
|
|
1670
1668
|
h(this, Vt, /* @__PURE__ */ d(() => {
|
|
1671
1669
|
const s = /* @__PURE__ */ new Map();
|
|
1672
1670
|
t(this, M).forEach((e) => {
|
|
1673
1671
|
s.set(e.name, e.type);
|
|
1674
|
-
}), y(this, M, Array.from(s, ([e,
|
|
1672
|
+
}), y(this, M, Array.from(s, ([e, r]) => ({ name: e, type: r }))), y(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, r) => e.name.length < r.name.length ? 1 : -1);
|
|
1675
1673
|
}, "#adjust"));
|
|
1676
1674
|
h(this, ve, /* @__PURE__ */ d(() => {
|
|
1677
1675
|
y(this, M, []), q.log(t(this, vt).querySelectorAll("table"));
|
|
1678
1676
|
const s = Array.from(t(this, vt).querySelectorAll("table"));
|
|
1679
1677
|
if (!(!s || s.length === 0)) {
|
|
1680
1678
|
for (const e of s)
|
|
1681
|
-
q.log(e), $("[data-bind]", e).each((
|
|
1682
|
-
const a =
|
|
1679
|
+
q.log(e), $("[data-bind]", e).each((r, n) => {
|
|
1680
|
+
const a = n.dataset.bind, o = n.getAttribute("data-type") || "string";
|
|
1683
1681
|
a && t(this, M).push({ name: a, type: o });
|
|
1684
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1685
|
-
$(`[${
|
|
1686
|
-
var o = a.getAttribute(
|
|
1682
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((r) => {
|
|
1683
|
+
$(`[${r}]`, e).each((n, a) => {
|
|
1684
|
+
var o = a.getAttribute(r);
|
|
1687
1685
|
if (o.indexOf("data.") < 0) {
|
|
1688
1686
|
const i = o.search(/[(]/g);
|
|
1689
1687
|
if (i > 0)
|
|
@@ -1717,7 +1715,7 @@ const hs = class hs {
|
|
|
1717
1715
|
}
|
|
1718
1716
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1719
1717
|
getType(s) {
|
|
1720
|
-
const e = t(this, M).find((
|
|
1718
|
+
const e = t(this, M).find((r) => r.name === s);
|
|
1721
1719
|
return e ? e.type : "string";
|
|
1722
1720
|
}
|
|
1723
1721
|
indexOf(s) {
|
|
@@ -1790,15 +1788,15 @@ const fs = class fs extends ze {
|
|
|
1790
1788
|
A(this, "getDisplayText", /* @__PURE__ */ d((e) => {
|
|
1791
1789
|
if (t(this, w))
|
|
1792
1790
|
if (t(this, w).closest("tbody")) {
|
|
1793
|
-
const
|
|
1794
|
-
if (!
|
|
1791
|
+
const r = t(this, w).closest("tr").data, n = parseInt(t(this, w).dataset.row);
|
|
1792
|
+
if (!r) return "";
|
|
1795
1793
|
if (ninegrid.isNull(t(this, w).dataset.expr)) {
|
|
1796
1794
|
if (!ninegrid.isNull(t(this, w).dataset.bind))
|
|
1797
|
-
return
|
|
1795
|
+
return r[t(this, w).dataset.bind] || ninegrid.nvl(e, "");
|
|
1798
1796
|
} else try {
|
|
1799
|
-
return this.getExprValue(t(this, w).dataset.expr,
|
|
1797
|
+
return this.getExprValue(t(this, w).dataset.expr, r, n, t(this, w));
|
|
1800
1798
|
} catch {
|
|
1801
|
-
console.error(t(this, w).dataset.expr,
|
|
1799
|
+
console.error(t(this, w).dataset.expr, r, t(this, w).dataset.row);
|
|
1802
1800
|
}
|
|
1803
1801
|
return ninegrid.nvl(e, "");
|
|
1804
1802
|
} else
|
|
@@ -1811,14 +1809,14 @@ const fs = class fs extends ze {
|
|
|
1811
1809
|
if (!(!t(this, I) || !t(this, I).template || !t(this, w).closest("tbody.bindable"))) {
|
|
1812
1810
|
var e = ninegrid.j.querySelectorAll(t(this, w)).attr("suppress");
|
|
1813
1811
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1814
|
-
var
|
|
1815
|
-
$("th,td",
|
|
1812
|
+
var r = t(this, w).closest("tr"), n = [];
|
|
1813
|
+
$("th,td", r).each((x, T) => {
|
|
1816
1814
|
var E = ninegrid.j.querySelectorAll(T).attr("suppress");
|
|
1817
|
-
E && T.dataset.row && (E = parseInt(E), !isNaN(E) && E <= e &&
|
|
1818
|
-
}),
|
|
1815
|
+
E && T.dataset.row && (E = parseInt(E), !isNaN(E) && E <= e && n.push(E));
|
|
1816
|
+
}), n.sort();
|
|
1819
1817
|
var a = !1;
|
|
1820
|
-
if (parseInt(
|
|
1821
|
-
for (var o of
|
|
1818
|
+
if (parseInt(r.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1819
|
+
for (var o of n) {
|
|
1822
1820
|
if (o > e) break;
|
|
1823
1821
|
var i = parseInt(t(this, w).dataset.row), c = i - 1, l = t(this, w).closest("tr").data, f = t(this, I).data.get(c);
|
|
1824
1822
|
t(this, w).dataset.matrixRow;
|
|
@@ -1836,12 +1834,12 @@ const fs = class fs extends ze {
|
|
|
1836
1834
|
}
|
|
1837
1835
|
}
|
|
1838
1836
|
}, "#resetSuppress"));
|
|
1839
|
-
A(this, "getExprValue", /* @__PURE__ */ d((e,
|
|
1837
|
+
A(this, "getExprValue", /* @__PURE__ */ d((e, r, n, a) => {
|
|
1840
1838
|
if (typeof e < "u")
|
|
1841
1839
|
try {
|
|
1842
|
-
|
|
1840
|
+
n = parseInt(n);
|
|
1843
1841
|
const o = e.replace("()", "");
|
|
1844
|
-
return t(this, I)[o] ? t(this, I)[o].call(this,
|
|
1842
|
+
return t(this, I)[o] ? t(this, I)[o].call(this, r, n, t(this, w)) : t(this, I).exprFunction(e).call(this, r, n, t(this, I).data);
|
|
1845
1843
|
} catch {
|
|
1846
1844
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1847
1845
|
}
|
|
@@ -1857,9 +1855,9 @@ const fs = class fs extends ze {
|
|
|
1857
1855
|
return e ?? "";
|
|
1858
1856
|
}
|
|
1859
1857
|
set value(e) {
|
|
1860
|
-
var
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1858
|
+
var r = parseInt(t(this, w).dataset.row);
|
|
1859
|
+
const n = this.getAttribute("update-row-state") != "false";
|
|
1860
|
+
r < 0 ? t(this, I).data.setValueNF(parseInt(t(this, w).dataset.index), t(this, w).dataset.bind, e, n) : t(this, I).data.setValue(r, t(this, w).dataset.bind, e, n);
|
|
1863
1861
|
}
|
|
1864
1862
|
get row() {
|
|
1865
1863
|
return parseInt(t(this, w).dataset.row);
|
|
@@ -1936,10 +1934,10 @@ const gs = class gs extends Pe {
|
|
|
1936
1934
|
if (t(this, ut) == "number") {
|
|
1937
1935
|
let a = [];
|
|
1938
1936
|
if (t(this, G) && Number(t(this, G)) > 0 && a.push("."), t(this, Rt) && Number(t(this, Rt)) >= 0 && a.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !a.includes(e.key) && e.preventDefault(), t(this, G) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1939
|
-
var
|
|
1940
|
-
if (
|
|
1941
|
-
var
|
|
1942
|
-
|
|
1937
|
+
var r = e.target.value, n = r.indexOf(".");
|
|
1938
|
+
if (n >= 0) {
|
|
1939
|
+
var r = r.substr(n + 1, r.length);
|
|
1940
|
+
r.length >= Number(t(this, G)) && e.preventDefault();
|
|
1943
1941
|
}
|
|
1944
1942
|
}
|
|
1945
1943
|
}
|
|
@@ -1949,8 +1947,8 @@ const gs = class gs extends Pe {
|
|
|
1949
1947
|
if (this.applyBaseStyle(), y(this, ut, this.getAttribute("type") || "text"), y(this, St, this.getAttribute("maxbyte")), y(this, Rt, this.getAttribute("min")), y(this, Ae, this.getAttribute("max")), y(this, G, this.getAttribute("scale")), !["text", "number"].includes(t(this, ut))) throw `invalid type : ${t(this, ut)}`;
|
|
1950
1948
|
}
|
|
1951
1949
|
connectedCallback() {
|
|
1952
|
-
for (var e = [],
|
|
1953
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1950
|
+
for (var e = [], r = 0; r < this.attributes.length; r++)
|
|
1951
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[r].name) && e.push(`${this.attributes[r].name}="${this.attributes[r].value}"`);
|
|
1954
1952
|
this.innerHTML = `
|
|
1955
1953
|
<input type="text"
|
|
1956
1954
|
${e.join(" ")}
|