@ninebone/table 0.0.332 β 0.0.334
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 +251 -254
- 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
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var ne = (m) => {
|
|
3
|
+
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
5
|
+
var le = (m, i, e) => i in m ? se(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
|
+
var c = (m, i) => se(m, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (m, i, e) => le(m, typeof i != "symbol" ? i + "" : i, e), oe = (m, i, e) => i.has(m) || ne("Cannot " + e);
|
|
8
|
+
var t = (m, i, e) => (oe(m, i, "read from private field"), e ? e.call(m) : i.get(m)), a = (m, i, e) => i.has(m) ? ne("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), g = (m, i, e, s) => (oe(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
|
+
var re = (m, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
g(
|
|
11
|
+
g(m, i, n, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(m, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as ce } from "@ninebone/util";
|
|
@@ -20,27 +20,27 @@ const Kt = class Kt extends ce.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(Kt, "Trace");
|
|
24
24
|
let zt = Kt;
|
|
25
|
-
const
|
|
26
|
-
var C, M, y, O, D,
|
|
25
|
+
const F = new zt();
|
|
26
|
+
var C, M, y, z, O, D, bt, N, gt;
|
|
27
27
|
const jt = class jt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
a(this, C);
|
|
31
|
+
a(this, M, !1);
|
|
32
|
+
a(this, y);
|
|
33
|
+
a(this, z);
|
|
34
|
+
a(this, O);
|
|
35
|
+
a(this, D);
|
|
36
|
+
a(this, bt, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, C)) return;
|
|
38
38
|
const e = t(this, C).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, D, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, D).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, C) || !t(this, y) || t(this, M)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
@@ -58,10 +58,10 @@ const jt = class jt extends HTMLElement {
|
|
|
58
58
|
const u = e.scrollLeft, b = h - l;
|
|
59
59
|
let p = 0;
|
|
60
60
|
b > 0 && (p = parseInt(u / b * (d - f), 10)), p < 0 && (p = 0);
|
|
61
|
-
const
|
|
62
|
-
p >
|
|
61
|
+
const E = d - f;
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, F.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
a(this, N, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
@@ -73,18 +73,18 @@ const jt = class jt extends HTMLElement {
|
|
|
73
73
|
const d = s.clientWidth, u = n.scrollWidth - d;
|
|
74
74
|
return h > 0 && u > 0 && (s.scrollLeft = l / h * u), l > 0 && l < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
76
|
+
a(this, gt, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((n) => {
|
|
78
|
+
clearInterval(t(this, z)), clearInterval(t(this, O));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, N).call(this, r + n), g(this, z, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, z)), g(this, O, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, N).call(this, o + n) || clearInterval(t(this, O));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
+
clearInterval(t(this, z)), clearInterval(t(this, O));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
90
|
t(this, y).left.addEventListener(n, s), t(this, y).right.addEventListener(n, s), t(this, y).track.addEventListener(n, s);
|
|
@@ -96,15 +96,15 @@ const jt = class jt extends HTMLElement {
|
|
|
96
96
|
if (n.button !== 0) return;
|
|
97
97
|
n.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), o = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, N).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
102
|
n.stopPropagation(), n.preventDefault(), g(this, M, !0), this.shiftX = n.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
|
-
const r = /* @__PURE__ */
|
|
103
|
+
const r = /* @__PURE__ */ c((l) => {
|
|
104
104
|
if (!t(this, M)) return;
|
|
105
105
|
const h = t(this, y).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
106
|
+
t(this, N).call(this, l.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
108
|
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
@@ -176,7 +176,7 @@ const jt = class jt extends HTMLElement {
|
|
|
176
176
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
|
-
const e = /* @__PURE__ */
|
|
179
|
+
const e = /* @__PURE__ */ c(() => {
|
|
180
180
|
const s = t(this, C).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
@@ -195,31 +195,31 @@ const jt = class jt extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, D) && t(this, D).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(),
|
|
201
|
+
C = new WeakMap(), M = new WeakMap(), y = new WeakMap(), z = new WeakMap(), O = new WeakMap(), D = new WeakMap(), bt = new WeakMap(), N = new WeakMap(), gt = new WeakMap(), c(jt, "NineTableHScrollBar");
|
|
202
202
|
let Ot = jt;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Ot);
|
|
204
|
-
var
|
|
204
|
+
var B, I, v, st, nt, yt;
|
|
205
205
|
const Zt = class Zt extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
a(this, B);
|
|
209
|
+
a(this, I, !1);
|
|
210
|
+
a(this, v);
|
|
211
|
+
a(this, st, 0);
|
|
212
|
+
a(this, nt, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
|
-
|
|
217
|
-
if (!t(this,
|
|
218
|
-
const e = t(this,
|
|
216
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
+
if (!t(this, B) || !t(this, v) || t(this, I)) return;
|
|
218
|
+
const e = t(this, v).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
|
-
const n = t(this,
|
|
220
|
+
const n = t(this, v).track, r = t(this, v).thumb, o = e.clientHeight, l = s.scrollHeight;
|
|
221
221
|
if (l <= o) {
|
|
222
|
-
r.style.display = "none", t(this,
|
|
222
|
+
r.style.display = "none", t(this, v).top.disabled = !0, t(this, v).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
r.style.display = "block";
|
|
@@ -231,46 +231,46 @@ const Zt = class Zt extends HTMLElement {
|
|
|
231
231
|
let b = 0;
|
|
232
232
|
u > 0 && (b = f / u * (h - d));
|
|
233
233
|
const p = h - d;
|
|
234
|
-
b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this,
|
|
234
|
+
b < 0 && (b = 0), b > p && (b = p), r.style.top = `${b}px`, t(this, v).top.disabled = f <= 0, t(this, v).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
|
|
237
|
-
const e = t(this,
|
|
236
|
+
a(this, yt, /* @__PURE__ */ c(() => {
|
|
237
|
+
const e = t(this, v).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, I) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
240
|
+
}), t(this, v).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
242
|
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, st, s.clientY), g(this, nt, e.scrollTop);
|
|
243
|
-
const n = /* @__PURE__ */
|
|
243
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
244
244
|
if (!t(this, I)) return;
|
|
245
|
-
const l = t(this,
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
if (f > 0 &&
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this, nt) +
|
|
245
|
+
const l = t(this, v).track.getBoundingClientRect(), h = t(this, v).thumb.clientHeight, f = l.height - h, u = o.clientY - t(this, st), b = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
F.log(p), F.log(p.scrollHeight);
|
|
247
|
+
const L = p.scrollHeight - b;
|
|
248
|
+
if (f > 0 && L > 0) {
|
|
249
|
+
const ft = u / f * L;
|
|
250
|
+
e.scrollTop = t(this, nt) + ft;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), r = /* @__PURE__ */
|
|
253
|
+
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
254
254
|
g(this, I, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (s.button !== 0 || s.target === t(this,
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, v).track.addEventListener("mousedown", (s) => {
|
|
258
|
+
if (s.button !== 0 || s.target === t(this, v).thumb) return;
|
|
259
|
+
const n = t(this, v).track.getBoundingClientRect(), r = t(this, v).thumb.clientHeight, o = s.clientY - n.top - r / 2, h = n.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
260
|
if (h > 0 && u > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, o / h));
|
|
262
262
|
e.scrollTop = b * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, v).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, v).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (g(this,
|
|
273
|
+
if (g(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -334,13 +334,13 @@ const Zt = class Zt extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
338
|
-
const s = t(this,
|
|
337
|
+
const e = /* @__PURE__ */ c(() => {
|
|
338
|
+
const s = t(this, B).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
g(this,
|
|
343
|
+
g(this, v, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,10 +351,10 @@ const Zt = class Zt extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
B = new WeakMap(), I = new WeakMap(), v = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), yt = new WeakMap(), c(Zt, "NineTableVScrollBar");
|
|
355
355
|
let Dt = Zt;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Dt);
|
|
357
|
-
var pt,
|
|
357
|
+
var pt, K;
|
|
358
358
|
const H = class H {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,7 +369,7 @@ const H = class H {
|
|
|
369
369
|
var n, r, o, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(n = H, pt).call(n, e), t(r = H,
|
|
372
|
+
return t(n = H, pt).call(n, e), t(r = H, K).call(r, e, "thead"), t(o = H, K).call(o, e, "tbody"), t(l = H, K).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((h, d) => {
|
|
373
373
|
const f = h.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
@@ -377,7 +377,7 @@ const H = class H {
|
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
pt = new WeakMap(),
|
|
380
|
+
pt = new WeakMap(), K = new WeakMap(), c(H, "TableCompiler"), a(H, pt, /* @__PURE__ */ c((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let o = 0; o < s; o++) {
|
|
@@ -391,7 +391,7 @@ pt = new WeakMap(), j = new WeakMap(), a(H, "TableCompiler"), c(H, pt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")),
|
|
394
|
+
}, "#ensureTableStructure")), a(H, K, /* @__PURE__ */ c((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || n.length === 0) return;
|
|
397
397
|
let o = 0;
|
|
@@ -403,15 +403,15 @@ pt = new WeakMap(), j = new WeakMap(), a(H, "TableCompiler"), c(H, pt, /* @__PUR
|
|
|
403
403
|
const d = h.sectionRowIndex;
|
|
404
404
|
let f = 0;
|
|
405
405
|
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
406
|
-
for (let
|
|
407
|
-
if (l[d][
|
|
408
|
-
f =
|
|
406
|
+
for (let E = 0; E < l[d].length; E++)
|
|
407
|
+
if (l[d][E] === null) {
|
|
408
|
+
f = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
const b = u.rowSpan || 1, p = u.colSpan || 1;
|
|
412
|
-
for (let
|
|
413
|
-
for (let
|
|
414
|
-
d +
|
|
412
|
+
for (let E = 0; E < b; E++)
|
|
413
|
+
for (let L = 0; L < p; L++)
|
|
414
|
+
d + E < r && f + L < o && (l[d + E][f + L] = E === 0 && L === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
416
|
}), s.forEach((h) => {
|
|
417
417
|
const d = h.sectionRowIndex;
|
|
@@ -425,24 +425,24 @@ pt = new WeakMap(), j = new WeakMap(), a(H, "TableCompiler"), c(H, pt, /* @__PUR
|
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
427
|
let Nt = H;
|
|
428
|
-
var
|
|
428
|
+
var j, w, _, R, $, P, Z, mt, xt, ot, rt, vt, wt, lt, G, St;
|
|
429
429
|
const Gt = class Gt {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
431
|
+
a(this, j);
|
|
432
|
+
a(this, w);
|
|
433
|
+
a(this, _, /* @__PURE__ */ new Map());
|
|
434
|
+
a(this, R, null);
|
|
435
|
+
a(this, $, null);
|
|
436
|
+
a(this, P, 0);
|
|
437
|
+
a(this, Z, 40);
|
|
438
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
439
439
|
var e;
|
|
440
|
-
const i = t(this,
|
|
441
|
-
i && (t(this,
|
|
440
|
+
const i = t(this, w).querySelector(".ng-container-body");
|
|
441
|
+
i && (t(this, ot).call(this), t(this, G).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
|
-
|
|
443
|
+
x(this, "initialize", /* @__PURE__ */ c(() => {
|
|
444
444
|
g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
445
|
-
const r = t(this,
|
|
445
|
+
const r = t(this, w).querySelector(n);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const o = r.querySelector("table");
|
|
448
448
|
if (!o) return;
|
|
@@ -451,13 +451,13 @@ const Gt = class Gt {
|
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
452
|
t(this, _).set(n, d);
|
|
453
453
|
});
|
|
454
|
-
const i = t(this,
|
|
454
|
+
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
455
455
|
if (i) {
|
|
456
|
-
t(this, xt).call(this, i), t(this,
|
|
456
|
+
t(this, xt).call(this, i), t(this, lt).call(this), t(this, ot).call(this), t(this, G).call(this, i.scrollTop);
|
|
457
457
|
let n = i.scrollTop;
|
|
458
|
-
const r = /* @__PURE__ */
|
|
458
|
+
const r = /* @__PURE__ */ c((o) => {
|
|
459
459
|
var l;
|
|
460
|
-
e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, G).call(this, o), (l = t(this,
|
|
460
|
+
e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, G).call(this, o), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
461
|
}, "syncScroll");
|
|
462
462
|
i.addEventListener("scroll", () => {
|
|
463
463
|
const o = i.scrollTop;
|
|
@@ -465,7 +465,7 @@ const Gt = class Gt {
|
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
|
-
|
|
468
|
+
a(this, mt, /* @__PURE__ */ c((i, e) => {
|
|
469
469
|
const s = t(this, _).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
@@ -478,7 +478,7 @@ const Gt = class Gt {
|
|
|
478
478
|
});
|
|
479
479
|
r ? r.before(o) : n.appendChild(o);
|
|
480
480
|
}, "#renderRows"));
|
|
481
|
-
|
|
481
|
+
a(this, xt, /* @__PURE__ */ c((i) => {
|
|
482
482
|
if (t(this, R) !== null && t(this, R) > 0)
|
|
483
483
|
return t(this, R);
|
|
484
484
|
const e = t(this, _).get(".ng-container-body");
|
|
@@ -490,34 +490,32 @@ const Gt = class Gt {
|
|
|
490
490
|
e.forEach((b) => {
|
|
491
491
|
r.appendChild(b.cloneNode(!0));
|
|
492
492
|
}), n ? n.before(r) : s.appendChild(r);
|
|
493
|
-
const o = t(this,
|
|
493
|
+
const o = t(this, w), l = o.style.display, h = o.style.visibility, d = o.style.position;
|
|
494
494
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
495
495
|
let f = 0;
|
|
496
496
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
497
497
|
return u.forEach((b) => {
|
|
498
498
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
499
|
-
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = h, o.style.position = d, g(this, R, f > 0 ? f : 24), t(this,
|
|
499
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = h, o.style.position = d, g(this, R, f > 0 ? f : 24), t(this, rt).call(this), t(this, R);
|
|
500
500
|
}, "#measureAndCacheHeight"));
|
|
501
|
-
|
|
502
|
-
if (!t(this,
|
|
503
|
-
const e = t(this,
|
|
504
|
-
K.log(e);
|
|
505
|
-
const s = e.length > 0 ? e.length : 100, n = t(this, R), r = s * n;
|
|
501
|
+
a(this, ot, /* @__PURE__ */ c(() => {
|
|
502
|
+
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
503
|
+
const e = t(this, j).data.get() || [], s = e.length > 0 ? e.length : 100, n = t(this, R), r = s * n;
|
|
506
504
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
507
|
-
const l = t(this,
|
|
505
|
+
const l = t(this, w).querySelector(o), h = l == null ? void 0 : l.querySelector("table");
|
|
508
506
|
h && (h.style.height = `${r}px`);
|
|
509
507
|
});
|
|
510
508
|
}, "#updateVirtualScrollHeight"));
|
|
511
|
-
|
|
512
|
-
if (t(this,
|
|
513
|
-
const i = Math.ceil(t(this,
|
|
509
|
+
a(this, rt, /* @__PURE__ */ c(() => {
|
|
510
|
+
if (t(this, P) > 0 && t(this, R) > 0) {
|
|
511
|
+
const i = Math.ceil(t(this, P) / t(this, R));
|
|
514
512
|
g(this, Z, i + 20);
|
|
515
513
|
} else
|
|
516
514
|
g(this, Z, 40);
|
|
517
515
|
}, "#updateRowCount"));
|
|
518
|
-
|
|
516
|
+
a(this, vt, /* @__PURE__ */ c(() => {
|
|
519
517
|
var h, d, f;
|
|
520
|
-
const i = t(this,
|
|
518
|
+
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
521
519
|
if (!e) return;
|
|
522
520
|
const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, r.length, o.length);
|
|
523
521
|
for (let u = 0; u < l; u++) {
|
|
@@ -529,8 +527,8 @@ const Gt = class Gt {
|
|
|
529
527
|
p > 0 && (n[u] && (n[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), o[u] && (o[u].style.height = `${p}px`));
|
|
530
528
|
}
|
|
531
529
|
}, "#syncRowHeights"));
|
|
532
|
-
|
|
533
|
-
!t(this,
|
|
530
|
+
a(this, wt, /* @__PURE__ */ c(() => {
|
|
531
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
534
532
|
for (const e of i) {
|
|
535
533
|
const s = e.target;
|
|
536
534
|
if (!s.classList.contains("active")) continue;
|
|
@@ -540,44 +538,43 @@ const Gt = class Gt {
|
|
|
540
538
|
const o = s.querySelector("thead");
|
|
541
539
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
542
540
|
const l = Math.max(n - r, 100);
|
|
543
|
-
t(this,
|
|
541
|
+
t(this, P) !== l && (g(this, P, l), t(this, rt).call(this), t(this, R) !== null && t(this, lt).call(this));
|
|
544
542
|
}
|
|
545
543
|
}
|
|
546
|
-
})), t(this, $).observe(t(this,
|
|
544
|
+
})), t(this, $).observe(t(this, w)));
|
|
547
545
|
}, "#initResizeObserver"));
|
|
548
|
-
|
|
546
|
+
a(this, lt, /* @__PURE__ */ c(() => {
|
|
549
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
550
|
-
const e = t(this,
|
|
548
|
+
const e = t(this, w).querySelector(i);
|
|
551
549
|
e && e.querySelector("tbody.bindable-tbody") && t(this, mt).call(this, e, i);
|
|
552
550
|
}), t(this, vt).call(this);
|
|
553
551
|
}, "#renderAllContainers"));
|
|
554
|
-
|
|
552
|
+
a(this, G, /* @__PURE__ */ c((i) => {
|
|
555
553
|
var r;
|
|
556
554
|
const e = t(this, R);
|
|
557
555
|
if (!e || e <= 0) return;
|
|
558
556
|
const s = Math.max(0, Math.floor(i / e)), n = ((r = t(this, _).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
559
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
560
|
-
const l = t(this,
|
|
558
|
+
const l = t(this, w).querySelector(o);
|
|
561
559
|
if (!l) return;
|
|
562
560
|
const h = l.querySelector("tbody.bindable-tbody");
|
|
563
561
|
if (!h) return;
|
|
564
562
|
Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
565
|
-
|
|
566
|
-
const b = s + Math.floor(u / n), p = (typeof t(this, m).getData == "function" ? t(this, m).getData(b) : null) ?? (typeof ((S = t(this, m).data) == null ? void 0 : S.get) == "function" ? t(this, m).data.get(b) : null) ?? ((z = (q = t(this, m).dataManager) == null ? void 0 : q.rawRecords) == null ? void 0 : z[b]) ?? ((se = t(this, m).data) == null ? void 0 : se[b]) ?? { _index: b };
|
|
563
|
+
const b = s + Math.floor(u / n), p = t(this, j).data.get(b);
|
|
567
564
|
f.style.display = "", t(this, St).call(this, f, p, b);
|
|
568
565
|
});
|
|
569
566
|
});
|
|
570
567
|
}, "#handleScroll"));
|
|
571
|
-
|
|
572
|
-
i.dataset.row = s, Array.from(i.cells).forEach((n, r) => {
|
|
568
|
+
a(this, St, /* @__PURE__ */ c((i, e, s) => {
|
|
569
|
+
i.dataset.row = s, F.log(i, e, s), Array.from(i.cells).forEach((n, r) => {
|
|
573
570
|
const o = n.dataset.bind;
|
|
574
571
|
o && e && e[o] !== void 0 ? n.textContent = e[o] : n.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, n.dataset.row = s;
|
|
575
572
|
});
|
|
576
573
|
}, "#bindRowData"));
|
|
577
|
-
|
|
574
|
+
x(this, "destroy", /* @__PURE__ */ c(() => {
|
|
578
575
|
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
579
576
|
}, "destroy"));
|
|
580
|
-
g(this,
|
|
577
|
+
g(this, j, i.getRootNode().host), g(this, w, i), t(this, wt).call(this);
|
|
581
578
|
}
|
|
582
579
|
getRowHeight() {
|
|
583
580
|
return t(this, R);
|
|
@@ -587,23 +584,23 @@ const Gt = class Gt {
|
|
|
587
584
|
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
588
585
|
}
|
|
589
586
|
};
|
|
590
|
-
|
|
587
|
+
j = new WeakMap(), w = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), P = new WeakMap(), Z = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), lt = new WeakMap(), G = new WeakMap(), St = new WeakMap(), c(Gt, "RowManager");
|
|
591
588
|
let Bt = Gt;
|
|
592
|
-
var Et, J,
|
|
589
|
+
var Et, J, Y, Rt, kt, qt, At, Tt;
|
|
593
590
|
const it = class it extends HTMLElement {
|
|
594
591
|
constructor() {
|
|
595
592
|
super();
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
593
|
+
a(this, Et);
|
|
594
|
+
a(this, J, null);
|
|
595
|
+
a(this, Y);
|
|
599
596
|
/**
|
|
600
597
|
* data.set, add, delete
|
|
601
598
|
* filter, sorting : κ³ λ €λμ
|
|
602
599
|
*/
|
|
603
|
-
|
|
604
|
-
t(this,
|
|
600
|
+
x(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
601
|
+
t(this, Y).refresh();
|
|
605
602
|
}, "invalidate"));
|
|
606
|
-
|
|
603
|
+
a(this, Rt, /* @__PURE__ */ c(() => {
|
|
607
604
|
[
|
|
608
605
|
{ selector: ".ng-container-body", type: null },
|
|
609
606
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -615,7 +612,7 @@ const it = class it extends HTMLElement {
|
|
|
615
612
|
r.innerHTML = "", r.appendChild(o);
|
|
616
613
|
});
|
|
617
614
|
}, "#renderSplitContainers"));
|
|
618
|
-
|
|
615
|
+
a(this, kt, /* @__PURE__ */ c(() => {
|
|
619
616
|
["left", "right"].forEach((e) => {
|
|
620
617
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
621
618
|
if (!s || !n) return;
|
|
@@ -626,14 +623,14 @@ const it = class it extends HTMLElement {
|
|
|
626
623
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
627
624
|
});
|
|
628
625
|
}, "#updateContainerWidths"));
|
|
629
|
-
|
|
626
|
+
x(this, "generate", /* @__PURE__ */ c((e) => {
|
|
630
627
|
e && (g(this, J, Nt.compile(e)), t(this, J).style.display = "table", t(this, Rt).call(this), t(this, kt).call(this), requestAnimationFrame(() => {
|
|
631
628
|
var n;
|
|
632
629
|
const s = (n = this.querySelector("thead")) == null ? void 0 : n.getBoundingClientRect().height;
|
|
633
630
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
634
631
|
r.style.top = `${s}px`;
|
|
635
632
|
});
|
|
636
|
-
}), t(this,
|
|
633
|
+
}), t(this, Y).initialize(), setTimeout(() => {
|
|
637
634
|
var s;
|
|
638
635
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
639
636
|
}, 0));
|
|
@@ -641,7 +638,7 @@ const it = class it extends HTMLElement {
|
|
|
641
638
|
/**
|
|
642
639
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
643
640
|
*/
|
|
644
|
-
|
|
641
|
+
a(this, qt, /* @__PURE__ */ c((e, s) => {
|
|
645
642
|
const n = e.cloneNode(!0), r = n.querySelector("tbody");
|
|
646
643
|
if (r) {
|
|
647
644
|
const o = document.createElement("tbody");
|
|
@@ -655,19 +652,19 @@ const it = class it extends HTMLElement {
|
|
|
655
652
|
o.remove();
|
|
656
653
|
}), n;
|
|
657
654
|
}, "#createSplitTable"));
|
|
658
|
-
|
|
659
|
-
|
|
655
|
+
x(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, Y).getRowHeight(), "getRowHeight"));
|
|
656
|
+
x(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
660
657
|
const s = this.querySelector(".ng-container-body");
|
|
661
658
|
s && (s.scrollLeft = e);
|
|
662
659
|
}, "scrollToX"));
|
|
663
|
-
|
|
660
|
+
x(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
664
661
|
const s = this.querySelector(".ng-container-body");
|
|
665
662
|
s && (s.scrollTop = e);
|
|
666
663
|
}, "scrollToY"));
|
|
667
|
-
|
|
664
|
+
a(this, At, /* @__PURE__ */ c(() => {
|
|
668
665
|
t(this, Tt).call(this);
|
|
669
666
|
}, "#init"));
|
|
670
|
-
|
|
667
|
+
a(this, Tt, /* @__PURE__ */ c(() => {
|
|
671
668
|
const e = it.SCROLLBAR_SIZE;
|
|
672
669
|
this.innerHTML = `
|
|
673
670
|
<style>
|
|
@@ -814,23 +811,23 @@ const it = class it extends HTMLElement {
|
|
|
814
811
|
</div>
|
|
815
812
|
`;
|
|
816
813
|
}, "#render"));
|
|
817
|
-
g(this,
|
|
814
|
+
g(this, Y, new Bt(this)), g(this, Et, this.getRootNode().host);
|
|
818
815
|
}
|
|
819
816
|
connectedCallback() {
|
|
820
817
|
t(this, At).call(this);
|
|
821
818
|
}
|
|
822
819
|
disconnectedCallback() {
|
|
823
|
-
this.innerHTML = "",
|
|
820
|
+
this.innerHTML = "", F.log("NineTableSheet destroyed.");
|
|
824
821
|
}
|
|
825
822
|
};
|
|
826
|
-
Et = new WeakMap(), J = new WeakMap(),
|
|
823
|
+
Et = new WeakMap(), J = new WeakMap(), Y = new WeakMap(), Rt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), At = new WeakMap(), Tt = new WeakMap(), c(it, "NineTableSheet"), x(it, "SCROLLBAR_SIZE", 16);
|
|
827
824
|
let ut = it;
|
|
828
825
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ut);
|
|
829
826
|
var Lt, ct;
|
|
830
827
|
const Jt = class Jt extends HTMLElement {
|
|
831
828
|
constructor() {
|
|
832
829
|
super();
|
|
833
|
-
|
|
830
|
+
a(this, Lt, /* @__PURE__ */ c(() => {
|
|
834
831
|
var e;
|
|
835
832
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
836
833
|
var o;
|
|
@@ -838,14 +835,14 @@ const Jt = class Jt extends HTMLElement {
|
|
|
838
835
|
t(this, ct).call(this, r, n);
|
|
839
836
|
}), t(this, ct).call(this, 0, !1);
|
|
840
837
|
}, "#init"));
|
|
841
|
-
|
|
842
|
-
const n = /* @__PURE__ */
|
|
838
|
+
a(this, ct, /* @__PURE__ */ c((e, s = !1) => {
|
|
839
|
+
const n = /* @__PURE__ */ c(() => {
|
|
843
840
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
844
841
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
845
842
|
const b = f.filter((p) => p.classList.contains("active"));
|
|
846
843
|
b.length < 2 || b.forEach((p) => {
|
|
847
|
-
const
|
|
848
|
-
|
|
844
|
+
const E = parseInt(p.getAttribute("data-index"), 10), L = this.querySelector(`nine-splitter[data-split-index="${E}"]`), ft = f[E + 1];
|
|
845
|
+
L && ft && ft.classList.contains("active") && L.style.setProperty("display", "flex");
|
|
849
846
|
});
|
|
850
847
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
851
848
|
if (!l[e]) return;
|
|
@@ -874,27 +871,27 @@ const Jt = class Jt extends HTMLElement {
|
|
|
874
871
|
t(this, Lt).call(this);
|
|
875
872
|
}
|
|
876
873
|
};
|
|
877
|
-
Lt = new WeakMap(), ct = new WeakMap(),
|
|
874
|
+
Lt = new WeakMap(), ct = new WeakMap(), c(Jt, "NineTableSheets");
|
|
878
875
|
let Pt = Jt;
|
|
879
876
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Pt);
|
|
880
|
-
var k, Ht,
|
|
877
|
+
var k, Ht, at, Ct;
|
|
881
878
|
const Qt = class Qt {
|
|
882
879
|
constructor(i) {
|
|
883
|
-
|
|
884
|
-
|
|
880
|
+
a(this, k);
|
|
881
|
+
a(this, Ht, /* @__PURE__ */ c(() => {
|
|
885
882
|
t(this, Ct).call(this), new ResizeObserver((i) => {
|
|
886
883
|
for (let e of i)
|
|
887
|
-
t(this, k).getAttribute("auto-height") === "true" && t(this,
|
|
884
|
+
t(this, k).getAttribute("auto-height") === "true" && t(this, at).call(this);
|
|
888
885
|
}).observe(t(this, k));
|
|
889
886
|
}, "#init"));
|
|
890
|
-
|
|
887
|
+
a(this, at, /* @__PURE__ */ c(() => {
|
|
891
888
|
var h, d;
|
|
892
889
|
const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
893
890
|
if (i.length === 0) return;
|
|
894
891
|
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (h = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, o = ut.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
895
892
|
t(this, k).style.height = `${l}px`;
|
|
896
893
|
}, "#applyAutoHeight"));
|
|
897
|
-
|
|
894
|
+
a(this, Ct, /* @__PURE__ */ c(() => {
|
|
898
895
|
const e = Array.from(t(this, k).children).filter((h) => h.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", n = e.length, r = e.map((h, d) => {
|
|
899
896
|
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < n - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
900
897
|
return u + b;
|
|
@@ -1001,22 +998,22 @@ const Qt = class Qt {
|
|
|
1001
998
|
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1002
999
|
l == null || l.forEach((h, d) => {
|
|
1003
1000
|
e[d] && setTimeout(() => {
|
|
1004
|
-
h.generate(e[d]), s && t(this,
|
|
1001
|
+
h.generate(e[d]), s && t(this, at).call(this);
|
|
1005
1002
|
});
|
|
1006
1003
|
});
|
|
1007
1004
|
}, "#render"));
|
|
1008
1005
|
g(this, k, i), t(this, Ht).call(this);
|
|
1009
1006
|
}
|
|
1010
1007
|
};
|
|
1011
|
-
k = new WeakMap(), Ht = new WeakMap(),
|
|
1008
|
+
k = new WeakMap(), Ht = new WeakMap(), at = new WeakMap(), Ct = new WeakMap(), c(Qt, "LayoutManager");
|
|
1012
1009
|
let Yt = Qt;
|
|
1013
|
-
var
|
|
1010
|
+
var ht, Q;
|
|
1014
1011
|
const te = class te {
|
|
1015
1012
|
constructor(i) {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
g(this,
|
|
1013
|
+
a(this, ht);
|
|
1014
|
+
a(this, Q, -1);
|
|
1015
|
+
x(this, "count", /* @__PURE__ */ c(() => t(this, ht).rawRecords.length, "count"));
|
|
1016
|
+
g(this, ht, i);
|
|
1020
1017
|
}
|
|
1021
1018
|
get at() {
|
|
1022
1019
|
return t(this, Q);
|
|
@@ -1026,55 +1023,68 @@ const te = class te {
|
|
|
1026
1023
|
});
|
|
1027
1024
|
}
|
|
1028
1025
|
};
|
|
1029
|
-
|
|
1026
|
+
ht = new WeakMap(), Q = new WeakMap(), c(te, "ngRow");
|
|
1030
1027
|
let Vt = te;
|
|
1031
|
-
var
|
|
1032
|
-
const
|
|
1028
|
+
var q, S, A, tt, _t, W, Mt, V, dt, It, $t, et;
|
|
1029
|
+
const T = class T {
|
|
1033
1030
|
constructor(i, e) {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1031
|
+
a(this, q);
|
|
1032
|
+
a(this, S);
|
|
1033
|
+
a(this, A, []);
|
|
1034
|
+
a(this, tt, []);
|
|
1035
|
+
a(this, _t, 0);
|
|
1036
|
+
a(this, W, []);
|
|
1037
|
+
a(this, Mt, /* @__PURE__ */ c(() => {
|
|
1041
1038
|
g(this, W, []);
|
|
1042
|
-
const i = t(this,
|
|
1039
|
+
const i = t(this, q).template || [];
|
|
1043
1040
|
Array.from(i).forEach((e) => {
|
|
1044
1041
|
var s;
|
|
1045
1042
|
t(this, W).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1046
|
-
}), (t(this,
|
|
1047
|
-
e.__ng || (e.__ng = t(this,
|
|
1043
|
+
}), (t(this, S).rawRecords || []).forEach((e) => {
|
|
1044
|
+
e.__ng || (e.__ng = t(this, dt).call(this)), e.__ng.height = t(this, W).slice();
|
|
1048
1045
|
});
|
|
1049
1046
|
}, "#initialize"));
|
|
1050
|
-
|
|
1051
|
-
t(this,
|
|
1047
|
+
a(this, V, /* @__PURE__ */ c(() => {
|
|
1048
|
+
t(this, q).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1052
1049
|
i.invalidate();
|
|
1053
1050
|
});
|
|
1054
1051
|
}, "#invalidate"));
|
|
1055
|
-
|
|
1056
|
-
|
|
1052
|
+
x(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1053
|
+
var r;
|
|
1054
|
+
const s = this.getValidData();
|
|
1055
|
+
if (!s || s.length <= 0) return;
|
|
1056
|
+
if (i == null) return t(this, et).call(this, s);
|
|
1057
|
+
if (i < 0 || i >= s.length) return null;
|
|
1058
|
+
const n = typeof ((r = t(this, q).fields) == null ? void 0 : r.get) == "function" ? t(this, q).fields.get() : [];
|
|
1059
|
+
if (e != null) {
|
|
1060
|
+
const o = n.indexOf(e);
|
|
1061
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1062
|
+
}
|
|
1063
|
+
return t(this, et).call(this, s[i]);
|
|
1064
|
+
}, "get"));
|
|
1065
|
+
x(this, "set", /* @__PURE__ */ c((i) => {
|
|
1066
|
+
this.clear(), this.add(i, !1), t(this, V).call(this);
|
|
1057
1067
|
}, "set"));
|
|
1058
|
-
|
|
1059
|
-
rowState:
|
|
1068
|
+
a(this, dt, /* @__PURE__ */ c(() => ({
|
|
1069
|
+
rowState: T.ROW_STATE.EMPTY,
|
|
1060
1070
|
deleted: !1,
|
|
1061
1071
|
filtered: !1,
|
|
1062
1072
|
height: t(this, W).slice(),
|
|
1063
1073
|
o: {},
|
|
1064
1074
|
c: {},
|
|
1065
|
-
_: [0, 0, 0, 0,
|
|
1075
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, W).slice(), -1, {}, {}]
|
|
1066
1076
|
}), "#getDefaultMeta"));
|
|
1067
|
-
|
|
1068
|
-
g(this,
|
|
1077
|
+
x(this, "reset", /* @__PURE__ */ c(() => {
|
|
1078
|
+
g(this, A, []), g(this, tt, []), t(this, V).call(this);
|
|
1069
1079
|
}, "reset"));
|
|
1070
|
-
|
|
1080
|
+
x(this, "clear", /* @__PURE__ */ c(() => {
|
|
1071
1081
|
var i;
|
|
1072
|
-
t(this,
|
|
1082
|
+
t(this, S).rawRecords = [], g(this, A, []), g(this, tt, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1073
1083
|
}, "clear"));
|
|
1074
|
-
|
|
1084
|
+
a(this, It, /* @__PURE__ */ c((i) => {
|
|
1075
1085
|
var n;
|
|
1076
1086
|
Array.isArray(i) || (i = [i]);
|
|
1077
|
-
const e = typeof ((n = t(this,
|
|
1087
|
+
const e = typeof ((n = t(this, q).fields) == null ? void 0 : n.get) == "function" ? t(this, q).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1078
1088
|
return i.forEach((r) => {
|
|
1079
1089
|
const o = { v: [] };
|
|
1080
1090
|
e.forEach((l) => {
|
|
@@ -1082,52 +1092,52 @@ const L = class L {
|
|
|
1082
1092
|
}), s.push(o);
|
|
1083
1093
|
}), s;
|
|
1084
1094
|
}, "#json2Array"));
|
|
1085
|
-
|
|
1086
|
-
e.__ng = t(this,
|
|
1095
|
+
a(this, $t, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1096
|
+
e.__ng = t(this, dt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = T.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1087
1097
|
}), i), "#defaultInsert"));
|
|
1088
|
-
|
|
1098
|
+
x(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1089
1099
|
i === void 0 && (i = {});
|
|
1090
1100
|
const s = t(this, It).call(this, i);
|
|
1091
|
-
t(this,
|
|
1101
|
+
t(this, S).rawRecords = t(this, S).rawRecords.concat(t(this, $t).call(this, s)), this.resetRecords();
|
|
1092
1102
|
const n = this.count() - 1;
|
|
1093
1103
|
return e || s.forEach((r, o) => {
|
|
1094
|
-
const l = t(this,
|
|
1095
|
-
l && (l.__ng.rowState =
|
|
1096
|
-
}), t(this,
|
|
1104
|
+
const l = t(this, S).rawRecords[n - o];
|
|
1105
|
+
l && (l.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
1106
|
+
}), t(this, V).call(this), n;
|
|
1097
1107
|
}, "add"));
|
|
1098
|
-
|
|
1108
|
+
x(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1099
1109
|
let e = [];
|
|
1100
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1101
|
-
if (t(this,
|
|
1102
|
-
const n = t(this,
|
|
1103
|
-
t(this,
|
|
1104
|
-
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1110
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, S).host.row.at] : e = [parseInt(i, 10)], e.sort((s, n) => n - s).forEach((s) => {
|
|
1111
|
+
if (t(this, A)[s]) {
|
|
1112
|
+
const n = t(this, A)[s].__ng.rowid;
|
|
1113
|
+
t(this, A)[s].__ng.rowState === T.ROW_STATE.INSERT ? t(this, S).rawRecords = t(this, S).rawRecords.filter((r) => r.__ng.rowid !== n) : t(this, S).rawRecords.forEach((r) => {
|
|
1114
|
+
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
|
|
1105
1115
|
});
|
|
1106
1116
|
}
|
|
1107
|
-
}), this.resetRecords(), t(this,
|
|
1117
|
+
}), this.resetRecords(), t(this, V).call(this);
|
|
1108
1118
|
}, "delete"));
|
|
1109
|
-
|
|
1119
|
+
x(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1110
1120
|
var h;
|
|
1111
1121
|
i = parseInt(i, 10);
|
|
1112
|
-
const r = (typeof ((h = t(this,
|
|
1122
|
+
const r = (typeof ((h = t(this, q).fields) == null ? void 0 : h.get) == "function" ? t(this, q).fields.get() : []).indexOf(e);
|
|
1113
1123
|
if (r < 0) return;
|
|
1114
1124
|
const o = this.getValidData()[i];
|
|
1115
1125
|
if (!o) return;
|
|
1116
1126
|
const l = o.v[r];
|
|
1117
|
-
l !== s && o.__ng.rowState !==
|
|
1127
|
+
l !== s && o.__ng.rowState !== T.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = T.ROW_STATE.UPDATE), o.v[r] = s;
|
|
1118
1128
|
}, "setValue"));
|
|
1119
|
-
|
|
1120
|
-
g(this, tt, t(this,
|
|
1129
|
+
x(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1130
|
+
g(this, tt, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, t(this, S).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, S).rawRecords.forEach((i, e) => {
|
|
1121
1131
|
i.__ng.rowidx = e;
|
|
1122
|
-
}), t(this,
|
|
1132
|
+
}), t(this, A).forEach((i, e) => {
|
|
1123
1133
|
i.__ng.i = e;
|
|
1124
1134
|
});
|
|
1125
1135
|
}, "resetRecords"));
|
|
1126
|
-
|
|
1127
|
-
|
|
1136
|
+
x(this, "getValidData", /* @__PURE__ */ c(() => (t(this, A).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, A)), "getValidData"));
|
|
1137
|
+
a(this, et, /* @__PURE__ */ c((i) => {
|
|
1128
1138
|
var s;
|
|
1129
1139
|
if (!i) return i;
|
|
1130
|
-
const e = typeof ((s = t(this,
|
|
1140
|
+
const e = typeof ((s = t(this, q).fields) == null ? void 0 : s.get) == "function" ? t(this, q).fields.get() : [];
|
|
1131
1141
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
1132
1142
|
const r = {};
|
|
1133
1143
|
return e.forEach((o, l) => {
|
|
@@ -1135,54 +1145,41 @@ const L = class L {
|
|
|
1135
1145
|
}), r.__ng = n.__ng, r;
|
|
1136
1146
|
}) : i;
|
|
1137
1147
|
}, "#conv2"));
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
var r;
|
|
1141
|
-
const s = this.getValidData();
|
|
1142
|
-
if (!s || s.length <= 0) return;
|
|
1143
|
-
if (i == null) return t(this, et).call(this, s);
|
|
1144
|
-
if (i < 0 || i >= s.length) return null;
|
|
1145
|
-
const n = typeof ((r = t(this, A).fields) == null ? void 0 : r.get) == "function" ? t(this, A).fields.get() : [];
|
|
1146
|
-
if (e != null) {
|
|
1147
|
-
const o = n.indexOf(e);
|
|
1148
|
-
return o >= 0 ? s[i].v[o] : null;
|
|
1149
|
-
}
|
|
1150
|
-
return t(this, et).call(this, s[i]);
|
|
1151
|
-
}, "get"));
|
|
1152
|
-
g(this, A, i), g(this, E, e), t(this, Mt).call(this);
|
|
1148
|
+
x(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1149
|
+
g(this, q, i), g(this, S, e), t(this, Mt).call(this);
|
|
1153
1150
|
}
|
|
1154
1151
|
get source() {
|
|
1155
|
-
return t(this, et).call(this, t(this,
|
|
1152
|
+
return t(this, et).call(this, t(this, S).rawRecords);
|
|
1156
1153
|
}
|
|
1157
1154
|
set source(i) {
|
|
1158
1155
|
this.clear(), this.add(i, !1);
|
|
1159
1156
|
}
|
|
1160
1157
|
get nextId() {
|
|
1161
|
-
return ++
|
|
1158
|
+
return ++re(this, _t)._;
|
|
1162
1159
|
}
|
|
1163
1160
|
get length() {
|
|
1164
|
-
return t(this,
|
|
1161
|
+
return t(this, A).length;
|
|
1165
1162
|
}
|
|
1166
1163
|
getRowCount() {
|
|
1167
1164
|
return this.length;
|
|
1168
1165
|
}
|
|
1169
1166
|
};
|
|
1170
|
-
|
|
1171
|
-
|
|
1167
|
+
q = new WeakMap(), S = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), _t = new WeakMap(), W = new WeakMap(), Mt = new WeakMap(), V = new WeakMap(), dt = new WeakMap(), It = new WeakMap(), $t = new WeakMap(), et = new WeakMap(), c(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1168
|
+
x(T, "ROW_STATE", {
|
|
1172
1169
|
EMPTY: "EMPTY",
|
|
1173
1170
|
NORMAL: "NORMAL",
|
|
1174
1171
|
INSERT: "INSERT",
|
|
1175
1172
|
UPDATE: "UPDATE",
|
|
1176
1173
|
DELETE: "DELETE"
|
|
1177
1174
|
});
|
|
1178
|
-
let Xt =
|
|
1179
|
-
var
|
|
1175
|
+
let Xt = T;
|
|
1176
|
+
var X;
|
|
1180
1177
|
const ee = class ee {
|
|
1181
1178
|
constructor(i) {
|
|
1182
|
-
|
|
1183
|
-
g(this,
|
|
1179
|
+
a(this, X);
|
|
1180
|
+
g(this, X, i), this.row = new Vt(this), this.data = new Xt(t(this, X), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1184
1181
|
var e;
|
|
1185
|
-
(e = t(this,
|
|
1182
|
+
(e = t(this, X).view) != null && e.redraw && t(this, X).view.redraw();
|
|
1186
1183
|
}, this.setDataSource = (e) => {
|
|
1187
1184
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1188
1185
|
}, this.getRowState = (e) => {
|
|
@@ -1197,37 +1194,37 @@ const ee = class ee {
|
|
|
1197
1194
|
}, this.setDataSource([]);
|
|
1198
1195
|
}
|
|
1199
1196
|
};
|
|
1200
|
-
|
|
1197
|
+
X = new WeakMap(), c(ee, "ngDataManager");
|
|
1201
1198
|
let Ut = ee;
|
|
1202
|
-
var
|
|
1199
|
+
var U, Wt;
|
|
1203
1200
|
const ie = class ie extends HTMLElement {
|
|
1204
1201
|
constructor() {
|
|
1205
1202
|
super();
|
|
1206
1203
|
//#created = false;
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1204
|
+
a(this, U);
|
|
1205
|
+
a(this, Wt);
|
|
1206
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Ut(this));
|
|
1210
1207
|
}
|
|
1211
1208
|
connectedCallback() {
|
|
1212
|
-
g(this, Wt, new Yt(this)),
|
|
1209
|
+
g(this, Wt, new Yt(this)), F.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1213
1210
|
}
|
|
1214
1211
|
disconnectedCallback() {
|
|
1215
|
-
|
|
1212
|
+
F.log("NineTable disconnected.");
|
|
1216
1213
|
}
|
|
1217
1214
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1218
1215
|
get data() {
|
|
1219
|
-
return t(this,
|
|
1216
|
+
return t(this, U).data;
|
|
1220
1217
|
}
|
|
1221
1218
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1222
1219
|
get row() {
|
|
1223
|
-
return t(this,
|
|
1220
|
+
return t(this, U).row;
|
|
1224
1221
|
}
|
|
1225
1222
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1226
1223
|
get dataManager() {
|
|
1227
|
-
return t(this,
|
|
1224
|
+
return t(this, U);
|
|
1228
1225
|
}
|
|
1229
1226
|
};
|
|
1230
|
-
|
|
1227
|
+
U = new WeakMap(), Wt = new WeakMap(), c(ie, "NineTable");
|
|
1231
1228
|
let Ft = ie;
|
|
1232
1229
|
customElements.get("nine-table") || customElements.define("nine-table", Ft);
|
|
1233
1230
|
//# sourceMappingURL=nine-table.js.map
|