@ninebone/table 0.0.477 β 0.0.479
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 +295 -295
- 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
|
@@ -2,16 +2,16 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ye = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var Ue = (q,
|
|
6
|
-
var h = (q,
|
|
7
|
-
var A = (q,
|
|
8
|
-
var t = (q,
|
|
9
|
-
var Ke = (q,
|
|
10
|
-
set _(
|
|
11
|
-
y(q,
|
|
5
|
+
var Ue = (q, r, e) => r in q ? Fe(q, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[r] = e;
|
|
6
|
+
var h = (q, r) => Fe(q, "name", { value: r, configurable: !0 });
|
|
7
|
+
var A = (q, r, e) => Ue(q, typeof r != "symbol" ? r + "" : r, e), Ve = (q, r, e) => r.has(q) || Ye("Cannot " + e);
|
|
8
|
+
var t = (q, r, e) => (Ve(q, r, "read from private field"), e ? e.call(q) : r.get(q)), d = (q, r, e) => r.has(q) ? Ye("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(q) : r.set(q, e), y = (q, r, e, s) => (Ve(q, r, "write to private field"), s ? s.call(q, e) : r.set(q, e), e);
|
|
9
|
+
var Ke = (q, r, e, s) => ({
|
|
10
|
+
set _(i) {
|
|
11
|
+
y(q, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(q,
|
|
14
|
+
return t(q, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Xe } from "@ninebone/util";
|
|
@@ -23,13 +23,13 @@ const He = class He extends Xe.constructor {
|
|
|
23
23
|
h(He, "Trace");
|
|
24
24
|
let le = He;
|
|
25
25
|
const pt = new le();
|
|
26
|
-
var D, P,
|
|
26
|
+
var D, P, E, K, U, X, _t, Z, Nt;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, D);
|
|
31
31
|
d(this, P, !1);
|
|
32
|
-
d(this,
|
|
32
|
+
d(this, E);
|
|
33
33
|
d(this, K);
|
|
34
34
|
d(this, U);
|
|
35
35
|
d(this, X);
|
|
@@ -41,17 +41,17 @@ const Me = class Me extends HTMLElement {
|
|
|
41
41
|
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, D) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
44
|
+
if (!t(this, D) || !t(this, E) || t(this, P)) return;
|
|
45
|
+
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const i = t(this, E).track, n = t(this, E).thumb, o = t(this, D).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = i.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
@@ -59,50 +59,50 @@ const Me = class Me extends HTMLElement {
|
|
|
59
59
|
let g = 0;
|
|
60
60
|
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
g > m && (g = m), n.style.left = `${g}px`, t(this,
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, Z, /* @__PURE__ */ h((e) => {
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
67
|
-
if (!
|
|
68
|
-
const n = t(this,
|
|
65
|
+
if (!t(this, E)) return !1;
|
|
66
|
+
const s = t(this, E).container, i = s.querySelector("table");
|
|
67
|
+
if (!i) return !1;
|
|
68
|
+
const n = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = n.width - o;
|
|
72
|
-
a > c && (a = c), a = parseInt(a, 10), t(this,
|
|
73
|
-
const l = s.clientWidth, u =
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
+
const l = s.clientWidth, u = i.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
77
|
+
const e = /* @__PURE__ */ h((i) => {
|
|
78
78
|
clearInterval(t(this, K)), clearInterval(t(this, U));
|
|
79
|
-
const n = parseInt(t(this,
|
|
80
|
-
t(this, Z).call(this, n +
|
|
79
|
+
const n = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, Z).call(this, n + i), y(this, K, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, K)), y(this, U, setInterval(() => {
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this, Z).call(this, o +
|
|
82
|
+
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, Z).call(this, o + i) || clearInterval(t(this, U));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, K)), clearInterval(t(this, U));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
92
|
-
|
|
93
|
-
}), t(this,
|
|
94
|
-
|
|
95
|
-
}), t(this,
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const n = t(this,
|
|
99
|
-
t(this, Z).call(this,
|
|
100
|
-
}), t(this,
|
|
101
|
-
if (
|
|
102
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
|
+
t(this, E).left.addEventListener(i, s), t(this, E).right.addEventListener(i, s), t(this, E).track.addEventListener(i, s);
|
|
91
|
+
}), t(this, E).left.addEventListener("mousedown", (i) => {
|
|
92
|
+
i.button === 0 && e(-20);
|
|
93
|
+
}), t(this, E).right.addEventListener("mousedown", (i) => {
|
|
94
|
+
i.button === 0 && e(20);
|
|
95
|
+
}), t(this, E).left.addEventListener("touchstart", () => e(-20)), t(this, E).right.addEventListener("touchstart", () => e(20)), t(this, E).track.addEventListener("mousedown", (i) => {
|
|
96
|
+
if (i.button !== 0) return;
|
|
97
|
+
i.preventDefault();
|
|
98
|
+
const n = t(this, E).track.getBoundingClientRect(), o = t(this, E).thumb.clientWidth;
|
|
99
|
+
t(this, Z).call(this, i.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, E).thumb.addEventListener("mousedown", (i) => {
|
|
101
|
+
if (i.button !== 0) return;
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), y(this, P, !0), this.shiftX = i.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, P)) return;
|
|
105
|
-
const c = t(this,
|
|
105
|
+
const c = t(this, E).track.getBoundingClientRect();
|
|
106
106
|
t(this, Z).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
108
|
y(this, P, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
y(this,
|
|
185
|
+
y(this, E, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -198,7 +198,7 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
D = new WeakMap(), P = new WeakMap(),
|
|
201
|
+
D = new WeakMap(), P = new WeakMap(), E = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(), _t = new WeakMap(), Z = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ce = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ce);
|
|
204
204
|
var j, nt, G, R, wt, St, Wt;
|
|
@@ -213,21 +213,21 @@ const $e = class $e extends HTMLElement {
|
|
|
213
213
|
d(this, St, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, j) || !t(this, R)) return;
|
|
216
|
-
const e = t(this, R).container, s = t(this, R).track,
|
|
216
|
+
const e = t(this, R).container, s = t(this, R).track, i = t(this, R).thumb, n = e.clientHeight, a = (t(this, j).data.get() || []).length, c = t(this, nt).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
|
|
218
|
+
i.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
i.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
|
-
|
|
225
|
+
i.style.height = `${u}px`;
|
|
226
226
|
const b = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
g > 0 && (m = b / g * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > v && (m = v),
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, R).top.disabled = b <= 0, t(this, R).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
233
233
|
const e = t(this, R).container, s = /* @__PURE__ */ h(() => {
|
|
@@ -236,15 +236,15 @@ const $e = class $e extends HTMLElement {
|
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
238
|
t(this, G) || this.refresh();
|
|
239
|
-
}), t(this, R).thumb.addEventListener("mousedown", (
|
|
240
|
-
if (
|
|
241
|
-
|
|
239
|
+
}), t(this, R).thumb.addEventListener("mousedown", (i) => {
|
|
240
|
+
if (i.button !== 0) return;
|
|
241
|
+
i.stopPropagation(), i.preventDefault(), y(this, G, !0), y(this, wt, i.clientY), y(this, St, e.scrollTop);
|
|
242
242
|
const n = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, G)) return;
|
|
244
244
|
const c = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, wt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const
|
|
247
|
-
let x = t(this, St) +
|
|
246
|
+
const S = b / u * v;
|
|
247
|
+
let x = t(this, St) + S;
|
|
248
248
|
const M = Math.max(0, m - g);
|
|
249
249
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
250
250
|
}
|
|
@@ -253,9 +253,9 @@ const $e = class $e extends HTMLElement {
|
|
|
253
253
|
y(this, G, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
|
-
}), t(this, R).track.addEventListener("mousedown", (
|
|
257
|
-
if (
|
|
258
|
-
const n = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, a =
|
|
256
|
+
}), t(this, R).track.addEventListener("mousedown", (i) => {
|
|
257
|
+
if (i.button !== 0 || i.target === t(this, R).thumb) return;
|
|
258
|
+
const n = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, a = i.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
@@ -353,11 +353,11 @@ const $e = class $e extends HTMLElement {
|
|
|
353
353
|
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
354
354
|
let he = $e;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", he);
|
|
356
|
-
var O,
|
|
356
|
+
var O, w, B, H, F, J, Et, ot, at, Ot, Bt, zt, At, qt, Dt, Pt, Rt, jt, Ae, lt, ct, Ft;
|
|
357
357
|
const Ie = class Ie {
|
|
358
|
-
constructor(
|
|
358
|
+
constructor(r) {
|
|
359
359
|
d(this, O);
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, w);
|
|
361
361
|
d(this, B, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, H, null);
|
|
363
363
|
d(this, F, null);
|
|
@@ -368,63 +368,63 @@ const Ie = class Ie {
|
|
|
368
368
|
d(this, Ot, 3);
|
|
369
369
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
370
370
|
var e;
|
|
371
|
-
const
|
|
372
|
-
|
|
371
|
+
const r = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
372
|
+
r && (t(this, At).call(this), t(this, lt).call(this, r.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
373
373
|
}, "refresh"));
|
|
374
374
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
375
|
-
y(this, H, null), t(this, B).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
376
|
-
const
|
|
377
|
-
if (!n) return;
|
|
378
|
-
const o = n.querySelector(".ng-part-body table");
|
|
379
|
-
if (!o) return;
|
|
380
|
-
const a = o.querySelector("tbody.bindable-tbody");
|
|
375
|
+
y(this, H, null), t(this, B).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
376
|
+
const a = t(this, w).querySelector(o);
|
|
381
377
|
if (!a) return;
|
|
382
|
-
const
|
|
383
|
-
|
|
378
|
+
const c = a.querySelector(".ng-part-body table");
|
|
379
|
+
if (!c) return;
|
|
380
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
381
|
+
if (!l) return;
|
|
382
|
+
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
383
|
+
t(this, B).set(o, u);
|
|
384
384
|
});
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
t(this, zt).call(this,
|
|
388
|
-
let
|
|
389
|
-
const
|
|
390
|
-
var
|
|
391
|
-
|
|
385
|
+
const r = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), i = t(this, w).querySelector(".ng-container-body .ng-part-header"), n = t(this, w).querySelector(".ng-container-body .ng-part-footer");
|
|
386
|
+
if (r) {
|
|
387
|
+
t(this, zt).call(this, r), t(this, Rt).call(this), t(this, At).call(this), t(this, lt).call(this, r.scrollTop);
|
|
388
|
+
let o = !1;
|
|
389
|
+
const a = /* @__PURE__ */ h((c, l, f) => {
|
|
390
|
+
var u;
|
|
391
|
+
o || (o = !0, r && r.scrollTop !== c && (r.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), s && s.scrollTop !== c && (s.scrollTop = c), i && i.scrollLeft !== l && (i.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this, w).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1);
|
|
392
392
|
}, "syncScroll");
|
|
393
|
-
[
|
|
394
|
-
|
|
393
|
+
[r, e, s].forEach((c) => {
|
|
394
|
+
c && c.addEventListener("scroll", () => {
|
|
395
395
|
t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
|
|
396
|
-
|
|
396
|
+
a(c.scrollTop, c.scrollLeft), y(this, at, !1);
|
|
397
397
|
}));
|
|
398
398
|
});
|
|
399
|
-
});
|
|
399
|
+
}), this.refresh();
|
|
400
400
|
}
|
|
401
401
|
}, "initialize"));
|
|
402
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
402
|
+
d(this, Bt, /* @__PURE__ */ h((r, e) => {
|
|
403
403
|
const s = t(this, B).get(e);
|
|
404
404
|
if (!s || s.length === 0) return;
|
|
405
|
-
const
|
|
406
|
-
if (!
|
|
407
|
-
|
|
408
|
-
const n =
|
|
405
|
+
const i = r.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
406
|
+
if (!i) return;
|
|
407
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
408
|
+
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
409
409
|
for (let a = 0; a < t(this, Et); a++)
|
|
410
410
|
s.forEach((c) => {
|
|
411
411
|
o.appendChild(c.cloneNode(!0));
|
|
412
412
|
});
|
|
413
|
-
n ? n.before(o) :
|
|
413
|
+
n ? n.before(o) : i.appendChild(o);
|
|
414
414
|
}, "#renderRows"));
|
|
415
|
-
d(this, zt, /* @__PURE__ */ h((
|
|
415
|
+
d(this, zt, /* @__PURE__ */ h((r) => {
|
|
416
416
|
if (t(this, H) !== null && t(this, H) > 0)
|
|
417
417
|
return t(this, H);
|
|
418
418
|
const e = t(this, B).get(".ng-container-body");
|
|
419
419
|
if (!e || e.length === 0) return 24;
|
|
420
|
-
const s =
|
|
420
|
+
const s = r.querySelector("tbody.bindable-tbody");
|
|
421
421
|
if (!s) return 24;
|
|
422
422
|
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
423
|
-
const
|
|
423
|
+
const i = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
424
424
|
e.forEach((b) => {
|
|
425
425
|
n.appendChild(b.cloneNode(!0));
|
|
426
|
-
}),
|
|
427
|
-
const o = t(this,
|
|
426
|
+
}), i ? i.before(n) : s.appendChild(n);
|
|
427
|
+
const o = t(this, w), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
428
428
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
429
429
|
let f = 0;
|
|
430
430
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
@@ -433,26 +433,26 @@ const Ie = class Ie {
|
|
|
433
433
|
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, H, f > 0 ? f : 24), t(this, qt).call(this), t(this, H);
|
|
434
434
|
}, "#measureAndCacheHeight"));
|
|
435
435
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
436
|
-
const e = (t(this, O).data.get() || []).length, s = t(this, H)
|
|
436
|
+
const e = (t(this, O).data.get() || []).length, s = t(this, H), i = e * s;
|
|
437
437
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
438
|
-
const o = t(this,
|
|
438
|
+
const o = t(this, w).querySelector(n);
|
|
439
439
|
if (!o) return;
|
|
440
440
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
441
|
-
a && (a.style.height = `${
|
|
441
|
+
a && (a.style.height = `${i}px`);
|
|
442
442
|
});
|
|
443
443
|
}, "#updateVirtualScrollHeight"));
|
|
444
444
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
445
445
|
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
446
|
-
const
|
|
447
|
-
y(this, Et,
|
|
446
|
+
const r = Math.ceil(t(this, J) / t(this, H));
|
|
447
|
+
y(this, Et, r + t(this, Ot));
|
|
448
448
|
}
|
|
449
449
|
}, "#updateRowCount"));
|
|
450
450
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
451
451
|
var a, c, l, f, u, b;
|
|
452
|
-
const
|
|
452
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), s = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
453
453
|
if (e) {
|
|
454
|
-
const g =
|
|
455
|
-
for (let x = 0; x <
|
|
454
|
+
const g = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], S = Math.max(g.length, m.length, v.length);
|
|
455
|
+
for (let x = 0; x < S; x++) {
|
|
456
456
|
const M = [
|
|
457
457
|
((a = g[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
458
458
|
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -461,10 +461,10 @@ const Ie = class Ie {
|
|
|
461
461
|
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
464
|
+
const i = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
465
465
|
if (n) {
|
|
466
|
-
const g =
|
|
467
|
-
for (let x = 0; x <
|
|
466
|
+
const g = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], S = Math.max(g.length, m.length, v.length);
|
|
467
|
+
for (let x = 0; x < S; x++) {
|
|
468
468
|
const M = [
|
|
469
469
|
((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
470
470
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
@@ -475,37 +475,37 @@ const Ie = class Ie {
|
|
|
475
475
|
}
|
|
476
476
|
}, "#syncRowHeights"));
|
|
477
477
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
478
|
-
!t(this,
|
|
479
|
-
for (const e of
|
|
478
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (y(this, F, new ResizeObserver((r) => {
|
|
479
|
+
for (const e of r) {
|
|
480
480
|
const s = e.target;
|
|
481
481
|
if (!s.classList.contains("active")) continue;
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
482
|
+
const i = e.contentRect.height;
|
|
483
|
+
if (i > 0) {
|
|
484
484
|
let n = 0;
|
|
485
485
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
486
486
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
487
|
-
const c = Math.max(
|
|
487
|
+
const c = Math.max(i - n, 100);
|
|
488
488
|
t(this, J) !== c && (y(this, J, c), t(this, qt).call(this), t(this, H) !== null && t(this, Rt).call(this));
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
})), t(this, F).observe(t(this,
|
|
491
|
+
})), t(this, F).observe(t(this, w)));
|
|
492
492
|
}, "#initResizeObserver"));
|
|
493
493
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
494
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
495
|
-
const e = t(this,
|
|
496
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e,
|
|
494
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
495
|
+
const e = t(this, w).querySelector(r);
|
|
496
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Bt).call(this, e, r);
|
|
497
497
|
}), t(this, Ft).call(this), t(this, Dt).call(this);
|
|
498
498
|
}, "#renderAllContainers"));
|
|
499
|
-
d(this, jt, /* @__PURE__ */ h((
|
|
499
|
+
d(this, jt, /* @__PURE__ */ h((r) => {
|
|
500
500
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
501
501
|
var l;
|
|
502
|
-
const s = t(this,
|
|
502
|
+
const s = t(this, w).querySelector(e);
|
|
503
503
|
if (!s) return;
|
|
504
|
-
const
|
|
505
|
-
if (!
|
|
506
|
-
const n = Array.from(
|
|
504
|
+
const i = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
505
|
+
if (!i) return;
|
|
506
|
+
const n = Array.from(i.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, B).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, O).data.get() || []).length;
|
|
507
507
|
n.forEach((f, u) => {
|
|
508
|
-
const b =
|
|
508
|
+
const b = r + Math.floor(u / o);
|
|
509
509
|
if (b >= c) {
|
|
510
510
|
f.style.display = "none";
|
|
511
511
|
return;
|
|
@@ -515,52 +515,52 @@ const Ie = class Ie {
|
|
|
515
515
|
});
|
|
516
516
|
});
|
|
517
517
|
}, "#adjustBufferRows"));
|
|
518
|
-
d(this, Ae, /* @__PURE__ */ h((
|
|
518
|
+
d(this, Ae, /* @__PURE__ */ h((r) => {
|
|
519
519
|
var c;
|
|
520
520
|
const e = t(this, H);
|
|
521
521
|
if (!e || e <= 0) return;
|
|
522
|
-
const
|
|
522
|
+
const i = (t(this, O).data.get() || []).length, n = Math.max(0, Math.floor(r / e)), o = n * e, a = ((c = t(this, B).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
|
|
523
523
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
524
|
-
const f = t(this,
|
|
524
|
+
const f = t(this, w).querySelector(l);
|
|
525
525
|
if (!f) return;
|
|
526
526
|
const u = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
527
527
|
if (!u) return;
|
|
528
528
|
u.style.transform = `translateY(${o}px)`, Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g, m) => {
|
|
529
529
|
const v = n + Math.floor(m / a);
|
|
530
|
-
if (v >=
|
|
530
|
+
if (v >= i) {
|
|
531
531
|
g.style.display = "none";
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
|
-
const
|
|
535
|
-
g.style.display = "", t(this, ct).call(this, g,
|
|
534
|
+
const S = t(this, O).data.get(v);
|
|
535
|
+
g.style.display = "", t(this, ct).call(this, g, S, v);
|
|
536
536
|
});
|
|
537
537
|
}), t(this, ot) || (y(this, ot, !0), setTimeout(() => {
|
|
538
538
|
t(this, jt).call(this, n), y(this, ot, !1);
|
|
539
539
|
}, 0));
|
|
540
540
|
}, "#handleScroll_BAK"));
|
|
541
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
541
|
+
d(this, lt, /* @__PURE__ */ h((r) => {
|
|
542
542
|
var u;
|
|
543
543
|
const e = t(this, H);
|
|
544
544
|
if (!e || e <= 0) return;
|
|
545
|
-
const
|
|
545
|
+
const i = (t(this, O).data.get() || []).length, n = Math.max(0, Math.floor(r / e)), o = n * e, a = ((u = t(this, B).get(".ng-container-body")) == null ? void 0 : u.length) || 1, c = t(this, w).querySelector(".ng-container-body"), l = c == null ? void 0 : c.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
546
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
547
|
-
const g = t(this,
|
|
547
|
+
const g = t(this, w).querySelector(b);
|
|
548
548
|
if (!g) return;
|
|
549
549
|
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
550
550
|
m && (m.style.transform = `translateY(${o}px)`);
|
|
551
551
|
}), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
552
|
-
const g = t(this,
|
|
552
|
+
const g = t(this, w).querySelector(b);
|
|
553
553
|
if (!g) return;
|
|
554
554
|
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
555
555
|
if (!m) return;
|
|
556
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
556
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((S, x) => {
|
|
557
557
|
const M = n + Math.floor(x / a);
|
|
558
|
-
if (M >=
|
|
559
|
-
|
|
558
|
+
if (M >= i) {
|
|
559
|
+
S.style.display = "none";
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
562
|
const k = t(this, O).data.get(M);
|
|
563
|
-
|
|
563
|
+
S.style.display = "", t(this, ct).call(this, S, k, M);
|
|
564
564
|
});
|
|
565
565
|
});
|
|
566
566
|
}, "#handleScroll"));
|
|
@@ -578,62 +578,62 @@ const Ie = class Ie {
|
|
|
578
578
|
cell.dataset.row = dataIndex;
|
|
579
579
|
});
|
|
580
580
|
}; */
|
|
581
|
-
d(this, ct, /* @__PURE__ */ h((
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
const o = Array.from(
|
|
581
|
+
d(this, ct, /* @__PURE__ */ h((r, e, s) => {
|
|
582
|
+
r.dataset.row = s, r.data = e, pt.log(s), Array.from(r.cells).forEach((i, n) => {
|
|
583
|
+
i.dataset.row = s, i.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
|
|
584
|
+
const o = Array.from(i.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
585
585
|
o && typeof o.refresh == "function" && o.refresh();
|
|
586
586
|
});
|
|
587
587
|
}, "#bindRowData"));
|
|
588
588
|
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
589
589
|
var c, l, f;
|
|
590
|
-
const
|
|
590
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), s = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
591
591
|
if (!e) return;
|
|
592
|
-
const
|
|
592
|
+
const i = r ? Array.from(r.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(i.length, n.length, o.length);
|
|
593
593
|
for (let u = 0; u < a; u++) {
|
|
594
594
|
const b = [
|
|
595
|
-
((c =
|
|
595
|
+
((c = i[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
596
596
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
597
597
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
598
598
|
], g = Math.max(...b);
|
|
599
|
-
g > 0 && (
|
|
599
|
+
g > 0 && (i[u] && (i[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
600
600
|
}
|
|
601
601
|
}, "#syncHeaderHeights"));
|
|
602
602
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
603
603
|
t(this, F) && (t(this, F).disconnect(), y(this, F, null));
|
|
604
604
|
}, "destroy"));
|
|
605
|
-
y(this, O,
|
|
605
|
+
y(this, O, r.getRootNode().host), y(this, w, r), t(this, Pt).call(this);
|
|
606
606
|
}
|
|
607
607
|
getRowHeight() {
|
|
608
608
|
return t(this, H);
|
|
609
609
|
}
|
|
610
|
-
templateLength(
|
|
610
|
+
templateLength(r = ".ng-container-body") {
|
|
611
611
|
var e;
|
|
612
|
-
return ((e = t(this, B).get(
|
|
612
|
+
return ((e = t(this, B).get(r)) == null ? void 0 : e.length) || 1;
|
|
613
613
|
}
|
|
614
614
|
};
|
|
615
|
-
O = new WeakMap(),
|
|
615
|
+
O = new WeakMap(), w = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), Et = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), zt = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap(), Pt = new WeakMap(), Rt = new WeakMap(), jt = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), Ft = new WeakMap(), h(Ie, "RowManager");
|
|
616
616
|
let de = Ie;
|
|
617
617
|
const Yt = class Yt {
|
|
618
618
|
/**
|
|
619
619
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
620
620
|
*/
|
|
621
|
-
static compileAll(
|
|
622
|
-
return Array.isArray(
|
|
621
|
+
static compileAll(r) {
|
|
622
|
+
return Array.isArray(r) ? r.map((e) => Yt.compile(e)) : [];
|
|
623
623
|
}
|
|
624
624
|
/**
|
|
625
625
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
626
626
|
*/
|
|
627
|
-
static compile(
|
|
628
|
-
if (!
|
|
627
|
+
static compile(r) {
|
|
628
|
+
if (!r) return null;
|
|
629
629
|
const e = /* @__PURE__ */ h((a) => {
|
|
630
630
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
631
631
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
632
632
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
633
633
|
let u = `cell-${f}`;
|
|
634
634
|
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
635
|
-
let
|
|
636
|
-
b &&
|
|
635
|
+
let S = [];
|
|
636
|
+
b && S.push(`data-bind="${b}"`), g && S.push(`data-expr="${g}"`), m && S.push(`maxbyte="${m}"`), v && S.push(`type="${v}"`), l.innerHTML = `<${u} ${S.join(" ")}></${u}>`;
|
|
637
637
|
});
|
|
638
638
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
639
639
|
if (!a.querySelector("colgroup")) {
|
|
@@ -649,7 +649,7 @@ const Yt = class Yt {
|
|
|
649
649
|
l ? l.after(c) : a.prepend(c);
|
|
650
650
|
}
|
|
651
651
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
652
|
-
}, "ensureTableStructure"),
|
|
652
|
+
}, "ensureTableStructure"), i = /* @__PURE__ */ h((a, c) => {
|
|
653
653
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
654
654
|
if (u === 0 || f.length === 0) return;
|
|
655
655
|
let b = 0;
|
|
@@ -659,30 +659,30 @@ const Yt = class Yt {
|
|
|
659
659
|
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
660
660
|
l.forEach((m) => {
|
|
661
661
|
const v = m.sectionRowIndex;
|
|
662
|
-
let
|
|
662
|
+
let S = 0;
|
|
663
663
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
664
664
|
for (let z = 0; z < g[v].length; z++)
|
|
665
665
|
if (g[v][z] === null) {
|
|
666
|
-
|
|
666
|
+
S = z;
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
670
670
|
for (let z = 0; z < M; z++)
|
|
671
671
|
for (let mt = 0; mt < k; mt++)
|
|
672
|
-
v + z < u &&
|
|
672
|
+
v + z < u && S + mt < b && (g[v + z][S + mt] = z === 0 && mt === 0 ? "1" : "0");
|
|
673
673
|
});
|
|
674
674
|
}), l.forEach((m) => {
|
|
675
675
|
const v = m.sectionRowIndex;
|
|
676
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
676
|
+
Array.from(m.querySelectorAll("th,td")).forEach((S) => {
|
|
677
677
|
for (let x = 0; x < g[v].length; x++)
|
|
678
678
|
if (g[v][x] === "1") {
|
|
679
|
-
|
|
679
|
+
S.dataset.col = x, g[v][x] = "0";
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
|
-
}, "resetColIndex"), n =
|
|
685
|
-
return s(n), e(n),
|
|
684
|
+
}, "resetColIndex"), n = r.cloneNode(!0);
|
|
685
|
+
return s(n), e(n), i(n, "thead"), i(n, "tbody"), i(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
686
686
|
const l = a.getAttribute("fixed");
|
|
687
687
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
688
688
|
f.setAttribute("fixed", l);
|
|
@@ -709,28 +709,28 @@ const xt = class xt extends HTMLElement {
|
|
|
709
709
|
{ selector: ".ng-container-body", type: null },
|
|
710
710
|
{ selector: ".ng-container-left", type: "left" },
|
|
711
711
|
{ selector: ".ng-container-right", type: "right" }
|
|
712
|
-
].forEach(({ selector: s, type:
|
|
712
|
+
].forEach(({ selector: s, type: i }) => {
|
|
713
713
|
const n = this.querySelector(s);
|
|
714
714
|
if (!n) return;
|
|
715
715
|
n.innerHTML = "";
|
|
716
716
|
const o = document.createElement("div");
|
|
717
|
-
o.className = "ng-part-header", o.appendChild(t(this, ht).call(this, t(this, Q),
|
|
717
|
+
o.className = "ng-part-header", o.appendChild(t(this, ht).call(this, t(this, Q), i, "header"));
|
|
718
718
|
const a = document.createElement("div");
|
|
719
719
|
a.className = "ng-part-body";
|
|
720
720
|
const c = document.createElement("div");
|
|
721
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ht).call(this, t(this, Q),
|
|
721
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ht).call(this, t(this, Q), i, "body"));
|
|
722
722
|
const l = document.createElement("div");
|
|
723
723
|
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
724
724
|
const f = document.createElement("div");
|
|
725
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ht).call(this, t(this, Q),
|
|
725
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ht).call(this, t(this, Q), i, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
726
726
|
});
|
|
727
727
|
}, "#renderSplitContainers"));
|
|
728
728
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
729
729
|
["left", "right", "body"].forEach((e) => {
|
|
730
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
731
|
-
if (!s || !
|
|
730
|
+
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
731
|
+
if (!s || !i || i.length === 0) return;
|
|
732
732
|
let n = 0;
|
|
733
|
-
|
|
733
|
+
i[0].querySelectorAll("col").forEach((o) => {
|
|
734
734
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
735
735
|
isNaN(n) || (n += a);
|
|
736
736
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
@@ -742,14 +742,14 @@ const xt = class xt extends HTMLElement {
|
|
|
742
742
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
743
743
|
}, 0));
|
|
744
744
|
}, "generate"));
|
|
745
|
-
d(this, ht, /* @__PURE__ */ h((e, s,
|
|
745
|
+
d(this, ht, /* @__PURE__ */ h((e, s, i) => {
|
|
746
746
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
747
|
-
if (
|
|
747
|
+
if (i === "header") {
|
|
748
748
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
749
749
|
const f = document.createElement("tbody");
|
|
750
750
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
751
751
|
}
|
|
752
|
-
} else
|
|
752
|
+
} else i === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : i === "footer" && (o && o.remove(), a && a.remove());
|
|
753
753
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
754
754
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
755
755
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -933,18 +933,18 @@ const _e = class _e extends HTMLElement {
|
|
|
933
933
|
var e;
|
|
934
934
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
935
935
|
var o;
|
|
936
|
-
const
|
|
937
|
-
t(this, kt).call(this, n,
|
|
936
|
+
const i = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
937
|
+
t(this, kt).call(this, n, i);
|
|
938
938
|
}), t(this, kt).call(this, 0, !1);
|
|
939
939
|
}, "#init"));
|
|
940
940
|
d(this, kt, /* @__PURE__ */ h((e, s = !1) => {
|
|
941
|
-
const
|
|
941
|
+
const i = /* @__PURE__ */ h(() => {
|
|
942
942
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
943
943
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
944
944
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
945
945
|
b.length < 2 || b.forEach((g) => {
|
|
946
|
-
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
947
|
-
v &&
|
|
946
|
+
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), S = f[m + 1];
|
|
947
|
+
v && S && S.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
948
948
|
});
|
|
949
949
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
950
950
|
if (!a[e]) return;
|
|
@@ -966,7 +966,7 @@ const _e = class _e extends HTMLElement {
|
|
|
966
966
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
967
967
|
l == null || l.forEach((f) => {
|
|
968
968
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
969
|
-
}),
|
|
969
|
+
}), i();
|
|
970
970
|
}, "#switchSheet"));
|
|
971
971
|
}
|
|
972
972
|
connectedCallback() {
|
|
@@ -978,24 +978,24 @@ let ue = _e;
|
|
|
978
978
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ue);
|
|
979
979
|
var I, Jt, Tt, Qt;
|
|
980
980
|
const Ne = class Ne {
|
|
981
|
-
constructor(
|
|
981
|
+
constructor(r) {
|
|
982
982
|
d(this, I);
|
|
983
983
|
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
984
|
-
t(this, Qt).call(this), new ResizeObserver((
|
|
985
|
-
for (let e of
|
|
984
|
+
t(this, Qt).call(this), new ResizeObserver((r) => {
|
|
985
|
+
for (let e of r)
|
|
986
986
|
t(this, I).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
987
987
|
}).observe(t(this, I));
|
|
988
988
|
}, "#init"));
|
|
989
989
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
990
990
|
var c, l;
|
|
991
|
-
const
|
|
992
|
-
if (
|
|
993
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
991
|
+
const r = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
992
|
+
if (r.length === 0) return;
|
|
993
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = It.SCROLLBAR_SIZE, a = e * s + i + n + o;
|
|
994
994
|
t(this, I).style.height = `${a}px`;
|
|
995
995
|
}, "#applyAutoHeight"));
|
|
996
996
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
997
|
-
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true",
|
|
998
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l <
|
|
997
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", i = e.length, n = e.map((c, l) => {
|
|
998
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < i - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
999
999
|
return u + b;
|
|
1000
1000
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1001
1001
|
t(this, I).shadowRoot.innerHTML = `
|
|
@@ -1096,32 +1096,32 @@ const Ne = class Ne {
|
|
|
1096
1096
|
});
|
|
1097
1097
|
});
|
|
1098
1098
|
}, "#render"));
|
|
1099
|
-
y(this, I,
|
|
1099
|
+
y(this, I, r), t(this, Jt).call(this);
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
I = new WeakMap(), Jt = new WeakMap(), Tt = new WeakMap(), Qt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1103
1103
|
let ge = Ne;
|
|
1104
1104
|
var Ct, dt;
|
|
1105
1105
|
const We = class We {
|
|
1106
|
-
constructor(
|
|
1106
|
+
constructor(r) {
|
|
1107
1107
|
d(this, Ct);
|
|
1108
1108
|
d(this, dt, -1);
|
|
1109
1109
|
A(this, "count", /* @__PURE__ */ h(() => t(this, Ct).rawRecords.length, "count"));
|
|
1110
|
-
y(this, Ct,
|
|
1110
|
+
y(this, Ct, r);
|
|
1111
1111
|
}
|
|
1112
1112
|
get at() {
|
|
1113
1113
|
return t(this, dt);
|
|
1114
1114
|
}
|
|
1115
|
-
set at(
|
|
1116
|
-
y(this, dt, parseInt(
|
|
1115
|
+
set at(r) {
|
|
1116
|
+
y(this, dt, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, dt)}"]`) && setTimeout(() => {
|
|
1117
1117
|
});
|
|
1118
1118
|
}
|
|
1119
1119
|
};
|
|
1120
1120
|
Ct = new WeakMap(), dt = new WeakMap(), h(We, "ngRow");
|
|
1121
1121
|
let be = We;
|
|
1122
|
-
var _, T, N, ft, te, Y, ee, et, Lt, se,
|
|
1122
|
+
var _, T, N, ft, te, Y, ee, et, Lt, se, re, ut;
|
|
1123
1123
|
const W = class W {
|
|
1124
|
-
constructor(
|
|
1124
|
+
constructor(r, e) {
|
|
1125
1125
|
d(this, _);
|
|
1126
1126
|
d(this, T);
|
|
1127
1127
|
d(this, N, []);
|
|
@@ -1130,8 +1130,8 @@ const W = class W {
|
|
|
1130
1130
|
d(this, Y, []);
|
|
1131
1131
|
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1132
1132
|
y(this, Y, []);
|
|
1133
|
-
const
|
|
1134
|
-
Array.from(
|
|
1133
|
+
const r = t(this, _).template || [];
|
|
1134
|
+
Array.from(r).forEach((e) => {
|
|
1135
1135
|
var s;
|
|
1136
1136
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1137
1137
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
@@ -1139,25 +1139,25 @@ const W = class W {
|
|
|
1139
1139
|
});
|
|
1140
1140
|
}, "#initialize"));
|
|
1141
1141
|
d(this, et, /* @__PURE__ */ h(() => {
|
|
1142
|
-
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1143
|
-
|
|
1142
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((r) => {
|
|
1143
|
+
r.invalidate();
|
|
1144
1144
|
});
|
|
1145
1145
|
}, "#invalidate"));
|
|
1146
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1146
|
+
A(this, "get", /* @__PURE__ */ h((r, e) => {
|
|
1147
1147
|
var n;
|
|
1148
1148
|
const s = this.getValidData();
|
|
1149
1149
|
if (!s || s.length <= 0) return;
|
|
1150
|
-
if (
|
|
1151
|
-
if (
|
|
1152
|
-
const
|
|
1150
|
+
if (r == null) return t(this, ut).call(this, s);
|
|
1151
|
+
if (r < 0 || r >= s.length) return null;
|
|
1152
|
+
const i = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1153
1153
|
if (e != null) {
|
|
1154
|
-
const o =
|
|
1155
|
-
return o >= 0 ? s[
|
|
1154
|
+
const o = i.indexOf(e);
|
|
1155
|
+
return o >= 0 ? s[r].v[o] : null;
|
|
1156
1156
|
}
|
|
1157
|
-
return t(this, ut).call(this, s[
|
|
1157
|
+
return t(this, ut).call(this, s[r]);
|
|
1158
1158
|
}, "get"));
|
|
1159
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1160
|
-
this.clear(), this.add(
|
|
1159
|
+
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1160
|
+
this.clear(), this.add(r, !1), t(this, et).call(this);
|
|
1161
1161
|
}, "set"));
|
|
1162
1162
|
d(this, Lt, /* @__PURE__ */ h(() => ({
|
|
1163
1163
|
rowState: W.ROW_STATE.EMPTY,
|
|
@@ -1172,81 +1172,81 @@ const W = class W {
|
|
|
1172
1172
|
y(this, N, []), y(this, ft, []), t(this, et).call(this);
|
|
1173
1173
|
}, "reset"));
|
|
1174
1174
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1175
|
-
var i;
|
|
1176
|
-
t(this, T).rawRecords = [], y(this, N, []), y(this, ft, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1177
|
-
}, "clear"));
|
|
1178
|
-
d(this, se, /* @__PURE__ */ h((i) => {
|
|
1179
1175
|
var r;
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1176
|
+
t(this, T).rawRecords = [], y(this, N, []), y(this, ft, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1177
|
+
}, "clear"));
|
|
1178
|
+
d(this, se, /* @__PURE__ */ h((r) => {
|
|
1179
|
+
var i;
|
|
1180
|
+
Array.isArray(r) || (r = [r]);
|
|
1181
|
+
const e = typeof ((i = t(this, _).fields) == null ? void 0 : i.get) == "function" ? t(this, _).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
1182
|
+
return r.forEach((n) => {
|
|
1183
1183
|
const o = { v: [] };
|
|
1184
1184
|
e.forEach((a) => {
|
|
1185
1185
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1186
1186
|
}), s.push(o);
|
|
1187
1187
|
}), s;
|
|
1188
1188
|
}, "#json2Array"));
|
|
1189
|
-
d(this,
|
|
1189
|
+
d(this, re, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1190
1190
|
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1191
|
-
}),
|
|
1192
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1193
|
-
|
|
1194
|
-
const s = t(this, se).call(this,
|
|
1195
|
-
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this,
|
|
1196
|
-
const
|
|
1191
|
+
}), r), "#defaultInsert"));
|
|
1192
|
+
A(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1193
|
+
r === void 0 && (r = {});
|
|
1194
|
+
const s = t(this, se).call(this, r);
|
|
1195
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, re).call(this, s)), this.resetRecords();
|
|
1196
|
+
const i = this.count() - 1;
|
|
1197
1197
|
return e || s.forEach((n, o) => {
|
|
1198
|
-
const a = t(this, T).rawRecords[
|
|
1198
|
+
const a = t(this, T).rawRecords[i - o];
|
|
1199
1199
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1200
|
-
}), t(this, et).call(this),
|
|
1200
|
+
}), t(this, et).call(this), i;
|
|
1201
1201
|
}, "add"));
|
|
1202
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1202
|
+
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1203
1203
|
let e = [];
|
|
1204
|
-
Array.isArray(
|
|
1204
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1205
1205
|
if (t(this, N)[s]) {
|
|
1206
|
-
const
|
|
1207
|
-
t(this, N)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1208
|
-
n.__ng.rowid ===
|
|
1206
|
+
const i = t(this, N)[s].__ng.rowid;
|
|
1207
|
+
t(this, N)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, T).rawRecords.forEach((n) => {
|
|
1208
|
+
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1209
1209
|
});
|
|
1210
1210
|
}
|
|
1211
1211
|
}), this.resetRecords(), t(this, et).call(this);
|
|
1212
1212
|
}, "delete"));
|
|
1213
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1213
|
+
A(this, "setValue", /* @__PURE__ */ h((r, e, s) => {
|
|
1214
1214
|
var c;
|
|
1215
|
-
|
|
1215
|
+
r = parseInt(r, 10);
|
|
1216
1216
|
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1217
1217
|
if (n < 0) return;
|
|
1218
|
-
const o = this.getValidData()[
|
|
1218
|
+
const o = this.getValidData()[r];
|
|
1219
1219
|
if (!o) return;
|
|
1220
1220
|
const a = o.v[n];
|
|
1221
1221
|
a !== s && o.__ng.rowState !== W.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = W.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1222
1222
|
}, "setValue"));
|
|
1223
1223
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1224
|
-
y(this, ft, t(this, T).rawRecords.filter((
|
|
1225
|
-
|
|
1226
|
-
}), t(this, N).forEach((
|
|
1227
|
-
|
|
1224
|
+
y(this, ft, t(this, T).rawRecords.filter((r) => !r.__ng.deleted)), y(this, N, t(this, T).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, T).rawRecords.forEach((r, e) => {
|
|
1225
|
+
r.__ng.rowidx = e;
|
|
1226
|
+
}), t(this, N).forEach((r, e) => {
|
|
1227
|
+
r.__ng.i = e;
|
|
1228
1228
|
});
|
|
1229
1229
|
}, "resetRecords"));
|
|
1230
1230
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1231
|
-
d(this, ut, /* @__PURE__ */ h((
|
|
1231
|
+
d(this, ut, /* @__PURE__ */ h((r) => {
|
|
1232
1232
|
var o;
|
|
1233
|
-
if (!
|
|
1234
|
-
const e = !Array.isArray(
|
|
1233
|
+
if (!r) return r;
|
|
1234
|
+
const e = !Array.isArray(r), s = e ? [r] : r, i = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1235
1235
|
const c = {};
|
|
1236
|
-
return
|
|
1236
|
+
return i.forEach((l, f) => {
|
|
1237
1237
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1238
1238
|
}), c.__ng = a.__ng, c;
|
|
1239
1239
|
});
|
|
1240
1240
|
return e ? n[0] : n;
|
|
1241
1241
|
}, "#conv"));
|
|
1242
1242
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1243
|
-
y(this, _,
|
|
1243
|
+
y(this, _, r), y(this, T, e), t(this, ee).call(this);
|
|
1244
1244
|
}
|
|
1245
1245
|
get source() {
|
|
1246
1246
|
return t(this, ut).call(this, t(this, T).rawRecords);
|
|
1247
1247
|
}
|
|
1248
|
-
set source(
|
|
1249
|
-
this.clear(), this.add(
|
|
1248
|
+
set source(r) {
|
|
1249
|
+
this.clear(), this.add(r, !1);
|
|
1250
1250
|
}
|
|
1251
1251
|
get nextId() {
|
|
1252
1252
|
return ++Ke(this, te)._;
|
|
@@ -1258,7 +1258,7 @@ const W = class W {
|
|
|
1258
1258
|
return this.length;
|
|
1259
1259
|
}
|
|
1260
1260
|
};
|
|
1261
|
-
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), ft = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), et = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(),
|
|
1261
|
+
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), ft = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), et = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), re = new WeakMap(), ut = new WeakMap(), h(W, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1262
1262
|
A(W, "ROW_STATE", {
|
|
1263
1263
|
EMPTY: "EMPTY",
|
|
1264
1264
|
NORMAL: "NORMAL",
|
|
@@ -1269,54 +1269,54 @@ A(W, "ROW_STATE", {
|
|
|
1269
1269
|
let ye = W;
|
|
1270
1270
|
var st;
|
|
1271
1271
|
const Oe = class Oe {
|
|
1272
|
-
constructor(
|
|
1272
|
+
constructor(r) {
|
|
1273
1273
|
d(this, st);
|
|
1274
|
-
y(this, st,
|
|
1274
|
+
y(this, st, r), this.row = new be(this), this.data = new ye(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1275
1275
|
var e;
|
|
1276
1276
|
(e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
|
|
1277
1277
|
}, this.setDataSource = (e) => {
|
|
1278
1278
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1279
1279
|
}, this.getRowState = (e) => {
|
|
1280
|
-
var
|
|
1280
|
+
var i, n;
|
|
1281
1281
|
const s = parseInt(e, 10);
|
|
1282
1282
|
if (!(s >= this.data.count()))
|
|
1283
|
-
return (n = (
|
|
1283
|
+
return (n = (i = this.data.getValidData()[s]) == null ? void 0 : i.__ng) == null ? void 0 : n.rowState;
|
|
1284
1284
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1285
1285
|
this.row.at = e;
|
|
1286
|
-
}, 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,
|
|
1287
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1286
|
+
}, 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, i) => {
|
|
1287
|
+
e = parseInt(e, 10), this.data.setValue(e, s, i);
|
|
1288
1288
|
}, this.setDataSource([]);
|
|
1289
1289
|
}
|
|
1290
1290
|
};
|
|
1291
1291
|
st = new WeakMap(), h(Oe, "ngDataManager");
|
|
1292
1292
|
let pe = Oe;
|
|
1293
|
-
var gt, L, Ht,
|
|
1293
|
+
var gt, L, Ht, ie;
|
|
1294
1294
|
const Be = class Be {
|
|
1295
1295
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1296
|
-
constructor(
|
|
1296
|
+
constructor(r) {
|
|
1297
1297
|
d(this, gt);
|
|
1298
1298
|
d(this, L, []);
|
|
1299
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1300
|
-
|
|
1301
|
-
t(this, L).some((
|
|
1299
|
+
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1300
|
+
r.forEach((s) => {
|
|
1301
|
+
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1302
1302
|
}), t(this, Ht).call(this);
|
|
1303
1303
|
}, "add"));
|
|
1304
1304
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
1305
|
-
const
|
|
1305
|
+
const r = /* @__PURE__ */ new Map();
|
|
1306
1306
|
t(this, L).forEach((e) => {
|
|
1307
|
-
|
|
1308
|
-
}), y(this, L, Array.from(
|
|
1307
|
+
r.set(e.name, e.type);
|
|
1308
|
+
}), y(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1309
1309
|
}, "#adjust"));
|
|
1310
|
-
d(this,
|
|
1310
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1311
1311
|
y(this, L, []), pt.log(t(this, gt).querySelectorAll("table"));
|
|
1312
|
-
const
|
|
1313
|
-
if (!(!
|
|
1314
|
-
for (const e of
|
|
1315
|
-
pt.log(e), $("[data-bind]", e).each((s,
|
|
1316
|
-
const n =
|
|
1312
|
+
const r = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1313
|
+
if (!(!r || r.length === 0)) {
|
|
1314
|
+
for (const e of r)
|
|
1315
|
+
pt.log(e), $("[data-bind]", e).each((s, i) => {
|
|
1316
|
+
const n = i.dataset.bind, o = i.getAttribute("data-type") || "string";
|
|
1317
1317
|
n && t(this, L).push({ name: n, type: o });
|
|
1318
1318
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1319
|
-
$(`[${s}]`, e).each((
|
|
1319
|
+
$(`[${s}]`, e).each((i, n) => {
|
|
1320
1320
|
var o = n.getAttribute(s);
|
|
1321
1321
|
if (o.indexOf("data.") < 0) {
|
|
1322
1322
|
const a = o.search(/[(]/g);
|
|
@@ -1339,41 +1339,41 @@ const Be = class Be {
|
|
|
1339
1339
|
t(this, Ht).call(this);
|
|
1340
1340
|
}
|
|
1341
1341
|
}, "#init"));
|
|
1342
|
-
y(this, gt,
|
|
1342
|
+
y(this, gt, r), t(this, ie).call(this);
|
|
1343
1343
|
}
|
|
1344
1344
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1345
1345
|
get() {
|
|
1346
|
-
return t(this, L).map((
|
|
1346
|
+
return t(this, L).map((r) => r.name);
|
|
1347
1347
|
}
|
|
1348
1348
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1349
1349
|
getFields() {
|
|
1350
1350
|
return t(this, L);
|
|
1351
1351
|
}
|
|
1352
1352
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1353
|
-
getType(
|
|
1354
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1353
|
+
getType(r) {
|
|
1354
|
+
const e = t(this, L).find((s) => s.name === r);
|
|
1355
1355
|
return e ? e.type : "string";
|
|
1356
1356
|
}
|
|
1357
|
-
indexOf(
|
|
1358
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1357
|
+
indexOf(r) {
|
|
1358
|
+
return t(this, L).findIndex((e) => e.name === r);
|
|
1359
1359
|
}
|
|
1360
|
-
includes(
|
|
1361
|
-
return t(this, L).some((e) => e.name ===
|
|
1360
|
+
includes(r) {
|
|
1361
|
+
return t(this, L).some((e) => e.name === r);
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
|
-
gt = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(),
|
|
1364
|
+
gt = new WeakMap(), L = new WeakMap(), Ht = new WeakMap(), ie = new WeakMap(), h(Be, "ngFields");
|
|
1365
1365
|
let me = Be;
|
|
1366
|
-
var
|
|
1366
|
+
var rt, ne, oe;
|
|
1367
1367
|
const ze = class ze extends HTMLElement {
|
|
1368
1368
|
constructor() {
|
|
1369
1369
|
super();
|
|
1370
1370
|
//#created = false;
|
|
1371
|
-
d(this,
|
|
1371
|
+
d(this, rt);
|
|
1372
1372
|
d(this, ne);
|
|
1373
1373
|
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1374
1374
|
this.fields = new me(this), y(this, ne, new ge(this)), pt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1375
1375
|
}, "#init"));
|
|
1376
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1376
|
+
this.attachShadow({ mode: "open" }), y(this, rt, new pe(this));
|
|
1377
1377
|
}
|
|
1378
1378
|
connectedCallback() {
|
|
1379
1379
|
t(this, oe).call(this);
|
|
@@ -1383,18 +1383,18 @@ const ze = class ze extends HTMLElement {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1385
1385
|
get data() {
|
|
1386
|
-
return t(this,
|
|
1386
|
+
return t(this, rt).data;
|
|
1387
1387
|
}
|
|
1388
1388
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1389
1389
|
get row() {
|
|
1390
|
-
return t(this,
|
|
1390
|
+
return t(this, rt).row;
|
|
1391
1391
|
}
|
|
1392
1392
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1393
1393
|
get dataManager() {
|
|
1394
|
-
return t(this,
|
|
1394
|
+
return t(this, rt);
|
|
1395
1395
|
}
|
|
1396
1396
|
};
|
|
1397
|
-
|
|
1397
|
+
rt = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), h(ze, "NineTable");
|
|
1398
1398
|
let xe = ze;
|
|
1399
1399
|
customElements.get("nine-table") || customElements.define("nine-table", xe);
|
|
1400
1400
|
const vt = class vt extends HTMLElement {
|
|
@@ -1424,13 +1424,13 @@ const De = class De extends ve {
|
|
|
1424
1424
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1425
1425
|
if (t(this, p))
|
|
1426
1426
|
if (t(this, p).closest("tbody")) {
|
|
1427
|
-
const s = t(this, p).closest("tr").data,
|
|
1427
|
+
const s = t(this, p).closest("tr").data, i = parseInt(t(this, p).dataset.row);
|
|
1428
1428
|
if (!s) return "";
|
|
1429
1429
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1430
1430
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1431
1431
|
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1432
1432
|
} else try {
|
|
1433
|
-
return this.getExprValue(t(this, p).dataset.expr, s,
|
|
1433
|
+
return this.getExprValue(t(this, p).dataset.expr, s, i, t(this, p));
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1436
1436
|
}
|
|
@@ -1445,14 +1445,14 @@ const De = class De extends ve {
|
|
|
1445
1445
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1446
1446
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1447
1447
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1448
|
-
var s = t(this, p).closest("tr"),
|
|
1448
|
+
var s = t(this, p).closest("tr"), i = [];
|
|
1449
1449
|
$("th,td", s).each((x, M) => {
|
|
1450
1450
|
var k = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1451
|
-
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e &&
|
|
1452
|
-
}),
|
|
1451
|
+
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && i.push(k));
|
|
1452
|
+
}), i.sort();
|
|
1453
1453
|
var n = !1;
|
|
1454
1454
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1455
|
-
for (var o of
|
|
1455
|
+
for (var o of i) {
|
|
1456
1456
|
if (o > e) break;
|
|
1457
1457
|
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1458
1458
|
t(this, p).dataset.matrixRow;
|
|
@@ -1465,17 +1465,17 @@ const De = class De extends ve {
|
|
|
1465
1465
|
else
|
|
1466
1466
|
n = !0;
|
|
1467
1467
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1468
|
-
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1,
|
|
1469
|
-
$(
|
|
1468
|
+
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1, S = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1469
|
+
$(S).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").addClass("last-suppress") : !$(S).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
}, "#resetSuppress"));
|
|
1473
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e, s,
|
|
1473
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, i, n) => {
|
|
1474
1474
|
if (typeof e < "u")
|
|
1475
1475
|
try {
|
|
1476
|
-
|
|
1476
|
+
i = parseInt(i);
|
|
1477
1477
|
const o = e.replace("()", "");
|
|
1478
|
-
return t(this, C)[o] ? t(this, C)[o].call(this, s,
|
|
1478
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, i, t(this, p)) : t(this, C).exprFunction(e).call(this, s, i, t(this, C).data);
|
|
1479
1479
|
} catch {
|
|
1480
1480
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1481
1481
|
}
|
|
@@ -1492,8 +1492,8 @@ const De = class De extends ve {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
set value(e) {
|
|
1494
1494
|
var s = parseInt(t(this, p).dataset.row);
|
|
1495
|
-
const
|
|
1496
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e,
|
|
1495
|
+
const i = this.getAttribute("update-row-state") != "false";
|
|
1496
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, i) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, i);
|
|
1497
1497
|
}
|
|
1498
1498
|
get row() {
|
|
1499
1499
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1520,12 +1520,12 @@ const Pe = class Pe extends we {
|
|
|
1520
1520
|
};
|
|
1521
1521
|
h(Pe, "EditableCellElement");
|
|
1522
1522
|
let Se = Pe;
|
|
1523
|
-
var $t,
|
|
1523
|
+
var $t, it, bt, yt, ae, V, Le;
|
|
1524
1524
|
const je = class je extends Se {
|
|
1525
1525
|
constructor() {
|
|
1526
1526
|
super();
|
|
1527
1527
|
d(this, $t);
|
|
1528
|
-
d(this,
|
|
1528
|
+
d(this, it);
|
|
1529
1529
|
d(this, bt);
|
|
1530
1530
|
d(this, yt);
|
|
1531
1531
|
d(this, ae);
|
|
@@ -1566,12 +1566,12 @@ const je = class je extends Se {
|
|
|
1566
1566
|
*/
|
|
1567
1567
|
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1568
1568
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1569
|
-
if (t(this,
|
|
1569
|
+
if (t(this, it) == "number") {
|
|
1570
1570
|
let n = [];
|
|
1571
1571
|
if (t(this, V) && Number(t(this, V)) > 0 && n.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, V) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1572
|
-
var s = e.target.value,
|
|
1573
|
-
if (
|
|
1574
|
-
var s = s.substr(
|
|
1572
|
+
var s = e.target.value, i = s.indexOf(".");
|
|
1573
|
+
if (i >= 0) {
|
|
1574
|
+
var s = s.substr(i + 1, s.length);
|
|
1575
1575
|
s.length >= Number(t(this, V)) && e.preventDefault();
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
@@ -1579,7 +1579,7 @@ const je = class je extends Se {
|
|
|
1579
1579
|
t(this, bt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, bt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1580
1580
|
}
|
|
1581
1581
|
}, "#onKeyDown"));
|
|
1582
|
-
if (this.applyBaseStyle(), y(this,
|
|
1582
|
+
if (this.applyBaseStyle(), y(this, it, this.getAttribute("type") || "text"), y(this, bt, this.getAttribute("maxbyte")), y(this, yt, this.getAttribute("min")), y(this, ae, this.getAttribute("max")), y(this, V, this.getAttribute("scale")), !["text", "number"].includes(t(this, it))) throw `invalid type : ${t(this, it)}`;
|
|
1583
1583
|
}
|
|
1584
1584
|
connectedCallback() {
|
|
1585
1585
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1592,7 +1592,7 @@ const je = class je extends Se {
|
|
|
1592
1592
|
`, super.connectedCallback(), y(this, $t, this.querySelector("input"));
|
|
1593
1593
|
}
|
|
1594
1594
|
};
|
|
1595
|
-
$t = new WeakMap(),
|
|
1595
|
+
$t = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), ae = new WeakMap(), V = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1596
1596
|
let Ee = je;
|
|
1597
1597
|
customElements.get("cell-input-text");
|
|
1598
1598
|
customElements.get("cell-input") || customElements.define("cell-input", Ee);
|