@ninebone/table 0.0.463 β 0.0.465
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 +171 -169
- 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
|
@@ -21,27 +21,27 @@ const Ce = class Ce extends Ue.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
c(Ce, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var B,
|
|
24
|
+
let ae = Ce;
|
|
25
|
+
const bt = new ae();
|
|
26
|
+
var B, P, w, U, X, K, Mt, Z, It;
|
|
27
27
|
const Le = class Le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, P, !1);
|
|
32
32
|
d(this, w);
|
|
33
|
+
d(this, U);
|
|
33
34
|
d(this, X);
|
|
34
35
|
d(this, K);
|
|
35
|
-
d(this, Z);
|
|
36
36
|
d(this, Mt, /* @__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 && (b(this,
|
|
39
|
+
e && (b(this, K, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, K).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
S(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
-
if (!t(this, B) || !t(this, w) || t(this,
|
|
44
|
+
if (!t(this, B) || !t(this, w) || t(this, P)) 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 Le = class Le extends HTMLElement {
|
|
|
61
61
|
const m = l - f;
|
|
62
62
|
g > m && (g = m), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, Z, /* @__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 Le = class Le extends HTMLElement {
|
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, It, /* @__PURE__ */ c(() => {
|
|
77
77
|
const e = /* @__PURE__ */ c((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, U)), clearInterval(t(this, X));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Z).call(this, n + r), b(this, U, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, U)), b(this, X, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Z).call(this, o + r) || clearInterval(t(this, X));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, U)), clearInterval(t(this, X));
|
|
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 Le = class Le 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, Z).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(), b(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), b(this, P, !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, P)) return;
|
|
105
105
|
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, Z).call(this, a.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
-
b(this,
|
|
108
|
+
b(this, P, !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 Le = class Le 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, P) || this.refresh();
|
|
193
193
|
}), t(this, It).call(this), t(this, Mt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, K) && t(this, K).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
201
|
+
B = new WeakMap(), P = new WeakMap(), w = new WeakMap(), U = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Mt = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), c(Le, "NineTableHScrollBar");
|
|
202
|
+
let le = Le;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
+
var j, nt, G, q, xt, vt, _t;
|
|
205
205
|
const He = class He extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, j);
|
|
209
|
+
d(this, nt);
|
|
210
|
+
d(this, G, !1);
|
|
211
211
|
d(this, q);
|
|
212
212
|
d(this, xt, 0);
|
|
213
213
|
d(this, vt, 0);
|
|
214
214
|
S(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
|
-
if (!t(this,
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this,
|
|
215
|
+
if (!t(this, j) || !t(this, q)) return;
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, j).data.get() || []).length, h = t(this, nt).getRowHeight(), l = a * h;
|
|
217
217
|
if (l <= n) {
|
|
218
218
|
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
@@ -231,16 +231,16 @@ const He = class He extends HTMLElement {
|
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, _t, /* @__PURE__ */ c(() => {
|
|
233
233
|
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
234
|
-
const n = (t(this,
|
|
234
|
+
const n = (t(this, j).data.get() || []).length, o = t(this, nt).getRowHeight();
|
|
235
235
|
return n * o;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
|
-
t(this,
|
|
238
|
+
t(this, G) || this.refresh();
|
|
239
239
|
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(), b(this,
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), b(this, G, !0), b(this, xt, r.clientY), b(this, vt, e.scrollTop);
|
|
242
242
|
const n = /* @__PURE__ */ c((a) => {
|
|
243
|
-
if (!t(this,
|
|
243
|
+
if (!t(this, G)) return;
|
|
244
244
|
const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l, p = a.clientY - t(this, xt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
246
|
const E = p / u * v;
|
|
@@ -250,7 +250,7 @@ const He = class He extends HTMLElement {
|
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
253
|
-
b(this,
|
|
253
|
+
b(this, G, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
@@ -269,7 +269,7 @@ const He = class He extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
b(this,
|
|
272
|
+
b(this, j, this.getRootNode().host), b(this, nt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,7 +334,7 @@ const He = class He extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ c(() => {
|
|
337
|
-
const s = t(this,
|
|
337
|
+
const s = t(this, j).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
@@ -350,25 +350,25 @@ const He = class He extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var
|
|
353
|
+
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), _t = new WeakMap(), c(He, "NineTableVScrollBar");
|
|
354
|
+
let ce = He;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
356
|
+
var D, A, z, H, F, J, wt, ot, Nt, Wt, Ot, St, Et, Bt, zt, At, Dt, at, Rt, Pt;
|
|
357
357
|
const $e = class $e {
|
|
358
358
|
constructor(i) {
|
|
359
|
-
d(this,
|
|
359
|
+
d(this, D);
|
|
360
360
|
d(this, A);
|
|
361
361
|
d(this, z, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, H, null);
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
363
|
+
d(this, F, null);
|
|
364
|
+
d(this, J, 0);
|
|
365
365
|
d(this, wt, 40);
|
|
366
|
-
d(this,
|
|
366
|
+
d(this, ot, !1);
|
|
367
367
|
d(this, Nt, 3);
|
|
368
368
|
S(this, "refresh", /* @__PURE__ */ c(() => {
|
|
369
369
|
var e;
|
|
370
370
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body");
|
|
371
|
-
i && (t(this, St).call(this), t(this,
|
|
371
|
+
i && (t(this, St).call(this), t(this, at).call(this, i.scrollTop), (e = t(this, A).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
372
372
|
}, "refresh"));
|
|
373
373
|
S(this, "initialize", /* @__PURE__ */ c(() => {
|
|
374
374
|
b(this, H, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
@@ -383,11 +383,11 @@ const $e = class $e {
|
|
|
383
383
|
});
|
|
384
384
|
const i = t(this, A).querySelector(".ng-container-body .ng-part-body"), e = t(this, A).querySelector(".ng-container-left .ng-part-body"), s = t(this, A).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (i) {
|
|
386
|
-
t(this, Ot).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this,
|
|
386
|
+
t(this, Ot).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, at).call(this, i.scrollTop);
|
|
387
387
|
let r = !1;
|
|
388
388
|
const n = /* @__PURE__ */ c((o, a) => {
|
|
389
389
|
var h;
|
|
390
|
-
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this,
|
|
390
|
+
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, at).call(this, o), (h = t(this, A).querySelector("nine-table-vscrollbar")) == null || h.refresh(), r = !1);
|
|
391
391
|
}, "syncScroll");
|
|
392
392
|
[i, e, s].forEach((o) => {
|
|
393
393
|
o && o.addEventListener("scroll", () => {
|
|
@@ -430,7 +430,7 @@ const $e = class $e {
|
|
|
430
430
|
}), u.forEach((p) => p.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, b(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
432
|
d(this, St, /* @__PURE__ */ c(() => {
|
|
433
|
-
const e = (t(this,
|
|
433
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, H) || 24, r = e * s;
|
|
434
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
435
435
|
const o = t(this, A).querySelector(n);
|
|
436
436
|
if (!o) return;
|
|
@@ -439,8 +439,8 @@ const $e = class $e {
|
|
|
439
439
|
});
|
|
440
440
|
}, "#updateVirtualScrollHeight"));
|
|
441
441
|
d(this, Et, /* @__PURE__ */ c(() => {
|
|
442
|
-
if (t(this,
|
|
443
|
-
const i = Math.ceil(t(this,
|
|
442
|
+
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
443
|
+
const i = Math.ceil(t(this, J) / t(this, H));
|
|
444
444
|
b(this, wt, i + t(this, Nt));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
@@ -472,7 +472,7 @@ const $e = class $e {
|
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
474
474
|
d(this, zt, /* @__PURE__ */ c(() => {
|
|
475
|
-
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (b(this,
|
|
475
|
+
!t(this, A) || !(t(this, A) instanceof HTMLElement) || (b(this, F, new ResizeObserver((i) => {
|
|
476
476
|
for (const e of i) {
|
|
477
477
|
const s = e.target;
|
|
478
478
|
if (!s.classList.contains("active")) continue;
|
|
@@ -482,10 +482,10 @@ const $e = class $e {
|
|
|
482
482
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
483
483
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
484
484
|
const h = Math.max(r - n, 100);
|
|
485
|
-
t(this,
|
|
485
|
+
t(this, J) !== h && (b(this, J, h), t(this, Et).call(this), t(this, H) !== null && t(this, At).call(this));
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
})), t(this,
|
|
488
|
+
})), t(this, F).observe(t(this, A)));
|
|
489
489
|
}, "#initResizeObserver"));
|
|
490
490
|
d(this, At, /* @__PURE__ */ c(() => {
|
|
491
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -500,23 +500,23 @@ const $e = class $e {
|
|
|
500
500
|
if (!s) return;
|
|
501
501
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
502
502
|
if (!r) return;
|
|
503
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, h = (t(this,
|
|
503
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, D).data.get() || []).length;
|
|
504
504
|
n.forEach((f, u) => {
|
|
505
505
|
const p = i + Math.floor(u / o);
|
|
506
506
|
if (p >= h) {
|
|
507
507
|
f.style.display = "none";
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
const g = t(this,
|
|
510
|
+
const g = t(this, D).data.get(p);
|
|
511
511
|
f.style.display = "", t(this, Rt).call(this, f, g, p);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}, "#adjustBufferRows"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, at, /* @__PURE__ */ c((i) => {
|
|
516
516
|
var h;
|
|
517
517
|
const e = t(this, H);
|
|
518
518
|
if (!e || e <= 0) return;
|
|
519
|
-
const r = (t(this,
|
|
519
|
+
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((h = t(this, z).get(".ng-container-body")) == null ? void 0 : h.length) || 1;
|
|
520
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
521
521
|
const f = t(this, A).querySelector(l);
|
|
522
522
|
if (!f) return;
|
|
@@ -528,11 +528,11 @@ const $e = class $e {
|
|
|
528
528
|
g.style.display = "none";
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const E = t(this,
|
|
531
|
+
const E = t(this, D).data.get(v);
|
|
532
532
|
g.style.display = "", t(this, Rt).call(this, g, E, v);
|
|
533
533
|
});
|
|
534
|
-
}), t(this,
|
|
535
|
-
t(this, Dt).call(this, n), b(this,
|
|
534
|
+
}), t(this, ot) || (b(this, ot, !0), setTimeout(() => {
|
|
535
|
+
t(this, Dt).call(this, n), b(this, ot, !1);
|
|
536
536
|
}, 0));
|
|
537
537
|
}, "#handleScroll"));
|
|
538
538
|
/**
|
|
@@ -552,8 +552,8 @@ const $e = class $e {
|
|
|
552
552
|
d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
553
553
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
554
554
|
r.dataset.row = s, r.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
|
|
555
|
-
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.
|
|
556
|
-
o && typeof o.
|
|
555
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
556
|
+
o && typeof o.refresh == "function" && o.refresh();
|
|
557
557
|
});
|
|
558
558
|
}, "#bindRowData"));
|
|
559
559
|
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
@@ -571,9 +571,9 @@ const $e = class $e {
|
|
|
571
571
|
}
|
|
572
572
|
}, "#syncHeaderHeights"));
|
|
573
573
|
S(this, "destroy", /* @__PURE__ */ c(() => {
|
|
574
|
-
t(this,
|
|
574
|
+
t(this, F) && (t(this, F).disconnect(), b(this, F, null));
|
|
575
575
|
}, "destroy"));
|
|
576
|
-
b(this,
|
|
576
|
+
b(this, D, i.getRootNode().host), b(this, A, i), t(this, zt).call(this);
|
|
577
577
|
}
|
|
578
578
|
getRowHeight() {
|
|
579
579
|
return t(this, H);
|
|
@@ -583,8 +583,8 @@ const $e = class $e {
|
|
|
583
583
|
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
let
|
|
586
|
+
D = new WeakMap(), A = new WeakMap(), z = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), wt = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), c($e, "RowManager");
|
|
587
|
+
let he = $e;
|
|
588
588
|
const jt = class jt {
|
|
589
589
|
/**
|
|
590
590
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -663,17 +663,17 @@ const jt = class jt {
|
|
|
663
663
|
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
664
664
|
};
|
|
665
665
|
c(jt, "TableCompiler");
|
|
666
|
-
let
|
|
667
|
-
var Ft,
|
|
666
|
+
let de = jt;
|
|
667
|
+
var Ft, Q, tt, Vt, Yt, lt, Ut, Xt;
|
|
668
668
|
const yt = class yt extends HTMLElement {
|
|
669
669
|
constructor() {
|
|
670
670
|
super();
|
|
671
671
|
d(this, Ft);
|
|
672
|
-
d(this,
|
|
673
|
-
d(this,
|
|
672
|
+
d(this, Q, null);
|
|
673
|
+
d(this, tt);
|
|
674
674
|
S(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
675
675
|
var e, s;
|
|
676
|
-
t(this,
|
|
676
|
+
t(this, tt).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
677
677
|
}, "invalidate"));
|
|
678
678
|
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
679
679
|
[
|
|
@@ -685,15 +685,15 @@ const yt = class yt extends HTMLElement {
|
|
|
685
685
|
if (!n) return;
|
|
686
686
|
n.innerHTML = "";
|
|
687
687
|
const o = document.createElement("div");
|
|
688
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
688
|
+
o.className = "ng-part-header", o.appendChild(t(this, lt).call(this, t(this, Q), r, "header"));
|
|
689
689
|
const a = document.createElement("div");
|
|
690
690
|
a.className = "ng-part-body";
|
|
691
691
|
const h = document.createElement("div");
|
|
692
|
-
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this,
|
|
692
|
+
h.className = "ng-scroll-content", h.style.position = "relative", h.style.width = "100%", h.appendChild(t(this, lt).call(this, t(this, Q), r, "body"));
|
|
693
693
|
const l = document.createElement("div");
|
|
694
694
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", h.appendChild(l), a.appendChild(h);
|
|
695
695
|
const f = document.createElement("div");
|
|
696
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
696
|
+
f.className = "ng-part-footer", f.appendChild(t(this, lt).call(this, t(this, Q), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
697
697
|
});
|
|
698
698
|
}, "#renderSplitContainers"));
|
|
699
699
|
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
@@ -708,12 +708,12 @@ const yt = class yt extends HTMLElement {
|
|
|
708
708
|
});
|
|
709
709
|
}, "#updateContainerWidths"));
|
|
710
710
|
S(this, "generate", /* @__PURE__ */ c((e) => {
|
|
711
|
-
e && (b(this,
|
|
711
|
+
e && (b(this, Q, de.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, tt).initialize(), setTimeout(() => {
|
|
712
712
|
var s;
|
|
713
713
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
714
714
|
}, 0));
|
|
715
715
|
}, "generate"));
|
|
716
|
-
d(this,
|
|
716
|
+
d(this, lt, /* @__PURE__ */ c((e, s, r) => {
|
|
717
717
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
718
718
|
if (r === "header") {
|
|
719
719
|
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
@@ -729,7 +729,7 @@ const yt = class yt extends HTMLElement {
|
|
|
729
729
|
l.remove();
|
|
730
730
|
}), n;
|
|
731
731
|
}, "#createSplitTable"));
|
|
732
|
-
S(this, "getRowHeight", /* @__PURE__ */ c(() => t(this,
|
|
732
|
+
S(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, tt).getRowHeight(), "getRowHeight"));
|
|
733
733
|
S(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
734
734
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
735
735
|
s && (s.scrollLeft = e);
|
|
@@ -884,16 +884,16 @@ const yt = class yt extends HTMLElement {
|
|
|
884
884
|
</div>
|
|
885
885
|
`;
|
|
886
886
|
}, "#render"));
|
|
887
|
-
b(this,
|
|
887
|
+
b(this, tt, new he(this)), b(this, Ft, this.getRootNode().host);
|
|
888
888
|
}
|
|
889
889
|
connectedCallback() {
|
|
890
890
|
t(this, Ut).call(this);
|
|
891
891
|
}
|
|
892
892
|
disconnectedCallback() {
|
|
893
|
-
this.innerHTML = "",
|
|
893
|
+
this.innerHTML = "", bt.log("NineTableSheet destroyed.");
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
|
-
Ft = new WeakMap(),
|
|
896
|
+
Ft = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), lt = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(yt, "NineTableSheet"), S(yt, "SCROLLBAR_SIZE", 16);
|
|
897
897
|
let $t = yt;
|
|
898
898
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
899
899
|
var Kt, qt;
|
|
@@ -945,8 +945,8 @@ const Me = class Me extends HTMLElement {
|
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
947
|
Kt = new WeakMap(), qt = new WeakMap(), c(Me, "NineTableSheets");
|
|
948
|
-
let
|
|
949
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
948
|
+
let fe = Me;
|
|
949
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
950
950
|
var M, Zt, kt, Gt;
|
|
951
951
|
const Ie = class Ie {
|
|
952
952
|
constructor(i) {
|
|
@@ -1071,45 +1071,45 @@ const Ie = class Ie {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
};
|
|
1073
1073
|
M = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), c(Ie, "LayoutManager");
|
|
1074
|
-
let
|
|
1075
|
-
var Tt,
|
|
1074
|
+
let ue = Ie;
|
|
1075
|
+
var Tt, ct;
|
|
1076
1076
|
const _e = class _e {
|
|
1077
1077
|
constructor(i) {
|
|
1078
1078
|
d(this, Tt);
|
|
1079
|
-
d(this,
|
|
1079
|
+
d(this, ct, -1);
|
|
1080
1080
|
S(this, "count", /* @__PURE__ */ c(() => t(this, Tt).rawRecords.length, "count"));
|
|
1081
1081
|
b(this, Tt, i);
|
|
1082
1082
|
}
|
|
1083
1083
|
get at() {
|
|
1084
|
-
return t(this,
|
|
1084
|
+
return t(this, ct);
|
|
1085
1085
|
}
|
|
1086
1086
|
set at(i) {
|
|
1087
|
-
b(this,
|
|
1087
|
+
b(this, ct, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ct)}"]`) && setTimeout(() => {
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
1090
|
};
|
|
1091
|
-
Tt = new WeakMap(),
|
|
1092
|
-
let
|
|
1093
|
-
var I, k, _,
|
|
1091
|
+
Tt = new WeakMap(), ct = new WeakMap(), c(_e, "ngRow");
|
|
1092
|
+
let ge = _e;
|
|
1093
|
+
var I, k, _, ht, Jt, V, Qt, et, Ct, te, ee, dt;
|
|
1094
1094
|
const N = class N {
|
|
1095
1095
|
constructor(i, e) {
|
|
1096
1096
|
d(this, I);
|
|
1097
1097
|
d(this, k);
|
|
1098
1098
|
d(this, _, []);
|
|
1099
|
-
d(this,
|
|
1099
|
+
d(this, ht, []);
|
|
1100
1100
|
d(this, Jt, 0);
|
|
1101
|
-
d(this,
|
|
1101
|
+
d(this, V, []);
|
|
1102
1102
|
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1103
|
-
b(this,
|
|
1103
|
+
b(this, V, []);
|
|
1104
1104
|
const i = t(this, I).template || [];
|
|
1105
1105
|
Array.from(i).forEach((e) => {
|
|
1106
1106
|
var s;
|
|
1107
|
-
t(this,
|
|
1107
|
+
t(this, V).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1108
1108
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1109
|
-
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this,
|
|
1109
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, V).slice();
|
|
1110
1110
|
});
|
|
1111
1111
|
}, "#initialize"));
|
|
1112
|
-
d(this,
|
|
1112
|
+
d(this, et, /* @__PURE__ */ c(() => {
|
|
1113
1113
|
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1114
1114
|
i.invalidate();
|
|
1115
1115
|
});
|
|
@@ -1118,33 +1118,33 @@ const N = class N {
|
|
|
1118
1118
|
var n;
|
|
1119
1119
|
const s = this.getValidData();
|
|
1120
1120
|
if (!s || s.length <= 0) return;
|
|
1121
|
-
if (i == null) return t(this,
|
|
1121
|
+
if (i == null) return t(this, dt).call(this, s);
|
|
1122
1122
|
if (i < 0 || i >= s.length) return null;
|
|
1123
1123
|
const r = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1124
1124
|
if (e != null) {
|
|
1125
1125
|
const o = r.indexOf(e);
|
|
1126
1126
|
return o >= 0 ? s[i].v[o] : null;
|
|
1127
1127
|
}
|
|
1128
|
-
return t(this,
|
|
1128
|
+
return t(this, dt).call(this, s[i]);
|
|
1129
1129
|
}, "get"));
|
|
1130
1130
|
S(this, "set", /* @__PURE__ */ c((i) => {
|
|
1131
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1131
|
+
this.clear(), this.add(i, !1), t(this, et).call(this);
|
|
1132
1132
|
}, "set"));
|
|
1133
1133
|
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1134
1134
|
rowState: N.ROW_STATE.EMPTY,
|
|
1135
1135
|
deleted: !1,
|
|
1136
1136
|
filtered: !1,
|
|
1137
|
-
height: t(this,
|
|
1137
|
+
height: t(this, V).slice(),
|
|
1138
1138
|
o: {},
|
|
1139
1139
|
c: {},
|
|
1140
|
-
_: [0, 0, 0, 0, N.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1140
|
+
_: [0, 0, 0, 0, N.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, V).slice(), -1, {}, {}]
|
|
1141
1141
|
}), "#getDefaultMeta"));
|
|
1142
1142
|
S(this, "reset", /* @__PURE__ */ c(() => {
|
|
1143
|
-
b(this, _, []), b(this,
|
|
1143
|
+
b(this, _, []), b(this, ht, []), t(this, et).call(this);
|
|
1144
1144
|
}, "reset"));
|
|
1145
1145
|
S(this, "clear", /* @__PURE__ */ c(() => {
|
|
1146
1146
|
var i;
|
|
1147
|
-
t(this, k).rawRecords = [], b(this, _, []), b(this,
|
|
1147
|
+
t(this, k).rawRecords = [], b(this, _, []), b(this, ht, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1148
1148
|
}, "clear"));
|
|
1149
1149
|
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1150
1150
|
var r;
|
|
@@ -1168,7 +1168,7 @@ const N = class N {
|
|
|
1168
1168
|
return e || s.forEach((n, o) => {
|
|
1169
1169
|
const a = t(this, k).rawRecords[r - o];
|
|
1170
1170
|
a && (a.__ng.rowState = N.ROW_STATE.EMPTY);
|
|
1171
|
-
}), t(this,
|
|
1171
|
+
}), t(this, et).call(this), r;
|
|
1172
1172
|
}, "add"));
|
|
1173
1173
|
S(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1174
1174
|
let e = [];
|
|
@@ -1179,7 +1179,7 @@ const N = class N {
|
|
|
1179
1179
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = N.ROW_STATE.DELETE);
|
|
1180
1180
|
});
|
|
1181
1181
|
}
|
|
1182
|
-
}), this.resetRecords(), t(this,
|
|
1182
|
+
}), this.resetRecords(), t(this, et).call(this);
|
|
1183
1183
|
}, "delete"));
|
|
1184
1184
|
S(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1185
1185
|
var h;
|
|
@@ -1192,14 +1192,14 @@ const N = class N {
|
|
|
1192
1192
|
a !== s && o.__ng.rowState !== N.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = N.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1193
1193
|
}, "setValue"));
|
|
1194
1194
|
S(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1195
|
-
b(this,
|
|
1195
|
+
b(this, ht, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), b(this, _, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1196
1196
|
i.__ng.rowidx = e;
|
|
1197
1197
|
}), t(this, _).forEach((i, e) => {
|
|
1198
1198
|
i.__ng.i = e;
|
|
1199
1199
|
});
|
|
1200
1200
|
}, "resetRecords"));
|
|
1201
1201
|
S(this, "getValidData", /* @__PURE__ */ c(() => (t(this, _).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1202
|
-
d(this,
|
|
1202
|
+
d(this, dt, /* @__PURE__ */ c((i) => {
|
|
1203
1203
|
var o;
|
|
1204
1204
|
if (!i) return i;
|
|
1205
1205
|
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, I).fields) == null ? void 0 : o.get) == "function" ? t(this, I).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
@@ -1214,7 +1214,7 @@ const N = class N {
|
|
|
1214
1214
|
b(this, I, i), b(this, k, e), t(this, Qt).call(this);
|
|
1215
1215
|
}
|
|
1216
1216
|
get source() {
|
|
1217
|
-
return t(this,
|
|
1217
|
+
return t(this, dt).call(this, t(this, k).rawRecords);
|
|
1218
1218
|
}
|
|
1219
1219
|
set source(i) {
|
|
1220
1220
|
this.clear(), this.add(i, !1);
|
|
@@ -1229,7 +1229,7 @@ const N = class N {
|
|
|
1229
1229
|
return this.length;
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
I = new WeakMap(), k = new WeakMap(), _ = new WeakMap(),
|
|
1232
|
+
I = new WeakMap(), k = new WeakMap(), _ = new WeakMap(), ht = new WeakMap(), Jt = new WeakMap(), V = new WeakMap(), Qt = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), dt = new WeakMap(), c(N, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1233
1233
|
S(N, "ROW_STATE", {
|
|
1234
1234
|
EMPTY: "EMPTY",
|
|
1235
1235
|
NORMAL: "NORMAL",
|
|
@@ -1237,14 +1237,14 @@ S(N, "ROW_STATE", {
|
|
|
1237
1237
|
UPDATE: "UPDATE",
|
|
1238
1238
|
DELETE: "DELETE"
|
|
1239
1239
|
});
|
|
1240
|
-
let
|
|
1241
|
-
var
|
|
1240
|
+
let be = N;
|
|
1241
|
+
var st;
|
|
1242
1242
|
const Ne = class Ne {
|
|
1243
1243
|
constructor(i) {
|
|
1244
|
-
d(this,
|
|
1245
|
-
b(this,
|
|
1244
|
+
d(this, st);
|
|
1245
|
+
b(this, st, i), this.row = new ge(this), this.data = new be(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1246
1246
|
var e;
|
|
1247
|
-
(e = t(this,
|
|
1247
|
+
(e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
|
|
1248
1248
|
}, this.setDataSource = (e) => {
|
|
1249
1249
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1250
1250
|
}, this.getRowState = (e) => {
|
|
@@ -1259,13 +1259,13 @@ const Ne = class Ne {
|
|
|
1259
1259
|
}, this.setDataSource([]);
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
|
-
|
|
1263
|
-
let
|
|
1264
|
-
var
|
|
1262
|
+
st = new WeakMap(), c(Ne, "ngDataManager");
|
|
1263
|
+
let pe = Ne;
|
|
1264
|
+
var ft, L, Lt, se;
|
|
1265
1265
|
const We = class We {
|
|
1266
1266
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1267
1267
|
constructor(i) {
|
|
1268
|
-
d(this,
|
|
1268
|
+
d(this, ft);
|
|
1269
1269
|
d(this, L, []);
|
|
1270
1270
|
S(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1271
1271
|
i.forEach((s) => {
|
|
@@ -1279,11 +1279,11 @@ const We = class We {
|
|
|
1279
1279
|
}), b(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(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);
|
|
1280
1280
|
}, "#adjust"));
|
|
1281
1281
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1282
|
-
b(this, L, []),
|
|
1283
|
-
const i = Array.from(t(this,
|
|
1282
|
+
b(this, L, []), bt.log(t(this, ft).querySelectorAll("table"));
|
|
1283
|
+
const i = Array.from(t(this, ft).querySelectorAll("table"));
|
|
1284
1284
|
if (!(!i || i.length === 0)) {
|
|
1285
1285
|
for (const e of i)
|
|
1286
|
-
|
|
1286
|
+
bt.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1287
1287
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1288
1288
|
n && t(this, L).push({ name: n, type: o });
|
|
1289
1289
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1310,7 +1310,7 @@ const We = class We {
|
|
|
1310
1310
|
t(this, Lt).call(this);
|
|
1311
1311
|
}
|
|
1312
1312
|
}, "#init"));
|
|
1313
|
-
b(this,
|
|
1313
|
+
b(this, ft, i), t(this, se).call(this);
|
|
1314
1314
|
}
|
|
1315
1315
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1316
1316
|
get() {
|
|
@@ -1332,42 +1332,42 @@ const We = class We {
|
|
|
1332
1332
|
return t(this, L).some((e) => e.name === i);
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
|
-
|
|
1336
|
-
let
|
|
1337
|
-
var
|
|
1335
|
+
ft = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(We, "ngFields");
|
|
1336
|
+
let ye = We;
|
|
1337
|
+
var it, ie, re;
|
|
1338
1338
|
const Oe = class Oe extends HTMLElement {
|
|
1339
1339
|
constructor() {
|
|
1340
1340
|
super();
|
|
1341
1341
|
//#created = false;
|
|
1342
|
-
d(this,
|
|
1342
|
+
d(this, it);
|
|
1343
1343
|
d(this, ie);
|
|
1344
1344
|
d(this, re, /* @__PURE__ */ c(() => {
|
|
1345
|
-
this.fields = new
|
|
1345
|
+
this.fields = new ye(this), b(this, ie, new ue(this)), bt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1346
1346
|
}, "#init"));
|
|
1347
|
-
this.attachShadow({ mode: "open" }), b(this,
|
|
1347
|
+
this.attachShadow({ mode: "open" }), b(this, it, new pe(this));
|
|
1348
1348
|
}
|
|
1349
1349
|
connectedCallback() {
|
|
1350
1350
|
t(this, re).call(this);
|
|
1351
1351
|
}
|
|
1352
1352
|
disconnectedCallback() {
|
|
1353
|
-
|
|
1353
|
+
bt.log("NineTable disconnected.");
|
|
1354
1354
|
}
|
|
1355
1355
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1356
1356
|
get data() {
|
|
1357
|
-
return t(this,
|
|
1357
|
+
return t(this, it).data;
|
|
1358
1358
|
}
|
|
1359
1359
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1360
1360
|
get row() {
|
|
1361
|
-
return t(this,
|
|
1361
|
+
return t(this, it).row;
|
|
1362
1362
|
}
|
|
1363
1363
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1364
1364
|
get dataManager() {
|
|
1365
|
-
return t(this,
|
|
1365
|
+
return t(this, it);
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
|
|
1369
|
-
let
|
|
1370
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1368
|
+
it = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(Oe, "NineTable");
|
|
1369
|
+
let me = Oe;
|
|
1370
|
+
customElements.get("nine-table") || customElements.define("nine-table", me);
|
|
1371
1371
|
const mt = class mt extends HTMLElement {
|
|
1372
1372
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
1373
1373
|
constructor() {
|
|
@@ -1380,18 +1380,18 @@ const mt = class mt extends HTMLElement {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
1382
|
c(mt, "BasicCellElement"), S(mt, "_styleCache", /* @__PURE__ */ new Map()), S(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1383
|
-
let
|
|
1384
|
-
var T, Ht, y,
|
|
1385
|
-
const Be = class Be extends
|
|
1383
|
+
let xe = mt;
|
|
1384
|
+
var T, Ht, y, Ee, Ae, Re, qe, ke;
|
|
1385
|
+
const Be = class Be extends xe {
|
|
1386
1386
|
constructor() {
|
|
1387
1387
|
super();
|
|
1388
1388
|
d(this, T);
|
|
1389
1389
|
d(this, Ht);
|
|
1390
1390
|
d(this, y);
|
|
1391
|
-
d(this, Se);
|
|
1392
1391
|
d(this, Ee);
|
|
1393
1392
|
d(this, Ae);
|
|
1394
1393
|
d(this, Re);
|
|
1394
|
+
d(this, qe);
|
|
1395
1395
|
S(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1396
1396
|
if (t(this, y))
|
|
1397
1397
|
if (t(this, y).closest("tbody")) {
|
|
@@ -1412,7 +1412,7 @@ const Be = class Be extends me {
|
|
|
1412
1412
|
} catch {
|
|
1413
1413
|
}
|
|
1414
1414
|
}, "getDisplayText"));
|
|
1415
|
-
d(this,
|
|
1415
|
+
d(this, ke, /* @__PURE__ */ c(() => {
|
|
1416
1416
|
if (!(!t(this, T) || !t(this, T).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1417
1417
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1418
1418
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
@@ -1472,40 +1472,42 @@ const Be = class Be extends me {
|
|
|
1472
1472
|
get data() {
|
|
1473
1473
|
return t(this, y).closest("tr").data;
|
|
1474
1474
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1475
|
+
refresh() {
|
|
1476
|
+
const e = t(this, y).dataset.bind;
|
|
1477
|
+
parseInt(t(this, y).dataset.row);
|
|
1478
|
+
const s = t(this, Ht).data;
|
|
1479
|
+
return bt.log(s, e, s[e]), s[e];
|
|
1479
1480
|
}
|
|
1480
1481
|
};
|
|
1481
|
-
T = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(),
|
|
1482
|
-
let
|
|
1483
|
-
const ze = class ze extends
|
|
1482
|
+
T = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Ee = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), c(Be, "CellElement");
|
|
1483
|
+
let ve = Be;
|
|
1484
|
+
const ze = class ze extends ve {
|
|
1484
1485
|
constructor() {
|
|
1485
1486
|
super();
|
|
1486
1487
|
}
|
|
1487
1488
|
connectedCallback() {
|
|
1488
1489
|
super.connectedCallback();
|
|
1489
1490
|
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1491
|
+
refresh() {
|
|
1492
|
+
return super.refresh();
|
|
1492
1493
|
}
|
|
1493
1494
|
};
|
|
1494
1495
|
c(ze, "EditableCellElement");
|
|
1495
|
-
let
|
|
1496
|
-
var
|
|
1497
|
-
const De = class De extends
|
|
1496
|
+
let we = ze;
|
|
1497
|
+
var ne, rt, ut, gt, oe, Y, Te;
|
|
1498
|
+
const De = class De extends we {
|
|
1498
1499
|
constructor() {
|
|
1499
1500
|
super();
|
|
1500
|
-
d(this, ke);
|
|
1501
|
-
d(this, nt);
|
|
1502
|
-
d(this, gt);
|
|
1503
|
-
d(this, bt);
|
|
1504
1501
|
d(this, ne);
|
|
1505
|
-
d(this,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1502
|
+
d(this, rt);
|
|
1503
|
+
d(this, ut);
|
|
1504
|
+
d(this, gt);
|
|
1505
|
+
d(this, oe);
|
|
1506
|
+
d(this, Y);
|
|
1507
|
+
S(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1508
|
+
const e = super.refresh();
|
|
1509
|
+
t(this, ne).value = e;
|
|
1510
|
+
}, "refresh"));
|
|
1509
1511
|
/**
|
|
1510
1512
|
dataRefresh = (v) => {
|
|
1511
1513
|
this.#target.value = this.value;
|
|
@@ -1538,20 +1540,20 @@ const De = class De extends ve {
|
|
|
1538
1540
|
*/
|
|
1539
1541
|
d(this, Te, /* @__PURE__ */ c((e) => {
|
|
1540
1542
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1541
|
-
if (t(this,
|
|
1543
|
+
if (t(this, rt) == "number") {
|
|
1542
1544
|
let n = [];
|
|
1543
|
-
if (t(this,
|
|
1545
|
+
if (t(this, Y) && Number(t(this, Y)) > 0 && n.push("."), t(this, gt) && Number(t(this, gt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, Y) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1544
1546
|
var s = e.target.value, r = s.indexOf(".");
|
|
1545
1547
|
if (r >= 0) {
|
|
1546
1548
|
var s = s.substr(r + 1, s.length);
|
|
1547
|
-
s.length >= Number(t(this,
|
|
1549
|
+
s.length >= Number(t(this, Y)) && e.preventDefault();
|
|
1548
1550
|
}
|
|
1549
1551
|
}
|
|
1550
1552
|
}
|
|
1551
|
-
t(this,
|
|
1553
|
+
t(this, ut) && ninegrid.getByteLength(e.target.value) >= Number(t(this, ut)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1552
1554
|
}
|
|
1553
1555
|
}, "#onKeyDown"));
|
|
1554
|
-
if (this.applyBaseStyle(), b(this,
|
|
1556
|
+
if (this.applyBaseStyle(), b(this, rt, this.getAttribute("type") || "text"), b(this, ut, this.getAttribute("maxbyte")), b(this, gt, this.getAttribute("min")), b(this, oe, this.getAttribute("max")), b(this, Y, this.getAttribute("scale")), !["text", "number"].includes(t(this, rt))) throw `invalid type : ${t(this, rt)}`;
|
|
1555
1557
|
}
|
|
1556
1558
|
connectedCallback() {
|
|
1557
1559
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1564,8 +1566,8 @@ const De = class De extends ve {
|
|
|
1564
1566
|
`, super.connectedCallback();
|
|
1565
1567
|
}
|
|
1566
1568
|
};
|
|
1567
|
-
|
|
1568
|
-
let
|
|
1569
|
+
ne = new WeakMap(), rt = new WeakMap(), ut = new WeakMap(), gt = new WeakMap(), oe = new WeakMap(), Y = new WeakMap(), Te = new WeakMap(), c(De, "CellInputText");
|
|
1570
|
+
let Se = De;
|
|
1569
1571
|
customElements.get("cell-input-text");
|
|
1570
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1572
|
+
customElements.get("cell-input") || customElements.define("cell-input", Se);
|
|
1571
1573
|
//# sourceMappingURL=nine-table.js.map
|