@ninebone/table 0.0.715 β 0.0.717
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 +343 -337
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -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 D,
|
|
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
30
|
d(this, D);
|
|
31
|
-
d(this,
|
|
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
37
|
if (!t(this, D)) return;
|
|
38
38
|
const e = t(this, D).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (p(this,
|
|
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, D) || !t(this, R) || 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, D).querySelector(".ng-container-bottom"), a = e.clientWidth, c =
|
|
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,16 +96,16 @@ 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
|
});
|
|
@@ -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
|
-
D = new WeakMap(),
|
|
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 F, S,
|
|
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(
|
|
358
|
+
constructor(n) {
|
|
359
359
|
d(this, F);
|
|
360
360
|
d(this, S);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, st);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
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");
|
|
@@ -388,56 +388,56 @@ const Pe = class Pe {
|
|
|
388
388
|
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
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
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, F).data.get() || []).length,
|
|
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,47 +481,47 @@ 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
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;
|
|
@@ -531,33 +531,33 @@ const Pe = class Pe {
|
|
|
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 (
|
|
538
|
+
const s = t(this, F).data.length;
|
|
539
|
+
if (s === 0) return;
|
|
540
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, F,
|
|
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, P).get(
|
|
610
|
+
return ((e = t(this, P).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
F = new WeakMap(), S = new WeakMap(),
|
|
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,49 +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
|
-
t(this,
|
|
773
|
-
const r =
|
|
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);
|
|
774
780
|
if (o < 0) {
|
|
775
|
-
t(this,
|
|
781
|
+
t(this, I).style.userSelect = "", t(this, I).style.webkitUserSelect = "";
|
|
776
782
|
return;
|
|
777
783
|
}
|
|
778
784
|
E.log(`π±οΈ [MouseDown Success] startRow: ${o}, startCol: ${i}`), this.setRange(o, i, o, i);
|
|
779
785
|
const a = /* @__PURE__ */ h((l) => {
|
|
780
786
|
const f = document.elementFromPoint(l.clientX, l.clientY);
|
|
781
787
|
let u = f == null ? void 0 : f.closest("td, th");
|
|
782
|
-
if (!u || !t(this,
|
|
783
|
-
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");
|
|
784
790
|
for (const w of v) {
|
|
785
791
|
const m = w.getBoundingClientRect();
|
|
786
792
|
if (l.clientX >= m.left && l.clientX <= m.right && l.clientY >= m.top && l.clientY <= m.bottom) {
|
|
@@ -790,10 +796,10 @@ z = new WeakMap(), nt = new WeakMap(), j = new WeakSet(), wt = /* @__PURE__ */ h
|
|
|
790
796
|
}
|
|
791
797
|
}
|
|
792
798
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
793
|
-
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);
|
|
794
800
|
g < 0 || this.setRange(o, i, g, y);
|
|
795
801
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
796
|
-
E.log("π±οΈ [MouseUp] Drag ended."), t(this,
|
|
802
|
+
E.log("π±οΈ [MouseUp] Drag ended."), t(this, I).style.userSelect = "", t(this, I).style.webkitUserSelect = "", document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
797
803
|
}, "onMouseUp");
|
|
798
804
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", c);
|
|
799
805
|
});
|
|
@@ -813,8 +819,8 @@ const St = class St extends HTMLElement {
|
|
|
813
819
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
814
820
|
if (E.log("sheet.generate()"), !e) return;
|
|
815
821
|
p(this, rt, ye.compile(e)), t(this, Gt).call(this), t(this, Jt).call(this);
|
|
816
|
-
const
|
|
817
|
-
|
|
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(() => {
|
|
818
824
|
var i;
|
|
819
825
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
820
826
|
}, 0);
|
|
@@ -824,23 +830,23 @@ const St = class St extends HTMLElement {
|
|
|
824
830
|
{ selector: ".ng-container-body", type: null },
|
|
825
831
|
{ selector: ".ng-container-left", type: "left" },
|
|
826
832
|
{ selector: ".ng-container-right", type: "right" }
|
|
827
|
-
].forEach(({ selector:
|
|
833
|
+
].forEach(({ selector: s, type: r }) => {
|
|
828
834
|
var o, i, a;
|
|
829
|
-
(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"));
|
|
830
836
|
});
|
|
831
837
|
}, "#renderSplitContainers"));
|
|
832
838
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
833
839
|
["left", "right", "body"].forEach((e) => {
|
|
834
|
-
const
|
|
835
|
-
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;
|
|
836
842
|
let o = 0;
|
|
837
843
|
r[0].querySelectorAll("col").forEach((i) => {
|
|
838
844
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
839
845
|
isNaN(o) || (o += a);
|
|
840
|
-
}), e === "body" ?
|
|
846
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`);
|
|
841
847
|
});
|
|
842
848
|
}, "#updateContainerWidths"));
|
|
843
|
-
d(this, gt, /* @__PURE__ */ h((e,
|
|
849
|
+
d(this, gt, /* @__PURE__ */ h((e, s, r) => {
|
|
844
850
|
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
845
851
|
if (r === "header") {
|
|
846
852
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -848,9 +854,9 @@ const St = class St extends HTMLElement {
|
|
|
848
854
|
f.className = "fixed-tbody", o.appendChild(f);
|
|
849
855
|
}
|
|
850
856
|
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
851
|
-
return
|
|
857
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
852
858
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
853
|
-
}) :
|
|
859
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
854
860
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
855
861
|
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
856
862
|
l.remove();
|
|
@@ -858,12 +864,12 @@ const St = class St extends HTMLElement {
|
|
|
858
864
|
}, "#createSplitTable"));
|
|
859
865
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ot).getRowHeight(), "getRowHeight"));
|
|
860
866
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
861
|
-
const
|
|
862
|
-
|
|
867
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
868
|
+
s && (s.scrollLeft = e);
|
|
863
869
|
}, "scrollToX"));
|
|
864
870
|
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
865
|
-
const
|
|
866
|
-
|
|
871
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
872
|
+
s && (s.scrollTop = e);
|
|
867
873
|
}, "scrollToY"));
|
|
868
874
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
869
875
|
t(this, te).call(this), p(this, It, new me(this));
|
|
@@ -1090,13 +1096,13 @@ const je = class je extends HTMLElement {
|
|
|
1090
1096
|
super();
|
|
1091
1097
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1092
1098
|
var e;
|
|
1093
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1099
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1094
1100
|
var i;
|
|
1095
|
-
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);
|
|
1096
1102
|
t(this, Mt).call(this, o, r);
|
|
1097
1103
|
}), t(this, Mt).call(this, 0, !1);
|
|
1098
1104
|
}, "#init"));
|
|
1099
|
-
d(this, Mt, /* @__PURE__ */ h((e,
|
|
1105
|
+
d(this, Mt, /* @__PURE__ */ h((e, s = !1) => {
|
|
1100
1106
|
const r = /* @__PURE__ */ h(() => {
|
|
1101
1107
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1102
1108
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1107,7 +1113,7 @@ const je = class je extends HTMLElement {
|
|
|
1107
1113
|
});
|
|
1108
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");
|
|
1109
1115
|
if (!a[e]) return;
|
|
1110
|
-
if (!
|
|
1116
|
+
if (!s)
|
|
1111
1117
|
a.forEach((f, u) => {
|
|
1112
1118
|
f.classList.toggle("active", u === e);
|
|
1113
1119
|
}), c.forEach((f, u) => {
|
|
@@ -1135,36 +1141,36 @@ const je = class je extends HTMLElement {
|
|
|
1135
1141
|
ee = new WeakMap(), Mt = new WeakMap(), h(je, "NineTableSheets");
|
|
1136
1142
|
let xe = je;
|
|
1137
1143
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", xe);
|
|
1138
|
-
var
|
|
1144
|
+
var M, se, $t, ne;
|
|
1139
1145
|
const Ye = class Ye {
|
|
1140
|
-
constructor(
|
|
1141
|
-
d(this,
|
|
1146
|
+
constructor(n) {
|
|
1147
|
+
d(this, M);
|
|
1142
1148
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1143
|
-
t(this, ne).call(this), new ResizeObserver((
|
|
1144
|
-
for (let e of
|
|
1145
|
-
t(this,
|
|
1146
|
-
}).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));
|
|
1147
1153
|
}, "#init"));
|
|
1148
1154
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
1149
1155
|
var c, l;
|
|
1150
|
-
const
|
|
1151
|
-
if (
|
|
1152
|
-
const e = parseInt(t(this,
|
|
1153
|
-
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`;
|
|
1154
1160
|
}, "#applyAutoHeight"));
|
|
1155
1161
|
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1156
|
-
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) => {
|
|
1157
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>` : "";
|
|
1158
1164
|
return u + b;
|
|
1159
1165
|
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1160
|
-
t(this,
|
|
1166
|
+
t(this, M).shadowRoot.innerHTML = `
|
|
1161
1167
|
<style>
|
|
1162
1168
|
:host {
|
|
1163
1169
|
display: flex;
|
|
1164
1170
|
flex-direction: column;
|
|
1165
1171
|
position: relative;
|
|
1166
1172
|
overflow: hidden;
|
|
1167
|
-
height: ${
|
|
1173
|
+
height: ${s ? "auto" : "100%"};
|
|
1168
1174
|
background: #fff;
|
|
1169
1175
|
}
|
|
1170
1176
|
|
|
@@ -1277,151 +1283,151 @@ const Ye = class Ye {
|
|
|
1277
1283
|
<nine-table-analysis></nine-table-analysis>
|
|
1278
1284
|
</nine-table-body>
|
|
1279
1285
|
<nine-table-footer></nine-table-footer>
|
|
1280
|
-
`, t(this,
|
|
1281
|
-
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");
|
|
1282
1288
|
a == null || a.forEach((c, l) => {
|
|
1283
1289
|
e[l] && setTimeout(() => {
|
|
1284
|
-
c.generate(e[l]),
|
|
1290
|
+
c.generate(e[l]), s && t(this, $t).call(this);
|
|
1285
1291
|
});
|
|
1286
1292
|
});
|
|
1287
1293
|
}, "#render"));
|
|
1288
|
-
p(this,
|
|
1294
|
+
p(this, M, n), t(this, se).call(this);
|
|
1289
1295
|
}
|
|
1290
1296
|
};
|
|
1291
|
-
|
|
1297
|
+
M = new WeakMap(), se = new WeakMap(), $t = new WeakMap(), ne = new WeakMap(), h(Ye, "LayoutManager");
|
|
1292
1298
|
let ve = Ye;
|
|
1293
1299
|
var _t, bt;
|
|
1294
1300
|
const Ve = class Ve {
|
|
1295
|
-
constructor(
|
|
1301
|
+
constructor(n) {
|
|
1296
1302
|
d(this, _t);
|
|
1297
1303
|
d(this, bt, -1);
|
|
1298
1304
|
A(this, "count", /* @__PURE__ */ h(() => t(this, _t).rawRecords.length, "count"));
|
|
1299
|
-
p(this, _t,
|
|
1305
|
+
p(this, _t, n);
|
|
1300
1306
|
}
|
|
1301
1307
|
get at() {
|
|
1302
1308
|
return t(this, bt);
|
|
1303
1309
|
}
|
|
1304
|
-
set at(
|
|
1305
|
-
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(() => {
|
|
1306
1312
|
});
|
|
1307
1313
|
}
|
|
1308
1314
|
};
|
|
1309
1315
|
_t = new WeakMap(), bt = new WeakMap(), h(Ve, "ngRow");
|
|
1310
1316
|
let we = Ve;
|
|
1311
|
-
var O, k, W, pt, re,
|
|
1317
|
+
var O, k, W, pt, re, X, oe, it, Nt, ie, ae, yt;
|
|
1312
1318
|
const B = class B {
|
|
1313
|
-
constructor(
|
|
1319
|
+
constructor(n, e) {
|
|
1314
1320
|
d(this, O);
|
|
1315
1321
|
d(this, k);
|
|
1316
1322
|
d(this, W, []);
|
|
1317
1323
|
d(this, pt, []);
|
|
1318
1324
|
d(this, re, 0);
|
|
1319
|
-
d(this,
|
|
1325
|
+
d(this, X, []);
|
|
1320
1326
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1321
|
-
p(this,
|
|
1322
|
-
const
|
|
1323
|
-
Array.from(
|
|
1324
|
-
var
|
|
1325
|
-
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);
|
|
1326
1332
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1327
|
-
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();
|
|
1328
1334
|
});
|
|
1329
1335
|
}, "#initialize"));
|
|
1330
1336
|
d(this, it, /* @__PURE__ */ h(() => {
|
|
1331
|
-
const
|
|
1332
|
-
|
|
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) => {
|
|
1333
1339
|
e.invalidate();
|
|
1334
1340
|
});
|
|
1335
1341
|
}, "#invalidate"));
|
|
1336
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1342
|
+
A(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1337
1343
|
var o;
|
|
1338
|
-
const
|
|
1339
|
-
if (!
|
|
1340
|
-
if (
|
|
1341
|
-
if (
|
|
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;
|
|
1342
1348
|
const r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [];
|
|
1343
1349
|
if (e != null) {
|
|
1344
1350
|
const i = r.indexOf(e);
|
|
1345
|
-
return i >= 0 ? n
|
|
1351
|
+
return i >= 0 ? s[n].v[i] : null;
|
|
1346
1352
|
}
|
|
1347
|
-
return t(this, yt).call(this, n
|
|
1353
|
+
return t(this, yt).call(this, s[n]);
|
|
1348
1354
|
}, "get"));
|
|
1349
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1350
|
-
this.clear(), this.add(
|
|
1355
|
+
A(this, "set", /* @__PURE__ */ h((n) => {
|
|
1356
|
+
this.clear(), this.add(n, !1), t(this, it).call(this);
|
|
1351
1357
|
}, "set"));
|
|
1352
1358
|
d(this, Nt, /* @__PURE__ */ h(() => ({
|
|
1353
1359
|
rowState: B.ROW_STATE.EMPTY,
|
|
1354
1360
|
deleted: !1,
|
|
1355
1361
|
filtered: !1,
|
|
1356
|
-
height: t(this,
|
|
1362
|
+
height: t(this, X).slice(),
|
|
1357
1363
|
o: {},
|
|
1358
1364
|
c: {},
|
|
1359
|
-
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1365
|
+
_: [0, 0, 0, 0, B.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, X).slice(), -1, {}, {}]
|
|
1360
1366
|
}), "#getDefaultMeta"));
|
|
1361
1367
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1362
1368
|
p(this, W, []), p(this, pt, []), t(this, it).call(this);
|
|
1363
1369
|
}, "reset"));
|
|
1364
1370
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1365
|
-
var
|
|
1366
|
-
t(this, k).rawRecords = [], p(this, W, []), p(this, pt, []), (
|
|
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();
|
|
1367
1373
|
}, "clear"));
|
|
1368
|
-
d(this, ie, /* @__PURE__ */ h((
|
|
1374
|
+
d(this, ie, /* @__PURE__ */ h((n) => {
|
|
1369
1375
|
var r;
|
|
1370
|
-
Array.isArray(
|
|
1371
|
-
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(
|
|
1372
|
-
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) => {
|
|
1373
1379
|
const i = { v: [] };
|
|
1374
1380
|
e.forEach((a) => {
|
|
1375
1381
|
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1376
|
-
}),
|
|
1377
|
-
}),
|
|
1382
|
+
}), s.push(i);
|
|
1383
|
+
}), s;
|
|
1378
1384
|
}, "#json2Array"));
|
|
1379
|
-
d(this, ae, /* @__PURE__ */ h((
|
|
1385
|
+
d(this, ae, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1380
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;
|
|
1381
|
-
}),
|
|
1382
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1383
|
-
|
|
1384
|
-
const
|
|
1385
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ae).call(this,
|
|
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();
|
|
1386
1392
|
const r = this.count() - 1;
|
|
1387
|
-
return e ||
|
|
1393
|
+
return e || s.forEach((o, i) => {
|
|
1388
1394
|
const a = t(this, k).rawRecords[r - i];
|
|
1389
1395
|
a && (a.__ng.rowState = B.ROW_STATE.EMPTY);
|
|
1390
1396
|
}), t(this, it).call(this), r;
|
|
1391
1397
|
}, "add"));
|
|
1392
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1398
|
+
A(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1393
1399
|
let e = [];
|
|
1394
|
-
Array.isArray(
|
|
1395
|
-
if (t(this, W)[
|
|
1396
|
-
const r = t(this, W)[
|
|
1397
|
-
t(this, W)[
|
|
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) => {
|
|
1398
1404
|
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = B.ROW_STATE.DELETE);
|
|
1399
1405
|
});
|
|
1400
1406
|
}
|
|
1401
1407
|
}), this.resetRecords(), t(this, it).call(this);
|
|
1402
1408
|
}, "delete"));
|
|
1403
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1409
|
+
A(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1404
1410
|
var c;
|
|
1405
|
-
|
|
1411
|
+
n = parseInt(n, 10);
|
|
1406
1412
|
const o = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1407
1413
|
if (o < 0) return;
|
|
1408
|
-
const i = this.getValidData()[
|
|
1414
|
+
const i = this.getValidData()[n];
|
|
1409
1415
|
if (!i) return;
|
|
1410
1416
|
const a = i.v[o];
|
|
1411
|
-
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;
|
|
1412
1418
|
}, "setValue"));
|
|
1413
1419
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1414
|
-
p(this, pt, t(this, k).rawRecords.filter((
|
|
1415
|
-
|
|
1416
|
-
}), t(this, W).forEach((
|
|
1417
|
-
|
|
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;
|
|
1418
1424
|
});
|
|
1419
1425
|
}, "resetRecords"));
|
|
1420
1426
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1421
|
-
d(this, yt, /* @__PURE__ */ h((
|
|
1427
|
+
d(this, yt, /* @__PURE__ */ h((n) => {
|
|
1422
1428
|
var i;
|
|
1423
|
-
if (!
|
|
1424
|
-
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) => {
|
|
1425
1431
|
const c = {};
|
|
1426
1432
|
return r.forEach((l, f) => {
|
|
1427
1433
|
c[l] = a.v ? a.v[f] : a[l];
|
|
@@ -1430,13 +1436,13 @@ const B = class B {
|
|
|
1430
1436
|
return e ? o[0] : o;
|
|
1431
1437
|
}, "#conv"));
|
|
1432
1438
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1433
|
-
p(this, O,
|
|
1439
|
+
p(this, O, n), p(this, k, e), t(this, oe).call(this);
|
|
1434
1440
|
}
|
|
1435
1441
|
get source() {
|
|
1436
1442
|
return t(this, yt).call(this, t(this, k).rawRecords);
|
|
1437
1443
|
}
|
|
1438
|
-
set source(
|
|
1439
|
-
this.clear(), this.add(
|
|
1444
|
+
set source(n) {
|
|
1445
|
+
this.clear(), this.add(n, !1);
|
|
1440
1446
|
}
|
|
1441
1447
|
get nextId() {
|
|
1442
1448
|
return ++os(this, re)._;
|
|
@@ -1451,7 +1457,7 @@ const B = class B {
|
|
|
1451
1457
|
return this.length;
|
|
1452
1458
|
}
|
|
1453
1459
|
};
|
|
1454
|
-
O = new WeakMap(), k = new WeakMap(), W = new WeakMap(), pt = new WeakMap(), re = new WeakMap(),
|
|
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"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1455
1461
|
A(B, "ROW_STATE", {
|
|
1456
1462
|
EMPTY: "EMPTY",
|
|
1457
1463
|
NORMAL: "NORMAL",
|
|
@@ -1462,22 +1468,22 @@ A(B, "ROW_STATE", {
|
|
|
1462
1468
|
let Se = B;
|
|
1463
1469
|
var at;
|
|
1464
1470
|
const Ue = class Ue {
|
|
1465
|
-
constructor(
|
|
1471
|
+
constructor(n) {
|
|
1466
1472
|
d(this, at);
|
|
1467
|
-
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 = () => {
|
|
1468
1474
|
var e;
|
|
1469
1475
|
(e = t(this, at).view) != null && e.redraw && t(this, at).view.redraw();
|
|
1470
1476
|
}, this.setDataSource = (e) => {
|
|
1471
1477
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1472
1478
|
}, this.getRowState = (e) => {
|
|
1473
1479
|
var r, o;
|
|
1474
|
-
const
|
|
1475
|
-
if (!(
|
|
1476
|
-
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;
|
|
1477
1483
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1478
1484
|
this.row.at = e;
|
|
1479
|
-
}, 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,
|
|
1480
|
-
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);
|
|
1481
1487
|
}, this.setDataSource([]);
|
|
1482
1488
|
}
|
|
1483
1489
|
};
|
|
@@ -1486,31 +1492,31 @@ let Re = Ue;
|
|
|
1486
1492
|
var mt, H, zt, le;
|
|
1487
1493
|
const Xe = class Xe {
|
|
1488
1494
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1489
|
-
constructor(
|
|
1495
|
+
constructor(n) {
|
|
1490
1496
|
d(this, mt);
|
|
1491
1497
|
d(this, H, []);
|
|
1492
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1493
|
-
|
|
1494
|
-
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 });
|
|
1495
1501
|
}), t(this, zt).call(this);
|
|
1496
1502
|
}, "add"));
|
|
1497
1503
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
1498
|
-
const
|
|
1504
|
+
const n = /* @__PURE__ */ new Map();
|
|
1499
1505
|
t(this, H).forEach((e) => {
|
|
1500
|
-
|
|
1501
|
-
}), 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);
|
|
1502
1508
|
}, "#adjust"));
|
|
1503
1509
|
d(this, le, /* @__PURE__ */ h(() => {
|
|
1504
1510
|
p(this, H, []), E.log(t(this, mt).querySelectorAll("table"));
|
|
1505
|
-
const
|
|
1506
|
-
if (!(!
|
|
1507
|
-
for (const e of
|
|
1508
|
-
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) => {
|
|
1509
1515
|
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1510
1516
|
o && t(this, H).push({ name: o, type: i });
|
|
1511
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1512
|
-
$(`[${
|
|
1513
|
-
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);
|
|
1514
1520
|
if (i.indexOf("data.") < 0) {
|
|
1515
1521
|
const a = i.search(/[(]/g);
|
|
1516
1522
|
if (a > 0)
|
|
@@ -1532,26 +1538,26 @@ const Xe = class Xe {
|
|
|
1532
1538
|
t(this, zt).call(this);
|
|
1533
1539
|
}
|
|
1534
1540
|
}, "#init"));
|
|
1535
|
-
p(this, mt,
|
|
1541
|
+
p(this, mt, n), t(this, le).call(this);
|
|
1536
1542
|
}
|
|
1537
1543
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1538
1544
|
get() {
|
|
1539
|
-
return t(this, H).map((
|
|
1545
|
+
return t(this, H).map((n) => n.name);
|
|
1540
1546
|
}
|
|
1541
1547
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1542
1548
|
getFields() {
|
|
1543
1549
|
return t(this, H);
|
|
1544
1550
|
}
|
|
1545
1551
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1546
|
-
getType(
|
|
1547
|
-
const e = t(this, H).find((
|
|
1552
|
+
getType(n) {
|
|
1553
|
+
const e = t(this, H).find((s) => s.name === n);
|
|
1548
1554
|
return e ? e.type : "string";
|
|
1549
1555
|
}
|
|
1550
|
-
indexOf(
|
|
1551
|
-
return t(this, H).findIndex((e) => e.name ===
|
|
1556
|
+
indexOf(n) {
|
|
1557
|
+
return t(this, H).findIndex((e) => e.name === n);
|
|
1552
1558
|
}
|
|
1553
|
-
includes(
|
|
1554
|
-
return t(this, H).some((e) => e.name ===
|
|
1559
|
+
includes(n) {
|
|
1560
|
+
return t(this, H).some((e) => e.name === n);
|
|
1555
1561
|
}
|
|
1556
1562
|
};
|
|
1557
1563
|
mt = new WeakMap(), H = new WeakMap(), zt = new WeakMap(), le = new WeakMap(), h(Xe, "ngFields");
|
|
@@ -1617,15 +1623,15 @@ const Ze = class Ze extends qe {
|
|
|
1617
1623
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1618
1624
|
if (t(this, x))
|
|
1619
1625
|
if (t(this, x).closest("tbody")) {
|
|
1620
|
-
const
|
|
1621
|
-
if (!
|
|
1626
|
+
const s = t(this, x).closest("tr").data, r = parseInt(t(this, x).dataset.row);
|
|
1627
|
+
if (!s) return "";
|
|
1622
1628
|
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1623
1629
|
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1624
|
-
return
|
|
1630
|
+
return s[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1625
1631
|
} else try {
|
|
1626
|
-
return this.getExprValue(t(this, x).dataset.expr,
|
|
1632
|
+
return this.getExprValue(t(this, x).dataset.expr, s, r, t(this, x));
|
|
1627
1633
|
} catch {
|
|
1628
|
-
console.error(t(this, x).dataset.expr,
|
|
1634
|
+
console.error(t(this, x).dataset.expr, s, t(this, x).dataset.row);
|
|
1629
1635
|
}
|
|
1630
1636
|
return ninegrid.nvl(e, "");
|
|
1631
1637
|
} else
|
|
@@ -1638,13 +1644,13 @@ const Ze = class Ze extends qe {
|
|
|
1638
1644
|
if (!(!t(this, L) || !t(this, L).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1639
1645
|
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1640
1646
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1641
|
-
var
|
|
1642
|
-
$("th,td",
|
|
1643
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1644
|
-
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));
|
|
1645
1651
|
}), r.sort();
|
|
1646
1652
|
var o = !1;
|
|
1647
|
-
if (parseInt(
|
|
1653
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1648
1654
|
for (var i of r) {
|
|
1649
1655
|
if (i > e) break;
|
|
1650
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);
|
|
@@ -1663,12 +1669,12 @@ const Ze = class Ze extends qe {
|
|
|
1663
1669
|
}
|
|
1664
1670
|
}
|
|
1665
1671
|
}, "#resetSuppress"));
|
|
1666
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1672
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
|
|
1667
1673
|
if (typeof e < "u")
|
|
1668
1674
|
try {
|
|
1669
1675
|
r = parseInt(r);
|
|
1670
1676
|
const i = e.replace("()", "");
|
|
1671
|
-
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);
|
|
1672
1678
|
} catch {
|
|
1673
1679
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1674
1680
|
}
|
|
@@ -1684,9 +1690,9 @@ const Ze = class Ze extends qe {
|
|
|
1684
1690
|
return e ?? "";
|
|
1685
1691
|
}
|
|
1686
1692
|
set value(e) {
|
|
1687
|
-
var
|
|
1693
|
+
var s = parseInt(t(this, x).dataset.row);
|
|
1688
1694
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1689
|
-
|
|
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);
|
|
1690
1696
|
}
|
|
1691
1697
|
get row() {
|
|
1692
1698
|
return parseInt(t(this, x).dataset.row);
|
|
@@ -1714,7 +1720,7 @@ const Ge = class Ge extends Te {
|
|
|
1714
1720
|
};
|
|
1715
1721
|
h(Ge, "EditableCellElement");
|
|
1716
1722
|
let Ce = Ge;
|
|
1717
|
-
var Wt, ct, xt, vt, de,
|
|
1723
|
+
var Wt, ct, xt, vt, de, K, Oe;
|
|
1718
1724
|
const Je = class Je extends Ce {
|
|
1719
1725
|
constructor() {
|
|
1720
1726
|
super();
|
|
@@ -1723,7 +1729,7 @@ const Je = class Je extends Ce {
|
|
|
1723
1729
|
d(this, xt);
|
|
1724
1730
|
d(this, vt);
|
|
1725
1731
|
d(this, de);
|
|
1726
|
-
d(this,
|
|
1732
|
+
d(this, K);
|
|
1727
1733
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1728
1734
|
const e = super.refresh();
|
|
1729
1735
|
t(this, Wt).value = e;
|
|
@@ -1762,22 +1768,22 @@ const Je = class Je extends Ce {
|
|
|
1762
1768
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1763
1769
|
if (t(this, ct) == "number") {
|
|
1764
1770
|
let o = [];
|
|
1765
|
-
if (t(this,
|
|
1766
|
-
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(".");
|
|
1767
1773
|
if (r >= 0) {
|
|
1768
|
-
var
|
|
1769
|
-
|
|
1774
|
+
var s = s.substr(r + 1, s.length);
|
|
1775
|
+
s.length >= Number(t(this, K)) && e.preventDefault();
|
|
1770
1776
|
}
|
|
1771
1777
|
}
|
|
1772
1778
|
}
|
|
1773
1779
|
t(this, xt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, xt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1774
1780
|
}
|
|
1775
1781
|
}, "#onKeyDown"));
|
|
1776
|
-
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)}`;
|
|
1777
1783
|
}
|
|
1778
1784
|
connectedCallback() {
|
|
1779
|
-
for (var e = [],
|
|
1780
|
-
["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}"`);
|
|
1781
1787
|
this.innerHTML = `
|
|
1782
1788
|
<input type="text"
|
|
1783
1789
|
${e.join(" ")}
|
|
@@ -1786,7 +1792,7 @@ const Je = class Je extends Ce {
|
|
|
1786
1792
|
`, super.connectedCallback(), p(this, Wt, this.querySelector("input"));
|
|
1787
1793
|
}
|
|
1788
1794
|
};
|
|
1789
|
-
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");
|
|
1790
1796
|
let ke = Je;
|
|
1791
1797
|
customElements.get("cell-input-text");
|
|
1792
1798
|
customElements.get("cell-input") || customElements.define("cell-input", ke);
|