@ninebone/table 0.0.353 β 0.0.355
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nine-table.js +372 -359
- 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,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var be = (m) => {
|
|
3
3
|
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (m, i) =>
|
|
7
|
-
var x = (m, i, e) =>
|
|
8
|
-
var t = (m, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var pe = (m, i, e) => i in m ? ue(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
|
+
var a = (m, i) => ue(m, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (m, i, e) => pe(m, typeof i != "symbol" ? i + "" : i, e), ge = (m, i, e) => i.has(m) || be("Cannot " + e);
|
|
8
|
+
var t = (m, i, e) => (ge(m, i, "read from private field"), e ? e.call(m) : i.get(m)), c = (m, i, e) => i.has(m) ? be("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), b = (m, i, e, s) => (ge(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
|
+
var ye = (m, i, e, s) => ({
|
|
10
10
|
set _(o) {
|
|
11
11
|
b(m, i, o, e);
|
|
12
12
|
},
|
|
@@ -14,26 +14,26 @@ var ue = (m, i, e, s) => ({
|
|
|
14
14
|
return t(m, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as me } from "@ninebone/util";
|
|
18
|
+
const se = class se extends me.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var _,
|
|
27
|
-
const
|
|
23
|
+
a(se, "Trace");
|
|
24
|
+
let Xt = se;
|
|
25
|
+
const D = new Xt();
|
|
26
|
+
var _, I, y, B, N, P, xt, Y, vt;
|
|
27
|
+
const ne = class ne extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
c(this, _);
|
|
31
|
+
c(this, I, !1);
|
|
32
|
+
c(this, y);
|
|
33
|
+
c(this, B);
|
|
34
|
+
c(this, N);
|
|
35
|
+
c(this, P);
|
|
36
|
+
c(this, xt, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
39
|
e && (b(this, P, new ResizeObserver(() => {
|
|
@@ -41,11 +41,11 @@ const ee = class ee extends HTMLElement {
|
|
|
41
41
|
})), t(this, P).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this, _) || !t(this, y) || t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, y) || t(this, I)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && h > l)
|
|
49
49
|
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
n && (n.style.display = "none");
|
|
@@ -53,38 +53,38 @@ const ee = class ee extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const d = o.clientWidth;
|
|
55
55
|
if (d <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(d * (l /
|
|
56
|
+
const f = Math.max(Math.min(d * (l / h), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft, g =
|
|
58
|
+
const u = e.scrollLeft, g = h - l;
|
|
59
59
|
let p = 0;
|
|
60
60
|
g > 0 && (p = parseInt(u / g * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
p > E && (p = E), r.style.left = `${p}px`,
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, D.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
c(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
68
68
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
71
|
+
const h = r.width - n;
|
|
72
|
+
l > h && (l = h), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= h - 1;
|
|
73
73
|
const d = s.clientWidth, u = o.scrollWidth - d;
|
|
74
|
-
return
|
|
74
|
+
return h > 0 && u > 0 && (s.scrollLeft = l / h * u), l > 0 && l < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
76
|
+
c(this, vt, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((o) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, B)), clearInterval(t(this, N));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, Y).call(this, r + o), b(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Y).call(this, r + o), b(this, B, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, B)), b(this, N, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, Y).call(this, n + o) || clearInterval(t(this,
|
|
83
|
+
t(this, Y).call(this, n + o) || clearInterval(t(this, N));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, B)), clearInterval(t(this, N));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -99,13 +99,13 @@ const ee = class ee extends HTMLElement {
|
|
|
99
99
|
t(this, Y).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
|
-
o.stopPropagation(), o.preventDefault(), b(this,
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), b(this, I, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this, Y).call(this, l.clientX -
|
|
104
|
+
if (!t(this, I)) return;
|
|
105
|
+
const h = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, Y).call(this, l.clientX - h.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
-
b(this,
|
|
108
|
+
b(this, I, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
@@ -189,8 +189,8 @@ const ee = class ee 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,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, I) || this.refresh();
|
|
193
|
+
}), t(this, vt).call(this), t(this, xt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,73 +198,73 @@ const ee = class ee extends HTMLElement {
|
|
|
198
198
|
t(this, P) && t(this, P).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var V,
|
|
205
|
-
const
|
|
201
|
+
_ = new WeakMap(), I = new WeakMap(), y = new WeakMap(), B = new WeakMap(), N = new WeakMap(), P = new WeakMap(), xt = new WeakMap(), Y = new WeakMap(), vt = new WeakMap(), a(ne, "NineTableHScrollBar");
|
|
202
|
+
let jt = ne;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", jt);
|
|
204
|
+
var V, W, w, lt, at, wt;
|
|
205
|
+
const oe = class oe extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
c(this, V);
|
|
209
|
+
c(this, W, !1);
|
|
210
|
+
c(this, w);
|
|
211
|
+
c(this, lt, 0);
|
|
212
|
+
c(this, at, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
216
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
-
if (!t(this, V) || !t(this,
|
|
218
|
-
const e = t(this,
|
|
217
|
+
if (!t(this, V) || !t(this, w) || t(this, W)) return;
|
|
218
|
+
const e = t(this, w).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
|
-
const o = t(this,
|
|
220
|
+
const o = t(this, w).track, r = t(this, w).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
221
221
|
if (l <= n) {
|
|
222
|
-
r.style.display = "none", t(this,
|
|
222
|
+
r.style.display = "none", t(this, w).top.disabled = !0, t(this, w).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
r.style.display = "block";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const d = Math.max(Math.min(
|
|
226
|
+
const h = o.clientHeight;
|
|
227
|
+
if (h <= 0) return;
|
|
228
|
+
const d = Math.max(Math.min(h * (n / l), h), 20);
|
|
229
229
|
r.style.height = `${d}px`;
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
231
|
let g = 0;
|
|
232
|
-
u > 0 && (g = f / u * (
|
|
233
|
-
const p =
|
|
234
|
-
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this,
|
|
232
|
+
u > 0 && (g = f / u * (h - d));
|
|
233
|
+
const p = h - d;
|
|
234
|
+
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, w).top.disabled = f <= 0, t(this, w).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
|
|
237
|
-
const e = t(this,
|
|
236
|
+
c(this, wt, /* @__PURE__ */ a(() => {
|
|
237
|
+
const e = t(this, w).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
240
|
-
}), t(this,
|
|
239
|
+
t(this, W) || this.refresh();
|
|
240
|
+
}), t(this, w).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(), b(this,
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), b(this, W, !0), b(this, lt, s.clientY), b(this, at, e.scrollTop);
|
|
243
243
|
const o = /* @__PURE__ */ a((n) => {
|
|
244
|
-
if (!t(this,
|
|
245
|
-
const l = t(this,
|
|
246
|
-
|
|
244
|
+
if (!t(this, W)) return;
|
|
245
|
+
const l = t(this, w).track.getBoundingClientRect(), h = t(this, w).thumb.clientHeight, f = l.height - h, u = n.clientY - t(this, lt), g = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
D.log(p), D.log(p.scrollHeight);
|
|
247
247
|
const H = p.scrollHeight - g;
|
|
248
248
|
if (f > 0 && H > 0) {
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this,
|
|
249
|
+
const pt = u / f * H;
|
|
250
|
+
e.scrollTop = t(this, at) + pt;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
253
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
254
|
-
b(this,
|
|
254
|
+
b(this, W, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (s.button !== 0 || s.target === t(this,
|
|
259
|
-
const o = t(this,
|
|
260
|
-
if (
|
|
261
|
-
const g = Math.max(0, Math.min(1, n /
|
|
257
|
+
}), t(this, w).track.addEventListener("mousedown", (s) => {
|
|
258
|
+
if (s.button !== 0 || s.target === t(this, w).thumb) return;
|
|
259
|
+
const o = t(this, w).track.getBoundingClientRect(), r = t(this, w).thumb.clientHeight, n = s.clientY - o.top - r / 2, h = o.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
|
+
if (h > 0 && u > 0) {
|
|
261
|
+
const g = Math.max(0, Math.min(1, n / h));
|
|
262
262
|
e.scrollTop = g * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, w).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, w).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -340,21 +340,21 @@ const ie = class ie extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
b(this,
|
|
343
|
+
b(this, w, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
347
347
|
top: this.querySelector(".ng-scroll-top"),
|
|
348
348
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
349
|
-
}), t(this,
|
|
349
|
+
}), t(this, wt).call(this), this.refresh();
|
|
350
350
|
}, "initWhenReady");
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
V = new WeakMap(),
|
|
355
|
-
let
|
|
356
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
357
|
-
var
|
|
354
|
+
V = new WeakMap(), W = new WeakMap(), w = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), wt = new WeakMap(), a(oe, "NineTableVScrollBar");
|
|
355
|
+
let Ut = oe;
|
|
356
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ut);
|
|
357
|
+
var St, Z;
|
|
358
358
|
const C = class C {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,15 +369,15 @@ const C = class C {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o = C,
|
|
373
|
-
const f =
|
|
372
|
+
return t(o = C, St).call(o, e), t(r = C, Z).call(r, e, "thead"), t(n = C, Z).call(n, e, "tbody"), t(l = C, Z).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((h, d) => {
|
|
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);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
St = new WeakMap(), Z = new WeakMap(), a(C, "TableCompiler"), c(C, St, /* @__PURE__ */ a((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, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,18 +391,18 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__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")), c(C, Z, /* @__PURE__ */ a((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
398
|
-
o.forEach((
|
|
399
|
-
n +=
|
|
398
|
+
o.forEach((h) => {
|
|
399
|
+
n += h.colSpan || 1;
|
|
400
400
|
});
|
|
401
401
|
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
402
|
-
s.forEach((
|
|
403
|
-
const d =
|
|
402
|
+
s.forEach((h) => {
|
|
403
|
+
const d = h.sectionRowIndex;
|
|
404
404
|
let f = 0;
|
|
405
|
-
Array.from(
|
|
405
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
406
406
|
for (let E = 0; E < l[d].length; E++)
|
|
407
407
|
if (l[d][E] === null) {
|
|
408
408
|
f = E;
|
|
@@ -413,9 +413,9 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PUR
|
|
|
413
413
|
for (let H = 0; H < p; H++)
|
|
414
414
|
d + E < r && f + H < n && (l[d + E][f + H] = E === 0 && H === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
|
-
}), s.forEach((
|
|
417
|
-
const d =
|
|
418
|
-
Array.from(
|
|
416
|
+
}), s.forEach((h) => {
|
|
417
|
+
const d = h.sectionRowIndex;
|
|
418
|
+
Array.from(h.querySelectorAll("th,td")).forEach((f) => {
|
|
419
419
|
for (let u = 0; u < l[d].length; u++)
|
|
420
420
|
if (l[d][u] === "1") {
|
|
421
421
|
f.dataset.col = u, l[d][u] = "0";
|
|
@@ -424,25 +424,26 @@ wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PUR
|
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
|
-
let
|
|
428
|
-
var
|
|
429
|
-
const
|
|
427
|
+
let Ft = C;
|
|
428
|
+
var G, v, M, A, O, X, J, Q, Et, Rt, ct, ht, At, qt, dt, Tt, tt, kt;
|
|
429
|
+
const re = class re {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
431
|
+
c(this, G);
|
|
432
|
+
c(this, v);
|
|
433
|
+
c(this, M, /* @__PURE__ */ new Map());
|
|
434
|
+
c(this, A, null);
|
|
435
|
+
c(this, O, null);
|
|
436
|
+
c(this, X, 0);
|
|
437
|
+
c(this, J, 40);
|
|
438
|
+
c(this, Q, !1);
|
|
438
439
|
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
439
440
|
var e;
|
|
440
|
-
const i = t(this,
|
|
441
|
-
i && (t(this,
|
|
441
|
+
const i = t(this, v).querySelector(".ng-container-body");
|
|
442
|
+
i && (t(this, ct).call(this), t(this, tt).call(this, i.scrollTop), (e = t(this, v).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
443
|
}, "refresh"));
|
|
443
444
|
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
444
|
-
b(this,
|
|
445
|
-
const r = t(this,
|
|
445
|
+
b(this, A, null), t(this, M).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
446
|
+
const r = t(this, v).querySelector(o);
|
|
446
447
|
if (!r) return;
|
|
447
448
|
const n = r.querySelector("table");
|
|
448
449
|
if (!n) return;
|
|
@@ -451,13 +452,13 @@ const se = class se {
|
|
|
451
452
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
453
|
t(this, M).set(o, d);
|
|
453
454
|
});
|
|
454
|
-
const i = t(this,
|
|
455
|
+
const i = t(this, v).querySelector(".ng-container-body"), e = t(this, v).querySelector(".ng-container-left"), s = t(this, v).querySelector(".ng-container-right");
|
|
455
456
|
if (i) {
|
|
456
|
-
t(this,
|
|
457
|
+
t(this, Rt).call(this, i), t(this, dt).call(this), t(this, ct).call(this), t(this, tt).call(this, i.scrollTop);
|
|
457
458
|
let o = i.scrollTop;
|
|
458
459
|
const r = /* @__PURE__ */ a((n) => {
|
|
459
460
|
var l;
|
|
460
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
461
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, tt).call(this, n), (l = t(this, v).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
462
|
}, "syncScroll");
|
|
462
463
|
i.addEventListener("scroll", () => {
|
|
463
464
|
const n = i.scrollTop;
|
|
@@ -465,7 +466,7 @@ const se = class se {
|
|
|
465
466
|
});
|
|
466
467
|
}
|
|
467
468
|
}, "initialize"));
|
|
468
|
-
|
|
469
|
+
c(this, Et, /* @__PURE__ */ a((i, e) => {
|
|
469
470
|
const s = t(this, M).get(e);
|
|
470
471
|
if (!s || s.length === 0) return;
|
|
471
472
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
@@ -473,14 +474,14 @@ const se = class se {
|
|
|
473
474
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
475
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
475
476
|
for (let l = 0; l < t(this, J); l++)
|
|
476
|
-
s.forEach((
|
|
477
|
-
n.appendChild(
|
|
477
|
+
s.forEach((h) => {
|
|
478
|
+
n.appendChild(h.cloneNode(!0));
|
|
478
479
|
});
|
|
479
480
|
r ? r.before(n) : o.appendChild(n);
|
|
480
481
|
}, "#renderRows"));
|
|
481
|
-
|
|
482
|
-
if (t(this,
|
|
483
|
-
return t(this,
|
|
482
|
+
c(this, Rt, /* @__PURE__ */ a((i) => {
|
|
483
|
+
if (t(this, A) !== null && t(this, A) > 0)
|
|
484
|
+
return t(this, A);
|
|
484
485
|
const e = t(this, M).get(".ng-container-body");
|
|
485
486
|
if (!e || e.length === 0) return 24;
|
|
486
487
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
@@ -490,45 +491,45 @@ const se = class se {
|
|
|
490
491
|
e.forEach((g) => {
|
|
491
492
|
r.appendChild(g.cloneNode(!0));
|
|
492
493
|
}), o ? o.before(r) : s.appendChild(r);
|
|
493
|
-
const n = t(this,
|
|
494
|
+
const n = t(this, v), l = n.style.display, h = n.style.visibility, d = n.style.position;
|
|
494
495
|
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
495
496
|
let f = 0;
|
|
496
497
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
497
498
|
return u.forEach((g) => {
|
|
498
499
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
499
|
-
}), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility =
|
|
500
|
+
}), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = h, n.style.position = d, b(this, A, f > 0 ? f : 24), t(this, ht).call(this), t(this, A);
|
|
500
501
|
}, "#measureAndCacheHeight"));
|
|
501
|
-
|
|
502
|
-
if (!t(this,
|
|
503
|
-
const e = t(this,
|
|
502
|
+
c(this, ct, /* @__PURE__ */ a(() => {
|
|
503
|
+
if (!t(this, v).querySelector(".ng-container-body")) return;
|
|
504
|
+
const e = t(this, G).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
|
|
504
505
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
|
-
const l = t(this,
|
|
506
|
-
|
|
506
|
+
const l = t(this, v).querySelector(n), h = l == null ? void 0 : l.querySelector("table");
|
|
507
|
+
h && (h.style.height = `${r}px`);
|
|
507
508
|
});
|
|
508
509
|
}, "#updateVirtualScrollHeight"));
|
|
509
|
-
|
|
510
|
-
if (t(this,
|
|
511
|
-
const i = Math.ceil(t(this,
|
|
510
|
+
c(this, ht, /* @__PURE__ */ a(() => {
|
|
511
|
+
if (t(this, X) > 0 && t(this, A) > 0) {
|
|
512
|
+
const i = Math.ceil(t(this, X) / t(this, A));
|
|
512
513
|
b(this, J, i + 20);
|
|
513
514
|
} else
|
|
514
515
|
b(this, J, 40);
|
|
515
516
|
}, "#updateRowCount"));
|
|
516
|
-
|
|
517
|
-
var
|
|
518
|
-
const i = t(this,
|
|
517
|
+
c(this, At, /* @__PURE__ */ a(() => {
|
|
518
|
+
var h, d, f;
|
|
519
|
+
const i = t(this, v).querySelector(".ng-container-left table"), e = t(this, v).querySelector(".ng-container-body table"), s = t(this, v).querySelector(".ng-container-right table");
|
|
519
520
|
if (!e) return;
|
|
520
521
|
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
521
522
|
for (let u = 0; u < l; u++) {
|
|
522
523
|
const g = [
|
|
523
|
-
((
|
|
524
|
+
((h = o[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
524
525
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
525
526
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
526
527
|
], p = Math.max(...g);
|
|
527
528
|
p > 0 && (o[u] && (o[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), n[u] && (n[u].style.height = `${p}px`));
|
|
528
529
|
}
|
|
529
530
|
}, "#syncRowHeights"));
|
|
530
|
-
|
|
531
|
-
!t(this,
|
|
531
|
+
c(this, qt, /* @__PURE__ */ a(() => {
|
|
532
|
+
!t(this, v) || !(t(this, v) instanceof HTMLElement) || (b(this, O, new ResizeObserver((i) => {
|
|
532
533
|
for (const e of i) {
|
|
533
534
|
const s = e.target;
|
|
534
535
|
if (!s.classList.contains("active")) continue;
|
|
@@ -538,61 +539,70 @@ const se = class se {
|
|
|
538
539
|
const n = s.querySelector("thead");
|
|
539
540
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
541
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this,
|
|
542
|
+
t(this, X) !== l && (b(this, X, l), t(this, ht).call(this), t(this, A) !== null && t(this, dt).call(this));
|
|
542
543
|
}
|
|
543
544
|
}
|
|
544
|
-
})), t(this,
|
|
545
|
+
})), t(this, O).observe(t(this, v)));
|
|
545
546
|
}, "#initResizeObserver"));
|
|
546
|
-
|
|
547
|
+
c(this, dt, /* @__PURE__ */ a(() => {
|
|
547
548
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
548
|
-
const e = t(this,
|
|
549
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
550
|
-
}), t(this,
|
|
549
|
+
const e = t(this, v).querySelector(i);
|
|
550
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, Et).call(this, e, i);
|
|
551
|
+
}), t(this, At).call(this);
|
|
551
552
|
}, "#renderAllContainers"));
|
|
552
|
-
|
|
553
|
+
c(this, Tt, /* @__PURE__ */ a((i) => {
|
|
554
|
+
const e = t(this, A) || 24, s = i * e;
|
|
555
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
556
|
+
const r = t(this, v).querySelector(o), n = r == null ? void 0 : r.querySelector("table");
|
|
557
|
+
n && (n.style.transform = `translateY(${s}px)`);
|
|
558
|
+
});
|
|
559
|
+
}, "#adjustBufferRows"));
|
|
560
|
+
c(this, tt, /* @__PURE__ */ a((i) => {
|
|
553
561
|
var r;
|
|
554
|
-
const e = t(this,
|
|
562
|
+
const e = t(this, A);
|
|
555
563
|
if (!e || e <= 0) return;
|
|
556
564
|
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, M).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
565
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
|
-
const l = t(this,
|
|
566
|
+
const l = t(this, v).querySelector(n);
|
|
559
567
|
if (!l) return;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
Array.from(
|
|
563
|
-
const g = s + Math.floor(u / o), p = t(this,
|
|
564
|
-
|
|
568
|
+
const h = l.querySelector("tbody.bindable-tbody");
|
|
569
|
+
if (!h) return;
|
|
570
|
+
Array.from(h.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
571
|
+
const g = s + Math.floor(u / o), p = t(this, G).data.get(g);
|
|
572
|
+
f.style.display = "", t(this, kt).call(this, f, p, g);
|
|
565
573
|
});
|
|
566
|
-
})
|
|
574
|
+
}), t(this, Q) || (b(this, Q, !0), setTimeout(() => {
|
|
575
|
+
t(this, Tt).call(this, s), b(this, Q, !1);
|
|
576
|
+
}, 0));
|
|
567
577
|
}, "#handleScroll"));
|
|
568
|
-
|
|
578
|
+
c(this, kt, /* @__PURE__ */ a((i, e, s) => {
|
|
569
579
|
i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
|
|
570
580
|
const n = o.dataset.bind;
|
|
571
581
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, o.dataset.row = s;
|
|
572
582
|
});
|
|
573
583
|
}, "#bindRowData"));
|
|
574
584
|
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
575
|
-
t(this,
|
|
585
|
+
t(this, O) && (t(this, O).disconnect(), b(this, O, null));
|
|
576
586
|
}, "destroy"));
|
|
577
|
-
b(this,
|
|
587
|
+
b(this, G, i.getRootNode().host), b(this, v, i), t(this, qt).call(this);
|
|
578
588
|
}
|
|
579
589
|
getRowHeight() {
|
|
580
|
-
return t(this,
|
|
590
|
+
return t(this, A);
|
|
581
591
|
}
|
|
582
592
|
templateLength(i = ".ng-container-body") {
|
|
583
593
|
var e;
|
|
584
594
|
return ((e = t(this, M).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
595
|
}
|
|
586
596
|
};
|
|
587
|
-
|
|
588
|
-
let
|
|
589
|
-
var
|
|
590
|
-
const
|
|
597
|
+
G = new WeakMap(), v = new WeakMap(), M = new WeakMap(), A = new WeakMap(), O = new WeakMap(), X = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Et = new WeakMap(), Rt = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), dt = new WeakMap(), Tt = new WeakMap(), tt = new WeakMap(), kt = new WeakMap(), a(re, "RowManager");
|
|
598
|
+
let Kt = re;
|
|
599
|
+
var Lt, et, j, Ht, Ct, _t, Mt, It;
|
|
600
|
+
const rt = class rt extends HTMLElement {
|
|
591
601
|
constructor() {
|
|
592
602
|
super();
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
603
|
+
c(this, Lt);
|
|
604
|
+
c(this, et, null);
|
|
605
|
+
c(this, j);
|
|
596
606
|
/**
|
|
597
607
|
* data.set, add, delete
|
|
598
608
|
* filter, sorting : κ³ λ €λμ
|
|
@@ -600,7 +610,7 @@ const ot = class ot extends HTMLElement {
|
|
|
600
610
|
x(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
601
611
|
t(this, j).refresh();
|
|
602
612
|
}, "invalidate"));
|
|
603
|
-
|
|
613
|
+
c(this, Ht, /* @__PURE__ */ a(() => {
|
|
604
614
|
[
|
|
605
615
|
{ selector: ".ng-container-body", type: null },
|
|
606
616
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -608,11 +618,11 @@ const ot = class ot extends HTMLElement {
|
|
|
608
618
|
].forEach(({ selector: s, type: o }) => {
|
|
609
619
|
const r = this.querySelector(s);
|
|
610
620
|
if (!r) return;
|
|
611
|
-
const n = t(this,
|
|
621
|
+
const n = t(this, _t).call(this, t(this, et), o);
|
|
612
622
|
r.innerHTML = "", r.appendChild(n);
|
|
613
623
|
});
|
|
614
624
|
}, "#renderSplitContainers"));
|
|
615
|
-
|
|
625
|
+
c(this, Ct, /* @__PURE__ */ a(() => {
|
|
616
626
|
["left", "right"].forEach((e) => {
|
|
617
627
|
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
618
628
|
if (!s || !o) return;
|
|
@@ -624,7 +634,7 @@ const ot = class ot extends HTMLElement {
|
|
|
624
634
|
});
|
|
625
635
|
}, "#updateContainerWidths"));
|
|
626
636
|
x(this, "generate", /* @__PURE__ */ a((e) => {
|
|
627
|
-
e && (b(this,
|
|
637
|
+
e && (b(this, et, Ft.compile(e)), t(this, et).style.display = "table", t(this, Ht).call(this), t(this, Ct).call(this), requestAnimationFrame(() => {
|
|
628
638
|
var o;
|
|
629
639
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
630
640
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -638,7 +648,7 @@ const ot = class ot extends HTMLElement {
|
|
|
638
648
|
/**
|
|
639
649
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
640
650
|
*/
|
|
641
|
-
|
|
651
|
+
c(this, _t, /* @__PURE__ */ a((e, s) => {
|
|
642
652
|
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
643
653
|
if (r) {
|
|
644
654
|
const n = document.createElement("tbody");
|
|
@@ -661,11 +671,11 @@ const ot = class ot extends HTMLElement {
|
|
|
661
671
|
const s = this.querySelector(".ng-container-body");
|
|
662
672
|
s && (s.scrollTop = e);
|
|
663
673
|
}, "scrollToY"));
|
|
664
|
-
|
|
665
|
-
t(this,
|
|
674
|
+
c(this, Mt, /* @__PURE__ */ a(() => {
|
|
675
|
+
t(this, It).call(this);
|
|
666
676
|
}, "#init"));
|
|
667
|
-
|
|
668
|
-
const e =
|
|
677
|
+
c(this, It, /* @__PURE__ */ a(() => {
|
|
678
|
+
const e = rt.SCROLLBAR_SIZE;
|
|
669
679
|
this.innerHTML = `
|
|
670
680
|
<style>
|
|
671
681
|
nine-table-sheet {
|
|
@@ -811,45 +821,45 @@ const ot = class ot extends HTMLElement {
|
|
|
811
821
|
</div>
|
|
812
822
|
`;
|
|
813
823
|
}, "#render"));
|
|
814
|
-
b(this, j, new
|
|
824
|
+
b(this, j, new Kt(this)), b(this, Lt, this.getRootNode().host);
|
|
815
825
|
}
|
|
816
826
|
connectedCallback() {
|
|
817
|
-
t(this,
|
|
827
|
+
t(this, Mt).call(this);
|
|
818
828
|
}
|
|
819
829
|
disconnectedCallback() {
|
|
820
|
-
this.innerHTML = "",
|
|
830
|
+
this.innerHTML = "", D.log("NineTableSheet destroyed.");
|
|
821
831
|
}
|
|
822
832
|
};
|
|
823
|
-
|
|
824
|
-
let
|
|
825
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
826
|
-
var
|
|
827
|
-
const
|
|
833
|
+
Lt = new WeakMap(), et = new WeakMap(), j = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap(), It = new WeakMap(), a(rt, "NineTableSheet"), x(rt, "SCROLLBAR_SIZE", 16);
|
|
834
|
+
let mt = rt;
|
|
835
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", mt);
|
|
836
|
+
var $t, ft;
|
|
837
|
+
const le = class le extends HTMLElement {
|
|
828
838
|
constructor() {
|
|
829
839
|
super();
|
|
830
|
-
|
|
840
|
+
c(this, $t, /* @__PURE__ */ a(() => {
|
|
831
841
|
var e;
|
|
832
842
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
833
843
|
var n;
|
|
834
844
|
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
835
|
-
t(this,
|
|
836
|
-
}), t(this,
|
|
845
|
+
t(this, ft).call(this, r, o);
|
|
846
|
+
}), t(this, ft).call(this, 0, !1);
|
|
837
847
|
}, "#init"));
|
|
838
|
-
|
|
848
|
+
c(this, ft, /* @__PURE__ */ a((e, s = !1) => {
|
|
839
849
|
const o = /* @__PURE__ */ a(() => {
|
|
840
850
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
841
851
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
842
852
|
const g = f.filter((p) => p.classList.contains("active"));
|
|
843
853
|
g.length < 2 || g.forEach((p) => {
|
|
844
|
-
const E = parseInt(p.getAttribute("data-index"), 10), H = this.querySelector(`nine-splitter[data-split-index="${E}"]`),
|
|
845
|
-
H &&
|
|
854
|
+
const E = parseInt(p.getAttribute("data-index"), 10), H = this.querySelector(`nine-splitter[data-split-index="${E}"]`), pt = f[E + 1];
|
|
855
|
+
H && pt && pt.classList.contains("active") && H.style.setProperty("display", "flex");
|
|
846
856
|
});
|
|
847
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
857
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = n.querySelectorAll("nine-table-sheet");
|
|
848
858
|
if (!l[e]) return;
|
|
849
859
|
if (!s)
|
|
850
860
|
l.forEach((f, u) => {
|
|
851
861
|
f.classList.toggle("active", u === e);
|
|
852
|
-
}),
|
|
862
|
+
}), h.forEach((f, u) => {
|
|
853
863
|
const g = u === e;
|
|
854
864
|
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
855
865
|
});
|
|
@@ -868,108 +878,35 @@ const ne = class ne extends HTMLElement {
|
|
|
868
878
|
}, "#switchSheet"));
|
|
869
879
|
}
|
|
870
880
|
connectedCallback() {
|
|
871
|
-
t(this,
|
|
872
|
-
}
|
|
873
|
-
};
|
|
874
|
-
Mt = new WeakMap(), dt = new WeakMap(), a(ne, "NineTableSheets");
|
|
875
|
-
let jt = ne;
|
|
876
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", jt);
|
|
877
|
-
var et, R, ft, It;
|
|
878
|
-
const oe = class oe {
|
|
879
|
-
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
880
|
-
constructor(i) {
|
|
881
|
-
h(this, et);
|
|
882
|
-
h(this, R, []);
|
|
883
|
-
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
884
|
-
i.forEach((s) => {
|
|
885
|
-
t(this, R).some((o) => o.name === s) || t(this, R).push({ name: s, type: e });
|
|
886
|
-
}), t(this, ft).call(this);
|
|
887
|
-
}, "add"));
|
|
888
|
-
h(this, ft, /* @__PURE__ */ a(() => {
|
|
889
|
-
const i = /* @__PURE__ */ new Map();
|
|
890
|
-
t(this, R).forEach((e) => {
|
|
891
|
-
i.set(e.name, e.type);
|
|
892
|
-
}), b(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
893
|
-
}, "#adjust"));
|
|
894
|
-
h(this, It, /* @__PURE__ */ a(() => {
|
|
895
|
-
b(this, R, []), I.log(t(this, et).querySelectorAll("table"));
|
|
896
|
-
const i = Array.from(t(this, et).querySelectorAll("table"));
|
|
897
|
-
if (!(!i || i.length === 0)) {
|
|
898
|
-
for (const e of i)
|
|
899
|
-
I.log(e), $("[data-bind]", e).each((s, o) => {
|
|
900
|
-
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
901
|
-
r && t(this, R).push({ name: r, type: n });
|
|
902
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
903
|
-
$(`[${s}]`, e).each((o, r) => {
|
|
904
|
-
var n = r.getAttribute(s);
|
|
905
|
-
if (n.indexOf("data.") < 0) {
|
|
906
|
-
const l = n.search(/[(]/g);
|
|
907
|
-
if (l > 0)
|
|
908
|
-
try {
|
|
909
|
-
n = String(window[n.substring(0, l).trim()]);
|
|
910
|
-
} catch {
|
|
911
|
-
n = "";
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
n.split("data.").forEach((l) => {
|
|
915
|
-
if (l.trim() != "") {
|
|
916
|
-
const c = l.search(/[^_A-Za-z0-9]/g);
|
|
917
|
-
let d = "";
|
|
918
|
-
c >= 0 ? d = l.substring(0, c) : n.startsWith("data.") && (d = l.replace("data.", "")), d && t(this, R).push({ name: d, type: "string" });
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
});
|
|
922
|
-
});
|
|
923
|
-
t(this, ft).call(this);
|
|
924
|
-
}
|
|
925
|
-
}, "#init"));
|
|
926
|
-
b(this, et, i), t(this, It).call(this);
|
|
927
|
-
}
|
|
928
|
-
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
929
|
-
get() {
|
|
930
|
-
return t(this, R).map((i) => i.name);
|
|
931
|
-
}
|
|
932
|
-
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
933
|
-
getFields() {
|
|
934
|
-
return t(this, R);
|
|
935
|
-
}
|
|
936
|
-
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
937
|
-
getType(i) {
|
|
938
|
-
const e = t(this, R).find((s) => s.name === i);
|
|
939
|
-
return e ? e.type : "string";
|
|
940
|
-
}
|
|
941
|
-
indexOf(i) {
|
|
942
|
-
return t(this, R).findIndex((e) => e.name === i);
|
|
943
|
-
}
|
|
944
|
-
includes(i) {
|
|
945
|
-
return t(this, R).some((e) => e.name === i);
|
|
881
|
+
t(this, $t).call(this);
|
|
946
882
|
}
|
|
947
883
|
};
|
|
948
|
-
|
|
949
|
-
let
|
|
950
|
-
|
|
951
|
-
|
|
884
|
+
$t = new WeakMap(), ft = new WeakMap(), a(le, "NineTableSheets");
|
|
885
|
+
let Zt = le;
|
|
886
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Zt);
|
|
887
|
+
var q, Wt, ut, Ot;
|
|
888
|
+
const ae = class ae {
|
|
952
889
|
constructor(i) {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
t(this,
|
|
890
|
+
c(this, q);
|
|
891
|
+
c(this, Wt, /* @__PURE__ */ a(() => {
|
|
892
|
+
t(this, Ot).call(this), new ResizeObserver((i) => {
|
|
956
893
|
for (let e of i)
|
|
957
|
-
t(this,
|
|
958
|
-
}).observe(t(this,
|
|
894
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, ut).call(this);
|
|
895
|
+
}).observe(t(this, q));
|
|
959
896
|
}, "#init"));
|
|
960
|
-
|
|
961
|
-
var
|
|
962
|
-
const i = Array.from(t(this,
|
|
897
|
+
c(this, ut, /* @__PURE__ */ a(() => {
|
|
898
|
+
var h, d;
|
|
899
|
+
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
963
900
|
if (i.length === 0) return;
|
|
964
|
-
const e = parseInt(t(this,
|
|
965
|
-
t(this,
|
|
901
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (h = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (d = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = mt.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
902
|
+
t(this, q).style.height = `${l}px`;
|
|
966
903
|
}, "#applyAutoHeight"));
|
|
967
|
-
|
|
968
|
-
const e = Array.from(t(this,
|
|
904
|
+
c(this, Ot, /* @__PURE__ */ a(() => {
|
|
905
|
+
const e = Array.from(t(this, q).children).filter((h) => h.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", o = e.length, r = e.map((h, d) => {
|
|
969
906
|
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, g = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
970
907
|
return u + g;
|
|
971
|
-
}).join(""), n = e.map((
|
|
972
|
-
t(this,
|
|
908
|
+
}).join(""), n = e.map((h, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
909
|
+
t(this, q).shadowRoot.innerHTML = `
|
|
973
910
|
<style>
|
|
974
911
|
:host {
|
|
975
912
|
display: flex;
|
|
@@ -1068,23 +1005,23 @@ const re = class re {
|
|
|
1068
1005
|
</nine-table-body>
|
|
1069
1006
|
<nine-table-footer></nine-table-footer>
|
|
1070
1007
|
`;
|
|
1071
|
-
const l = t(this,
|
|
1072
|
-
l == null || l.forEach((
|
|
1008
|
+
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1009
|
+
l == null || l.forEach((h, d) => {
|
|
1073
1010
|
e[d] && setTimeout(() => {
|
|
1074
|
-
|
|
1011
|
+
h.generate(e[d]), s && t(this, ut).call(this);
|
|
1075
1012
|
});
|
|
1076
1013
|
});
|
|
1077
1014
|
}, "#render"));
|
|
1078
|
-
b(this,
|
|
1015
|
+
b(this, q, i), t(this, Wt).call(this);
|
|
1079
1016
|
}
|
|
1080
1017
|
};
|
|
1081
|
-
|
|
1082
|
-
let
|
|
1018
|
+
q = new WeakMap(), Wt = new WeakMap(), ut = new WeakMap(), Ot = new WeakMap(), a(ae, "LayoutManager");
|
|
1019
|
+
let Gt = ae;
|
|
1083
1020
|
var bt, it;
|
|
1084
|
-
const
|
|
1021
|
+
const ce = class ce {
|
|
1085
1022
|
constructor(i) {
|
|
1086
|
-
|
|
1087
|
-
|
|
1023
|
+
c(this, bt);
|
|
1024
|
+
c(this, it, -1);
|
|
1088
1025
|
x(this, "count", /* @__PURE__ */ a(() => t(this, bt).rawRecords.length, "count"));
|
|
1089
1026
|
b(this, bt, i);
|
|
1090
1027
|
}
|
|
@@ -1096,29 +1033,29 @@ const le = class le {
|
|
|
1096
1033
|
});
|
|
1097
1034
|
}
|
|
1098
1035
|
};
|
|
1099
|
-
bt = new WeakMap(), it = new WeakMap(), a(
|
|
1100
|
-
let
|
|
1101
|
-
var
|
|
1036
|
+
bt = new WeakMap(), it = new WeakMap(), a(ce, "ngRow");
|
|
1037
|
+
let Jt = ce;
|
|
1038
|
+
var T, S, k, st, zt, z, Dt, U, gt, Bt, Nt, nt;
|
|
1102
1039
|
const L = class L {
|
|
1103
1040
|
constructor(i, e) {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
b(this,
|
|
1112
|
-
const i = t(this,
|
|
1041
|
+
c(this, T);
|
|
1042
|
+
c(this, S);
|
|
1043
|
+
c(this, k, []);
|
|
1044
|
+
c(this, st, []);
|
|
1045
|
+
c(this, zt, 0);
|
|
1046
|
+
c(this, z, []);
|
|
1047
|
+
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
1048
|
+
b(this, z, []);
|
|
1049
|
+
const i = t(this, T).template || [];
|
|
1113
1050
|
Array.from(i).forEach((e) => {
|
|
1114
1051
|
var s;
|
|
1115
|
-
t(this,
|
|
1052
|
+
t(this, z).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1116
1053
|
}), (t(this, S).rawRecords || []).forEach((e) => {
|
|
1117
|
-
e.__ng || (e.__ng = t(this, gt).call(this)), e.__ng.height = t(this,
|
|
1054
|
+
e.__ng || (e.__ng = t(this, gt).call(this)), e.__ng.height = t(this, z).slice();
|
|
1118
1055
|
});
|
|
1119
1056
|
}, "#initialize"));
|
|
1120
|
-
|
|
1121
|
-
t(this,
|
|
1057
|
+
c(this, U, /* @__PURE__ */ a(() => {
|
|
1058
|
+
t(this, T).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1122
1059
|
i.invalidate();
|
|
1123
1060
|
});
|
|
1124
1061
|
}, "#invalidate"));
|
|
@@ -1128,7 +1065,7 @@ const L = class L {
|
|
|
1128
1065
|
if (!s || s.length <= 0) return;
|
|
1129
1066
|
if (i == null) return t(this, nt).call(this, s);
|
|
1130
1067
|
if (i < 0 || i >= s.length) return null;
|
|
1131
|
-
const o = typeof ((r = t(this,
|
|
1068
|
+
const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
1132
1069
|
if (e != null) {
|
|
1133
1070
|
const n = o.indexOf(e);
|
|
1134
1071
|
return n >= 0 ? s[i].v[n] : null;
|
|
@@ -1136,28 +1073,28 @@ const L = class L {
|
|
|
1136
1073
|
return t(this, nt).call(this, s[i]);
|
|
1137
1074
|
}, "get"));
|
|
1138
1075
|
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
1139
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1076
|
+
this.clear(), this.add(i, !1), t(this, U).call(this);
|
|
1140
1077
|
}, "set"));
|
|
1141
|
-
|
|
1078
|
+
c(this, gt, /* @__PURE__ */ a(() => ({
|
|
1142
1079
|
rowState: L.ROW_STATE.EMPTY,
|
|
1143
1080
|
deleted: !1,
|
|
1144
1081
|
filtered: !1,
|
|
1145
|
-
height: t(this,
|
|
1082
|
+
height: t(this, z).slice(),
|
|
1146
1083
|
o: {},
|
|
1147
1084
|
c: {},
|
|
1148
|
-
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1085
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, z).slice(), -1, {}, {}]
|
|
1149
1086
|
}), "#getDefaultMeta"));
|
|
1150
1087
|
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
1151
|
-
b(this,
|
|
1088
|
+
b(this, k, []), b(this, st, []), t(this, U).call(this);
|
|
1152
1089
|
}, "reset"));
|
|
1153
1090
|
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
1154
1091
|
var i;
|
|
1155
|
-
t(this, S).rawRecords = [], b(this,
|
|
1092
|
+
t(this, S).rawRecords = [], b(this, k, []), b(this, st, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1156
1093
|
}, "clear"));
|
|
1157
|
-
|
|
1094
|
+
c(this, Bt, /* @__PURE__ */ a((i) => {
|
|
1158
1095
|
var o;
|
|
1159
1096
|
Array.isArray(i) || (i = [i]);
|
|
1160
|
-
const e = typeof ((o = t(this,
|
|
1097
|
+
const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1161
1098
|
return i.forEach((r) => {
|
|
1162
1099
|
const n = { v: [] };
|
|
1163
1100
|
e.forEach((l) => {
|
|
@@ -1165,34 +1102,34 @@ const L = class L {
|
|
|
1165
1102
|
}), s.push(n);
|
|
1166
1103
|
}), s;
|
|
1167
1104
|
}, "#json2Array"));
|
|
1168
|
-
|
|
1105
|
+
c(this, Nt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1169
1106
|
e.__ng = t(this, gt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1170
1107
|
}), i), "#defaultInsert"));
|
|
1171
1108
|
x(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1172
1109
|
i === void 0 && (i = {});
|
|
1173
|
-
const s = t(this,
|
|
1110
|
+
const s = t(this, Bt).call(this, i);
|
|
1174
1111
|
t(this, S).rawRecords = t(this, S).rawRecords.concat(t(this, Nt).call(this, s)), this.resetRecords();
|
|
1175
1112
|
const o = this.count() - 1;
|
|
1176
1113
|
return e || s.forEach((r, n) => {
|
|
1177
1114
|
const l = t(this, S).rawRecords[o - n];
|
|
1178
1115
|
l && (l.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1179
|
-
}), t(this,
|
|
1116
|
+
}), t(this, U).call(this), o;
|
|
1180
1117
|
}, "add"));
|
|
1181
1118
|
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1182
1119
|
let e = [];
|
|
1183
1120
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, S).host.row.at] : e = [parseInt(i, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1184
|
-
if (t(this,
|
|
1185
|
-
const o = t(this,
|
|
1186
|
-
t(this,
|
|
1121
|
+
if (t(this, k)[s]) {
|
|
1122
|
+
const o = t(this, k)[s].__ng.rowid;
|
|
1123
|
+
t(this, k)[s].__ng.rowState === L.ROW_STATE.INSERT ? t(this, S).rawRecords = t(this, S).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, S).rawRecords.forEach((r) => {
|
|
1187
1124
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1188
1125
|
});
|
|
1189
1126
|
}
|
|
1190
|
-
}), this.resetRecords(), t(this,
|
|
1127
|
+
}), this.resetRecords(), t(this, U).call(this);
|
|
1191
1128
|
}, "delete"));
|
|
1192
1129
|
x(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1193
|
-
var
|
|
1130
|
+
var h;
|
|
1194
1131
|
i = parseInt(i, 10);
|
|
1195
|
-
const r = (typeof ((
|
|
1132
|
+
const r = (typeof ((h = t(this, T).fields) == null ? void 0 : h.get) == "function" ? t(this, T).fields.get() : []).indexOf(e);
|
|
1196
1133
|
if (r < 0) return;
|
|
1197
1134
|
const n = this.getValidData()[i];
|
|
1198
1135
|
if (!n) return;
|
|
@@ -1200,26 +1137,26 @@ const L = class L {
|
|
|
1200
1137
|
l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1201
1138
|
}, "setValue"));
|
|
1202
1139
|
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1203
|
-
b(this, st, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), b(this,
|
|
1140
|
+
b(this, st, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), b(this, k, t(this, S).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, S).rawRecords.forEach((i, e) => {
|
|
1204
1141
|
i.__ng.rowidx = e;
|
|
1205
|
-
}), t(this,
|
|
1142
|
+
}), t(this, k).forEach((i, e) => {
|
|
1206
1143
|
i.__ng.i = e;
|
|
1207
1144
|
});
|
|
1208
1145
|
}, "resetRecords"));
|
|
1209
|
-
x(this, "getValidData", /* @__PURE__ */ a(() => (t(this,
|
|
1210
|
-
|
|
1146
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (t(this, k).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, k)), "getValidData"));
|
|
1147
|
+
c(this, nt, /* @__PURE__ */ a((i) => {
|
|
1211
1148
|
var n;
|
|
1212
1149
|
if (!i) return i;
|
|
1213
|
-
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this,
|
|
1214
|
-
const
|
|
1150
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, T).fields) == null ? void 0 : n.get) == "function" ? t(this, T).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1151
|
+
const h = {};
|
|
1215
1152
|
return o.forEach((d, f) => {
|
|
1216
|
-
|
|
1217
|
-
}),
|
|
1153
|
+
h[d] = l.v ? l.v[f] : l[d];
|
|
1154
|
+
}), h.__ng = l.__ng, h;
|
|
1218
1155
|
});
|
|
1219
1156
|
return e ? r[0] : r;
|
|
1220
1157
|
}, "#conv"));
|
|
1221
1158
|
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1222
|
-
b(this,
|
|
1159
|
+
b(this, T, i), b(this, S, e), t(this, Dt).call(this);
|
|
1223
1160
|
}
|
|
1224
1161
|
get source() {
|
|
1225
1162
|
return t(this, nt).call(this, t(this, S).rawRecords);
|
|
@@ -1228,16 +1165,16 @@ const L = class L {
|
|
|
1228
1165
|
this.clear(), this.add(i, !1);
|
|
1229
1166
|
}
|
|
1230
1167
|
get nextId() {
|
|
1231
|
-
return ++
|
|
1168
|
+
return ++ye(this, zt)._;
|
|
1232
1169
|
}
|
|
1233
1170
|
get length() {
|
|
1234
|
-
return t(this,
|
|
1171
|
+
return t(this, k).length;
|
|
1235
1172
|
}
|
|
1236
1173
|
getRowCount() {
|
|
1237
1174
|
return this.length;
|
|
1238
1175
|
}
|
|
1239
1176
|
};
|
|
1240
|
-
|
|
1177
|
+
T = new WeakMap(), S = new WeakMap(), k = new WeakMap(), st = new WeakMap(), zt = new WeakMap(), z = new WeakMap(), Dt = new WeakMap(), U = new WeakMap(), gt = new WeakMap(), Bt = new WeakMap(), Nt = new WeakMap(), nt = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1241
1178
|
x(L, "ROW_STATE", {
|
|
1242
1179
|
EMPTY: "EMPTY",
|
|
1243
1180
|
NORMAL: "NORMAL",
|
|
@@ -1245,14 +1182,14 @@ x(L, "ROW_STATE", {
|
|
|
1245
1182
|
UPDATE: "UPDATE",
|
|
1246
1183
|
DELETE: "DELETE"
|
|
1247
1184
|
});
|
|
1248
|
-
let
|
|
1249
|
-
var
|
|
1250
|
-
const
|
|
1185
|
+
let Qt = L;
|
|
1186
|
+
var F;
|
|
1187
|
+
const he = class he {
|
|
1251
1188
|
constructor(i) {
|
|
1252
|
-
|
|
1253
|
-
b(this,
|
|
1189
|
+
c(this, F);
|
|
1190
|
+
b(this, F, i), this.row = new Jt(this), this.data = new Qt(t(this, F), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1254
1191
|
var e;
|
|
1255
|
-
(e = t(this,
|
|
1192
|
+
(e = t(this, F).view) != null && e.redraw && t(this, F).view.redraw();
|
|
1256
1193
|
}, this.setDataSource = (e) => {
|
|
1257
1194
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1258
1195
|
}, this.getRowState = (e) => {
|
|
@@ -1267,37 +1204,113 @@ const ae = class ae {
|
|
|
1267
1204
|
}, this.setDataSource([]);
|
|
1268
1205
|
}
|
|
1269
1206
|
};
|
|
1270
|
-
|
|
1271
|
-
let
|
|
1272
|
-
var
|
|
1273
|
-
const
|
|
1207
|
+
F = new WeakMap(), a(he, "ngDataManager");
|
|
1208
|
+
let te = he;
|
|
1209
|
+
var ot, R, yt, Pt;
|
|
1210
|
+
const de = class de {
|
|
1211
|
+
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1212
|
+
constructor(i) {
|
|
1213
|
+
c(this, ot);
|
|
1214
|
+
c(this, R, []);
|
|
1215
|
+
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1216
|
+
i.forEach((s) => {
|
|
1217
|
+
t(this, R).some((o) => o.name === s) || t(this, R).push({ name: s, type: e });
|
|
1218
|
+
}), t(this, yt).call(this);
|
|
1219
|
+
}, "add"));
|
|
1220
|
+
c(this, yt, /* @__PURE__ */ a(() => {
|
|
1221
|
+
const i = /* @__PURE__ */ new Map();
|
|
1222
|
+
t(this, R).forEach((e) => {
|
|
1223
|
+
i.set(e.name, e.type);
|
|
1224
|
+
}), b(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1225
|
+
}, "#adjust"));
|
|
1226
|
+
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
1227
|
+
b(this, R, []), D.log(t(this, ot).querySelectorAll("table"));
|
|
1228
|
+
const i = Array.from(t(this, ot).querySelectorAll("table"));
|
|
1229
|
+
if (!(!i || i.length === 0)) {
|
|
1230
|
+
for (const e of i)
|
|
1231
|
+
D.log(e), $("[data-bind]", e).each((s, o) => {
|
|
1232
|
+
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
1233
|
+
r && t(this, R).push({ name: r, type: n });
|
|
1234
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1235
|
+
$(`[${s}]`, e).each((o, r) => {
|
|
1236
|
+
var n = r.getAttribute(s);
|
|
1237
|
+
if (n.indexOf("data.") < 0) {
|
|
1238
|
+
const l = n.search(/[(]/g);
|
|
1239
|
+
if (l > 0)
|
|
1240
|
+
try {
|
|
1241
|
+
n = String(window[n.substring(0, l).trim()]);
|
|
1242
|
+
} catch {
|
|
1243
|
+
n = "";
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
n.split("data.").forEach((l) => {
|
|
1247
|
+
if (l.trim() != "") {
|
|
1248
|
+
const h = l.search(/[^_A-Za-z0-9]/g);
|
|
1249
|
+
let d = "";
|
|
1250
|
+
h >= 0 ? d = l.substring(0, h) : n.startsWith("data.") && (d = l.replace("data.", "")), d && t(this, R).push({ name: d, type: "string" });
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
});
|
|
1255
|
+
t(this, yt).call(this);
|
|
1256
|
+
}
|
|
1257
|
+
}, "#init"));
|
|
1258
|
+
b(this, ot, i), t(this, Pt).call(this);
|
|
1259
|
+
}
|
|
1260
|
+
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1261
|
+
get() {
|
|
1262
|
+
return t(this, R).map((i) => i.name);
|
|
1263
|
+
}
|
|
1264
|
+
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1265
|
+
getFields() {
|
|
1266
|
+
return t(this, R);
|
|
1267
|
+
}
|
|
1268
|
+
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1269
|
+
getType(i) {
|
|
1270
|
+
const e = t(this, R).find((s) => s.name === i);
|
|
1271
|
+
return e ? e.type : "string";
|
|
1272
|
+
}
|
|
1273
|
+
indexOf(i) {
|
|
1274
|
+
return t(this, R).findIndex((e) => e.name === i);
|
|
1275
|
+
}
|
|
1276
|
+
includes(i) {
|
|
1277
|
+
return t(this, R).some((e) => e.name === i);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
ot = new WeakMap(), R = new WeakMap(), yt = new WeakMap(), Pt = new WeakMap(), a(de, "ngFields");
|
|
1281
|
+
let ee = de;
|
|
1282
|
+
var K, Yt, Vt;
|
|
1283
|
+
const fe = class fe extends HTMLElement {
|
|
1274
1284
|
constructor() {
|
|
1275
1285
|
super();
|
|
1276
1286
|
//#created = false;
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1287
|
+
c(this, K);
|
|
1288
|
+
c(this, Yt);
|
|
1289
|
+
c(this, Vt, /* @__PURE__ */ a(() => {
|
|
1290
|
+
this.fields = new ee(this), b(this, Yt, new Gt(this)), D.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1291
|
+
}, "#init"));
|
|
1292
|
+
this.attachShadow({ mode: "open" }), b(this, K, new te(this));
|
|
1280
1293
|
}
|
|
1281
1294
|
connectedCallback() {
|
|
1282
|
-
|
|
1295
|
+
t(this, Vt).call(this);
|
|
1283
1296
|
}
|
|
1284
1297
|
disconnectedCallback() {
|
|
1285
|
-
|
|
1298
|
+
D.log("NineTable disconnected.");
|
|
1286
1299
|
}
|
|
1287
1300
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1288
1301
|
get data() {
|
|
1289
|
-
return t(this,
|
|
1302
|
+
return t(this, K).data;
|
|
1290
1303
|
}
|
|
1291
1304
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1292
1305
|
get row() {
|
|
1293
|
-
return t(this,
|
|
1306
|
+
return t(this, K).row;
|
|
1294
1307
|
}
|
|
1295
1308
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1296
1309
|
get dataManager() {
|
|
1297
|
-
return t(this,
|
|
1310
|
+
return t(this, K);
|
|
1298
1311
|
}
|
|
1299
1312
|
};
|
|
1300
|
-
|
|
1301
|
-
let
|
|
1302
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1313
|
+
K = new WeakMap(), Yt = new WeakMap(), Vt = new WeakMap(), a(fe, "NineTable");
|
|
1314
|
+
let ie = fe;
|
|
1315
|
+
customElements.get("nine-table") || customElements.define("nine-table", ie);
|
|
1303
1316
|
//# sourceMappingURL=nine-table.js.map
|