@ninebone/table 0.0.591 → 0.0.593
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 +416 -410
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +21 -10
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var Fe = Object.defineProperty;
|
|
2
|
-
var Ve = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var Ve = (R) => {
|
|
3
|
+
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var Ue = (
|
|
10
|
-
set _(
|
|
11
|
-
p(
|
|
5
|
+
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
+
var c = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), p = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
|
+
var Ue = (R, i, e, s) => ({
|
|
10
|
+
set _(r) {
|
|
11
|
+
p(R, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(R, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -20,91 +20,91 @@ const He = class He extends Ke.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const W = new oe();
|
|
26
|
-
var
|
|
26
|
+
var z, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this, It, /* @__PURE__ */
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
36
|
+
d(this, It, /* @__PURE__ */ c(() => {
|
|
37
|
+
if (!t(this, z)) return;
|
|
38
|
+
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
48
|
-
if (a !== 0 &&
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && h > 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 = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (a /
|
|
56
|
+
const f = Math.max(Math.min(l * (a / h), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft, g =
|
|
58
|
+
const u = e.scrollLeft, g = h - a;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - f), 10)), b < 0 && (b = 0);
|
|
61
61
|
const m = l - f;
|
|
62
62
|
b > m && (b = m), n.style.left = `${b}px`, t(this, w).left.disabled = b === 0, t(this, w).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, G, /* @__PURE__ */
|
|
64
|
+
d(this, G, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
|
+
if (!r) return !1;
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
73
|
-
const l = s.clientWidth, u =
|
|
74
|
-
return
|
|
71
|
+
const h = n.width - o;
|
|
72
|
+
a > h && (a = h), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= h - 1;
|
|
73
|
+
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return h > 0 && u > 0 && (s.scrollLeft = a / h * u), a > 0 && a < h - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, _t, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
76
|
+
d(this, _t, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + r), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, o +
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
+
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (r) => {
|
|
92
|
+
r.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (r) => {
|
|
94
|
+
r.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
|
+
if (r.button !== 0) return;
|
|
97
|
+
r.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
const n = /* @__PURE__ */
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
|
+
if (r.button !== 0) return;
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
105
|
+
const h = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - h.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
108
|
p(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
@@ -112,7 +112,7 @@ const Me = class Me extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,8 +176,8 @@ const Me = class Me 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__ */
|
|
180
|
-
const s = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ c(() => {
|
|
180
|
+
const s = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -198,73 +198,73 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J,
|
|
204
|
+
var F, at, J, q, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
211
|
+
d(this, q);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
|
+
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
|
|
218
|
+
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
r.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
|
+
r.style.height = `${u}px`;
|
|
226
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const x = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > x && (m = x),
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Nt, /* @__PURE__ */
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this,
|
|
234
|
+
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
const n = /* @__PURE__ */
|
|
240
|
+
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
241
|
+
if (r.button !== 0) return;
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), p(this, J, !0), p(this, vt, r.clientY), p(this, xt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
245
|
+
const h = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && x > 0) {
|
|
247
|
-
const
|
|
248
|
-
let v = t(this, xt) +
|
|
247
|
+
const A = g / u * x;
|
|
248
|
+
let v = t(this, xt) + A;
|
|
249
249
|
const M = Math.max(0, m - b);
|
|
250
250
|
v < 0 && (v = 0), v > M && (v = M), e.scrollTop = v;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
254
254
|
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
258
|
+
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, q).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, q).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -334,13 +334,13 @@ const $e = class $e 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__ */
|
|
337
|
+
const e = /* @__PURE__ */ c(() => {
|
|
338
338
|
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
p(this,
|
|
343
|
+
p(this, q, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,130 +351,130 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ae, Wt, Ot, Bt, St, At, zt, Dt, Et, Ee, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
360
|
-
d(this,
|
|
359
|
+
constructor(i) {
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
|
-
d(this,
|
|
369
|
+
d(this, Ae, !1);
|
|
370
370
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
371
371
|
d(this, Wt, 3);
|
|
372
|
-
|
|
372
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
373
373
|
var e;
|
|
374
374
|
W.log("rowManager.refresh");
|
|
375
|
-
const
|
|
376
|
-
|
|
375
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
|
|
378
|
+
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
379
379
|
W.log("rowManager.initialize"), p(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), p(this, I, null), t(this,
|
|
382
|
+
}), p(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const l =
|
|
385
|
+
const h = a.querySelector(".ng-part-body table");
|
|
386
|
+
if (!h) return;
|
|
387
|
+
const l = h.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
390
|
-
t(this,
|
|
390
|
+
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
t(this, Bt).call(this,
|
|
392
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (i) {
|
|
394
|
+
t(this, Bt).call(this, i), t(this, Et).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
const a = /* @__PURE__ */
|
|
396
|
+
const a = /* @__PURE__ */ c((h) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
|
-
const l =
|
|
400
|
-
|
|
399
|
+
const l = h.scrollTop, f = h.scrollLeft;
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
403
|
-
|
|
404
|
-
a(
|
|
402
|
+
[i, e, s].forEach((h) => {
|
|
403
|
+
h && h.addEventListener("scroll", () => {
|
|
404
|
+
a(h);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Ot, /* @__PURE__ */
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
410
410
|
W.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const n =
|
|
413
|
+
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!r) return;
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
|
-
s.forEach((
|
|
419
|
-
o.appendChild(
|
|
418
|
+
s.forEach((h) => {
|
|
419
|
+
o.appendChild(h.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) :
|
|
421
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this, Bt, /* @__PURE__ */
|
|
423
|
+
d(this, Bt, /* @__PURE__ */ c((i) => {
|
|
424
424
|
if (W.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
425
|
return t(this, I);
|
|
426
426
|
W.log("#measureAndCacheHeight");
|
|
427
|
-
const e = t(this,
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) return 24;
|
|
429
|
-
const s =
|
|
429
|
+
const s = i.querySelector("tbody.bindable-tbody");
|
|
430
430
|
if (!s) return 24;
|
|
431
431
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
|
-
const
|
|
432
|
+
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
433
|
e.forEach((g) => {
|
|
434
434
|
n.appendChild(g.cloneNode(!0));
|
|
435
|
-
}),
|
|
436
|
-
const o = t(this, S), a = o.style.display,
|
|
435
|
+
}), r ? r.before(n) : s.appendChild(n);
|
|
436
|
+
const o = t(this, S), a = o.style.display, h = o.style.visibility, l = o.style.position;
|
|
437
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
438
|
let f = 0;
|
|
439
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
440
|
return u.forEach((g) => {
|
|
441
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility =
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = h, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this, At).call(this), t(this, I);
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
|
-
d(this, St, /* @__PURE__ */
|
|
444
|
+
d(this, St, /* @__PURE__ */ c(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
-
const e = (t(this,
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
447
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
448
448
|
const o = t(this, S).querySelector(n);
|
|
449
449
|
if (!o) return;
|
|
450
450
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
451
|
-
a && (a.style.height = `${
|
|
451
|
+
a && (a.style.height = `${r}px`);
|
|
452
452
|
});
|
|
453
453
|
}, "#updateVirtualScrollHeight"));
|
|
454
|
-
d(this,
|
|
454
|
+
d(this, At, /* @__PURE__ */ c(() => {
|
|
455
455
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
|
-
const
|
|
457
|
-
p(this, wt,
|
|
456
|
+
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
+
p(this, wt, i + t(this, Wt));
|
|
458
458
|
}
|
|
459
459
|
}, "#updateRowCount"));
|
|
460
|
-
d(this,
|
|
461
|
-
var a,
|
|
462
|
-
const
|
|
460
|
+
d(this, zt, /* @__PURE__ */ c(() => {
|
|
461
|
+
var a, h, l, f, u, g;
|
|
462
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
463
463
|
if (e) {
|
|
464
|
-
const b =
|
|
465
|
-
for (let v = 0; v <
|
|
464
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(b.length, m.length, x.length);
|
|
465
|
+
for (let v = 0; v < A; v++) {
|
|
466
466
|
const M = [
|
|
467
467
|
((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
468
|
-
((
|
|
468
|
+
((h = m[v]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
469
469
|
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
470
|
], T = Math.max(...M);
|
|
471
471
|
T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
475
|
if (n) {
|
|
476
|
-
const b =
|
|
477
|
-
for (let v = 0; v <
|
|
476
|
+
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(b.length, m.length, x.length);
|
|
477
|
+
for (let v = 0; v < A; v++) {
|
|
478
478
|
const M = [
|
|
479
479
|
((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
480
|
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
@@ -484,54 +484,54 @@ const Ie = class Ie {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
487
|
-
d(this,
|
|
488
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((
|
|
489
|
-
for (const e of
|
|
487
|
+
d(this, Dt, /* @__PURE__ */ c(() => {
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((i) => {
|
|
489
|
+
for (const e of i) {
|
|
490
490
|
const s = e.target;
|
|
491
491
|
if (!s.classList.contains("active")) continue;
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
492
|
+
const r = e.contentRect.height;
|
|
493
|
+
if (r > 0) {
|
|
494
494
|
let n = 0;
|
|
495
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
496
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
497
|
-
const
|
|
498
|
-
t(this, tt) !==
|
|
497
|
+
const h = Math.max(r - n, 100);
|
|
498
|
+
t(this, tt) !== h && (p(this, tt, h), t(this, At).call(this), t(this, I) !== null && (t(this, Et).call(this), this.refresh()));
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
})), t(this, V).observe(t(this, S)));
|
|
502
502
|
}, "#initResizeObserver"));
|
|
503
|
-
d(this,
|
|
504
|
-
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
505
|
-
const e = t(this, S).querySelector(
|
|
506
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
507
|
-
}), t(this,
|
|
503
|
+
d(this, Et, /* @__PURE__ */ c(() => {
|
|
504
|
+
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
505
|
+
const e = t(this, S).querySelector(i);
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
507
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
508
508
|
}, "#renderAllContainers"));
|
|
509
|
-
d(this,
|
|
509
|
+
d(this, Ee, /* @__PURE__ */ c((i) => {
|
|
510
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
511
511
|
var l;
|
|
512
512
|
const s = t(this, S).querySelector(e);
|
|
513
513
|
if (!s) return;
|
|
514
|
-
const
|
|
515
|
-
if (!
|
|
516
|
-
const n = Array.from(
|
|
514
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
|
+
if (!r) return;
|
|
516
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, h = (t(this, P).data.get() || []).length;
|
|
517
517
|
n.forEach((f, u) => {
|
|
518
|
-
const g =
|
|
519
|
-
if (g >=
|
|
518
|
+
const g = i + Math.floor(u / o);
|
|
519
|
+
if (g >= h) {
|
|
520
520
|
f.style.display = "none";
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
const b = t(this,
|
|
524
|
-
f.style.display = "", t(this,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this, lt, /* @__PURE__ */
|
|
528
|
+
d(this, lt, /* @__PURE__ */ c((i) => {
|
|
529
529
|
var f, u;
|
|
530
530
|
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this,
|
|
532
|
+
const s = t(this, P).data.length;
|
|
533
533
|
if (s === 0) return;
|
|
534
|
-
const
|
|
534
|
+
const r = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), o = Math.min(n, Math.max(0, Math.floor(i / e))), a = Math.floor(o * e), h = t(this, Q).firstTr, l = h && h.dataset.row !== void 0 ? parseInt(h.dataset.row, 10) : -1;
|
|
535
535
|
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
536
|
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
537
|
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
@@ -539,14 +539,14 @@ const Ie = class Ie {
|
|
|
539
539
|
if (!b) return;
|
|
540
540
|
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
541
|
if (!m) return;
|
|
542
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
543
|
-
const M = o + Math.floor(v /
|
|
542
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((A, v) => {
|
|
543
|
+
const M = o + Math.floor(v / r);
|
|
544
544
|
if (M >= s) {
|
|
545
|
-
|
|
545
|
+
A.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
const T = t(this,
|
|
549
|
-
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
|
+
A.style.display = "", t(this, Rt).call(this, A, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,67 +564,67 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const o = Array.from(
|
|
567
|
+
d(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
568
|
+
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
569
|
+
r.dataset.row = s;
|
|
570
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
571
571
|
o && typeof o.refresh == "function" && o.refresh();
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
|
-
d(this,
|
|
575
|
-
var
|
|
574
|
+
d(this, Pt, /* @__PURE__ */ c(() => {
|
|
575
|
+
var h, l, f;
|
|
576
576
|
W.log("rowManager.#syncHeaderHeights");
|
|
577
|
-
const
|
|
577
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
578
578
|
if (!e) return;
|
|
579
|
-
const
|
|
579
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
580
580
|
for (let u = 0; u < a; u++) {
|
|
581
581
|
const g = [
|
|
582
|
-
((
|
|
582
|
+
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
583
583
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
584
584
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
585
585
|
], b = Math.max(...g);
|
|
586
|
-
b > 0 && (
|
|
586
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
587
587
|
}
|
|
588
588
|
}, "#syncHeaderHeights"));
|
|
589
|
-
|
|
589
|
+
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
590
590
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
591
591
|
}, "destroy"));
|
|
592
|
-
p(this,
|
|
592
|
+
p(this, P, i.getRootNode().host), p(this, S, i), t(this, Dt).call(this);
|
|
593
593
|
}
|
|
594
594
|
getRowHeight() {
|
|
595
595
|
return t(this, I);
|
|
596
596
|
}
|
|
597
|
-
templateLength(
|
|
597
|
+
templateLength(i = ".ng-container-body") {
|
|
598
598
|
var e;
|
|
599
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), c(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
606
606
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
607
607
|
*/
|
|
608
|
-
static compileAll(
|
|
609
|
-
return Array.isArray(
|
|
608
|
+
static compileAll(i) {
|
|
609
|
+
return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
612
612
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
613
613
|
*/
|
|
614
|
-
static compile(
|
|
615
|
-
if (!
|
|
616
|
-
const e = /* @__PURE__ */
|
|
614
|
+
static compile(i) {
|
|
615
|
+
if (!i) return null;
|
|
616
|
+
const e = /* @__PURE__ */ c((a) => {
|
|
617
617
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
618
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
619
619
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
620
620
|
let u = `cell-${f}`;
|
|
621
621
|
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
622
|
-
let
|
|
623
|
-
g &&
|
|
622
|
+
let A = [];
|
|
623
|
+
g && A.push(`data-bind="${g}"`), b && A.push(`data-expr="${b}"`), m && A.push(`maxbyte="${m}"`), x && A.push(`type="${x}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
624
624
|
});
|
|
625
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
625
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((a) => {
|
|
626
626
|
if (!a.querySelector("colgroup")) {
|
|
627
|
-
const
|
|
627
|
+
const h = a.querySelector("tbody tr") || a.querySelector("tr"), l = h ? h.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
628
628
|
for (let g = 0; g < l; g++) {
|
|
629
629
|
const b = document.createElement("col");
|
|
630
630
|
b.setAttribute("width", u), f.appendChild(b);
|
|
@@ -632,12 +632,12 @@ const jt = class jt {
|
|
|
632
632
|
a.prepend(f);
|
|
633
633
|
}
|
|
634
634
|
if (!a.querySelector("thead")) {
|
|
635
|
-
const
|
|
636
|
-
l ? l.after(
|
|
635
|
+
const h = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
636
|
+
l ? l.after(h) : a.prepend(h);
|
|
637
637
|
}
|
|
638
638
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
639
|
-
}, "ensureTableStructure"),
|
|
640
|
-
const l = Array.from(a.querySelectorAll(
|
|
639
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((a, h) => {
|
|
640
|
+
const l = Array.from(a.querySelectorAll(h + " tr")), f = Array.from(a.querySelectorAll(h + " th," + h + " td")), u = l.length;
|
|
641
641
|
if (u === 0 || f.length === 0) return;
|
|
642
642
|
let g = 0;
|
|
643
643
|
f.forEach((m) => {
|
|
@@ -646,39 +646,39 @@ const jt = class jt {
|
|
|
646
646
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
647
647
|
l.forEach((m) => {
|
|
648
648
|
const x = m.sectionRowIndex;
|
|
649
|
-
let
|
|
649
|
+
let A = 0;
|
|
650
650
|
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
651
651
|
for (let B = 0; B < b[x].length; B++)
|
|
652
652
|
if (b[x][B] === null) {
|
|
653
|
-
|
|
653
|
+
A = B;
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
const M = v.rowSpan || 1, T = v.colSpan || 1;
|
|
657
657
|
for (let B = 0; B < M; B++)
|
|
658
658
|
for (let pt = 0; pt < T; pt++)
|
|
659
|
-
x + B < u &&
|
|
659
|
+
x + B < u && A + pt < g && (b[x + B][A + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
662
662
|
const x = m.sectionRowIndex;
|
|
663
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
663
|
+
Array.from(m.querySelectorAll("th,td")).forEach((A) => {
|
|
664
664
|
for (let v = 0; v < b[x].length; v++)
|
|
665
665
|
if (b[x][v] === "1") {
|
|
666
|
-
|
|
666
|
+
A.dataset.col = v, b[x][v] = "0";
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
670
|
});
|
|
671
|
-
}, "resetColIndex"), n =
|
|
672
|
-
return s(n), e(n),
|
|
671
|
+
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
672
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, h) => {
|
|
673
673
|
const l = a.getAttribute("fixed");
|
|
674
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
674
|
+
l && n.querySelectorAll(`thead [data-col="${h}"], tbody [data-col="${h}"], tfoot [data-col="${h}"]`).forEach((f) => {
|
|
675
675
|
f.setAttribute("fixed", l);
|
|
676
676
|
});
|
|
677
677
|
}), n;
|
|
678
678
|
}
|
|
679
679
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
680
680
|
};
|
|
681
|
-
|
|
681
|
+
c(jt, "TableCompiler");
|
|
682
682
|
let he = jt;
|
|
683
683
|
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
684
684
|
const yt = class yt extends HTMLElement {
|
|
@@ -687,49 +687,44 @@ const yt = class yt extends HTMLElement {
|
|
|
687
687
|
d(this, Ft);
|
|
688
688
|
d(this, et, null);
|
|
689
689
|
d(this, st);
|
|
690
|
-
|
|
690
|
+
E(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
691
691
|
t(this, st).refresh();
|
|
692
692
|
}, "invalidate"));
|
|
693
|
-
d(this, Vt, /* @__PURE__ */
|
|
693
|
+
d(this, Vt, /* @__PURE__ */ c(() => {
|
|
694
694
|
[
|
|
695
695
|
{ selector: ".ng-container-body", type: null },
|
|
696
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
697
697
|
{ selector: ".ng-container-right", type: "right" }
|
|
698
|
-
].forEach(({ selector: s, type:
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
n.querySelector(".ng-part-header").appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
702
|
-
const a = n.querySelector(".ng-part-body"), c = n.querySelector(".ng-scroll-content");
|
|
703
|
-
c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
704
|
-
const l = document.createElement("div");
|
|
705
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c), n.querySelector(".ng-part-footer").appendChild(t(this, ct).call(this, t(this, et), i, "footer"));
|
|
698
|
+
].forEach(({ selector: s, type: r }) => {
|
|
699
|
+
var n, o, a;
|
|
700
|
+
this.querySelector(`${s} .ng-part-header`), (n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (o = this.querySelector(`${s} .ng-scroll-content`)) == null || o.insertBefore(t(this, ct).call(this, t(this, et), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
706
701
|
});
|
|
707
702
|
}, "#renderSplitContainers"));
|
|
708
|
-
d(this, Yt, /* @__PURE__ */
|
|
703
|
+
d(this, Yt, /* @__PURE__ */ c(() => {
|
|
709
704
|
["left", "right", "body"].forEach((e) => {
|
|
710
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
711
|
-
if (!s || !
|
|
705
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
706
|
+
if (!s || !r || r.length === 0) return;
|
|
712
707
|
let n = 0;
|
|
713
|
-
|
|
708
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
714
709
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
715
710
|
isNaN(n) || (n += a);
|
|
716
711
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
717
712
|
});
|
|
718
713
|
}, "#updateContainerWidths"));
|
|
719
|
-
|
|
714
|
+
E(this, "generate", /* @__PURE__ */ c((e) => {
|
|
720
715
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
721
716
|
var s;
|
|
722
717
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
723
718
|
}, 0));
|
|
724
719
|
}, "generate"));
|
|
725
|
-
d(this, ct, /* @__PURE__ */
|
|
726
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
727
|
-
if (
|
|
728
|
-
if (a && a.remove(),
|
|
720
|
+
d(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
721
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), h = n.querySelector("tfoot");
|
|
722
|
+
if (r === "header") {
|
|
723
|
+
if (a && a.remove(), h && h.remove(), e.querySelector("tbody")) {
|
|
729
724
|
const f = document.createElement("tbody");
|
|
730
725
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
731
726
|
}
|
|
732
|
-
} else
|
|
727
|
+
} else r === "body" ? (o && o.remove(), h && h.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
733
728
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
734
729
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
735
730
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -738,19 +733,19 @@ const yt = class yt extends HTMLElement {
|
|
|
738
733
|
l.remove();
|
|
739
734
|
}), n;
|
|
740
735
|
}, "#createSplitTable"));
|
|
741
|
-
|
|
742
|
-
|
|
736
|
+
E(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
737
|
+
E(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
743
738
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
739
|
s && (s.scrollLeft = e);
|
|
745
740
|
}, "scrollToX"));
|
|
746
|
-
|
|
741
|
+
E(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
747
742
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
748
743
|
s && (s.scrollTop = e);
|
|
749
744
|
}, "scrollToY"));
|
|
750
|
-
d(this, Ut, /* @__PURE__ */
|
|
745
|
+
d(this, Ut, /* @__PURE__ */ c(() => {
|
|
751
746
|
t(this, Xt).call(this);
|
|
752
747
|
}, "#init"));
|
|
753
|
-
d(this, Xt, /* @__PURE__ */
|
|
748
|
+
d(this, Xt, /* @__PURE__ */ c(() => {
|
|
754
749
|
const e = yt.SCROLLBAR_SIZE;
|
|
755
750
|
this.innerHTML = `
|
|
756
751
|
<style>
|
|
@@ -888,8 +883,13 @@ const yt = class yt extends HTMLElement {
|
|
|
888
883
|
}
|
|
889
884
|
|
|
890
885
|
.ng-scroll-content {
|
|
891
|
-
position:
|
|
886
|
+
position: relative;
|
|
887
|
+
width: 100%;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.ng-virtual-spacer {
|
|
892
891
|
width: 100%;
|
|
892
|
+
pointer-events: none;
|
|
893
893
|
}
|
|
894
894
|
</style>
|
|
895
895
|
|
|
@@ -897,21 +897,27 @@ const yt = class yt extends HTMLElement {
|
|
|
897
897
|
<div class='ng-container-left'>
|
|
898
898
|
<div class="ng-part-header"></div>
|
|
899
899
|
<div class="ng-part-body">
|
|
900
|
-
<div class="ng-scroll-content"
|
|
900
|
+
<div class="ng-scroll-content">
|
|
901
|
+
<div class="ng-virtual-spacer"></div>
|
|
902
|
+
</div>
|
|
901
903
|
</div>
|
|
902
904
|
<div class="ng-part-footer"></div>
|
|
903
905
|
</div>
|
|
904
906
|
<div class='ng-container-body'>
|
|
905
907
|
<div class="ng-part-header"></div>
|
|
906
908
|
<div class="ng-part-body">
|
|
907
|
-
<div class="ng-scroll-content"
|
|
909
|
+
<div class="ng-scroll-content">
|
|
910
|
+
<div class="ng-virtual-spacer"></div>
|
|
911
|
+
</div>
|
|
908
912
|
</div>
|
|
909
913
|
<div class="ng-part-footer"></div>
|
|
910
914
|
</div>
|
|
911
915
|
<div class='ng-container-right'>
|
|
912
916
|
<div class="ng-part-header"></div>
|
|
913
917
|
<div class="ng-part-body">
|
|
914
|
-
<div class="ng-scroll-content"
|
|
918
|
+
<div class="ng-scroll-content">
|
|
919
|
+
<div class="ng-virtual-spacer"></div>
|
|
920
|
+
</div>
|
|
915
921
|
</div>
|
|
916
922
|
<div class="ng-part-footer"></div>
|
|
917
923
|
</div>
|
|
@@ -932,36 +938,36 @@ const yt = class yt extends HTMLElement {
|
|
|
932
938
|
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
933
939
|
}
|
|
934
940
|
};
|
|
935
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(),
|
|
941
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(yt, "NineTableSheet"), E(yt, "SCROLLBAR_SIZE", 16);
|
|
936
942
|
let $t = yt;
|
|
937
943
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
938
|
-
var Kt,
|
|
944
|
+
var Kt, qt;
|
|
939
945
|
const _e = class _e extends HTMLElement {
|
|
940
946
|
constructor() {
|
|
941
947
|
super();
|
|
942
|
-
d(this, Kt, /* @__PURE__ */
|
|
948
|
+
d(this, Kt, /* @__PURE__ */ c(() => {
|
|
943
949
|
var e;
|
|
944
950
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
945
951
|
var o;
|
|
946
|
-
const
|
|
947
|
-
t(this,
|
|
948
|
-
}), t(this,
|
|
952
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
953
|
+
t(this, qt).call(this, n, r);
|
|
954
|
+
}), t(this, qt).call(this, 0, !1);
|
|
949
955
|
}, "#init"));
|
|
950
|
-
d(this,
|
|
951
|
-
const
|
|
956
|
+
d(this, qt, /* @__PURE__ */ c((e, s = !1) => {
|
|
957
|
+
const r = /* @__PURE__ */ c(() => {
|
|
952
958
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
953
959
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
954
960
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
955
961
|
g.length < 2 || g.forEach((b) => {
|
|
956
|
-
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
957
|
-
x &&
|
|
962
|
+
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`), A = f[m + 1];
|
|
963
|
+
x && A && A.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
958
964
|
});
|
|
959
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
965
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
960
966
|
if (!a[e]) return;
|
|
961
967
|
if (!s)
|
|
962
968
|
a.forEach((f, u) => {
|
|
963
969
|
f.classList.toggle("active", u === e);
|
|
964
|
-
}),
|
|
970
|
+
}), h.forEach((f, u) => {
|
|
965
971
|
const g = u === e;
|
|
966
972
|
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
967
973
|
});
|
|
@@ -976,38 +982,38 @@ const _e = class _e extends HTMLElement {
|
|
|
976
982
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
977
983
|
l == null || l.forEach((f) => {
|
|
978
984
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
979
|
-
}),
|
|
985
|
+
}), r();
|
|
980
986
|
}, "#switchSheet"));
|
|
981
987
|
}
|
|
982
988
|
connectedCallback() {
|
|
983
989
|
t(this, Kt).call(this);
|
|
984
990
|
}
|
|
985
991
|
};
|
|
986
|
-
Kt = new WeakMap(),
|
|
992
|
+
Kt = new WeakMap(), qt = new WeakMap(), c(_e, "NineTableSheets");
|
|
987
993
|
let de = _e;
|
|
988
994
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
989
995
|
var H, Zt, Tt, Gt;
|
|
990
996
|
const Ne = class Ne {
|
|
991
|
-
constructor(
|
|
997
|
+
constructor(i) {
|
|
992
998
|
d(this, H);
|
|
993
|
-
d(this, Zt, /* @__PURE__ */
|
|
994
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
995
|
-
for (let e of
|
|
999
|
+
d(this, Zt, /* @__PURE__ */ c(() => {
|
|
1000
|
+
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1001
|
+
for (let e of i)
|
|
996
1002
|
t(this, H).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
997
1003
|
}).observe(t(this, H));
|
|
998
1004
|
}, "#init"));
|
|
999
|
-
d(this, Tt, /* @__PURE__ */
|
|
1000
|
-
var
|
|
1001
|
-
const
|
|
1002
|
-
if (
|
|
1003
|
-
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
1005
|
+
d(this, Tt, /* @__PURE__ */ c(() => {
|
|
1006
|
+
var h, l;
|
|
1007
|
+
const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1008
|
+
if (i.length === 0) return;
|
|
1009
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (h = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1004
1010
|
t(this, H).style.height = `${a}px`;
|
|
1005
1011
|
}, "#applyAutoHeight"));
|
|
1006
|
-
d(this, Gt, /* @__PURE__ */
|
|
1007
|
-
const e = Array.from(t(this, H).children).filter((
|
|
1008
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l <
|
|
1012
|
+
d(this, Gt, /* @__PURE__ */ c(() => {
|
|
1013
|
+
const e = Array.from(t(this, H).children).filter((h) => h.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((h, l) => {
|
|
1014
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1009
1015
|
return u + g;
|
|
1010
|
-
}).join(""), o = e.map((
|
|
1016
|
+
}).join(""), o = e.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1011
1017
|
t(this, H).shadowRoot.innerHTML = `
|
|
1012
1018
|
<style>
|
|
1013
1019
|
:host {
|
|
@@ -1117,76 +1123,76 @@ const Ne = class Ne {
|
|
|
1117
1123
|
<nine-table-footer></nine-table-footer>
|
|
1118
1124
|
`, t(this, H).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1119
1125
|
const a = t(this, H).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1120
|
-
a == null || a.forEach((
|
|
1126
|
+
a == null || a.forEach((h, l) => {
|
|
1121
1127
|
e[l] && setTimeout(() => {
|
|
1122
|
-
|
|
1128
|
+
h.generate(e[l]), s && t(this, Tt).call(this);
|
|
1123
1129
|
});
|
|
1124
1130
|
});
|
|
1125
1131
|
}, "#render"));
|
|
1126
|
-
p(this, H,
|
|
1132
|
+
p(this, H, i), t(this, Zt).call(this);
|
|
1127
1133
|
}
|
|
1128
1134
|
};
|
|
1129
|
-
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(),
|
|
1135
|
+
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
1130
1136
|
let fe = Ne;
|
|
1131
1137
|
var kt, ht;
|
|
1132
1138
|
const We = class We {
|
|
1133
|
-
constructor(
|
|
1139
|
+
constructor(i) {
|
|
1134
1140
|
d(this, kt);
|
|
1135
1141
|
d(this, ht, -1);
|
|
1136
|
-
|
|
1137
|
-
p(this, kt,
|
|
1142
|
+
E(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1143
|
+
p(this, kt, i);
|
|
1138
1144
|
}
|
|
1139
1145
|
get at() {
|
|
1140
1146
|
return t(this, ht);
|
|
1141
1147
|
}
|
|
1142
|
-
set at(
|
|
1143
|
-
p(this, ht, parseInt(
|
|
1148
|
+
set at(i) {
|
|
1149
|
+
p(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1144
1150
|
});
|
|
1145
1151
|
}
|
|
1146
1152
|
};
|
|
1147
|
-
kt = new WeakMap(), ht = new WeakMap(),
|
|
1153
|
+
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1148
1154
|
let ue = We;
|
|
1149
|
-
var _, k, N, dt, Jt, Y, Qt,
|
|
1155
|
+
var _, k, N, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1150
1156
|
const O = class O {
|
|
1151
|
-
constructor(
|
|
1157
|
+
constructor(i, e) {
|
|
1152
1158
|
d(this, _);
|
|
1153
1159
|
d(this, k);
|
|
1154
1160
|
d(this, N, []);
|
|
1155
1161
|
d(this, dt, []);
|
|
1156
1162
|
d(this, Jt, 0);
|
|
1157
1163
|
d(this, Y, []);
|
|
1158
|
-
d(this, Qt, /* @__PURE__ */
|
|
1164
|
+
d(this, Qt, /* @__PURE__ */ c(() => {
|
|
1159
1165
|
p(this, Y, []);
|
|
1160
|
-
const
|
|
1161
|
-
Array.from(
|
|
1166
|
+
const i = t(this, _).template || [];
|
|
1167
|
+
Array.from(i).forEach((e) => {
|
|
1162
1168
|
var s;
|
|
1163
1169
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1164
1170
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1165
1171
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1166
1172
|
});
|
|
1167
1173
|
}, "#initialize"));
|
|
1168
|
-
d(this,
|
|
1169
|
-
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1170
|
-
|
|
1174
|
+
d(this, it, /* @__PURE__ */ c(() => {
|
|
1175
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1176
|
+
i.invalidate();
|
|
1171
1177
|
});
|
|
1172
1178
|
}, "#invalidate"));
|
|
1173
|
-
|
|
1179
|
+
E(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1174
1180
|
var n;
|
|
1175
1181
|
const s = this.getValidData();
|
|
1176
1182
|
if (!s || s.length <= 0) return;
|
|
1177
|
-
if (
|
|
1178
|
-
if (
|
|
1179
|
-
const
|
|
1183
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1184
|
+
if (i < 0 || i >= s.length) return null;
|
|
1185
|
+
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1180
1186
|
if (e != null) {
|
|
1181
|
-
const o =
|
|
1182
|
-
return o >= 0 ? s[
|
|
1187
|
+
const o = r.indexOf(e);
|
|
1188
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1183
1189
|
}
|
|
1184
|
-
return t(this, ft).call(this, s[
|
|
1190
|
+
return t(this, ft).call(this, s[i]);
|
|
1185
1191
|
}, "get"));
|
|
1186
|
-
|
|
1187
|
-
this.clear(), this.add(
|
|
1192
|
+
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1193
|
+
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1188
1194
|
}, "set"));
|
|
1189
|
-
d(this, Ct, /* @__PURE__ */
|
|
1195
|
+
d(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1190
1196
|
rowState: O.ROW_STATE.EMPTY,
|
|
1191
1197
|
deleted: !1,
|
|
1192
1198
|
filtered: !1,
|
|
@@ -1195,85 +1201,85 @@ const O = class O {
|
|
|
1195
1201
|
c: {},
|
|
1196
1202
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1197
1203
|
}), "#getDefaultMeta"));
|
|
1198
|
-
|
|
1199
|
-
p(this, N, []), p(this, dt, []), t(this,
|
|
1204
|
+
E(this, "reset", /* @__PURE__ */ c(() => {
|
|
1205
|
+
p(this, N, []), p(this, dt, []), t(this, it).call(this);
|
|
1200
1206
|
}, "reset"));
|
|
1201
|
-
|
|
1202
|
-
var r;
|
|
1203
|
-
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1204
|
-
}, "clear"));
|
|
1205
|
-
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1207
|
+
E(this, "clear", /* @__PURE__ */ c(() => {
|
|
1206
1208
|
var i;
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1209
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1210
|
+
}, "clear"));
|
|
1211
|
+
d(this, te, /* @__PURE__ */ c((i) => {
|
|
1212
|
+
var r;
|
|
1213
|
+
Array.isArray(i) || (i = [i]);
|
|
1214
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1215
|
+
return i.forEach((n) => {
|
|
1210
1216
|
const o = { v: [] };
|
|
1211
1217
|
e.forEach((a) => {
|
|
1212
1218
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1213
1219
|
}), s.push(o);
|
|
1214
1220
|
}), s;
|
|
1215
1221
|
}, "#json2Array"));
|
|
1216
|
-
d(this, ee, /* @__PURE__ */
|
|
1222
|
+
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1217
1223
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1218
|
-
}),
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
const s = t(this, te).call(this,
|
|
1224
|
+
}), i), "#defaultInsert"));
|
|
1225
|
+
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1226
|
+
i === void 0 && (i = {});
|
|
1227
|
+
const s = t(this, te).call(this, i);
|
|
1222
1228
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1223
|
-
const
|
|
1229
|
+
const r = this.count() - 1;
|
|
1224
1230
|
return e || s.forEach((n, o) => {
|
|
1225
|
-
const a = t(this, k).rawRecords[
|
|
1231
|
+
const a = t(this, k).rawRecords[r - o];
|
|
1226
1232
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1227
|
-
}), t(this,
|
|
1233
|
+
}), t(this, it).call(this), r;
|
|
1228
1234
|
}, "add"));
|
|
1229
|
-
|
|
1235
|
+
E(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1230
1236
|
let e = [];
|
|
1231
|
-
Array.isArray(
|
|
1237
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1232
1238
|
if (t(this, N)[s]) {
|
|
1233
|
-
const
|
|
1234
|
-
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1235
|
-
n.__ng.rowid ===
|
|
1239
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1240
|
+
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1241
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1236
1242
|
});
|
|
1237
1243
|
}
|
|
1238
|
-
}), this.resetRecords(), t(this,
|
|
1244
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1239
1245
|
}, "delete"));
|
|
1240
|
-
|
|
1241
|
-
var
|
|
1242
|
-
|
|
1243
|
-
const n = (typeof ((
|
|
1246
|
+
E(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1247
|
+
var h;
|
|
1248
|
+
i = parseInt(i, 10);
|
|
1249
|
+
const n = (typeof ((h = t(this, _).fields) == null ? void 0 : h.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1244
1250
|
if (n < 0) return;
|
|
1245
|
-
const o = this.getValidData()[
|
|
1251
|
+
const o = this.getValidData()[i];
|
|
1246
1252
|
if (!o) return;
|
|
1247
1253
|
const a = o.v[n];
|
|
1248
1254
|
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1249
1255
|
}, "setValue"));
|
|
1250
|
-
|
|
1251
|
-
p(this, dt, t(this, k).rawRecords.filter((
|
|
1252
|
-
|
|
1253
|
-
}), t(this, N).forEach((
|
|
1254
|
-
|
|
1256
|
+
E(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1257
|
+
p(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), p(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1258
|
+
i.__ng.rowidx = e;
|
|
1259
|
+
}), t(this, N).forEach((i, e) => {
|
|
1260
|
+
i.__ng.i = e;
|
|
1255
1261
|
});
|
|
1256
1262
|
}, "resetRecords"));
|
|
1257
|
-
|
|
1258
|
-
d(this, ft, /* @__PURE__ */
|
|
1263
|
+
E(this, "getValidData", /* @__PURE__ */ c(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1264
|
+
d(this, ft, /* @__PURE__ */ c((i) => {
|
|
1259
1265
|
var o;
|
|
1260
|
-
if (!
|
|
1261
|
-
const e = !Array.isArray(
|
|
1262
|
-
const
|
|
1263
|
-
return
|
|
1264
|
-
|
|
1265
|
-
}),
|
|
1266
|
+
if (!i) return i;
|
|
1267
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1268
|
+
const h = {};
|
|
1269
|
+
return r.forEach((l, f) => {
|
|
1270
|
+
h[l] = a.v ? a.v[f] : a[l];
|
|
1271
|
+
}), h.__ng = a.__ng, h;
|
|
1266
1272
|
});
|
|
1267
1273
|
return e ? n[0] : n;
|
|
1268
1274
|
}, "#conv"));
|
|
1269
|
-
|
|
1270
|
-
p(this, _,
|
|
1275
|
+
E(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1276
|
+
p(this, _, i), p(this, k, e), t(this, Qt).call(this);
|
|
1271
1277
|
}
|
|
1272
1278
|
get source() {
|
|
1273
1279
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1274
1280
|
}
|
|
1275
|
-
set source(
|
|
1276
|
-
this.clear(), this.add(
|
|
1281
|
+
set source(i) {
|
|
1282
|
+
this.clear(), this.add(i, !1);
|
|
1277
1283
|
}
|
|
1278
1284
|
get nextId() {
|
|
1279
1285
|
return ++Ue(this, Jt)._;
|
|
@@ -1288,8 +1294,8 @@ const O = class O {
|
|
|
1288
1294
|
return this.length;
|
|
1289
1295
|
}
|
|
1290
1296
|
};
|
|
1291
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1292
|
-
|
|
1297
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1298
|
+
E(O, "ROW_STATE", {
|
|
1293
1299
|
EMPTY: "EMPTY",
|
|
1294
1300
|
NORMAL: "NORMAL",
|
|
1295
1301
|
INSERT: "INSERT",
|
|
@@ -1297,56 +1303,56 @@ A(O, "ROW_STATE", {
|
|
|
1297
1303
|
DELETE: "DELETE"
|
|
1298
1304
|
});
|
|
1299
1305
|
let ge = O;
|
|
1300
|
-
var
|
|
1306
|
+
var rt;
|
|
1301
1307
|
const Oe = class Oe {
|
|
1302
|
-
constructor(
|
|
1303
|
-
d(this,
|
|
1304
|
-
p(this,
|
|
1308
|
+
constructor(i) {
|
|
1309
|
+
d(this, rt);
|
|
1310
|
+
p(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1305
1311
|
var e;
|
|
1306
|
-
(e = t(this,
|
|
1312
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1307
1313
|
}, this.setDataSource = (e) => {
|
|
1308
1314
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1309
1315
|
}, this.getRowState = (e) => {
|
|
1310
|
-
var
|
|
1316
|
+
var r, n;
|
|
1311
1317
|
const s = parseInt(e, 10);
|
|
1312
1318
|
if (!(s >= this.data.count()))
|
|
1313
|
-
return (n = (
|
|
1319
|
+
return (n = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
|
|
1314
1320
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1315
1321
|
this.row.at = e;
|
|
1316
|
-
}, 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,
|
|
1317
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1322
|
+
}, 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, r) => {
|
|
1323
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1318
1324
|
}, this.setDataSource([]);
|
|
1319
1325
|
}
|
|
1320
1326
|
};
|
|
1321
|
-
|
|
1327
|
+
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1322
1328
|
let be = Oe;
|
|
1323
1329
|
var ut, L, Lt, se;
|
|
1324
1330
|
const Be = class Be {
|
|
1325
1331
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1326
|
-
constructor(
|
|
1332
|
+
constructor(i) {
|
|
1327
1333
|
d(this, ut);
|
|
1328
1334
|
d(this, L, []);
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
t(this, L).some((
|
|
1335
|
+
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1336
|
+
i.forEach((s) => {
|
|
1337
|
+
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1332
1338
|
}), t(this, Lt).call(this);
|
|
1333
1339
|
}, "add"));
|
|
1334
|
-
d(this, Lt, /* @__PURE__ */
|
|
1335
|
-
const
|
|
1340
|
+
d(this, Lt, /* @__PURE__ */ c(() => {
|
|
1341
|
+
const i = /* @__PURE__ */ new Map();
|
|
1336
1342
|
t(this, L).forEach((e) => {
|
|
1337
|
-
|
|
1338
|
-
}), p(this, L, Array.from(
|
|
1343
|
+
i.set(e.name, e.type);
|
|
1344
|
+
}), p(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), p(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);
|
|
1339
1345
|
}, "#adjust"));
|
|
1340
|
-
d(this, se, /* @__PURE__ */
|
|
1346
|
+
d(this, se, /* @__PURE__ */ c(() => {
|
|
1341
1347
|
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1342
|
-
const
|
|
1343
|
-
if (!(!
|
|
1344
|
-
for (const e of
|
|
1345
|
-
W.log(e), $("[data-bind]", e).each((s,
|
|
1346
|
-
const n =
|
|
1348
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1349
|
+
if (!(!i || i.length === 0)) {
|
|
1350
|
+
for (const e of i)
|
|
1351
|
+
W.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1352
|
+
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1347
1353
|
n && t(this, L).push({ name: n, type: o });
|
|
1348
1354
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1349
|
-
$(`[${s}]`, e).each((
|
|
1355
|
+
$(`[${s}]`, e).each((r, n) => {
|
|
1350
1356
|
var o = n.getAttribute(s);
|
|
1351
1357
|
if (o.indexOf("data.") < 0) {
|
|
1352
1358
|
const a = o.search(/[(]/g);
|
|
@@ -1359,9 +1365,9 @@ const Be = class Be {
|
|
|
1359
1365
|
}
|
|
1360
1366
|
o.split("data.").forEach((a) => {
|
|
1361
1367
|
if (a.trim() != "") {
|
|
1362
|
-
const
|
|
1368
|
+
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1363
1369
|
let l = "";
|
|
1364
|
-
|
|
1370
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1365
1371
|
}
|
|
1366
1372
|
});
|
|
1367
1373
|
});
|
|
@@ -1369,44 +1375,44 @@ const Be = class Be {
|
|
|
1369
1375
|
t(this, Lt).call(this);
|
|
1370
1376
|
}
|
|
1371
1377
|
}, "#init"));
|
|
1372
|
-
p(this, ut,
|
|
1378
|
+
p(this, ut, i), t(this, se).call(this);
|
|
1373
1379
|
}
|
|
1374
1380
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1375
1381
|
get() {
|
|
1376
|
-
return t(this, L).map((
|
|
1382
|
+
return t(this, L).map((i) => i.name);
|
|
1377
1383
|
}
|
|
1378
1384
|
// 🎯 내부 객체 통째로 얻기
|
|
1379
1385
|
getFields() {
|
|
1380
1386
|
return t(this, L);
|
|
1381
1387
|
}
|
|
1382
1388
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1383
|
-
getType(
|
|
1384
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1389
|
+
getType(i) {
|
|
1390
|
+
const e = t(this, L).find((s) => s.name === i);
|
|
1385
1391
|
return e ? e.type : "string";
|
|
1386
1392
|
}
|
|
1387
|
-
indexOf(
|
|
1388
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1393
|
+
indexOf(i) {
|
|
1394
|
+
return t(this, L).findIndex((e) => e.name === i);
|
|
1389
1395
|
}
|
|
1390
|
-
includes(
|
|
1391
|
-
return t(this, L).some((e) => e.name ===
|
|
1396
|
+
includes(i) {
|
|
1397
|
+
return t(this, L).some((e) => e.name === i);
|
|
1392
1398
|
}
|
|
1393
1399
|
};
|
|
1394
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(),
|
|
1400
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(Be, "ngFields");
|
|
1395
1401
|
let pe = Be;
|
|
1396
|
-
var nt,
|
|
1397
|
-
const
|
|
1402
|
+
var nt, ie, re;
|
|
1403
|
+
const ze = class ze extends HTMLElement {
|
|
1398
1404
|
constructor() {
|
|
1399
1405
|
super();
|
|
1400
1406
|
//#created = false;
|
|
1401
1407
|
d(this, nt);
|
|
1402
|
-
d(this,
|
|
1403
|
-
d(this,
|
|
1404
|
-
this.fields = new pe(this), p(this,
|
|
1408
|
+
d(this, ie);
|
|
1409
|
+
d(this, re, /* @__PURE__ */ c(() => {
|
|
1410
|
+
this.fields = new pe(this), p(this, ie, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1405
1411
|
}, "#init"));
|
|
1406
1412
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
1407
1413
|
}
|
|
1408
1414
|
connectedCallback() {
|
|
1409
|
-
t(this,
|
|
1415
|
+
t(this, re).call(this);
|
|
1410
1416
|
}
|
|
1411
1417
|
disconnectedCallback() {
|
|
1412
1418
|
W.log("NineTable disconnected.");
|
|
@@ -1424,8 +1430,8 @@ const Pe = class Pe extends HTMLElement {
|
|
|
1424
1430
|
return t(this, nt);
|
|
1425
1431
|
}
|
|
1426
1432
|
};
|
|
1427
|
-
nt = new WeakMap(),
|
|
1428
|
-
let ye =
|
|
1433
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(ze, "NineTable");
|
|
1434
|
+
let ye = ze;
|
|
1429
1435
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1430
1436
|
const mt = class mt extends HTMLElement {
|
|
1431
1437
|
// 👈 커스텀 스타일용 캐시 추가
|
|
@@ -1438,29 +1444,29 @@ const mt = class mt extends HTMLElement {
|
|
|
1438
1444
|
connectedCallback() {
|
|
1439
1445
|
}
|
|
1440
1446
|
};
|
|
1441
|
-
|
|
1447
|
+
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1442
1448
|
let me = mt;
|
|
1443
|
-
var C, Ht, y,
|
|
1444
|
-
const
|
|
1449
|
+
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1450
|
+
const De = class De extends me {
|
|
1445
1451
|
constructor() {
|
|
1446
1452
|
super();
|
|
1447
1453
|
d(this, C);
|
|
1448
1454
|
d(this, Ht);
|
|
1449
1455
|
d(this, y);
|
|
1450
|
-
d(this, qe);
|
|
1451
1456
|
d(this, Re);
|
|
1457
|
+
d(this, qe);
|
|
1452
1458
|
d(this, Te);
|
|
1453
1459
|
d(this, ke);
|
|
1454
|
-
|
|
1460
|
+
E(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1455
1461
|
if (t(this, y))
|
|
1456
1462
|
if (t(this, y).closest("tbody")) {
|
|
1457
|
-
const s = t(this, y).closest("tr").data,
|
|
1463
|
+
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
1458
1464
|
if (!s) return "";
|
|
1459
1465
|
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1460
1466
|
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1461
1467
|
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1462
1468
|
} else try {
|
|
1463
|
-
return this.getExprValue(t(this, y).dataset.expr, s,
|
|
1469
|
+
return this.getExprValue(t(this, y).dataset.expr, s, r, t(this, y));
|
|
1464
1470
|
} catch {
|
|
1465
1471
|
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1466
1472
|
}
|
|
@@ -1471,22 +1477,22 @@ const ze = class ze extends me {
|
|
|
1471
1477
|
} catch {
|
|
1472
1478
|
}
|
|
1473
1479
|
}, "getDisplayText"));
|
|
1474
|
-
d(this, Ce, /* @__PURE__ */
|
|
1480
|
+
d(this, Ce, /* @__PURE__ */ c(() => {
|
|
1475
1481
|
if (!(!t(this, C) || !t(this, C).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1476
1482
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1477
1483
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1478
|
-
var s = t(this, y).closest("tr"),
|
|
1484
|
+
var s = t(this, y).closest("tr"), r = [];
|
|
1479
1485
|
$("th,td", s).each((v, M) => {
|
|
1480
1486
|
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1481
|
-
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e &&
|
|
1482
|
-
}),
|
|
1487
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
|
|
1488
|
+
}), r.sort();
|
|
1483
1489
|
var n = !1;
|
|
1484
1490
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1485
|
-
for (var o of
|
|
1491
|
+
for (var o of r) {
|
|
1486
1492
|
if (o > e) break;
|
|
1487
|
-
var a = parseInt(t(this, y).dataset.row),
|
|
1493
|
+
var a = parseInt(t(this, y).dataset.row), h = a - 1, l = t(this, y).closest("tr").data, f = t(this, C).data.get(h);
|
|
1488
1494
|
t(this, y).dataset.matrixRow;
|
|
1489
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f,
|
|
1495
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, y).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1490
1496
|
if (g != b) {
|
|
1491
1497
|
n = !0;
|
|
1492
1498
|
break;
|
|
@@ -1495,17 +1501,17 @@ const ze = class ze extends me {
|
|
|
1495
1501
|
else
|
|
1496
1502
|
n = !0;
|
|
1497
1503
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1498
|
-
var m = parseInt(t(this, y).dataset.matrixRow), x = m - 1,
|
|
1499
|
-
$(
|
|
1504
|
+
var m = parseInt(t(this, y).dataset.matrixRow), x = m - 1, A = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1505
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1500
1506
|
}
|
|
1501
1507
|
}
|
|
1502
1508
|
}, "#resetSuppress"));
|
|
1503
|
-
|
|
1509
|
+
E(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1504
1510
|
if (typeof e < "u")
|
|
1505
1511
|
try {
|
|
1506
|
-
|
|
1512
|
+
r = parseInt(r);
|
|
1507
1513
|
const o = e.replace("()", "");
|
|
1508
|
-
return t(this, C)[o] ? t(this, C)[o].call(this, s,
|
|
1514
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, r, t(this, y)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1509
1515
|
} catch {
|
|
1510
1516
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1511
1517
|
}
|
|
@@ -1522,8 +1528,8 @@ const ze = class ze extends me {
|
|
|
1522
1528
|
}
|
|
1523
1529
|
set value(e) {
|
|
1524
1530
|
var s = parseInt(t(this, y).dataset.row);
|
|
1525
|
-
const
|
|
1526
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e,
|
|
1531
|
+
const r = this.getAttribute("update-row-state") != "false";
|
|
1532
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, r) : t(this, C).data.setValue(s, t(this, y).dataset.bind, e, r);
|
|
1527
1533
|
}
|
|
1528
1534
|
get row() {
|
|
1529
1535
|
return parseInt(t(this, y).dataset.row);
|
|
@@ -1536,9 +1542,9 @@ const ze = class ze extends me {
|
|
|
1536
1542
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1537
1543
|
}
|
|
1538
1544
|
};
|
|
1539
|
-
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(),
|
|
1540
|
-
let ve =
|
|
1541
|
-
const
|
|
1545
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), c(De, "CellElement");
|
|
1546
|
+
let ve = De;
|
|
1547
|
+
const Pe = class Pe extends ve {
|
|
1542
1548
|
constructor() {
|
|
1543
1549
|
super();
|
|
1544
1550
|
}
|
|
@@ -1549,8 +1555,8 @@ const De = class De extends ve {
|
|
|
1549
1555
|
return super.refresh();
|
|
1550
1556
|
}
|
|
1551
1557
|
};
|
|
1552
|
-
|
|
1553
|
-
let xe =
|
|
1558
|
+
c(Pe, "EditableCellElement");
|
|
1559
|
+
let xe = Pe;
|
|
1554
1560
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1555
1561
|
const je = class je extends xe {
|
|
1556
1562
|
constructor() {
|
|
@@ -1561,7 +1567,7 @@ const je = class je extends xe {
|
|
|
1561
1567
|
d(this, bt);
|
|
1562
1568
|
d(this, ne);
|
|
1563
1569
|
d(this, U);
|
|
1564
|
-
|
|
1570
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1565
1571
|
const e = super.refresh();
|
|
1566
1572
|
t(this, Mt).value = e;
|
|
1567
1573
|
}, "refresh"));
|
|
@@ -1595,14 +1601,14 @@ const je = class je extends xe {
|
|
|
1595
1601
|
if (!v) this.reset();
|
|
1596
1602
|
};
|
|
1597
1603
|
*/
|
|
1598
|
-
d(this, Le, /* @__PURE__ */
|
|
1604
|
+
d(this, Le, /* @__PURE__ */ c((e) => {
|
|
1599
1605
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1600
1606
|
if (t(this, ot) == "number") {
|
|
1601
1607
|
let n = [];
|
|
1602
1608
|
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1603
|
-
var s = e.target.value,
|
|
1604
|
-
if (
|
|
1605
|
-
var s = s.substr(
|
|
1609
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1610
|
+
if (r >= 0) {
|
|
1611
|
+
var s = s.substr(r + 1, s.length);
|
|
1606
1612
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1607
1613
|
}
|
|
1608
1614
|
}
|
|
@@ -1623,7 +1629,7 @@ const je = class je extends xe {
|
|
|
1623
1629
|
`, super.connectedCallback(), p(this, Mt, this.querySelector("input"));
|
|
1624
1630
|
}
|
|
1625
1631
|
};
|
|
1626
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(),
|
|
1632
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1627
1633
|
let we = je;
|
|
1628
1634
|
customElements.get("cell-input-text");
|
|
1629
1635
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|