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