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