@ninebone/table 0.0.414 β 0.0.416
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 +352 -345
- 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
|
@@ -5,10 +5,10 @@ var me = (x) => {
|
|
|
5
5
|
var we = (x, i, e) => i in x ? pe(x, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : x[i] = e;
|
|
6
6
|
var a = (x, i) => pe(x, "name", { value: i, configurable: !0 });
|
|
7
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)),
|
|
8
|
+
var t = (x, i, e) => (xe(x, i, "read from private field"), e ? e.call(x) : i.get(x)), h = (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
9
|
var ve = (x, i, e, s) => ({
|
|
10
|
-
set _(
|
|
11
|
-
g(x, i,
|
|
10
|
+
set _(o) {
|
|
11
|
+
g(x, i, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(x, i, s);
|
|
@@ -23,91 +23,91 @@ const re = class re extends Se.constructor {
|
|
|
23
23
|
a(re, "Trace");
|
|
24
24
|
let jt = re;
|
|
25
25
|
const k = new jt();
|
|
26
|
-
var _, O, p,
|
|
26
|
+
var _, O, p, V, Y, X, Et, U, Rt;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
h(this, _);
|
|
31
|
+
h(this, O, !1);
|
|
32
|
+
h(this, p);
|
|
33
|
+
h(this, V);
|
|
34
|
+
h(this, Y);
|
|
35
|
+
h(this, X);
|
|
36
|
+
h(this, Et, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!t(this, _)) return;
|
|
38
38
|
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
-
e && (g(this,
|
|
39
|
+
e && (g(this, X, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!t(this, _) || !t(this, p) || t(this, O)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const o = t(this, p).track, r = t(this, p).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
48
48
|
if (l !== 0 && d > l)
|
|
49
|
-
|
|
49
|
+
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
n && (n.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const c = o.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(c * (l / d), c), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, b = d - l;
|
|
59
59
|
let y = 0;
|
|
60
|
-
b > 0 && (y = parseInt(u / b * (
|
|
61
|
-
const m =
|
|
60
|
+
b > 0 && (y = parseInt(u / b * (c - f), 10)), y < 0 && (y = 0);
|
|
61
|
+
const m = c - f;
|
|
62
62
|
y > m && (y = m), r.style.left = `${y}px`, k.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
h(this, U, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, p)) return !1;
|
|
66
|
-
const s = t(this, p).container,
|
|
67
|
-
if (!
|
|
68
|
-
const r = t(this, p).track.getBoundingClientRect(),
|
|
66
|
+
const s = t(this, p).container, o = s.querySelector("table");
|
|
67
|
+
if (!o) return !1;
|
|
68
|
+
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const d = r.width -
|
|
71
|
+
const d = r.width - n;
|
|
72
72
|
l > d && (l = d), l = parseInt(l, 10), t(this, p).thumb.style.left = `${l}px`, t(this, p).left.disabled = l === 0, t(this, p).right.disabled = l >= d - 1;
|
|
73
|
-
const
|
|
73
|
+
const c = s.clientWidth, u = o.scrollWidth - c;
|
|
74
74
|
return d > 0 && u > 0 && (s.scrollLeft = l / d * u), l > 0 && l < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
77
|
-
const e = /* @__PURE__ */ a((
|
|
78
|
-
clearInterval(t(this,
|
|
76
|
+
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
77
|
+
const e = /* @__PURE__ */ a((o) => {
|
|
78
|
+
clearInterval(t(this, V)), clearInterval(t(this, Y));
|
|
79
79
|
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const
|
|
83
|
-
t(this,
|
|
80
|
+
t(this, U).call(this, r + o), g(this, V, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, V)), g(this, Y, setInterval(() => {
|
|
82
|
+
const n = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, U).call(this, n + o) || clearInterval(t(this, Y));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, V)), clearInterval(t(this, Y));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, p).left.addEventListener(
|
|
91
|
-
}), t(this, p).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, p).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const r = t(this, p).track.getBoundingClientRect(),
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this, p).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
|
+
t(this, p).left.addEventListener(o, s), t(this, p).right.addEventListener(o, s), t(this, p).track.addEventListener(o, s);
|
|
91
|
+
}), t(this, p).left.addEventListener("mousedown", (o) => {
|
|
92
|
+
o.button === 0 && e(-20);
|
|
93
|
+
}), t(this, p).right.addEventListener("mousedown", (o) => {
|
|
94
|
+
o.button === 0 && e(20);
|
|
95
|
+
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (o) => {
|
|
96
|
+
if (o.button !== 0) return;
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const r = t(this, p).track.getBoundingClientRect(), n = t(this, p).thumb.clientWidth;
|
|
99
|
+
t(this, U).call(this, o.clientX - r.left - n / 2);
|
|
100
|
+
}), t(this, p).thumb.addEventListener("mousedown", (o) => {
|
|
101
|
+
if (o.button !== 0) return;
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), g(this, O, !0), this.shiftX = o.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
104
|
if (!t(this, O)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup",
|
|
106
|
+
t(this, U).call(this, l.clientX - d.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
+
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
@@ -190,61 +190,61 @@ const le = class le extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, O) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Rt).call(this), t(this, Et).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(),
|
|
201
|
+
_ = new WeakMap(), O = new WeakMap(), p = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), Et = new WeakMap(), U = new WeakMap(), Rt = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var F, Q, z, S, ht, dt, At;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
h(this, F);
|
|
209
|
+
h(this, Q);
|
|
210
|
+
h(this, z, !1);
|
|
211
|
+
h(this, S);
|
|
212
|
+
h(this, ht, 0);
|
|
213
|
+
h(this, dt, 0);
|
|
214
214
|
/**
|
|
215
215
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
218
|
k.log("refresh", t(this, z)), k.log("refresh2");
|
|
219
|
-
const e = t(this, S).container, s = t(this, S).track,
|
|
220
|
-
if (
|
|
221
|
-
|
|
219
|
+
const e = t(this, S).container, s = t(this, S).track, o = t(this, S).thumb, r = e.clientHeight, l = (t(this, F).data.get() || []).length, d = t(this, Q).getRowHeight(), c = l * d;
|
|
220
|
+
if (c <= r) {
|
|
221
|
+
o.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
222
222
|
return;
|
|
223
223
|
} else
|
|
224
|
-
|
|
224
|
+
o.style.display = "block";
|
|
225
225
|
const f = s.clientHeight;
|
|
226
226
|
if (f <= 0) return;
|
|
227
|
-
const u = Math.max(Math.min(f * (r /
|
|
228
|
-
|
|
229
|
-
const b = e.scrollTop, y = Math.max(
|
|
227
|
+
const u = Math.max(Math.min(f * (r / c), f), 20);
|
|
228
|
+
o.style.height = `${u}px`;
|
|
229
|
+
const b = e.scrollTop, y = Math.max(c - r, 1);
|
|
230
230
|
let m = 0;
|
|
231
231
|
y > 0 && (m = b / y * (f - u));
|
|
232
232
|
const R = f - u;
|
|
233
|
-
m < 0 && (m = 0), m > R && (m = R),
|
|
233
|
+
m < 0 && (m = 0), m > R && (m = R), o.style.top = `${m}px`, k.log("currentScrollTop", b), k.log("maxScrollTop", y), k.log("trackHeight", f), k.log("thumbHeight", u), t(this, S).top.disabled = b <= 0, t(this, S).bottom.disabled = b >= y - 1;
|
|
234
234
|
}, "refresh"));
|
|
235
|
-
|
|
235
|
+
h(this, At, /* @__PURE__ */ a(() => {
|
|
236
236
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
237
|
-
const r = (t(this,
|
|
238
|
-
return r *
|
|
237
|
+
const r = (t(this, F).data.get() || []).length, n = t(this, Q).getRowHeight();
|
|
238
|
+
return r * n;
|
|
239
239
|
}, "getContentHeight");
|
|
240
240
|
e.addEventListener("scroll", () => {
|
|
241
241
|
t(this, z) || this.refresh();
|
|
242
|
-
}), t(this, S).thumb.addEventListener("mousedown", (
|
|
243
|
-
if (
|
|
244
|
-
|
|
242
|
+
}), t(this, S).thumb.addEventListener("mousedown", (o) => {
|
|
243
|
+
if (o.button !== 0) return;
|
|
244
|
+
o.stopPropagation(), o.preventDefault(), g(this, z, !0), g(this, ht, o.clientY), g(this, dt, e.scrollTop);
|
|
245
245
|
const r = /* @__PURE__ */ a((l) => {
|
|
246
246
|
if (!t(this, z)) return;
|
|
247
|
-
const d = t(this, S).track.getBoundingClientRect(),
|
|
247
|
+
const d = t(this, S).track.getBoundingClientRect(), c = t(this, S).thumb.clientHeight, u = d.height - c, b = l.clientY - t(this, ht), y = e.clientHeight, m = s(), R = Math.max(m - y, 1);
|
|
248
248
|
if (u > 0 && R > 0) {
|
|
249
249
|
const J = b / u * R;
|
|
250
250
|
let at = t(this, dt) + J;
|
|
@@ -252,15 +252,15 @@ const ae = class ae extends HTMLElement {
|
|
|
252
252
|
at < 0 && (at = 0), at > ye && (at = ye), e.scrollTop = at;
|
|
253
253
|
}
|
|
254
254
|
this.refresh();
|
|
255
|
-
}, "onMouseMove"),
|
|
256
|
-
g(this, z, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup",
|
|
255
|
+
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
256
|
+
g(this, z, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
257
257
|
}, "onMouseUp");
|
|
258
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
259
|
-
}), t(this, S).track.addEventListener("mousedown", (
|
|
260
|
-
if (
|
|
261
|
-
const r = t(this, S).track.getBoundingClientRect(),
|
|
262
|
-
if (
|
|
263
|
-
const y = Math.max(0, Math.min(1, l /
|
|
258
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
259
|
+
}), t(this, S).track.addEventListener("mousedown", (o) => {
|
|
260
|
+
if (o.button !== 0 || o.target === t(this, S).thumb) return;
|
|
261
|
+
const r = t(this, S).track.getBoundingClientRect(), n = t(this, S).thumb.clientHeight, l = o.clientY - r.top - n / 2, c = r.height - n, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
262
|
+
if (c > 0 && b > 0) {
|
|
263
|
+
const y = Math.max(0, Math.min(1, l / c));
|
|
264
264
|
e.scrollTop = y * b;
|
|
265
265
|
}
|
|
266
266
|
this.refresh();
|
|
@@ -272,7 +272,7 @@ const ae = class ae extends HTMLElement {
|
|
|
272
272
|
}, "#init"));
|
|
273
273
|
}
|
|
274
274
|
connectedCallback() {
|
|
275
|
-
g(this,
|
|
275
|
+
g(this, F, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
276
276
|
<style>
|
|
277
277
|
nine-table-vscrollbar {
|
|
278
278
|
display: flex;
|
|
@@ -338,7 +338,7 @@ const ae = class ae extends HTMLElement {
|
|
|
338
338
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
339
339
|
`;
|
|
340
340
|
const e = /* @__PURE__ */ a(() => {
|
|
341
|
-
const s = t(this,
|
|
341
|
+
const s = t(this, F).shadowRoot.querySelector(".ng-container-body");
|
|
342
342
|
if (!s) {
|
|
343
343
|
setTimeout(e, 10);
|
|
344
344
|
return;
|
|
@@ -349,15 +349,15 @@ const ae = class ae extends HTMLElement {
|
|
|
349
349
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
350
350
|
top: this.querySelector(".ng-scroll-top"),
|
|
351
351
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
352
|
-
}), t(this,
|
|
352
|
+
}), t(this, At).call(this), this.refresh();
|
|
353
353
|
}, "initWhenReady");
|
|
354
354
|
e();
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
F = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), At = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
358
358
|
let Zt = ae;
|
|
359
359
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
360
|
-
var
|
|
360
|
+
var Tt, tt;
|
|
361
361
|
const M = class M {
|
|
362
362
|
/**
|
|
363
363
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
@@ -369,121 +369,121 @@ const M = class M {
|
|
|
369
369
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
370
370
|
*/
|
|
371
371
|
static compile(i) {
|
|
372
|
-
var
|
|
372
|
+
var o, r, n, l;
|
|
373
373
|
if (!i) return null;
|
|
374
374
|
const e = i.cloneNode(!0);
|
|
375
|
-
return t(
|
|
375
|
+
return t(o = M, Tt).call(o, e), t(r = M, tt).call(r, e, "thead"), t(n = M, tt).call(n, e, "tbody"), t(l = M, tt).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((d, c) => {
|
|
376
376
|
const f = d.getAttribute("fixed");
|
|
377
|
-
f && e.querySelectorAll(`thead [data-col="${
|
|
377
|
+
f && e.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((u) => {
|
|
378
378
|
u.setAttribute("fixed", f);
|
|
379
379
|
});
|
|
380
380
|
}), e;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
|
|
383
|
+
Tt = new WeakMap(), tt = new WeakMap(), a(M, "TableCompiler"), h(M, Tt, /* @__PURE__ */ a((i) => {
|
|
384
384
|
if (!i.querySelector("colgroup")) {
|
|
385
|
-
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1,
|
|
386
|
-
for (let
|
|
385
|
+
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);
|
|
386
|
+
for (let n = 0; n < s; n++) {
|
|
387
387
|
const l = document.createElement("col");
|
|
388
|
-
l.setAttribute("width", r),
|
|
388
|
+
l.setAttribute("width", r), o.appendChild(l);
|
|
389
389
|
}
|
|
390
|
-
i.prepend(
|
|
390
|
+
i.prepend(o);
|
|
391
391
|
}
|
|
392
392
|
if (!i.querySelector("thead")) {
|
|
393
393
|
const e = document.createElement("thead"), s = i.querySelector("colgroup");
|
|
394
394
|
s ? s.after(e) : i.prepend(e);
|
|
395
395
|
}
|
|
396
396
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
397
|
-
}, "#ensureTableStructure")),
|
|
398
|
-
const s = Array.from(i.querySelectorAll(e + " tr")),
|
|
399
|
-
if (r === 0 ||
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
|
|
397
|
+
}, "#ensureTableStructure")), h(M, tt, /* @__PURE__ */ a((i, e) => {
|
|
398
|
+
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
399
|
+
if (r === 0 || o.length === 0) return;
|
|
400
|
+
let n = 0;
|
|
401
|
+
o.forEach((d) => {
|
|
402
|
+
n += d.colSpan || 1;
|
|
403
403
|
});
|
|
404
|
-
const l = Array.from(Array(r), () => Array(
|
|
404
|
+
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
405
405
|
s.forEach((d) => {
|
|
406
|
-
const
|
|
406
|
+
const c = d.sectionRowIndex;
|
|
407
407
|
let f = 0;
|
|
408
408
|
Array.from(d.querySelectorAll("th,td")).forEach((u) => {
|
|
409
|
-
for (let m = 0; m < l[
|
|
410
|
-
if (l[
|
|
409
|
+
for (let m = 0; m < l[c].length; m++)
|
|
410
|
+
if (l[c][m] === null) {
|
|
411
411
|
f = m;
|
|
412
412
|
break;
|
|
413
413
|
}
|
|
414
414
|
const b = u.rowSpan || 1, y = u.colSpan || 1;
|
|
415
415
|
for (let m = 0; m < b; m++)
|
|
416
416
|
for (let R = 0; R < y; R++)
|
|
417
|
-
|
|
417
|
+
c + m < r && f + R < n && (l[c + m][f + R] = m === 0 && R === 0 ? "1" : "0");
|
|
418
418
|
});
|
|
419
419
|
}), s.forEach((d) => {
|
|
420
|
-
const
|
|
420
|
+
const c = d.sectionRowIndex;
|
|
421
421
|
Array.from(d.querySelectorAll("th,td")).forEach((f) => {
|
|
422
|
-
for (let u = 0; u < l[
|
|
423
|
-
if (l[
|
|
424
|
-
f.dataset.col = u, l[
|
|
422
|
+
for (let u = 0; u < l[c].length; u++)
|
|
423
|
+
if (l[c][u] === "1") {
|
|
424
|
+
f.dataset.col = u, l[c][u] = "0";
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
}, "#resetColIndex"));
|
|
430
430
|
let Gt = M;
|
|
431
|
-
var I, w, W, T, D,
|
|
431
|
+
var I, w, W, T, D, j, B, et, qt, kt, Lt, ft, ut, Ht, Ct, gt, $t, it, bt;
|
|
432
432
|
const ce = class ce {
|
|
433
433
|
constructor(i) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
h(this, I);
|
|
435
|
+
h(this, w);
|
|
436
|
+
h(this, W, /* @__PURE__ */ new Map());
|
|
437
|
+
h(this, T, null);
|
|
438
|
+
h(this, D, null);
|
|
439
|
+
h(this, j, 0);
|
|
440
|
+
h(this, B, 40);
|
|
441
|
+
h(this, et, !1);
|
|
442
|
+
h(this, qt, 3);
|
|
443
443
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
444
444
|
var e;
|
|
445
445
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
446
446
|
i && (t(this, ft).call(this), t(this, it).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
447
447
|
}, "refresh"));
|
|
448
448
|
v(this, "initialize", /* @__PURE__ */ a(() => {
|
|
449
|
-
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
450
|
-
const r = t(this, w).querySelector(
|
|
449
|
+
g(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
450
|
+
const r = t(this, w).querySelector(o);
|
|
451
451
|
if (!r) return;
|
|
452
|
-
const
|
|
453
|
-
if (!
|
|
454
|
-
const l =
|
|
452
|
+
const n = r.querySelector("table");
|
|
453
|
+
if (!n) return;
|
|
454
|
+
const l = n.querySelector("tbody.bindable-tbody");
|
|
455
455
|
if (!l) return;
|
|
456
|
-
const
|
|
457
|
-
t(this, W).set(
|
|
456
|
+
const c = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
457
|
+
t(this, W).set(o, c);
|
|
458
458
|
});
|
|
459
459
|
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");
|
|
460
460
|
if (i) {
|
|
461
|
-
t(this,
|
|
462
|
-
let
|
|
463
|
-
const r = /* @__PURE__ */ a((
|
|
461
|
+
t(this, Lt).call(this, i), t(this, gt).call(this), t(this, ft).call(this), t(this, it).call(this, i.scrollTop);
|
|
462
|
+
let o = i.scrollTop;
|
|
463
|
+
const r = /* @__PURE__ */ a((n) => {
|
|
464
464
|
var l;
|
|
465
|
-
e && e.scrollTop !==
|
|
465
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, it).call(this, n), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
466
466
|
}, "syncScroll");
|
|
467
467
|
i.addEventListener("scroll", () => {
|
|
468
|
-
const
|
|
469
|
-
|
|
468
|
+
const n = i.scrollTop;
|
|
469
|
+
o !== n && (o = n, r(n));
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}, "initialize"));
|
|
473
|
-
|
|
473
|
+
h(this, kt, /* @__PURE__ */ a((i, e) => {
|
|
474
474
|
const s = t(this, W).get(e);
|
|
475
475
|
if (!s || s.length === 0) return;
|
|
476
|
-
const
|
|
477
|
-
if (!
|
|
478
|
-
|
|
479
|
-
const r =
|
|
476
|
+
const o = i.querySelector("tbody.bindable-tbody");
|
|
477
|
+
if (!o) return;
|
|
478
|
+
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
479
|
+
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
480
480
|
for (let l = 0; l < t(this, B); l++)
|
|
481
481
|
s.forEach((d) => {
|
|
482
|
-
|
|
482
|
+
n.appendChild(d.cloneNode(!0));
|
|
483
483
|
});
|
|
484
|
-
r ? r.before(
|
|
484
|
+
r ? r.before(n) : o.appendChild(n);
|
|
485
485
|
}, "#renderRows"));
|
|
486
|
-
|
|
486
|
+
h(this, Lt, /* @__PURE__ */ a((i) => {
|
|
487
487
|
if (t(this, T) !== null && t(this, T) > 0)
|
|
488
488
|
return t(this, T);
|
|
489
489
|
const e = t(this, W).get(".ng-container-body");
|
|
@@ -491,78 +491,78 @@ const ce = class ce {
|
|
|
491
491
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
492
492
|
if (!s) return 24;
|
|
493
493
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
494
|
-
const
|
|
494
|
+
const o = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
495
495
|
e.forEach((b) => {
|
|
496
496
|
r.appendChild(b.cloneNode(!0));
|
|
497
|
-
}),
|
|
498
|
-
const
|
|
499
|
-
(l === "none" || window.getComputedStyle(
|
|
497
|
+
}), o ? o.before(r) : s.appendChild(r);
|
|
498
|
+
const n = t(this, w), l = n.style.display, d = n.style.visibility, c = n.style.position;
|
|
499
|
+
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
500
500
|
let f = 0;
|
|
501
501
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
502
502
|
return u.forEach((b) => {
|
|
503
503
|
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
504
|
-
}), u.forEach((b) => b.remove()),
|
|
504
|
+
}), u.forEach((b) => b.remove()), n.style.display = l, n.style.visibility = d, n.style.position = c, g(this, T, f > 0 ? f : 24), t(this, ut).call(this), t(this, T);
|
|
505
505
|
}, "#measureAndCacheHeight"));
|
|
506
|
-
|
|
506
|
+
h(this, ft, /* @__PURE__ */ a(() => {
|
|
507
507
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
508
|
-
const s = (t(this, I).data.get() || []).length,
|
|
509
|
-
k.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${
|
|
510
|
-
const l = t(this, w).querySelector(
|
|
508
|
+
const s = (t(this, I).data.get() || []).length, o = t(this, T) || 24, r = s * o;
|
|
509
|
+
k.log(`[VirtualHeight] totalCount: ${s}, rowHeight: ${o}, totalVirtualHeight: ${r}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
510
|
+
const l = t(this, w).querySelector(n), d = l == null ? void 0 : l.querySelector("table");
|
|
511
511
|
d && (d.style.height = `${r}px`);
|
|
512
512
|
});
|
|
513
513
|
}, "#updateVirtualScrollHeight"));
|
|
514
|
-
|
|
515
|
-
if ((t(this, I).data.get() || []).length, t(this,
|
|
516
|
-
const e = Math.ceil(t(this,
|
|
517
|
-
g(this, B, e + t(this,
|
|
514
|
+
h(this, ut, /* @__PURE__ */ a(() => {
|
|
515
|
+
if ((t(this, I).data.get() || []).length, t(this, j) > 0 && t(this, T) > 0) {
|
|
516
|
+
const e = Math.ceil(t(this, j) / t(this, T));
|
|
517
|
+
g(this, B, e + t(this, qt)), k.log("visibleRows:", e, "cachedRowCount:", t(this, B));
|
|
518
518
|
}
|
|
519
519
|
}, "#updateRowCount"));
|
|
520
|
-
|
|
521
|
-
var d,
|
|
520
|
+
h(this, Ht, /* @__PURE__ */ a(() => {
|
|
521
|
+
var d, c, f;
|
|
522
522
|
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");
|
|
523
523
|
if (!e) return;
|
|
524
|
-
const
|
|
524
|
+
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);
|
|
525
525
|
for (let u = 0; u < l; u++) {
|
|
526
526
|
const b = [
|
|
527
|
-
((d =
|
|
528
|
-
((
|
|
529
|
-
((f =
|
|
527
|
+
((d = o[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
528
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
529
|
+
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
530
530
|
], y = Math.max(...b);
|
|
531
|
-
y > 0 && (
|
|
531
|
+
y > 0 && (o[u] && (o[u].style.height = `${y}px`), r[u] && (r[u].style.height = `${y}px`), n[u] && (n[u].style.height = `${y}px`));
|
|
532
532
|
}
|
|
533
533
|
}, "#syncRowHeights"));
|
|
534
|
-
|
|
534
|
+
h(this, Ct, /* @__PURE__ */ a(() => {
|
|
535
535
|
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (g(this, D, new ResizeObserver((i) => {
|
|
536
536
|
for (const e of i) {
|
|
537
537
|
const s = e.target;
|
|
538
538
|
if (!s.classList.contains("active")) continue;
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
539
|
+
const o = e.contentRect.height;
|
|
540
|
+
if (o > 0) {
|
|
541
541
|
let r = 0;
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
const l = Math.max(
|
|
545
|
-
t(this,
|
|
542
|
+
const n = s.querySelector("thead");
|
|
543
|
+
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
544
|
+
const l = Math.max(o - r, 100);
|
|
545
|
+
t(this, j) !== l && (g(this, j, l), t(this, ut).call(this), t(this, T) !== null && t(this, gt).call(this));
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
})), t(this, D).observe(t(this, w)));
|
|
549
549
|
}, "#initResizeObserver"));
|
|
550
|
-
|
|
550
|
+
h(this, gt, /* @__PURE__ */ a(() => {
|
|
551
551
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
552
552
|
const e = t(this, w).querySelector(i);
|
|
553
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
554
|
-
}), t(this,
|
|
553
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, kt).call(this, e, i);
|
|
554
|
+
}), t(this, Ht).call(this);
|
|
555
555
|
}, "#renderAllContainers"));
|
|
556
|
-
|
|
556
|
+
h(this, $t, /* @__PURE__ */ a((i) => {
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
558
|
-
var
|
|
558
|
+
var c;
|
|
559
559
|
const s = t(this, w).querySelector(e);
|
|
560
560
|
if (!s) return;
|
|
561
|
-
const
|
|
562
|
-
if (!
|
|
563
|
-
const r = Array.from(
|
|
561
|
+
const o = s.querySelector("tbody.bindable-tbody");
|
|
562
|
+
if (!o) return;
|
|
563
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), n = ((c = t(this, W).get(e)) == null ? void 0 : c.length) || 1, d = (t(this, I).data.get() || []).length;
|
|
564
564
|
r.forEach((f, u) => {
|
|
565
|
-
const b = i + Math.floor(u /
|
|
565
|
+
const b = i + Math.floor(u / n);
|
|
566
566
|
if (b >= d) {
|
|
567
567
|
f.style.display = "none";
|
|
568
568
|
return;
|
|
@@ -572,19 +572,19 @@ const ce = class ce {
|
|
|
572
572
|
});
|
|
573
573
|
});
|
|
574
574
|
}, "#adjustBufferRows"));
|
|
575
|
-
|
|
575
|
+
h(this, it, /* @__PURE__ */ a((i) => {
|
|
576
576
|
var d;
|
|
577
577
|
const e = t(this, T);
|
|
578
578
|
if (!e || e <= 0) return;
|
|
579
|
-
const
|
|
580
|
-
k.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, B)}, targetDataIndex range: ${r} ~ ${l} (Total: ${
|
|
581
|
-
const f = t(this, w).querySelector(
|
|
579
|
+
const o = (t(this, I).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), n = ((d = t(this, W).get(".ng-container-body")) == null ? void 0 : d.length) || 1, l = r + t(this, B);
|
|
580
|
+
k.log(`[Scroll] scrollTop: ${i}, startIndex: ${r}, cachedRowCount: ${t(this, B)}, targetDataIndex range: ${r} ~ ${l} (Total: ${o})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
581
|
+
const f = t(this, w).querySelector(c);
|
|
582
582
|
if (!f) return;
|
|
583
583
|
const u = f.querySelector("tbody.bindable-tbody");
|
|
584
584
|
if (!u) return;
|
|
585
585
|
Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((y, m) => {
|
|
586
|
-
const R = r + Math.floor(m /
|
|
587
|
-
if (R >=
|
|
586
|
+
const R = r + Math.floor(m / n);
|
|
587
|
+
if (R >= o) {
|
|
588
588
|
y.style.display = "none";
|
|
589
589
|
return;
|
|
590
590
|
}
|
|
@@ -592,19 +592,19 @@ const ce = class ce {
|
|
|
592
592
|
y.style.display = "", t(this, bt).call(this, y, J, R);
|
|
593
593
|
});
|
|
594
594
|
}), t(this, et) || (g(this, et, !0), setTimeout(() => {
|
|
595
|
-
t(this,
|
|
595
|
+
t(this, $t).call(this, r), g(this, et, !1);
|
|
596
596
|
}, 0));
|
|
597
597
|
}, "#handleScroll"));
|
|
598
|
-
|
|
599
|
-
i.dataset.row = s, Array.from(i.cells).forEach((
|
|
600
|
-
const
|
|
601
|
-
|
|
598
|
+
h(this, bt, /* @__PURE__ */ a((i, e, s) => {
|
|
599
|
+
i.dataset.row = s, Array.from(i.cells).forEach((o, r) => {
|
|
600
|
+
const n = o.dataset.bind;
|
|
601
|
+
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;
|
|
602
602
|
});
|
|
603
603
|
}, "#bindRowData"));
|
|
604
604
|
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
605
605
|
t(this, D) && (t(this, D).disconnect(), g(this, D, null));
|
|
606
606
|
}, "destroy"));
|
|
607
|
-
g(this, I, i.getRootNode().host), g(this, w, i), t(this,
|
|
607
|
+
g(this, I, i.getRootNode().host), g(this, w, i), t(this, Ct).call(this);
|
|
608
608
|
}
|
|
609
609
|
getRowHeight() {
|
|
610
610
|
return t(this, T);
|
|
@@ -614,75 +614,82 @@ const ce = class ce {
|
|
|
614
614
|
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), D = new WeakMap(),
|
|
617
|
+
I = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), D = new WeakMap(), j = new WeakMap(), B = new WeakMap(), et = new WeakMap(), qt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), gt = new WeakMap(), $t = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), a(ce, "RowManager");
|
|
618
618
|
let Jt = ce;
|
|
619
|
-
var
|
|
619
|
+
var yt, st, N, Mt, _t, It, Wt, Ot;
|
|
620
620
|
const ct = class ct extends HTMLElement {
|
|
621
621
|
constructor() {
|
|
622
622
|
super();
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
623
|
+
h(this, yt);
|
|
624
|
+
h(this, st, null);
|
|
625
|
+
h(this, N);
|
|
626
626
|
/**
|
|
627
627
|
* data.set, add, delete
|
|
628
628
|
* filter, sorting : κ³ λ €λμ
|
|
629
629
|
*/
|
|
630
630
|
v(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
631
|
-
t(this,
|
|
631
|
+
t(this, N).refresh();
|
|
632
632
|
}, "invalidate"));
|
|
633
|
-
|
|
633
|
+
h(this, Mt, /* @__PURE__ */ a(() => {
|
|
634
634
|
[
|
|
635
635
|
{ selector: ".ng-container-body", type: null },
|
|
636
636
|
{ selector: ".ng-container-left", type: "left" },
|
|
637
637
|
{ selector: ".ng-container-right", type: "right" }
|
|
638
|
-
].forEach(({ selector: s, type:
|
|
638
|
+
].forEach(({ selector: s, type: o }) => {
|
|
639
639
|
const r = this.querySelector(s);
|
|
640
640
|
if (!r) return;
|
|
641
|
-
const
|
|
642
|
-
r.innerHTML = "", r.appendChild(
|
|
641
|
+
const n = t(this, It).call(this, t(this, st), o);
|
|
642
|
+
r.innerHTML = "", r.appendChild(n);
|
|
643
643
|
});
|
|
644
644
|
}, "#renderSplitContainers"));
|
|
645
|
-
|
|
645
|
+
h(this, _t, /* @__PURE__ */ a(() => {
|
|
646
646
|
["left", "right"].forEach((e) => {
|
|
647
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
648
|
-
if (!s || !
|
|
647
|
+
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
648
|
+
if (!s || !o) return;
|
|
649
649
|
let r = 0;
|
|
650
|
-
|
|
651
|
-
const l = parseInt(
|
|
650
|
+
o.querySelectorAll("col").forEach((n) => {
|
|
651
|
+
const l = parseInt(n.getAttribute("width"), 10);
|
|
652
652
|
isNaN(r) || (r += l);
|
|
653
653
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
654
654
|
});
|
|
655
655
|
}, "#updateContainerWidths"));
|
|
656
656
|
v(this, "generate", /* @__PURE__ */ a((e) => {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
var l, d;
|
|
658
|
+
if (!e) return;
|
|
659
|
+
g(this, st, Gt.compile(e)), t(this, st).style.display = "table", t(this, Mt).call(this), t(this, _t).call(this), requestAnimationFrame(() => {
|
|
660
|
+
var f;
|
|
661
|
+
const c = (f = this.querySelector("thead")) == null ? void 0 : f.getBoundingClientRect().height;
|
|
662
|
+
this.querySelectorAll("tbody.fixed-tbody").forEach((u) => {
|
|
663
|
+
u.style.top = `${c}px`;
|
|
662
664
|
});
|
|
663
|
-
}), t(this,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
665
|
+
}), t(this, N).initialize();
|
|
666
|
+
const o = (((d = (l = t(this, yt)) == null ? void 0 : l.data) == null ? void 0 : d.get()) || []).length, r = t(this, N).getRowHeight(), n = o * r;
|
|
667
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((c) => {
|
|
668
|
+
const f = this.querySelector(c), u = f == null ? void 0 : f.querySelector("table");
|
|
669
|
+
u && (u.style.height = `${n}px`, u.style.minHeight = `${n}px`);
|
|
670
|
+
}), setTimeout(() => {
|
|
671
|
+
var c;
|
|
672
|
+
(c = this.querySelector("nine-table-hscrollbar")) == null || c.refresh();
|
|
673
|
+
}, 0);
|
|
667
674
|
}, "generate"));
|
|
668
675
|
/**
|
|
669
676
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
670
677
|
*/
|
|
671
|
-
|
|
672
|
-
const
|
|
678
|
+
h(this, It, /* @__PURE__ */ a((e, s) => {
|
|
679
|
+
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
673
680
|
if (r) {
|
|
674
|
-
const
|
|
675
|
-
|
|
681
|
+
const n = document.createElement("tbody");
|
|
682
|
+
n.className = "fixed-tbody", r.className = "bindable-tbody", r.before(n);
|
|
676
683
|
}
|
|
677
|
-
return s === "left" ?
|
|
678
|
-
|
|
679
|
-
}) : s === "right" ?
|
|
680
|
-
|
|
681
|
-
}) :
|
|
682
|
-
|
|
683
|
-
}),
|
|
684
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((n) => {
|
|
685
|
+
n.getAttribute("fixed") !== "left" && n.remove();
|
|
686
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((n) => {
|
|
687
|
+
n.getAttribute("fixed") !== "right" && n.remove();
|
|
688
|
+
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((n) => {
|
|
689
|
+
n.remove();
|
|
690
|
+
}), o;
|
|
684
691
|
}, "#createSplitTable"));
|
|
685
|
-
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this,
|
|
692
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, N).getRowHeight(), "getRowHeight"));
|
|
686
693
|
v(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
687
694
|
const s = this.querySelector(".ng-container-body");
|
|
688
695
|
s && (s.scrollLeft = e);
|
|
@@ -691,10 +698,10 @@ const ct = class ct extends HTMLElement {
|
|
|
691
698
|
const s = this.querySelector(".ng-container-body");
|
|
692
699
|
s && (s.scrollTop = e);
|
|
693
700
|
}, "scrollToY"));
|
|
694
|
-
|
|
701
|
+
h(this, Wt, /* @__PURE__ */ a(() => {
|
|
695
702
|
t(this, Ot).call(this);
|
|
696
703
|
}, "#init"));
|
|
697
|
-
|
|
704
|
+
h(this, Ot, /* @__PURE__ */ a(() => {
|
|
698
705
|
const e = ct.SCROLLBAR_SIZE;
|
|
699
706
|
this.innerHTML = `
|
|
700
707
|
<style>
|
|
@@ -841,7 +848,7 @@ const ct = class ct extends HTMLElement {
|
|
|
841
848
|
</div>
|
|
842
849
|
`;
|
|
843
850
|
}, "#render"));
|
|
844
|
-
g(this,
|
|
851
|
+
g(this, N, new Jt(this)), g(this, yt, this.getRootNode().host);
|
|
845
852
|
}
|
|
846
853
|
connectedCallback() {
|
|
847
854
|
t(this, Wt).call(this);
|
|
@@ -850,23 +857,23 @@ const ct = class ct extends HTMLElement {
|
|
|
850
857
|
this.innerHTML = "", k.log("NineTableSheet destroyed.");
|
|
851
858
|
}
|
|
852
859
|
};
|
|
853
|
-
|
|
854
|
-
let
|
|
855
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
856
|
-
var zt,
|
|
860
|
+
yt = new WeakMap(), st = new WeakMap(), N = new WeakMap(), Mt = new WeakMap(), _t = new WeakMap(), It = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), a(ct, "NineTableSheet"), v(ct, "SCROLLBAR_SIZE", 16);
|
|
861
|
+
let St = ct;
|
|
862
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", St);
|
|
863
|
+
var zt, pt;
|
|
857
864
|
const he = class he extends HTMLElement {
|
|
858
865
|
constructor() {
|
|
859
866
|
super();
|
|
860
|
-
|
|
867
|
+
h(this, zt, /* @__PURE__ */ a(() => {
|
|
861
868
|
var e;
|
|
862
869
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
863
|
-
var
|
|
864
|
-
const
|
|
865
|
-
t(this,
|
|
866
|
-
}), t(this,
|
|
870
|
+
var n;
|
|
871
|
+
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
872
|
+
t(this, pt).call(this, r, o);
|
|
873
|
+
}), t(this, pt).call(this, 0, !1);
|
|
867
874
|
}, "#init"));
|
|
868
|
-
|
|
869
|
-
const
|
|
875
|
+
h(this, pt, /* @__PURE__ */ a((e, s = !1) => {
|
|
876
|
+
const o = /* @__PURE__ */ a(() => {
|
|
870
877
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
871
878
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
872
879
|
const b = f.filter((y) => y.classList.contains("active"));
|
|
@@ -874,7 +881,7 @@ const he = class he extends HTMLElement {
|
|
|
874
881
|
const m = parseInt(y.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), J = f[m + 1];
|
|
875
882
|
R && J && J.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
876
883
|
});
|
|
877
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"),
|
|
884
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), d = n.querySelectorAll("nine-table-sheet");
|
|
878
885
|
if (!l[e]) return;
|
|
879
886
|
if (!s)
|
|
880
887
|
l.forEach((f, u) => {
|
|
@@ -888,44 +895,44 @@ const he = class he extends HTMLElement {
|
|
|
888
895
|
if (f.classList.contains("active") && u.length <= 1)
|
|
889
896
|
return;
|
|
890
897
|
f.classList.toggle("active");
|
|
891
|
-
const b =
|
|
898
|
+
const b = n.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
892
899
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
893
900
|
}
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
f.style.flex =
|
|
897
|
-
}),
|
|
901
|
+
const c = n.querySelectorAll("nine-table-sheet.active");
|
|
902
|
+
c == null || c.forEach((f) => {
|
|
903
|
+
f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
904
|
+
}), o();
|
|
898
905
|
}, "#switchSheet"));
|
|
899
906
|
}
|
|
900
907
|
connectedCallback() {
|
|
901
908
|
t(this, zt).call(this);
|
|
902
909
|
}
|
|
903
910
|
};
|
|
904
|
-
zt = new WeakMap(),
|
|
911
|
+
zt = new WeakMap(), pt = new WeakMap(), a(he, "NineTableSheets");
|
|
905
912
|
let Qt = he;
|
|
906
913
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Qt);
|
|
907
|
-
var q, Dt,
|
|
914
|
+
var q, Dt, mt, Bt;
|
|
908
915
|
const de = class de {
|
|
909
916
|
constructor(i) {
|
|
910
|
-
|
|
911
|
-
|
|
917
|
+
h(this, q);
|
|
918
|
+
h(this, Dt, /* @__PURE__ */ a(() => {
|
|
912
919
|
t(this, Bt).call(this), new ResizeObserver((i) => {
|
|
913
920
|
for (let e of i)
|
|
914
|
-
t(this, q).getAttribute("auto-height") === "true" && t(this,
|
|
921
|
+
t(this, q).getAttribute("auto-height") === "true" && t(this, mt).call(this);
|
|
915
922
|
}).observe(t(this, q));
|
|
916
923
|
}, "#init"));
|
|
917
|
-
|
|
918
|
-
var d,
|
|
924
|
+
h(this, mt, /* @__PURE__ */ a(() => {
|
|
925
|
+
var d, c;
|
|
919
926
|
const i = Array.from(t(this, q).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
920
927
|
if (i.length === 0) return;
|
|
921
|
-
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())),
|
|
928
|
+
const e = parseInt(t(this, q).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (d = t(this, q).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (c = t(this, q).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, n = St.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
922
929
|
t(this, q).style.height = `${l}px`;
|
|
923
930
|
}, "#applyAutoHeight"));
|
|
924
|
-
|
|
925
|
-
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true",
|
|
926
|
-
const u = `<nine-table-sheet class="${
|
|
931
|
+
h(this, Bt, /* @__PURE__ */ a(() => {
|
|
932
|
+
const e = Array.from(t(this, q).children).filter((d) => d.tagName === "TABLE"), s = t(this, q).getAttribute("auto-height") === "true", o = e.length, r = e.map((d, c) => {
|
|
933
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < o - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
927
934
|
return u + b;
|
|
928
|
-
}).join(""),
|
|
935
|
+
}).join(""), n = e.map((d, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
929
936
|
t(this, q).shadowRoot.innerHTML = `
|
|
930
937
|
<style>
|
|
931
938
|
:host {
|
|
@@ -1009,7 +1016,7 @@ const de = class de {
|
|
|
1009
1016
|
<nine-table-sheets>
|
|
1010
1017
|
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1011
1018
|
<nine-table-sheets-footer>
|
|
1012
|
-
<div class="nine-tab-bar">${
|
|
1019
|
+
<div class="nine-tab-bar">${n}</div>
|
|
1013
1020
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1014
1021
|
</nine-table-sheets-footer>
|
|
1015
1022
|
</nine-table-sheets>
|
|
@@ -1018,24 +1025,24 @@ const de = class de {
|
|
|
1018
1025
|
<nine-table-footer></nine-table-footer>
|
|
1019
1026
|
`;
|
|
1020
1027
|
const l = t(this, q).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1021
|
-
l == null || l.forEach((d,
|
|
1022
|
-
e[
|
|
1023
|
-
d.generate(e[
|
|
1028
|
+
l == null || l.forEach((d, c) => {
|
|
1029
|
+
e[c] && setTimeout(() => {
|
|
1030
|
+
d.generate(e[c]), s && t(this, mt).call(this);
|
|
1024
1031
|
});
|
|
1025
1032
|
});
|
|
1026
1033
|
}, "#render"));
|
|
1027
1034
|
g(this, q, i), t(this, Dt).call(this);
|
|
1028
1035
|
}
|
|
1029
1036
|
};
|
|
1030
|
-
q = new WeakMap(), Dt = new WeakMap(),
|
|
1037
|
+
q = new WeakMap(), Dt = new WeakMap(), mt = new WeakMap(), Bt = new WeakMap(), a(de, "LayoutManager");
|
|
1031
1038
|
let te = de;
|
|
1032
|
-
var
|
|
1039
|
+
var xt, nt;
|
|
1033
1040
|
const fe = class fe {
|
|
1034
1041
|
constructor(i) {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
v(this, "count", /* @__PURE__ */ a(() => t(this,
|
|
1038
|
-
g(this,
|
|
1042
|
+
h(this, xt);
|
|
1043
|
+
h(this, nt, -1);
|
|
1044
|
+
v(this, "count", /* @__PURE__ */ a(() => t(this, xt).rawRecords.length, "count"));
|
|
1045
|
+
g(this, xt, i);
|
|
1039
1046
|
}
|
|
1040
1047
|
get at() {
|
|
1041
1048
|
return t(this, nt);
|
|
@@ -1045,28 +1052,28 @@ const fe = class fe {
|
|
|
1045
1052
|
});
|
|
1046
1053
|
}
|
|
1047
1054
|
};
|
|
1048
|
-
|
|
1055
|
+
xt = new WeakMap(), nt = new WeakMap(), a(fe, "ngRow");
|
|
1049
1056
|
let ee = fe;
|
|
1050
|
-
var L, E, H, ot, Nt,
|
|
1057
|
+
var L, E, H, ot, Nt, P, Pt, K, vt, Vt, Yt, rt;
|
|
1051
1058
|
const C = class C {
|
|
1052
1059
|
constructor(i, e) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
g(this,
|
|
1060
|
+
h(this, L);
|
|
1061
|
+
h(this, E);
|
|
1062
|
+
h(this, H, []);
|
|
1063
|
+
h(this, ot, []);
|
|
1064
|
+
h(this, Nt, 0);
|
|
1065
|
+
h(this, P, []);
|
|
1066
|
+
h(this, Pt, /* @__PURE__ */ a(() => {
|
|
1067
|
+
g(this, P, []);
|
|
1061
1068
|
const i = t(this, L).template || [];
|
|
1062
1069
|
Array.from(i).forEach((e) => {
|
|
1063
1070
|
var s;
|
|
1064
|
-
t(this,
|
|
1071
|
+
t(this, P).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1065
1072
|
}), (t(this, E).rawRecords || []).forEach((e) => {
|
|
1066
|
-
e.__ng || (e.__ng = t(this,
|
|
1073
|
+
e.__ng || (e.__ng = t(this, vt).call(this)), e.__ng.height = t(this, P).slice();
|
|
1067
1074
|
});
|
|
1068
1075
|
}, "#initialize"));
|
|
1069
|
-
|
|
1076
|
+
h(this, K, /* @__PURE__ */ a(() => {
|
|
1070
1077
|
t(this, L).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1071
1078
|
i.invalidate();
|
|
1072
1079
|
});
|
|
@@ -1077,24 +1084,24 @@ const C = class C {
|
|
|
1077
1084
|
if (!s || s.length <= 0) return;
|
|
1078
1085
|
if (i == null) return t(this, rt).call(this, s);
|
|
1079
1086
|
if (i < 0 || i >= s.length) return null;
|
|
1080
|
-
const
|
|
1087
|
+
const o = typeof ((r = t(this, L).fields) == null ? void 0 : r.get) == "function" ? t(this, L).fields.get() : [];
|
|
1081
1088
|
if (e != null) {
|
|
1082
|
-
const
|
|
1083
|
-
return
|
|
1089
|
+
const n = o.indexOf(e);
|
|
1090
|
+
return n >= 0 ? s[i].v[n] : null;
|
|
1084
1091
|
}
|
|
1085
1092
|
return t(this, rt).call(this, s[i]);
|
|
1086
1093
|
}, "get"));
|
|
1087
1094
|
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
1088
1095
|
this.clear(), this.add(i, !1), t(this, K).call(this);
|
|
1089
1096
|
}, "set"));
|
|
1090
|
-
|
|
1097
|
+
h(this, vt, /* @__PURE__ */ a(() => ({
|
|
1091
1098
|
rowState: C.ROW_STATE.EMPTY,
|
|
1092
1099
|
deleted: !1,
|
|
1093
1100
|
filtered: !1,
|
|
1094
|
-
height: t(this,
|
|
1101
|
+
height: t(this, P).slice(),
|
|
1095
1102
|
o: {},
|
|
1096
1103
|
c: {},
|
|
1097
|
-
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1104
|
+
_: [0, 0, 0, 0, C.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, P).slice(), -1, {}, {}]
|
|
1098
1105
|
}), "#getDefaultMeta"));
|
|
1099
1106
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
1100
1107
|
g(this, H, []), g(this, ot, []), t(this, K).call(this);
|
|
@@ -1103,37 +1110,37 @@ const C = class C {
|
|
|
1103
1110
|
var i;
|
|
1104
1111
|
t(this, E).rawRecords = [], g(this, H, []), g(this, ot, []), (i = t(this, E).viewRecords) != null && i.reset && t(this, E).viewRecords.reset();
|
|
1105
1112
|
}, "clear"));
|
|
1106
|
-
|
|
1107
|
-
var
|
|
1113
|
+
h(this, Vt, /* @__PURE__ */ a((i) => {
|
|
1114
|
+
var o;
|
|
1108
1115
|
Array.isArray(i) || (i = [i]);
|
|
1109
|
-
const e = typeof ((
|
|
1116
|
+
const e = typeof ((o = t(this, L).fields) == null ? void 0 : o.get) == "function" ? t(this, L).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1110
1117
|
return i.forEach((r) => {
|
|
1111
|
-
const
|
|
1118
|
+
const n = { v: [] };
|
|
1112
1119
|
e.forEach((l) => {
|
|
1113
|
-
|
|
1114
|
-
}), s.push(
|
|
1120
|
+
n.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1121
|
+
}), s.push(n);
|
|
1115
1122
|
}), s;
|
|
1116
1123
|
}, "#json2Array"));
|
|
1117
|
-
|
|
1118
|
-
e.__ng = t(this,
|
|
1124
|
+
h(this, Yt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1125
|
+
e.__ng = t(this, vt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = C.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1119
1126
|
}), i), "#defaultInsert"));
|
|
1120
1127
|
v(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1121
1128
|
i === void 0 && (i = {});
|
|
1122
1129
|
const s = t(this, Vt).call(this, i);
|
|
1123
1130
|
t(this, E).rawRecords = t(this, E).rawRecords.concat(t(this, Yt).call(this, s)), this.resetRecords();
|
|
1124
|
-
const
|
|
1125
|
-
return e || s.forEach((r,
|
|
1126
|
-
const l = t(this, E).rawRecords[
|
|
1131
|
+
const o = this.count() - 1;
|
|
1132
|
+
return e || s.forEach((r, n) => {
|
|
1133
|
+
const l = t(this, E).rawRecords[o - n];
|
|
1127
1134
|
l && (l.__ng.rowState = C.ROW_STATE.EMPTY);
|
|
1128
|
-
}), t(this, K).call(this),
|
|
1135
|
+
}), t(this, K).call(this), o;
|
|
1129
1136
|
}, "add"));
|
|
1130
1137
|
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1131
1138
|
let e = [];
|
|
1132
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((s,
|
|
1139
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, E).host.row.at] : e = [parseInt(i, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1133
1140
|
if (t(this, H)[s]) {
|
|
1134
|
-
const
|
|
1135
|
-
t(this, H)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !==
|
|
1136
|
-
r.__ng.rowid ===
|
|
1141
|
+
const o = t(this, H)[s].__ng.rowid;
|
|
1142
|
+
t(this, H)[s].__ng.rowState === C.ROW_STATE.INSERT ? t(this, E).rawRecords = t(this, E).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, E).rawRecords.forEach((r) => {
|
|
1143
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = C.ROW_STATE.DELETE);
|
|
1137
1144
|
});
|
|
1138
1145
|
}
|
|
1139
1146
|
}), this.resetRecords(), t(this, K).call(this);
|
|
@@ -1143,10 +1150,10 @@ const C = class C {
|
|
|
1143
1150
|
i = parseInt(i, 10);
|
|
1144
1151
|
const r = (typeof ((d = t(this, L).fields) == null ? void 0 : d.get) == "function" ? t(this, L).fields.get() : []).indexOf(e);
|
|
1145
1152
|
if (r < 0) return;
|
|
1146
|
-
const
|
|
1147
|
-
if (!
|
|
1148
|
-
const l =
|
|
1149
|
-
l !== s &&
|
|
1153
|
+
const n = this.getValidData()[i];
|
|
1154
|
+
if (!n) return;
|
|
1155
|
+
const l = n.v[r];
|
|
1156
|
+
l !== s && n.__ng.rowState !== C.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = C.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1150
1157
|
}, "setValue"));
|
|
1151
1158
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1152
1159
|
g(this, ot, t(this, E).rawRecords.filter((i) => !i.__ng.deleted)), g(this, H, t(this, E).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, E).rawRecords.forEach((i, e) => {
|
|
@@ -1156,13 +1163,13 @@ const C = class C {
|
|
|
1156
1163
|
});
|
|
1157
1164
|
}, "resetRecords"));
|
|
1158
1165
|
v(this, "getValidData", /* @__PURE__ */ a(() => (t(this, H).length === 0 && t(this, E).rawRecords.length > 0 && this.resetRecords(), t(this, H)), "getValidData"));
|
|
1159
|
-
|
|
1160
|
-
var
|
|
1166
|
+
h(this, rt, /* @__PURE__ */ a((i) => {
|
|
1167
|
+
var n;
|
|
1161
1168
|
if (!i) return i;
|
|
1162
|
-
const e = !Array.isArray(i), s = e ? [i] : i,
|
|
1169
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, L).fields) == null ? void 0 : n.get) == "function" ? t(this, L).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1163
1170
|
const d = {};
|
|
1164
|
-
return
|
|
1165
|
-
d[
|
|
1171
|
+
return o.forEach((c, f) => {
|
|
1172
|
+
d[c] = l.v ? l.v[f] : l[c];
|
|
1166
1173
|
}), d.__ng = l.__ng, d;
|
|
1167
1174
|
});
|
|
1168
1175
|
return e ? r[0] : r;
|
|
@@ -1186,7 +1193,7 @@ const C = class C {
|
|
|
1186
1193
|
return this.length;
|
|
1187
1194
|
}
|
|
1188
1195
|
};
|
|
1189
|
-
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(),
|
|
1196
|
+
L = new WeakMap(), E = new WeakMap(), H = new WeakMap(), ot = new WeakMap(), Nt = new WeakMap(), P = new WeakMap(), Pt = new WeakMap(), K = new WeakMap(), vt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), rt = new WeakMap(), a(C, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1190
1197
|
v(C, "ROW_STATE", {
|
|
1191
1198
|
EMPTY: "EMPTY",
|
|
1192
1199
|
NORMAL: "NORMAL",
|
|
@@ -1198,73 +1205,73 @@ let ie = C;
|
|
|
1198
1205
|
var Z;
|
|
1199
1206
|
const ue = class ue {
|
|
1200
1207
|
constructor(i) {
|
|
1201
|
-
|
|
1208
|
+
h(this, Z);
|
|
1202
1209
|
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 = () => {
|
|
1203
1210
|
var e;
|
|
1204
1211
|
(e = t(this, Z).view) != null && e.redraw && t(this, Z).view.redraw();
|
|
1205
1212
|
}, this.setDataSource = (e) => {
|
|
1206
1213
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1207
1214
|
}, this.getRowState = (e) => {
|
|
1208
|
-
var
|
|
1215
|
+
var o, r;
|
|
1209
1216
|
const s = parseInt(e, 10);
|
|
1210
1217
|
if (!(s >= this.data.count()))
|
|
1211
|
-
return (r = (
|
|
1218
|
+
return (r = (o = this.data.getValidData()[s]) == null ? void 0 : o.__ng) == null ? void 0 : r.rowState;
|
|
1212
1219
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1213
1220
|
this.row.at = e;
|
|
1214
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1215
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1221
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, o) => {
|
|
1222
|
+
e = parseInt(e, 10), this.data.setValue(e, s, o);
|
|
1216
1223
|
}, this.setDataSource([]);
|
|
1217
1224
|
}
|
|
1218
1225
|
};
|
|
1219
1226
|
Z = new WeakMap(), a(ue, "ngDataManager");
|
|
1220
1227
|
let se = ue;
|
|
1221
|
-
var lt, A,
|
|
1228
|
+
var lt, A, wt, Xt;
|
|
1222
1229
|
const ge = class ge {
|
|
1223
1230
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1224
1231
|
constructor(i) {
|
|
1225
|
-
|
|
1226
|
-
|
|
1232
|
+
h(this, lt);
|
|
1233
|
+
h(this, A, []);
|
|
1227
1234
|
v(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
1228
1235
|
i.forEach((s) => {
|
|
1229
|
-
t(this, A).some((
|
|
1230
|
-
}), t(this,
|
|
1236
|
+
t(this, A).some((o) => o.name === s) || t(this, A).push({ name: s, type: e });
|
|
1237
|
+
}), t(this, wt).call(this);
|
|
1231
1238
|
}, "add"));
|
|
1232
|
-
|
|
1239
|
+
h(this, wt, /* @__PURE__ */ a(() => {
|
|
1233
1240
|
const i = /* @__PURE__ */ new Map();
|
|
1234
1241
|
t(this, A).forEach((e) => {
|
|
1235
1242
|
i.set(e.name, e.type);
|
|
1236
1243
|
}), 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);
|
|
1237
1244
|
}, "#adjust"));
|
|
1238
|
-
|
|
1245
|
+
h(this, Xt, /* @__PURE__ */ a(() => {
|
|
1239
1246
|
g(this, A, []), k.log(t(this, lt).querySelectorAll("table"));
|
|
1240
1247
|
const i = Array.from(t(this, lt).querySelectorAll("table"));
|
|
1241
1248
|
if (!(!i || i.length === 0)) {
|
|
1242
1249
|
for (const e of i)
|
|
1243
|
-
k.log(e), $("[data-bind]", e).each((s,
|
|
1244
|
-
const r =
|
|
1245
|
-
r && t(this, A).push({ name: r, type:
|
|
1250
|
+
k.log(e), $("[data-bind]", e).each((s, o) => {
|
|
1251
|
+
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
1252
|
+
r && t(this, A).push({ name: r, type: n });
|
|
1246
1253
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1247
|
-
$(`[${s}]`, e).each((
|
|
1248
|
-
var
|
|
1249
|
-
if (
|
|
1250
|
-
const l =
|
|
1254
|
+
$(`[${s}]`, e).each((o, r) => {
|
|
1255
|
+
var n = r.getAttribute(s);
|
|
1256
|
+
if (n.indexOf("data.") < 0) {
|
|
1257
|
+
const l = n.search(/[(]/g);
|
|
1251
1258
|
if (l > 0)
|
|
1252
1259
|
try {
|
|
1253
|
-
|
|
1260
|
+
n = String(window[n.substring(0, l).trim()]);
|
|
1254
1261
|
} catch {
|
|
1255
|
-
|
|
1262
|
+
n = "";
|
|
1256
1263
|
}
|
|
1257
1264
|
}
|
|
1258
|
-
|
|
1265
|
+
n.split("data.").forEach((l) => {
|
|
1259
1266
|
if (l.trim() != "") {
|
|
1260
1267
|
const d = l.search(/[^_A-Za-z0-9]/g);
|
|
1261
|
-
let
|
|
1262
|
-
d >= 0 ?
|
|
1268
|
+
let c = "";
|
|
1269
|
+
d >= 0 ? c = l.substring(0, d) : n.startsWith("data.") && (c = l.replace("data.", "")), c && t(this, A).push({ name: c, type: "string" });
|
|
1263
1270
|
}
|
|
1264
1271
|
});
|
|
1265
1272
|
});
|
|
1266
1273
|
});
|
|
1267
|
-
t(this,
|
|
1274
|
+
t(this, wt).call(this);
|
|
1268
1275
|
}
|
|
1269
1276
|
}, "#init"));
|
|
1270
1277
|
g(this, lt, i), t(this, Xt).call(this);
|
|
@@ -1289,16 +1296,16 @@ const ge = class ge {
|
|
|
1289
1296
|
return t(this, A).some((e) => e.name === i);
|
|
1290
1297
|
}
|
|
1291
1298
|
};
|
|
1292
|
-
lt = new WeakMap(), A = new WeakMap(),
|
|
1299
|
+
lt = new WeakMap(), A = new WeakMap(), wt = new WeakMap(), Xt = new WeakMap(), a(ge, "ngFields");
|
|
1293
1300
|
let ne = ge;
|
|
1294
1301
|
var G, Ut, Ft;
|
|
1295
1302
|
const be = class be extends HTMLElement {
|
|
1296
1303
|
constructor() {
|
|
1297
1304
|
super();
|
|
1298
1305
|
//#created = false;
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1306
|
+
h(this, G);
|
|
1307
|
+
h(this, Ut);
|
|
1308
|
+
h(this, Ft, /* @__PURE__ */ a(() => {
|
|
1302
1309
|
this.fields = new ne(this), g(this, Ut, new te(this)), k.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1303
1310
|
}, "#init"));
|
|
1304
1311
|
this.attachShadow({ mode: "open" }), g(this, G, new se(this));
|