@ninebone/table 0.0.645 β 0.0.647
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 +145 -146
- 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,9 +2,9 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var Xe = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
6
|
var c = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
|
-
var E = (q, i, e) =>
|
|
7
|
+
var E = (q, i, e) => Xe(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Ve("Cannot " + e);
|
|
8
8
|
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
9
|
var Ue = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -14,8 +14,8 @@ var Ue = (q, i, e, s) => ({
|
|
|
14
14
|
return t(q, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const He = class He extends
|
|
17
|
+
import { trace as Ke } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Ke.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
@@ -23,25 +23,25 @@ const He = class He extends Ze.constructor {
|
|
|
23
23
|
c(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const H = new oe();
|
|
26
|
-
var B,
|
|
26
|
+
var B, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
|
+
d(this, X);
|
|
33
34
|
d(this, K);
|
|
34
35
|
d(this, Z);
|
|
35
|
-
d(this, G);
|
|
36
36
|
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (y(this,
|
|
39
|
+
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
-
if (!t(this, B) || !t(this, w) || t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
@@ -61,7 +61,7 @@ const Me = class Me extends HTMLElement {
|
|
|
61
61
|
const v = l - f;
|
|
62
62
|
u > v && (u = v), n.style.left = `${u}px`, t(this, w).left.disabled = u === 0, t(this, w).right.disabled = u >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, G, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
@@ -75,16 +75,16 @@ const Me = class Me extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
90
|
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
@@ -96,16 +96,16 @@ const Me = class Me extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ c((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, j)) return;
|
|
105
105
|
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
-
y(this,
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -189,31 +189,31 @@ const Me = class Me extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, j) || this.refresh();
|
|
193
193
|
}), t(this, _t).call(this), t(this, It).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var
|
|
204
|
+
var F, at, J, T, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, F);
|
|
209
|
+
d(this, at);
|
|
210
|
+
d(this, J, !1);
|
|
211
211
|
d(this, T);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
|
-
if (!t(this,
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this,
|
|
215
|
+
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(), h = o * a;
|
|
217
217
|
if (h <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
@@ -232,16 +232,16 @@ const $e = class $e extends HTMLElement {
|
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
H.log("nine-table-vscrollbar.#init");
|
|
234
234
|
const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
|
|
235
|
-
const n = (t(this,
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
239
|
+
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
|
-
r.stopPropagation(), r.preventDefault(), y(this,
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ c((a) => {
|
|
244
|
-
if (!t(this,
|
|
244
|
+
if (!t(this, J)) return;
|
|
245
245
|
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = h.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, v = s(), x = Math.max(v - u, 1);
|
|
246
246
|
if (g > 0 && x > 0) {
|
|
247
247
|
const A = b / g * x;
|
|
@@ -251,7 +251,7 @@ const $e = class $e extends HTMLElement {
|
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
254
|
-
y(this,
|
|
254
|
+
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, T).track.addEventListener("mousedown", (r) => {
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
y(this,
|
|
273
|
+
y(this, F, this.getRootNode().host), y(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -335,7 +335,7 @@ const $e = class $e extends HTMLElement {
|
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
337
|
const e = /* @__PURE__ */ c(() => {
|
|
338
|
-
const s = t(this,
|
|
338
|
+
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,19 +351,19 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ee, Wt, Ot, zt, St, Et, Bt, Dt, At, Ae, lt, qt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
|
-
d(this,
|
|
362
|
+
d(this, Q);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, I, null);
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
365
|
+
d(this, V, null);
|
|
366
|
+
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
@@ -373,10 +373,10 @@ const Ie = class Ie {
|
|
|
373
373
|
var e;
|
|
374
374
|
H.log("rowManager.refresh");
|
|
375
375
|
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
-
i && (t(this, St).call(this), t(this,
|
|
376
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
378
|
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
|
-
H.log("rowManager.initialize"), y(this,
|
|
379
|
+
H.log("rowManager.initialize"), y(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
382
|
}), y(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
@@ -391,13 +391,13 @@ const Ie = class Ie {
|
|
|
391
391
|
});
|
|
392
392
|
const i = 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"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (i) {
|
|
394
|
-
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this,
|
|
394
|
+
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ c((h) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = h.scrollTop, f = h.scrollLeft;
|
|
400
|
-
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this,
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
402
|
[i, e, s].forEach((h) => {
|
|
403
403
|
h && h.addEventListener("scroll", () => {
|
|
@@ -418,7 +418,7 @@ const Ie = class Ie {
|
|
|
418
418
|
s.forEach((h) => {
|
|
419
419
|
o.appendChild(h.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this,
|
|
421
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
423
|
d(this, zt, /* @__PURE__ */ c((i) => {
|
|
424
424
|
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
@@ -449,7 +449,7 @@ const Ie = class Ie {
|
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
450
|
d(this, St, /* @__PURE__ */ c(() => {
|
|
451
451
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this,
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
453
453
|
H.log("π [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
454
454
|
const o = t(this, S).querySelector(n);
|
|
455
455
|
if (!o) return;
|
|
@@ -458,8 +458,8 @@ const Ie = class Ie {
|
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
460
|
d(this, Et, /* @__PURE__ */ c(() => {
|
|
461
|
-
if (t(this,
|
|
462
|
-
const i = Math.ceil(t(this,
|
|
461
|
+
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
462
|
+
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
463
463
|
y(this, wt, i + t(this, Wt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
@@ -491,7 +491,7 @@ const Ie = class Ie {
|
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
493
|
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
494
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this,
|
|
494
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
495
495
|
for (const e of i) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -501,10 +501,10 @@ const Ie = class Ie {
|
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
503
|
const h = Math.max(r - n, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, tt) !== h && (y(this, tt, h), t(this, Et).call(this), t(this, I) !== null && (t(this, At).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, V).observe(t(this, S)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
509
|
d(this, At, /* @__PURE__ */ c(() => {
|
|
510
510
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -519,44 +519,43 @@ const Ie = class Ie {
|
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, h = (t(this,
|
|
522
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, P).data.get() || []).length;
|
|
523
523
|
n.forEach((f, g) => {
|
|
524
524
|
const b = i + Math.floor(g / o);
|
|
525
525
|
if (b >= h) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const u = t(this,
|
|
529
|
+
const u = t(this, P).data.get(b);
|
|
530
530
|
f.style.display = "", t(this, qt).call(this, f, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
535
|
-
var
|
|
534
|
+
d(this, lt, /* @__PURE__ */ c((i) => {
|
|
535
|
+
var g, b;
|
|
536
536
|
const e = t(this, I);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const s = t(this,
|
|
538
|
+
const s = t(this, P).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
R.style.display = "none";
|
|
540
|
+
const r = ((g = t(this, D).get(".ng-container-body")) == null ? void 0 : g.length) || 1, n = t(this, S).querySelector(".ng-container-body .ng-part-body"), o = Math.max(0, s - Math.ceil(n.clientHeight / e)), a = Math.min(o, Math.max(0, Math.floor(i / e)));
|
|
541
|
+
let h = Math.floor(a * e);
|
|
542
|
+
H.log(`π [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, maxStartIndex: ${o}, startIndex: ${a}, offsetY: ${h}`);
|
|
543
|
+
const l = t(this, Q).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
544
|
+
(b = t(this, Q)) == null || b.scrollTables.forEach((u) => {
|
|
545
|
+
u.style.transform = `translate3d(0, ${h}px, 0)`;
|
|
546
|
+
}), f !== a && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
547
|
+
const v = t(this, S).querySelector(u);
|
|
548
|
+
if (!v) return;
|
|
549
|
+
const x = v.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
550
|
+
if (!x) return;
|
|
551
|
+
Array.from(x.querySelectorAll("tr:not(.nodata)")).forEach((m, W) => {
|
|
552
|
+
const R = a + Math.floor(W / r);
|
|
553
|
+
if (R >= s) {
|
|
554
|
+
m.style.display = "none";
|
|
556
555
|
return;
|
|
557
556
|
}
|
|
558
|
-
const
|
|
559
|
-
|
|
557
|
+
const O = t(this, P).data.get(R);
|
|
558
|
+
m.style.display = "", t(this, qt).call(this, m, O, R);
|
|
560
559
|
});
|
|
561
560
|
});
|
|
562
561
|
}, "#handleScroll"));
|
|
@@ -597,9 +596,9 @@ const Ie = class Ie {
|
|
|
597
596
|
}
|
|
598
597
|
}, "#syncHeaderHeights"));
|
|
599
598
|
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
600
|
-
t(this,
|
|
599
|
+
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
601
600
|
}, "destroy"));
|
|
602
|
-
y(this,
|
|
601
|
+
y(this, P, i.getRootNode().host), y(this, S, i), t(this, Dt).call(this);
|
|
603
602
|
}
|
|
604
603
|
getRowHeight() {
|
|
605
604
|
return t(this, I);
|
|
@@ -609,7 +608,7 @@ const Ie = class Ie {
|
|
|
609
608
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
610
609
|
}
|
|
611
610
|
};
|
|
612
|
-
|
|
611
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
613
612
|
let ce = Ie;
|
|
614
613
|
const jt = class jt {
|
|
615
614
|
/**
|
|
@@ -665,8 +664,8 @@ const jt = class jt {
|
|
|
665
664
|
}
|
|
666
665
|
const W = m.rowSpan || 1, R = m.colSpan || 1;
|
|
667
666
|
for (let O = 0; O < W; O++)
|
|
668
|
-
for (let
|
|
669
|
-
x + O < g && A +
|
|
667
|
+
for (let yt = 0; yt < R; yt++)
|
|
668
|
+
x + O < g && A + yt < b && (u[x + O][A + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
670
669
|
});
|
|
671
670
|
}), l.forEach((v) => {
|
|
672
671
|
const x = v.sectionRowIndex;
|
|
@@ -690,15 +689,15 @@ const jt = class jt {
|
|
|
690
689
|
};
|
|
691
690
|
c(jt, "TableCompiler");
|
|
692
691
|
let he = jt;
|
|
693
|
-
var Ft,
|
|
692
|
+
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
694
693
|
const pt = class pt extends HTMLElement {
|
|
695
694
|
constructor() {
|
|
696
695
|
super();
|
|
697
696
|
d(this, Ft);
|
|
698
|
-
d(this,
|
|
699
|
-
d(this,
|
|
697
|
+
d(this, et, null);
|
|
698
|
+
d(this, st);
|
|
700
699
|
E(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
701
|
-
t(this,
|
|
700
|
+
t(this, st).refresh();
|
|
702
701
|
}, "invalidate"));
|
|
703
702
|
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
704
703
|
[
|
|
@@ -707,7 +706,7 @@ const pt = class pt extends HTMLElement {
|
|
|
707
706
|
{ selector: ".ng-container-right", type: "right" }
|
|
708
707
|
].forEach(({ selector: s, type: r }) => {
|
|
709
708
|
var n, o, a;
|
|
710
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this,
|
|
709
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
711
710
|
});
|
|
712
711
|
}, "#renderSplitContainers"));
|
|
713
712
|
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
@@ -723,14 +722,14 @@ const pt = class pt extends HTMLElement {
|
|
|
723
722
|
}, "#updateContainerWidths"));
|
|
724
723
|
E(this, "generate", /* @__PURE__ */ c((e) => {
|
|
725
724
|
if (!e) return;
|
|
726
|
-
y(this,
|
|
725
|
+
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
727
726
|
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
728
|
-
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this,
|
|
727
|
+
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
729
728
|
var o;
|
|
730
729
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
731
730
|
}, 0);
|
|
732
731
|
}, "generate"));
|
|
733
|
-
d(this,
|
|
732
|
+
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
734
733
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
735
734
|
if (r === "header") {
|
|
736
735
|
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
@@ -746,7 +745,7 @@ const pt = class pt extends HTMLElement {
|
|
|
746
745
|
l.remove();
|
|
747
746
|
}), n;
|
|
748
747
|
}, "#createSplitTable"));
|
|
749
|
-
E(this, "getRowHeight", /* @__PURE__ */ c(() => t(this,
|
|
748
|
+
E(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
750
749
|
E(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
751
750
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
752
751
|
s && (s.scrollLeft = e);
|
|
@@ -947,7 +946,7 @@ const pt = class pt extends HTMLElement {
|
|
|
947
946
|
</div>
|
|
948
947
|
`;
|
|
949
948
|
}, "#render"));
|
|
950
|
-
y(this,
|
|
949
|
+
y(this, st, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
951
950
|
}
|
|
952
951
|
connectedCallback() {
|
|
953
952
|
t(this, Ut).call(this);
|
|
@@ -956,7 +955,7 @@ const pt = class pt extends HTMLElement {
|
|
|
956
955
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
957
956
|
}
|
|
958
957
|
};
|
|
959
|
-
Ft = new WeakMap(),
|
|
958
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
960
959
|
let $t = pt;
|
|
961
960
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
962
961
|
var Kt, Rt;
|
|
@@ -1165,44 +1164,44 @@ const Ne = class Ne {
|
|
|
1165
1164
|
};
|
|
1166
1165
|
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
1167
1166
|
let fe = Ne;
|
|
1168
|
-
var kt,
|
|
1167
|
+
var kt, ht;
|
|
1169
1168
|
const We = class We {
|
|
1170
1169
|
constructor(i) {
|
|
1171
1170
|
d(this, kt);
|
|
1172
|
-
d(this,
|
|
1171
|
+
d(this, ht, -1);
|
|
1173
1172
|
E(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1174
1173
|
y(this, kt, i);
|
|
1175
1174
|
}
|
|
1176
1175
|
get at() {
|
|
1177
|
-
return t(this,
|
|
1176
|
+
return t(this, ht);
|
|
1178
1177
|
}
|
|
1179
1178
|
set at(i) {
|
|
1180
|
-
y(this,
|
|
1179
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1181
1180
|
});
|
|
1182
1181
|
}
|
|
1183
1182
|
};
|
|
1184
|
-
kt = new WeakMap(),
|
|
1183
|
+
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1185
1184
|
let ue = We;
|
|
1186
|
-
var _, k, N,
|
|
1185
|
+
var _, k, N, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1187
1186
|
const z = class z {
|
|
1188
1187
|
constructor(i, e) {
|
|
1189
1188
|
d(this, _);
|
|
1190
1189
|
d(this, k);
|
|
1191
1190
|
d(this, N, []);
|
|
1192
|
-
d(this,
|
|
1191
|
+
d(this, dt, []);
|
|
1193
1192
|
d(this, Jt, 0);
|
|
1194
|
-
d(this,
|
|
1193
|
+
d(this, Y, []);
|
|
1195
1194
|
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1196
|
-
y(this,
|
|
1195
|
+
y(this, Y, []);
|
|
1197
1196
|
const i = t(this, _).template || [];
|
|
1198
1197
|
Array.from(i).forEach((e) => {
|
|
1199
1198
|
var s;
|
|
1200
|
-
t(this,
|
|
1199
|
+
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1201
1200
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1202
|
-
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this,
|
|
1201
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1203
1202
|
});
|
|
1204
1203
|
}, "#initialize"));
|
|
1205
|
-
d(this,
|
|
1204
|
+
d(this, it, /* @__PURE__ */ c(() => {
|
|
1206
1205
|
const i = t(this, _).shadowRoot.querySelector("nine-table-sheets");
|
|
1207
1206
|
i == null || i.classList.toggle("nodata", this.length === 0), t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1208
1207
|
e.invalidate();
|
|
@@ -1212,33 +1211,33 @@ const z = class z {
|
|
|
1212
1211
|
var n;
|
|
1213
1212
|
const s = this.getValidData();
|
|
1214
1213
|
if (!s || s.length <= 0) return;
|
|
1215
|
-
if (i == null) return t(this,
|
|
1214
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1216
1215
|
if (i < 0 || i >= s.length) return null;
|
|
1217
1216
|
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1218
1217
|
if (e != null) {
|
|
1219
1218
|
const o = r.indexOf(e);
|
|
1220
1219
|
return o >= 0 ? s[i].v[o] : null;
|
|
1221
1220
|
}
|
|
1222
|
-
return t(this,
|
|
1221
|
+
return t(this, ft).call(this, s[i]);
|
|
1223
1222
|
}, "get"));
|
|
1224
1223
|
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1225
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1224
|
+
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1226
1225
|
}, "set"));
|
|
1227
1226
|
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1228
1227
|
rowState: z.ROW_STATE.EMPTY,
|
|
1229
1228
|
deleted: !1,
|
|
1230
1229
|
filtered: !1,
|
|
1231
|
-
height: t(this,
|
|
1230
|
+
height: t(this, Y).slice(),
|
|
1232
1231
|
o: {},
|
|
1233
1232
|
c: {},
|
|
1234
|
-
_: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1233
|
+
_: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1235
1234
|
}), "#getDefaultMeta"));
|
|
1236
1235
|
E(this, "reset", /* @__PURE__ */ c(() => {
|
|
1237
|
-
y(this, N, []), y(this,
|
|
1236
|
+
y(this, N, []), y(this, dt, []), t(this, it).call(this);
|
|
1238
1237
|
}, "reset"));
|
|
1239
1238
|
E(this, "clear", /* @__PURE__ */ c(() => {
|
|
1240
1239
|
var i;
|
|
1241
|
-
t(this, k).rawRecords = [], y(this, N, []), y(this,
|
|
1240
|
+
t(this, k).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1242
1241
|
}, "clear"));
|
|
1243
1242
|
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1244
1243
|
var r;
|
|
@@ -1262,7 +1261,7 @@ const z = class z {
|
|
|
1262
1261
|
return e || s.forEach((n, o) => {
|
|
1263
1262
|
const a = t(this, k).rawRecords[r - o];
|
|
1264
1263
|
a && (a.__ng.rowState = z.ROW_STATE.EMPTY);
|
|
1265
|
-
}), t(this,
|
|
1264
|
+
}), t(this, it).call(this), r;
|
|
1266
1265
|
}, "add"));
|
|
1267
1266
|
E(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1268
1267
|
let e = [];
|
|
@@ -1273,7 +1272,7 @@ const z = class z {
|
|
|
1273
1272
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = z.ROW_STATE.DELETE);
|
|
1274
1273
|
});
|
|
1275
1274
|
}
|
|
1276
|
-
}), this.resetRecords(), t(this,
|
|
1275
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1277
1276
|
}, "delete"));
|
|
1278
1277
|
E(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1279
1278
|
var h;
|
|
@@ -1286,14 +1285,14 @@ const z = class z {
|
|
|
1286
1285
|
a !== s && o.__ng.rowState !== z.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = z.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1287
1286
|
}, "setValue"));
|
|
1288
1287
|
E(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1289
|
-
y(this,
|
|
1288
|
+
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1290
1289
|
i.__ng.rowidx = e;
|
|
1291
1290
|
}), t(this, N).forEach((i, e) => {
|
|
1292
1291
|
i.__ng.i = e;
|
|
1293
1292
|
});
|
|
1294
1293
|
}, "resetRecords"));
|
|
1295
1294
|
E(this, "getValidData", /* @__PURE__ */ c(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1296
|
-
d(this,
|
|
1295
|
+
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1297
1296
|
var o;
|
|
1298
1297
|
if (!i) return i;
|
|
1299
1298
|
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
@@ -1308,7 +1307,7 @@ const z = class z {
|
|
|
1308
1307
|
y(this, _, i), y(this, k, e), t(this, Qt).call(this);
|
|
1309
1308
|
}
|
|
1310
1309
|
get source() {
|
|
1311
|
-
return t(this,
|
|
1310
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1312
1311
|
}
|
|
1313
1312
|
set source(i) {
|
|
1314
1313
|
this.clear(), this.add(i, !1);
|
|
@@ -1326,7 +1325,7 @@ const z = class z {
|
|
|
1326
1325
|
return this.length;
|
|
1327
1326
|
}
|
|
1328
1327
|
};
|
|
1329
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(),
|
|
1328
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(z, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1330
1329
|
E(z, "ROW_STATE", {
|
|
1331
1330
|
EMPTY: "EMPTY",
|
|
1332
1331
|
NORMAL: "NORMAL",
|
|
@@ -1335,13 +1334,13 @@ E(z, "ROW_STATE", {
|
|
|
1335
1334
|
DELETE: "DELETE"
|
|
1336
1335
|
});
|
|
1337
1336
|
let ge = z;
|
|
1338
|
-
var
|
|
1337
|
+
var rt;
|
|
1339
1338
|
const Oe = class Oe {
|
|
1340
1339
|
constructor(i) {
|
|
1341
|
-
d(this,
|
|
1342
|
-
y(this,
|
|
1340
|
+
d(this, rt);
|
|
1341
|
+
y(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1343
1342
|
var e;
|
|
1344
|
-
(e = t(this,
|
|
1343
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1345
1344
|
}, this.setDataSource = (e) => {
|
|
1346
1345
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1347
1346
|
}, this.getRowState = (e) => {
|
|
@@ -1356,13 +1355,13 @@ const Oe = class Oe {
|
|
|
1356
1355
|
}, this.setDataSource([]);
|
|
1357
1356
|
}
|
|
1358
1357
|
};
|
|
1359
|
-
|
|
1358
|
+
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1360
1359
|
let be = Oe;
|
|
1361
|
-
var
|
|
1360
|
+
var ut, L, Lt, se;
|
|
1362
1361
|
const ze = class ze {
|
|
1363
1362
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1364
1363
|
constructor(i) {
|
|
1365
|
-
d(this,
|
|
1364
|
+
d(this, ut);
|
|
1366
1365
|
d(this, L, []);
|
|
1367
1366
|
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1368
1367
|
i.forEach((s) => {
|
|
@@ -1376,8 +1375,8 @@ const ze = class ze {
|
|
|
1376
1375
|
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1377
1376
|
}, "#adjust"));
|
|
1378
1377
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1379
|
-
y(this, L, []), H.log(t(this,
|
|
1380
|
-
const i = Array.from(t(this,
|
|
1378
|
+
y(this, L, []), H.log(t(this, ut).querySelectorAll("table"));
|
|
1379
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1381
1380
|
if (!(!i || i.length === 0)) {
|
|
1382
1381
|
for (const e of i)
|
|
1383
1382
|
H.log(e), $("[data-bind]", e).each((s, r) => {
|
|
@@ -1407,7 +1406,7 @@ const ze = class ze {
|
|
|
1407
1406
|
t(this, Lt).call(this);
|
|
1408
1407
|
}
|
|
1409
1408
|
}, "#init"));
|
|
1410
|
-
y(this,
|
|
1409
|
+
y(this, ut, i), t(this, se).call(this);
|
|
1411
1410
|
}
|
|
1412
1411
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1413
1412
|
get() {
|
|
@@ -1429,19 +1428,19 @@ const ze = class ze {
|
|
|
1429
1428
|
return t(this, L).some((e) => e.name === i);
|
|
1430
1429
|
}
|
|
1431
1430
|
};
|
|
1432
|
-
|
|
1431
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(ze, "ngFields");
|
|
1433
1432
|
let ye = ze;
|
|
1434
|
-
var
|
|
1433
|
+
var nt, ie, re;
|
|
1435
1434
|
const Be = class Be extends HTMLElement {
|
|
1436
1435
|
constructor() {
|
|
1437
1436
|
super();
|
|
1438
1437
|
//#created = false;
|
|
1439
|
-
d(this,
|
|
1438
|
+
d(this, nt);
|
|
1440
1439
|
d(this, ie);
|
|
1441
1440
|
d(this, re, /* @__PURE__ */ c(() => {
|
|
1442
1441
|
this.fields = new ye(this), y(this, ie, new fe(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1443
1442
|
}, "#init"));
|
|
1444
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1443
|
+
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1445
1444
|
}
|
|
1446
1445
|
connectedCallback() {
|
|
1447
1446
|
t(this, re).call(this);
|
|
@@ -1451,18 +1450,18 @@ const Be = class Be extends HTMLElement {
|
|
|
1451
1450
|
}
|
|
1452
1451
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1453
1452
|
get data() {
|
|
1454
|
-
return t(this,
|
|
1453
|
+
return t(this, nt).data;
|
|
1455
1454
|
}
|
|
1456
1455
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1457
1456
|
get row() {
|
|
1458
|
-
return t(this,
|
|
1457
|
+
return t(this, nt).row;
|
|
1459
1458
|
}
|
|
1460
1459
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1461
1460
|
get dataManager() {
|
|
1462
|
-
return t(this,
|
|
1461
|
+
return t(this, nt);
|
|
1463
1462
|
}
|
|
1464
1463
|
};
|
|
1465
|
-
|
|
1464
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(Be, "NineTable");
|
|
1466
1465
|
let pe = Be;
|
|
1467
1466
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1468
1467
|
const mt = class mt extends HTMLElement {
|
|
@@ -1589,16 +1588,16 @@ const Pe = class Pe extends ve {
|
|
|
1589
1588
|
};
|
|
1590
1589
|
c(Pe, "EditableCellElement");
|
|
1591
1590
|
let xe = Pe;
|
|
1592
|
-
var Mt,
|
|
1591
|
+
var Mt, ot, gt, bt, ne, U, Le;
|
|
1593
1592
|
const je = class je extends xe {
|
|
1594
1593
|
constructor() {
|
|
1595
1594
|
super();
|
|
1596
1595
|
d(this, Mt);
|
|
1597
|
-
d(this,
|
|
1596
|
+
d(this, ot);
|
|
1597
|
+
d(this, gt);
|
|
1598
1598
|
d(this, bt);
|
|
1599
|
-
d(this, yt);
|
|
1600
1599
|
d(this, ne);
|
|
1601
|
-
d(this,
|
|
1600
|
+
d(this, U);
|
|
1602
1601
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1603
1602
|
const e = super.refresh();
|
|
1604
1603
|
t(this, Mt).value = e;
|
|
@@ -1635,20 +1634,20 @@ const je = class je extends xe {
|
|
|
1635
1634
|
*/
|
|
1636
1635
|
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1637
1636
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1638
|
-
if (t(this,
|
|
1637
|
+
if (t(this, ot) == "number") {
|
|
1639
1638
|
let n = [];
|
|
1640
|
-
if (t(this,
|
|
1639
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1641
1640
|
var s = e.target.value, r = s.indexOf(".");
|
|
1642
1641
|
if (r >= 0) {
|
|
1643
1642
|
var s = s.substr(r + 1, s.length);
|
|
1644
|
-
s.length >= Number(t(this,
|
|
1643
|
+
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1645
1644
|
}
|
|
1646
1645
|
}
|
|
1647
1646
|
}
|
|
1648
|
-
t(this,
|
|
1647
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1649
1648
|
}
|
|
1650
1649
|
}, "#onKeyDown"));
|
|
1651
|
-
if (this.applyBaseStyle(), y(this,
|
|
1650
|
+
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1652
1651
|
}
|
|
1653
1652
|
connectedCallback() {
|
|
1654
1653
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1661,7 +1660,7 @@ const je = class je extends xe {
|
|
|
1661
1660
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1662
1661
|
}
|
|
1663
1662
|
};
|
|
1664
|
-
Mt = new WeakMap(),
|
|
1663
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1665
1664
|
let we = je;
|
|
1666
1665
|
customElements.get("cell-input-text");
|
|
1667
1666
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|