@ninebone/table 0.0.406 β 0.0.408
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 +186 -183
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- 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 pe = Object.defineProperty;
|
|
2
|
+
var me = (x) => {
|
|
3
3
|
throw TypeError(x);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (x, i) =>
|
|
7
|
-
var v = (x, i, e) =>
|
|
8
|
-
var t = (x, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var we = (x, i, e) => i in x ? pe(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
|
+
var a = (x, i) => pe(x, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (x, i, e) => we(x, typeof i != "symbol" ? i + "" : i, e), xe = (x, i, e) => i.has(x) || me("Cannot " + e);
|
|
8
|
+
var t = (x, i, e) => (xe(x, i, "read from private field"), e ? e.call(x) : i.get(x)), c = (x, i, e) => i.has(x) ? me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(x) : i.set(x, e), g = (x, i, e, s) => (xe(x, i, "write to private field"), s ? s.call(x, e) : i.set(x, e), e);
|
|
9
|
+
var ve = (x, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
g(x, i, n, e);
|
|
12
12
|
},
|
|
@@ -14,37 +14,37 @@ var me = (x, i, e, s) => ({
|
|
|
14
14
|
return t(x, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Se } from "@ninebone/util";
|
|
18
|
+
const re = class re extends Se.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(re, "Trace");
|
|
24
|
+
let jt = re;
|
|
25
|
+
const H = new jt();
|
|
26
|
+
var _, z, p, V, Y, X, St, U, Et;
|
|
27
|
+
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
c(this,
|
|
31
|
-
c(this,
|
|
30
|
+
c(this, _);
|
|
31
|
+
c(this, z, !1);
|
|
32
32
|
c(this, p);
|
|
33
33
|
c(this, V);
|
|
34
34
|
c(this, Y);
|
|
35
35
|
c(this, X);
|
|
36
|
-
c(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
c(this, St, /* @__PURE__ */ a(() => {
|
|
37
|
+
if (!t(this, _)) return;
|
|
38
|
+
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
39
|
e && (g(this, X, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, p) || t(this, z)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this, p).track, r = t(this, p).thumb, o = t(this,
|
|
47
|
+
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && d > l)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,7 +59,7 @@ const re = class re extends HTMLElement {
|
|
|
59
59
|
let y = 0;
|
|
60
60
|
b > 0 && (y = parseInt(u / b * (h - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const m = h - f;
|
|
62
|
-
y > m && (y = m), r.style.left = `${y}px`,
|
|
62
|
+
y > m && (y = m), r.style.left = `${y}px`, H.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
c(this, U, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
@@ -73,7 +73,7 @@ const re = class re extends HTMLElement {
|
|
|
73
73
|
const h = s.clientWidth, u = n.scrollWidth - h;
|
|
74
74
|
return d > 0 && u > 0 && (s.scrollLeft = l / d * u), l > 0 && l < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
c(this,
|
|
76
|
+
c(this, Et, /* @__PURE__ */ a(() => {
|
|
77
77
|
const e = /* @__PURE__ */ a((n) => {
|
|
78
78
|
clearInterval(t(this, V)), clearInterval(t(this, Y));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
@@ -99,20 +99,20 @@ const re = class re extends HTMLElement {
|
|
|
99
99
|
t(this, U).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, z, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, z)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
106
|
t(this, U).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
|
-
g(this,
|
|
108
|
+
g(this, z, !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);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (g(this,
|
|
115
|
+
if (g(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, _)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const re = class re extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ a(() => {
|
|
180
|
-
const s = t(this,
|
|
180
|
+
const s = t(this, _).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -189,8 +189,8 @@ const re = class re 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, z) || this.refresh();
|
|
193
|
+
}), t(this, Et).call(this), t(this, St).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
@@ -198,60 +198,63 @@ const re = class re extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
_ = new WeakMap(), z = new WeakMap(), p = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), St = new WeakMap(), U = new WeakMap(), Et = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
|
+
let Kt = le;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
+
var D, Q, O, S, ht, dt, Rt;
|
|
205
|
+
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
208
|
+
c(this, D);
|
|
209
209
|
c(this, Q);
|
|
210
|
-
c(this,
|
|
210
|
+
c(this, O, !1);
|
|
211
211
|
c(this, S);
|
|
212
|
-
c(this, ct, 0);
|
|
213
212
|
c(this, ht, 0);
|
|
213
|
+
c(this, dt, 0);
|
|
214
214
|
/**
|
|
215
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
if (!t(this,
|
|
219
|
-
|
|
218
|
+
if (H.log("refresh", t(this, O)), !t(this, D) || !t(this, S) || t(this, O)) return;
|
|
219
|
+
H.log("refresh2");
|
|
220
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this, D).data.get() || []).length, d = t(this, Q).getRowHeight(), h = l * d;
|
|
220
221
|
if (h <= r) {
|
|
221
222
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
223
|
return;
|
|
223
224
|
} else
|
|
224
225
|
n.style.display = "block";
|
|
225
226
|
const f = s.clientHeight;
|
|
226
|
-
if (
|
|
227
|
+
if (H.log(s, f, this, this.clientHeight), f <= 0) return;
|
|
227
228
|
const u = Math.max(Math.min(f * (r / h), f), 20);
|
|
228
229
|
n.style.height = `${u}px`;
|
|
229
230
|
const b = e.scrollTop, y = Math.max(h - r, 1);
|
|
230
231
|
let m = 0;
|
|
231
232
|
y > 0 && (m = b / y * (f - u));
|
|
232
233
|
const R = f - u;
|
|
233
|
-
m < 0 && (m = 0), m > R && (m = R), n.style.top = `${m}px`,
|
|
234
|
+
m < 0 && (m = 0), m > R && (m = R), n.style.top = `${m}px`, H.log(m), t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= y - 1;
|
|
234
235
|
}, "refresh"));
|
|
235
|
-
c(this,
|
|
236
|
+
c(this, Rt, /* @__PURE__ */ a(() => {
|
|
236
237
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
|
-
const r = (t(this,
|
|
238
|
+
const r = (t(this, D).data.get() || []).length, o = t(this, Q).getRowHeight();
|
|
238
239
|
return r * o;
|
|
239
240
|
}, "getContentHeight");
|
|
240
241
|
e.addEventListener("scroll", () => {
|
|
241
|
-
t(this,
|
|
242
|
+
t(this, O) || this.refresh();
|
|
242
243
|
}), t(this, S).thumb.addEventListener("mousedown", (n) => {
|
|
243
244
|
if (n.button !== 0) return;
|
|
244
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
245
|
+
n.stopPropagation(), n.preventDefault(), g(this, O, !0), g(this, ht, n.clientY), g(this, dt, e.scrollTop);
|
|
245
246
|
const r = /* @__PURE__ */ a((l) => {
|
|
246
|
-
if (!t(this,
|
|
247
|
-
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this,
|
|
247
|
+
if (!t(this, O)) return;
|
|
248
|
+
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this, ht), y = e.clientHeight, m = s(), R = Math.max(m - y, 1);
|
|
248
249
|
if (u > 0 && R > 0) {
|
|
249
250
|
const J = b / u * R;
|
|
250
|
-
t(this,
|
|
251
|
+
let at = t(this, dt) + J;
|
|
252
|
+
const ye = Math.max(0, m - y);
|
|
253
|
+
at < 0 && (at = 0), at > ye && (at = ye), e.scrollTop = at;
|
|
251
254
|
}
|
|
252
255
|
this.refresh();
|
|
253
256
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
254
|
-
g(this,
|
|
257
|
+
g(this, O, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
258
|
}, "onMouseUp");
|
|
256
259
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
257
260
|
}), t(this, S).track.addEventListener("mousedown", (n) => {
|
|
@@ -270,7 +273,7 @@ const le = class le extends HTMLElement {
|
|
|
270
273
|
}, "#init"));
|
|
271
274
|
}
|
|
272
275
|
connectedCallback() {
|
|
273
|
-
g(this,
|
|
276
|
+
g(this, D, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
277
|
<style>
|
|
275
278
|
nine-table-vscrollbar {
|
|
276
279
|
display: flex;
|
|
@@ -336,7 +339,7 @@ const le = class le extends HTMLElement {
|
|
|
336
339
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
337
340
|
`;
|
|
338
341
|
const e = /* @__PURE__ */ a(() => {
|
|
339
|
-
const s = t(this,
|
|
342
|
+
const s = t(this, D).shadowRoot.querySelector(".ng-container-body");
|
|
340
343
|
if (!s) {
|
|
341
344
|
setTimeout(e, 10);
|
|
342
345
|
return;
|
|
@@ -347,21 +350,21 @@ const le = class le extends HTMLElement {
|
|
|
347
350
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
348
351
|
top: this.querySelector(".ng-scroll-top"),
|
|
349
352
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
350
|
-
}), t(this,
|
|
353
|
+
}), t(this, Rt).call(this), this.refresh();
|
|
351
354
|
}, "initWhenReady");
|
|
352
355
|
e();
|
|
353
356
|
}
|
|
354
357
|
};
|
|
355
|
-
|
|
356
|
-
let
|
|
357
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
358
|
-
var
|
|
359
|
-
const
|
|
358
|
+
D = new WeakMap(), Q = new WeakMap(), O = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Rt = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
359
|
+
let Zt = ae;
|
|
360
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
361
|
+
var At, tt;
|
|
362
|
+
const M = class M {
|
|
360
363
|
/**
|
|
361
364
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
362
365
|
*/
|
|
363
366
|
static compileAll(i) {
|
|
364
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
367
|
+
return Array.isArray(i) ? i.map((e) => M.compile(e)) : [];
|
|
365
368
|
}
|
|
366
369
|
/**
|
|
367
370
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -370,7 +373,7 @@ const _ = class _ {
|
|
|
370
373
|
var n, r, o, l;
|
|
371
374
|
if (!i) return null;
|
|
372
375
|
const e = i.cloneNode(!0);
|
|
373
|
-
return t(n =
|
|
376
|
+
return t(n = M, At).call(n, e), t(r = M, tt).call(r, e, "thead"), t(o = M, tt).call(o, e, "tbody"), t(l = M, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, h) => {
|
|
374
377
|
const f = d.getAttribute("fixed");
|
|
375
378
|
f && e.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((u) => {
|
|
376
379
|
u.setAttribute("fixed", f);
|
|
@@ -378,7 +381,7 @@ const _ = class _ {
|
|
|
378
381
|
}), e;
|
|
379
382
|
}
|
|
380
383
|
};
|
|
381
|
-
|
|
384
|
+
At = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), c(M, At, /* @__PURE__ */ a((i) => {
|
|
382
385
|
if (!i.querySelector("colgroup")) {
|
|
383
386
|
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);
|
|
384
387
|
for (let o = 0; o < s; o++) {
|
|
@@ -392,7 +395,7 @@ Rt = new WeakMap(), tt = new WeakMap(), a(_, "TableCompiler"), c(_, Rt, /* @__PU
|
|
|
392
395
|
s ? s.after(e) : i.prepend(e);
|
|
393
396
|
}
|
|
394
397
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
395
|
-
}, "#ensureTableStructure")), c(
|
|
398
|
+
}, "#ensureTableStructure")), c(M, tt, /* @__PURE__ */ a((i, e) => {
|
|
396
399
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
397
400
|
if (r === 0 || n.length === 0) return;
|
|
398
401
|
let o = 0;
|
|
@@ -425,9 +428,9 @@ Rt = new WeakMap(), tt = new WeakMap(), a(_, "TableCompiler"), c(_, Rt, /* @__PU
|
|
|
425
428
|
});
|
|
426
429
|
});
|
|
427
430
|
}, "#resetColIndex"));
|
|
428
|
-
let
|
|
429
|
-
var I, w, W, T, B, F, N, et,
|
|
430
|
-
const
|
|
431
|
+
let Gt = M;
|
|
432
|
+
var I, w, W, T, B, F, N, et, Tt, qt, kt, ft, ut, Lt, Ht, gt, Ct, it, bt;
|
|
433
|
+
const ce = class ce {
|
|
431
434
|
constructor(i) {
|
|
432
435
|
c(this, I);
|
|
433
436
|
c(this, w);
|
|
@@ -437,11 +440,11 @@ const ae = class ae {
|
|
|
437
440
|
c(this, F, 0);
|
|
438
441
|
c(this, N, 40);
|
|
439
442
|
c(this, et, !1);
|
|
440
|
-
c(this,
|
|
443
|
+
c(this, Tt, 3);
|
|
441
444
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
442
445
|
var e;
|
|
443
446
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
444
|
-
i && (t(this,
|
|
447
|
+
i && (t(this, ft).call(this), t(this, it).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
445
448
|
}, "refresh"));
|
|
446
449
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
447
450
|
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -456,7 +459,7 @@ const ae = class ae {
|
|
|
456
459
|
});
|
|
457
460
|
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");
|
|
458
461
|
if (i) {
|
|
459
|
-
t(this,
|
|
462
|
+
t(this, kt).call(this, i), t(this, gt).call(this), t(this, ft).call(this), t(this, it).call(this, i.scrollTop);
|
|
460
463
|
let n = i.scrollTop;
|
|
461
464
|
const r = /* @__PURE__ */ a((o) => {
|
|
462
465
|
var l;
|
|
@@ -468,7 +471,7 @@ const ae = class ae {
|
|
|
468
471
|
});
|
|
469
472
|
}
|
|
470
473
|
}, "initialize"));
|
|
471
|
-
c(this,
|
|
474
|
+
c(this, qt, /* @__PURE__ */ a((i, e) => {
|
|
472
475
|
const s = t(this, W).get(e);
|
|
473
476
|
if (!s || s.length === 0) return;
|
|
474
477
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
@@ -481,7 +484,7 @@ const ae = class ae {
|
|
|
481
484
|
});
|
|
482
485
|
r ? r.before(o) : n.appendChild(o);
|
|
483
486
|
}, "#renderRows"));
|
|
484
|
-
c(this,
|
|
487
|
+
c(this, kt, /* @__PURE__ */ a((i) => {
|
|
485
488
|
if (t(this, T) !== null && t(this, T) > 0)
|
|
486
489
|
return t(this, T);
|
|
487
490
|
const e = t(this, W).get(".ng-container-body");
|
|
@@ -499,23 +502,23 @@ const ae = class ae {
|
|
|
499
502
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
500
503
|
return u.forEach((b) => {
|
|
501
504
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
502
|
-
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this,
|
|
505
|
+
}), u.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = d, o.style.position = h, g(this, T, f > 0 ? f : 24), t(this, ut).call(this), t(this, T);
|
|
503
506
|
}, "#measureAndCacheHeight"));
|
|
504
|
-
c(this,
|
|
507
|
+
c(this, ft, /* @__PURE__ */ a(() => {
|
|
505
508
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
506
509
|
const s = (t(this, I).data.get() || []).length, n = t(this, T) || 24, r = s * n;
|
|
507
|
-
|
|
510
|
+
H.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${n}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
508
511
|
const l = t(this, w).querySelector(o), d = l == null ? void 0 : l.querySelector("table");
|
|
509
512
|
d && (d.style.height = `${r}px`);
|
|
510
513
|
});
|
|
511
514
|
}, "#updateVirtualScrollHeight"));
|
|
512
|
-
c(this,
|
|
515
|
+
c(this, ut, /* @__PURE__ */ a(() => {
|
|
513
516
|
if ((t(this, I).data.get() || []).length, t(this, F) > 0 && t(this, T) > 0) {
|
|
514
517
|
const e = Math.ceil(t(this, F) / t(this, T));
|
|
515
|
-
g(this, N, e + t(this,
|
|
518
|
+
g(this, N, e + t(this, Tt)), H.log("visibleRows:", e, "cachedRowCount:", t(this, N));
|
|
516
519
|
}
|
|
517
520
|
}, "#updateRowCount"));
|
|
518
|
-
c(this,
|
|
521
|
+
c(this, Lt, /* @__PURE__ */ a(() => {
|
|
519
522
|
var d, h, f;
|
|
520
523
|
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
524
|
if (!e) return;
|
|
@@ -529,7 +532,7 @@ const ae = class ae {
|
|
|
529
532
|
y > 0 && (n[u] && (n[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), o[u] && (o[u].style.height = `${y}px`));
|
|
530
533
|
}
|
|
531
534
|
}, "#syncRowHeights"));
|
|
532
|
-
c(this,
|
|
535
|
+
c(this, Ht, /* @__PURE__ */ a(() => {
|
|
533
536
|
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, B, new ResizeObserver((i) => {
|
|
534
537
|
for (const e of i) {
|
|
535
538
|
const s = e.target;
|
|
@@ -540,18 +543,18 @@ const ae = class ae {
|
|
|
540
543
|
const o = s.querySelector("thead");
|
|
541
544
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
542
545
|
const l = Math.max(n - r, 100);
|
|
543
|
-
t(this, F) !== l && (g(this, F, l), t(this,
|
|
546
|
+
t(this, F) !== l && (g(this, F, l), t(this, ut).call(this), t(this, T) !== null && t(this, gt).call(this));
|
|
544
547
|
}
|
|
545
548
|
}
|
|
546
549
|
})), t(this, B).observe(t(this, w)));
|
|
547
550
|
}, "#initResizeObserver"));
|
|
548
|
-
c(this,
|
|
551
|
+
c(this, gt, /* @__PURE__ */ a(() => {
|
|
549
552
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
550
553
|
const e = t(this, w).querySelector(i);
|
|
551
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
552
|
-
}), t(this,
|
|
554
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, qt).call(this, e, i);
|
|
555
|
+
}), t(this, Lt).call(this);
|
|
553
556
|
}, "#renderAllContainers"));
|
|
554
|
-
c(this,
|
|
557
|
+
c(this, Ct, /* @__PURE__ */ a((i) => {
|
|
555
558
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
556
559
|
var h;
|
|
557
560
|
const s = t(this, w).querySelector(e);
|
|
@@ -566,7 +569,7 @@ const ae = class ae {
|
|
|
566
569
|
return;
|
|
567
570
|
}
|
|
568
571
|
const y = t(this, I).data.get(b);
|
|
569
|
-
f.style.display = "", t(this,
|
|
572
|
+
f.style.display = "", t(this, bt).call(this, f, y, b);
|
|
570
573
|
});
|
|
571
574
|
});
|
|
572
575
|
}, "#adjustBufferRows"));
|
|
@@ -575,7 +578,7 @@ const ae = class ae {
|
|
|
575
578
|
const e = t(this, T);
|
|
576
579
|
if (!e || e <= 0) return;
|
|
577
580
|
const n = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, N);
|
|
578
|
-
|
|
581
|
+
H.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, N)}, targetDataIndex range: ${r} ~ ${l} (Total: ${n})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((h) => {
|
|
579
582
|
const f = t(this, w).querySelector(h);
|
|
580
583
|
if (!f) return;
|
|
581
584
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
@@ -587,13 +590,13 @@ const ae = class ae {
|
|
|
587
590
|
return;
|
|
588
591
|
}
|
|
589
592
|
const J = t(this, I).data.get(R);
|
|
590
|
-
y.style.display = "", t(this,
|
|
593
|
+
y.style.display = "", t(this, bt).call(this, y, J, R);
|
|
591
594
|
});
|
|
592
595
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
593
|
-
t(this,
|
|
596
|
+
t(this, Ct).call(this, r), g(this, et, !1);
|
|
594
597
|
}, 0));
|
|
595
598
|
}, "#handleScroll"));
|
|
596
|
-
c(this,
|
|
599
|
+
c(this, bt, /* @__PURE__ */ a((i, e, s) => {
|
|
597
600
|
i.dataset.row = s, Array.from(i.cells).forEach((n, r) => {
|
|
598
601
|
const o = n.dataset.bind;
|
|
599
602
|
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;
|
|
@@ -602,7 +605,7 @@ const ae = class ae {
|
|
|
602
605
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
603
606
|
t(this, B) && (t(this, B).disconnect(), g(this, B, null));
|
|
604
607
|
}, "destroy"));
|
|
605
|
-
g(this, I, i.getRootNode().host), g(this, w, i), t(this,
|
|
608
|
+
g(this, I, i.getRootNode().host), g(this, w, i), t(this, Ht).call(this);
|
|
606
609
|
}
|
|
607
610
|
getRowHeight() {
|
|
608
611
|
return t(this, T);
|
|
@@ -612,13 +615,13 @@ const ae = class ae {
|
|
|
612
615
|
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
613
616
|
}
|
|
614
617
|
};
|
|
615
|
-
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), B = new WeakMap(), F = new WeakMap(), N = new WeakMap(), et = new WeakMap(),
|
|
616
|
-
let
|
|
617
|
-
var
|
|
618
|
-
const
|
|
618
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), B = new WeakMap(), F = new WeakMap(), N = new WeakMap(), et = new WeakMap(), Tt = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), gt = new WeakMap(), Ct = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), a(ce, "RowManager");
|
|
619
|
+
let Jt = ce;
|
|
620
|
+
var Mt, st, j, _t, $t, It, Wt, Ot;
|
|
621
|
+
const ct = class ct extends HTMLElement {
|
|
619
622
|
constructor() {
|
|
620
623
|
super();
|
|
621
|
-
c(this,
|
|
624
|
+
c(this, Mt);
|
|
622
625
|
c(this, st, null);
|
|
623
626
|
c(this, j);
|
|
624
627
|
/**
|
|
@@ -636,7 +639,7 @@ const at = class at extends HTMLElement {
|
|
|
636
639
|
].forEach(({ selector: s, type: n }) => {
|
|
637
640
|
const r = this.querySelector(s);
|
|
638
641
|
if (!r) return;
|
|
639
|
-
const o = t(this,
|
|
642
|
+
const o = t(this, It).call(this, t(this, st), n);
|
|
640
643
|
r.innerHTML = "", r.appendChild(o);
|
|
641
644
|
});
|
|
642
645
|
}, "#renderSplitContainers"));
|
|
@@ -652,7 +655,7 @@ const at = class at extends HTMLElement {
|
|
|
652
655
|
});
|
|
653
656
|
}, "#updateContainerWidths"));
|
|
654
657
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
655
|
-
e && (g(this, st,
|
|
658
|
+
e && (g(this, st, Gt.compile(e)), t(this, st).style.display = "table", t(this, _t).call(this), t(this, $t).call(this), requestAnimationFrame(() => {
|
|
656
659
|
var n;
|
|
657
660
|
const s = (n = this.querySelector("thead")) == null ? void 0 : n.getBoundingClientRect().height;
|
|
658
661
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
@@ -666,7 +669,7 @@ const at = class at extends HTMLElement {
|
|
|
666
669
|
/**
|
|
667
670
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
668
671
|
*/
|
|
669
|
-
c(this,
|
|
672
|
+
c(this, It, /* @__PURE__ */ a((e, s) => {
|
|
670
673
|
const n = e.cloneNode(!0), r = n.querySelector("tbody");
|
|
671
674
|
if (r) {
|
|
672
675
|
const o = document.createElement("tbody");
|
|
@@ -689,11 +692,11 @@ const at = class at extends HTMLElement {
|
|
|
689
692
|
const s = this.querySelector(".ng-container-body");
|
|
690
693
|
s && (s.scrollTop = e);
|
|
691
694
|
}, "scrollToY"));
|
|
692
|
-
c(this, It, /* @__PURE__ */ a(() => {
|
|
693
|
-
t(this, Wt).call(this);
|
|
694
|
-
}, "#init"));
|
|
695
695
|
c(this, Wt, /* @__PURE__ */ a(() => {
|
|
696
|
-
|
|
696
|
+
t(this, Ot).call(this);
|
|
697
|
+
}, "#init"));
|
|
698
|
+
c(this, Ot, /* @__PURE__ */ a(() => {
|
|
699
|
+
const e = ct.SCROLLBAR_SIZE;
|
|
697
700
|
this.innerHTML = `
|
|
698
701
|
<style>
|
|
699
702
|
nine-table-sheet {
|
|
@@ -839,31 +842,31 @@ const at = class at extends HTMLElement {
|
|
|
839
842
|
</div>
|
|
840
843
|
`;
|
|
841
844
|
}, "#render"));
|
|
842
|
-
g(this, j, new
|
|
845
|
+
g(this, j, new Jt(this)), g(this, Mt, this.getRootNode().host);
|
|
843
846
|
}
|
|
844
847
|
connectedCallback() {
|
|
845
|
-
t(this,
|
|
848
|
+
t(this, Wt).call(this);
|
|
846
849
|
}
|
|
847
850
|
disconnectedCallback() {
|
|
848
|
-
this.innerHTML = "",
|
|
851
|
+
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
849
852
|
}
|
|
850
853
|
};
|
|
851
|
-
|
|
852
|
-
let
|
|
853
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
854
|
-
var
|
|
855
|
-
const
|
|
854
|
+
Mt = new WeakMap(), st = new WeakMap(), j = new WeakMap(), _t = new WeakMap(), $t = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(ct, "NineTableSheet"), v(ct, "SCROLLBAR_SIZE", 16);
|
|
855
|
+
let wt = ct;
|
|
856
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", wt);
|
|
857
|
+
var zt, yt;
|
|
858
|
+
const he = class he extends HTMLElement {
|
|
856
859
|
constructor() {
|
|
857
860
|
super();
|
|
858
|
-
c(this,
|
|
861
|
+
c(this, zt, /* @__PURE__ */ a(() => {
|
|
859
862
|
var e;
|
|
860
863
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
861
864
|
var o;
|
|
862
865
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
863
|
-
t(this,
|
|
864
|
-
}), t(this,
|
|
866
|
+
t(this, yt).call(this, r, n);
|
|
867
|
+
}), t(this, yt).call(this, 0, !1);
|
|
865
868
|
}, "#init"));
|
|
866
|
-
c(this,
|
|
869
|
+
c(this, yt, /* @__PURE__ */ a((e, s = !1) => {
|
|
867
870
|
const n = /* @__PURE__ */ a(() => {
|
|
868
871
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
869
872
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
@@ -896,30 +899,30 @@ const ce = class ce extends HTMLElement {
|
|
|
896
899
|
}, "#switchSheet"));
|
|
897
900
|
}
|
|
898
901
|
connectedCallback() {
|
|
899
|
-
t(this,
|
|
902
|
+
t(this, zt).call(this);
|
|
900
903
|
}
|
|
901
904
|
};
|
|
902
|
-
|
|
903
|
-
let
|
|
904
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
905
|
-
var q,
|
|
906
|
-
const
|
|
905
|
+
zt = new WeakMap(), yt = new WeakMap(), a(he, "NineTableSheets");
|
|
906
|
+
let Qt = he;
|
|
907
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
908
|
+
var q, Dt, pt, Bt;
|
|
909
|
+
const de = class de {
|
|
907
910
|
constructor(i) {
|
|
908
911
|
c(this, q);
|
|
909
|
-
c(this,
|
|
910
|
-
t(this,
|
|
912
|
+
c(this, Dt, /* @__PURE__ */ a(() => {
|
|
913
|
+
t(this, Bt).call(this), new ResizeObserver((i) => {
|
|
911
914
|
for (let e of i)
|
|
912
|
-
t(this, q).getAttribute("auto-height") === "true" && t(this,
|
|
915
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, pt).call(this);
|
|
913
916
|
}).observe(t(this, q));
|
|
914
917
|
}, "#init"));
|
|
915
|
-
c(this,
|
|
918
|
+
c(this, pt, /* @__PURE__ */ a(() => {
|
|
916
919
|
var d, h;
|
|
917
920
|
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
918
921
|
if (i.length === 0) return;
|
|
919
|
-
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o =
|
|
922
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), n = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (h = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : h.getBoundingClientRect().height, o = wt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
920
923
|
t(this, q).style.height = `${l}px`;
|
|
921
924
|
}, "#applyAutoHeight"));
|
|
922
|
-
c(this,
|
|
925
|
+
c(this, Bt, /* @__PURE__ */ a(() => {
|
|
923
926
|
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", n = e.length, r = e.map((d, h) => {
|
|
924
927
|
const u = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, b = h < n - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
925
928
|
return u + b;
|
|
@@ -1018,22 +1021,22 @@ const he = class he {
|
|
|
1018
1021
|
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1019
1022
|
l == null || l.forEach((d, h) => {
|
|
1020
1023
|
e[h] && setTimeout(() => {
|
|
1021
|
-
d.generate(e[h]), s && t(this,
|
|
1024
|
+
d.generate(e[h]), s && t(this, pt).call(this);
|
|
1022
1025
|
});
|
|
1023
1026
|
});
|
|
1024
1027
|
}, "#render"));
|
|
1025
|
-
g(this, q, i), t(this,
|
|
1028
|
+
g(this, q, i), t(this, Dt).call(this);
|
|
1026
1029
|
}
|
|
1027
1030
|
};
|
|
1028
|
-
q = new WeakMap(),
|
|
1029
|
-
let
|
|
1030
|
-
var
|
|
1031
|
-
const
|
|
1031
|
+
q = new WeakMap(), Dt = new WeakMap(), pt = new WeakMap(), Bt = new WeakMap(), a(de, "LayoutManager");
|
|
1032
|
+
let te = de;
|
|
1033
|
+
var mt, nt;
|
|
1034
|
+
const fe = class fe {
|
|
1032
1035
|
constructor(i) {
|
|
1033
|
-
c(this,
|
|
1036
|
+
c(this, mt);
|
|
1034
1037
|
c(this, nt, -1);
|
|
1035
|
-
v(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1036
|
-
g(this,
|
|
1038
|
+
v(this, "count", /* @__PURE__ */ a(() => t(this, mt).rawRecords.length, "count"));
|
|
1039
|
+
g(this, mt, i);
|
|
1037
1040
|
}
|
|
1038
1041
|
get at() {
|
|
1039
1042
|
return t(this, nt);
|
|
@@ -1043,25 +1046,25 @@ const de = class de {
|
|
|
1043
1046
|
});
|
|
1044
1047
|
}
|
|
1045
1048
|
};
|
|
1046
|
-
|
|
1047
|
-
let
|
|
1048
|
-
var k, E, L, ot,
|
|
1049
|
-
const
|
|
1049
|
+
mt = new WeakMap(), nt = new WeakMap(), a(fe, "ngRow");
|
|
1050
|
+
let ee = fe;
|
|
1051
|
+
var k, E, L, ot, Nt, P, Pt, K, xt, Vt, Yt, rt;
|
|
1052
|
+
const C = class C {
|
|
1050
1053
|
constructor(i, e) {
|
|
1051
1054
|
c(this, k);
|
|
1052
1055
|
c(this, E);
|
|
1053
1056
|
c(this, L, []);
|
|
1054
1057
|
c(this, ot, []);
|
|
1055
|
-
c(this,
|
|
1058
|
+
c(this, Nt, 0);
|
|
1056
1059
|
c(this, P, []);
|
|
1057
|
-
c(this,
|
|
1060
|
+
c(this, Pt, /* @__PURE__ */ a(() => {
|
|
1058
1061
|
g(this, P, []);
|
|
1059
1062
|
const i = t(this, k).template || [];
|
|
1060
1063
|
Array.from(i).forEach((e) => {
|
|
1061
1064
|
var s;
|
|
1062
1065
|
t(this, P).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1063
1066
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1064
|
-
e.__ng || (e.__ng = t(this,
|
|
1067
|
+
e.__ng || (e.__ng = t(this, xt).call(this)), e.__ng.height = t(this, P).slice();
|
|
1065
1068
|
});
|
|
1066
1069
|
}, "#initialize"));
|
|
1067
1070
|
c(this, K, /* @__PURE__ */ a(() => {
|
|
@@ -1085,14 +1088,14 @@ const H = class H {
|
|
|
1085
1088
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1086
1089
|
this.clear(), this.add(i, !1), t(this, K).call(this);
|
|
1087
1090
|
}, "set"));
|
|
1088
|
-
c(this,
|
|
1089
|
-
rowState:
|
|
1091
|
+
c(this, xt, /* @__PURE__ */ a(() => ({
|
|
1092
|
+
rowState: C.ROW_STATE.EMPTY,
|
|
1090
1093
|
deleted: !1,
|
|
1091
1094
|
filtered: !1,
|
|
1092
1095
|
height: t(this, P).slice(),
|
|
1093
1096
|
o: {},
|
|
1094
1097
|
c: {},
|
|
1095
|
-
_: [0, 0, 0, 0,
|
|
1098
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, P).slice(), -1, {}, {}]
|
|
1096
1099
|
}), "#getDefaultMeta"));
|
|
1097
1100
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1098
1101
|
g(this, L, []), g(this, ot, []), t(this, K).call(this);
|
|
@@ -1101,7 +1104,7 @@ const H = class H {
|
|
|
1101
1104
|
var i;
|
|
1102
1105
|
t(this, E).rawRecords = [], g(this, L, []), g(this, ot, []), (i = t(this, E).viewRecords) != null && i.reset && t(this, E).viewRecords.reset();
|
|
1103
1106
|
}, "clear"));
|
|
1104
|
-
c(this,
|
|
1107
|
+
c(this, Vt, /* @__PURE__ */ a((i) => {
|
|
1105
1108
|
var n;
|
|
1106
1109
|
Array.isArray(i) || (i = [i]);
|
|
1107
1110
|
const e = typeof ((n = t(this, k).fields) == null ? void 0 : n.get) == "function" ? t(this, k).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -1112,17 +1115,17 @@ const H = class H {
|
|
|
1112
1115
|
}), s.push(o);
|
|
1113
1116
|
}), s;
|
|
1114
1117
|
}, "#json2Array"));
|
|
1115
|
-
c(this,
|
|
1116
|
-
e.__ng = t(this,
|
|
1118
|
+
c(this, Yt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1119
|
+
e.__ng = t(this, xt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1117
1120
|
}), i), "#defaultInsert"));
|
|
1118
1121
|
v(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1119
1122
|
i === void 0 && (i = {});
|
|
1120
|
-
const s = t(this,
|
|
1121
|
-
t(this, E).rawRecords = t(this, E).rawRecords.concat(t(this,
|
|
1123
|
+
const s = t(this, Vt).call(this, i);
|
|
1124
|
+
t(this, E).rawRecords = t(this, E).rawRecords.concat(t(this, Yt).call(this, s)), this.resetRecords();
|
|
1122
1125
|
const n = this.count() - 1;
|
|
1123
1126
|
return e || s.forEach((r, o) => {
|
|
1124
1127
|
const l = t(this, E).rawRecords[n - o];
|
|
1125
|
-
l && (l.__ng.rowState =
|
|
1128
|
+
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1126
1129
|
}), t(this, K).call(this), n;
|
|
1127
1130
|
}, "add"));
|
|
1128
1131
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
@@ -1130,8 +1133,8 @@ const H = class H {
|
|
|
1130
1133
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((s, n) => n - s).forEach((s) => {
|
|
1131
1134
|
if (t(this, L)[s]) {
|
|
1132
1135
|
const n = t(this, L)[s].__ng.rowid;
|
|
1133
|
-
t(this, L)[s].__ng.rowState ===
|
|
1134
|
-
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1136
|
+
t(this, L)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !== n) : t(this, E).rawRecords.forEach((r) => {
|
|
1137
|
+
r.__ng.rowid === n && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1135
1138
|
});
|
|
1136
1139
|
}
|
|
1137
1140
|
}), this.resetRecords(), t(this, K).call(this);
|
|
@@ -1144,7 +1147,7 @@ const H = class H {
|
|
|
1144
1147
|
const o = this.getValidData()[i];
|
|
1145
1148
|
if (!o) return;
|
|
1146
1149
|
const l = o.v[r];
|
|
1147
|
-
l !== s && o.__ng.rowState !==
|
|
1150
|
+
l !== s && o.__ng.rowState !== C.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = C.ROW_STATE.UPDATE), o.v[r] = s;
|
|
1148
1151
|
}, "setValue"));
|
|
1149
1152
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1150
1153
|
g(this, ot, t(this, E).rawRecords.filter((i) => !i.__ng.deleted)), g(this, L, t(this, E).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, E).rawRecords.forEach((i, e) => {
|
|
@@ -1166,7 +1169,7 @@ const H = class H {
|
|
|
1166
1169
|
return e ? r[0] : r;
|
|
1167
1170
|
}, "#conv"));
|
|
1168
1171
|
v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1169
|
-
g(this, k, i), g(this, E, e), t(this,
|
|
1172
|
+
g(this, k, i), g(this, E, e), t(this, Pt).call(this);
|
|
1170
1173
|
}
|
|
1171
1174
|
get source() {
|
|
1172
1175
|
return t(this, rt).call(this, t(this, E).rawRecords);
|
|
@@ -1175,7 +1178,7 @@ const H = class H {
|
|
|
1175
1178
|
this.clear(), this.add(i, !1);
|
|
1176
1179
|
}
|
|
1177
1180
|
get nextId() {
|
|
1178
|
-
return ++
|
|
1181
|
+
return ++ve(this, Nt)._;
|
|
1179
1182
|
}
|
|
1180
1183
|
get length() {
|
|
1181
1184
|
return t(this, L).length;
|
|
@@ -1184,20 +1187,20 @@ const H = class H {
|
|
|
1184
1187
|
return this.length;
|
|
1185
1188
|
}
|
|
1186
1189
|
};
|
|
1187
|
-
k = new WeakMap(), E = new WeakMap(), L = new WeakMap(), ot = new WeakMap(),
|
|
1188
|
-
v(
|
|
1190
|
+
k = new WeakMap(), E = new WeakMap(), L = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), P = new WeakMap(), Pt = new WeakMap(), K = new WeakMap(), xt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1191
|
+
v(C, "ROW_STATE", {
|
|
1189
1192
|
EMPTY: "EMPTY",
|
|
1190
1193
|
NORMAL: "NORMAL",
|
|
1191
1194
|
INSERT: "INSERT",
|
|
1192
1195
|
UPDATE: "UPDATE",
|
|
1193
1196
|
DELETE: "DELETE"
|
|
1194
1197
|
});
|
|
1195
|
-
let
|
|
1198
|
+
let ie = C;
|
|
1196
1199
|
var Z;
|
|
1197
|
-
const
|
|
1200
|
+
const ue = class ue {
|
|
1198
1201
|
constructor(i) {
|
|
1199
1202
|
c(this, Z);
|
|
1200
|
-
g(this, Z, i), this.row = new
|
|
1203
|
+
g(this, Z, i), this.row = new ee(this), this.data = new ie(t(this, Z), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1201
1204
|
var e;
|
|
1202
1205
|
(e = t(this, Z).view) != null && e.redraw && t(this, Z).view.redraw();
|
|
1203
1206
|
}, this.setDataSource = (e) => {
|
|
@@ -1214,10 +1217,10 @@ const fe = class fe {
|
|
|
1214
1217
|
}, this.setDataSource([]);
|
|
1215
1218
|
}
|
|
1216
1219
|
};
|
|
1217
|
-
Z = new WeakMap(), a(
|
|
1218
|
-
let
|
|
1219
|
-
var lt, A,
|
|
1220
|
-
const
|
|
1220
|
+
Z = new WeakMap(), a(ue, "ngDataManager");
|
|
1221
|
+
let se = ue;
|
|
1222
|
+
var lt, A, vt, Xt;
|
|
1223
|
+
const ge = class ge {
|
|
1221
1224
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1222
1225
|
constructor(i) {
|
|
1223
1226
|
c(this, lt);
|
|
@@ -1225,20 +1228,20 @@ const ue = class ue {
|
|
|
1225
1228
|
v(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1226
1229
|
i.forEach((s) => {
|
|
1227
1230
|
t(this, A).some((n) => n.name === s) || t(this, A).push({ name: s, type: e });
|
|
1228
|
-
}), t(this,
|
|
1231
|
+
}), t(this, vt).call(this);
|
|
1229
1232
|
}, "add"));
|
|
1230
|
-
c(this,
|
|
1233
|
+
c(this, vt, /* @__PURE__ */ a(() => {
|
|
1231
1234
|
const i = /* @__PURE__ */ new Map();
|
|
1232
1235
|
t(this, A).forEach((e) => {
|
|
1233
1236
|
i.set(e.name, e.type);
|
|
1234
1237
|
}), g(this, A, Array.from(i, ([e, s]) => ({ name: e, type: s }))), g(this, A, t(this, A).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, A).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1235
1238
|
}, "#adjust"));
|
|
1236
|
-
c(this,
|
|
1237
|
-
g(this, A, []),
|
|
1239
|
+
c(this, Xt, /* @__PURE__ */ a(() => {
|
|
1240
|
+
g(this, A, []), H.log(t(this, lt).querySelectorAll("table"));
|
|
1238
1241
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1239
1242
|
if (!(!i || i.length === 0)) {
|
|
1240
1243
|
for (const e of i)
|
|
1241
|
-
|
|
1244
|
+
H.log(e), $("[data-bind]", e).each((s, n) => {
|
|
1242
1245
|
const r = n.dataset.bind, o = n.getAttribute("data-type") || "string";
|
|
1243
1246
|
r && t(this, A).push({ name: r, type: o });
|
|
1244
1247
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1262,10 +1265,10 @@ const ue = class ue {
|
|
|
1262
1265
|
});
|
|
1263
1266
|
});
|
|
1264
1267
|
});
|
|
1265
|
-
t(this,
|
|
1268
|
+
t(this, vt).call(this);
|
|
1266
1269
|
}
|
|
1267
1270
|
}, "#init"));
|
|
1268
|
-
g(this, lt, i), t(this,
|
|
1271
|
+
g(this, lt, i), t(this, Xt).call(this);
|
|
1269
1272
|
}
|
|
1270
1273
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1271
1274
|
get() {
|
|
@@ -1287,25 +1290,25 @@ const ue = class ue {
|
|
|
1287
1290
|
return t(this, A).some((e) => e.name === i);
|
|
1288
1291
|
}
|
|
1289
1292
|
};
|
|
1290
|
-
lt = new WeakMap(), A = new WeakMap(),
|
|
1291
|
-
let
|
|
1292
|
-
var G,
|
|
1293
|
-
const
|
|
1293
|
+
lt = new WeakMap(), A = new WeakMap(), vt = new WeakMap(), Xt = new WeakMap(), a(ge, "ngFields");
|
|
1294
|
+
let ne = ge;
|
|
1295
|
+
var G, Ut, Ft;
|
|
1296
|
+
const be = class be extends HTMLElement {
|
|
1294
1297
|
constructor() {
|
|
1295
1298
|
super();
|
|
1296
1299
|
//#created = false;
|
|
1297
1300
|
c(this, G);
|
|
1298
|
-
c(this,
|
|
1299
|
-
c(this,
|
|
1300
|
-
this.fields = new
|
|
1301
|
+
c(this, Ut);
|
|
1302
|
+
c(this, Ft, /* @__PURE__ */ a(() => {
|
|
1303
|
+
this.fields = new ne(this), g(this, Ut, new te(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1301
1304
|
}, "#init"));
|
|
1302
|
-
this.attachShadow({ mode: "open" }), g(this, G, new
|
|
1305
|
+
this.attachShadow({ mode: "open" }), g(this, G, new se(this));
|
|
1303
1306
|
}
|
|
1304
1307
|
connectedCallback() {
|
|
1305
|
-
t(this,
|
|
1308
|
+
t(this, Ft).call(this);
|
|
1306
1309
|
}
|
|
1307
1310
|
disconnectedCallback() {
|
|
1308
|
-
|
|
1311
|
+
H.log("NineTable disconnected.");
|
|
1309
1312
|
}
|
|
1310
1313
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1311
1314
|
get data() {
|
|
@@ -1320,7 +1323,7 @@ const ge = class ge extends HTMLElement {
|
|
|
1320
1323
|
return t(this, G);
|
|
1321
1324
|
}
|
|
1322
1325
|
};
|
|
1323
|
-
G = new WeakMap(),
|
|
1324
|
-
let
|
|
1325
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1326
|
+
G = new WeakMap(), Ut = new WeakMap(), Ft = new WeakMap(), a(be, "NineTable");
|
|
1327
|
+
let oe = be;
|
|
1328
|
+
customElements.get("nine-table") || customElements.define("nine-table", oe);
|
|
1326
1329
|
//# sourceMappingURL=nine-table.js.map
|