@ninebone/table 0.0.714 β 0.0.716
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 +372 -363
- 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
|
@@ -2,16 +2,16 @@ var ns = Object.defineProperty;
|
|
|
2
2
|
var rs = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var as = (q,
|
|
6
|
-
var h = (q,
|
|
7
|
-
var A = (q,
|
|
8
|
-
var t = (q,
|
|
9
|
-
var os = (q,
|
|
5
|
+
var as = (q, n, e) => n in q ? ns(q, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[n] = e;
|
|
6
|
+
var h = (q, n) => ns(q, "name", { value: n, configurable: !0 });
|
|
7
|
+
var A = (q, n, e) => as(q, typeof n != "symbol" ? n + "" : n, e), fe = (q, n, e) => n.has(q) || rs("Cannot " + e);
|
|
8
|
+
var t = (q, n, e) => (fe(q, n, "read from private field"), e ? e.call(q) : n.get(q)), d = (q, n, e) => n.has(q) ? rs("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(q) : n.set(q, e), p = (q, n, e, s) => (fe(q, n, "write to private field"), s ? s.call(q, e) : n.set(q, e), e), dt = (q, n, e) => (fe(q, n, "access private method"), e);
|
|
9
|
+
var os = (q, n, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
p(q,
|
|
11
|
+
p(q, n, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(q,
|
|
14
|
+
return t(q, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as ls } from "@ninebone/util";
|
|
@@ -23,28 +23,28 @@ const We = class We extends ls.constructor {
|
|
|
23
23
|
h(We, "Trace");
|
|
24
24
|
let ue = We;
|
|
25
25
|
const E = new ue();
|
|
26
|
-
var
|
|
26
|
+
var D, V, R, Z, G, J, Dt, Q, Pt;
|
|
27
27
|
const Be = class Be extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
31
|
-
d(this,
|
|
30
|
+
d(this, D);
|
|
31
|
+
d(this, V, !1);
|
|
32
32
|
d(this, R);
|
|
33
|
-
d(this, K);
|
|
34
33
|
d(this, Z);
|
|
35
34
|
d(this, G);
|
|
35
|
+
d(this, J);
|
|
36
36
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (p(this,
|
|
37
|
+
if (!t(this, D)) return;
|
|
38
|
+
const e = t(this, D).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
+
e && (p(this, J, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, J).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this, R).container,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this, R).track, o = t(this, R).thumb, i = t(this,
|
|
44
|
+
if (!t(this, D) || !t(this, R) || t(this, V)) return;
|
|
45
|
+
const e = t(this, R).container, s = e.querySelector("table");
|
|
46
|
+
if (!s) return;
|
|
47
|
+
const r = t(this, R).track, o = t(this, R).thumb, i = t(this, D).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -61,33 +61,33 @@ const Be = class Be extends HTMLElement {
|
|
|
61
61
|
const y = l - f;
|
|
62
62
|
g > y && (g = y), o.style.left = `${g}px`, t(this, R).left.disabled = g === 0, t(this, R).right.disabled = g >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, Q, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, R)) return !1;
|
|
66
|
-
const
|
|
66
|
+
const s = t(this, R).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
68
|
const o = t(this, R).track.getBoundingClientRect(), i = t(this, R).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = o.width - i;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, R).thumb.style.left = `${a}px`, t(this, R).left.disabled = a === 0, t(this, R).right.disabled = a >= c - 1;
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && u > 0 && (
|
|
73
|
+
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, Z)), clearInterval(t(this, G));
|
|
79
79
|
const o = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Q).call(this, o + r), p(this, Z, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Z)), p(this, G, setInterval(() => {
|
|
82
82
|
const i = parseInt(t(this, R).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Q).call(this, i + r) || clearInterval(t(this, G));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, Z)), clearInterval(t(this, G));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this, R).left.addEventListener(r,
|
|
90
|
+
t(this, R).left.addEventListener(r, s), t(this, R).right.addEventListener(r, s), t(this, R).track.addEventListener(r, s);
|
|
91
91
|
}), t(this, R).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
93
|
}), t(this, R).right.addEventListener("mousedown", (r) => {
|
|
@@ -96,23 +96,23 @@ const Be = class Be extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const o = t(this, R).track.getBoundingClientRect(), i = t(this, R).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Q).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, R).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), p(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, V, !0), this.shiftX = r.clientX - t(this, R).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, V)) return;
|
|
105
105
|
const c = t(this, R).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Q).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this,
|
|
108
|
+
p(this, V, !1), s(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, D, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, D)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,49 +177,49 @@ const Be = class Be extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const s = t(this, D).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
p(this, R, {
|
|
186
|
-
container:
|
|
186
|
+
container: s,
|
|
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
|
-
}),
|
|
192
|
-
t(this,
|
|
191
|
+
}), s.addEventListener("scroll", () => {
|
|
192
|
+
t(this, V) || this.refresh();
|
|
193
193
|
}), t(this, Pt).call(this), t(this, Dt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, J) && t(this, J).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
D = new WeakMap(), V = new WeakMap(), R = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), J = new WeakMap(), Dt = new WeakMap(), Q = new WeakMap(), Pt = new WeakMap(), h(Be, "NineTableHScrollBar");
|
|
202
202
|
let ge = Be;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
204
|
-
var
|
|
204
|
+
var tt, et, ft, C, Et, At, Ft;
|
|
205
205
|
const De = class De extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this, Q);
|
|
209
208
|
d(this, tt);
|
|
209
|
+
d(this, et);
|
|
210
210
|
d(this, ft, !1);
|
|
211
211
|
d(this, C);
|
|
212
212
|
d(this, Et, 0);
|
|
213
213
|
d(this, At, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (E.log("vscrollbar.refresh"), !t(this,
|
|
216
|
-
const e = t(this, C).container,
|
|
215
|
+
if (E.log("vscrollbar.refresh"), !t(this, tt) || !t(this, C)) return;
|
|
216
|
+
const e = t(this, C).container, s = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this, tt).data.length, a = t(this, et).getRowHeight(), c = i * a;
|
|
217
217
|
if (c <= o || i === 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 = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
@@ -232,8 +232,8 @@ const De = class De extends HTMLElement {
|
|
|
232
232
|
}, "refresh"));
|
|
233
233
|
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
234
234
|
E.log("nine-table-vscrollbar.#init");
|
|
235
|
-
const e = t(this, C).container,
|
|
236
|
-
const o = (t(this,
|
|
235
|
+
const e = t(this, C).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
+
const o = (t(this, tt).data.get() || []).length, i = t(this, et).getRowHeight();
|
|
237
237
|
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, C).thumb.addEventListener("mousedown", (r) => {
|
|
@@ -241,12 +241,12 @@ const De = class De extends HTMLElement {
|
|
|
241
241
|
r.stopPropagation(), r.preventDefault(), p(this, ft, !0), p(this, Et, r.clientY), p(this, At, e.scrollTop);
|
|
242
242
|
const o = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, ft)) return;
|
|
244
|
-
const c = t(this, C).track.getBoundingClientRect(), l = t(this, C).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, Et), g = e.clientHeight, y =
|
|
244
|
+
const c = t(this, C).track.getBoundingClientRect(), l = t(this, C).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, Et), g = e.clientHeight, y = s(), v = Math.max(y - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
246
|
const w = b / u * v;
|
|
247
247
|
let m = t(this, At) + w;
|
|
248
|
-
const
|
|
249
|
-
m < 0 && (m = 0), m >
|
|
248
|
+
const _ = Math.max(0, y - g);
|
|
249
|
+
m < 0 && (m = 0), m > _ && (m = _), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
@@ -255,7 +255,7 @@ const De = class De extends HTMLElement {
|
|
|
255
255
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
256
256
|
}), t(this, C).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, C).thumb) return;
|
|
258
|
-
const o = t(this, C).track.getBoundingClientRect(), i = t(this, C).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u =
|
|
258
|
+
const o = t(this, C).track.getBoundingClientRect(), i = t(this, C).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
@@ -269,7 +269,7 @@ const De = class De extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
p(this,
|
|
272
|
+
p(this, tt, this.getRootNode().host), p(this, et, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,13 +334,13 @@ const De = class De 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
|
|
338
|
-
if (!
|
|
337
|
+
const s = t(this, et).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
p(this, C, {
|
|
343
|
-
container:
|
|
343
|
+
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -350,19 +350,19 @@ const De = class De extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
tt = new WeakMap(), et = new WeakMap(), ft = new WeakMap(), C = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Ft = new WeakMap(), h(De, "NineTableVScrollBar");
|
|
354
354
|
let be = De;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", be);
|
|
356
|
-
var
|
|
356
|
+
var F, S, st, P, z, U, nt, qt, Le, He, jt, Yt, Tt, Ct, kt, Vt, Ut, Lt, Ie, ut, Ht, Xt;
|
|
357
357
|
const Pe = class Pe {
|
|
358
|
-
constructor(
|
|
359
|
-
d(this,
|
|
358
|
+
constructor(n) {
|
|
359
|
+
d(this, F);
|
|
360
360
|
d(this, S);
|
|
361
|
-
d(this,
|
|
362
|
-
d(this,
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
361
|
+
d(this, st);
|
|
362
|
+
d(this, P, /* @__PURE__ */ new Map());
|
|
363
|
+
d(this, z, null);
|
|
364
|
+
d(this, U, null);
|
|
365
|
+
d(this, nt, 0);
|
|
366
366
|
d(this, qt, 40);
|
|
367
367
|
d(this, Le, !1);
|
|
368
368
|
d(this, He, !1);
|
|
@@ -371,14 +371,14 @@ const Pe = class Pe {
|
|
|
371
371
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
E.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, Tt).call(this), t(this, Ct).call(this), t(this, ut).call(this, n.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
E.log("rowManager.initialize"), p(this,
|
|
378
|
+
E.log("rowManager.initialize"), p(this, st, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), p(this,
|
|
381
|
+
}), p(this, z, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
382
382
|
const a = t(this, S).querySelector(i);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -386,58 +386,58 @@ const Pe = class Pe {
|
|
|
386
386
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
387
|
if (!l) return;
|
|
388
388
|
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
|
-
t(this,
|
|
389
|
+
t(this, P).set(i, u);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this, Tt).call(this), t(this, Lt).call(this), t(this, Ct).call(this), t(this, ut).call(this,
|
|
391
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), o = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, Tt).call(this), t(this, Lt).call(this), t(this, Ct).call(this), t(this, ut).call(this, n.scrollTop);
|
|
394
394
|
let i = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var u;
|
|
397
397
|
if (i) return;
|
|
398
398
|
i = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), o && o.scrollLeft !== f && (o.scrollLeft = f), t(this, ut).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Yt, /* @__PURE__ */ h((
|
|
409
|
+
d(this, Yt, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
E.log("rowManager.#renderRows");
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
const r =
|
|
411
|
+
const s = t(this, P).get(e);
|
|
412
|
+
if (!s || s.length === 0) return;
|
|
413
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const o = r.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, qt); a++)
|
|
418
|
-
|
|
418
|
+
s.forEach((c) => {
|
|
419
419
|
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this,
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, st).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
426
|
-
const
|
|
424
|
+
if (t(this, z) !== null && t(this, z) > 0)
|
|
425
|
+
return t(this, z);
|
|
426
|
+
const n = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
E.log("rowManager.#measureAndCacheHeight");
|
|
428
|
-
const e = t(this,
|
|
428
|
+
const e = t(this, P).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
|
-
const
|
|
431
|
-
if (E.log(
|
|
432
|
-
|
|
433
|
-
const r =
|
|
430
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
|
+
if (E.log(s), !s) throw new Error("invalid dom");
|
|
432
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
+
const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
435
|
o.appendChild(b.cloneNode(!0));
|
|
436
|
-
}), r ? r.before(o) :
|
|
436
|
+
}), r ? r.before(o) : s.appendChild(o);
|
|
437
437
|
const i = t(this, S), a = i.style.display, c = i.style.visibility, l = i.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
|
-
const u =
|
|
440
|
+
const u = s.querySelectorAll("tr");
|
|
441
441
|
return u.forEach((b) => {
|
|
442
442
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (g === 0) {
|
|
@@ -445,12 +445,12 @@ const Pe = class Pe {
|
|
|
445
445
|
g = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += g;
|
|
448
|
-
}), u.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this,
|
|
448
|
+
}), u.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, z, f), t(this, kt).call(this), t(this, z));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, Ct, /* @__PURE__ */ h(() => {
|
|
451
451
|
E.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this,
|
|
453
|
-
E.log("π [VirtualHeight]", { totalCount: e, rowHeight:
|
|
452
|
+
const e = (t(this, F).data.get() || []).length, s = t(this, z), r = e * s;
|
|
453
|
+
E.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
454
|
const i = t(this, S).querySelector(o);
|
|
455
455
|
if (!i) return;
|
|
456
456
|
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
@@ -458,22 +458,22 @@ const Pe = class Pe {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const
|
|
463
|
-
p(this, qt,
|
|
461
|
+
if (t(this, nt) > 0 && t(this, z) > 0) {
|
|
462
|
+
const n = Math.ceil(t(this, nt) / t(this, z));
|
|
463
|
+
p(this, qt, n + t(this, jt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
466
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, f, u, b;
|
|
468
|
-
const
|
|
468
|
+
const n = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const g =
|
|
470
|
+
const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, y.length, v.length);
|
|
471
471
|
for (let m = 0; m < w; m++) {
|
|
472
|
-
const
|
|
472
|
+
const _ = [
|
|
473
473
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
475
|
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
|
-
], T = Math.max(...
|
|
476
|
+
], T = Math.max(..._);
|
|
477
477
|
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
@@ -481,83 +481,83 @@ const Pe = class Pe {
|
|
|
481
481
|
if (o) {
|
|
482
482
|
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")), v = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, y.length, v.length);
|
|
483
483
|
for (let m = 0; m < w; m++) {
|
|
484
|
-
const
|
|
484
|
+
const _ = [
|
|
485
485
|
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
486
|
((u = y[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
487
487
|
((b = v[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
-
], T = Math.max(...
|
|
488
|
+
], T = Math.max(..._);
|
|
489
489
|
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`), v[m] && (v[m].style.height = `${T}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
494
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this,
|
|
495
|
-
for (const e of
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
494
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, U, new ResizeObserver((n) => {
|
|
495
|
+
for (const e of n) {
|
|
496
|
+
const s = e.target;
|
|
497
|
+
if (!s.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
500
|
let o = 0;
|
|
501
|
-
const i =
|
|
501
|
+
const i = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
503
|
const c = Math.max(r - o, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, nt) !== c && (p(this, nt, c), t(this, kt).call(this), t(this, z) !== null && (t(this, Lt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, U).observe(t(this, S)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
510
|
-
E.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
511
|
-
const e = t(this, S).querySelector(
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Yt).call(this, e,
|
|
510
|
+
E.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
|
+
const e = t(this, S).querySelector(n);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Yt).call(this, e, n);
|
|
513
513
|
}), t(this, Xt).call(this), t(this, Vt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this, Ie, /* @__PURE__ */ h((
|
|
515
|
+
d(this, Ie, /* @__PURE__ */ h((n) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
520
|
-
const r =
|
|
518
|
+
const s = t(this, S).querySelector(e);
|
|
519
|
+
if (!s) return;
|
|
520
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this,
|
|
522
|
+
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, F).data.get() || []).length;
|
|
523
523
|
o.forEach((f, u) => {
|
|
524
|
-
const b =
|
|
524
|
+
const b = n + Math.floor(u / i);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const g = t(this,
|
|
529
|
+
const g = t(this, F).data.get(b);
|
|
530
530
|
f.style.display = "", t(this, Ht).call(this, f, g, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this, ut, /* @__PURE__ */ h((
|
|
534
|
+
d(this, ut, /* @__PURE__ */ h((n) => {
|
|
535
535
|
var u, b;
|
|
536
|
-
const e = t(this,
|
|
536
|
+
const e = t(this, z);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
const r = ((u = t(this,
|
|
538
|
+
const s = t(this, F).data.length;
|
|
539
|
+
if (s === 0) return;
|
|
540
|
+
const r = ((u = t(this, P).get(".ng-container-body")) == null ? void 0 : u.length) || 1, o = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
541
541
|
E.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
|
-
const i = Math.max(0,
|
|
542
|
+
const i = Math.max(0, s - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
E.log(`π [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && E.log(`π [Scroll Inspect] scrollTop: ${
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
544
|
+
E.log(`π [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && E.log(`π [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, st).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, st)) == null || b.scrollTables.forEach((g) => {
|
|
547
547
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (E.log(`π [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
549
549
|
const y = t(this, S).querySelector(g);
|
|
550
550
|
if (!y) return;
|
|
551
551
|
const v = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
552
|
if (!v) return;
|
|
553
|
-
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((m,
|
|
554
|
-
const T = a + Math.floor(
|
|
555
|
-
if (T >=
|
|
553
|
+
Array.from(v.querySelectorAll("tr:not(.nodata)")).forEach((m, _) => {
|
|
554
|
+
const T = a + Math.floor(_ / r);
|
|
555
|
+
if (T >= s) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
m.style.display = "", t(this, Ht).call(this, m,
|
|
559
|
+
const N = t(this, F).data.get(T);
|
|
560
|
+
m.style.display = "", t(this, Ht).call(this, m, N, T);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -575,9 +575,9 @@ const Pe = class Pe {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
d(this, Ht, /* @__PURE__ */ h((
|
|
579
|
-
|
|
580
|
-
r.dataset.row =
|
|
578
|
+
d(this, Ht, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, o) => {
|
|
580
|
+
r.dataset.row = s;
|
|
581
581
|
const i = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
582
|
i && typeof i.refresh == "function" && i.refresh();
|
|
583
583
|
});
|
|
@@ -585,9 +585,9 @@ const Pe = class Pe {
|
|
|
585
585
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
587
|
E.log("rowManager.#syncHeaderHeights");
|
|
588
|
-
const
|
|
588
|
+
const n = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r =
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
|
|
591
591
|
for (let u = 0; u < a; u++) {
|
|
592
592
|
const b = [
|
|
593
593
|
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -598,32 +598,32 @@ const Pe = class Pe {
|
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, U) && (t(this, U).disconnect(), p(this, U, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
p(this,
|
|
603
|
+
p(this, F, n.getRootNode().host), p(this, S, n), t(this, Ut).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
|
-
return t(this,
|
|
606
|
+
return t(this, z);
|
|
607
607
|
}
|
|
608
|
-
templateLength(
|
|
608
|
+
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this,
|
|
610
|
+
return ((e = t(this, P).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
613
|
+
F = new WeakMap(), S = new WeakMap(), st = new WeakMap(), P = new WeakMap(), z = new WeakMap(), U = new WeakMap(), nt = new WeakMap(), qt = new WeakMap(), Le = new WeakMap(), He = new WeakMap(), jt = new WeakMap(), Yt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), kt = new WeakMap(), Vt = new WeakMap(), Ut = new WeakMap(), Lt = new WeakMap(), Ie = new WeakMap(), ut = new WeakMap(), Ht = new WeakMap(), Xt = new WeakMap(), h(Pe, "RowManager");
|
|
614
614
|
let pe = Pe;
|
|
615
615
|
const Kt = class Kt {
|
|
616
616
|
/**
|
|
617
617
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
618
618
|
*/
|
|
619
|
-
static compileAll(
|
|
620
|
-
return Array.isArray(
|
|
619
|
+
static compileAll(n) {
|
|
620
|
+
return Array.isArray(n) ? n.map((e) => Kt.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
624
624
|
*/
|
|
625
|
-
static compile(
|
|
626
|
-
if (!
|
|
625
|
+
static compile(n) {
|
|
626
|
+
if (!n) return null;
|
|
627
627
|
const e = /* @__PURE__ */ h((a) => {
|
|
628
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
@@ -633,7 +633,7 @@ const Kt = class Kt {
|
|
|
633
633
|
let w = [];
|
|
634
634
|
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), y && w.push(`maxbyte="${y}"`), v && w.push(`type="${v}"`), l.innerHTML = `<${u} ${w.join(" ")}></${u}>`;
|
|
635
635
|
});
|
|
636
|
-
}, "processCellTypes"),
|
|
636
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
638
638
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
639
639
|
for (let b = 0; b < l; b++) {
|
|
@@ -659,15 +659,15 @@ const Kt = class Kt {
|
|
|
659
659
|
const v = y.sectionRowIndex;
|
|
660
660
|
let w = 0;
|
|
661
661
|
Array.from(y.querySelectorAll("th,td")).forEach((m) => {
|
|
662
|
-
for (let
|
|
663
|
-
if (g[v][
|
|
664
|
-
w =
|
|
662
|
+
for (let N = 0; N < g[v].length; N++)
|
|
663
|
+
if (g[v][N] === null) {
|
|
664
|
+
w = N;
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
const
|
|
668
|
-
for (let
|
|
667
|
+
const _ = m.rowSpan || 1, T = m.colSpan || 1;
|
|
668
|
+
for (let N = 0; N < _; N++)
|
|
669
669
|
for (let ht = 0; ht < T; ht++)
|
|
670
|
-
v +
|
|
670
|
+
v + N < u && w + ht < b && (g[v + N][w + ht] = N === 0 && ht === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
672
|
}), l.forEach((y) => {
|
|
673
673
|
const v = y.sectionRowIndex;
|
|
@@ -679,8 +679,8 @@ const Kt = class Kt {
|
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"), o =
|
|
683
|
-
return
|
|
682
|
+
}, "resetColIndex"), o = n.cloneNode(!0);
|
|
683
|
+
return s(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
685
|
l && o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
@@ -691,23 +691,23 @@ const Kt = class Kt {
|
|
|
691
691
|
};
|
|
692
692
|
h(Kt, "TableCompiler");
|
|
693
693
|
let ye = Kt;
|
|
694
|
-
var
|
|
694
|
+
var I, j, Y, wt, is;
|
|
695
695
|
const Fe = class Fe {
|
|
696
|
-
constructor(
|
|
697
|
-
d(this,
|
|
698
|
-
d(this,
|
|
699
|
-
d(this,
|
|
696
|
+
constructor(n) {
|
|
697
|
+
d(this, Y);
|
|
698
|
+
d(this, I);
|
|
699
|
+
d(this, j, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
700
|
A(this, "render", /* @__PURE__ */ h(() => {
|
|
701
|
-
const { startRow:
|
|
702
|
-
E.log("π¨ [CellSelection.render] Rendering range ->", t(this,
|
|
703
|
-
const o = t(this,
|
|
701
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, j);
|
|
702
|
+
E.log("π¨ [CellSelection.render] Rendering range ->", t(this, j));
|
|
703
|
+
const o = t(this, I).querySelectorAll(
|
|
704
704
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
705
|
);
|
|
706
706
|
if (o.forEach((a) => {
|
|
707
707
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
708
708
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
709
709
|
});
|
|
710
|
-
}),
|
|
710
|
+
}), n < 0 || e < 0) {
|
|
711
711
|
E.log("β οΈ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
@@ -715,22 +715,28 @@ const Fe = class Fe {
|
|
|
715
715
|
o.forEach((a) => {
|
|
716
716
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
717
717
|
if (c.classList.contains("nodata")) return;
|
|
718
|
-
const { matrixRow: l } = dt(this,
|
|
718
|
+
const { matrixRow: l } = dt(this, Y, wt).call(this, c);
|
|
719
719
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
720
720
|
const u = parseInt(f.dataset.col, 10);
|
|
721
721
|
if (isNaN(u)) return;
|
|
722
722
|
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, v = u + g - 1;
|
|
723
|
-
y >=
|
|
723
|
+
y >= n && l <= s && v >= e && u <= r && (i++, f.classList.add("selected"), l === n && f.classList.add("selected-top"), y === s && f.classList.add("selected-bottom"), u === e && f.classList.add("selected-left"), v === r && f.classList.add("selected-right"));
|
|
724
724
|
});
|
|
725
725
|
});
|
|
726
726
|
}), E.log(`β¨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
727
727
|
}, "render"));
|
|
728
|
-
p(this,
|
|
728
|
+
p(this, I, n), dt(this, Y, is).call(this), t(this, I).querySelectorAll(
|
|
729
|
+
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
730
|
+
).forEach((s) => {
|
|
731
|
+
s.addEventListener("scroll", () => {
|
|
732
|
+
t(this, j).startRow >= 0 && t(this, j).startCol >= 0 && this.render();
|
|
733
|
+
});
|
|
734
|
+
}), E.log("π― [CellSelection] Initialized");
|
|
729
735
|
}
|
|
730
|
-
setRange(
|
|
731
|
-
E.log(`π [CellSelection.setRange] Input -> startRow: ${
|
|
732
|
-
let o = Math.min(
|
|
733
|
-
const l = t(this,
|
|
736
|
+
setRange(n, e, s, r) {
|
|
737
|
+
E.log(`π [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
738
|
+
let o = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
739
|
+
const l = t(this, I).querySelectorAll(
|
|
734
740
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
735
741
|
);
|
|
736
742
|
let f = !0, u = 0;
|
|
@@ -738,46 +744,49 @@ const Fe = class Fe {
|
|
|
738
744
|
f = !1, u++, l.forEach((b) => {
|
|
739
745
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
740
746
|
if (g.classList.contains("nodata")) return;
|
|
741
|
-
const { matrixRow: y } = dt(this,
|
|
747
|
+
const { matrixRow: y } = dt(this, Y, wt).call(this, g);
|
|
742
748
|
y < 0 || g.querySelectorAll("td, th").forEach((v) => {
|
|
743
749
|
const w = parseInt(v.dataset.col, 10);
|
|
744
750
|
if (isNaN(w)) return;
|
|
745
|
-
const m = parseInt(v.rowSpan || 1, 10),
|
|
746
|
-
if (T >= o && y <= i &&
|
|
747
|
-
const Qe = Math.min(o, y), ts = Math.max(i, T), es = Math.min(a, w), ss = Math.max(c,
|
|
751
|
+
const m = parseInt(v.rowSpan || 1, 10), _ = parseInt(v.colSpan || 1, 10), T = y + m - 1, N = w + _ - 1;
|
|
752
|
+
if (T >= o && y <= i && N >= a && w <= c) {
|
|
753
|
+
const Qe = Math.min(o, y), ts = Math.max(i, T), es = Math.min(a, w), ss = Math.max(c, N);
|
|
748
754
|
(Qe !== o || ts !== i || es !== a || ss !== c) && (o = Qe, i = ts, a = es, c = ss, f = !0);
|
|
749
755
|
}
|
|
750
756
|
});
|
|
751
757
|
});
|
|
752
758
|
});
|
|
753
|
-
p(this,
|
|
759
|
+
p(this, j, { startRow: o, startCol: a, endRow: i, endCol: c }), E.log("π¦ [CellSelection.setRange] Final Range ->", t(this, j)), this.render();
|
|
754
760
|
}
|
|
755
761
|
};
|
|
756
|
-
|
|
757
|
-
if (!
|
|
758
|
-
const e = parseInt(
|
|
762
|
+
I = new WeakMap(), j = new WeakMap(), Y = new WeakSet(), wt = /* @__PURE__ */ h(function(n) {
|
|
763
|
+
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
764
|
+
const e = parseInt(n.dataset.row, 10);
|
|
759
765
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
760
|
-
const
|
|
766
|
+
const s = n.closest("tbody"), o = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), i = o.indexOf(n), a = o.length > 0 ? o.length : 1, c = e * a + (i >= 0 ? i : n.sectionRowIndex % a);
|
|
761
767
|
return { dataRow: e, subRowIndex: i, matrixRow: c };
|
|
762
768
|
}, "#getMatrixRow"), is = /* @__PURE__ */ h(function() {
|
|
763
|
-
const
|
|
764
|
-
if (!
|
|
769
|
+
const n = t(this, I).querySelector(".ng-container-top");
|
|
770
|
+
if (!n) {
|
|
765
771
|
E.log("β [CellSelection] .ng-container-top not found!");
|
|
766
772
|
return;
|
|
767
773
|
}
|
|
768
|
-
|
|
774
|
+
n.addEventListener("mousedown", (e) => {
|
|
769
775
|
if (e.button !== 0) return;
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
772
|
-
|
|
773
|
-
|
|
776
|
+
const s = e.target.closest("td, th");
|
|
777
|
+
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
778
|
+
t(this, I).style.userSelect = "none", t(this, I).style.webkitUserSelect = "none";
|
|
779
|
+
const r = s.closest("tr"), { matrixRow: o } = dt(this, Y, wt).call(this, r), i = parseInt(s.dataset.col, 10);
|
|
780
|
+
if (o < 0) {
|
|
781
|
+
t(this, I).style.userSelect = "", t(this, I).style.webkitUserSelect = "";
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
774
784
|
E.log(`π±οΈ [MouseDown Success] startRow: ${o}, startCol: ${i}`), this.setRange(o, i, o, i);
|
|
775
785
|
const a = /* @__PURE__ */ h((l) => {
|
|
776
|
-
l.preventDefault();
|
|
777
786
|
const f = document.elementFromPoint(l.clientX, l.clientY);
|
|
778
787
|
let u = f == null ? void 0 : f.closest("td, th");
|
|
779
|
-
if (!u || !t(this,
|
|
780
|
-
const v = t(this,
|
|
788
|
+
if (!u || !t(this, I).contains(u)) {
|
|
789
|
+
const v = t(this, I).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
781
790
|
for (const w of v) {
|
|
782
791
|
const m = w.getBoundingClientRect();
|
|
783
792
|
if (l.clientX >= m.left && l.clientX <= m.right && l.clientY >= m.top && l.clientY <= m.bottom) {
|
|
@@ -787,10 +796,10 @@ F = new WeakMap(), nt = new WeakMap(), j = new WeakSet(), wt = /* @__PURE__ */ h
|
|
|
787
796
|
}
|
|
788
797
|
}
|
|
789
798
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
790
|
-
const b = u.closest("tr"), { matrixRow: g } = dt(this,
|
|
799
|
+
const b = u.closest("tr"), { matrixRow: g } = dt(this, Y, wt).call(this, b), y = parseInt(u.dataset.col, 10);
|
|
791
800
|
g < 0 || this.setRange(o, i, g, y);
|
|
792
801
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
793
|
-
E.log("π±οΈ [MouseUp] Drag ended."), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
802
|
+
E.log("π±οΈ [MouseUp] Drag ended."), t(this, I).style.userSelect = "", t(this, I).style.webkitUserSelect = "", document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
794
803
|
}, "onMouseUp");
|
|
795
804
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", c);
|
|
796
805
|
});
|
|
@@ -810,8 +819,8 @@ const St = class St extends HTMLElement {
|
|
|
810
819
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
811
820
|
if (E.log("sheet.generate()"), !e) return;
|
|
812
821
|
p(this, rt, ye.compile(e)), t(this, Gt).call(this), t(this, Jt).call(this);
|
|
813
|
-
const
|
|
814
|
-
|
|
822
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
823
|
+
s && o && (o.style.top = `${s.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, ot).initialize(), setTimeout(() => {
|
|
815
824
|
var i;
|
|
816
825
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
817
826
|
}, 0);
|
|
@@ -821,23 +830,23 @@ const St = class St extends HTMLElement {
|
|
|
821
830
|
{ selector: ".ng-container-body", type: null },
|
|
822
831
|
{ selector: ".ng-container-left", type: "left" },
|
|
823
832
|
{ selector: ".ng-container-right", type: "right" }
|
|
824
|
-
].forEach(({ selector:
|
|
833
|
+
].forEach(({ selector: s, type: r }) => {
|
|
825
834
|
var o, i, a;
|
|
826
|
-
(o = this.querySelector(`${
|
|
835
|
+
(o = this.querySelector(`${s} .ng-part-header`)) == null || o.appendChild(t(this, gt).call(this, t(this, rt), r, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, gt).call(this, t(this, rt), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, gt).call(this, t(this, rt), r, "footer"));
|
|
827
836
|
});
|
|
828
837
|
}, "#renderSplitContainers"));
|
|
829
838
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
830
839
|
["left", "right", "body"].forEach((e) => {
|
|
831
|
-
const
|
|
832
|
-
if (!
|
|
840
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
841
|
+
if (!s || !r || r.length === 0) return;
|
|
833
842
|
let o = 0;
|
|
834
843
|
r[0].querySelectorAll("col").forEach((i) => {
|
|
835
844
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
836
845
|
isNaN(o) || (o += a);
|
|
837
|
-
}), e === "body" ?
|
|
846
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`);
|
|
838
847
|
});
|
|
839
848
|
}, "#updateContainerWidths"));
|
|
840
|
-
d(this, gt, /* @__PURE__ */ h((e,
|
|
849
|
+
d(this, gt, /* @__PURE__ */ h((e, s, r) => {
|
|
841
850
|
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
842
851
|
if (r === "header") {
|
|
843
852
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -845,9 +854,9 @@ const St = class St extends HTMLElement {
|
|
|
845
854
|
f.className = "fixed-tbody", o.appendChild(f);
|
|
846
855
|
}
|
|
847
856
|
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
848
|
-
return
|
|
857
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
849
858
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
850
|
-
}) :
|
|
859
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
851
860
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
852
861
|
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
853
862
|
l.remove();
|
|
@@ -855,12 +864,12 @@ const St = class St extends HTMLElement {
|
|
|
855
864
|
}, "#createSplitTable"));
|
|
856
865
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ot).getRowHeight(), "getRowHeight"));
|
|
857
866
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
858
|
-
const
|
|
859
|
-
|
|
867
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
868
|
+
s && (s.scrollLeft = e);
|
|
860
869
|
}, "scrollToX"));
|
|
861
870
|
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
862
|
-
const
|
|
863
|
-
|
|
871
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
872
|
+
s && (s.scrollTop = e);
|
|
864
873
|
}, "scrollToY"));
|
|
865
874
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
866
875
|
t(this, te).call(this), p(this, It, new me(this));
|
|
@@ -1087,13 +1096,13 @@ const je = class je extends HTMLElement {
|
|
|
1087
1096
|
super();
|
|
1088
1097
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1089
1098
|
var e;
|
|
1090
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1099
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1091
1100
|
var i;
|
|
1092
|
-
const r =
|
|
1101
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, o = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1093
1102
|
t(this, Mt).call(this, o, r);
|
|
1094
1103
|
}), t(this, Mt).call(this, 0, !1);
|
|
1095
1104
|
}, "#init"));
|
|
1096
|
-
d(this, Mt, /* @__PURE__ */ h((e,
|
|
1105
|
+
d(this, Mt, /* @__PURE__ */ h((e, s = !1) => {
|
|
1097
1106
|
const r = /* @__PURE__ */ h(() => {
|
|
1098
1107
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1099
1108
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1104,7 +1113,7 @@ const je = class je extends HTMLElement {
|
|
|
1104
1113
|
});
|
|
1105
1114
|
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
1106
1115
|
if (!a[e]) return;
|
|
1107
|
-
if (!
|
|
1116
|
+
if (!s)
|
|
1108
1117
|
a.forEach((f, u) => {
|
|
1109
1118
|
f.classList.toggle("active", u === e);
|
|
1110
1119
|
}), c.forEach((f, u) => {
|
|
@@ -1132,36 +1141,36 @@ const je = class je extends HTMLElement {
|
|
|
1132
1141
|
ee = new WeakMap(), Mt = new WeakMap(), h(je, "NineTableSheets");
|
|
1133
1142
|
let xe = je;
|
|
1134
1143
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", xe);
|
|
1135
|
-
var
|
|
1144
|
+
var M, se, $t, ne;
|
|
1136
1145
|
const Ye = class Ye {
|
|
1137
|
-
constructor(
|
|
1138
|
-
d(this,
|
|
1146
|
+
constructor(n) {
|
|
1147
|
+
d(this, M);
|
|
1139
1148
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1140
|
-
t(this, ne).call(this), new ResizeObserver((
|
|
1141
|
-
for (let e of
|
|
1142
|
-
t(this,
|
|
1143
|
-
}).observe(t(this,
|
|
1149
|
+
t(this, ne).call(this), new ResizeObserver((n) => {
|
|
1150
|
+
for (let e of n)
|
|
1151
|
+
t(this, M).getAttribute("auto-height") === "true" && t(this, $t).call(this);
|
|
1152
|
+
}).observe(t(this, M));
|
|
1144
1153
|
}, "#init"));
|
|
1145
1154
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
1146
1155
|
var c, l;
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1149
|
-
const e = parseInt(t(this,
|
|
1150
|
-
t(this,
|
|
1156
|
+
const n = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1157
|
+
if (n.length === 0) return;
|
|
1158
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Bt.SCROLLBAR_SIZE, a = e * s + r + o + i;
|
|
1159
|
+
t(this, M).style.height = `${a}px`;
|
|
1151
1160
|
}, "#applyAutoHeight"));
|
|
1152
1161
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1153
|
-
const e = Array.from(t(this,
|
|
1162
|
+
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1154
1163
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1155
1164
|
return u + b;
|
|
1156
1165
|
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1157
|
-
t(this,
|
|
1166
|
+
t(this, M).shadowRoot.innerHTML = `
|
|
1158
1167
|
<style>
|
|
1159
1168
|
:host {
|
|
1160
1169
|
display: flex;
|
|
1161
1170
|
flex-direction: column;
|
|
1162
1171
|
position: relative;
|
|
1163
1172
|
overflow: hidden;
|
|
1164
|
-
height: ${
|
|
1173
|
+
height: ${s ? "auto" : "100%"};
|
|
1165
1174
|
background: #fff;
|
|
1166
1175
|
}
|
|
1167
1176
|
|
|
@@ -1274,151 +1283,151 @@ const Ye = class Ye {
|
|
|
1274
1283
|
<nine-table-analysis></nine-table-analysis>
|
|
1275
1284
|
</nine-table-body>
|
|
1276
1285
|
<nine-table-footer></nine-table-footer>
|
|
1277
|
-
`, t(this,
|
|
1278
|
-
const a = t(this,
|
|
1286
|
+
`, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1287
|
+
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1279
1288
|
a == null || a.forEach((c, l) => {
|
|
1280
1289
|
e[l] && setTimeout(() => {
|
|
1281
|
-
c.generate(e[l]),
|
|
1290
|
+
c.generate(e[l]), s && t(this, $t).call(this);
|
|
1282
1291
|
});
|
|
1283
1292
|
});
|
|
1284
1293
|
}, "#render"));
|
|
1285
|
-
p(this,
|
|
1294
|
+
p(this, M, n), t(this, se).call(this);
|
|
1286
1295
|
}
|
|
1287
1296
|
};
|
|
1288
|
-
|
|
1297
|
+
M = new WeakMap(), se = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), h(Ye, "LayoutManager");
|
|
1289
1298
|
let ve = Ye;
|
|
1290
1299
|
var _t, bt;
|
|
1291
1300
|
const Ve = class Ve {
|
|
1292
|
-
constructor(
|
|
1301
|
+
constructor(n) {
|
|
1293
1302
|
d(this, _t);
|
|
1294
1303
|
d(this, bt, -1);
|
|
1295
1304
|
A(this, "count", /* @__PURE__ */ h(() => t(this, _t).rawRecords.length, "count"));
|
|
1296
|
-
p(this, _t,
|
|
1305
|
+
p(this, _t, n);
|
|
1297
1306
|
}
|
|
1298
1307
|
get at() {
|
|
1299
1308
|
return t(this, bt);
|
|
1300
1309
|
}
|
|
1301
|
-
set at(
|
|
1302
|
-
p(this, bt, parseInt(
|
|
1310
|
+
set at(n) {
|
|
1311
|
+
p(this, bt, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, bt)}"]`) && setTimeout(() => {
|
|
1303
1312
|
});
|
|
1304
1313
|
}
|
|
1305
1314
|
};
|
|
1306
1315
|
_t = new WeakMap(), bt = new WeakMap(), h(Ve, "ngRow");
|
|
1307
1316
|
let we = Ve;
|
|
1308
|
-
var
|
|
1309
|
-
const
|
|
1310
|
-
constructor(
|
|
1311
|
-
d(this,
|
|
1317
|
+
var O, k, W, pt, re, X, oe, it, Nt, ie, ae, yt;
|
|
1318
|
+
const B = class B {
|
|
1319
|
+
constructor(n, e) {
|
|
1320
|
+
d(this, O);
|
|
1312
1321
|
d(this, k);
|
|
1313
|
-
d(this,
|
|
1322
|
+
d(this, W, []);
|
|
1314
1323
|
d(this, pt, []);
|
|
1315
1324
|
d(this, re, 0);
|
|
1316
|
-
d(this,
|
|
1325
|
+
d(this, X, []);
|
|
1317
1326
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1318
|
-
p(this,
|
|
1319
|
-
const
|
|
1320
|
-
Array.from(
|
|
1321
|
-
var
|
|
1322
|
-
t(this,
|
|
1327
|
+
p(this, X, []);
|
|
1328
|
+
const n = t(this, O).template || [];
|
|
1329
|
+
Array.from(n).forEach((e) => {
|
|
1330
|
+
var s;
|
|
1331
|
+
t(this, X).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1323
1332
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1324
|
-
e.__ng || (e.__ng = t(this, Nt).call(this)), e.__ng.height = t(this,
|
|
1333
|
+
e.__ng || (e.__ng = t(this, Nt).call(this)), e.__ng.height = t(this, X).slice();
|
|
1325
1334
|
});
|
|
1326
1335
|
}, "#initialize"));
|
|
1327
1336
|
d(this, it, /* @__PURE__ */ h(() => {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1337
|
+
const n = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1338
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1330
1339
|
e.invalidate();
|
|
1331
1340
|
});
|
|
1332
1341
|
}, "#invalidate"));
|
|
1333
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1342
|
+
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1334
1343
|
var o;
|
|
1335
|
-
const
|
|
1336
|
-
if (!
|
|
1337
|
-
if (
|
|
1338
|
-
if (
|
|
1339
|
-
const r = typeof ((o = t(this,
|
|
1344
|
+
const s = this.getValidData();
|
|
1345
|
+
if (!s || s.length <= 0) return;
|
|
1346
|
+
if (n == null) return t(this, yt).call(this, s);
|
|
1347
|
+
if (n < 0 || n >= s.length) return null;
|
|
1348
|
+
const r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [];
|
|
1340
1349
|
if (e != null) {
|
|
1341
1350
|
const i = r.indexOf(e);
|
|
1342
|
-
return i >= 0 ? n
|
|
1351
|
+
return i >= 0 ? s[n].v[i] : null;
|
|
1343
1352
|
}
|
|
1344
|
-
return t(this, yt).call(this, n
|
|
1353
|
+
return t(this, yt).call(this, s[n]);
|
|
1345
1354
|
}, "get"));
|
|
1346
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1347
|
-
this.clear(), this.add(
|
|
1355
|
+
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1356
|
+
this.clear(), this.add(n, !1), t(this, it).call(this);
|
|
1348
1357
|
}, "set"));
|
|
1349
1358
|
d(this, Nt, /* @__PURE__ */ h(() => ({
|
|
1350
|
-
rowState:
|
|
1359
|
+
rowState: B.ROW_STATE.EMPTY,
|
|
1351
1360
|
deleted: !1,
|
|
1352
1361
|
filtered: !1,
|
|
1353
|
-
height: t(this,
|
|
1362
|
+
height: t(this, X).slice(),
|
|
1354
1363
|
o: {},
|
|
1355
1364
|
c: {},
|
|
1356
|
-
_: [0, 0, 0, 0,
|
|
1365
|
+
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, X).slice(), -1, {}, {}]
|
|
1357
1366
|
}), "#getDefaultMeta"));
|
|
1358
1367
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1359
|
-
p(this,
|
|
1368
|
+
p(this, W, []), p(this, pt, []), t(this, it).call(this);
|
|
1360
1369
|
}, "reset"));
|
|
1361
1370
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1362
|
-
var
|
|
1363
|
-
t(this, k).rawRecords = [], p(this,
|
|
1371
|
+
var n;
|
|
1372
|
+
t(this, k).rawRecords = [], p(this, W, []), p(this, pt, []), (n = t(this, k).viewRecords) != null && n.reset && t(this, k).viewRecords.reset();
|
|
1364
1373
|
}, "clear"));
|
|
1365
|
-
d(this, ie, /* @__PURE__ */ h((
|
|
1374
|
+
d(this, ie, /* @__PURE__ */ h((n) => {
|
|
1366
1375
|
var r;
|
|
1367
|
-
Array.isArray(
|
|
1368
|
-
const e = typeof ((r = t(this,
|
|
1369
|
-
return
|
|
1376
|
+
Array.isArray(n) || (n = [n]);
|
|
1377
|
+
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1378
|
+
return n.forEach((o) => {
|
|
1370
1379
|
const i = { v: [] };
|
|
1371
1380
|
e.forEach((a) => {
|
|
1372
1381
|
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1373
|
-
}),
|
|
1374
|
-
}),
|
|
1382
|
+
}), s.push(i);
|
|
1383
|
+
}), s;
|
|
1375
1384
|
}, "#json2Array"));
|
|
1376
|
-
d(this, ae, /* @__PURE__ */ h((
|
|
1377
|
-
e.__ng = t(this, Nt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1378
|
-
}),
|
|
1379
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1382
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ae).call(this,
|
|
1385
|
+
d(this, ae, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1386
|
+
e.__ng = t(this, Nt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = B.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1387
|
+
}), n), "#defaultInsert"));
|
|
1388
|
+
A(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1389
|
+
n === void 0 && (n = {});
|
|
1390
|
+
const s = t(this, ie).call(this, n);
|
|
1391
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ae).call(this, s)), this.resetRecords();
|
|
1383
1392
|
const r = this.count() - 1;
|
|
1384
|
-
return e ||
|
|
1393
|
+
return e || s.forEach((o, i) => {
|
|
1385
1394
|
const a = t(this, k).rawRecords[r - i];
|
|
1386
|
-
a && (a.__ng.rowState =
|
|
1395
|
+
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1387
1396
|
}), t(this, it).call(this), r;
|
|
1388
1397
|
}, "add"));
|
|
1389
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1398
|
+
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1390
1399
|
let e = [];
|
|
1391
|
-
Array.isArray(
|
|
1392
|
-
if (t(this,
|
|
1393
|
-
const r = t(this,
|
|
1394
|
-
t(this,
|
|
1395
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
1400
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1401
|
+
if (t(this, W)[s]) {
|
|
1402
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1403
|
+
t(this, W)[s].__ng.rowState === B.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, k).rawRecords.forEach((o) => {
|
|
1404
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1396
1405
|
});
|
|
1397
1406
|
}
|
|
1398
1407
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1399
1408
|
}, "delete"));
|
|
1400
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1409
|
+
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1401
1410
|
var c;
|
|
1402
|
-
|
|
1403
|
-
const o = (typeof ((c = t(this,
|
|
1411
|
+
n = parseInt(n, 10);
|
|
1412
|
+
const o = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1404
1413
|
if (o < 0) return;
|
|
1405
|
-
const i = this.getValidData()[
|
|
1414
|
+
const i = this.getValidData()[n];
|
|
1406
1415
|
if (!i) return;
|
|
1407
1416
|
const a = i.v[o];
|
|
1408
|
-
a !==
|
|
1417
|
+
a !== s && i.__ng.rowState !== B.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = B.ROW_STATE.UPDATE), i.v[o] = s;
|
|
1409
1418
|
}, "setValue"));
|
|
1410
1419
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1411
|
-
p(this, pt, t(this, k).rawRecords.filter((
|
|
1412
|
-
|
|
1413
|
-
}), t(this,
|
|
1414
|
-
|
|
1420
|
+
p(this, pt, t(this, k).rawRecords.filter((n) => !n.__ng.deleted)), p(this, W, t(this, k).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, k).rawRecords.forEach((n, e) => {
|
|
1421
|
+
n.__ng.rowidx = e;
|
|
1422
|
+
}), t(this, W).forEach((n, e) => {
|
|
1423
|
+
n.__ng.i = e;
|
|
1415
1424
|
});
|
|
1416
1425
|
}, "resetRecords"));
|
|
1417
|
-
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1418
|
-
d(this, yt, /* @__PURE__ */ h((
|
|
1426
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1427
|
+
d(this, yt, /* @__PURE__ */ h((n) => {
|
|
1419
1428
|
var i;
|
|
1420
|
-
if (!
|
|
1421
|
-
const e = !Array.isArray(
|
|
1429
|
+
if (!n) return n;
|
|
1430
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((i = t(this, O).fields) == null ? void 0 : i.get) == "function" ? t(this, O).fields.get() : [], o = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1422
1431
|
const c = {};
|
|
1423
1432
|
return r.forEach((l, f) => {
|
|
1424
1433
|
c[l] = a.v ? a.v[f] : a[l];
|
|
@@ -1427,54 +1436,54 @@ const W = class W {
|
|
|
1427
1436
|
return e ? o[0] : o;
|
|
1428
1437
|
}, "#conv"));
|
|
1429
1438
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1430
|
-
p(this,
|
|
1439
|
+
p(this, O, n), p(this, k, e), t(this, oe).call(this);
|
|
1431
1440
|
}
|
|
1432
1441
|
get source() {
|
|
1433
1442
|
return t(this, yt).call(this, t(this, k).rawRecords);
|
|
1434
1443
|
}
|
|
1435
|
-
set source(
|
|
1436
|
-
this.clear(), this.add(
|
|
1444
|
+
set source(n) {
|
|
1445
|
+
this.clear(), this.add(n, !1);
|
|
1437
1446
|
}
|
|
1438
1447
|
get nextId() {
|
|
1439
1448
|
return ++os(this, re)._;
|
|
1440
1449
|
}
|
|
1441
1450
|
get count() {
|
|
1442
|
-
return t(this,
|
|
1451
|
+
return t(this, W).length;
|
|
1443
1452
|
}
|
|
1444
1453
|
get length() {
|
|
1445
|
-
return t(this,
|
|
1454
|
+
return t(this, W).length;
|
|
1446
1455
|
}
|
|
1447
1456
|
getRowCount() {
|
|
1448
1457
|
return this.length;
|
|
1449
1458
|
}
|
|
1450
1459
|
};
|
|
1451
|
-
|
|
1452
|
-
A(
|
|
1460
|
+
O = new WeakMap(), k = new WeakMap(), W = new WeakMap(), pt = new WeakMap(), re = new WeakMap(), X = new WeakMap(), oe = new WeakMap(), it = new WeakMap(), Nt = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), yt = new WeakMap(), h(B, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1461
|
+
A(B, "ROW_STATE", {
|
|
1453
1462
|
EMPTY: "EMPTY",
|
|
1454
1463
|
NORMAL: "NORMAL",
|
|
1455
1464
|
INSERT: "INSERT",
|
|
1456
1465
|
UPDATE: "UPDATE",
|
|
1457
1466
|
DELETE: "DELETE"
|
|
1458
1467
|
});
|
|
1459
|
-
let Se =
|
|
1468
|
+
let Se = B;
|
|
1460
1469
|
var at;
|
|
1461
1470
|
const Ue = class Ue {
|
|
1462
|
-
constructor(
|
|
1471
|
+
constructor(n) {
|
|
1463
1472
|
d(this, at);
|
|
1464
|
-
p(this, at,
|
|
1473
|
+
p(this, at, n), this.row = new we(this), this.data = new Se(t(this, at), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1465
1474
|
var e;
|
|
1466
1475
|
(e = t(this, at).view) != null && e.redraw && t(this, at).view.redraw();
|
|
1467
1476
|
}, this.setDataSource = (e) => {
|
|
1468
1477
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1469
1478
|
}, this.getRowState = (e) => {
|
|
1470
1479
|
var r, o;
|
|
1471
|
-
const
|
|
1472
|
-
if (!(
|
|
1473
|
-
return (o = (r = this.data.getValidData()[
|
|
1480
|
+
const s = parseInt(e, 10);
|
|
1481
|
+
if (!(s >= this.data.count()))
|
|
1482
|
+
return (o = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1474
1483
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1475
1484
|
this.row.at = e;
|
|
1476
|
-
}, 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,
|
|
1477
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1485
|
+
}, 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, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1486
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1478
1487
|
}, this.setDataSource([]);
|
|
1479
1488
|
}
|
|
1480
1489
|
};
|
|
@@ -1483,31 +1492,31 @@ let Re = Ue;
|
|
|
1483
1492
|
var mt, H, zt, le;
|
|
1484
1493
|
const Xe = class Xe {
|
|
1485
1494
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1486
|
-
constructor(
|
|
1495
|
+
constructor(n) {
|
|
1487
1496
|
d(this, mt);
|
|
1488
1497
|
d(this, H, []);
|
|
1489
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1490
|
-
|
|
1491
|
-
t(this, H).some((r) => r.name ===
|
|
1498
|
+
A(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1499
|
+
n.forEach((s) => {
|
|
1500
|
+
t(this, H).some((r) => r.name === s) || t(this, H).push({ name: s, type: e });
|
|
1492
1501
|
}), t(this, zt).call(this);
|
|
1493
1502
|
}, "add"));
|
|
1494
1503
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
1495
|
-
const
|
|
1504
|
+
const n = /* @__PURE__ */ new Map();
|
|
1496
1505
|
t(this, H).forEach((e) => {
|
|
1497
|
-
|
|
1498
|
-
}), p(this, H, Array.from(
|
|
1506
|
+
n.set(e.name, e.type);
|
|
1507
|
+
}), p(this, H, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, H, t(this, H).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, H).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1499
1508
|
}, "#adjust"));
|
|
1500
1509
|
d(this, le, /* @__PURE__ */ h(() => {
|
|
1501
1510
|
p(this, H, []), E.log(t(this, mt).querySelectorAll("table"));
|
|
1502
|
-
const
|
|
1503
|
-
if (!(!
|
|
1504
|
-
for (const e of
|
|
1505
|
-
E.log(e), $("[data-bind]", e).each((
|
|
1511
|
+
const n = Array.from(t(this, mt).querySelectorAll("table"));
|
|
1512
|
+
if (!(!n || n.length === 0)) {
|
|
1513
|
+
for (const e of n)
|
|
1514
|
+
E.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1506
1515
|
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1507
1516
|
o && t(this, H).push({ name: o, type: i });
|
|
1508
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1509
|
-
$(`[${
|
|
1510
|
-
var i = o.getAttribute(
|
|
1517
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1518
|
+
$(`[${s}]`, e).each((r, o) => {
|
|
1519
|
+
var i = o.getAttribute(s);
|
|
1511
1520
|
if (i.indexOf("data.") < 0) {
|
|
1512
1521
|
const a = i.search(/[(]/g);
|
|
1513
1522
|
if (a > 0)
|
|
@@ -1529,26 +1538,26 @@ const Xe = class Xe {
|
|
|
1529
1538
|
t(this, zt).call(this);
|
|
1530
1539
|
}
|
|
1531
1540
|
}, "#init"));
|
|
1532
|
-
p(this, mt,
|
|
1541
|
+
p(this, mt, n), t(this, le).call(this);
|
|
1533
1542
|
}
|
|
1534
1543
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1535
1544
|
get() {
|
|
1536
|
-
return t(this, H).map((
|
|
1545
|
+
return t(this, H).map((n) => n.name);
|
|
1537
1546
|
}
|
|
1538
1547
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1539
1548
|
getFields() {
|
|
1540
1549
|
return t(this, H);
|
|
1541
1550
|
}
|
|
1542
1551
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1543
|
-
getType(
|
|
1544
|
-
const e = t(this, H).find((
|
|
1552
|
+
getType(n) {
|
|
1553
|
+
const e = t(this, H).find((s) => s.name === n);
|
|
1545
1554
|
return e ? e.type : "string";
|
|
1546
1555
|
}
|
|
1547
|
-
indexOf(
|
|
1548
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1556
|
+
indexOf(n) {
|
|
1557
|
+
return t(this, H).findIndex((e) => e.name === n);
|
|
1549
1558
|
}
|
|
1550
|
-
includes(
|
|
1551
|
-
return t(this, H).some((e) => e.name ===
|
|
1559
|
+
includes(n) {
|
|
1560
|
+
return t(this, H).some((e) => e.name === n);
|
|
1552
1561
|
}
|
|
1553
1562
|
};
|
|
1554
1563
|
mt = new WeakMap(), H = new WeakMap(), zt = new WeakMap(), le = new WeakMap(), h(Xe, "ngFields");
|
|
@@ -1614,15 +1623,15 @@ const Ze = class Ze extends qe {
|
|
|
1614
1623
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1615
1624
|
if (t(this, x))
|
|
1616
1625
|
if (t(this, x).closest("tbody")) {
|
|
1617
|
-
const
|
|
1618
|
-
if (!
|
|
1626
|
+
const s = t(this, x).closest("tr").data, r = parseInt(t(this, x).dataset.row);
|
|
1627
|
+
if (!s) return "";
|
|
1619
1628
|
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1620
1629
|
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1621
|
-
return
|
|
1630
|
+
return s[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1622
1631
|
} else try {
|
|
1623
|
-
return this.getExprValue(t(this, x).dataset.expr,
|
|
1632
|
+
return this.getExprValue(t(this, x).dataset.expr, s, r, t(this, x));
|
|
1624
1633
|
} catch {
|
|
1625
|
-
console.error(t(this, x).dataset.expr,
|
|
1634
|
+
console.error(t(this, x).dataset.expr, s, t(this, x).dataset.row);
|
|
1626
1635
|
}
|
|
1627
1636
|
return ninegrid.nvl(e, "");
|
|
1628
1637
|
} else
|
|
@@ -1635,13 +1644,13 @@ const Ze = class Ze extends qe {
|
|
|
1635
1644
|
if (!(!t(this, L) || !t(this, L).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1636
1645
|
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1637
1646
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1638
|
-
var
|
|
1639
|
-
$("th,td",
|
|
1640
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1641
|
-
T &&
|
|
1647
|
+
var s = t(this, x).closest("tr"), r = [];
|
|
1648
|
+
$("th,td", s).each((m, _) => {
|
|
1649
|
+
var T = ninegrid.j.querySelectorAll(_).attr("suppress");
|
|
1650
|
+
T && _.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
|
|
1642
1651
|
}), r.sort();
|
|
1643
1652
|
var o = !1;
|
|
1644
|
-
if (parseInt(
|
|
1653
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1645
1654
|
for (var i of r) {
|
|
1646
1655
|
if (i > e) break;
|
|
1647
1656
|
var a = parseInt(t(this, x).dataset.row), c = a - 1, l = t(this, x).closest("tr").data, f = t(this, L).data.get(c);
|
|
@@ -1660,12 +1669,12 @@ const Ze = class Ze extends qe {
|
|
|
1660
1669
|
}
|
|
1661
1670
|
}
|
|
1662
1671
|
}, "#resetSuppress"));
|
|
1663
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1672
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
|
|
1664
1673
|
if (typeof e < "u")
|
|
1665
1674
|
try {
|
|
1666
1675
|
r = parseInt(r);
|
|
1667
1676
|
const i = e.replace("()", "");
|
|
1668
|
-
return t(this, L)[i] ? t(this, L)[i].call(this,
|
|
1677
|
+
return t(this, L)[i] ? t(this, L)[i].call(this, s, r, t(this, x)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1669
1678
|
} catch {
|
|
1670
1679
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1671
1680
|
}
|
|
@@ -1681,9 +1690,9 @@ const Ze = class Ze extends qe {
|
|
|
1681
1690
|
return e ?? "";
|
|
1682
1691
|
}
|
|
1683
1692
|
set value(e) {
|
|
1684
|
-
var
|
|
1693
|
+
var s = parseInt(t(this, x).dataset.row);
|
|
1685
1694
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1686
|
-
|
|
1695
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, x).dataset.index), t(this, x).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, x).dataset.bind, e, r);
|
|
1687
1696
|
}
|
|
1688
1697
|
get row() {
|
|
1689
1698
|
return parseInt(t(this, x).dataset.row);
|
|
@@ -1711,7 +1720,7 @@ const Ge = class Ge extends Te {
|
|
|
1711
1720
|
};
|
|
1712
1721
|
h(Ge, "EditableCellElement");
|
|
1713
1722
|
let Ce = Ge;
|
|
1714
|
-
var Wt, ct, xt, vt, de,
|
|
1723
|
+
var Wt, ct, xt, vt, de, K, Oe;
|
|
1715
1724
|
const Je = class Je extends Ce {
|
|
1716
1725
|
constructor() {
|
|
1717
1726
|
super();
|
|
@@ -1720,7 +1729,7 @@ const Je = class Je extends Ce {
|
|
|
1720
1729
|
d(this, xt);
|
|
1721
1730
|
d(this, vt);
|
|
1722
1731
|
d(this, de);
|
|
1723
|
-
d(this,
|
|
1732
|
+
d(this, K);
|
|
1724
1733
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1725
1734
|
const e = super.refresh();
|
|
1726
1735
|
t(this, Wt).value = e;
|
|
@@ -1759,22 +1768,22 @@ const Je = class Je extends Ce {
|
|
|
1759
1768
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1760
1769
|
if (t(this, ct) == "number") {
|
|
1761
1770
|
let o = [];
|
|
1762
|
-
if (t(this,
|
|
1763
|
-
var
|
|
1771
|
+
if (t(this, K) && Number(t(this, K)) > 0 && o.push("."), t(this, vt) && Number(t(this, vt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, K) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1772
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1764
1773
|
if (r >= 0) {
|
|
1765
|
-
var
|
|
1766
|
-
|
|
1774
|
+
var s = s.substr(r + 1, s.length);
|
|
1775
|
+
s.length >= Number(t(this, K)) && e.preventDefault();
|
|
1767
1776
|
}
|
|
1768
1777
|
}
|
|
1769
1778
|
}
|
|
1770
1779
|
t(this, xt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, xt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1771
1780
|
}
|
|
1772
1781
|
}, "#onKeyDown"));
|
|
1773
|
-
if (this.applyBaseStyle(), p(this, ct, this.getAttribute("type") || "text"), p(this, xt, this.getAttribute("maxbyte")), p(this, vt, this.getAttribute("min")), p(this, de, this.getAttribute("max")), p(this,
|
|
1782
|
+
if (this.applyBaseStyle(), p(this, ct, this.getAttribute("type") || "text"), p(this, xt, this.getAttribute("maxbyte")), p(this, vt, this.getAttribute("min")), p(this, de, this.getAttribute("max")), p(this, K, this.getAttribute("scale")), !["text", "number"].includes(t(this, ct))) throw `invalid type : ${t(this, ct)}`;
|
|
1774
1783
|
}
|
|
1775
1784
|
connectedCallback() {
|
|
1776
|
-
for (var e = [],
|
|
1777
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1785
|
+
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
1786
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
|
|
1778
1787
|
this.innerHTML = `
|
|
1779
1788
|
<input type="text"
|
|
1780
1789
|
${e.join(" ")}
|
|
@@ -1783,7 +1792,7 @@ const Je = class Je extends Ce {
|
|
|
1783
1792
|
`, super.connectedCallback(), p(this, Wt, this.querySelector("input"));
|
|
1784
1793
|
}
|
|
1785
1794
|
};
|
|
1786
|
-
Wt = new WeakMap(), ct = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), de = new WeakMap(),
|
|
1795
|
+
Wt = new WeakMap(), ct = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), de = new WeakMap(), K = new WeakMap(), Oe = new WeakMap(), h(Je, "CellInputText");
|
|
1787
1796
|
let ke = Je;
|
|
1788
1797
|
customElements.get("cell-input-text");
|
|
1789
1798
|
customElements.get("cell-input") || customElements.define("cell-input", ke);
|